From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 00:16:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3DF6FF8D; Sun, 27 Jan 2013 00:16:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 30E8B750; Sun, 27 Jan 2013 00:16:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R0GaHB008728; Sun, 27 Jan 2013 00:16:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R0Ga9k008727; Sun, 27 Jan 2013 00:16:36 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301270016.r0R0Ga9k008727@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Jan 2013 00:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245953 - head/sys/dev/nand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 00:16:37 -0000 Author: ian Date: Sun Jan 27 00:16:36 2013 New Revision: 245953 URL: http://svnweb.freebsd.org/changeset/base/245953 Log: Add the chip used in recent GlobalScale Technologies *Plug computers Approved by: cognet (mentor) Modified: head/sys/dev/nand/nand_id.c Modified: head/sys/dev/nand/nand_id.c ============================================================================== --- head/sys/dev/nand/nand_id.c Sat Jan 26 22:08:21 2013 (r245952) +++ head/sys/dev/nand/nand_id.c Sun Jan 27 00:16:36 2013 (r245953) @@ -37,6 +37,8 @@ struct nand_params nand_ids[] = { 0x20, 0x200, 0x10, 0x20, 0 }, { { NAND_MAN_SAMSUNG, 0xd3 }, "Samsung NAND 1GiB 3,3V 8-bit", 0x400, 0x800, 0x40, 0x40, 0 }, + { { NAND_MAN_SAMSUNG, 0xdc }, "Samsung NAND 512MiB 3,3V 8-bit", + 0x200, 0x800, 0x40, 0x40, 0 }, { { NAND_MAN_HYNIX, 0x76 }, "Hynix NAND 64MiB 3,3V 8-bit", 0x40, 0x200, 0x10, 0x20, 0 }, { { NAND_MAN_HYNIX, 0xdc }, "Hynix NAND 512MiB 3,3V 8-bit", From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 00:39:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9AAC4451; Sun, 27 Jan 2013 00:39:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DDA27F4; Sun, 27 Jan 2013 00:39:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R0d3p3014772; Sun, 27 Jan 2013 00:39:03 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R0d3C1014770; Sun, 27 Jan 2013 00:39:03 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301270039.r0R0d3C1014770@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Jan 2013 00:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245954 - in head/sys/arm: conf mv mv/kirkwood X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 00:39:03 -0000 Author: ian Date: Sun Jan 27 00:39:02 2013 New Revision: 245954 URL: http://svnweb.freebsd.org/changeset/base/245954 Log: Add a default do-nothing implementation of fdt_pci_devmap() using a weak alias, so that we don't need an empty implementation of it for every Marvell platform that has no PCI. This allows the removal of the SheevaPlug-specific stub and config files, and eliminates the need to add similar stubs for future models. Marvell platforms that do expose PCI are compiled with 'device pci' which causes the real (non-weak) implementation in dev/fdt/fdt_pci.c to be used. Approved by: cognet (mentor) Deleted: head/sys/arm/mv/kirkwood/files.sheevaplug head/sys/arm/mv/kirkwood/sheevaplug.c head/sys/arm/mv/kirkwood/std.sheevaplug Modified: head/sys/arm/conf/SHEEVAPLUG head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Sun Jan 27 00:16:36 2013 (r245953) +++ head/sys/arm/conf/SHEEVAPLUG Sun Jan 27 00:39:02 2013 (r245954) @@ -5,7 +5,7 @@ # ident SHEEVAPLUG -include "../mv/kirkwood/std.sheevaplug" +include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sun Jan 27 00:16:36 2013 (r245953) +++ head/sys/arm/mv/mv_machdep.c Sun Jan 27 00:39:02 2013 (r245954) @@ -279,6 +279,25 @@ out: } /* + * Supply a default do-nothing implementation of fdt_pci_devmap() via a weak + * alias. Many Marvell platforms don't support a PCI interface, but to support + * those that do, we end up with a reference to this function below, in + * platform_devmap_init(). If "device pci" appears in the kernel config, the + * real implementation of this function in dev/fdt/fdt_pci.c overrides the weak + * alias defined here. + */ +int mv_default_fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap, + vm_offset_t io_va, vm_offset_t mem_va); +int +mv_default_fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap, + vm_offset_t io_va, vm_offset_t mem_va) +{ + + return (0); +} +__weak_reference(mv_default_fdt_pci_devmap, fdt_pci_devmap); + +/* * XXX: When device entry in devmap has pd_size smaller than section size, * system will freeze during initialization */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 01:17:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7ECE49B8; Sun, 27 Jan 2013 01:17:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 57F898D5; Sun, 27 Jan 2013 01:17:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R1HcWx026596; Sun, 27 Jan 2013 01:17:38 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R1HbIV026593; Sun, 27 Jan 2013 01:17:37 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301270117.r0R1HbIV026593@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Jan 2013 01:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245955 - in head/sys: arm/conf boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 01:17:38 -0000 Author: ian Date: Sun Jan 27 01:17:37 2013 New Revision: 245955 URL: http://svnweb.freebsd.org/changeset/base/245955 Log: Add support for the GlobalScale Technologies DreamPlug computer. This adds support for version 10, revision 01, but it should also work without changes for the 0901 model, at least until we get drivers for the two different wifi chips involved. Many users contributed to and tested the various patchsets floating around for the past year that have eventually evolved into this checkin, most notably Richard Neese who provided the bulk of the kernel config file. Approved by: cognet (mentor) Added: head/sys/arm/conf/DREAMPLUG-1001 (contents, props changed) head/sys/boot/fdt/dts/dreamplug-1001.dts (contents, props changed) head/sys/boot/fdt/dts/dreamplug-1001N.dts (contents, props changed) Added: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/DREAMPLUG-1001 Sun Jan 27 01:17:37 2013 (r245955) @@ -0,0 +1,183 @@ +# Kernel config for GlobalScale Technologies DreamPlug version 1001. +# +# This is for units that are version 10, revision 01, with NOR SPI flash. +# These units are identified with the number "1001" on the S/N label. +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ +# + +ident DREAMPLUG-1001 + +include "../mv/kirkwood/std.db88f6xxx" + +makeoptions FDT_DTS_FILE=dreamplug-1001.dts + +makeoptions MODULES_OVERRIDE="" + +options SOC_MV_KIRKWOOD + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options SOFTUPDATES +options CD9660 #ISO 9660 filesystem +options FFS #Berkeley Fast Filesystem +options MSDOSFS #MS DOS File System (FAT, FAT32) +options NULLFS #NULL filesystem +options TMPFS #Efficient memory filesystem +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options GEOM_ELI # Disk encryption. +options GEOM_LABEL # Providers labelization. +options GEOM_PART_GPT # GPT partitioning + +# Flattened Device Tree +device fdt +options FDT +options FDT_DTB_STATIC + +# Misc pseudo devices +device bpf #Required for DHCP +device faith #IPv6-to-IPv4 relaying (translation) +device firmware #firmware(9) required for USB wlan +device gif #IPv6 and IPv4 tunneling +device loop #Network loopback +device md #Memory/malloc disk +device pty #BSD-style compatibility pseudo ttys +device random #Entropy device +device tun #Packet tunnel. +device ether #Required for all ethernet devices +device vlan #802.1Q VLAN support +device wlan #802.11 WLAN support + +# cam support for umass and ahci +device scbus +device pass +device da +device cd + +# Serial ports +device uart + +# Networking +device mge # Marvell Gigabit Ethernet controller +device mii +device e1000phy + +# USB +options USB_HOST_ALIGN=32 # Align DMA to cacheline +#options USB_DEBUG # Compile in USB debug support +device usb # Basic usb support +device ehci # USB host controller +device umass # Mass storage +device uhid # Human-interface devices +device rum # Ralink Technology RT2501USB wireless NICs +device uath # Atheros AR5523 wireless NICs +device ural # Ralink Technology RT2500USB wireless NICs +device zyd # ZyDAS zb1211/zb1211b wireless NICs +device urtw # Realtek RTL8187B/L USB +device upgt # Conexant/Intersil PrismGT SoftMAC USB +device u3g # USB-based 3G modems (Option, Huawei, Sierra) + +# I2C (TWSI) +device iic +device iicbus + +# SATA +device mvs +device ahci + +# Sound +device sound +device snd_uaudio + +#crypto +device cesa # Marvell security engine +device crypto +device cryptodev + +# IPSec +device enc +options IPSEC +options IPSEC_NAT_T +options TCP_SIGNATURE #include support for RFC 2385 + +# IPFW +options IPFIREWALL +options IPFIREWALL_DEFAULT_TO_ACCEPT +options IPFIREWALL_VERBOSE +options IPFIREWALL_VERBOSE_LIMIT=100 +options IPFIREWALL_NAT +options LIBALIAS +options DUMMYNET +options IPDIVERT + +#PF +device pf +device pflog +device pfsync + +# ALTQ, required for PF +options ALTQ # Basic ALTQ support +options ALTQ_CBQ # Class Based Queueing +options ALTQ_RED # Random Early Detection +options ALTQ_RIO # RED In/Out +options ALTQ_HFSC # Hierarchical Packet Scheduler +options ALTQ_CDNR # Traffic conditioner +options ALTQ_PRIQ # Priority Queueing +options ALTQ_NOPCC # Required if the TSC is unusable +#options ALTQ_DEBUG + +# Debugging +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER +options DDB +options KDB +options DIAGNOSTIC +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options WITNESS_KDB + +# Enable these options for nfs root configured via BOOTP. +options NFSCL #Network Filesystem Client +options NFSLOCKD #Network Lock Manager +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=mge0 + +# If not using BOOTP, use something like one of these... +#options ROOTDEVNAME=\"ufs:/dev/da1a\" +options ROOTDEVNAME=\"ufs:/dev/da1s1a\" +#options ROOTDEVNAME=\"ufs:/dev/da1p10\" +#options ROOTDEVNAME=\"nfs:192.168.0.254/dreamplug\" + +# To use this configuration with the (rare) model 1001N (nand flash), +# create a kernel config file that looks like this: +# +# include DREAMPLUG-1001 +# nomakeoptions FDT_DTS_FILE +# makeoptions FDT_DTS_FILE=dreamplug-1001N.dts +# device nand + Added: head/sys/boot/fdt/dts/dreamplug-1001.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/dreamplug-1001.dts Sun Jan 27 01:17:37 2013 (r245955) @@ -0,0 +1,319 @@ +/* + * Copyright (c) 2013 Ian Lepore + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software substantially based on work developed by Semihalf + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * GlobalScale Technologies DreamPlug Device Tree Source. + * + * This source is for version 10 revision 01 units with NOR SPI flash. + * These units are marked "1001" on the serial number label. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/ { + model = "GlobalScale Technologies Dreamplug v1001"; + compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + ethernet0 = &enet0; + ethernet1 = &enet1; + mpp = &MPP; + serial0 = &serial0; + serial1 = &serial1; + soc = &SOC; + sram = &SRAM; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "ARM,88FR131"; + reg = <0x0>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x4000>; // L1, 16K + i-cache-size = <0x4000>; // L1, 16K + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + }; + + }; + + memory { + device_type = "memory"; + reg = <0x0 0x20000000>; // 512M at 0x0 + }; + + localbus@0 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "mrvl,lbc"; + bank-count = <1>; + + /* This reflects CPU decode windows setup. */ + ranges = <0x0 0x1e 0xfa000000 0x00100000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x00100000>; + bank-width = <2>; + device-width = <1>; + }; + }; + + SOC: soc88f6281@f1000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges = <0x0 0xf1000000 0x00100000>; + bus-frequency = <0>; + + PIC: pic@20200 { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x20200 0x3c>; + compatible = "mrvl,pic"; + }; + + timer@20300 { + compatible = "mrvl,timer"; + reg = <0x20300 0x30>; + interrupts = <1>; + interrupt-parent = <&PIC>; + mrvl,has-wdt; + }; + + MPP: mpp@10000 { + #pin-cells = <2>; + compatible = "mrvl,mpp"; + reg = <0x10000 0x34>; + pin-count = <50>; + pin-map = < + 0 2 /* MPP[ 0]: SPI_SCn */ + 1 2 /* MPP[ 1]: SPI_MOSI */ + 2 2 /* MPP[ 2]: SPI_SCK */ + 3 2 /* MPP[ 3]: SPI_MISO */ + 4 1 /* MPP[ 4]: NF_IO[6] */ + 5 1 /* MPP[ 5]: NF_IO[7] */ + 6 1 /* MPP[ 6]: SYSRST_OUTn */ + 7 0 /* MPP[ 7]: GPO[7] */ + 8 1 /* MPP[ 8]: TW_SDA */ + 9 1 /* MPP[ 9]: TW_SCK */ + 10 3 /* MPP[10]: UA0_TXD */ + 11 3 /* MPP[11]: US0_RXD */ + 12 1 /* MPP[12]: SD_CLK */ + 13 1 /* MPP[13]: SD_CMD */ + 14 1 /* MPP[14]: SD_D[0] */ + 15 1 /* MPP[15]: SD_D[1] */ + 16 1 /* MPP[16]: SD_D[2] */ + 17 1 /* MPP[17]: SD_D[3] */ + 18 1 /* MPP[18]: NF_IO[0] */ + 19 1 /* MPP[19]: NF_IO[1] */ + 20 3 /* MPP[20]: GE1[ 0] */ + 21 3 /* MPP[21]: GE1[ 1] */ + 22 3 /* MPP[22]: GE1[ 2] */ + 23 3 /* MPP[23]: GE1[ 3] */ + 24 3 /* MPP[24]: GE1[ 4] */ + 25 3 /* MPP[25]: GE1[ 5] */ + 26 3 /* MPP[26]: GE1[ 6] */ + 27 3 /* MPP[27]: GE1[ 7] */ + 28 3 /* MPP[28]: GE1[ 8] */ + 29 3 /* MPP[29]: GE1[ 9] */ + 30 3 /* MPP[30]: GE1[10] */ + 31 3 /* MPP[31]: GE1[11] */ + 32 3 /* MPP[32]: GE1[12] */ + 33 3 /* MPP[33]: GE1[13] */ + 34 3 /* MPP[34]: GE1[14] */ + 35 3 /* MPP[35]: GE1[15] */ + 36 0 /* MPP[36]: GPIO[36] */ + 37 0 /* MPP[37]: GPIO[37] */ + 38 0 /* MPP[38]: GPIO[38] */ + 39 0 /* MPP[39]: GPIO[39] */ + 40 2 /* MPP[40]: TDM_SPI_SCK */ + 41 2 /* MPP[41]: TDM_SPI_MISO */ + 42 2 /* MPP[42]: TDM_SPI_MOSI */ + 43 0 /* MPP[43]: GPIO[43] */ + 44 0 /* MPP[44]: GPIO[44] */ + 45 0 /* MPP[45]: GPIO[45] */ + 46 0 /* MPP[46]: GPIO[46] */ + 47 0 /* MPP[47]: GPIO[47] */ + 48 0 /* MPP[48]: GPIO[48] */ + 49 0 /* MPP[49]: GPIO[49] */ + >; + }; + + GPIO: gpio@10100 { + #gpio-cells = <3>; + compatible = "mrvl,gpio"; + reg = <0x10100 0x20>; + gpio-controller; + interrupts = <35 36 37 38 39 40 41>; + interrupt-parent = <&PIC>; + pin-count = <50>; + }; + + gpioled@0 { + compatible = "mrvl,gpioled"; + + gpios = <&GPIO 47 2 0 /* GPIO[47] BT LED: OUT */ + &GPIO 48 2 0 /* GPIO[48] WLAN LED: OUT */ + &GPIO 49 2 0>; /* GPIO[49] WLAN AP LED: OUT */ + }; + + rtc@10300 { + compatible = "mrvl,rtc"; + reg = <0x10300 0x08>; + }; + + twsi@11000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,twsi"; + reg = <0x11000 0x20>; + interrupts = <43>; + interrupt-parent = <&PIC>; + }; + + enet0: ethernet@72000 { + #address-cells = <1>; + #size-cells = <1>; + model = "V2"; + compatible = "mrvl,ge"; + reg = <0x72000 0x2000>; + ranges = <0x0 0x72000 0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <12 13 14 11 46>; + interrupt-parent = <&PIC>; + phy-handle = <&phy0>; + + mdio@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,mdio"; + + phy0: ethernet-phy@0 { + reg = <0x0>; + }; + + phy1: ethernet-phy@1 { + reg = <0x1>; + }; + }; + }; + + enet1: ethernet@76000 { + #address-cells = <1>; + #size-cells = <1>; + model = "V2"; + compatible = "mrvl,ge"; + reg = <0x76000 0x02000>; + ranges = <0x0 0x76000 0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <16 17 18 15 47>; + interrupt-parent = <&PIC>; + phy-handle = <&phy1>; + }; + + serial0: serial@12000 { + compatible = "ns16550"; + reg = <0x12000 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <33>; + interrupt-parent = <&PIC>; + }; + + serial1: serial@12100 { + compatible = "ns16550"; + reg = <0x12100 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <34>; + interrupt-parent = <&PIC>; + }; + + crypto@30000 { + compatible = "mrvl,cesa"; + reg = <0x30000 0x10000>; + interrupts = <22>; + interrupt-parent = <&PIC>; + + sram-handle = <&SRAM>; + }; + + usb@50000 { + compatible = "mrvl,usb-ehci", "usb-ehci"; + reg = <0x50000 0x1000>; + interrupts = <48 19>; + interrupt-parent = <&PIC>; + }; + + xor@60000 { + compatible = "mrvl,xor"; + reg = <0x60000 0x1000>; + interrupts = <5 6 7 8>; + interrupt-parent = <&PIC>; + }; + + sata@80000 { + compatible = "mrvl,sata"; + reg = <0x80000 0x6000>; + interrupts = <21>; + interrupt-parent = <&PIC>; + }; + + sdio@90000 { + compatible = "mrvl,sdio"; + reg = <0x90000 0x134>; + interrupts = <28>; + interrupt-parent = <&PIC>; + }; + }; + + SRAM: sram@fd000000 { + compatible = "mrvl,cesa-sram"; + reg = <0xfd000000 0x00100000>; + }; + + chosen { + stdin = "serial0"; + stdout = "serial0"; + }; + +}; Added: head/sys/boot/fdt/dts/dreamplug-1001N.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/dreamplug-1001N.dts Sun Jan 27 01:17:37 2013 (r245955) @@ -0,0 +1,340 @@ +/* + * Copyright (c) 2013 Ian Lepore + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software substantially based on work developed by Semihalf + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * GlobalScale Technologies DreamPlug Device Tree Source. + * + * This source is for version 10 revision 01 units with NAND flash. + * These units are marked "1001N" on the serial number label. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/ { + model = "GlobalScale Technologies Dreamplug v1001N"; + compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + ethernet0 = &enet0; + ethernet1 = &enet1; + mpp = &MPP; + serial0 = &serial0; + serial1 = &serial1; + soc = &SOC; + sram = &SRAM; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "ARM,88FR131"; + reg = <0x0>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x4000>; // L1, 16K + i-cache-size = <0x4000>; // L1, 16K + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + }; + + }; + + memory { + device_type = "memory"; + reg = <0x0 0x20000000>; // 512M at 0x0 + }; + + localbus@0 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "mrvl,lbc"; + bank-count = <1>; + + /* This reflects CPU decode windows setup. */ + ranges = <0x0 0x2f 0xf9300000 0x00100000>; + + nand@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "mrvl,nfc"; + reg = <0x0 0x0 0x00100000>; + bank-width = <2>; + device-width = <1>; + + // Slice info reported by builtin linux when it boots... + //[ 11.161328] 0x00000000-0x00100000 : "u-boot" + //[ 11.167431] 0x00100000-0x00500000 : "uImage" + //[ 11.173471] 0x00500000-0x20000000 : "root" + + slice@0 { + reg = <0x0 0x100000>; + label = "u-boot"; + read-only; + }; + + slice@200000 { + reg = <0x100000 0x40000>; + label = "uImage"; + }; + + slice@500000 { + reg = <0x500000 0x1FB00000>; + label = "root"; + }; + }; + }; + + SOC: soc88f6281@f1000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges = <0x0 0xf1000000 0x00100000>; + bus-frequency = <0>; + + PIC: pic@20200 { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x20200 0x3c>; + compatible = "mrvl,pic"; + }; + + timer@20300 { + compatible = "mrvl,timer"; + reg = <0x20300 0x30>; + interrupts = <1>; + interrupt-parent = <&PIC>; + mrvl,has-wdt; + }; + + MPP: mpp@10000 { + #pin-cells = <2>; + compatible = "mrvl,mpp"; + reg = <0x10000 0x34>; + pin-count = <50>; + pin-map = < + 0 1 /* MPP[ 0]: NF_IO[2] */ + 1 1 /* MPP[ 1]: NF_IO[3] */ + 2 1 /* MPP[ 2]: NF_IO[4] */ + 3 1 /* MPP[ 3]: NF_IO[5] */ + 4 1 /* MPP[ 4]: NF_IO[6] */ + 5 1 /* MPP[ 5]: NF_IO[7] */ + 6 1 /* MPP[ 6]: SYSRST_OUTn */ + 7 0 /* MPP[ 7]: GPO[7] */ + 8 1 /* MPP[ 8]: TW_SDA */ + 9 1 /* MPP[ 9]: TW_SCK */ + 10 3 /* MPP[10]: UA0_TXD */ + 11 3 /* MPP[11]: US0_RXD */ + 12 1 /* MPP[12]: SD_CLK */ + 13 1 /* MPP[13]: SD_CMD */ + 14 1 /* MPP[14]: SD_D[0] */ + 15 1 /* MPP[15]: SD_D[1] */ + 16 1 /* MPP[16]: SD_D[2] */ + 17 1 /* MPP[17]: SD_D[3] */ + 18 1 /* MPP[18]: NF_IO[0] */ + 19 1 /* MPP[19]: NF_IO[1] */ + 20 3 /* MPP[20]: GE1[ 0] */ + 21 3 /* MPP[21]: GE1[ 1] */ + 22 3 /* MPP[22]: GE1[ 2] */ + 23 3 /* MPP[23]: GE1[ 3] */ + 24 3 /* MPP[24]: GE1[ 4] */ + 25 3 /* MPP[25]: GE1[ 5] */ + 26 3 /* MPP[26]: GE1[ 6] */ + 27 3 /* MPP[27]: GE1[ 7] */ + 28 3 /* MPP[28]: GE1[ 8] */ + 29 3 /* MPP[29]: GE1[ 9] */ + 30 3 /* MPP[30]: GE1[10] */ + 31 3 /* MPP[31]: GE1[11] */ + 32 3 /* MPP[32]: GE1[12] */ + 33 3 /* MPP[33]: GE1[13] */ + 34 3 /* MPP[34]: GE1[14] */ + 35 3 /* MPP[35]: GE1[15] */ + 36 0 /* MPP[36]: GPIO[36] */ + 37 0 /* MPP[37]: GPIO[37] */ + 38 0 /* MPP[38]: GPIO[38] */ + 39 0 /* MPP[39]: GPIO[39] */ + 40 2 /* MPP[40]: TDM_SPI_SCK */ + 41 2 /* MPP[41]: TDM_SPI_MISO */ + 42 2 /* MPP[42]: TDM_SPI_MOSI */ + 43 0 /* MPP[43]: GPIO[43] */ + 44 0 /* MPP[44]: GPIO[44] */ + 45 0 /* MPP[45]: GPIO[45] */ + 46 0 /* MPP[46]: GPIO[46] */ + 47 0 /* MPP[47]: GPIO[47] */ + 48 0 /* MPP[48]: GPIO[48] */ + 49 0 /* MPP[49]: GPIO[49] */ + >; + }; + + GPIO: gpio@10100 { + #gpio-cells = <3>; + compatible = "mrvl,gpio"; + reg = <0x10100 0x20>; + gpio-controller; + interrupts = <35 36 37 38 39 40 41>; + interrupt-parent = <&PIC>; + pin-count = <50>; + }; + + gpioled@0 { + compatible = "mrvl,gpioled"; + + gpios = <&GPIO 47 2 0 /* GPIO[47] BT LED: OUT */ + &GPIO 48 2 0 /* GPIO[48] WLAN LED: OUT */ + &GPIO 49 2 0>; /* GPIO[49] WLAN AP LED: OUT */ + }; + + rtc@10300 { + compatible = "mrvl,rtc"; + reg = <0x10300 0x08>; + }; + + twsi@11000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,twsi"; + reg = <0x11000 0x20>; + interrupts = <43>; + interrupt-parent = <&PIC>; + }; + + enet0: ethernet@72000 { + #address-cells = <1>; + #size-cells = <1>; + model = "V2"; + compatible = "mrvl,ge"; + reg = <0x72000 0x2000>; + ranges = <0x0 0x72000 0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <12 13 14 11 46>; + interrupt-parent = <&PIC>; + phy-handle = <&phy0>; + + mdio@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,mdio"; + + phy0: ethernet-phy@0 { + reg = <0x0>; + }; + + phy1: ethernet-phy@1 { + reg = <0x1>; + }; + }; + }; + + enet1: ethernet@76000 { + #address-cells = <1>; + #size-cells = <1>; + model = "V2"; + compatible = "mrvl,ge"; + reg = <0x76000 0x02000>; + ranges = <0x0 0x76000 0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <16 17 18 15 47>; + interrupt-parent = <&PIC>; + phy-handle = <&phy1>; + }; + + serial0: serial@12000 { + compatible = "ns16550"; + reg = <0x12000 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <33>; + interrupt-parent = <&PIC>; + }; + + serial1: serial@12100 { + compatible = "ns16550"; + reg = <0x12100 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <34>; + interrupt-parent = <&PIC>; + }; + + crypto@30000 { + compatible = "mrvl,cesa"; + reg = <0x30000 0x10000>; + interrupts = <22>; + interrupt-parent = <&PIC>; + + sram-handle = <&SRAM>; + }; + + usb@50000 { + compatible = "mrvl,usb-ehci", "usb-ehci"; + reg = <0x50000 0x1000>; + interrupts = <48 19>; + interrupt-parent = <&PIC>; + }; + + xor@60000 { + compatible = "mrvl,xor"; + reg = <0x60000 0x1000>; + interrupts = <5 6 7 8>; + interrupt-parent = <&PIC>; + }; + + sata@80000 { + compatible = "mrvl,sata"; + reg = <0x80000 0x6000>; + interrupts = <21>; + interrupt-parent = <&PIC>; + }; + + sdio@90000 { + compatible = "mrvl,sdio"; + reg = <0x90000 0x134>; + interrupts = <28>; + interrupt-parent = <&PIC>; + }; + }; + + SRAM: sram@fd000000 { + compatible = "mrvl,cesa-sram"; + reg = <0xfd000000 0x00100000>; + }; + + chosen { + stdin = "serial0"; + stdout = "serial0"; + }; + +}; From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 03:14:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E5375636; Sun, 27 Jan 2013 03:14:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDE8ACD8; Sun, 27 Jan 2013 03:14:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R3Eslo062269; Sun, 27 Jan 2013 03:14:54 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R3EsBT062267; Sun, 27 Jan 2013 03:14:54 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301270314.r0R3EsBT062267@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 27 Jan 2013 03:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245956 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 03:14:55 -0000 Author: mjg Date: Sun Jan 27 03:14:54 2013 New Revision: 245956 URL: http://svnweb.freebsd.org/changeset/base/245956 Log: truss: if file requested with -o flag could not be opened print the reason MFC after: 3 days Modified: head/usr.bin/truss/main.c Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Sun Jan 27 01:17:37 2013 (r245955) +++ head/usr.bin/truss/main.c Sun Jan 27 03:14:54 2013 (r245956) @@ -235,7 +235,7 @@ main(int ac, char **av) if (fname != NULL) { /* Use output file */ if ((trussinfo->outfile = fopen(fname, "w")) == NULL) - errx(1, "cannot open %s", fname); + err(1, "cannot open %s", fname); /* * Set FD_CLOEXEC, so that the output file is not shared with * the traced process. From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 03:17:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0878A7CB; Sun, 27 Jan 2013 03:17:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EE4A7CF5; Sun, 27 Jan 2013 03:17:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R3HZKK062651; Sun, 27 Jan 2013 03:17:35 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R3HZcE062650; Sun, 27 Jan 2013 03:17:35 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301270317.r0R3HZcE062650@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 27 Jan 2013 03:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245957 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 03:17:36 -0000 Author: mjg Date: Sun Jan 27 03:17:35 2013 New Revision: 245957 URL: http://svnweb.freebsd.org/changeset/base/245957 Log: truss: use 'e' flag for fopen instead of fcntl(.., FD_CLOEXEC) Modified: head/usr.bin/truss/main.c Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Sun Jan 27 03:14:54 2013 (r245956) +++ head/usr.bin/truss/main.c Sun Jan 27 03:17:35 2013 (r245957) @@ -234,15 +234,12 @@ main(int ac, char **av) usage(); if (fname != NULL) { /* Use output file */ - if ((trussinfo->outfile = fopen(fname, "w")) == NULL) - err(1, "cannot open %s", fname); /* - * Set FD_CLOEXEC, so that the output file is not shared with - * the traced process. + * Set close-on-exec ('e'), so that the output file is not + * shared with the traced process. */ - if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == - -1) - warn("fcntl()"); + if ((trussinfo->outfile = fopen(fname, "we")) == NULL) + err(1, "cannot open %s", fname); } /* From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 05:59:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EAF406B5; Sun, 27 Jan 2013 05:59:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D1C66133; Sun, 27 Jan 2013 05:59:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R5xSdE010618; Sun, 27 Jan 2013 05:59:28 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R5xS8H010617; Sun, 27 Jan 2013 05:59:28 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301270559.r0R5xS8H010617@svn.freebsd.org> From: Mark Johnston Date: Sun, 27 Jan 2013 05:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245960 - head/bin/cp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 05:59:29 -0000 Author: markj Date: Sun Jan 27 05:59:28 2013 New Revision: 245960 URL: http://svnweb.freebsd.org/changeset/base/245960 Log: Return with an error from copy_link(), copy_fifo() and copy_special() if the -n option is specified and the destination file exists. PR: bin/174489 Approved by: rstone (co-mentor) MFC after: 2 weeks Modified: head/bin/cp/utils.c Modified: head/bin/cp/utils.c ============================================================================== --- head/bin/cp/utils.c Sun Jan 27 05:45:55 2013 (r245959) +++ head/bin/cp/utils.c Sun Jan 27 05:59:28 2013 (r245960) @@ -266,6 +266,11 @@ copy_link(const FTSENT *p, int exists) int len; char llink[PATH_MAX]; + if (exists && nflag) { + if (vflag) + printf("%s not overwritten\n", to.p_path); + return (1); + } if ((len = readlink(p->fts_path, llink, sizeof(llink) - 1)) == -1) { warn("readlink: %s", p->fts_path); return (1); @@ -285,6 +290,12 @@ copy_link(const FTSENT *p, int exists) int copy_fifo(struct stat *from_stat, int exists) { + + if (exists && nflag) { + if (vflag) + printf("%s not overwritten\n", to.p_path); + return (1); + } if (exists && unlink(to.p_path)) { warn("unlink: %s", to.p_path); return (1); @@ -299,6 +310,12 @@ copy_fifo(struct stat *from_stat, int ex int copy_special(struct stat *from_stat, int exists) { + + if (exists && nflag) { + if (vflag) + printf("%s not overwritten\n", to.p_path); + return (1); + } if (exists && unlink(to.p_path)) { warn("unlink: %s", to.p_path); return (1); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 06:01:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BA57389C; Sun, 27 Jan 2013 06:01:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A336914B; Sun, 27 Jan 2013 06:01:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R61ZW6012625; Sun, 27 Jan 2013 06:01:35 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R61ZiJ012624; Sun, 27 Jan 2013 06:01:35 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301270601.r0R61ZiJ012624@svn.freebsd.org> From: Mark Johnston Date: Sun, 27 Jan 2013 06:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245961 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 06:01:35 -0000 Author: markj Date: Sun Jan 27 06:01:35 2013 New Revision: 245961 URL: http://svnweb.freebsd.org/changeset/base/245961 Log: When the 'R' flag is used with a newsyslog.conf entry, some fields of the corresponding struct sigwork_entry were left uninitialized, potentially causing an early return from do_sigwork(). Ensure that these fields are initialized, and handle the 'R' flag properly in do_sigwork(). PR: bin/175330 Reviewed by: gad Approved by: rstone (co-mentor) MFC after: 1 week Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sun Jan 27 05:59:28 2013 (r245960) +++ head/usr.sbin/newsyslog/newsyslog.c Sun Jan 27 06:01:35 2013 (r245961) @@ -1866,7 +1866,7 @@ do_sigwork(struct sigwork_entry *swork) int kres, secs; char *tmp; - if (!(swork->sw_pidok) || swork->sw_pid == 0) + if (swork->run_cmd == 0 && (!(swork->sw_pidok) || swork->sw_pid == 0)) return; /* no work to do... */ /* @@ -2078,6 +2078,8 @@ save_sigwork(const struct conf_entry *en stmp->run_cmd = 0; /* If this is a command to run we just set the flag and run command */ if (ent->flags & CE_PID2CMD) { + stmp->sw_pid = -1; + stmp->sw_pidok = 0; stmp->run_cmd = 1; } else { set_swpid(stmp, ent); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 06:02:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CA7B3A1A; Sun, 27 Jan 2013 06:02:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9128159; Sun, 27 Jan 2013 06:02:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R62cIE012839; Sun, 27 Jan 2013 06:02:38 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R62c1r012837; Sun, 27 Jan 2013 06:02:38 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301270602.r0R62c1r012837@svn.freebsd.org> From: Mark Johnston Date: Sun, 27 Jan 2013 06:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245962 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 06:02:38 -0000 Author: markj Date: Sun Jan 27 06:02:38 2013 New Revision: 245962 URL: http://svnweb.freebsd.org/changeset/base/245962 Log: Ensure that newsyslog -n prints the correct message for a rotation rule that uses the 'R' flag. Reviewed by: gad Approved by: rstone (co-mentor) MFC after: 1 week Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sun Jan 27 06:01:35 2013 (r245961) +++ head/usr.sbin/newsyslog/newsyslog.c Sun Jan 27 06:02:38 2013 (r245962) @@ -1900,10 +1900,15 @@ do_sigwork(struct sigwork_entry *swork) } if (noaction) { - printf("\tkill -%d %d \t\t# %s\n", swork->sw_signum, - (int)swork->sw_pid, swork->sw_fname); - if (secs > 0) - printf("\tsleep %d\n", secs); + if (swork->run_cmd) + printf("\tsh -c '%s %d'\n", swork->sw_fname, + swork->sw_signum); + else { + printf("\tkill -%d %d \t\t# %s\n", swork->sw_signum, + (int)swork->sw_pid, swork->sw_fname); + if (secs > 0) + printf("\tsleep %d\n", secs); + } return; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 06:03:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CEB96B9B; Sun, 27 Jan 2013 06:03:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8ABD16A; Sun, 27 Jan 2013 06:03:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R63vNw013088; Sun, 27 Jan 2013 06:03:57 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R63vLv013087; Sun, 27 Jan 2013 06:03:57 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301270603.r0R63vLv013087@svn.freebsd.org> From: Mark Johnston Date: Sun, 27 Jan 2013 06:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245963 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 06:03:57 -0000 Author: markj Date: Sun Jan 27 06:03:57 2013 New Revision: 245963 URL: http://svnweb.freebsd.org/changeset/base/245963 Log: Rename the run_cmd field to sw_runcmd to make it consistent with the other fields in struct sigwork_entry. Approved by: rstone (co-mentor) MFC after: 1 week Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sun Jan 27 06:02:38 2013 (r245962) +++ head/usr.sbin/newsyslog/newsyslog.c Sun Jan 27 06:03:57 2013 (r245963) @@ -179,7 +179,7 @@ struct sigwork_entry { int sw_pidok; /* true if pid value is valid */ pid_t sw_pid; /* the process id from the PID file */ const char *sw_pidtype; /* "daemon" or "process group" */ - int run_cmd; /* run command or send PID to signal */ + int sw_runcmd; /* run command or send PID to signal */ char sw_fname[1]; /* file the PID was read from or shell cmd */ }; @@ -1866,7 +1866,7 @@ do_sigwork(struct sigwork_entry *swork) int kres, secs; char *tmp; - if (swork->run_cmd == 0 && (!(swork->sw_pidok) || swork->sw_pid == 0)) + if (swork->sw_runcmd == 0 && (!(swork->sw_pidok) || swork->sw_pid == 0)) return; /* no work to do... */ /* @@ -1900,7 +1900,7 @@ do_sigwork(struct sigwork_entry *swork) } if (noaction) { - if (swork->run_cmd) + if (swork->sw_runcmd) printf("\tsh -c '%s %d'\n", swork->sw_fname, swork->sw_signum); else { @@ -1912,7 +1912,7 @@ do_sigwork(struct sigwork_entry *swork) return; } - if (swork->run_cmd) { + if (swork->sw_runcmd) { asprintf(&tmp, "%s %d", swork->sw_fname, swork->sw_signum); if (tmp == NULL) { warn("can't allocate memory to run %s", @@ -1988,7 +1988,7 @@ do_zipwork(struct zipwork_entry *zwork) else pgm_name++; - if (zwork->zw_swork != NULL && zwork->zw_swork->run_cmd == 0 && + if (zwork->zw_swork != NULL && zwork->zw_swork->sw_runcmd == 0 && zwork->zw_swork->sw_pidok <= 0) { warnx( "log %s not compressed because daemon(s) not notified", @@ -2080,12 +2080,12 @@ save_sigwork(const struct conf_entry *en tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_cmd_file) + 1; stmp = malloc(tmpsiz); - stmp->run_cmd = 0; + stmp->sw_runcmd = 0; /* If this is a command to run we just set the flag and run command */ if (ent->flags & CE_PID2CMD) { stmp->sw_pid = -1; stmp->sw_pidok = 0; - stmp->run_cmd = 1; + stmp->sw_runcmd = 1; } else { set_swpid(stmp, ent); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 09:31:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 368A8D89; Sun, 27 Jan 2013 09:31:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1D26D833; Sun, 27 Jan 2013 09:31:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R9VB6L075579; Sun, 27 Jan 2013 09:31:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R9VBFw075578; Sun, 27 Jan 2013 09:31:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301270931.r0R9VBFw075578@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Jan 2013 09:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245976 - head/sys/dev/agp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 09:31:12 -0000 Author: kib Date: Sun Jan 27 09:31:11 2013 New Revision: 245976 URL: http://svnweb.freebsd.org/changeset/base/245976 Log: Fix reversed condition in the logic to wait for the chipset buffers flush wait on the Gen2 chipsets. Confirmed by the inspection of the Linux agp code. Submitted by: Taku YAMAMOTO MFC after: 2 weeks Modified: head/sys/dev/agp/agp_i810.c Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Sun Jan 27 07:22:46 2013 (r245975) +++ head/sys/dev/agp/agp_i810.c Sun Jan 27 09:31:11 2013 (r245976) @@ -2228,7 +2228,7 @@ agp_i830_chipset_flush(device_t dev) bus_write_4(sc->sc_res[0], AGP_I830_HIC, hic | (1 << 31)); for (i = 0; i < 20000 /* 1 sec */; i++) { hic = bus_read_4(sc->sc_res[0], AGP_I830_HIC); - if ((hic & (1 << 31)) != 0) + if ((hic & (1 << 31)) == 0) break; DELAY(50); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 09:34:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6AC88F0B; Sun, 27 Jan 2013 09:34:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D4DC847; Sun, 27 Jan 2013 09:34:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R9YQOc076059; Sun, 27 Jan 2013 09:34:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R9YQmG076058; Sun, 27 Jan 2013 09:34:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301270934.r0R9YQmG076058@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Jan 2013 09:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245977 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 09:34:26 -0000 Author: kib Date: Sun Jan 27 09:34:25 2013 New Revision: 245977 URL: http://svnweb.freebsd.org/changeset/base/245977 Log: Be conservative and do not try to consume more bytes than was requested from the server for the read operation. Server shall not reply with too large size, but client should be resilent too. Reviewed by: rmacklem MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sun Jan 27 09:31:11 2013 (r245976) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sun Jan 27 09:34:25 2013 (r245977) @@ -1444,7 +1444,7 @@ nfsrpc_readrpc(vnode_t vp, struct uio *u NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); eof = fxdr_unsigned(int, *tl); } - NFSM_STRSIZ(retlen, rsize); + NFSM_STRSIZ(retlen, len); error = nfsm_mbufuio(nd, uiop, retlen); if (error) goto nfsmout; From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 14:49:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 50E55553; Sun, 27 Jan 2013 14:49:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2B90E32B; Sun, 27 Jan 2013 14:49:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0REns42071684; Sun, 27 Jan 2013 14:49:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0REnsew071683; Sun, 27 Jan 2013 14:49:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201301271449.r0REnsew071683@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Jan 2013 14:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245980 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 14:49:55 -0000 Author: nwhitehorn Date: Sun Jan 27 14:49:54 2013 New Revision: 245980 URL: http://svnweb.freebsd.org/changeset/base/245980 Log: Properly quote argument. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Sun Jan 27 12:52:08 2013 (r245979) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Sun Jan 27 14:49:54 2013 (r245980) @@ -60,7 +60,7 @@ NETWORKS=`echo "$SCAN_RESULTS" | awk -F '/..:..:..:..:..:../ {if (length($5) > 0) printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq` -if [ -z $NETWORKS ]; then +if [ -z "$NETWORKS" ]; then dialog --backtitle "FreeBSD Installer" --title "Error" \ --yesno "No wireless networks were found. Rescan?" 0 0 && \ exec $0 $@ From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 16:49:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15857645; Sun, 27 Jan 2013 16:49:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3BB4AD0; Sun, 27 Jan 2013 16:49:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RGnBml007510; Sun, 27 Jan 2013 16:49:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RGnBup007507; Sun, 27 Jan 2013 16:49:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271649.r0RGnBup007507@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 16:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245981 - in stable/9/sys/sparc64: include sparc64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 16:49:12 -0000 Author: marius Date: Sun Jan 27 16:49:11 2013 New Revision: 245981 URL: http://svnweb.freebsd.org/changeset/base/245981 Log: MFC: 241780 - Give PIL_PREEMPT the lowest priority just above low/stray interrupts. The reason for this is that the SPARC v9 architecture allows nested interrupts of higher priority/level than that of the current interrupt to occur (and we can't just entirely bypass this model, also, at least for tick interrupts, this also wouldn't be wise). However, when a preemption interrupt interrupts another interrupt of lower priority, f.e. PIL_ITHREAD, and that one in turn is nested by a third interrupt, f.e. PIL_TICK, with SCHED_ULE the execution of interrupts higher than PIL_PREEMPT may be migrated to another CPU. In particular, tl1_ret(), which is responsible for restoring the state of the CPU prior to entry to the interrupt based on the (also migrated) trap frame, then is run on a CPU which actually didn't receive the interrupt in question, causing an inappropriate processor interrupt level to be "restored". In turn, this causes interrupts of the first level, i.e. PIL_ITHREAD in the above scenario, to be blocked on the target of the migration until the correct PIL happens to be restored again on that CPU again. Making PIL_PREEMPT the lowest real priority, this effectively prevents this scenario from happening, as preemption interrupts no longer can interrupt any other interrupt besides stray ones (which is no issue). Thanks to attilio@ and especially mav@ for helping me to understand this problem at the 201208DevSummit. - Give PIL_STOP (which is also used for IPI_STOP_HARD, given that there's no real equivalent to NMIs on SPARC v9) the highest possible priority just below the hardwired PIL_TICK, so it has a chance to interrupt more things. Modified: stable/9/sys/sparc64/include/intr_machdep.h stable/9/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/include/intr_machdep.h ============================================================================== --- stable/9/sys/sparc64/include/intr_machdep.h Sun Jan 27 14:49:54 2013 (r245980) +++ stable/9/sys/sparc64/include/intr_machdep.h Sun Jan 27 16:49:11 2013 (r245981) @@ -41,14 +41,14 @@ #define IV_SHIFT 6 #define PIL_LOW 1 /* stray interrupts */ -#define PIL_ITHREAD 2 /* interrupts that use ithreads */ -#define PIL_RENDEZVOUS 3 /* smp rendezvous ipi */ -#define PIL_AST 4 /* ast ipi */ -#define PIL_STOP 5 /* stop cpu ipi */ -#define PIL_PREEMPT 6 /* preempt idle thread cpu ipi */ -#define PIL_HARDCLOCK 7 /* hardclock broadcast */ -#define PIL_FILTER 12 /* filter interrupts */ -#define PIL_BRIDGE 13 /* bridge interrupts */ +#define PIL_PREEMPT 2 /* preempt idle thread CPU IPI */ +#define PIL_ITHREAD 3 /* interrupts that use ithreads */ +#define PIL_RENDEZVOUS 4 /* SMP rendezvous IPI */ +#define PIL_AST 5 /* asynchronous trap IPI */ +#define PIL_HARDCLOCK 6 /* hardclock broadcast */ +#define PIL_FILTER 11 /* filter interrupts */ +#define PIL_BRIDGE 12 /* bridge interrupts */ +#define PIL_STOP 13 /* stop CPU IPI */ #define PIL_TICK 14 /* tick interrupts */ #ifndef LOCORE Modified: stable/9/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/9/sys/sparc64/sparc64/intr_machdep.c Sun Jan 27 14:49:54 2013 (r245980) +++ stable/9/sys/sparc64/sparc64/intr_machdep.c Sun Jan 27 16:49:11 2013 (r245981) @@ -92,15 +92,15 @@ static uint16_t intr_stray_count[IV_MAX] static const char *const pil_names[] = { "stray", "low", /* PIL_LOW */ + "preempt", /* PIL_PREEMPT */ "ithrd", /* PIL_ITHREAD */ "rndzvs", /* PIL_RENDEZVOUS */ "ast", /* PIL_AST */ - "stop", /* PIL_STOP */ - "preempt", /* PIL_PREEMPT */ "hardclock", /* PIL_HARDCLOCK */ "stray", "stray", "stray", "stray", "filter", /* PIL_FILTER */ "bridge", /* PIL_BRIDGE */ + "stop", /* PIL_STOP */ "tick", /* PIL_TICK */ }; From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 16:49:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CFC6A646; Sun, 27 Jan 2013 16:49:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B67A6AD1; Sun, 27 Jan 2013 16:49:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RGnEp9007554; Sun, 27 Jan 2013 16:49:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RGnE38007552; Sun, 27 Jan 2013 16:49:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271649.r0RGnE38007552@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 16:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245982 - in stable/8/sys/sparc64: include sparc64 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 16:49:14 -0000 Author: marius Date: Sun Jan 27 16:49:13 2013 New Revision: 245982 URL: http://svnweb.freebsd.org/changeset/base/245982 Log: MFC: 241780 - Give PIL_PREEMPT the lowest priority just above low/stray interrupts. The reason for this is that the SPARC v9 architecture allows nested interrupts of higher priority/level than that of the current interrupt to occur (and we can't just entirely bypass this model, also, at least for tick interrupts, this also wouldn't be wise). However, when a preemption interrupt interrupts another interrupt of lower priority, f.e. PIL_ITHREAD, and that one in turn is nested by a third interrupt, f.e. PIL_TICK, with SCHED_ULE the execution of interrupts higher than PIL_PREEMPT may be migrated to another CPU. In particular, tl1_ret(), which is responsible for restoring the state of the CPU prior to entry to the interrupt based on the (also migrated) trap frame, then is run on a CPU which actually didn't receive the interrupt in question, causing an inappropriate processor interrupt level to be "restored". In turn, this causes interrupts of the first level, i.e. PIL_ITHREAD in the above scenario, to be blocked on the target of the migration until the correct PIL happens to be restored again on that CPU again. Making PIL_PREEMPT the lowest real priority, this effectively prevents this scenario from happening, as preemption interrupts no longer can interrupt any other interrupt besides stray ones (which is no issue). Thanks to attilio@ and especially mav@ for helping me to understand this problem at the 201208DevSummit. - Give PIL_STOP (which is also used for IPI_STOP_HARD, given that there's no real equivalent to NMIs on SPARC v9) the highest possible priority just below the hardwired PIL_TICK, so it has a chance to interrupt more things. Modified: stable/8/sys/sparc64/include/intr_machdep.h stable/8/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/sparc64/include/intr_machdep.h ============================================================================== --- stable/8/sys/sparc64/include/intr_machdep.h Sun Jan 27 16:49:11 2013 (r245981) +++ stable/8/sys/sparc64/include/intr_machdep.h Sun Jan 27 16:49:13 2013 (r245982) @@ -41,13 +41,13 @@ #define IV_SHIFT 6 #define PIL_LOW 1 /* stray interrupts */ -#define PIL_ITHREAD 2 /* interrupts that use ithreads */ -#define PIL_RENDEZVOUS 3 /* smp rendezvous ipi */ -#define PIL_AST 4 /* ast ipi */ -#define PIL_STOP 5 /* stop cpu ipi */ -#define PIL_PREEMPT 6 /* preempt idle thread cpu ipi */ -#define PIL_FILTER 12 /* filter interrupts */ -#define PIL_BRIDGE 13 /* bridge interrupts */ +#define PIL_PREEMPT 2 /* preempt idle thread CPU IPI */ +#define PIL_ITHREAD 3 /* interrupts that use ithreads */ +#define PIL_RENDEZVOUS 4 /* SMP rendezvous IPI */ +#define PIL_AST 5 /* asynchronous trap IPI */ +#define PIL_FILTER 11 /* filter interrupts */ +#define PIL_BRIDGE 12 /* bridge interrupts */ +#define PIL_STOP 13 /* stop CPU IPI */ #define PIL_TICK 14 /* tick interrupts */ #ifndef LOCORE Modified: stable/8/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/intr_machdep.c Sun Jan 27 16:49:11 2013 (r245981) +++ stable/8/sys/sparc64/sparc64/intr_machdep.c Sun Jan 27 16:49:13 2013 (r245982) @@ -92,14 +92,14 @@ static uint16_t intr_stray_count[IV_MAX] static const char *const pil_names[] = { "stray", "low", /* PIL_LOW */ + "preempt", /* PIL_PREEMPT */ "ithrd", /* PIL_ITHREAD */ "rndzvs", /* PIL_RENDEZVOUS */ "ast", /* PIL_AST */ - "stop", /* PIL_STOP */ - "preempt", /* PIL_PREEMPT */ "stray", "stray", "stray", "stray", "stray", "filter", /* PIL_FILTER */ "bridge", /* PIL_BRIDGE */ + "stop", /* PIL_STOP */ "tick", /* PIL_TICK */ }; From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:13:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8AB73E86; Sun, 27 Jan 2013 17:13:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 60B77C00; Sun, 27 Jan 2013 17:13:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHDCjS016116; Sun, 27 Jan 2013 17:13:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHDBQm016110; Sun, 27 Jan 2013 17:13:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271713.r0RHDBQm016110@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245983 - stable/9/sys/dev/mpt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:13:12 -0000 Author: marius Date: Sun Jan 27 17:13:11 2013 New Revision: 245983 URL: http://svnweb.freebsd.org/changeset/base/245983 Log: MFC: r241874 After r241858 (MFC'ed to stable/9 in r242286), remove the remainder of FreeBSD ~4 support from mpt(4). Modified: stable/9/sys/dev/mpt/mpt.c stable/9/sys/dev/mpt/mpt.h stable/9/sys/dev/mpt/mpt_cam.c stable/9/sys/dev/mpt/mpt_debug.c stable/9/sys/dev/mpt/mpt_raid.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mpt/mpt.c ============================================================================== --- stable/9/sys/dev/mpt/mpt.c Sun Jan 27 16:49:13 2013 (r245982) +++ stable/9/sys/dev/mpt/mpt.c Sun Jan 27 17:13:11 2013 (r245983) @@ -286,10 +286,8 @@ mpt_modevent(module_t mod, int type, voi } case MOD_SHUTDOWN: break; -#if __FreeBSD_version >= 500000 case MOD_QUIESCE: break; -#endif case MOD_UNLOAD: error = pers->unload(pers); mpt_personalities[pers->id] = NULL; @@ -1471,15 +1469,9 @@ mpt_recv_handshake_reply(struct mpt_soft */ if ((reply_len >> 1) != hdr->MsgLength && (hdr->Function != MPI_FUNCTION_IOC_FACTS)){ -#if __FreeBSD_version >= 500000 mpt_prt(mpt, "reply length does not match message length: " "got %x; expected %zx for function %x\n", hdr->MsgLength << 2, reply_len << 1, hdr->Function); -#else - mpt_prt(mpt, "reply length does not match message length: " - "got %x; expected %x for function %x\n", - hdr->MsgLength << 2, reply_len << 1, hdr->Function); -#endif } /* Get rest of the reply; but don't overflow the provided buffer */ @@ -2155,7 +2147,6 @@ mpt_disable_ints(struct mpt_softc *mpt) static void mpt_sysctl_attach(struct mpt_softc *mpt) { -#if __FreeBSD_version >= 500000 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); @@ -2170,7 +2161,6 @@ mpt_sysctl_attach(struct mpt_softc *mpt) "failure_id", CTLFLAG_RW, &mpt->failure_id, -1, "Next Target to Fail"); #endif -#endif } int Modified: stable/9/sys/dev/mpt/mpt.h ============================================================================== --- stable/9/sys/dev/mpt/mpt.h Sun Jan 27 16:49:13 2013 (r245982) +++ stable/9/sys/dev/mpt/mpt.h Sun Jan 27 17:13:11 2013 (r245983) @@ -100,52 +100,34 @@ #define _MPT_H_ /********************************* OS Includes ********************************/ -#include #include #include +#include +#include #include #include -#if __FreeBSD_version < 500000 #include -#include -#include -#include -#else #include -#include -#include #include +#include #include -#include -#endif #include -#include -#include +#include +#include +#include +#include #include #include -#if __FreeBSD_version < 500000 -#include -#include -#endif - #ifdef __sparc64__ #include #include #endif -#include - -#if __FreeBSD_version < 500000 -#include -#include -#else #include #include -#endif -#include #include "opt_ddb.h" /**************************** Register Definitions ****************************/ @@ -241,7 +223,6 @@ int mpt_modevent(module_t, int, void *); #if __FreeBSD_version < 600000 #define bus_get_dma_tag(x) NULL #endif -#if __FreeBSD_version >= 501102 #define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ lowaddr, highaddr, filter, filterarg, \ maxsize, nsegments, maxsegsz, flags, \ @@ -251,17 +232,6 @@ int mpt_modevent(module_t, int, void *); maxsize, nsegments, maxsegsz, flags, \ busdma_lock_mutex, &(mpt)->mpt_lock, \ dma_tagp) -#else -#define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) \ - bus_dma_tag_create(parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) -#endif - struct mpt_map_info { struct mpt_softc *mpt; int error; @@ -291,14 +261,9 @@ void mpt_map_rquest(void *, bus_dma_segm kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) #define mpt_kthread_exit(status) \ kproc_exit(status) -#elif __FreeBSD_version > 500005 -#define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mpt_kthread_exit(status) \ - kthread_exit(status) #else #define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, fmtstr, arg) + kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) #define mpt_kthread_exit(status) \ kthread_exit(status) #endif @@ -599,13 +564,8 @@ struct mptsas_portinfo { struct mpt_softc { device_t dev; -#if __FreeBSD_version < 500000 - uint32_t mpt_islocked; - int mpt_splsaved; -#else struct mtx mpt_lock; int mpt_locksetup; -#endif uint32_t mpt_pers_mask; uint32_t : 7, @@ -676,7 +636,6 @@ struct mpt_softc { #define mpt_fcport_speed cfg.fc._port_speed } fc; } cfg; -#if __FreeBSD_version >= 500000 /* * Device config information stored up for sysctl to access */ @@ -689,7 +648,6 @@ struct mpt_softc { char wwpn[19]; } fc; } scinfo; -#endif /* Controller Info for RAID information */ CONFIG_PAGE_IOC_2 * ioc_page2; @@ -830,74 +788,6 @@ mpt_assign_serno(struct mpt_softc *mpt, } /***************************** Locking Primitives *****************************/ -#if __FreeBSD_version < 500000 -#define MPT_IFLAGS INTR_TYPE_CAM -#define MPT_LOCK(mpt) mpt_lockspl(mpt) -#define MPT_UNLOCK(mpt) mpt_unlockspl(mpt) -#define MPT_OWNED(mpt) mpt->mpt_islocked -#define MPT_LOCK_ASSERT(mpt) -#define MPTLOCK_2_CAMLOCK MPT_UNLOCK -#define CAMLOCK_2_MPTLOCK MPT_LOCK -#define MPT_LOCK_SETUP(mpt) -#define MPT_LOCK_DESTROY(mpt) - -static __inline void mpt_lockspl(struct mpt_softc *mpt); -static __inline void mpt_unlockspl(struct mpt_softc *mpt); - -static __inline void -mpt_lockspl(struct mpt_softc *mpt) -{ - int s; - - s = splcam(); - if (mpt->mpt_islocked++ == 0) { - mpt->mpt_splsaved = s; - } else { - splx(s); - panic("Recursed lock with mask: 0x%x", s); - } -} - -static __inline void -mpt_unlockspl(struct mpt_softc *mpt) -{ - if (mpt->mpt_islocked) { - if (--mpt->mpt_islocked == 0) { - splx(mpt->mpt_splsaved); - } - } else - panic("Negative lock count"); -} - -static __inline int -mpt_sleep(struct mpt_softc *mpt, void *ident, int priority, - const char *wmesg, int timo) -{ - int saved_cnt; - int saved_spl; - int error; - - KASSERT(mpt->mpt_islocked <= 1, ("Invalid lock count on tsleep")); - saved_cnt = mpt->mpt_islocked; - saved_spl = mpt->mpt_splsaved; - mpt->mpt_islocked = 0; - error = tsleep(ident, priority, wmesg, timo); - KASSERT(mpt->mpt_islocked == 0, ("Invalid lock count on wakeup")); - mpt->mpt_islocked = saved_cnt; - mpt->mpt_splsaved = saved_spl; - return (error); -} - -#define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)); -#define mpt_req_untimeout(req, func, arg) \ - callout_stop(&(req)->callout) -#define mpt_callout_init(mpt, c) \ - callout_init(c) -#define mpt_callout_drain(mpt, c) \ - callout_stop(c) - -#else #if 1 #define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE #define MPT_LOCK_SETUP(mpt) \ @@ -957,7 +847,6 @@ mpt_sleep(struct mpt_softc *mpt, void *i return (r); } #endif -#endif /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); @@ -1098,7 +987,6 @@ enum { MPT_PRT_NONE=100 }; -#if __FreeBSD_version > 500000 #define mpt_lprt(mpt, level, ...) \ do { \ if (level <= (mpt)->verbose) \ @@ -1112,14 +1000,7 @@ do { \ mpt_prtc(mpt, __VA_ARGS__); \ } while (0) #endif -#else -void mpt_lprt(struct mpt_softc *, int, const char *, ...) - __printflike(3, 4); -#if 0 -void mpt_lprtc(struct mpt_softc *, int, const char *, ...) - __printflike(3, 4); -#endif -#endif + void mpt_prt(struct mpt_softc *, const char *, ...) __printflike(2, 3); void mpt_prtc(struct mpt_softc *, const char *, ...) Modified: stable/9/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_cam.c Sun Jan 27 16:49:13 2013 (r245982) +++ stable/9/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:11 2013 (r245983) @@ -105,11 +105,10 @@ __FBSDID("$FreeBSD$"); #include "dev/mpt/mpilib/mpi_targ.h" #include "dev/mpt/mpilib/mpi_fc.h" #include "dev/mpt/mpilib/mpi_sas.h" -#if __FreeBSD_version >= 500000 -#include -#endif + #include #include +#include #if __FreeBSD_version >= 700025 #ifndef CAM_NEW_TRAN_CODE @@ -125,7 +124,6 @@ mpt_get_spi_settings(struct mpt_softc *, static void mpt_setwidth(struct mpt_softc *, int, int); static void mpt_setsync(struct mpt_softc *, int, int, int); static int mpt_update_spi_config(struct mpt_softc *, int); -static void mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended); static mpt_reply_handler_t mpt_scsi_reply_handler; static mpt_reply_handler_t mpt_scsi_tmf_reply_handler; @@ -416,6 +414,8 @@ cleanup: static int mpt_read_config_info_fc(struct mpt_softc *mpt) { + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; char *topology = NULL; int rv; @@ -473,33 +473,27 @@ mpt_read_config_info_fc(struct mpt_softc mpt->mpt_fcport_page0.WWPN.High, mpt->mpt_fcport_page0.WWPN.Low, mpt->mpt_fcport_speed); -#if __FreeBSD_version >= 500000 MPT_UNLOCK(mpt); - { - struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); - struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); + ctx = device_get_sysctl_ctx(mpt->dev); + tree = device_get_sysctl_tree(mpt->dev); - snprintf(mpt->scinfo.fc.wwnn, - sizeof (mpt->scinfo.fc.wwnn), "0x%08x%08x", - mpt->mpt_fcport_page0.WWNN.High, - mpt->mpt_fcport_page0.WWNN.Low); - - snprintf(mpt->scinfo.fc.wwpn, - sizeof (mpt->scinfo.fc.wwpn), "0x%08x%08x", - mpt->mpt_fcport_page0.WWPN.High, - mpt->mpt_fcport_page0.WWPN.Low); - - SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, - "World Wide Node Name"); - - SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, - "World Wide Port Name"); + snprintf(mpt->scinfo.fc.wwnn, sizeof (mpt->scinfo.fc.wwnn), + "0x%08x%08x", mpt->mpt_fcport_page0.WWNN.High, + mpt->mpt_fcport_page0.WWNN.Low); + + snprintf(mpt->scinfo.fc.wwpn, sizeof (mpt->scinfo.fc.wwpn), + "0x%08x%08x", mpt->mpt_fcport_page0.WWPN.High, + mpt->mpt_fcport_page0.WWPN.Low); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, + "World Wide Node Name"); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, + "World Wide Port Name"); - } MPT_LOCK(mpt); -#endif return (0); } @@ -1246,9 +1240,6 @@ mpt_timeout(void *arg) ccb = (union ccb *)arg; mpt = ccb->ccb_h.ccb_mpt_ptr; -#if __FreeBSD_version < 500000 - MPT_LOCK(mpt); -#endif MPT_LOCK_ASSERT(mpt); req = ccb->ccb_h.ccb_req_ptr; mpt_prt(mpt, "request %p:%u timed out for ccb %p (req->ccb %p)\n", req, @@ -1260,9 +1251,6 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } -#if __FreeBSD_version < 500000 - MPT_UNLOCK(mpt); -#endif } /* @@ -3660,7 +3648,7 @@ mpt_action(struct cam_sim *sim, union cc mpt_set_ccb_status(ccb, CAM_REQ_INVALID); break; } - mpt_calc_geometry(ccg, /*extended*/1); + cam_calc_geometry(ccg, /* extended */ 1); KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); break; } @@ -4022,33 +4010,6 @@ mpt_update_spi_config(struct mpt_softc * return (0); } -static void -mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended) -{ -#if __FreeBSD_version >= 500000 - cam_calc_geometry(ccg, extended); -#else - uint32_t size_mb; - uint32_t secs_per_cylinder; - - if (ccg->block_size == 0) { - ccg->ccb_h.status = CAM_REQ_INVALID; - return; - } - size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size); - if (size_mb > 1024 && extended) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccg->ccb_h.status = CAM_REQ_CMP; -#endif -} - /****************************** Timeout Recovery ******************************/ static int mpt_spawn_recovery_thread(struct mpt_softc *mpt) Modified: stable/9/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_debug.c Sun Jan 27 16:49:13 2013 (r245982) +++ stable/9/sys/dev/mpt/mpt_debug.c Sun Jan 27 17:13:11 2013 (r245983) @@ -518,6 +518,7 @@ mpt_print_reply(void *vmsg) static void mpt_print_request_hdr(MSG_REQUEST_HEADER *req) { + printf("%s @ %p\n", mpt_ioc_function(req->Function), req); printf("\tChain Offset 0x%02x\n", req->ChainOffset); printf("\tMsgFlags 0x%02x\n", req->MsgFlags); @@ -841,13 +842,8 @@ mpt_dump_request(struct mpt_softc *mpt, uint32_t *pReq = req->req_vbuf; int o; -#if __FreeBSD_version >= 500000 mpt_prt(mpt, "Send Request %d (%jx):", req->index, (uintmax_t) req->req_pbuf); -#else - mpt_prt(mpt, "Send Request %d (%llx):", - req->index, (unsigned long long) req->req_pbuf); -#endif for (o = 0; o < mpt->ioc_facts.RequestFrameSize; o++) { if ((o & 0x7) == 0) { mpt_prtc(mpt, "\n"); @@ -858,33 +854,6 @@ mpt_dump_request(struct mpt_softc *mpt, mpt_prtc(mpt, "\n"); } -#if __FreeBSD_version < 500000 -void -mpt_lprt(struct mpt_softc *mpt, int level, const char *fmt, ...) -{ - va_list ap; - if (level <= mpt->verbose) { - printf("%s: ", device_get_nameunit(mpt->dev)); - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } -} - -#if 0 -void -mpt_lprtc(struct mpt_softc *mpt, int level, const char *fmt, ...) -{ - va_list ap; - if (level <= mpt->verbose) { - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } -} -#endif -#endif - void mpt_prt(struct mpt_softc *mpt, const char *fmt, ...) { Modified: stable/9/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_raid.c Sun Jan 27 16:49:13 2013 (r245982) +++ stable/9/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:11 2013 (r245983) @@ -51,15 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#if __FreeBSD_version < 500000 -#include -#define GIANT_REQUIRED -#endif -#include - #include #include #include @@ -118,11 +113,7 @@ static void mpt_enable_vol(struct mpt_so static void mpt_verify_mwce(struct mpt_softc *, struct mpt_raid_volume *); static void mpt_adjust_queue_depth(struct mpt_softc *, struct mpt_raid_volume *, struct cam_path *); -#if __FreeBSD_version < 500000 -#define mpt_raid_sysctl_attach(x) do { } while (0) -#else static void mpt_raid_sysctl_attach(struct mpt_softc *); -#endif static const char *mpt_vol_type(struct mpt_raid_volume *vol); static const char *mpt_vol_state(struct mpt_raid_volume *vol); @@ -1520,15 +1511,9 @@ mpt_refresh_raid_data(struct mpt_softc * mpt_vol_prt(mpt, mpt_vol, "%s Priority Re-Sync\n", prio ? "High" : "Low"); } -#if __FreeBSD_version >= 500000 mpt_vol_prt(mpt, mpt_vol, "%ju of %ju " "blocks remaining\n", (uintmax_t)left, (uintmax_t)total); -#else - mpt_vol_prt(mpt, mpt_vol, "%llu of %llu " - "blocks remaining\n", (uint64_t)left, - (uint64_t)total); -#endif /* Periodically report on sync progress. */ mpt_schedule_raid_refresh(mpt); @@ -1593,14 +1578,8 @@ mpt_raid_timer(void *arg) struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; -#if __FreeBSD_version < 500000 - MPT_LOCK(mpt); -#endif MPT_LOCK_ASSERT(mpt); mpt_raid_wakeup(mpt); -#if __FreeBSD_version < 500000 - MPT_UNLOCK(mpt); -#endif } static void @@ -1644,7 +1623,6 @@ mpt_raid_free_mem(struct mpt_softc *mpt) mpt->raid_max_disks = 0; } -#if __FreeBSD_version >= 500000 static int mpt_raid_set_vol_resync_rate(struct mpt_softc *mpt, u_int rate) { @@ -1869,4 +1847,3 @@ mpt_raid_sysctl_attach(struct mpt_softc &mpt->raid_nonopt_volumes, 0, "number of nonoptimal volumes"); } -#endif From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:13:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5E90F8D; Sun, 27 Jan 2013 17:13:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 89381C01; Sun, 27 Jan 2013 17:13:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHDJdu016180; Sun, 27 Jan 2013 17:13:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHDIZg016167; Sun, 27 Jan 2013 17:13:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271713.r0RHDIZg016167@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245984 - stable/8/sys/dev/mpt X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:13:19 -0000 Author: marius Date: Sun Jan 27 17:13:18 2013 New Revision: 245984 URL: http://svnweb.freebsd.org/changeset/base/245984 Log: MFC: r241874 After r241858 (MFC'ed to stable/8 in r242285), remove the remainder of FreeBSD ~4 support from mpt(4). Modified: stable/8/sys/dev/mpt/mpt.c stable/8/sys/dev/mpt/mpt.h stable/8/sys/dev/mpt/mpt_cam.c stable/8/sys/dev/mpt/mpt_debug.c stable/8/sys/dev/mpt/mpt_raid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mpt/ (props changed) Modified: stable/8/sys/dev/mpt/mpt.c ============================================================================== --- stable/8/sys/dev/mpt/mpt.c Sun Jan 27 17:13:11 2013 (r245983) +++ stable/8/sys/dev/mpt/mpt.c Sun Jan 27 17:13:18 2013 (r245984) @@ -286,10 +286,8 @@ mpt_modevent(module_t mod, int type, voi } case MOD_SHUTDOWN: break; -#if __FreeBSD_version >= 500000 case MOD_QUIESCE: break; -#endif case MOD_UNLOAD: error = pers->unload(pers); mpt_personalities[pers->id] = NULL; @@ -1471,15 +1469,9 @@ mpt_recv_handshake_reply(struct mpt_soft */ if ((reply_len >> 1) != hdr->MsgLength && (hdr->Function != MPI_FUNCTION_IOC_FACTS)){ -#if __FreeBSD_version >= 500000 mpt_prt(mpt, "reply length does not match message length: " "got %x; expected %zx for function %x\n", hdr->MsgLength << 2, reply_len << 1, hdr->Function); -#else - mpt_prt(mpt, "reply length does not match message length: " - "got %x; expected %x for function %x\n", - hdr->MsgLength << 2, reply_len << 1, hdr->Function); -#endif } /* Get rest of the reply; but don't overflow the provided buffer */ @@ -2155,7 +2147,6 @@ mpt_disable_ints(struct mpt_softc *mpt) static void mpt_sysctl_attach(struct mpt_softc *mpt) { -#if __FreeBSD_version >= 500000 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); @@ -2170,7 +2161,6 @@ mpt_sysctl_attach(struct mpt_softc *mpt) "failure_id", CTLFLAG_RW, &mpt->failure_id, -1, "Next Target to Fail"); #endif -#endif } int Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Sun Jan 27 17:13:11 2013 (r245983) +++ stable/8/sys/dev/mpt/mpt.h Sun Jan 27 17:13:18 2013 (r245984) @@ -100,52 +100,34 @@ #define _MPT_H_ /********************************* OS Includes ********************************/ -#include #include #include +#include +#include #include #include -#if __FreeBSD_version < 500000 #include -#include -#include -#include -#else #include -#include -#include #include +#include #include -#include -#endif #include -#include -#include +#include +#include +#include +#include #include #include -#if __FreeBSD_version < 500000 -#include -#include -#endif - #ifdef __sparc64__ #include #include #endif -#include - -#if __FreeBSD_version < 500000 -#include -#include -#else #include #include -#endif -#include #include "opt_ddb.h" /**************************** Register Definitions ****************************/ @@ -241,7 +223,6 @@ int mpt_modevent(module_t, int, void *); #if __FreeBSD_version < 600000 #define bus_get_dma_tag(x) NULL #endif -#if __FreeBSD_version >= 501102 #define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ lowaddr, highaddr, filter, filterarg, \ maxsize, nsegments, maxsegsz, flags, \ @@ -251,17 +232,6 @@ int mpt_modevent(module_t, int, void *); maxsize, nsegments, maxsegsz, flags, \ busdma_lock_mutex, &(mpt)->mpt_lock, \ dma_tagp) -#else -#define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) \ - bus_dma_tag_create(parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) -#endif - struct mpt_map_info { struct mpt_softc *mpt; int error; @@ -291,14 +261,9 @@ void mpt_map_rquest(void *, bus_dma_segm kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) #define mpt_kthread_exit(status) \ kproc_exit(status) -#elif __FreeBSD_version > 500005 -#define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mpt_kthread_exit(status) \ - kthread_exit(status) #else #define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, fmtstr, arg) + kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) #define mpt_kthread_exit(status) \ kthread_exit(status) #endif @@ -599,13 +564,8 @@ struct mptsas_portinfo { struct mpt_softc { device_t dev; -#if __FreeBSD_version < 500000 - uint32_t mpt_islocked; - int mpt_splsaved; -#else struct mtx mpt_lock; int mpt_locksetup; -#endif uint32_t mpt_pers_mask; uint32_t : 7, @@ -676,7 +636,6 @@ struct mpt_softc { #define mpt_fcport_speed cfg.fc._port_speed } fc; } cfg; -#if __FreeBSD_version >= 500000 /* * Device config information stored up for sysctl to access */ @@ -689,7 +648,6 @@ struct mpt_softc { char wwpn[19]; } fc; } scinfo; -#endif /* Controller Info for RAID information */ CONFIG_PAGE_IOC_2 * ioc_page2; @@ -830,74 +788,6 @@ mpt_assign_serno(struct mpt_softc *mpt, } /***************************** Locking Primitives *****************************/ -#if __FreeBSD_version < 500000 -#define MPT_IFLAGS INTR_TYPE_CAM -#define MPT_LOCK(mpt) mpt_lockspl(mpt) -#define MPT_UNLOCK(mpt) mpt_unlockspl(mpt) -#define MPT_OWNED(mpt) mpt->mpt_islocked -#define MPT_LOCK_ASSERT(mpt) -#define MPTLOCK_2_CAMLOCK MPT_UNLOCK -#define CAMLOCK_2_MPTLOCK MPT_LOCK -#define MPT_LOCK_SETUP(mpt) -#define MPT_LOCK_DESTROY(mpt) - -static __inline void mpt_lockspl(struct mpt_softc *mpt); -static __inline void mpt_unlockspl(struct mpt_softc *mpt); - -static __inline void -mpt_lockspl(struct mpt_softc *mpt) -{ - int s; - - s = splcam(); - if (mpt->mpt_islocked++ == 0) { - mpt->mpt_splsaved = s; - } else { - splx(s); - panic("Recursed lock with mask: 0x%x", s); - } -} - -static __inline void -mpt_unlockspl(struct mpt_softc *mpt) -{ - if (mpt->mpt_islocked) { - if (--mpt->mpt_islocked == 0) { - splx(mpt->mpt_splsaved); - } - } else - panic("Negative lock count"); -} - -static __inline int -mpt_sleep(struct mpt_softc *mpt, void *ident, int priority, - const char *wmesg, int timo) -{ - int saved_cnt; - int saved_spl; - int error; - - KASSERT(mpt->mpt_islocked <= 1, ("Invalid lock count on tsleep")); - saved_cnt = mpt->mpt_islocked; - saved_spl = mpt->mpt_splsaved; - mpt->mpt_islocked = 0; - error = tsleep(ident, priority, wmesg, timo); - KASSERT(mpt->mpt_islocked == 0, ("Invalid lock count on wakeup")); - mpt->mpt_islocked = saved_cnt; - mpt->mpt_splsaved = saved_spl; - return (error); -} - -#define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)); -#define mpt_req_untimeout(req, func, arg) \ - callout_stop(&(req)->callout) -#define mpt_callout_init(mpt, c) \ - callout_init(c) -#define mpt_callout_drain(mpt, c) \ - callout_stop(c) - -#else #if 1 #define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE #define MPT_LOCK_SETUP(mpt) \ @@ -957,7 +847,6 @@ mpt_sleep(struct mpt_softc *mpt, void *i return (r); } #endif -#endif /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); @@ -1098,7 +987,6 @@ enum { MPT_PRT_NONE=100 }; -#if __FreeBSD_version > 500000 #define mpt_lprt(mpt, level, ...) \ do { \ if (level <= (mpt)->verbose) \ @@ -1112,14 +1000,7 @@ do { \ mpt_prtc(mpt, __VA_ARGS__); \ } while (0) #endif -#else -void mpt_lprt(struct mpt_softc *, int, const char *, ...) - __printflike(3, 4); -#if 0 -void mpt_lprtc(struct mpt_softc *, int, const char *, ...) - __printflike(3, 4); -#endif -#endif + void mpt_prt(struct mpt_softc *, const char *, ...) __printflike(2, 3); void mpt_prtc(struct mpt_softc *, const char *, ...) Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:11 2013 (r245983) +++ stable/8/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:18 2013 (r245984) @@ -105,11 +105,10 @@ __FBSDID("$FreeBSD$"); #include "dev/mpt/mpilib/mpi_targ.h" #include "dev/mpt/mpilib/mpi_fc.h" #include "dev/mpt/mpilib/mpi_sas.h" -#if __FreeBSD_version >= 500000 -#include -#endif + #include #include +#include #if __FreeBSD_version >= 700025 #ifndef CAM_NEW_TRAN_CODE @@ -125,7 +124,6 @@ mpt_get_spi_settings(struct mpt_softc *, static void mpt_setwidth(struct mpt_softc *, int, int); static void mpt_setsync(struct mpt_softc *, int, int, int); static int mpt_update_spi_config(struct mpt_softc *, int); -static void mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended); static mpt_reply_handler_t mpt_scsi_reply_handler; static mpt_reply_handler_t mpt_scsi_tmf_reply_handler; @@ -416,6 +414,8 @@ cleanup: static int mpt_read_config_info_fc(struct mpt_softc *mpt) { + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; char *topology = NULL; int rv; @@ -473,33 +473,27 @@ mpt_read_config_info_fc(struct mpt_softc mpt->mpt_fcport_page0.WWPN.High, mpt->mpt_fcport_page0.WWPN.Low, mpt->mpt_fcport_speed); -#if __FreeBSD_version >= 500000 MPT_UNLOCK(mpt); - { - struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); - struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); + ctx = device_get_sysctl_ctx(mpt->dev); + tree = device_get_sysctl_tree(mpt->dev); - snprintf(mpt->scinfo.fc.wwnn, - sizeof (mpt->scinfo.fc.wwnn), "0x%08x%08x", - mpt->mpt_fcport_page0.WWNN.High, - mpt->mpt_fcport_page0.WWNN.Low); - - snprintf(mpt->scinfo.fc.wwpn, - sizeof (mpt->scinfo.fc.wwpn), "0x%08x%08x", - mpt->mpt_fcport_page0.WWPN.High, - mpt->mpt_fcport_page0.WWPN.Low); - - SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, - "World Wide Node Name"); - - SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, - "World Wide Port Name"); + snprintf(mpt->scinfo.fc.wwnn, sizeof (mpt->scinfo.fc.wwnn), + "0x%08x%08x", mpt->mpt_fcport_page0.WWNN.High, + mpt->mpt_fcport_page0.WWNN.Low); + + snprintf(mpt->scinfo.fc.wwpn, sizeof (mpt->scinfo.fc.wwpn), + "0x%08x%08x", mpt->mpt_fcport_page0.WWPN.High, + mpt->mpt_fcport_page0.WWPN.Low); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, + "World Wide Node Name"); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, + "World Wide Port Name"); - } MPT_LOCK(mpt); -#endif return (0); } @@ -1246,9 +1240,6 @@ mpt_timeout(void *arg) ccb = (union ccb *)arg; mpt = ccb->ccb_h.ccb_mpt_ptr; -#if __FreeBSD_version < 500000 - MPT_LOCK(mpt); -#endif MPT_LOCK_ASSERT(mpt); req = ccb->ccb_h.ccb_req_ptr; mpt_prt(mpt, "request %p:%u timed out for ccb %p (req->ccb %p)\n", req, @@ -1260,9 +1251,6 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } -#if __FreeBSD_version < 500000 - MPT_UNLOCK(mpt); -#endif } /* @@ -3653,7 +3641,7 @@ mpt_action(struct cam_sim *sim, union cc mpt_set_ccb_status(ccb, CAM_REQ_INVALID); break; } - mpt_calc_geometry(ccg, /*extended*/1); + cam_calc_geometry(ccg, /* extended */ 1); KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); break; } @@ -4015,33 +4003,6 @@ mpt_update_spi_config(struct mpt_softc * return (0); } -static void -mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended) -{ -#if __FreeBSD_version >= 500000 - cam_calc_geometry(ccg, extended); -#else - uint32_t size_mb; - uint32_t secs_per_cylinder; - - if (ccg->block_size == 0) { - ccg->ccb_h.status = CAM_REQ_INVALID; - return; - } - size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size); - if (size_mb > 1024 && extended) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccg->ccb_h.status = CAM_REQ_CMP; -#endif -} - /****************************** Timeout Recovery ******************************/ static int mpt_spawn_recovery_thread(struct mpt_softc *mpt) Modified: stable/8/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_debug.c Sun Jan 27 17:13:11 2013 (r245983) +++ stable/8/sys/dev/mpt/mpt_debug.c Sun Jan 27 17:13:18 2013 (r245984) @@ -518,6 +518,7 @@ mpt_print_reply(void *vmsg) static void mpt_print_request_hdr(MSG_REQUEST_HEADER *req) { + printf("%s @ %p\n", mpt_ioc_function(req->Function), req); printf("\tChain Offset 0x%02x\n", req->ChainOffset); printf("\tMsgFlags 0x%02x\n", req->MsgFlags); @@ -841,13 +842,8 @@ mpt_dump_request(struct mpt_softc *mpt, uint32_t *pReq = req->req_vbuf; int o; -#if __FreeBSD_version >= 500000 mpt_prt(mpt, "Send Request %d (%jx):", req->index, (uintmax_t) req->req_pbuf); -#else - mpt_prt(mpt, "Send Request %d (%llx):", - req->index, (unsigned long long) req->req_pbuf); -#endif for (o = 0; o < mpt->ioc_facts.RequestFrameSize; o++) { if ((o & 0x7) == 0) { mpt_prtc(mpt, "\n"); @@ -858,33 +854,6 @@ mpt_dump_request(struct mpt_softc *mpt, mpt_prtc(mpt, "\n"); } -#if __FreeBSD_version < 500000 -void -mpt_lprt(struct mpt_softc *mpt, int level, const char *fmt, ...) -{ - va_list ap; - if (level <= mpt->verbose) { - printf("%s: ", device_get_nameunit(mpt->dev)); - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } -} - -#if 0 -void -mpt_lprtc(struct mpt_softc *mpt, int level, const char *fmt, ...) -{ - va_list ap; - if (level <= mpt->verbose) { - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } -} -#endif -#endif - void mpt_prt(struct mpt_softc *mpt, const char *fmt, ...) { Modified: stable/8/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:11 2013 (r245983) +++ stable/8/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:18 2013 (r245984) @@ -51,15 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#if __FreeBSD_version < 500000 -#include -#define GIANT_REQUIRED -#endif -#include - #include #include #include @@ -118,11 +113,7 @@ static void mpt_enable_vol(struct mpt_so static void mpt_verify_mwce(struct mpt_softc *, struct mpt_raid_volume *); static void mpt_adjust_queue_depth(struct mpt_softc *, struct mpt_raid_volume *, struct cam_path *); -#if __FreeBSD_version < 500000 -#define mpt_raid_sysctl_attach(x) do { } while (0) -#else static void mpt_raid_sysctl_attach(struct mpt_softc *); -#endif static const char *mpt_vol_type(struct mpt_raid_volume *vol); static const char *mpt_vol_state(struct mpt_raid_volume *vol); @@ -1520,15 +1511,9 @@ mpt_refresh_raid_data(struct mpt_softc * mpt_vol_prt(mpt, mpt_vol, "%s Priority Re-Sync\n", prio ? "High" : "Low"); } -#if __FreeBSD_version >= 500000 mpt_vol_prt(mpt, mpt_vol, "%ju of %ju " "blocks remaining\n", (uintmax_t)left, (uintmax_t)total); -#else - mpt_vol_prt(mpt, mpt_vol, "%llu of %llu " - "blocks remaining\n", (uint64_t)left, - (uint64_t)total); -#endif /* Periodically report on sync progress. */ mpt_schedule_raid_refresh(mpt); @@ -1593,14 +1578,8 @@ mpt_raid_timer(void *arg) struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; -#if __FreeBSD_version < 500000 - MPT_LOCK(mpt); -#endif MPT_LOCK_ASSERT(mpt); mpt_raid_wakeup(mpt); -#if __FreeBSD_version < 500000 - MPT_UNLOCK(mpt); -#endif } static void @@ -1644,7 +1623,6 @@ mpt_raid_free_mem(struct mpt_softc *mpt) mpt->raid_max_disks = 0; } -#if __FreeBSD_version >= 500000 static int mpt_raid_set_vol_resync_rate(struct mpt_softc *mpt, u_int rate) { @@ -1869,4 +1847,3 @@ mpt_raid_sysctl_attach(struct mpt_softc &mpt->raid_nonopt_volumes, 0, "number of nonoptimal volumes"); } -#endif From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:13:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A8B73F98; Sun, 27 Jan 2013 17:13:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8C974C02; Sun, 27 Jan 2013 17:13:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHDMps016225; Sun, 27 Jan 2013 17:13:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHDL7q016218; Sun, 27 Jan 2013 17:13:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271713.r0RHDL7q016218@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r245985 - stable/7/sys/dev/mpt X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:13:22 -0000 Author: marius Date: Sun Jan 27 17:13:21 2013 New Revision: 245985 URL: http://svnweb.freebsd.org/changeset/base/245985 Log: MFC: r241874 After r241858 (MFC'ed to stable/7 in r242287), remove the remainder of FreeBSD ~4 support from mpt(4). Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_debug.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Sun Jan 27 17:13:18 2013 (r245984) +++ stable/7/sys/dev/mpt/mpt.c Sun Jan 27 17:13:21 2013 (r245985) @@ -286,10 +286,8 @@ mpt_modevent(module_t mod, int type, voi } case MOD_SHUTDOWN: break; -#if __FreeBSD_version >= 500000 case MOD_QUIESCE: break; -#endif case MOD_UNLOAD: error = pers->unload(pers); mpt_personalities[pers->id] = NULL; @@ -1471,15 +1469,9 @@ mpt_recv_handshake_reply(struct mpt_soft */ if ((reply_len >> 1) != hdr->MsgLength && (hdr->Function != MPI_FUNCTION_IOC_FACTS)){ -#if __FreeBSD_version >= 500000 mpt_prt(mpt, "reply length does not match message length: " "got %x; expected %zx for function %x\n", hdr->MsgLength << 2, reply_len << 1, hdr->Function); -#else - mpt_prt(mpt, "reply length does not match message length: " - "got %x; expected %x for function %x\n", - hdr->MsgLength << 2, reply_len << 1, hdr->Function); -#endif } /* Get rest of the reply; but don't overflow the provided buffer */ @@ -2155,7 +2147,6 @@ mpt_disable_ints(struct mpt_softc *mpt) static void mpt_sysctl_attach(struct mpt_softc *mpt) { -#if __FreeBSD_version >= 500000 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); @@ -2170,7 +2161,6 @@ mpt_sysctl_attach(struct mpt_softc *mpt) "failure_id", CTLFLAG_RW, &mpt->failure_id, -1, "Next Target to Fail"); #endif -#endif } int Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Sun Jan 27 17:13:18 2013 (r245984) +++ stable/7/sys/dev/mpt/mpt.h Sun Jan 27 17:13:21 2013 (r245985) @@ -100,52 +100,34 @@ #define _MPT_H_ /********************************* OS Includes ********************************/ -#include #include #include +#include +#include #include #include -#if __FreeBSD_version < 500000 #include -#include -#include -#include -#else #include -#include -#include #include +#include #include -#include -#endif #include -#include -#include +#include +#include +#include +#include #include #include -#if __FreeBSD_version < 500000 -#include -#include -#endif - #ifdef __sparc64__ #include #include #endif -#include - -#if __FreeBSD_version < 500000 -#include -#include -#else #include #include -#endif -#include #include "opt_ddb.h" /**************************** Register Definitions ****************************/ @@ -241,7 +223,6 @@ int mpt_modevent(module_t, int, void *); #if __FreeBSD_version < 600000 #define bus_get_dma_tag(x) NULL #endif -#if __FreeBSD_version >= 501102 #define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ lowaddr, highaddr, filter, filterarg, \ maxsize, nsegments, maxsegsz, flags, \ @@ -251,17 +232,6 @@ int mpt_modevent(module_t, int, void *); maxsize, nsegments, maxsegsz, flags, \ busdma_lock_mutex, &(mpt)->mpt_lock, \ dma_tagp) -#else -#define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) \ - bus_dma_tag_create(parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) -#endif - struct mpt_map_info { struct mpt_softc *mpt; int error; @@ -291,14 +261,9 @@ void mpt_map_rquest(void *, bus_dma_segm kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) #define mpt_kthread_exit(status) \ kproc_exit(status) -#elif __FreeBSD_version > 500005 -#define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mpt_kthread_exit(status) \ - kthread_exit(status) #else #define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, fmtstr, arg) + kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) #define mpt_kthread_exit(status) \ kthread_exit(status) #endif @@ -599,13 +564,8 @@ struct mptsas_portinfo { struct mpt_softc { device_t dev; -#if __FreeBSD_version < 500000 - uint32_t mpt_islocked; - int mpt_splsaved; -#else struct mtx mpt_lock; int mpt_locksetup; -#endif uint32_t mpt_pers_mask; uint32_t : 7, @@ -676,7 +636,6 @@ struct mpt_softc { #define mpt_fcport_speed cfg.fc._port_speed } fc; } cfg; -#if __FreeBSD_version >= 500000 /* * Device config information stored up for sysctl to access */ @@ -689,7 +648,6 @@ struct mpt_softc { char wwpn[19]; } fc; } scinfo; -#endif /* Controller Info for RAID information */ CONFIG_PAGE_IOC_2 * ioc_page2; @@ -830,74 +788,6 @@ mpt_assign_serno(struct mpt_softc *mpt, } /***************************** Locking Primitives *****************************/ -#if __FreeBSD_version < 500000 -#define MPT_IFLAGS INTR_TYPE_CAM -#define MPT_LOCK(mpt) mpt_lockspl(mpt) -#define MPT_UNLOCK(mpt) mpt_unlockspl(mpt) -#define MPT_OWNED(mpt) mpt->mpt_islocked -#define MPT_LOCK_ASSERT(mpt) -#define MPTLOCK_2_CAMLOCK MPT_UNLOCK -#define CAMLOCK_2_MPTLOCK MPT_LOCK -#define MPT_LOCK_SETUP(mpt) -#define MPT_LOCK_DESTROY(mpt) - -static __inline void mpt_lockspl(struct mpt_softc *mpt); -static __inline void mpt_unlockspl(struct mpt_softc *mpt); - -static __inline void -mpt_lockspl(struct mpt_softc *mpt) -{ - int s; - - s = splcam(); - if (mpt->mpt_islocked++ == 0) { - mpt->mpt_splsaved = s; - } else { - splx(s); - panic("Recursed lock with mask: 0x%x", s); - } -} - -static __inline void -mpt_unlockspl(struct mpt_softc *mpt) -{ - if (mpt->mpt_islocked) { - if (--mpt->mpt_islocked == 0) { - splx(mpt->mpt_splsaved); - } - } else - panic("Negative lock count"); -} - -static __inline int -mpt_sleep(struct mpt_softc *mpt, void *ident, int priority, - const char *wmesg, int timo) -{ - int saved_cnt; - int saved_spl; - int error; - - KASSERT(mpt->mpt_islocked <= 1, ("Invalid lock count on tsleep")); - saved_cnt = mpt->mpt_islocked; - saved_spl = mpt->mpt_splsaved; - mpt->mpt_islocked = 0; - error = tsleep(ident, priority, wmesg, timo); - KASSERT(mpt->mpt_islocked == 0, ("Invalid lock count on wakeup")); - mpt->mpt_islocked = saved_cnt; - mpt->mpt_splsaved = saved_spl; - return (error); -} - -#define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)); -#define mpt_req_untimeout(req, func, arg) \ - callout_stop(&(req)->callout) -#define mpt_callout_init(mpt, c) \ - callout_init(c) -#define mpt_callout_drain(mpt, c) \ - callout_stop(c) - -#else #if 1 #define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE #define MPT_LOCK_SETUP(mpt) \ @@ -957,7 +847,6 @@ mpt_sleep(struct mpt_softc *mpt, void *i return (r); } #endif -#endif /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); @@ -1098,7 +987,6 @@ enum { MPT_PRT_NONE=100 }; -#if __FreeBSD_version > 500000 #define mpt_lprt(mpt, level, ...) \ do { \ if (level <= (mpt)->verbose) \ @@ -1112,14 +1000,7 @@ do { \ mpt_prtc(mpt, __VA_ARGS__); \ } while (0) #endif -#else -void mpt_lprt(struct mpt_softc *, int, const char *, ...) - __printflike(3, 4); -#if 0 -void mpt_lprtc(struct mpt_softc *, int, const char *, ...) - __printflike(3, 4); -#endif -#endif + void mpt_prt(struct mpt_softc *, const char *, ...) __printflike(2, 3); void mpt_prtc(struct mpt_softc *, const char *, ...) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:18 2013 (r245984) +++ stable/7/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:21 2013 (r245985) @@ -105,11 +105,10 @@ __FBSDID("$FreeBSD$"); #include "dev/mpt/mpilib/mpi_targ.h" #include "dev/mpt/mpilib/mpi_fc.h" #include "dev/mpt/mpilib/mpi_sas.h" -#if __FreeBSD_version >= 500000 -#include -#endif + #include #include +#include #if __FreeBSD_version >= 700025 #ifndef CAM_NEW_TRAN_CODE @@ -125,7 +124,6 @@ mpt_get_spi_settings(struct mpt_softc *, static void mpt_setwidth(struct mpt_softc *, int, int); static void mpt_setsync(struct mpt_softc *, int, int, int); static int mpt_update_spi_config(struct mpt_softc *, int); -static void mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended); static mpt_reply_handler_t mpt_scsi_reply_handler; static mpt_reply_handler_t mpt_scsi_tmf_reply_handler; @@ -416,6 +414,8 @@ cleanup: static int mpt_read_config_info_fc(struct mpt_softc *mpt) { + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; char *topology = NULL; int rv; @@ -473,33 +473,27 @@ mpt_read_config_info_fc(struct mpt_softc mpt->mpt_fcport_page0.WWPN.High, mpt->mpt_fcport_page0.WWPN.Low, mpt->mpt_fcport_speed); -#if __FreeBSD_version >= 500000 MPT_UNLOCK(mpt); - { - struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); - struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); + ctx = device_get_sysctl_ctx(mpt->dev); + tree = device_get_sysctl_tree(mpt->dev); - snprintf(mpt->scinfo.fc.wwnn, - sizeof (mpt->scinfo.fc.wwnn), "0x%08x%08x", - mpt->mpt_fcport_page0.WWNN.High, - mpt->mpt_fcport_page0.WWNN.Low); - - snprintf(mpt->scinfo.fc.wwpn, - sizeof (mpt->scinfo.fc.wwpn), "0x%08x%08x", - mpt->mpt_fcport_page0.WWPN.High, - mpt->mpt_fcport_page0.WWPN.Low); - - SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, - "World Wide Node Name"); - - SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, - "World Wide Port Name"); + snprintf(mpt->scinfo.fc.wwnn, sizeof (mpt->scinfo.fc.wwnn), + "0x%08x%08x", mpt->mpt_fcport_page0.WWNN.High, + mpt->mpt_fcport_page0.WWNN.Low); + + snprintf(mpt->scinfo.fc.wwpn, sizeof (mpt->scinfo.fc.wwpn), + "0x%08x%08x", mpt->mpt_fcport_page0.WWPN.High, + mpt->mpt_fcport_page0.WWPN.Low); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, + "World Wide Node Name"); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, + "World Wide Port Name"); - } MPT_LOCK(mpt); -#endif return (0); } @@ -1246,9 +1240,6 @@ mpt_timeout(void *arg) ccb = (union ccb *)arg; mpt = ccb->ccb_h.ccb_mpt_ptr; -#if __FreeBSD_version < 500000 - MPT_LOCK(mpt); -#endif MPT_LOCK_ASSERT(mpt); req = ccb->ccb_h.ccb_req_ptr; mpt_prt(mpt, "request %p:%u timed out for ccb %p (req->ccb %p)\n", req, @@ -1260,9 +1251,6 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } -#if __FreeBSD_version < 500000 - MPT_UNLOCK(mpt); -#endif } /* @@ -3652,7 +3640,7 @@ mpt_action(struct cam_sim *sim, union cc mpt_set_ccb_status(ccb, CAM_REQ_INVALID); break; } - mpt_calc_geometry(ccg, /*extended*/1); + cam_calc_geometry(ccg, /* extended */ 1); KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); break; } @@ -4016,33 +4004,6 @@ mpt_update_spi_config(struct mpt_softc * return (0); } -static void -mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended) -{ -#if __FreeBSD_version >= 500000 - cam_calc_geometry(ccg, extended); -#else - uint32_t size_mb; - uint32_t secs_per_cylinder; - - if (ccg->block_size == 0) { - ccg->ccb_h.status = CAM_REQ_INVALID; - return; - } - size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size); - if (size_mb > 1024 && extended) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccg->ccb_h.status = CAM_REQ_CMP; -#endif -} - /****************************** Timeout Recovery ******************************/ static int mpt_spawn_recovery_thread(struct mpt_softc *mpt) Modified: stable/7/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_debug.c Sun Jan 27 17:13:18 2013 (r245984) +++ stable/7/sys/dev/mpt/mpt_debug.c Sun Jan 27 17:13:21 2013 (r245985) @@ -518,6 +518,7 @@ mpt_print_reply(void *vmsg) static void mpt_print_request_hdr(MSG_REQUEST_HEADER *req) { + printf("%s @ %p\n", mpt_ioc_function(req->Function), req); printf("\tChain Offset 0x%02x\n", req->ChainOffset); printf("\tMsgFlags 0x%02x\n", req->MsgFlags); @@ -841,13 +842,8 @@ mpt_dump_request(struct mpt_softc *mpt, uint32_t *pReq = req->req_vbuf; int o; -#if __FreeBSD_version >= 500000 mpt_prt(mpt, "Send Request %d (%jx):", req->index, (uintmax_t) req->req_pbuf); -#else - mpt_prt(mpt, "Send Request %d (%llx):", - req->index, (unsigned long long) req->req_pbuf); -#endif for (o = 0; o < mpt->ioc_facts.RequestFrameSize; o++) { if ((o & 0x7) == 0) { mpt_prtc(mpt, "\n"); @@ -858,33 +854,6 @@ mpt_dump_request(struct mpt_softc *mpt, mpt_prtc(mpt, "\n"); } -#if __FreeBSD_version < 500000 -void -mpt_lprt(struct mpt_softc *mpt, int level, const char *fmt, ...) -{ - va_list ap; - if (level <= mpt->verbose) { - printf("%s: ", device_get_nameunit(mpt->dev)); - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } -} - -#if 0 -void -mpt_lprtc(struct mpt_softc *mpt, int level, const char *fmt, ...) -{ - va_list ap; - if (level <= mpt->verbose) { - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } -} -#endif -#endif - void mpt_prt(struct mpt_softc *mpt, const char *fmt, ...) { Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:18 2013 (r245984) +++ stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:21 2013 (r245985) @@ -51,16 +51,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include -#if __FreeBSD_version < 500000 -#include -#define GIANT_REQUIRED -#endif -#include - #include #include #include @@ -119,11 +114,7 @@ static void mpt_enable_vol(struct mpt_so static void mpt_verify_mwce(struct mpt_softc *, struct mpt_raid_volume *); static void mpt_adjust_queue_depth(struct mpt_softc *, struct mpt_raid_volume *, struct cam_path *); -#if __FreeBSD_version < 500000 -#define mpt_raid_sysctl_attach(x) do { } while (0) -#else static void mpt_raid_sysctl_attach(struct mpt_softc *); -#endif static const char *mpt_vol_type(struct mpt_raid_volume *vol); static const char *mpt_vol_state(struct mpt_raid_volume *vol); @@ -1536,15 +1527,9 @@ mpt_refresh_raid_data(struct mpt_softc * mpt_vol_prt(mpt, mpt_vol, "%s Priority Re-Sync\n", prio ? "High" : "Low"); } -#if __FreeBSD_version >= 500000 mpt_vol_prt(mpt, mpt_vol, "%ju of %ju " "blocks remaining\n", (uintmax_t)left, (uintmax_t)total); -#else - mpt_vol_prt(mpt, mpt_vol, "%llu of %llu " - "blocks remaining\n", (uint64_t)left, - (uint64_t)total); -#endif /* Periodically report on sync progress. */ mpt_schedule_raid_refresh(mpt); @@ -1609,14 +1594,8 @@ mpt_raid_timer(void *arg) struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; -#if __FreeBSD_version < 500000 - MPT_LOCK(mpt); -#endif MPT_LOCK_ASSERT(mpt); mpt_raid_wakeup(mpt); -#if __FreeBSD_version < 500000 - MPT_UNLOCK(mpt); -#endif } static void @@ -1660,7 +1639,6 @@ mpt_raid_free_mem(struct mpt_softc *mpt) mpt->raid_max_disks = 0; } -#if __FreeBSD_version >= 500000 static int mpt_raid_set_vol_resync_rate(struct mpt_softc *mpt, u_int rate) { @@ -1885,4 +1863,3 @@ mpt_raid_sysctl_attach(struct mpt_softc &mpt->raid_nonopt_volumes, 0, "number of nonoptimal volumes"); } -#endif From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:15:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4C243356; Sun, 27 Jan 2013 17:15:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C28FC2B; Sun, 27 Jan 2013 17:15:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHFvW8016698; Sun, 27 Jan 2013 17:15:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHFuAx016692; Sun, 27 Jan 2013 17:15:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271715.r0RHFuAx016692@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245986 - stable/9/sys/dev/mpt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:15:57 -0000 Author: marius Date: Sun Jan 27 17:15:56 2013 New Revision: 245986 URL: http://svnweb.freebsd.org/changeset/base/245986 Log: MFC: r241875 Remove support for using Giant for locking within mpt(4). Finer grained locking has been working fine for ~5.5 years by now. Modified: stable/9/sys/dev/mpt/mpt.h stable/9/sys/dev/mpt/mpt_cam.c stable/9/sys/dev/mpt/mpt_raid.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mpt/mpt.h ============================================================================== --- stable/9/sys/dev/mpt/mpt.h Sun Jan 27 17:13:21 2013 (r245985) +++ stable/9/sys/dev/mpt/mpt.h Sun Jan 27 17:15:56 2013 (r245986) @@ -788,7 +788,6 @@ mpt_assign_serno(struct mpt_softc *mpt, } /***************************** Locking Primitives *****************************/ -#if 1 #define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE #define MPT_LOCK_SETUP(mpt) \ mtx_init(&mpt->mpt_lock, "mpt", NULL, MTX_DEF); \ @@ -803,8 +802,6 @@ mpt_assign_serno(struct mpt_softc *mpt, #define MPT_UNLOCK(mpt) mtx_unlock(&(mpt)->mpt_lock) #define MPT_OWNED(mpt) mtx_owned(&(mpt)->mpt_lock) #define MPT_LOCK_ASSERT(mpt) mtx_assert(&(mpt)->mpt_lock, MA_OWNED) -#define MPTLOCK_2_CAMLOCK(mpt) -#define CAMLOCK_2_MPTLOCK(mpt) #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ @@ -816,38 +813,6 @@ mpt_assign_serno(struct mpt_softc *mpt, #define mpt_callout_drain(mpt, c) \ callout_drain(c) -#else - -#define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY -#define MPT_LOCK_SETUP(mpt) do { } while (0) -#define MPT_LOCK_DESTROY(mpt) do { } while (0) -#define MPT_LOCK_ASSERT(mpt) mtx_assert(&Giant, MA_OWNED) -#define MPT_LOCK(mpt) mtx_lock(&Giant) -#define MPT_UNLOCK(mpt) mtx_unlock(&Giant) -#define MPTLOCK_2_CAMLOCK(mpt) -#define CAMLOCK_2_MPTLOCK(mpt) - -#define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)) -#define mpt_req_untimeout(req, func, arg) \ - callout_stop(&(req)->callout) -#define mpt_callout_init(mpt, c) \ - callout_init(c, 0) -#define mpt_callout_drain(mpt, c) \ - callout_drain(c) - -static __inline int -mpt_sleep(struct mpt_softc *, void *, int, const char *, int); - -static __inline int -mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) -{ - int r; - r = tsleep(i, p, w, t); - return (r); -} -#endif - /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); static __inline uint32_t mpt_read(struct mpt_softc *, int); Modified: stable/9/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:21 2013 (r245985) +++ stable/9/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:15:56 2013 (r245986) @@ -1347,9 +1347,7 @@ bad: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1583,9 +1581,7 @@ bad: if (seg < nseg && nxt_off >= MPT_REQUEST_AREA) { request_t *nrq; - CAMLOCK_2_MPTLOCK(mpt); nrq = mpt_get_request(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); if (nrq == NULL) { error = ENOMEM; @@ -1633,9 +1629,7 @@ out: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1667,9 +1661,7 @@ out: tgt->state = TGT_STATE_MOVING_DATA; #endif } - CAMLOCK_2_MPTLOCK(mpt); mpt_send_cmd(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); } static void @@ -1758,9 +1750,7 @@ bad: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1978,9 +1968,7 @@ bad: if (seg < nseg && nxt_off >= MPT_REQUEST_AREA) { request_t *nrq; - CAMLOCK_2_MPTLOCK(mpt); nrq = mpt_get_request(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); if (nrq == NULL) { error = ENOMEM; @@ -2028,9 +2016,7 @@ out: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -2062,9 +2048,7 @@ out: tgt->state = TGT_STATE_MOVING_DATA; #endif } - CAMLOCK_2_MPTLOCK(mpt); mpt_send_cmd(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); } static void @@ -2083,7 +2067,6 @@ mpt_start(struct cam_sim *sim, union ccb mpt = ccb->ccb_h.ccb_mpt_ptr; raid_passthru = (sim == mpt->phydisk_sim); - CAMLOCK_2_MPTLOCK(mpt); if ((req = mpt_get_request(mpt, FALSE)) == NULL) { if (mpt->outofbeer == 0) { mpt->outofbeer = 1; @@ -2092,14 +2075,12 @@ mpt_start(struct cam_sim *sim, union ccb } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); return; } #ifdef INVARIANTS mpt_req_not_spcl(mpt, req, "mpt_start", __LINE__); #endif - MPTLOCK_2_CAMLOCK(mpt); if (sizeof (bus_addr_t) > 4) { cb = mpt_execute_req_a64; @@ -2121,15 +2102,12 @@ mpt_start(struct cam_sim *sim, union ccb mpt_req->Function = MPI_FUNCTION_SCSI_IO_REQUEST; if (raid_passthru) { mpt_req->Function = MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH; - CAMLOCK_2_MPTLOCK(mpt); if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { - MPTLOCK_2_CAMLOCK(mpt); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb); return; } - MPTLOCK_2_CAMLOCK(mpt); mpt_req->Bus = 0; /* we never set bus here */ } else { tgt = ccb->ccb_h.target_id; @@ -2424,7 +2402,6 @@ mpt_cam_event(struct mpt_softc *mpt, req } else { pathid = cam_sim_path(mpt->sim); } - MPTLOCK_2_CAMLOCK(mpt); /* * Allocate a CCB, create a wildcard path for this bus, * and schedule a rescan. @@ -2432,19 +2409,16 @@ mpt_cam_event(struct mpt_softc *mpt, req ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { mpt_prt(mpt, "unable to alloc CCB for rescan\n"); - CAMLOCK_2_MPTLOCK(mpt); break; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); break; } xpt_rescan(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; } #else @@ -2541,13 +2515,11 @@ mpt_cam_event(struct mpt_softc *mpt, req } else { sim = mpt->sim; } - MPTLOCK_2_CAMLOCK(mpt); for (lun_id = 0; lun_id < MPT_MAX_LUNS; lun_id++) { if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), pqf->TargetID, lun_id) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create a path to send " "XPT_REL_SIMQ"); - CAMLOCK_2_MPTLOCK(mpt); break; } xpt_setup_ccb(&crs.ccb_h, tmppath, 5); @@ -2561,7 +2533,6 @@ mpt_cam_event(struct mpt_softc *mpt, req } xpt_free_path(tmppath); } - CAMLOCK_2_MPTLOCK(mpt); break; } case MPI_EVENT_IR_RESYNC_UPDATE: @@ -2583,39 +2554,32 @@ mpt_cam_event(struct mpt_softc *mpt, req sim = mpt->sim; switch(psdsc->ReasonCode) { case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: - MPTLOCK_2_CAMLOCK(mpt); ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { mpt_prt(mpt, "unable to alloc CCB for rescan\n"); - CAMLOCK_2_MPTLOCK(mpt); break; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); break; } xpt_rescan(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: - MPTLOCK_2_CAMLOCK(mpt); if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create path for async event"); - CAMLOCK_2_MPTLOCK(mpt); break; } xpt_async(AC_LOST_DEVICE, tmppath, NULL); xpt_free_path(tmppath); - CAMLOCK_2_MPTLOCK(mpt); break; case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET: case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL: @@ -2735,9 +2699,7 @@ mpt_scsi_reply_handler(struct mpt_softc req, req->serno); } KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); if ((req->state & REQ_STATE_TIMEDOUT) == 0) { TAILQ_REMOVE(&mpt->request_pending_list, req, links); } else { @@ -3323,15 +3285,12 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.func_code != XPT_PATH_INQ && ccb->ccb_h.func_code != XPT_RESET_BUS && ccb->ccb_h.func_code != XPT_RESET_DEV) { - CAMLOCK_2_MPTLOCK(mpt); if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { - MPTLOCK_2_CAMLOCK(mpt); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb); return; } - MPTLOCK_2_CAMLOCK(mpt); } ccb->ccb_h.ccb_mpt_ptr = mpt; @@ -3380,9 +3339,7 @@ mpt_action(struct cam_sim *sim, union cc } else { xpt_print(ccb->ccb_h.path, "reset device\n"); } - CAMLOCK_2_MPTLOCK(mpt); (void) mpt_bus_reset(mpt, tgt, lun, FALSE); - MPTLOCK_2_CAMLOCK(mpt); /* * mpt_bus_reset is always successful in that it @@ -3396,7 +3353,6 @@ mpt_action(struct cam_sim *sim, union cc case XPT_ABORT: { union ccb *accb = ccb->cab.abort_ccb; - CAMLOCK_2_MPTLOCK(mpt); switch (accb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: case XPT_IMMEDIATE_NOTIFY: @@ -3413,7 +3369,6 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.status = CAM_REQ_INVALID; break; } - MPTLOCK_2_CAMLOCK(mpt); break; } @@ -3553,7 +3508,6 @@ mpt_action(struct cam_sim *sim, union cc period >>= MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD; } #endif - CAMLOCK_2_MPTLOCK(mpt); if (dval & DP_DISC_ENABLE) { mpt->mpt_disc_enable |= (1 << tgt); } else if (dval & DP_DISC_DISABL) { @@ -3571,7 +3525,6 @@ mpt_action(struct cam_sim *sim, union cc mpt_setsync(mpt, tgt, period, offset); } if (dval == 0) { - MPTLOCK_2_CAMLOCK(mpt); mpt_set_ccb_status(ccb, CAM_REQ_CMP); break; } @@ -3583,7 +3536,6 @@ mpt_action(struct cam_sim *sim, union cc } else { mpt_set_ccb_status(ccb, CAM_REQ_CMP); } - MPTLOCK_2_CAMLOCK(mpt); break; } case XPT_GET_TRAN_SETTINGS: @@ -3758,14 +3710,12 @@ mpt_action(struct cam_sim *sim, union cc { int result; - CAMLOCK_2_MPTLOCK(mpt); if (ccb->cel.enable) result = mpt_enable_lun(mpt, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); else result = mpt_disable_lun(mpt, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); - MPTLOCK_2_CAMLOCK(mpt); if (result == 0) { mpt_set_ccb_status(ccb, CAM_REQ_CMP); } else { @@ -3795,7 +3745,6 @@ mpt_action(struct cam_sim *sim, union cc } else { trtp = &mpt->trt[lun]; } - CAMLOCK_2_MPTLOCK(mpt); if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { mpt_lprt(mpt, MPT_PRT_DEBUG1, "Put FREE ATIO %p lun %d\n", ccb, lun); @@ -3810,13 +3759,10 @@ mpt_action(struct cam_sim *sim, union cc mpt_lprt(mpt, MPT_PRT_ALWAYS, "Got Notify ACK\n"); } mpt_set_ccb_status(ccb, CAM_REQ_INPROG); - MPTLOCK_2_CAMLOCK(mpt); return; } case XPT_CONT_TARGET_IO: - CAMLOCK_2_MPTLOCK(mpt); mpt_target_start_io(mpt, ccb); - MPTLOCK_2_CAMLOCK(mpt); return; default: @@ -3860,18 +3806,15 @@ mpt_get_spi_settings(struct mpt_softc *m CONFIG_PAGE_SCSI_DEVICE_0 tmp; dval = 0; - CAMLOCK_2_MPTLOCK(mpt); tmp = mpt->mpt_dev_page0[tgt]; rv = mpt_read_cur_cfg_page(mpt, tgt, &tmp.Header, sizeof(tmp), FALSE, 5000); if (rv) { - MPTLOCK_2_CAMLOCK(mpt); mpt_prt(mpt, "can't get tgt %d config page 0\n", tgt); return (rv); } mpt2host_config_page_scsi_device_0(&tmp); - MPTLOCK_2_CAMLOCK(mpt); mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_get_spi_settings[%d]: current NP %x Info %x\n", tgt, tmp.NegotiatedParameters, tmp.Information); @@ -4500,18 +4443,14 @@ mpt_target_start_io(struct mpt_softc *mp xpt_freeze_simq(mpt->sim, 1); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; tgt->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; default: mpt_prt(mpt, "ccb %p flags 0x%x tag 0x%08x had bad request " "starting I/O\n", ccb, csio->ccb_h.flags, csio->tag_id); mpt_tgt_dump_req_state(mpt, cmd_req); mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } @@ -4531,9 +4470,7 @@ mpt_target_start_io(struct mpt_softc *mp } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } ccb->ccb_h.status = CAM_SIM_QUEUED | CAM_REQ_INPROG; @@ -4607,7 +4544,6 @@ mpt_target_start_io(struct mpt_softc *mp "nxtstate=%d\n", csio, csio->tag_id, csio->dxfer_len, tgt->resid, ccb->ccb_h.flags, req, req->serno, tgt->state); - MPTLOCK_2_CAMLOCK(mpt); if ((ccb->ccb_h.flags & CAM_SCATTER_VALID) == 0) { if ((ccb->ccb_h.flags & CAM_DATA_PHYS) == 0) { int error; @@ -4647,7 +4583,6 @@ mpt_target_start_io(struct mpt_softc *mp (*cb)(req, sgs, csio->sglist_cnt, 0); } } - CAMLOCK_2_MPTLOCK(mpt); } else { uint8_t *sp = NULL, sense[MPT_SENSE_SIZE]; @@ -4664,9 +4599,7 @@ mpt_target_start_io(struct mpt_softc *mp ccb->ccb_h.status, tgt->resid, tgt->bytes_xfered); mpt_set_ccb_status(ccb, CAM_REQ_CMP); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } if (ccb->ccb_h.flags & CAM_SEND_SENSE) { @@ -4872,9 +4805,7 @@ mpt_scsi_tgt_status(struct mpt_softc *mp if (ccb) { ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); } else { mpt_prt(mpt, "could not allocate status request- dropping\n"); @@ -5049,9 +4980,7 @@ mpt_scsi_tgt_tsk_mgmt(struct mpt_softc * */ tgt->ccb = (union ccb *) inot; inot->ccb_h.status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; - MPTLOCK_2_CAMLOCK(mpt); xpt_done((union ccb *)inot); - CAMLOCK_2_MPTLOCK(mpt); } static void @@ -5321,9 +5250,7 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, itag, atiop->tag_id, tgt->reply_desc, tgt->resid); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done((union ccb *)atiop); - CAMLOCK_2_MPTLOCK(mpt); } static void @@ -5432,9 +5359,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt->outofbeer = 0; mpt_lprt(mpt, MPT_PRT_DEBUG, "THAWQ\n"); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; } /* @@ -5517,9 +5442,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt->outofbeer = 0; mpt_lprt(mpt, MPT_PRT_DEBUG, "THAWQ\n"); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); } break; } Modified: stable/9/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:21 2013 (r245985) +++ stable/9/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:15:56 2013 (r245986) @@ -692,9 +692,7 @@ mpt_raid_thread(void *arg) */ if (firstrun) { firstrun = 0; - MPTLOCK_2_CAMLOCK(mpt); xpt_release_simq(mpt->phydisk_sim, TRUE); - CAMLOCK_2_MPTLOCK(mpt); } if (mpt->raid_rescan != 0) { @@ -1664,19 +1662,16 @@ mpt_raid_set_vol_queue_depth(struct mpt_ mpt->raid_rescan = 0; - MPTLOCK_2_CAMLOCK(mpt); error = xpt_create_path(&path, xpt_periph, cam_sim_path(mpt->sim), mpt_vol->config_page->VolumeID, /*lun*/0); if (error != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_vol_prt(mpt, mpt_vol, "Unable to allocate path!\n"); continue; } mpt_adjust_queue_depth(mpt, mpt_vol, path); xpt_free_path(path); - CAMLOCK_2_MPTLOCK(mpt); } MPT_UNLOCK(mpt); return (0); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:15:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 583EF357; Sun, 27 Jan 2013 17:15:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48583C2C; Sun, 27 Jan 2013 17:15:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHFxqg016737; Sun, 27 Jan 2013 17:15:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHFwSd016730; Sun, 27 Jan 2013 17:15:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271715.r0RHFwSd016730@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245987 - stable/8/sys/dev/mpt X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:15:59 -0000 Author: marius Date: Sun Jan 27 17:15:58 2013 New Revision: 245987 URL: http://svnweb.freebsd.org/changeset/base/245987 Log: MFC: r241875 Remove support for using Giant for locking within mpt(4). Finer grained locking has been working fine for ~5.5 years by now. Modified: stable/8/sys/dev/mpt/mpt.h stable/8/sys/dev/mpt/mpt_cam.c stable/8/sys/dev/mpt/mpt_raid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mpt/ (props changed) Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Sun Jan 27 17:15:56 2013 (r245986) +++ stable/8/sys/dev/mpt/mpt.h Sun Jan 27 17:15:58 2013 (r245987) @@ -788,7 +788,6 @@ mpt_assign_serno(struct mpt_softc *mpt, } /***************************** Locking Primitives *****************************/ -#if 1 #define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE #define MPT_LOCK_SETUP(mpt) \ mtx_init(&mpt->mpt_lock, "mpt", NULL, MTX_DEF); \ @@ -803,8 +802,6 @@ mpt_assign_serno(struct mpt_softc *mpt, #define MPT_UNLOCK(mpt) mtx_unlock(&(mpt)->mpt_lock) #define MPT_OWNED(mpt) mtx_owned(&(mpt)->mpt_lock) #define MPT_LOCK_ASSERT(mpt) mtx_assert(&(mpt)->mpt_lock, MA_OWNED) -#define MPTLOCK_2_CAMLOCK(mpt) -#define CAMLOCK_2_MPTLOCK(mpt) #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ @@ -816,38 +813,6 @@ mpt_assign_serno(struct mpt_softc *mpt, #define mpt_callout_drain(mpt, c) \ callout_drain(c) -#else - -#define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY -#define MPT_LOCK_SETUP(mpt) do { } while (0) -#define MPT_LOCK_DESTROY(mpt) do { } while (0) -#define MPT_LOCK_ASSERT(mpt) mtx_assert(&Giant, MA_OWNED) -#define MPT_LOCK(mpt) mtx_lock(&Giant) -#define MPT_UNLOCK(mpt) mtx_unlock(&Giant) -#define MPTLOCK_2_CAMLOCK(mpt) -#define CAMLOCK_2_MPTLOCK(mpt) - -#define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)) -#define mpt_req_untimeout(req, func, arg) \ - callout_stop(&(req)->callout) -#define mpt_callout_init(mpt, c) \ - callout_init(c, 0) -#define mpt_callout_drain(mpt, c) \ - callout_drain(c) - -static __inline int -mpt_sleep(struct mpt_softc *, void *, int, const char *, int); - -static __inline int -mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) -{ - int r; - r = tsleep(i, p, w, t); - return (r); -} -#endif - /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); static __inline uint32_t mpt_read(struct mpt_softc *, int); Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:15:56 2013 (r245986) +++ stable/8/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:15:58 2013 (r245987) @@ -1347,9 +1347,7 @@ bad: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1583,9 +1581,7 @@ bad: if (seg < nseg && nxt_off >= MPT_REQUEST_AREA) { request_t *nrq; - CAMLOCK_2_MPTLOCK(mpt); nrq = mpt_get_request(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); if (nrq == NULL) { error = ENOMEM; @@ -1633,9 +1629,7 @@ out: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1667,9 +1661,7 @@ out: tgt->state = TGT_STATE_MOVING_DATA; #endif } - CAMLOCK_2_MPTLOCK(mpt); mpt_send_cmd(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); } static void @@ -1758,9 +1750,7 @@ bad: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1978,9 +1968,7 @@ bad: if (seg < nseg && nxt_off >= MPT_REQUEST_AREA) { request_t *nrq; - CAMLOCK_2_MPTLOCK(mpt); nrq = mpt_get_request(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); if (nrq == NULL) { error = ENOMEM; @@ -2028,9 +2016,7 @@ out: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -2062,9 +2048,7 @@ out: tgt->state = TGT_STATE_MOVING_DATA; #endif } - CAMLOCK_2_MPTLOCK(mpt); mpt_send_cmd(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); } static void @@ -2083,7 +2067,6 @@ mpt_start(struct cam_sim *sim, union ccb mpt = ccb->ccb_h.ccb_mpt_ptr; raid_passthru = (sim == mpt->phydisk_sim); - CAMLOCK_2_MPTLOCK(mpt); if ((req = mpt_get_request(mpt, FALSE)) == NULL) { if (mpt->outofbeer == 0) { mpt->outofbeer = 1; @@ -2092,14 +2075,12 @@ mpt_start(struct cam_sim *sim, union ccb } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); return; } #ifdef INVARIANTS mpt_req_not_spcl(mpt, req, "mpt_start", __LINE__); #endif - MPTLOCK_2_CAMLOCK(mpt); if (sizeof (bus_addr_t) > 4) { cb = mpt_execute_req_a64; @@ -2121,15 +2102,12 @@ mpt_start(struct cam_sim *sim, union ccb mpt_req->Function = MPI_FUNCTION_SCSI_IO_REQUEST; if (raid_passthru) { mpt_req->Function = MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH; - CAMLOCK_2_MPTLOCK(mpt); if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { - MPTLOCK_2_CAMLOCK(mpt); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb); return; } - MPTLOCK_2_CAMLOCK(mpt); mpt_req->Bus = 0; /* we never set bus here */ } else { tgt = ccb->ccb_h.target_id; @@ -2424,7 +2402,6 @@ mpt_cam_event(struct mpt_softc *mpt, req } else { pathid = cam_sim_path(mpt->sim); } - MPTLOCK_2_CAMLOCK(mpt); /* * Allocate a CCB, create a wildcard path for this bus, * and schedule a rescan. @@ -2432,19 +2409,16 @@ mpt_cam_event(struct mpt_softc *mpt, req ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { mpt_prt(mpt, "unable to alloc CCB for rescan\n"); - CAMLOCK_2_MPTLOCK(mpt); break; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); break; } xpt_rescan(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; } #else @@ -2541,13 +2515,11 @@ mpt_cam_event(struct mpt_softc *mpt, req } else { sim = mpt->sim; } - MPTLOCK_2_CAMLOCK(mpt); for (lun_id = 0; lun_id < MPT_MAX_LUNS; lun_id++) { if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), pqf->TargetID, lun_id) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create a path to send " "XPT_REL_SIMQ"); - CAMLOCK_2_MPTLOCK(mpt); break; } xpt_setup_ccb(&crs.ccb_h, tmppath, 5); @@ -2561,7 +2533,6 @@ mpt_cam_event(struct mpt_softc *mpt, req } xpt_free_path(tmppath); } - CAMLOCK_2_MPTLOCK(mpt); break; } case MPI_EVENT_IR_RESYNC_UPDATE: @@ -2583,39 +2554,32 @@ mpt_cam_event(struct mpt_softc *mpt, req sim = mpt->sim; switch(psdsc->ReasonCode) { case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: - MPTLOCK_2_CAMLOCK(mpt); ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { mpt_prt(mpt, "unable to alloc CCB for rescan\n"); - CAMLOCK_2_MPTLOCK(mpt); break; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); break; } xpt_rescan(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: - MPTLOCK_2_CAMLOCK(mpt); if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create path for async event"); - CAMLOCK_2_MPTLOCK(mpt); break; } xpt_async(AC_LOST_DEVICE, tmppath, NULL); xpt_free_path(tmppath); - CAMLOCK_2_MPTLOCK(mpt); break; case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET: case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL: @@ -2735,9 +2699,7 @@ mpt_scsi_reply_handler(struct mpt_softc req, req->serno); } KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); if ((req->state & REQ_STATE_TIMEDOUT) == 0) { TAILQ_REMOVE(&mpt->request_pending_list, req, links); } else { @@ -3316,15 +3278,12 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.func_code != XPT_PATH_INQ && ccb->ccb_h.func_code != XPT_RESET_BUS && ccb->ccb_h.func_code != XPT_RESET_DEV) { - CAMLOCK_2_MPTLOCK(mpt); if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { - MPTLOCK_2_CAMLOCK(mpt); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb); return; } - MPTLOCK_2_CAMLOCK(mpt); } ccb->ccb_h.ccb_mpt_ptr = mpt; @@ -3373,9 +3332,7 @@ mpt_action(struct cam_sim *sim, union cc } else { xpt_print(ccb->ccb_h.path, "reset device\n"); } - CAMLOCK_2_MPTLOCK(mpt); (void) mpt_bus_reset(mpt, tgt, lun, FALSE); - MPTLOCK_2_CAMLOCK(mpt); /* * mpt_bus_reset is always successful in that it @@ -3389,7 +3346,6 @@ mpt_action(struct cam_sim *sim, union cc case XPT_ABORT: { union ccb *accb = ccb->cab.abort_ccb; - CAMLOCK_2_MPTLOCK(mpt); switch (accb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: case XPT_IMMED_NOTIFY: @@ -3406,7 +3362,6 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.status = CAM_REQ_INVALID; break; } - MPTLOCK_2_CAMLOCK(mpt); break; } @@ -3546,7 +3501,6 @@ mpt_action(struct cam_sim *sim, union cc period >>= MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD; } #endif - CAMLOCK_2_MPTLOCK(mpt); if (dval & DP_DISC_ENABLE) { mpt->mpt_disc_enable |= (1 << tgt); } else if (dval & DP_DISC_DISABL) { @@ -3564,7 +3518,6 @@ mpt_action(struct cam_sim *sim, union cc mpt_setsync(mpt, tgt, period, offset); } if (dval == 0) { - MPTLOCK_2_CAMLOCK(mpt); mpt_set_ccb_status(ccb, CAM_REQ_CMP); break; } @@ -3576,7 +3529,6 @@ mpt_action(struct cam_sim *sim, union cc } else { mpt_set_ccb_status(ccb, CAM_REQ_CMP); } - MPTLOCK_2_CAMLOCK(mpt); break; } case XPT_GET_TRAN_SETTINGS: @@ -3751,14 +3703,12 @@ mpt_action(struct cam_sim *sim, union cc { int result; - CAMLOCK_2_MPTLOCK(mpt); if (ccb->cel.enable) result = mpt_enable_lun(mpt, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); else result = mpt_disable_lun(mpt, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); - MPTLOCK_2_CAMLOCK(mpt); if (result == 0) { mpt_set_ccb_status(ccb, CAM_REQ_CMP); } else { @@ -3788,7 +3738,6 @@ mpt_action(struct cam_sim *sim, union cc } else { trtp = &mpt->trt[lun]; } - CAMLOCK_2_MPTLOCK(mpt); if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { mpt_lprt(mpt, MPT_PRT_DEBUG1, "Put FREE ATIO %p lun %d\n", ccb, lun); @@ -3803,13 +3752,10 @@ mpt_action(struct cam_sim *sim, union cc mpt_lprt(mpt, MPT_PRT_ALWAYS, "Got Notify ACK\n"); } mpt_set_ccb_status(ccb, CAM_REQ_INPROG); - MPTLOCK_2_CAMLOCK(mpt); return; } case XPT_CONT_TARGET_IO: - CAMLOCK_2_MPTLOCK(mpt); mpt_target_start_io(mpt, ccb); - MPTLOCK_2_CAMLOCK(mpt); return; default: @@ -3853,18 +3799,15 @@ mpt_get_spi_settings(struct mpt_softc *m CONFIG_PAGE_SCSI_DEVICE_0 tmp; dval = 0; - CAMLOCK_2_MPTLOCK(mpt); tmp = mpt->mpt_dev_page0[tgt]; rv = mpt_read_cur_cfg_page(mpt, tgt, &tmp.Header, sizeof(tmp), FALSE, 5000); if (rv) { - MPTLOCK_2_CAMLOCK(mpt); mpt_prt(mpt, "can't get tgt %d config page 0\n", tgt); return (rv); } mpt2host_config_page_scsi_device_0(&tmp); - MPTLOCK_2_CAMLOCK(mpt); mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_get_spi_settings[%d]: current NP %x Info %x\n", tgt, tmp.NegotiatedParameters, tmp.Information); @@ -4493,18 +4436,14 @@ mpt_target_start_io(struct mpt_softc *mp xpt_freeze_simq(mpt->sim, 1); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; tgt->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; default: mpt_prt(mpt, "ccb %p flags 0x%x tag 0x%08x had bad request " "starting I/O\n", ccb, csio->ccb_h.flags, csio->tag_id); mpt_tgt_dump_req_state(mpt, cmd_req); mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } @@ -4524,9 +4463,7 @@ mpt_target_start_io(struct mpt_softc *mp } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } ccb->ccb_h.status = CAM_SIM_QUEUED | CAM_REQ_INPROG; @@ -4600,7 +4537,6 @@ mpt_target_start_io(struct mpt_softc *mp "nxtstate=%d\n", csio, csio->tag_id, csio->dxfer_len, tgt->resid, ccb->ccb_h.flags, req, req->serno, tgt->state); - MPTLOCK_2_CAMLOCK(mpt); if ((ccb->ccb_h.flags & CAM_SCATTER_VALID) == 0) { if ((ccb->ccb_h.flags & CAM_DATA_PHYS) == 0) { int error; @@ -4640,7 +4576,6 @@ mpt_target_start_io(struct mpt_softc *mp (*cb)(req, sgs, csio->sglist_cnt, 0); } } - CAMLOCK_2_MPTLOCK(mpt); } else { uint8_t *sp = NULL, sense[MPT_SENSE_SIZE]; @@ -4657,9 +4592,7 @@ mpt_target_start_io(struct mpt_softc *mp ccb->ccb_h.status, tgt->resid, tgt->bytes_xfered); mpt_set_ccb_status(ccb, CAM_REQ_CMP); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } if (ccb->ccb_h.flags & CAM_SEND_SENSE) { @@ -4865,9 +4798,7 @@ mpt_scsi_tgt_status(struct mpt_softc *mp if (ccb) { ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); } else { mpt_prt(mpt, "could not allocate status request- dropping\n"); @@ -5042,9 +4973,7 @@ mpt_scsi_tgt_tsk_mgmt(struct mpt_softc * } tgt->ccb = (union ccb *) inot; inot->ccb_h.status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; - MPTLOCK_2_CAMLOCK(mpt); xpt_done((union ccb *)inot); - CAMLOCK_2_MPTLOCK(mpt); } static void @@ -5314,9 +5243,7 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, itag, atiop->tag_id, tgt->reply_desc, tgt->resid); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done((union ccb *)atiop); - CAMLOCK_2_MPTLOCK(mpt); } static void @@ -5425,9 +5352,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt->outofbeer = 0; mpt_lprt(mpt, MPT_PRT_DEBUG, "THAWQ\n"); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; } /* @@ -5510,9 +5435,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt->outofbeer = 0; mpt_lprt(mpt, MPT_PRT_DEBUG, "THAWQ\n"); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); } break; } Modified: stable/8/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:15:56 2013 (r245986) +++ stable/8/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:15:58 2013 (r245987) @@ -692,9 +692,7 @@ mpt_raid_thread(void *arg) */ if (firstrun) { firstrun = 0; - MPTLOCK_2_CAMLOCK(mpt); xpt_release_simq(mpt->phydisk_sim, TRUE); - CAMLOCK_2_MPTLOCK(mpt); } if (mpt->raid_rescan != 0) { @@ -1664,19 +1662,16 @@ mpt_raid_set_vol_queue_depth(struct mpt_ mpt->raid_rescan = 0; - MPTLOCK_2_CAMLOCK(mpt); error = xpt_create_path(&path, xpt_periph, cam_sim_path(mpt->sim), mpt_vol->config_page->VolumeID, /*lun*/0); if (error != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_vol_prt(mpt, mpt_vol, "Unable to allocate path!\n"); continue; } mpt_adjust_queue_depth(mpt, mpt_vol, path); xpt_free_path(path); - CAMLOCK_2_MPTLOCK(mpt); } MPT_UNLOCK(mpt); return (0); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:16:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1E944468; Sun, 27 Jan 2013 17:16:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 10A39C2E; Sun, 27 Jan 2013 17:16:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHG8kL016809; Sun, 27 Jan 2013 17:16:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHG7KT016806; Sun, 27 Jan 2013 17:16:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271716.r0RHG7KT016806@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r245988 - stable/7/sys/dev/mpt X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:16:08 -0000 Author: marius Date: Sun Jan 27 17:16:07 2013 New Revision: 245988 URL: http://svnweb.freebsd.org/changeset/base/245988 Log: MFC: r241875 Remove support for using Giant for locking within mpt(4). Finer grained locking has been working fine for ~5.5 years by now. Modified: stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Sun Jan 27 17:15:58 2013 (r245987) +++ stable/7/sys/dev/mpt/mpt.h Sun Jan 27 17:16:07 2013 (r245988) @@ -788,7 +788,6 @@ mpt_assign_serno(struct mpt_softc *mpt, } /***************************** Locking Primitives *****************************/ -#if 1 #define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE #define MPT_LOCK_SETUP(mpt) \ mtx_init(&mpt->mpt_lock, "mpt", NULL, MTX_DEF); \ @@ -803,8 +802,6 @@ mpt_assign_serno(struct mpt_softc *mpt, #define MPT_UNLOCK(mpt) mtx_unlock(&(mpt)->mpt_lock) #define MPT_OWNED(mpt) mtx_owned(&(mpt)->mpt_lock) #define MPT_LOCK_ASSERT(mpt) mtx_assert(&(mpt)->mpt_lock, MA_OWNED) -#define MPTLOCK_2_CAMLOCK(mpt) -#define CAMLOCK_2_MPTLOCK(mpt) #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ @@ -816,38 +813,6 @@ mpt_assign_serno(struct mpt_softc *mpt, #define mpt_callout_drain(mpt, c) \ callout_drain(c) -#else - -#define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY -#define MPT_LOCK_SETUP(mpt) do { } while (0) -#define MPT_LOCK_DESTROY(mpt) do { } while (0) -#define MPT_LOCK_ASSERT(mpt) mtx_assert(&Giant, MA_OWNED) -#define MPT_LOCK(mpt) mtx_lock(&Giant) -#define MPT_UNLOCK(mpt) mtx_unlock(&Giant) -#define MPTLOCK_2_CAMLOCK(mpt) -#define CAMLOCK_2_MPTLOCK(mpt) - -#define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)) -#define mpt_req_untimeout(req, func, arg) \ - callout_stop(&(req)->callout) -#define mpt_callout_init(mpt, c) \ - callout_init(c, 0) -#define mpt_callout_drain(mpt, c) \ - callout_drain(c) - -static __inline int -mpt_sleep(struct mpt_softc *, void *, int, const char *, int); - -static __inline int -mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) -{ - int r; - r = tsleep(i, p, w, t); - return (r); -} -#endif - /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); static __inline uint32_t mpt_read(struct mpt_softc *, int); Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:15:58 2013 (r245987) +++ stable/7/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:16:07 2013 (r245988) @@ -1347,9 +1347,7 @@ bad: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1583,9 +1581,7 @@ bad: if (seg < nseg && nxt_off >= MPT_REQUEST_AREA) { request_t *nrq; - CAMLOCK_2_MPTLOCK(mpt); nrq = mpt_get_request(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); if (nrq == NULL) { error = ENOMEM; @@ -1633,9 +1629,7 @@ out: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1667,9 +1661,7 @@ out: tgt->state = TGT_STATE_MOVING_DATA; #endif } - CAMLOCK_2_MPTLOCK(mpt); mpt_send_cmd(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); } static void @@ -1758,9 +1750,7 @@ bad: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1978,9 +1968,7 @@ bad: if (seg < nseg && nxt_off >= MPT_REQUEST_AREA) { request_t *nrq; - CAMLOCK_2_MPTLOCK(mpt); nrq = mpt_get_request(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); if (nrq == NULL) { error = ENOMEM; @@ -2028,9 +2016,7 @@ out: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -2062,9 +2048,7 @@ out: tgt->state = TGT_STATE_MOVING_DATA; #endif } - CAMLOCK_2_MPTLOCK(mpt); mpt_send_cmd(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); } static void @@ -2083,7 +2067,6 @@ mpt_start(struct cam_sim *sim, union ccb mpt = ccb->ccb_h.ccb_mpt_ptr; raid_passthru = (sim == mpt->phydisk_sim); - CAMLOCK_2_MPTLOCK(mpt); if ((req = mpt_get_request(mpt, FALSE)) == NULL) { if (mpt->outofbeer == 0) { mpt->outofbeer = 1; @@ -2092,14 +2075,12 @@ mpt_start(struct cam_sim *sim, union ccb } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); return; } #ifdef INVARIANTS mpt_req_not_spcl(mpt, req, "mpt_start", __LINE__); #endif - MPTLOCK_2_CAMLOCK(mpt); if (sizeof (bus_addr_t) > 4) { cb = mpt_execute_req_a64; @@ -2121,15 +2102,12 @@ mpt_start(struct cam_sim *sim, union ccb mpt_req->Function = MPI_FUNCTION_SCSI_IO_REQUEST; if (raid_passthru) { mpt_req->Function = MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH; - CAMLOCK_2_MPTLOCK(mpt); if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { - MPTLOCK_2_CAMLOCK(mpt); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb); return; } - MPTLOCK_2_CAMLOCK(mpt); mpt_req->Bus = 0; /* we never set bus here */ } else { tgt = ccb->ccb_h.target_id; @@ -2424,7 +2402,6 @@ mpt_cam_event(struct mpt_softc *mpt, req } else { pathid = cam_sim_path(mpt->sim); } - MPTLOCK_2_CAMLOCK(mpt); /* * Allocate a CCB, create a wildcard path for this bus, * and schedule a rescan. @@ -2432,19 +2409,16 @@ mpt_cam_event(struct mpt_softc *mpt, req ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { mpt_prt(mpt, "unable to alloc CCB for rescan\n"); - CAMLOCK_2_MPTLOCK(mpt); break; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); break; } xpt_rescan(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; } #else @@ -2541,13 +2515,11 @@ mpt_cam_event(struct mpt_softc *mpt, req } else { sim = mpt->sim; } - MPTLOCK_2_CAMLOCK(mpt); for (lun_id = 0; lun_id < MPT_MAX_LUNS; lun_id++) { if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), pqf->TargetID, lun_id) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create a path to send " "XPT_REL_SIMQ"); - CAMLOCK_2_MPTLOCK(mpt); break; } xpt_setup_ccb(&crs.ccb_h, tmppath, 5); @@ -2561,7 +2533,6 @@ mpt_cam_event(struct mpt_softc *mpt, req } xpt_free_path(tmppath); } - CAMLOCK_2_MPTLOCK(mpt); break; } case MPI_EVENT_IR_RESYNC_UPDATE: @@ -2583,39 +2554,32 @@ mpt_cam_event(struct mpt_softc *mpt, req sim = mpt->sim; switch(psdsc->ReasonCode) { case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: - MPTLOCK_2_CAMLOCK(mpt); ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { mpt_prt(mpt, "unable to alloc CCB for rescan\n"); - CAMLOCK_2_MPTLOCK(mpt); break; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); break; } xpt_rescan(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: - MPTLOCK_2_CAMLOCK(mpt); if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create path for async event"); - CAMLOCK_2_MPTLOCK(mpt); break; } xpt_async(AC_LOST_DEVICE, tmppath, NULL); xpt_free_path(tmppath); - CAMLOCK_2_MPTLOCK(mpt); break; case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET: case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL: @@ -2735,9 +2699,7 @@ mpt_scsi_reply_handler(struct mpt_softc req, req->serno); } KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); if ((req->state & REQ_STATE_TIMEDOUT) == 0) { TAILQ_REMOVE(&mpt->request_pending_list, req, links); } else { @@ -3315,15 +3277,12 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.func_code != XPT_PATH_INQ && ccb->ccb_h.func_code != XPT_RESET_BUS && ccb->ccb_h.func_code != XPT_RESET_DEV) { - CAMLOCK_2_MPTLOCK(mpt); if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { - MPTLOCK_2_CAMLOCK(mpt); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb); return; } - MPTLOCK_2_CAMLOCK(mpt); } ccb->ccb_h.ccb_mpt_ptr = mpt; @@ -3372,9 +3331,7 @@ mpt_action(struct cam_sim *sim, union cc } else { xpt_print(ccb->ccb_h.path, "reset device\n"); } - CAMLOCK_2_MPTLOCK(mpt); (void) mpt_bus_reset(mpt, tgt, lun, FALSE); - MPTLOCK_2_CAMLOCK(mpt); /* * mpt_bus_reset is always successful in that it @@ -3388,7 +3345,6 @@ mpt_action(struct cam_sim *sim, union cc case XPT_ABORT: { union ccb *accb = ccb->cab.abort_ccb; - CAMLOCK_2_MPTLOCK(mpt); switch (accb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: case XPT_IMMED_NOTIFY: @@ -3405,7 +3361,6 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.status = CAM_REQ_INVALID; break; } - MPTLOCK_2_CAMLOCK(mpt); break; } @@ -3545,7 +3500,6 @@ mpt_action(struct cam_sim *sim, union cc period >>= MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD; } #endif - CAMLOCK_2_MPTLOCK(mpt); if (dval & DP_DISC_ENABLE) { mpt->mpt_disc_enable |= (1 << tgt); } else if (dval & DP_DISC_DISABL) { @@ -3563,7 +3517,6 @@ mpt_action(struct cam_sim *sim, union cc mpt_setsync(mpt, tgt, period, offset); } if (dval == 0) { - MPTLOCK_2_CAMLOCK(mpt); mpt_set_ccb_status(ccb, CAM_REQ_CMP); break; } @@ -3575,7 +3528,6 @@ mpt_action(struct cam_sim *sim, union cc } else { mpt_set_ccb_status(ccb, CAM_REQ_CMP); } - MPTLOCK_2_CAMLOCK(mpt); break; } case XPT_GET_TRAN_SETTINGS: @@ -3752,14 +3704,12 @@ mpt_action(struct cam_sim *sim, union cc { int result; - CAMLOCK_2_MPTLOCK(mpt); if (ccb->cel.enable) result = mpt_enable_lun(mpt, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); else result = mpt_disable_lun(mpt, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); - MPTLOCK_2_CAMLOCK(mpt); if (result == 0) { mpt_set_ccb_status(ccb, CAM_REQ_CMP); } else { @@ -3789,7 +3739,6 @@ mpt_action(struct cam_sim *sim, union cc } else { trtp = &mpt->trt[lun]; } - CAMLOCK_2_MPTLOCK(mpt); if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { mpt_lprt(mpt, MPT_PRT_DEBUG1, "Put FREE ATIO %p lun %d\n", ccb, lun); @@ -3804,13 +3753,10 @@ mpt_action(struct cam_sim *sim, union cc mpt_lprt(mpt, MPT_PRT_ALWAYS, "Got Notify ACK\n"); } mpt_set_ccb_status(ccb, CAM_REQ_INPROG); - MPTLOCK_2_CAMLOCK(mpt); return; } case XPT_CONT_TARGET_IO: - CAMLOCK_2_MPTLOCK(mpt); mpt_target_start_io(mpt, ccb); - MPTLOCK_2_CAMLOCK(mpt); return; default: @@ -3854,18 +3800,15 @@ mpt_get_spi_settings(struct mpt_softc *m CONFIG_PAGE_SCSI_DEVICE_0 tmp; dval = 0; - CAMLOCK_2_MPTLOCK(mpt); tmp = mpt->mpt_dev_page0[tgt]; rv = mpt_read_cur_cfg_page(mpt, tgt, &tmp.Header, sizeof(tmp), FALSE, 5000); if (rv) { - MPTLOCK_2_CAMLOCK(mpt); mpt_prt(mpt, "can't get tgt %d config page 0\n", tgt); return (rv); } mpt2host_config_page_scsi_device_0(&tmp); - MPTLOCK_2_CAMLOCK(mpt); mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_get_spi_settings[%d]: current NP %x Info %x\n", tgt, tmp.NegotiatedParameters, tmp.Information); @@ -4494,18 +4437,14 @@ mpt_target_start_io(struct mpt_softc *mp xpt_freeze_simq(mpt->sim, 1); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; tgt->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; default: mpt_prt(mpt, "ccb %p flags 0x%x tag 0x%08x had bad request " "starting I/O\n", ccb, csio->ccb_h.flags, csio->tag_id); mpt_tgt_dump_req_state(mpt, cmd_req); mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } @@ -4525,9 +4464,7 @@ mpt_target_start_io(struct mpt_softc *mp } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } ccb->ccb_h.status = CAM_SIM_QUEUED | CAM_REQ_INPROG; @@ -4601,7 +4538,6 @@ mpt_target_start_io(struct mpt_softc *mp "nxtstate=%d\n", csio, csio->tag_id, csio->dxfer_len, tgt->resid, ccb->ccb_h.flags, req, req->serno, tgt->state); - MPTLOCK_2_CAMLOCK(mpt); if ((ccb->ccb_h.flags & CAM_SCATTER_VALID) == 0) { if ((ccb->ccb_h.flags & CAM_DATA_PHYS) == 0) { int error; @@ -4641,7 +4577,6 @@ mpt_target_start_io(struct mpt_softc *mp (*cb)(req, sgs, csio->sglist_cnt, 0); } } - CAMLOCK_2_MPTLOCK(mpt); } else { uint8_t *sp = NULL, sense[MPT_SENSE_SIZE]; @@ -4658,9 +4593,7 @@ mpt_target_start_io(struct mpt_softc *mp ccb->ccb_h.status, tgt->resid, tgt->bytes_xfered); mpt_set_ccb_status(ccb, CAM_REQ_CMP); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } if (ccb->ccb_h.flags & CAM_SEND_SENSE) { @@ -4866,9 +4799,7 @@ mpt_scsi_tgt_status(struct mpt_softc *mp if (ccb) { ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); } else { mpt_prt(mpt, "could not allocate status request- dropping\n"); @@ -5043,9 +4974,7 @@ mpt_scsi_tgt_tsk_mgmt(struct mpt_softc * } tgt->ccb = (union ccb *) inot; inot->ccb_h.status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; - MPTLOCK_2_CAMLOCK(mpt); xpt_done((union ccb *)inot); - CAMLOCK_2_MPTLOCK(mpt); } static void @@ -5315,9 +5244,7 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, itag, atiop->tag_id, tgt->reply_desc, tgt->resid); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done((union ccb *)atiop); - CAMLOCK_2_MPTLOCK(mpt); } static void @@ -5426,9 +5353,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt->outofbeer = 0; mpt_lprt(mpt, MPT_PRT_DEBUG, "THAWQ\n"); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; } /* @@ -5511,9 +5436,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt->outofbeer = 0; mpt_lprt(mpt, MPT_PRT_DEBUG, "THAWQ\n"); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); } break; } Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:15:58 2013 (r245987) +++ stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:16:07 2013 (r245988) @@ -701,9 +701,7 @@ mpt_raid_thread(void *arg) */ if (firstrun) { firstrun = 0; - MPTLOCK_2_CAMLOCK(mpt); xpt_release_simq(mpt->phydisk_sim, TRUE); - CAMLOCK_2_MPTLOCK(mpt); } if (mpt->raid_rescan != 0) { @@ -1680,19 +1678,16 @@ mpt_raid_set_vol_queue_depth(struct mpt_ mpt->raid_rescan = 0; - MPTLOCK_2_CAMLOCK(mpt); error = xpt_create_path(&path, xpt_periph, cam_sim_path(mpt->sim), mpt_vol->config_page->VolumeID, /*lun*/0); if (error != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_vol_prt(mpt, mpt_vol, "Unable to allocate path!\n"); continue; } mpt_adjust_queue_depth(mpt, mpt_vol, path); xpt_free_path(path); - CAMLOCK_2_MPTLOCK(mpt); } MPT_UNLOCK(mpt); return (0); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:24:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E055D986; Sun, 27 Jan 2013 17:24:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA7ACCFF; Sun, 27 Jan 2013 17:24:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHOobq020484; Sun, 27 Jan 2013 17:24:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHOokx020483; Sun, 27 Jan 2013 17:24:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271724.r0RHOokx020483@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r245989 - stable/7/sys/dev/mpt X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:24:51 -0000 Author: marius Date: Sun Jan 27 17:24:50 2013 New Revision: 245989 URL: http://svnweb.freebsd.org/changeset/base/245989 Log: MFC: r241875 Remove support for using Giant for locking within mpt(4). Finer grained locking has been working fine for ~5.5 years by now. Modified: stable/7/sys/dev/mpt/mpt_raid.c Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:16:07 2013 (r245988) +++ stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:24:50 2013 (r245989) @@ -726,9 +726,7 @@ mpt_raid_thread(void *arg) ccb->ccb_h.func_code = XPT_SCAN_BUS; ccb->ccb_h.cbfcnp = mpt_cam_rescan_callback; ccb->crcn.flags = CAM_FLAG_NONE; - MPTLOCK_2_CAMLOCK(mpt); xpt_action(ccb); - CAMLOCK_2_MPTLOCK(mpt); } } } From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:33:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DFCF3C2B; Sun, 27 Jan 2013 17:33:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF8DAD50; Sun, 27 Jan 2013 17:33:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHXMwQ023217; Sun, 27 Jan 2013 17:33:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHXMx4023216; Sun, 27 Jan 2013 17:33:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271733.r0RHXMx4023216@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245990 - stable/9/sys/boot/sparc64/boot1 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:33:23 -0000 Author: marius Date: Sun Jan 27 17:33:22 2013 New Revision: 245990 URL: http://svnweb.freebsd.org/changeset/base/245990 Log: MFC: r244307 Restore pre-r234898 (MFC'ed to stable/9 in r236076) printing of boot loader and path. Modified: stable/9/sys/boot/sparc64/boot1/boot1.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/9/sys/boot/sparc64/boot1/boot1.c Sun Jan 27 17:24:50 2013 (r245989) +++ stable/9/sys/boot/sparc64/boot1/boot1.c Sun Jan 27 17:33:22 2013 (r245990) @@ -340,11 +340,11 @@ main(int ac, char **av) } #ifdef ZFSBOOT - printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", + printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", bootpath); #else - printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" - " Boot loader: %s\n", "", bootpath, path); + printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" + " Boot loader: %s\n", bootpath, path); #endif if (mount(bootpath) == -1) From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:33:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 22554D31; Sun, 27 Jan 2013 17:33:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C2DFFD51; Sun, 27 Jan 2013 17:33:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHXSeo023269; Sun, 27 Jan 2013 17:33:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHXSf1023268; Sun, 27 Jan 2013 17:33:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271733.r0RHXSf1023268@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245991 - stable/8/sys/boot/sparc64/boot1 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:33:29 -0000 Author: marius Date: Sun Jan 27 17:33:28 2013 New Revision: 245991 URL: http://svnweb.freebsd.org/changeset/base/245991 Log: MFC: r244307 Restore pre-r234898 (MFC'ed to stable/9 in r236077) printing of boot loader and path. Modified: stable/8/sys/boot/sparc64/boot1/boot1.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/8/sys/boot/sparc64/boot1/boot1.c Sun Jan 27 17:33:22 2013 (r245990) +++ stable/8/sys/boot/sparc64/boot1/boot1.c Sun Jan 27 17:33:28 2013 (r245991) @@ -340,11 +340,11 @@ main(int ac, char **av) } #ifdef ZFSBOOT - printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", + printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", bootpath); #else - printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" - " Boot loader: %s\n", "", bootpath, path); + printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" + " Boot loader: %s\n", bootpath, path); #endif if (mount(bootpath) == -1) From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:38:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D97A1F22; Sun, 27 Jan 2013 17:38:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C6B65D76; Sun, 27 Jan 2013 17:38:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHcTpr023945; Sun, 27 Jan 2013 17:38:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHcTlP023944; Sun, 27 Jan 2013 17:38:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271738.r0RHcTlP023944@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245992 - stable/9/sys/sparc64/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:38:29 -0000 Author: marius Date: Sun Jan 27 17:38:29 2013 New Revision: 245992 URL: http://svnweb.freebsd.org/changeset/base/245992 Log: Revert r237842 (MFC'ed to stable/9 in r238012) and switch back to SCHED_ULE. All problems I encountered with the latter have been fixed with r241780 (MFC'ed to stable/9 in r245981). Modified: stable/9/sys/sparc64/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/conf/GENERIC ============================================================================== --- stable/9/sys/sparc64/conf/GENERIC Sun Jan 27 17:33:28 2013 (r245991) +++ stable/9/sys/sparc64/conf/GENERIC Sun Jan 27 17:38:29 2013 (r245992) @@ -26,7 +26,7 @@ makeoptions DEBUG=-g # Build kernel wit # Platforms supported # At this time all platforms are supported, as-is. -options SCHED_4BSD # 4BSD scheduler +options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:41:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 514FB2C4; Sun, 27 Jan 2013 17:41:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4301ADB6; Sun, 27 Jan 2013 17:41:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHfRS4025965; Sun, 27 Jan 2013 17:41:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHfRB4025964; Sun, 27 Jan 2013 17:41:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271741.r0RHfRB4025964@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245993 - stable/9/usr.sbin/daemon X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:41:27 -0000 Author: marius Date: Sun Jan 27 17:41:26 2013 New Revision: 245993 URL: http://svnweb.freebsd.org/changeset/base/245993 Log: MFC: r244986 Remove bogus '-' from getopt(3) string hit when porting daemon(8) to GNU/Linux *duck*. Modified: stable/9/usr.sbin/daemon/daemon.c Directory Properties: stable/9/usr.sbin/daemon/ (props changed) Modified: stable/9/usr.sbin/daemon/daemon.c ============================================================================== --- stable/9/usr.sbin/daemon/daemon.c Sun Jan 27 17:38:29 2013 (r245992) +++ stable/9/usr.sbin/daemon/daemon.c Sun Jan 27 17:41:26 2013 (r245993) @@ -62,7 +62,7 @@ main(int argc, char *argv[]) nochdir = noclose = 1; restart = 0; pidfile = user = NULL; - while ((ch = getopt(argc, argv, "-cfp:ru:")) != -1) { + while ((ch = getopt(argc, argv, "cfp:ru:")) != -1) { switch (ch) { case 'c': nochdir = 0; From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 17:41:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 353442C5; Sun, 27 Jan 2013 17:41:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27043DB8; Sun, 27 Jan 2013 17:41:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHfUVP026003; Sun, 27 Jan 2013 17:41:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHfUlr026002; Sun, 27 Jan 2013 17:41:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271741.r0RHfUlr026002@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245994 - stable/8/usr.sbin/daemon X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:41:30 -0000 Author: marius Date: Sun Jan 27 17:41:29 2013 New Revision: 245994 URL: http://svnweb.freebsd.org/changeset/base/245994 Log: MFC: r244986 Remove bogus '-' from getopt(3) string hit when porting daemon(8) to GNU/Linux *duck*. Modified: stable/8/usr.sbin/daemon/daemon.c Directory Properties: stable/8/usr.sbin/daemon/ (props changed) Modified: stable/8/usr.sbin/daemon/daemon.c ============================================================================== --- stable/8/usr.sbin/daemon/daemon.c Sun Jan 27 17:41:26 2013 (r245993) +++ stable/8/usr.sbin/daemon/daemon.c Sun Jan 27 17:41:29 2013 (r245994) @@ -62,7 +62,7 @@ main(int argc, char *argv[]) nochdir = noclose = 1; restart = 0; pidfile = user = NULL; - while ((ch = getopt(argc, argv, "-cfp:ru:")) != -1) { + while ((ch = getopt(argc, argv, "cfp:ru:")) != -1) { switch (ch) { case 'c': nochdir = 0; From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 18:01:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BE730A1E; Sun, 27 Jan 2013 18:01:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF798E63; Sun, 27 Jan 2013 18:01:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RI13RR031845; Sun, 27 Jan 2013 18:01:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RI13rU031844; Sun, 27 Jan 2013 18:01:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301271801.r0RI13rU031844@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 27 Jan 2013 18:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245995 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 18:01:03 -0000 Author: hselasky Date: Sun Jan 27 18:01:03 2013 New Revision: 245995 URL: http://svnweb.freebsd.org/changeset/base/245995 Log: Fix regression issue after r244500 and r244503: If a BUSDMA load operation results in a single segment which is greater than the PAGE_SIZE, the USB computed physical addresses will not be correct. Make sure that the first segment is unfolded like the sub-sequent segments are into USB_PAGE_SIZE big ranges. Found by: Alexander Nedotsukov MFC after: 1 week Modified: head/sys/dev/usb/usb_busdma.c Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Sun Jan 27 17:41:29 2013 (r245994) +++ head/sys/dev/usb/usb_busdma.c Sun Jan 27 18:01:03 2013 (r245995) @@ -440,7 +440,6 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ rem = segs->ds_addr & (USB_PAGE_SIZE - 1); pc->page_offset_buf = rem; pc->page_offset_end += rem; - nseg--; #ifdef USB_DEBUG if (rem != (USB_P2U(pc->buffer) & (USB_PAGE_SIZE - 1))) { /* @@ -451,7 +450,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ goto done; } #endif - while (nseg > 0) { + while (1) { off += USB_PAGE_SIZE; if (off >= (segs->ds_len + rem)) { /* page crossing */ @@ -459,6 +458,8 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ segs++; off = 0; rem = 0; + if (nseg == 0) + break; } pg++; pg->physaddr = (segs->ds_addr + off) & ~(USB_PAGE_SIZE - 1); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 19:44:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1C3634CC; Sun, 27 Jan 2013 19:44:42 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E788245; Sun, 27 Jan 2013 19:44:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RJifP5062004; Sun, 27 Jan 2013 19:44:41 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RJifD8062003; Sun, 27 Jan 2013 19:44:41 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201301271944.r0RJifD8062003@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 27 Jan 2013 19:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r245996 - stable/9/usr.bin/grep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 19:44:42 -0000 Author: gabor Date: Sun Jan 27 19:44:41 2013 New Revision: 245996 URL: http://svnweb.freebsd.org/changeset/base/245996 Log: MFC r245057, r245688 - Fix handling of the case when multiple patterns are specified in a single command line argument, separated by newlines Modified: stable/9/usr.bin/grep/grep.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/grep.c ============================================================================== --- stable/9/usr.bin/grep/grep.c Sun Jan 27 18:01:03 2013 (r245995) +++ stable/9/usr.bin/grep/grep.c Sun Jan 27 19:44:41 2013 (r245996) @@ -477,7 +477,13 @@ main(int argc, char *argv[]) grepbehave = GREP_EXTENDED; break; case 'e': - add_pattern(optarg, strlen(optarg)); + { + char *token; + char *string = optarg; + + while ((token = strsep(&string, "\n")) != NULL) + add_pattern(token, strlen(token)); + } needpattern = 0; break; case 'F': @@ -666,7 +672,11 @@ main(int argc, char *argv[]) /* Process patterns from command line */ if (aargc != 0 && needpattern) { - add_pattern(*aargv, strlen(*aargv)); + char *token; + char *string = *aargv; + + while ((token = strsep(&string, "\n")) != NULL) + add_pattern(token, strlen(token)); --aargc; ++aargv; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 19:49:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8999068A; Sun, 27 Jan 2013 19:49:11 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6123D261; Sun, 27 Jan 2013 19:49:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RJnBgX062622; Sun, 27 Jan 2013 19:49:11 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RJnBnG062621; Sun, 27 Jan 2013 19:49:11 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201301271949.r0RJnBnG062621@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 27 Jan 2013 19:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245997 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 19:49:11 -0000 Author: gabor Date: Sun Jan 27 19:49:10 2013 New Revision: 245997 URL: http://svnweb.freebsd.org/changeset/base/245997 Log: - Simplify and unify diagnostic and error message handling Submitted by: Christoph Mallon Reviewed by: Oleg Moskalenko Modified: head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Sun Jan 27 19:44:41 2013 (r245996) +++ head/usr.bin/sort/sort.c Sun Jan 27 19:49:10 2013 (r245997) @@ -434,8 +434,7 @@ parse_memory_buffer_value(const char *va 100; break; default: - fprintf(stderr, "%s: %s\n", strerror(EINVAL), - optarg); + warnc(EINVAL, "%s", optarg); membuf = available_free_memory; } } @@ -658,7 +657,7 @@ parse_pos(const char *s, struct key_spec errno = 0; ks->f2 = (size_t) strtoul(f, NULL, 10); if (errno != 0) - errx(2, "%s: -k", strerror(errno)); + err(2, "-k"); if (ks->f2 == 0) { warn("%s",getstr(5)); goto end; @@ -667,7 +666,7 @@ parse_pos(const char *s, struct key_spec errno = 0; ks->f1 = (size_t) strtoul(f, NULL, 10); if (errno != 0) - errx(2, "%s: -k", strerror(errno)); + err(2, "-k"); if (ks->f1 == 0) { warn("%s",getstr(5)); goto end; @@ -685,12 +684,12 @@ parse_pos(const char *s, struct key_spec errno = 0; ks->c2 = (size_t) strtoul(c, NULL, 10); if (errno != 0) - errx(2, "%s: -k", strerror(errno)); + err(2, "-k"); } else { errno = 0; ks->c1 = (size_t) strtoul(c, NULL, 10); if (errno != 0) - errx(2, "%s: -k", strerror(errno)); + err(2, "-k"); if (ks->c1 == 0) { warn("%s",getstr(6)); goto end; @@ -1041,8 +1040,7 @@ main(int argc, char **argv) if (parse_k(optarg, &(keys[keys_num - 1])) < 0) { - errx(2, "%s: -k %s\n", - strerror(EINVAL), optarg); + errc(2, EINVAL, "-k %s", optarg); } break; @@ -1067,8 +1065,7 @@ main(int argc, char **argv) case 't': while (strlen(optarg) > 1) { if (optarg[0] != '\\') { - errx(2, "%s: %s\n", - strerror(EINVAL), optarg); + errc(2, EINVAL, "%s", optarg); } optarg += 1; if (*optarg == '0') { @@ -1155,8 +1152,7 @@ main(int argc, char **argv) errno = 0; long mof = strtol(optarg, NULL, 10); if (errno != 0) - errx(2, "--batch-size: %s", - strerror(errno)); + err(2, "--batch-size"); if (mof >= 2) max_open_files = (size_t) mof + 1; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 19:50:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8701F838; Sun, 27 Jan 2013 19:50:25 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 61F91273; Sun, 27 Jan 2013 19:50:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RJoPBT062836; Sun, 27 Jan 2013 19:50:25 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RJoPcp062835; Sun, 27 Jan 2013 19:50:25 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201301271950.r0RJoPcp062835@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 27 Jan 2013 19:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245998 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 19:50:25 -0000 Author: gabor Date: Sun Jan 27 19:50:24 2013 New Revision: 245998 URL: http://svnweb.freebsd.org/changeset/base/245998 Log: - Remove forgotten commented out debug code Submitted by: Christoph Mallon Reviewed by: Oleg Moskalenko Modified: head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Sun Jan 27 19:49:10 2013 (r245997) +++ head/usr.bin/sort/sort.c Sun Jan 27 19:50:24 2013 (r245998) @@ -986,21 +986,6 @@ main(int argc, char **argv) set_tmpdir(); set_sort_opts(); -#if 0 - { - static int counter = 0; - char fn[128]; - sprintf(fn, "/var/tmp/debug.sort.%d", counter++); - FILE* f = fopen(fn, "w"); - fprintf(f, ">>sort>>"); - for (int i = 0; i < argc; i++) { - fprintf(f, "<%s>", argv[i]); - } - fprintf(f, "< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F94CB52; Sun, 27 Jan 2013 20:10:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 428AC2E7; Sun, 27 Jan 2013 20:10:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RKAU6d070367; Sun, 27 Jan 2013 20:10:30 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RKAThH070360; Sun, 27 Jan 2013 20:10:29 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301272010.r0RKAThH070360@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Jan 2013 20:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245999 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 20:10:30 -0000 Author: ian Date: Sun Jan 27 20:10:29 2013 New Revision: 245999 URL: http://svnweb.freebsd.org/changeset/base/245999 Log: Remove the remaining references to the now-obsolete sheevaplug config files, which have been replaced by the generic db88f6xxx config which works for all kirkwood-series chips. Approved by: cognet (mentor) Modified: head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/NOTES Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Sun Jan 27 19:50:24 2013 (r245998) +++ head/sys/arm/conf/DOCKSTAR Sun Jan 27 20:10:29 2013 (r245999) @@ -5,7 +5,7 @@ # ident DOCKSTAR -include "../mv/kirkwood/std.sheevaplug" +include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Sun Jan 27 19:50:24 2013 (r245998) +++ head/sys/arm/conf/NOTES Sun Jan 27 20:10:29 2013 (r245999) @@ -19,7 +19,6 @@ files "../econa/files.econa" files "../mv/files.mv" files "../mv/discovery/files.db78xxx" files "../mv/kirkwood/files.kirkwood" -files "../mv/kirkwood/files.sheevaplug" files "../mv/orion/files.db88f5xxx" files "../mv/orion/files.ts7800" files "../s3c2xx0/files.s3c2xx0" From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 20:16:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 55F1BF21; Sun, 27 Jan 2013 20:16:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4400334D; Sun, 27 Jan 2013 20:16:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RKGpGR071528; Sun, 27 Jan 2013 20:16:51 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RKGpjw071527; Sun, 27 Jan 2013 20:16:51 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301272016.r0RKGpjw071527@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Jan 2013 20:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246000 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 20:16:52 -0000 Author: ian Date: Sun Jan 27 20:16:50 2013 New Revision: 246000 URL: http://svnweb.freebsd.org/changeset/base/246000 Log: Restore the irq number to the display string; I fumbled this in the previous commit while trying to make the code internally self-consistant. Approved by: cognet (mentor) Obtained from: Christoph Mallon Modified: head/sys/arm/arm/intr.c Modified: head/sys/arm/arm/intr.c ============================================================================== --- head/sys/arm/arm/intr.c Sun Jan 27 20:10:29 2013 (r245999) +++ head/sys/arm/arm/intr.c Sun Jan 27 20:16:50 2013 (r246000) @@ -72,9 +72,10 @@ arm_intrnames_init(void) { int i; - for (i = 0; i < NIRQ; ++i) + for (i = 0; i < NIRQ; ++i) { snprintf(&intrnames[i * INTRNAME_LEN], INTRNAME_LEN, "%-*s", INTRNAME_LEN - 1, ""); + } } void @@ -94,8 +95,8 @@ arm_setup_irqhandler(const char *name, d if (error) return; intr_events[irq] = event; - snprintf(&intrnames[irq * INTRNAME_LEN], INTRNAME_LEN, "%-*s", - INTRNAME_LEN - 1, name); + snprintf(&intrnames[irq * INTRNAME_LEN], INTRNAME_LEN, + "irq%d: %-*s", irq, INTRNAME_LEN - 1, name); } intr_event_add_handler(event, name, filt, hand, arg, intr_priority(flags), flags, cookiep); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 20:28:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BFABB619; Sun, 27 Jan 2013 20:28:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A712D685; Sun, 27 Jan 2013 20:28:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RKSFFV074636; Sun, 27 Jan 2013 20:28:15 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RKSFVu074634; Sun, 27 Jan 2013 20:28:15 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301272028.r0RKSFVu074634@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Jan 2013 20:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246001 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 20:28:15 -0000 Author: ian Date: Sun Jan 27 20:28:14 2013 New Revision: 246001 URL: http://svnweb.freebsd.org/changeset/base/246001 Log: Fix off-by-one errors in low-level arm9 and arm10 cache maintenance routines. In all the routines that loop through a range of virtual addresses, the loop is controlled by subtracting the cache line size from the total length of the request. After the subtract, a 'bpl' instruction was used, which branches if the result of the subtraction is zero or greater, but we need to exit the loop when the count hits zero. Thus, all the bpl instructions in those loops have been changed to 'bhi' (branch if greater than zero). In addition, the two routines that walk through the cache using set-and-index were correct, but confusing. The loop control for those has been simplified, just so that it's easier to see by examination that the code is correct. Routines for other arm architectures and generations still have the bpl instruction, but compensate for the off-by-one situation by decrementing the count register by one before entering the loop. PR: arm/174461 Approved by: cognet (mentor) Modified: head/sys/arm/arm/cpufunc_asm_arm10.S head/sys/arm/arm/cpufunc_asm_arm9.S Modified: head/sys/arm/arm/cpufunc_asm_arm10.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_arm10.S Sun Jan 27 20:16:50 2013 (r246000) +++ head/sys/arm/arm/cpufunc_asm_arm10.S Sun Jan 27 20:28:14 2013 (r246001) @@ -87,7 +87,7 @@ ENTRY_NP(arm10_icache_sync_range) mcr p15, 0, r0, c7, c10, 1 /* Clean D cache SE with VA */ add r0, r0, ip subs r1, r1, ip - bpl .Larm10_sync_next + bhi .Larm10_sync_next mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ bx lr @@ -108,12 +108,10 @@ ENTRY_NP(arm10_icache_sync_all) orr ip, s_max, i_max .Lnext_index: mcr p15, 0, ip, c7, c10, 2 /* Clean D cache SE with Set/Index */ - sub ip, ip, i_inc - tst ip, i_max /* Index 0 is last one */ - bne .Lnext_index /* Next index */ - mcr p15, 0, ip, c7, c10, 2 /* Clean D cache SE with Set/Index */ + subs ip, ip, i_inc + bhs .Lnext_index /* Next index */ subs s_max, s_max, s_inc - bpl .Lnext_set /* Next set */ + bhs .Lnext_set /* Next set */ mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ bx lr @@ -133,7 +131,7 @@ ENTRY(arm10_dcache_wb_range) mcr p15, 0, r0, c7, c10, 1 /* Clean D cache SE with VA */ add r0, r0, ip subs r1, r1, ip - bpl .Larm10_wb_next + bhi .Larm10_wb_next mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ bx lr @@ -150,7 +148,7 @@ ENTRY(arm10_dcache_wbinv_range) mcr p15, 0, r0, c7, c14, 1 /* Purge D cache SE with VA */ add r0, r0, ip subs r1, r1, ip - bpl .Larm10_wbinv_next + bhi .Larm10_wbinv_next mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ bx lr @@ -171,7 +169,7 @@ ENTRY(arm10_dcache_inv_range) mcr p15, 0, r0, c7, c6, 1 /* Invalidate D cache SE with VA */ add r0, r0, ip subs r1, r1, ip - bpl .Larm10_inv_next + bhi .Larm10_inv_next mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ bx lr @@ -189,7 +187,7 @@ ENTRY(arm10_idcache_wbinv_range) mcr p15, 0, r0, c7, c14, 1 /* Purge D cache SE with VA */ add r0, r0, ip subs r1, r1, ip - bpl .Larm10_id_wbinv_next + bhi .Larm10_id_wbinv_next mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ bx lr @@ -211,12 +209,10 @@ ENTRY(arm10_dcache_wbinv_all) orr ip, s_max, i_max .Lnext_index_inv: mcr p15, 0, ip, c7, c14, 2 /* Purge D cache SE with Set/Index */ - sub ip, ip, i_inc - tst ip, i_max /* Index 0 is last one */ - bne .Lnext_index_inv /* Next index */ - mcr p15, 0, ip, c7, c14, 2 /* Purge D cache SE with Set/Index */ + subs ip, ip, i_inc + bhs .Lnext_index_inv /* Next index */ subs s_max, s_max, s_inc - bpl .Lnext_set_inv /* Next set */ + bhs .Lnext_set_inv /* Next set */ mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ bx lr Modified: head/sys/arm/arm/cpufunc_asm_arm9.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_arm9.S Sun Jan 27 20:16:50 2013 (r246000) +++ head/sys/arm/arm/cpufunc_asm_arm9.S Sun Jan 27 20:28:14 2013 (r246001) @@ -81,7 +81,7 @@ ENTRY_NP(arm9_icache_sync_range) mcr p15, 0, r0, c7, c10, 1 /* Clean D cache SE with VA */ add r0, r0, ip subs r1, r1, ip - bpl .Larm9_sync_next + bhi .Larm9_sync_next mov pc, lr ENTRY_NP(arm9_icache_sync_all) @@ -101,12 +101,10 @@ ENTRY_NP(arm9_icache_sync_all) orr ip, s_max, i_max .Lnext_index: mcr p15, 0, ip, c7, c10, 2 /* Clean D cache SE with Set/Index */ - sub ip, ip, i_inc - tst ip, i_max /* Index 0 is last one */ - bne .Lnext_index /* Next index */ - mcr p15, 0, ip, c7, c10, 2 /* Clean D cache SE with Set/Index */ + subs ip, ip, i_inc + bhs .Lnext_index /* Next index */ subs s_max, s_max, s_inc - bpl .Lnext_set /* Next set */ + bhs .Lnext_set /* Next set */ mov pc, lr .Larm9_line_size: @@ -125,7 +123,7 @@ ENTRY(arm9_dcache_wb_range) mcr p15, 0, r0, c7, c10, 1 /* Clean D cache SE with VA */ add r0, r0, ip subs r1, r1, ip - bpl .Larm9_wb_next + bhi .Larm9_wb_next mov pc, lr ENTRY(arm9_dcache_wbinv_range) @@ -141,7 +139,7 @@ ENTRY(arm9_dcache_wbinv_range) mcr p15, 0, r0, c7, c14, 1 /* Purge D cache SE with VA */ add r0, r0, ip subs r1, r1, ip - bpl .Larm9_wbinv_next + bhi .Larm9_wbinv_next mov pc, lr /* @@ -161,7 +159,7 @@ ENTRY(arm9_dcache_inv_range) mcr p15, 0, r0, c7, c6, 1 /* Invalidate D cache SE with VA */ add r0, r0, ip subs r1, r1, ip - bpl .Larm9_inv_next + bhi .Larm9_inv_next mov pc, lr ENTRY(arm9_idcache_wbinv_range) @@ -178,7 +176,7 @@ ENTRY(arm9_idcache_wbinv_range) mcr p15, 0, r0, c7, c14, 1 /* Purge D cache SE with VA */ add r0, r0, ip subs r1, r1, ip - bpl .Larm9_id_wbinv_next + bhi .Larm9_id_wbinv_next mov pc, lr ENTRY_NP(arm9_idcache_wbinv_all) @@ -199,12 +197,10 @@ ENTRY(arm9_dcache_wbinv_all) orr ip, s_max, i_max .Lnext_index_inv: mcr p15, 0, ip, c7, c14, 2 /* Purge D cache SE with Set/Index */ - sub ip, ip, i_inc - tst ip, i_max /* Index 0 is last one */ - bne .Lnext_index_inv /* Next index */ - mcr p15, 0, ip, c7, c14, 2 /* Purge D cache SE with Set/Index */ + subs ip, ip, i_inc + bhs .Lnext_index_inv /* Next index */ subs s_max, s_max, s_inc - bpl .Lnext_set_inv /* Next set */ + bhs .Lnext_set_inv /* Next set */ mov pc, lr .Larm9_cache_data: From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 21:55:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 884E43D5; Sun, 27 Jan 2013 21:55:02 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7B3648A3; Sun, 27 Jan 2013 21:55:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RLt247000910; Sun, 27 Jan 2013 21:55:02 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RLt2cb000909; Sun, 27 Jan 2013 21:55:02 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301272155.r0RLt2cb000909@svn.freebsd.org> From: Neel Natu Date: Sun, 27 Jan 2013 21:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246002 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 21:55:02 -0000 Author: neel Date: Sun Jan 27 21:55:01 2013 New Revision: 246002 URL: http://svnweb.freebsd.org/changeset/base/246002 Log: Increase the "memorylocked" limit for the "daemon" class. amd(8) requires more than the 64MB that is currently available to it so bump it up to 128MB. Reviewed by: kib Discussed with: avg, kib, zont Modified: head/etc/login.conf Modified: head/etc/login.conf ============================================================================== --- head/etc/login.conf Sun Jan 27 20:28:14 2013 (r246001) +++ head/etc/login.conf Sun Jan 27 21:55:01 2013 (r246002) @@ -59,7 +59,7 @@ xuser:\ staff:\ :tc=default: daemon:\ - :memorylocked=64M:\ + :memorylocked=128M:\ :tc=default: news:\ :tc=default: From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 22:50:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5AA7FC; Sun, 27 Jan 2013 22:50:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80313A59; Sun, 27 Jan 2013 22:50:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RMobC6018210; Sun, 27 Jan 2013 22:50:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RMobcA018209; Sun, 27 Jan 2013 22:50:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272250.r0RMobcA018209@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 22:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246003 - stable/9/sys/i386/xen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 22:50:37 -0000 Author: marius Date: Sun Jan 27 22:50:36 2013 New Revision: 246003 URL: http://svnweb.freebsd.org/changeset/base/246003 Log: MFC: r244987 Fix !INVARIANTS && !SMP build. Modified: stable/9/sys/i386/xen/xen_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/xen/xen_machdep.c ============================================================================== --- stable/9/sys/i386/xen/xen_machdep.c Sun Jan 27 21:55:01 2013 (r246002) +++ stable/9/sys/i386/xen/xen_machdep.c Sun Jan 27 22:50:36 2013 (r246003) @@ -215,7 +215,9 @@ static mmu_update_t xpq_queue[MAX_VIRT_C #else static mmu_update_t xpq_queue[XPQUEUE_SIZE]; +#ifdef INVARIANTS static struct mmu_log xpq_queue_log[XPQUEUE_SIZE]; +#endif static int xpq_idx = 0; #define XPQ_QUEUE_LOG xpq_queue_log From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 22:50:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 567D0FD; Sun, 27 Jan 2013 22:50:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 314A8A5A; Sun, 27 Jan 2013 22:50:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RMoeYb018250; Sun, 27 Jan 2013 22:50:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RMoeQk018249; Sun, 27 Jan 2013 22:50:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272250.r0RMoeQk018249@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 22:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246004 - stable/8/sys/i386/xen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 22:50:40 -0000 Author: marius Date: Sun Jan 27 22:50:39 2013 New Revision: 246004 URL: http://svnweb.freebsd.org/changeset/base/246004 Log: MFC: r244987 Fix !INVARIANTS && !SMP build. Modified: stable/8/sys/i386/xen/xen_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/i386/ (props changed) Modified: stable/8/sys/i386/xen/xen_machdep.c ============================================================================== --- stable/8/sys/i386/xen/xen_machdep.c Sun Jan 27 22:50:36 2013 (r246003) +++ stable/8/sys/i386/xen/xen_machdep.c Sun Jan 27 22:50:39 2013 (r246004) @@ -215,7 +215,9 @@ static mmu_update_t xpq_queue[MAX_VIRT_C #else static mmu_update_t xpq_queue[XPQUEUE_SIZE]; +#ifdef INVARIANTS static struct mmu_log xpq_queue_log[XPQUEUE_SIZE]; +#endif static int xpq_idx = 0; #define XPQ_QUEUE_LOG xpq_queue_log From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 22:59:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B43646C5; Sun, 27 Jan 2013 22:59:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A6467ABC; Sun, 27 Jan 2013 22:59:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RMxx41019549; Sun, 27 Jan 2013 22:59:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RMxxqi019547; Sun, 27 Jan 2013 22:59:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272259.r0RMxxqi019547@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 22:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246005 - stable/9/sys/dev/xen/control X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 22:59:59 -0000 Author: marius Date: Sun Jan 27 22:59:59 2013 New Revision: 246005 URL: http://svnweb.freebsd.org/changeset/base/246005 Log: MFC: r244990 - Fix !SMP build. - Replace incorrect function names in printf(9) strings with __func__. - Make xctrl_shutdown_reasons table const. - Use nitems() rather than rolling an own version. - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. Modified: stable/9/sys/dev/xen/control/control.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/xen/control/control.c ============================================================================== --- stable/9/sys/dev/xen/control/control.c Sun Jan 27 22:50:39 2013 (r246004) +++ stable/9/sys/dev/xen/control/control.c Sun Jan 27 22:59:59 2013 (r246005) @@ -125,7 +125,6 @@ __FBSDID("$FreeBSD$"); #include #endif - #include #include @@ -145,8 +144,6 @@ __FBSDID("$FreeBSD$"); #include -#define NUM_ELEMENTS(x) (sizeof(x) / sizeof(*(x))) - /*--------------------------- Forward Declarations --------------------------*/ /** Function signature for shutdown event handlers. */ typedef void (xctrl_shutdown_handler_t)(void); @@ -165,7 +162,7 @@ struct xctrl_shutdown_reason { }; /** Lookup table for shutdown event name to handler. */ -static struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { +static const struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { { "poweroff", xctrl_poweroff }, { "reboot", xctrl_reboot }, { "suspend", xctrl_suspend }, @@ -198,7 +195,6 @@ extern void xencons_resume(void); static void xctrl_suspend() { - u_int cpuid; int i, j, k, fpp; unsigned long max_pfn, start_info_mfn; @@ -207,6 +203,8 @@ xctrl_suspend() #ifdef SMP struct thread *td; cpuset_t map; + u_int cpuid; + /* * Bind us to CPU 0 and stop any other VCPUs. */ @@ -231,7 +229,7 @@ xctrl_suspend() mtx_lock(&Giant); if (DEVICE_SUSPEND(root_bus) != 0) { mtx_unlock(&Giant); - printf("xen_suspend: device_suspend failed\n"); + printf("%s: device_suspend failed\n", __func__); #ifdef SMP if (!CPU_EMPTY(&map)) restart_cpus(map); @@ -343,9 +341,9 @@ xctrl_suspend() * drivers need this. */ mtx_lock(&Giant); - if (DEVICE_SUSPEND(root_bus)) { + if (DEVICE_SUSPEND(root_bus) != 0) { mtx_unlock(&Giant); - printf("xen_suspend: device_suspend failed\n"); + printf("%s: device_suspend failed\n", __func__); return; } mtx_unlock(&Giant); @@ -396,8 +394,8 @@ xctrl_halt() static void xctrl_on_watch_event(struct xs_watch *watch, const char **vec, unsigned int len) { - struct xctrl_shutdown_reason *reason; - struct xctrl_shutdown_reason *last_reason; + const struct xctrl_shutdown_reason *reason; + const struct xctrl_shutdown_reason *last_reason; char *result; int error; int result_len; @@ -408,7 +406,7 @@ xctrl_on_watch_event(struct xs_watch *wa return; reason = xctrl_shutdown_reasons; - last_reason = reason + NUM_ELEMENTS(xctrl_shutdown_reasons); + last_reason = reason + nitems(xctrl_shutdown_reasons); while (reason < last_reason) { if (!strcmp(result, reason->name)) { @@ -511,10 +509,10 @@ static device_method_t xctrl_methods[] = DEVMETHOD(device_attach, xctrl_attach), DEVMETHOD(device_detach, xctrl_detach), - { 0, 0 } + DEVMETHOD_END }; DEFINE_CLASS_0(xctrl, xctrl_driver, xctrl_methods, sizeof(struct xctrl_softc)); devclass_t xctrl_devclass; -DRIVER_MODULE(xctrl, xenstore, xctrl_driver, xctrl_devclass, 0, 0); +DRIVER_MODULE(xctrl, xenstore, xctrl_driver, xctrl_devclass, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:00:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B8EB6C9; Sun, 27 Jan 2013 23:00:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1E6BAC0; Sun, 27 Jan 2013 23:00:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN01qb019674; Sun, 27 Jan 2013 23:00:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN01hd019673; Sun, 27 Jan 2013 23:00:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272300.r0RN01hd019673@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246006 - stable/8/sys/dev/xen/control X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:00:02 -0000 Author: marius Date: Sun Jan 27 23:00:01 2013 New Revision: 246006 URL: http://svnweb.freebsd.org/changeset/base/246006 Log: MFC: r244990 (partial) - Replace incorrect function names in printf(9) strings with __func__. - Make xctrl_shutdown_reasons table const. - Use nitems() rather than rolling an own version. - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. Modified: stable/8/sys/dev/xen/control/control.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/xen/ (props changed) Modified: stable/8/sys/dev/xen/control/control.c ============================================================================== --- stable/8/sys/dev/xen/control/control.c Sun Jan 27 22:59:59 2013 (r246005) +++ stable/8/sys/dev/xen/control/control.c Sun Jan 27 23:00:01 2013 (r246006) @@ -125,7 +125,6 @@ __FBSDID("$FreeBSD$"); #include #endif - #include #include @@ -145,8 +144,6 @@ __FBSDID("$FreeBSD$"); #include -#define NUM_ELEMENTS(x) (sizeof(x) / sizeof(*(x))) - /*--------------------------- Forward Declarations --------------------------*/ /** Function signature for shutdown event handlers. */ typedef void (xctrl_shutdown_handler_t)(void); @@ -165,7 +162,7 @@ struct xctrl_shutdown_reason { }; /** Lookup table for shutdown event name to handler. */ -static struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { +static const struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { { "poweroff", xctrl_poweroff }, { "reboot", xctrl_reboot }, { "suspend", xctrl_suspend }, @@ -205,6 +202,7 @@ xctrl_suspend() #ifdef SMP cpumask_t map; + /* * Bind us to CPU 0 and stop any other VCPUs. */ @@ -225,7 +223,7 @@ xctrl_suspend() mtx_lock(&Giant); if (DEVICE_SUSPEND(root_bus) != 0) { mtx_unlock(&Giant); - printf("xen_suspend: device_suspend failed\n"); + printf("%s: device_suspend failed\n", __func__); #ifdef SMP if (map) restart_cpus(map); @@ -337,9 +335,9 @@ xctrl_suspend() * drivers need this. */ mtx_lock(&Giant); - if (DEVICE_SUSPEND(root_bus)) { + if (DEVICE_SUSPEND(root_bus) != 0) { mtx_unlock(&Giant); - printf("xen_suspend: device_suspend failed\n"); + printf("%s: device_suspend failed\n", __func__); return; } mtx_unlock(&Giant); @@ -390,8 +388,8 @@ xctrl_halt() static void xctrl_on_watch_event(struct xs_watch *watch, const char **vec, unsigned int len) { - struct xctrl_shutdown_reason *reason; - struct xctrl_shutdown_reason *last_reason; + const struct xctrl_shutdown_reason *reason; + const struct xctrl_shutdown_reason *last_reason; char *result; int error; int result_len; @@ -402,7 +400,7 @@ xctrl_on_watch_event(struct xs_watch *wa return; reason = xctrl_shutdown_reasons; - last_reason = reason + NUM_ELEMENTS(xctrl_shutdown_reasons); + last_reason = reason + nitems(xctrl_shutdown_reasons); while (reason < last_reason) { if (!strcmp(result, reason->name)) { @@ -505,10 +503,10 @@ static device_method_t xctrl_methods[] = DEVMETHOD(device_attach, xctrl_attach), DEVMETHOD(device_detach, xctrl_detach), - { 0, 0 } + DEVMETHOD_END }; DEFINE_CLASS_0(xctrl, xctrl_driver, xctrl_methods, sizeof(struct xctrl_softc)); devclass_t xctrl_devclass; -DRIVER_MODULE(xctrl, xenstore, xctrl_driver, xctrl_devclass, 0, 0); +DRIVER_MODULE(xctrl, xenstore, xctrl_driver, xctrl_devclass, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:02:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 44A2CA6F; Sun, 27 Jan 2013 23:02:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 36238AE9; Sun, 27 Jan 2013 23:02:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN2YDk021749; Sun, 27 Jan 2013 23:02:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN2YUW021748; Sun, 27 Jan 2013 23:02:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272302.r0RN2YUW021748@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246007 - stable/9/sys/dev/xen/netfront X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:02:34 -0000 Author: marius Date: Sun Jan 27 23:02:33 2013 New Revision: 246007 URL: http://svnweb.freebsd.org/changeset/base/246007 Log: MFC: r244991 - Replace partially incorrect function names in panic(9) strings with __func__ and add some missing ones. - Remove a stale comment. - Remove unused NUM_ELEMENTS macro. - Remove extra empty lines. - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. Modified: stable/9/sys/dev/xen/netfront/netfront.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/9/sys/dev/xen/netfront/netfront.c Sun Jan 27 23:00:01 2013 (r246006) +++ stable/9/sys/dev/xen/netfront/netfront.c Sun Jan 27 23:02:33 2013 (r246007) @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ - #include __FBSDID("$FreeBSD$"); @@ -208,8 +207,6 @@ struct xn_chain_data { struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; }; -#define NUM_ELEMENTS(x) (sizeof(x)/sizeof(*x)) - struct net_device_stats { u_long rx_packets; /* total packets received */ @@ -244,7 +241,6 @@ struct net_device_stats }; struct netfront_info { - struct ifnet *xn_ifp; #if __FreeBSD_version >= 700000 struct lro_ctrl xn_lro; @@ -329,12 +325,6 @@ struct netfront_rx_info { /* Access macros for acquiring freeing slots in xn_free_{tx,rx}_idxs[]. */ - - -/* - * Access macros for acquiring freeing slots in tx_skbs[]. - */ - static inline void add_id_to_freelist(struct mbuf **list, uintptr_t id) { @@ -517,7 +507,6 @@ netfront_resume(device_t dev) return (0); } - /* Common code used when first setting up, and when resuming. */ static int talk_to_backend(device_t dev, struct netfront_info *info) @@ -605,7 +594,6 @@ talk_to_backend(device_t dev, struct net return err; } - static int setup_device(device_t dev, struct netfront_info *info) { @@ -794,7 +782,7 @@ netif_release_tx_bufs(struct netfront_in add_id_to_freelist(np->tx_mbufs, i); np->xn_cdata.xn_tx_chain_cnt--; if (np->xn_cdata.xn_tx_chain_cnt < 0) { - panic("netif_release_tx_bufs: tx_chain_cnt must be >= 0"); + panic("%s: tx_chain_cnt must be >= 0", __func__); } m_free(m); } @@ -946,7 +934,6 @@ refill: reservation.domid = DOMID_SELF; if (!xen_feature(XENFEAT_auto_translated_physmap)) { - /* After all PTEs have been zapped, flush the TLB. */ sc->rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] = UVMF_TLB_FLUSH|UVMF_ALL; @@ -958,15 +945,11 @@ refill: /* Zap PTEs and give away pages in one big multicall. */ (void)HYPERVISOR_multicall(sc->rx_mcl, i+1); - /* Check return status of HYPERVISOR_dom_mem_op(). */ - if (unlikely(sc->rx_mcl[i].result != i)) - panic("Unable to reduce memory reservation\n"); - } else { - if (HYPERVISOR_memory_op( - XENMEM_decrease_reservation, &reservation) - != i) - panic("Unable to reduce memory " - "reservation\n"); + if (unlikely(sc->rx_mcl[i].result != i || + HYPERVISOR_memory_op(XENMEM_decrease_reservation, + &reservation) != i)) + panic("%s: unable to reduce memory " + "reservation\n", __func__); } } else { wmb(); @@ -1169,8 +1152,8 @@ xn_txeof(struct netfront_info *np) ifp->if_opackets++; if (unlikely(gnttab_query_foreign_access( np->grant_tx_ref[id]) != 0)) { - panic("grant id %u still in use by the backend", - id); + panic("%s: grant id %u still in use by the " + "backend", __func__, id); } gnttab_end_foreign_access_ref( np->grant_tx_ref[id]); @@ -1210,7 +1193,6 @@ xn_txeof(struct netfront_info *np) netif_wake_queue(dev); #endif } - } static void @@ -1240,7 +1222,6 @@ xn_intr(void *xsc) xn_start(ifp); } - static void xennet_move_rx_slot(struct netfront_info *np, struct mbuf *m, grant_ref_t ref) @@ -1319,17 +1300,15 @@ xennet_get_responses(struct netfront_inf m0 = m = m_prev = xennet_get_rx_mbuf(np, *cons); - if (rx->flags & NETRXF_extra_info) { err = xennet_get_extras(np, extras, rp, cons); } - if (m0 != NULL) { m0->m_pkthdr.len = 0; m0->m_next = NULL; } - + for (;;) { u_long mfn; @@ -1468,10 +1447,8 @@ xn_tick_locked(struct netfront_info *sc) callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); /* XXX placeholder for printing debug information */ - } - static void xn_tick(void *xsc) { @@ -1481,7 +1458,6 @@ xn_tick(void *xsc) XN_RX_LOCK(sc); xn_tick_locked(sc); XN_RX_UNLOCK(sc); - } /** @@ -1595,10 +1571,12 @@ xn_assemble_tx_request(struct netfront_i tx = RING_GET_REQUEST(&sc->tx, sc->tx.req_prod_pvt); id = get_id_from_freelist(sc->tx_mbufs); if (id == 0) - panic("xn_start_locked: was allocated the freelist head!\n"); + panic("%s: was allocated the freelist head!\n", + __func__); sc->xn_cdata.xn_tx_chain_cnt++; if (sc->xn_cdata.xn_tx_chain_cnt > NET_TX_RING_SIZE) - panic("xn_start_locked: tx_chain_cnt must be <= NET_TX_RING_SIZE\n"); + panic("%s: tx_chain_cnt must be <= NET_TX_RING_SIZE\n", + __func__); sc->tx_mbufs[id] = m; tx->id = id; ref = gnttab_claim_grant_reference(&sc->gref_tx_head); @@ -1710,7 +1688,6 @@ xn_start_locked(struct ifnet *ifp) } } - static void xn_start(struct ifnet *ifp) { @@ -1744,10 +1721,8 @@ xn_ifinit_locked(struct netfront_info *s if_link_state_change(ifp, LINK_STATE_UP); callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); - } - static void xn_ifinit(void *xsc) { @@ -1756,10 +1731,8 @@ xn_ifinit(void *xsc) XN_LOCK(sc); xn_ifinit_locked(sc); XN_UNLOCK(sc); - } - static int xn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { @@ -2262,7 +2235,7 @@ static device_method_t netfront_methods[ /* Xenbus interface */ DEVMETHOD(xenbus_otherend_changed, netfront_backend_changed), - { 0, 0 } + DEVMETHOD_END }; static driver_t netfront_driver = { @@ -2272,4 +2245,5 @@ static driver_t netfront_driver = { }; devclass_t netfront_devclass; -DRIVER_MODULE(xe, xenbusb_front, netfront_driver, netfront_devclass, 0, 0); +DRIVER_MODULE(xe, xenbusb_front, netfront_driver, netfront_devclass, NULL, + NULL); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:02:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 82B62A70; Sun, 27 Jan 2013 23:02:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74A4CAEA; Sun, 27 Jan 2013 23:02:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN2aaE021786; Sun, 27 Jan 2013 23:02:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN2a34021785; Sun, 27 Jan 2013 23:02:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272302.r0RN2a34021785@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246008 - stable/8/sys/dev/xen/netfront X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:02:36 -0000 Author: marius Date: Sun Jan 27 23:02:35 2013 New Revision: 246008 URL: http://svnweb.freebsd.org/changeset/base/246008 Log: MFC: r244991 - Replace partially incorrect function names in panic(9) strings with __func__ and add some missing ones. - Remove a stale comment. - Remove unused NUM_ELEMENTS macro. - Remove extra empty lines. - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. Modified: stable/8/sys/dev/xen/netfront/netfront.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/xen/ (props changed) Modified: stable/8/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/8/sys/dev/xen/netfront/netfront.c Sun Jan 27 23:02:33 2013 (r246007) +++ stable/8/sys/dev/xen/netfront/netfront.c Sun Jan 27 23:02:35 2013 (r246008) @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ - #include __FBSDID("$FreeBSD$"); @@ -206,8 +205,6 @@ struct xn_chain_data { struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; }; -#define NUM_ELEMENTS(x) (sizeof(x)/sizeof(*x)) - struct net_device_stats { u_long rx_packets; /* total packets received */ @@ -242,7 +239,6 @@ struct net_device_stats }; struct netfront_info { - struct ifnet *xn_ifp; #if __FreeBSD_version >= 700000 struct lro_ctrl xn_lro; @@ -327,12 +323,6 @@ struct netfront_rx_info { /* Access macros for acquiring freeing slots in xn_free_{tx,rx}_idxs[]. */ - - -/* - * Access macros for acquiring freeing slots in tx_skbs[]. - */ - static inline void add_id_to_freelist(struct mbuf **list, uintptr_t id) { @@ -515,7 +505,6 @@ netfront_resume(device_t dev) return (0); } - /* Common code used when first setting up, and when resuming. */ static int talk_to_backend(device_t dev, struct netfront_info *info) @@ -603,7 +592,6 @@ talk_to_backend(device_t dev, struct net return err; } - static int setup_device(device_t dev, struct netfront_info *info) { @@ -788,7 +776,7 @@ netif_release_tx_bufs(struct netfront_in add_id_to_freelist(np->tx_mbufs, i); np->xn_cdata.xn_tx_chain_cnt--; if (np->xn_cdata.xn_tx_chain_cnt < 0) { - panic("netif_release_tx_bufs: tx_chain_cnt must be >= 0"); + panic("%s: tx_chain_cnt must be >= 0", __func__); } m_free(m); } @@ -940,7 +928,6 @@ refill: reservation.domid = DOMID_SELF; if (!xen_feature(XENFEAT_auto_translated_physmap)) { - /* After all PTEs have been zapped, flush the TLB. */ sc->rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] = UVMF_TLB_FLUSH|UVMF_ALL; @@ -952,15 +939,11 @@ refill: /* Zap PTEs and give away pages in one big multicall. */ (void)HYPERVISOR_multicall(sc->rx_mcl, i+1); - /* Check return status of HYPERVISOR_dom_mem_op(). */ - if (unlikely(sc->rx_mcl[i].result != i)) - panic("Unable to reduce memory reservation\n"); - } else { - if (HYPERVISOR_memory_op( - XENMEM_decrease_reservation, &reservation) - != i) - panic("Unable to reduce memory " - "reservation\n"); + if (unlikely(sc->rx_mcl[i].result != i || + HYPERVISOR_memory_op(XENMEM_decrease_reservation, + &reservation) != i)) + panic("%s: unable to reduce memory " + "reservation\n", __func__); } } else { wmb(); @@ -1163,8 +1146,8 @@ xn_txeof(struct netfront_info *np) ifp->if_opackets++; if (unlikely(gnttab_query_foreign_access( np->grant_tx_ref[id]) != 0)) { - panic("grant id %u still in use by the backend", - id); + panic("%s: grant id %u still in use by the " + "backend", __func__, id); } gnttab_end_foreign_access_ref( np->grant_tx_ref[id]); @@ -1204,7 +1187,6 @@ xn_txeof(struct netfront_info *np) netif_wake_queue(dev); #endif } - } static void @@ -1234,7 +1216,6 @@ xn_intr(void *xsc) xn_start(ifp); } - static void xennet_move_rx_slot(struct netfront_info *np, struct mbuf *m, grant_ref_t ref) @@ -1313,17 +1294,15 @@ xennet_get_responses(struct netfront_inf m0 = m = m_prev = xennet_get_rx_mbuf(np, *cons); - if (rx->flags & NETRXF_extra_info) { err = xennet_get_extras(np, extras, rp, cons); } - if (m0 != NULL) { m0->m_pkthdr.len = 0; m0->m_next = NULL; } - + for (;;) { u_long mfn; @@ -1462,10 +1441,8 @@ xn_tick_locked(struct netfront_info *sc) callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); /* XXX placeholder for printing debug information */ - } - static void xn_tick(void *xsc) { @@ -1475,7 +1452,6 @@ xn_tick(void *xsc) XN_RX_LOCK(sc); xn_tick_locked(sc); XN_RX_UNLOCK(sc); - } /** @@ -1589,10 +1565,12 @@ xn_assemble_tx_request(struct netfront_i tx = RING_GET_REQUEST(&sc->tx, sc->tx.req_prod_pvt); id = get_id_from_freelist(sc->tx_mbufs); if (id == 0) - panic("xn_start_locked: was allocated the freelist head!\n"); + panic("%s: was allocated the freelist head!\n", + __func__); sc->xn_cdata.xn_tx_chain_cnt++; if (sc->xn_cdata.xn_tx_chain_cnt > NET_TX_RING_SIZE) - panic("xn_start_locked: tx_chain_cnt must be <= NET_TX_RING_SIZE\n"); + panic("%s: tx_chain_cnt must be <= NET_TX_RING_SIZE\n", + __func__); sc->tx_mbufs[id] = m; tx->id = id; ref = gnttab_claim_grant_reference(&sc->gref_tx_head); @@ -1704,7 +1682,6 @@ xn_start_locked(struct ifnet *ifp) } } - static void xn_start(struct ifnet *ifp) { @@ -1738,10 +1715,8 @@ xn_ifinit_locked(struct netfront_info *s if_link_state_change(ifp, LINK_STATE_UP); callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); - } - static void xn_ifinit(void *xsc) { @@ -1750,10 +1725,8 @@ xn_ifinit(void *xsc) XN_LOCK(sc); xn_ifinit_locked(sc); XN_UNLOCK(sc); - } - static int xn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { @@ -2250,7 +2223,7 @@ static device_method_t netfront_methods[ /* Xenbus interface */ DEVMETHOD(xenbus_otherend_changed, netfront_backend_changed), - { 0, 0 } + DEVMETHOD_END }; static driver_t netfront_driver = { @@ -2260,4 +2233,5 @@ static driver_t netfront_driver = { }; devclass_t netfront_devclass; -DRIVER_MODULE(xe, xenbusb_front, netfront_driver, netfront_devclass, 0, 0); +DRIVER_MODULE(xe, xenbusb_front, netfront_driver, netfront_devclass, NULL, + NULL); From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:05:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 685DCD59; Sun, 27 Jan 2013 23:05:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 420A7B09; Sun, 27 Jan 2013 23:05:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN5MGM022328; Sun, 27 Jan 2013 23:05:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN5MxD022327; Sun, 27 Jan 2013 23:05:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272305.r0RN5MxD022327@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246009 - in stable/9/sys/dev/xen: evtchn xenpci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:05:22 -0000 Author: marius Date: Sun Jan 27 23:05:21 2013 New Revision: 246009 URL: http://svnweb.freebsd.org/changeset/base/246009 Log: MFC: r244993 Remove files not connected to the build. It's confusing enough that we still have two not quite the same evtchn.c left over. Deleted: stable/9/sys/dev/xen/evtchn/ stable/9/sys/dev/xen/xenpci/machine_reboot.c Modified: Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:05:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9E4C2E61; Sun, 27 Jan 2013 23:05:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 444BAB0B; Sun, 27 Jan 2013 23:05:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN5Sw5022384; Sun, 27 Jan 2013 23:05:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN5SHI022383; Sun, 27 Jan 2013 23:05:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272305.r0RN5SHI022383@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246010 - in stable/8/sys/dev/xen: evtchn xenpci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:05:28 -0000 Author: marius Date: Sun Jan 27 23:05:27 2013 New Revision: 246010 URL: http://svnweb.freebsd.org/changeset/base/246010 Log: MFC: r244993 Remove files not connected to the build. It's confusing enough that we still have two not quite the same evtchn.c left over. Deleted: stable/8/sys/dev/xen/evtchn/ stable/8/sys/dev/xen/xenpci/machine_reboot.c Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/xen/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:08:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6ACDAE4; Sun, 27 Jan 2013 23:08:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 51BCFB22; Sun, 27 Jan 2013 23:08:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN8qH4022990; Sun, 27 Jan 2013 23:08:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN8qLf022989; Sun, 27 Jan 2013 23:08:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272308.r0RN8qLf022989@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246011 - stable/9/sys/sparc64/sparc64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:08:52 -0000 Author: marius Date: Sun Jan 27 23:08:51 2013 New Revision: 246011 URL: http://svnweb.freebsd.org/changeset/base/246011 Log: MFC: r245017 Revert bogus part of r241740 (MFC'ed to stable/9 in r241878). Reported by: Michael Moll Modified: stable/9/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/9/sys/sparc64/sparc64/interrupt.S Sun Jan 27 23:05:27 2013 (r246010) +++ stable/9/sys/sparc64/sparc64/interrupt.S Sun Jan 27 23:08:51 2013 (r246011) @@ -83,13 +83,13 @@ ENTRY(intr_vector) * The 2nd word points to code to execute and the 3rd is an argument * to pass. Jump to it. */ - brnz,a,pt %g3, 1f - srlx %g3, 60, %g6 + brnz,pt %g3, 1f /* * NB: Zeus CPUs set some undocumented bits in the first data word. */ - jmpl %g4, %g0 and %g3, IV_MAX - 1, %g3 + jmpl %g4, %g0 + nop /* NOTREACHED */ /* @@ -98,7 +98,8 @@ ENTRY(intr_vector) * 4 bits of the 1st data word specify a priority, and the 2nd and * 3rd a function and argument. */ -1: brnz,a,pn %g6, 2f +1: srlx %g3, 60, %g6 + brnz,a,pn %g6, 2f clr %g3 /* From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:08:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 867ABEB; Sun, 27 Jan 2013 23:08:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 70484B26; Sun, 27 Jan 2013 23:08:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN8u8F023036; Sun, 27 Jan 2013 23:08:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN8uDM023035; Sun, 27 Jan 2013 23:08:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272308.r0RN8uDM023035@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246012 - stable/8/sys/sparc64/sparc64 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:08:56 -0000 Author: marius Date: Sun Jan 27 23:08:55 2013 New Revision: 246012 URL: http://svnweb.freebsd.org/changeset/base/246012 Log: MFC: r245017 Revert bogus part of r241740 (MFC'ed to stable/8 in r241879). Reported by: Michael Moll Modified: stable/8/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/8/sys/sparc64/sparc64/interrupt.S Sun Jan 27 23:08:51 2013 (r246011) +++ stable/8/sys/sparc64/sparc64/interrupt.S Sun Jan 27 23:08:55 2013 (r246012) @@ -83,13 +83,13 @@ ENTRY(intr_vector) * The 2nd word points to code to execute and the 3rd is an argument * to pass. Jump to it. */ - brnz,a,pt %g3, 1f - srlx %g3, 60, %g6 + brnz,pt %g3, 1f /* * NB: Zeus CPUs set some undocumented bits in the first data word. */ - jmpl %g4, %g0 and %g3, IV_MAX - 1, %g3 + jmpl %g4, %g0 + nop /* NOTREACHED */ /* @@ -98,7 +98,8 @@ ENTRY(intr_vector) * 4 bits of the 1st data word specify a priority, and the 2nd and * 3rd a function and argument. */ -1: brnz,a,pn %g6, 2f +1: srlx %g3, 60, %g6 + brnz,a,pn %g6, 2f clr %g3 /* From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:12:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0F6D1475; Sun, 27 Jan 2013 23:12:38 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01C2FB56; Sun, 27 Jan 2013 23:12:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RNCbQ9025314; Sun, 27 Jan 2013 23:12:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RNCbdY025313; Sun, 27 Jan 2013 23:12:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201301272312.r0RNCbdY025313@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Jan 2013 23:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246013 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:12:38 -0000 Author: nwhitehorn Date: Sun Jan 27 23:12:37 2013 New Revision: 246013 URL: http://svnweb.freebsd.org/changeset/base/246013 Log: If no resolv.conf has been made for the new system already and the install media has one already, copy it in lieu of leaving things blank. This reduces the foot-shooting potential for PXE installs that immediately add packages. Modified: head/usr.sbin/bsdinstall/scripts/script Modified: head/usr.sbin/bsdinstall/scripts/script ============================================================================== --- head/usr.sbin/bsdinstall/scripts/script Sun Jan 27 23:08:55 2013 (r246012) +++ head/usr.sbin/bsdinstall/scripts/script Sun Jan 27 23:12:37 2013 (r246013) @@ -68,6 +68,11 @@ bsdinstall distextract # Finalize install bsdinstall config +# Make sure networking is functional, if we can arrange that +if [ ! -f $BSDINSTALL_CHROOT/etc/resolv.conf -a -f /etc/resolv.conf ]; then + cp /etc/resolv.conf $BSDINSTALL_CHROOT/etc/resolv.conf +fi + # Run post-install script if [ -f /tmp/bsdinstall-installscript-ab ]; then cp /tmp/bsdinstall-installscript-ab $BSDINSTALL_CHROOT/tmp/installscript From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:21:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 211BE623; Sun, 27 Jan 2013 23:21:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3C0ABD5; Sun, 27 Jan 2013 23:21:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RNLlYL028158; Sun, 27 Jan 2013 23:21:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RNLl0P028155; Sun, 27 Jan 2013 23:21:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272321.r0RNLl0P028155@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246014 - in stable/9/sys/sparc64: include sparc64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:21:48 -0000 Author: marius Date: Sun Jan 27 23:21:47 2013 New Revision: 246014 URL: http://svnweb.freebsd.org/changeset/base/246014 Log: MFC: r245850 Revert the part of r239864 (MFC'ed to stable/9 in r241681) which removed obtaining the SMP mutex around reading registers from other CPUs. As it turns out, the hardware doesn't really like concurrent IPI'ing causing adverse effects. Also the thought deadlock when using this spin lock here and the targeted CPU(s) are also holding or in case of nested locks can't actually happen. This is due to the fact that on sparc64, spinlock_enter() only raises the PIL but doesn't disable interrupts completely. Thus direct cross calls as used for the register reading (and all other MD IPI needs) still will be executed by the targeted CPU(s) in that case. Modified: stable/9/sys/sparc64/include/smp.h stable/9/sys/sparc64/sparc64/tick.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/include/smp.h ============================================================================== --- stable/9/sys/sparc64/include/smp.h Sun Jan 27 23:12:37 2013 (r246013) +++ stable/9/sys/sparc64/include/smp.h Sun Jan 27 23:21:47 2013 (r246014) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -202,6 +203,7 @@ ipi_rd(u_int cpu, void *func, u_long *va return (NULL); sched_pin(); ira = &ipi_rd_args; + mtx_lock_spin(&smp_ipi_mtx); CPU_SETOF(cpu, &ira->ira_mask); ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); @@ -298,18 +300,6 @@ ipi_wait(void *cookie) } } -static __inline void -ipi_wait_unlocked(void *cookie) -{ - volatile cpuset_t *mask; - - if ((mask = cookie) != NULL) { - while (!CPU_EMPTY(mask)) - ; - sched_unpin(); - } -} - #endif /* _MACHINE_PMAP_H_ && _SYS_MUTEX_H_ */ #endif /* !LOCORE */ @@ -368,12 +358,6 @@ ipi_wait(void *cookie __unused) } static __inline void -ipi_wait_unlocked(void *cookie __unused) -{ - -} - -static __inline void tl_ipi_cheetah_dcache_page_inval(void) { Modified: stable/9/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/9/sys/sparc64/sparc64/tick.c Sun Jan 27 23:12:37 2013 (r246013) +++ stable/9/sys/sparc64/sparc64/tick.c Sun Jan 27 23:21:47 2013 (r246014) @@ -334,7 +334,7 @@ stick_get_timecount_mp(struct timecounte if (curcpu == 0) stick = rdstick(); else - ipi_wait_unlocked(ipi_rd(0, tl_ipi_stick_rd, &stick)); + ipi_wait(ipi_rd(0, tl_ipi_stick_rd, &stick)); sched_unpin(); return (stick); } @@ -348,7 +348,7 @@ tick_get_timecount_mp(struct timecounter if (curcpu == 0) tick = rd(tick); else - ipi_wait_unlocked(ipi_rd(0, tl_ipi_tick_rd, &tick)); + ipi_wait(ipi_rd(0, tl_ipi_tick_rd, &tick)); sched_unpin(); return (tick); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:21:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9982A624; Sun, 27 Jan 2013 23:21:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A113BD6; Sun, 27 Jan 2013 23:21:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RNLqpJ028203; Sun, 27 Jan 2013 23:21:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RNLqKG028201; Sun, 27 Jan 2013 23:21:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272321.r0RNLqKG028201@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246015 - in stable/8/sys/sparc64: include sparc64 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:21:52 -0000 Author: marius Date: Sun Jan 27 23:21:51 2013 New Revision: 246015 URL: http://svnweb.freebsd.org/changeset/base/246015 Log: MFC: r245850 Revert the part of r239864 (MFC'ed to stable/8 in r241690) which removed obtaining the SMP mutex around reading registers from other CPUs. As it turns out, the hardware doesn't really like concurrent IPI'ing causing adverse effects. Also the thought deadlock when using this spin lock here and the targeted CPU(s) are also holding or in case of nested locks can't actually happen. This is due to the fact that on sparc64, spinlock_enter() only raises the PIL but doesn't disable interrupts completely. Thus direct cross calls as used for the register reading (and all other MD IPI needs) still will be executed by the targeted CPU(s) in that case. Modified: stable/8/sys/sparc64/include/smp.h stable/8/sys/sparc64/sparc64/tick.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/sparc64/include/smp.h ============================================================================== --- stable/8/sys/sparc64/include/smp.h Sun Jan 27 23:21:47 2013 (r246014) +++ stable/8/sys/sparc64/include/smp.h Sun Jan 27 23:21:51 2013 (r246015) @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -195,6 +196,7 @@ ipi_rd(u_int cpu, void *func, u_long *va return (NULL); sched_pin(); ira = &ipi_rd_args; + mtx_lock_spin(&smp_ipi_mtx); ira->ira_mask = 1 << cpu; ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); @@ -282,18 +284,6 @@ ipi_wait(void *cookie) } } -static __inline void -ipi_wait_unlocked(void *cookie) -{ - volatile cpumask_t *mask; - - if ((mask = cookie) != NULL) { - while (*mask != 0) - ; - sched_unpin(); - } -} - #endif /* _MACHINE_PMAP_H_ && _SYS_MUTEX_H_ */ #endif /* !LOCORE */ @@ -352,12 +342,6 @@ ipi_wait(void *cookie __unused) } static __inline void -ipi_wait_unlocked(void *cookie __unused) -{ - -} - -static __inline void tl_ipi_cheetah_dcache_page_inval(void) { Modified: stable/8/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/8/sys/sparc64/sparc64/tick.c Sun Jan 27 23:21:47 2013 (r246014) +++ stable/8/sys/sparc64/sparc64/tick.c Sun Jan 27 23:21:51 2013 (r246015) @@ -314,7 +314,7 @@ stick_get_timecount_mp(struct timecounte if (curcpu == 0) stick = rdstick(); else - ipi_wait_unlocked(ipi_rd(0, tl_ipi_stick_rd, &stick)); + ipi_wait(ipi_rd(0, tl_ipi_stick_rd, &stick)); sched_unpin(); return (stick); } @@ -328,7 +328,7 @@ tick_get_timecount_mp(struct timecounter if (curcpu == 0) tick = rd(tick); else - ipi_wait_unlocked(ipi_rd(0, tl_ipi_tick_rd, &tick)); + ipi_wait(ipi_rd(0, tl_ipi_tick_rd, &tick)); sched_unpin(); return (tick); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 27 23:33:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5107098D; Sun, 27 Jan 2013 23:33:43 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37C84C25; Sun, 27 Jan 2013 23:33:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RNXhra031357; Sun, 27 Jan 2013 23:33:43 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RNXhuO031356; Sun, 27 Jan 2013 23:33:43 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201301272333.r0RNXhuO031356@svn.freebsd.org> From: Colin Percival Date: Sun, 27 Jan 2013 23:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246016 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 23:33:43 -0000 Author: cperciva Date: Sun Jan 27 23:33:42 2013 New Revision: 246016 URL: http://svnweb.freebsd.org/changeset/base/246016 Log: Add a loader tunable "hw.broken_txfifo" which enables a workaround for a bug in old versions of QEMU (and Xen, and other places using QEMU code). On those buggy emulated UARTs, the "TX idle" interrupt gets lost; with this workaround, we spinwait for the TX to happen and then send ourselves the interrupt. It's ugly but it works, while minimizing the impact on the code for the !broken_txfifo case. MFC after: 2 weeks Modified: head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Sun Jan 27 23:21:51 2013 (r246015) +++ head/sys/dev/uart/uart_dev_ns8250.c Sun Jan 27 23:33:42 2013 (r246016) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -845,6 +847,11 @@ ns8250_bus_setsig(struct uart_softc *sc, return (0); } +static int broken_txfifo = 0; +SYSCTL_INT(_hw, OID_AUTO, broken_txfifo, CTLFLAG_RW | CTLFLAG_TUN, + &broken_txfifo, 0, "UART FIFO has QEMU emulation bug"); +TUNABLE_INT("hw.broken_txfifo", &broken_txfifo); + static int ns8250_bus_transmit(struct uart_softc *sc) { @@ -862,7 +869,12 @@ ns8250_bus_transmit(struct uart_softc *s uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); } - sc->sc_txbusy = 1; + if (broken_txfifo) + ns8250_drain(bas, UART_DRAIN_TRANSMITTER); + else + sc->sc_txbusy = 1; uart_unlock(sc->sc_hwmtx); + if (broken_txfifo) + uart_sched_softih(sc, SER_INT_TXIDLE); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 00:31:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 391F02CF; Mon, 28 Jan 2013 00:31:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 122E3E35; Mon, 28 Jan 2013 00:31:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S0VWM1048892; Mon, 28 Jan 2013 00:31:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S0VWBJ048891; Mon, 28 Jan 2013 00:31:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301280031.r0S0VWBJ048891@svn.freebsd.org> From: Marius Strobl Date: Mon, 28 Jan 2013 00:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246018 - stable/9/sys/dev/cas X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 00:31:33 -0000 Author: marius Date: Mon Jan 28 00:31:32 2013 New Revision: 246018 URL: http://svnweb.freebsd.org/changeset/base/246018 Log: MFC: r245923 - Check the return value of taskqueue_start_threads(). - At least the Saturn chips of 501-6738 cards need a delay after freezing the external GMII pins before the internal PHY is accessible again. So wait a bit after (un)freezing these. Also don't touch the other bits of that configuration register. [1] - Take advantage of nitems(). Reported and tested by: Paul Keusemann [1] Modified: stable/9/sys/dev/cas/if_cas.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cas/if_cas.c ============================================================================== --- stable/9/sys/dev/cas/if_cas.c Mon Jan 28 00:15:44 2013 (r246017) +++ stable/9/sys/dev/cas/if_cas.c Mon Jan 28 00:31:32 2013 (r246018) @@ -214,8 +214,12 @@ cas_attach(struct cas_softc *sc) error = ENXIO; goto fail_ifnet; } - taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", + error = taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->sc_dev)); + if (error != 0) { + device_printf(sc->sc_dev, "could not start threads\n"); + goto fail_taskq; + } /* Make sure the chip is stopped. */ cas_reset(sc); @@ -339,10 +343,13 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* Enable/unfreeze the GMII pins of Saturn. */ if (sc->sc_variant == CAS_SATURN) { - CAS_WRITE_4(sc, CAS_SATURN_PCFG, 0); + CAS_WRITE_4(sc, CAS_SATURN_PCFG, + CAS_READ_4(sc, CAS_SATURN_PCFG) & + ~CAS_SATURN_PCFG_FSI); CAS_BARRIER(sc, CAS_SATURN_PCFG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(10000); } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, @@ -359,10 +366,12 @@ cas_attach(struct cas_softc *sc) /* Freeze the GMII pins of Saturn for saving power. */ if (sc->sc_variant == CAS_SATURN) { CAS_WRITE_4(sc, CAS_SATURN_PCFG, + CAS_READ_4(sc, CAS_SATURN_PCFG) | CAS_SATURN_PCFG_FSI); CAS_BARRIER(sc, CAS_SATURN_PCFG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(10000); } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, @@ -2865,7 +2874,7 @@ cas_pci_attach(device_t dev) goto fail; } i = 0; - if (lma > 1 && pci_get_slot(dev) < sizeof(enaddr) / sizeof(*enaddr)) + if (lma > 1 && pci_get_slot(dev) < nitems(enaddr)) i = pci_get_slot(dev); memcpy(sc->sc_enaddr, enaddr[i], ETHER_ADDR_LEN); @@ -2874,7 +2883,7 @@ cas_pci_attach(device_t dev) goto fail; } i = 0; - if (phy > 1 && pci_get_slot(dev) < sizeof(pcs) / sizeof(*pcs)) + if (phy > 1 && pci_get_slot(dev) < nitems(pcs)) i = pci_get_slot(dev); if (pcs[i] != 0) sc->sc_flags |= CAS_SERDES; From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 00:31:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2C89A434; Mon, 28 Jan 2013 00:31:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1099DE39; Mon, 28 Jan 2013 00:31:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S0Vtxd048981; Mon, 28 Jan 2013 00:31:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S0Vt4U048980; Mon, 28 Jan 2013 00:31:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301280031.r0S0Vt4U048980@svn.freebsd.org> From: Marius Strobl Date: Mon, 28 Jan 2013 00:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246019 - stable/8/sys/dev/cas X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 00:31:56 -0000 Author: marius Date: Mon Jan 28 00:31:55 2013 New Revision: 246019 URL: http://svnweb.freebsd.org/changeset/base/246019 Log: MFC: r245923 - Check the return value of taskqueue_start_threads(). - At least the Saturn chips of 501-6738 cards need a delay after freezing the external GMII pins before the internal PHY is accessible again. So wait a bit after (un)freezing these. Also don't touch the other bits of that configuration register. [1] - Take advantage of nitems(). Reported and tested by: Paul Keusemann [1] Modified: stable/8/sys/dev/cas/if_cas.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/cas/ (props changed) Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Mon Jan 28 00:31:32 2013 (r246018) +++ stable/8/sys/dev/cas/if_cas.c Mon Jan 28 00:31:55 2013 (r246019) @@ -214,8 +214,12 @@ cas_attach(struct cas_softc *sc) error = ENXIO; goto fail_ifnet; } - taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", + error = taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->sc_dev)); + if (error != 0) { + device_printf(sc->sc_dev, "could not start threads\n"); + goto fail_taskq; + } /* Make sure the chip is stopped. */ cas_reset(sc); @@ -339,10 +343,13 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* Enable/unfreeze the GMII pins of Saturn. */ if (sc->sc_variant == CAS_SATURN) { - CAS_WRITE_4(sc, CAS_SATURN_PCFG, 0); + CAS_WRITE_4(sc, CAS_SATURN_PCFG, + CAS_READ_4(sc, CAS_SATURN_PCFG) & + ~CAS_SATURN_PCFG_FSI); CAS_BARRIER(sc, CAS_SATURN_PCFG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(10000); } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, @@ -359,10 +366,12 @@ cas_attach(struct cas_softc *sc) /* Freeze the GMII pins of Saturn for saving power. */ if (sc->sc_variant == CAS_SATURN) { CAS_WRITE_4(sc, CAS_SATURN_PCFG, + CAS_READ_4(sc, CAS_SATURN_PCFG) | CAS_SATURN_PCFG_FSI); CAS_BARRIER(sc, CAS_SATURN_PCFG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(10000); } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, @@ -2871,7 +2880,7 @@ cas_pci_attach(device_t dev) goto fail; } i = 0; - if (lma > 1 && pci_get_slot(dev) < sizeof(enaddr) / sizeof(*enaddr)) + if (lma > 1 && pci_get_slot(dev) < nitems(enaddr)) i = pci_get_slot(dev); memcpy(sc->sc_enaddr, enaddr[i], ETHER_ADDR_LEN); @@ -2880,7 +2889,7 @@ cas_pci_attach(device_t dev) goto fail; } i = 0; - if (phy > 1 && pci_get_slot(dev) < sizeof(pcs) / sizeof(*pcs)) + if (phy > 1 && pci_get_slot(dev) < nitems(pcs)) i = pci_get_slot(dev); if (pcs[i] != 0) sc->sc_flags |= CAS_SERDES; From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 07:04:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DBDCD268; Mon, 28 Jan 2013 07:04:52 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CD0A8D66; Mon, 28 Jan 2013 07:04:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S74qoe065977; Mon, 28 Jan 2013 07:04:52 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S74qBh065976; Mon, 28 Jan 2013 07:04:52 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201301280704.r0S74qBh065976@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 28 Jan 2013 07:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246020 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 07:04:52 -0000 Author: pluknet Date: Mon Jan 28 07:04:52 2013 New Revision: 246020 URL: http://svnweb.freebsd.org/changeset/base/246020 Log: Technical corrections and improvements for the previous change. Submitted by: bde Modified: head/share/man/man9/VFS_SET.9 Modified: head/share/man/man9/VFS_SET.9 ============================================================================== --- head/share/man/man9/VFS_SET.9 Mon Jan 28 00:31:55 2013 (r246019) +++ head/share/man/man9/VFS_SET.9 Mon Jan 28 07:04:52 2013 (r246020) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2012 +.Dd January 28, 2013 .Dt VFS_SET 9 .Os .Sh NAME @@ -84,9 +84,9 @@ sysctl is set to .Sh PSEUDOCODE .Bd -literal /* - * Fill in the ones we redefine. The unused fields will be - * automatically initialized by pointers to vfs_std* functions - * during file system registration. + * Fill in the fields for which we have special methods. + * The others are initially null. This tells vfs to change them to + * pointers to vfs_std* functions during file system registration. */ static struct vfsops myfs_vfsops = { .vfs_mount = myfs_mount, From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 07:22:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 454285CB; Mon, 28 Jan 2013 07:22:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37E79DEE; Mon, 28 Jan 2013 07:22:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S7MjdX071768; Mon, 28 Jan 2013 07:22:45 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S7Mi1L071766; Mon, 28 Jan 2013 07:22:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301280722.r0S7Mi1L071766@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 28 Jan 2013 07:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246021 - in head/sys/dev/usb: . net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 07:22:45 -0000 Author: hselasky Date: Mon Jan 28 07:22:44 2013 New Revision: 246021 URL: http://svnweb.freebsd.org/changeset/base/246021 Log: Add new USB ID. Submitted by: Ramil PR: usb/175639 MFC after: 1 week Modified: head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Mon Jan 28 07:04:52 2013 (r246020) +++ head/sys/dev/usb/net/if_axe.c Mon Jan 28 07:22:44 2013 (r246021) @@ -159,6 +159,7 @@ static const STRUCT_USB_HOST_ID axe_devs AXE_DEV(COREGA, FETHER_USB2_TX, 0), AXE_DEV(DLINK, DUBE100, 0), AXE_DEV(DLINK, DUBE100B1, AXE_FLAG_772), + AXE_DEV(DLINK, DUBE100C1, AXE_FLAG_772B), AXE_DEV(GOODWAY, GWUSB2E, 0), AXE_DEV(IODATA, ETGUS2, AXE_FLAG_178), AXE_DEV(JVC, MP_PRX1, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jan 28 07:04:52 2013 (r246020) +++ head/sys/dev/usb/usbdevs Mon Jan 28 07:22:44 2013 (r246021) @@ -1487,6 +1487,7 @@ product DIGIANSWER ZIGBEE802154 0x000a Z /* D-Link products */ /*product DLINK DSBS25 0x0100 DSB-S25 serial*/ product DLINK DUBE100 0x1a00 10/100 Ethernet +product DLINK DUBE100C1 0x1a02 DUB-E100 rev C1 product DLINK DSB650TX4 0x200c 10/100 Ethernet product DLINK DWL120E 0x3200 DWL-120 rev E product DLINK DWL122 0x3700 DWL-122 From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 07:26:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2AE1772; Mon, 28 Jan 2013 07:26:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AFD50E10; Mon, 28 Jan 2013 07:26:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S7Qktr072329; Mon, 28 Jan 2013 07:26:46 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S7QknC072327; Mon, 28 Jan 2013 07:26:46 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301280726.r0S7QknC072327@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 28 Jan 2013 07:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246022 - in stable/9/sys/dev/usb: . quirk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 07:26:47 -0000 Author: hselasky Date: Mon Jan 28 07:26:45 2013 New Revision: 246022 URL: http://svnweb.freebsd.org/changeset/base/246022 Log: MFC r245725: Add new quirk and correct old one. PR: usb/175454 MFC after: 1 week Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Mon Jan 28 07:22:44 2013 (r246021) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Mon Jan 28 07:26:45 2013 (r246022) @@ -302,7 +302,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(ONSPEC, READER, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(ONSPEC, UCF100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY | UQ_MSC_NO_GETMAXLUN), + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(ONSPEC2, IMAGEMATE_SDDR55, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(PANASONIC, KXL840AN, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, @@ -338,6 +338,8 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(SANDISK, SDDR31, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1), + USB_QUIRK(SANDISK, IMAGEMATE_SDDR289, 0x0000, 0xffff, + UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(SCANLOGIC, SL11R, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY), USB_QUIRK(SHUTTLE, EUSB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Jan 28 07:22:44 2013 (r246021) +++ stable/9/sys/dev/usb/usbdevs Mon Jan 28 07:26:45 2013 (r246022) @@ -3558,6 +3558,7 @@ product SANDISK SDDR75 0x0810 ImageMate product SANDISK SDCZ2_256 0x7104 Cruzer Mini 256MB product SANDISK SDCZ4_128 0x7112 Cruzer Micro 128MB product SANDISK SDCZ4_256 0x7113 Cruzer Micro 256MB +product SANDISK IMAGEMATE_SDDR289 0xb6ba ImageMate SDDR-289 /* Sanwa Electric Instrument Co., Ltd. products */ product SANWA KB_USB2 0x0701 KB-USB2 multimeter cable From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 07:28:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0D4BC9AA; Mon, 28 Jan 2013 07:28:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4BFFE33; Mon, 28 Jan 2013 07:28:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S7Srra072643; Mon, 28 Jan 2013 07:28:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S7Sr1C072641; Mon, 28 Jan 2013 07:28:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301280728.r0S7Sr1C072641@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 28 Jan 2013 07:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246023 - in stable/8/sys/dev/usb: . quirk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 07:28:54 -0000 Author: hselasky Date: Mon Jan 28 07:28:52 2013 New Revision: 246023 URL: http://svnweb.freebsd.org/changeset/base/246023 Log: MFC r245725: Add new quirk and correct old one. PR: usb/175454 MFC after: 1 week Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Mon Jan 28 07:26:45 2013 (r246022) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Mon Jan 28 07:28:52 2013 (r246023) @@ -299,7 +299,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(ONSPEC, READER, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(ONSPEC, UCF100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY | UQ_MSC_NO_GETMAXLUN), + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(ONSPEC2, IMAGEMATE_SDDR55, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(PANASONIC, KXL840AN, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, @@ -335,6 +335,8 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(SANDISK, SDDR31, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1), + USB_QUIRK(SANDISK, IMAGEMATE_SDDR289, 0x0000, 0xffff, + UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(SCANLOGIC, SL11R, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY), USB_QUIRK(SHUTTLE, EUSB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Mon Jan 28 07:26:45 2013 (r246022) +++ stable/8/sys/dev/usb/usbdevs Mon Jan 28 07:28:52 2013 (r246023) @@ -3559,6 +3559,7 @@ product SANDISK SDDR75 0x0810 ImageMate product SANDISK SDCZ2_256 0x7104 Cruzer Mini 256MB product SANDISK SDCZ4_128 0x7112 Cruzer Micro 128MB product SANDISK SDCZ4_256 0x7113 Cruzer Micro 256MB +product SANDISK IMAGEMATE_SDDR289 0xb6ba ImageMate SDDR-289 /* Sanwa Electric Instrument Co., Ltd. products */ product SANWA KB_USB2 0x0701 KB-USB2 multimeter cable From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 09:11:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 22569E28; Mon, 28 Jan 2013 09:11:05 +0000 (UTC) (envelope-from dmarion@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 137D1310; Mon, 28 Jan 2013 09:11:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S9B520004706; Mon, 28 Jan 2013 09:11:05 GMT (envelope-from dmarion@svn.freebsd.org) Received: (from dmarion@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S9B5we004705; Mon, 28 Jan 2013 09:11:05 GMT (envelope-from dmarion@svn.freebsd.org) Message-Id: <201301280911.r0S9B5we004705@svn.freebsd.org> From: Damjan Marion Date: Mon, 28 Jan 2013 09:11:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246024 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 09:11:05 -0000 Author: dmarion Date: Mon Jan 28 09:11:04 2013 New Revision: 246024 URL: http://svnweb.freebsd.org/changeset/base/246024 Log: Filled in missing pads for AM335x / Beaglebone. Submitted by: Emmanuel Vadot Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.c Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm_padconf.c Mon Jan 28 07:28:52 2013 (r246023) +++ head/sys/arm/ti/am335x/am335x_scm_padconf.c Mon Jan 28 09:11:04 2013 (r246024) @@ -86,127 +86,117 @@ const struct ti_scm_padstate ti_padstate }; const struct ti_scm_padconf ti_padconf_devmap[] = { - _PIN(0x800, "GPMC_AD0", 32, 7,"gpmc_ad0", "mmc1_dat0", NULL, NULL, NULL, NULL, NULL, "gpio1_0"), - _PIN(0x804, "GPMC_AD1", 33, 7,"gpmc_ad1", "mmc1_dat1", NULL, NULL, NULL, NULL, NULL, "gpio1_1"), - _PIN(0x808, "GPMC_AD2", 34, 7,"gpmc_ad2", "mmc1_dat2", NULL, NULL, NULL, NULL, NULL, "gpio1_2"), - _PIN(0x80C, "GPMC_AD3", 35, 7,"gpmc_ad3", "mmc1_dat3", NULL, NULL, NULL, NULL, NULL, "gpio1_3"), - _PIN(0x810, "GPMC_AD4", 36, 7,"gpmc_ad4", "mmc1_dat4", NULL, NULL, NULL, NULL, NULL, "gpio1_4"), - _PIN(0x814, "GPMC_AD5", 37, 7,"gpmc_ad5", "mmc1_dat5", NULL, NULL, NULL, NULL, NULL, "gpio1_5"), - _PIN(0x818, "GPMC_AD6", 38, 7,"gpmc_ad6", "mmc1_dat6", NULL, NULL, NULL, NULL, NULL, "gpio1_6"), - _PIN(0x81C, "GPMC_AD7", 39, 7,"gpmc_ad7", "mmc1_dat7", NULL, NULL, NULL, NULL, NULL, "gpio1_7"), -#if 0 /* Incomplete Entries - fill with data from table 2-7 in datasheet */ - _PIN(0x820, "gpmc_ad8", 0, 0, "gpmc_ad8", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x824, "gpmc_ad9", 0, 0, "gpmc_ad9", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x828, "gpmc_ad10", 0, 0, "gpmc_ad10", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x82C, "gpmc_ad11", 0, 0, "gpmc_ad11", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x830, "gpmc_ad12", 0, 0, "gpmc_ad12", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x834, "gpmc_ad13", 0, 0, "gpmc_ad13", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x838, "gpmc_ad14", 0, 0, "gpmc_ad14", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x83C, "gpmc_ad15", 0, 0, "gpmc_ad15", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x840, "gpmc_a0", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x844, "gpmc_a1", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x848, "gpmc_a2", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x84C, "gpmc_a3", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x850, "gpmc_a4", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), -#endif - _PIN(0x854, "GPMC_A5", 53, 7, "gpmc_a5", "gmii2_txd0", "rgmii2_td0", "rmii2_txd0", "gpmc_a21", "pr1_mii1_rxd3", "eQEP1B_in", "gpio1_21"), - _PIN(0x858, "GPMC_A6", 54, 7, "gpmc_a6", "gmii2_txclk", "rgmii2_tclk", "mmc2_dat4", "gpmc_a22", "pr1_mii1_rxd2", "eQEP1_index", "gpio1_22"), - _PIN(0x85C, "GPMC_A7", 55, 7, "gpmc_a7", "gmii2_rxclk", "rgmii2_rclk", "mmc2_dat5", "gpmc_a23", "pr1_mii1_rxd1", "eQEP1_strobe", "gpio1_23"), - _PIN(0x860, "GPMC_A8", 56, 7, "gpmc_a8", "gmii2_rxd3", "rgmii2_rd3", "mmc2_dat6", "gpmc_a24", "pr1_mii1_rxd0", "mcasp0_aclkx", "gpio1_24"), -#if 0 - _PIN(0x864, "gpmc_a9", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x868, "gpmc_a10", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x86C, "gpmc_a11", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x870, "gpmc_wait0", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x874, "gpmc_wpn", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x878, "gpmc_be1n", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x87c, "gpmc_csn0", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x880, "gpmc_csn1", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x884, "gpmc_csn2", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x888, "gpmc_csn3", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x88c, "gpmc_clk", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x890, "gpmc_advn_ale", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x894, "gpmc_oen_ren", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x898, "gpmc_wen", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x89c, "gpmc_be0n_cle", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8a0, "lcd_data0", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8a4, "lcd_data1", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8a8, "lcd_data2", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8ac, "lcd_data3", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8b0, "lcd_data4", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8b4, "lcd_data5", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8b8, "lcd_data6", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8bc, "lcd_data7", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8c0, "lcd_data8", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8c4, "lcd_data9", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8c8, "lcd_data10", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8cc, "lcd_data11", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8d0, "lcd_data12", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8d4, "lcd_data13", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8d8, "lcd_data14", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8dc, "lcd_data15", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8e0, "lcd_vsync", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8e4, "lcd_hsync", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8e8, "lcd_pclk", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x8ec, "lcd_ac_bias_en", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), -#endif - _PIN(0x8f0, "MMC0_DAT3", 90, 7, "mmc0_dat3", "gpmc_a20", "uart4_ctsn", "timer5", "uart1_dcdn", "pr1_pru0_pru_r30_8", "pr1_pru0_pru_r31_8", "gpio2_26"), - _PIN(0x8f4, "MMC0_DAT2", 91, 7, "mmc0_dat2", "gpmc_a21", "uart4_rtsn", "timer6", "uart1_dsrn", "pr1_pru0_pru_r30_9", "pr1_pru0_pru_r31_9", "gpio2_27"), - _PIN(0x8f8, "MMC0_DAT1", 92, 7, "mmc0_dat1", "gpmc_a22", "uart5_ctsn", "uart3_rxd", "uart1_dtrn", "pr1_pru0_pru_r30_10", "pr1_pru0_pru_r31_10", "gpio2_28"), - _PIN(0x8fc, "MMC0_DAT0", 93, 7, "mmc0_dat0", "gpmc_a23", "uart5_rtsn", "uart3_txd", "uart1_rin", "pr1_pru0_pru_r30_11", "pr1_pru0_pru_r31_11", "gpio2_29"), - _PIN(0x900, "MMC0_CLK", 94, 7, "mmc0_clk", "gpmc_a24", "uart3_ctsn", "uart2_rxd", "dcan1_tx", "pr1_pru0_pru_r30_12", "pr1_pru0_pru_r31_12", "gpio2_30"), - _PIN(0x904, "MMC0_CMD", 95, 7, "mmc0_cmd", "gpmc_a25", "uart3_rtsn", "uart2_txd", "dcan1_rx", "pr1_pru0_pru_r30_13", "pr1_pru0_pru_r31_13", "gpio2_31"), - _PIN(0x908, "MII1_COL", 96, 7, "gmii1_col", "rmii2_refclk", "spi1_sclk", "uart5_rxd", "mcasp1_axr2", "mmc2_dat3", "mcasp0_axr2", "gpio3_0"), - _PIN(0x90c, "MII1_CRS", 97, 7, "gmii1_crs", "rmii1_crs_dv", "spi1_d0", "I2C1_SDA", "mcasp1_aclkx", "uart5_ctsn", "uart2_rxd", "gpio3_1"), - _PIN(0x910, "MII1_RX_ER", 98, 7, "gmii1_rxerr", "rmii1_rxerr", "spi1_d1", "I2C1_SCL", "mcasp1_fsx", "uart5_rtsn", "uart2_txd", "gpio3_2"), - _PIN(0x914, "MII1_TX_EN", 99, 7, "gmii1_txen", "rmii1_txen", "rgmii1_tctl", "timer4", "mcasp1_axr0", "eQEP0_index", "mmc2_cmd", "gpio3_3"), + _PIN(0x800, "GPMC_AD0", 32, 7, "gpmc_ad0", "mmc1_dat0", NULL, NULL, NULL, NULL, NULL, "gpio1_0"), + _PIN(0x804, "GPMC_AD1", 33, 7, "gpmc_ad1", "mmc1_dat1", NULL, NULL, NULL, NULL, NULL, "gpio1_1"), + _PIN(0x808, "GPMC_AD2", 34, 7, "gpmc_ad2", "mmc1_dat2", NULL, NULL, NULL, NULL, NULL, "gpio1_2"), + _PIN(0x80C, "GPMC_AD3", 35, 7, "gpmc_ad3", "mmc1_dat3", NULL, NULL, NULL, NULL, NULL, "gpio1_3"), + _PIN(0x810, "GPMC_AD4", 36, 7, "gpmc_ad4", "mmc1_dat4", NULL, NULL, NULL, NULL, NULL, "gpio1_4"), + _PIN(0x814, "GPMC_AD5", 37, 7, "gpmc_ad5", "mmc1_dat5", NULL, NULL, NULL, NULL, NULL, "gpio1_5"), + _PIN(0x818, "GPMC_AD6", 38, 7, "gpmc_ad6", "mmc1_dat6", NULL, NULL, NULL, NULL, NULL, "gpio1_6"), + _PIN(0x81C, "GPMC_AD7", 39, 7, "gpmc_ad7", "mmc1_dat7", NULL, NULL, NULL, NULL, NULL, "gpio1_7"), + _PIN(0x820, "GPMC_AD8", 22, 7, "gpmc_ad8", "lcd_data23", "mmc1_dat0", "mmc2_dat4", "ehrpwm2A", NULL, NULL, "gpio0_22"), + _PIN(0x824, "GPMC_AD9", 23, 7, "gpmc_ad9", "lcd_data22", "mmc1_dat1", "mmc2_dat5", "ehrpwm2B", NULL, NULL, "gpio0_23"), + _PIN(0x828, "GPMC_AD10", 26, 7, "gpmc_ad10", "lcd_data21", "mmc1_dat2", "mmc2_dat6", "ehrpwm2_tripzone_in", NULL, NULL, "gpio0_26"), + _PIN(0x82C, "GPMC_AD11", 27, 7, "gpmc_ad11", "lcd_data20", "mmc1_dat3", "mmc2_dat7", "ehrpwm0_synco", NULL, NULL, "gpio0_27"), + _PIN(0x830, "GPMC_AD12", 44, 7, "gpmc_ad12", "lcd_data19", "mmc1_dat4", "mmc2_dat0", "eqep2a_in", "pr1_mii0_txd2", "pr1_pru0_pru_r30_14", "gpio1_12"), + _PIN(0x834, "GPMC_AD13", 45, 7, "gpmc_ad13", "lcd_data18", "mmc1_dat5", "mmc2_dat1", "eqep2b_in", "pr1_mii0_txd1", "pr1_pru0_pru_r30_15", "gpio1_13"), + _PIN(0x838, "GPMC_AD14", 46, 7, "gpmc_ad14", "lcd_data17", "mmc1_dat6", "mmc2_dat2", "eqep2b_index", "pr1_mii0_txd0", "pr1_pru0_pru_r31_14", "gpio1_14"), + _PIN(0x83C, "GPMC_AD15", 47, 7, "gpmc_ad15", "lcd_data16", "mmc1_dat7", "mmc2_dat3", "eqep2b_strobe", "pr1_ecap0_ecap_capin_apwm_o", "pr1_pru0_pru_r31_15", "gpio1_15"), + _PIN(0x840, "GPMC_A0", 48, 7, "gpmc_a0", "gmii2_txen", "rgmii2_tctl", "rmii2_txen", "gpmc_a16", "pr1_mii_mt1_clk", "ehrpwm1_tripzone_input", "gpio1_16"), + _PIN(0x844, "GPMC_A1", 49, 7, "gpmc_a1", "gmii2_rxdv", "rgmii2_rctl", "mmc2_dat0", "gpmc_a17", "pr1_mii1_txd3", "ehrpwm0_synco", "gpio1_17"), + _PIN(0x848, "GPMC_A2", 50, 7, "gpmc_a2", "gmii2_txd3", "rgmii2_td3", "mmc2_dat1", "gpmc_a18", "pr1_mii1_txd2", "ehrpwm1a", "gpio1_18"), + _PIN(0x84C, "GPMC_A3", 51, 7, "gpmc_a3", "gmii2_txd2", "rgmii2_td2", "mmc2_dat2", "gpmc_a19", "pr1_mii1_txd1", "ehrpwm1b", "gpio1_19"), + _PIN(0x850, "GPMC_A4", 52, 7, "gpmc_a4", "gmii2_txd1", "rgmii2_td1", "rmii2_tdx1", "gpmc_a20", "pr1_mii1_txd0", "eqep1a_in", "gpio1_20"), + _PIN(0x854, "GPMC_A5", 53, 7, "gpmc_a5", "gmii2_txd0", "rgmii2_td0", "rmii2_txd0", "gpmc_a21", "pr1_mii1_rxd3", "eQEP1B_in", "gpio1_21"), + _PIN(0x858, "GPMC_A6", 54, 7, "gpmc_a6", "gmii2_txclk", "rgmii2_tclk", "mmc2_dat4", "gpmc_a22", "pr1_mii1_rxd2", "eQEP1_index", "gpio1_22"), + _PIN(0x85C, "GPMC_A7", 55, 7, "gpmc_a7", "gmii2_rxclk", "rgmii2_rclk", "mmc2_dat5", "gpmc_a23", "pr1_mii1_rxd1", "eQEP1_strobe", "gpio1_23"), + _PIN(0x860, "GPMC_A8", 56, 7, "gpmc_a8", "gmii2_rxd3", "rgmii2_rd3", "mmc2_dat6", "gpmc_a24", "pr1_mii1_rxd0", "mcasp0_aclkx", "gpio1_24"), + _PIN(0x864, "GPMC_A9", 57, 7, "gmpc_a9", "gmii2_rxd2", "rgmii2_rd2", "mmc2_dat7 / rmii2_crs_dv", "gpmc_a25", "pr1_mii_mr1_clk", "mcasp0_fsx", "gpio1_25"), + _PIN(0x868, "GPMC_A10", 58, 7, "gmpc_a10", "gmii2_rxd1", "rgmii2_rd1", "rmii2_rxd1", "gpmc_a26", "pr1_mii1_rxdv", "mcasp0_arx0", "gpio1_26"), + _PIN(0x86C, "GPMC_A11", 59, 7, "gmpc_a11", "gmii2_rxd0", "rgmii2_rd0", "rmii2_rxd0", "gpmc_a27", "pr1_mii1_rxer", "mcasp0_axr1", "gpio1_27"), + _PIN(0x870, "GPMC_WAIT0", 30, 7, "gpmc_wait0", "gmii2_crs", "gpmc_csn4", "rmii2_crs_dv", "mmc1_sdcd", "pr1_mii1_col", "uart4_rxd", "gpio0_30"), + _PIN(0x874, "GPMC_WPn", 31, 7, "gpmc_wpn", "gmii2_rxerr", "gpmc_csn5", "rmii2_rxerr", "mmc2_sdcd", "pr1_mii1_txen", "uart4_txd", "gpio0_31"), + _PIN(0x878, "GPMC_BEn1", 60, 7, "gpmc_be1n", "gmii2_col", "gmpc_csn6","mmc2_dat3", "gpmc_dir", "pr1_mii1_rxlink", "mcasp0_aclkr", "gpio1_28"), + _PIN(0x87c, "GPMC_CSn0", 61, 7, "gpmc_csn0", NULL, NULL, NULL, NULL, NULL, NULL, "gpio1_29"), + _PIN(0x880, "GPMC_CSn1", 62, 7, "gpmc_csn1", "gpmc_clk", "mmc1_clk", "pr1_edio_data_in6", "pr1_edio_data_out6", "pr1_pru1_pru_r30_12", "pr1_pru1_pru_r31_12", "gpio1_30"), + _PIN(0x884, "GPMC_CSn2", 63, 7, "gpmc_csn2", "gpmc_be1n", "mmc1_cmd", "pr1_edio_data_in7", "pr1_edio_data_out7", "pr1_pru1_pru_r30_13", "pr1_pru1_pru_r31_13", "gpio1_31"), + _PIN(0x888, "GPMC_CSn3", 64, 7, "gpmc_csn3", "gpmc_a3", "rmii2_crs_dv", "mmc2_cmd", "pr1_mii0_crs", "pr1_mdio_data", "emu4", "gpio2_0"), + _PIN(0x88c, "GPMC_CLK", 65, 7, "gpmc_clk", "lcd_memory_clk", "gpmc_wait1", "mmc2_clk", "pr1_mii1_crs", "pr1_mdio_mdclk", "mcasp0_fsr", "gpio2_1"), + _PIN(0x890, "GPMC_ADVn_ALE", 66, 7, "gpmc_advn_ale", NULL, "timer4", NULL, NULL, NULL, NULL, "gpio2_2"), + _PIN(0x894, "GPMC_OEn_REn", 67, 7, "gpmc_oen_ren", NULL, "timer7", NULL, NULL, NULL, NULL, "gpio2_3"), + _PIN(0x898, "GPMC_WEn", 68, 7, "gpmc_wen", NULL, "timer6", NULL, NULL, NULL, NULL, "gpio2_4"), + _PIN(0x89c, "GPMC_BEn0_CLE", 67, 7, "gpmc_ben0_cle", NULL, "timer5", NULL, NULL, NULL, NULL, "gpio2_5"), + _PIN(0x8a0, "LCD_DATA0", 68, 7, "lcd_data0", "gpmc_a0", "pr1_mii_mt0_clk", "ehrpwm2a", NULL, "pr1_pru1_pru_r30_0", "pr1_pru1_pru_r31_0", "gpio2_6"), + _PIN(0x8a4, "LCD_DATA1", 69, 7, "lcd_data1", "gpmc_a1", "pr1_mii0_txen", "ehrpwm2b", NULL, "pr1_pru1_pru_r30_1", "pr1_pru1_pru_r31_1", "gpio2_7"), + _PIN(0x8a8, "LCD_DATA2", 70, 7, "lcd_data2", "gpmc_a2", "pr1_mii0_txd3", "ehrpwm2_tripzone_input", NULL, "pr1_pru1_pru_r30_2", "pr1_pru1_pru_r31_2", "gpio2_8"), + _PIN(0x8ac, "LCD_DATA3", 71, 7, "lcd_data3", "gpmc_a3", "pr1_mii0_txd2", "ehrpwm0_synco", NULL, "pr1_pru1_pru_r30_3", "pr1_pru1_pru_r31_3", "gpio2_9"), + _PIN(0x8b0, "LCD_DATA4", 72, 7, "lcd_data4", "gpmc_a4", "pr1_mii0_txd1", "eqep2a_in", NULL, "pr1_pru1_pru_r30_4", "pr1_pru1_pru_r31_4", "gpio2_10"), + _PIN(0x8b4, "LCD_DATA5", 73, 7, "lcd_data5", "gpmc_a5", "pr1_mii0_txd0", "eqep2b_in", NULL, "pr1_pru1_pru_r30_5", "pr1_pru1_pru_r31_5", "gpio2_11"), + _PIN(0x8b8, "LCD_DATA6", 74, 7, "lcd_data6", "gpmc_a6", "pr1_edio_data_in6", "eqep2_index", "pr1_edio_data_out6", "pr1_pru1_pru_r30_6", "pr1_pru1_pru_r31_6", "gpio2_12"), + _PIN(0x8bc, "LCD_DATA7", 75, 7, "lcd_data7", "gpmc_a7", "pr1_edio_data_in7", "eqep2_strobe", "pr1_edio_data_out7", "pr1_pru1_pru_r30_7", "pr1_pru1_pru_r31_7", "gpio2_13"), + _PIN(0x8c0, "LCD_DATA8", 76, 7, "lcd_data8", "gpmc_a12", "ehrpwm1_tripzone_input", "mcasp0_aclkx", "uart5_txd", "pr1_mii0_rxd3", "uart2_ctsn", "gpio2_14"), + _PIN(0x8c4, "LCD_DATA9", 76, 7, "lcd_data9", "gpmc_a13", "ehrpwm0_synco", "mcasp0_fsx", "uart5_rxd", "pr1_mii0_rxd2", "uart2_rtsn", "gpio2_15"), + _PIN(0x8c8, "LCD_DATA10", 77, 7, "lcd_data10", "gpmc_a14", "ehrpwm1a", "mcasp0_axr0", NULL, "pr1_mii0_rxd1", "uart3_ctsn", "gpio2_16"), + _PIN(0x8cc, "LCD_DATA11", 78, 7, "lcd_data11", "gpmc_a15", "ehrpwm1b", "mcasp0_ahclkr", "mcasp0_axr2", "pr1_mii0_rxd0", "uart3_rtsn", "gpio2_17"), + _PIN(0x8d0, "LCD_DATA12", 8, 7, "lcd_data12", "gpmc_a16", "eqep1a_in", "mcasp0_aclkr", "mcasp0_axr2", "pr1_mii0_rxlink", "uart4_ctsn", "gpio0_8"), + _PIN(0x8d4, "LCD_DATA13", 9, 7, "lcd_data13", "gpmc_a17", "eqep1b_in", "mcasp0_fsr", "mcasp0_axr3", "pr1_mii0_rxer", "uart4_rtsn", "gpio0_9"), + _PIN(0x8d8, "LCD_DATA14", 10, 7, "lcd_data14", "gpmc_a18", "eqep1_index", "mcasp0_axr1", "uart5_rxd", "pr1_mii_mr0_clk", "uart5_ctsn", "gpio0_10"), + _PIN(0x8dc, "LCD_DATA15", 11, 7, "lcd_data15", "gpmc_a19", "eqep1_strobe", "mcasp0_ahclkx", "mcasp0_axr3", "pr1_mii0_rxdv", "uart5_rtsn", "gpio0_11"), + _PIN(0x8e0, "LCD_VSYNC", 86, 7, "lcd_vsync", "gpmc_a8", "gpmc_a1", "pr1_edio_data_in2", "pr1_edio_data_out2", "pr1_pru1_pru_r30_8", "pr1_pru1_pru_r31_8", "gpio2_22"), + _PIN(0x8e4, "LCD_HSYNC", 87, 7, "lcd_hsync", "gmpc_a9", "gpmc_a2", "pr1_edio_data_in3", "pr1_edio_data_out3", "pr1_pru1_pru_r30_9", "pr1_pru1_pru_r31_9", "gpio2_23"), + _PIN(0x8e8, "LCD_PCLK", 88, 7, "lcd_pclk", "gpmc_a10", "pr1_mii0_crs", "pr1_edio_data_in4", "pr1_edio_data_out4", "pr1_pru1_pru_r30_10", "pr1_pru1_pru_r31_10", "gpio2_24"), + _PIN(0x8ec, "LCD_AC_BIAS_EN", 89, 7, "lcd_ac_bias_en", "gpmc_a11", "pr1_mii1_crs", "pr1_edio_data_in5", "pr1_edio_data_out5", "pr1_pru1_pru_r30_11", "pr1_pru1_pru_r31_11", "gpio2_25"), + _PIN(0x8f0, "MMC0_DAT3", 90, 7, "mmc0_dat3", "gpmc_a20", "uart4_ctsn", "timer5", "uart1_dcdn", "pr1_pru0_pru_r30_8", "pr1_pru0_pru_r31_8", "gpio2_26"), + _PIN(0x8f4, "MMC0_DAT2", 91, 7, "mmc0_dat2", "gpmc_a21", "uart4_rtsn", "timer6", "uart1_dsrn", "pr1_pru0_pru_r30_9", "pr1_pru0_pru_r31_9", "gpio2_27"), + _PIN(0x8f8, "MMC0_DAT1", 92, 7, "mmc0_dat1", "gpmc_a22", "uart5_ctsn", "uart3_rxd", "uart1_dtrn", "pr1_pru0_pru_r30_10", "pr1_pru0_pru_r31_10", "gpio2_28"), + _PIN(0x8fc, "MMC0_DAT0", 93, 7, "mmc0_dat0", "gpmc_a23", "uart5_rtsn", "uart3_txd", "uart1_rin", "pr1_pru0_pru_r30_11", "pr1_pru0_pru_r31_11", "gpio2_29"), + _PIN(0x900, "MMC0_CLK", 94, 7, "mmc0_clk", "gpmc_a24", "uart3_ctsn", "uart2_rxd", "dcan1_tx", "pr1_pru0_pru_r30_12", "pr1_pru0_pru_r31_12", "gpio2_30"), + _PIN(0x904, "MMC0_CMD", 95, 7, "mmc0_cmd", "gpmc_a25", "uart3_rtsn", "uart2_txd", "dcan1_rx", "pr1_pru0_pru_r30_13", "pr1_pru0_pru_r31_13", "gpio2_31"), + _PIN(0x908, "MII1_COL", 96, 7, "gmii1_col", "rmii2_refclk", "spi1_sclk", "uart5_rxd", "mcasp1_axr2", "mmc2_dat3", "mcasp0_axr2", "gpio3_0"), + _PIN(0x90c, "MII1_CRS", 97, 7, "gmii1_crs", "rmii1_crs_dv", "spi1_d0", "I2C1_SDA", "mcasp1_aclkx", "uart5_ctsn", "uart2_rxd", "gpio3_1"), + _PIN(0x910, "MII1_RX_ER", 98, 7, "gmii1_rxerr", "rmii1_rxerr", "spi1_d1", "I2C1_SCL", "mcasp1_fsx", "uart5_rtsn", "uart2_txd", "gpio3_2"), + _PIN(0x914, "MII1_TX_EN", 99, 7, "gmii1_txen", "rmii1_txen", "rgmii1_tctl", "timer4", "mcasp1_axr0", "eQEP0_index", "mmc2_cmd", "gpio3_3"), _PIN(0x918, "MII1_RX_DV", 100, 7, "gmii1_rxdv", "cd_memory_clk", "rgmii1_rctl", "uart5_txd", "mcasp1_aclkx", "mmc2_dat0", "mcasp0_aclkr", "gpio3_4"), - _PIN(0x91c, "MII1_TXD3", 16, 7, "gmii1_txd3", "dcan0_tx", "rgmii1_td3", "uart4_rxd", "mcasp1_fsx", "mmc2_dat1", "mcasp0_fsr", "gpio0_16"), - _PIN(0x920, "MII1_TXD2", 17, 7, "gmii1_txd2", "dcan0_rx", "rgmii1_td2", "uart4_txd", "mcasp1_axr0", "mmc2_dat2", "mcasp0_ahclkx", "gpio0_17"), - _PIN(0x924, "MII1_TXD1", 21, 7, "gmii1_txd1", "rmii1_txd1", "rgmii1_td1", "mcasp1_fsr", "mcasp1_axr1", "eQEP0A_in", "mmc1_cmd", "gpio0_21"), - _PIN(0x928, "MII1_TXD0", 28, 7, "gmii1_txd0", "rmii1_txd0", "rgmii1_td0", "mcasp1_axr2", "mcasp1_aclkr", "eQEP0B_in", "mmc1_clk", "gpio0_28"), + _PIN(0x91c, "MII1_TXD3", 16, 7, "gmii1_txd3", "dcan0_tx", "rgmii1_td3", "uart4_rxd", "mcasp1_fsx", "mmc2_dat1", "mcasp0_fsr", "gpio0_16"), + _PIN(0x920, "MII1_TXD2", 17, 7, "gmii1_txd2", "dcan0_rx", "rgmii1_td2", "uart4_txd", "mcasp1_axr0", "mmc2_dat2", "mcasp0_ahclkx", "gpio0_17"), + _PIN(0x924, "MII1_TXD1", 21, 7, "gmii1_txd1", "rmii1_txd1", "rgmii1_td1", "mcasp1_fsr", "mcasp1_axr1", "eQEP0A_in", "mmc1_cmd", "gpio0_21"), + _PIN(0x928, "MII1_TXD0", 28, 7, "gmii1_txd0", "rmii1_txd0", "rgmii1_td0", "mcasp1_axr2", "mcasp1_aclkr", "eQEP0B_in", "mmc1_clk", "gpio0_28"), _PIN(0x92c, "MII1_TX_CLK", 105, 7, "gmii1_txclk", "uart2_rxd", "rgmii1_tclk", "mmc0_dat7", "mmc1_dat0", "uart1_dcdn", "mcasp0_aclkx", "gpio3_9"), _PIN(0x930, "MII1_RX_CLK", 106, 7, "gmii1_rxclk", "uart2_txd", "rgmii1_rclk", "mmc0_dat6", "mmc1_dat1", "uart1_dsrn", "mcasp0_fsx", "gpio3_10"), - _PIN(0x934, "MII1_RXD3", 82, 7, "gmii1_rxd3", "uart3_rxd", "rgmii1_rd3", "mmc0_dat5", "mmc1_dat2", "uart1_dtrn", "mcasp0_axr0", "gpio2_18"), - _PIN(0x938, "MII1_RXD2", 83, 7, "gmii1_rxd2", "uart3_txd", "rgmii1_rd2", "mmc0_dat4", "mmc1_dat3", "uart1_rin", "mcasp0_axr1", "gpio2_19"), - _PIN(0x93c, "MII1_RXD1", 84, 7, "gmii1_rxd1", "rmii1_rxd1", "rgmii1_rd1", "mcasp1_axr3", "mcasp1_fsr", "eQEP0_strobe", "mmc2_clk", "gpio2_20"), - _PIN(0x940, "MII1_RXD0", 85, 7, "gmii1_rxd0", "rmii1_rxd0", "rgmii1_rd0", "mcasp1_ahclkx", "mcasp1_ahclkr", "mcasp1_aclkr", "mcasp0_axr3", "gpio2_21"), - _PIN(0x944, "RMII1_REF_CLK", 29, 7, "rmii1_refclk", "xdma_event_intr2", "spi1_cs0", "uart5_txd", "mcasp1_axr3", "mmc0_pow", "mcasp1_ahclkx", "gpio0_29"), - _PIN(0x948, "MDIO", 0, 7, "mdio_data", "timer6", "uart5_rxd", "uart3_ctsn", "mmc0_sdcd","mmc1_cmd", "mmc2_cmd","gpio0_0"), - _PIN(0x94c, "MDC", 1, 7, "mdio_clk", "timer5", "uart5_txd", "uart3_rtsn", "mmc0_sdwp", "mmc1_clk", "mmc2_clk", "gpio0_1"), -#if 0 /* Incomplete Entries - fill with data from table 2-7 in datasheet */ - _PIN(0x950, "spi0_sclk", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x954, "spi0_d0", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), -#endif - _PIN(0x958, "spi0_d1", 4, 7, "spi0_d1", "mmc1_sdwp", "I2C1_SDA", "ehrpwm0_tripzone_input", "pr1_uart0_rxd", "pr1_edio_data_in0", "pr1_edio_data_out0", "gpio0_4"), - _PIN(0x95c, "spi0_cs0", 5, 7, "spi0_cs0", "mmc2_sdwp", "I2C1_SCL", "ehrpwm0_synci", "pr1_uart0_txd", "pr1_edio_data_in1", "pr1_edio_data_out1", "gpio0_5"), -#if 0 - _PIN(0x960, "spi0_cs1", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x964, "ecap0_in_pwm0_out",0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x968, "uart0_ctsn", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x96c, "uart0_rtsn", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x970, "uart0_rxd", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x974, "uart0_txd", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), -#endif - _PIN(0x978, "uart1_ctsn", 12, 7, "uart1_ctsn", "timer6_mux1", "dcan0_tx", "I2C2_SDA", "spi1_cs0", "pr1_uart0_cts_n", "pr1_edc_latch0_in", "gpio0_12"), - _PIN(0x97c, "uart1_rtsn", 13, 7, "uart1_rtsn", "timer5_mux1", "dcan0_rx", "I2C2_SCL", "spi1_cs1", "pr1_uart0_rts_n ", "pr1_edc_latch1_in", "gpio0_13"), -#if 0 - _PIN(0x980, "uart1_rxd", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x984, "uart1_txd", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), -#endif - _PIN(0x988, "I2C0_SDA", 101, 7, "I2C0_SDA", "timer4", "uart2_ctsn", "eCAP2_in_PWM2_out", NULL, NULL, NULL, "gpio3_5"), - _PIN(0x98c, "I2C0_SCL", 102, 7, "I2C0_SCL", "timer7", "uart2_rtsn", "eCAP1_in_PWM1_out", NULL, NULL, NULL, "gpio3_6"), + _PIN(0x934, "MII1_RXD3", 82, 7, "gmii1_rxd3", "uart3_rxd", "rgmii1_rd3", "mmc0_dat5", "mmc1_dat2", "uart1_dtrn", "mcasp0_axr0", "gpio2_18"), + _PIN(0x938, "MII1_RXD2", 83, 7, "gmii1_rxd2", "uart3_txd", "rgmii1_rd2", "mmc0_dat4", "mmc1_dat3", "uart1_rin", "mcasp0_axr1", "gpio2_19"), + _PIN(0x93c, "MII1_RXD1", 84, 7, "gmii1_rxd1", "rmii1_rxd1", "rgmii1_rd1", "mcasp1_axr3", "mcasp1_fsr", "eQEP0_strobe", "mmc2_clk", "gpio2_20"), + _PIN(0x940, "MII1_RXD0", 85, 7, "gmii1_rxd0", "rmii1_rxd0", "rgmii1_rd0", "mcasp1_ahclkx", "mcasp1_ahclkr", "mcasp1_aclkr", "mcasp0_axr3", "gpio2_21"), + _PIN(0x944, "RMII1_REF_CLK", 29, 7, "rmii1_refclk", "xdma_event_intr2", "spi1_cs0", "uart5_txd", "mcasp1_axr3", "mmc0_pow", "mcasp1_ahclkx", "gpio0_29"), + _PIN(0x948, "MDIO", 0, 7, "mdio_data", "timer6", "uart5_rxd", "uart3_ctsn", "mmc0_sdcd","mmc1_cmd", "mmc2_cmd","gpio0_0"), + _PIN(0x94c, "MDC", 1, 7, "mdio_clk", "timer5", "uart5_txd", "uart3_rtsn", "mmc0_sdwp", "mmc1_clk", "mmc2_clk", "gpio0_1"), + _PIN(0x950, "SPI0_SCLK", 2, 7, "spi0_sclk", "uart2_rxd", "i2c2_sda", "ehrpwm0a", "pr1_uart0_cts_n", "pr1_edio_sof", "emu2", "gpio0_2"), + _PIN(0x954, "SPI0_D0", 3, 7, "spi0_d0", "uart2_txd", "i2c2_scl", "ehrpwm0b", "pr1_uart0_rts_n", "pr1_edio_latch_in", "emu3", "gpio0_3"), + _PIN(0x958, "SPIO_D1", 4, 7, "spi0_d1", "mmc1_sdwp", "I2C1_SDA", "ehrpwm0_tripzone_input", "pr1_uart0_rxd", "pr1_edio_data_in0", "pr1_edio_data_out0", "gpio0_4"), + _PIN(0x95c, "SPI0_CS0", 5, 7, "spi0_cs0", "mmc2_sdwp", "I2C1_SCL", "ehrpwm0_synci", "pr1_uart0_txd", "pr1_edio_data_in1", "pr1_edio_data_out1", "gpio0_5"), + _PIN(0x960, "SPI0_CS1", 6, 7, "spi0_cs1", "uart3_rxd", "ecap1_in_pwm1_out", "mcc0_pow", "xdm_event_intr2", "mmc0_sdcd", "emu4", "gpio0_6"), + _PIN(0x964, "ECAP0_IN_PWM0_OUT",7, 7, "ecap0_in_pwm0_out", "uart3_txd", "spi1_cs1", "pr1_ecap0_ecap_capin_apwm_o", "spi1_sclk", "mmc0_sdwp", "xdma_event_intr2", "gpio0_7"), + _PIN(0x968, "UART0_CTSn", 40, 7, "uart0_ctsn", "uart4_rxd", "dcan1_tx", "i2c1_sda", "spi1_d0", "timer7", "pr1_edc_sync0_out", "gpio1_8"), + _PIN(0x96c, "UART0_RTSn", 41, 7, "uart0_rtsn", "uart4_txd", "dcan1_rx", "i2c1_scl", "spi1_d1", "spi1_cs0", "pr1_edc_sync1_out", "gpio1_9"), + _PIN(0x970, "UART0_rxd", 42, 7, "uart0_rxd", "spi1_cs0", "dcan0_tx", "i2c2_sda", "ecap2_in_pwm2_out", "pr1_pru1_pru_r30_14", "pr1_pru1_pru_r31_14", "gpio1_10"), + _PIN(0x974, "UART0_txd", 43, 7, "uart0_txd", "spi1_cs1", "dcan0_rx", "i2c2_scl", "ecap1_in_pwm1_out", "pr1_pru1_pru_r30_15", "pr1_pru1_pru_r31_15", "gpio1_11"), + _PIN(0x978, "UART1_CTSn", 12, 7, "uart1_ctsn", "timer6_mux1", "dcan0_tx", "I2C2_SDA", "spi1_cs0", "pr1_uart0_cts_n", "pr1_edc_latch0_in", "gpio0_12"), + _PIN(0x97c, "UART1_RTSn", 13, 7, "uart1_rtsn", "timer5_mux1", "dcan0_rx", "I2C2_SCL", "spi1_cs1", "pr1_uart0_rts_n ", "pr1_edc_latch1_in", "gpio0_13"), + _PIN(0x980, "UART1_RXD", 14, 7, "uart1_rxd", "mmc1_sdwp", "dcan1_tx", "i2c1_sda", NULL, "pr1_uart0_rxd", "pr1_pru1_pru_r31_16", "gpio0_14"), + _PIN(0x984, "UART1_TXD", 15, 7, "uart1_txd", "mmc2_sdwp", "dcan1_rx", "i2c1_scl", NULL, "pr1_uart0_txd", "pr1_pru0_pru_r31_16", "gpio0_15"), + _PIN(0x988, "I2C0_SDA", 101, 7, "i2c0_sda", "timer4", "uart2_ctsn", "eCAP2_in_pwm2_out", NULL, NULL, NULL, "gpio3_5"), + _PIN(0x98c, "I2C0_SCL", 102, 7, "i2c0_scl", "timer7", "uart2_rtsn", "eCAP1_in_pwm1_out", NULL, NULL, NULL, "gpio3_6"), + _PIN(0x990, "MCASP0_ACLKX", 110, 7, "mcasp0_aclkx", "ehrpwm0a", NULL, "spi1_sclk", "mmc0_sdcd", "pr1_pru0_pru_r30_0", "pr1_pru0_pru_r31_0", "gpio3_14"), + _PIN(0x994, "MCASP0_FSX", 111, 7, "mcasp0_fsx", "ehrpwm0b", NULL, "spi1_d0", "mmc1_sdcd", "pr1_pru0_pru_r30_1", "pr1_pru0_pru_r31_1", "gpio3_15"), + _PIN(0x998, "MCASP0_AXR0", 112, 7, "mcasp0_axr0", "ehrpwm0_tripzone_input", NULL, "spi1_d1", "mmc2_sdcd", "pr1_pru0_pru_r30_2", "pr1_pru0_pru_r31_2", "gpio3_16"), + _PIN(0x99c, "MCASP0_AHCLKR", 113, 7, "mcasp0_ahclkr", "ehrpwm0_synci", "mcasp0_axr2", "spi1_cs0", "ecap2_in_pwm2_out", "pr1_pru0_pru_r30_3", "pr1_pru0_pru_r31_3", "gpio3_17"), + _PIN(0x9a0, "MCASP0_ACLKR", 114, 7, "mcasp0_aclkr", "eqep0a_in", "mcasp0_axr2", "mcasp1_aclkx", "mmc0_sdwp", "pr1_pru0_pru_r30_4", "pr1_pru0_pru_r31_4", "gpio3_18"), + _PIN(0x9a4, "MCASP0_FSR", 115, 7, "mcasp0_fsr", "eqep0b_in", "mcasp0_axr3", "mcasp1_fsx", "emu2", "pr1_pru0_pru_r30_5", "pr1_pru0_pru_r31_5", "gpio3_19"), + _PIN(0x9a8, "MCASP0_AXR1", 116, 7, "mcasp0_axr1", "eqep0_index", NULL, "mcasp1_axr0", "emu3", "pr1_pru0_pru_r30_6", "pr1_pru0_pru_r31_6", "gpio3_20"), + _PIN(0x9ac, "MCASP0_AHCLKX", 117, 7, "mcasp0_ahclkx", "eqep0_strobe", "mcasp0_axr3", "mcasp1_axr1", "emu4", "pr1_pru0_pru_r30_7", "pr1_pru0_pru_r31_7", "gpio3_21"), + _PIN(0x9b0, "XDMA_EVENT_INTR0", 19, 7, "xdma_event_intr0", NULL, "timer4", "clkout1", "spi1_cs1", "pr1_pru1_pru_r31_16", "emu2", "gpio0_19"), + _PIN(0x9b4, "XDMA_EVENT_INTR1", 20, 7, "xdma_event_intr1", NULL, "tclkin", "clkout2", "timer7", "pr1_pru0_pru_r31_16", "emu3", "gpio0_20"), #if 0 - _PIN(0x990, "mcasp0_aclkx", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x994, "mcasp0_fsx", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x998, "mcasp0_axr0", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x99c, "mcasp0_ahclkr", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x9a0, "mcasp0_aclkr", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x9a4, "mcasp0_fsr", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x9a8, "mcasp0_axr1", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x9ac, "mcasp0_ahclkx", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x9b0, "xdma_event_intr0", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x9b4, "xdma_event_intr1", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x9b8, "nresetin_out", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x9bc, "porz", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x9c0, "nnmi", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), @@ -218,8 +208,10 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0x9d8, "tdo", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x9dc, "tck", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x9e0, "ntrst", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x9e4, "emu0", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x9e8, "emu1", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +#endif + _PIN(0x9e4, "EMU0", 103, 7, "emu0", NULL, NULL, NULL, NULL, NULL, NULL, "gpio3_7"), + _PIN(0x9e8, "EMU1", 104, 0, "emu1", NULL, NULL, NULL, NULL, NULL, NULL, "gpio3_8"), +#if 0 _PIN(0x9ec, "osc1_in", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x9f0, "osc1_out", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x9f4, "osc1_vss", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), @@ -228,17 +220,17 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0xa00, "ext_wakeup", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0xa04, "enz_kaldo_1p8v", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), #endif - _PIN(0xa08, "USB0_DM", 0, 0, "USB0_DM", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0xa0c, "USB0_DP", 0, 0, "USB0_DP", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0xa10, "USB0_CE", 0, 0, "USB0_CE", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0xa14, "USB0_ID", 0, 0, "USB0_ID", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0xa18, "USB0_VBUS", 0, 0, "USB0_VBUS", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0xa1c, "USB0_DRVVBUS", 18, 7, "USB0_DRVVBUS", NULL, NULL, NULL, NULL, NULL, NULL, "gpio0_18"), - _PIN(0xa20, "USB1_DM", 0, 0, "USB1_DM", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0xa24, "USB1_DP", 0, 0, "USB1_DP", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0xa28, "USB1_CE", 0, 0, "USB1_CE", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0xa2c, "USB1_ID", 0, 0, "USB1_ID", NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0xa30, "USB1_VBUS", 0, 0, "USB1_VBUS", NULL, NULL, NULL, NULL, NULL, NULL, NULL), + _PIN(0xa08, "USB0_DM", 0, 0, "USB0_DM", NULL, NULL, NULL, NULL, NULL, NULL, NULL), + _PIN(0xa0c, "USB0_DP", 0, 0, "USB0_DP", NULL, NULL, NULL, NULL, NULL, NULL, NULL), + _PIN(0xa10, "USB0_CE", 0, 0, "USB0_CE", NULL, NULL, NULL, NULL, NULL, NULL, NULL), + _PIN(0xa14, "USB0_ID", 0, 0, "USB0_ID", NULL, NULL, NULL, NULL, NULL, NULL, NULL), + _PIN(0xa18, "USB0_VBUS", 0, 0, "USB0_VBUS", NULL, NULL, NULL, NULL, NULL, NULL, NULL), + _PIN(0xa1c, "USB0_DRVVBUS", 18, 7, "USB0_DRVVBUS", NULL, NULL, NULL, NULL, NULL, NULL, "gpio0_18"), + _PIN(0xa20, "USB1_DM", 0, 0, "USB1_DM", NULL, NULL, NULL, NULL, NULL, NULL, NULL), + _PIN(0xa24, "USB1_DP", 0, 0, "USB1_DP", NULL, NULL, NULL, NULL, NULL, NULL, NULL), + _PIN(0xa28, "USB1_CE", 0, 0, "USB1_CE", NULL, NULL, NULL, NULL, NULL, NULL, NULL), + _PIN(0xa2c, "USB1_ID", 0, 0, "USB1_ID", NULL, NULL, NULL, NULL, NULL, NULL, NULL), + _PIN(0xa30, "USB1_VBUS", 0, 0, "USB1_VBUS", NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0xa34, "USB1_DRVVBUS", 109, 7, "USB1_DRVVBUS", NULL, NULL, NULL, NULL, NULL, NULL, "gpio3_13"), #if 0 _PIN(0xa38, "ddr_resetn", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 09:23:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3766FFB; Mon, 28 Jan 2013 09:23:39 +0000 (UTC) (envelope-from dmarion@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2905438B; Mon, 28 Jan 2013 09:23:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S9NdD8008051; Mon, 28 Jan 2013 09:23:39 GMT (envelope-from dmarion@svn.freebsd.org) Received: (from dmarion@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S9Ndeg008050; Mon, 28 Jan 2013 09:23:39 GMT (envelope-from dmarion@svn.freebsd.org) Message-Id: <201301280923.r0S9Ndeg008050@svn.freebsd.org> From: Damjan Marion Date: Mon, 28 Jan 2013 09:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246025 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 09:23:39 -0000 Author: dmarion Date: Mon Jan 28 09:23:38 2013 New Revision: 246025 URL: http://svnweb.freebsd.org/changeset/base/246025 Log: Fix case for some signal names. Submitted by: Emmanuel Vadot Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.c Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm_padconf.c Mon Jan 28 09:11:04 2013 (r246024) +++ head/sys/arm/ti/am335x/am335x_scm_padconf.c Mon Jan 28 09:23:38 2013 (r246025) @@ -86,27 +86,27 @@ const struct ti_scm_padstate ti_padstate }; const struct ti_scm_padconf ti_padconf_devmap[] = { - _PIN(0x800, "GPMC_AD0", 32, 7, "gpmc_ad0", "mmc1_dat0", NULL, NULL, NULL, NULL, NULL, "gpio1_0"), - _PIN(0x804, "GPMC_AD1", 33, 7, "gpmc_ad1", "mmc1_dat1", NULL, NULL, NULL, NULL, NULL, "gpio1_1"), - _PIN(0x808, "GPMC_AD2", 34, 7, "gpmc_ad2", "mmc1_dat2", NULL, NULL, NULL, NULL, NULL, "gpio1_2"), - _PIN(0x80C, "GPMC_AD3", 35, 7, "gpmc_ad3", "mmc1_dat3", NULL, NULL, NULL, NULL, NULL, "gpio1_3"), - _PIN(0x810, "GPMC_AD4", 36, 7, "gpmc_ad4", "mmc1_dat4", NULL, NULL, NULL, NULL, NULL, "gpio1_4"), - _PIN(0x814, "GPMC_AD5", 37, 7, "gpmc_ad5", "mmc1_dat5", NULL, NULL, NULL, NULL, NULL, "gpio1_5"), - _PIN(0x818, "GPMC_AD6", 38, 7, "gpmc_ad6", "mmc1_dat6", NULL, NULL, NULL, NULL, NULL, "gpio1_6"), - _PIN(0x81C, "GPMC_AD7", 39, 7, "gpmc_ad7", "mmc1_dat7", NULL, NULL, NULL, NULL, NULL, "gpio1_7"), + _PIN(0x800, "GPMC_AD0", 32, 7,"gpmc_ad0", "mmc1_dat0", NULL, NULL, NULL, NULL, NULL, "gpio1_0"), + _PIN(0x804, "GPMC_AD1", 33, 7,"gpmc_ad1", "mmc1_dat1", NULL, NULL, NULL, NULL, NULL, "gpio1_1"), + _PIN(0x808, "GPMC_AD2", 34, 7,"gpmc_ad2", "mmc1_dat2", NULL, NULL, NULL, NULL, NULL, "gpio1_2"), + _PIN(0x80C, "GPMC_AD3", 35, 7,"gpmc_ad3", "mmc1_dat3", NULL, NULL, NULL, NULL, NULL, "gpio1_3"), + _PIN(0x810, "GPMC_AD4", 36, 7,"gpmc_ad4", "mmc1_dat4", NULL, NULL, NULL, NULL, NULL, "gpio1_4"), + _PIN(0x814, "GPMC_AD5", 37, 7,"gpmc_ad5", "mmc1_dat5", NULL, NULL, NULL, NULL, NULL, "gpio1_5"), + _PIN(0x818, "GPMC_AD6", 38, 7,"gpmc_ad6", "mmc1_dat6", NULL, NULL, NULL, NULL, NULL, "gpio1_6"), + _PIN(0x81C, "GPMC_AD7", 39, 7,"gpmc_ad7", "mmc1_dat7", NULL, NULL, NULL, NULL, NULL, "gpio1_7"), _PIN(0x820, "GPMC_AD8", 22, 7, "gpmc_ad8", "lcd_data23", "mmc1_dat0", "mmc2_dat4", "ehrpwm2A", NULL, NULL, "gpio0_22"), _PIN(0x824, "GPMC_AD9", 23, 7, "gpmc_ad9", "lcd_data22", "mmc1_dat1", "mmc2_dat5", "ehrpwm2B", NULL, NULL, "gpio0_23"), _PIN(0x828, "GPMC_AD10", 26, 7, "gpmc_ad10", "lcd_data21", "mmc1_dat2", "mmc2_dat6", "ehrpwm2_tripzone_in", NULL, NULL, "gpio0_26"), _PIN(0x82C, "GPMC_AD11", 27, 7, "gpmc_ad11", "lcd_data20", "mmc1_dat3", "mmc2_dat7", "ehrpwm0_synco", NULL, NULL, "gpio0_27"), - _PIN(0x830, "GPMC_AD12", 44, 7, "gpmc_ad12", "lcd_data19", "mmc1_dat4", "mmc2_dat0", "eqep2a_in", "pr1_mii0_txd2", "pr1_pru0_pru_r30_14", "gpio1_12"), - _PIN(0x834, "GPMC_AD13", 45, 7, "gpmc_ad13", "lcd_data18", "mmc1_dat5", "mmc2_dat1", "eqep2b_in", "pr1_mii0_txd1", "pr1_pru0_pru_r30_15", "gpio1_13"), - _PIN(0x838, "GPMC_AD14", 46, 7, "gpmc_ad14", "lcd_data17", "mmc1_dat6", "mmc2_dat2", "eqep2b_index", "pr1_mii0_txd0", "pr1_pru0_pru_r31_14", "gpio1_14"), - _PIN(0x83C, "GPMC_AD15", 47, 7, "gpmc_ad15", "lcd_data16", "mmc1_dat7", "mmc2_dat3", "eqep2b_strobe", "pr1_ecap0_ecap_capin_apwm_o", "pr1_pru0_pru_r31_15", "gpio1_15"), + _PIN(0x830, "GPMC_AD12", 44, 7, "gpmc_ad12", "lcd_data19", "mmc1_dat4", "mmc2_dat0", "eQEP2A_in", "pr1_mii0_txd2", "pr1_pru0_pru_r30_14", "gpio1_12"), + _PIN(0x834, "GPMC_AD13", 45, 7, "gpmc_ad13", "lcd_data18", "mmc1_dat5", "mmc2_dat1", "eQEP2B_in", "pr1_mii0_txd1", "pr1_pru0_pru_r30_15", "gpio1_13"), + _PIN(0x838, "GPMC_AD14", 46, 7, "gpmc_ad14", "lcd_data17", "mmc1_dat6", "mmc2_dat2", "eQEP2_index", "pr1_mii0_txd0", "pr1_pru0_pru_r31_14", "gpio1_14"), + _PIN(0x83C, "GPMC_AD15", 47, 7, "gpmc_ad15", "lcd_data16", "mmc1_dat7", "mmc2_dat3", "eQEP2_strobe", "pr1_ecap0_ecap_capin_apwm_o", "pr1_pru0_pru_r31_15", "gpio1_15"), _PIN(0x840, "GPMC_A0", 48, 7, "gpmc_a0", "gmii2_txen", "rgmii2_tctl", "rmii2_txen", "gpmc_a16", "pr1_mii_mt1_clk", "ehrpwm1_tripzone_input", "gpio1_16"), _PIN(0x844, "GPMC_A1", 49, 7, "gpmc_a1", "gmii2_rxdv", "rgmii2_rctl", "mmc2_dat0", "gpmc_a17", "pr1_mii1_txd3", "ehrpwm0_synco", "gpio1_17"), - _PIN(0x848, "GPMC_A2", 50, 7, "gpmc_a2", "gmii2_txd3", "rgmii2_td3", "mmc2_dat1", "gpmc_a18", "pr1_mii1_txd2", "ehrpwm1a", "gpio1_18"), - _PIN(0x84C, "GPMC_A3", 51, 7, "gpmc_a3", "gmii2_txd2", "rgmii2_td2", "mmc2_dat2", "gpmc_a19", "pr1_mii1_txd1", "ehrpwm1b", "gpio1_19"), - _PIN(0x850, "GPMC_A4", 52, 7, "gpmc_a4", "gmii2_txd1", "rgmii2_td1", "rmii2_tdx1", "gpmc_a20", "pr1_mii1_txd0", "eqep1a_in", "gpio1_20"), + _PIN(0x848, "GPMC_A2", 50, 7, "gpmc_a2", "gmii2_txd3", "rgmii2_td3", "mmc2_dat1", "gpmc_a18", "pr1_mii1_txd2", "ehrpwm1A", "gpio1_18"), + _PIN(0x84C, "GPMC_A3", 51, 7, "gpmc_a3", "gmii2_txd2", "rgmii2_td2", "mmc2_dat2", "gpmc_a19", "pr1_mii1_txd1", "ehrpwm1B", "gpio1_19"), + _PIN(0x850, "GPMC_A4", 52, 7, "gpmc_a4", "gmii2_txd1", "rgmii2_td1", "rmii2_tdx1", "gpmc_a20", "pr1_mii1_txd0", "eQEP1A_in", "gpio1_20"), _PIN(0x854, "GPMC_A5", 53, 7, "gpmc_a5", "gmii2_txd0", "rgmii2_td0", "rmii2_txd0", "gpmc_a21", "pr1_mii1_rxd3", "eQEP1B_in", "gpio1_21"), _PIN(0x858, "GPMC_A6", 54, 7, "gpmc_a6", "gmii2_txclk", "rgmii2_tclk", "mmc2_dat4", "gpmc_a22", "pr1_mii1_rxd2", "eQEP1_index", "gpio1_22"), _PIN(0x85C, "GPMC_A7", 55, 7, "gpmc_a7", "gmii2_rxclk", "rgmii2_rclk", "mmc2_dat5", "gpmc_a23", "pr1_mii1_rxd1", "eQEP1_strobe", "gpio1_23"), @@ -120,28 +120,28 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0x87c, "GPMC_CSn0", 61, 7, "gpmc_csn0", NULL, NULL, NULL, NULL, NULL, NULL, "gpio1_29"), _PIN(0x880, "GPMC_CSn1", 62, 7, "gpmc_csn1", "gpmc_clk", "mmc1_clk", "pr1_edio_data_in6", "pr1_edio_data_out6", "pr1_pru1_pru_r30_12", "pr1_pru1_pru_r31_12", "gpio1_30"), _PIN(0x884, "GPMC_CSn2", 63, 7, "gpmc_csn2", "gpmc_be1n", "mmc1_cmd", "pr1_edio_data_in7", "pr1_edio_data_out7", "pr1_pru1_pru_r30_13", "pr1_pru1_pru_r31_13", "gpio1_31"), - _PIN(0x888, "GPMC_CSn3", 64, 7, "gpmc_csn3", "gpmc_a3", "rmii2_crs_dv", "mmc2_cmd", "pr1_mii0_crs", "pr1_mdio_data", "emu4", "gpio2_0"), + _PIN(0x888, "GPMC_CSn3", 64, 7, "gpmc_csn3", "gpmc_a3", "rmii2_crs_dv", "mmc2_cmd", "pr1_mii0_crs", "pr1_mdio_data", "EMU4", "gpio2_0"), _PIN(0x88c, "GPMC_CLK", 65, 7, "gpmc_clk", "lcd_memory_clk", "gpmc_wait1", "mmc2_clk", "pr1_mii1_crs", "pr1_mdio_mdclk", "mcasp0_fsr", "gpio2_1"), _PIN(0x890, "GPMC_ADVn_ALE", 66, 7, "gpmc_advn_ale", NULL, "timer4", NULL, NULL, NULL, NULL, "gpio2_2"), _PIN(0x894, "GPMC_OEn_REn", 67, 7, "gpmc_oen_ren", NULL, "timer7", NULL, NULL, NULL, NULL, "gpio2_3"), _PIN(0x898, "GPMC_WEn", 68, 7, "gpmc_wen", NULL, "timer6", NULL, NULL, NULL, NULL, "gpio2_4"), _PIN(0x89c, "GPMC_BEn0_CLE", 67, 7, "gpmc_ben0_cle", NULL, "timer5", NULL, NULL, NULL, NULL, "gpio2_5"), - _PIN(0x8a0, "LCD_DATA0", 68, 7, "lcd_data0", "gpmc_a0", "pr1_mii_mt0_clk", "ehrpwm2a", NULL, "pr1_pru1_pru_r30_0", "pr1_pru1_pru_r31_0", "gpio2_6"), - _PIN(0x8a4, "LCD_DATA1", 69, 7, "lcd_data1", "gpmc_a1", "pr1_mii0_txen", "ehrpwm2b", NULL, "pr1_pru1_pru_r30_1", "pr1_pru1_pru_r31_1", "gpio2_7"), + _PIN(0x8a0, "LCD_DATA0", 68, 7, "lcd_data0", "gpmc_a0", "pr1_mii_mt0_clk", "ehrpwm2A", NULL, "pr1_pru1_pru_r30_0", "pr1_pru1_pru_r31_0", "gpio2_6"), + _PIN(0x8a4, "LCD_DATA1", 69, 7, "lcd_data1", "gpmc_a1", "pr1_mii0_txen", "ehrpwm2B", NULL, "pr1_pru1_pru_r30_1", "pr1_pru1_pru_r31_1", "gpio2_7"), _PIN(0x8a8, "LCD_DATA2", 70, 7, "lcd_data2", "gpmc_a2", "pr1_mii0_txd3", "ehrpwm2_tripzone_input", NULL, "pr1_pru1_pru_r30_2", "pr1_pru1_pru_r31_2", "gpio2_8"), _PIN(0x8ac, "LCD_DATA3", 71, 7, "lcd_data3", "gpmc_a3", "pr1_mii0_txd2", "ehrpwm0_synco", NULL, "pr1_pru1_pru_r30_3", "pr1_pru1_pru_r31_3", "gpio2_9"), - _PIN(0x8b0, "LCD_DATA4", 72, 7, "lcd_data4", "gpmc_a4", "pr1_mii0_txd1", "eqep2a_in", NULL, "pr1_pru1_pru_r30_4", "pr1_pru1_pru_r31_4", "gpio2_10"), - _PIN(0x8b4, "LCD_DATA5", 73, 7, "lcd_data5", "gpmc_a5", "pr1_mii0_txd0", "eqep2b_in", NULL, "pr1_pru1_pru_r30_5", "pr1_pru1_pru_r31_5", "gpio2_11"), - _PIN(0x8b8, "LCD_DATA6", 74, 7, "lcd_data6", "gpmc_a6", "pr1_edio_data_in6", "eqep2_index", "pr1_edio_data_out6", "pr1_pru1_pru_r30_6", "pr1_pru1_pru_r31_6", "gpio2_12"), - _PIN(0x8bc, "LCD_DATA7", 75, 7, "lcd_data7", "gpmc_a7", "pr1_edio_data_in7", "eqep2_strobe", "pr1_edio_data_out7", "pr1_pru1_pru_r30_7", "pr1_pru1_pru_r31_7", "gpio2_13"), + _PIN(0x8b0, "LCD_DATA4", 72, 7, "lcd_data4", "gpmc_a4", "pr1_mii0_txd1", "eQEP2A_in", NULL, "pr1_pru1_pru_r30_4", "pr1_pru1_pru_r31_4", "gpio2_10"), + _PIN(0x8b4, "LCD_DATA5", 73, 7, "lcd_data5", "gpmc_a5", "pr1_mii0_txd0", "eQEP2B_in", NULL, "pr1_pru1_pru_r30_5", "pr1_pru1_pru_r31_5", "gpio2_11"), + _PIN(0x8b8, "LCD_DATA6", 74, 7, "lcd_data6", "gpmc_a6", "pr1_edio_data_in6", "eQEP2_index", "pr1_edio_data_out6", "pr1_pru1_pru_r30_6", "pr1_pru1_pru_r31_6", "gpio2_12"), + _PIN(0x8bc, "LCD_DATA7", 75, 7, "lcd_data7", "gpmc_a7", "pr1_edio_data_in7", "eQEP2_strobe", "pr1_edio_data_out7", "pr1_pru1_pru_r30_7", "pr1_pru1_pru_r31_7", "gpio2_13"), _PIN(0x8c0, "LCD_DATA8", 76, 7, "lcd_data8", "gpmc_a12", "ehrpwm1_tripzone_input", "mcasp0_aclkx", "uart5_txd", "pr1_mii0_rxd3", "uart2_ctsn", "gpio2_14"), _PIN(0x8c4, "LCD_DATA9", 76, 7, "lcd_data9", "gpmc_a13", "ehrpwm0_synco", "mcasp0_fsx", "uart5_rxd", "pr1_mii0_rxd2", "uart2_rtsn", "gpio2_15"), - _PIN(0x8c8, "LCD_DATA10", 77, 7, "lcd_data10", "gpmc_a14", "ehrpwm1a", "mcasp0_axr0", NULL, "pr1_mii0_rxd1", "uart3_ctsn", "gpio2_16"), - _PIN(0x8cc, "LCD_DATA11", 78, 7, "lcd_data11", "gpmc_a15", "ehrpwm1b", "mcasp0_ahclkr", "mcasp0_axr2", "pr1_mii0_rxd0", "uart3_rtsn", "gpio2_17"), - _PIN(0x8d0, "LCD_DATA12", 8, 7, "lcd_data12", "gpmc_a16", "eqep1a_in", "mcasp0_aclkr", "mcasp0_axr2", "pr1_mii0_rxlink", "uart4_ctsn", "gpio0_8"), - _PIN(0x8d4, "LCD_DATA13", 9, 7, "lcd_data13", "gpmc_a17", "eqep1b_in", "mcasp0_fsr", "mcasp0_axr3", "pr1_mii0_rxer", "uart4_rtsn", "gpio0_9"), - _PIN(0x8d8, "LCD_DATA14", 10, 7, "lcd_data14", "gpmc_a18", "eqep1_index", "mcasp0_axr1", "uart5_rxd", "pr1_mii_mr0_clk", "uart5_ctsn", "gpio0_10"), - _PIN(0x8dc, "LCD_DATA15", 11, 7, "lcd_data15", "gpmc_a19", "eqep1_strobe", "mcasp0_ahclkx", "mcasp0_axr3", "pr1_mii0_rxdv", "uart5_rtsn", "gpio0_11"), + _PIN(0x8c8, "LCD_DATA10", 77, 7, "lcd_data10", "gpmc_a14", "ehrpwm1A", "mcasp0_axr0", NULL, "pr1_mii0_rxd1", "uart3_ctsn", "gpio2_16"), + _PIN(0x8cc, "LCD_DATA11", 78, 7, "lcd_data11", "gpmc_a15", "ehrpwm1B", "mcasp0_ahclkr", "mcasp0_axr2", "pr1_mii0_rxd0", "uart3_rtsn", "gpio2_17"), + _PIN(0x8d0, "LCD_DATA12", 8, 7, "lcd_data12", "gpmc_a16", "eQEP1A_in", "mcasp0_aclkr", "mcasp0_axr2", "pr1_mii0_rxlink", "uart4_ctsn", "gpio0_8"), + _PIN(0x8d4, "LCD_DATA13", 9, 7, "lcd_data13", "gpmc_a17", "eQEP1B_in", "mcasp0_fsr", "mcasp0_axr3", "pr1_mii0_rxer", "uart4_rtsn", "gpio0_9"), + _PIN(0x8d8, "LCD_DATA14", 10, 7, "lcd_data14", "gpmc_a18", "eQEP1_index", "mcasp0_axr1", "uart5_rxd", "pr1_mii_mr0_clk", "uart5_ctsn", "gpio0_10"), + _PIN(0x8dc, "LCD_DATA15", 11, 7, "lcd_data15", "gpmc_a19", "eQEP1_strobe", "mcasp0_ahclkx", "mcasp0_axr3", "pr1_mii0_rxdv", "uart5_rtsn", "gpio0_11"), _PIN(0x8e0, "LCD_VSYNC", 86, 7, "lcd_vsync", "gpmc_a8", "gpmc_a1", "pr1_edio_data_in2", "pr1_edio_data_out2", "pr1_pru1_pru_r30_8", "pr1_pru1_pru_r31_8", "gpio2_22"), _PIN(0x8e4, "LCD_HSYNC", 87, 7, "lcd_hsync", "gmpc_a9", "gpmc_a2", "pr1_edio_data_in3", "pr1_edio_data_out3", "pr1_pru1_pru_r30_9", "pr1_pru1_pru_r31_9", "gpio2_23"), _PIN(0x8e8, "LCD_PCLK", 88, 7, "lcd_pclk", "gpmc_a10", "pr1_mii0_crs", "pr1_edio_data_in4", "pr1_edio_data_out4", "pr1_pru1_pru_r30_10", "pr1_pru1_pru_r31_10", "gpio2_24"), @@ -170,32 +170,32 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0x944, "RMII1_REF_CLK", 29, 7, "rmii1_refclk", "xdma_event_intr2", "spi1_cs0", "uart5_txd", "mcasp1_axr3", "mmc0_pow", "mcasp1_ahclkx", "gpio0_29"), _PIN(0x948, "MDIO", 0, 7, "mdio_data", "timer6", "uart5_rxd", "uart3_ctsn", "mmc0_sdcd","mmc1_cmd", "mmc2_cmd","gpio0_0"), _PIN(0x94c, "MDC", 1, 7, "mdio_clk", "timer5", "uart5_txd", "uart3_rtsn", "mmc0_sdwp", "mmc1_clk", "mmc2_clk", "gpio0_1"), - _PIN(0x950, "SPI0_SCLK", 2, 7, "spi0_sclk", "uart2_rxd", "i2c2_sda", "ehrpwm0a", "pr1_uart0_cts_n", "pr1_edio_sof", "emu2", "gpio0_2"), - _PIN(0x954, "SPI0_D0", 3, 7, "spi0_d0", "uart2_txd", "i2c2_scl", "ehrpwm0b", "pr1_uart0_rts_n", "pr1_edio_latch_in", "emu3", "gpio0_3"), + _PIN(0x950, "SPI0_SCLK", 2, 7, "spi0_sclk", "uart2_rxd", "I2C2_SDA", "ehrpwm0A", "pr1_uart0_cts_n", "pr1_edio_sof", "EMU2", "gpio0_2"), + _PIN(0x954, "SPI0_D0", 3, 7, "spi0_d0", "uart2_txd", "i2C2_SCL", "ehrpwm0B", "pr1_uart0_rts_n", "pr1_edio_latch_in", "EMU3", "gpio0_3"), _PIN(0x958, "SPIO_D1", 4, 7, "spi0_d1", "mmc1_sdwp", "I2C1_SDA", "ehrpwm0_tripzone_input", "pr1_uart0_rxd", "pr1_edio_data_in0", "pr1_edio_data_out0", "gpio0_4"), _PIN(0x95c, "SPI0_CS0", 5, 7, "spi0_cs0", "mmc2_sdwp", "I2C1_SCL", "ehrpwm0_synci", "pr1_uart0_txd", "pr1_edio_data_in1", "pr1_edio_data_out1", "gpio0_5"), - _PIN(0x960, "SPI0_CS1", 6, 7, "spi0_cs1", "uart3_rxd", "ecap1_in_pwm1_out", "mcc0_pow", "xdm_event_intr2", "mmc0_sdcd", "emu4", "gpio0_6"), - _PIN(0x964, "ECAP0_IN_PWM0_OUT",7, 7, "ecap0_in_pwm0_out", "uart3_txd", "spi1_cs1", "pr1_ecap0_ecap_capin_apwm_o", "spi1_sclk", "mmc0_sdwp", "xdma_event_intr2", "gpio0_7"), - _PIN(0x968, "UART0_CTSn", 40, 7, "uart0_ctsn", "uart4_rxd", "dcan1_tx", "i2c1_sda", "spi1_d0", "timer7", "pr1_edc_sync0_out", "gpio1_8"), - _PIN(0x96c, "UART0_RTSn", 41, 7, "uart0_rtsn", "uart4_txd", "dcan1_rx", "i2c1_scl", "spi1_d1", "spi1_cs0", "pr1_edc_sync1_out", "gpio1_9"), - _PIN(0x970, "UART0_rxd", 42, 7, "uart0_rxd", "spi1_cs0", "dcan0_tx", "i2c2_sda", "ecap2_in_pwm2_out", "pr1_pru1_pru_r30_14", "pr1_pru1_pru_r31_14", "gpio1_10"), - _PIN(0x974, "UART0_txd", 43, 7, "uart0_txd", "spi1_cs1", "dcan0_rx", "i2c2_scl", "ecap1_in_pwm1_out", "pr1_pru1_pru_r30_15", "pr1_pru1_pru_r31_15", "gpio1_11"), + _PIN(0x960, "SPI0_CS1", 6, 7, "spi0_cs1", "uart3_rxd", "eCAP1_in_PWM1_out", "mcc0_pow", "xdm_event_intr2", "mmc0_sdcd", "EMU4", "gpio0_6"), + _PIN(0x964, "ECAP0_IN_PWM0_OUT",7, 7, "eCAP0_in_PWM0_out", "uart3_txd", "spi1_cs1", "pr1_ecap0_ecap_capin_apwm_o", "spi1_sclk", "mmc0_sdwp", "xdma_event_intr2", "gpio0_7"), + _PIN(0x968, "UART0_CTSn", 40, 7, "uart0_ctsn", "uart4_rxd", "dcan1_tx", "I2C1_SDA", "spi1_d0", "timer7", "pr1_edc_sync0_out", "gpio1_8"), + _PIN(0x96c, "UART0_RTSn", 41, 7, "uart0_rtsn", "uart4_txd", "dcan1_rx", "I2C1_SCL", "spi1_d1", "spi1_cs0", "pr1_edc_sync1_out", "gpio1_9"), + _PIN(0x970, "UART0_rxd", 42, 7, "uart0_rxd", "spi1_cs0", "dcan0_tx", "I2C2_SDA", "eCAP2_in_PWM2_out", "pr1_pru1_pru_r30_14", "pr1_pru1_pru_r31_14", "gpio1_10"), + _PIN(0x974, "UART0_txd", 43, 7, "uart0_txd", "spi1_cs1", "dcan0_rx", "I2C2_SCL", "eCAP1_in_PWM1_out", "pr1_pru1_pru_r30_15", "pr1_pru1_pru_r31_15", "gpio1_11"), _PIN(0x978, "UART1_CTSn", 12, 7, "uart1_ctsn", "timer6_mux1", "dcan0_tx", "I2C2_SDA", "spi1_cs0", "pr1_uart0_cts_n", "pr1_edc_latch0_in", "gpio0_12"), _PIN(0x97c, "UART1_RTSn", 13, 7, "uart1_rtsn", "timer5_mux1", "dcan0_rx", "I2C2_SCL", "spi1_cs1", "pr1_uart0_rts_n ", "pr1_edc_latch1_in", "gpio0_13"), - _PIN(0x980, "UART1_RXD", 14, 7, "uart1_rxd", "mmc1_sdwp", "dcan1_tx", "i2c1_sda", NULL, "pr1_uart0_rxd", "pr1_pru1_pru_r31_16", "gpio0_14"), - _PIN(0x984, "UART1_TXD", 15, 7, "uart1_txd", "mmc2_sdwp", "dcan1_rx", "i2c1_scl", NULL, "pr1_uart0_txd", "pr1_pru0_pru_r31_16", "gpio0_15"), - _PIN(0x988, "I2C0_SDA", 101, 7, "i2c0_sda", "timer4", "uart2_ctsn", "eCAP2_in_pwm2_out", NULL, NULL, NULL, "gpio3_5"), - _PIN(0x98c, "I2C0_SCL", 102, 7, "i2c0_scl", "timer7", "uart2_rtsn", "eCAP1_in_pwm1_out", NULL, NULL, NULL, "gpio3_6"), - _PIN(0x990, "MCASP0_ACLKX", 110, 7, "mcasp0_aclkx", "ehrpwm0a", NULL, "spi1_sclk", "mmc0_sdcd", "pr1_pru0_pru_r30_0", "pr1_pru0_pru_r31_0", "gpio3_14"), - _PIN(0x994, "MCASP0_FSX", 111, 7, "mcasp0_fsx", "ehrpwm0b", NULL, "spi1_d0", "mmc1_sdcd", "pr1_pru0_pru_r30_1", "pr1_pru0_pru_r31_1", "gpio3_15"), + _PIN(0x980, "UART1_RXD", 14, 7, "uart1_rxd", "mmc1_sdwp", "dcan1_tx", "I2C1_SDA", NULL, "pr1_uart0_rxd", "pr1_pru1_pru_r31_16", "gpio0_14"), + _PIN(0x984, "UART1_TXD", 15, 7, "uart1_txd", "mmc2_sdwp", "dcan1_rx", "I2C1_SCL", NULL, "pr1_uart0_txd", "pr1_pru0_pru_r31_16", "gpio0_15"), + _PIN(0x988, "I2C0_SDA", 101, 7, "I2C0_SDA", "timer4", "uart2_ctsn", "eCAP2_in_PWM2_out", NULL, NULL, NULL, "gpio3_5"), + _PIN(0x98c, "I2C0_SCL", 102, 7, "I2C0_SCL", "timer7", "uart2_rtsn", "eCAP1_in_PWM1_out", NULL, NULL, NULL, "gpio3_6"), + _PIN(0x990, "MCASP0_ACLKX", 110, 7, "mcasp0_aclkx", "ehrpwm0A", NULL, "spi1_sclk", "mmc0_sdcd", "pr1_pru0_pru_r30_0", "pr1_pru0_pru_r31_0", "gpio3_14"), + _PIN(0x994, "MCASP0_FSX", 111, 7, "mcasp0_fsx", "ehrpwm0B", NULL, "spi1_d0", "mmc1_sdcd", "pr1_pru0_pru_r30_1", "pr1_pru0_pru_r31_1", "gpio3_15"), _PIN(0x998, "MCASP0_AXR0", 112, 7, "mcasp0_axr0", "ehrpwm0_tripzone_input", NULL, "spi1_d1", "mmc2_sdcd", "pr1_pru0_pru_r30_2", "pr1_pru0_pru_r31_2", "gpio3_16"), - _PIN(0x99c, "MCASP0_AHCLKR", 113, 7, "mcasp0_ahclkr", "ehrpwm0_synci", "mcasp0_axr2", "spi1_cs0", "ecap2_in_pwm2_out", "pr1_pru0_pru_r30_3", "pr1_pru0_pru_r31_3", "gpio3_17"), - _PIN(0x9a0, "MCASP0_ACLKR", 114, 7, "mcasp0_aclkr", "eqep0a_in", "mcasp0_axr2", "mcasp1_aclkx", "mmc0_sdwp", "pr1_pru0_pru_r30_4", "pr1_pru0_pru_r31_4", "gpio3_18"), - _PIN(0x9a4, "MCASP0_FSR", 115, 7, "mcasp0_fsr", "eqep0b_in", "mcasp0_axr3", "mcasp1_fsx", "emu2", "pr1_pru0_pru_r30_5", "pr1_pru0_pru_r31_5", "gpio3_19"), - _PIN(0x9a8, "MCASP0_AXR1", 116, 7, "mcasp0_axr1", "eqep0_index", NULL, "mcasp1_axr0", "emu3", "pr1_pru0_pru_r30_6", "pr1_pru0_pru_r31_6", "gpio3_20"), - _PIN(0x9ac, "MCASP0_AHCLKX", 117, 7, "mcasp0_ahclkx", "eqep0_strobe", "mcasp0_axr3", "mcasp1_axr1", "emu4", "pr1_pru0_pru_r30_7", "pr1_pru0_pru_r31_7", "gpio3_21"), - _PIN(0x9b0, "XDMA_EVENT_INTR0", 19, 7, "xdma_event_intr0", NULL, "timer4", "clkout1", "spi1_cs1", "pr1_pru1_pru_r31_16", "emu2", "gpio0_19"), - _PIN(0x9b4, "XDMA_EVENT_INTR1", 20, 7, "xdma_event_intr1", NULL, "tclkin", "clkout2", "timer7", "pr1_pru0_pru_r31_16", "emu3", "gpio0_20"), + _PIN(0x99c, "MCASP0_AHCLKR", 113, 7, "mcasp0_ahclkr", "ehrpwm0_synci", "mcasp0_axr2", "spi1_cs0", "eCAP2_in_PWM2_out", "pr1_pru0_pru_r30_3", "pr1_pru0_pru_r31_3", "gpio3_17"), + _PIN(0x9a0, "MCASP0_ACLKR", 114, 7, "mcasp0_aclkr", "eQEP0A_in", "mcasp0_axr2", "mcasp1_aclkx", "mmc0_sdwp", "pr1_pru0_pru_r30_4", "pr1_pru0_pru_r31_4", "gpio3_18"), + _PIN(0x9a4, "MCASP0_FSR", 115, 7, "mcasp0_fsr", "eQEP0B_in", "mcasp0_axr3", "mcasp1_fsx", "EMU2", "pr1_pru0_pru_r30_5", "pr1_pru0_pru_r31_5", "gpio3_19"), + _PIN(0x9a8, "MCASP0_AXR1", 116, 7, "mcasp0_axr1", "eQEP0_index", NULL, "mcasp1_axr0", "EMU3", "pr1_pru0_pru_r30_6", "pr1_pru0_pru_r31_6", "gpio3_20"), + _PIN(0x9ac, "MCASP0_AHCLKX", 117, 7, "mcasp0_ahclkx", "eQEP0_strobe", "mcasp0_axr3", "mcasp1_axr1", "EMU4", "pr1_pru0_pru_r30_7", "pr1_pru0_pru_r31_7", "gpio3_21"), + _PIN(0x9b0, "XDMA_EVENT_INTR0", 19, 7, "xdma_event_intr0", NULL, "timer4", "clkout1", "spi1_cs1", "pr1_pru1_pru_r31_16", "EMU2", "gpio0_19"), + _PIN(0x9b4, "XDMA_EVENT_INTR1", 20, 7, "xdma_event_intr1", NULL, "tclkin", "clkout2", "timer7", "pr1_pru0_pru_r31_16", "EMU3", "gpio0_20"), #if 0 _PIN(0x9b8, "nresetin_out", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x9bc, "porz", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), @@ -209,8 +209,8 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0x9dc, "tck", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x9e0, "ntrst", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), #endif - _PIN(0x9e4, "EMU0", 103, 7, "emu0", NULL, NULL, NULL, NULL, NULL, NULL, "gpio3_7"), - _PIN(0x9e8, "EMU1", 104, 0, "emu1", NULL, NULL, NULL, NULL, NULL, NULL, "gpio3_8"), + _PIN(0x9e4, "EMU0", 103, 7, "EMU0", NULL, NULL, NULL, NULL, NULL, NULL, "gpio3_7"), + _PIN(0x9e8, "EMU1", 104, 0, "EMU1", NULL, NULL, NULL, NULL, NULL, NULL, "gpio3_8"), #if 0 _PIN(0x9ec, "osc1_in", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x9f0, "osc1_out", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 09:47:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 041FC9E8; Mon, 28 Jan 2013 09:47:01 +0000 (UTC) (envelope-from dmarion@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DBC54758; Mon, 28 Jan 2013 09:47:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S9l09N014195; Mon, 28 Jan 2013 09:47:00 GMT (envelope-from dmarion@svn.freebsd.org) Received: (from dmarion@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S9l09m014194; Mon, 28 Jan 2013 09:47:00 GMT (envelope-from dmarion@svn.freebsd.org) Message-Id: <201301280947.r0S9l09m014194@svn.freebsd.org> From: Damjan Marion Date: Mon, 28 Jan 2013 09:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246026 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 09:47:01 -0000 Author: dmarion Date: Mon Jan 28 09:47:00 2013 New Revision: 246026 URL: http://svnweb.freebsd.org/changeset/base/246026 Log: Configure all GPIO pins as described in Beaglebone SRM. Submitted by: Emmanuel Vadot Modified: head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/beaglebone.dts ============================================================================== --- head/sys/boot/fdt/dts/beaglebone.dts Mon Jan 28 09:23:38 2013 (r246025) +++ head/sys/boot/fdt/dts/beaglebone.dts Mon Jan 28 09:47:00 2013 (r246026) @@ -91,7 +91,58 @@ "MMC0_DAT0", "mmc0_dat0", "input_pullup", "MMC0_DAT1", "mmc0_dat1", "input_pullup", "MMC0_DAT2", "mmc0_dat2", "input_pullup", - "MMC0_DAT3", "mmc0_dat3", "input_pullup"; + "MMC0_DAT3", "mmc0_dat3", "input_pullup", + /* GPIO */ + "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", + "GPMC_AD10", "gpio0_26", "input_pulldown", + "GPMC_AD11", "gpio0_27", "input_pulldown", + "GPMC_AD0", "gpio1_0", "input_pulldown", + "GPMC_AD1", "gpio1_1", "input_pulldown", + "GPMC_AD2", "gpio1_2", "input_pulldown", + "GPMC_AD3", "gpio1_3", "input_pulldown", + "GPMC_AD4", "gpio1_4", "input_pulldown", + "GPMC_AD5", "gpio1_5", "input_pulldown", + "GPMC_AD6", "gpio1_6", "input_pulldown", + "GPMC_AD7", "gpio1_7", "input_pulldown", + "GPMC_AD12", "gpio1_12", "input_pulldown", + "GPMC_AD13", "gpio1_13", "input_pulldown", + "GPMC_AD14", "gpio1_14", "input_pulldown", + "GPMC_AD15", "gpio1_15", "input_pulldown", + "GPMC_A0", "gpio1_16", "input_pulldown", + "GPMC_A1", "gpio1_17", "input_pulldown", + "GPMC_A5", "gpio1_21", "output", /* User LED 1 */ + "GPMC_A6", "gpio1_22", "output", /* User LED 2 */ + "GPMC_A7", "gpio1_23", "output", /* User LED 3 */ + "GPMC_A8", "gpio1_24", "output", /* User LED 4 */ + "GPMC_BEn1", "gpio1_28", "input_pulldown", + "GPMC_CSn0", "gpio1_29", "input_pulldown", + "GPMC_CSn1", "gpio1_30", "input_pulldown", + "GPMC_CSn2", "gpio1_31", "input_pulldown", + "GPMC_CLK", "gpio2_1", "input_pulldown", + "LCD_DATA0", "gpio2_6", "input_pulldown", + "LCD_DATA1", "gpio2_7", "input_pulldown", + "LCD_DATA2", "gpio2_8", "input_pulldown", + "LCD_DATA3", "gpio2_9", "input_pulldown", + "LCD_DATA4", "gpio2_10", "input_pulldown", + "LCD_DATA5", "gpio2_11", "input_pulldown", + "LCD_DATA6", "gpio2_12", "input_pulldown", + "LCD_DATA7", "gpio2_13", "input_pulldown", + "LCD_VSYNC", "gpio2_22", "input_pulldown", + "LCD_HSYNC", "gpio2_23", "input_pulldown", + "LCD_PCLK", "gpio2_24", "input_pulldown", + "LCD_AC_BIAS_EN", "gpio2_25", "input_pulldown", + "MCASP0_FSR", "gpio3_19", "input_pulldown", + "MCASP0_AHCLKX", "gpio3_21", "input_pulldown", + /* TIMERs */ + "GPMC_ADVn_ALE", "timer4", "output", + "GPMC_BEn0_CLE", "timer5", "output", + "GPMC_WEn", "timer6", "output", + "GPMC_OEn_REn", "timer7", "output", + /* PWM */ + "GPMC_A2", "ehrpwm1A", "output", + "GPMC_A3", "ehrpwm1B", "output", + "GPMC_AD8", "ehrpwm2A", "output", + "GPMC_AD9", "ehrpwm2B", "output"; }; prcm@44E00000 { From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 10:52:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF7FCBC6; Mon, 28 Jan 2013 10:52:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8958AAC3; Mon, 28 Jan 2013 10:52:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SAqPsJ034629; Mon, 28 Jan 2013 10:52:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SAqOBW034625; Mon, 28 Jan 2013 10:52:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301281052.r0SAqOBW034625@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 28 Jan 2013 10:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246027 - head/sys/dev/usb/template X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 10:52:27 -0000 Author: hselasky Date: Mon Jan 28 10:52:24 2013 New Revision: 246027 URL: http://svnweb.freebsd.org/changeset/base/246027 Log: Remove some extra and not needed space characters. MFC after: 1 week Modified: head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_modem.c Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Mon Jan 28 09:47:00 2013 (r246026) +++ head/sys/dev/usb/template/usb_template_audio.c Mon Jan 28 10:52:24 2013 (r246027) @@ -70,7 +70,7 @@ enum { #define STRING_AUDIO_PRODUCT \ 'A', 0, 'u', 0, 'd', 0, 'i', 0, 'o', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ - 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, ' ', 0, + 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, #define STRING_AUDIO_MIXER \ 'M', 0, 'i', 0, 'x', 0, 'e', 0, 'r', 0, ' ', 0, \ Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Mon Jan 28 09:47:00 2013 (r246026) +++ head/sys/dev/usb/template/usb_template_kbd.c Mon Jan 28 10:52:24 2013 (r246027) @@ -68,7 +68,7 @@ enum { #define STRING_PRODUCT \ 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ - 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, ' ', 0, + 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, #define STRING_KEYBOARD \ 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, \ Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Mon Jan 28 09:47:00 2013 (r246026) +++ head/sys/dev/usb/template/usb_template_modem.c Mon Jan 28 10:52:24 2013 (r246027) @@ -68,7 +68,7 @@ enum { #define STRING_PRODUCT \ 'M', 0, 'o', 0, 'd', 0, 'e', 0, 'm', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ - 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, ' ', 0, + 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, #define STRING_MODEM \ 'M', 0, 'o', 0, 'd', 0, 'e', 0, 'm', 0, ' ', 0, \ From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 11:12:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC203592; Mon, 28 Jan 2013 11:12:50 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BE556F11; Mon, 28 Jan 2013 11:12:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SBCoPK041365; Mon, 28 Jan 2013 11:12:50 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SBCo0B041362; Mon, 28 Jan 2013 11:12:50 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201301281112.r0SBCo0B041362@svn.freebsd.org> From: David Chisnall Date: Mon, 28 Jan 2013 11:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246028 - in head: gnu/lib/libsupc++ lib/libcxxrt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 11:12:50 -0000 Author: theraven Date: Mon Jan 28 11:12:49 2013 New Revision: 246028 URL: http://svnweb.freebsd.org/changeset/base/246028 Log: Fix some symbol version mismatches between libstdc++ and libsupc++/libcxxrt that were causing the runtime and STL libraries to see different versions of various classes and functions when libstdc++ is used as a filter. Note: This changes the ABI for libcxxrt, but libcxxrt is currently only in -STABLE for testing and is not used by anything unless explicitly enabled by the end user. No default compiler configurations use it. libc++ will need to be recompiled after this change. make buildworld will do this automatically, but make in lib/libc++ will not necessarily work unless the new libcxxrt is installed first. PR: kern/171610, stand/175453 Reviewed by: kib MFC after: 1 week Modified: head/gnu/lib/libsupc++/Version.map head/lib/libcxxrt/Version.map Modified: head/gnu/lib/libsupc++/Version.map ============================================================================== --- head/gnu/lib/libsupc++/Version.map Mon Jan 28 10:52:24 2013 (r246027) +++ head/gnu/lib/libsupc++/Version.map Mon Jan 28 11:12:49 2013 (r246028) @@ -142,8 +142,37 @@ GLIBCXX_3.4 { _ZdaPvRKSt9nothrow_t; _ZdlPv; _ZdlPvRKSt9nothrow_t; + extern "C++" { + std::set_new_handler*; + std::set_terminate*; + std::set_unexpected*; + + std::bad_alloc; + std::bad_cast; + std::exception*; + + "typeinfo for std::bad_alloc"; + "typeinfo for std::bad_cast"; + "typeinfo for std::exception"; + + "typeinfo name for std::bad_alloc"; + "typeinfo name for std::bad_cast"; + "typeinfo name for std::exception"; + + "vtable for std::bad_alloc"; + "vtable for std::bad_cast"; + "vtable for std::exception"; + }; }; +GLIBCXX_3.4.9 { + extern "C++" { + "std::bad_alloc::what() const"; + "std::bad_cast::what() const"; + "std::bad_typeid::what() const"; + }; +} GLIBCXX_3.4; + CXXABI_1.3.1 { __cxa_get_exception_ptr; Modified: head/lib/libcxxrt/Version.map ============================================================================== --- head/lib/libcxxrt/Version.map Mon Jan 28 10:52:24 2013 (r246027) +++ head/lib/libcxxrt/Version.map Mon Jan 28 11:12:49 2013 (r246028) @@ -209,18 +209,7 @@ CXXABI_1.3 { "std::type_info::type_info(std::type_info const&)"; "std::type_info::type_info(std::type_info const&)"; - "std::type_info::~type_info()"; - "std::type_info::~type_info()"; - "std::type_info::~type_info()"; "std::type_info::operator=(std::type_info const&)"; - "std::unexpected()"; - "std::get_terminate()"; - "std::set_terminate(void (*)())"; - "std::get_unexpected()"; - "std::set_unexpected(void (*)())"; - "std::set_new_handler(void (*)())"; - "std::uncaught_exception()"; - "std::terminate()"; # Extensions @@ -243,67 +232,22 @@ CXXABI_1.3.1 { CXXRT_1.0 { extern "C++" { - "std::bad_cast::what() const"; - "std::bad_typeid::what() const"; - "std::bad_alloc::what() const"; - "std::exception::what() const"; "std::type_info::name() const"; "std::type_info::before(std::type_info const&) const"; "std::type_info::operator==(std::type_info const&) const"; "std::type_info::operator!=(std::type_info const&) const"; - "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; - "std::bad_typeid::bad_typeid()"; - "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; - "std::bad_typeid::bad_typeid()"; - "std::bad_typeid::~bad_typeid()"; - "std::bad_typeid::~bad_typeid()"; - "std::bad_typeid::~bad_typeid()"; - "std::bad_typeid::operator=(std::bad_typeid const&)"; "std::bad_cast::bad_cast(std::bad_cast const&)"; "std::bad_cast::bad_cast()"; "std::bad_cast::bad_cast(std::bad_cast const&)"; "std::bad_cast::bad_cast()"; - "std::bad_cast::~bad_cast()"; - "std::bad_cast::~bad_cast()"; - "std::bad_cast::~bad_cast()"; "std::bad_cast::operator=(std::bad_cast const&)"; - "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; - "std::bad_alloc::bad_alloc()"; - "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; - "std::bad_alloc::bad_alloc()"; - "std::bad_alloc::~bad_alloc()"; - "std::bad_alloc::~bad_alloc()"; - "std::bad_alloc::~bad_alloc()"; - "std::bad_alloc::operator=(std::bad_alloc const&)"; "std::exception::exception(std::exception const&)"; "std::exception::exception()"; "std::exception::exception(std::exception const&)"; "std::exception::exception()"; - "std::exception::~exception()"; - "std::exception::~exception()"; - "std::exception::~exception()"; "std::exception::operator=(std::exception const&)"; - "vtable for std::bad_typeid"; - "vtable for std::bad_cast"; - "vtable for std::bad_alloc"; - "vtable for std::exception"; - "vtable for std::type_info"; - "typeinfo for std::bad_typeid"; - "typeinfo for std::bad_cast"; - "typeinfo for std::bad_alloc"; - "typeinfo for std::exception"; - "typeinfo for std::type_info"; - "typeinfo name for std::bad_typeid"; - "typeinfo name for std::bad_cast"; - "typeinfo name for std::bad_alloc"; - "typeinfo name for std::exception"; - "typeinfo name for std::type_info"; - - "std::type_info::__is_function_p() const"; - "std::type_info::__do_upcast(__cxxabiv1::__class_type_info const*, void**) const"; - "std::type_info::__is_pointer_p() const"; @@ -317,6 +261,7 @@ CXXRT_1.0 { } CXXABI_1.3.1; + GLIBCXX_3.4 { extern "C++" { "operator delete[](void*)"; @@ -327,5 +272,50 @@ GLIBCXX_3.4 { "operator new[](unsigned long)"; "operator new(unsigned long)"; "operator new(unsigned long, std::nothrow_t const&)"; + + "std::unexpected()"; + "std::get_terminate()"; + "std::get_unexpected()"; + "std::uncaught_exception()"; + "std::terminate()"; + + "std::type_info::~type_info()"; + "std::bad_cast::~bad_cast()"; + "std::exception::~exception()"; + + std::set_new_handler*; + std::set_terminate*; + std::set_unexpected*; + std::exception*; + std::bad_alloc; + std::bad_typeid; + std::type_info*; + + "vtable for std::bad_alloc"; + "vtable for std::bad_cast"; + "vtable for std::bad_typeid"; + "vtable for std::exception"; + "vtable for std::type_info"; + + "typeinfo for std::bad_alloc"; + "typeinfo for std::bad_typeid"; + "typeinfo for std::exception"; + "typeinfo for std::bad_cast"; + "typeinfo for std::exception"; + "typeinfo for std::type_info"; + "typeinfo name for std::bad_typeid"; + "typeinfo name for std::bad_cast"; + "typeinfo name for std::exception"; + "typeinfo name for std::type_info"; + }; }; + +GLIBCXX_3.4.9 { + extern "C++" { + "std::bad_typeid::what() const"; + "std::bad_cast::what() const"; + "std::bad_alloc::what() const"; + }; +} GLIBCXX_3.4; + From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 12:08:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 22D5B4EF; Mon, 28 Jan 2013 12:08:30 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E6F5E3A5; Mon, 28 Jan 2013 12:08:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SC8Tb8056764; Mon, 28 Jan 2013 12:08:29 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SC8TIv056763; Mon, 28 Jan 2013 12:08:29 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201301281208.r0SC8TIv056763@svn.freebsd.org> From: Andrey Zonov Date: Mon, 28 Jan 2013 12:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246029 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 12:08:30 -0000 Author: zont Date: Mon Jan 28 12:08:29 2013 New Revision: 246029 URL: http://svnweb.freebsd.org/changeset/base/246029 Log: - Style. MFC after: 2 weeks Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon Jan 28 11:12:49 2013 (r246028) +++ head/sys/vm/vm_pageout.c Mon Jan 28 12:08:29 2013 (r246029) @@ -151,18 +151,19 @@ static struct mtx vm_daemon_mtx; MTX_SYSINIT(vm_daemon, &vm_daemon_mtx, "vm daemon", MTX_DEF); #endif static int vm_max_launder = 32; -static int vm_pageout_stats_max=0, vm_pageout_stats_interval = 0; -static int vm_pageout_full_stats_interval = 0; -static int vm_pageout_algorithm=0; -static int defer_swap_pageouts=0; -static int disable_swap_pageouts=0; +static int vm_pageout_stats_max; +static int vm_pageout_stats_interval; +static int vm_pageout_full_stats_interval; +static int vm_pageout_algorithm; +static int defer_swap_pageouts; +static int disable_swap_pageouts; #if defined(NO_SWAPPING) -static int vm_swap_enabled=0; -static int vm_swap_idle_enabled=0; +static int vm_swap_enabled = 0; +static int vm_swap_idle_enabled = 0; #else -static int vm_swap_enabled=1; -static int vm_swap_idle_enabled=0; +static int vm_swap_enabled = 1; +static int vm_swap_idle_enabled = 0; #endif SYSCTL_INT(_vm, VM_PAGEOUT_ALGORITHM, pageout_algorithm, @@ -1512,12 +1513,12 @@ vm_pageout_oom(int shortage) * helps the situation where paging just starts to occur. */ static void -vm_pageout_page_stats() +vm_pageout_page_stats(void) { struct vm_pagequeue *pq; vm_object_t object; - vm_page_t m,next; - int pcount,tpcount; /* Number of pages to check */ + vm_page_t m, next; + int pcount, tpcount; /* Number of pages to check */ static int fullintervalcount = 0; int page_shortage; @@ -1624,7 +1625,7 @@ vm_pageout_page_stats() * vm_pageout is the high level pageout daemon. */ static void -vm_pageout() +vm_pageout(void) { int error, pass; @@ -1757,7 +1758,7 @@ vm_pageout() * the free page queue lock is held until the msleep() is performed. */ void -pagedaemon_wakeup() +pagedaemon_wakeup(void) { if (!vm_pages_needed && curthread->td_proc != pageproc) { @@ -1782,7 +1783,7 @@ vm_req_vmdaemon(int req) } static void -vm_daemon() +vm_daemon(void) { struct rlimit rsslim; struct proc *p; From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 12:20:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 51A6D7DD; Mon, 28 Jan 2013 12:20:21 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8A468D; Mon, 28 Jan 2013 12:20:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SCKLA2060310; Mon, 28 Jan 2013 12:20:21 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SCKLhf060309; Mon, 28 Jan 2013 12:20:21 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201301281220.r0SCKLhf060309@svn.freebsd.org> From: Andrey Zonov Date: Mon, 28 Jan 2013 12:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246030 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 12:20:21 -0000 Author: zont Date: Mon Jan 28 12:20:20 2013 New Revision: 246030 URL: http://svnweb.freebsd.org/changeset/base/246030 Log: - Add sysctls to show number of stats scans. MFC after: 2 weeks Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon Jan 28 12:08:29 2013 (r246029) +++ head/sys/vm/vm_pageout.c Mon Jan 28 12:20:20 2013 (r246030) @@ -152,7 +152,9 @@ MTX_SYSINIT(vm_daemon, &vm_daemon_mtx, " #endif static int vm_max_launder = 32; static int vm_pageout_stats_max; +static int vm_pageout_stats; static int vm_pageout_stats_interval; +static int vm_pageout_full_stats; static int vm_pageout_full_stats_interval; static int vm_pageout_algorithm; static int defer_swap_pageouts; @@ -175,12 +177,18 @@ SYSCTL_INT(_vm, OID_AUTO, max_launder, SYSCTL_INT(_vm, OID_AUTO, pageout_stats_max, CTLFLAG_RW, &vm_pageout_stats_max, 0, "Max pageout stats scan length"); -SYSCTL_INT(_vm, OID_AUTO, pageout_full_stats_interval, - CTLFLAG_RW, &vm_pageout_full_stats_interval, 0, "Interval for full stats scan"); +SYSCTL_INT(_vm, OID_AUTO, pageout_stats, + CTLFLAG_RD, &vm_pageout_stats, 0, "Number of partial stats scans"); SYSCTL_INT(_vm, OID_AUTO, pageout_stats_interval, CTLFLAG_RW, &vm_pageout_stats_interval, 0, "Interval for partial stats scan"); +SYSCTL_INT(_vm, OID_AUTO, pageout_full_stats, + CTLFLAG_RD, &vm_pageout_full_stats, 0, "Number of full stats scans"); + +SYSCTL_INT(_vm, OID_AUTO, pageout_full_stats_interval, + CTLFLAG_RW, &vm_pageout_full_stats_interval, 0, "Interval for full stats scan"); + #if defined(NO_SWAPPING) SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled, CTLFLAG_RD, &vm_swap_enabled, 0, "Enable entire process swapout"); @@ -1532,11 +1540,13 @@ vm_pageout_page_stats(void) pcount = cnt.v_active_count; fullintervalcount += vm_pageout_stats_interval; if (fullintervalcount < vm_pageout_full_stats_interval) { + vm_pageout_stats++; tpcount = (int64_t)vm_pageout_stats_max * cnt.v_active_count / cnt.v_page_count; if (pcount > tpcount) pcount = tpcount; } else { + vm_pageout_full_stats++; fullintervalcount = 0; } From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 12:54:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8BC214C1; Mon, 28 Jan 2013 12:54:54 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A8C886F; Mon, 28 Jan 2013 12:54:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SCss5h070952; Mon, 28 Jan 2013 12:54:54 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SCsrPK070947; Mon, 28 Jan 2013 12:54:53 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201301281254.r0SCsrPK070947@svn.freebsd.org> From: Andrey Zonov Date: Mon, 28 Jan 2013 12:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246032 - in head/sys: sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 12:54:54 -0000 Author: zont Date: Mon Jan 28 12:54:53 2013 New Revision: 246032 URL: http://svnweb.freebsd.org/changeset/base/246032 Log: - Add system wide page faults requiring I/O counter. Reviewed by: alc MFC after: 2 weeks Modified: head/sys/sys/vmmeter.h head/sys/vm/vm_fault.c head/sys/vm/vm_meter.c Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Mon Jan 28 12:50:16 2013 (r246031) +++ head/sys/sys/vmmeter.h Mon Jan 28 12:54:53 2013 (r246032) @@ -61,6 +61,7 @@ struct vmmeter { * Virtual memory activity. */ u_int v_vm_faults; /* (p) address memory faults */ + u_int v_io_faults; /* (p) page faults requiring I/O */ u_int v_cow_faults; /* (p) copy-on-writes faults */ u_int v_cow_optim; /* (p) optimized copy-on-writes faults */ u_int v_zfod; /* (p) pages zero filled on demand */ Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Jan 28 12:50:16 2013 (r246031) +++ head/sys/vm/vm_fault.c Mon Jan 28 12:54:53 2013 (r246032) @@ -939,9 +939,10 @@ vnode_locked: * Unlock everything, and return */ unlock_and_deallocate(&fs); - if (hardfault) + if (hardfault) { + PCPU_INC(cnt.v_io_faults); curthread->td_ru.ru_majflt++; - else + } else curthread->td_ru.ru_minflt++; return (KERN_SUCCESS); Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Mon Jan 28 12:50:16 2013 (r246031) +++ head/sys/vm/vm_meter.c Mon Jan 28 12:54:53 2013 (r246032) @@ -283,6 +283,7 @@ VM_STATS_SYS(v_syscall, "System calls"); VM_STATS_SYS(v_intr, "Device interrupts"); VM_STATS_SYS(v_soft, "Software interrupts"); VM_STATS_VM(v_vm_faults, "Address memory faults"); +VM_STATS_VM(v_io_faults, "Page faults requiring I/O"); VM_STATS_VM(v_cow_faults, "Copy-on-write faults"); VM_STATS_VM(v_cow_optim, "Optimized COW faults"); VM_STATS_VM(v_zfod, "Pages zero-filled on demand"); From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 12:57:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE88B6FF; Mon, 28 Jan 2013 12:57:43 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91E0E8A1; Mon, 28 Jan 2013 12:57:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SCvhXE071415; Mon, 28 Jan 2013 12:57:43 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SCvhhv071414; Mon, 28 Jan 2013 12:57:43 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201301281257.r0SCvhhv071414@svn.freebsd.org> From: Andrey Zonov Date: Mon, 28 Jan 2013 12:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246033 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 12:57:43 -0000 Author: zont Date: Mon Jan 28 12:57:42 2013 New Revision: 246033 URL: http://svnweb.freebsd.org/changeset/base/246033 Log: - Show page faults requiring I/O on vmstat display. Reviewed by: alc MFC after: 2 weeks Modified: head/usr.bin/systat/vmstat.c Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Mon Jan 28 12:54:53 2013 (r246032) +++ head/usr.bin/systat/vmstat.c Mon Jan 28 12:57:42 2013 (r246033) @@ -79,6 +79,7 @@ static struct Info { * Virtual memory activity. */ u_int v_vm_faults; /* number of address memory faults */ + u_int v_io_faults; /* page faults requiring I/O */ u_int v_cow_faults; /* number of copy-on-writes */ u_int v_zfod; /* pages zero filled on demand */ u_int v_ozfod; /* optimized zero fill pages */ @@ -324,24 +325,25 @@ labelkre(void) mvprintw(INTSROW, INTSCOL + 1, "Interrupts"); mvprintw(INTSROW + 1, INTSCOL + 6, "total"); - mvprintw(VMSTATROW, VMSTATCOL + 9, "cow"); - mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "zfod"); - mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "ozfod"); - mvprintw(VMSTATROW + 3, VMSTATCOL + 9 - 1, "%%ozfod"); - mvprintw(VMSTATROW + 4, VMSTATCOL + 9, "daefr"); - mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "prcfr"); - mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "totfr"); - mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "react"); - mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "pdwak"); - mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdpgs"); - mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "intrn"); - mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "wire"); - mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "act"); - mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "inact"); - mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "cache"); - mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "free"); - if (LINES - 1 > VMSTATROW + 16) - mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "buf"); + mvprintw(VMSTATROW, VMSTATCOL + 9, "ioflt"); + mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "cow"); + mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "zfod"); + mvprintw(VMSTATROW + 3, VMSTATCOL + 9, "ozfod"); + mvprintw(VMSTATROW + 4, VMSTATCOL + 9 - 1, "%%ozfod"); + mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "daefr"); + mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "prcfr"); + mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "totfr"); + mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "react"); + mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdwak"); + mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "pdpgs"); + mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "intrn"); + mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "wire"); + mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "act"); + mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "inact"); + mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "cache"); + mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "free"); + if (LINES - 1 > VMSTATROW + 17) + mvprintw(VMSTATROW + 17, VMSTATCOL + 9, "buf"); mvprintw(GENSTATROW, GENSTATCOL, " Csw Trp Sys Int Sof Flt"); @@ -493,25 +495,26 @@ showkre(void) putint(total.t_dw, PROCSROW + 2, PROCSCOL + 8, 3); putint(total.t_sl, PROCSROW + 2, PROCSCOL + 12, 3); putint(total.t_sw, PROCSROW + 2, PROCSCOL + 16, 3); - PUTRATE(v_cow_faults, VMSTATROW, VMSTATCOL + 2, 8 - 2); - PUTRATE(v_zfod, VMSTATROW + 1, VMSTATCOL + 2, 8 - 2); - PUTRATE(v_ozfod, VMSTATROW + 2, VMSTATCOL, 8); + PUTRATE(v_io_faults, VMSTATROW, VMSTATCOL + 2, 8 - 2); + PUTRATE(v_cow_faults, VMSTATROW + 1, VMSTATCOL + 2, 8 - 2); + PUTRATE(v_zfod, VMSTATROW + 2, VMSTATCOL + 2, 8 - 2); + PUTRATE(v_ozfod, VMSTATROW + 3, VMSTATCOL, 8); putint(s.v_zfod != 0 ? (int)(s.v_ozfod * 100.0 / s.v_zfod) : 0, - VMSTATROW + 3, VMSTATCOL + 1, 8 - 1); - PUTRATE(v_dfree, VMSTATROW + 4, VMSTATCOL + 2, 8 - 2); - PUTRATE(v_pfree, VMSTATROW + 5, VMSTATCOL + 2, 8 - 2); - PUTRATE(v_tfree, VMSTATROW + 6, VMSTATCOL, 8); - PUTRATE(v_reactivated, VMSTATROW + 7, VMSTATCOL, 8); - PUTRATE(v_pdwakeups, VMSTATROW + 8, VMSTATCOL, 8); - PUTRATE(v_pdpages, VMSTATROW + 9, VMSTATCOL, 8); - PUTRATE(v_intrans, VMSTATROW + 10, VMSTATCOL, 8); - putint(pgtokb(s.v_wire_count), VMSTATROW + 11, VMSTATCOL, 8); - putint(pgtokb(s.v_active_count), VMSTATROW + 12, VMSTATCOL, 8); - putint(pgtokb(s.v_inactive_count), VMSTATROW + 13, VMSTATCOL, 8); - putint(pgtokb(s.v_cache_count), VMSTATROW + 14, VMSTATCOL, 8); - putint(pgtokb(s.v_free_count), VMSTATROW + 15, VMSTATCOL, 8); - if (LINES - 1 > VMSTATROW + 16) - putint(s.bufspace / 1024, VMSTATROW + 16, VMSTATCOL, 8); + VMSTATROW + 4, VMSTATCOL + 1, 8 - 1); + PUTRATE(v_dfree, VMSTATROW + 5, VMSTATCOL + 2, 8 - 2); + PUTRATE(v_pfree, VMSTATROW + 6, VMSTATCOL + 2, 8 - 2); + PUTRATE(v_tfree, VMSTATROW + 7, VMSTATCOL, 8); + PUTRATE(v_reactivated, VMSTATROW + 8, VMSTATCOL, 8); + PUTRATE(v_pdwakeups, VMSTATROW + 9, VMSTATCOL, 8); + PUTRATE(v_pdpages, VMSTATROW + 10, VMSTATCOL, 8); + PUTRATE(v_intrans, VMSTATROW + 11, VMSTATCOL, 8); + putint(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); + putint(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); + putint(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); + putint(pgtokb(s.v_cache_count), VMSTATROW + 15, VMSTATCOL, 8); + putint(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); + if (LINES - 1 > VMSTATROW + 17) + putint(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); PUTRATE(v_vnodein, PAGEROW + 2, PAGECOL + 6, 5); PUTRATE(v_vnodeout, PAGEROW + 2, PAGECOL + 12, 5); PUTRATE(v_swapin, PAGEROW + 2, PAGECOL + 19, 5); @@ -751,6 +754,7 @@ getinfo(struct Info *ls) GETSYSCTL("vm.stats.sys.v_intr", ls->v_intr); GETSYSCTL("vm.stats.sys.v_soft", ls->v_soft); GETSYSCTL("vm.stats.vm.v_vm_faults", ls->v_vm_faults); + GETSYSCTL("vm.stats.vm.v_io_faults", ls->v_io_faults); GETSYSCTL("vm.stats.vm.v_cow_faults", ls->v_cow_faults); GETSYSCTL("vm.stats.vm.v_zfod", ls->v_zfod); GETSYSCTL("vm.stats.vm.v_ozfod", ls->v_ozfod); From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 12:58:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3920E886; Mon, 28 Jan 2013 12:58:38 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8798B5; Mon, 28 Jan 2013 12:58:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SCwcwi071581; Mon, 28 Jan 2013 12:58:38 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SCwcd8071580; Mon, 28 Jan 2013 12:58:38 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201301281258.r0SCwcd8071580@svn.freebsd.org> From: Andrey Zonov Date: Mon, 28 Jan 2013 12:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246034 - head/usr.bin/vmstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 12:58:38 -0000 Author: zont Date: Mon Jan 28 12:58:37 2013 New Revision: 246034 URL: http://svnweb.freebsd.org/changeset/base/246034 Log: - Show page faults requiring I/O when -s invoked. Reviewed by: alc MFC after: 2 weeks Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Mon Jan 28 12:57:42 2013 (r246033) +++ head/usr.bin/vmstat/vmstat.c Mon Jan 28 12:58:37 2013 (r246034) @@ -469,6 +469,7 @@ fill_vmmeter(struct vmmeter *vmmp) ADD_FROM_PCPU(i, v_intr); ADD_FROM_PCPU(i, v_soft); ADD_FROM_PCPU(i, v_vm_faults); + ADD_FROM_PCPU(i, v_io_faults); ADD_FROM_PCPU(i, v_cow_faults); ADD_FROM_PCPU(i, v_cow_optim); ADD_FROM_PCPU(i, v_zfod); @@ -507,6 +508,7 @@ fill_vmmeter(struct vmmeter *vmmp) /* vm */ GET_VM_STATS(vm, v_vm_faults); + GET_VM_STATS(vm, v_io_faults); GET_VM_STATS(vm, v_cow_faults); GET_VM_STATS(vm, v_cow_optim); GET_VM_STATS(vm, v_zfod); @@ -968,6 +970,7 @@ dosum(void) (void)printf("%9u zero fill pages prezeroed\n", sum.v_ozfod); (void)printf("%9u intransit blocking page faults\n", sum.v_intrans); (void)printf("%9u total VM faults taken\n", sum.v_vm_faults); + (void)printf("%9u page faults requiring I/O\n", sum.v_io_faults); (void)printf("%9u pages affected by kernel thread creation\n", sum.v_kthreadpages); (void)printf("%9u pages affected by fork()\n", sum.v_forkpages); (void)printf("%9u pages affected by vfork()\n", sum.v_vforkpages); From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 14:51:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1867332D; Mon, 28 Jan 2013 14:51:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 8A84FEC; Mon, 28 Jan 2013 14:51:19 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0SEpDFB002577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 Jan 2013 01:51:15 +1100 Date: Tue, 29 Jan 2013 01:51:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Zonov Subject: Re: svn commit: r246033 - head/usr.bin/systat In-Reply-To: <201301281257.r0SCvhhv071414@svn.freebsd.org> Message-ID: <20130129003913.G2698@besplex.bde.org> References: <201301281257.r0SCvhhv071414@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=P/xiHV8u c=1 sm=1 a=VYs4l19NTHwA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=hP3lJxi6wgAA:10 a=ejpqoXUJjIB3LjvBEa4A:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 14:51:20 -0000 On Mon, 28 Jan 2013, Andrey Zonov wrote: > Log: > - Show page faults requiring I/O on vmstat display. No space is available there for showing it. > Modified: head/usr.bin/systat/vmstat.c > ============================================================================== > --- head/usr.bin/systat/vmstat.c Mon Jan 28 12:54:53 2013 (r246032) > +++ head/usr.bin/systat/vmstat.c Mon Jan 28 12:57:42 2013 (r246033) > @@ -324,24 +325,25 @@ labelkre(void) > mvprintw(INTSROW, INTSCOL + 1, "Interrupts"); > mvprintw(INTSROW + 1, INTSCOL + 6, "total"); > > - mvprintw(VMSTATROW, VMSTATCOL + 9, "cow"); > - mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "zfod"); > - mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "ozfod"); > - mvprintw(VMSTATROW + 3, VMSTATCOL + 9 - 1, "%%ozfod"); > - mvprintw(VMSTATROW + 4, VMSTATCOL + 9, "daefr"); > - mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "prcfr"); > - mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "totfr"); > - mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "react"); > - mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "pdwak"); > - mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdpgs"); > - mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "intrn"); > - mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "wire"); > - mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "act"); > - mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "inact"); > - mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "cache"); > - mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "free"); > - if (LINES - 1 > VMSTATROW + 16) > - mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "buf"); This is the last possible line on a 25-line display. On a 24-line display, it is omitted so that it doesn't mangle or get mangled by the prompt/status line. But previous lines are not specially handled, and neither are other parts of the display. Also, the interrupt display may reach the last line of the window, and then it interacts with the prompt/status line even on a 25-line display. On a 23-line display, mangling occurs as follows: - the special case for the "buf" line has no visible effect, since this line is outside of the window - the free "line" and the prompt/status line are both on the last line in the window, together with the %busy display and possibly the interrupts display. These mangle each other, On a 22-line display, the mangling moves up by 1 line and becomes worse. Now there seems to be a windowing bug. Some field (the "free" one) is mispositioned, so the display becomes magled (instead of just truncated) even when the prompt/status line is not used. > + mvprintw(VMSTATROW, VMSTATCOL + 9, "ioflt"); Putting it first unsorts the fields a bit and makes the diff large. It is not documented in the man page. > + mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "cow"); > + mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "zfod"); > + mvprintw(VMSTATROW + 3, VMSTATCOL + 9, "ozfod"); > + mvprintw(VMSTATROW + 4, VMSTATCOL + 9 - 1, "%%ozfod"); > + mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "daefr"); > + mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "prcfr"); > + mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "totfr"); > + mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "react"); > + mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdwak"); > + mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "pdpgs"); > + mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "intrn"); > + mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "wire"); > + mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "act"); > + mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "inact"); > + mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "cache"); > + mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "free"); > + if (LINES - 1 > VMSTATROW + 17) > + mvprintw(VMSTATROW + 17, VMSTATCOL + 9, "buf"); Adding a field at the top pushes the "buf" field to the last line of the window in the most common case of a 25-line display, and makes its special case useless except for 26-line displays, so mangling from the "buf" line now occurs in the most common case. It moves the problems for 22-24 line displays to 23-25 line displays, respectively. Now it is the "free" field that needs the special handling to avoid mangling in the nextmost common case of 24-line displays. Even more seriously, the "free" field is much more interesting than the "buf" field, so we don't want to lose it or have it mangled in a common case. The "buf" field really belongs in another group of fields (before "dtbuf") but is spaced where it is since there is no free space near "dtbuf" but just 1 line of free space (in the most common case) in the vmmeter fields column ("buf" also isn't a vmmeter field so it doesn't belong there). But now there are 0 lines of free space there. Since systat output barely works with screen depths other than 24 and 25 lines, omitting the "buf" field after moving its special case to the "free" field and moving some less important field than "free" to the end would be the simplest fix. The "buf" field is worse than useless because it is just the constant limit on the amount of virtual memory for buffers (nbuf * BKVASIZE). It is not merely useless, since it wastes space and confuses users into thinking that it is useful. top(1) prints it too. In other OS's top(1) prints something related to buffer resources that is actually useful. The related usful values in FreeBSD are the non-constant amount of physical memory mapped to buffers and to a lesser extent the non-constant amount of virtual memory mapped to buffers. These are not directly available. Also the amount of malloced memory pointed to by buffers (available in vfs.bufmallocspace), and the amount of disk space cached in VMIO buffers (not directly available, buf "inact" often approximates it). But there is no space for these. "buf" is even more useless with zfs. So are some of the other fields printed by systat and top. I think zfs has its own statistics programs, but it would be especially difficult to combine these with systat statistics see the combined resource usage if both zfs and file systems using the buffer cache/VMIO are active. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 15:48:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1B7B6D4B; Mon, 28 Jan 2013 15:48:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1176F1; Mon, 28 Jan 2013 15:48:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SFmVa2023277; Mon, 28 Jan 2013 15:48:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SFmVra023276; Mon, 28 Jan 2013 15:48:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301281548.r0SFmVra023276@svn.freebsd.org> From: John Baldwin Date: Mon, 28 Jan 2013 15:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246035 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 15:48:32 -0000 Author: jhb Date: Mon Jan 28 15:48:31 2013 New Revision: 246035 URL: http://svnweb.freebsd.org/changeset/base/246035 Log: - Compute the correct size to reallocate when doubling the size of the array of loaded objects to avoid a buffer overrun. - Use reallocf() to avoid leaking memory if the realloc() fails. PR: kern/175648 Submitted by: yuri@rawbw.com (1) MFC after: 1 week Modified: head/lib/libproc/proc_rtld.c Modified: head/lib/libproc/proc_rtld.c ============================================================================== --- head/lib/libproc/proc_rtld.c Mon Jan 28 12:58:37 2013 (r246034) +++ head/lib/libproc/proc_rtld.c Mon Jan 28 15:48:31 2013 (r246035) @@ -44,7 +44,8 @@ map_iter(const rd_loadobj_t *lop, void * if (phdl->nobjs >= phdl->rdobjsz) { phdl->rdobjsz *= 2; - phdl->rdobjs = realloc(phdl->rdobjs, phdl->rdobjsz); + phdl->rdobjs = reallocf(phdl->rdobjs, sizeof(*phdl->rdobjs) * + phdl->rdobjsz); if (phdl->rdobjs == NULL) return (-1); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 18:58:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 213C4219; Mon, 28 Jan 2013 18:58:14 +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 F36CA25C; Mon, 28 Jan 2013 18:58:13 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3EAA0B922; Mon, 28 Jan 2013 13:58:13 -0500 (EST) From: John Baldwin To: Andriy Gapon Subject: Re: svn commit: r245850 - in head/sys/sparc64: include sparc64 Date: Mon, 28 Jan 2013 09:54:51 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301232252.r0NMqLxh085107@svn.freebsd.org> <5103ABCC.3010706@FreeBSD.org> In-Reply-To: <5103ABCC.3010706@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201301280954.51558.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 28 Jan 2013 13:58:13 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 18:58:14 -0000 On Saturday, January 26, 2013 5:11:24 am Andriy Gapon wrote: > on 24/01/2013 00:52 Marius Strobl said the following: > > This is due to > > the fact that on sparc64, spinlock_enter() only raises the PIL but doesn't > > disable interrupts completely. > > John, > > I wonder if you are considering pushing your amd64 TPR patch some day... I have it in a p4 branch still that is easy to update. I haven't yet been able to do any testing/benchmarks that show it as beneficial. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 19:01:22 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D44B1C5A; Mon, 28 Jan 2013 19:01:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8998231D; Mon, 28 Jan 2013 19:01:21 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA03568; Mon, 28 Jan 2013 21:01:19 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <5106CAFF.3050905@FreeBSD.org> Date: Mon, 28 Jan 2013 21:01:19 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130113 Thunderbird/17.0.2 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r245850 - in head/sys/sparc64: include sparc64 References: <201301232252.r0NMqLxh085107@svn.freebsd.org> <5103ABCC.3010706@FreeBSD.org> <201301280954.51558.jhb@freebsd.org> In-Reply-To: <201301280954.51558.jhb@freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 19:01:22 -0000 on 28/01/2013 16:54 John Baldwin said the following: > On Saturday, January 26, 2013 5:11:24 am Andriy Gapon wrote: >> on 24/01/2013 00:52 Marius Strobl said the following: >>> This is due to >>> the fact that on sparc64, spinlock_enter() only raises the PIL but doesn't >>> disable interrupts completely. >> >> John, >> >> I wonder if you are considering pushing your amd64 TPR patch some day... > > I have it in a p4 branch still that is easy to update. I haven't yet been > able to do any testing/benchmarks that show it as beneficial. > I am thinking about architectural benefits. Like doing inter-processor stuff with less risk of deadlocks. Or "hard CPU stop" without resorting to NMI. Things like that... -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 19:38:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2600A7F; Mon, 28 Jan 2013 19:38:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4ABA74F; Mon, 28 Jan 2013 19:38:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SJcEwR091858; Mon, 28 Jan 2013 19:38:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SJcDKp091851; Mon, 28 Jan 2013 19:38:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301281938.r0SJcDKp091851@svn.freebsd.org> From: John Baldwin Date: Mon, 28 Jan 2013 19:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246037 - in head/sys: dev/usb/net kern pci sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 19:38:15 -0000 Author: jhb Date: Mon Jan 28 19:38:13 2013 New Revision: 246037 URL: http://svnweb.freebsd.org/changeset/base/246037 Log: Mark 'ticks', 'time_second', and 'time_uptime' as volatile to prevent the compiler from caching their values in tight loops. Reviewed by: bde MFC after: 1 week Modified: head/sys/dev/usb/net/if_cdce.c head/sys/kern/kern_clock.c head/sys/kern/kern_tc.c head/sys/pci/ncr.c head/sys/sys/kernel.h head/sys/sys/time.h Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Mon Jan 28 17:25:53 2013 (r246036) +++ head/sys/dev/usb/net/if_cdce.c Mon Jan 28 19:38:13 2013 (r246037) @@ -500,6 +500,7 @@ cdce_attach(device_t dev) const struct usb_interface_descriptor *id; const struct usb_cdc_ethernet_descriptor *ued; const struct usb_config *pcfg; + uint32_t seed; int error; uint8_t i; uint8_t data_iface_no; @@ -612,8 +613,9 @@ alloc_transfers: /* fake MAC address */ device_printf(dev, "faking MAC address\n"); + seed = ticks; sc->sc_ue.ue_eaddr[0] = 0x2a; - memcpy(&sc->sc_ue.ue_eaddr[1], &ticks, sizeof(uint32_t)); + memcpy(&sc->sc_ue.ue_eaddr[1], &seed, sizeof(uint32_t)); sc->sc_ue.ue_eaddr[5] = device_get_unit(dev); } else { Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Mon Jan 28 17:25:53 2013 (r246036) +++ head/sys/kern/kern_clock.c Mon Jan 28 19:38:13 2013 (r246037) @@ -382,7 +382,7 @@ static void watchdog_config(void *, u_in int stathz; int profhz; int profprocs; -int ticks; +volatile int ticks; int psratio; static DPCPU_DEFINE(int, pcputicks); /* Per-CPU version of ticks. */ @@ -469,7 +469,7 @@ void hardclock(int usermode, uintfptr_t pc) { - atomic_add_int((volatile int *)&ticks, 1); + atomic_add_int(&ticks, 1); hardclock_cpu(usermode); tc_ticktock(1); cpu_tick_calibration(); Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Mon Jan 28 17:25:53 2013 (r246036) +++ head/sys/kern/kern_tc.c Mon Jan 28 19:38:13 2013 (r246037) @@ -103,8 +103,8 @@ static struct timecounter *timecounters int tc_min_ticktock_freq = 1; -time_t time_second = 1; -time_t time_uptime = 1; +volatile time_t time_second = 1; +volatile time_t time_uptime = 1; struct bintime boottimebin; struct timeval boottime; Modified: head/sys/pci/ncr.c ============================================================================== --- head/sys/pci/ncr.c Mon Jan 28 17:25:53 2013 (r246036) +++ head/sys/pci/ncr.c Mon Jan 28 19:38:13 2013 (r246037) @@ -1386,7 +1386,7 @@ static char *ncr_name (ncb_p np) * Kernel variables referenced in the scripts. * THESE MUST ALL BE ALIGNED TO A 4-BYTE BOUNDARY. */ -static void *script_kvars[] = +static volatile void *script_kvars[] = { &time_second, &ticks, &ncr_cache }; static struct script script0 = { Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Mon Jan 28 17:25:53 2013 (r246036) +++ head/sys/sys/kernel.h Mon Jan 28 19:38:13 2013 (r246037) @@ -63,7 +63,7 @@ extern int psratio; /* ratio: prof / s extern int stathz; /* statistics clock's frequency */ extern int profhz; /* profiling clock's frequency */ extern int profprocs; /* number of process's profiling */ -extern int ticks; +extern volatile int ticks; #endif /* _KERNEL */ Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Mon Jan 28 17:25:53 2013 (r246036) +++ head/sys/sys/time.h Mon Jan 28 19:38:13 2013 (r246037) @@ -287,8 +287,8 @@ struct clockinfo { void inittodr(time_t base); void resettodr(void); -extern time_t time_second; -extern time_t time_uptime; +extern volatile time_t time_second; +extern volatile time_t time_uptime; extern struct bintime boottimebin; extern struct timeval boottime; From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 20:25:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CB8CF755; Mon, 28 Jan 2013 20:25:27 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B266B94E; Mon, 28 Jan 2013 20:25:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SKPR8f006652; Mon, 28 Jan 2013 20:25:27 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SKPR9u006651; Mon, 28 Jan 2013 20:25:27 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201301282025.r0SKPR9u006651@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 28 Jan 2013 20:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246038 - vendor-sys/acpica/dist/source/include X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 20:25:27 -0000 Author: jkim Date: Mon Jan 28 20:25:27 2013 New Revision: 246038 URL: http://svnweb.freebsd.org/changeset/base/246038 Log: Partially revert a vendor commit. The following broke our acpi(4) in a very subtle way: https://github.com/otcshare/acpica/commit/b8cf8cd2232f4e08ef9f8df4a103a29bd8699194 Modified: vendor-sys/acpica/dist/source/include/acoutput.h Modified: vendor-sys/acpica/dist/source/include/acoutput.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acoutput.h Mon Jan 28 19:38:13 2013 (r246037) +++ vendor-sys/acpica/dist/source/include/acoutput.h Mon Jan 28 20:25:27 2013 (r246038) @@ -329,9 +329,9 @@ /* Helper macro */ -#define ACPI_TRACE_ENTRY(Name, Function, Cast, Param) \ +#define ACPI_TRACE_ENTRY(Name, Function, Type, Param) \ ACPI_FUNCTION_NAME (Name) \ - Function (ACPI_DEBUG_PARAMETERS, Cast (Param)) + Function (ACPI_DEBUG_PARAMETERS, (Type) (Param)) /* The actual entry trace macros */ @@ -340,13 +340,13 @@ AcpiUtTrace (ACPI_DEBUG_PARAMETERS) #define ACPI_FUNCTION_TRACE_PTR(Name, Pointer) \ - ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, (void *), Pointer) + ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, void *, Pointer) #define ACPI_FUNCTION_TRACE_U32(Name, Value) \ - ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, (UINT32), Value) + ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, UINT32, Value) #define ACPI_FUNCTION_TRACE_STR(Name, String) \ - ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, (char *), String) + ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, char *, String) #define ACPI_FUNCTION_ENTRY() \ AcpiUtTrackStackPtr() @@ -361,16 +361,37 @@ * * One of the FUNCTION_TRACE macros above must be used in conjunction * with these macros so that "_AcpiFunctionName" is defined. + * + * There are two versions of most of the return macros. The default version is + * safer, since it avoids side-effects by guaranteeing that the argument will + * not be evaluated twice. + * + * A less-safe version of the macros is provided for optional use if the + * compiler uses excessive CPU stack (for example, this may happen in the + * debug case if code optimzation is disabled.) */ /* Exit trace helper macro */ -#define ACPI_TRACE_EXIT(Function, Cast, Param) \ +#ifndef ACPI_SIMPLE_RETURN_MACROS + +#define ACPI_TRACE_EXIT(Function, Type, Param) \ + ACPI_DO_WHILE0 ({ \ + register Type _Param = (Type) (Param); \ + Function (ACPI_DEBUG_PARAMETERS, _Param); \ + return (_Param); \ + }) + +#else /* Use original less-safe macros */ + +#define ACPI_TRACE_EXIT(Function, Type, Param) \ ACPI_DO_WHILE0 ({ \ - Function (ACPI_DEBUG_PARAMETERS, Cast (Param)); \ - return ((Param)); \ + Function (ACPI_DEBUG_PARAMETERS, (Type) (Param)); \ + return (Param); \ }) +#endif /* ACPI_SIMPLE_RETURN_MACROS */ + /* The actual exit macros */ #define return_VOID \ @@ -380,13 +401,13 @@ }) #define return_ACPI_STATUS(Status) \ - ACPI_TRACE_EXIT (AcpiUtStatusExit, (ACPI_STATUS), Status) + ACPI_TRACE_EXIT (AcpiUtStatusExit, ACPI_STATUS, Status) #define return_PTR(Pointer) \ - ACPI_TRACE_EXIT (AcpiUtPtrExit, (UINT8 *), Pointer) + ACPI_TRACE_EXIT (AcpiUtPtrExit, void *, Pointer) #define return_VALUE(Value) \ - ACPI_TRACE_EXIT (AcpiUtValueExit, (UINT64), Value) + ACPI_TRACE_EXIT (AcpiUtValueExit, UINT64, Value) /* Conditional execution */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 20:33:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EB1FEA60; Mon, 28 Jan 2013 20:33:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D1F759C8; Mon, 28 Jan 2013 20:33:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SKXWhg009368; Mon, 28 Jan 2013 20:33:32 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SKXWBc009365; Mon, 28 Jan 2013 20:33:32 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201301282033.r0SKXWBc009365@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 28 Jan 2013 20:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246039 - in vendor-sys/acpica/dist/source: components/utilities include X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 20:33:33 -0000 Author: jkim Date: Mon Jan 28 20:33:31 2013 New Revision: 246039 URL: http://svnweb.freebsd.org/changeset/base/246039 Log: Fix a long standing bug. NextObject is the first field for very long time. Modified: vendor-sys/acpica/dist/source/components/utilities/utcache.c vendor-sys/acpica/dist/source/include/acmacros.h vendor-sys/acpica/dist/source/include/actypes.h Modified: vendor-sys/acpica/dist/source/components/utilities/utcache.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utcache.c Mon Jan 28 20:25:27 2013 (r246038) +++ vendor-sys/acpica/dist/source/components/utilities/utcache.c Mon Jan 28 20:33:31 2013 (r246039) @@ -95,7 +95,6 @@ AcpiOsCreateCache ( /* Populate the cache object and return it */ ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST)); - Cache->LinkOffset = 8; Cache->ListName = CacheName; Cache->ObjectSize = ObjectSize; Cache->MaxDepth = MaxDepth; @@ -121,7 +120,7 @@ ACPI_STATUS AcpiOsPurgeCache ( ACPI_MEMORY_LIST *Cache) { - char *Next; + void *Next; ACPI_STATUS Status; @@ -145,8 +144,7 @@ AcpiOsPurgeCache ( { /* Delete and unlink one cached state object */ - Next = *(ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Cache->ListHead)[Cache->LinkOffset]))); + Next = ACPI_GET_DESCRIPTOR_PTR (Cache->ListHead); ACPI_FREE (Cache->ListHead); Cache->ListHead = Next; @@ -251,8 +249,7 @@ AcpiOsReleaseObject ( /* Put the object at the head of the cache list */ - * (ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Object)[Cache->LinkOffset]))) = Cache->ListHead; + ACPI_SET_DESCRIPTOR_PTR (Object, Cache->ListHead); Cache->ListHead = Object; Cache->CurrentDepth++; @@ -307,8 +304,7 @@ AcpiOsAcquireObject ( /* There is an object available, use it */ Object = Cache->ListHead; - Cache->ListHead = *(ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Object)[Cache->LinkOffset]))); + Cache->ListHead = ACPI_GET_DESCRIPTOR_PTR (Object); Cache->CurrentDepth--; Modified: vendor-sys/acpica/dist/source/include/acmacros.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acmacros.h Mon Jan 28 20:25:27 2013 (r246038) +++ vendor-sys/acpica/dist/source/include/acmacros.h Mon Jan 28 20:33:31 2013 (r246039) @@ -325,10 +325,12 @@ * where a pointer to an object of type ACPI_OPERAND_OBJECT can also * appear. This macro is used to distinguish them. * - * The "Descriptor" field is the first field in both structures. + * The "DescriptorType" field is the second field in both structures. */ +#define ACPI_GET_DESCRIPTOR_PTR(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer) +#define ACPI_SET_DESCRIPTOR_PTR(d, p) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer = (p)) #define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType) -#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = t) +#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = (t)) /* * Macros for the master AML opcode table Modified: vendor-sys/acpica/dist/source/include/actypes.h ============================================================================== --- vendor-sys/acpica/dist/source/include/actypes.h Mon Jan 28 20:25:27 2013 (r246038) +++ vendor-sys/acpica/dist/source/include/actypes.h Mon Jan 28 20:33:31 2013 (r246039) @@ -1226,7 +1226,6 @@ typedef struct acpi_memory_list UINT16 ObjectSize; UINT16 MaxDepth; UINT16 CurrentDepth; - UINT16 LinkOffset; #ifdef ACPI_DBG_TRACK_ALLOCATIONS From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 20:37:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 96870CA9; Mon, 28 Jan 2013 20:37:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FB289FC; Mon, 28 Jan 2013 20:37:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SKbXTM009926; Mon, 28 Jan 2013 20:37:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SKbWC5009922; Mon, 28 Jan 2013 20:37:32 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201301282037.r0SKbWC5009922@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 28 Jan 2013 20:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246040 - in head/sys/contrib/dev/acpica: components/utilities include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 20:37:33 -0000 Author: jkim Date: Mon Jan 28 20:37:32 2013 New Revision: 246040 URL: http://svnweb.freebsd.org/changeset/base/246040 Log: Merge two bug fixes from the vendor branch. Reported by: pjd Modified: head/sys/contrib/dev/acpica/components/utilities/utcache.c head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/actypes.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/components/utilities/utcache.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/utcache.c Mon Jan 28 20:33:31 2013 (r246039) +++ head/sys/contrib/dev/acpica/components/utilities/utcache.c Mon Jan 28 20:37:32 2013 (r246040) @@ -95,7 +95,6 @@ AcpiOsCreateCache ( /* Populate the cache object and return it */ ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST)); - Cache->LinkOffset = 8; Cache->ListName = CacheName; Cache->ObjectSize = ObjectSize; Cache->MaxDepth = MaxDepth; @@ -121,7 +120,7 @@ ACPI_STATUS AcpiOsPurgeCache ( ACPI_MEMORY_LIST *Cache) { - char *Next; + void *Next; ACPI_STATUS Status; @@ -145,8 +144,7 @@ AcpiOsPurgeCache ( { /* Delete and unlink one cached state object */ - Next = *(ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Cache->ListHead)[Cache->LinkOffset]))); + Next = ACPI_GET_DESCRIPTOR_PTR (Cache->ListHead); ACPI_FREE (Cache->ListHead); Cache->ListHead = Next; @@ -251,8 +249,7 @@ AcpiOsReleaseObject ( /* Put the object at the head of the cache list */ - * (ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Object)[Cache->LinkOffset]))) = Cache->ListHead; + ACPI_SET_DESCRIPTOR_PTR (Object, Cache->ListHead); Cache->ListHead = Object; Cache->CurrentDepth++; @@ -307,8 +304,7 @@ AcpiOsAcquireObject ( /* There is an object available, use it */ Object = Cache->ListHead; - Cache->ListHead = *(ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Object)[Cache->LinkOffset]))); + Cache->ListHead = ACPI_GET_DESCRIPTOR_PTR (Object); Cache->CurrentDepth--; Modified: head/sys/contrib/dev/acpica/include/acmacros.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acmacros.h Mon Jan 28 20:33:31 2013 (r246039) +++ head/sys/contrib/dev/acpica/include/acmacros.h Mon Jan 28 20:37:32 2013 (r246040) @@ -325,10 +325,12 @@ * where a pointer to an object of type ACPI_OPERAND_OBJECT can also * appear. This macro is used to distinguish them. * - * The "Descriptor" field is the first field in both structures. + * The "DescriptorType" field is the second field in both structures. */ +#define ACPI_GET_DESCRIPTOR_PTR(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer) +#define ACPI_SET_DESCRIPTOR_PTR(d, p) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer = (p)) #define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType) -#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = t) +#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = (t)) /* * Macros for the master AML opcode table Modified: head/sys/contrib/dev/acpica/include/acoutput.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acoutput.h Mon Jan 28 20:33:31 2013 (r246039) +++ head/sys/contrib/dev/acpica/include/acoutput.h Mon Jan 28 20:37:32 2013 (r246040) @@ -329,9 +329,9 @@ /* Helper macro */ -#define ACPI_TRACE_ENTRY(Name, Function, Cast, Param) \ +#define ACPI_TRACE_ENTRY(Name, Function, Type, Param) \ ACPI_FUNCTION_NAME (Name) \ - Function (ACPI_DEBUG_PARAMETERS, Cast (Param)) + Function (ACPI_DEBUG_PARAMETERS, (Type) (Param)) /* The actual entry trace macros */ @@ -340,13 +340,13 @@ AcpiUtTrace (ACPI_DEBUG_PARAMETERS) #define ACPI_FUNCTION_TRACE_PTR(Name, Pointer) \ - ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, (void *), Pointer) + ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, void *, Pointer) #define ACPI_FUNCTION_TRACE_U32(Name, Value) \ - ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, (UINT32), Value) + ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, UINT32, Value) #define ACPI_FUNCTION_TRACE_STR(Name, String) \ - ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, (char *), String) + ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, char *, String) #define ACPI_FUNCTION_ENTRY() \ AcpiUtTrackStackPtr() @@ -361,16 +361,37 @@ * * One of the FUNCTION_TRACE macros above must be used in conjunction * with these macros so that "_AcpiFunctionName" is defined. + * + * There are two versions of most of the return macros. The default version is + * safer, since it avoids side-effects by guaranteeing that the argument will + * not be evaluated twice. + * + * A less-safe version of the macros is provided for optional use if the + * compiler uses excessive CPU stack (for example, this may happen in the + * debug case if code optimzation is disabled.) */ /* Exit trace helper macro */ -#define ACPI_TRACE_EXIT(Function, Cast, Param) \ +#ifndef ACPI_SIMPLE_RETURN_MACROS + +#define ACPI_TRACE_EXIT(Function, Type, Param) \ + ACPI_DO_WHILE0 ({ \ + register Type _Param = (Type) (Param); \ + Function (ACPI_DEBUG_PARAMETERS, _Param); \ + return (_Param); \ + }) + +#else /* Use original less-safe macros */ + +#define ACPI_TRACE_EXIT(Function, Type, Param) \ ACPI_DO_WHILE0 ({ \ - Function (ACPI_DEBUG_PARAMETERS, Cast (Param)); \ - return ((Param)); \ + Function (ACPI_DEBUG_PARAMETERS, (Type) (Param)); \ + return (Param); \ }) +#endif /* ACPI_SIMPLE_RETURN_MACROS */ + /* The actual exit macros */ #define return_VOID \ @@ -380,13 +401,13 @@ }) #define return_ACPI_STATUS(Status) \ - ACPI_TRACE_EXIT (AcpiUtStatusExit, (ACPI_STATUS), Status) + ACPI_TRACE_EXIT (AcpiUtStatusExit, ACPI_STATUS, Status) #define return_PTR(Pointer) \ - ACPI_TRACE_EXIT (AcpiUtPtrExit, (UINT8 *), Pointer) + ACPI_TRACE_EXIT (AcpiUtPtrExit, void *, Pointer) #define return_VALUE(Value) \ - ACPI_TRACE_EXIT (AcpiUtValueExit, (UINT64), Value) + ACPI_TRACE_EXIT (AcpiUtValueExit, UINT64, Value) /* Conditional execution */ Modified: head/sys/contrib/dev/acpica/include/actypes.h ============================================================================== --- head/sys/contrib/dev/acpica/include/actypes.h Mon Jan 28 20:33:31 2013 (r246039) +++ head/sys/contrib/dev/acpica/include/actypes.h Mon Jan 28 20:37:32 2013 (r246040) @@ -1226,7 +1226,6 @@ typedef struct acpi_memory_list UINT16 ObjectSize; UINT16 MaxDepth; UINT16 CurrentDepth; - UINT16 LinkOffset; #ifdef ACPI_DBG_TRACK_ALLOCATIONS From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 21:06:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 774C9221; Mon, 28 Jan 2013 21:06:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1EBB2D; Mon, 28 Jan 2013 21:06:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SL6LYI018690; Mon, 28 Jan 2013 21:06:21 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SL6K8V018688; Mon, 28 Jan 2013 21:06:20 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201301282106.r0SL6K8V018688@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 28 Jan 2013 21:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246041 - in head/sys/dev/acpica: . Osd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 21:06:21 -0000 Author: jkim Date: Mon Jan 28 21:06:20 2013 New Revision: 246041 URL: http://svnweb.freebsd.org/changeset/base/246041 Log: Fix white spaces for style consistency. Modified: head/sys/dev/acpica/Osd/OsdSchedule.c head/sys/dev/acpica/acpi_pcib.c Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Mon Jan 28 20:37:32 2013 (r246040) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Mon Jan 28 21:06:20 2013 (r246041) @@ -186,7 +186,7 @@ AcpiOsExecute(ACPI_EXECUTE_TYPE Type, AC ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); if (Function == NULL) - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS(AE_BAD_PARAMETER); switch (Type) { case OSL_GPE_HANDLER: @@ -208,10 +208,10 @@ AcpiOsExecute(ACPI_EXECUTE_TYPE Type, AC pri = 0; break; default: - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS(AE_BAD_PARAMETER); } - return_ACPI_STATUS (acpi_task_enqueue(pri, Function, Context)); + return_ACPI_STATUS(acpi_task_enqueue(pri, Function, Context)); } void Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Mon Jan 28 20:37:32 2013 (r246040) +++ head/sys/dev/acpica/acpi_pcib.c Mon Jan 28 21:06:20 2013 (r246041) @@ -129,7 +129,7 @@ prt_attach_devices(ACPI_PCI_ROUTING_TABL int acpi_pcib_attach(device_t dev, ACPI_BUFFER *prt, int busno) { - ACPI_STATUS status; + ACPI_STATUS status; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -168,7 +168,7 @@ acpi_pcib_attach(device_t dev, ACPI_BUFF */ prt_walk_table(prt, prt_attach_devices, dev); - return_VALUE (bus_generic_attach(dev)); + return_VALUE(bus_generic_attach(dev)); } static void @@ -273,7 +273,7 @@ acpi_pcib_route_interrupt(device_t pcib, out: ACPI_SERIAL_END(pcib); - return_VALUE (interrupt); + return_VALUE(interrupt); } int @@ -285,4 +285,3 @@ acpi_pcib_power_for_sleep(device_t pcib, acpi_device_pwr_for_sleep(acpi_dev, dev, pstate); return (0); } - From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 21:10:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2EBDF3D8; Mon, 28 Jan 2013 21:10:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A066B55; Mon, 28 Jan 2013 21:10:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SLAZvA019448; Mon, 28 Jan 2013 21:10:35 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SLAZQ0019446; Mon, 28 Jan 2013 21:10:35 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201301282110.r0SLAZQ0019446@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 28 Jan 2013 21:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246042 - in head/sys/dev/acpica: . Osd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 21:10:36 -0000 Author: jkim Date: Mon Jan 28 21:10:35 2013 New Revision: 246042 URL: http://svnweb.freebsd.org/changeset/base/246042 Log: Fix two misusages of return_*() macros for ACPICA. Noticed by: avg Modified: head/sys/dev/acpica/Osd/OsdSchedule.c head/sys/dev/acpica/acpi_pcib.c Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Mon Jan 28 21:06:20 2013 (r246041) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Mon Jan 28 21:10:35 2013 (r246042) @@ -181,6 +181,7 @@ ACPI_STATUS AcpiOsExecute(ACPI_EXECUTE_TYPE Type, ACPI_OSD_EXEC_CALLBACK Function, void *Context) { + ACPI_STATUS status; int pri; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -211,7 +212,8 @@ AcpiOsExecute(ACPI_EXECUTE_TYPE Type, AC return_ACPI_STATUS(AE_BAD_PARAMETER); } - return_ACPI_STATUS(acpi_task_enqueue(pri, Function, Context)); + status = acpi_task_enqueue(pri, Function, Context); + return_ACPI_STATUS(status); } void Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Mon Jan 28 21:06:20 2013 (r246041) +++ head/sys/dev/acpica/acpi_pcib.c Mon Jan 28 21:10:35 2013 (r246042) @@ -130,6 +130,7 @@ int acpi_pcib_attach(device_t dev, ACPI_BUFFER *prt, int busno) { ACPI_STATUS status; + int error; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -168,7 +169,8 @@ acpi_pcib_attach(device_t dev, ACPI_BUFF */ prt_walk_table(prt, prt_attach_devices, dev); - return_VALUE(bus_generic_attach(dev)); + error = bus_generic_attach(dev); + return_VALUE(error); } static void From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 22:50:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7565E38; Mon, 28 Jan 2013 22:50:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA15320D; Mon, 28 Jan 2013 22:50:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SMotHJ049311; Mon, 28 Jan 2013 22:50:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SMotWh049310; Mon, 28 Jan 2013 22:50:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301282250.r0SMotWh049310@svn.freebsd.org> From: Warner Losh Date: Mon, 28 Jan 2013 22:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246043 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 22:50:55 -0000 Author: imp Date: Mon Jan 28 22:50:54 2013 New Revision: 246043 URL: http://svnweb.freebsd.org/changeset/base/246043 Log: Add notes for breakage points for traditional building of the kernel as a guide to others. buildkernel, etc was not broken at these points, so document that as well. Modified: stable/9/UPDATING Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Mon Jan 28 21:10:35 2013 (r246042) +++ stable/9/UPDATING Mon Jan 28 22:50:54 2013 (r246043) @@ -35,6 +35,13 @@ Items affecting the ports and packages s Please refer to the "ZFS notes" section of this file for information on upgrading boot ZFS pools. +20121114: + The commit introducing bsd.compiler.mk breaks the traditional + building of kernels before this point. Add -m ${SRC}/share/mk + (for the right value of SRC) to your command lines to work + around; update your useland to a point after this; or use the + buildkernel/installkernel top-level targets. + 20121102: The IPFIREWALL_FORWARD kernel option has been removed. Its functionality now turned on by default. @@ -47,6 +54,12 @@ Items affecting the ports and packages s option, so the change only affects the custom kernel configurations. +20120829: + The amd64 kernel now uses xsetbv, xrstor instructions. To compile with + the traditional method, you must update your system with an installworld + before the kernel will build. The documented make buildkernel/installkernel + interfaces (coupled with fresh make kernel-toolchain) continue to work. + 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 From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 22:53:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6AE3EFAC; Mon, 28 Jan 2013 22:53:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58609223; Mon, 28 Jan 2013 22:53:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SMr95H051030; Mon, 28 Jan 2013 22:53:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SMr9wL051029; Mon, 28 Jan 2013 22:53:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301282253.r0SMr9wL051029@svn.freebsd.org> From: Warner Losh Date: Mon, 28 Jan 2013 22:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246044 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 22:53:09 -0000 Author: imp Date: Mon Jan 28 22:53:08 2013 New Revision: 246044 URL: http://svnweb.freebsd.org/changeset/base/246044 Log: Add pointer from recent breakage to old breakage. Modified: stable/9/UPDATING Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Mon Jan 28 22:50:54 2013 (r246043) +++ stable/9/UPDATING Mon Jan 28 22:53:08 2013 (r246044) @@ -40,7 +40,7 @@ Items affecting the ports and packages s building of kernels before this point. Add -m ${SRC}/share/mk (for the right value of SRC) to your command lines to work around; update your useland to a point after this; or use the - buildkernel/installkernel top-level targets. + buildkernel/installkernel top-level targets. See also 20120829. 20121102: The IPFIREWALL_FORWARD kernel option has been removed. Its From owner-svn-src-all@FreeBSD.ORG Mon Jan 28 23:16:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F571674; Mon, 28 Jan 2013 23:16:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52DFE32C; Mon, 28 Jan 2013 23:16:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0SNGmur057852; Mon, 28 Jan 2013 23:16:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0SNGl68057848; Mon, 28 Jan 2013 23:16:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301282316.r0SNGl68057848@svn.freebsd.org> From: Warner Losh Date: Mon, 28 Jan 2013 23:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246045 - stable/9/sys/dev/atkbdc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 23:16:48 -0000 Author: imp Date: Mon Jan 28 23:16:47 2013 New Revision: 246045 URL: http://svnweb.freebsd.org/changeset/base/246045 Log: MFC: r245314 and r245315: r245315 | imp | 2013-01-11 14:42:23 -0700 (Fri, 11 Jan 2013) | 4 lines Pass the device_t into atkbd_{probe,attach}_unit and get the controller unit and keyboard unit from there. It will be needed for other things in the future as well... r245314 | imp | 2013-01-11 14:19:45 -0700 (Fri, 11 Jan 2013) | 2 lines style(9) changes before I do more real changes. Modified: stable/9/sys/dev/atkbdc/atkbd.c stable/9/sys/dev/atkbdc/atkbd_atkbdc.c stable/9/sys/dev/atkbdc/atkbdreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/atkbdc/atkbd.c ============================================================================== --- stable/9/sys/dev/atkbdc/atkbd.c Mon Jan 28 22:53:08 2013 (r246044) +++ stable/9/sys/dev/atkbdc/atkbd.c Mon Jan 28 23:16:47 2013 (r246045) @@ -66,7 +66,7 @@ static timeout_t atkbd_timeout; static void atkbd_shutdown_final(void *v); int -atkbd_probe_unit(int unit, int ctlr, int irq, int flags) +atkbd_probe_unit(device_t dev, int irq, int flags) { keyboard_switch_t *sw; int args[2]; @@ -76,27 +76,29 @@ atkbd_probe_unit(int unit, int ctlr, int if (sw == NULL) return ENXIO; - args[0] = ctlr; + args[0] = device_get_unit(device_get_parent(dev)); args[1] = irq; - error = (*sw->probe)(unit, args, flags); + error = (*sw->probe)(device_get_unit(dev), args, flags); if (error) return error; return 0; } int -atkbd_attach_unit(int unit, keyboard_t **kbd, int ctlr, int irq, int flags) +atkbd_attach_unit(device_t dev, keyboard_t **kbd, int irq, int flags) { keyboard_switch_t *sw; int args[2]; int error; + int unit; sw = kbd_get_switch(ATKBD_DRIVER_NAME); if (sw == NULL) return ENXIO; /* reset, initialize and enable the device */ - args[0] = ctlr; + unit = device_get_unit(dev); + args[0] = device_get_unit(device_get_parent(dev)); args[1] = irq; *kbd = NULL; error = (*sw->probe)(unit, args, flags); @@ -401,7 +403,7 @@ atkbd_init(int unit, keyboard_t **kbdp, bcopy(&key_map, keymap, sizeof(key_map)); bcopy(&accent_map, accmap, sizeof(accent_map)); bcopy(fkey_tab, fkeymap, - imin(fkeymap_size*sizeof(fkeymap[0]), sizeof(fkey_tab))); + imin(fkeymap_size * sizeof(fkeymap[0]), sizeof(fkey_tab))); kbd_set_maps(kbd, keymap, accmap, fkeymap, fkeymap_size); kbd->kb_data = (void *)state; @@ -424,8 +426,8 @@ atkbd_init(int unit, keyboard_t **kbdp, if (!KBD_IS_INITIALIZED(kbd) && !(flags & KB_CONF_PROBE_ONLY)) { kbd->kb_config = flags & ~KB_CONF_PROBE_ONLY; if (KBD_HAS_DEVICE(kbd) - && init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config) - && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD)) { + && init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config) + && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD)) { kbd_unregister(kbd); error = ENXIO; goto bad; @@ -485,8 +487,7 @@ atkbd_intr(keyboard_t *kbd, void *arg) * The keyboard was not detected before; * it must have been reconnected! */ - init_keyboard(state->kbdc, &kbd->kb_type, - kbd->kb_config); + init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config); KBD_FOUND_DEVICE(kbd); atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state); get_typematic(kbd); @@ -645,7 +646,7 @@ next_code: goto next_code; } break; - case 0xE0: /* 0xE0 prefix */ + case 0xE0: /* 0xE0 prefix */ state->ks_prefix = 0; switch (keycode) { case 0x1C: /* right enter key */ @@ -655,57 +656,57 @@ next_code: keycode = 0x5A; break; case 0x35: /* keypad divide key */ - keycode = 0x5B; - break; + keycode = 0x5B; + break; case 0x37: /* print scrn key */ - keycode = 0x5C; - break; + keycode = 0x5C; + break; case 0x38: /* right alt key (alt gr) */ - keycode = 0x5D; - break; + keycode = 0x5D; + break; case 0x46: /* ctrl-pause/break on AT 101 (see below) */ keycode = 0x68; - break; + break; case 0x47: /* grey home key */ - keycode = 0x5E; - break; + keycode = 0x5E; + break; case 0x48: /* grey up arrow key */ - keycode = 0x5F; - break; + keycode = 0x5F; + break; case 0x49: /* grey page up key */ - keycode = 0x60; - break; + keycode = 0x60; + break; case 0x4B: /* grey left arrow key */ - keycode = 0x61; - break; + keycode = 0x61; + break; case 0x4D: /* grey right arrow key */ - keycode = 0x62; - break; + keycode = 0x62; + break; case 0x4F: /* grey end key */ - keycode = 0x63; - break; + keycode = 0x63; + break; case 0x50: /* grey down arrow key */ - keycode = 0x64; - break; + keycode = 0x64; + break; case 0x51: /* grey page down key */ - keycode = 0x65; - break; + keycode = 0x65; + break; case 0x52: /* grey insert key */ - keycode = 0x66; - break; + keycode = 0x66; + break; case 0x53: /* grey delete key */ - keycode = 0x67; - break; - /* the following 3 are only used on the MS "Natural" keyboard */ + keycode = 0x67; + break; + /* the following 3 are only used on the MS "Natural" keyboard */ case 0x5b: /* left Window key */ - keycode = 0x69; - break; + keycode = 0x69; + break; case 0x5c: /* right Window key */ - keycode = 0x6a; - break; + keycode = 0x6a; + break; case 0x5d: /* menu key */ - keycode = 0x6b; - break; + keycode = 0x6b; + break; case 0x5e: /* power key */ keycode = 0x6d; break; @@ -716,10 +717,10 @@ next_code: keycode = 0x6f; break; default: /* ignore everything else */ - goto next_code; + goto next_code; } break; - case 0xE1: /* 0xE1 prefix */ + case 0xE1: /* 0xE1 prefix */ /* * The pause/break key on the 101 keyboard produces: * E1-1D-45 E1-9D-C5 @@ -728,10 +729,10 @@ next_code: */ state->ks_prefix = 0; if (keycode == 0x1D) - state->ks_prefix = 0x1D; + state->ks_prefix = 0x1D; goto next_code; /* NOT REACHED */ - case 0x1D: /* pause / break */ + case 0x1D: /* pause / break */ state->ks_prefix = 0; if (keycode != 0x45) goto next_code; @@ -743,7 +744,7 @@ next_code: switch (keycode) { case 0x37: /* *(numpad)/print screen */ if (state->ks_flags & SHIFTS) - keycode = 0x5c; /* print screen */ + keycode = 0x5c; /* print screen */ break; case 0x45: /* num lock/pause */ if (state->ks_flags & CTLS) @@ -1177,7 +1178,7 @@ get_kbd_echo(KBDC kbdc) */ return ENXIO; } - + return 0; } @@ -1275,7 +1276,7 @@ init_keyboard(KBDC kbdc, int *type, int } if (bootverbose) printf("atkbd: the current kbd controller command byte %04x\n", - c); + c); #if 0 /* override the keyboard lock switch */ c |= KBD_OVERRIDE_KBD_LOCK; @@ -1415,52 +1416,49 @@ init_keyboard(KBDC kbdc, int *type, int static int write_kbd(KBDC kbdc, int command, int data) { - int s; + int s; - /* prevent the timeout routine from polling the keyboard */ - if (!kbdc_lock(kbdc, TRUE)) - return EBUSY; + /* prevent the timeout routine from polling the keyboard */ + if (!kbdc_lock(kbdc, TRUE)) + return EBUSY; - /* disable the keyboard and mouse interrupt */ - s = spltty(); + /* disable the keyboard and mouse interrupt */ + s = spltty(); #if 0 - c = get_controller_command_byte(kbdc); - if ((c == -1) - || !set_controller_command_byte(kbdc, - kbdc_get_device_mask(kbdc), - KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT - | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) { - /* CONTROLLER ERROR */ - kbdc_lock(kbdc, FALSE); + c = get_controller_command_byte(kbdc); + if ((c == -1) + || !set_controller_command_byte(kbdc, + kbdc_get_device_mask(kbdc), + KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT + | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) { + /* CONTROLLER ERROR */ + kbdc_lock(kbdc, FALSE); + splx(s); + return EIO; + } + /* + * Now that the keyboard controller is told not to generate + * the keyboard and mouse interrupts, call `splx()' to allow + * the other tty interrupts. The clock interrupt may also occur, + * but the timeout routine (`scrn_timer()') will be blocked + * by the lock flag set via `kbdc_lock()' + */ splx(s); - return EIO; - } - /* - * Now that the keyboard controller is told not to generate - * the keyboard and mouse interrupts, call `splx()' to allow - * the other tty interrupts. The clock interrupt may also occur, - * but the timeout routine (`scrn_timer()') will be blocked - * by the lock flag set via `kbdc_lock()' - */ - splx(s); #endif - - if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK) - send_kbd_command(kbdc, KBDC_ENABLE_KBD); - + if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK) + send_kbd_command(kbdc, KBDC_ENABLE_KBD); #if 0 - /* restore the interrupts */ - if (!set_controller_command_byte(kbdc, - kbdc_get_device_mask(kbdc), + /* restore the interrupts */ + if (!set_controller_command_byte(kbdc, kbdc_get_device_mask(kbdc), c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) { - /* CONTROLLER ERROR */ - } + /* CONTROLLER ERROR */ + } #else - splx(s); + splx(s); #endif - kbdc_lock(kbdc, FALSE); + kbdc_lock(kbdc, FALSE); - return 0; + return 0; } static int Modified: stable/9/sys/dev/atkbdc/atkbd_atkbdc.c ============================================================================== --- stable/9/sys/dev/atkbdc/atkbd_atkbdc.c Mon Jan 28 22:53:08 2013 (r246044) +++ stable/9/sys/dev/atkbdc/atkbd_atkbdc.c Mon Jan 28 23:16:47 2013 (r246045) @@ -104,9 +104,7 @@ atkbdprobe(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, rid, res); /* probe the device */ - return atkbd_probe_unit(device_get_unit(dev), - device_get_unit(device_get_parent(dev)), - irq, flags); + return atkbd_probe_unit(dev, irq, flags); } static int @@ -124,9 +122,7 @@ atkbdattach(device_t dev) rid = KBDC_RID_KBD; irq = bus_get_resource_start(dev, SYS_RES_IRQ, rid); flags = device_get_flags(dev); - error = atkbd_attach_unit(device_get_unit(dev), &kbd, - device_get_unit(device_get_parent(dev)), - irq, flags); + error = atkbd_attach_unit(dev, &kbd, irq, flags); if (error) return error; Modified: stable/9/sys/dev/atkbdc/atkbdreg.h ============================================================================== --- stable/9/sys/dev/atkbdc/atkbdreg.h Mon Jan 28 22:53:08 2013 (r246044) +++ stable/9/sys/dev/atkbdc/atkbdreg.h Mon Jan 28 23:16:47 2013 (r246045) @@ -39,9 +39,8 @@ #ifdef _KERNEL -int atkbd_probe_unit(int unit, int ctlr, int irq, int flags); -int atkbd_attach_unit(int unit, keyboard_t **kbd, - int ctlr, int irq, int flags); +int atkbd_probe_unit(device_t dev, int irq, int flags); +int atkbd_attach_unit(device_t dev, keyboard_t **kbd, int irq, int flags); #endif From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 01:44:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0D0E0BEC; Tue, 29 Jan 2013 01:44:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F179FD77; Tue, 29 Jan 2013 01:44:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0T1iEhg002297; Tue, 29 Jan 2013 01:44:14 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0T1iDvK002290; Tue, 29 Jan 2013 01:44:13 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201301290144.r0T1iDvK002290@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 29 Jan 2013 01:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246049 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 01:44:15 -0000 Author: pfg Date: Tue Jan 29 01:44:13 2013 New Revision: 246049 URL: http://svnweb.freebsd.org/changeset/base/246049 Log: MFC r245820, r245844, r245950: ext2fs: make some inode fields match the ext2 spec. Ext2fs uses unsigned fields in its dinode struct. FreeBSD can have negative values in some of those fields and the inode is meant to interact with the system so we have never respected the unsigned nature of most of those fields. Block numbers and the generation number do not need to be signed so redefine them as unsigned to better match the on-disk information. Include some fixes proposed by bde@. While here add a lot of svn mergeinfo that was missing in /sys: r239963,240060,240880,241007,241141,241143,241181,243641, 243652,244475,245121,245612,245817 Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c stable/9/sys/fs/ext2fs/ext2_balloc.c stable/9/sys/fs/ext2fs/ext2_inode.c stable/9/sys/fs/ext2fs/inode.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_alloc.c Tue Jan 29 00:11:21 2013 (r246048) +++ stable/9/sys/fs/ext2fs/ext2_alloc.c Tue Jan 29 01:44:13 2013 (r246049) @@ -169,7 +169,7 @@ ext2_reallocblks(ap) struct inode *ip; struct vnode *vp; struct buf *sbp, *ebp; - int32_t *bap, *sbap, *ebap = 0; + uint32_t *bap, *sbap, *ebap = 0; struct ext2mount *ump; struct cluster_save *buflist; struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp; Modified: stable/9/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_balloc.c Tue Jan 29 00:11:21 2013 (r246048) +++ stable/9/sys/fs/ext2fs/ext2_balloc.c Tue Jan 29 01:44:13 2013 (r246049) @@ -69,7 +69,7 @@ ext2_balloc(ip, lbn, size, cred, bpp, fl struct buf *bp, *nbp; struct vnode *vp = ITOV(ip); struct indir indirs[NIADDR + 2]; - int32_t newb, *bap, pref; + uint32_t newb, *bap, pref; int osize, nsize, num, i, error; *bpp = NULL; Modified: stable/9/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_inode.c Tue Jan 29 00:11:21 2013 (r246048) +++ stable/9/sys/fs/ext2fs/ext2_inode.c Tue Jan 29 01:44:13 2013 (r246049) @@ -119,7 +119,7 @@ ext2_truncate(vp, length, flags, cred, t int32_t lastblock; struct inode *oip; int32_t bn, lbn, lastiblock[NIADDR], indir_lbn[NIADDR]; - int32_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; + uint32_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; struct bufobj *bo; struct m_ext2fs *fs; struct buf *bp; @@ -341,8 +341,9 @@ done: * Put back the real size. */ oip->i_size = length; - oip->i_blocks -= blocksreleased; - if (oip->i_blocks < 0) /* sanity */ + if (oip->i_blocks >= blocksreleased) + oip->i_blocks -= blocksreleased; + else /* sanity */ oip->i_blocks = 0; oip->i_flag |= IN_CHANGE; vnode_pager_setsize(ovp, length); Modified: stable/9/sys/fs/ext2fs/inode.h ============================================================================== --- stable/9/sys/fs/ext2fs/inode.h Tue Jan 29 00:11:21 2013 (r246048) +++ stable/9/sys/fs/ext2fs/inode.h Tue Jan 29 01:44:13 2013 (r246049) @@ -90,11 +90,11 @@ struct inode { int32_t i_atimensec; /* Last access time. */ int32_t i_ctimensec; /* Last inode change time. */ int32_t i_birthnsec; /* Inode creation time. */ - int32_t i_db[NDADDR]; /* Direct disk blocks. */ - int32_t i_ib[NIADDR]; /* Indirect disk blocks. */ + uint32_t i_db[NDADDR]; /* Direct disk blocks. */ + uint32_t i_ib[NIADDR]; /* Indirect disk blocks. */ uint32_t i_flags; /* Status flags (chflags). */ - int32_t i_blocks; /* Blocks actually held. */ - int32_t i_gen; /* Generation number. */ + uint32_t i_blocks; /* Blocks actually held. */ + uint32_t i_gen; /* Generation number. */ uint32_t i_uid; /* File owner. */ uint32_t i_gid; /* File group. */ }; @@ -163,7 +163,7 @@ struct ufid { uint16_t ufid_len; /* Length of structure. */ uint16_t ufid_pad; /* Force 32-bit alignment. */ ino_t ufid_ino; /* File number (ino). */ - int32_t ufid_gen; /* Generation number. */ + uint32_t ufid_gen; /* Generation number. */ }; #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 07:21:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A071E10D; Tue, 29 Jan 2013 07:21:51 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8242FBFD; Tue, 29 Jan 2013 07:21:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0T7LpBf004227; Tue, 29 Jan 2013 07:21:51 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0T7Lo0u004219; Tue, 29 Jan 2013 07:21:50 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201301290721.r0T7Lo0u004219@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 29 Jan 2013 07:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246057 - in head/sys: arm/allwinner arm/conf boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 07:21:51 -0000 Author: ganbold (doc committer) Date: Tue Jan 29 07:21:50 2013 New Revision: 246057 URL: http://svnweb.freebsd.org/changeset/base/246057 Log: Add simple clock driver and ehci glue code for a10 Update dts and kernel config Approved by: gonzo@ Added: head/sys/arm/allwinner/a10_clk.c (contents, props changed) head/sys/arm/allwinner/a10_clk.h (contents, props changed) head/sys/arm/allwinner/a10_ehci.c (contents, props changed) Modified: head/sys/arm/allwinner/files.a10 head/sys/arm/conf/CUBIEBOARD head/sys/boot/fdt/dts/cubieboard.dts Added: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_clk.c Tue Jan 29 07:21:50 2013 (r246057) @@ -0,0 +1,171 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * 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. + */ + +/* Simple clock driver for Allwinner A10 */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "a10_clk.h" + +struct a10_ccm_softc { + struct resource *res; + bus_space_tag_t bst; + bus_space_handle_t bsh; +}; + +static struct a10_ccm_softc *a10_ccm_sc = NULL; + +#define ccm_read_4(reg) \ + bus_space_read_4(a10_ccm_sc->bst, a10_ccm_sc->bsh, reg) +#define ccm_write_4(reg, val) \ + bus_space_write_4(a10_ccm_sc->bst, a10_ccm_sc->bsh, reg, val) + +static int +a10_ccm_probe(device_t dev) +{ + if (ofw_bus_is_compatible(dev, "allwinner,sun4i-ccm")) { + device_set_desc(dev, "Allwinner Clock Control Module"); + return(BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +a10_ccm_attach(device_t dev) +{ + struct a10_ccm_softc *sc = device_get_softc(dev); + int rid = 0; + + if (a10_ccm_sc) + return (ENXIO); + + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!sc->res) { + device_printf(dev, "could not allocate resource\n"); + return (ENXIO); + } + + sc->bst = rman_get_bustag(sc->res); + sc->bsh = rman_get_bushandle(sc->res); + + a10_ccm_sc = sc; + + return (0); +} + +static device_method_t a10_ccm_methods[] = { + DEVMETHOD(device_probe, a10_ccm_probe), + DEVMETHOD(device_attach, a10_ccm_attach), + { 0, 0 } +}; + +static driver_t a10_ccm_driver = { + "a10_ccm", + a10_ccm_methods, + sizeof(struct a10_ccm_softc), +}; + +static devclass_t a10_ccm_devclass; + +DRIVER_MODULE(a10_ccm, simplebus, a10_ccm_driver, a10_ccm_devclass, 0, 0); + +int +a10_clk_usb_activate(void) +{ + struct a10_ccm_softc *sc = a10_ccm_sc; + uint32_t reg_value = 0; + + if (sc == NULL) + return ENXIO; + + /* Gating AHB clock for USB */ + reg_value = ccm_read_4(CCM_AHB_GATING0); + reg_value |= CCM_AHB_GATING_USB0; /* AHB clock gate usb0 */ + reg_value |= CCM_AHB_GATING_EHCI1; /* AHB clock gate ehci1 */ + ccm_write_4(CCM_AHB_GATING0, reg_value); + + /* Enable clock for USB */ + reg_value = ccm_read_4(CCM_USB_CLK); + reg_value |= CCM_USB_PHY; /* USBPHY */ + reg_value |= CCM_USB0_RESET; /* disable reset for USB0 */ + reg_value |= CCM_USB1_RESET; /* disable reset for USB1 */ + reg_value |= CCM_USB2_RESET; /* disable reset for USB2 */ + ccm_write_4(CCM_USB_CLK, reg_value); + + return (0); +} + +int +a10_clk_usb_deactivate(void) +{ + struct a10_ccm_softc *sc = a10_ccm_sc; + uint32_t reg_value = 0; + + if (sc == NULL) + return ENXIO; + + /* Disable clock for USB */ + reg_value = ccm_read_4(CCM_USB_CLK); + reg_value &= ~CCM_USB_PHY; /* USBPHY */ + reg_value &= ~CCM_USB0_RESET; /* reset for USB0 */ + reg_value &= ~CCM_USB1_RESET; /* reset for USB1 */ + reg_value &= ~CCM_USB2_RESET; /* reset for USB2 */ + ccm_write_4(CCM_USB_CLK, reg_value); + + /* Disable gating AHB clock for USB */ + reg_value = ccm_read_4(CCM_AHB_GATING0); + reg_value &= ~CCM_AHB_GATING_USB0; /* disable AHB clock gate usb0 */ + reg_value &= ~CCM_AHB_GATING_EHCI1; /* disable AHB clock gate ehci1 */ + ccm_write_4(CCM_AHB_GATING0, reg_value); + + return (0); +} + Added: head/sys/arm/allwinner/a10_clk.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_clk.h Tue Jan 29 07:21:50 2013 (r246057) @@ -0,0 +1,114 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _A10_CLK_H_ +#define _A10_CLK_H_ + +#define CCMU_BASE 0xe1c20000 + +#define CCM_PLL1_CFG 0x0000 +#define CCM_PLL1_TUN 0x0004 +#define CCM_PLL2_CFG 0x0008 +#define CCM_PLL2_TUN 0x000c +#define CCM_PLL3_CFG 0x0010 +#define CCM_PLL3_TUN 0x0014 +#define CCM_PLL4_CFG 0x0018 +#define CCM_PLL4_TUN 0x001c +#define CCM_PLL5_CFG 0x0020 +#define CCM_PLL5_TUN 0x0024 +#define CCM_PLL6_CFG 0x0028 +#define CCM_PLL6_TUN 0x002c +#define CCM_PLL7_CFG 0x0030 +#define CCM_PLL7_TUN 0x0034 +#define CCM_PLL1_TUN2 0x0038 +#define CCM_PLL5_TUN2 0x003c +#define CCM_PLL_LOCK_DBG 0x004c +#define CCM_OSC24M_CFG 0x0050 +#define CCM_CPU_AHB_APB0_CFG 0x0054 +#define CCM_APB1_CLK_DIV 0x0058 +#define CCM_AXI_GATING 0x005c +#define CCM_AHB_GATING0 0x0060 +#define CCM_AHB_GATING1 0x0064 +#define CCM_APB0_GATING 0x0068 +#define CCM_APB1_GATING 0x006c +#define CCM_NAND_SCLK_CFG 0x0080 +#define CCM_MS_SCLK_CFG 0x0084 +#define CCM_MMC0_SCLK_CFG 0x0088 +#define CCM_MMC1_SCLK_CFG 0x008c +#define CCM_MMC2_SCLK_CFG 0x0090 +#define CCM_MMC3_SCLK_CFG 0x0094 +#define CCM_TS_CLK 0x0098 +#define CCM_SS_CLK 0x009c +#define CCM_SPI0_CLK 0x00a0 +#define CCM_SPI1_CLK 0x00a4 +#define CCM_SPI2_CLK 0x00a8 +#define CCM_PATA_CLK 0x00ac +#define CCM_IR0_CLK 0x00b0 +#define CCM_IR1_CLK 0x00b4 +#define CCM_IIS_CLK 0x00b8 +#define CCM_AC97_CLK 0x00bc +#define CCM_SPDIF_CLK 0x00c0 +#define CCM_KEYPAD_CLK 0x00c4 +#define CCM_SATA_CLK 0x00c8 +#define CCM_USB_CLK 0x00cc +#define CCM_GPS_CLK 0x00d0 +#define CCM_SPI3_CLK 0x00d4 +#define CCM_DRAM_CLK 0x0100 +#define CCM_BE0_SCLK 0x0104 +#define CCM_BE1_SCLK 0x0108 +#define CCM_FE0_CLK 0x010c +#define CCM_FE1_CLK 0x0110 +#define CCM_MP_CLK 0x0114 +#define CCM_LCD0_CH0_CLK 0x0118 +#define CCM_LCD1_CH0_CLK 0x011c +#define CCM_CSI_ISP_CLK 0x0120 +#define CCM_TVD_CLK 0x0128 +#define CCM_LCD0_CH1_CLK 0x012c +#define CCM_LCD1_CH1_CLK 0x0130 +#define CCM_CS0_CLK 0x0134 +#define CCM_CS1_CLK 0x0138 +#define CCM_VE_CLK 0x013c +#define CCM_AUDIO_CODEC_CLK 0x0140 +#define CCM_AVS_CLK 0x0144 +#define CCM_ACE_CLK 0x0148 +#define CCM_LVDS_CLK 0x014c +#define CCM_HDMI_CLK 0x0150 +#define CCM_MALI400_CLK 0x0154 + +#define CCM_AHB_GATING_USB0 (1 << 0) +#define CCM_AHB_GATING_EHCI1 (1 << 3) + +#define CCM_USB_PHY (1 << 8) +#define CCM_USB0_RESET (1 << 0) +#define CCM_USB1_RESET (1 << 1) +#define CCM_USB2_RESET (1 << 2) + +int a10_clk_usb_activate(void); +int a10_clk_usb_deactivate(void); + +#endif /* _A10_CLK_H_ */ Added: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_ehci.c Tue Jan 29 07:21:50 2013 (r246057) @@ -0,0 +1,279 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu + * 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. + */ + +/* + * Allwinner A10 attachment driver for the USB Enhanced Host Controller. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "a10_clk.h" + +#define EHCI_HC_DEVSTR "Allwinner Integrated USB 2.0 controller" + +#define SW_USB_PMU_IRQ_ENABLE 0x800 + +#define SW_SDRAM_REG_HPCR_USB1 (0x250 + ((1 << 2) * 4)) +#define SW_SDRAM_REG_HPCR_USB2 (0x250 + ((1 << 2) * 5)) +#define SW_SDRAM_BP_HPCR_ACCESS (1 << 0) + +#define SW_ULPI_BYPASS (1 << 0) +#define SW_AHB_INCRX_ALIGN (1 << 8) +#define SW_AHB_INCR4 (1 << 9) +#define SW_AHB_INCR8 (1 << 10) + +#define A10_READ_4(sc, reg) \ + bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg) + +#define A10_WRITE_4(sc, reg, data) \ + bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data) + +static device_attach_t a10_ehci_attach; +static device_detach_t a10_ehci_detach; + +bs_r_1_proto(reversed); +bs_w_1_proto(reversed); + +static int +a10_ehci_probe(device_t self) +{ + if (!ofw_bus_is_compatible(self, "allwinner,usb-ehci")) + return (ENXIO); + + device_set_desc(self, EHCI_HC_DEVSTR); + + return (BUS_PROBE_DEFAULT); +} + +static int +a10_ehci_attach(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + bus_space_handle_t bsh; + int err; + int rid; + uint32_t reg_value = 0; + + /* initialise some bus fields */ + sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { + return (ENOMEM); + } + + sc->sc_bus.usbrev = USB_REV_2_0; + + rid = 0; + sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!sc->sc_io_res) { + device_printf(self, "Could not map memory\n"); + goto error; + } + + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + bsh = rman_get_bushandle(sc->sc_io_res); + + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + if (bus_space_subregion(sc->sc_io_tag, bsh, 0x00, + sc->sc_io_size, &sc->sc_io_hdl) != 0) + panic("%s: unable to subregion USB host registers", + device_get_name(self)); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + device_printf(self, "Could not allocate irq\n"); + goto error; + } + sc->sc_bus.bdev = device_add_child(self, "usbus", -1); + if (!sc->sc_bus.bdev) { + device_printf(self, "Could not add USB device\n"); + goto error; + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + device_set_desc(sc->sc_bus.bdev, EHCI_HC_DEVSTR); + + sprintf(sc->sc_vendor, "Allwinner"); + + err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + device_printf(self, "Could not setup irq, %d\n", err); + sc->sc_intr_hdl = NULL; + goto error; + } + + sc->sc_flags |= EHCI_SCFLG_DONTRESET; + + /* Enable clock for USB */ + a10_clk_usb_activate(); + + /* Enable passby */ + reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); + reg_value |= SW_AHB_INCR8; /* AHB INCR8 enable */ + reg_value |= SW_AHB_INCR4; /* AHB burst type INCR4 enable */ + reg_value |= SW_AHB_INCRX_ALIGN; /* AHB INCRX align enable */ + reg_value |= SW_ULPI_BYPASS; /* ULPI bypass enable */ + A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value); + + /* Configure port */ + reg_value = A10_READ_4(sc, SW_SDRAM_REG_HPCR_USB2); + reg_value |= SW_SDRAM_BP_HPCR_ACCESS; + A10_WRITE_4(sc, SW_SDRAM_REG_HPCR_USB2, reg_value); + + err = ehci_init(sc); + if (!err) { + err = device_probe_and_attach(sc->sc_bus.bdev); + } + if (err) { + device_printf(self, "USB init failed err=%d\n", err); + goto error; + } + return (0); + +error: + a10_ehci_detach(self); + return (ENXIO); +} + +static int +a10_ehci_detach(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + device_t bdev; + int err; + uint32_t reg_value = 0; + + if (sc->sc_bus.bdev) { + bdev = sc->sc_bus.bdev; + device_detach(bdev); + device_delete_child(self, bdev); + } + /* during module unload there are lots of children leftover */ + device_delete_children(self); + + if (sc->sc_irq_res && sc->sc_intr_hdl) { + /* + * only call ehci_detach() after ehci_init() + */ + ehci_detach(sc); + + err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); + + if (err) + /* XXX or should we panic? */ + device_printf(self, "Could not tear down irq, %d\n", + err); + sc->sc_intr_hdl = NULL; + } + + if (sc->sc_irq_res) { + bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + if (sc->sc_io_res) { + bus_release_resource(self, SYS_RES_MEMORY, 0, + sc->sc_io_res); + sc->sc_io_res = NULL; + } + usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); + + /* Disable configure port */ + reg_value = A10_READ_4(sc, SW_SDRAM_REG_HPCR_USB2); + reg_value &= ~SW_SDRAM_BP_HPCR_ACCESS; + A10_WRITE_4(sc, SW_SDRAM_REG_HPCR_USB2, reg_value); + + /* Disable passby */ + reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); + reg_value &= ~SW_AHB_INCR8; /* AHB INCR8 disable */ + reg_value &= ~SW_AHB_INCR4; /* AHB burst type INCR4 disable */ + reg_value &= ~SW_AHB_INCRX_ALIGN; /* AHB INCRX align disable */ + reg_value &= ~SW_ULPI_BYPASS; /* ULPI bypass disable */ + A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value); + + /* Disable clock for USB */ + a10_clk_usb_deactivate(); + + return (0); +} + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, a10_ehci_probe), + DEVMETHOD(device_attach, a10_ehci_attach), + DEVMETHOD(device_detach, a10_ehci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t ehci_driver = { + .name = "ehci", + .methods = ehci_methods, + .size = sizeof(ehci_softc_t), +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); Modified: head/sys/arm/allwinner/files.a10 ============================================================================== --- head/sys/arm/allwinner/files.a10 Tue Jan 29 04:03:15 2013 (r246056) +++ head/sys/arm/allwinner/files.a10 Tue Jan 29 07:21:50 2013 (r246057) @@ -9,6 +9,8 @@ arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard arm/arm/irq_dispatch.S standard +arm/allwinner/a10_clk.c standard +arm/allwinner/a10_ehci.c optional ehci arm/allwinner/timer.c standard arm/allwinner/aintc.c standard arm/allwinner/bus_space.c standard Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Tue Jan 29 04:03:15 2013 (r246056) +++ head/sys/arm/conf/CUBIEBOARD Tue Jan 29 07:21:50 2013 (r246057) @@ -78,7 +78,7 @@ options WITNESS_SKIPSPIN #Don't run wit #device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -#options ROOTDEVNAME=\"ufs:/dev/da0s2\" +options ROOTDEVNAME=\"ufs:/dev/da0s2\" # ATA controllers #device ahci # AHCI-compatible SATA controllers @@ -106,15 +106,15 @@ device da # Direct Access (disks) device pass # USB support -#device usb -#options USB_DEBUG +device usb +options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE #device uhci #device ohci -#device ehci +device ehci -#device umass +device umass # Ethernet device loop Modified: head/sys/boot/fdt/dts/cubieboard.dts ============================================================================== --- head/sys/boot/fdt/dts/cubieboard.dts Tue Jan 29 04:03:15 2013 (r246056) +++ head/sys/boot/fdt/dts/cubieboard.dts Tue Jan 29 07:21:50 2013 (r246057) @@ -61,6 +61,13 @@ reg = < 0x01c20400 0x400 >; }; + ccm@01c20000 { + compatible = "allwinner,sun4i-ccm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c20000 0x400 >; + }; + timer@01c20c00 { compatible = "allwinner,sun4i-timer"; reg = <0x01c20c00 0x90>; From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 12:12:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 516DD6D2 for ; Tue, 29 Jan 2013 12:12:00 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-la0-x232.google.com (la-in-x0232.1e100.net [IPv6:2a00:1450:4010:c03::232]) by mx1.freebsd.org (Postfix) with ESMTP id 91AD97BD for ; Tue, 29 Jan 2013 12:11:59 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id ec20so232127lab.37 for ; Tue, 29 Jan 2013 04:11:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received: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=Xqcw4PsQRllbNAmNcwLDP4/dybA82ik8gUFyX1co+jY=; b=l/DOG/VnPYo2CEvQaegGpltCGJyxuWuhpcnaDvT7at3kYRTQk5EF+wAZr27PPFOkp9 QDh6Vu0/Pn3q3G2FPlm8NixnLO1Ad9P8uRuTpjzwTwoflhrKWYJA4gAl3BfujBCFJLfr 4yjxzJ+Q2r+GNGBRFy1I1oEsyMlAGUttbeaP8WZEx10lJTA1toBx2ySz5SB/Lfu6fYtN cDH1JUXJKWSeg05g8raFwguBFsfbYgHrs5V92t1PDiLjAVh2TloeSDcNX+CxHcl0ZjjC YiTVLAHUV9R7Bopaetaiil+Z7ZOuFalcdUHPjFlYdiTCWS/x7nCd3L3oC/a1xJjaSs6j 6mhQ== X-Received: by 10.152.109.146 with SMTP id hs18mr961823lab.8.1359461518364; Tue, 29 Jan 2013 04:11:58 -0800 (PST) Received: from dhcp170-82-red.yandex.net (dhcp170-82-red.yandex.net. [95.108.170.82]) by mx.google.com with ESMTPS id gt13sm4897411lab.14.2013.01.29.04.11.56 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Jan 2013 04:11:57 -0800 (PST) Sender: Andrey Zonov Message-ID: <5107BC87.4080403@FreeBSD.org> Date: Tue, 29 Jan 2013 16:11:51 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r246033 - head/usr.bin/systat References: <201301281257.r0SCvhhv071414@svn.freebsd.org> <20130129003913.G2698@besplex.bde.org> In-Reply-To: <20130129003913.G2698@besplex.bde.org> X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2DFWENKBPTLSKWUVBVGUD" X-Gm-Message-State: ALoCoQk6hhjfTU8IZT/9eWJbZYPI95H6Dayqn0FWJShc7HpHP87UnQGP47tStEJ4lZOLYDZclVom Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 12:12:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2DFWENKBPTLSKWUVBVGUD Content-Type: multipart/mixed; boundary="------------060109070406000801030708" This is a multi-part message in MIME format. --------------060109070406000801030708 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 1/28/13 6:51 PM, Bruce Evans wrote: > On Mon, 28 Jan 2013, Andrey Zonov wrote: >=20 >> Log: >> - Show page faults requiring I/O on vmstat display. >=20 > No space is available there for showing it. >=20 Yep, you're right. >> Modified: head/usr.bin/systat/vmstat.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> >> --- head/usr.bin/systat/vmstat.c Mon Jan 28 12:54:53 2013 (r2460= 32) >> +++ head/usr.bin/systat/vmstat.c Mon Jan 28 12:57:42 2013 (r2460= 33) >> @@ -324,24 +325,25 @@ labelkre(void) >> mvprintw(INTSROW, INTSCOL + 1, "Interrupts"); >> mvprintw(INTSROW + 1, INTSCOL + 6, "total"); >> >> - mvprintw(VMSTATROW, VMSTATCOL + 9, "cow"); >> - mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "zfod"); >> - mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "ozfod"); >> - mvprintw(VMSTATROW + 3, VMSTATCOL + 9 - 1, "%%ozfod"); >> - mvprintw(VMSTATROW + 4, VMSTATCOL + 9, "daefr"); >> - mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "prcfr"); >> - mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "totfr"); >> - mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "react"); >> - mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "pdwak"); >> - mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdpgs"); >> - mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "intrn"); >> - mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "wire"); >> - mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "act"); >> - mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "inact"); >> - mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "cache"); >> - mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "free"); >> - if (LINES - 1 > VMSTATROW + 16) >> - mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "buf"); >=20 > This is the last possible line on a 25-line display. On a 24-line > display, it is omitted so that it doesn't mangle or get mangled by the > prompt/status line. But previous lines are not specially handled, and > neither are other parts of the display. Also, the interrupt display > may reach the last line of the window, and then it interacts with the > prompt/status line even on a 25-line display. >=20 > On a 23-line display, mangling occurs as follows: > - the special case for the "buf" line has no visible effect, since > this line is outside of the window > - the free "line" and the prompt/status line are both on the last line > in the window, together with the %busy display and possibly the > interrupts display. These mangle each other, >=20 > On a 22-line display, the mangling moves up by 1 line and becomes worse= =2E > Now there seems to be a windowing bug. Some field (the "free" one) is > mispositioned, so the display becomes magled (instead of just truncated= ) > even when the prompt/status line is not used. >=20 >> + mvprintw(VMSTATROW, VMSTATCOL + 9, "ioflt"); >=20 > Putting it first unsorts the fields a bit and makes the diff large. >=20 > It is not documented in the man page. >=20 Fixed in attached systat1.patch.txt. >> + mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "cow"); >> + mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "zfod"); >> + mvprintw(VMSTATROW + 3, VMSTATCOL + 9, "ozfod"); >> + mvprintw(VMSTATROW + 4, VMSTATCOL + 9 - 1, "%%ozfod"); >> + mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "daefr"); >> + mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "prcfr"); >> + mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "totfr"); >> + mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "react"); >> + mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdwak"); >> + mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "pdpgs"); >> + mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "intrn"); >> + mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "wire"); >> + mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "act"); >> + mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "inact"); >> + mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "cache"); >> + mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "free"); >> + if (LINES - 1 > VMSTATROW + 17) >> + mvprintw(VMSTATROW + 17, VMSTATCOL + 9, "buf"); >=20 > Adding a field at the top pushes the "buf" field to the last line of > the window in the most common case of a 25-line display, and makes its > special case useless except for 26-line displays, so mangling from the > "buf" line now occurs in the most common case. >=20 > It moves the problems for 22-24 line displays to 23-25 line displays, > respectively. Now it is the "free" field that needs the special handli= ng > to avoid mangling in the nextmost common case of 24-line displays. Eve= n > more seriously, the "free" field is much more interesting than the "buf= " > field, so we don't want to lose it or have it mangled in a common case.= > The "buf" field really belongs in another group of fields (before "dtbu= f") > but is spaced where it is since there is no free space near "dtbuf" but= > just 1 line of free space (in the most common case) in the vmmeter fiel= ds > column ("buf" also isn't a vmmeter field so it doesn't belong there). = But > now there are 0 lines of free space there. >=20 > Since systat output barely works with screen depths other than 24 and > 25 lines, omitting the "buf" field after moving its special case to the= > "free" field and moving some less important field than "free" to the > end would be the simplest fix. >=20 > The "buf" field is worse than useless because it is just the constant > limit on the amount of virtual memory for buffers (nbuf * BKVASIZE). > It is not merely useless, since it wastes space and confuses users > into thinking that it is useful. top(1) prints it too. In other OS's > top(1) prints something related to buffer resources that is actually > useful. The related usful values in FreeBSD are the non-constant > amount of physical memory mapped to buffers and to a lesser extent the > non-constant amount of virtual memory mapped to buffers. These are > not directly available. Also the amount of malloced memory pointed > to by buffers (available in vfs.bufmallocspace), and the amount of > disk space cached in VMIO buffers (not directly available, buf "inact" > often approximates it). But there is no space for these. >=20 > "buf" is even more useless with zfs. So are some of the other fields > printed by systat and top. I think zfs has its own statistics programs= , > but it would be especially difficult to combine these with systat > statistics see the combined resource usage if both zfs and file systems= > using the buffer cache/VMIO are active. >=20 I totally agree with you, 'buf' should go away from systat and top. I removed 'buf' from systat. Please review systat2.patch.txt. To count 'disk cache' we have to add new counter which should track all pages with OBJT_VNODE type. It doesn't look hard to implement this. I wrote utility [1] which allows me to inspect memory and find what is in disk cache. I also found that %ozfod is not useful for me and I removed it to not mangle 'free' on 24-line terminals (systat3.patch.txt). Thanks for comments! [1] https://github.com/z0nt/meminfo/ --=20 Andrey Zonov --------------060109070406000801030708 Content-Type: text/plain; charset=UTF-8; name="systat1.patch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="systat1.patch.txt" commit 8b2daa5a9ffae685987ec7c7641d94f87d8da91e Author: Andrey Zonov Date: Tue Jan 29 15:21:54 2013 +0400 - Document 'ioflt' in man page. =20 Spotted by: bde X-MFC-with: r246033 diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1 index 849c890..d815e54 100644 --- a/usr.bin/systat/systat.1 +++ b/usr.bin/systat/systat.1 @@ -28,7 +28,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD: head/usr.bin/systat/systat.1 240605 2012-09-17 13:36:47Z m= elifaro $ .\" -.Dd September 17, 2012 +.Dd January 29, 2013 .Dt SYSTAT 1 .Os .Sh NAME @@ -371,6 +371,7 @@ memory system. The first few lines describe, in units (except as noted below) of pages per second averaged over the sampling interval, +page faults requiring I/O (`ioflt'), pages copied on write (`cow'), pages zero filled on demand (`zfod'), pages optimally zero filled on demand (`ozfod'), --------------060109070406000801030708 Content-Type: text/plain; charset=UTF-8; name="systat2.patch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="systat2.patch.txt" commit dc19ccb997e57ddc8a31ad839f26db5f32590b7d Author: Andrey Zonov Date: Tue Jan 29 14:51:44 2013 +0400 - Do not show bufspace, because it is useless and constant in fact. =20 Suggested by: bde X-MFC-with: r246033 diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1 index 29b3276..07cf12a 100644 --- a/usr.bin/systat/systat.1 +++ b/usr.bin/systat/systat.1 @@ -396,15 +396,6 @@ free pages (`free'). Note that the values displayed are the current transient ones; they are not averages. .Pp -At the bottom of this column is a line showing the -amount of virtual memory, in kilobytes, mapped into the buffer cache (`b= uf'). -This statistic is not useful. -It exists only as a placeholder for the corresponding useful statistic -(the amount of real memory used to cache disks). -The most important component of the latter (the amount of real memory -used by the vm system to cache disks) is not available, -but can be guessed from the `inact' amount under some system loads. -.Pp Running down the right hand side of the display is a breakdown of the interrupts being handled by the system. At the top of the list is the total interrupts per second diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 7a9d719..c7e3c7f 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -112,7 +112,6 @@ static struct Info { struct nchstats nchstats; long nchcount; long *intrcnt; - long bufspace; int desiredvnodes; long numvnodes; long freevnodes; @@ -342,8 +341,6 @@ labelkre(void) mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "inact"); mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "cache"); mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "free"); - if (LINES - 1 > VMSTATROW + 17) - mvprintw(VMSTATROW + 17, VMSTATCOL + 9, "buf"); =20 mvprintw(GENSTATROW, GENSTATCOL, " Csw Trp Sys Int Sof Flt"); =20 @@ -513,8 +510,6 @@ showkre(void) putint(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); putint(pgtokb(s.v_cache_count), VMSTATROW + 15, VMSTATCOL, 8); putint(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); - if (LINES - 1 > VMSTATROW + 17) - putint(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); PUTRATE(v_vnodein, PAGEROW + 2, PAGECOL + 6, 5); PUTRATE(v_vnodeout, PAGEROW + 2, PAGECOL + 12, 5); PUTRATE(v_swapin, PAGEROW + 2, PAGECOL + 19, 5); @@ -779,7 +774,6 @@ getinfo(struct Info *ls) GETSYSCTL("vm.stats.vm.v_active_count", ls->v_active_count); GETSYSCTL("vm.stats.vm.v_inactive_count", ls->v_inactive_count); GETSYSCTL("vm.stats.vm.v_cache_count", ls->v_cache_count); - GETSYSCTL("vfs.bufspace", ls->bufspace); GETSYSCTL("kern.maxvnodes", ls->desiredvnodes); GETSYSCTL("vfs.numvnodes", ls->numvnodes); GETSYSCTL("vfs.freevnodes", ls->freevnodes); --------------060109070406000801030708 Content-Type: text/plain; charset=UTF-8; name="systat3.patch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="systat3.patch.txt" commit 89bb37ad23d3d893e7efb6b8fc2eea9fdd08fa02 Author: Andrey Zonov Date: Tue Jan 29 15:18:06 2013 +0400 - Remove '%ozfod' on vmstat display to not mangle 'free' on 24-line t= erminal. diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1 index 07cf12a..849c890 100644 --- a/usr.bin/systat/systat.1 +++ b/usr.bin/systat/systat.1 @@ -374,7 +374,6 @@ of pages per second averaged over the sampling interv= al, pages copied on write (`cow'), pages zero filled on demand (`zfod'), pages optimally zero filled on demand (`ozfod'), -the ratio of the (average) ozfod / zfod as a percentage (`%ozfod'), pages freed by the page daemon (`daefr'), pages freed by exiting processes (`prcfr'), total pages freed (`totfr'), @@ -384,7 +383,7 @@ times per second that the page daemon was awakened (`= pdwak'), pages analyzed by the page daemon (`pdpgs'), and in-transit blocking page faults (`intrn'). -Note that the units are special for `%ozfod' and `pdwak'. +Note that the units are special for `pdwak'. The next few lines describe, as amounts of memory in kilobytes, pages wired down (`wire'), diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index c7e3c7f..f8e051d 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -328,19 +328,18 @@ labelkre(void) mvprintw(VMSTATROW + 1, VMSTATCOL + 9, "cow"); mvprintw(VMSTATROW + 2, VMSTATCOL + 9, "zfod"); mvprintw(VMSTATROW + 3, VMSTATCOL + 9, "ozfod"); - mvprintw(VMSTATROW + 4, VMSTATCOL + 9 - 1, "%%ozfod"); - mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "daefr"); - mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "prcfr"); - mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "totfr"); - mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "react"); - mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdwak"); - mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "pdpgs"); - mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "intrn"); - mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "wire"); - mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "act"); - mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "inact"); - mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "cache"); - mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "free"); + mvprintw(VMSTATROW + 4, VMSTATCOL + 9, "daefr"); + mvprintw(VMSTATROW + 5, VMSTATCOL + 9, "prcfr"); + mvprintw(VMSTATROW + 6, VMSTATCOL + 9, "totfr"); + mvprintw(VMSTATROW + 7, VMSTATCOL + 9, "react"); + mvprintw(VMSTATROW + 8, VMSTATCOL + 9, "pdwak"); + mvprintw(VMSTATROW + 9, VMSTATCOL + 9, "pdpgs"); + mvprintw(VMSTATROW + 10, VMSTATCOL + 9, "intrn"); + mvprintw(VMSTATROW + 11, VMSTATCOL + 9, "wire"); + mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "act"); + mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "inact"); + mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "cache"); + mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "free"); =20 mvprintw(GENSTATROW, GENSTATCOL, " Csw Trp Sys Int Sof Flt"); =20 @@ -496,20 +495,18 @@ showkre(void) PUTRATE(v_cow_faults, VMSTATROW + 1, VMSTATCOL + 2, 8 - 2); PUTRATE(v_zfod, VMSTATROW + 2, VMSTATCOL + 2, 8 - 2); PUTRATE(v_ozfod, VMSTATROW + 3, VMSTATCOL, 8); - putint(s.v_zfod !=3D 0 ? (int)(s.v_ozfod * 100.0 / s.v_zfod) : 0, - VMSTATROW + 4, VMSTATCOL + 1, 8 - 1); - PUTRATE(v_dfree, VMSTATROW + 5, VMSTATCOL + 2, 8 - 2); - PUTRATE(v_pfree, VMSTATROW + 6, VMSTATCOL + 2, 8 - 2); - PUTRATE(v_tfree, VMSTATROW + 7, VMSTATCOL, 8); - PUTRATE(v_reactivated, VMSTATROW + 8, VMSTATCOL, 8); - PUTRATE(v_pdwakeups, VMSTATROW + 9, VMSTATCOL, 8); - PUTRATE(v_pdpages, VMSTATROW + 10, VMSTATCOL, 8); - PUTRATE(v_intrans, VMSTATROW + 11, VMSTATCOL, 8); - putint(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); - putint(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); - putint(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); - putint(pgtokb(s.v_cache_count), VMSTATROW + 15, VMSTATCOL, 8); - putint(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); + PUTRATE(v_dfree, VMSTATROW + 4, VMSTATCOL + 2, 8 - 2); + PUTRATE(v_pfree, VMSTATROW + 5, VMSTATCOL + 2, 8 - 2); + PUTRATE(v_tfree, VMSTATROW + 6, VMSTATCOL, 8); + PUTRATE(v_reactivated, VMSTATROW + 7, VMSTATCOL, 8); + PUTRATE(v_pdwakeups, VMSTATROW + 8, VMSTATCOL, 8); + PUTRATE(v_pdpages, VMSTATROW + 9, VMSTATCOL, 8); + PUTRATE(v_intrans, VMSTATROW + 10, VMSTATCOL, 8); + putint(pgtokb(s.v_wire_count), VMSTATROW + 11, VMSTATCOL, 8); + putint(pgtokb(s.v_active_count), VMSTATROW + 12, VMSTATCOL, 8); + putint(pgtokb(s.v_inactive_count), VMSTATROW + 13, VMSTATCOL, 8); + putint(pgtokb(s.v_cache_count), VMSTATROW + 14, VMSTATCOL, 8); + putint(pgtokb(s.v_free_count), VMSTATROW + 15, VMSTATCOL, 8); PUTRATE(v_vnodein, PAGEROW + 2, PAGECOL + 6, 5); PUTRATE(v_vnodeout, PAGEROW + 2, PAGECOL + 12, 5); PUTRATE(v_swapin, PAGEROW + 2, PAGECOL + 19, 5); --------------060109070406000801030708-- ------enig2DFWENKBPTLSKWUVBVGUD 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 iQEcBAEBAgAGBQJRB7yKAAoJEBWLemxX/CvTE+cH/RzSAEoDvaPp/cT9hYVxL2Xm Zhpeu0VNWiuGFzDnkuygxJBY6BFSHBgiTPlYOQswM1+xvIRcKZsCUATM3CsFh/hp F6khMMA3Prnu5c/uV8Lyg6X2AS5k1KA1wCo3EFn+mCbEtfLarsja+GrvLXX5Ep/1 SWHsm910DfLwSeIWGVSSn6aVf326Re8HBW1/DBhJENth4/Ki/PF8USmx1hbQvdoy fAL8pGhSuBwEuRNnoRnQrXmtoOix2y96eHXRKuumn6oMVgFoPCo7xdAIJCXprWM5 8DOPwzJ0hBB25+WbB9lhkm+R6HnaE5JipbA01ww3UrdjbyTQd5Pw9nExjh0k28I= =GyoU -----END PGP SIGNATURE----- ------enig2DFWENKBPTLSKWUVBVGUD-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 13:49:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15FC833E; Tue, 29 Jan 2013 13:49:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 05A3CD0D; Tue, 29 Jan 2013 13:49:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TDn8M7018584; Tue, 29 Jan 2013 13:49:08 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TDn8Cb018583; Tue, 29 Jan 2013 13:49:08 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201301291349.r0TDn8Cb018583@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 29 Jan 2013 13:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246069 - in stable/9: contrib/binutils/config contrib/bsnmp/lib contrib/bsnmp/snmp_target contrib/bsnmp/snmp_usm contrib/bsnmp/snmp_vacm contrib/dialog/samples/copifuncs contrib/ee con... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 13:49:09 -0000 Author: pfg Date: Tue Jan 29 13:49:08 2013 New Revision: 246069 URL: http://svnweb.freebsd.org/changeset/base/246069 Log: Clean some 'svn:executable' properties in the tree. Submitted by: Christoph Mallon While here, merge some other mergeinfo properties that were left behind from my commits /head/include:r241008,241141,241181 /head/contrib/gcc:r244776,244792 /head/cddl:r238457,238509,238558 Modified: Directory Properties: stable/9/ (props changed) stable/9/cddl/ (props changed) stable/9/contrib/binutils/ (props changed) stable/9/contrib/binutils/config/acinclude.m4 (props changed) stable/9/contrib/bsnmp/ (props changed) stable/9/contrib/bsnmp/lib/tc.def (props changed) stable/9/contrib/bsnmp/snmp_target/snmp_target.3 (props changed) stable/9/contrib/bsnmp/snmp_target/target_snmp.c (props changed) stable/9/contrib/bsnmp/snmp_target/target_tree.def (props changed) stable/9/contrib/bsnmp/snmp_usm/snmp_usm.3 (props changed) stable/9/contrib/bsnmp/snmp_usm/usm_snmp.c (props changed) stable/9/contrib/bsnmp/snmp_usm/usm_tree.def (props changed) stable/9/contrib/bsnmp/snmp_vacm/snmp_vacm.3 (props changed) stable/9/contrib/bsnmp/snmp_vacm/vacm_snmp.c (props changed) stable/9/contrib/bsnmp/snmp_vacm/vacm_tree.def (props changed) stable/9/contrib/dialog/ (props changed) stable/9/contrib/dialog/samples/copifuncs/common.funcs (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifman1 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifman2 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifmcfg2 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifmcfg4 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifmcfg5 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifpoll2 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.ifreq2 (props changed) stable/9/contrib/dialog/samples/copifuncs/copi.sendifm2 (props changed) stable/9/contrib/ee/ (props changed) stable/9/contrib/ee/Makefile (props changed) stable/9/contrib/ee/ee.c (props changed) stable/9/contrib/expat/ (props changed) stable/9/contrib/expat/doc/expat.png (props changed) stable/9/contrib/expat/doc/valid-xhtml10.png (props changed) stable/9/contrib/expat/lib/expat_external.h (props changed) stable/9/contrib/expat/tests/benchmark/README.txt (props changed) stable/9/contrib/expat/tests/benchmark/benchmark.c (props changed) stable/9/contrib/expat/tests/benchmark/benchmark.dsp (props changed) stable/9/contrib/expat/tests/benchmark/benchmark.dsw (props changed) stable/9/contrib/expat/tests/minicheck.c (props changed) stable/9/contrib/expat/tests/minicheck.h (props changed) stable/9/contrib/expat/tests/runtestspp.cpp (props changed) stable/9/contrib/expat/xmlwf/codepage.c (props changed) stable/9/contrib/expat/xmlwf/codepage.h (props changed) stable/9/contrib/expat/xmlwf/ct.c (props changed) stable/9/contrib/expat/xmlwf/filemap.h (props changed) stable/9/contrib/expat/xmlwf/readfilemap.c (props changed) stable/9/contrib/expat/xmlwf/unixfilemap.c (props changed) stable/9/contrib/expat/xmlwf/win32filemap.c (props changed) stable/9/contrib/expat/xmlwf/xmlfile.c (props changed) stable/9/contrib/expat/xmlwf/xmlfile.h (props changed) stable/9/contrib/expat/xmlwf/xmlmime.c (props changed) stable/9/contrib/expat/xmlwf/xmlmime.h (props changed) stable/9/contrib/expat/xmlwf/xmltchar.h (props changed) stable/9/contrib/expat/xmlwf/xmlurl.h (props changed) stable/9/contrib/expat/xmlwf/xmlwf.c (props changed) stable/9/contrib/expat/xmlwf/xmlwin32url.cxx (props changed) stable/9/contrib/gcc/ (props changed) stable/9/contrib/gcc/config/i386/host-cygwin.c (props changed) stable/9/contrib/gcc/config/i386/winnt-cxx.c (props changed) stable/9/contrib/gcc/config/i386/winnt-stubs.c (props changed) stable/9/contrib/gdb/ (props changed) stable/9/contrib/gdb/gdb/config/i386/nm-nto.h (props changed) stable/9/contrib/gdb/gdb/config/i386/nto.mh (props changed) stable/9/contrib/gdb/gdb/config/i386/nto.mt (props changed) stable/9/contrib/gdb/gdb/config/i386/tm-nto.h (props changed) stable/9/contrib/gdb/gdb/config/tm-nto.h (props changed) stable/9/contrib/gdb/gdb/i386-nto-tdep.c (props changed) stable/9/contrib/gdb/gdb/nto-procfs.c (props changed) stable/9/contrib/gdb/gdb/nto-tdep.c (props changed) stable/9/contrib/gdb/gdb/nto-tdep.h (props changed) stable/9/contrib/gdb/gdb/proc-api.c (props changed) stable/9/contrib/gdb/gdb/proc-events.c (props changed) stable/9/contrib/gdb/gdb/proc-flags.c (props changed) stable/9/contrib/gdb/gdb/proc-why.c (props changed) stable/9/contrib/gdb/gdb/uw-thread.c (props changed) stable/9/contrib/ipfilter/FreeBSD-4.0/ipv6-patch (props changed) stable/9/contrib/ipfilter/FreeBSD-4.0/ipv6-patch-4.0 (props changed) stable/9/contrib/libpcap/ (props changed) stable/9/contrib/libpcap/configure.in (props changed) stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.h (props changed) stable/9/contrib/ntp/ (props changed) stable/9/contrib/ntp/html/drivers/driver44.html (props changed) stable/9/contrib/ntp/include/icom.h (props changed) stable/9/contrib/ntp/readme.y2kfixes (props changed) stable/9/contrib/ntp/scripts/stats/clock.awk (props changed) stable/9/contrib/ntp/scripts/stats/dupe.awk (props changed) stable/9/contrib/ntp/scripts/stats/ensemble.S (props changed) stable/9/contrib/ntp/scripts/stats/ensemble.awk (props changed) stable/9/contrib/ntp/scripts/stats/etf.S (props changed) stable/9/contrib/ntp/scripts/stats/etf.awk (props changed) stable/9/contrib/ntp/scripts/stats/itf.S (props changed) stable/9/contrib/ntp/scripts/stats/itf.awk (props changed) stable/9/contrib/ntp/scripts/stats/loop.S (props changed) stable/9/contrib/ntp/scripts/stats/loop.awk (props changed) stable/9/contrib/ntp/scripts/stats/loop_summary (props changed) stable/9/contrib/ntp/scripts/stats/peer.awk (props changed) stable/9/contrib/ntp/scripts/stats/psummary.awk (props changed) stable/9/contrib/ntp/scripts/stats/tdata.S (props changed) stable/9/contrib/ntp/scripts/stats/tdata.awk (props changed) stable/9/contrib/tcpdump/ (props changed) stable/9/contrib/tcpdump/bgp.h (props changed) stable/9/contrib/tcpdump/configure.in (props changed) stable/9/contrib/tcpdump/ipproto.c (props changed) stable/9/contrib/tcpdump/l2vpn.c (props changed) stable/9/contrib/tcpdump/l2vpn.h (props changed) stable/9/contrib/tcpdump/nlpid.c (props changed) stable/9/contrib/tcpdump/print-syslog.c (props changed) stable/9/crypto/heimdal/ (props changed) stable/9/crypto/heimdal/doc/vars.texi (props changed) stable/9/crypto/openssl/ (props changed) stable/9/crypto/openssl/crypto/bn/bn_const.c (props changed) stable/9/crypto/openssl/crypto/ocsp/ocsp_cl.c (props changed) stable/9/crypto/openssl/crypto/ocsp/ocsp_ext.c (props changed) stable/9/crypto/openssl/crypto/ocsp/ocsp_lib.c (props changed) stable/9/crypto/openssl/crypto/ocsp/ocsp_srv.c (props changed) stable/9/crypto/openssl/crypto/rand/rand_lcl.h (props changed) stable/9/crypto/openssl/util/libeay.num (props changed) stable/9/crypto/openssl/util/ssleay.num (props changed) stable/9/include/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/ath/ath_hal/ar5211/boss.ini (props changed) stable/9/sys/dev/bktr/CHANGELOG.TXT (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/ixgbe/ixgbe_82598.h (props changed) stable/9/sys/dev/ixgbe/ixgbe_82599.h (props changed) stable/9/sys/dev/ixgbe/ixgbe_x540.c (props changed) stable/9/sys/dev/ixgbe/ixgbe_x540.h (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ext2fs/ext2_dinode.h (props changed) stable/9/sys/fs/ext2fs/ext2_dir.h (props changed) stable/9/sys/fs/ext2fs/ext2fs.h (props changed) stable/9/sys/mips/rmi/msgring_xls.cfg (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/modules/digi/Makefile (props changed) stable/9/sys/modules/digi/Makefile.inc (props changed) stable/9/sys/modules/isci/Makefile (props changed) stable/9/sys/modules/sound/driver/ich/Makefile (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/bsnmpd/ (props changed) stable/9/usr.sbin/bsnmpd/modules/snmp_target/Makefile (props changed) stable/9/usr.sbin/bsnmpd/modules/snmp_usm/Makefile (props changed) stable/9/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile (props changed) stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 17:03:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AECB0E9F; Tue, 29 Jan 2013 17:03:21 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 923B9949; Tue, 29 Jan 2013 17:03:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TH3L6g078266; Tue, 29 Jan 2013 17:03:21 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TH3JaO078248; Tue, 29 Jan 2013 17:03:19 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201301291703.r0TH3JaO078248@svn.freebsd.org> From: Gabor Kovesdan Date: Tue, 29 Jan 2013 17:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246074 - in head: . gnu/usr.bin/patch share/mk tools/build/options usr.bin usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:03:21 -0000 Author: gabor Date: Tue Jan 29 17:03:18 2013 New Revision: 246074 URL: http://svnweb.freebsd.org/changeset/base/246074 Log: - Add a BSD-licensed patch, ported by Pedro F. Giffuni (pfg) from DragonflyBSD and install it as bsdpatch. WITH_BSD_PATCH makes it default and installs GNU patch as gnupatch. Submitted by: pfg Obtained from: The DragonflyBSD Project Added: head/tools/build/options/WITH_BSD_PATCH (contents, props changed) head/usr.bin/patch/ head/usr.bin/patch/Makefile (contents, props changed) head/usr.bin/patch/backupfile.c (contents, props changed) head/usr.bin/patch/backupfile.h (contents, props changed) head/usr.bin/patch/common.h (contents, props changed) head/usr.bin/patch/inp.c (contents, props changed) head/usr.bin/patch/inp.h (contents, props changed) head/usr.bin/patch/mkpath.c (contents, props changed) head/usr.bin/patch/patch.1 (contents, props changed) head/usr.bin/patch/patch.c (contents, props changed) head/usr.bin/patch/pathnames.h (contents, props changed) head/usr.bin/patch/pch.c (contents, props changed) head/usr.bin/patch/pch.h (contents, props changed) head/usr.bin/patch/util.c (contents, props changed) head/usr.bin/patch/util.h (contents, props changed) Modified: head/UPDATING head/gnu/usr.bin/patch/Makefile head/share/mk/bsd.own.mk head/usr.bin/Makefile Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Jan 29 16:00:43 2013 (r246073) +++ head/UPDATING Tue Jan 29 17:03:18 2013 (r246074) @@ -26,6 +26,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".) +20130129: + A BSD-licensed patch(1) variant has been added and is installed + as bsdpatch, being the GNU version the default patch. + To inverse the logic and use the BSD-licensed one as default, + while having the GNU version installed as gnupatch, rebuild + ans install world with the WITH_BSD_PATCH knob set. + 20130118: The install(1) option -M has changed meaning and now takes an argument that is a file or path to append logs to. In the Modified: head/gnu/usr.bin/patch/Makefile ============================================================================== --- head/gnu/usr.bin/patch/Makefile Tue Jan 29 16:00:43 2013 (r246073) +++ head/gnu/usr.bin/patch/Makefile Tue Jan 29 17:03:18 2013 (r246074) @@ -1,6 +1,17 @@ # $FreeBSD$ -PROG= patch +.include + +.if ${MK_BSD_PATCH} == "yes" +PROG= gnupatch +CLEANFILES+= gnupatch.1 + +gnupatch.1: patch.1 + cp ${.ALLSRC} ${.TARGET} +.else +PROG= patch +.endif + SRCS= backupfile.c inp.c patch.c pch.c util.c version.c CFLAGS+=-DHAVE_CONFIG_H Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Jan 29 16:00:43 2013 (r246073) +++ head/share/mk/bsd.own.mk Tue Jan 29 17:03:18 2013 (r246074) @@ -354,6 +354,7 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ ARM_EABI \ + BSD_PATCH \ BIND_IDN \ BIND_LARGE_FILE \ BIND_LIBS \ Added: head/tools/build/options/WITH_BSD_PATCH ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BSD_PATCH Tue Jan 29 17:03:18 2013 (r246074) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Install BSD-licensed patch as 'patch' instead of GNU patch. Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Tue Jan 29 16:00:43 2013 (r246073) +++ head/usr.bin/Makefile Tue Jan 29 17:03:18 2013 (r246074) @@ -123,6 +123,7 @@ SUBDIR= alias \ pagesize \ passwd \ paste \ + patch \ pathchk \ perror \ pr \ Added: head/usr.bin/patch/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/patch/Makefile Tue Jan 29 17:03:18 2013 (r246074) @@ -0,0 +1,19 @@ +# $FreeBSD$ +# $OpenBSD: Makefile,v 1.4 2005/05/16 15:22:46 espie Exp $ +# $DragonFly: src/usr.bin/patch/Makefile,v 1.8 2008/08/10 23:50:12 joerg Exp $ + +.include + +.if ${MK_BSD_PATCH} == "yes" +PROG= patch +.else +PROG= bsdpatch +CLEANFILES+= bsdpatch.1 + +bsdpatch.1: patch.1 + cp ${.ALLSRC} ${.TARGET} +.endif + +SRCS= backupfile.c inp.c mkpath.c patch.c pch.c util.c + +.include Added: head/usr.bin/patch/backupfile.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/patch/backupfile.c Tue Jan 29 17:03:18 2013 (r246074) @@ -0,0 +1,248 @@ +/* $FreeBSD$ */ +/*- + * + * Copyright (C) 1990 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * without restriction. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * backupfile.c -- make Emacs style backup file names + * + * David MacKenzie . Some algorithms adapted from GNU Emacs. + * + * $OpenBSD: backupfile.c,v 1.19 2006/03/11 19:41:30 otto Exp $ + * $DragonFly: src/usr.bin/patch/backupfile.c,v 1.5 2008/08/11 00:05:06 joerg Exp $ + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "backupfile.h" + + +#define ISDIGIT(c) (isascii ((unsigned char)c) && isdigit ((unsigned char)c)) + +/* Which type of backup file names are generated. */ +enum backup_type backup_type = none; + +/* + * The extension added to file names to produce a simple (as opposed to + * numbered) backup file name. + */ +const char *simple_backup_suffix = "~"; + +static char *concat(const char *, const char *); +static char *make_version_name(const char *, int); +static int max_backup_version(const char *, const char *); +static int version_number(const char *, const char *, size_t); +static int argmatch(const char *, const char **); +static void invalid_arg(const char *, const char *, int); + +/* + * Return the name of the new backup file for file FILE, allocated with + * malloc. Return 0 if out of memory. FILE must not end with a '/' unless it + * is the root directory. Do not call this function if backup_type == none. + */ +char * +find_backup_file_name(const char *file) +{ + char *dir, *base_versions, *tmp_file; + int highest_backup; + + if (backup_type == simple) + return concat(file, simple_backup_suffix); + tmp_file = strdup(file); + if (tmp_file == NULL) + return NULL; + base_versions = concat(basename(tmp_file), ".~"); + free(tmp_file); + if (base_versions == NULL) + return NULL; + tmp_file = strdup(file); + if (tmp_file == NULL) { + free(base_versions); + return NULL; + } + dir = dirname(tmp_file); + if (dir == NULL) { + free(base_versions); + free(tmp_file); + return NULL; + } + highest_backup = max_backup_version(base_versions, dir); + free(base_versions); + free(tmp_file); + if (backup_type == numbered_existing && highest_backup == 0) + return concat(file, simple_backup_suffix); + return make_version_name(file, highest_backup + 1); +} + +/* + * Return the number of the highest-numbered backup file for file FILE in + * directory DIR. If there are no numbered backups of FILE in DIR, or an + * error occurs reading DIR, return 0. FILE should already have ".~" appended + * to it. + */ +static int +max_backup_version(const char *file, const char *dir) +{ + DIR *dirp; + struct dirent *dp; + int highest_version, this_version; + size_t file_name_length; + + dirp = opendir(dir); + if (dirp == NULL) + return 0; + + highest_version = 0; + file_name_length = strlen(file); + + while ((dp = readdir(dirp)) != NULL) { + if (dp->d_namlen <= file_name_length) + continue; + + this_version = version_number(file, dp->d_name, file_name_length); + if (this_version > highest_version) + highest_version = this_version; + } + closedir(dirp); + return highest_version; +} + +/* + * Return a string, allocated with malloc, containing "FILE.~VERSION~". + * Return 0 if out of memory. + */ +static char * +make_version_name(const char *file, int version) +{ + char *backup_name; + + if (asprintf(&backup_name, "%s.~%d~", file, version) == -1) + return NULL; + return backup_name; +} + +/* + * If BACKUP is a numbered backup of BASE, return its version number; + * otherwise return 0. BASE_LENGTH is the length of BASE. BASE should + * already have ".~" appended to it. + */ +static int +version_number(const char *base, const char *backup, size_t base_length) +{ + int version; + const char *p; + + version = 0; + if (!strncmp(base, backup, base_length) && ISDIGIT(backup[base_length])) { + for (p = &backup[base_length]; ISDIGIT(*p); ++p) + version = version * 10 + *p - '0'; + if (p[0] != '~' || p[1]) + version = 0; + } + return version; +} + +/* + * Return the newly-allocated concatenation of STR1 and STR2. If out of + * memory, return 0. + */ +static char * +concat(const char *str1, const char *str2) +{ + char *newstr; + + if (asprintf(&newstr, "%s%s", str1, str2) == -1) + return NULL; + return newstr; +} + +/* + * If ARG is an unambiguous match for an element of the null-terminated array + * OPTLIST, return the index in OPTLIST of the matched element, else -1 if it + * does not match any element or -2 if it is ambiguous (is a prefix of more + * than one element). + */ +static int +argmatch(const char *arg, const char **optlist) +{ + int i; /* Temporary index in OPTLIST. */ + size_t arglen; /* Length of ARG. */ + int matchind = -1; /* Index of first nonexact match. */ + int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */ + + arglen = strlen(arg); + + /* Test all elements for either exact match or abbreviated matches. */ + for (i = 0; optlist[i]; i++) { + if (!strncmp(optlist[i], arg, arglen)) { + if (strlen(optlist[i]) == arglen) + /* Exact match found. */ + return i; + else if (matchind == -1) + /* First nonexact match found. */ + matchind = i; + else + /* Second nonexact match found. */ + ambiguous = 1; + } + } + if (ambiguous) + return -2; + else + return matchind; +} + +/* + * Error reporting for argmatch. KIND is a description of the type of entity + * that was being matched. VALUE is the invalid value that was given. PROBLEM + * is the return value from argmatch. + */ +static void +invalid_arg(const char *kind, const char *value, int problem) +{ + fprintf(stderr, "patch: "); + if (problem == -1) + fprintf(stderr, "invalid"); + else /* Assume -2. */ + fprintf(stderr, "ambiguous"); + fprintf(stderr, " %s `%s'\n", kind, value); +} + +static const char *backup_args[] = { + "never", "simple", "nil", "existing", "t", "numbered", 0 +}; + +static enum backup_type backup_types[] = { + simple, simple, numbered_existing, + numbered_existing, numbered, numbered +}; + +/* + * Return the type of backup indicated by VERSION. Unique abbreviations are + * accepted. + */ +enum backup_type +get_version(const char *version) +{ + int i; + + if (version == NULL || *version == '\0') + return numbered_existing; + i = argmatch(version, backup_args); + if (i >= 0) + return backup_types[i]; + invalid_arg("version control type", version, i); + exit(2); +} Added: head/usr.bin/patch/backupfile.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/patch/backupfile.h Tue Jan 29 17:03:18 2013 (r246074) @@ -0,0 +1,39 @@ +/* $FreeBSD$ */ +/*- + * backupfile.h -- declarations for making Emacs style backup file names + * Copyright (C) 1990 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * without restriction. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * $OpenBSD: backupfile.h,v 1.6 2003/07/28 18:35:36 otto Exp $ + * $DragonFly: src/usr.bin/patch/backupfile.h,v 1.3 2007/09/29 23:11:10 swildner Exp $ + */ + +/* When to make backup files. */ +enum backup_type { + /* Never make backups. */ + none, + + /* Make simple backups of every file. */ + simple, + + /* + * Make numbered backups of files that already have numbered backups, + * and simple backups of the others. + */ + numbered_existing, + + /* Make numbered backups of every file. */ + numbered +}; + +extern enum backup_type backup_type; +extern const char *simple_backup_suffix; + +char *find_backup_file_name(const char *file); +enum backup_type get_version(const char *version); Added: head/usr.bin/patch/common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/patch/common.h Tue Jan 29 17:03:18 2013 (r246074) @@ -0,0 +1,121 @@ +/* $FreeBSD$ */ +/*- + * + * Copyright 1986, Larry Wall + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following condition is met: + * 1. Redistributions of source code must retain the above copyright notice, + * this condition and the following disclaimer. + * + * 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. + * + * patch - a program to apply diffs to original files + * + * -C option added in 1998, original code by Marc Espie, based on FreeBSD + * behaviour + * + * $OpenBSD: common.h,v 1.26 2006/03/11 19:41:30 otto Exp $ + * $DragonFly: src/usr.bin/patch/common.h,v 1.5 2008/08/10 23:50:12 joerg Exp $ + */ + +#include + +#include +#include + +#define DEBUGGING + +/* constants */ + +#define MAXHUNKSIZE 200000 /* is this enough lines? */ +#define INITHUNKMAX 125 /* initial dynamic allocation size */ +#define INITLINELEN 4096 +#define BUFFERSIZE 4096 + +#define SCCSPREFIX "s." +#define GET "get -e %s" +#define SCCSDIFF "get -p %s | diff - %s >/dev/null" + +#define RCSSUFFIX ",v" +#define CHECKOUT "co -l %s" +#define RCSDIFF "rcsdiff %s > /dev/null" + +#define ORIGEXT ".orig" +#define REJEXT ".rej" + +/* handy definitions */ + +#define strNE(s1,s2) (strcmp(s1, s2)) +#define strEQ(s1,s2) (!strcmp(s1, s2)) +#define strnNE(s1,s2,l) (strncmp(s1, s2, l)) +#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) + +/* typedefs */ + +typedef long LINENUM; /* must be signed */ + +/* globals */ + +extern mode_t filemode; + +extern char *buf; /* general purpose buffer */ +extern size_t buf_size; /* size of general purpose buffer */ + +extern bool using_plan_a; /* try to keep everything in memory */ +extern bool out_of_mem; /* ran out of memory in plan a */ + +#define MAXFILEC 2 + +extern char *filearg[MAXFILEC]; +extern bool ok_to_create_file; +extern char *outname; +extern char *origprae; + +extern char *TMPOUTNAME; +extern char *TMPINNAME; +extern char *TMPREJNAME; +extern char *TMPPATNAME; +extern bool toutkeep; +extern bool trejkeep; + +#ifdef DEBUGGING +extern int debug; +#endif + +extern bool force; +extern bool batch; +extern bool verbose; +extern bool reverse; +extern bool noreverse; +extern bool skip_rest_of_patch; +extern int strippath; +extern bool canonicalize; +/* TRUE if -C was specified on command line. */ +extern bool check_only; +extern bool warn_on_invalid_line; +extern bool last_line_missing_eol; + + +#define CONTEXT_DIFF 1 +#define NORMAL_DIFF 2 +#define ED_DIFF 3 +#define NEW_CONTEXT_DIFF 4 +#define UNI_DIFF 5 + +extern int diff_type; +extern char *revision; /* prerequisite revision, if any */ +extern LINENUM input_lines; /* how long is input file in lines */ + +extern int posix; + Added: head/usr.bin/patch/inp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/patch/inp.c Tue Jan 29 17:03:18 2013 (r246074) @@ -0,0 +1,485 @@ +/* $FreeBSD$ */ +/*- + * + * Copyright 1986, Larry Wall + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following condition is met: + * 1. Redistributions of source code must retain the above copyright notice, + * this condition and the following disclaimer. + * + * 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. + * + * patch - a program to apply diffs to original files + * + * -C option added in 1998, original code by Marc Espie, based on FreeBSD + * behaviour + * + * $OpenBSD: inp.c,v 1.34 2006/03/11 19:41:30 otto Exp $ + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "util.h" +#include "pch.h" +#include "inp.h" + + +/* Input-file-with-indexable-lines abstract type */ + +static size_t i_size; /* size of the input file */ +static char *i_womp; /* plan a buffer for entire file */ +static char **i_ptr; /* pointers to lines in i_womp */ +static char empty_line[] = { '\0' }; + +static int tifd = -1; /* plan b virtual string array */ +static char *tibuf[2]; /* plan b buffers */ +static LINENUM tiline[2] = {-1, -1}; /* 1st line in each buffer */ +static LINENUM lines_per_buf; /* how many lines per buffer */ +static int tireclen; /* length of records in tmp file */ + +static bool rev_in_string(const char *); +static bool reallocate_lines(size_t *); + +/* returns false if insufficient memory */ +static bool plan_a(const char *); + +static void plan_b(const char *); + +/* New patch--prepare to edit another file. */ + +void +re_input(void) +{ + if (using_plan_a) { + free(i_ptr); + i_ptr = NULL; + if (i_womp != NULL) { + munmap(i_womp, i_size); + i_womp = NULL; + } + i_size = 0; + } else { + using_plan_a = true; /* maybe the next one is smaller */ + close(tifd); + tifd = -1; + free(tibuf[0]); + free(tibuf[1]); + tibuf[0] = tibuf[1] = NULL; + tiline[0] = tiline[1] = -1; + tireclen = 0; + } +} + +/* Construct the line index, somehow or other. */ + +void +scan_input(const char *filename) +{ + if (!plan_a(filename)) + plan_b(filename); + if (verbose) { + say("Patching file %s using Plan %s...\n", filename, + (using_plan_a ? "A" : "B")); + } +} + +static bool +reallocate_lines(size_t *lines_allocated) +{ + char **p; + size_t new_size; + + new_size = *lines_allocated * 3 / 2; + p = realloc(i_ptr, (new_size + 2) * sizeof(char *)); + if (p == NULL) { /* shucks, it was a near thing */ + munmap(i_womp, i_size); + i_womp = NULL; + free(i_ptr); + i_ptr = NULL; + *lines_allocated = 0; + return false; + } + *lines_allocated = new_size; + i_ptr = p; + return true; +} + +/* Try keeping everything in memory. */ + +static bool +plan_a(const char *filename) +{ + int ifd, statfailed; + char *p, *s, lbuf[INITLINELEN]; + struct stat filestat; + ptrdiff_t sz; + size_t i; + size_t iline, lines_allocated; + +#ifdef DEBUGGING + if (debug & 8) + return false; +#endif + + if (filename == NULL || *filename == '\0') + return false; + + statfailed = stat(filename, &filestat); + if (statfailed && ok_to_create_file) { + if (verbose) + say("(Creating file %s...)\n", filename); + + /* + * in check_patch case, we still display `Creating file' even + * though we're not. The rule is that -C should be as similar + * to normal patch behavior as possible + */ + if (check_only) + return true; + makedirs(filename, true); + close(creat(filename, 0666)); + statfailed = stat(filename, &filestat); + } + if (statfailed && check_only) + fatal("%s not found, -C mode, can't probe further\n", filename); + /* For nonexistent or read-only files, look for RCS or SCCS versions. */ + if (statfailed || + /* No one can write to it. */ + (filestat.st_mode & 0222) == 0 || + /* I can't write to it. */ + ((filestat.st_mode & 0022) == 0 && filestat.st_uid != getuid())) { + const char *cs = NULL, *filebase, *filedir; + struct stat cstat; + char *tmp_filename1, *tmp_filename2; + + tmp_filename1 = strdup(filename); + tmp_filename2 = strdup(filename); + if (tmp_filename1 == NULL || tmp_filename2 == NULL) + fatal("strdupping filename"); + filebase = basename(tmp_filename1); + filedir = dirname(tmp_filename2); + + /* Leave room in lbuf for the diff command. */ + s = lbuf + 20; + +#define try(f, a1, a2, a3) \ + (snprintf(s, buf_size - 20, f, a1, a2, a3), stat(s, &cstat) == 0) + + if (try("%s/RCS/%s%s", filedir, filebase, RCSSUFFIX) || + try("%s/RCS/%s%s", filedir, filebase, "") || + try("%s/%s%s", filedir, filebase, RCSSUFFIX)) { + snprintf(buf, buf_size, CHECKOUT, filename); + snprintf(lbuf, sizeof lbuf, RCSDIFF, filename); + cs = "RCS"; + } else if (try("%s/SCCS/%s%s", filedir, SCCSPREFIX, filebase) || + try("%s/%s%s", filedir, SCCSPREFIX, filebase)) { + snprintf(buf, buf_size, GET, s); + snprintf(lbuf, sizeof lbuf, SCCSDIFF, s, filename); + cs = "SCCS"; + } else if (statfailed) + fatal("can't find %s\n", filename); + + free(tmp_filename1); + free(tmp_filename2); + + /* + * else we can't write to it but it's not under a version + * control system, so just proceed. + */ + if (cs) { + if (!statfailed) { + if ((filestat.st_mode & 0222) != 0) + /* The owner can write to it. */ + fatal("file %s seems to be locked " + "by somebody else under %s\n", + filename, cs); + /* + * It might be checked out unlocked. See if + * it's safe to check out the default version + * locked. + */ + if (verbose) + say("Comparing file %s to default " + "%s version...\n", + filename, cs); + if (system(lbuf)) + fatal("can't check out file %s: " + "differs from default %s version\n", + filename, cs); + } + if (verbose) + say("Checking out file %s from %s...\n", + filename, cs); + if (system(buf) || stat(filename, &filestat)) + fatal("can't check out file %s from %s\n", + filename, cs); + } + } + filemode = filestat.st_mode; + if (!S_ISREG(filemode)) + fatal("%s is not a normal file--can't patch\n", filename); + if ((uint64_t)filestat.st_size > SIZE_MAX) { + say("block too large to mmap\n"); + return false; + } + i_size = (size_t)filestat.st_size; + if (out_of_mem) { + set_hunkmax(); /* make sure dynamic arrays are allocated */ + out_of_mem = false; + return false; /* force plan b because plan a bombed */ + } + if ((ifd = open(filename, O_RDONLY)) < 0) + pfatal("can't open file %s", filename); + + if (i_size) { + i_womp = mmap(NULL, i_size, PROT_READ, MAP_PRIVATE, ifd, 0); + if (i_womp == MAP_FAILED) { + perror("mmap failed"); + i_womp = NULL; + close(ifd); + return false; + } + } else { + i_womp = NULL; + } + + close(ifd); + if (i_size) + madvise(i_womp, i_size, MADV_SEQUENTIAL); + + /* estimate the number of lines */ + lines_allocated = i_size / 25; + if (lines_allocated < 100) + lines_allocated = 100; + + if (!reallocate_lines(&lines_allocated)) + return false; + + /* now scan the buffer and build pointer array */ + iline = 1; + i_ptr[iline] = i_womp; + /* test for NUL too, to maintain the behavior of the original code */ + for (s = i_womp, i = 0; i < i_size && *s != '\0'; s++, i++) { + if (*s == '\n') { + if (iline == lines_allocated) { + if (!reallocate_lines(&lines_allocated)) + return false; + } + /* these are NOT NUL terminated */ + i_ptr[++iline] = s + 1; + } + } + /* if the last line contains no EOL, append one */ + if (i_size > 0 && i_womp[i_size - 1] != '\n') { + last_line_missing_eol = true; + /* fix last line */ + sz = s - i_ptr[iline]; + p = malloc(sz + 1); + if (p == NULL) { + free(i_ptr); + i_ptr = NULL; + munmap(i_womp, i_size); + i_womp = NULL; + return false; + } + + memcpy(p, i_ptr[iline], sz); + p[sz] = '\n'; + i_ptr[iline] = p; + /* count the extra line and make it point to some valid mem */ + i_ptr[++iline] = empty_line; + } else + last_line_missing_eol = false; + + input_lines = iline - 1; + + /* now check for revision, if any */ + + if (revision != NULL) { + if (!rev_in_string(i_womp)) { + if (force) { + if (verbose) + say("Warning: this file doesn't appear " + "to be the %s version--patching anyway.\n", + revision); + } else if (batch) { + fatal("this file doesn't appear to be the " + "%s version--aborting.\n", + revision); + } else { + ask("This file doesn't appear to be the " + "%s version--patch anyway? [n] ", + revision); + if (*buf != 'y') + fatal("aborted\n"); + } + } else if (verbose) + say("Good. This file appears to be the %s version.\n", + revision); + } + return true; /* plan a will work */ +} + +/* Keep (virtually) nothing in memory. */ + +static void +plan_b(const char *filename) +{ + FILE *ifp; + size_t i = 0, j, maxlen = 1; + char *p; + bool found_revision = (revision == NULL); + + using_plan_a = false; + if ((ifp = fopen(filename, "r")) == NULL) + pfatal("can't open file %s", filename); + unlink(TMPINNAME); + if ((tifd = open(TMPINNAME, O_EXCL | O_CREAT | O_WRONLY, 0666)) < 0) + pfatal("can't open file %s", TMPINNAME); + while (fgets(buf, buf_size, ifp) != NULL) { + if (revision != NULL && !found_revision && rev_in_string(buf)) + found_revision = true; + if ((i = strlen(buf)) > maxlen) + maxlen = i; /* find longest line */ + } + last_line_missing_eol = i > 0 && buf[i - 1] != '\n'; + if (last_line_missing_eol && maxlen == i) + maxlen++; + + if (revision != NULL) { + if (!found_revision) { + if (force) { + if (verbose) + say("Warning: this file doesn't appear " + "to be the %s version--patching anyway.\n", + revision); + } else if (batch) { + fatal("this file doesn't appear to be the " + "%s version--aborting.\n", + revision); + } else { + ask("This file doesn't appear to be the %s " + "version--patch anyway? [n] ", + revision); + if (*buf != 'y') + fatal("aborted\n"); + } + } else if (verbose) + say("Good. This file appears to be the %s version.\n", + revision); + } + fseek(ifp, 0L, SEEK_SET); /* rewind file */ + lines_per_buf = BUFFERSIZE / maxlen; + tireclen = maxlen; + tibuf[0] = malloc(BUFFERSIZE + 1); + if (tibuf[0] == NULL) + fatal("out of memory\n"); + tibuf[1] = malloc(BUFFERSIZE + 1); + if (tibuf[1] == NULL) + fatal("out of memory\n"); + for (i = 1;; i++) { + p = tibuf[0] + maxlen * (i % lines_per_buf); + if (i % lines_per_buf == 0) /* new block */ + if (write(tifd, tibuf[0], BUFFERSIZE) < BUFFERSIZE) + pfatal("can't write temp file"); + if (fgets(p, maxlen + 1, ifp) == NULL) { + input_lines = i - 1; + if (i % lines_per_buf != 0) + if (write(tifd, tibuf[0], BUFFERSIZE) < BUFFERSIZE) + pfatal("can't write temp file"); + break; + } + j = strlen(p); + /* These are '\n' terminated strings, so no need to add a NUL */ + if (j == 0 || p[j - 1] != '\n') + p[j] = '\n'; + } + fclose(ifp); + close(tifd); + if ((tifd = open(TMPINNAME, O_RDONLY)) < 0) + pfatal("can't reopen file %s", TMPINNAME); +} + +/* + * Fetch a line from the input file, \n terminated, not necessarily \0. + */ +char * +ifetch(LINENUM line, int whichbuf) +{ + if (line < 1 || line > input_lines) { + if (warn_on_invalid_line) { + say("No such line %ld in input file, ignoring\n", line); + warn_on_invalid_line = false; + } + return NULL; + } + if (using_plan_a) + return i_ptr[line]; + else { + LINENUM offline = line % lines_per_buf; + LINENUM baseline = line - offline; + + if (tiline[0] == baseline) + whichbuf = 0; + else if (tiline[1] == baseline) + whichbuf = 1; + else { + tiline[whichbuf] = baseline; + + if (lseek(tifd, (off_t) (baseline / lines_per_buf * + BUFFERSIZE), SEEK_SET) < 0) + pfatal("cannot seek in the temporary input file"); + + if (read(tifd, tibuf[whichbuf], BUFFERSIZE) < 0) + pfatal("error reading tmp file %s", TMPINNAME); + } + return tibuf[whichbuf] + (tireclen * offline); + } +} + +/* + * True if the string argument contains the revision number we want. + */ +static bool +rev_in_string(const char *string) +{ + const char *s; + size_t patlen; + + if (revision == NULL) + return true; + patlen = strlen(revision); + if (strnEQ(string, revision, patlen) && isspace((unsigned char)string[patlen])) + return true; + for (s = string; *s; s++) { + if (isspace((unsigned char)*s) && strnEQ(s + 1, revision, patlen) && + isspace((unsigned char)s[patlen + 1])) { + return true; + } + } + return false; +} Added: head/usr.bin/patch/inp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/patch/inp.h Tue Jan 29 17:03:18 2013 (r246074) @@ -0,0 +1,35 @@ +/* + * $FreeBSD$ + * $OpenBSD: inp.h,v 1.8 2003/08/15 08:00:51 otto Exp $ + * $DragonFly: src/usr.bin/patch/inp.h,v 1.1 2004/09/24 18:44:28 joerg Exp $ + */ + +/* + * patch - a program to apply diffs to original files *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 17:05:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 873C110D; Tue, 29 Jan 2013 17:05:22 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5FF05970; Tue, 29 Jan 2013 17:05:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TH5M4Z078674; Tue, 29 Jan 2013 17:05:22 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TH5MZH078673; Tue, 29 Jan 2013 17:05:22 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201301291705.r0TH5MZH078673@svn.freebsd.org> From: Gabor Kovesdan Date: Tue, 29 Jan 2013 17:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246075 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:05:22 -0000 Author: gabor Date: Tue Jan 29 17:05:21 2013 New Revision: 246075 URL: http://svnweb.freebsd.org/changeset/base/246075 Log: - Regen Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Jan 29 17:03:18 2013 (r246074) +++ head/share/man/man5/src.conf.5 Tue Jan 29 17:05:21 2013 (r246075) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd January 17, 2013 +.Dd January 29, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -100,6 +100,9 @@ Set to not build .Xr apm 8 , .Xr apmd 8 and related programs. +.It Va WITH_ARM_EABI +.\" from FreeBSD: head/tools/build/options/WITH_ARM_EABI 245539 2013-01-17 05:56:28Z andrew +Set the ARM ABI to EABI. .It Va WITHOUT_ASSERT_DEBUG .\" from FreeBSD: head/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru Set to compile programs and libraries without the @@ -242,6 +245,9 @@ Set to not build the BSD licensed versio .It Va WITH_BSD_GREP .\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien Install BSD-licensed grep as '[ef]grep' instead of GNU grep. +.It Va WITH_BSD_PATCH +.\" from FreeBSD: head/tools/build/options/WITH_BSD_PATCH 246074 2013-01-29 17:03:18Z gabor +Install BSD-licensed patch as 'patch' instead of GNU patch. .It Va WITHOUT_BSNMP .\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam Set to not build or install @@ -476,9 +482,6 @@ Set to not build GPIB bus support. Set to not build .Xr gpioctl 8 as part of the base system. -.It Va WITH_GPL_DTC -Set to build the GPL'd version of the device tree compiler from elinux.org, -instead of the BSD licensed one. .It Va WITHOUT_GROFF .\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs Set to not build @@ -888,6 +891,11 @@ Set to build some programs without PAM s .Xr ftpd 8 and .Xr ppp 8 . +.It Va WITHOUT_PC_SYSINSTALL +.\" from FreeBSD: head/tools/build/options/WITHOUT_PC_SYSINSTALL 245606 2013-01-18 15:57:09Z eadler +Set to not build +.Xr pc-sysinstall 8 +and related programs. .It Va WITHOUT_PF .\" from FreeBSD: head/tools/build/options/WITHOUT_PF 156932 2006-03-21 07:50:50Z ru Set to not build PF firewall package. From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 17:20:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9CDBE62C; Tue, 29 Jan 2013 17:20:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A411A29; Tue, 29 Jan 2013 17:20:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THKo7e084278; Tue, 29 Jan 2013 17:20:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THKoWJ084277; Tue, 29 Jan 2013 17:20:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291720.r0THKoWJ084277@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246076 - stable/9/sys/geom/mirror X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:20:50 -0000 Author: mav Date: Tue Jan 29 17:20:49 2013 New Revision: 246076 URL: http://svnweb.freebsd.org/changeset/base/246076 Log: MFC r245443: Alike to r242314 for GRAID make GMIRROR more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM MIRROR to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. PR: kern/113957 Modified: stable/9/sys/geom/mirror/g_mirror.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Tue Jan 29 17:05:21 2013 (r246075) +++ stable/9/sys/geom/mirror/g_mirror.c Tue Jan 29 17:20:49 2013 (r246076) @@ -80,7 +80,8 @@ SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, G_MIRROR_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) -static eventhandler_tag g_mirror_pre_sync = NULL; +static eventhandler_tag g_mirror_post_sync = NULL; +static int g_mirror_shutdown = 0; static int g_mirror_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -814,7 +815,7 @@ g_mirror_idle(struct g_mirror_softc *sc, return (0); if (acw > 0 || (acw == -1 && sc->sc_provider->acw > 0)) { timeout = g_mirror_idletime - (time_uptime - sc->sc_last_write); - if (timeout > 0) + if (!g_mirror_shutdown && timeout > 0) return (timeout); } sc->sc_idle = 1; @@ -2820,7 +2821,7 @@ g_mirror_access(struct g_provider *pp, i error = ENXIO; goto end; } - if (dcw == 0 && !sc->sc_idle) + if (dcw == 0) g_mirror_idle(sc, dcw); if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROYING) != 0) { if (acr > 0 || acw > 0 || ace > 0) { @@ -3231,7 +3232,7 @@ g_mirror_dumpconf(struct sbuf *sb, const } static void -g_mirror_shutdown_pre_sync(void *arg, int howto) +g_mirror_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; @@ -3241,6 +3242,7 @@ g_mirror_shutdown_pre_sync(void *arg, in mp = arg; DROP_GIANT(); g_topology_lock(); + g_mirror_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; @@ -3249,6 +3251,7 @@ g_mirror_shutdown_pre_sync(void *arg, in continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + g_mirror_idle(sc, -1); g_cancel_event(sc); error = g_mirror_destroy(sc, G_MIRROR_DESTROY_DELAYED); if (error != 0) @@ -3263,9 +3266,9 @@ static void g_mirror_init(struct g_class *mp) { - g_mirror_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_mirror_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_mirror_pre_sync == NULL) + g_mirror_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_mirror_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_mirror_post_sync == NULL) G_MIRROR_DEBUG(0, "Warning! Cannot register shutdown event."); } @@ -3273,8 +3276,8 @@ static void g_mirror_fini(struct g_class *mp) { - if (g_mirror_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_mirror_pre_sync); + if (g_mirror_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_mirror_post_sync); } DECLARE_GEOM_CLASS(g_mirror_class, g_mirror); From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 17:22:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9DCB97BA; Tue, 29 Jan 2013 17:22:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E756A42; Tue, 29 Jan 2013 17:22:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THMsXN084601; Tue, 29 Jan 2013 17:22:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THMsXk084600; Tue, 29 Jan 2013 17:22:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291722.r0THMsXk084600@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246077 - stable/8/sys/geom/mirror X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:22:54 -0000 Author: mav Date: Tue Jan 29 17:22:53 2013 New Revision: 246077 URL: http://svnweb.freebsd.org/changeset/base/246077 Log: MFC r245443: Alike to r242314 for GRAID make GMIRROR more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM MIRROR to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. PR: kern/113957 Modified: stable/8/sys/geom/mirror/g_mirror.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/8/sys/geom/mirror/g_mirror.c Tue Jan 29 17:20:49 2013 (r246076) +++ stable/8/sys/geom/mirror/g_mirror.c Tue Jan 29 17:22:53 2013 (r246077) @@ -78,7 +78,8 @@ SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, G_MIRROR_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) -static eventhandler_tag g_mirror_pre_sync = NULL; +static eventhandler_tag g_mirror_post_sync = NULL; +static int g_mirror_shutdown = 0; static int g_mirror_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -807,7 +808,7 @@ g_mirror_idle(struct g_mirror_softc *sc, return (0); if (acw > 0 || (acw == -1 && sc->sc_provider->acw > 0)) { timeout = g_mirror_idletime - (time_uptime - sc->sc_last_write); - if (timeout > 0) + if (!g_mirror_shutdown && timeout > 0) return (timeout); } sc->sc_idle = 1; @@ -2807,7 +2808,7 @@ g_mirror_access(struct g_provider *pp, i error = ENXIO; goto end; } - if (dcw == 0 && !sc->sc_idle) + if (dcw == 0) g_mirror_idle(sc, dcw); if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROYING) != 0) { if (acr > 0 || acw > 0 || ace > 0) { @@ -3213,7 +3214,7 @@ g_mirror_dumpconf(struct sbuf *sb, const } static void -g_mirror_shutdown_pre_sync(void *arg, int howto) +g_mirror_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; @@ -3223,6 +3224,7 @@ g_mirror_shutdown_pre_sync(void *arg, in mp = arg; DROP_GIANT(); g_topology_lock(); + g_mirror_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; @@ -3231,6 +3233,7 @@ g_mirror_shutdown_pre_sync(void *arg, in continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + g_mirror_idle(sc, -1); g_cancel_event(sc); error = g_mirror_destroy(sc, G_MIRROR_DESTROY_DELAYED); if (error != 0) @@ -3245,9 +3248,9 @@ static void g_mirror_init(struct g_class *mp) { - g_mirror_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_mirror_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_mirror_pre_sync == NULL) + g_mirror_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_mirror_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_mirror_post_sync == NULL) G_MIRROR_DEBUG(0, "Warning! Cannot register shutdown event."); } @@ -3255,8 +3258,8 @@ static void g_mirror_fini(struct g_class *mp) { - if (g_mirror_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_mirror_pre_sync); + if (g_mirror_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_mirror_post_sync); } DECLARE_GEOM_CLASS(g_mirror_class, g_mirror); From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 17:37:02 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4824BC92; Tue, 29 Jan 2013 17:37:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A915CAEE; Tue, 29 Jan 2013 17:36:57 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA16210; Tue, 29 Jan 2013 19:36:50 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <510808B2.2090305@FreeBSD.org> Date: Tue, 29 Jan 2013 19:36:50 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130113 Thunderbird/17.0.2 MIME-Version: 1.0 To: Alexander Motin Subject: Re: svn commit: r246077 - stable/8/sys/geom/mirror References: <201301291722.r0THMsXk084600@svn.freebsd.org> In-Reply-To: <201301291722.r0THMsXk084600@svn.freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:37:02 -0000 on 29/01/2013 19:22 Alexander Motin said the following: > ZFS tends to not close devices on shutdown BTW, I have a patch for this. It makes the code a little bit uglier, so I am not sure if we'd want it. Anyone is interested? :) -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 17:45:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67615165; Tue, 29 Jan 2013 17:45:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B19DBD5; Tue, 29 Jan 2013 17:45:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THj6F4090843; Tue, 29 Jan 2013 17:45:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THj6sA090842; Tue, 29 Jan 2013 17:45:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291745.r0THj6sA090842@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246079 - stable/9/sys/geom/raid3 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:45:06 -0000 Author: mav Date: Tue Jan 29 17:45:05 2013 New Revision: 246079 URL: http://svnweb.freebsd.org/changeset/base/246079 Log: MFC r245444: Alike to r242314 for GRAID make GRAID3 more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID3 to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. Modified: stable/9/sys/geom/raid3/g_raid3.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid3/g_raid3.c ============================================================================== --- stable/9/sys/geom/raid3/g_raid3.c Tue Jan 29 17:38:58 2013 (r246078) +++ stable/9/sys/geom/raid3/g_raid3.c Tue Jan 29 17:45:05 2013 (r246079) @@ -103,7 +103,8 @@ SYSCTL_UINT(_kern_geom_raid3_stat, OID_A G_RAID3_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) -static eventhandler_tag g_raid3_pre_sync = NULL; +static eventhandler_tag g_raid3_post_sync = NULL; +static int g_raid3_shutdown = 0; static int g_raid3_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -875,7 +876,7 @@ g_raid3_idle(struct g_raid3_softc *sc, i return (0); if (acw > 0 || (acw == -1 && sc->sc_provider->acw > 0)) { timeout = g_raid3_idletime - (time_uptime - sc->sc_last_write); - if (timeout > 0) + if (!g_raid3_shutdown && timeout > 0) return (timeout); } sc->sc_idle = 1; @@ -3097,7 +3098,7 @@ g_raid3_access(struct g_provider *pp, in error = ENXIO; goto end; } - if (dcw == 0 && !sc->sc_idle) + if (dcw == 0) g_raid3_idle(sc, dcw); if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_DESTROYING) != 0) { if (acr > 0 || acw > 0 || ace > 0) { @@ -3543,7 +3544,7 @@ g_raid3_dumpconf(struct sbuf *sb, const } static void -g_raid3_shutdown_pre_sync(void *arg, int howto) +g_raid3_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; @@ -3553,6 +3554,7 @@ g_raid3_shutdown_pre_sync(void *arg, int mp = arg; DROP_GIANT(); g_topology_lock(); + g_raid3_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; @@ -3561,6 +3563,7 @@ g_raid3_shutdown_pre_sync(void *arg, int continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + g_raid3_idle(sc, -1); g_cancel_event(sc); error = g_raid3_destroy(sc, G_RAID3_DESTROY_DELAYED); if (error != 0) @@ -3575,9 +3578,9 @@ static void g_raid3_init(struct g_class *mp) { - g_raid3_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_raid3_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_raid3_pre_sync == NULL) + g_raid3_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_raid3_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_raid3_post_sync == NULL) G_RAID3_DEBUG(0, "Warning! Cannot register shutdown event."); } @@ -3585,8 +3588,8 @@ static void g_raid3_fini(struct g_class *mp) { - if (g_raid3_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid3_pre_sync); + if (g_raid3_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_raid3_post_sync); } DECLARE_GEOM_CLASS(g_raid3_class, g_raid3); From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 17:47:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1EBE63DD; Tue, 29 Jan 2013 17:47:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 10896C19; Tue, 29 Jan 2013 17:47:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THl7cF091162; Tue, 29 Jan 2013 17:47:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THl7Mu091161; Tue, 29 Jan 2013 17:47:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291747.r0THl7Mu091161@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246080 - stable/8/sys/geom/raid3 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:47:08 -0000 Author: mav Date: Tue Jan 29 17:47:07 2013 New Revision: 246080 URL: http://svnweb.freebsd.org/changeset/base/246080 Log: MFC r245444: Alike to r242314 for GRAID make GRAID3 more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID3 to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. Modified: stable/8/sys/geom/raid3/g_raid3.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid3/g_raid3.c ============================================================================== --- stable/8/sys/geom/raid3/g_raid3.c Tue Jan 29 17:45:05 2013 (r246079) +++ stable/8/sys/geom/raid3/g_raid3.c Tue Jan 29 17:47:07 2013 (r246080) @@ -101,7 +101,8 @@ SYSCTL_UINT(_kern_geom_raid3_stat, OID_A G_RAID3_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) -static eventhandler_tag g_raid3_pre_sync = NULL; +static eventhandler_tag g_raid3_post_sync = NULL; +static int g_raid3_shutdown = 0; static int g_raid3_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -873,7 +874,7 @@ g_raid3_idle(struct g_raid3_softc *sc, i return (0); if (acw > 0 || (acw == -1 && sc->sc_provider->acw > 0)) { timeout = g_raid3_idletime - (time_uptime - sc->sc_last_write); - if (timeout > 0) + if (!g_raid3_shutdown && timeout > 0) return (timeout); } sc->sc_idle = 1; @@ -3095,7 +3096,7 @@ g_raid3_access(struct g_provider *pp, in error = ENXIO; goto end; } - if (dcw == 0 && !sc->sc_idle) + if (dcw == 0) g_raid3_idle(sc, dcw); if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_DESTROYING) != 0) { if (acr > 0 || acw > 0 || ace > 0) { @@ -3536,7 +3537,7 @@ g_raid3_dumpconf(struct sbuf *sb, const } static void -g_raid3_shutdown_pre_sync(void *arg, int howto) +g_raid3_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; @@ -3546,6 +3547,7 @@ g_raid3_shutdown_pre_sync(void *arg, int mp = arg; DROP_GIANT(); g_topology_lock(); + g_raid3_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; @@ -3554,6 +3556,7 @@ g_raid3_shutdown_pre_sync(void *arg, int continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + g_raid3_idle(sc, -1); g_cancel_event(sc); error = g_raid3_destroy(sc, G_RAID3_DESTROY_DELAYED); if (error != 0) @@ -3568,9 +3571,9 @@ static void g_raid3_init(struct g_class *mp) { - g_raid3_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_raid3_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_raid3_pre_sync == NULL) + g_raid3_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_raid3_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_raid3_post_sync == NULL) G_RAID3_DEBUG(0, "Warning! Cannot register shutdown event."); } @@ -3578,8 +3581,8 @@ static void g_raid3_fini(struct g_class *mp) { - if (g_raid3_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid3_pre_sync); + if (g_raid3_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_raid3_post_sync); } DECLARE_GEOM_CLASS(g_raid3_class, g_raid3); From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 17:51:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E4EA6E0; Tue, 29 Jan 2013 17:51:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 50360CC4; Tue, 29 Jan 2013 17:51:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THpDw3093432; Tue, 29 Jan 2013 17:51:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THpCWX093429; Tue, 29 Jan 2013 17:51:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291751.r0THpCWX093429@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246081 - in stable/9: sbin/geom/class/raid3 sys/geom/raid3 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:51:13 -0000 Author: mav Date: Tue Jan 29 17:51:12 2013 New Revision: 246081 URL: http://svnweb.freebsd.org/changeset/base/246081 Log: MFC r245456: Allow to insert new component to geom_raid3 without specifying number. PR: kern/160562 Modified: stable/9/sbin/geom/class/raid3/geom_raid3.c stable/9/sbin/geom/class/raid3/graid3.8 stable/9/sys/geom/raid3/g_raid3_ctl.c Directory Properties: stable/9/sbin/geom/class/raid3/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- stable/9/sbin/geom/class/raid3/geom_raid3.c Tue Jan 29 17:47:07 2013 (r246080) +++ stable/9/sbin/geom/class/raid3/geom_raid3.c Tue Jan 29 17:51:12 2013 (r246081) @@ -76,7 +76,7 @@ struct g_command class_commands[] = { { "insert", G_FLAG_VERBOSE, NULL, { { 'h', "hardcode", NULL, G_TYPE_BOOL }, - { 'n', "number", NULL, G_TYPE_NUMBER }, + { 'n', "number", G_VAL_OPTIONAL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, "[-hv] <-n number> name prov" Modified: stable/9/sbin/geom/class/raid3/graid3.8 ============================================================================== --- stable/9/sbin/geom/class/raid3/graid3.8 Tue Jan 29 17:47:07 2013 (r246080) +++ stable/9/sbin/geom/class/raid3/graid3.8 Tue Jan 29 17:51:12 2013 (r246081) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2010 +.Dd January 15, 2012 .Dt GRAID3 8 .Os .Sh NAME @@ -53,7 +53,7 @@ .Nm .Cm insert .Op Fl hv -.Fl n Ar number +.Op Fl n Ar number .Ar name .Ar prov .Nm @@ -171,6 +171,8 @@ Add the given component to the existing removed previously with the .Cm remove command or if one component is missing and will not be connected again. +If no number is given, new component will be added instead of first missed +component. .Pp Additional options include: .Bl -tag -width ".Fl h" Modified: stable/9/sys/geom/raid3/g_raid3_ctl.c ============================================================================== --- stable/9/sys/geom/raid3/g_raid3_ctl.c Tue Jan 29 17:47:07 2013 (r246080) +++ stable/9/sys/geom/raid3/g_raid3_ctl.c Tue Jan 29 17:51:12 2013 (r246081) @@ -404,7 +404,7 @@ g_raid3_ctl_insert(struct gctl_req *req, u_char *sector; off_t compsize; intmax_t *no; - int *hardcode, *nargs, error; + int *hardcode, *nargs, error, autono; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -425,11 +425,10 @@ g_raid3_ctl_insert(struct gctl_req *req, gctl_error(req, "No 'arg%u' argument.", 1); return; } - no = gctl_get_paraml(req, "number", sizeof(*no)); - if (no == NULL) { - gctl_error(req, "No '%s' argument.", "no"); - return; - } + if (gctl_get_param(req, "number", NULL) != NULL) + no = gctl_get_paraml(req, "number", sizeof(*no)); + else + no = NULL; if (strncmp(name, "/dev/", 5) == 0) name += 5; g_topology_lock(); @@ -465,16 +464,30 @@ g_raid3_ctl_insert(struct gctl_req *req, gctl_error(req, "No such device: %s.", name); goto end; } - if (*no >= sc->sc_ndisks) { - sx_xunlock(&sc->sc_lock); - gctl_error(req, "Invalid component number."); - goto end; - } - disk = &sc->sc_disks[*no]; - if (disk->d_state != G_RAID3_DISK_STATE_NODISK) { - sx_xunlock(&sc->sc_lock); - gctl_error(req, "Component %jd is already connected.", *no); - goto end; + if (no != NULL) { + if (*no < 0 || *no >= sc->sc_ndisks) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Invalid component number."); + goto end; + } + disk = &sc->sc_disks[*no]; + if (disk->d_state != G_RAID3_DISK_STATE_NODISK) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Component %jd is already connected.", + *no); + goto end; + } + } else { + disk = NULL; + for (autono = 0; autono < sc->sc_ndisks && disk == NULL; autono++) + if (sc->sc_disks[autono].d_state == + G_RAID3_DISK_STATE_NODISK) + disk = &sc->sc_disks[autono]; + if (disk == NULL) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "No disconnected components."); + goto end; + } } if (((sc->sc_sectorsize / (sc->sc_ndisks - 1)) % pp->sectorsize) != 0) { sx_xunlock(&sc->sc_lock); From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 17:54:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B71DC87E; Tue, 29 Jan 2013 17:54:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A41D7CE4; Tue, 29 Jan 2013 17:54:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THsRJG093901; Tue, 29 Jan 2013 17:54:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THsRU8093898; Tue, 29 Jan 2013 17:54:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291754.r0THsRU8093898@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246082 - in stable/8: sbin/geom/class/raid3 sys/geom/raid3 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 17:54:27 -0000 Author: mav Date: Tue Jan 29 17:54:26 2013 New Revision: 246082 URL: http://svnweb.freebsd.org/changeset/base/246082 Log: MFC r245456: Allow to insert new component to geom_raid3 without specifying number. PR: kern/160562 Modified: stable/8/sbin/geom/class/raid3/geom_raid3.c stable/8/sbin/geom/class/raid3/graid3.8 stable/8/sys/geom/raid3/g_raid3_ctl.c Directory Properties: stable/8/sbin/geom/class/raid3/ (props changed) stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- stable/8/sbin/geom/class/raid3/geom_raid3.c Tue Jan 29 17:51:12 2013 (r246081) +++ stable/8/sbin/geom/class/raid3/geom_raid3.c Tue Jan 29 17:54:26 2013 (r246082) @@ -76,7 +76,7 @@ struct g_command class_commands[] = { { "insert", G_FLAG_VERBOSE, NULL, { { 'h', "hardcode", NULL, G_TYPE_BOOL }, - { 'n', "number", NULL, G_TYPE_NUMBER }, + { 'n', "number", G_VAL_OPTIONAL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, NULL, "[-hv] <-n number> name prov" Modified: stable/8/sbin/geom/class/raid3/graid3.8 ============================================================================== --- stable/8/sbin/geom/class/raid3/graid3.8 Tue Jan 29 17:51:12 2013 (r246081) +++ stable/8/sbin/geom/class/raid3/graid3.8 Tue Jan 29 17:54:26 2013 (r246082) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2006 +.Dd January 15, 2012 .Dt GRAID3 8 .Os .Sh NAME @@ -52,7 +52,7 @@ .Nm .Cm insert .Op Fl hv -.Fl n Ar number +.Op Fl n Ar number .Ar name .Ar prov .Nm @@ -164,6 +164,8 @@ Add the given component to the existing removed previously with the .Cm remove command or if one component is missing and will not be connected again. +If no number is given, new component will be added instead of first missed +component. .Pp Additional options include: .Bl -tag -width ".Fl h" Modified: stable/8/sys/geom/raid3/g_raid3_ctl.c ============================================================================== --- stable/8/sys/geom/raid3/g_raid3_ctl.c Tue Jan 29 17:51:12 2013 (r246081) +++ stable/8/sys/geom/raid3/g_raid3_ctl.c Tue Jan 29 17:54:26 2013 (r246082) @@ -404,7 +404,7 @@ g_raid3_ctl_insert(struct gctl_req *req, u_char *sector; off_t compsize; intmax_t *no; - int *hardcode, *nargs, error; + int *hardcode, *nargs, error, autono; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -425,11 +425,10 @@ g_raid3_ctl_insert(struct gctl_req *req, gctl_error(req, "No 'arg%u' argument.", 1); return; } - no = gctl_get_paraml(req, "number", sizeof(*no)); - if (no == NULL) { - gctl_error(req, "No '%s' argument.", "no"); - return; - } + if (gctl_get_param(req, "number", NULL) != NULL) + no = gctl_get_paraml(req, "number", sizeof(*no)); + else + no = NULL; if (strncmp(name, "/dev/", 5) == 0) name += 5; g_topology_lock(); @@ -465,16 +464,30 @@ g_raid3_ctl_insert(struct gctl_req *req, gctl_error(req, "No such device: %s.", name); goto end; } - if (*no >= sc->sc_ndisks) { - sx_xunlock(&sc->sc_lock); - gctl_error(req, "Invalid component number."); - goto end; - } - disk = &sc->sc_disks[*no]; - if (disk->d_state != G_RAID3_DISK_STATE_NODISK) { - sx_xunlock(&sc->sc_lock); - gctl_error(req, "Component %jd is already connected.", *no); - goto end; + if (no != NULL) { + if (*no < 0 || *no >= sc->sc_ndisks) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Invalid component number."); + goto end; + } + disk = &sc->sc_disks[*no]; + if (disk->d_state != G_RAID3_DISK_STATE_NODISK) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Component %jd is already connected.", + *no); + goto end; + } + } else { + disk = NULL; + for (autono = 0; autono < sc->sc_ndisks && disk == NULL; autono++) + if (sc->sc_disks[autono].d_state == + G_RAID3_DISK_STATE_NODISK) + disk = &sc->sc_disks[autono]; + if (disk == NULL) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "No disconnected components."); + goto end; + } } if (((sc->sc_sectorsize / (sc->sc_ndisks - 1)) % pp->sectorsize) != 0) { sx_xunlock(&sc->sc_lock); From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 18:19:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42A67382; Tue, 29 Jan 2013 18:19:41 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2628BE80; Tue, 29 Jan 2013 18:19:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TIJflQ001178; Tue, 29 Jan 2013 18:19:41 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TIJeYW001176; Tue, 29 Jan 2013 18:19:40 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301291819.r0TIJeYW001176@svn.freebsd.org> From: Brooks Davis Date: Tue, 29 Jan 2013 18:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246083 - head/bin/cat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 18:19:41 -0000 Author: brooks Date: Tue Jan 29 18:19:40 2013 New Revision: 246083 URL: http://svnweb.freebsd.org/changeset/base/246083 Log: Add -l option to cat(1). This option causes cat(1) to use fcntl(2) to set an exclusive advisory lock on stdout. This will be used to guarantee orderly writing to METALOG. Sponsored by: DARPA, AFRL Obtained from: NetBSD (mason) Modified: head/bin/cat/cat.1 head/bin/cat/cat.c Modified: head/bin/cat/cat.1 ============================================================================== --- head/bin/cat/cat.1 Tue Jan 29 17:54:26 2013 (r246082) +++ head/bin/cat/cat.1 Tue Jan 29 18:19:40 2013 (r246083) @@ -32,7 +32,7 @@ .\" @(#)cat.1 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd March 21, 2004 +.Dd Jaunary 29, 2013 .Dt CAT 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd concatenate and print files .Sh SYNOPSIS .Nm -.Op Fl benstuv +.Op Fl belnstuv .Op Ar .Sh DESCRIPTION The @@ -79,6 +79,16 @@ Display non-printing characters (see the option), and display a dollar sign .Pq Ql \&$ at the end of each line. +.It Fl l +Set an exclusive advisory lock on the standard output file descriptor. +This lock is set using +.Xr fcntl 2 +with the +.Dv F_SETLKW +command. +If the output file is already locked, +.Nm +will block until the lock is acquired. .It Fl n Number the output lines, starting at 1. .It Fl s @@ -160,6 +170,7 @@ operand. .Xr tail 1 , .Xr vis 1 , .Xr zcat 1 , +.Xr fcntl 2 , .Xr setbuf 3 .Rs .%A Rob Pike @@ -175,7 +186,7 @@ utility is compliant with the specification. .Pp The flags -.Op Fl benstv +.Op Fl belnstv are extensions to the specification. .Sh HISTORY A Modified: head/bin/cat/cat.c ============================================================================== --- head/bin/cat/cat.c Tue Jan 29 17:54:26 2013 (r246082) +++ head/bin/cat/cat.c Tue Jan 29 18:19:40 2013 (r246083) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include -static int bflag, eflag, nflag, sflag, tflag, vflag; +static int bflag, eflag, lflag, nflag, sflag, tflag, vflag; static int rval; static const char *filename; @@ -96,10 +96,11 @@ int main(int argc, char *argv[]) { int ch; + struct flock stdout_lock; setlocale(LC_CTYPE, ""); - while ((ch = getopt(argc, argv, "benstuv")) != -1) + while ((ch = getopt(argc, argv, "belnstuv")) != -1) switch (ch) { case 'b': bflag = nflag = 1; /* -b implies -n */ @@ -107,6 +108,9 @@ main(int argc, char *argv[]) case 'e': eflag = vflag = 1; /* -e implies -v */ break; + case 'l': + lflag = 1; + break; case 'n': nflag = 1; break; @@ -127,6 +131,15 @@ main(int argc, char *argv[]) } argv += optind; + if (lflag) { + stdout_lock.l_len = 0; + stdout_lock.l_start = 0; + stdout_lock.l_type = F_WRLCK; + stdout_lock.l_whence = SEEK_SET; + if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) == -1) + err(EXIT_FAILURE, "stdout"); + } + if (bflag || eflag || nflag || sflag || tflag || vflag) scanfiles(argv, 1); else @@ -140,7 +153,7 @@ main(int argc, char *argv[]) static void usage(void) { - fprintf(stderr, "usage: cat [-benstuv] [file ...]\n"); + fprintf(stderr, "usage: cat [-belnstuv] [file ...]\n"); exit(1); /* NOTREACHED */ } From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 18:22:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DA5BD521; Tue, 29 Jan 2013 18:22:38 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C896FE9E; Tue, 29 Jan 2013 18:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TIMc6V003323; Tue, 29 Jan 2013 18:22:38 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TIMcR6003322; Tue, 29 Jan 2013 18:22:38 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301291822.r0TIMcR6003322@svn.freebsd.org> From: Brooks Davis Date: Tue, 29 Jan 2013 18:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246084 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 18:22:38 -0000 Author: brooks Date: Tue Jan 29 18:22:38 2013 New Revision: 246084 URL: http://svnweb.freebsd.org/changeset/base/246084 Log: Bump __FreeBSD_version for cat -l (soon to be a bootstrap tool). Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Jan 29 18:19:40 2013 (r246083) +++ head/sys/sys/param.h Tue Jan 29 18:22:38 2013 (r246084) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000026 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000027 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 18:41:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1CC9D7CA; Tue, 29 Jan 2013 18:41:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 006CCF36; Tue, 29 Jan 2013 18:41:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TIfXVU008952; Tue, 29 Jan 2013 18:41:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TIfUxs008927; Tue, 29 Jan 2013 18:41:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301291841.r0TIfUxs008927@svn.freebsd.org> From: John Baldwin Date: Tue, 29 Jan 2013 18:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246085 - in head/sys: amd64/linux32 compat/linprocfs compat/linux i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 18:41:34 -0000 Author: jhb Date: Tue Jan 29 18:41:30 2013 New Revision: 246085 URL: http://svnweb.freebsd.org/changeset/base/246085 Log: Reduce duplication between i386/linux/linux.h and amd64/linux32/linux.h by moving bits that are MI out into headers in compat/linux. Reviewed by: Chagin Dmitry dmitry | gmail MFC after: 2 weeks Modified: head/sys/amd64/linux32/linux.h head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_file.h head/sys/compat/linux/linux_fork.c head/sys/compat/linux/linux_ioctl.h head/sys/compat/linux/linux_ipc.h head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_misc.h head/sys/compat/linux/linux_signal.h head/sys/compat/linux/linux_socket.h head/sys/compat/linux/linux_sysctl.c head/sys/compat/linux/linux_time.c head/sys/i386/linux/linux.h head/sys/i386/linux/linux_ptrace.c head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/amd64/linux32/linux.h Tue Jan 29 18:41:30 2013 (r246085) @@ -107,11 +107,6 @@ typedef struct { /* * Miscellaneous */ -#define LINUX_NAME_MAX 255 -#define LINUX_MAX_UTSNAME 65 - -#define LINUX_CTL_MAXNAME 10 - #define LINUX_AT_COUNT 16 /* Count of used aux entry types. * Keep this synchronized with * elf_linux_fixup() code. @@ -127,11 +122,6 @@ struct l___sysctl_args l_ulong __spare[4]; } __packed; -/* Scheduling policies */ -#define LINUX_SCHED_OTHER 0 -#define LINUX_SCHED_FIFO 1 -#define LINUX_SCHED_RR 2 - /* Resource limits */ #define LINUX_RLIMIT_CPU 0 #define LINUX_RLIMIT_FSIZE 1 @@ -265,15 +255,6 @@ struct l_statfs64 { l_int f_spare[6]; } __packed; -struct l_new_utsname { - char sysname[LINUX_MAX_UTSNAME]; - char nodename[LINUX_MAX_UTSNAME]; - char release[LINUX_MAX_UTSNAME]; - char version[LINUX_MAX_UTSNAME]; - char machine[LINUX_MAX_UTSNAME]; - char domainname[LINUX_MAX_UTSNAME]; -} __packed; - /* * Signalling */ @@ -535,27 +516,9 @@ struct l_rt_sigframe { l_handler_t sf_handler; } __packed; -extern int bsd_to_linux_signal[]; -extern int linux_to_bsd_signal[]; extern struct sysentvec elf_linux_sysvec; /* - * Pluggable ioctl handlers - */ -struct linux_ioctl_args; -struct thread; - -typedef int linux_ioctl_function_t(struct thread *, struct linux_ioctl_args *); - -struct linux_ioctl_handler { - linux_ioctl_function_t *func; - int low, high; -}; - -int linux_ioctl_register_handler(struct linux_ioctl_handler *h); -int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h); - -/* * open/fcntl flags */ #define LINUX_O_RDONLY 00000000 @@ -597,65 +560,6 @@ int linux_ioctl_unregister_handler(struc #define LINUX_F_WRLCK 1 #define LINUX_F_UNLCK 2 -/* - * posix_fadvise advice - */ -#define LINUX_POSIX_FADV_NORMAL 0 -#define LINUX_POSIX_FADV_RANDOM 1 -#define LINUX_POSIX_FADV_SEQUENTIAL 2 -#define LINUX_POSIX_FADV_WILLNEED 3 -#define LINUX_POSIX_FADV_DONTNEED 4 -#define LINUX_POSIX_FADV_NOREUSE 5 - -/* - * mount flags - */ -#define LINUX_MS_RDONLY 0x0001 -#define LINUX_MS_NOSUID 0x0002 -#define LINUX_MS_NODEV 0x0004 -#define LINUX_MS_NOEXEC 0x0008 -#define LINUX_MS_REMOUNT 0x0020 - -/* - * SystemV IPC defines - */ -#define LINUX_SEMOP 1 -#define LINUX_SEMGET 2 -#define LINUX_SEMCTL 3 -#define LINUX_MSGSND 11 -#define LINUX_MSGRCV 12 -#define LINUX_MSGGET 13 -#define LINUX_MSGCTL 14 -#define LINUX_SHMAT 21 -#define LINUX_SHMDT 22 -#define LINUX_SHMGET 23 -#define LINUX_SHMCTL 24 - -#define LINUX_IPC_RMID 0 -#define LINUX_IPC_SET 1 -#define LINUX_IPC_STAT 2 -#define LINUX_IPC_INFO 3 - -#define LINUX_SHM_LOCK 11 -#define LINUX_SHM_UNLOCK 12 -#define LINUX_SHM_STAT 13 -#define LINUX_SHM_INFO 14 - -#define LINUX_SHM_RDONLY 0x1000 -#define LINUX_SHM_RND 0x2000 -#define LINUX_SHM_REMAP 0x4000 - -/* semctl commands */ -#define LINUX_GETPID 11 -#define LINUX_GETVAL 12 -#define LINUX_GETALL 13 -#define LINUX_GETNCNT 14 -#define LINUX_GETZCNT 15 -#define LINUX_SETVAL 16 -#define LINUX_SETALL 17 -#define LINUX_SEM_STAT 18 -#define LINUX_SEM_INFO 19 - union l_semun { l_int val; l_uintptr_t buf; @@ -667,25 +571,6 @@ union l_semun { /* * Socket defines */ -#define LINUX_SOCKET 1 -#define LINUX_BIND 2 -#define LINUX_CONNECT 3 -#define LINUX_LISTEN 4 -#define LINUX_ACCEPT 5 -#define LINUX_GETSOCKNAME 6 -#define LINUX_GETPEERNAME 7 -#define LINUX_SOCKETPAIR 8 -#define LINUX_SEND 9 -#define LINUX_RECV 10 -#define LINUX_SENDTO 11 -#define LINUX_RECVFROM 12 -#define LINUX_SHUTDOWN 13 -#define LINUX_SETSOCKOPT 14 -#define LINUX_GETSOCKOPT 15 -#define LINUX_SENDMSG 16 -#define LINUX_RECVMSG 17 -#define LINUX_ACCEPT4 18 - #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 #define LINUX_SOL_IPX 256 @@ -714,24 +599,6 @@ union l_semun { #define LINUX_SO_TIMESTAMP 29 #define LINUX_SO_ACCEPTCONN 30 -#define LINUX_IP_TOS 1 -#define LINUX_IP_TTL 2 -#define LINUX_IP_HDRINCL 3 -#define LINUX_IP_OPTIONS 4 - -#define LINUX_IP_MULTICAST_IF 32 -#define LINUX_IP_MULTICAST_TTL 33 -#define LINUX_IP_MULTICAST_LOOP 34 -#define LINUX_IP_ADD_MEMBERSHIP 35 -#define LINUX_IP_DROP_MEMBERSHIP 36 - -#define LINUX_TCP_NODELAY 1 -#define LINUX_TCP_MAXSEG 2 -#define LINUX_TCP_KEEPIDLE 4 -#define LINUX_TCP_KEEPINTVL 5 -#define LINUX_TCP_KEEPCNT 6 -#define LINUX_TCP_MD5SIG 14 - struct l_sockaddr { l_ushort sa_family; char sa_data[14]; @@ -897,30 +764,6 @@ struct l_user_desc { #define LINUX_GET_USEABLE(desc) \ (((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1) -#define LINUX_CLOCK_REALTIME 0 -#define LINUX_CLOCK_MONOTONIC 1 -#define LINUX_CLOCK_PROCESS_CPUTIME_ID 2 -#define LINUX_CLOCK_THREAD_CPUTIME_ID 3 -#define LINUX_CLOCK_REALTIME_HR 4 -#define LINUX_CLOCK_MONOTONIC_HR 5 - -#define LINUX_CLONE_VM 0x00000100 -#define LINUX_CLONE_FS 0x00000200 -#define LINUX_CLONE_FILES 0x00000400 -#define LINUX_CLONE_SIGHAND 0x00000800 -#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */ -#define LINUX_CLONE_VFORK 0x00004000 -#define LINUX_CLONE_PARENT 0x00008000 -#define LINUX_CLONE_THREAD 0x00010000 -#define LINUX_CLONE_SETTLS 0x00080000 -#define LINUX_CLONE_PARENT_SETTID 0x00100000 -#define LINUX_CLONE_CHILD_CLEARTID 0x00200000 -#define LINUX_CLONE_CHILD_SETTID 0x01000000 - -#define LINUX_THREADING_FLAGS \ - (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \ - LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD) - struct iovec; struct l_iovec32 { @@ -942,7 +785,4 @@ struct linux_robust_list_head { l_uintptr_t pending_list; }; -int linux_set_upcall_kse(struct thread *td, register_t stack); -int linux_set_cloned_tls(struct thread *td, void *desc); - #endif /* !_AMD64_LINUX_H_ */ Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Jan 29 18:41:30 2013 (r246085) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linprocfs/linprocfs.c Tue Jan 29 18:41:30 2013 (r246085) @@ -101,13 +101,9 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef COMPAT_LINUX32 /* XXX */ -#include -#else -#include -#endif #include #include +#include #include #include #include Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_emul.c Tue Jan 29 18:41:30 2013 (r246085) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /** * Special DTrace provider for the linuxulator. Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_file.c Tue Jan 29 18:41:30 2013 (r246085) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include #include #include Modified: head/sys/compat/linux/linux_file.h ============================================================================== --- head/sys/compat/linux/linux_file.h Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_file.h Tue Jan 29 18:41:30 2013 (r246085) @@ -35,4 +35,23 @@ #define LINUX_AT_REMOVEDIR 0x200 #define LINUX_AT_SYMLINK_FOLLOW 0x400 +/* + * posix_fadvise advice + */ +#define LINUX_POSIX_FADV_NORMAL 0 +#define LINUX_POSIX_FADV_RANDOM 1 +#define LINUX_POSIX_FADV_SEQUENTIAL 2 +#define LINUX_POSIX_FADV_WILLNEED 3 +#define LINUX_POSIX_FADV_DONTNEED 4 +#define LINUX_POSIX_FADV_NOREUSE 5 + +/* + * mount flags + */ +#define LINUX_MS_RDONLY 0x0001 +#define LINUX_MS_NOSUID 0x0002 +#define LINUX_MS_NODEV 0x0004 +#define LINUX_MS_NOEXEC 0x0008 +#define LINUX_MS_REMOUNT 0x0020 + #endif /* !_LINUX_FILE_H_ */ Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_fork.c Tue Jan 29 18:41:30 2013 (r246085) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); Modified: head/sys/compat/linux/linux_ioctl.h ============================================================================== --- head/sys/compat/linux/linux_ioctl.h Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_ioctl.h Tue Jan 29 18:41:30 2013 (r246085) @@ -748,4 +748,20 @@ int linux_ifname(struct ifnet *, char #define FBSD_LUSB_MAX 0xffff #define FBSD_LUSB_MIN 0xffe0 +/* + * Pluggable ioctl handlers + */ +struct linux_ioctl_args; +struct thread; + +typedef int linux_ioctl_function_t(struct thread *, struct linux_ioctl_args *); + +struct linux_ioctl_handler { + linux_ioctl_function_t *func; + int low, high; +}; + +int linux_ioctl_register_handler(struct linux_ioctl_handler *h); +int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h); + #endif /* !_LINUX_IOCTL_H_ */ Modified: head/sys/compat/linux/linux_ipc.h ============================================================================== --- head/sys/compat/linux/linux_ipc.h Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_ipc.h Tue Jan 29 18:41:30 2013 (r246085) @@ -32,6 +32,48 @@ #define _LINUX_IPC_H_ /* + * SystemV IPC defines + */ +#define LINUX_SEMOP 1 +#define LINUX_SEMGET 2 +#define LINUX_SEMCTL 3 +#define LINUX_MSGSND 11 +#define LINUX_MSGRCV 12 +#define LINUX_MSGGET 13 +#define LINUX_MSGCTL 14 +#define LINUX_SHMAT 21 +#define LINUX_SHMDT 22 +#define LINUX_SHMGET 23 +#define LINUX_SHMCTL 24 + +#define LINUX_IPC_RMID 0 +#define LINUX_IPC_SET 1 +#define LINUX_IPC_STAT 2 +#define LINUX_IPC_INFO 3 + +#define LINUX_MSG_INFO 12 + +#define LINUX_SHM_LOCK 11 +#define LINUX_SHM_UNLOCK 12 +#define LINUX_SHM_STAT 13 +#define LINUX_SHM_INFO 14 + +#define LINUX_SHM_RDONLY 0x1000 +#define LINUX_SHM_RND 0x2000 +#define LINUX_SHM_REMAP 0x4000 + +/* semctl commands */ +#define LINUX_GETPID 11 +#define LINUX_GETVAL 12 +#define LINUX_GETALL 13 +#define LINUX_GETNCNT 14 +#define LINUX_GETZCNT 15 +#define LINUX_SETVAL 16 +#define LINUX_SETALL 17 +#define LINUX_SEM_STAT 18 +#define LINUX_SEM_INFO 19 + +/* * Version flags for semctl, msgctl, and shmctl commands * These are passed as bitflags or-ed with the actual command */ @@ -135,8 +177,6 @@ int linux_shmctl(struct thread *, struct int linux_shmdt(struct thread *, struct linux_shmdt_args *); int linux_shmget(struct thread *, struct linux_shmget_args *); -#define LINUX_MSG_INFO 12 - #endif /* __i386__ || __amd64__ */ #endif /* _LINUX_IPC_H_ */ Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_mib.c Tue Jan 29 18:41:30 2013 (r246085) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); Modified: head/sys/compat/linux/linux_misc.h ============================================================================== --- head/sys/compat/linux/linux_misc.h Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_misc.h Tue Jan 29 18:41:30 2013 (r246085) @@ -31,6 +31,14 @@ #ifndef _LINUX_MISC_H_ #define _LINUX_MISC_H_ +/* + * Miscellaneous + */ +#define LINUX_NAME_MAX 255 +#define LINUX_MAX_UTSNAME 65 + +#define LINUX_CTL_MAXNAME 10 + /* defines for prctl */ #define LINUX_PR_SET_PDEATHSIG 1 /* Second arg is a signal. */ #define LINUX_PR_GET_PDEATHSIG 2 /* @@ -67,11 +75,51 @@ extern const char *linux_platform; #define __LINUX_NPXCW__ 0x37f #endif +#define LINUX_CLONE_VM 0x00000100 +#define LINUX_CLONE_FS 0x00000200 +#define LINUX_CLONE_FILES 0x00000400 +#define LINUX_CLONE_SIGHAND 0x00000800 +#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */ +#define LINUX_CLONE_VFORK 0x00004000 +#define LINUX_CLONE_PARENT 0x00008000 +#define LINUX_CLONE_THREAD 0x00010000 +#define LINUX_CLONE_SETTLS 0x00080000 +#define LINUX_CLONE_PARENT_SETTID 0x00100000 +#define LINUX_CLONE_CHILD_CLEARTID 0x00200000 +#define LINUX_CLONE_CHILD_SETTID 0x01000000 + +#define LINUX_THREADING_FLAGS \ + (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \ + LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD) + +/* Scheduling policies */ +#define LINUX_SCHED_OTHER 0 +#define LINUX_SCHED_FIFO 1 +#define LINUX_SCHED_RR 2 + +struct l_new_utsname { + char sysname[LINUX_MAX_UTSNAME]; + char nodename[LINUX_MAX_UTSNAME]; + char release[LINUX_MAX_UTSNAME]; + char version[LINUX_MAX_UTSNAME]; + char machine[LINUX_MAX_UTSNAME]; + char domainname[LINUX_MAX_UTSNAME]; +}; + +#define LINUX_CLOCK_REALTIME 0 +#define LINUX_CLOCK_MONOTONIC 1 +#define LINUX_CLOCK_PROCESS_CPUTIME_ID 2 +#define LINUX_CLOCK_THREAD_CPUTIME_ID 3 +#define LINUX_CLOCK_REALTIME_HR 4 +#define LINUX_CLOCK_MONOTONIC_HR 5 + extern int stclohz; #define __WCLONE 0x80000000 int linux_common_wait(struct thread *td, int pid, int *status, int options, struct rusage *ru); +int linux_set_upcall_kse(struct thread *td, register_t stack); +int linux_set_cloned_tls(struct thread *td, void *desc); #endif /* _LINUX_MISC_H_ */ Modified: head/sys/compat/linux/linux_signal.h ============================================================================== --- head/sys/compat/linux/linux_signal.h Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_signal.h Tue Jan 29 18:41:30 2013 (r246085) @@ -33,6 +33,9 @@ #define LINUX_SI_TKILL -6; +extern int bsd_to_linux_signal[]; +extern int linux_to_bsd_signal[]; + void linux_to_bsd_sigset(l_sigset_t *, sigset_t *); void bsd_to_linux_sigset(sigset_t *, l_sigset_t *); int linux_do_sigaction(struct thread *, int, l_sigaction_t *, l_sigaction_t *); Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_socket.h Tue Jan 29 18:41:30 2013 (r246085) @@ -116,4 +116,44 @@ struct l_ucred { uint32_t gid; }; +/* Operations for socketcall */ + +#define LINUX_SOCKET 1 +#define LINUX_BIND 2 +#define LINUX_CONNECT 3 +#define LINUX_LISTEN 4 +#define LINUX_ACCEPT 5 +#define LINUX_GETSOCKNAME 6 +#define LINUX_GETPEERNAME 7 +#define LINUX_SOCKETPAIR 8 +#define LINUX_SEND 9 +#define LINUX_RECV 10 +#define LINUX_SENDTO 11 +#define LINUX_RECVFROM 12 +#define LINUX_SHUTDOWN 13 +#define LINUX_SETSOCKOPT 14 +#define LINUX_GETSOCKOPT 15 +#define LINUX_SENDMSG 16 +#define LINUX_RECVMSG 17 +#define LINUX_ACCEPT4 18 + +/* Socket options */ +#define LINUX_IP_TOS 1 +#define LINUX_IP_TTL 2 +#define LINUX_IP_HDRINCL 3 +#define LINUX_IP_OPTIONS 4 + +#define LINUX_IP_MULTICAST_IF 32 +#define LINUX_IP_MULTICAST_TTL 33 +#define LINUX_IP_MULTICAST_LOOP 34 +#define LINUX_IP_ADD_MEMBERSHIP 35 +#define LINUX_IP_DROP_MEMBERSHIP 36 + +#define LINUX_TCP_NODELAY 1 +#define LINUX_TCP_MAXSEG 2 +#define LINUX_TCP_KEEPIDLE 4 +#define LINUX_TCP_KEEPINTVL 5 +#define LINUX_TCP_KEEPCNT 6 +#define LINUX_TCP_MD5SIG 14 + #endif /* _LINUX_SOCKET_H_ */ Modified: head/sys/compat/linux/linux_sysctl.c ============================================================================== --- head/sys/compat/linux/linux_sysctl.c Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_sysctl.c Tue Jan 29 18:41:30 2013 (r246085) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #include #define LINUX_CTL_KERN 1 Modified: head/sys/compat/linux/linux_time.c ============================================================================== --- head/sys/compat/linux/linux_time.c Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/compat/linux/linux_time.c Tue Jan 29 18:41:30 2013 (r246085) @@ -60,6 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c #endif #include +#include /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/i386/linux/linux.h Tue Jan 29 18:41:30 2013 (r246085) @@ -101,11 +101,6 @@ typedef struct { /* * Miscellaneous */ -#define LINUX_NAME_MAX 255 -#define LINUX_MAX_UTSNAME 65 - -#define LINUX_CTL_MAXNAME 10 - #define LINUX_AT_COUNT 16 /* Count of used aux entry types. * Keep this synchronized with * elf_linux_fixup() code. @@ -121,11 +116,6 @@ struct l___sysctl_args l_ulong __spare[4]; }; -/* Scheduling policies */ -#define LINUX_SCHED_OTHER 0 -#define LINUX_SCHED_FIFO 1 -#define LINUX_SCHED_RR 2 - /* Resource limits */ #define LINUX_RLIMIT_CPU 0 #define LINUX_RLIMIT_FSIZE 1 @@ -240,15 +230,6 @@ struct l_statfs64 { l_int f_spare[6]; }; -struct l_new_utsname { - char sysname[LINUX_MAX_UTSNAME]; - char nodename[LINUX_MAX_UTSNAME]; - char release[LINUX_MAX_UTSNAME]; - char version[LINUX_MAX_UTSNAME]; - char machine[LINUX_MAX_UTSNAME]; - char domainname[LINUX_MAX_UTSNAME]; -}; - /* * Signalling */ @@ -510,28 +491,10 @@ struct l_rt_sigframe { l_handler_t sf_handler; }; -extern int bsd_to_linux_signal[]; -extern int linux_to_bsd_signal[]; extern struct sysentvec linux_sysvec; extern struct sysentvec elf_linux_sysvec; /* - * Pluggable ioctl handlers - */ -struct linux_ioctl_args; -struct thread; - -typedef int linux_ioctl_function_t(struct thread *, struct linux_ioctl_args *); - -struct linux_ioctl_handler { - linux_ioctl_function_t *func; - int low, high; -}; - -int linux_ioctl_register_handler(struct linux_ioctl_handler *h); -int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h); - -/* * open/fcntl flags */ #define LINUX_O_RDONLY 00000000 @@ -573,65 +536,6 @@ int linux_ioctl_unregister_handler(struc #define LINUX_F_WRLCK 1 #define LINUX_F_UNLCK 2 -/* - * posix_fadvise advice - */ -#define LINUX_POSIX_FADV_NORMAL 0 -#define LINUX_POSIX_FADV_RANDOM 1 -#define LINUX_POSIX_FADV_SEQUENTIAL 2 -#define LINUX_POSIX_FADV_WILLNEED 3 -#define LINUX_POSIX_FADV_DONTNEED 4 -#define LINUX_POSIX_FADV_NOREUSE 5 - -/* - * mount flags - */ -#define LINUX_MS_RDONLY 0x0001 -#define LINUX_MS_NOSUID 0x0002 -#define LINUX_MS_NODEV 0x0004 -#define LINUX_MS_NOEXEC 0x0008 -#define LINUX_MS_REMOUNT 0x0020 - -/* - * SystemV IPC defines - */ -#define LINUX_SEMOP 1 -#define LINUX_SEMGET 2 -#define LINUX_SEMCTL 3 -#define LINUX_MSGSND 11 -#define LINUX_MSGRCV 12 -#define LINUX_MSGGET 13 -#define LINUX_MSGCTL 14 -#define LINUX_SHMAT 21 -#define LINUX_SHMDT 22 -#define LINUX_SHMGET 23 -#define LINUX_SHMCTL 24 - -#define LINUX_IPC_RMID 0 -#define LINUX_IPC_SET 1 -#define LINUX_IPC_STAT 2 -#define LINUX_IPC_INFO 3 - -#define LINUX_SHM_LOCK 11 -#define LINUX_SHM_UNLOCK 12 -#define LINUX_SHM_STAT 13 -#define LINUX_SHM_INFO 14 - -#define LINUX_SHM_RDONLY 0x1000 -#define LINUX_SHM_RND 0x2000 -#define LINUX_SHM_REMAP 0x4000 - -/* semctl commands */ -#define LINUX_GETPID 11 -#define LINUX_GETVAL 12 -#define LINUX_GETALL 13 -#define LINUX_GETNCNT 14 -#define LINUX_GETZCNT 15 -#define LINUX_SETVAL 16 -#define LINUX_SETALL 17 -#define LINUX_SEM_STAT 18 -#define LINUX_SEM_INFO 19 - union l_semun { l_int val; struct l_semid_ds *buf; @@ -643,25 +547,6 @@ union l_semun { /* * Socket defines */ -#define LINUX_SOCKET 1 -#define LINUX_BIND 2 -#define LINUX_CONNECT 3 -#define LINUX_LISTEN 4 -#define LINUX_ACCEPT 5 -#define LINUX_GETSOCKNAME 6 -#define LINUX_GETPEERNAME 7 -#define LINUX_SOCKETPAIR 8 -#define LINUX_SEND 9 -#define LINUX_RECV 10 -#define LINUX_SENDTO 11 -#define LINUX_RECVFROM 12 -#define LINUX_SHUTDOWN 13 -#define LINUX_SETSOCKOPT 14 -#define LINUX_GETSOCKOPT 15 -#define LINUX_SENDMSG 16 -#define LINUX_RECVMSG 17 -#define LINUX_ACCEPT4 18 - #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 #define LINUX_SOL_IPX 256 @@ -690,24 +575,6 @@ union l_semun { #define LINUX_SO_TIMESTAMP 29 #define LINUX_SO_ACCEPTCONN 30 -#define LINUX_IP_TOS 1 -#define LINUX_IP_TTL 2 -#define LINUX_IP_HDRINCL 3 -#define LINUX_IP_OPTIONS 4 - -#define LINUX_IP_MULTICAST_IF 32 -#define LINUX_IP_MULTICAST_TTL 33 -#define LINUX_IP_MULTICAST_LOOP 34 -#define LINUX_IP_ADD_MEMBERSHIP 35 -#define LINUX_IP_DROP_MEMBERSHIP 36 - -#define LINUX_TCP_NODELAY 1 -#define LINUX_TCP_MAXSEG 2 -#define LINUX_TCP_KEEPIDLE 4 -#define LINUX_TCP_KEEPINTVL 5 -#define LINUX_TCP_KEEPCNT 6 -#define LINUX_TCP_MD5SIG 14 - struct l_sockaddr { l_ushort sa_family; char sa_data[14]; @@ -867,30 +734,6 @@ struct l_desc_struct { #define LINUX_GET_USEABLE(desc) \ (((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1) -#define LINUX_CLOCK_REALTIME 0 -#define LINUX_CLOCK_MONOTONIC 1 -#define LINUX_CLOCK_PROCESS_CPUTIME_ID 2 -#define LINUX_CLOCK_THREAD_CPUTIME_ID 3 -#define LINUX_CLOCK_REALTIME_HR 4 -#define LINUX_CLOCK_MONOTONIC_HR 5 - -#define LINUX_CLONE_VM 0x00000100 -#define LINUX_CLONE_FS 0x00000200 -#define LINUX_CLONE_FILES 0x00000400 -#define LINUX_CLONE_SIGHAND 0x00000800 -#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */ -#define LINUX_CLONE_VFORK 0x00004000 -#define LINUX_CLONE_PARENT 0x00008000 -#define LINUX_CLONE_THREAD 0x00010000 -#define LINUX_CLONE_SETTLS 0x00080000 -#define LINUX_CLONE_PARENT_SETTID 0x00100000 -#define LINUX_CLONE_CHILD_CLEARTID 0x00200000 -#define LINUX_CLONE_CHILD_SETTID 0x01000000 - -#define LINUX_THREADING_FLAGS \ - (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \ - LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD) - /* robust futexes */ struct linux_robust_list { struct linux_robust_list *next; @@ -902,7 +745,4 @@ struct linux_robust_list_head { struct linux_robust_list *pending_list; }; -int linux_set_upcall_kse(struct thread *td, register_t stack); -int linux_set_cloned_tls(struct thread *td, void *desc); - #endif /* !_I386_LINUX_H_ */ Modified: head/sys/i386/linux/linux_ptrace.c ============================================================================== --- head/sys/i386/linux/linux_ptrace.c Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/i386/linux/linux_ptrace.c Tue Jan 29 18:41:30 2013 (r246085) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) #define CPU_ENABLE_SSE Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Tue Jan 29 18:22:38 2013 (r246084) +++ head/sys/i386/linux/linux_sysvec.c Tue Jan 29 18:41:30 2013 (r246085) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 19:06:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 23114FD6; Tue, 29 Jan 2013 19:06:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1593DBA; Tue, 29 Jan 2013 19:06:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TJ6GZY015733; Tue, 29 Jan 2013 19:06:16 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TJ6GwN015731; Tue, 29 Jan 2013 19:06:16 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201301291906.r0TJ6GwN015731@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 29 Jan 2013 19:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246087 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 19:06:17 -0000 Author: glebius Date: Tue Jan 29 19:06:16 2013 New Revision: 246087 URL: http://svnweb.freebsd.org/changeset/base/246087 Log: Fix typo in debug printf. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Jan 29 19:02:43 2013 (r246086) +++ head/sys/vm/uma_core.c Tue Jan 29 19:06:16 2013 (r246087) @@ -1702,7 +1702,7 @@ uma_startup(void *bootmem, int boot_page #ifdef UMA_DEBUG printf("Calculated uma_max_ipers (for OFFPAGE) is %d\n", uma_max_ipers); - printf("Calculated uma_max_ipers_slab (for OFFPAGE) is %d\n", + printf("Calculated uma_max_ipers_ref (for OFFPAGE) is %d\n", uma_max_ipers_ref); #endif From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 20:01:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2355737C; Tue, 29 Jan 2013 20:01:48 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F22072FC; Tue, 29 Jan 2013 20:01:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TK1l4W033746; Tue, 29 Jan 2013 20:01:47 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TK1lPM033744; Tue, 29 Jan 2013 20:01:47 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201301292001.r0TK1lPM033744@svn.freebsd.org> From: Joel Dahl Date: Tue, 29 Jan 2013 20:01:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246090 - head/bin/cat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 20:01:48 -0000 Author: joel (doc committer) Date: Tue Jan 29 20:01:47 2013 New Revision: 246090 URL: http://svnweb.freebsd.org/changeset/base/246090 Log: Fix date. Modified: head/bin/cat/cat.1 Modified: head/bin/cat/cat.1 ============================================================================== --- head/bin/cat/cat.1 Tue Jan 29 19:59:56 2013 (r246089) +++ head/bin/cat/cat.1 Tue Jan 29 20:01:47 2013 (r246090) @@ -32,7 +32,7 @@ .\" @(#)cat.1 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd Jaunary 29, 2013 +.Dd January 29, 2013 .Dt CAT 1 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 20:05:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 806476E2; Tue, 29 Jan 2013 20:05:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58B8F348; Tue, 29 Jan 2013 20:05:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TK5Jrx034451; Tue, 29 Jan 2013 20:05:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TK5GpN034429; Tue, 29 Jan 2013 20:05:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301292005.r0TK5GpN034429@svn.freebsd.org> From: Xin LI Date: Tue, 29 Jan 2013 20:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246091 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 20:05:19 -0000 Author: delphij Date: Tue Jan 29 20:05:16 2013 New Revision: 246091 URL: http://svnweb.freebsd.org/changeset/base/246091 Log: - Refresh code with latest OpenBSD revisions. - Remove $DragonFly$ tags as they are using git nowadays and VCS tags will not help merging. - Other changes to Copyright headers to make them consistent with other source code, we intend to fork from this point. Reviewed by: pfg Modified: head/usr.bin/patch/Makefile head/usr.bin/patch/backupfile.c head/usr.bin/patch/backupfile.h head/usr.bin/patch/common.h head/usr.bin/patch/inp.c head/usr.bin/patch/inp.h head/usr.bin/patch/mkpath.c head/usr.bin/patch/patch.1 head/usr.bin/patch/patch.c head/usr.bin/patch/pathnames.h head/usr.bin/patch/pch.c head/usr.bin/patch/pch.h head/usr.bin/patch/util.c head/usr.bin/patch/util.h Modified: head/usr.bin/patch/Makefile ============================================================================== --- head/usr.bin/patch/Makefile Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/Makefile Tue Jan 29 20:05:16 2013 (r246091) @@ -1,6 +1,5 @@ -# $FreeBSD$ # $OpenBSD: Makefile,v 1.4 2005/05/16 15:22:46 espie Exp $ -# $DragonFly: src/usr.bin/patch/Makefile,v 1.8 2008/08/10 23:50:12 joerg Exp $ +# $FreeBSD$ .include Modified: head/usr.bin/patch/backupfile.c ============================================================================== --- head/usr.bin/patch/backupfile.c Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/backupfile.c Tue Jan 29 20:05:16 2013 (r246091) @@ -1,6 +1,4 @@ -/* $FreeBSD$ */ /*- - * * Copyright (C) 1990 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify it @@ -14,8 +12,8 @@ * * David MacKenzie . Some algorithms adapted from GNU Emacs. * - * $OpenBSD: backupfile.c,v 1.19 2006/03/11 19:41:30 otto Exp $ - * $DragonFly: src/usr.bin/patch/backupfile.c,v 1.5 2008/08/11 00:05:06 joerg Exp $ + * $OpenBSD: backupfile.c,v 1.20 2009/10/27 23:59:41 deraadt Exp $ + * $FreeBSD$ */ #include Modified: head/usr.bin/patch/backupfile.h ============================================================================== --- head/usr.bin/patch/backupfile.h Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/backupfile.h Tue Jan 29 20:05:16 2013 (r246091) @@ -1,6 +1,4 @@ -/* $FreeBSD$ */ /*- - * backupfile.h -- declarations for making Emacs style backup file names * Copyright (C) 1990 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify it @@ -9,9 +7,11 @@ * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. - * + * + * backupfile.h -- declarations for making Emacs style backup file names + * * $OpenBSD: backupfile.h,v 1.6 2003/07/28 18:35:36 otto Exp $ - * $DragonFly: src/usr.bin/patch/backupfile.h,v 1.3 2007/09/29 23:11:10 swildner Exp $ + * $FreeBSD$ */ /* When to make backup files. */ Modified: head/usr.bin/patch/common.h ============================================================================== --- head/usr.bin/patch/common.h Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/common.h Tue Jan 29 20:05:16 2013 (r246091) @@ -1,6 +1,4 @@ -/* $FreeBSD$ */ /*- - * * Copyright 1986, Larry Wall * * Redistribution and use in source and binary forms, with or without @@ -26,7 +24,7 @@ * behaviour * * $OpenBSD: common.h,v 1.26 2006/03/11 19:41:30 otto Exp $ - * $DragonFly: src/usr.bin/patch/common.h,v 1.5 2008/08/10 23:50:12 joerg Exp $ + * $FreeBSD$ */ #include Modified: head/usr.bin/patch/inp.c ============================================================================== --- head/usr.bin/patch/inp.c Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/inp.c Tue Jan 29 20:05:16 2013 (r246091) @@ -1,6 +1,4 @@ -/* $FreeBSD$ */ /*- - * * Copyright 1986, Larry Wall * * Redistribution and use in source and binary forms, with or without @@ -25,7 +23,8 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: inp.c,v 1.34 2006/03/11 19:41:30 otto Exp $ + * $OpenBSD: inp.c,v 1.36 2012/04/10 14:46:34 ajacoutot Exp $ + * $FreeBSD$ */ #include Modified: head/usr.bin/patch/inp.h ============================================================================== --- head/usr.bin/patch/inp.h Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/inp.h Tue Jan 29 20:05:16 2013 (r246091) @@ -1,12 +1,4 @@ -/* - * $FreeBSD$ - * $OpenBSD: inp.h,v 1.8 2003/08/15 08:00:51 otto Exp $ - * $DragonFly: src/usr.bin/patch/inp.h,v 1.1 2004/09/24 18:44:28 joerg Exp $ - */ - -/* - * patch - a program to apply diffs to original files - * +/*- * Copyright 1986, Larry Wall * * Redistribution and use in source and binary forms, with or without @@ -26,8 +18,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * patch - a program to apply diffs to original files + * * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour + * + * $OpenBSD: inp.h,v 1.8 2003/08/15 08:00:51 otto Exp $ + * $FreeBSD$ */ void re_input(void); Modified: head/usr.bin/patch/mkpath.c ============================================================================== --- head/usr.bin/patch/mkpath.c Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/mkpath.c Tue Jan 29 20:05:16 2013 (r246091) @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 1983, 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -27,8 +26,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: mkpath.c,v 1.2 2005/06/20 07:14:06 otto Exp $ - * $DragonFly: src/usr.bin/patch/mkpath.c,v 1.1 2007/09/29 23:11:10 swildner Exp $ + * $OpenBSD: mkpath.c,v 1.2 2005/06/20 07:14:06 otto Exp $ + * $FreeBSD$ */ #include Modified: head/usr.bin/patch/patch.1 ============================================================================== --- head/usr.bin/patch/patch.1 Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/patch.1 Tue Jan 29 20:05:16 2013 (r246091) @@ -1,4 +1,4 @@ -.\" $FreeBSD$ +.\"- .\" Copyright 1986, Larry Wall .\" .\" Redistribution and use in source and binary forms, with or without @@ -19,9 +19,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: patch.1,v 1.22 2008/06/06 20:44:00 jmc Exp $ -.\" $DragonFly: src/usr.bin/patch/patch.1,v 1.10 2008/08/18 19:15:55 joerg Exp $ -.Dd August 18, 2008 +.\" $OpenBSD: patch.1,v 1.26 2010/09/03 11:09:29 jmc Exp $ +.\" $FreeBSD$ +.Dd January 29, 2013 .Dt PATCH 1 .Os .Sh NAME @@ -59,7 +59,7 @@ If is omitted, or is a hyphen, the patch will be read from the standard input. .Pp .Nm -will attempt to determine the type of the diff listing, unless over-ruled by a +will attempt to determine the type of the diff listing, unless overruled by a .Fl c , .Fl e , .Fl n , @@ -349,7 +349,7 @@ used in place of .Qq .orig . .It Fl Fl posix Enables strict -.St -p1003.1-2004 +.St -p1003.1-2008 conformance, specifically: .Bl -enum .It @@ -463,7 +463,7 @@ match used: If .Nm is operating in strict -.St -p1003.1-2004 +.St -p1003.1-2008 mode, the first of the .Dq old , .Dq new @@ -605,40 +605,40 @@ used to read input when .Nm prompts the user .El -.Sh DIAGNOSTICS -Too many to list here, but generally indicative that -.Nm -couldn't parse your patch file. -.Pp -The message -.Qq Hmm... -indicates that there is unprocessed text in the patch file and that -.Nm -is attempting to intuit whether there is a patch in that text and, if so, -what kind of patch it is. -.Pp +.Sh EXIT STATUS The .Nm utility exits with one of the following values: .Pp -.Bl -tag -width Ds -compact -offset indent -.It \&0 +.Bl -tag -width Ds -offset indent -compact +.It 0 Successful completion. -.It \&1 +.It 1 One or more lines were written to a reject file. -.It \*[Gt]\&1 +.It \*(Gt1 An error occurred. .El .Pp When applying a set of patches in a loop it behooves you to check this exit status so you don't apply a later patch to a partially patched file. +.Sh DIAGNOSTICS +Too many to list here, but generally indicative that +.Nm +couldn't parse your patch file. +.Pp +The message +.Qq Hmm... +indicates that there is unprocessed text in the patch file and that +.Nm +is attempting to intuit whether there is a patch in that text and, if so, +what kind of patch it is. .Sh SEE ALSO .Xr diff 1 .Sh STANDARDS The .Nm utility is compliant with the -.St -p1003.1-2004 +.St -p1003.1-2008 specification (except as detailed above for the .Fl -posix @@ -648,7 +648,7 @@ though the presence of itself is optional. .Pp The flags -.Op Fl CEfstuvBFVxz +.Op Fl BCEFfstVvxz and .Op Fl -posix are extensions to that specification. Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/patch.c Tue Jan 29 20:05:16 2013 (r246091) @@ -1,6 +1,4 @@ -/* $FreeBSD$ */ /*- - * * Copyright 1986, Larry Wall * * Redistribution and use in source and binary forms, with or without @@ -25,8 +23,8 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: patch.c,v 1.45 2007/04/18 21:52:24 sobrado Exp $ - * $DragonFly: src/usr.bin/patch/patch.c,v 1.10 2008/08/10 23:39:56 joerg Exp $ + * $OpenBSD: patch.c,v 1.50 2012/05/15 19:32:02 millert Exp $ + * $FreeBSD$ * */ @@ -114,9 +112,6 @@ static bool reverse_flag_specified = fal /* buffer holding the name of the rejected patch file. */ static char rejname[NAME_MAX + 1]; -/* buffer for stderr */ -static char serrbuf[BUFSIZ]; - /* how many input lines have been irretractibly output */ static LINENUM last_frozen_line = 0; @@ -150,11 +145,13 @@ int main(int argc, char *argv[]) { int error = 0, hunk, failed, i, fd; + bool patch_seen; LINENUM where = 0, newwhere, fuzz, mymaxfuzz; const char *tmpdir; char *v; - setbuf(stderr, serrbuf); + setlinebuf(stdout); + setlinebuf(stderr); for (i = 0; i < MAXFILEC; i++) filearg[i] = NULL; @@ -214,9 +211,12 @@ main(int argc, char *argv[]) /* make sure we clean up /tmp in case of disaster */ set_signals(0); + patch_seen = false; for (open_patch_file(filearg[1]); there_is_another_patch(); reinitialize_almost_everything()) { /* for each patch in patch file */ + + patch_seen = true; warn_on_invalid_line = true; @@ -400,18 +400,21 @@ main(int argc, char *argv[]) sizeof(rejname)) >= sizeof(rejname)) fatal("filename %s is too long\n", outname); } - if (skip_rest_of_patch) { - say("%d out of %d hunks ignored--saving rejects to %s\n", - failed, hunk, rejname); - } else { - say("%d out of %d hunks failed--saving rejects to %s\n", - failed, hunk, rejname); - } + if (!check_only) + say("%d out of %d hunks %s--saving rejects to %s\n", + failed, hunk, skip_rest_of_patch ? "ignored" : "failed", rejname); + else + say("%d out of %d hunks %s\n", + failed, hunk, skip_rest_of_patch ? "ignored" : "failed"); if (!check_only && move_file(TMPREJNAME, rejname) < 0) trejkeep = true; } set_signals(1); } + + if (!patch_seen) + error = 2; + my_exit(error); /* NOTREACHED */ } Modified: head/usr.bin/patch/pathnames.h ============================================================================== --- head/usr.bin/patch/pathnames.h Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/pathnames.h Tue Jan 29 20:05:16 2013 (r246091) @@ -1,10 +1,9 @@ -/* $FreeBSD$ */ /*- * Placed in the public domain by Todd C. Miller * on July 29, 2003. * * $OpenBSD: pathnames.h,v 1.1 2003/07/29 20:10:17 millert Exp $ - * $DragonFly: src/usr.bin/patch/pathnames.h,v 1.2 2008/08/11 00:04:12 joerg Exp $ + * $FreeBSD$ */ Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/pch.c Tue Jan 29 20:05:16 2013 (r246091) @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ + /*- - * * Copyright 1986, Larry Wall * * Redistribution and use in source and binary forms, with or without @@ -25,8 +24,8 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: pch.c,v 1.37 2007/09/02 15:19:33 deraadt Exp $ - * $DragonFly: src/usr.bin/patch/pch.c,v 1.6 2008/08/10 23:35:40 joerg Exp $ + * $OpenBSD: pch.c,v 1.39 2012/04/11 08:07:13 ajacoutot Exp $ + * $FreeBSD$ */ #include Modified: head/usr.bin/patch/pch.h ============================================================================== --- head/usr.bin/patch/pch.h Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/pch.h Tue Jan 29 20:05:16 2013 (r246091) @@ -1,6 +1,4 @@ -/* $FreeBSD$ */ /*- - * * Copyright 1986, Larry Wall * * Redistribution and use in source and binary forms, with or without @@ -26,7 +24,7 @@ * behaviour * * $OpenBSD: pch.h,v 1.9 2003/10/31 20:20:45 millert Exp $ - * $DragonFly: src/usr.bin/patch/pch.h,v 1.1 2004/09/24 18:44:28 joerg Exp $ + * $FreeBSD$ */ #define OLD_FILE 0 Modified: head/usr.bin/patch/util.c ============================================================================== --- head/usr.bin/patch/util.c Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/util.c Tue Jan 29 20:05:16 2013 (r246091) @@ -1,6 +1,4 @@ -/* $FreeBSD$ */ /*- - * * Copyright 1986, Larry Wall * * Redistribution and use in source and binary forms, with or without @@ -25,8 +23,8 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: util.c,v 1.32 2006/03/11 19:41:30 otto Exp $ - * $DragonFly: src/usr.bin/patch/util.c,v 1.9 2007/09/29 23:11:10 swildner Exp $ + * $OpenBSD: util.c,v 1.35 2010/07/24 01:10:12 ray Exp $ + * $FreeBSD$ */ #include @@ -212,9 +210,9 @@ say(const char *fmt, ...) va_list ap; va_start(ap, fmt); - vfprintf(stderr, fmt, ap); + vfprintf(stdout, fmt, ap); va_end(ap); - fflush(stderr); + fflush(stdout); } /* Modified: head/usr.bin/patch/util.h ============================================================================== --- head/usr.bin/patch/util.h Tue Jan 29 20:01:47 2013 (r246090) +++ head/usr.bin/patch/util.h Tue Jan 29 20:05:16 2013 (r246091) @@ -1,6 +1,4 @@ -/* $FreeBSD$ */ /*- - * * Copyright 1986, Larry Wall * * Redistribution and use in source and binary forms, with or without @@ -26,8 +24,7 @@ * behaviour * * $OpenBSD: util.h,v 1.15 2005/06/20 07:14:06 otto Exp $ - * $DragonFly: src/usr.bin/patch/util.h,v 1.2 2007/09/29 23:11:10 swildner Exp $ - + * $FreeBSD$ */ char *fetchname(const char *, bool *, int); From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 20:28:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3EB79D8C; Tue, 29 Jan 2013 20:28:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 31498686; Tue, 29 Jan 2013 20:28:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TKSC4k041077; Tue, 29 Jan 2013 20:28:12 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TKSCEj041076; Tue, 29 Jan 2013 20:28:12 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301292028.r0TKSCEj041076@svn.freebsd.org> From: Brooks Davis Date: Tue, 29 Jan 2013 20:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246092 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 20:28:12 -0000 Author: brooks Date: Tue Jan 29 20:28:11 2013 New Revision: 246092 URL: http://svnweb.freebsd.org/changeset/base/246092 Log: Fix installworld when the host does not need to bootstrap nmtree. Reported by: lev, jmg Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jan 29 20:05:16 2013 (r246091) +++ head/Makefile.inc1 Tue Jan 29 20:28:11 2013 (r246092) @@ -673,7 +673,7 @@ _zoneinfo= zic tzsetup ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ date echo egrep find grep id install ${_install-info} \ - ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ + ln lockf make mkdir mtree mv nmtree pwd_mkdb rm sed sh sysctl \ test true uname wc ${_zoneinfo} # From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 20:55:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E3043EA; Tue, 29 Jan 2013 20:55:05 +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 7CE417A0; Tue, 29 Jan 2013 20:55:05 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BC076B926; Tue, 29 Jan 2013 15:55:04 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r246085 - in head/sys: amd64/linux32 compat/linprocfs compat/linux i386/linux Date: Tue, 29 Jan 2013 15:55:03 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301291841.r0TIfUxs008927@svn.freebsd.org> In-Reply-To: <201301291841.r0TIfUxs008927@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201301291555.03690.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 29 Jan 2013 15:55:04 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 20:55:05 -0000 On Tuesday, January 29, 2013 1:41:30 pm John Baldwin wrote: > Author: jhb > Date: Tue Jan 29 18:41:30 2013 > New Revision: 246085 > URL: http://svnweb.freebsd.org/changeset/base/246085 > > Log: > Reduce duplication between i386/linux/linux.h and amd64/linux32/linux.h > by moving bits that are MI out into headers in compat/linux. > > Reviewed by: Chagin Dmitry dmitry | gmail > MFC after: 2 weeks Should be 'Reviewed by: dchagin', sorry. :( -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 20:59:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 87CD4598; Tue, 29 Jan 2013 20:59:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 708627CA; Tue, 29 Jan 2013 20:59:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TKxM4g049838; Tue, 29 Jan 2013 20:59:22 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TKxMkI049836; Tue, 29 Jan 2013 20:59:22 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301292059.r0TKxMkI049836@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 29 Jan 2013 20:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246093 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 20:59:23 -0000 Author: np Date: Tue Jan 29 20:59:22 2013 New Revision: 246093 URL: http://svnweb.freebsd.org/changeset/base/246093 Log: Provide a statistic to track the number of drops in each of the port's txq's buf_ring. The aggregate for all the queues of a port is already provided in ifnet->if_snd.ifq_drops. MFC after: 3 days. Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Jan 29 20:28:11 2013 (r246092) +++ head/sys/dev/cxgbe/t4_main.c Tue Jan 29 20:59:22 2013 (r246093) @@ -5533,6 +5533,7 @@ t4_ioctl(struct cdev *dev, unsigned long txq->txpkt_wrs = 0; txq->txpkts_wrs = 0; txq->txpkts_pkts = 0; + txq->br->br_drops = 0; txq->no_dmamap = 0; txq->no_desc = 0; } Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Jan 29 20:28:11 2013 (r246092) +++ head/sys/dev/cxgbe/t4_sge.c Tue Jan 29 20:59:22 2013 (r246093) @@ -2362,6 +2362,8 @@ alloc_txq(struct port_info *pi, struct s SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "txpkts_pkts", CTLFLAG_RD, &txq->txpkts_pkts, "# of frames tx'd using txpkts work requests"); + SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "br_drops", CTLFLAG_RD, + &txq->br->br_drops, "# of drops in the buf_ring for this queue"); SYSCTL_ADD_UINT(&pi->ctx, children, OID_AUTO, "no_dmamap", CTLFLAG_RD, &txq->no_dmamap, 0, "# of times txq ran out of DMA maps"); SYSCTL_ADD_UINT(&pi->ctx, children, OID_AUTO, "no_desc", CTLFLAG_RD, From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 21:37:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F3509BFC; Tue, 29 Jan 2013 21:37:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B5DED919; Tue, 29 Jan 2013 21:37:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TLbuTd061807; Tue, 29 Jan 2013 21:37:56 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TLbuvW061806; Tue, 29 Jan 2013 21:37:56 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201301292137.r0TLbuvW061806@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 29 Jan 2013 21:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246094 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 21:37:57 -0000 Author: glebius Date: Tue Jan 29 21:37:56 2013 New Revision: 246094 URL: http://svnweb.freebsd.org/changeset/base/246094 Log: Remove unused file. Deleted: head/lib/libstand/if_ether.h From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 21:44:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0BC65DF0; Tue, 29 Jan 2013 21:44:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F27ED95F; Tue, 29 Jan 2013 21:44:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TLiM5c064277; Tue, 29 Jan 2013 21:44:22 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TLiMYs064276; Tue, 29 Jan 2013 21:44:22 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201301292144.r0TLiMYs064276@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 29 Jan 2013 21:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246095 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 21:44:23 -0000 Author: glebius Date: Tue Jan 29 21:44:22 2013 New Revision: 246095 URL: http://svnweb.freebsd.org/changeset/base/246095 Log: route_output() always supplies info with RTAX_GATEWAY member that points to a sockaddr of AF_LINK family. Assert this instead of checking. Modified: head/sys/net/if_llatbl.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Tue Jan 29 21:37:56 2013 (r246094) +++ head/sys/net/if_llatbl.c Tue Jan 29 21:44:22 2013 (r246095) @@ -273,10 +273,9 @@ lla_rt_output(struct rt_msghdr *rtm, str u_int laflags = 0, flags = 0; int error = 0; - if (dl == NULL || dl->sdl_family != AF_LINK) { - log(LOG_INFO, "%s: invalid dl\n", __func__); - return EINVAL; - } + KASSERT(dl != NULL && dl->sdl_family == AF_LINK, + ("%s: invalid dl\n", __func__)); + ifp = ifnet_byindex(dl->sdl_index); if (ifp == NULL) { log(LOG_INFO, "%s: invalid ifp (sdl_index %d)\n", From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 21:48:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CDBD6F90; Tue, 29 Jan 2013 21:48:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C0849983; Tue, 29 Jan 2013 21:48:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TLmART064805; Tue, 29 Jan 2013 21:48:10 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TLmAIc064804; Tue, 29 Jan 2013 21:48:10 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301292148.r0TLmAIc064804@svn.freebsd.org> From: Brooks Davis Date: Tue, 29 Jan 2013 21:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246096 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 21:48:10 -0000 Author: brooks Date: Tue Jan 29 21:48:10 2013 New Revision: 246096 URL: http://svnweb.freebsd.org/changeset/base/246096 Log: Fix installworld when nmtree is not on the host by only adding it to ITOOLS when we will be using the host copy. Fix installkernel when -DNO_ROOT is set. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jan 29 21:44:22 2013 (r246095) +++ head/Makefile.inc1 Tue Jan 29 21:48:10 2013 (r246096) @@ -673,8 +673,8 @@ _zoneinfo= zic tzsetup ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ date echo egrep find grep id install ${_install-info} \ - ln lockf make mkdir mtree mv nmtree pwd_mkdb rm sed sh sysctl \ - test true uname wc ${_zoneinfo} + ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \ + rm sed sh sysctl test true uname wc ${_zoneinfo} # # distributeworld @@ -964,7 +964,7 @@ reinstallkernel reinstallkernel.debug: i @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ - ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} + ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} distributekernel distributekernel.debug: .if empty(INSTALLKERNEL) @@ -1132,6 +1132,8 @@ _yacc= usr.bin/yacc .if ${BOOTSTRAPPING} < 1000026 _nmtree= lib/libnetbsd \ usr.sbin/nmtree +.else +_nmtree_itools= nmtree .endif .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 From owner-svn-src-all@FreeBSD.ORG Tue Jan 29 22:17:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1B321BC0; Tue, 29 Jan 2013 22:17:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EE4E3B59; Tue, 29 Jan 2013 22:17:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0TMHwUI073946; Tue, 29 Jan 2013 22:17:58 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0TMHwrk073944; Tue, 29 Jan 2013 22:17:58 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301292217.r0TMHwrk073944@svn.freebsd.org> From: Brooks Davis Date: Tue, 29 Jan 2013 22:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246097 - in head: . etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 22:17:59 -0000 Author: brooks Date: Tue Jan 29 22:17:58 2013 New Revision: 246097 URL: http://svnweb.freebsd.org/changeset/base/246097 Log: Log the addition of login.conf.db, passwd, pwd.db, and spwd.db via cat -l. Make cat a bootstrap tool to facilitate this. Modified: head/Makefile.inc1 head/etc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jan 29 21:48:10 2013 (r246096) +++ head/Makefile.inc1 Tue Jan 29 22:17:58 2013 (r246097) @@ -185,7 +185,7 @@ OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.$ .endif WORLDTMP= ${OBJTREE}${.CURDIR}/tmp # /usr/games added for fortune which depend on strfile -BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games +BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games:${WORLDTMP}/legacy/bin XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games STRICTTMPPATH= ${BPATH}:${XPATH} TMPPATH= ${STRICTTMPPATH}:${PATH} @@ -412,7 +412,7 @@ _worldtmp: rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c .endif .for _dir in \ - lib usr legacy/usr + lib usr legacy/bin legacy/usr mkdir -p ${WORLDTMP}/${_dir} .endfor mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ @@ -1136,6 +1136,10 @@ _nmtree= lib/libnetbsd \ _nmtree_itools= nmtree .endif +.if ${BOOTSTRAPPING} < 1000027 +_cat= bin/cat +.endif + .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 _awk= usr.bin/awk .endif @@ -1191,6 +1195,7 @@ bootstrap-tools: ${_ar} \ ${_dtc} \ ${_awk} \ + ${_cat} \ usr.bin/lorder \ usr.bin/makewhatis \ ${_mklocale} \ Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Tue Jan 29 21:48:10 2013 (r246096) +++ head/etc/Makefile Tue Jan 29 22:17:58 2013 (r246097) @@ -180,6 +180,10 @@ CAP_MKDB_ENDIAN?= PWD_MKDB_ENDIAN?= .endif +.if defined(NO_ROOT) +METALOG.add?= cat -l >> ${METALOG} +.endif + distribution: .if !defined(DESTDIR) @echo "set DESTDIR before running \"make ${.TARGET}\"" @@ -201,6 +205,14 @@ distribution: .endif pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \ ${DESTDIR}/etc/master.passwd +.if defined(NO_ROOT) + ( \ + echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \ + echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ + echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ + echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ + ) | ${METALOG.add} +.endif .if ${MK_ATF} != "no" ${_+_}cd ${.CURDIR}/atf; ${MAKE} install .endif @@ -336,9 +348,9 @@ distrib-dirs: test "$$d" == "/" && d=""; \ d=${DISTBASE}$$d; \ shift; \ - ${ECHO} "${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# >>" \ - "${METALOG}" ; \ - ${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# >> ${METALOG} ; \ + ${ECHO} "${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# |" \ + "${METALOG.add}" ; \ + ${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# | ${METALOG.add} ; \ done; true .endif ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 01:36:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6DE40B15; Wed, 30 Jan 2013 01:36:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5F493670; Wed, 30 Jan 2013 01:36:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0U1a5IE033732; Wed, 30 Jan 2013 01:36:05 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0U1a5OE033731; Wed, 30 Jan 2013 01:36:05 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301300136.r0U1a5OE033731@svn.freebsd.org> From: Sean Bruno Date: Wed, 30 Jan 2013 01:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246106 - head/libexec/tftpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 01:36:05 -0000 Author: sbruno Date: Wed Jan 30 01:36:04 2013 New Revision: 246106 URL: http://svnweb.freebsd.org/changeset/base/246106 Log: Remove extra %s from debug statement that ends up crashing tftpd if debug is set very high (like -d15 in my case). Obtained from: Yahoo! Inc MFC after: 2 weeks Modified: head/libexec/tftpd/tftp-io.c Modified: head/libexec/tftpd/tftp-io.c ============================================================================== --- head/libexec/tftpd/tftp-io.c Wed Jan 30 01:30:06 2013 (r246105) +++ head/libexec/tftpd/tftp-io.c Wed Jan 30 01:36:04 2013 (r246106) @@ -142,7 +142,7 @@ send_error(int peer, int error) char buf[MAXPKTSIZE]; if (debug&DEBUG_PACKETS) - tftp_log(LOG_DEBUG, "Sending ERROR %d: %s", error); + tftp_log(LOG_DEBUG, "Sending ERROR %d", error); DROPPACKET("send_error"); From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 04:09:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 496491A4; Wed, 30 Jan 2013 04:09:10 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37C8DB7C; Wed, 30 Jan 2013 04:09:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0U49Au2080097; Wed, 30 Jan 2013 04:09:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0U499Bm080094; Wed, 30 Jan 2013 04:09:09 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301300409.r0U499Bm080094@svn.freebsd.org> From: Neel Natu Date: Wed, 30 Jan 2013 04:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246108 - in head/sys/amd64: include vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 04:09:10 -0000 Author: neel Date: Wed Jan 30 04:09:09 2013 New Revision: 246108 URL: http://svnweb.freebsd.org/changeset/base/246108 Log: Add emulation support for instruction "88/r: mov r/m8, r8". This instruction moves a byte from a register to a memory location. Tested by: tycho nightingale at pluribusnetworks com Modified: head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Wed Jan 30 01:43:00 2013 (r246107) +++ head/sys/amd64/include/vmm_instruction_emul.h Wed Jan 30 04:09:09 2013 (r246108) @@ -49,7 +49,8 @@ struct vie { uint8_t rex_w:1, /* REX prefix */ rex_r:1, rex_x:1, - rex_b:1; + rex_b:1, + rex_present:1; uint8_t mod:2, /* ModRM byte */ reg:4, Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Wed Jan 30 01:43:00 2013 (r246107) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Wed Jan 30 04:09:09 2013 (r246108) @@ -65,6 +65,10 @@ enum { #define VIE_OP_F_IMM8 (1 << 1) /* 8-bit immediate operand */ static const struct vie_op one_byte_opcodes[256] = { + [0x88] = { + .op_byte = 0x88, + .op_type = VIE_OP_TYPE_MOV, + }, [0x89] = { .op_byte = 0x89, .op_type = VIE_OP_TYPE_MOV, @@ -161,6 +165,46 @@ vie_read_register(void *vm, int vcpuid, } static int +vie_read_bytereg(void *vm, int vcpuid, struct vie *vie, uint8_t *rval) +{ + uint64_t val; + int error, rshift; + enum vm_reg_name reg; + + rshift = 0; + reg = gpr_map[vie->reg]; + + /* + * 64-bit mode imposes limitations on accessing legacy byte registers. + * + * The legacy high-byte registers cannot be addressed if the REX + * prefix is present. In this case the values 4, 5, 6 and 7 of the + * 'ModRM:reg' field address %spl, %bpl, %sil and %dil respectively. + * + * If the REX prefix is not present then the values 4, 5, 6 and 7 + * of the 'ModRM:reg' field address the legacy high-byte registers, + * %ah, %ch, %dh and %bh respectively. + */ + if (!vie->rex_present) { + if (vie->reg & 0x4) { + /* + * Obtain the value of %ah by reading %rax and shifting + * right by 8 bits (same for %bh, %ch and %dh). + */ + rshift = 8; + reg = gpr_map[vie->reg & 0x3]; + } + } + + if (!vie_valid_register(reg)) + return (EINVAL); + + error = vm_get_register(vm, vcpuid, reg, &val); + *rval = val >> rshift; + return (error); +} + +static int vie_update_register(void *vm, int vcpuid, enum vm_reg_name reg, uint64_t val, int size) { @@ -209,12 +253,24 @@ emulate_mov(void *vm, int vcpuid, uint64 { int error, size; enum vm_reg_name reg; + uint8_t byte; uint64_t val; size = 4; error = EINVAL; switch (vie->op.op_byte) { + case 0x88: + /* + * MOV byte from reg (ModRM:reg) to mem (ModRM:r/m) + * 88/r: mov r/m8, r8 + * REX + 88/r: mov r/m8, r8 (%ah, %ch, %dh, %bh not available) + */ + size = 1; + error = vie_read_bytereg(vm, vcpuid, vie, &byte); + if (error == 0) + error = memwrite(vm, vcpuid, gpa, byte, size, arg); + break; case 0x89: /* * MOV from reg (ModRM:reg) to mem (ModRM:r/m) @@ -497,6 +553,8 @@ decode_rex(struct vie *vie) return (-1); if (x >= 0x40 && x <= 0x4F) { + vie->rex_present = 1; + vie->rex_w = x & 0x8 ? 1 : 0; vie->rex_r = x & 0x4 ? 1 : 0; vie->rex_x = x & 0x2 ? 1 : 0; From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 04:30:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 95B98530; Wed, 30 Jan 2013 04:30:37 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 878B3CD5; Wed, 30 Jan 2013 04:30:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0U4UbhK086097; Wed, 30 Jan 2013 04:30:37 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0U4UaQS086091; Wed, 30 Jan 2013 04:30:36 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301300430.r0U4UaQS086091@svn.freebsd.org> From: Neel Natu Date: Wed, 30 Jan 2013 04:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246109 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 04:30:37 -0000 Author: neel Date: Wed Jan 30 04:30:36 2013 New Revision: 246109 URL: http://svnweb.freebsd.org/changeset/base/246109 Log: Add support for MSI-X interrupts in the virtio network device and make that the default. The current behavior of advertising a single MSI vector can be requested by setting the environment variable "BHYVE_USE_MSI" to "true". The use of MSI is not compliant with the virtio specification and will be eventually phased out. Submitted by: Gopakumar T Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Wed Jan 30 04:09:09 2013 (r246108) +++ head/usr.sbin/bhyve/pci_emul.c Wed Jan 30 04:30:36 2013 (r246109) @@ -167,6 +167,94 @@ pci_parse_slot(char *opt, int legacy) } static int +pci_valid_pba_offset(struct pci_devinst *pi, uint64_t offset) +{ + + if (offset < pi->pi_msix.pba_offset) + return (0); + + if (offset >= pi->pi_msix.pba_offset + pi->pi_msix.pba_size) { + return (0); + } + + return (1); +} + +int +pci_emul_msix_twrite(struct pci_devinst *pi, uint64_t offset, int size, + uint64_t value) +{ + int msix_entry_offset; + int tab_index; + char *dest; + + /* support only 4 or 8 byte writes */ + if (size != 4 && size != 8) + return (-1); + + /* + * Return if table index is beyond what device supports + */ + tab_index = offset / MSIX_TABLE_ENTRY_SIZE; + if (tab_index >= pi->pi_msix.table_count) + return (-1); + + msix_entry_offset = offset % MSIX_TABLE_ENTRY_SIZE; + + /* support only aligned writes */ + if ((msix_entry_offset % size) != 0) + return (-1); + + dest = (char *)(pi->pi_msix.table + tab_index); + dest += msix_entry_offset; + + if (size == 4) + *((uint32_t *)dest) = value; + else + *((uint64_t *)dest) = value; + + return (0); +} + +uint64_t +pci_emul_msix_tread(struct pci_devinst *pi, uint64_t offset, int size) +{ + char *dest; + int msix_entry_offset; + int tab_index; + uint64_t retval = ~0; + + /* support only 4 or 8 byte reads */ + if (size != 4 && size != 8) + return (retval); + + msix_entry_offset = offset % MSIX_TABLE_ENTRY_SIZE; + + /* support only aligned reads */ + if ((msix_entry_offset % size) != 0) { + return (retval); + } + + tab_index = offset / MSIX_TABLE_ENTRY_SIZE; + + if (tab_index < pi->pi_msix.table_count) { + /* valid MSI-X Table access */ + dest = (char *)(pi->pi_msix.table + tab_index); + dest += msix_entry_offset; + + if (size == 4) + retval = *((uint32_t *)dest); + else + retval = *((uint64_t *)dest); + } else if (pci_valid_pba_offset(pi, offset)) { + /* return 0 for PBA access */ + retval = 0; + } + + return (retval); +} + +static int pci_emul_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { @@ -178,8 +266,7 @@ pci_emul_io_handler(struct vmctx *ctx, i for (i = 0; i <= PCI_BARMAX; i++) { if (pdi->pi_bar[i].type == PCIBAR_IO && port >= pdi->pi_bar[i].addr && - port + bytes <= - pdi->pi_bar[i].addr + pdi->pi_bar[i].size) { + port + bytes <= pdi->pi_bar[i].addr + pdi->pi_bar[i].size) { offset = port - pdi->pi_bar[i].addr; if (in) *eax = (*pe->pe_barread)(ctx, vcpu, pdi, i, @@ -484,13 +571,95 @@ pci_emul_add_msicap(struct pci_devinst * return (pci_emul_add_capability(pi, (u_char *)&msicap, sizeof(msicap))); } +static void +pci_populate_msixcap(struct msixcap *msixcap, int msgnum, int barnum, + uint32_t msix_tab_size, int nextptr) +{ + CTASSERT(sizeof(struct msixcap) == 12); + + assert(msix_tab_size % 4096 == 0); + + bzero(msixcap, sizeof(struct msixcap)); + msixcap->capid = PCIY_MSIX; + msixcap->nextptr = nextptr; + + /* + * Message Control Register, all fields set to + * zero except for the Table Size. + * Note: Table size N is encoded as N-1 + */ + msixcap->msgctrl = msgnum - 1; + + /* + * MSI-X BAR setup: + * - MSI-X table start at offset 0 + * - PBA table starts at a 4K aligned offset after the MSI-X table + */ + msixcap->table_info = barnum & PCIM_MSIX_BIR_MASK; + msixcap->pba_info = msix_tab_size | (barnum & PCIM_MSIX_BIR_MASK); +} + +static void +pci_msix_table_init(struct pci_devinst *pi, int table_entries) +{ + int i, table_size; + + assert(table_entries > 0); + assert(table_entries <= MAX_MSIX_TABLE_ENTRIES); + + table_size = table_entries * MSIX_TABLE_ENTRY_SIZE; + pi->pi_msix.table = malloc(table_size); + bzero(pi->pi_msix.table, table_size); + + /* set mask bit of vector control register */ + for (i = 0; i < table_entries; i++) + pi->pi_msix.table[i].vector_control |= PCIM_MSIX_VCTRL_MASK; +} + +int +pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum) +{ + uint16_t pba_index; + uint32_t tab_size; + struct msixcap msixcap; + + assert(msgnum >= 1 && msgnum <= MAX_MSIX_TABLE_ENTRIES); + assert(barnum >= 0 && barnum <= PCIR_MAX_BAR_0); + + tab_size = msgnum * MSIX_TABLE_ENTRY_SIZE; + + /* Align table size to nearest 4K */ + tab_size = roundup2(tab_size, 4096); + + pi->pi_msix.table_bar = barnum; + pi->pi_msix.pba_bar = barnum; + pi->pi_msix.table_offset = 0; + pi->pi_msix.table_count = msgnum; + pi->pi_msix.pba_offset = tab_size; + + /* calculate the MMIO size required for MSI-X PBA */ + pba_index = (msgnum - 1) / (PBA_TABLE_ENTRY_SIZE * 8); + pi->pi_msix.pba_size = (pba_index + 1) * PBA_TABLE_ENTRY_SIZE; + + pci_msix_table_init(pi, msgnum); + + pci_populate_msixcap(&msixcap, msgnum, barnum, tab_size, 0); + + /* allocate memory for MSI-X Table and PBA */ + pci_emul_alloc_bar(pi, barnum, PCIBAR_MEM32, + tab_size + pi->pi_msix.pba_size); + + return (pci_emul_add_capability(pi, (u_char *)&msixcap, + sizeof(msixcap))); +} + void msixcap_cfgwrite(struct pci_devinst *pi, int capoff, int offset, int bytes, uint32_t val) { uint16_t msgctrl, rwmask; int off, table_bar; - + off = offset - capoff; table_bar = pi->pi_msix.table_bar; /* Message Control Register */ @@ -502,6 +671,7 @@ msixcap_cfgwrite(struct pci_devinst *pi, val = msgctrl; pi->pi_msix.enabled = val & PCIM_MSIXCTRL_MSIX_ENABLE; + pi->pi_msix.function_mask = val & PCIM_MSIXCTRL_FUNCTION_MASK; } CFGWRITE(pi, offset, val, bytes); @@ -589,6 +759,9 @@ pci_emul_capwrite(struct pci_devinst *pi case PCIY_MSI: msicap_cfgwrite(pi, capoff, offset, bytes, val); break; + case PCIY_MSIX: + msixcap_cfgwrite(pi, capoff, offset, bytes, val); + break; default: break; } @@ -668,6 +841,35 @@ pci_msi_msgnum(struct pci_devinst *pi) return (0); } +int +pci_msix_enabled(struct pci_devinst *pi) +{ + + return (pi->pi_msix.enabled && !pi->pi_msi.enabled); +} + +void +pci_generate_msix(struct pci_devinst *pi, int index) +{ + struct msix_table_entry *mte; + + if (!pci_msix_enabled(pi)) + return; + + if (pi->pi_msix.function_mask) + return; + + if (index >= pi->pi_msix.table_count) + return; + + mte = &pi->pi_msix.table[index]; + if ((mte->vector_control & PCIM_MSIX_VCTRL_MASK) == 0) { + /* XXX Set PBA bit if interrupt is disabled */ + vm_lapic_irq(pi->pi_vmctx, + (mte->addr >> 12) & 0xff, mte->msg_data & 0xff); + } +} + void pci_generate_msi(struct pci_devinst *pi, int msg) { Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Wed Jan 30 04:09:09 2013 (r246108) +++ head/usr.sbin/bhyve/pci_emul.h Wed Jan 30 04:30:36 2013 (r246109) @@ -96,6 +96,8 @@ struct msix_table_entry { * for the size that should be emulated. */ #define MSIX_TABLE_ENTRY_SIZE 16 +#define MAX_MSIX_TABLE_ENTRIES 2048 +#define PBA_TABLE_ENTRY_SIZE 8 struct pci_devinst { struct pci_devemu *pi_d; @@ -120,6 +122,8 @@ struct pci_devinst { size_t table_offset; int table_count; size_t pba_offset; + size_t pba_size; + int function_mask; struct msix_table_entry *table; /* allocated at runtime */ } pi_msix; @@ -168,6 +172,10 @@ int pci_msix_enabled(struct pci_devinst int pci_msi_msgnum(struct pci_devinst *pi); void pci_parse_slot(char *opt, int legacy); void pci_populate_msicap(struct msicap *cap, int msgs, int nextptr); +int pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum); +int pci_emul_msix_twrite(struct pci_devinst *pi, uint64_t offset, int size, + uint64_t value); +uint64_t pci_emul_msix_tread(struct pci_devinst *pi, uint64_t offset, int size); static __inline void pci_set_cfgdata8(struct pci_devinst *pi, int offset, uint8_t val) Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Wed Jan 30 04:09:09 2013 (r246108) +++ head/usr.sbin/bhyve/pci_virtio_net.c Wed Jan 30 04:30:36 2013 (r246109) @@ -59,17 +59,17 @@ __FBSDID("$FreeBSD$"); /* * PCI config-space register offsets */ -#define VTNET_R_CFG0 20 -#define VTNET_R_CFG1 21 -#define VTNET_R_CFG2 22 -#define VTNET_R_CFG3 23 -#define VTNET_R_CFG4 24 -#define VTNET_R_CFG5 25 -#define VTNET_R_CFG6 26 -#define VTNET_R_CFG7 27 -#define VTNET_R_MAX 27 +#define VTNET_R_CFG0 24 +#define VTNET_R_CFG1 25 +#define VTNET_R_CFG2 26 +#define VTNET_R_CFG3 27 +#define VTNET_R_CFG4 28 +#define VTNET_R_CFG5 29 +#define VTNET_R_CFG6 30 +#define VTNET_R_CFG7 31 +#define VTNET_R_MAX 31 -#define VTNET_REGSZ VTNET_R_MAX+1 +#define VTNET_REGSZ VTNET_R_MAX+1 /* * Host capabilities @@ -88,6 +88,8 @@ __FBSDID("$FreeBSD$"); #define VTNET_MAXQ 3 +static int use_msix = 1; + struct vring_hqueue { /* Internal state */ uint16_t hq_size; @@ -144,9 +146,24 @@ struct pci_vtnet_softc { uint64_t vsc_pfn[VTNET_MAXQ]; struct vring_hqueue vsc_hq[VTNET_MAXQ]; + uint16_t vsc_msix_table_idx[VTNET_MAXQ]; }; /* + * Return the size of IO BAR that maps virtio header and device specific + * region. The size would vary depending on whether MSI-X is enabled or + * not. + */ +static uint64_t +pci_vtnet_iosize(struct pci_devinst *pi) +{ + if (pci_msix_enabled(pi)) + return (VTNET_REGSZ); + else + return (VTNET_REGSZ - (VTCFG_R_CFG1 - VTCFG_R_MSIX)); +} + +/* * Return the number of available descriptors in the vring taking care * of the 16-bit index wraparound. */ @@ -344,8 +361,13 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc hq->hq_cur_aidx = aidx; if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) { - sc->vsc_isr |= 1; - pci_generate_msi(sc->vsc_pi, 0); + if (use_msix) { + pci_generate_msix(sc->vsc_pi, + sc->vsc_msix_table_idx[VTNET_RXQ]); + } else { + sc->vsc_isr |= 1; + pci_generate_msi(sc->vsc_pi, 0); + } } } @@ -438,8 +460,13 @@ pci_vtnet_proctx(struct pci_vtnet_softc * Generate an interrupt if able */ if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) { - sc->vsc_isr |= 1; - pci_generate_msi(sc->vsc_pi, 0); + if (use_msix) { + pci_generate_msix(sc->vsc_pi, + sc->vsc_msix_table_idx[VTNET_TXQ]); + } else { + sc->vsc_isr |= 1; + pci_generate_msi(sc->vsc_pi, 0); + } } } @@ -512,6 +539,7 @@ pci_vtnet_init(struct vmctx *ctx, struct unsigned char digest[16]; char nstr[80]; struct pci_vtnet_softc *sc; + const char *env_msi; /* * Access to guest memory is required. Fail if @@ -527,6 +555,14 @@ pci_vtnet_init(struct vmctx *ctx, struct sc->vsc_pi = pi; pthread_mutex_init(&sc->vsc_mtx, NULL); + + /* + * Use MSI if set by user + */ + if ((env_msi = getenv("BHYVE_USE_MSI")) != NULL) { + if (strcasecmp(env_msi, "yes") == 0) + use_msix = 0; + } /* * Attempt to open the tap device @@ -594,7 +630,24 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR); pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_NETWORK); pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_NET); - pci_emul_add_msicap(pi, 1); + + if (use_msix) { + /* MSI-X support */ + int i; + + for (i = 0; i < VTNET_MAXQ; i++) + sc->vsc_msix_table_idx[i] = VIRTIO_MSI_NO_VECTOR; + + /* + * BAR 1 used to map MSI-X table and PBA + */ + if (pci_emul_add_msixcap(pi, VTNET_MAXQ, 1)) + return (1); + } else { + /* MSI support */ + pci_emul_add_msicap(pi, 1); + } + pci_emul_alloc_bar(pi, 0, PCIBAR_IO, VTNET_REGSZ); return (0); @@ -609,6 +662,21 @@ static void (*pci_vtnet_qnotify[VTNET_MA pci_vtnet_ping_ctlq }; +static uint64_t +vtnet_adjust_offset(struct pci_devinst *pi, uint64_t offset) +{ + /* + * Device specific offsets used by guest would change based on + * whether MSI-X capability is enabled or not + */ + if (!pci_msix_enabled(pi)) { + if (offset >= VTCFG_R_MSIX) + return (offset + (VTCFG_R_CFG1 - VTCFG_R_MSIX)); + } + + return (offset); +} + static void pci_vtnet_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx, uint64_t offset, int size, uint64_t value) @@ -616,9 +684,17 @@ pci_vtnet_write(struct vmctx *ctx, int v struct pci_vtnet_softc *sc = pi->pi_arg; void *ptr; + if (use_msix) { + if (baridx == pi->pi_msix.table_bar || + baridx == pi->pi_msix.pba_bar) { + pci_emul_msix_twrite(pi, offset, size, value); + return; + } + } + assert(baridx == 0); - if (offset + size > VTNET_REGSZ) { + if (offset + size > pci_vtnet_iosize(pi)) { DPRINTF(("vtnet_write: 2big, offset %ld size %d\n", offset, size)); return; @@ -626,6 +702,8 @@ pci_vtnet_write(struct vmctx *ctx, int v pthread_mutex_lock(&sc->vsc_mtx); + offset = vtnet_adjust_offset(pi, offset); + switch (offset) { case VTCFG_R_GUESTCAP: assert(size == 4); @@ -649,6 +727,15 @@ pci_vtnet_write(struct vmctx *ctx, int v assert(size == 1); pci_vtnet_update_status(sc, value); break; + case VTCFG_R_CFGVEC: + assert(size == 2); + sc->vsc_msix_table_idx[VTNET_CTLQ] = value; + break; + case VTCFG_R_QVEC: + assert(size == 2); + assert(sc->vsc_curq != VTNET_CTLQ); + sc->vsc_msix_table_idx[sc->vsc_curq] = value; + break; case VTNET_R_CFG0: case VTNET_R_CFG1: case VTNET_R_CFG2: @@ -693,9 +780,16 @@ pci_vtnet_read(struct vmctx *ctx, int vc void *ptr; uint64_t value; + if (use_msix) { + if (baridx == pi->pi_msix.table_bar || + baridx == pi->pi_msix.pba_bar) { + return (pci_emul_msix_tread(pi, offset, size)); + } + } + assert(baridx == 0); - if (offset + size > VTNET_REGSZ) { + if (offset + size > pci_vtnet_iosize(pi)) { DPRINTF(("vtnet_read: 2big, offset %ld size %d\n", offset, size)); return (0); @@ -703,6 +797,8 @@ pci_vtnet_read(struct vmctx *ctx, int vc pthread_mutex_lock(&sc->vsc_mtx); + offset = vtnet_adjust_offset(pi, offset); + switch (offset) { case VTCFG_R_HOSTCAP: assert(size == 4); @@ -737,21 +833,30 @@ pci_vtnet_read(struct vmctx *ctx, int vc value = sc->vsc_isr; sc->vsc_isr = 0; /* a read clears this flag */ break; + case VTCFG_R_CFGVEC: + assert(size == 2); + value = sc->vsc_msix_table_idx[VTNET_CTLQ]; + break; + case VTCFG_R_QVEC: + assert(size == 2); + assert(sc->vsc_curq != VTNET_CTLQ); + value = sc->vsc_msix_table_idx[sc->vsc_curq]; + break; case VTNET_R_CFG0: case VTNET_R_CFG1: case VTNET_R_CFG2: case VTNET_R_CFG3: case VTNET_R_CFG4: case VTNET_R_CFG5: - assert((size + offset) <= (VTNET_R_CFG5 + 1)); - ptr = &sc->vsc_macaddr[offset - VTNET_R_CFG0]; - if (size == 1) { - value = *(uint8_t *) ptr; - } else if (size == 2) { - value = *(uint16_t *) ptr; - } else { - value = *(uint32_t *) ptr; - } + assert((size + offset) <= (VTNET_R_CFG5 + 1)); + ptr = &sc->vsc_macaddr[offset - VTNET_R_CFG0]; + if (size == 1) { + value = *(uint8_t *) ptr; + } else if (size == 2) { + value = *(uint16_t *) ptr; + } else { + value = *(uint32_t *) ptr; + } break; case VTNET_R_CFG6: assert(size != 4); Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Wed Jan 30 04:09:09 2013 (r246108) +++ head/usr.sbin/bhyve/virtio.h Wed Jan 30 04:30:36 2013 (r246109) @@ -36,6 +36,7 @@ #define VRING_DESC_F_INDIRECT (1 << 2) #define VRING_AVAIL_F_NO_INTERRUPT 1 +#define VIRTIO_MSI_NO_VECTOR 0xFFFF struct virtio_desc { uint64_t vd_addr; @@ -78,6 +79,8 @@ struct virtio_used { #define VTCFG_R_QNOTIFY 16 #define VTCFG_R_STATUS 18 #define VTCFG_R_ISR 19 +#define VTCFG_R_CFGVEC 20 +#define VTCFG_R_QVEC 22 #define VTCFG_R_CFG0 20 /* No MSI-X */ #define VTCFG_R_CFG1 24 /* With MSI-X */ #define VTCFG_R_MSIX 20 From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 07:48:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CBDB869C; Wed, 30 Jan 2013 07:48:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA130358; Wed, 30 Jan 2013 07:48:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0U7miAc044631; Wed, 30 Jan 2013 07:48:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0U7mihL044630; Wed, 30 Jan 2013 07:48:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301300748.r0U7mihL044630@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Jan 2013 07:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246113 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 07:48:44 -0000 Author: hselasky Date: Wed Jan 30 07:48:43 2013 New Revision: 246113 URL: http://svnweb.freebsd.org/changeset/base/246113 Log: Add missing NULL pointer check. Reported by: Lars Engels MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Wed Jan 30 06:37:18 2013 (r246112) +++ head/sys/dev/usb/controller/xhci.c Wed Jan 30 07:48:43 2013 (r246113) @@ -886,6 +886,12 @@ xhci_check_transfer(struct xhci_softc *s * a short packet also makes the transfer done */ if (td->remainder > 0) { + if (td->alt_next == NULL) { + DPRINTF("short TD has no " + "alternate next\n"); + xhci_generic_done(xfer); + break; + } DPRINTF("TD has short pkt\n"); if (xfer->flags_int.short_frames_ok || xfer->flags_int.isochronous_xfr || From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 10:03:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD5F68FB for ; Wed, 30 Jan 2013 10:03:39 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.78]) by mx1.freebsd.org (Postfix) with ESMTP id 66D3CBDF for ; Wed, 30 Jan 2013 10:03:39 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1U0UV4-0007yX-Dv for svn-src-all@freebsd.org; Wed, 30 Jan 2013 11:03:26 +0100 Received: from [81.21.138.17] (helo=ronaldradial.versatec.local) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1U0UV4-0006eV-HP for svn-src-all@freebsd.org; Wed, 30 Jan 2013 11:02:38 +0100 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: svn-src-all@freebsd.org Subject: Re: svn commit: r246032 - in head/sys: sys vm References: <201301281254.r0SCsrPK070947@svn.freebsd.org> Date: Wed, 30 Jan 2013 11:02:39 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <201301281254.r0SCsrPK070947@svn.freebsd.org> User-Agent: Opera Mail/12.13 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.1 X-Scan-Signature: 18b3e585b0ef946fc0f6ee9ab4fcc4ff X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 10:03:39 -0000 On Mon, 28 Jan 2013 13:54:53 +0100, Andrey Zonov wrote: > Author: zont > Date: Mon Jan 28 12:54:53 2013 > New Revision: 246032 > URL: http://svnweb.freebsd.org/changeset/base/246032 > > Log: > - Add system wide page faults requiring I/O counter. > Reviewed by: alc > MFC after: 2 weeks Sounds very useful! Ronald. > Modified: > head/sys/sys/vmmeter.h > head/sys/vm/vm_fault.c > head/sys/vm/vm_meter.c > > Modified: head/sys/sys/vmmeter.h > ============================================================================== > --- head/sys/sys/vmmeter.h Mon Jan 28 12:50:16 2013 (r246031) > +++ head/sys/sys/vmmeter.h Mon Jan 28 12:54:53 2013 (r246032) > @@ -61,6 +61,7 @@ struct vmmeter { > * Virtual memory activity. > */ > u_int v_vm_faults; /* (p) address memory faults */ > + u_int v_io_faults; /* (p) page faults requiring I/O */ > u_int v_cow_faults; /* (p) copy-on-writes faults */ > u_int v_cow_optim; /* (p) optimized copy-on-writes faults */ > u_int v_zfod; /* (p) pages zero filled on demand */ > > Modified: head/sys/vm/vm_fault.c > ============================================================================== > --- head/sys/vm/vm_fault.c Mon Jan 28 12:50:16 2013 (r246031) > +++ head/sys/vm/vm_fault.c Mon Jan 28 12:54:53 2013 (r246032) > @@ -939,9 +939,10 @@ vnode_locked: > * Unlock everything, and return > */ > unlock_and_deallocate(&fs); > - if (hardfault) > + if (hardfault) { > + PCPU_INC(cnt.v_io_faults); > curthread->td_ru.ru_majflt++; > - else > + } else > curthread->td_ru.ru_minflt++; > return (KERN_SUCCESS); > > Modified: head/sys/vm/vm_meter.c > ============================================================================== > --- head/sys/vm/vm_meter.c Mon Jan 28 12:50:16 2013 (r246031) > +++ head/sys/vm/vm_meter.c Mon Jan 28 12:54:53 2013 (r246032) > @@ -283,6 +283,7 @@ VM_STATS_SYS(v_syscall, "System calls"); > VM_STATS_SYS(v_intr, "Device interrupts"); > VM_STATS_SYS(v_soft, "Software interrupts"); > VM_STATS_VM(v_vm_faults, "Address memory faults"); > +VM_STATS_VM(v_io_faults, "Page faults requiring I/O"); > VM_STATS_VM(v_cow_faults, "Copy-on-write faults"); > VM_STATS_VM(v_cow_optim, "Optimized COW faults"); > VM_STATS_VM(v_zfod, "Pages zero-filled on demand"); > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 10:05:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23C3996B for ; Wed, 30 Jan 2013 10:05:26 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.78]) by mx1.freebsd.org (Postfix) with ESMTP id CC90BBF6 for ; Wed, 30 Jan 2013 10:05:25 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1U0UXk-0008LN-QW for svn-src-all@freebsd.org; Wed, 30 Jan 2013 11:05:25 +0100 Received: from [81.21.138.17] (helo=ronaldradial.versatec.local) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1U0UXk-0006pP-E9 for svn-src-all@freebsd.org; Wed, 30 Jan 2013 11:05:24 +0100 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: svn-src-all@freebsd.org Subject: Re: svn commit: r246016 - head/sys/dev/uart References: <201301272333.r0RNXhuO031356@svn.freebsd.org> Date: Wed, 30 Jan 2013 11:05:24 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <201301272333.r0RNXhuO031356@svn.freebsd.org> User-Agent: Opera Mail/12.13 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.1 X-Scan-Signature: a6d9551f4f6a9cf0aa9f9bf7e32696d9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 10:05:26 -0000 On Mon, 28 Jan 2013 00:33:43 +0100, Colin Percival wrote: > Author: cperciva > Date: Sun Jan 27 23:33:42 2013 > New Revision: 246016 > URL: http://svnweb.freebsd.org/changeset/base/246016 > > Log: > Add a loader tunable "hw.broken_txfifo" which enables a workaround for > a > bug in old versions of QEMU (and Xen, and other places using QEMU > code). > On those buggy emulated UARTs, the "TX idle" interrupt gets lost; with > this workaround, we spinwait for the TX to happen and then send > ourselves > the interrupt. It's ugly but it works, while minimizing the impact on > the code for the !broken_txfifo case. > MFC after: 2 weeks Would hw.uart.broken_txfifo not be a better name? It looks more in line with the other devices under hw.* and avoids naming collisions. Regards, Ronald. > > Modified: > head/sys/dev/uart/uart_dev_ns8250.c > > Modified: head/sys/dev/uart/uart_dev_ns8250.c > ============================================================================== > --- head/sys/dev/uart/uart_dev_ns8250.c Sun Jan 27 23:21:51 > 2013 (r246015) > +++ head/sys/dev/uart/uart_dev_ns8250.c Sun Jan 27 23:33:42 > 2013 (r246016) > @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > #include > #include > @@ -845,6 +847,11 @@ ns8250_bus_setsig(struct uart_softc *sc, > return (0); > } > +static int broken_txfifo = 0; > +SYSCTL_INT(_hw, OID_AUTO, broken_txfifo, CTLFLAG_RW | CTLFLAG_TUN, > + &broken_txfifo, 0, "UART FIFO has QEMU emulation bug"); > +TUNABLE_INT("hw.broken_txfifo", &broken_txfifo); > + > static int > ns8250_bus_transmit(struct uart_softc *sc) > { > @@ -862,7 +869,12 @@ ns8250_bus_transmit(struct uart_softc *s > uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); > uart_barrier(bas); > } > - sc->sc_txbusy = 1; > + if (broken_txfifo) > + ns8250_drain(bas, UART_DRAIN_TRANSMITTER); > + else > + sc->sc_txbusy = 1; > uart_unlock(sc->sc_hwmtx); > + if (broken_txfifo) > + uart_sched_softih(sc, SER_INT_TXIDLE); > return (0); > } > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 10:23:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B68EFEBB; Wed, 30 Jan 2013 10:23:39 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A945FD79; Wed, 30 Jan 2013 10:23:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UANdCM091957; Wed, 30 Jan 2013 10:23:39 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UANdIk091955; Wed, 30 Jan 2013 10:23:39 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201301301023.r0UANdIk091955@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 30 Jan 2013 10:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246114 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 10:23:39 -0000 Author: gabor Date: Wed Jan 30 10:23:38 2013 New Revision: 246114 URL: http://svnweb.freebsd.org/changeset/base/246114 Log: - Fix typo Submitted by: jkim Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jan 30 07:48:43 2013 (r246113) +++ head/UPDATING Wed Jan 30 10:23:38 2013 (r246114) @@ -31,7 +31,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 as bsdpatch, being the GNU version the default patch. To inverse the logic and use the BSD-licensed one as default, while having the GNU version installed as gnupatch, rebuild - ans install world with the WITH_BSD_PATCH knob set. + and install world with the WITH_BSD_PATCH knob set. 20130118: The install(1) option -M has changed meaning and now takes an From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 10:59:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8E103676; Wed, 30 Jan 2013 10:59:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74E13ED7; Wed, 30 Jan 2013 10:59:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UAxhZ1001369; Wed, 30 Jan 2013 10:59:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UAxhZc001368; Wed, 30 Jan 2013 10:59:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301301059.r0UAxhZc001368@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Jan 2013 10:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246115 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 10:59:43 -0000 Author: hselasky Date: Wed Jan 30 10:59:42 2013 New Revision: 246115 URL: http://svnweb.freebsd.org/changeset/base/246115 Log: Add missing header file inclusion guard. Modified: head/sys/dev/usb/ufm_ioctl.h Modified: head/sys/dev/usb/ufm_ioctl.h ============================================================================== --- head/sys/dev/usb/ufm_ioctl.h Wed Jan 30 10:23:38 2013 (r246114) +++ head/sys/dev/usb/ufm_ioctl.h Wed Jan 30 10:59:42 2013 (r246115) @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /*- * Copyright (c) 2001 M. Warner Losh * All rights reserved. @@ -28,7 +29,8 @@ * its contributors. */ -/* $FreeBSD$ */ +#ifndef _UFM_IOCTL_H_ +#define _UFM_IOCTL_H_ #include @@ -37,3 +39,5 @@ #define FM_START _IOWR('U', 202, int) #define FM_STOP _IOWR('U', 203, int) #define FM_GET_STAT _IOWR('U', 204, int) + +#endif /* _UFM_IOCTL_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 12:43:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A8AB46E; Wed, 30 Jan 2013 12:43:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 42CC6754; Wed, 30 Jan 2013 12:43:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UChA4o033315; Wed, 30 Jan 2013 12:43:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UChAbJ033314; Wed, 30 Jan 2013 12:43:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301301243.r0UChAbJ033314@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 30 Jan 2013 12:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246116 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 12:43:11 -0000 Author: kib Date: Wed Jan 30 12:43:10 2013 New Revision: 246116 URL: http://svnweb.freebsd.org/changeset/base/246116 Log: Reduce default shift used to calculate the max frequency for the TSC timecounter to 1, and correspondingly increase the precision of the gettimeofday(2) and related functions in the default configuration. The motivation for the TSC-low timecounter, as described in the r222866, seems to provide a workaround for the non-serializing behaviour of the RDTSC on some Intel hardware. Tests demonstrate that even with the pre-shift of 8, the cross-core non-monotonicity of the RDTSC is still observed reliably, e.g. on the Nehalems. The r238755 and r238973 implemented the proper fix for the issue. The pre-shift of 1 is applied to keep TSC not overflowing for the frequency of hardclock down to 2 sec/intr. The pre-shift is made a tunable to allow the easy debugging of the issues users could see with the shift being too low. Reviewed by: bde MFC after: 2 weeks Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Wed Jan 30 10:59:42 2013 (r246115) +++ head/sys/x86/x86/tsc.c Wed Jan 30 12:43:10 2013 (r246116) @@ -65,6 +65,12 @@ static int smp_tsc; SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc, CTLFLAG_RDTUN, &smp_tsc, 0, "Indicates whether the TSC is safe to use in SMP mode"); TUNABLE_INT("kern.timecounter.smp_tsc", &smp_tsc); + +static int smp_tsc_shift = 1; +SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc_shift, CTLFLAG_RDTUN, + &smp_tsc_shift, 0, + "Shift to pre-apply for the maximum TSC frequency in SMP mode"); +TUNABLE_INT("kern.timecounter.smp_tsc_shift", &smp_tsc_shift); #endif static int tsc_disabled; @@ -506,7 +512,7 @@ init_TSC_tc(void) tsc_timecounter.tc_quality = -100; } else { tsc_timecounter.tc_quality = test_smp_tsc(); - max_freq >>= 8; + max_freq >>= smp_tsc_shift; } } else #endif From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 12:48:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7235D678; Wed, 30 Jan 2013 12:48:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5494D7B4; Wed, 30 Jan 2013 12:48:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UCmKRl034089; Wed, 30 Jan 2013 12:48:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UCmHA3034071; Wed, 30 Jan 2013 12:48:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301301248.r0UCmHA3034071@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 30 Jan 2013 12:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246117 - in head: lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/ia64/sys lib/libc/mips/sys lib/libc/powerpc lib/libc/powerpc/sys lib/libc/powerpc64 lib/libc/powerpc64/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 12:48:20 -0000 Author: kib Date: Wed Jan 30 12:48:16 2013 New Revision: 246117 URL: http://svnweb.freebsd.org/changeset/base/246117 Log: Rework the __vdso_* symbols attributes to only make the symbols weak, but use normal references instead of weak. This makes the statically linked binaries to use fast gettimeofday(2) by forcing the linker to resolve references and providing the neccessary functions. Reported by: bde Tested by: marius (sparc64) MFC after: 2 weeks Added: head/lib/libc/arm/sys/__vdso_gettc.c (contents, props changed) head/lib/libc/ia64/sys/__vdso_gettc.c (contents, props changed) head/lib/libc/mips/sys/__vdso_gettc.c (contents, props changed) head/lib/libc/powerpc/sys/__vdso_gettc.c (contents, props changed) head/lib/libc/powerpc64/sys/__vdso_gettc.c (contents, props changed) head/lib/libc/sparc64/sys/__vdso_gettc.c (contents, props changed) Modified: head/lib/libc/amd64/sys/__vdso_gettc.c head/lib/libc/arm/sys/Makefile.inc head/lib/libc/i386/sys/__vdso_gettc.c head/lib/libc/ia64/sys/Makefile.inc head/lib/libc/mips/sys/Makefile.inc head/lib/libc/powerpc/Makefile.inc head/lib/libc/powerpc64/Makefile.inc head/lib/libc/sparc64/Makefile.inc head/lib/libc/sys/__vdso_gettimeofday.c head/lib/libc/sys/gettimeofday.c head/sys/sys/vdso.h Modified: head/lib/libc/amd64/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/amd64/sys/__vdso_gettc.c Wed Jan 30 12:43:10 2013 (r246116) +++ head/lib/libc/amd64/sys/__vdso_gettc.c Wed Jan 30 12:48:16 2013 (r246117) @@ -27,9 +27,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include +#include "libc_private.h" static u_int __vdso_gettc_low(const struct vdso_timehands *th) @@ -41,9 +43,18 @@ __vdso_gettc_low(const struct vdso_timeh return (rv); } +#pragma weak __vdso_gettc u_int __vdso_gettc(const struct vdso_timehands *th) { return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : rdtsc32()); } + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (_elf_aux_info(AT_TIMEKEEP, tk, sizeof(*tk))); +} Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Wed Jan 30 12:43:10 2013 (r246116) +++ head/lib/libc/arm/sys/Makefile.inc Wed Jan 30 12:48:16 2013 (r246117) @@ -1,5 +1,7 @@ # $FreeBSD$ +SRCS+= __vdso_gettc.c + MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S # Don't generate default code for these syscalls: Added: head/lib/libc/arm/sys/__vdso_gettc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/sys/__vdso_gettc.c Wed Jan 30 12:48:16 2013 (r246117) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2013 Konstantin Belousov + * + * 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 + +#pragma weak __vdso_gettc +u_int +__vdso_gettc(const struct vdso_timehands *th) +{ + + return (0); +} + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (ENOSYS); +} Modified: head/lib/libc/i386/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/i386/sys/__vdso_gettc.c Wed Jan 30 12:43:10 2013 (r246116) +++ head/lib/libc/i386/sys/__vdso_gettc.c Wed Jan 30 12:48:16 2013 (r246117) @@ -27,9 +27,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include +#include "libc_private.h" static u_int __vdso_gettc_low(const struct vdso_timehands *th) @@ -48,3 +50,11 @@ __vdso_gettc(const struct vdso_timehands return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : rdtsc32()); } + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (_elf_aux_info(AT_TIMEKEEP, tk, sizeof(*tk))); +} Modified: head/lib/libc/ia64/sys/Makefile.inc ============================================================================== --- head/lib/libc/ia64/sys/Makefile.inc Wed Jan 30 12:43:10 2013 (r246116) +++ head/lib/libc/ia64/sys/Makefile.inc Wed Jan 30 12:48:16 2013 (r246117) @@ -1,5 +1,7 @@ # $FreeBSD$ +SRCS+= __vdso_gettc.c + MDASM+= Ovfork.S brk.S cerror.S exect.S fork.S getcontext.S pipe.S ptrace.S \ sbrk.S setlogin.S sigreturn.S swapcontext.S Added: head/lib/libc/ia64/sys/__vdso_gettc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/ia64/sys/__vdso_gettc.c Wed Jan 30 12:48:16 2013 (r246117) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2013 Konstantin Belousov + * + * 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 + +#pragma weak __vdso_gettc +u_int +__vdso_gettc(const struct vdso_timehands *th) +{ + + return (0); +} + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (ENOSYS); +} Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Wed Jan 30 12:43:10 2013 (r246116) +++ head/lib/libc/mips/sys/Makefile.inc Wed Jan 30 12:48:16 2013 (r246117) @@ -1,5 +1,7 @@ # $FreeBSD$ +SRCS+= __vdso_gettc.c + MDASM= Ovfork.S brk.S cerror.S exect.S \ fork.S pipe.S ptrace.S sbrk.S syscall.S Added: head/lib/libc/mips/sys/__vdso_gettc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/mips/sys/__vdso_gettc.c Wed Jan 30 12:48:16 2013 (r246117) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2013 Konstantin Belousov + * + * 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 + +#pragma weak __vdso_gettc +u_int +__vdso_gettc(const struct vdso_timehands *th) +{ + + return (0); +} + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (ENOSYS); +} Modified: head/lib/libc/powerpc/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/Makefile.inc Wed Jan 30 12:43:10 2013 (r246116) +++ head/lib/libc/powerpc/Makefile.inc Wed Jan 30 12:48:16 2013 (r246117) @@ -1,5 +1,7 @@ # $FreeBSD$ +SRCS+= __vdso_gettc.c + # Long double is 64-bits MDSRCS+=machdep_ldisd.c SYM_MAPS+=${.CURDIR}/powerpc/Symbol.map Added: head/lib/libc/powerpc/sys/__vdso_gettc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc/sys/__vdso_gettc.c Wed Jan 30 12:48:16 2013 (r246117) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2013 Konstantin Belousov + * + * 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 + +#pragma weak __vdso_gettc +u_int +__vdso_gettc(const struct vdso_timehands *th) +{ + + return (0); +} + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (ENOSYS); +} Modified: head/lib/libc/powerpc64/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/Makefile.inc Wed Jan 30 12:43:10 2013 (r246116) +++ head/lib/libc/powerpc64/Makefile.inc Wed Jan 30 12:48:16 2013 (r246117) @@ -1,5 +1,7 @@ # $FreeBSD$ +SRCS+= __vdso_gettc.c + # Long double is 64-bits MDSRCS+=machdep_ldisd.c SYM_MAPS+=${.CURDIR}/powerpc64/Symbol.map Added: head/lib/libc/powerpc64/sys/__vdso_gettc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/sys/__vdso_gettc.c Wed Jan 30 12:48:16 2013 (r246117) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2013 Konstantin Belousov + * + * 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 + +#pragma weak __vdso_gettc +u_int +__vdso_gettc(const struct vdso_timehands *th) +{ + + return (0); +} + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (ENOSYS); +} Modified: head/lib/libc/sparc64/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/Makefile.inc Wed Jan 30 12:43:10 2013 (r246116) +++ head/lib/libc/sparc64/Makefile.inc Wed Jan 30 12:48:16 2013 (r246117) @@ -5,6 +5,8 @@ .include "fpu/Makefile.inc" +SRCS+= __vdso_gettc.c + # Long double is quad precision GDTOASRCS+=strtorQ.c MDSRCS+=machdep_ldisQ.c Added: head/lib/libc/sparc64/sys/__vdso_gettc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sparc64/sys/__vdso_gettc.c Wed Jan 30 12:48:16 2013 (r246117) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2013 Konstantin Belousov + * + * 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 + +#pragma weak __vdso_gettc +u_int +__vdso_gettc(const struct vdso_timehands *th) +{ + + return (0); +} + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (ENOSYS); +} Modified: head/lib/libc/sys/__vdso_gettimeofday.c ============================================================================== --- head/lib/libc/sys/__vdso_gettimeofday.c Wed Jan 30 12:43:10 2013 (r246116) +++ head/lib/libc/sys/__vdso_gettimeofday.c Wed Jan 30 12:48:16 2013 (r246117) @@ -79,6 +79,7 @@ binuptime(struct bintime *bt, struct vds static struct vdso_timekeep *tk; +#pragma weak __vdso_gettimeofday int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz) { @@ -88,7 +89,7 @@ __vdso_gettimeofday(struct timeval *tv, if (tz != NULL) return (ENOSYS); if (tk == NULL) { - error = _elf_aux_info(AT_TIMEKEEP, &tk, sizeof(tk)); + error = __vdso_gettimekeep(&tk); if (error != 0 || tk == NULL) return (ENOSYS); } @@ -101,6 +102,7 @@ __vdso_gettimeofday(struct timeval *tv, return (0); } +#pragma weak __vdso_clock_gettime int __vdso_clock_gettime(clockid_t clock_id, struct timespec *ts) { Modified: head/lib/libc/sys/gettimeofday.c ============================================================================== --- head/lib/libc/sys/gettimeofday.c Wed Jan 30 12:43:10 2013 (r246116) +++ head/lib/libc/sys/gettimeofday.c Wed Jan 30 12:48:16 2013 (r246117) @@ -41,10 +41,7 @@ __gettimeofday(struct timeval *tv, struc { int error; - if (__vdso_gettimeofday != NULL && __vdso_gettc != NULL) - error = __vdso_gettimeofday(tv, tz); - else - error = ENOSYS; + error = __vdso_gettimeofday(tv, tz); if (error == ENOSYS) error = __sys_gettimeofday(tv, tz); return (error); Modified: head/sys/sys/vdso.h ============================================================================== --- head/sys/sys/vdso.h Wed Jan 30 12:43:10 2013 (r246116) +++ head/sys/sys/vdso.h Wed Jan 30 12:48:16 2013 (r246117) @@ -61,13 +61,9 @@ struct timeval; struct timezone; int __vdso_clock_gettime(clockid_t clock_id, struct timespec *ts); -#pragma weak __vdso_clock_gettime - int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz); -#pragma weak __vdso_gettimeofday - u_int __vdso_gettc(const struct vdso_timehands *vdso_th); -#pragma weak __vdso_gettc +int __vdso_gettimekeep(struct vdso_timekeep **tk); #endif From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 13:14:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7ECCCAF8; Wed, 30 Jan 2013 13:14:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 59484903; Wed, 30 Jan 2013 13:14:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UDEGkY042903; Wed, 30 Jan 2013 13:14:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UDEG2D042902; Wed, 30 Jan 2013 13:14:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301301314.r0UDEG2D042902@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 30 Jan 2013 13:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246118 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 13:14:16 -0000 Author: kib Date: Wed Jan 30 13:14:15 2013 New Revision: 246118 URL: http://svnweb.freebsd.org/changeset/base/246118 Log: The case of pid == WAIT_MYPGRP for the kern_wait() is already handled in kern_wait6(), which is called by kern_wait(). Remove the redundand check, introduced in r243136, and add a comment noting this, to make the code less confusing. The blank lines are added to properly delineate the scope of the preceeding comments. Noted by: "Jukka A. Ukkonen" MFC after: 1 week Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Jan 30 12:48:16 2013 (r246117) +++ head/sys/kern/kern_exit.c Wed Jan 30 13:14:15 2013 (r246118) @@ -1024,20 +1024,18 @@ kern_wait(struct thread *td, pid_t pid, struct rusage *rusage) { struct __wrusage wru, *wrup; - struct proc *q; idtype_t idtype; id_t id; int ret; + /* + * Translate the special pid values into the (idtype, pid) + * pair for kern_wait6. The WAIT_MYPGRP case is handled by + * kern_wait6() on its own. + */ if (pid == WAIT_ANY) { idtype = P_ALL; id = 0; - } else if (pid == WAIT_MYPGRP) { - idtype = P_PGID; - q = td->td_proc; - PROC_LOCK(q); - id = (id_t)q->p_pgid; - PROC_UNLOCK(q); } else if (pid < 0) { idtype = P_PGID; id = (id_t)-pid; @@ -1045,10 +1043,12 @@ kern_wait(struct thread *td, pid_t pid, idtype = P_PID; id = (id_t)pid; } + if (rusage != NULL) wrup = &wru; else wrup = NULL; + /* * For backward compatibility we implicitly add flags WEXITED * and WTRAPPED here. From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 13:14:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF308C6A; Wed, 30 Jan 2013 13:14:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 897C590D; Wed, 30 Jan 2013 13:14:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UDEZ6W042979; Wed, 30 Jan 2013 13:14:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UDEZBx042978; Wed, 30 Jan 2013 13:14:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301301314.r0UDEZBx042978@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 30 Jan 2013 13:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246119 - head/tools/test/pthread_vfork X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 13:14:35 -0000 Author: kib Date: Wed Jan 30 13:14:34 2013 New Revision: 246119 URL: http://svnweb.freebsd.org/changeset/base/246119 Log: Rework the handling of the children for the pthread_vfork_test. The trivial handler for SIGCHLD is installed, and SIGCHLD is blocked, to not abandon our zombies to init(8). This way, the zombies are around slightly longer, allowing to actually exercise the logic for p_pwait use by the test. MFC after: 1 week Modified: head/tools/test/pthread_vfork/pthread_vfork_test.c Modified: head/tools/test/pthread_vfork/pthread_vfork_test.c ============================================================================== --- head/tools/test/pthread_vfork/pthread_vfork_test.c Wed Jan 30 13:14:15 2013 (r246118) +++ head/tools/test/pthread_vfork/pthread_vfork_test.c Wed Jan 30 13:14:34 2013 (r246119) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include @@ -39,10 +41,11 @@ __FBSDID("$FreeBSD$"); #define NUM_THREADS 100 -void * -vfork_test(void *threadid) +static void * +vfork_test(void *threadid __unused) { - pid_t pid; + pid_t pid, wpid; + int status; for (;;) { pid = vfork(); @@ -50,10 +53,20 @@ vfork_test(void *threadid) _exit(0); else if (pid == -1) err(1, "Failed to vfork"); + else { + wpid = waitpid(pid, &status, 0); + if (wpid == -1) + err(1, "waitpid"); + } } return (NULL); } +static void +sighandler(int signo __unused) +{ +} + /* * This program invokes multiple threads and each thread calls * vfork() system call. @@ -63,19 +76,24 @@ main(void) { pthread_t threads[NUM_THREADS]; struct sigaction reapchildren; + sigset_t sigchld_mask; int rc, t; memset(&reapchildren, 0, sizeof(reapchildren)); - reapchildren.sa_handler = SIG_IGN; - - /* Automatically reap zombies. */ + reapchildren.sa_handler = sighandler; if (sigaction(SIGCHLD, &reapchildren, NULL) == -1) err(1, "Could not sigaction(SIGCHLD)"); + sigemptyset(&sigchld_mask); + sigaddset(&sigchld_mask, SIGCHLD); + if (sigprocmask(SIG_BLOCK, &sigchld_mask, NULL) == -1) + err(1, "sigprocmask"); + for (t = 0; t < NUM_THREADS; t++) { - rc = pthread_create(&threads[t], NULL, vfork_test, (void *)t); + rc = pthread_create(&threads[t], NULL, vfork_test, &t); if (rc) errc(1, rc, "pthread_create"); } + pause(); return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 14:59:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 47848E43; Wed, 30 Jan 2013 14:59:28 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E16CF06; Wed, 30 Jan 2013 14:59:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UExSoI074262; Wed, 30 Jan 2013 14:59:28 GMT (envelope-from gahr@svn.freebsd.org) Received: (from gahr@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UExQKw074249; Wed, 30 Jan 2013 14:59:26 GMT (envelope-from gahr@svn.freebsd.org) Message-Id: <201301301459.r0UExQKw074249@svn.freebsd.org> From: Pietro Cerutti Date: Wed, 30 Jan 2013 14:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246120 - in head: include lib/libc/stdio tools/regression/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 14:59:28 -0000 Author: gahr (ports committer) Date: Wed Jan 30 14:59:26 2013 New Revision: 246120 URL: http://svnweb.freebsd.org/changeset/base/246120 Log: Add fmemopen(3), an interface to get a FILE * from a buffer in memory, along with the respective regression test. See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html Reviewed by: cognet Approved by: cognet Added: head/lib/libc/stdio/fmemopen.c (contents, props changed) head/tools/regression/lib/libc/stdio/test-fmemopen.c (contents, props changed) head/tools/regression/lib/libc/stdio/test-fmemopen.t (contents, props changed) Modified: head/include/stdio.h (contents, props changed) head/lib/libc/stdio/Makefile.inc (contents, props changed) head/lib/libc/stdio/Symbol.map (contents, props changed) head/lib/libc/stdio/fopen.3 (contents, props changed) Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Wed Jan 30 13:14:34 2013 (r246119) +++ head/include/stdio.h Wed Jan 30 14:59:26 2013 (r246120) @@ -343,6 +343,7 @@ char *tempnam(const char *, const char * #endif #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +FILE *fmemopen(void * __restrict, size_t, const char * __restrict); ssize_t getdelim(char ** __restrict, size_t * __restrict, int, FILE * __restrict); int renameat(int, const char *, int, const char *); Modified: head/lib/libc/stdio/Makefile.inc ============================================================================== --- head/lib/libc/stdio/Makefile.inc Wed Jan 30 13:14:34 2013 (r246119) +++ head/lib/libc/stdio/Makefile.inc Wed Jan 30 14:59:26 2013 (r246120) @@ -8,7 +8,8 @@ SRCS+= _flock_stub.c asprintf.c clrerr.c fclose.c fcloseall.c fdopen.c \ feof.c ferror.c fflush.c fgetc.c fgetln.c fgetpos.c fgets.c fgetwc.c \ fgetwln.c fgetws.c \ - fileno.c findfp.c flags.c fopen.c fprintf.c fpurge.c fputc.c fputs.c \ + fileno.c findfp.c flags.c fmemopen.c fopen.c fprintf.c fpurge.c \ + fputc.c fputs.c \ fputwc.c fputws.c fread.c freopen.c fscanf.c fseek.c fsetpos.c \ ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \ fwrite.c getc.c getchar.c getdelim.c getline.c \ @@ -48,7 +49,7 @@ MLINKS+=ferror.3 ferror_unlocked.3 \ MLINKS+=fflush.3 fpurge.3 MLINKS+=fgets.3 gets.3 MLINKS+=flockfile.3 ftrylockfile.3 flockfile.3 funlockfile.3 -MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 +MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 fopen.3 fmemopen.3 MLINKS+=fputs.3 puts.3 MLINKS+=fread.3 fwrite.3 MLINKS+=fseek.3 fgetpos.3 fseek.3 fseeko.3 fseek.3 fsetpos.3 fseek.3 ftell.3 \ Modified: head/lib/libc/stdio/Symbol.map ============================================================================== --- head/lib/libc/stdio/Symbol.map Wed Jan 30 13:14:34 2013 (r246119) +++ head/lib/libc/stdio/Symbol.map Wed Jan 30 14:59:26 2013 (r246120) @@ -155,6 +155,7 @@ FBSD_1.3 { getwchar_l; putwc_l; putwchar_l; + fmemopen; }; FBSDprivate_1.0 { Added: head/lib/libc/stdio/fmemopen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdio/fmemopen.c Wed Jan 30 14:59:26 2013 (r246120) @@ -0,0 +1,182 @@ +/*- +Copyright (C) 2013 Pietro Cerutti + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +*/ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +struct __fmemopen_cookie +{ + char *buf; /* pointer to the memory region */ + char own; /* did we allocate the buffer ourselves? */ + long len; /* buffer length in bytes */ + long off; /* current offset into the buffer */ +}; + +static int fmemopen_read (void *cookie, char *buf, int nbytes); +static int fmemopen_write (void *cookie, const char *buf, int nbytes); +static fpos_t fmemopen_seek (void *cookie, fpos_t offset, int whence); +static int fmemopen_close (void *cookie); + +FILE * +fmemopen (void * __restrict buf, size_t size, const char * __restrict mode) +{ + /* allocate cookie */ + struct __fmemopen_cookie *ck = malloc (sizeof (struct __fmemopen_cookie)); + if (ck == NULL) { + errno = ENOMEM; + return (NULL); + } + + ck->off = 0; + ck->len = size; + + /* do we have to allocate the buffer ourselves? */ + ck->own = ((ck->buf = buf) == NULL); + if (ck->own) { + ck->buf = malloc (size); + if (ck->buf == NULL) { + free (ck); + errno = ENOMEM; + return (NULL); + } + ck->buf[0] = '\0'; + } + + if (mode[0] == 'a') + ck->off = strnlen(ck->buf, ck->len); + + /* actuall wrapper */ + FILE *f = funopen ((void *)ck, fmemopen_read, fmemopen_write, + fmemopen_seek, fmemopen_close); + + if (f == NULL) { + if (ck->own) + free (ck->buf); + free (ck); + return (NULL); + } + + /* turn off buffering, so a write past the end of the buffer + * correctly returns a short object count */ + setvbuf (f, (char *) NULL, _IONBF, 0); + + return (f); +} + +static int +fmemopen_read (void *cookie, char *buf, int nbytes) +{ + struct __fmemopen_cookie *ck = cookie; + + if (nbytes > ck->len - ck->off) + nbytes = ck->len - ck->off; + + if (nbytes == 0) + return (0); + + memcpy (buf, ck->buf + ck->off, nbytes); + + ck->off += nbytes; + + return (nbytes); +} + +static int +fmemopen_write (void *cookie, const char *buf, int nbytes) +{ + struct __fmemopen_cookie *ck = cookie; + + if (nbytes > ck->len - ck->off) + nbytes = ck->len - ck->off; + + if (nbytes == 0) + return (0); + + memcpy (ck->buf + ck->off, buf, nbytes); + + ck->off += nbytes; + + if (ck->off < ck->len && ck->buf[ck->off - 1] != '\0') + ck->buf[ck->off] = '\0'; + + return (nbytes); +} + +static fpos_t +fmemopen_seek (void *cookie, fpos_t offset, int whence) +{ + struct __fmemopen_cookie *ck = cookie; + + + switch (whence) { + case SEEK_SET: + if (offset > ck->len) { + errno = EINVAL; + return (-1); + } + ck->off = offset; + break; + + case SEEK_CUR: + if (ck->off + offset > ck->len) { + errno = EINVAL; + return (-1); + } + ck->off += offset; + break; + + case SEEK_END: + if (offset > 0 || -offset > ck->len) { + errno = EINVAL; + return (-1); + } + ck->off = ck->len + offset; + break; + + default: + errno = EINVAL; + return (-1); + } + + return (ck->off); +} + +static int +fmemopen_close (void *cookie) +{ + struct __fmemopen_cookie *ck = cookie; + + if (ck->own) + free (ck->buf); + + free (ck); + + return (0); +} Modified: head/lib/libc/stdio/fopen.3 ============================================================================== --- head/lib/libc/stdio/fopen.3 Wed Jan 30 13:14:34 2013 (r246119) +++ head/lib/libc/stdio/fopen.3 Wed Jan 30 14:59:26 2013 (r246120) @@ -32,13 +32,14 @@ .\" @(#)fopen.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 30, 2012 +.Dd January 30, 2013 .Dt FOPEN 3 .Os .Sh NAME .Nm fopen , .Nm fdopen , -.Nm freopen +.Nm freopen , +.Nm fmemopen .Nd stream open functions .Sh LIBRARY .Lb libc @@ -50,6 +51,8 @@ .Fn fdopen "int fildes" "const char *mode" .Ft FILE * .Fn freopen "const char *path" "const char *mode" "FILE *stream" +.Ft FILE * +.Fn fmemopen "void *restrict *buf" "size_t size" "const char * restrict mode" .Sh DESCRIPTION The .Fn fopen @@ -202,6 +205,29 @@ standard text stream .Dv ( stderr , stdin , or .Dv stdout ) . +.Pp +The +.Fn fmemopen +function +associates the buffer given by the +.Fa buf +and +.Fa size +arguments with a stream. +The +.Fa buf +argument shall be either a null pointer or point to a buffer that +is at least +.Fa size +bytes long. +If a null pointer is specified as the +.Fa buf +argument, +.Fn fmemopen +shall allocate +.Fa size +bytes of memory. This buffer shall be automatically freed when the +stream is closed. .Sh RETURN VALUES Upon successful completion .Fn fopen , @@ -225,16 +251,18 @@ argument to .Fn fopen , .Fn fdopen , +.Fn freopen , or -.Fn freopen +.Fn fmemopen was invalid. .El .Pp The .Fn fopen , -.Fn fdopen -and +.Fn fdopen , .Fn freopen +and +.Fn fmemopen functions may also fail and set .Va errno @@ -294,3 +322,8 @@ The .Dq Li e mode option does not conform to any standard but is also supported by glibc. +The +.Fn fmemopen +function +conforms to +.St -p1003.1-2008 . Added: head/tools/regression/lib/libc/stdio/test-fmemopen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/stdio/test-fmemopen.c Wed Jan 30 14:59:26 2013 (r246120) @@ -0,0 +1,143 @@ +/*- +Copyright (C) 2013 Pietro Cerutti + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +*/ + +/* + * Test basic FILE * functions (fread, fwrite, fseek, fclose) against + * a FILE * retrieved using fmemopen() + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +void +test_preexisting () +{ + /* + * use a pre-existing buffer + */ + + char buf[512]; + char buf2[512]; + char str[] = "Test writing some stuff"; + char str2[] = "AAAAAAAAA"; + char str3[] = "AAAA writing some stuff"; + FILE *fp; + size_t nofw, nofr; + int rc; + + /* open a FILE * using fmemopen */ + fp = fmemopen (buf, sizeof buf, "w"); + assert (fp != NULL); + + /* write to the buffer */ + nofw = fwrite (str, 1, sizeof str, fp); + assert (nofw == sizeof str); + + /* close the FILE * */ + rc = fclose (fp); + assert (rc == 0); + + /* re-open the FILE * to read back the data */ + fp = fmemopen (buf, sizeof buf, "r"); + assert (fp != NULL); + + /* read from the buffer */ + bzero (buf2, sizeof buf2); + nofr = fread (buf2, 1, sizeof buf2, fp); + assert (nofr == sizeof buf2); + + /* since a write on a FILE * retrieved by fmemopen + * will add a '\0' (if there's space), we can check + * the strings for equality */ + assert (strcmp(str, buf2) == 0); + + /* close the FILE * */ + rc = fclose (fp); + assert (rc == 0); + + /* now open a FILE * on the first 4 bytes of the string */ + fp = fmemopen (str, 4, "w"); + assert (fp != NULL); + + /* try to write more bytes than we shoud, we'll get a short count (4) */ + nofw = fwrite (str2, 1, sizeof str2, fp); + assert (nofw == 4); + + /* close the FILE * */ + rc = fclose (fp); + + /* check that the string was not modified after the first 4 bytes */ + assert (strcmp (str, str3) == 0); +} + +void +test_autoalloc () +{ + /* + * let fmemopen allocate the buffer + */ + + char str[] = "A quick test"; + FILE *fp; + long pos; + size_t nofw, nofr, i; + int rc; + + /* open a FILE * using fmemopen */ + fp = fmemopen (NULL, 512, "w"); + assert (fp != NULL); + + /* fill the buffer */ + for (i = 0; i < 512; i++) { + nofw = fwrite ("a", 1, 1, fp); + assert (nofw == 1); + } + + /* get the current position into the stream */ + pos = ftell (fp); + assert (pos == 512); + + /* try to write past the end, we should get a short object count (0) */ + nofw = fwrite ("a", 1, 1, fp); + assert (nofw == 0); + + /* close the FILE * */ + rc = fclose (fp); + assert (rc == 0); +} + +int +main (void) +{ + test_autoalloc (); + test_preexisting (); + return (0); +} Added: head/tools/regression/lib/libc/stdio/test-fmemopen.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/stdio/test-fmemopen.t Wed Jan 30 14:59:26 2013 (r246120) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 15:21:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6828D393; Wed, 30 Jan 2013 15:21:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5CAFFA; Wed, 30 Jan 2013 15:21:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UFLI6x082494; Wed, 30 Jan 2013 15:21:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UFLIaT082491; Wed, 30 Jan 2013 15:21:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301301521.r0UFLIaT082491@svn.freebsd.org> From: Ian Lepore Date: Wed, 30 Jan 2013 15:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246121 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 15:21:19 -0000 Author: ian Date: Wed Jan 30 15:21:18 2013 New Revision: 246121 URL: http://svnweb.freebsd.org/changeset/base/246121 Log: Fix a descriptor leak in devd. Clients reading /var/run/devd.pipe can close their socket connection any time, and devd only notices that when it gets an error trying to write an event to the client. On a system with no device change activity, clients could connect and disappear repeatedly without devd noticing, leading to an ever-growing list of open socket descriptors in devd. Now devd uses poll(2) looking for POLLHUP on all existing clients every time a new client connection is established, and also periodically (once a minute) to proactively find zombie clients and reap the socket descriptors. It also now has a connection limit, configurable with a new -l command line arg. When the maximum number of connections is reached it stops accepting new connections until some current clients drop off. Reviewed by: imp Approved by: cognet (mentor) Modified: head/sbin/devd/devd.8 head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.8 ============================================================================== --- head/sbin/devd/devd.8 Wed Jan 30 14:59:26 2013 (r246120) +++ head/sbin/devd/devd.8 Wed Jan 30 15:21:18 2013 (r246121) @@ -35,6 +35,7 @@ .Nm .Op Fl Ddn .Op Fl f Ar file +.Op Fl l Ar num .Sh DESCRIPTION The .Nm @@ -55,6 +56,12 @@ instead of the default If option .Fl f is specified more than once, the last file specified is used. +.It Fl l Ar num +Limit concurrent +.Pa /var/run/devd.pipe +connections to +.Ar num . +The default connection limit is 10. .It Fl n Do not process all pending events before becoming a daemon. Instead, call daemon right away. Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Wed Jan 30 14:59:26 2013 (r246120) +++ head/sbin/devd/devd.cc Wed Jan 30 15:21:18 2013 (r246121) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -814,23 +815,58 @@ create_socket(const char *name) return (fd); } +unsigned int max_clients = 10; /* Default, can be overriden on cmdline. */ +unsigned int num_clients; list clients; void notify_clients(const char *data, int len) { - list bad; - list::const_iterator i; + list::iterator i; - for (i = clients.begin(); i != clients.end(); ++i) { - if (write(*i, data, len) <= 0) { - bad.push_back(*i); + /* + * Deliver the data to all clients. Throw clients overboard at the + * first sign of trouble. This reaps clients who've died or closed + * their sockets, and also clients who are alive but failing to keep up + * (or who are maliciously not reading, to consume buffer space in + * kernel memory or tie up the limited number of available connections). + */ + for (i = clients.begin(); i != clients.end(); ) { + if (write(*i, data, len) != len) { + --num_clients; close(*i); - } + i = clients.erase(i); + } else + ++i; } +} + +void +check_clients(void) +{ + int s; + struct pollfd pfd; + list::iterator i; - for (i = bad.begin(); i != bad.end(); ++i) - clients.erase(find(clients.begin(), clients.end(), *i)); + /* + * Check all existing clients to see if any of them have disappeared. + * Normally we reap clients when we get an error trying to send them an + * event. This check eliminates the problem of an ever-growing list of + * zombie clients because we're never writing to them on a system + * without frequent device-change activity. + */ + pfd.events = 0; + for (i = clients.begin(); i != clients.end(); ) { + pfd.fd = *i; + s = poll(&pfd, 1, 0); + if ((s < 0 && s != EINTR ) || + (s > 0 && (pfd.revents & POLLHUP))) { + --num_clients; + close(*i); + i = clients.erase(i); + } else + ++i; + } } void @@ -838,9 +874,18 @@ new_client(int fd) { int s; + /* + * First go reap any zombie clients, then accept the connection, and + * shut down the read side to stop clients from consuming kernel memory + * by sending large buffers full of data we'll never read. + */ + check_clients(); s = accept(fd, NULL, NULL); - if (s != -1) + if (s != -1) { + shutdown(s, SHUT_RD); clients.push_back(s); + ++num_clients; + } } static void @@ -851,6 +896,7 @@ event_loop(void) char buffer[DEVCTL_MAXBUF]; int once = 0; int server_fd, max_fd; + int accepting; timeval tv; fd_set fds; @@ -858,6 +904,7 @@ event_loop(void) if (fd == -1) err(1, "Can't open devctl device %s", PATH_DEVCTL); server_fd = create_socket(PIPE); + accepting = 1; max_fd = max(fd, server_fd) + 1; while (1) { if (romeo_must_die) @@ -880,15 +927,38 @@ event_loop(void) once++; } } + /* + * When we've already got the max number of clients, stop + * accepting new connections (don't put server_fd in the set), + * shrink the accept() queue to reject connections quickly, and + * poll the existing clients more often, so that we notice more + * quickly when any of them disappear to free up client slots. + */ FD_ZERO(&fds); FD_SET(fd, &fds); - FD_SET(server_fd, &fds); - rv = select(max_fd, &fds, NULL, NULL, NULL); + if (num_clients < max_clients) { + if (!accepting) { + listen(server_fd, max_clients); + accepting = 1; + } + FD_SET(server_fd, &fds); + tv.tv_sec = 60; + tv.tv_usec = 0; + } else { + if (accepting) { + listen(server_fd, 0); + accepting = 0; + } + tv.tv_sec = 2; + tv.tv_usec = 0; + } + rv = select(max_fd, &fds, NULL, NULL, &tv); if (rv == -1) { if (errno == EINTR) continue; err(1, "select"); - } + } else if (rv == 0) + check_clients(); if (FD_ISSET(fd, &fds)) { rv = read(fd, buffer, sizeof(buffer) - 1); if (rv > 0) { @@ -1007,7 +1077,8 @@ gensighand(int) static void usage() { - fprintf(stderr, "usage: %s [-Ddn] [-f file]\n", getprogname()); + fprintf(stderr, "usage: %s [-Ddn] [-l connlimit] [-f file]\n", + getprogname()); exit(1); } @@ -1036,7 +1107,7 @@ main(int argc, char **argv) int ch; check_devd_enabled(); - while ((ch = getopt(argc, argv, "Ddf:n")) != -1) { + while ((ch = getopt(argc, argv, "Ddf:l:n")) != -1) { switch (ch) { case 'D': Dflag++; @@ -1047,6 +1118,9 @@ main(int argc, char **argv) case 'f': configfile = optarg; break; + case 'l': + max_clients = MAX(1, strtoul(optarg, NULL, 0)); + break; case 'n': nflag++; break; From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 15:26:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DAB41729; Wed, 30 Jan 2013 15:26:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBC2CB6; Wed, 30 Jan 2013 15:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UFQC7n083321; Wed, 30 Jan 2013 15:26:12 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UFQ5rF083270; Wed, 30 Jan 2013 15:26:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301301526.r0UFQ5rF083270@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Jan 2013 15:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246122 - in head/sys/dev/usb: . controller storage template X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 15:26:12 -0000 Author: hselasky Date: Wed Jan 30 15:26:04 2013 New Revision: 246122 URL: http://svnweb.freebsd.org/changeset/base/246122 Log: Modify the FreeBSD USB kernel code so that it can be compiled directly into the FreeBSD boot loader, typically for non-USB aware BIOSes, EFI systems or embedded platforms. This is also useful for out of the system compilation of the FreeBSD USB stack for various purposes. The USB kernel files can now optionally include a global header file which should include all needed definitions required to compile the FreeBSD USB stack. When the global USB header file is included, no other USB header files will be included by default. Add new file containing the USB stack configuration for the FreeBSD loader build. Replace some __FBSDID()'s by /* $FreeBSD$ */ comments. Now all USB files follow the same style. Use cases: - console in loader via USB - loading kernel via USB Discussed with: Hiroki Sato, hrs @ EuroBSDCon Added: head/sys/dev/usb/usb_freebsd_loader.h (contents, props changed) Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_cdce.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_mouse.c head/sys/dev/usb/template/usb_template_msc.c head/sys/dev/usb/template/usb_template_mtp.c head/sys/dev/usb/usb.h head/sys/dev/usb/usb_busdma.c head/sys/dev/usb/usb_busdma.h head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_core.c head/sys/dev/usb/usb_debug.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_dev.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_dynamic.c head/sys/dev/usb/usb_endian.h head/sys/dev/usb/usb_error.c head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_handle_request.c head/sys/dev/usb/usb_hid.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_ioctl.h head/sys/dev/usb/usb_lookup.c head/sys/dev/usb/usb_mbuf.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_parse.c head/sys/dev/usb/usb_pci.h head/sys/dev/usb/usb_pf.c head/sys/dev/usb/usb_process.c head/sys/dev/usb/usb_process.h head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usb_util.c head/sys/dev/usb/usbdi.h head/sys/dev/usb/usbhid.h Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/at91dci.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,6 +1,4 @@ -#include -__FBSDID("$FreeBSD$"); - +/* $FreeBSD$ */ /*- * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. * @@ -44,6 +42,9 @@ __FBSDID("$FreeBSD$"); * endpoints, Function-address and more. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -79,6 +80,8 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + #include #define AT9100_DCI_BUS2SC(bus) \ Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/atmegadci.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,6 +1,4 @@ -#include -__FBSDID("$FreeBSD$"); - +/* $FreeBSD$ */ /*- * Copyright (c) 2009 Hans Petter Selasky. All rights reserved. * @@ -36,6 +34,9 @@ __FBSDID("$FreeBSD$"); * endpoints, Function-address and more. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -71,6 +72,8 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + #include #define ATMEGA_BUS2SC(bus) \ Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/avr32dci.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,6 +1,4 @@ -#include -__FBSDID("$FreeBSD$"); - +/* $FreeBSD$ */ /*- * Copyright (c) 2009 Hans Petter Selasky. All rights reserved. * @@ -35,7 +33,9 @@ __FBSDID("$FreeBSD$"); * NOTE: When the chip detects BUS-reset it will also reset the * endpoints, Function-address and more. */ - +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -71,6 +71,8 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + #include #define AVR32_BUS2SC(bus) \ Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/dwc_otg.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /*- * Copyright (c) 2012 Hans Petter Selasky. All rights reserved. * Copyright (c) 2010-2011 Aleksandr Rybalko. All rights reserved. @@ -41,9 +42,9 @@ * internal reset. */ -#include -__FBSDID("$FreeBSD$"); - +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -79,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ #include #include Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/ehci.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * Copyright (c) 2004 The NetBSD Foundation, Inc. All rights reserved. @@ -43,9 +44,9 @@ * 1) command failures are not recovered correctly */ -#include -__FBSDID("$FreeBSD$"); - +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -81,6 +82,8 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + #include #include Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/musb_otg.c Wed Jan 30 15:26:04 2013 (r246122) @@ -36,6 +36,9 @@ * NOTE: The current implementation only supports Device Side Mode! */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -71,6 +74,8 @@ #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + #include #define MUSBOTG_INTR_ENDPT 1 Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/ohci.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. @@ -25,9 +26,6 @@ * SUCH DAMAGE. */ -#include -__FBSDID("$FreeBSD$"); - /* * USB Open Host Controller driver. * @@ -35,6 +33,9 @@ __FBSDID("$FreeBSD$"); * USB spec: http://www.usb.org/developers/docs/usbspec.zip */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -70,6 +71,8 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + #include #include Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/uhci.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. @@ -25,9 +26,6 @@ * SUCH DAMAGE. */ -#include -__FBSDID("$FreeBSD$"); - /* * USB Universal Host Controller driver. * Handles e.g. PIIX3 and PIIX4. @@ -38,6 +36,9 @@ __FBSDID("$FreeBSD$"); * ftp://download.intel.com/design/intarch/datashts/29056201.pdf */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -73,6 +74,8 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + #include #include Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/usb_controller.c Wed Jan 30 15:26:04 2013 (r246122) @@ -24,6 +24,9 @@ * SUCH DAMAGE. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include "opt_ddb.h" #include @@ -62,6 +65,7 @@ #include #include #include "usb_if.h" +#endif /* USB_GLOBAL_INCLUDE_FILE */ /* function prototypes */ @@ -84,10 +88,12 @@ SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug "Debug level"); #endif +#if USB_HAVE_ROOT_MOUNT_HOLD static int usb_no_boot_wait = 0; TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RD|CTLFLAG_TUN, &usb_no_boot_wait, 0, "No USB device enumerate waiting at boot."); +#endif static int usb_no_suspend_wait = 0; TUNABLE_INT("hw.usb.no_suspend_wait", &usb_no_suspend_wait); @@ -144,6 +150,7 @@ usb_probe(device_t dev) return (0); } +#if USB_HAVE_ROOT_MOUNT_HOLD static void usb_root_mount_rel(struct usb_bus *bus) { @@ -153,6 +160,7 @@ usb_root_mount_rel(struct usb_bus *bus) bus->bus_roothold = NULL; } } +#endif /*------------------------------------------------------------------------* * usb_attach @@ -169,11 +177,12 @@ usb_attach(device_t dev) return (ENXIO); } +#if USB_HAVE_ROOT_MOUNT_HOLD if (usb_no_boot_wait == 0) { /* delay vfs_mountroot until the bus is explored */ bus->bus_roothold = root_mount_hold(device_get_nameunit(dev)); } - +#endif usb_attach_sub(dev, bus); return (0); /* return success */ @@ -196,8 +205,10 @@ usb_detach(device_t dev) /* Stop power watchdog */ usb_callout_drain(&bus->power_wdog); +#if USB_HAVE_ROOT_MOUNT_HOLD /* Let the USB explore process detach all devices. */ usb_root_mount_rel(bus); +#endif USB_BUS_LOCK(bus); @@ -363,7 +374,9 @@ usb_bus_explore(struct usb_proc_msg *pm) (udev->hub->explore) (udev); USB_BUS_LOCK(bus); } +#if USB_HAVE_ROOT_MOUNT_HOLD usb_root_mount_rel(bus); +#endif } /*------------------------------------------------------------------------* @@ -630,7 +643,9 @@ usb_bus_attach(struct usb_proc_msg *pm) default: device_printf(bus->bdev, "Unsupported USB revision\n"); +#if USB_HAVE_ROOT_MOUNT_HOLD usb_root_mount_rel(bus); +#endif return; } @@ -672,7 +687,9 @@ usb_bus_attach(struct usb_proc_msg *pm) if (err) { device_printf(bus->bdev, "Root HUB problem, error=%s\n", usbd_errstr(err)); +#if USB_HAVE_ROOT_MOUNT_HOLD usb_root_mount_rel(bus); +#endif } /* set softc - we are ready */ Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/uss820dci.c Wed Jan 30 15:26:04 2013 (r246122) @@ -32,6 +32,9 @@ * NOTE: The datasheet does not document everything. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -67,6 +70,8 @@ #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + #include #define USS820_DCI_BUS2SC(bus) \ Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/controller/xhci.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -38,9 +39,9 @@ * way we avoid too much diveration among USB drivers. */ -#include -__FBSDID("$FreeBSD$"); - +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -76,6 +77,8 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + #include #include Modified: head/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- head/sys/dev/usb/storage/ustorage_fs.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/storage/ustorage_fs.c Wed Jan 30 15:26:04 2013 (r246122) @@ -36,6 +36,9 @@ * Linux USB gadget stack. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -62,6 +65,7 @@ #define USB_DEBUG_VAR ustorage_fs_debug #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ #ifdef USB_DEBUG static int ustorage_fs_debug = 0; Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/template/usb_template.c Wed Jan 30 15:26:04 2013 (r246122) @@ -29,6 +29,9 @@ * USB templates. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -67,6 +70,7 @@ #include #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ MODULE_DEPEND(usb_template, usb, 1, 1, 1); MODULE_VERSION(usb_template, 1); Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/template/usb_template_audio.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,6 +1,4 @@ -#include -__FBSDID("$FreeBSD$"); - +/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -30,6 +28,9 @@ __FBSDID("$FreeBSD$"); * This file contains the USB template for an USB Audio Device. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ enum { INDEX_AUDIO_LANG, Modified: head/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- head/sys/dev/usb/template/usb_template_cdce.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/template/usb_template_cdce.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,6 +1,4 @@ -#include -__FBSDID("$FreeBSD$"); - +/* $FreeBSD$ */ /*- * Copyright (c) 2007 Hans Petter Selasky * All rights reserved. @@ -31,6 +29,9 @@ __FBSDID("$FreeBSD$"); * This file contains the USB templates for a CDC USB ethernet device. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -55,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ enum { STRING_LANG_INDEX, Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/template/usb_template_kbd.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,6 +1,4 @@ -#include -__FBSDID("$FreeBSD$"); - +/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -30,6 +28,9 @@ __FBSDID("$FreeBSD$"); * This file contains the USB template for an USB Keyboard Device. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ enum { INDEX_LANG, Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/template/usb_template_modem.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,6 +1,4 @@ -#include -__FBSDID("$FreeBSD$"); - +/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -30,6 +28,9 @@ __FBSDID("$FreeBSD$"); * This file contains the USB template for an USB Modem Device. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ enum { INDEX_LANG, Modified: head/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mouse.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/template/usb_template_mouse.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,6 +1,4 @@ -#include -__FBSDID("$FreeBSD$"); - +/* $FreeBSD$ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -30,6 +28,9 @@ __FBSDID("$FreeBSD$"); * This file contains the USB template for an USB Mouse Device. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ enum { INDEX_LANG, Modified: head/sys/dev/usb/template/usb_template_msc.c ============================================================================== --- head/sys/dev/usb/template/usb_template_msc.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/template/usb_template_msc.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,6 +1,4 @@ -#include -__FBSDID("$FreeBSD$"); - +/* $FreeBSD$ */ /*- * Copyright (c) 2008 Hans Petter Selasky * All rights reserved. @@ -31,6 +29,9 @@ __FBSDID("$FreeBSD$"); * This file contains the USB templates for an USB Mass Storage Device. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ enum { STRING_LANG_INDEX, Modified: head/sys/dev/usb/template/usb_template_mtp.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mtp.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/template/usb_template_mtp.c Wed Jan 30 15:26:04 2013 (r246122) @@ -1,6 +1,4 @@ -#include -__FBSDID("$FreeBSD$"); - +/* $FreeBSD$ */ /*- * Copyright (c) 2008 Hans Petter Selasky * All rights reserved. @@ -38,6 +36,9 @@ __FBSDID("$FreeBSD$"); * operating system the VID and PID of your device. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -60,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ #define MTP_BREQUEST 0x08 Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb.h Wed Jan 30 15:26:04 2013 (r246122) @@ -40,22 +40,28 @@ #define _USB_STANDARD_H_ #if defined(_KERNEL) +#ifndef USB_GLOBAL_INCLUDE_FILE #include "opt_usb.h" +#endif /* Declare parent SYSCTL USB node. */ #ifdef SYSCTL_DECL SYSCTL_DECL(_hw_usb); #endif +#ifndef USB_GLOBAL_INCLUDE_FILE #include +#endif MALLOC_DECLARE(M_USB); MALLOC_DECLARE(M_USBDEV); MALLOC_DECLARE(M_USBHC); #endif /* _KERNEL */ +#ifndef USB_GLOBAL_INCLUDE_FILE #include #include +#endif #define USB_STACK_VERSION 2000 /* 2.0 */ Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_busdma.c Wed Jan 30 15:26:04 2013 (r246122) @@ -24,6 +24,9 @@ * SUCH DAMAGE. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -59,6 +62,7 @@ #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ #if USB_HAVE_BUSDMA static void usb_dma_tag_create(struct usb_dma_tag *, usb_size_t, usb_size_t); Modified: head/sys/dev/usb/usb_busdma.h ============================================================================== --- head/sys/dev/usb/usb_busdma.h Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_busdma.h Wed Jan 30 15:26:04 2013 (r246122) @@ -27,10 +27,12 @@ #ifndef _USB_BUSDMA_H_ #define _USB_BUSDMA_H_ +#ifndef USB_GLOBAL_INCLUDE_FILE #include #include #include +#endif /* defines */ Modified: head/sys/dev/usb/usb_compat_linux.c ============================================================================== --- head/sys/dev/usb/usb_compat_linux.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_compat_linux.c Wed Jan 30 15:26:04 2013 (r246122) @@ -25,6 +25,9 @@ * SUCH DAMAGE. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -61,6 +64,7 @@ #include #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ struct usb_linux_softc { LIST_ENTRY(usb_linux_softc) sc_attached_list; Modified: head/sys/dev/usb/usb_core.c ============================================================================== --- head/sys/dev/usb/usb_core.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_core.c Wed Jan 30 15:26:04 2013 (r246122) @@ -30,6 +30,9 @@ * http://www.usb.org/developers/devclass_docs/ */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -51,6 +54,7 @@ #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ MALLOC_DEFINE(M_USB, "USB", "USB"); MALLOC_DEFINE(M_USBDEV, "USBdev", "USB device"); Modified: head/sys/dev/usb/usb_debug.c ============================================================================== --- head/sys/dev/usb/usb_debug.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_debug.c Wed Jan 30 15:26:04 2013 (r246122) @@ -24,6 +24,9 @@ * SUCH DAMAGE. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -55,6 +58,7 @@ #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ /* * Define this unconditionally in case a kernel module is loaded that Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_dev.c Wed Jan 30 15:26:04 2013 (r246122) @@ -27,6 +27,9 @@ * usb_dev.c - An abstraction layer for creating devices under /dev/... */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -75,6 +78,7 @@ #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ #if USB_HAVE_UGEN Modified: head/sys/dev/usb/usb_dev.h ============================================================================== --- head/sys/dev/usb/usb_dev.h Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_dev.h Wed Jan 30 15:26:04 2013 (r246122) @@ -27,11 +27,13 @@ #ifndef _USB_DEV_H_ #define _USB_DEV_H_ +#ifndef USB_GLOBAL_INCLUDE_FILE #include #include #include #include #include +#endif struct usb_fifo; struct usb_mbuf; Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_device.c Wed Jan 30 15:26:04 2013 (r246122) @@ -24,6 +24,9 @@ * SUCH DAMAGE. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -78,6 +81,7 @@ #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ /* function prototypes */ Modified: head/sys/dev/usb/usb_dynamic.c ============================================================================== --- head/sys/dev/usb/usb_dynamic.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_dynamic.c Wed Jan 30 15:26:04 2013 (r246122) @@ -24,6 +24,9 @@ * SUCH DAMAGE. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -50,6 +53,7 @@ #include #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ /* function prototypes */ static usb_handle_req_t usb_temp_get_desc_w; Modified: head/sys/dev/usb/usb_endian.h ============================================================================== --- head/sys/dev/usb/usb_endian.h Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_endian.h Wed Jan 30 15:26:04 2013 (r246122) @@ -27,8 +27,10 @@ #ifndef _USB_ENDIAN_H_ #define _USB_ENDIAN_H_ +#ifndef USB_GLOBAL_INCLUDE_FILE #include #include +#endif /* * Declare the basic USB record types. USB records have an alignment Modified: head/sys/dev/usb/usb_error.c ============================================================================== --- head/sys/dev/usb/usb_error.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_error.c Wed Jan 30 15:26:04 2013 (r246122) @@ -24,6 +24,9 @@ * SUCH DAMAGE. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -45,6 +48,7 @@ #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ static const char* usb_errstr_table[USB_ERR_MAX] = { [USB_ERR_NORMAL_COMPLETION] = "USB_ERR_NORMAL_COMPLETION", Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_freebsd.h Wed Jan 30 15:26:04 2013 (r246122) @@ -42,6 +42,7 @@ #define USB_HAVE_POWERD 1 #define USB_HAVE_MSCTEST 1 #define USB_HAVE_PF 1 +#define USB_HAVE_ROOT_MOUNT_HOLD 1 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid Added: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/usb_freebsd_loader.h Wed Jan 30 15:26:04 2013 (r246122) @@ -0,0 +1,83 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2013 Hans Petter Selasky. 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. + */ + +/* + * Including this file is mandatory for all USB related c-files in the loader. + */ + +#ifndef _USB_FREEBSD_LOADER_H_ +#define _USB_FREEBSD_LOADER_H_ + +/* Default USB configuration */ +#define USB_HAVE_UGEN 0 +#define USB_HAVE_DEVCTL 0 +#define USB_HAVE_BUSDMA 1 +#define USB_HAVE_COMPAT_LINUX 0 +#define USB_HAVE_USER_IO 0 +#define USB_HAVE_MBUF 0 +#define USB_HAVE_TT_SUPPORT 1 +#define USB_HAVE_POWERD 1 +#define USB_HAVE_MSCTEST 0 +#define USB_HAVE_PF 0 +#define USB_HAVE_ROOT_MOUNT_HOLD 0 + +#define USB_TD_GET_PROC(td) (td)->td_proc +#define USB_PROC_GET_GID(td) (td)->p_pgid + +#if (!defined(USB_HOST_ALIGN)) || (USB_HOST_ALIGN <= 0) +/* Use default value. */ +#undef USB_HOST_ALIGN +#define USB_HOST_ALIGN 8 /* bytes, must be power of two */ +#endif +/* Sanity check for USB_HOST_ALIGN: Verify power of two. */ +#if ((-USB_HOST_ALIGN) & USB_HOST_ALIGN) != USB_HOST_ALIGN +#error "USB_HOST_ALIGN is not power of two." +#endif +#define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ +#define USB_BUS_MAX 256 /* units */ +#define USB_MAX_DEVICES 128 /* units */ +#define USB_IFACE_MAX 32 /* units */ +#define USB_FIFO_MAX 128 /* units */ +#define USB_MAX_EP_STREAMS 8 /* units */ + +#define USB_MAX_FS_ISOC_FRAMES_PER_XFER (120) /* units */ +#define USB_MAX_HS_ISOC_FRAMES_PER_XFER (8*120) /* units */ + +#define USB_HUB_MAX_DEPTH 5 +#define USB_EP0_BUFSIZE 1024 /* bytes */ +#define USB_CS_RESET_LIMIT 20 /* failures = 20 * 50 ms = 1sec */ + +#define USB_MAX_AUTO_QUIRK 4 /* maximum number of dynamic quirks */ + +typedef uint32_t usb_timeout_t; /* milliseconds */ +typedef uint32_t usb_frlength_t; /* bytes */ +typedef uint32_t usb_frcount_t; /* units */ +typedef uint32_t usb_size_t; /* bytes */ +typedef uint32_t usb_ticks_t; /* system defined */ +typedef uint16_t usb_power_mask_t; /* see "USB_HW_POWER_XXX" */ +typedef uint16_t usb_stream_t; /* stream ID */ + +#endif /* _USB_FREEBSD_LOADER_H_ */ Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_generic.c Wed Jan 30 15:26:04 2013 (r246122) @@ -24,6 +24,9 @@ * SUCH DAMAGE. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -67,6 +70,7 @@ #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ #if USB_HAVE_UGEN Modified: head/sys/dev/usb/usb_handle_request.c ============================================================================== --- head/sys/dev/usb/usb_handle_request.c Wed Jan 30 15:21:18 2013 (r246121) +++ head/sys/dev/usb/usb_handle_request.c Wed Jan 30 15:26:04 2013 (r246122) @@ -24,6 +24,9 @@ * SUCH DAMAGE. */ +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else #include #include #include @@ -61,6 +64,7 @@ #include #include +#endif /* USB_GLOBAL_INCLUDE_FILE */ /* function prototypes */ Modified: head/sys/dev/usb/usb_hid.c ============================================================================== --- head/sys/dev/usb/usb_hid.c Wed Jan 30 15:21:18 2013 (r246121) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 15:46:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 659A8F88; Wed, 30 Jan 2013 15:46:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49C80202; Wed, 30 Jan 2013 15:46:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UFkUYw089223; Wed, 30 Jan 2013 15:46:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UFkROT089198; Wed, 30 Jan 2013 15:46:27 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301301546.r0UFkROT089198@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Jan 2013 15:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246123 - in head/sys/dev/usb: . controller template X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 15:46:30 -0000 Author: hselasky Date: Wed Jan 30 15:46:26 2013 New Revision: 246123 URL: http://svnweb.freebsd.org/changeset/base/246123 Log: Provide one global language string descriptor for american english instead of giving each module its own. Submitted by: Christoph Mallon Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_cdce.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_mouse.c head/sys/dev/usb/template/usb_template_msc.c head/sys/dev/usb/template/usb_template_mtp.c head/sys/dev/usb/usb.h head/sys/dev/usb/usb_core.c head/sys/dev/usb/usb_core.h Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/at91dci.c Wed Jan 30 15:46:26 2013 (r246123) @@ -1740,9 +1740,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'A', 0, 'T', 0, 'M', 0, 'E', 0, 'L', 0 @@ -1751,7 +1748,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, at91dci_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, at91dci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, at91dci_product); @@ -1953,8 +1949,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(at91dci_langtab); - ptr = (const void *)&at91dci_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/atmegadci.c Wed Jan 30 15:46:26 2013 (r246123) @@ -1565,9 +1565,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'A', 0, 'T', 0, 'M', 0, 'E', 0, 'G', 0, 'A', 0 @@ -1576,7 +1573,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, atmegadci_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, atmegadci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, atmegadci_product); @@ -1779,8 +1775,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(atmegadci_langtab); - ptr = (const void *)&atmegadci_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/avr32dci.c Wed Jan 30 15:46:26 2013 (r246123) @@ -1505,9 +1505,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'A', 0, 'V', 0, 'R', 0, '3', 0, '2', 0 @@ -1516,7 +1513,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, avr32dci_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, avr32dci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, avr32dci_product); @@ -1719,8 +1715,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(avr32dci_langtab); - ptr = (const void *)&avr32dci_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/dwc_otg.c Wed Jan 30 15:46:26 2013 (r246123) @@ -3491,9 +3491,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'D', 0, 'W', 0, 'C', 0, 'O', 0, 'T', 0, 'G', 0 @@ -3502,7 +3499,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, dwc_otg_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, dwc_otg_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, dwc_otg_product); @@ -3704,8 +3700,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(dwc_otg_langtab); - ptr = (const void *)&dwc_otg_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/musb_otg.c Wed Jan 30 15:46:26 2013 (r246123) @@ -2211,9 +2211,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'M', 0, 'e', 0, 'n', 0, 't', 0, 'o', 0, 'r', 0, ' ', 0, \ 'G', 0, 'r', 0, 'a', 0, 'p', 0, 'h', 0, 'i', 0, 'c', 0, 's', 0 @@ -2223,7 +2220,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, musbotg_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, musbotg_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, musbotg_product); @@ -2425,8 +2421,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(musbotg_langtab); - ptr = (const void *)&musbotg_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/uss820dci.c Wed Jan 30 15:46:26 2013 (r246123) @@ -1808,9 +1808,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'A', 0, 'G', 0, 'E', 0, 'R', 0, 'E', 0 @@ -1819,7 +1816,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, uss820dci_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, uss820dci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, uss820dci_product); @@ -2021,8 +2017,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(uss820dci_langtab); - ptr = (const void *)&uss820dci_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_audio.c Wed Jan 30 15:46:26 2013 (r246123) @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -66,9 +67,6 @@ enum { INDEX_AUDIO_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_AUDIO_PRODUCT \ 'A', 0, 'u', 0, 'd', 0, 'i', 0, 'o', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ @@ -89,7 +87,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_AUDIO_MIXER, string_audio_mixer); USB_MAKE_STRING_DESC(STRING_AUDIO_RECORD, string_audio_record); USB_MAKE_STRING_DESC(STRING_AUDIO_PLAYBACK, string_audio_playback); @@ -387,7 +384,7 @@ static const void * audio_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[INDEX_AUDIO_MAX] = { - [INDEX_AUDIO_LANG] = &string_lang, + [INDEX_AUDIO_LANG] = &usb_string_lang_en, [INDEX_AUDIO_MIXER] = &string_audio_mixer, [INDEX_AUDIO_RECORD] = &string_audio_record, [INDEX_AUDIO_PLAYBACK] = &string_audio_playback, @@ -395,7 +392,7 @@ audio_get_string_desc(uint16_t lang_id, }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- head/sys/dev/usb/template/usb_template_cdce.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_cdce.c Wed Jan 30 15:46:26 2013 (r246123) @@ -53,6 +53,7 @@ #include #include +#include #include #include @@ -70,9 +71,6 @@ enum { STRING_ETH_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_MAC \ '2', 0, 'A', 0, '2', 0, '3', 0, \ '4', 0, '5', 0, '6', 0, '7', 0, \ @@ -124,7 +122,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_MAC, string_mac); USB_MAKE_STRING_DESC(STRING_ETH_CONTROL, string_eth_control); USB_MAKE_STRING_DESC(STRING_ETH_DATA, string_eth_data); @@ -288,7 +285,7 @@ static const void * eth_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[STRING_ETH_MAX] = { - [STRING_LANG_INDEX] = &string_lang, + [STRING_LANG_INDEX] = &usb_string_lang_en, [STRING_MAC_INDEX] = &string_mac, [STRING_ETH_CONTROL_INDEX] = &string_eth_control, [STRING_ETH_DATA_INDEX] = &string_eth_data, @@ -299,7 +296,7 @@ eth_get_string_desc(uint16_t lang_id, ui }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_kbd.c Wed Jan 30 15:46:26 2013 (r246123) @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -64,9 +65,6 @@ enum { INDEX_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_PRODUCT \ 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ @@ -78,7 +76,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_KEYBOARD, string_keyboard); USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); @@ -208,13 +205,13 @@ static const void * keyboard_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[INDEX_MAX] = { - [INDEX_LANG] = &string_lang, + [INDEX_LANG] = &usb_string_lang_en, [INDEX_KEYBOARD] = &string_keyboard, [INDEX_PRODUCT] = &string_product, }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_modem.c Wed Jan 30 15:46:26 2013 (r246123) @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -64,9 +65,6 @@ enum { INDEX_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_PRODUCT \ 'M', 0, 'o', 0, 'd', 0, 'e', 0, 'm', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ @@ -78,7 +76,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_MODEM, string_modem); USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); @@ -236,13 +233,13 @@ static const void * modem_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[INDEX_MAX] = { - [INDEX_LANG] = &string_lang, + [INDEX_LANG] = &usb_string_lang_en, [INDEX_MODEM] = &string_modem, [INDEX_PRODUCT] = &string_product, }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mouse.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_mouse.c Wed Jan 30 15:46:26 2013 (r246123) @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -64,9 +65,6 @@ enum { INDEX_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_PRODUCT \ 'M', 0, 'o', 0, 'u', 0, 's', 0, 'e', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ @@ -78,7 +76,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_MOUSE, string_mouse); USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); @@ -206,13 +203,13 @@ static const void * mouse_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[INDEX_MAX] = { - [INDEX_LANG] = &string_lang, + [INDEX_LANG] = &usb_string_lang_en, [INDEX_MOUSE] = &string_mouse, [INDEX_PRODUCT] = &string_product, }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_msc.c ============================================================================== --- head/sys/dev/usb/template/usb_template_msc.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_msc.c Wed Jan 30 15:46:26 2013 (r246123) @@ -53,6 +53,7 @@ #include #include +#include #include #endif /* USB_GLOBAL_INCLUDE_FILE */ @@ -67,9 +68,6 @@ enum { STRING_MSC_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_MSC_DATA \ 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ 'M', 0, 'a', 0, 's', 0, 's', 0, \ @@ -105,7 +103,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_MSC_DATA, string_msc_data); USB_MAKE_STRING_DESC(STRING_MSC_CONFIG, string_msc_config); USB_MAKE_STRING_DESC(STRING_MSC_VENDOR, string_msc_vendor); @@ -197,7 +194,7 @@ static const void * msc_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[STRING_MSC_MAX] = { - [STRING_LANG_INDEX] = &string_lang, + [STRING_LANG_INDEX] = &usb_string_lang_en, [STRING_MSC_DATA_INDEX] = &string_msc_data, [STRING_MSC_CONFIG_INDEX] = &string_msc_config, [STRING_MSC_VENDOR_INDEX] = &string_msc_vendor, @@ -206,7 +203,7 @@ msc_get_string_desc(uint16_t lang_id, ui }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_mtp.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mtp.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_mtp.c Wed Jan 30 15:46:26 2013 (r246123) @@ -60,6 +60,8 @@ #include #include +#include + #include #endif /* USB_GLOBAL_INCLUDE_FILE */ @@ -75,9 +77,6 @@ enum { STRING_MTP_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_MTP_DATA \ 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ 'M', 0, 'T', 0, 'P', 0, \ @@ -109,7 +108,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_MTP_DATA, string_mtp_data); USB_MAKE_STRING_DESC(STRING_MTP_CONFIG, string_mtp_config); USB_MAKE_STRING_DESC(STRING_MTP_VENDOR, string_mtp_vendor); @@ -246,7 +244,7 @@ static const void * mtp_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[STRING_MTP_MAX] = { - [STRING_LANG_INDEX] = &string_lang, + [STRING_LANG_INDEX] = &usb_string_lang_en, [STRING_MTP_DATA_INDEX] = &string_mtp_data, [STRING_MTP_CONFIG_INDEX] = &string_mtp_config, [STRING_MTP_VENDOR_INDEX] = &string_mtp_vendor, @@ -268,7 +266,7 @@ mtp_get_string_desc(uint16_t lang_id, ui return (dummy_desc); } if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/usb.h Wed Jan 30 15:46:26 2013 (r246123) @@ -577,6 +577,13 @@ static const struct name name = { \ .bData = { m }, \ } +struct usb_string_lang { + uByte bLength; + uByte bDescriptorType; + uByte bData[2]; +} __packed; +typedef struct usb_string_lang usb_string_lang_t; + struct usb_hub_descriptor { uByte bDescLength; uByte bDescriptorType; Modified: head/sys/dev/usb/usb_core.c ============================================================================== --- head/sys/dev/usb/usb_core.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/usb_core.c Wed Jan 30 15:46:26 2013 (r246123) @@ -56,6 +56,11 @@ #include #endif /* USB_GLOBAL_INCLUDE_FILE */ +const struct usb_string_lang usb_string_lang_en = { + sizeof(usb_string_lang_en), UDESC_STRING, + { 0x09, 0x04 } /* American English */ +}; + MALLOC_DEFINE(M_USB, "USB", "USB"); MALLOC_DEFINE(M_USBDEV, "USBdev", "USB device"); MALLOC_DEFINE(M_USBHC, "USBHC", "USB host controller"); Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/usb_core.h Wed Jan 30 15:46:26 2013 (r246123) @@ -69,6 +69,7 @@ struct usb_page; struct usb_page_cache; struct usb_xfer; struct usb_xfer_root; +struct usb_string_lang; /* typedefs */ @@ -174,6 +175,7 @@ struct usb_xfer { /* external variables */ extern struct mtx usb_ref_lock; +extern const struct usb_string_lang usb_string_lang_en; /* typedefs */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 15:49:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A66CE421; Wed, 30 Jan 2013 15:49:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9476B257; Wed, 30 Jan 2013 15:49:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UFncgp089671; Wed, 30 Jan 2013 15:49:38 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UFnctm089670; Wed, 30 Jan 2013 15:49:38 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301301549.r0UFnctm089670@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Jan 2013 15:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246124 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 15:49:38 -0000 Author: hselasky Date: Wed Jan 30 15:49:37 2013 New Revision: 246124 URL: http://svnweb.freebsd.org/changeset/base/246124 Log: Use an anonymous struct for generated string descriptors. Submitted by: Christoph Mallon Modified: head/sys/dev/usb/usb.h Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Wed Jan 30 15:46:26 2013 (r246123) +++ head/sys/dev/usb/usb.h Wed Jan 30 15:49:37 2013 (r246124) @@ -566,13 +566,12 @@ struct usb_string_descriptor { typedef struct usb_string_descriptor usb_string_descriptor_t; #define USB_MAKE_STRING_DESC(m,name) \ -struct name { \ +static const struct { \ uByte bLength; \ uByte bDescriptorType; \ uByte bData[sizeof((uint8_t []){m})]; \ -} __packed; \ -static const struct name name = { \ - .bLength = sizeof(struct name), \ +} __packed name = { \ + .bLength = sizeof(name), \ .bDescriptorType = UDESC_STRING, \ .bData = { m }, \ } From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 16:05:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1C0539E0; Wed, 30 Jan 2013 16:05:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E89BD33C; Wed, 30 Jan 2013 16:05:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UG5vNM095386; Wed, 30 Jan 2013 16:05:57 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UG5tGY095372; Wed, 30 Jan 2013 16:05:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301301605.r0UG5tGY095372@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Jan 2013 16:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246125 - in head/sys/dev/usb: controller template X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 16:05:58 -0000 Author: hselasky Date: Wed Jan 30 16:05:54 2013 New Revision: 246125 URL: http://svnweb.freebsd.org/changeset/base/246125 Log: Use string literals in string descriptors for marginally better readability. Submitted by: Christoph Mallon Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_cdce.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_mouse.c head/sys/dev/usb/template/usb_template_msc.c head/sys/dev/usb/template/usb_template_mtp.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/controller/at91dci.c Wed Jan 30 16:05:54 2013 (r246125) @@ -1741,12 +1741,10 @@ static const struct usb_hub_descriptor_m }; #define STRING_VENDOR \ - 'A', 0, 'T', 0, 'M', 0, 'E', 0, 'L', 0 + "A\0T\0M\0E\0L" #define STRING_PRODUCT \ - 'D', 0, 'C', 0, 'I', 0, ' ', 0, 'R', 0, \ - 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ - 'U', 0, 'B', 0, + "D\0C\0I\0 \0R\0o\0o\0t\0 \0H\0U\0B" USB_MAKE_STRING_DESC(STRING_VENDOR, at91dci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, at91dci_product); Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/controller/atmegadci.c Wed Jan 30 16:05:54 2013 (r246125) @@ -1566,12 +1566,10 @@ static const struct usb_hub_descriptor_m }; #define STRING_VENDOR \ - 'A', 0, 'T', 0, 'M', 0, 'E', 0, 'G', 0, 'A', 0 + "A\0T\0M\0E\0G\0A" #define STRING_PRODUCT \ - 'D', 0, 'C', 0, 'I', 0, ' ', 0, 'R', 0, \ - 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ - 'U', 0, 'B', 0, + "D\0C\0I\0 \0R\0o\0o\0t\0 \0H\0U\0B" USB_MAKE_STRING_DESC(STRING_VENDOR, atmegadci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, atmegadci_product); Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/controller/avr32dci.c Wed Jan 30 16:05:54 2013 (r246125) @@ -1506,12 +1506,10 @@ static const struct usb_hub_descriptor_m }; #define STRING_VENDOR \ - 'A', 0, 'V', 0, 'R', 0, '3', 0, '2', 0 + "A\0V\0R\0003\0002" #define STRING_PRODUCT \ - 'D', 0, 'C', 0, 'I', 0, ' ', 0, 'R', 0, \ - 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ - 'U', 0, 'B', 0, + "D\0C\0I\0 \0R\0o\0o\0t\0 \0H\0U\0B" USB_MAKE_STRING_DESC(STRING_VENDOR, avr32dci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, avr32dci_product); Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/controller/dwc_otg.c Wed Jan 30 16:05:54 2013 (r246125) @@ -3492,12 +3492,10 @@ static const struct usb_hub_descriptor_m }; #define STRING_VENDOR \ - 'D', 0, 'W', 0, 'C', 0, 'O', 0, 'T', 0, 'G', 0 + "D\0W\0C\0O\0T\0G" #define STRING_PRODUCT \ - 'O', 0, 'T', 0, 'G', 0, ' ', 0, 'R', 0, \ - 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ - 'U', 0, 'B', 0, + "O\0T\0G\0 \0R\0o\0o\0t\0 \0H\0U\0B" USB_MAKE_STRING_DESC(STRING_VENDOR, dwc_otg_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, dwc_otg_product); Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/controller/musb_otg.c Wed Jan 30 16:05:54 2013 (r246125) @@ -2212,13 +2212,10 @@ static const struct usb_hub_descriptor_m }; #define STRING_VENDOR \ - 'M', 0, 'e', 0, 'n', 0, 't', 0, 'o', 0, 'r', 0, ' ', 0, \ - 'G', 0, 'r', 0, 'a', 0, 'p', 0, 'h', 0, 'i', 0, 'c', 0, 's', 0 + "M\0e\0n\0t\0o\0r\0 \0G\0r\0a\0p\0h\0i\0c\0s" #define STRING_PRODUCT \ - 'O', 0, 'T', 0, 'G', 0, ' ', 0, 'R', 0, \ - 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ - 'U', 0, 'B', 0, + "O\0T\0G\0 \0R\0o\0o\0t\0 \0H\0U\0B" USB_MAKE_STRING_DESC(STRING_VENDOR, musbotg_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, musbotg_product); Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/controller/uss820dci.c Wed Jan 30 16:05:54 2013 (r246125) @@ -1809,12 +1809,10 @@ static const struct usb_hub_descriptor_m }; #define STRING_VENDOR \ - 'A', 0, 'G', 0, 'E', 0, 'R', 0, 'E', 0 + "A\0G\0E\0R\0E" #define STRING_PRODUCT \ - 'D', 0, 'C', 0, 'I', 0, ' ', 0, 'R', 0, \ - 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ - 'U', 0, 'B', 0, + "D\0C\0I\0 \0R\0o\0o\0t\0 \0H\0U\0B" USB_MAKE_STRING_DESC(STRING_VENDOR, uss820dci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, uss820dci_product); Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/template/usb_template_audio.c Wed Jan 30 16:05:54 2013 (r246125) @@ -68,21 +68,16 @@ enum { }; #define STRING_AUDIO_PRODUCT \ - 'A', 0, 'u', 0, 'd', 0, 'i', 0, 'o', 0, ' ', 0, \ - 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ - 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, + "A\0u\0d\0i\0o\0 \0T\0e\0s\0t\0 \0D\0e\0v\0i\0c\0e" #define STRING_AUDIO_MIXER \ - 'M', 0, 'i', 0, 'x', 0, 'e', 0, 'r', 0, ' ', 0, \ - 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + "M\0i\0x\0e\0r\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" #define STRING_AUDIO_RECORD \ - 'R', 0, 'e', 0, 'c', 0, 'o', 0, 'r', 0, 'd', 0, ' ', 0, \ - 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + "R\0e\0c\0o\0r\0d\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" #define STRING_AUDIO_PLAYBACK \ - 'P', 0, 'l', 0, 'a', 0, 'y', 0, 'b', 0, 'a', 0, 'c', 0, 'k', 0, ' ', 0, \ - 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + "P\0l\0a\0y\0b\0a\0c\0k\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" /* make the real string descriptors */ Modified: head/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- head/sys/dev/usb/template/usb_template_cdce.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/template/usb_template_cdce.c Wed Jan 30 16:05:54 2013 (r246125) @@ -72,53 +72,27 @@ enum { }; #define STRING_MAC \ - '2', 0, 'A', 0, '2', 0, '3', 0, \ - '4', 0, '5', 0, '6', 0, '7', 0, \ - '8', 0, '9', 0, 'A', 0, 'B', 0, + "2\0A\0002\0003\0004\0005\0006\0007\08\09\0A\0B" #define STRING_ETH_CONTROL \ - 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ - 'E', 0, 't', 0, 'h', 0, 'e', 0, \ - 'r', 0, 'n', 0, 'e', 0, 't', 0, \ - ' ', 0, 'C', 0, 'o', 0, 'm', 0, \ - 'm', 0, ' ', 0, 'i', 0, 'n', 0, \ - 't', 0, 'e', 0, 'r', 0, 'f', 0, \ - 'a', 0, 'c', 0, 'e', 0, + "U\0S\0B\0 \0E\0t\0h\0e\0r\0n\0e\0t\0 " \ + "\0C\0o\0m\0m\0 \0I\0n\0t\0e\0r\0f\0a\0c\0e" #define STRING_ETH_DATA \ - 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ - 'E', 0, 't', 0, 'h', 0, 'e', 0, \ - 'r', 0, 'n', 0, 'e', 0, 't', 0, \ - ' ', 0, 'D', 0, 'a', 0, 't', 0, \ - 'a', 0, ' ', 0, 'i', 0, 'n', 0, \ - 't', 0, 'e', 0, 'r', 0, 'f', 0, \ - 'a', 0, 'c', 0, 'e', 0, + "U\0S\0B\0 \0E\0t\0h\0e\0r\0n\0e\0t\0 \0D\0a\0t\0a\0 " \ + "\0I\0n\0t\0e\0r\0f\0a\0c\0e" #define STRING_ETH_CONFIG \ - 'D', 0, 'e', 0, 'f', 0, 'a', 0, \ - 'u', 0, 'l', 0, 't', 0, ' ', 0, \ - 'c', 0, 'o', 0, 'n', 0, 'f', 0, \ - 'i', 0, 'g', 0, + "D\0e\0f\0a\0u\0l\0t\0 \0c\0o\0n\0f\0i\0g" #define STRING_ETH_VENDOR \ - 'F', 0, 'r', 0, 'e', 0, 'e', 0, \ - 'B', 0, 'S', 0, 'D', 0, ' ', 0, \ - 'f', 0, 'o', 0, 'u', 0, 'n', 0, \ - 'd', 0, 'a', 0, 't', 0, 'i', 0, \ - 'o', 0, 'n', 0, + "F\0r\0e\0e\0B\0S\0D\0 \0f\0o\0u\0n\0d\0a\0t\0i\0o\0n" #define STRING_ETH_PRODUCT \ - 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ - 'E', 0, 't', 0, 'h', 0, 'e', 0, \ - 'r', 0, 'n', 0, 'e', 0, 't', 0, \ - ' ', 0, 'A', 0, 'd', 0, 'a', 0, \ - 'p', 0, 't', 0, 'e', 0, 'r', 0, + "U\0S\0B\0 \0E\0t\0h\0e\0r\0n\0e\0t\0 \0A\0d\0a\0p\0t\0e\0r" #define STRING_ETH_SERIAL \ - 'D', 0, 'e', 0, 'c', 0, 'e', 0, \ - 'm', 0, 'b', 0, 'e', 0, 'r', 0, \ - ' ', 0, '2', 0, '0', 0, '0', 0, \ - '7', 0, + "D\0e\0c\0e\0m\0b\0e\0r\0 \0002\0000\0000\0007" /* make the real string descriptors */ Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/template/usb_template_kbd.c Wed Jan 30 16:05:54 2013 (r246125) @@ -66,13 +66,10 @@ enum { }; #define STRING_PRODUCT \ - 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, \ - 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ - 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, + "K\0e\0y\0b\0o\0a\0r\0d\0 \0T\0e\0s\0t\0 \0D\0e\0v\0i\0c\0e" #define STRING_KEYBOARD \ - 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, \ - 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + "K\0e\0y\0b\0o\0a\0r\0d\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" /* make the real string descriptors */ Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/template/usb_template_modem.c Wed Jan 30 16:05:54 2013 (r246125) @@ -66,13 +66,10 @@ enum { }; #define STRING_PRODUCT \ - 'M', 0, 'o', 0, 'd', 0, 'e', 0, 'm', 0, ' ', 0, \ - 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ - 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, + "M\0o\0d\0e\0m\0 \0T\0e\0s\0t\0 \0D\0e\0v\0i\0c\0e" #define STRING_MODEM \ - 'M', 0, 'o', 0, 'd', 0, 'e', 0, 'm', 0, ' ', 0, \ - 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + "M\0o\0d\0e\0m\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" /* make the real string descriptors */ Modified: head/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mouse.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/template/usb_template_mouse.c Wed Jan 30 16:05:54 2013 (r246125) @@ -66,13 +66,10 @@ enum { }; #define STRING_PRODUCT \ - 'M', 0, 'o', 0, 'u', 0, 's', 0, 'e', 0, ' ', 0, \ - 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ - 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, + "M\0o\0u\0s\0e\0 \0T\0e\0s\0t\0 \0D\0e\0v\0i\0c\0e" #define STRING_MOUSE \ - 'M', 0, 'o', 0, 'u', 0, 's', 0, 'e', 0, ' ', 0, \ - 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + "M\0o\0u\0s\0e\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" /* make the real string descriptors */ Modified: head/sys/dev/usb/template/usb_template_msc.c ============================================================================== --- head/sys/dev/usb/template/usb_template_msc.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/template/usb_template_msc.c Wed Jan 30 16:05:54 2013 (r246125) @@ -69,37 +69,20 @@ enum { }; #define STRING_MSC_DATA \ - 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ - 'M', 0, 'a', 0, 's', 0, 's', 0, \ - ' ', 0, 'S', 0, 't', 0, 'o', 0, \ - 'r', 0, 'a', 0, 'g', 0, 'e', 0, \ - ' ', 0, 'I', 0, 'n', 0, 't', 0, \ - 'e', 0, 'r', 0, 'f', 0, 'a', 0, \ - 'c', 0, 'e', 0, + "U\0S\0B\0 \0M\0a\0s\0s\0 \0S\0t\0o\0r\0a\0g\0e\0 " \ + "\0I\0n\0t\0e\0r\0f\0a\0c\0e" #define STRING_MSC_CONFIG \ - 'D', 0, 'e', 0, 'f', 0, 'a', 0, \ - 'u', 0, 'l', 0, 't', 0, ' ', 0, \ - 'c', 0, 'o', 0, 'n', 0, 'f', 0, \ - 'i', 0, 'g', 0, + "D\0e\0f\0a\0u\0l\0t\0 \0c\0o\0n\0f\0i\0g" #define STRING_MSC_VENDOR \ - 'F', 0, 'r', 0, 'e', 0, 'e', 0, \ - 'B', 0, 'S', 0, 'D', 0, ' ', 0, \ - 'f', 0, 'o', 0, 'u', 0, 'n', 0, \ - 'd', 0, 'a', 0, 't', 0, 'i', 0, \ - 'o', 0, 'n', 0, + "F\0r\0e\0e\0B\0S\0D\0 \0f\0o\0u\0n\0d\0a\0t\0i\0o\0n" #define STRING_MSC_PRODUCT \ - 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ - 'M', 0, 'e', 0, 'm', 0, 'o', 0, \ - 'r', 0, 'y', 0, ' ', 0, 'S', 0, \ - 't', 0, 'i', 0, 'c', 0, 'k', 0 + "U\0S\0B\0 \0M\0e\0m\0o\0r\0y\0 \0S\0t\0i\0c\0k" #define STRING_MSC_SERIAL \ - 'M', 0, 'a', 0, 'r', 0, 'c', 0, \ - 'h', 0, ' ', 0, '2', 0, '0', 0, \ - '0', 0, '8', 0, + "M\0a\0r\0c\0h\0 \0002\0000\0000\08" /* make the real string descriptors */ Modified: head/sys/dev/usb/template/usb_template_mtp.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mtp.c Wed Jan 30 15:49:37 2013 (r246124) +++ head/sys/dev/usb/template/usb_template_mtp.c Wed Jan 30 16:05:54 2013 (r246125) @@ -78,33 +78,19 @@ enum { }; #define STRING_MTP_DATA \ - 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ - 'M', 0, 'T', 0, 'P', 0, \ - ' ', 0, 'I', 0, 'n', 0, 't', 0, \ - 'e', 0, 'r', 0, 'f', 0, 'a', 0, \ - 'c', 0, 'e', 0, + "U\0S\0B\0 \0M\0T\0P\0 \0I\0n\0t\0e\0r\0f\0a\0c\0e" #define STRING_MTP_CONFIG \ - 'D', 0, 'e', 0, 'f', 0, 'a', 0, \ - 'u', 0, 'l', 0, 't', 0, ' ', 0, \ - 'c', 0, 'o', 0, 'n', 0, 'f', 0, \ - 'i', 0, 'g', 0, + "D\0e\0f\0a\0u\0l\0t\0 \0c\0o\0n\0f\0i\0g" #define STRING_MTP_VENDOR \ - 'F', 0, 'r', 0, 'e', 0, 'e', 0, \ - 'B', 0, 'S', 0, 'D', 0, ' ', 0, \ - 'f', 0, 'o', 0, 'u', 0, 'n', 0, \ - 'd', 0, 'a', 0, 't', 0, 'i', 0, \ - 'o', 0, 'n', 0, + "F\0r\0e\0e\0B\0S\0D\0 \0f\0o\0u\0n\0d\0a\0t\0i\0o\0n" #define STRING_MTP_PRODUCT \ - 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ - 'M', 0, 'T', 0, 'P', 0, + "U\0S\0B\0 \0M\0T\0P" #define STRING_MTP_SERIAL \ - 'J', 0, 'u', 0, 'n', 0, 'e', 0, \ - ' ', 0, '2', 0, '0', 0, '0', 0, \ - '8', 0, + "J\0u\0n\0e\0 \0002\0000\0000\08" /* make the real string descriptors */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 16:08:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B4B14C50; Wed, 30 Jan 2013 16:08:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90459356; Wed, 30 Jan 2013 16:08:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UG86xS095856; Wed, 30 Jan 2013 16:08:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UG86G6095855; Wed, 30 Jan 2013 16:08:06 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301301608.r0UG86G6095855@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Jan 2013 16:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246126 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 16:08:06 -0000 Author: hselasky Date: Wed Jan 30 16:08:05 2013 New Revision: 246126 URL: http://svnweb.freebsd.org/changeset/base/246126 Log: Do not unnecessarily split a string literal, because splitting it makes it hard to grep. Submitted by: Christoph Mallon Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Wed Jan 30 16:05:54 2013 (r246125) +++ head/sys/dev/usb/controller/xhci.c Wed Jan 30 16:08:05 2013 (r246126) @@ -890,8 +890,8 @@ xhci_check_transfer(struct xhci_softc *s */ if (td->remainder > 0) { if (td->alt_next == NULL) { - DPRINTF("short TD has no " - "alternate next\n"); + DPRINTF( + "short TD has no alternate next\n"); xhci_generic_done(xfer); break; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 16:30:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4598EDE1; Wed, 30 Jan 2013 16:30:39 +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 2272F715; Wed, 30 Jan 2013 16:30:39 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 78BCBB911; Wed, 30 Jan 2013 11:30:37 -0500 (EST) From: John Baldwin To: Pietro Cerutti Subject: Re: svn commit: r246120 - in head: include lib/libc/stdio tools/regression/lib/libc/stdio Date: Wed, 30 Jan 2013 10:08:51 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301301459.r0UExQKw074249@svn.freebsd.org> In-Reply-To: <201301301459.r0UExQKw074249@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201301301008.51324.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 30 Jan 2013 11:30:37 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 16:30:39 -0000 On Wednesday, January 30, 2013 9:59:26 am Pietro Cerutti wrote: > Author: gahr (ports committer) > Date: Wed Jan 30 14:59:26 2013 > New Revision: 246120 > URL: http://svnweb.freebsd.org/changeset/base/246120 > > Log: > Add fmemopen(3), an interface to get a FILE * from a buffer in memory, along > with the respective regression test. > See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html > > Reviewed by: cognet > Approved by: cognet Oh, cool! I have an implementation of open_memstream() based on funopen() that I can import them. I was waiting to implement this so they could be added together (since Linux treats them as a pair). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 17:39:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 35AD98AC; Wed, 30 Jan 2013 17:39:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27369ACE; Wed, 30 Jan 2013 17:39:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UHdiAL024604; Wed, 30 Jan 2013 17:39:44 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UHdiZK024603; Wed, 30 Jan 2013 17:39:44 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301301739.r0UHdiZK024603@svn.freebsd.org> From: Brooks Davis Date: Wed, 30 Jan 2013 17:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246127 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 17:39:44 -0000 Author: brooks Date: Wed Jan 30 17:39:43 2013 New Revision: 246127 URL: http://svnweb.freebsd.org/changeset/base/246127 Log: When adding the directory ownership to the METALOG do it by name rather than number as is done in install so as to differ binding of names to ids. Remove the -W flag from the mtree command so that the correct user and group is recorded rather than the default. Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Jan 30 16:08:05 2013 (r246126) +++ head/etc/Makefile Wed Jan 30 17:39:43 2013 (r246127) @@ -348,9 +348,10 @@ distrib-dirs: test "$$d" == "/" && d=""; \ d=${DISTBASE}$$d; \ shift; \ - ${ECHO} "${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# |" \ - "${METALOG.add}" ; \ - ${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# | ${METALOG.add} ; \ + ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \ + "sed s#^\.#.$$d# | ${METALOG.add}" ; \ + ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \ + ${METALOG.add} ; \ done; true .endif ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 18:01:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 07648F16; Wed, 30 Jan 2013 18:01:38 +0000 (UTC) (envelope-from sbz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DC2F2BFD; Wed, 30 Jan 2013 18:01:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UI1bip032454; Wed, 30 Jan 2013 18:01:37 GMT (envelope-from sbz@svn.freebsd.org) Received: (from sbz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UI1KBB032328; Wed, 30 Jan 2013 18:01:20 GMT (envelope-from sbz@svn.freebsd.org) Message-Id: <201301301801.r0UI1KBB032328@svn.freebsd.org> From: Sofian Brabez Date: Wed, 30 Jan 2013 18:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246128 - in head/sys/dev: acpi_support acpica adlink amdsbwd amdtemp auxio ce cfi coretemp cp cpufreq ctau cx digi e1000 ep fdc iicbus ixgb ixgbe mfi mn mxge my nvram2env nxge oce sdhc... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 18:01:38 -0000 Author: sbz (ports committer) Date: Wed Jan 30 18:01:20 2013 New Revision: 246128 URL: http://svnweb.freebsd.org/changeset/base/246128 Log: Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays Reviewed by: cognet Approved by: cognet Modified: head/sys/dev/acpi_support/acpi_asus_wmi.c head/sys/dev/acpi_support/acpi_fujitsu.c (contents, props changed) head/sys/dev/acpi_support/acpi_hp.c head/sys/dev/acpi_support/acpi_ibm.c (contents, props changed) head/sys/dev/acpi_support/acpi_panasonic.c (contents, props changed) head/sys/dev/acpi_support/acpi_sony.c (contents, props changed) head/sys/dev/acpi_support/acpi_toshiba.c (contents, props changed) head/sys/dev/acpica/acpi.c (contents, props changed) head/sys/dev/acpica/acpi_acad.c (contents, props changed) head/sys/dev/acpica/acpi_button.c (contents, props changed) head/sys/dev/acpica/acpi_cmbat.c (contents, props changed) head/sys/dev/acpica/acpi_dock.c (contents, props changed) head/sys/dev/acpica/acpi_ec.c (contents, props changed) head/sys/dev/acpica/acpi_hpet.c (contents, props changed) head/sys/dev/acpica/acpi_lid.c (contents, props changed) head/sys/dev/acpica/acpi_pci.c (contents, props changed) head/sys/dev/acpica/acpi_pci_link.c (contents, props changed) head/sys/dev/acpica/acpi_pcib_pci.c (contents, props changed) head/sys/dev/acpica/acpi_perf.c (contents, props changed) head/sys/dev/acpica/acpi_resource.c (contents, props changed) head/sys/dev/acpica/acpi_smbat.c (contents, props changed) head/sys/dev/acpica/acpi_thermal.c (contents, props changed) head/sys/dev/acpica/acpi_throttle.c (contents, props changed) head/sys/dev/acpica/acpi_timer.c (contents, props changed) head/sys/dev/adlink/adlink.c (contents, props changed) head/sys/dev/amdsbwd/amdsbwd.c head/sys/dev/amdtemp/amdtemp.c (contents, props changed) head/sys/dev/auxio/auxio.c (contents, props changed) head/sys/dev/ce/if_ce.c (contents, props changed) head/sys/dev/cfi/cfi_bus_fdt.c head/sys/dev/cfi/cfi_bus_ixp4xx.c head/sys/dev/coretemp/coretemp.c (contents, props changed) head/sys/dev/cp/if_cp.c (contents, props changed) head/sys/dev/cpufreq/ichss.c (contents, props changed) head/sys/dev/ctau/if_ct.c (contents, props changed) head/sys/dev/cx/if_cx.c (contents, props changed) head/sys/dev/digi/digi_isa.c (contents, props changed) head/sys/dev/digi/digi_pci.c (contents, props changed) head/sys/dev/e1000/if_em.c (contents, props changed) head/sys/dev/e1000/if_igb.c (contents, props changed) head/sys/dev/e1000/if_lem.c head/sys/dev/ep/if_ep_eisa.c (contents, props changed) head/sys/dev/ep/if_ep_isa.c (contents, props changed) head/sys/dev/ep/if_ep_mca.c (contents, props changed) head/sys/dev/ep/if_ep_pccard.c (contents, props changed) head/sys/dev/fdc/fdc_acpi.c (contents, props changed) head/sys/dev/iicbus/ad7418.c (contents, props changed) head/sys/dev/iicbus/ds133x.c (contents, props changed) head/sys/dev/iicbus/ds1672.c (contents, props changed) head/sys/dev/iicbus/icee.c (contents, props changed) head/sys/dev/ixgb/if_ixgb.c (contents, props changed) head/sys/dev/ixgbe/ixgbe.c (contents, props changed) head/sys/dev/ixgbe/ixv.c head/sys/dev/mfi/mfi_cam.c (contents, props changed) head/sys/dev/mn/if_mn.c (contents, props changed) head/sys/dev/mxge/if_mxge.c (contents, props changed) head/sys/dev/my/if_my.c (contents, props changed) head/sys/dev/nvram2env/nvram2env.c (contents, props changed) head/sys/dev/nxge/if_nxge.c (contents, props changed) head/sys/dev/oce/oce_if.c (contents, props changed) head/sys/dev/sdhci/sdhci_pci.c head/sys/dev/sound/pci/emu10kx-midi.c (contents, props changed) head/sys/dev/sound/pci/emu10kx-pcm.c (contents, props changed) head/sys/dev/sound/pci/emu10kx.c (contents, props changed) head/sys/dev/sound/sbus/cs4231.c (contents, props changed) head/sys/dev/sound/usb/uaudio_pcm.c head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/input/uhid.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/input/ums.c head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/misc/ufm.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_ipheth.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_smsc.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/storage/urio.c head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/usb_compat_linux.c head/sys/dev/vx/if_vx_eisa.c (contents, props changed) head/sys/dev/vx/if_vx_pci.c (contents, props changed) head/sys/dev/vxge/vxge.c (contents, props changed) head/sys/dev/xen/console/console.c Modified: head/sys/dev/acpi_support/acpi_asus_wmi.c ============================================================================== --- head/sys/dev/acpi_support/acpi_asus_wmi.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpi_support/acpi_asus_wmi.c Wed Jan 30 18:01:20 2013 (r246128) @@ -304,7 +304,8 @@ static device_method_t acpi_asus_wmi_met DEVMETHOD(device_probe, acpi_asus_wmi_probe), DEVMETHOD(device_attach, acpi_asus_wmi_attach), DEVMETHOD(device_detach, acpi_asus_wmi_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t acpi_asus_wmi_driver = { Modified: head/sys/dev/acpi_support/acpi_fujitsu.c ============================================================================== --- head/sys/dev/acpi_support/acpi_fujitsu.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpi_support/acpi_fujitsu.c Wed Jan 30 18:01:20 2013 (r246128) @@ -154,7 +154,8 @@ static device_method_t acpi_fujitsu_meth DEVMETHOD(device_detach, acpi_fujitsu_detach), DEVMETHOD(device_suspend, acpi_fujitsu_suspend), DEVMETHOD(device_resume, acpi_fujitsu_resume), - {0, 0} + + DEVMETHOD_END }; static driver_t acpi_fujitsu_driver = { Modified: head/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- head/sys/dev/acpi_support/acpi_hp.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpi_support/acpi_hp.c Wed Jan 30 18:01:20 2013 (r246128) @@ -324,7 +324,8 @@ static device_method_t acpi_hp_methods[] DEVMETHOD(device_probe, acpi_hp_probe), DEVMETHOD(device_attach, acpi_hp_attach), DEVMETHOD(device_detach, acpi_hp_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t acpi_hp_driver = { Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpi_support/acpi_ibm.c Wed Jan 30 18:01:20 2013 (r246128) @@ -303,7 +303,7 @@ static device_method_t acpi_ibm_methods[ DEVMETHOD(device_detach, acpi_ibm_detach), DEVMETHOD(device_resume, acpi_ibm_resume), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_ibm_driver = { Modified: head/sys/dev/acpi_support/acpi_panasonic.c ============================================================================== --- head/sys/dev/acpi_support/acpi_panasonic.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpi_support/acpi_panasonic.c Wed Jan 30 18:01:20 2013 (r246128) @@ -118,7 +118,7 @@ static device_method_t acpi_panasonic_me DEVMETHOD(device_detach, acpi_panasonic_detach), DEVMETHOD(device_shutdown, acpi_panasonic_shutdown), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_panasonic_driver = { Modified: head/sys/dev/acpi_support/acpi_sony.c ============================================================================== --- head/sys/dev/acpi_support/acpi_sony.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpi_support/acpi_sony.c Wed Jan 30 18:01:20 2013 (r246128) @@ -95,7 +95,7 @@ static device_method_t acpi_sony_methods DEVMETHOD(device_attach, acpi_sony_attach), DEVMETHOD(device_detach, acpi_sony_detach), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_sony_driver = { Modified: head/sys/dev/acpi_support/acpi_toshiba.c ============================================================================== --- head/sys/dev/acpi_support/acpi_toshiba.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpi_support/acpi_toshiba.c Wed Jan 30 18:01:20 2013 (r246128) @@ -172,7 +172,7 @@ static device_method_t acpi_toshiba_meth DEVMETHOD(device_attach, acpi_toshiba_attach), DEVMETHOD(device_detach, acpi_toshiba_detach), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_toshiba_driver = { @@ -190,7 +190,7 @@ static device_method_t acpi_toshiba_vide DEVMETHOD(device_probe, acpi_toshiba_video_probe), DEVMETHOD(device_attach, acpi_toshiba_video_attach), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_toshiba_video_driver = { Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi.c Wed Jan 30 18:01:20 2013 (r246128) @@ -217,7 +217,7 @@ static device_method_t acpi_methods[] = /* ISA emulation */ DEVMETHOD(isa_pnp_probe, acpi_isa_pnp_probe), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_driver = { Modified: head/sys/dev/acpica/acpi_acad.c ============================================================================== --- head/sys/dev/acpica/acpi_acad.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_acad.c Wed Jan 30 18:01:20 2013 (r246128) @@ -74,7 +74,7 @@ static device_method_t acpi_acad_methods DEVMETHOD(device_probe, acpi_acad_probe), DEVMETHOD(device_attach, acpi_acad_attach), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_acad_driver = { Modified: head/sys/dev/acpica/acpi_button.c ============================================================================== --- head/sys/dev/acpica/acpi_button.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_button.c Wed Jan 30 18:01:20 2013 (r246128) @@ -79,8 +79,7 @@ static device_method_t acpi_button_metho DEVMETHOD(device_suspend, acpi_button_suspend), DEVMETHOD(device_shutdown, acpi_button_suspend), DEVMETHOD(device_resume, acpi_button_resume), - - {0, 0} + DEVMETHOD_END }; static driver_t acpi_button_driver = { Modified: head/sys/dev/acpica/acpi_cmbat.c ============================================================================== --- head/sys/dev/acpica/acpi_cmbat.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_cmbat.c Wed Jan 30 18:01:20 2013 (r246128) @@ -99,7 +99,7 @@ static device_method_t acpi_cmbat_method DEVMETHOD(acpi_batt_get_info, acpi_cmbat_bif), DEVMETHOD(acpi_batt_get_status, acpi_cmbat_bst), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_cmbat_driver = { Modified: head/sys/dev/acpica/acpi_dock.c ============================================================================== --- head/sys/dev/acpica/acpi_dock.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_dock.c Wed Jan 30 18:01:20 2013 (r246128) @@ -521,7 +521,7 @@ static device_method_t acpi_dock_methods DEVMETHOD(device_probe, acpi_dock_probe), DEVMETHOD(device_attach, acpi_dock_attach), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_dock_driver = { Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_ec.c Wed Jan 30 18:01:20 2013 (r246128) @@ -253,7 +253,7 @@ static device_method_t acpi_ec_methods[] DEVMETHOD(acpi_ec_read, acpi_ec_read_method), DEVMETHOD(acpi_ec_write, acpi_ec_write_method), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_ec_driver = { Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_hpet.c Wed Jan 30 18:01:20 2013 (r246128) @@ -849,7 +849,7 @@ static device_method_t hpet_methods[] = DEVMETHOD(bus_remap_intr, hpet_remap_intr), #endif - {0, 0} + DEVMETHOD_END }; static driver_t hpet_driver = { Modified: head/sys/dev/acpica/acpi_lid.c ============================================================================== --- head/sys/dev/acpica/acpi_lid.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_lid.c Wed Jan 30 18:01:20 2013 (r246128) @@ -69,7 +69,7 @@ static device_method_t acpi_lid_methods[ DEVMETHOD(device_suspend, acpi_lid_suspend), DEVMETHOD(device_resume, acpi_lid_resume), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_lid_driver = { Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_pci.c Wed Jan 30 18:01:20 2013 (r246128) @@ -94,7 +94,7 @@ static device_method_t acpi_pci_methods[ /* PCI interface */ DEVMETHOD(pci_set_powerstate, acpi_pci_set_powerstate_method), - { 0, 0 } + DEVMETHOD_END }; static devclass_t pci_devclass; Modified: head/sys/dev/acpica/acpi_pci_link.c ============================================================================== --- head/sys/dev/acpica/acpi_pci_link.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_pci_link.c Wed Jan 30 18:01:20 2013 (r246128) @@ -1097,7 +1097,7 @@ static device_method_t acpi_pci_link_met DEVMETHOD(device_attach, acpi_pci_link_attach), DEVMETHOD(device_resume, acpi_pci_link_resume), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_pci_link_driver = { Modified: head/sys/dev/acpica/acpi_pcib_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_pci.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_pcib_pci.c Wed Jan 30 18:01:20 2013 (r246128) @@ -83,7 +83,7 @@ static device_method_t acpi_pcib_pci_met DEVMETHOD(pcib_route_interrupt, acpi_pcib_pci_route_interrupt), DEVMETHOD(pcib_power_for_sleep, acpi_pcib_power_for_sleep), - {0, 0} + DEVMETHOD_END }; static devclass_t pcib_devclass; Modified: head/sys/dev/acpica/acpi_perf.c ============================================================================== --- head/sys/dev/acpica/acpi_perf.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_perf.c Wed Jan 30 18:01:20 2013 (r246128) @@ -122,7 +122,8 @@ static device_method_t acpi_perf_methods DEVMETHOD(cpufreq_drv_get, acpi_px_get), DEVMETHOD(cpufreq_drv_type, acpi_px_type), DEVMETHOD(cpufreq_drv_settings, acpi_px_settings), - {0, 0} + + DEVMETHOD_END }; static driver_t acpi_perf_driver = { Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_resource.c Wed Jan 30 18:01:20 2013 (r246128) @@ -615,7 +615,7 @@ static device_method_t acpi_sysres_metho DEVMETHOD(device_probe, acpi_sysres_probe), DEVMETHOD(device_attach, acpi_sysres_attach), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_sysres_driver = { Modified: head/sys/dev/acpica/acpi_smbat.c ============================================================================== --- head/sys/dev/acpica/acpi_smbat.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_smbat.c Wed Jan 30 18:01:20 2013 (r246128) @@ -89,7 +89,7 @@ static device_method_t acpi_smbat_method DEVMETHOD(acpi_batt_get_status, acpi_smbat_get_bst), DEVMETHOD(acpi_batt_get_info, acpi_smbat_get_bif), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_smbat_driver = { Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_thermal.c Wed Jan 30 18:01:20 2013 (r246128) @@ -152,7 +152,7 @@ static device_method_t acpi_tz_methods[] DEVMETHOD(device_probe, acpi_tz_probe), DEVMETHOD(device_attach, acpi_tz_attach), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_tz_driver = { Modified: head/sys/dev/acpica/acpi_throttle.c ============================================================================== --- head/sys/dev/acpica/acpi_throttle.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_throttle.c Wed Jan 30 18:01:20 2013 (r246128) @@ -114,7 +114,7 @@ static device_method_t acpi_throttle_met DEVMETHOD(cpufreq_drv_get, acpi_thr_get), DEVMETHOD(cpufreq_drv_type, acpi_thr_type), DEVMETHOD(cpufreq_drv_settings, acpi_thr_settings), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_throttle_driver = { Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/acpica/acpi_timer.c Wed Jan 30 18:01:20 2013 (r246128) @@ -82,7 +82,7 @@ static device_method_t acpi_timer_method DEVMETHOD(device_probe, acpi_timer_probe), DEVMETHOD(device_attach, acpi_timer_attach), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_timer_driver = { Modified: head/sys/dev/adlink/adlink.c ============================================================================== --- head/sys/dev/adlink/adlink.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/adlink/adlink.c Wed Jan 30 18:01:20 2013 (r246128) @@ -407,7 +407,8 @@ static device_method_t adlink_methods[] DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), DEVMETHOD(device_shutdown, bus_generic_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t adlink_driver = { Modified: head/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- head/sys/dev/amdsbwd/amdsbwd.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/amdsbwd/amdsbwd.c Wed Jan 30 18:01:20 2013 (r246128) @@ -139,7 +139,7 @@ static device_method_t amdsbwd_methods[] #if 0 DEVMETHOD(device_shutdown, amdsbwd_detach), #endif - {0, 0} + DEVMETHOD_END }; static devclass_t amdsbwd_devclass; Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/amdtemp/amdtemp.c Wed Jan 30 18:01:20 2013 (r246128) @@ -134,7 +134,7 @@ static device_method_t amdtemp_methods[] DEVMETHOD(device_attach, amdtemp_attach), DEVMETHOD(device_detach, amdtemp_detach), - {0, 0} + DEVMETHOD_END }; static driver_t amdtemp_driver = { Modified: head/sys/dev/auxio/auxio.c ============================================================================== --- head/sys/dev/auxio/auxio.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/auxio/auxio.c Wed Jan 30 18:01:20 2013 (r246128) @@ -131,7 +131,8 @@ static device_method_t auxio_sbus_method DEVMETHOD(device_probe, auxio_bus_probe), DEVMETHOD(device_attach, auxio_sbus_attach), DEVMETHOD(device_detach, auxio_bus_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t auxio_sbus_driver = { @@ -151,7 +152,8 @@ static device_method_t auxio_ebus_method DEVMETHOD(device_probe, auxio_bus_probe), DEVMETHOD(device_attach, auxio_ebus_attach), DEVMETHOD(device_detach, auxio_bus_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t auxio_ebus_driver = { Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/ce/if_ce.c Wed Jan 30 18:01:20 2013 (r246128) @@ -145,7 +145,7 @@ static device_method_t ce_methods[] = { DEVMETHOD(device_attach, ce_attach), DEVMETHOD(device_detach, ce_detach), - {0, 0} + DEVMETHOD_END }; typedef struct _ce_dma_mem_t { Modified: head/sys/dev/cfi/cfi_bus_fdt.c ============================================================================== --- head/sys/dev/cfi/cfi_bus_fdt.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/cfi/cfi_bus_fdt.c Wed Jan 30 18:01:20 2013 (r246128) @@ -51,7 +51,7 @@ static device_method_t cfi_fdt_methods[] DEVMETHOD(device_attach, cfi_attach), DEVMETHOD(device_detach, cfi_detach), - {0, 0} + DEVMETHOD_END }; static driver_t cfi_fdt_driver = { Modified: head/sys/dev/cfi/cfi_bus_ixp4xx.c ============================================================================== --- head/sys/dev/cfi/cfi_bus_ixp4xx.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/cfi/cfi_bus_ixp4xx.c Wed Jan 30 18:01:20 2013 (r246128) @@ -69,7 +69,7 @@ static device_method_t cfi_ixp4xx_method DEVMETHOD(device_attach, cfi_attach), DEVMETHOD(device_detach, cfi_detach), - {0, 0} + DEVMETHOD_END }; static driver_t cfi_ixp4xx_driver = { Modified: head/sys/dev/coretemp/coretemp.c ============================================================================== --- head/sys/dev/coretemp/coretemp.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/coretemp/coretemp.c Wed Jan 30 18:01:20 2013 (r246128) @@ -85,7 +85,7 @@ static device_method_t coretemp_methods[ DEVMETHOD(device_attach, coretemp_attach), DEVMETHOD(device_detach, coretemp_detach), - {0, 0} + DEVMETHOD_END }; static driver_t coretemp_driver = { Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/cp/if_cp.c Wed Jan 30 18:01:20 2013 (r246128) @@ -93,7 +93,7 @@ static device_method_t cp_methods[] = { DEVMETHOD(device_attach, cp_attach), DEVMETHOD(device_detach, cp_detach), - {0, 0} + DEVMETHOD_END }; typedef struct _cp_dma_mem_t { Modified: head/sys/dev/cpufreq/ichss.c ============================================================================== --- head/sys/dev/cpufreq/ichss.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/cpufreq/ichss.c Wed Jan 30 18:01:20 2013 (r246128) @@ -113,7 +113,7 @@ static device_method_t ichss_methods[] = DEVMETHOD(cpufreq_drv_get, ichss_get), DEVMETHOD(cpufreq_drv_type, ichss_type), DEVMETHOD(cpufreq_drv_settings, ichss_settings), - {0, 0} + DEVMETHOD_END }; static driver_t ichss_driver = { "ichss", ichss_methods, sizeof(struct ichss_softc) Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/ctau/if_ct.c Wed Jan 30 18:01:20 2013 (r246128) @@ -93,7 +93,8 @@ static device_method_t ct_isa_methods [] DEVMETHOD(device_probe, ct_probe), DEVMETHOD(device_attach, ct_attach), DEVMETHOD(device_detach, ct_detach), - {0, 0} + + DEVMETHOD_END }; typedef struct _ct_dma_mem_t { Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/cx/if_cx.c Wed Jan 30 18:01:20 2013 (r246128) @@ -113,7 +113,8 @@ static device_method_t cx_isa_methods [] DEVMETHOD(device_probe, cx_probe), DEVMETHOD(device_attach, cx_attach), DEVMETHOD(device_detach, cx_detach), - {0, 0} + + DEVMETHOD_END }; typedef struct _cx_dma_mem_t { Modified: head/sys/dev/digi/digi_isa.c ============================================================================== --- head/sys/dev/digi/digi_isa.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/digi/digi_isa.c Wed Jan 30 18:01:20 2013 (r246128) @@ -462,7 +462,8 @@ static device_method_t digi_isa_methods[ DEVMETHOD(device_attach, digi_isa_attach), DEVMETHOD(device_detach, digi_detach), DEVMETHOD(device_shutdown, digi_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t digi_isa_drv = { Modified: head/sys/dev/digi/digi_pci.c ============================================================================== --- head/sys/dev/digi/digi_pci.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/digi/digi_pci.c Wed Jan 30 18:01:20 2013 (r246128) @@ -219,7 +219,8 @@ static device_method_t digi_pci_methods[ DEVMETHOD(device_attach, digi_pci_attach), DEVMETHOD(device_detach, digi_detach), DEVMETHOD(device_shutdown, digi_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t digi_pci_drv = { Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/e1000/if_em.c Wed Jan 30 18:01:20 2013 (r246128) @@ -309,7 +309,7 @@ static device_method_t em_methods[] = { DEVMETHOD(device_shutdown, em_shutdown), DEVMETHOD(device_suspend, em_suspend), DEVMETHOD(device_resume, em_resume), - {0, 0} + DEVMETHOD_END }; static driver_t em_driver = { Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/e1000/if_igb.c Wed Jan 30 18:01:20 2013 (r246128) @@ -294,7 +294,7 @@ static device_method_t igb_methods[] = { DEVMETHOD(device_shutdown, igb_shutdown), DEVMETHOD(device_suspend, igb_suspend), DEVMETHOD(device_resume, igb_resume), - {0, 0} + DEVMETHOD_END }; static driver_t igb_driver = { Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/e1000/if_lem.c Wed Jan 30 18:01:20 2013 (r246128) @@ -262,7 +262,7 @@ static device_method_t lem_methods[] = { DEVMETHOD(device_shutdown, lem_shutdown), DEVMETHOD(device_suspend, lem_suspend), DEVMETHOD(device_resume, lem_resume), - {0, 0} + DEVMETHOD_END }; static driver_t lem_driver = { Modified: head/sys/dev/ep/if_ep_eisa.c ============================================================================== --- head/sys/dev/ep/if_ep_eisa.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/ep/if_ep_eisa.c Wed Jan 30 18:01:20 2013 (r246128) @@ -238,7 +238,7 @@ static device_method_t ep_eisa_methods[] DEVMETHOD(device_attach, ep_eisa_attach), DEVMETHOD(device_detach, ep_detach), - {0, 0} + DEVMETHOD_END }; static driver_t ep_eisa_driver = { Modified: head/sys/dev/ep/if_ep_isa.c ============================================================================== --- head/sys/dev/ep/if_ep_isa.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/ep/if_ep_isa.c Wed Jan 30 18:01:20 2013 (r246128) @@ -391,7 +391,7 @@ static device_method_t ep_isa_methods[] DEVMETHOD(device_attach, ep_isa_attach), DEVMETHOD(device_detach, ep_detach), - {0, 0} + DEVMETHOD_END }; static driver_t ep_isa_driver = { Modified: head/sys/dev/ep/if_ep_mca.c ============================================================================== --- head/sys/dev/ep/if_ep_mca.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/ep/if_ep_mca.c Wed Jan 30 18:01:20 2013 (r246128) @@ -145,7 +145,7 @@ static device_method_t ep_mca_methods[] DEVMETHOD(device_attach, ep_mca_attach), DEVMETHOD(device_detach, ep_detach), - {0, 0} + DEVMETHOD_END }; static driver_t ep_mca_driver = { Modified: head/sys/dev/ep/if_ep_pccard.c ============================================================================== --- head/sys/dev/ep/if_ep_pccard.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/ep/if_ep_pccard.c Wed Jan 30 18:01:20 2013 (r246128) @@ -223,7 +223,7 @@ static device_method_t ep_pccard_methods DEVMETHOD(device_attach, ep_pccard_attach), DEVMETHOD(device_detach, ep_detach), - {0, 0} + DEVMETHOD_END }; static driver_t ep_pccard_driver = { Modified: head/sys/dev/fdc/fdc_acpi.c ============================================================================== --- head/sys/dev/fdc/fdc_acpi.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/fdc/fdc_acpi.c Wed Jan 30 18:01:20 2013 (r246128) @@ -258,7 +258,7 @@ static device_method_t fdc_acpi_methods[ DEVMETHOD(bus_read_ivar, fdc_read_ivar), DEVMETHOD(bus_write_ivar, fdc_write_ivar), - {0, 0} + DEVMETHOD_END }; static driver_t fdc_acpi_driver = { Modified: head/sys/dev/iicbus/ad7418.c ============================================================================== --- head/sys/dev/iicbus/ad7418.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/iicbus/ad7418.c Wed Jan 30 18:01:20 2013 (r246128) @@ -219,7 +219,7 @@ static device_method_t ad7418_methods[] DEVMETHOD(device_probe, ad7418_probe), DEVMETHOD(device_attach, ad7418_attach), - {0, 0}, + DEVMETHOD_END }; static driver_t ad7418_driver = { Modified: head/sys/dev/iicbus/ds133x.c ============================================================================== --- head/sys/dev/iicbus/ds133x.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/iicbus/ds133x.c Wed Jan 30 18:01:20 2013 (r246128) @@ -347,7 +347,7 @@ static device_method_t ds133x_methods[] DEVMETHOD(clock_gettime, ds133x_gettime), DEVMETHOD(clock_settime, ds133x_settime), - {0, 0}, + DEVMETHOD_END }; static driver_t ds133x_driver = { Modified: head/sys/dev/iicbus/ds1672.c ============================================================================== --- head/sys/dev/iicbus/ds1672.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/iicbus/ds1672.c Wed Jan 30 18:01:20 2013 (r246128) @@ -167,7 +167,7 @@ static device_method_t ds1672_methods[] DEVMETHOD(clock_gettime, ds1672_gettime), DEVMETHOD(clock_settime, ds1672_settime), - {0, 0}, + DEVMETHOD_END }; static driver_t ds1672_driver = { Modified: head/sys/dev/iicbus/icee.c ============================================================================== --- head/sys/dev/iicbus/icee.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/iicbus/icee.c Wed Jan 30 18:01:20 2013 (r246128) @@ -262,7 +262,7 @@ static device_method_t icee_methods[] = DEVMETHOD(device_probe, icee_probe), DEVMETHOD(device_attach, icee_attach), - {0, 0}, + DEVMETHOD_END }; static driver_t icee_driver = { Modified: head/sys/dev/ixgb/if_ixgb.c ============================================================================== --- head/sys/dev/ixgb/if_ixgb.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/ixgb/if_ixgb.c Wed Jan 30 18:01:20 2013 (r246128) @@ -159,7 +159,8 @@ static device_method_t ixgb_methods[] = DEVMETHOD(device_attach, ixgb_attach), DEVMETHOD(device_detach, ixgb_detach), DEVMETHOD(device_shutdown, ixgb_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t ixgb_driver = { Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/ixgbe/ixgbe.c Wed Jan 30 18:01:20 2013 (r246128) @@ -216,7 +216,8 @@ static device_method_t ixgbe_methods[] = DEVMETHOD(device_attach, ixgbe_attach), DEVMETHOD(device_detach, ixgbe_detach), DEVMETHOD(device_shutdown, ixgbe_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t ixgbe_driver = { Modified: head/sys/dev/ixgbe/ixv.c ============================================================================== --- head/sys/dev/ixgbe/ixv.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/ixgbe/ixv.c Wed Jan 30 18:01:20 2013 (r246128) @@ -169,7 +169,8 @@ static device_method_t ixv_methods[] = { DEVMETHOD(device_attach, ixv_attach), DEVMETHOD(device_detach, ixv_detach), DEVMETHOD(device_shutdown, ixv_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t ixv_driver = { Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/mfi/mfi_cam.c Wed Jan 30 18:01:20 2013 (r246128) @@ -99,7 +99,8 @@ static device_method_t mfip_methods[] = DEVMETHOD(device_probe, mfip_probe), DEVMETHOD(device_attach, mfip_attach), DEVMETHOD(device_detach, mfip_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t mfip_driver = { "mfip", Modified: head/sys/dev/mn/if_mn.c ============================================================================== --- head/sys/dev/mn/if_mn.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/mn/if_mn.c Wed Jan 30 18:01:20 2013 (r246128) @@ -1418,7 +1418,7 @@ static device_method_t mn_methods[] = { DEVMETHOD(device_resume, bus_generic_resume), DEVMETHOD(device_shutdown, bus_generic_shutdown), - {0, 0} + DEVMETHOD_END }; static driver_t mn_driver = { Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/mxge/if_mxge.c Wed Jan 30 18:01:20 2013 (r246128) @@ -124,7 +124,8 @@ static device_method_t mxge_methods[] = DEVMETHOD(device_attach, mxge_attach), DEVMETHOD(device_detach, mxge_detach), DEVMETHOD(device_shutdown, mxge_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t mxge_driver = Modified: head/sys/dev/my/if_my.c ============================================================================== --- head/sys/dev/my/if_my.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/my/if_my.c Wed Jan 30 18:01:20 2013 (r246128) @@ -153,7 +153,7 @@ static device_method_t my_methods[] = { DEVMETHOD(device_detach, my_detach), DEVMETHOD(device_shutdown, my_shutdown), - {0, 0} + DEVMETHOD_END }; static driver_t my_driver = { Modified: head/sys/dev/nvram2env/nvram2env.c ============================================================================== --- head/sys/dev/nvram2env/nvram2env.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/nvram2env/nvram2env.c Wed Jan 30 18:01:20 2013 (r246128) @@ -303,7 +303,8 @@ static device_method_t nvram2env_methods DEVMETHOD(device_identify, nvram2env_identify), DEVMETHOD(device_probe, nvram2env_probe), DEVMETHOD(device_attach, nvram2env_attach), - {0, 0}, + + DEVMETHOD_END }; static driver_t nvram2env_driver = { Modified: head/sys/dev/nxge/if_nxge.c ============================================================================== --- head/sys/dev/nxge/if_nxge.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/nxge/if_nxge.c Wed Jan 30 18:01:20 2013 (r246128) @@ -3507,7 +3507,8 @@ static device_method_t xge_methods[] = { DEVMETHOD(device_attach, xge_attach), DEVMETHOD(device_detach, xge_detach), DEVMETHOD(device_shutdown, xge_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t xge_driver = { Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/oce/oce_if.c Wed Jan 30 18:01:20 2013 (r246128) @@ -108,7 +108,8 @@ static device_method_t oce_dispatch[] = DEVMETHOD(device_attach, oce_attach), DEVMETHOD(device_detach, oce_detach), DEVMETHOD(device_shutdown, oce_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t oce_driver = { Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/sdhci/sdhci_pci.c Wed Jan 30 18:01:20 2013 (r246128) @@ -426,7 +426,7 @@ static device_method_t sdhci_methods[] = DEVMETHOD(sdhci_write_4, sdhci_pci_write_4), DEVMETHOD(sdhci_write_multi_4, sdhci_pci_write_multi_4), - {0, 0}, + DEVMETHOD_END }; static driver_t sdhci_pci_driver = { Modified: head/sys/dev/sound/pci/emu10kx-midi.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx-midi.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/sound/pci/emu10kx-midi.c Wed Jan 30 18:01:20 2013 (r246128) @@ -239,7 +239,7 @@ static device_method_t emu_midi_methods[ DEVMETHOD(device_attach, emu_midi_attach), DEVMETHOD(device_detach, emu_midi_detach), - {0, 0}, + DEVMETHOD_END }; static driver_t emu_midi_driver = { Modified: head/sys/dev/sound/pci/emu10kx-pcm.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx-pcm.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/sound/pci/emu10kx-pcm.c Wed Jan 30 18:01:20 2013 (r246128) @@ -1520,7 +1520,8 @@ static device_method_t emu_pcm_methods[] DEVMETHOD(device_probe, emu_pcm_probe), DEVMETHOD(device_attach, emu_pcm_attach), DEVMETHOD(device_detach, emu_pcm_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t emu_pcm_driver = { Modified: head/sys/dev/sound/pci/emu10kx.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/sound/pci/emu10kx.c Wed Jan 30 18:01:20 2013 (r246128) @@ -3529,7 +3529,7 @@ static device_method_t emu_methods[] = { DEVMETHOD(bus_read_ivar, emu_read_ivar), DEVMETHOD(bus_write_ivar, emu_write_ivar), - {0, 0} + DEVMETHOD_END }; Modified: head/sys/dev/sound/sbus/cs4231.c ============================================================================== --- head/sys/dev/sound/sbus/cs4231.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/sound/sbus/cs4231.c Wed Jan 30 18:01:20 2013 (r246128) @@ -231,7 +231,8 @@ static device_method_t cs4231_sbus_metho DEVMETHOD(device_detach, cs4231_bus_detach), DEVMETHOD(device_suspend, cs4231_bus_suspend), DEVMETHOD(device_resume, cs4231_bus_resume), - {0, 0} + + DEVMETHOD_END }; static driver_t cs4231_sbus_driver = { @@ -249,7 +250,8 @@ static device_method_t cs4231_ebus_metho DEVMETHOD(device_detach, cs4231_bus_detach), DEVMETHOD(device_suspend, cs4231_bus_suspend), DEVMETHOD(device_resume, cs4231_bus_resume), - {0, 0} + + DEVMETHOD_END }; static driver_t cs4231_ebus_driver = { Modified: head/sys/dev/sound/usb/uaudio_pcm.c ============================================================================== --- head/sys/dev/sound/usb/uaudio_pcm.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/sound/usb/uaudio_pcm.c Wed Jan 30 18:01:20 2013 (r246128) @@ -227,7 +227,7 @@ static device_method_t ua_pcm_methods[] DEVMETHOD(device_attach, ua_attach), DEVMETHOD(device_detach, ua_detach), - {0, 0} + DEVMETHOD_END }; static driver_t ua_pcm_driver = { Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/controller/usb_controller.c Wed Jan 30 18:01:20 2013 (r246128) @@ -114,7 +114,8 @@ static device_method_t usb_methods[] = { DEVMETHOD(device_suspend, usb_suspend), DEVMETHOD(device_resume, usb_resume), DEVMETHOD(device_shutdown, usb_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t usb_driver = { Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/input/uhid.c Wed Jan 30 18:01:20 2013 (r246128) @@ -852,7 +852,8 @@ static device_method_t uhid_methods[] = DEVMETHOD(device_probe, uhid_probe), DEVMETHOD(device_attach, uhid_attach), DEVMETHOD(device_detach, uhid_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t uhid_driver = { Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/input/ukbd.c Wed Jan 30 18:01:20 2013 (r246128) @@ -2120,7 +2120,8 @@ static device_method_t ukbd_methods[] = DEVMETHOD(device_attach, ukbd_attach), DEVMETHOD(device_detach, ukbd_detach), DEVMETHOD(device_resume, ukbd_resume), - {0, 0} + + DEVMETHOD_END }; static driver_t ukbd_driver = { Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/input/ums.c Wed Jan 30 18:01:20 2013 (r246128) @@ -1039,7 +1039,8 @@ static device_method_t ums_methods[] = { DEVMETHOD(device_probe, ums_probe), DEVMETHOD(device_attach, ums_attach), DEVMETHOD(device_detach, ums_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t ums_driver = { Modified: head/sys/dev/usb/misc/udbp.c ============================================================================== --- head/sys/dev/usb/misc/udbp.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/misc/udbp.c Wed Jan 30 18:01:20 2013 (r246128) @@ -248,7 +248,8 @@ static device_method_t udbp_methods[] = DEVMETHOD(device_probe, udbp_probe), DEVMETHOD(device_attach, udbp_attach), DEVMETHOD(device_detach, udbp_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t udbp_driver = { Modified: head/sys/dev/usb/misc/ufm.c ============================================================================== --- head/sys/dev/usb/misc/ufm.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/misc/ufm.c Wed Jan 30 18:01:20 2013 (r246128) @@ -105,7 +105,8 @@ static device_method_t ufm_methods[] = { DEVMETHOD(device_probe, ufm_probe), DEVMETHOD(device_attach, ufm_attach), DEVMETHOD(device_detach, ufm_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t ufm_driver = { Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/net/if_cdce.c Wed Jan 30 18:01:20 2013 (r246128) @@ -237,7 +237,7 @@ static device_method_t cdce_methods[] = DEVMETHOD(device_suspend, cdce_suspend), DEVMETHOD(device_resume, cdce_resume), - {0, 0} + DEVMETHOD_END }; static driver_t cdce_driver = { Modified: head/sys/dev/usb/net/if_cue.c ============================================================================== --- head/sys/dev/usb/net/if_cue.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/net/if_cue.c Wed Jan 30 18:01:20 2013 (r246128) @@ -157,7 +157,7 @@ static device_method_t cue_methods[] = { DEVMETHOD(device_attach, cue_attach), DEVMETHOD(device_detach, cue_detach), - {0, 0} + DEVMETHOD_END }; static driver_t cue_driver = { Modified: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- head/sys/dev/usb/net/if_ipheth.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/net/if_ipheth.c Wed Jan 30 18:01:20 2013 (r246128) @@ -116,7 +116,7 @@ static device_method_t ipheth_methods[] DEVMETHOD(device_attach, ipheth_attach), DEVMETHOD(device_detach, ipheth_detach), - {0, 0} + DEVMETHOD_END }; static driver_t ipheth_driver = { Modified: head/sys/dev/usb/net/if_kue.c ============================================================================== --- head/sys/dev/usb/net/if_kue.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/net/if_kue.c Wed Jan 30 18:01:20 2013 (r246128) @@ -199,7 +199,7 @@ static device_method_t kue_methods[] = { DEVMETHOD(device_attach, kue_attach), DEVMETHOD(device_detach, kue_detach), - {0, 0} + DEVMETHOD_END }; static driver_t kue_driver = { Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/net/if_smsc.c Wed Jan 30 18:01:20 2013 (r246128) @@ -1810,7 +1810,7 @@ static device_method_t smsc_methods[] = DEVMETHOD(miibus_writereg, smsc_miibus_writereg), DEVMETHOD(miibus_statchg, smsc_miibus_statchg), - {0, 0} + DEVMETHOD_END }; static driver_t smsc_driver = { Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/storage/umass.c Wed Jan 30 18:01:20 2013 (r246128) @@ -698,7 +698,8 @@ static device_method_t umass_methods[] = DEVMETHOD(device_probe, umass_probe), DEVMETHOD(device_attach, umass_attach), DEVMETHOD(device_detach, umass_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t umass_driver = { Modified: head/sys/dev/usb/storage/urio.c ============================================================================== --- head/sys/dev/usb/storage/urio.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/storage/urio.c Wed Jan 30 18:01:20 2013 (r246128) @@ -185,7 +185,8 @@ static device_method_t urio_methods[] = DEVMETHOD(device_probe, urio_probe), DEVMETHOD(device_attach, urio_attach), DEVMETHOD(device_detach, urio_detach), - {0, 0} + + DEVMETHOD_END }; static driver_t urio_driver = { Modified: head/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- head/sys/dev/usb/storage/ustorage_fs.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/storage/ustorage_fs.c Wed Jan 30 18:01:20 2013 (r246128) @@ -256,7 +256,7 @@ static device_method_t ustorage_fs_metho DEVMETHOD(device_suspend, ustorage_fs_suspend), DEVMETHOD(device_resume, ustorage_fs_resume), - {0, 0} + DEVMETHOD_END }; static driver_t ustorage_fs_driver = { Modified: head/sys/dev/usb/usb_compat_linux.c ============================================================================== --- head/sys/dev/usb/usb_compat_linux.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/usb/usb_compat_linux.c Wed Jan 30 18:01:20 2013 (r246128) @@ -113,7 +113,7 @@ static device_method_t usb_linux_methods DEVMETHOD(device_suspend, usb_linux_suspend), DEVMETHOD(device_resume, usb_linux_resume), - {0, 0} + DEVMETHOD_END }; static driver_t usb_linux_driver = { Modified: head/sys/dev/vx/if_vx_eisa.c ============================================================================== --- head/sys/dev/vx/if_vx_eisa.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/vx/if_vx_eisa.c Wed Jan 30 18:01:20 2013 (r246128) @@ -177,7 +177,7 @@ static device_method_t vx_eisa_methods[] DEVMETHOD(device_probe, vx_eisa_probe), DEVMETHOD(device_attach, vx_eisa_attach), - {0, 0} + DEVMETHOD_END }; static driver_t vx_eisa_driver = { Modified: head/sys/dev/vx/if_vx_pci.c ============================================================================== --- head/sys/dev/vx/if_vx_pci.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/vx/if_vx_pci.c Wed Jan 30 18:01:20 2013 (r246128) @@ -61,7 +61,7 @@ static device_method_t vx_methods[] = { DEVMETHOD(device_attach, vx_pci_attach), DEVMETHOD(device_shutdown, vx_pci_shutdown), - {0, 0} + DEVMETHOD_END }; static driver_t vx_driver = { Modified: head/sys/dev/vxge/vxge.c ============================================================================== --- head/sys/dev/vxge/vxge.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/vxge/vxge.c Wed Jan 30 18:01:20 2013 (r246128) @@ -4188,7 +4188,8 @@ static device_method_t vxge_methods[] = DEVMETHOD(device_attach, vxge_attach), DEVMETHOD(device_detach, vxge_detach), DEVMETHOD(device_shutdown, vxge_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t vxge_driver = { Modified: head/sys/dev/xen/console/console.c ============================================================================== --- head/sys/dev/xen/console/console.c Wed Jan 30 17:39:43 2013 (r246127) +++ head/sys/dev/xen/console/console.c Wed Jan 30 18:01:20 2013 (r246128) @@ -410,7 +410,8 @@ static device_method_t xc_methods[] = { DEVMETHOD(device_identify, xc_identify), DEVMETHOD(device_probe, xc_probe), DEVMETHOD(device_attach, xc_attach), - {0, 0} + + DEVMETHOD_END }; static driver_t xc_driver = { From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 18:05:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5EBA125A; Wed, 30 Jan 2013 18:05:42 +0000 (UTC) (envelope-from sbrabez@gmail.com) Received: from mail-we0-x235.google.com (we-in-x0235.1e100.net [IPv6:2a00:1450:400c:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 2845AC35; Wed, 30 Jan 2013 18:05:41 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id t44so1429031wey.12 for ; Wed, 30 Jan 2013 10:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=kxv/SSjZwMOZIMoLVR9eR6faERjZrmsNcfTNUnO/1Bs=; b=v5MHOwdcaTME+fWeGSzTvo+71RxH8wQlv0h4yFNoNL/puh45UCO5P29aWA8QHTgatE X1ySb15DHt8snHYia4mVeFhwRaARzIFOrkpj9ZP/JZHTC9qag+NPj7DAlG7w57X1u+v7 Dk5GXuk6Uqra2jecsmVYTBiFYDLdX5EKSYhY3wntgrV9/msBSaKxm40CcuSZBDOACzp8 HJp/DD3e/w1b0wgb7xE9p+uzOmUiNhTMf1EF0I0A//aO7z7m1XPez/plGBtqRL+rjq/F kt68HZ5Mc/S5m1pweXfS/XNc/ELt3oukw9zaTeQBzFvN9qSxWXgnMgVBdLR/DnrkuzRp PrzA== X-Received: by 10.194.89.167 with SMTP id bp7mr10781682wjb.0.1359569140136; Wed, 30 Jan 2013 10:05:40 -0800 (PST) Received: from ogoshi.int.nbs-system.com (home.6dev.net. [88.191.118.8]) by mx.google.com with ESMTPS id eo10sm4506046wib.9.2013.01.30.10.05.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jan 2013 10:05:38 -0800 (PST) Sender: Sofian Brabez Date: Wed, 30 Jan 2013 19:05:35 +0100 From: Sofian Brabez To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r246128 - in head/sys/dev: acpi_support acpica adlink amdsbwd amdtemp auxio ce cfi coretemp cp cpufreq ctau cx digi e1000 ep fdc iicbus ixgb ixgbe mfi mn mxge my nvram2env nxge oce sdhc... Message-ID: <20130130180535.GA52768@ogoshi.int.nbs-system.com> References: <201301301801.r0UI1KBB032328@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline In-Reply-To: <201301301801.r0UI1KBB032328@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 18:05:42 -0000 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 30, 2013 at 06:01:20PM +0000, Sofian Brabez wrote: > Author: sbz (ports committer) > Date: Wed Jan 30 18:01:20 2013 > New Revision: 246128 > URL: http://svnweb.freebsd.org/changeset/base/246128 >=20 > Log: > Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel= on device_method_t arrays > =20 > Reviewed by: cognet > Approved by: cognet >=20 > Modified: > head/sys/dev/acpi_support/acpi_asus_wmi.c > head/sys/dev/acpi_support/acpi_fujitsu.c (contents, props changed) > head/sys/dev/acpi_support/acpi_hp.c > head/sys/dev/acpi_support/acpi_ibm.c (contents, props changed) > head/sys/dev/acpi_support/acpi_panasonic.c (contents, props changed) > head/sys/dev/acpi_support/acpi_sony.c (contents, props changed) > head/sys/dev/acpi_support/acpi_toshiba.c (contents, props changed) > head/sys/dev/acpica/acpi.c (contents, props changed) > head/sys/dev/acpica/acpi_acad.c (contents, props changed) > head/sys/dev/acpica/acpi_button.c (contents, props changed) > head/sys/dev/acpica/acpi_cmbat.c (contents, props changed) > head/sys/dev/acpica/acpi_dock.c (contents, props changed) > head/sys/dev/acpica/acpi_ec.c (contents, props changed) > head/sys/dev/acpica/acpi_hpet.c (contents, props changed) > head/sys/dev/acpica/acpi_lid.c (contents, props changed) > head/sys/dev/acpica/acpi_pci.c (contents, props changed) > head/sys/dev/acpica/acpi_pci_link.c (contents, props changed) > head/sys/dev/acpica/acpi_pcib_pci.c (contents, props changed) > head/sys/dev/acpica/acpi_perf.c (contents, props changed) > head/sys/dev/acpica/acpi_resource.c (contents, props changed) > head/sys/dev/acpica/acpi_smbat.c (contents, props changed) > head/sys/dev/acpica/acpi_thermal.c (contents, props changed) > head/sys/dev/acpica/acpi_throttle.c (contents, props changed) > head/sys/dev/acpica/acpi_timer.c (contents, props changed) > head/sys/dev/adlink/adlink.c (contents, props changed) > head/sys/dev/amdsbwd/amdsbwd.c > head/sys/dev/amdtemp/amdtemp.c (contents, props changed) > head/sys/dev/auxio/auxio.c (contents, props changed) > head/sys/dev/ce/if_ce.c (contents, props changed) > head/sys/dev/cfi/cfi_bus_fdt.c > head/sys/dev/cfi/cfi_bus_ixp4xx.c > head/sys/dev/coretemp/coretemp.c (contents, props changed) > head/sys/dev/cp/if_cp.c (contents, props changed) > head/sys/dev/cpufreq/ichss.c (contents, props changed) > head/sys/dev/ctau/if_ct.c (contents, props changed) > head/sys/dev/cx/if_cx.c (contents, props changed) > head/sys/dev/digi/digi_isa.c (contents, props changed) > head/sys/dev/digi/digi_pci.c (contents, props changed) > head/sys/dev/e1000/if_em.c (contents, props changed) > head/sys/dev/e1000/if_igb.c (contents, props changed) > head/sys/dev/e1000/if_lem.c > head/sys/dev/ep/if_ep_eisa.c (contents, props changed) > head/sys/dev/ep/if_ep_isa.c (contents, props changed) > head/sys/dev/ep/if_ep_mca.c (contents, props changed) > head/sys/dev/ep/if_ep_pccard.c (contents, props changed) > head/sys/dev/fdc/fdc_acpi.c (contents, props changed) > head/sys/dev/iicbus/ad7418.c (contents, props changed) > head/sys/dev/iicbus/ds133x.c (contents, props changed) > head/sys/dev/iicbus/ds1672.c (contents, props changed) > head/sys/dev/iicbus/icee.c (contents, props changed) > head/sys/dev/ixgb/if_ixgb.c (contents, props changed) > head/sys/dev/ixgbe/ixgbe.c (contents, props changed) > head/sys/dev/ixgbe/ixv.c > head/sys/dev/mfi/mfi_cam.c (contents, props changed) > head/sys/dev/mn/if_mn.c (contents, props changed) > head/sys/dev/mxge/if_mxge.c (contents, props changed) > head/sys/dev/my/if_my.c (contents, props changed) > head/sys/dev/nvram2env/nvram2env.c (contents, props changed) > head/sys/dev/nxge/if_nxge.c (contents, props changed) > head/sys/dev/oce/oce_if.c (contents, props changed) > head/sys/dev/sdhci/sdhci_pci.c > head/sys/dev/sound/pci/emu10kx-midi.c (contents, props changed) > head/sys/dev/sound/pci/emu10kx-pcm.c (contents, props changed) > head/sys/dev/sound/pci/emu10kx.c (contents, props changed) > head/sys/dev/sound/sbus/cs4231.c (contents, props changed) > head/sys/dev/sound/usb/uaudio_pcm.c > head/sys/dev/usb/controller/usb_controller.c > head/sys/dev/usb/input/uhid.c > head/sys/dev/usb/input/ukbd.c > head/sys/dev/usb/input/ums.c > head/sys/dev/usb/misc/udbp.c > head/sys/dev/usb/misc/ufm.c > head/sys/dev/usb/net/if_cdce.c > head/sys/dev/usb/net/if_cue.c > head/sys/dev/usb/net/if_ipheth.c > head/sys/dev/usb/net/if_kue.c > head/sys/dev/usb/net/if_smsc.c > head/sys/dev/usb/storage/umass.c > head/sys/dev/usb/storage/urio.c > head/sys/dev/usb/storage/ustorage_fs.c > head/sys/dev/usb/usb_compat_linux.c > head/sys/dev/vx/if_vx_eisa.c (contents, props changed) > head/sys/dev/vx/if_vx_pci.c (contents, props changed) > head/sys/dev/vxge/vxge.c (contents, props changed) > head/sys/dev/xen/console/console.c >=20 > Modified: head/sys/dev/acpi_support/acpi_asus_wmi.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpi_support/acpi_asus_wmi.c Wed Jan 30 17:39:43 2013 (r= 246127) > +++ head/sys/dev/acpi_support/acpi_asus_wmi.c Wed Jan 30 18:01:20 2013 (r= 246128) > @@ -304,7 +304,8 @@ static device_method_t acpi_asus_wmi_met > DEVMETHOD(device_probe, acpi_asus_wmi_probe), > DEVMETHOD(device_attach, acpi_asus_wmi_attach), > DEVMETHOD(device_detach, acpi_asus_wmi_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t acpi_asus_wmi_driver =3D { >=20 > Modified: head/sys/dev/acpi_support/acpi_fujitsu.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpi_support/acpi_fujitsu.c Wed Jan 30 17:39:43 2013 (r2= 46127) > +++ head/sys/dev/acpi_support/acpi_fujitsu.c Wed Jan 30 18:01:20 2013 (r2= 46128) > @@ -154,7 +154,8 @@ static device_method_t acpi_fujitsu_meth > DEVMETHOD(device_detach, acpi_fujitsu_detach), > DEVMETHOD(device_suspend, acpi_fujitsu_suspend), > DEVMETHOD(device_resume, acpi_fujitsu_resume), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t acpi_fujitsu_driver =3D { >=20 > Modified: head/sys/dev/acpi_support/acpi_hp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpi_support/acpi_hp.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpi_support/acpi_hp.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -324,7 +324,8 @@ static device_method_t acpi_hp_methods[] > DEVMETHOD(device_probe, acpi_hp_probe), > DEVMETHOD(device_attach, acpi_hp_attach), > DEVMETHOD(device_detach, acpi_hp_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t acpi_hp_driver =3D { >=20 > Modified: head/sys/dev/acpi_support/acpi_ibm.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpi_support/acpi_ibm.c Wed Jan 30 17:39:43 2013 (r24612= 7) > +++ head/sys/dev/acpi_support/acpi_ibm.c Wed Jan 30 18:01:20 2013 (r24612= 8) > @@ -303,7 +303,7 @@ static device_method_t acpi_ibm_methods[ > DEVMETHOD(device_detach, acpi_ibm_detach), > DEVMETHOD(device_resume, acpi_ibm_resume), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_ibm_driver =3D { >=20 > Modified: head/sys/dev/acpi_support/acpi_panasonic.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpi_support/acpi_panasonic.c Wed Jan 30 17:39:43 2013 (= r246127) > +++ head/sys/dev/acpi_support/acpi_panasonic.c Wed Jan 30 18:01:20 2013 (= r246128) > @@ -118,7 +118,7 @@ static device_method_t acpi_panasonic_me > DEVMETHOD(device_detach, acpi_panasonic_detach), > DEVMETHOD(device_shutdown, acpi_panasonic_shutdown), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_panasonic_driver =3D { >=20 > Modified: head/sys/dev/acpi_support/acpi_sony.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpi_support/acpi_sony.c Wed Jan 30 17:39:43 2013 (r2461= 27) > +++ head/sys/dev/acpi_support/acpi_sony.c Wed Jan 30 18:01:20 2013 (r2461= 28) > @@ -95,7 +95,7 @@ static device_method_t acpi_sony_methods > DEVMETHOD(device_attach, acpi_sony_attach), > DEVMETHOD(device_detach, acpi_sony_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_sony_driver =3D { >=20 > Modified: head/sys/dev/acpi_support/acpi_toshiba.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpi_support/acpi_toshiba.c Wed Jan 30 17:39:43 2013 (r2= 46127) > +++ head/sys/dev/acpi_support/acpi_toshiba.c Wed Jan 30 18:01:20 2013 (r2= 46128) > @@ -172,7 +172,7 @@ static device_method_t acpi_toshiba_meth > DEVMETHOD(device_attach, acpi_toshiba_attach), > DEVMETHOD(device_detach, acpi_toshiba_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_toshiba_driver =3D { > @@ -190,7 +190,7 @@ static device_method_t acpi_toshiba_vide > DEVMETHOD(device_probe, acpi_toshiba_video_probe), > DEVMETHOD(device_attach, acpi_toshiba_video_attach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_toshiba_video_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -217,7 +217,7 @@ static device_method_t acpi_methods[] =3D=20 > /* ISA emulation */ > DEVMETHOD(isa_pnp_probe, acpi_isa_pnp_probe), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_acad.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_acad.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_acad.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -74,7 +74,7 @@ static device_method_t acpi_acad_methods > DEVMETHOD(device_probe, acpi_acad_probe), > DEVMETHOD(device_attach, acpi_acad_attach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_acad_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_button.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_button.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_button.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -79,8 +79,7 @@ static device_method_t acpi_button_metho > DEVMETHOD(device_suspend, acpi_button_suspend), > DEVMETHOD(device_shutdown, acpi_button_suspend), > DEVMETHOD(device_resume, acpi_button_resume), > - > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_button_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_cmbat.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_cmbat.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_cmbat.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -99,7 +99,7 @@ static device_method_t acpi_cmbat_method > DEVMETHOD(acpi_batt_get_info, acpi_cmbat_bif), > DEVMETHOD(acpi_batt_get_status, acpi_cmbat_bst), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_cmbat_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_dock.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_dock.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_dock.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -521,7 +521,7 @@ static device_method_t acpi_dock_methods > DEVMETHOD(device_probe, acpi_dock_probe), > DEVMETHOD(device_attach, acpi_dock_attach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_dock_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_ec.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_ec.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_ec.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -253,7 +253,7 @@ static device_method_t acpi_ec_methods[] > DEVMETHOD(acpi_ec_read, acpi_ec_read_method), > DEVMETHOD(acpi_ec_write, acpi_ec_write_method), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_ec_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_hpet.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_hpet.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_hpet.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -849,7 +849,7 @@ static device_method_t hpet_methods[] =3D=20 > DEVMETHOD(bus_remap_intr, hpet_remap_intr), > #endif > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t hpet_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_lid.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_lid.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_lid.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -69,7 +69,7 @@ static device_method_t acpi_lid_methods[ > DEVMETHOD(device_suspend, acpi_lid_suspend), > DEVMETHOD(device_resume, acpi_lid_resume), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_lid_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_pci.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_pci.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -94,7 +94,7 @@ static device_method_t acpi_pci_methods[ > /* PCI interface */ > DEVMETHOD(pci_set_powerstate, acpi_pci_set_powerstate_method), > =20 > - { 0, 0 } > + DEVMETHOD_END > }; > =20 > static devclass_t pci_devclass; >=20 > Modified: head/sys/dev/acpica/acpi_pci_link.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_pci_link.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_pci_link.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -1097,7 +1097,7 @@ static device_method_t acpi_pci_link_met > DEVMETHOD(device_attach, acpi_pci_link_attach), > DEVMETHOD(device_resume, acpi_pci_link_resume), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_pci_link_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_pcib_pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_pcib_pci.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_pcib_pci.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -83,7 +83,7 @@ static device_method_t acpi_pcib_pci_met > DEVMETHOD(pcib_route_interrupt, acpi_pcib_pci_route_interrupt), > DEVMETHOD(pcib_power_for_sleep, acpi_pcib_power_for_sleep), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static devclass_t pcib_devclass; >=20 > Modified: head/sys/dev/acpica/acpi_perf.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_perf.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_perf.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -122,7 +122,8 @@ static device_method_t acpi_perf_methods > DEVMETHOD(cpufreq_drv_get, acpi_px_get), > DEVMETHOD(cpufreq_drv_type, acpi_px_type), > DEVMETHOD(cpufreq_drv_settings, acpi_px_settings), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t acpi_perf_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_resource.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_resource.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_resource.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -615,7 +615,7 @@ static device_method_t acpi_sysres_metho > DEVMETHOD(device_probe, acpi_sysres_probe), > DEVMETHOD(device_attach, acpi_sysres_attach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_sysres_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_smbat.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_smbat.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_smbat.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -89,7 +89,7 @@ static device_method_t acpi_smbat_method > DEVMETHOD(acpi_batt_get_status, acpi_smbat_get_bst), > DEVMETHOD(acpi_batt_get_info, acpi_smbat_get_bif), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_smbat_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_thermal.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_thermal.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_thermal.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -152,7 +152,7 @@ static device_method_t acpi_tz_methods[] > DEVMETHOD(device_probe, acpi_tz_probe), > DEVMETHOD(device_attach, acpi_tz_attach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_tz_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_throttle.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_throttle.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_throttle.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -114,7 +114,7 @@ static device_method_t acpi_throttle_met > DEVMETHOD(cpufreq_drv_get, acpi_thr_get), > DEVMETHOD(cpufreq_drv_type, acpi_thr_type), > DEVMETHOD(cpufreq_drv_settings, acpi_thr_settings), > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_throttle_driver =3D { >=20 > Modified: head/sys/dev/acpica/acpi_timer.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/acpica/acpi_timer.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/acpica/acpi_timer.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -82,7 +82,7 @@ static device_method_t acpi_timer_method > DEVMETHOD(device_probe, acpi_timer_probe), > DEVMETHOD(device_attach, acpi_timer_attach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t acpi_timer_driver =3D { >=20 > Modified: head/sys/dev/adlink/adlink.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/adlink/adlink.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/adlink/adlink.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -407,7 +407,8 @@ static device_method_t adlink_methods[]=20 > DEVMETHOD(device_suspend, bus_generic_suspend), > DEVMETHOD(device_resume, bus_generic_resume), > DEVMETHOD(device_shutdown, bus_generic_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t adlink_driver =3D { >=20 > Modified: head/sys/dev/amdsbwd/amdsbwd.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/amdsbwd/amdsbwd.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/amdsbwd/amdsbwd.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -139,7 +139,7 @@ static device_method_t amdsbwd_methods[] > #if 0 > DEVMETHOD(device_shutdown, amdsbwd_detach), > #endif > - {0, 0} > + DEVMETHOD_END > }; > =20 > static devclass_t amdsbwd_devclass; >=20 > Modified: head/sys/dev/amdtemp/amdtemp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/amdtemp/amdtemp.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/amdtemp/amdtemp.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -134,7 +134,7 @@ static device_method_t amdtemp_methods[] > DEVMETHOD(device_attach, amdtemp_attach), > DEVMETHOD(device_detach, amdtemp_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t amdtemp_driver =3D { >=20 > Modified: head/sys/dev/auxio/auxio.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/auxio/auxio.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/auxio/auxio.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -131,7 +131,8 @@ static device_method_t auxio_sbus_method > DEVMETHOD(device_probe, auxio_bus_probe), > DEVMETHOD(device_attach, auxio_sbus_attach), > DEVMETHOD(device_detach, auxio_bus_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t auxio_sbus_driver =3D { > @@ -151,7 +152,8 @@ static device_method_t auxio_ebus_method > DEVMETHOD(device_probe, auxio_bus_probe), > DEVMETHOD(device_attach, auxio_ebus_attach), > DEVMETHOD(device_detach, auxio_bus_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t auxio_ebus_driver =3D { >=20 > Modified: head/sys/dev/ce/if_ce.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ce/if_ce.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/ce/if_ce.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -145,7 +145,7 @@ static device_method_t ce_methods[] =3D { > DEVMETHOD(device_attach, ce_attach), > DEVMETHOD(device_detach, ce_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > typedef struct _ce_dma_mem_t { >=20 > Modified: head/sys/dev/cfi/cfi_bus_fdt.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/cfi/cfi_bus_fdt.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/cfi/cfi_bus_fdt.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -51,7 +51,7 @@ static device_method_t cfi_fdt_methods[] > DEVMETHOD(device_attach, cfi_attach), > DEVMETHOD(device_detach, cfi_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t cfi_fdt_driver =3D { >=20 > Modified: head/sys/dev/cfi/cfi_bus_ixp4xx.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/cfi/cfi_bus_ixp4xx.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/cfi/cfi_bus_ixp4xx.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -69,7 +69,7 @@ static device_method_t cfi_ixp4xx_method > DEVMETHOD(device_attach, cfi_attach), > DEVMETHOD(device_detach, cfi_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t cfi_ixp4xx_driver =3D { >=20 > Modified: head/sys/dev/coretemp/coretemp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/coretemp/coretemp.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/coretemp/coretemp.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -85,7 +85,7 @@ static device_method_t coretemp_methods[ > DEVMETHOD(device_attach, coretemp_attach), > DEVMETHOD(device_detach, coretemp_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t coretemp_driver =3D { >=20 > Modified: head/sys/dev/cp/if_cp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/cp/if_cp.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/cp/if_cp.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -93,7 +93,7 @@ static device_method_t cp_methods[] =3D { > DEVMETHOD(device_attach, cp_attach), > DEVMETHOD(device_detach, cp_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > typedef struct _cp_dma_mem_t { >=20 > Modified: head/sys/dev/cpufreq/ichss.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/cpufreq/ichss.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/cpufreq/ichss.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -113,7 +113,7 @@ static device_method_t ichss_methods[] =3D > DEVMETHOD(cpufreq_drv_get, ichss_get), > DEVMETHOD(cpufreq_drv_type, ichss_type), > DEVMETHOD(cpufreq_drv_settings, ichss_settings), > - {0, 0} > + DEVMETHOD_END > }; > static driver_t ichss_driver =3D { > "ichss", ichss_methods, sizeof(struct ichss_softc) >=20 > Modified: head/sys/dev/ctau/if_ct.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ctau/if_ct.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/ctau/if_ct.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -93,7 +93,8 @@ static device_method_t ct_isa_methods [] > DEVMETHOD(device_probe, ct_probe), > DEVMETHOD(device_attach, ct_attach), > DEVMETHOD(device_detach, ct_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > typedef struct _ct_dma_mem_t { >=20 > Modified: head/sys/dev/cx/if_cx.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/cx/if_cx.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/cx/if_cx.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -113,7 +113,8 @@ static device_method_t cx_isa_methods [] > DEVMETHOD(device_probe, cx_probe), > DEVMETHOD(device_attach, cx_attach), > DEVMETHOD(device_detach, cx_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > typedef struct _cx_dma_mem_t { >=20 > Modified: head/sys/dev/digi/digi_isa.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/digi/digi_isa.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/digi/digi_isa.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -462,7 +462,8 @@ static device_method_t digi_isa_methods[ > DEVMETHOD(device_attach, digi_isa_attach), > DEVMETHOD(device_detach, digi_detach), > DEVMETHOD(device_shutdown, digi_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t digi_isa_drv =3D { >=20 > Modified: head/sys/dev/digi/digi_pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/digi/digi_pci.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/digi/digi_pci.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -219,7 +219,8 @@ static device_method_t digi_pci_methods[ > DEVMETHOD(device_attach, digi_pci_attach), > DEVMETHOD(device_detach, digi_detach), > DEVMETHOD(device_shutdown, digi_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t digi_pci_drv =3D { >=20 > Modified: head/sys/dev/e1000/if_em.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/e1000/if_em.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/e1000/if_em.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -309,7 +309,7 @@ static device_method_t em_methods[] =3D { > DEVMETHOD(device_shutdown, em_shutdown), > DEVMETHOD(device_suspend, em_suspend), > DEVMETHOD(device_resume, em_resume), > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t em_driver =3D { >=20 > Modified: head/sys/dev/e1000/if_igb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/e1000/if_igb.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/e1000/if_igb.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -294,7 +294,7 @@ static device_method_t igb_methods[] =3D { > DEVMETHOD(device_shutdown, igb_shutdown), > DEVMETHOD(device_suspend, igb_suspend), > DEVMETHOD(device_resume, igb_resume), > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t igb_driver =3D { >=20 > Modified: head/sys/dev/e1000/if_lem.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/e1000/if_lem.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/e1000/if_lem.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -262,7 +262,7 @@ static device_method_t lem_methods[] =3D { > DEVMETHOD(device_shutdown, lem_shutdown), > DEVMETHOD(device_suspend, lem_suspend), > DEVMETHOD(device_resume, lem_resume), > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t lem_driver =3D { >=20 > Modified: head/sys/dev/ep/if_ep_eisa.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ep/if_ep_eisa.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/ep/if_ep_eisa.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -238,7 +238,7 @@ static device_method_t ep_eisa_methods[] > DEVMETHOD(device_attach, ep_eisa_attach), > DEVMETHOD(device_detach, ep_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t ep_eisa_driver =3D { >=20 > Modified: head/sys/dev/ep/if_ep_isa.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ep/if_ep_isa.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/ep/if_ep_isa.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -391,7 +391,7 @@ static device_method_t ep_isa_methods[]=20 > DEVMETHOD(device_attach, ep_isa_attach), > DEVMETHOD(device_detach, ep_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t ep_isa_driver =3D { >=20 > Modified: head/sys/dev/ep/if_ep_mca.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ep/if_ep_mca.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/ep/if_ep_mca.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -145,7 +145,7 @@ static device_method_t ep_mca_methods[]=20 > DEVMETHOD(device_attach, ep_mca_attach), > DEVMETHOD(device_detach, ep_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t ep_mca_driver =3D { >=20 > Modified: head/sys/dev/ep/if_ep_pccard.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ep/if_ep_pccard.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/ep/if_ep_pccard.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -223,7 +223,7 @@ static device_method_t ep_pccard_methods > DEVMETHOD(device_attach, ep_pccard_attach), > DEVMETHOD(device_detach, ep_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t ep_pccard_driver =3D { >=20 > Modified: head/sys/dev/fdc/fdc_acpi.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/fdc/fdc_acpi.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/fdc/fdc_acpi.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -258,7 +258,7 @@ static device_method_t fdc_acpi_methods[ > DEVMETHOD(bus_read_ivar, fdc_read_ivar), > DEVMETHOD(bus_write_ivar, fdc_write_ivar), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t fdc_acpi_driver =3D { >=20 > Modified: head/sys/dev/iicbus/ad7418.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/iicbus/ad7418.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/iicbus/ad7418.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -219,7 +219,7 @@ static device_method_t ad7418_methods[]=20 > DEVMETHOD(device_probe, ad7418_probe), > DEVMETHOD(device_attach, ad7418_attach), > =20 > - {0, 0}, > + DEVMETHOD_END > }; > =20 > static driver_t ad7418_driver =3D { >=20 > Modified: head/sys/dev/iicbus/ds133x.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/iicbus/ds133x.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/iicbus/ds133x.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -347,7 +347,7 @@ static device_method_t ds133x_methods[]=20 > DEVMETHOD(clock_gettime, ds133x_gettime), > DEVMETHOD(clock_settime, ds133x_settime), > =20 > - {0, 0}, > + DEVMETHOD_END > }; > =20 > static driver_t ds133x_driver =3D { >=20 > Modified: head/sys/dev/iicbus/ds1672.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/iicbus/ds1672.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/iicbus/ds1672.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -167,7 +167,7 @@ static device_method_t ds1672_methods[]=20 > DEVMETHOD(clock_gettime, ds1672_gettime), > DEVMETHOD(clock_settime, ds1672_settime), > =20 > - {0, 0}, > + DEVMETHOD_END > }; > =20 > static driver_t ds1672_driver =3D { >=20 > Modified: head/sys/dev/iicbus/icee.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/iicbus/icee.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/iicbus/icee.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -262,7 +262,7 @@ static device_method_t icee_methods[] =3D=20 > DEVMETHOD(device_probe, icee_probe), > DEVMETHOD(device_attach, icee_attach), > =20 > - {0, 0}, > + DEVMETHOD_END > }; > =20 > static driver_t icee_driver =3D { >=20 > Modified: head/sys/dev/ixgb/if_ixgb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ixgb/if_ixgb.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/ixgb/if_ixgb.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -159,7 +159,8 @@ static device_method_t ixgb_methods[] =3D=20 > DEVMETHOD(device_attach, ixgb_attach), > DEVMETHOD(device_detach, ixgb_detach), > DEVMETHOD(device_shutdown, ixgb_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t ixgb_driver =3D { >=20 > Modified: head/sys/dev/ixgbe/ixgbe.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ixgbe/ixgbe.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/ixgbe/ixgbe.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -216,7 +216,8 @@ static device_method_t ixgbe_methods[] =3D > DEVMETHOD(device_attach, ixgbe_attach), > DEVMETHOD(device_detach, ixgbe_detach), > DEVMETHOD(device_shutdown, ixgbe_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t ixgbe_driver =3D { >=20 > Modified: head/sys/dev/ixgbe/ixv.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ixgbe/ixv.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/ixgbe/ixv.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -169,7 +169,8 @@ static device_method_t ixv_methods[] =3D { > DEVMETHOD(device_attach, ixv_attach), > DEVMETHOD(device_detach, ixv_detach), > DEVMETHOD(device_shutdown, ixv_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t ixv_driver =3D { >=20 > Modified: head/sys/dev/mfi/mfi_cam.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/mfi/mfi_cam.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/mfi/mfi_cam.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -99,7 +99,8 @@ static device_method_t mfip_methods[] =3D=20 > DEVMETHOD(device_probe, mfip_probe), > DEVMETHOD(device_attach, mfip_attach), > DEVMETHOD(device_detach, mfip_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > static driver_t mfip_driver =3D { > "mfip", >=20 > Modified: head/sys/dev/mn/if_mn.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/mn/if_mn.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/mn/if_mn.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -1418,7 +1418,7 @@ static device_method_t mn_methods[] =3D { > DEVMETHOD(device_resume, bus_generic_resume), > DEVMETHOD(device_shutdown, bus_generic_shutdown), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t mn_driver =3D { >=20 > Modified: head/sys/dev/mxge/if_mxge.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/mxge/if_mxge.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/mxge/if_mxge.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -124,7 +124,8 @@ static device_method_t mxge_methods[] =3D > DEVMETHOD(device_attach, mxge_attach), > DEVMETHOD(device_detach, mxge_detach), > DEVMETHOD(device_shutdown, mxge_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t mxge_driver =3D >=20 > Modified: head/sys/dev/my/if_my.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/my/if_my.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/my/if_my.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -153,7 +153,7 @@ static device_method_t my_methods[] =3D { > DEVMETHOD(device_detach, my_detach), > DEVMETHOD(device_shutdown, my_shutdown), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t my_driver =3D { >=20 > Modified: head/sys/dev/nvram2env/nvram2env.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/nvram2env/nvram2env.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/nvram2env/nvram2env.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -303,7 +303,8 @@ static device_method_t nvram2env_methods > DEVMETHOD(device_identify, nvram2env_identify), > DEVMETHOD(device_probe, nvram2env_probe), > DEVMETHOD(device_attach, nvram2env_attach), > - {0, 0}, > + > + DEVMETHOD_END > }; > =20 > static driver_t nvram2env_driver =3D { >=20 > Modified: head/sys/dev/nxge/if_nxge.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/nxge/if_nxge.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/nxge/if_nxge.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -3507,7 +3507,8 @@ static device_method_t xge_methods[] =3D { > DEVMETHOD(device_attach, xge_attach), > DEVMETHOD(device_detach, xge_detach), > DEVMETHOD(device_shutdown, xge_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t xge_driver =3D { >=20 > Modified: head/sys/dev/oce/oce_if.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/oce/oce_if.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/oce/oce_if.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -108,7 +108,8 @@ static device_method_t oce_dispatch[] =3D=20 > DEVMETHOD(device_attach, oce_attach), > DEVMETHOD(device_detach, oce_detach), > DEVMETHOD(device_shutdown, oce_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t oce_driver =3D { >=20 > Modified: head/sys/dev/sdhci/sdhci_pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/sdhci/sdhci_pci.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/sdhci/sdhci_pci.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -426,7 +426,7 @@ static device_method_t sdhci_methods[] =3D > DEVMETHOD(sdhci_write_4, sdhci_pci_write_4), > DEVMETHOD(sdhci_write_multi_4, sdhci_pci_write_multi_4), > =20 > - {0, 0}, > + DEVMETHOD_END > }; > =20 > static driver_t sdhci_pci_driver =3D { >=20 > Modified: head/sys/dev/sound/pci/emu10kx-midi.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/sound/pci/emu10kx-midi.c Wed Jan 30 17:39:43 2013 (r2461= 27) > +++ head/sys/dev/sound/pci/emu10kx-midi.c Wed Jan 30 18:01:20 2013 (r2461= 28) > @@ -239,7 +239,7 @@ static device_method_t emu_midi_methods[ > DEVMETHOD(device_attach, emu_midi_attach), > DEVMETHOD(device_detach, emu_midi_detach), > =20 > - {0, 0}, > + DEVMETHOD_END > }; > =20 > static driver_t emu_midi_driver =3D { >=20 > Modified: head/sys/dev/sound/pci/emu10kx-pcm.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/sound/pci/emu10kx-pcm.c Wed Jan 30 17:39:43 2013 (r24612= 7) > +++ head/sys/dev/sound/pci/emu10kx-pcm.c Wed Jan 30 18:01:20 2013 (r24612= 8) > @@ -1520,7 +1520,8 @@ static device_method_t emu_pcm_methods[] > DEVMETHOD(device_probe, emu_pcm_probe), > DEVMETHOD(device_attach, emu_pcm_attach), > DEVMETHOD(device_detach, emu_pcm_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t emu_pcm_driver =3D { >=20 > Modified: head/sys/dev/sound/pci/emu10kx.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/sound/pci/emu10kx.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/sound/pci/emu10kx.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -3529,7 +3529,7 @@ static device_method_t emu_methods[] =3D { > DEVMETHOD(bus_read_ivar, emu_read_ivar), > DEVMETHOD(bus_write_ivar, emu_write_ivar), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > =20 >=20 > Modified: head/sys/dev/sound/sbus/cs4231.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/sound/sbus/cs4231.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/sound/sbus/cs4231.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -231,7 +231,8 @@ static device_method_t cs4231_sbus_metho > DEVMETHOD(device_detach, cs4231_bus_detach), > DEVMETHOD(device_suspend, cs4231_bus_suspend), > DEVMETHOD(device_resume, cs4231_bus_resume), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t cs4231_sbus_driver =3D { > @@ -249,7 +250,8 @@ static device_method_t cs4231_ebus_metho > DEVMETHOD(device_detach, cs4231_bus_detach), > DEVMETHOD(device_suspend, cs4231_bus_suspend), > DEVMETHOD(device_resume, cs4231_bus_resume), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t cs4231_ebus_driver =3D { >=20 > Modified: head/sys/dev/sound/usb/uaudio_pcm.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/sound/usb/uaudio_pcm.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/sound/usb/uaudio_pcm.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -227,7 +227,7 @@ static device_method_t ua_pcm_methods[]=20 > DEVMETHOD(device_attach, ua_attach), > DEVMETHOD(device_detach, ua_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t ua_pcm_driver =3D { >=20 > Modified: head/sys/dev/usb/controller/usb_controller.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/controller/usb_controller.c Wed Jan 30 17:39:43 2013= (r246127) > +++ head/sys/dev/usb/controller/usb_controller.c Wed Jan 30 18:01:20 2013= (r246128) > @@ -114,7 +114,8 @@ static device_method_t usb_methods[] =3D { > DEVMETHOD(device_suspend, usb_suspend), > DEVMETHOD(device_resume, usb_resume), > DEVMETHOD(device_shutdown, usb_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t usb_driver =3D { >=20 > Modified: head/sys/dev/usb/input/uhid.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/input/uhid.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/input/uhid.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -852,7 +852,8 @@ static device_method_t uhid_methods[] =3D=20 > DEVMETHOD(device_probe, uhid_probe), > DEVMETHOD(device_attach, uhid_attach), > DEVMETHOD(device_detach, uhid_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t uhid_driver =3D { >=20 > Modified: head/sys/dev/usb/input/ukbd.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/input/ukbd.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/input/ukbd.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -2120,7 +2120,8 @@ static device_method_t ukbd_methods[] =3D=20 > DEVMETHOD(device_attach, ukbd_attach), > DEVMETHOD(device_detach, ukbd_detach), > DEVMETHOD(device_resume, ukbd_resume), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t ukbd_driver =3D { >=20 > Modified: head/sys/dev/usb/input/ums.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/input/ums.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/input/ums.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -1039,7 +1039,8 @@ static device_method_t ums_methods[] =3D { > DEVMETHOD(device_probe, ums_probe), > DEVMETHOD(device_attach, ums_attach), > DEVMETHOD(device_detach, ums_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t ums_driver =3D { >=20 > Modified: head/sys/dev/usb/misc/udbp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/misc/udbp.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/misc/udbp.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -248,7 +248,8 @@ static device_method_t udbp_methods[] =3D=20 > DEVMETHOD(device_probe, udbp_probe), > DEVMETHOD(device_attach, udbp_attach), > DEVMETHOD(device_detach, udbp_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t udbp_driver =3D { >=20 > Modified: head/sys/dev/usb/misc/ufm.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/misc/ufm.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/misc/ufm.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -105,7 +105,8 @@ static device_method_t ufm_methods[] =3D { > DEVMETHOD(device_probe, ufm_probe), > DEVMETHOD(device_attach, ufm_attach), > DEVMETHOD(device_detach, ufm_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t ufm_driver =3D { >=20 > Modified: head/sys/dev/usb/net/if_cdce.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/net/if_cdce.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/net/if_cdce.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -237,7 +237,7 @@ static device_method_t cdce_methods[] =3D=20 > DEVMETHOD(device_suspend, cdce_suspend), > DEVMETHOD(device_resume, cdce_resume), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t cdce_driver =3D { >=20 > Modified: head/sys/dev/usb/net/if_cue.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/net/if_cue.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/net/if_cue.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -157,7 +157,7 @@ static device_method_t cue_methods[] =3D { > DEVMETHOD(device_attach, cue_attach), > DEVMETHOD(device_detach, cue_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t cue_driver =3D { >=20 > Modified: head/sys/dev/usb/net/if_ipheth.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/net/if_ipheth.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/net/if_ipheth.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -116,7 +116,7 @@ static device_method_t ipheth_methods[]=20 > DEVMETHOD(device_attach, ipheth_attach), > DEVMETHOD(device_detach, ipheth_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t ipheth_driver =3D { >=20 > Modified: head/sys/dev/usb/net/if_kue.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/net/if_kue.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/net/if_kue.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -199,7 +199,7 @@ static device_method_t kue_methods[] =3D { > DEVMETHOD(device_attach, kue_attach), > DEVMETHOD(device_detach, kue_detach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t kue_driver =3D { >=20 > Modified: head/sys/dev/usb/net/if_smsc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/net/if_smsc.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/net/if_smsc.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -1810,7 +1810,7 @@ static device_method_t smsc_methods[] =3D=20 > DEVMETHOD(miibus_writereg, smsc_miibus_writereg), > DEVMETHOD(miibus_statchg, smsc_miibus_statchg), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t smsc_driver =3D { >=20 > Modified: head/sys/dev/usb/storage/umass.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/storage/umass.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/storage/umass.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -698,7 +698,8 @@ static device_method_t umass_methods[] =3D > DEVMETHOD(device_probe, umass_probe), > DEVMETHOD(device_attach, umass_attach), > DEVMETHOD(device_detach, umass_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t umass_driver =3D { >=20 > Modified: head/sys/dev/usb/storage/urio.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/storage/urio.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/storage/urio.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -185,7 +185,8 @@ static device_method_t urio_methods[] =3D=20 > DEVMETHOD(device_probe, urio_probe), > DEVMETHOD(device_attach, urio_attach), > DEVMETHOD(device_detach, urio_detach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t urio_driver =3D { >=20 > Modified: head/sys/dev/usb/storage/ustorage_fs.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/storage/ustorage_fs.c Wed Jan 30 17:39:43 2013 (r246= 127) > +++ head/sys/dev/usb/storage/ustorage_fs.c Wed Jan 30 18:01:20 2013 (r246= 128) > @@ -256,7 +256,7 @@ static device_method_t ustorage_fs_metho > DEVMETHOD(device_suspend, ustorage_fs_suspend), > DEVMETHOD(device_resume, ustorage_fs_resume), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t ustorage_fs_driver =3D { >=20 > Modified: head/sys/dev/usb/usb_compat_linux.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/usb_compat_linux.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/usb/usb_compat_linux.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -113,7 +113,7 @@ static device_method_t usb_linux_methods > DEVMETHOD(device_suspend, usb_linux_suspend), > DEVMETHOD(device_resume, usb_linux_resume), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t usb_linux_driver =3D { >=20 > Modified: head/sys/dev/vx/if_vx_eisa.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/vx/if_vx_eisa.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/vx/if_vx_eisa.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -177,7 +177,7 @@ static device_method_t vx_eisa_methods[] > DEVMETHOD(device_probe, vx_eisa_probe), > DEVMETHOD(device_attach, vx_eisa_attach), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t vx_eisa_driver =3D { >=20 > Modified: head/sys/dev/vx/if_vx_pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/vx/if_vx_pci.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/vx/if_vx_pci.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -61,7 +61,7 @@ static device_method_t vx_methods[] =3D { > DEVMETHOD(device_attach, vx_pci_attach), > DEVMETHOD(device_shutdown, vx_pci_shutdown), > =20 > - {0, 0} > + DEVMETHOD_END > }; > =20 > static driver_t vx_driver =3D { >=20 > Modified: head/sys/dev/vxge/vxge.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/vxge/vxge.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/vxge/vxge.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -4188,7 +4188,8 @@ static device_method_t vxge_methods[] =3D=20 > DEVMETHOD(device_attach, vxge_attach), > DEVMETHOD(device_detach, vxge_detach), > DEVMETHOD(device_shutdown, vxge_shutdown), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t vxge_driver =3D { >=20 > Modified: head/sys/dev/xen/console/console.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/xen/console/console.c Wed Jan 30 17:39:43 2013 (r246127) > +++ head/sys/dev/xen/console/console.c Wed Jan 30 18:01:20 2013 (r246128) > @@ -410,7 +410,8 @@ static device_method_t xc_methods[] =3D { > DEVMETHOD(device_identify, xc_identify), > DEVMETHOD(device_probe, xc_probe), > DEVMETHOD(device_attach, xc_attach), > - {0, 0} > + > + DEVMETHOD_END > }; > =20 > static driver_t xc_driver =3D { > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" Hi, This patch is to replace all the sentinel hardcoded using {0, 0} by the pro= per definition of the macro DEVMETHOD_END located in the include in= all drivers code in sys/dev path of the FreeBSD head source. I catch all the same pattern using command line below: $ ack -ri '{0, 0}' --type-set cc=3D.c,.h /usr/src/sys/dev I also rebuild the kernel before to commit it using the command line below: $ sudo make buildkernel KERNCONF=3DGENERIC and everything seems fine regarding the log [1] on amd64 platform. Regards [1] http://people.freebsd.org/~sbz/devmethod_end.log -- Sofian Brabez --yrj/dFKFPuw6o+aM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlEJYO8ACgkQc2NR9CSH5X4jHgCgk8IayU6iUZ7I2VXaMudYHBu1 rkgAoKOVrKIjtSq2lXLaC898KWfiEALq =L0Pp -----END PGP SIGNATURE----- --yrj/dFKFPuw6o+aM-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 18:24:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C0ACCC3; Wed, 30 Jan 2013 18:24:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16E2BD8A; Wed, 30 Jan 2013 18:24:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UIOTq5039635; Wed, 30 Jan 2013 18:24:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UIOTED039633; Wed, 30 Jan 2013 18:24:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301301824.r0UIOTED039633@svn.freebsd.org> From: John Baldwin Date: Wed, 30 Jan 2013 18:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246129 - head/usr.sbin/tcpdrop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 18:24:30 -0000 Author: jhb Date: Wed Jan 30 18:24:29 2013 New Revision: 246129 URL: http://svnweb.freebsd.org/changeset/base/246129 Log: Allow the address and ports to be separated by a colon or period rather than a space to permit directly pasting the output of commands such as netstat and sockstat on the command line. Reviewed by: net MFC after: 1 week Modified: head/usr.sbin/tcpdrop/tcpdrop.8 head/usr.sbin/tcpdrop/tcpdrop.c Modified: head/usr.sbin/tcpdrop/tcpdrop.8 ============================================================================== --- head/usr.sbin/tcpdrop/tcpdrop.8 Wed Jan 30 18:01:20 2013 (r246128) +++ head/usr.sbin/tcpdrop/tcpdrop.8 Wed Jan 30 18:24:29 2013 (r246129) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2009 +.Dd January 30, 2013 .Dt TCPDROP 8 .Os .Sh NAME @@ -62,6 +62,9 @@ will be dropped. .Pp Addresses and ports may be specified by name or numeric value. Both IPv4 and IPv6 address formats are supported. +.Pp +The addresses and ports may be separated by periods or colons +instead of spaces. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES Modified: head/usr.sbin/tcpdrop/tcpdrop.c ============================================================================== --- head/usr.sbin/tcpdrop/tcpdrop.c Wed Jan 30 18:01:20 2013 (r246128) +++ head/usr.sbin/tcpdrop/tcpdrop.c Wed Jan 30 18:24:29 2013 (r246129) @@ -50,6 +50,7 @@ struct host_service { static bool tcpdrop_list_commands = false; +static char *findport(const char *); static struct xinpgen *getxpcblist(const char *); static void sockinfo(const struct sockaddr *, struct host_service *); static bool tcpdrop(const struct sockaddr *, const struct sockaddr *); @@ -65,6 +66,7 @@ static void usage(void); int main(int argc, char *argv[]) { + char *lport, *fport; bool dropall; int ch; @@ -93,15 +95,43 @@ main(int argc, char *argv[]) exit(0); } - if (argc != 4 || tcpdrop_list_commands) + if ((argc != 2 && argc != 4) || tcpdrop_list_commands) usage(); - if (!tcpdropbyname(argv[0], argv[1], argv[2], argv[3])) + if (argc == 2) { + lport = findport(argv[0]); + fport = findport(argv[1]); + if (lport == NULL || lport[1] == '\0' || fport == NULL || + fport[1] == '\0') + usage(); + *lport++ = '\0'; + *fport++ = '\0'; + if (!tcpdropbyname(argv[0], lport, argv[1], fport)) + exit(1); + } else if (!tcpdropbyname(argv[0], argv[1], argv[2], argv[3])) exit(1); exit(0); } +static char * +findport(const char *arg) +{ + char *dot, *colon; + + /* A strrspn() or strrpbrk() would be nice. */ + dot = strrchr(arg, '.'); + colon = strrchr(arg, ':'); + if (dot == NULL) + return (colon); + if (colon == NULL) + return (dot); + if (dot < colon) + return (colon); + else + return (dot); +} + static struct xinpgen * getxpcblist(const char *name) { @@ -237,7 +267,7 @@ tcpdropbyname(const char *lhost, const c error = getaddrinfo(fhost, fport, &hints, &foreign); if (error != 0) { freeaddrinfo(local); /* XXX gratuitous */ - errx(1, "getaddrinfo: %s port %s: %s", lhost, lport, + errx(1, "getaddrinfo: %s port %s: %s", fhost, fport, gai_strerror(error)); } @@ -318,6 +348,8 @@ usage(void) { fprintf(stderr, "usage: tcpdrop local-address local-port foreign-address foreign-port\n" +" tcpdrop local-address:local-port foreign-address:foreign-port\n" +" tcpdrop local-address.local-port foreign-address.foreign-port\n" " tcpdrop [-l] -a\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 18:40:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B09DA41C; Wed, 30 Jan 2013 18:40:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A36CDE38; Wed, 30 Jan 2013 18:40:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UIeJl9043561; Wed, 30 Jan 2013 18:40:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UIeJnW043560; Wed, 30 Jan 2013 18:40:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201301301840.r0UIeJnW043560@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 30 Jan 2013 18:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246130 - head/sys/netinet/libalias X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 18:40:19 -0000 Author: glebius Date: Wed Jan 30 18:40:19 2013 New Revision: 246130 URL: http://svnweb.freebsd.org/changeset/base/246130 Log: Utilize m_get2() to get mbuf of appropriate size. Modified: head/sys/netinet/libalias/alias.c Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Wed Jan 30 18:24:29 2013 (r246129) +++ head/sys/netinet/libalias/alias.c Wed Jan 30 18:40:19 2013 (r246130) @@ -1760,21 +1760,7 @@ m_megapullup(struct mbuf *m, int len) { if (m->m_next == NULL && M_WRITABLE(m) && M_TRAILINGSPACE(m) >= RESERVE) return (m); - if (len <= MCLBYTES - RESERVE) { - mcl = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); - } else if (len < MJUM16BYTES) { - int size; - if (len <= MJUMPAGESIZE - RESERVE) { - size = MJUMPAGESIZE; - } else if (len <= MJUM9BYTES - RESERVE) { - size = MJUM9BYTES; - } else { - size = MJUM16BYTES; - }; - mcl = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); - } else { - goto bad; - } + mcl = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, len + RESERVE); if (mcl == NULL) goto bad; From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 19:29:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 77776DD6 for ; Wed, 30 Jan 2013 19:29:22 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx1.freebsd.org (Postfix) with ESMTP id EF2D1C for ; Wed, 30 Jan 2013 19:29:21 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id q12so2497415lbc.39 for ; Wed, 30 Jan 2013 11:29:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received: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=IDlEhppQdBcqpH7IttWsgpY5jOZDXt6eiNLXMC8U2qM=; b=Dtpzq721D12VtuKDAIw9KDzBGL9SS7rrrYyuQPpGM4Sz+q5Zqq7E2p0vmX1hAXTd76 EnpkXU1zj+RDOgdTPcS8W3MQesc8734Or8spe9cnVuGXm1Lh2vMOeDWR6S2dcWmYh3mz ZGNg59MacmBK3SU4roJP2RzUE/ZyRE7YPd8JBbTrir/Bb6auw3wgv+ocOo7M2lvJdPVW bpYwz68D7BQJnRqC4BQIJMN4y72JssH95WOLauflbBSrQr7oLI4lHn8tESeQK4SykiZs CAhQzGYyLn5w2Ud8aua9YIVyOGTeSQXdOX6+F7cV4I2lObfkOL45tH8u6vkzXmqpIZdt 3tlw== X-Received: by 10.112.30.104 with SMTP id r8mr2398733lbh.82.1359574155169; Wed, 30 Jan 2013 11:29:15 -0800 (PST) Received: from zont-osx.local (ppp95-165-134-17.pppoe.spdop.ru. [95.165.134.17]) by mx.google.com with ESMTPS id pz15sm1259349lab.3.2013.01.30.11.29.12 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jan 2013 11:29:13 -0800 (PST) Sender: Andrey Zonov Message-ID: <51097485.9070904@FreeBSD.org> Date: Wed, 30 Jan 2013 23:29:09 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r246129 - head/usr.sbin/tcpdrop References: <201301301824.r0UIOTED039633@svn.freebsd.org> In-Reply-To: <201301301824.r0UIOTED039633@svn.freebsd.org> X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2KQITNRSCWASTJLPNJLDT" X-Gm-Message-State: ALoCoQkEiRYGm7YEwkSp3jUpao6YMLJmFpuPMttjqr0dHs2/hvPtLQO5F3pklWpwS4b4+YU+k/Hc Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 19:29:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2KQITNRSCWASTJLPNJLDT Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 1/30/13 10:24 PM, John Baldwin wrote: > Author: jhb > Date: Wed Jan 30 18:24:29 2013 > New Revision: 246129 > URL: http://svnweb.freebsd.org/changeset/base/246129 >=20 > Log: > Allow the address and ports to be separated by a colon or period rath= er > than a space to permit directly pasting the output of commands such a= s > netstat and sockstat on the command line. > =20 We already have 'tcpdrop -la | grep $port | sh'. Why don't you like it? --=20 Andrey Zonov ------enig2KQITNRSCWASTJLPNJLDT 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 iQEcBAEBAgAGBQJRCXSHAAoJEBWLemxX/CvTrqoH/2HtqkSVSFBNBOLlJRp4GEt6 Lo8coHROIZn90h/+NKVHVTDBKapOXT21O++/Sm3wdsD2HF7Vn/d2r+Pr+OLOtp5y wB0SjkFLiyEVBH631vB0NBeYv6qSc/VaaIURlzTxNfaXSLYKLxnJS+/IIljlwh8C klRKz2mK5r5w3ydAIX6TSkQm0hIizKV4tIOpqTFMh2VhlCyjN7xtxpBrkZSv7NdU ln+HOyhVdLrVKKpHPuXqQ2uTrlUrNbmUemwmgOaMlETautE08pgoHVRTX8UDk/dp DKinGHCwDfN7LN/3mEJMV90IOX9GEh8cLmHgT+QwKG1x/wMjtfYSerALwttWc98= =eRzM -----END PGP SIGNATURE----- ------enig2KQITNRSCWASTJLPNJLDT-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 19:51:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BC1FE91A; Wed, 30 Jan 2013 19:51:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 97525192; Wed, 30 Jan 2013 19:51:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UJpGoG067184; Wed, 30 Jan 2013 19:51:16 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UJpGNx067183; Wed, 30 Jan 2013 19:51:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201301301951.r0UJpGNx067183@svn.freebsd.org> From: Dimitry Andric Date: Wed, 30 Jan 2013 19:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246131 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 19:51:16 -0000 Author: dim Date: Wed Jan 30 19:51:16 2013 New Revision: 246131 URL: http://svnweb.freebsd.org/changeset/base/246131 Log: Fix a problem introduced in r231057: in bsd.own.mk, move the test for whether clang is enabled to just after the last place where it could have been forced to "no". MFC after: 3 days Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Jan 30 18:40:19 2013 (r246130) +++ head/share/mk/bsd.own.mk Wed Jan 30 19:51:16 2013 (r246131) @@ -481,10 +481,6 @@ MK_ZFS:= no MK_CTF:= no .endif -.if ${MK_CLANG} == "no" -MK_CLANG_EXTRAS:= no -.endif - .if ${MK_CRYPT} == "no" MK_OPENSSL:= no MK_OPENSSH:= no @@ -527,6 +523,7 @@ MK_GDB:= no .endif .if ${MK_CLANG} == "no" +MK_CLANG_EXTRAS:= no MK_CLANG_IS_CC:= no .endif From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 20:03:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E7810E10; Wed, 30 Jan 2013 20:03:45 +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 B848B21A; Wed, 30 Jan 2013 20:03:45 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 311D9B985; Wed, 30 Jan 2013 15:03:45 -0500 (EST) From: John Baldwin To: Andrey Zonov Subject: Re: svn commit: r246129 - head/usr.sbin/tcpdrop Date: Wed, 30 Jan 2013 15:02:59 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301301824.r0UIOTED039633@svn.freebsd.org> <51097485.9070904@FreeBSD.org> In-Reply-To: <51097485.9070904@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201301301502.59264.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 30 Jan 2013 15:03:45 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 20:03:46 -0000 On Wednesday, January 30, 2013 2:29:09 pm Andrey Zonov wrote: > On 1/30/13 10:24 PM, John Baldwin wrote: > > Author: jhb > > Date: Wed Jan 30 18:24:29 2013 > > New Revision: 246129 > > URL: http://svnweb.freebsd.org/changeset/base/246129 > > > > Log: > > Allow the address and ports to be separated by a colon or period rather > > than a space to permit directly pasting the output of commands such as > > netstat and sockstat on the command line. > > > > We already have 'tcpdrop -la | grep $port | sh'. Why don't you like it? Because that isn't my workflow. My workflow is to stare at a long output of netstat -np tcp output (or some such) and find a broken connection based on examining some other stats, then cut and paste that connection info onto a tcpdrop command line. That is, I start by finding a broken connection and then want to just invoke tcpdrop directly. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 23:37:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C50B03AD; Wed, 30 Jan 2013 23:37:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E06CD4A; Wed, 30 Jan 2013 23:37:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UNbako035087; Wed, 30 Jan 2013 23:37:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UNbac6035085; Wed, 30 Jan 2013 23:37:36 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301302337.r0UNbac6035085@svn.freebsd.org> From: Ian Lepore Date: Wed, 30 Jan 2013 23:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246134 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 23:37:36 -0000 Author: ian Date: Wed Jan 30 23:37:35 2013 New Revision: 246134 URL: http://svnweb.freebsd.org/changeset/base/246134 Log: Improve devd startup time, by tweaking some string handling routines that are heavily used when parsing config files. Mostly these changes avoid making temporary copies of the strings, and avoid doing byte at a time append operations, on the most-used code path. On a 1.2 GHz ARM processor this reduces the time to parse the config files from 13 to 6 seconds. Reviewed by: imp Approved by: cognet (mentor) Modified: head/sbin/devd/devd.cc head/sbin/devd/devd.hh Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Wed Jan 30 23:20:28 2013 (r246133) +++ head/sbin/devd/devd.cc Wed Jan 30 23:37:35 2013 (r246134) @@ -137,7 +137,7 @@ config cfg; event_proc::event_proc() : _prio(-1) { - // nothing + _epsvec.reserve(4); } event_proc::~event_proc() @@ -241,25 +241,18 @@ my_system(const char *command) bool action::do_action(config &c) { - string s = c.expand_string(_cmd); + string s = c.expand_string(_cmd.c_str()); if (Dflag) fprintf(stderr, "Executing '%s'\n", s.c_str()); my_system(s.c_str()); return (true); } -match::match(config &c, const char *var, const char *re) - : _var(var), _re("^") +match::match(config &c, const char *var, const char *re) : + _inv(re[0] == '!'), + _var(var), + _re(c.expand_string(_inv ? re + 1 : re, "^", "$")) { - if (!c.expand_string(string(re)).empty() && - c.expand_string(string(re)).at(0) == '!') { - _re.append(c.expand_string(string(re)).substr(1)); - _inv = 1; - } else { - _re.append(c.expand_string(string(re))); - _inv = 0; - } - _re.append("$"); regcomp(&_regex, _re.c_str(), REG_EXTENDED | REG_NOSUB | REG_ICASE); } @@ -624,24 +617,37 @@ config::expand_one(const char *&src, str do { buffer.append(src++, 1); } while (is_id_char(*src)); - buffer.append("", 1); dst.append(get_variable(buffer.c_str())); } const string -config::expand_string(const string &s) +config::expand_string(const char *src, const char *prepend, const char *append) { - const char *src; + const char *var_at; string dst; - src = s.c_str(); - while (*src) { - if (*src == '$') - expand_one(src, dst); - else - dst.append(src++, 1); + /* + * 128 bytes is enough for 2427 of 2438 expansions that happen + * while parsing config files, as tested on 2013-01-30. + */ + dst.reserve(128); + + if (prepend != NULL) + dst = prepend; + + for (;;) { + var_at = strchr(src, '$'); + if (var_at == NULL) { + dst.append(src); + break; + } + dst.append(src, var_at - src); + src = var_at; + expand_one(src, dst); } - dst.append("", 1); + + if (append != NULL) + dst.append(append); return (dst); } Modified: head/sbin/devd/devd.hh ============================================================================== --- head/sbin/devd/devd.hh Wed Jan 30 23:20:28 2013 (r246133) +++ head/sbin/devd/devd.hh Wed Jan 30 23:37:35 2013 (r246134) @@ -90,9 +90,9 @@ public: virtual bool do_match(config &); virtual bool do_action(config &) { return true; } private: + bool _inv; std::string _var; std::string _re; - bool _inv; regex_t _regex; }; @@ -162,7 +162,8 @@ public: void pop_var_table(); void set_variable(const char *var, const char *val); const std::string &get_variable(const std::string &var); - const std::string expand_string(const std::string &var); + const std::string expand_string(const char * var, + const char * prepend = NULL, const char * append = NULL); char *set_vars(char *); void find_and_execute(char); protected: From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 23:49:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 14CAB7EC; Wed, 30 Jan 2013 23:49:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF5AADB9; Wed, 30 Jan 2013 23:49:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UNnaGn038259; Wed, 30 Jan 2013 23:49:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UNnam9038258; Wed, 30 Jan 2013 23:49:36 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201301302349.r0UNnam9038258@svn.freebsd.org> From: Ian Lepore Date: Wed, 30 Jan 2013 23:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246135 - head/sys/boot/uboot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 23:49:37 -0000 Author: ian Date: Wed Jan 30 23:49:36 2013 New Revision: 246135 URL: http://svnweb.freebsd.org/changeset/base/246135 Log: Do metadata relocation fixup on all loaded modules, not just the kernel. Approved by: cognet (mentor) Modified: head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Wed Jan 30 23:37:35 2013 (r246134) +++ head/sys/boot/uboot/common/metadata.c Wed Jan 30 23:49:36 2013 (r246135) @@ -369,12 +369,15 @@ md_load(char *args, vm_offset_t *modulep /* Convert addresses to the final VA */ *modulep -= __elfN(relocation_offset); - for (i = 0; i < sizeof mdt / sizeof mdt[0]; i++) { - md = file_findmetadata(kfp, mdt[i]); - if (md) { - bcopy(md->md_data, &vaddr, sizeof vaddr); - vaddr -= __elfN(relocation_offset); - bcopy(&vaddr, md->md_data, sizeof vaddr); + /* Do relocation fixup on metadata of each module. */ + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + for (i = 0; i < sizeof mdt / sizeof mdt[0]; i++) { + md = file_findmetadata(xp, mdt[i]); + if (md) { + bcopy(md->md_data, &vaddr, sizeof vaddr); + vaddr -= __elfN(relocation_offset); + bcopy(&vaddr, md->md_data, sizeof vaddr); + } } } From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 23:54:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2415B992; Wed, 30 Jan 2013 23:54:35 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 99582DDA; Wed, 30 Jan 2013 23:54:34 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id EA86F3592E6; Thu, 31 Jan 2013 00:54:32 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id C788D2848C; Thu, 31 Jan 2013 00:54:32 +0100 (CET) Date: Thu, 31 Jan 2013 00:54:32 +0100 From: Jilles Tjoelker To: Pietro Cerutti Subject: Re: svn commit: r246120 - in head: include lib/libc/stdio tools/regression/lib/libc/stdio Message-ID: <20130130235432.GA24750@stack.nl> References: <201301301459.r0UExQKw074249@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201301301459.r0UExQKw074249@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 23:54:35 -0000 On Wed, Jan 30, 2013 at 02:59:26PM +0000, Pietro Cerutti wrote: > Author: gahr (ports committer) > Date: Wed Jan 30 14:59:26 2013 > New Revision: 246120 > URL: http://svnweb.freebsd.org/changeset/base/246120 > Log: > Add fmemopen(3), an interface to get a FILE * from a buffer in memory, along > with the respective regression test. > See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html Various comments are inline. > Added: > head/lib/libc/stdio/fmemopen.c (contents, props changed) > head/tools/regression/lib/libc/stdio/test-fmemopen.c (contents, props changed) > head/tools/regression/lib/libc/stdio/test-fmemopen.t (contents, props changed) > Modified: > head/include/stdio.h (contents, props changed) > head/lib/libc/stdio/Makefile.inc (contents, props changed) > head/lib/libc/stdio/Symbol.map (contents, props changed) > head/lib/libc/stdio/fopen.3 (contents, props changed) > Modified: head/lib/libc/stdio/Makefile.inc > ============================================================================== > --- head/lib/libc/stdio/Makefile.inc Wed Jan 30 13:14:34 2013 (r246119) > +++ head/lib/libc/stdio/Makefile.inc Wed Jan 30 14:59:26 2013 (r246120) > @@ -8,7 +8,8 @@ SRCS+= _flock_stub.c asprintf.c clrerr.c > fclose.c fcloseall.c fdopen.c \ > feof.c ferror.c fflush.c fgetc.c fgetln.c fgetpos.c fgets.c fgetwc.c \ > fgetwln.c fgetws.c \ > - fileno.c findfp.c flags.c fopen.c fprintf.c fpurge.c fputc.c fputs.c \ > + fileno.c findfp.c flags.c fmemopen.c fopen.c fprintf.c fpurge.c \ > + fputc.c fputs.c \ > fputwc.c fputws.c fread.c freopen.c fscanf.c fseek.c fsetpos.c \ > ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \ > fwrite.c getc.c getchar.c getdelim.c getline.c \ > @@ -48,7 +49,7 @@ MLINKS+=ferror.3 ferror_unlocked.3 \ > MLINKS+=fflush.3 fpurge.3 > MLINKS+=fgets.3 gets.3 > MLINKS+=flockfile.3 ftrylockfile.3 flockfile.3 funlockfile.3 > -MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 > +MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 fopen.3 fmemopen.3 > MLINKS+=fputs.3 puts.3 > MLINKS+=fread.3 fwrite.3 > MLINKS+=fseek.3 fgetpos.3 fseek.3 fseeko.3 fseek.3 fsetpos.3 fseek.3 ftell.3 \ I think the man page could be a separate page without problem. There is a fair amount of behaviour unique to fmemopen(). > Added: head/lib/libc/stdio/fmemopen.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libc/stdio/fmemopen.c Wed Jan 30 14:59:26 2013 (r246120) > @@ -0,0 +1,182 @@ > +/*- > +Copyright (C) 2013 Pietro Cerutti > + > +Redistribution and use in source and binary forms, with or without > +modification, are permitted provided that the following conditions > +are met: > +1. Redistributions of source code must retain the above copyright > + notice, this list of conditions and the following disclaimer. > +2. Redistributions in binary form must reproduce the above copyright > + notice, this list of conditions and the following disclaimer in the > + documentation and/or other materials provided with the distribution. > + > +THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND > +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE > +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +SUCH DAMAGE. > +*/ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > + > +struct __fmemopen_cookie I think the underscores are not necessary if the name cannot collide with a user's name. > +{ > + char *buf; /* pointer to the memory region */ > + char own; /* did we allocate the buffer ourselves? */ > + long len; /* buffer length in bytes */ This is in fact a size_t, as passed to fmemopen(). > + long off; /* current offset into the buffer */ This should probably be a size_t as well. > +}; > + > +static int fmemopen_read (void *cookie, char *buf, int nbytes); > +static int fmemopen_write (void *cookie, const char *buf, int nbytes); > +static fpos_t fmemopen_seek (void *cookie, fpos_t offset, int whence); > +static int fmemopen_close (void *cookie); > + > +FILE * > +fmemopen (void * __restrict buf, size_t size, const char * __restrict mode) > +{ > + /* allocate cookie */ > + struct __fmemopen_cookie *ck = malloc (sizeof (struct __fmemopen_cookie)); > + if (ck == NULL) { > + errno = ENOMEM; malloc() already sets errno when it fails; you need not do it yourself. > + return (NULL); > + } > + > + ck->off = 0; > + ck->len = size; > + > + /* do we have to allocate the buffer ourselves? */ > + ck->own = ((ck->buf = buf) == NULL); > + if (ck->own) { > + ck->buf = malloc (size); > + if (ck->buf == NULL) { > + free (ck); > + errno = ENOMEM; > + return (NULL); > + } > + ck->buf[0] = '\0'; > + } > + > + if (mode[0] == 'a') > + ck->off = strnlen(ck->buf, ck->len); This is the only use of 'mode'. POSIX mentions a difference between 'r' and 'w' with regard to another piece of internal state: the notion of the size of the current buffer contents, which seems completely missing here. There was an interpretation issued about that as well, http://austingroupbugs.net/view.php?id=587 . glibc does something different when the mode specifies binary ('b') and POSIX will likely require this in future versions, see http://austingroupbugs.net/view.php?id=456 . It is probably best to fail with [EINVAL] if this special behaviour is not implemented so that people are not surprised. > + > + /* actuall wrapper */ > + FILE *f = funopen ((void *)ck, fmemopen_read, fmemopen_write, > + fmemopen_seek, fmemopen_close); The read and write functions should be passed as NULL instead when the mode does not permit reading or writing respectively. > + > + if (f == NULL) { > + if (ck->own) > + free (ck->buf); > + free (ck); > + return (NULL); > + } > + > + /* turn off buffering, so a write past the end of the buffer > + * correctly returns a short object count */ > + setvbuf (f, (char *) NULL, _IONBF, 0); This is indeed required but I think it makes the stream rather slow (because it will call fmemopen_read/fmemopen_write for single bytes). If this is a problem, I think it should be fixed by making unbuffered mode smarter in the rest of stdio and not here. > + > + return (f); > +} > + > +static int > +fmemopen_read (void *cookie, char *buf, int nbytes) stdio is strange, requiring 'int' here :( > +{ > + struct __fmemopen_cookie *ck = cookie; > + > + if (nbytes > ck->len - ck->off) > + nbytes = ck->len - ck->off; > + > + if (nbytes == 0) > + return (0); > + > + memcpy (buf, ck->buf + ck->off, nbytes); > + > + ck->off += nbytes; > + > + return (nbytes); > +} > [snip] > Modified: head/lib/libc/stdio/fopen.3 > ============================================================================== > --- head/lib/libc/stdio/fopen.3 Wed Jan 30 13:14:34 2013 (r246119) > +++ head/lib/libc/stdio/fopen.3 Wed Jan 30 14:59:26 2013 (r246120) > @@ -32,13 +32,14 @@ > [snip] > @@ -202,6 +205,29 @@ standard text stream > .Dv ( stderr , stdin , > or > .Dv stdout ) . > +.Pp > +The > +.Fn fmemopen > +function > +associates the buffer given by the > +.Fa buf > +and > +.Fa size > +arguments with a stream. > +The > +.Fa buf > +argument shall be either a null pointer or point to a buffer that > +is at least > +.Fa size > +bytes long. > +If a null pointer is specified as the > +.Fa buf > +argument, > +.Fn fmemopen > +shall allocate We don't usually use 'shall' for requirements on the implementation in man pages. We made it such that it is compliant; thus, it is, not shall be. > [snip] > @@ -294,3 +322,8 @@ The > .Dq Li e > mode option does not conform to any standard > but is also supported by glibc. > +The > +.Fn fmemopen > +function > +conforms to > +.St -p1003.1-2008 . Quite a bit of functionality is missing. > Added: head/tools/regression/lib/libc/stdio/test-fmemopen.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/regression/lib/libc/stdio/test-fmemopen.c Wed Jan 30 14:59:26 2013 (r246120) > @@ -0,0 +1,143 @@ > +/*- > +Copyright (C) 2013 Pietro Cerutti > + > +Redistribution and use in source and binary forms, with or without > +modification, are permitted provided that the following conditions > +are met: > +1. Redistributions of source code must retain the above copyright > + notice, this list of conditions and the following disclaimer. > +2. Redistributions in binary form must reproduce the above copyright > + notice, this list of conditions and the following disclaimer in the > + documentation and/or other materials provided with the distribution. > + > +THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND > +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE > +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +SUCH DAMAGE. > +*/ > + > +/* > + * Test basic FILE * functions (fread, fwrite, fseek, fclose) against > + * a FILE * retrieved using fmemopen() > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > + > [snip] > +void > +test_autoalloc () > +{ > + /* > + * let fmemopen allocate the buffer > + */ > + > + char str[] = "A quick test"; > + FILE *fp; > + long pos; > + size_t nofw, nofr, i; > + int rc; > + > + /* open a FILE * using fmemopen */ > + fp = fmemopen (NULL, 512, "w"); This does not make sense in a real program: there is no way to read the data back. POSIX permits fmemopen(NULL, ...) to fail when the mode is read-only or write-only. > + assert (fp != NULL); > + > + /* fill the buffer */ > + for (i = 0; i < 512; i++) { > + nofw = fwrite ("a", 1, 1, fp); > + assert (nofw == 1); > + } > + > + /* get the current position into the stream */ > + pos = ftell (fp); > + assert (pos == 512); > + > + /* try to write past the end, we should get a short object count (0) */ > + nofw = fwrite ("a", 1, 1, fp); > + assert (nofw == 0); > + > + /* close the FILE * */ > + rc = fclose (fp); > + assert (rc == 0); > +} > [snip] -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 00:02:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 74834EBE; Thu, 31 Jan 2013 00:02:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5BBC9E24; Thu, 31 Jan 2013 00:02:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0V02bTC043388; Thu, 31 Jan 2013 00:02:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0V02aki043380; Thu, 31 Jan 2013 00:02:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301310002.r0V02aki043380@svn.freebsd.org> From: Marius Strobl Date: Thu, 31 Jan 2013 00:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246139 - head/libexec/tftpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 00:02:37 -0000 Author: marius Date: Thu Jan 31 00:02:36 2013 New Revision: 246139 URL: http://svnweb.freebsd.org/changeset/base/246139 Log: Mark tftp_log() as __printflike() (which would have caught the bug fixed in r246106) and deal with the fallout. MFC after: 2 weeks Modified: head/libexec/tftpd/tftp-io.c head/libexec/tftpd/tftp-options.c head/libexec/tftpd/tftp-utils.h head/libexec/tftpd/tftpd.c Modified: head/libexec/tftpd/tftp-io.c ============================================================================== --- head/libexec/tftpd/tftp-io.c Wed Jan 30 23:59:27 2013 (r246138) +++ head/libexec/tftpd/tftp-io.c Thu Jan 31 00:02:36 2013 (r246139) @@ -106,13 +106,13 @@ send_packet(int peer, uint16_t block, ch for (i = 0; i < 12 ; i++) { DROPPACKETn("send_packet", 0); - if (sendto(peer, pkt, size, 0, - (struct sockaddr *)&peer_sock, peer_sock.ss_len) - == size) { + if (sendto(peer, pkt, size, 0, (struct sockaddr *)&peer_sock, + peer_sock.ss_len) == size) { if (i) tftp_log(LOG_ERR, "%s block %d, attempt %d successful", - block, i); + packettype(ntohs(((struct tftphdr *) + (pkt))->th_opcode)), block, i); return (0); } tftp_log(LOG_ERR, Modified: head/libexec/tftpd/tftp-options.c ============================================================================== --- head/libexec/tftpd/tftp-options.c Wed Jan 30 23:59:27 2013 (r246138) +++ head/libexec/tftpd/tftp-options.c Thu Jan 31 00:02:36 2013 (r246139) @@ -99,16 +99,17 @@ option_tsize(int peer __unused, struct t int option_timeout(int peer) { + int to; if (options[OPT_TIMEOUT].o_request == NULL) return (0); - int to = atoi(options[OPT_TIMEOUT].o_request); + to = atoi(options[OPT_TIMEOUT].o_request); if (to < TIMEOUT_MIN || to > TIMEOUT_MAX) { tftp_log(acting_as_client ? LOG_ERR : LOG_WARNING, "Received bad value for timeout. " - "Should be between %d and %d, received %s", - TIMEOUT_MIN, TIMEOUT_MAX); + "Should be between %d and %d, received %d", + TIMEOUT_MIN, TIMEOUT_MAX, to); send_error(peer, EBADOP); if (acting_as_client) return (1); @@ -195,14 +196,14 @@ option_blksize(int peer) tftp_log(LOG_ERR, "Invalid blocksize (%d bytes), " "net.inet.udp.maxdgram sysctl limits it to " - "%d bytes.\n", size, maxdgram); + "%ld bytes.\n", size, maxdgram); send_error(peer, EBADOP); return (1); } else { tftp_log(LOG_WARNING, "Invalid blocksize (%d bytes), " "net.inet.udp.maxdgram sysctl limits it to " - "%d bytes.\n", size, maxdgram); + "%ld bytes.\n", size, maxdgram); size = maxdgram; /* No reason to return */ } @@ -257,7 +258,7 @@ option_blksize2(int peer __unused) } tftp_log(LOG_INFO, "Invalid blocksize2 (%d bytes), net.inet.udp.maxdgram " - "sysctl limits it to %d bytes.\n", size, maxdgram); + "sysctl limits it to %ld bytes.\n", size, maxdgram); size = sizes[i]; /* No need to return */ } Modified: head/libexec/tftpd/tftp-utils.h ============================================================================== --- head/libexec/tftpd/tftp-utils.h Wed Jan 30 23:59:27 2013 (r246138) +++ head/libexec/tftpd/tftp-utils.h Thu Jan 31 00:02:36 2013 (r246139) @@ -106,7 +106,7 @@ const char *debug_show(int d); extern int tftp_logtostdout; void tftp_openlog(const char *ident, int logopt, int facility); void tftp_closelog(void); -void tftp_log(int priority, const char *message, ...); +void tftp_log(int priority, const char *message, ...) __printflike(2, 3); /* * Performance figures Modified: head/libexec/tftpd/tftpd.c ============================================================================== --- head/libexec/tftpd/tftpd.c Wed Jan 30 23:59:27 2013 (r246138) +++ head/libexec/tftpd/tftpd.c Thu Jan 31 00:02:36 2013 (r246139) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -799,8 +800,8 @@ tftp_xmitfile(int peer, const char *mode tftp_send(peer, &block, &ts); read_close(); if (debug&DEBUG_SIMPLE) - tftp_log(LOG_INFO, "Sent %d bytes in %d seconds", - ts.amount, time(NULL) - now); + tftp_log(LOG_INFO, "Sent %jd bytes in %jd seconds", + (intmax_t)ts.amount, (intmax_t)time(NULL) - now); } static void @@ -832,8 +833,8 @@ tftp_recvfile(int peer, const char *mode f = now2.tv_sec - now1.tv_sec + (now2.tv_usec - now1.tv_usec) / 100000.0; tftp_log(LOG_INFO, - "Download of %d bytes in %d blocks completed after %0.1f seconds\n", - ts.amount, block, f); + "Download of %jd bytes in %d blocks completed after %0.1f seconds\n", + (intmax_t)ts.amount, block, f); } return; From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 00:14:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD07A2E4; Thu, 31 Jan 2013 00:14:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF926E7F; Thu, 31 Jan 2013 00:14:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0V0EPkN046964; Thu, 31 Jan 2013 00:14:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0V0EP04046963; Thu, 31 Jan 2013 00:14:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301310014.r0V0EP04046963@svn.freebsd.org> From: Adrian Chadd Date: Thu, 31 Jan 2013 00:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246141 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 00:14:25 -0000 Author: adrian Date: Thu Jan 31 00:14:25 2013 New Revision: 246141 URL: http://svnweb.freebsd.org/changeset/base/246141 Log: Work around some rather unfortunate race conditions inside net80211. Right now, ic_curchan seems to be updated rather quickly (ie, during the ioctl) and before the driver gets notified of what's going on. So what I was seeing was: * NIC was in channel X; * It generates PHY errors for channel X; * an ioctl comes along from userland and changes things to channel Y; * .. this updates ic_curchan, but hasn't yet reset the hardware; * in parallel, RX is occuring and it looks at ic_curchan; * .. which is channel Y, so events get stamped with that now. Sigh. 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 Thu Jan 31 00:02:49 2013 (r246140) +++ head/sys/dev/ath/if_ath_rx.c Thu Jan 31 00:14:25 2013 (r246141) @@ -431,18 +431,16 @@ ath_rx_tap(struct ifnet *ifp, struct mbu #ifdef AH_SUPPORT_AR5416 sc->sc_rx_th.wr_chan_flags &= ~CHAN_HT; if (rs->rs_status & HAL_RXERR_PHY) { - struct ieee80211com *ic = ifp->if_l2com; - /* * PHY error - make sure the channel flags * reflect the actual channel configuration, * not the received frame. */ - if (IEEE80211_IS_CHAN_HT40U(ic->ic_curchan)) + if (IEEE80211_IS_CHAN_HT40U(sc->sc_curchan)) sc->sc_rx_th.wr_chan_flags |= CHAN_HT40U; - else if (IEEE80211_IS_CHAN_HT40D(ic->ic_curchan)) + else if (IEEE80211_IS_CHAN_HT40D(sc->sc_curchan)) sc->sc_rx_th.wr_chan_flags |= CHAN_HT40D; - else if (IEEE80211_IS_CHAN_HT20(ic->ic_curchan)) + else if (IEEE80211_IS_CHAN_HT20(sc->sc_curchan)) sc->sc_rx_th.wr_chan_flags |= CHAN_HT20; } else if (sc->sc_rx_th.wr_rate & IEEE80211_RATE_MCS) { /* HT rate */ struct ieee80211com *ic = ifp->if_l2com; From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 00:42:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D171E8BC; Thu, 31 Jan 2013 00:42:38 +0000 (UTC) (envelope-from seanwbruno@gmail.com) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by mx1.freebsd.org (Postfix) with ESMTP id 98FD4F92; Thu, 31 Jan 2013 00:42:38 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id bg4so1392710pad.26 for ; Wed, 30 Jan 2013 16:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:subject:from:reply-to:to:cc:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer; bh=bNN59j62p2KfdeSGMkDj2QMmwz8mz3Vhzqrj8NlYKgc=; b=KKN4f6r943MyHbxdiy5SjbF+jKKglP958yiNFjM5tcGQJ9I4/n76/pHL//E9qu6c4B GqUf2K55pA3xv7eFwI+kwEZzGGwKqvmYitN1snqtk4ZRsDWQptbR4liif3Wgv6oeySiK LZHvSHyjVPF73YZnLYjKSLjk8lgBiV+T6K1h5oOM2rzZksKoNPv2EFCaTUGuftiBkUNu bqE6NY4OjblIrMFwyJbAdhqQIEpnQ4qT7c9udzEH5UkjwGXmXQr/GdlIoqFzCzRYTLHt FVPATD4CjFk+g7C1OldaR3k8YXFIA3FqGfB1mmx/jIvIRfn6Ce6DS2gWpERSI60pfpQw j8jw== X-Received: by 10.68.223.230 with SMTP id qx6mr17161617pbc.159.1359592958237; Wed, 30 Jan 2013 16:42:38 -0800 (PST) Received: from [10.73.160.242] (nat-dip7.cfw-a-gci.corp.yahoo.com. [209.131.62.116]) by mx.google.com with ESMTPS id d1sm3608286pav.6.2013.01.30.16.42.36 (version=SSLv3 cipher=RC4-SHA bits=128/128); Wed, 30 Jan 2013 16:42:36 -0800 (PST) Subject: Re: svn commit: r246139 - head/libexec/tftpd From: Sean Bruno To: Marius Strobl In-Reply-To: <201301310002.r0V02aki043380@svn.freebsd.org> References: <201301310002.r0V02aki043380@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-hZVpNA32spBpc/j1N19k" Date: Wed, 30 Jan 2013 16:42:35 -0800 Message-ID: <1359592955.4656.2.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: sbruno@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 00:42:38 -0000 --=-hZVpNA32spBpc/j1N19k Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2013-01-31 at 00:02 +0000, Marius Strobl wrote: > Author: marius > Date: Thu Jan 31 00:02:36 2013 > New Revision: 246139 > URL: http://svnweb.freebsd.org/changeset/base/246139 >=20 > Log: > Mark tftp_log() as __printflike() (which would have caught the bug > fixed in r246106) and deal with the fallout. > =20 > MFC after: 2 weeks >=20 >=20 Gracias! Sean --=-hZVpNA32spBpc/j1N19k Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAABAgAGBQJRCb37AAoJEBkJRdwI6BaH3C4H/Rbn07ZtYFbM+bNvVTp1ErS6 zOSqMounG5mgsgvgimy1Qd0QSfNNFy3Rb5GaFZGhxvYpTZRYxh3qmEV6BOD08mnc pvHjC1aEnX+6Nul+rysPRF5OgAR9k24Jmz8Pb2GSVZn30tSV7vW1ZBs772jFh2B1 9KSIa/YOKnn/7rlxNYBDmDGNwO7R1cFIW7hk/dH0wj2tDVgRSPtFgu3y7jaN8VGV xXzaDxrRvLQ4+AWu4ailHU2TyqhayMwsRa15BH0e2ncNPV2WrFtcIK7G44oRKzZl EbTVOzMitRV67jvTAx73O1gnPNhQUOdr0CW/okBxjNTmpbEAwRzbk0E+zyQ+SsA= =s7Lp -----END PGP SIGNATURE----- --=-hZVpNA32spBpc/j1N19k-- From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 01:15:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CEC8BDDC; Thu, 31 Jan 2013 01:15:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B61B7FE; Thu, 31 Jan 2013 01:15:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0V1FC6I065041; Thu, 31 Jan 2013 01:15:12 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0V1FCVD065040; Thu, 31 Jan 2013 01:15:12 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301310115.r0V1FCVD065040@svn.freebsd.org> From: Mateusz Guzik Date: Thu, 31 Jan 2013 01:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246142 - stable/9/usr.bin/truss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 01:15:12 -0000 Author: mjg Date: Thu Jan 31 01:15:12 2013 New Revision: 246142 URL: http://svnweb.freebsd.org/changeset/base/246142 Log: MFC r245956: truss: if file requested with -o flag could not be opened print the reason Modified: stable/9/usr.bin/truss/main.c Directory Properties: stable/9/usr.bin/truss/ (props changed) Modified: stable/9/usr.bin/truss/main.c ============================================================================== --- stable/9/usr.bin/truss/main.c Thu Jan 31 00:14:25 2013 (r246141) +++ stable/9/usr.bin/truss/main.c Thu Jan 31 01:15:12 2013 (r246142) @@ -235,7 +235,7 @@ main(int ac, char **av) if (fname != NULL) { /* Use output file */ if ((trussinfo->outfile = fopen(fname, "w")) == NULL) - errx(1, "cannot open %s", fname); + err(1, "cannot open %s", fname); /* * Set FD_CLOEXEC, so that the output file is not shared with * the traced process. From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 01:26:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id F1AA310C; Thu, 31 Jan 2013 01:26:00 +0000 (UTC) Date: Thu, 31 Jan 2013 01:26:00 +0000 From: Alexey Dokuchaev To: Ian Lepore Subject: Re: svn commit: r246134 - head/sbin/devd Message-ID: <20130131012600.GB14619@FreeBSD.org> References: <201301302337.r0UNbac6035085@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201301302337.r0UNbac6035085@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 01:26:01 -0000 On Wed, Jan 30, 2013 at 11:37:36PM +0000, Ian Lepore wrote: > New Revision: 246134 > URL: http://svnweb.freebsd.org/changeset/base/246134 > > Log: > Improve devd startup time, by tweaking some string handling routines [...] > > On a 1.2 GHz ARM processor this reduces the time to parse the config files > from 13 to 6 seconds. Sweet! MFCs are planned, I presume? ./danfe From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 01:35:46 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BEDAD329; Thu, 31 Jan 2013 01:35:46 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 97F68184; Thu, 31 Jan 2013 01:35:46 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.6/8.14.6) with ESMTP id r0V1Zjlg098828; Wed, 30 Jan 2013 18:35:45 -0700 (MST) (envelope-from ian@FreeBSD.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r0V1ZXYs024342; Wed, 30 Jan 2013 18:35:33 -0700 (MST) (envelope-from ian@FreeBSD.org) Subject: Re: svn commit: r246134 - head/sbin/devd From: Ian Lepore To: Alexey Dokuchaev In-Reply-To: <20130131012600.GB14619@FreeBSD.org> References: <201301302337.r0UNbac6035085@svn.freebsd.org> <20130131012600.GB14619@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" Date: Wed, 30 Jan 2013 18:35:32 -0700 Message-ID: <1359596132.93359.299.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 01:35:46 -0000 On Thu, 2013-01-31 at 01:26 +0000, Alexey Dokuchaev wrote: > On Wed, Jan 30, 2013 at 11:37:36PM +0000, Ian Lepore wrote: > > New Revision: 246134 > > URL: http://svnweb.freebsd.org/changeset/base/246134 > > > > Log: > > Improve devd startup time, by tweaking some string handling routines [...] > > > > On a 1.2 GHz ARM processor this reduces the time to parse the config files > > from 13 to 6 seconds. > > Sweet! MFCs are planned, I presume? > > ./danfe After it gets some test miles on it, yeah. We can really use this on our extra-wimpy ARM processors (180 MHz) at work. -- Ian From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 08:55:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 18E35512; Thu, 31 Jan 2013 08:55:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EEF1C36F; Thu, 31 Jan 2013 08:55:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0V8tNN1002023; Thu, 31 Jan 2013 08:55:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0V8tLID002006; Thu, 31 Jan 2013 08:55:21 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201301310855.r0V8tLID002006@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 31 Jan 2013 08:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246143 - in head: contrib/ipfilter/ipsend libexec/bootpd sbin/route sys/net sys/netinet usr.sbin/arp usr.sbin/ndp usr.sbin/ppp usr.sbin/rarpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 08:55:24 -0000 Author: glebius Date: Thu Jan 31 08:55:21 2013 New Revision: 246143 URL: http://svnweb.freebsd.org/changeset/base/246143 Log: Retire struct sockaddr_inarp. Since ARP and routing are separated, "proxy only" entries don't have any meaning, thus we don't need additional field in sockaddr to pass SIN_PROXY flag. New kernel is binary compatible with old tools, since sizes of sockaddr_inarp and sockaddr_in match, and sa_family are filled with same value. The structure declaration is left for compatibility with third party software, but in tree code no longer use it. Reviewed by: ru, andre, net@ Modified: head/contrib/ipfilter/ipsend/44arp.c head/libexec/bootpd/rtmsg.c head/sbin/route/route.c head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/netinet/if_ether.h head/sys/netinet/in.c head/usr.sbin/arp/arp.8 head/usr.sbin/arp/arp.c head/usr.sbin/ndp/ndp.c head/usr.sbin/ppp/arp.c head/usr.sbin/rarpd/rarpd.c Modified: head/contrib/ipfilter/ipsend/44arp.c ============================================================================== --- head/contrib/ipfilter/ipsend/44arp.c Thu Jan 31 01:15:12 2013 (r246142) +++ head/contrib/ipfilter/ipsend/44arp.c Thu Jan 31 08:55:21 2013 (r246143) @@ -72,7 +72,7 @@ char *addr, *eaddr; size_t needed; char *lim, *buf, *next; struct rt_msghdr *rtm; - struct sockaddr_inarp *sin; + struct sockaddr_in *sin; struct sockaddr_dl *sdl; #ifdef IPSEND @@ -113,7 +113,7 @@ char *addr, *eaddr; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; - sin = (struct sockaddr_inarp *)(rtm + 1); + sin = (struct sockaddr_in *)(rtm + 1); sdl = (struct sockaddr_dl *)(sin + 1); if (!bcmp(addr, (char *)&sin->sin_addr, sizeof(struct in_addr))) Modified: head/libexec/bootpd/rtmsg.c ============================================================================== --- head/libexec/bootpd/rtmsg.c Thu Jan 31 01:15:12 2013 (r246142) +++ head/libexec/bootpd/rtmsg.c Thu Jan 31 08:55:21 2013 (r246143) @@ -106,9 +106,9 @@ static void getsocket () { } static struct sockaddr_in so_mask = {8, 0, 0, { 0xffffffff}}; -static struct sockaddr_inarp blank_sin = {sizeof(blank_sin), AF_INET }, sin_m; +static struct sockaddr_in blank_sin = {sizeof(blank_sin), AF_INET }, sin_m; static struct sockaddr_dl blank_sdl = {sizeof(blank_sdl), AF_LINK }, sdl_m; -static int expire_time, flags, export_only, doing_proxy; +static int expire_time, flags, doing_proxy; static struct { struct rt_msghdr m_rtm; char m_space[512]; @@ -122,7 +122,7 @@ int bsd_arp_set(ia, eaddr, len) char *eaddr; int len; { - register struct sockaddr_inarp *sin = &sin_m; + register struct sockaddr_in *sin = &sin_m; register struct sockaddr_dl *sdl; register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm); u_char *ea; @@ -137,7 +137,7 @@ int bsd_arp_set(ia, eaddr, len) ea = (u_char *)LLADDR(&sdl_m); bcopy(eaddr, ea, len); sdl_m.sdl_alen = len; - doing_proxy = flags = export_only = expire_time = 0; + doing_proxy = flags = expire_time = 0; /* make arp entry temporary */ clock_gettime(CLOCK_MONOTONIC, &tp); @@ -148,7 +148,7 @@ tryagain: report(LOG_WARNING, "rtmget: %s", strerror(errno)); return (1); } - sin = (struct sockaddr_inarp *)(rtm + 1); + sin = (struct sockaddr_in *)(rtm + 1); sdl = (struct sockaddr_dl *)(sin->sin_len + (char *)sin); if (sin->sin_addr.s_addr == sin_m.sin_addr.s_addr) { if (sdl->sdl_family == AF_LINK && @@ -163,13 +163,6 @@ tryagain: inet_ntoa(sin->sin_addr)); return (1); } - if (sin_m.sin_other & SIN_PROXY) { - report(LOG_WARNING, - "set: proxy entry exists for non 802 device\n"); - return(1); - } - sin_m.sin_other = SIN_PROXY; - export_only = 1; goto tryagain; } overwrite: @@ -209,14 +202,9 @@ static int rtmsg(cmd) rtm->rtm_rmx.rmx_expire = expire_time; rtm->rtm_inits = RTV_EXPIRE; rtm->rtm_flags |= (RTF_HOST | RTF_STATIC | RTF_LLDATA); - sin_m.sin_other = 0; if (doing_proxy) { - if (export_only) - sin_m.sin_other = SIN_PROXY; - else { - rtm->rtm_addrs |= RTA_NETMASK; - rtm->rtm_flags &= ~RTF_HOST; - } + rtm->rtm_addrs |= RTA_NETMASK; + rtm->rtm_flags &= ~RTF_HOST; } /* FALLTHROUGH */ case RTM_GET: Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Thu Jan 31 01:15:12 2013 (r246142) +++ head/sbin/route/route.c Thu Jan 31 08:55:21 2013 (r246143) @@ -86,7 +86,6 @@ union sockunion { #endif struct sockaddr_at sat; struct sockaddr_dl sdl; - struct sockaddr_inarp sinarp; struct sockaddr_storage ss; /* added to avoid memory overrun */ } so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp; @@ -923,10 +922,8 @@ newroute(int argc, char **argv) flags |= RTF_HOST; if ((nrflags & F_INTERFACE) == 0) flags |= RTF_GATEWAY; - if (nrflags & F_PROXY) { - so_dst.sinarp.sin_other = SIN_PROXY; + if (nrflags & F_PROXY) flags |= RTF_ANNOUNCE; - } if (dest == NULL) dest = ""; if (gateway == NULL) Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Thu Jan 31 01:15:12 2013 (r246142) +++ head/sys/net/if_llatbl.c Thu Jan 31 08:55:21 2013 (r246143) @@ -285,28 +285,8 @@ lla_rt_output(struct rt_msghdr *rtm, str switch (rtm->rtm_type) { case RTM_ADD: - if (rtm->rtm_flags & RTF_ANNOUNCE) { + if (rtm->rtm_flags & RTF_ANNOUNCE) flags |= LLE_PUB; -#ifdef INET - if (dst->sa_family == AF_INET && - ((struct sockaddr_inarp *)dst)->sin_other != 0) { - struct rtentry *rt; - ((struct sockaddr_inarp *)dst)->sin_other = 0; - rt = rtalloc1(dst, 0, 0); - if (rt == NULL || !(rt->rt_flags & RTF_HOST)) { - log(LOG_INFO, "%s: RTM_ADD publish " - "(proxy only) is invalid\n", - __func__); - if (rt) - RTFREE_LOCKED(rt); - return EINVAL; - } - RTFREE_LOCKED(rt); - - flags |= LLE_PROXY; - } -#endif - } flags |= LLE_CREATE; break; @@ -345,7 +325,7 @@ lla_rt_output(struct rt_msghdr *rtm, str * LLE_DELETED flag, and reset the expiration timer */ bcopy(LLADDR(dl), &lle->ll_addr, ifp->if_addrlen); - lle->la_flags |= (flags & (LLE_PUB | LLE_PROXY)); + lle->la_flags |= (flags & LLE_PUB); lle->la_flags |= LLE_VALID; lle->la_flags &= ~LLE_DELETED; #ifdef INET6 @@ -367,15 +347,12 @@ lla_rt_output(struct rt_msghdr *rtm, str laflags = lle->la_flags; LLE_WUNLOCK(lle); #ifdef INET - /* gratuitous ARP */ - if ((laflags & LLE_PUB) && dst->sa_family == AF_INET) { + /* gratuitous ARP */ + if ((laflags & LLE_PUB) && dst->sa_family == AF_INET) arprequest(ifp, &((struct sockaddr_in *)dst)->sin_addr, &((struct sockaddr_in *)dst)->sin_addr, - ((laflags & LLE_PROXY) ? - (u_char *)IF_LLADDR(ifp) : - (u_char *)LLADDR(dl))); - } + (u_char *)LLADDR(dl)); #endif } else { if (flags & LLE_EXCLUSIVE) Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Thu Jan 31 01:15:12 2013 (r246142) +++ head/sys/net/if_llatbl.h Thu Jan 31 08:55:21 2013 (r246143) @@ -172,7 +172,6 @@ MALLOC_DECLARE(M_LLTABLE); #define LLE_STATIC 0x0002 /* entry is static */ #define LLE_IFADDR 0x0004 /* entry is interface addr */ #define LLE_VALID 0x0008 /* ll_addr is valid */ -#define LLE_PROXY 0x0010 /* proxy entry ??? */ #define LLE_PUB 0x0020 /* publish entry ??? */ #define LLE_LINKED 0x0040 /* linked to lookup structure */ #define LLE_EXCLUSIVE 0x2000 /* return lle xlocked */ Modified: head/sys/netinet/if_ether.h ============================================================================== --- head/sys/netinet/if_ether.h Thu Jan 31 01:15:12 2013 (r246142) +++ head/sys/netinet/if_ether.h Thu Jan 31 08:55:21 2013 (r246143) @@ -89,6 +89,7 @@ struct ether_arp { #define arp_pln ea_hdr.ar_pln #define arp_op ea_hdr.ar_op +#ifndef BURN_BRIDGES /* Can be used by third party software. */ struct sockaddr_inarp { u_char sin_len; u_char sin_family; @@ -99,6 +100,8 @@ struct sockaddr_inarp { u_short sin_other; #define SIN_PROXY 1 }; +#endif /* !BURN_BRIDGES */ + /* * IP and ethernet specific routing flags */ Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Jan 31 01:15:12 2013 (r246142) +++ head/sys/netinet/in.c Thu Jan 31 08:55:21 2013 (r246143) @@ -1494,7 +1494,7 @@ in_lltable_dump(struct lltable *llt, str /* XXX stack use */ struct { struct rt_msghdr rtm; - struct sockaddr_inarp sin; + struct sockaddr_in sin; struct sockaddr_dl sdl; } arpc; int error, i; @@ -1515,7 +1515,7 @@ in_lltable_dump(struct lltable *llt, str /* * produce a msg made of: * struct rt_msghdr; - * struct sockaddr_inarp; (IPv4) + * struct sockaddr_in; (IPv4) * struct sockaddr_dl; */ bzero(&arpc, sizeof(arpc)); @@ -1529,12 +1529,8 @@ in_lltable_dump(struct lltable *llt, str arpc.sin.sin_addr.s_addr = SIN(lle)->sin_addr.s_addr; /* publish */ - if (lle->la_flags & LLE_PUB) { + if (lle->la_flags & LLE_PUB) arpc.rtm.rtm_flags |= RTF_ANNOUNCE; - /* proxy only */ - if (lle->la_flags & LLE_PROXY) - arpc.sin.sin_other = SIN_PROXY; - } sdl = &arpc.sdl; sdl->sdl_family = AF_LINK; Modified: head/usr.sbin/arp/arp.8 ============================================================================== --- head/usr.sbin/arp/arp.8 Thu Jan 31 01:15:12 2013 (r246142) +++ head/usr.sbin/arp/arp.8 Thu Jan 31 08:55:21 2013 (r246143) @@ -28,7 +28,7 @@ .\" @(#)arp.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 25, 2008 +.Dd January 31, 2013 .Dt ARP 8 .Os .Sh NAME @@ -54,12 +54,12 @@ .Fl s Ar hostname ether_addr .Op Cm temp .Op Cm blackhole No \&| Cm reject -.Op Cm pub Op Cm only +.Op Cm pub .Nm .Fl S Ar hostname ether_addr .Op Cm temp .Op Cm blackhole No \&| Cm reject -.Op Cm pub Op Cm only +.Op Cm pub .Nm .Fl f Ar filename .Sh DESCRIPTION @@ -140,16 +140,6 @@ can be given as in which case the interfaces on this host will be examined, and if one of them is found to occupy the same subnet, its Ethernet address will be used. -If the -.Cm only -keyword is also specified, this will create a -.Dq "published (proxy only)" -entry. -This type of entry is created automatically if -.Nm -detects that a routing table entry for -.Ar hostname -already exists. .Pp If the .Cm reject @@ -181,7 +171,7 @@ in the file should be of the form .Ar hostname ether_addr .Op Cm temp .Op Cm blackhole No \&| Cm reject -.Op Cm pub Op Cm only +.Op Cm pub .Ed .Pp with argument meanings as given above. Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Thu Jan 31 01:15:12 2013 (r246142) +++ head/usr.sbin/arp/arp.c Thu Jan 31 08:55:21 2013 (r246143) @@ -81,28 +81,28 @@ __FBSDID("$FreeBSD$"); #include typedef void (action_fn)(struct sockaddr_dl *sdl, - struct sockaddr_inarp *s_in, struct rt_msghdr *rtm); + struct sockaddr_in *s_in, struct rt_msghdr *rtm); static int search(u_long addr, action_fn *action); static action_fn print_entry; static action_fn nuke_entry; -static int delete(char *host, int do_proxy); +static int delete(char *host); static void usage(void); static int set(int argc, char **argv); static int get(char *host); static int file(char *name); static struct rt_msghdr *rtmsg(int cmd, - struct sockaddr_inarp *dst, struct sockaddr_dl *sdl); + struct sockaddr_in *dst, struct sockaddr_dl *sdl); static int get_ether_addr(in_addr_t ipaddr, struct ether_addr *hwaddr); -static struct sockaddr_inarp *getaddr(char *host); +static struct sockaddr_in *getaddr(char *host); static int valid_type(int type); static int nflag; /* no reverse dns lookups */ static char *rifname; static time_t expire_time; -static int flags, doing_proxy, proxy_only; +static int flags, doing_proxy; /* which function we're supposed to do */ #define F_GET 1 @@ -179,7 +179,7 @@ main(int argc, char *argv[]) if (argc < 2 || argc > 6) usage(); if (func == F_REPLACE) - (void)delete(argv[0], 0); + (void)delete(argv[0]); rtn = set(argc, argv) ? 1 : 0; break; case F_DELETE: @@ -187,15 +187,8 @@ main(int argc, char *argv[]) if (argc != 0) usage(); search(0, nuke_entry); - } else { - if (argc == 2 && strncmp(argv[1], "pub", 3) == 0) - ch = SIN_PROXY; - else if (argc == 1) - ch = 0; - else - usage(); - rtn = delete(argv[0], ch); - } + } else + rtn = delete(argv[0]); break; case F_FILESET: if (argc != 1) @@ -246,15 +239,15 @@ file(char *name) } /* - * Given a hostname, fills up a (static) struct sockaddr_inarp with + * Given a hostname, fills up a (static) struct sockaddr_in with * the address of the host and returns a pointer to the * structure. */ -static struct sockaddr_inarp * +static struct sockaddr_in * getaddr(char *host) { struct hostent *hp; - static struct sockaddr_inarp reply; + static struct sockaddr_in reply; bzero(&reply, sizeof(reply)); reply.sin_len = sizeof(reply); @@ -298,8 +291,8 @@ valid_type(int type) static int set(int argc, char **argv) { - struct sockaddr_inarp *addr; - struct sockaddr_inarp *dst; /* what are we looking for */ + struct sockaddr_in *addr; + struct sockaddr_in *dst; /* what are we looking for */ struct sockaddr_dl *sdl; struct rt_msghdr *rtm; struct ether_addr *ea; @@ -316,7 +309,7 @@ set(int argc, char **argv) dst = getaddr(host); if (dst == NULL) return (1); - doing_proxy = flags = proxy_only = expire_time = 0; + doing_proxy = flags = expire_time = 0; while (argc-- > 0) { if (strncmp(argv[0], "temp", 4) == 0) { struct timespec tp; @@ -332,7 +325,12 @@ set(int argc, char **argv) flags |= RTF_ANNOUNCE; doing_proxy = 1; if (argc && strncmp(argv[1], "only", 3) == 0) { - proxy_only = 1; + /* + * Compatibility: in pre FreeBSD 8 times + * the "only" keyword used to mean that + * an ARP entry should be announced, but + * not installed into routing table. + */ argc--; argv++; } } else if (strncmp(argv[0], "blackhole", 9) == 0) { @@ -385,7 +383,7 @@ set(int argc, char **argv) warn("%s", host); return (1); } - addr = (struct sockaddr_inarp *)(rtm + 1); + addr = (struct sockaddr_in *)(rtm + 1); sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr); if ((sdl->sdl_family != AF_LINK) || @@ -405,7 +403,7 @@ set(int argc, char **argv) static int get(char *host) { - struct sockaddr_inarp *addr; + struct sockaddr_in *addr; addr = getaddr(host); if (addr == NULL) @@ -425,9 +423,9 @@ get(char *host) * Delete an arp entry */ static int -delete(char *host, int do_proxy) +delete(char *host) { - struct sockaddr_inarp *addr, *dst; + struct sockaddr_in *addr, *dst; struct rt_msghdr *rtm; struct sockaddr_dl *sdl; struct sockaddr_dl sdl_m; @@ -456,7 +454,7 @@ delete(char *host, int do_proxy) warn("%s", host); return (1); } - addr = (struct sockaddr_inarp *)(rtm + 1); + addr = (struct sockaddr_in *)(rtm + 1); sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr); /* @@ -504,7 +502,7 @@ search(u_long addr, action_fn *action) size_t needed; char *lim, *buf, *next; struct rt_msghdr *rtm; - struct sockaddr_inarp *sin2; + struct sockaddr_in *sin2; struct sockaddr_dl *sdl; char ifname[IF_NAMESIZE]; int st, found_entry = 0; @@ -538,7 +536,7 @@ search(u_long addr, action_fn *action) lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; - sin2 = (struct sockaddr_inarp *)(rtm + 1); + sin2 = (struct sockaddr_in *)(rtm + 1); sdl = (struct sockaddr_dl *)((char *)sin2 + SA_SIZE(sin2)); if (rifname && if_indextoname(sdl->sdl_index, ifname) && strcmp(ifname, rifname)) @@ -562,7 +560,7 @@ static int64_t lifindex = -1; static void print_entry(struct sockaddr_dl *sdl, - struct sockaddr_inarp *addr, struct rt_msghdr *rtm) + struct sockaddr_in *addr, struct rt_msghdr *rtm) { const char *host; struct hostent *hp; @@ -612,8 +610,6 @@ print_entry(struct sockaddr_dl *sdl, else printf(" expired"); } - if (addr->sin_other & SIN_PROXY) - printf(" published (proxy only)"); if (rtm->rtm_flags & RTF_ANNOUNCE) printf(" published"); switch(sdl->sdl_type) { @@ -659,12 +655,12 @@ print_entry(struct sockaddr_dl *sdl, */ static void nuke_entry(struct sockaddr_dl *sdl __unused, - struct sockaddr_inarp *addr, struct rt_msghdr *rtm __unused) + struct sockaddr_in *addr, struct rt_msghdr *rtm __unused) { char ip[20]; snprintf(ip, sizeof(ip), "%s", inet_ntoa(addr->sin_addr)); - (void)delete(ip, 0); + delete(ip); } static void @@ -682,7 +678,7 @@ usage(void) } static struct rt_msghdr * -rtmsg(int cmd, struct sockaddr_inarp *dst, struct sockaddr_dl *sdl) +rtmsg(int cmd, struct sockaddr_in *dst, struct sockaddr_dl *sdl) { static int seq; int rlen; @@ -728,14 +724,9 @@ rtmsg(int cmd, struct sockaddr_inarp *ds rtm->rtm_rmx.rmx_expire = expire_time; rtm->rtm_inits = RTV_EXPIRE; rtm->rtm_flags |= (RTF_HOST | RTF_STATIC | RTF_LLDATA); - dst->sin_other = 0; if (doing_proxy) { - if (proxy_only) - dst->sin_other = SIN_PROXY; - else { - rtm->rtm_addrs |= RTA_NETMASK; - rtm->rtm_flags &= ~RTF_HOST; - } + rtm->rtm_addrs |= RTA_NETMASK; + rtm->rtm_flags &= ~RTF_HOST; } /* FALLTHROUGH */ case RTM_GET: Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Thu Jan 31 01:15:12 2013 (r246142) +++ head/usr.sbin/ndp/ndp.c Thu Jan 31 08:55:21 2013 (r246143) @@ -436,9 +436,6 @@ set(argc, argv) goto overwrite; } } - /* - * IPv4 arp command retries with sin_other = SIN_PROXY here. - */ fprintf(stderr, "set: cannot configure a new entry\n"); return 1; } @@ -523,9 +520,6 @@ delete(host) !(rtm->rtm_flags & RTF_GATEWAY)) { goto delete; } - /* - * IPv4 arp command retries with sin_other = SIN_PROXY here. - */ fprintf(stderr, "delete: cannot delete non-NDP entry\n"); return 1; } Modified: head/usr.sbin/ppp/arp.c ============================================================================== --- head/usr.sbin/ppp/arp.c Thu Jan 31 01:15:12 2013 (r246142) +++ head/usr.sbin/ppp/arp.c Thu Jan 31 08:55:21 2013 (r246143) @@ -91,7 +91,7 @@ */ static struct { struct rt_msghdr hdr; - struct sockaddr_inarp dst; + struct sockaddr_in dst; struct sockaddr_dl hwa; char extra[128]; } arpmsg; @@ -124,10 +124,9 @@ arp_ProxySub(struct bundle *bundle, stru arpmsg.hdr.rtm_seq = ++bundle->routing_seq; arpmsg.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY; arpmsg.hdr.rtm_inits = RTV_EXPIRE; - arpmsg.dst.sin_len = sizeof(struct sockaddr_inarp); + arpmsg.dst.sin_len = sizeof(struct sockaddr_in); arpmsg.dst.sin_family = AF_INET; arpmsg.dst.sin_addr.s_addr = addr.s_addr; - arpmsg.dst.sin_other = SIN_PROXY; arpmsg.hdr.rtm_msglen = (char *) &arpmsg.hwa - (char *) &arpmsg + arpmsg.hwa.sdl_len; Modified: head/usr.sbin/rarpd/rarpd.c ============================================================================== --- head/usr.sbin/rarpd/rarpd.c Thu Jan 31 01:15:12 2013 (r246142) +++ head/usr.sbin/rarpd/rarpd.c Thu Jan 31 08:55:21 2013 (r246143) @@ -692,11 +692,10 @@ rarp_process(struct if_info *ii, u_char * host (i.e. the guy running rarpd), won't try to ARP for the hardware * address of the guy being booted (he cannot answer the ARP). */ -struct sockaddr_inarp sin_inarp = { - sizeof(struct sockaddr_inarp), AF_INET, 0, +struct sockaddr_in sin_inarp = { + sizeof(struct sockaddr_in), AF_INET, 0, {0}, {0}, - 0, 0 }; struct sockaddr_dl sin_dl = { sizeof(struct sockaddr_dl), AF_LINK, 0, IFT_ETHER, 0, 6, @@ -712,7 +711,7 @@ update_arptab(u_char *ep, in_addr_t ipad { struct timespec tp; int cc; - struct sockaddr_inarp *ar, *ar2; + struct sockaddr_in *ar, *ar2; struct sockaddr_dl *ll, *ll2; struct rt_msghdr *rt; int xtype, xindex; @@ -740,7 +739,7 @@ update_arptab(u_char *ep, in_addr_t ipad rt->rtm_addrs = RTA_DST; rt->rtm_type = RTM_GET; rt->rtm_seq = ++seq; - ar2 = (struct sockaddr_inarp *)rtmsg.rtspace; + ar2 = (struct sockaddr_in *)rtmsg.rtspace; bcopy(ar, ar2, sizeof(*ar)); rt->rtm_msglen = sizeof(*rt) + sizeof(*ar); errno = 0; From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 10:29:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABFBE9D5; Thu, 31 Jan 2013 10:29:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90689996; Thu, 31 Jan 2013 10:29:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VATMph029896; Thu, 31 Jan 2013 10:29:22 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VATMJ6029894; Thu, 31 Jan 2013 10:29:22 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201301311029.r0VATMJ6029894@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 31 Jan 2013 10:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246144 - head/sys/netinet/libalias X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 10:29:22 -0000 Author: glebius Date: Thu Jan 31 10:29:22 2013 New Revision: 246144 URL: http://svnweb.freebsd.org/changeset/base/246144 Log: - Move AUTHORS and ACKNOWLEDGEMENTS to the end of the page. - Add myself to list of authors. Modified: head/sys/netinet/libalias/libalias.3 Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Thu Jan 31 08:55:21 2013 (r246143) +++ head/sys/netinet/libalias/libalias.3 Thu Jan 31 10:29:22 2013 (r246144) @@ -901,39 +901,6 @@ is provided for error checking purposes. This function can be used if an already-aliased packet needs to have its original IP header restored for further processing (e.g.\& logging). .Ed -.Sh AUTHORS -.An Charles Mott Aq cm@linktel.net , -versions 1.0 - 1.8, 2.0 - 2.4. -.An Eivind Eklund Aq eivind@FreeBSD.org , -versions 1.8b, 1.9 and 2.5. -Added IRC DCC support as well as contributing a number of architectural -improvements; added the firewall bypass for FTP/IRC DCC. -.An Erik Salander Aq erik@whistle.com -added support for PPTP and RTSP. -.An Junichi Satoh Aq junichi@junichi.org -added support for RTSP/PNA. -.An Ruslan Ermilov Aq ru@FreeBSD.org -added support for PPTP and LSNAT as well as general hacking. -.An Paolo Pisati Aq piso@FreeBSD.org -made the library modular, moving support for all -protocols (except for IP, TCP and UDP) to external modules. -.Sh ACKNOWLEDGEMENTS -Listed below, in approximate chronological order, are individuals who -have provided valuable comments and/or debugging assistance. -.Bd -ragged -offset indent -.An -split -.An Gary Roberts -.An Tom Torrance -.An Reto Burkhalter -.An Martin Renters -.An Brian Somers -.An Paul Traina -.An Ari Suutari -.An Dave Remien -.An J. Fortes -.An Andrzej Bialecki -.An Gordon Burditt -.Ed .Sh CONCEPTUAL BACKGROUND This section is intended for those who are planning to modify the source code or want to create somewhat esoteric applications using the packet @@ -1475,3 +1442,38 @@ with the facility and the .Dv LOG_INFO level. +.Sh AUTHORS +.An Charles Mott Aq cm@linktel.net , +versions 1.0 - 1.8, 2.0 - 2.4. +.An Eivind Eklund Aq eivind@FreeBSD.org , +versions 1.8b, 1.9 and 2.5. +Added IRC DCC support as well as contributing a number of architectural +improvements; added the firewall bypass for FTP/IRC DCC. +.An Erik Salander Aq erik@whistle.com +added support for PPTP and RTSP. +.An Junichi Satoh Aq junichi@junichi.org +added support for RTSP/PNA. +.An Ruslan Ermilov Aq ru@FreeBSD.org +added support for PPTP and LSNAT as well as general hacking. +.An Gleb Smirnoff Aq glebius@FreeBSD.org +ported the library to kernel space. +.An Paolo Pisati Aq piso@FreeBSD.org +made the library modular, moving support for all +protocols (except for IP, TCP and UDP) to external modules. +.Sh ACKNOWLEDGEMENTS +Listed below, in approximate chronological order, are individuals who +have provided valuable comments and/or debugging assistance. +.Bd -ragged -offset indent +.An -split +.An Gary Roberts +.An Tom Torrance +.An Reto Burkhalter +.An Martin Renters +.An Brian Somers +.An Paul Traina +.An Ari Suutari +.An Dave Remien +.An J. Fortes +.An Andrzej Bialecki +.An Gordon Burditt +.Ed From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 11:00:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02DB7F76; Thu, 31 Jan 2013 11:00:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA41DB23; Thu, 31 Jan 2013 11:00:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VB0wrc040294; Thu, 31 Jan 2013 11:00:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VB0vfu040286; Thu, 31 Jan 2013 11:00:57 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301311100.r0VB0vfu040286@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 31 Jan 2013 11:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246145 - in head/sys/boot/usb: . tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 11:00:59 -0000 Author: hselasky Date: Thu Jan 31 11:00:57 2013 New Revision: 246145 URL: http://svnweb.freebsd.org/changeset/base/246145 Log: Initial version of libusbboot, a fully stand-alone, single threaded and functional compilation of the FreeBSD USB stack for use with boot loaders and such. Discussed with: Hiroki Sato, hrs @ EuroBSDCon Added: head/sys/boot/usb/ head/sys/boot/usb/Makefile (contents, props changed) head/sys/boot/usb/Makefile.test (contents, props changed) head/sys/boot/usb/bsd_busspace.c (contents, props changed) head/sys/boot/usb/bsd_global.h (contents, props changed) head/sys/boot/usb/bsd_kernel.c (contents, props changed) head/sys/boot/usb/bsd_kernel.h (contents, props changed) head/sys/boot/usb/bsd_usbloader_test.c (contents, props changed) head/sys/boot/usb/tools/ head/sys/boot/usb/tools/sysinit.c (contents, props changed) head/sys/boot/usb/tools/sysinit.h (contents, props changed) head/sys/boot/usb/usb_busdma_loader.c (contents, props changed) Added: head/sys/boot/usb/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/usb/Makefile Thu Jan 31 11:00:57 2013 (r246145) @@ -0,0 +1,150 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2013 Hans Petter Selasky. 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. +# + +T=${.CURDIR}/tools +S=${.CURDIR}/../.. + +.PATH: \ + ${.CURDIR} \ + ${S}/dev/usb \ + ${S}/dev/usb/controller \ + ${S}/dev/usb/serial \ + ${S}/dev/usb/storage \ + ${S}/dev/usb/template + +LIB= usbboot +INTERNALLIB= +OBJCOPY?= objcopy +SYSCC?= cc + +CFLAGS+= -DBOOTPROG=\"usbloader\" +CFLAGS+= -DUSB_GLOBAL_INCLUDE_FILE="\"bsd_global.h\"" +CFLAGS+= -ffunction-sections -fdata-sections +CFLAGS+= -ffreestanding +CFLAGS+= -Wformat -Wall +CFLAGS+= -I ${S} +CFLAGS+= -I ${T} +CFLAGS+= -I ${.CURDIR} +CFLAGS+= -g + +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 +CFLAGS+= -mpreferred-stack-boundary=2 +.endif +.if ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -m32 +.endif + +# +# Single threaded BSD kernel +# +SRCS+= bsd_kernel.c + +# +# BUSSPACE implementation +# +SRCS+= bsd_busspace.c + +# +# BUSDMA implementation +# +SRCS+= usb_busdma_loader.c + +# +# USB controller drivers +# +SRCS+= at91dci.c +SRCS+= atmegadci.c +SRCS+= avr32dci.c +SRCS+= dwc_otg.c +SRCS+= ehci.c +SRCS+= musb_otg.c +SRCS+= ohci.c +SRCS+= uhci.c +SRCS+= uss820dci.c +SRCS+= xhci.c +SRCS+= usb_controller.c + +CFLAGS += -DUSB_PROBE_LIST="\"xhci\", \"ehci\", \"uhci\", \"ohci\"" + +# +# USB core and templates +# +SRCS+= usb_core.c +SRCS+= usb_debug.c +SRCS+= usb_device.c +SRCS+= usb_dynamic.c +SRCS+= usb_error.c +SRCS+= usb_handle_request.c +SRCS+= usb_hid.c +SRCS+= usb_hub.c +SRCS+= usb_lookup.c +SRCS+= usb_msctest.c +SRCS+= usb_parse.c +SRCS+= usb_request.c +SRCS+= usb_transfer.c +SRCS+= usb_util.c +SRCS+= usb_template.c +SRCS+= usb_template_cdce.c +SRCS+= usb_template_msc.c +SRCS+= usb_template_mtp.c +SRCS+= usb_template_modem.c +SRCS+= usb_template_mouse.c +SRCS+= usb_template_kbd.c +SRCS+= usb_template_audio.c +SRCS+= sysinit_data.c +SRCS+= sysuninit_data.c + +CLEANFILES+= sysinit +CLEANFILES+= sysinit.bin +CLEANFILES+= sysinit_data.c +CLEANFILES+= sysuninit_data.c + +CLEANFILES+= ${SRCS:C/\.c/.osys/g} + +.include + +# +# SYSINIT() and SYSUNINIT() handling +# +sysinit: ${T}/sysinit.c + ${SYSCC} -Wall -o ${.TARGET} ${.ALLSRC} + +sysinit_data.c: sysinit.bin sysinit + ${.OBJDIR}/sysinit -i sysinit.bin -o ${.TARGET} -k sysinit -s sysinit_data + +sysuninit_data.c: sysinit.bin sysinit + ${.OBJDIR}/sysinit -i sysinit.bin -o ${.TARGET} -R -k sysuninit -s sysuninit_data + +.for F in ${OBJS} +${F}sys: ${F} + ${OBJCOPY} -j ".debug.sysinit" -O binary ${F} ${.TARGET} + [ -f ${.TARGET} ] || touch ${.TARGET} +.endfor + +sysinit.bin: ${OBJS:C/\.o/.osys/g:C/sysinit_data.osys//g:C/sysuninit_data.osys//g} + cat ${.ALLSRC} > sysinit.bin Added: head/sys/boot/usb/Makefile.test ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/usb/Makefile.test Thu Jan 31 11:00:57 2013 (r246145) @@ -0,0 +1,61 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2013 Hans Petter Selasky. 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. +# + +# +# USB test application +# + +.PATH: ${.CURDIR} + +PROG= usbloader +MAN= +SRCS= + +CFLAGS+= -Wall +CFLAGS+= -g + +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 +CFLAGS+= -mpreferred-stack-boundary=2 +.endif +.if ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -m32 +.endif + +LDFLAGS+= -Wl,--gc-sections + +SRCS+= bsd_usbloader_test.c + +LDADD+= libusbboot.a +DPADD+= libusbboot.a + +all: libusbboot.a + +.include + +libusbboot.a: + make -f Makefile Added: head/sys/boot/usb/bsd_busspace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/usb/bsd_busspace.c Thu Jan 31 11:00:57 2013 (r246145) @@ -0,0 +1,207 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2013 Hans Petter Selasky. 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 + +struct burst { + uint32_t dw0; + uint32_t dw1; + uint32_t dw2; + uint32_t dw3; + uint32_t dw4; + uint32_t dw5; + uint32_t dw6; + uint32_t dw7; +}; + +void +bus_space_read_multi_1(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint8_t *datap, bus_size_t count) +{ + while (count--) { + *datap++ = bus_space_read_1(t, h, offset); + } +} + +void +bus_space_read_multi_2(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint16_t *datap, bus_size_t count) +{ + while (count--) { + *datap++ = bus_space_read_2(t, h, offset); + } +} + +void +bus_space_read_multi_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint32_t *datap, bus_size_t count) +{ + h += offset; + + while (count--) { + *datap++ = *((volatile uint32_t *)h); + } +} + +void +bus_space_write_multi_1(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint8_t *datap, bus_size_t count) +{ + while (count--) { + uint8_t temp = *datap++; + + bus_space_write_1(t, h, offset, temp); + } +} + +void +bus_space_write_multi_2(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint16_t *datap, bus_size_t count) +{ + while (count--) { + uint16_t temp = *datap++; + + bus_space_write_2(t, h, offset, temp); + } +} + +void +bus_space_write_multi_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint32_t *datap, bus_size_t count) +{ + h += offset; + + while (count--) { + *((volatile uint32_t *)h) = *datap++; + } +} + +void +bus_space_write_1(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint8_t data) +{ + *((volatile uint8_t *)(h + offset)) = data; +} + +void +bus_space_write_2(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint16_t data) +{ + *((volatile uint16_t *)(h + offset)) = data; +} + +void +bus_space_write_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint32_t data) +{ + *((volatile uint32_t *)(h + offset)) = data; +} + +uint8_t +bus_space_read_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t offset) +{ + return (*((volatile uint8_t *)(h + offset))); +} + +uint16_t +bus_space_read_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t offset) +{ + return (*((volatile uint16_t *)(h + offset))); +} + +uint32_t +bus_space_read_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t offset) +{ + return (*((volatile uint32_t *)(h + offset))); +} + +void +bus_space_read_region_1(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint8_t *datap, bus_size_t count) +{ + h += offset; + + while (count--) { + *datap++ = *((volatile uint8_t *)h); + h += 1; + } +} + +void +bus_space_write_region_1(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint8_t *datap, bus_size_t count) +{ + h += offset; + + while (count--) { + *((volatile uint8_t *)h) = *datap++; + h += 1; + } +} + +void +bus_space_read_region_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint32_t *datap, bus_size_t count) +{ + enum { BURST = sizeof(struct burst) / 4 }; + + h += offset; + + while (count >= BURST) { + *(struct burst *)datap = *((/* volatile */ struct burst *)h); + + h += BURST * 4; + datap += BURST; + count -= BURST; + } + + while (count--) { + *datap++ = *((volatile uint32_t *)h); + h += 4; + } +} + +void +bus_space_write_region_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint32_t *datap, bus_size_t count) +{ + enum { BURST = sizeof(struct burst) / 4 }; + + h += offset; + + while (count >= BURST) { + *((/* volatile */ struct burst *)h) = *(struct burst *)datap; + + h += BURST * 4; + datap += BURST; + count -= BURST; + } + + while (count--) { + *((volatile uint32_t *)h) = *datap++; + h += 4; + } +} Added: head/sys/boot/usb/bsd_global.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/usb/bsd_global.h Thu Jan 31 11:00:57 2013 (r246145) @@ -0,0 +1,63 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2013 Hans Petter Selasky. 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. + */ + +#ifndef _BSD_GLOBAL_H_ +#define _BSD_GLOBAL_H_ + +#include + +#define USB_DEBUG_VAR usb_debug +#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 + +#endif /* _BSD_GLOBAL_H_ */ Added: head/sys/boot/usb/bsd_kernel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/usb/bsd_kernel.c Thu Jan 31 11:00:57 2013 (r246145) @@ -0,0 +1,1269 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2013 Hans Petter Selasky. 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 + +static struct usb_process usb_process[USB_PROC_MAX]; +static device_t usb_pci_root; + +/*------------------------------------------------------------------------* + * Implementation of mutex API + *------------------------------------------------------------------------*/ + +struct mtx Giant; + +static void +mtx_system_init(void *arg) +{ + mtx_init(&Giant, "Giant", NULL, MTX_DEF | MTX_RECURSE); +} +SYSINIT(mtx_system_init, SI_SUB_LOCK, SI_ORDER_MIDDLE, mtx_system_init, NULL); + +void +mtx_init(struct mtx *mtx, const char *name, const char *type, int opt) +{ + mtx->owned = 0; + mtx->parent = mtx; +} + +void +mtx_lock(struct mtx *mtx) +{ + mtx = mtx->parent; + mtx->owned++; +} + +void +mtx_unlock(struct mtx *mtx) +{ + mtx = mtx->parent; + mtx->owned--; +} + +int +mtx_owned(struct mtx *mtx) +{ + mtx = mtx->parent; + return (mtx->owned != 0); +} + +void +mtx_destroy(struct mtx *mtx) +{ + /* NOP */ +} + +/*------------------------------------------------------------------------* + * Implementation of shared/exclusive mutex API + *------------------------------------------------------------------------*/ + +void +sx_init_flags(struct sx *sx, const char *name, int flags) +{ + sx->owned = 0; +} + +void +sx_destroy(struct sx *sx) +{ + /* NOP */ +} + +void +sx_xlock(struct sx *sx) +{ + sx->owned++; +} + +void +sx_xunlock(struct sx *sx) +{ + sx->owned--; +} + +int +sx_xlocked(struct sx *sx) +{ + return (sx->owned != 0); +} + +/*------------------------------------------------------------------------* + * Implementaiton of condition variable API + *------------------------------------------------------------------------*/ + +void +cv_init(struct cv *cv, const char *desc) +{ + cv->sleeping = 0; +} + +void +cv_destroy(struct cv *cv) +{ + /* NOP */ +} + +void +cv_wait(struct cv *cv, struct mtx *mtx) +{ + cv_timedwait(cv, mtx, -1); +} + +int +cv_timedwait(struct cv *cv, struct mtx *mtx, int timo) +{ + int start = ticks; + int delta; + + if (cv->sleeping) + return (EWOULDBLOCK); /* not allowed */ + + cv->sleeping = 1; + + while (cv->sleeping) { + if (timo >= 0) { + delta = ticks - start; + if (delta >= timo || delta < 0) + break; + } + mtx_unlock(mtx); + + usb_idle(); + + mtx_lock(mtx); + } + + if (cv->sleeping) { + cv->sleeping = 0; + return (EWOULDBLOCK); /* not allowed */ + } + return (0); +} + +void +cv_signal(struct cv *cv) +{ + cv->sleeping = 0; +} + +void +cv_broadcast(struct cv *cv) +{ + cv->sleeping = 0; +} + +/*------------------------------------------------------------------------* + * Implementation of callout API + *------------------------------------------------------------------------*/ + +static void callout_proc_msg(struct usb_proc_msg *); + +volatile int ticks = 0; + +static LIST_HEAD(, callout) head_callout = LIST_HEAD_INITIALIZER(&head_callout); + +static struct mtx mtx_callout; +static struct usb_proc_msg callout_msg[2]; + +static void +callout_system_init(void *arg) +{ + mtx_init(&mtx_callout, "callout-mtx", NULL, MTX_DEF | MTX_RECURSE); + + callout_msg[0].pm_callback = &callout_proc_msg; + callout_msg[1].pm_callback = &callout_proc_msg; +} +SYSINIT(callout_system_init, SI_SUB_LOCK, SI_ORDER_MIDDLE, callout_system_init, NULL); + +static void +callout_callback(struct callout *c) +{ + mtx_lock(c->mtx); + + mtx_lock(&mtx_callout); + if (c->entry.le_prev != NULL) { + LIST_REMOVE(c, entry); + c->entry.le_prev = NULL; + } + mtx_unlock(&mtx_callout); + + if (c->func) + (c->func) (c->arg); + + if (!(c->flags & CALLOUT_RETURNUNLOCKED)) + mtx_unlock(c->mtx); +} + +void +callout_process(int timeout) +{ + ticks += timeout; + usb_proc_msignal(usb_process + 2, &callout_msg[0], &callout_msg[1]); +} + +static void +callout_proc_msg(struct usb_proc_msg *pmsg) +{ + struct callout *c; + int delta; + +repeat: + mtx_lock(&mtx_callout); + + LIST_FOREACH(c, &head_callout, entry) { + + delta = c->timeout - ticks; + if (delta < 0) { + mtx_unlock(&mtx_callout); + + callout_callback(c); + + goto repeat; + } + } + mtx_unlock(&mtx_callout); +} + +void +callout_init_mtx(struct callout *c, struct mtx *mtx, int flags) +{ + memset(c, 0, sizeof(*c)); + + if (mtx == NULL) + mtx = &Giant; + + c->mtx = mtx; + c->flags = (flags & CALLOUT_RETURNUNLOCKED); +} + +void +callout_reset(struct callout *c, int to_ticks, + void (*func) (void *), void *arg) +{ + callout_stop(c); + + c->func = func; + c->arg = arg; + c->timeout = ticks + to_ticks; + + mtx_lock(&mtx_callout); + LIST_INSERT_HEAD(&head_callout, c, entry); + mtx_unlock(&mtx_callout); +} + +void +callout_stop(struct callout *c) +{ + mtx_lock(&mtx_callout); + + if (c->entry.le_prev != NULL) { + LIST_REMOVE(c, entry); + c->entry.le_prev = NULL; + } + mtx_unlock(&mtx_callout); + + c->func = NULL; + c->arg = NULL; +} + +void +callout_drain(struct callout *c) +{ + if (c->mtx == NULL) + return; /* not initialised */ + + mtx_lock(c->mtx); + callout_stop(c); + mtx_unlock(c->mtx); +} + +int +callout_pending(struct callout *c) +{ + int retval; + + mtx_lock(&mtx_callout); + retval = (c->entry.le_prev != NULL); + mtx_unlock(&mtx_callout); + + return (retval); +} + +/*------------------------------------------------------------------------* + * Implementation of device API + *------------------------------------------------------------------------*/ + +static const char unknown_string[] = { "unknown" }; + +static TAILQ_HEAD(, module_data) module_head = + TAILQ_HEAD_INITIALIZER(module_head); + +static uint8_t +devclass_equal(const char *a, const char *b) +{ + char ta, tb; + + if (a == b) + return (1); + + while (1) { + ta = *a; + tb = *b; + if (ta != tb) + return (0); + if (ta == 0) + break; + a++; + b++; + } + return (1); +} + +int +bus_generic_resume(device_t dev) +{ + return (0); +} + +int +bus_generic_shutdown(device_t dev) +{ + return (0); +} + +int +bus_generic_suspend(device_t dev) +{ + return (0); +} + +int +bus_generic_print_child(device_t dev, device_t child) +{ + return (0); +} + +void +bus_generic_driver_added(device_t dev, driver_t *driver) +{ + return; +} + +device_t +device_get_parent(device_t dev) +{ + return (dev ? dev->dev_parent : NULL); +} + +void +device_set_interrupt(device_t dev, intr_fn_t *fn, void *arg) +{ + dev->dev_irq_fn = fn; + dev->dev_irq_arg = arg; +} + +void +device_run_interrupts(device_t parent) +{ + device_t child; + + if (parent == NULL) + return; + + TAILQ_FOREACH(child, &parent->dev_children, dev_link) { + if (child->dev_irq_fn != NULL) + (child->dev_irq_fn) (child->dev_irq_arg); + } +} + +void +device_set_ivars(device_t dev, void *ivars) +{ + dev->dev_aux = ivars; +} + +void * +device_get_ivars(device_t dev) +{ + return (dev ? dev->dev_aux : NULL); +} + +int +device_get_unit(device_t dev) +{ + return (dev ? dev->dev_unit : 0); +} + +int +bus_generic_detach(device_t dev) +{ + device_t child; + int error; + + if (!dev->dev_attached) + return (EBUSY); + + TAILQ_FOREACH(child, &dev->dev_children, dev_link) { + if ((error = device_detach(child)) != 0) + return (error); + } + return (0); +} + +const char * +device_get_nameunit(device_t dev) +{ + if (dev && dev->dev_nameunit[0]) + return (dev->dev_nameunit); + + return (unknown_string); +} + +static uint8_t +devclass_create(devclass_t *dc_pp) +{ + if (dc_pp == NULL) { + return (1); + } + if (dc_pp[0] == NULL) { + dc_pp[0] = malloc(sizeof(**(dc_pp)), + M_DEVBUF, M_WAITOK | M_ZERO); + + if (dc_pp[0] == NULL) { + return (1); + } + } + return (0); +} + +static const struct module_data * +devclass_find_create(const char *classname) +{ + const struct module_data *mod; + + TAILQ_FOREACH(mod, &module_head, entry) { + if (devclass_equal(mod->mod_name, classname)) { + if (devclass_create(mod->devclass_pp)) { + continue; + } + return (mod); + } + } + return (NULL); +} + +static uint8_t +devclass_add_device(const struct module_data *mod, device_t dev) +{ + device_t *pp_dev; + device_t *end; + uint8_t unit; + + pp_dev = mod->devclass_pp[0]->dev_list; + end = pp_dev + DEVCLASS_MAXUNIT; + unit = 0; + + while (pp_dev != end) { + if (*pp_dev == NULL) { + *pp_dev = dev; + dev->dev_unit = unit; + dev->dev_module = mod; + snprintf(dev->dev_nameunit, + sizeof(dev->dev_nameunit), + "%s%d", device_get_name(dev), unit); + return (0); + } + pp_dev++; + unit++; + } + DPRINTF("Could not add device to devclass.\n"); + return (1); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 14:07:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E8E2A787; Thu, 31 Jan 2013 14:07:25 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3F5A951; Thu, 31 Jan 2013 14:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VE7PPU098203; Thu, 31 Jan 2013 14:07:25 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VE7PrX098202; Thu, 31 Jan 2013 14:07:25 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201301311407.r0VE7PrX098202@svn.freebsd.org> From: Steven Hartland Date: Thu, 31 Jan 2013 14:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246146 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 14:07:26 -0000 Author: smh Date: Thu Jan 31 14:07:24 2013 New Revision: 246146 URL: http://svnweb.freebsd.org/changeset/base/246146 Log: Format CDB output as 2 digit hex correcting the length Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Jan 31 11:00:57 2013 (r246145) +++ head/sys/cam/scsi/scsi_all.c Thu Jan 31 14:07:24 2013 (r246146) @@ -3139,7 +3139,7 @@ scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string = '\0'; for (i = 0; i < cdb_len; i++) snprintf(cdb_string + strlen(cdb_string), - len - strlen(cdb_string), "%x ", cdb_ptr[i]); + len - strlen(cdb_string), "%02hhx ", cdb_ptr[i]); return(cdb_string); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 16:04:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9145BD1; Thu, 31 Jan 2013 16:04:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D7142C; Thu, 31 Jan 2013 16:04:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VG4eJj034330; Thu, 31 Jan 2013 16:04:40 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VG4e1c034329; Thu, 31 Jan 2013 16:04:40 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301311604.r0VG4e1c034329@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Jan 2013 16:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246147 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 16:04:41 -0000 Author: brooks Date: Thu Jan 31 16:04:40 2013 New Revision: 246147 URL: http://svnweb.freebsd.org/changeset/base/246147 Log: When in -U mode do avoid setting SUID bits, but do not modify the mode variable so the intended mode can be logged correctly if -M is specified. Sponsored by: DARPA, AFRL Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Thu Jan 31 14:07:24 2013 (r246146) +++ head/usr.bin/xinstall/xinstall.c Thu Jan 31 16:04:40 2013 (r246147) @@ -953,9 +953,8 @@ install(const char *from_name, const cha } if (mode != (to_sb.st_mode & ALLPERMS)) { - if (dounpriv) - mode &= S_IRWXU|S_IRWXG|S_IRWXO; - if (fchmod(to_fd, mode)) { + if (fchmod(to_fd, + dounpriv ? mode & (S_IRWXU|S_IRWXG|S_IRWXO) : mode)) { serrno = errno; (void)unlink(to_name); errno = serrno; From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 16:39:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4E9687D2; Thu, 31 Jan 2013 16:39:51 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26F3524C; Thu, 31 Jan 2013 16:39:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VGdpCC044247; Thu, 31 Jan 2013 16:39:51 GMT (envelope-from gahr@svn.freebsd.org) Received: (from gahr@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VGdo0Q044244; Thu, 31 Jan 2013 16:39:50 GMT (envelope-from gahr@svn.freebsd.org) Message-Id: <201301311639.r0VGdo0Q044244@svn.freebsd.org> From: Pietro Cerutti Date: Thu, 31 Jan 2013 16:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246148 - in head: lib/libc/stdio tools/regression/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 16:39:51 -0000 Author: gahr (ports committer) Date: Thu Jan 31 16:39:50 2013 New Revision: 246148 URL: http://svnweb.freebsd.org/changeset/base/246148 Log: - Remove underscores from the internal structure name, as it doesn't collide with the user's namespace. - Correct size and position variables type from long to size_t. - Do not set errno to ENOMEM on malloc failure, as malloc already does so. - Implement the concept of "buffer data length", which mandates what SEEK_END refers to and the allowed extent for a read. - Use NULL as read-callback if the buffer is opened in write-only mode. Conversely, use NULL as write-callback when opened in read-only mode. - Implement the handling of the ``b'' character in the mode argument. A binary buffer differs from a text buffer (default mode if ``b'' is omitted) in that NULL bytes are never appended to writes and that the "buffer data length" equals to the size of the buffer. - Remove shall from the man page. Use indicative instead. Also, specify that the ``b'' flag does not conform with POSIX but is supported by glibc. - Update the regression test so that the ``b'' functionality and the "buffer data length" concepts are tested. - Minor style(9) corrections. Suggested by: jilles Reviewed by: cognet Approved by: cognet Modified: head/lib/libc/stdio/fmemopen.c head/lib/libc/stdio/fopen.3 head/tools/regression/lib/libc/stdio/test-fmemopen.c Modified: head/lib/libc/stdio/fmemopen.c ============================================================================== --- head/lib/libc/stdio/fmemopen.c Thu Jan 31 16:04:40 2013 (r246147) +++ head/lib/libc/stdio/fmemopen.c Thu Jan 31 16:39:50 2013 (r246148) @@ -26,17 +26,21 @@ SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); +#include #include #include #include #include +#include "local.h" -struct __fmemopen_cookie +struct fmemopen_cookie { - char *buf; /* pointer to the memory region */ - char own; /* did we allocate the buffer ourselves? */ - long len; /* buffer length in bytes */ - long off; /* current offset into the buffer */ + char *buf; /* pointer to the memory region */ + char own; /* did we allocate the buffer ourselves? */ + char bin; /* is this a binary buffer? */ + size_t size; /* buffer length in bytes */ + size_t len; /* data length in bytes */ + size_t off; /* current offset into the buffer */ }; static int fmemopen_read (void *cookie, char *buf, int nbytes); @@ -47,33 +51,95 @@ static int fmemopen_close (void *cookie) FILE * fmemopen (void * __restrict buf, size_t size, const char * __restrict mode) { - /* allocate cookie */ - struct __fmemopen_cookie *ck = malloc (sizeof (struct __fmemopen_cookie)); + struct fmemopen_cookie *ck; + FILE *f; + int flags, rc; + + /* + * Retrieve the flags as used by open(2) from the mode argument, and + * validate them. + * */ + rc = __sflags (mode, &flags); + if (rc == 0) { + errno = EINVAL; + return (NULL); + } + + /* + * There's no point in requiring an automatically allocated buffer + * in write-only mode. + */ + if (!(flags & O_RDWR) && buf == NULL) { + errno = EINVAL; + return (NULL); + } + + /* Allocate a cookie. */ + ck = malloc (sizeof (struct fmemopen_cookie)); if (ck == NULL) { - errno = ENOMEM; return (NULL); } - ck->off = 0; - ck->len = size; + ck->off = 0; + ck->size = size; - /* do we have to allocate the buffer ourselves? */ + /* Check whether we have to allocate the buffer ourselves. */ ck->own = ((ck->buf = buf) == NULL); if (ck->own) { ck->buf = malloc (size); if (ck->buf == NULL) { free (ck); - errno = ENOMEM; return (NULL); } + } + + /* + * POSIX distinguishes between w+ and r+, in that w+ is supposed to + * truncate the buffer. + */ + if (ck->own || mode[0] == 'w') { ck->buf[0] = '\0'; } - if (mode[0] == 'a') - ck->off = strnlen(ck->buf, ck->len); + /* Check for binary mode. */ + ck->bin = strchr(mode, 'b') != NULL; - /* actuall wrapper */ - FILE *f = funopen ((void *)ck, fmemopen_read, fmemopen_write, + /* + * The size of the current buffer contents is set depending on the + * mode: + * + * for append (text-mode), the position of the first NULL byte, or the + * size of the buffer if none is found + * + * for append (binary-mode), the size of the buffer + * + * for read, the size of the buffer + * + * for write, 0 + */ + switch (mode[0]) { + case 'a': + if (ck->bin) { + /* + * This isn't useful, since the buffer isn't + * allowed to grow. + */ + ck->off = ck->len = size; + } else + ck->off = ck->len = strnlen(ck->buf, ck->size); + break; + case 'r': + ck->len = size; + break; + case 'w': + ck->len = 0; + break; + } + + /* Actuall wrapper. */ + f = funopen ((void *)ck, + flags & O_WRONLY ? NULL : fmemopen_read, + flags & O_RDONLY ? NULL : fmemopen_write, fmemopen_seek, fmemopen_close); if (f == NULL) { @@ -83,8 +149,10 @@ fmemopen (void * __restrict buf, size_t return (NULL); } - /* turn off buffering, so a write past the end of the buffer - * correctly returns a short object count */ + /* + * Turn off buffering, so a write past the end of the buffer + * correctly returns a short object count. + */ setvbuf (f, (char *) NULL, _IONBF, 0); return (f); @@ -93,7 +161,7 @@ fmemopen (void * __restrict buf, size_t static int fmemopen_read (void *cookie, char *buf, int nbytes) { - struct __fmemopen_cookie *ck = cookie; + struct fmemopen_cookie *ck = cookie; if (nbytes > ck->len - ck->off) nbytes = ck->len - ck->off; @@ -111,10 +179,10 @@ fmemopen_read (void *cookie, char *buf, static int fmemopen_write (void *cookie, const char *buf, int nbytes) { - struct __fmemopen_cookie *ck = cookie; + struct fmemopen_cookie *ck = cookie; - if (nbytes > ck->len - ck->off) - nbytes = ck->len - ck->off; + if (nbytes > ck->size - ck->off) + nbytes = ck->size - ck->off; if (nbytes == 0) return (0); @@ -123,7 +191,16 @@ fmemopen_write (void *cookie, const char ck->off += nbytes; - if (ck->off < ck->len && ck->buf[ck->off - 1] != '\0') + if (ck->off > ck->len) + ck->len = ck->off; + + /* + * We append a NULL byte if all these conditions are met: + * - the buffer is not binary + * - the buffer is not full + * - the data just written doesn't already end with a NULL byte + */ + if (!ck->bin && ck->off < ck->size && ck->buf[ck->off - 1] != '\0') ck->buf[ck->off] = '\0'; return (nbytes); @@ -132,12 +209,12 @@ fmemopen_write (void *cookie, const char static fpos_t fmemopen_seek (void *cookie, fpos_t offset, int whence) { - struct __fmemopen_cookie *ck = cookie; + struct fmemopen_cookie *ck = cookie; switch (whence) { case SEEK_SET: - if (offset > ck->len) { + if (offset > ck->size) { errno = EINVAL; return (-1); } @@ -145,7 +222,7 @@ fmemopen_seek (void *cookie, fpos_t offs break; case SEEK_CUR: - if (ck->off + offset > ck->len) { + if (ck->off + offset > ck->size) { errno = EINVAL; return (-1); } @@ -171,7 +248,7 @@ fmemopen_seek (void *cookie, fpos_t offs static int fmemopen_close (void *cookie) { - struct __fmemopen_cookie *ck = cookie; + struct fmemopen_cookie *ck = cookie; if (ck->own) free (ck->buf); Modified: head/lib/libc/stdio/fopen.3 ============================================================================== --- head/lib/libc/stdio/fopen.3 Thu Jan 31 16:04:40 2013 (r246147) +++ head/lib/libc/stdio/fopen.3 Thu Jan 31 16:39:50 2013 (r246148) @@ -118,7 +118,9 @@ after either the or the first letter. This is strictly for compatibility with .St -isoC -and has no effect; the ``b'' is ignored. +and has effect only for +.Fn fmemopen +; otherwise the ``b'' is ignored. .Pp Any created files will have mode .Do Dv S_IRUSR @@ -216,7 +218,7 @@ and arguments with a stream. The .Fa buf -argument shall be either a null pointer or point to a buffer that +argument is either a null pointer or point to a buffer that is at least .Fa size bytes long. @@ -224,10 +226,15 @@ If a null pointer is specified as the .Fa buf argument, .Fn fmemopen -shall allocate +allocates .Fa size -bytes of memory. This buffer shall be automatically freed when the -stream is closed. +bytes of memory. This buffer is automatically freed when the +stream is closed. Buffers can be opened in text-mode (default) or binary-mode +(if ``b'' is present in the second or third position of the +.Fa mode +argument). Buffers opened in text-mode make sure that writes are terminated with +a NULL byte, if the last write hasn't filled up the whole buffer. Buffers +opened in binary-mode never append a NULL byte. .Sh RETURN VALUES Upon successful completion .Fn fopen , @@ -327,3 +334,5 @@ The function conforms to .St -p1003.1-2008 . +The ``b'' mode does not conform to any standard +but is also supported by glibc. Modified: head/tools/regression/lib/libc/stdio/test-fmemopen.c ============================================================================== --- head/tools/regression/lib/libc/stdio/test-fmemopen.c Thu Jan 31 16:04:40 2013 (r246147) +++ head/tools/regression/lib/libc/stdio/test-fmemopen.c Thu Jan 31 16:39:50 2013 (r246148) @@ -41,7 +41,7 @@ void test_preexisting () { /* - * use a pre-existing buffer + * Use a pre-existing buffer. */ char buf[512]; @@ -53,48 +53,52 @@ test_preexisting () size_t nofw, nofr; int rc; - /* open a FILE * using fmemopen */ - fp = fmemopen (buf, sizeof buf, "w"); + /* Open a FILE * using fmemopen. */ + fp = fmemopen (buf, sizeof(buf), "w"); assert (fp != NULL); - /* write to the buffer */ - nofw = fwrite (str, 1, sizeof str, fp); - assert (nofw == sizeof str); + /* Write to the buffer. */ + nofw = fwrite (str, 1, sizeof(str), fp); + assert (nofw == sizeof(str)); - /* close the FILE * */ + /* Close the FILE *. */ rc = fclose (fp); assert (rc == 0); - /* re-open the FILE * to read back the data */ - fp = fmemopen (buf, sizeof buf, "r"); + /* Re-open the FILE * to read back the data. */ + fp = fmemopen (buf, sizeof(buf), "r"); assert (fp != NULL); - /* read from the buffer */ - bzero (buf2, sizeof buf2); - nofr = fread (buf2, 1, sizeof buf2, fp); - assert (nofr == sizeof buf2); + /* Read from the buffer. */ + bzero (buf2, sizeof(buf2)); + nofr = fread (buf2, 1, sizeof(buf2), fp); + assert (nofr == sizeof(buf2)); - /* since a write on a FILE * retrieved by fmemopen + /* + * Since a write on a FILE * retrieved by fmemopen * will add a '\0' (if there's space), we can check - * the strings for equality */ + * the strings for equality. + */ assert (strcmp(str, buf2) == 0); - /* close the FILE * */ + /* Close the FILE *. */ rc = fclose (fp); assert (rc == 0); - /* now open a FILE * on the first 4 bytes of the string */ + /* Now open a FILE * on the first 4 bytes of the string. */ fp = fmemopen (str, 4, "w"); assert (fp != NULL); - /* try to write more bytes than we shoud, we'll get a short count (4) */ - nofw = fwrite (str2, 1, sizeof str2, fp); + /* + * Try to write more bytes than we shoud, we'll get a short count (4). + */ + nofw = fwrite (str2, 1, sizeof(str2), fp); assert (nofw == 4); - /* close the FILE * */ + /* Close the FILE *. */ rc = fclose (fp); - /* check that the string was not modified after the first 4 bytes */ + /* Check that the string was not modified after the first 4 bytes. */ assert (strcmp (str, str3) == 0); } @@ -102,7 +106,7 @@ void test_autoalloc () { /* - * let fmemopen allocate the buffer + * Let fmemopen allocate the buffer. */ char str[] = "A quick test"; @@ -111,8 +115,8 @@ test_autoalloc () size_t nofw, nofr, i; int rc; - /* open a FILE * using fmemopen */ - fp = fmemopen (NULL, 512, "w"); + /* Open a FILE * using fmemopen. */ + fp = fmemopen (NULL, 512, "w+"); assert (fp != NULL); /* fill the buffer */ @@ -121,15 +125,118 @@ test_autoalloc () assert (nofw == 1); } - /* get the current position into the stream */ + /* Get the current position into the stream. */ pos = ftell (fp); assert (pos == 512); - /* try to write past the end, we should get a short object count (0) */ + /* + * Try to write past the end, we should get a short object count (0) + */ nofw = fwrite ("a", 1, 1, fp); assert (nofw == 0); - /* close the FILE * */ + /* Close the FILE *. */ + rc = fclose (fp); + assert (rc == 0); +} + +void +test_data_length () +{ + /* + * Here we test that a read operation doesn't go past the end of the + * data actually written, and that a SEEK_END seeks from the end of the + * data, not of the whole buffer. + */ + FILE *fp; + char buf[512] = {'\0'}; + char str[] = "Test data length. "; + char str2[] = "Do we have two sentences?"; + char str3[sizeof(str) + sizeof(str2) -1]; + long pos; + size_t nofw, nofr; + int rc; + + /* Open a FILE * for updating our buffer. */ + fp = fmemopen (buf, sizeof(buf), "w+"); + assert (fp != NULL); + + /* Write our string into the buffer. */ + nofw = fwrite (str, 1, sizeof(str), fp); + assert (nofw == sizeof(str)); + + /* + * Now seek to the end and check that ftell + * gives us sizeof(str). + */ + rc = fseek (fp, 0, SEEK_END); + assert (rc == 0); + pos = ftell (fp); + assert (pos == sizeof(str)); + + /* Close the FILE *. */ + rc = fclose (fp); + assert (rc == 0); + + /* Reopen the buffer for appending. */ + fp = fmemopen (buf, sizeof(buf), "a+"); + assert (fp != NULL); + + /* We should now be writing after the first string. */ + nofw = fwrite (str2, 1, sizeof(str2), fp); + assert (nofw == sizeof(str2)); + + /* Rewind the FILE *. */ + rc = fseek (fp, 0, SEEK_SET); + assert (rc == 0); + + /* Make sure we're at the beginning. */ + pos = ftell (fp); + assert (pos == 0); + + /* Read the whole buffer. */ + nofr = fread (str3, 1, sizeof(buf), fp); + assert (nofr == sizeof(str3)); + + /* Make sure the two strings are there. */ + assert (strncmp (str3, str, sizeof(str) - 1) == 0); + assert (strncmp (str3 + sizeof(str) - 1, str2, sizeof(str2)) == 0); + + /* Close the FILE *. */ + rc = fclose (fp); + assert (rc == 0); +} + +void +test_binary () +{ + /* + * Make sure that NULL bytes are never appended when opening a buffer + * in binary mode. + */ + + FILE *fp; + char buf[20]; + char str[] = "Test"; + size_t nofw; + int rc, i; + + /* Pre-fill the buffer. */ + memset (buf, 'A', sizeof(buf)); + + /* Open a FILE * in binary mode. */ + fp = fmemopen (buf, sizeof(buf), "w+b"); + assert (fp != NULL); + + /* Write some data into it. */ + nofw = fwrite (str, 1, strlen(str), fp); + assert (nofw == strlen(str)); + + /* Make sure that the buffer doesn't contain any NULL bytes. */ + for (i = 0; i < sizeof(buf); i++) + assert (buf[i] != '\0'); + + /* Close the FILE *. */ rc = fclose (fp); assert (rc == 0); } @@ -139,5 +246,7 @@ main (void) { test_autoalloc (); test_preexisting (); + test_data_length (); + test_binary (); return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 16:44:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57CB9AC9; Thu, 31 Jan 2013 16:44:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 489BB299; Thu, 31 Jan 2013 16:44:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VGiQY0046489; Thu, 31 Jan 2013 16:44:26 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VGiOnv046470; Thu, 31 Jan 2013 16:44:24 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201301311644.r0VGiOnv046470@svn.freebsd.org> From: "Simon J. Gerraty" Date: Thu, 31 Jan 2013 16:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246149 - in vendor/NetBSD/bmake/dist: . mk mk/sys unit-tests X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 16:44:26 -0000 Author: sjg Date: Thu Jan 31 16:44:23 2013 New Revision: 246149 URL: http://svnweb.freebsd.org/changeset/base/246149 Log: Import bmake-20130123 Approved by: marcel (mentor) Added: vendor/NetBSD/bmake/dist/Makefile (contents, props changed) vendor/NetBSD/bmake/dist/Makefile.config.in (contents, props changed) vendor/NetBSD/bmake/dist/makefile.in (contents, props changed) vendor/NetBSD/bmake/dist/mk/ vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/FILES vendor/NetBSD/bmake/dist/mk/README vendor/NetBSD/bmake/dist/mk/auto.dep.mk vendor/NetBSD/bmake/dist/mk/auto.obj.mk vendor/NetBSD/bmake/dist/mk/autoconf.mk vendor/NetBSD/bmake/dist/mk/autodep.mk vendor/NetBSD/bmake/dist/mk/dep.mk vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/doc.mk vendor/NetBSD/bmake/dist/mk/dpadd.mk vendor/NetBSD/bmake/dist/mk/final.mk vendor/NetBSD/bmake/dist/mk/gendirdeps.mk vendor/NetBSD/bmake/dist/mk/host-target.mk vendor/NetBSD/bmake/dist/mk/host.libnames.mk vendor/NetBSD/bmake/dist/mk/inc.mk vendor/NetBSD/bmake/dist/mk/init.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/install-new.mk vendor/NetBSD/bmake/dist/mk/java.mk vendor/NetBSD/bmake/dist/mk/lib.mk vendor/NetBSD/bmake/dist/mk/libnames.mk vendor/NetBSD/bmake/dist/mk/libs.mk vendor/NetBSD/bmake/dist/mk/links.mk vendor/NetBSD/bmake/dist/mk/man.mk vendor/NetBSD/bmake/dist/mk/meta.autodep.mk vendor/NetBSD/bmake/dist/mk/meta.stage.mk vendor/NetBSD/bmake/dist/mk/meta.subdir.mk vendor/NetBSD/bmake/dist/mk/meta.sys.mk vendor/NetBSD/bmake/dist/mk/meta2deps.py (contents, props changed) vendor/NetBSD/bmake/dist/mk/meta2deps.sh (contents, props changed) vendor/NetBSD/bmake/dist/mk/mk-files.txt (contents, props changed) vendor/NetBSD/bmake/dist/mk/nls.mk vendor/NetBSD/bmake/dist/mk/obj.mk vendor/NetBSD/bmake/dist/mk/options.mk vendor/NetBSD/bmake/dist/mk/own.mk vendor/NetBSD/bmake/dist/mk/prlist.mk vendor/NetBSD/bmake/dist/mk/prog.mk vendor/NetBSD/bmake/dist/mk/progs.mk vendor/NetBSD/bmake/dist/mk/rst2htm.mk vendor/NetBSD/bmake/dist/mk/scripts.mk vendor/NetBSD/bmake/dist/mk/srctop.mk vendor/NetBSD/bmake/dist/mk/subdir.mk vendor/NetBSD/bmake/dist/mk/sys/ vendor/NetBSD/bmake/dist/mk/sys.clean-env.mk vendor/NetBSD/bmake/dist/mk/sys.dependfile.mk vendor/NetBSD/bmake/dist/mk/sys.mk vendor/NetBSD/bmake/dist/mk/sys/AIX.mk vendor/NetBSD/bmake/dist/mk/sys/Darwin.mk vendor/NetBSD/bmake/dist/mk/sys/Generic.mk vendor/NetBSD/bmake/dist/mk/sys/HP-UX.mk vendor/NetBSD/bmake/dist/mk/sys/IRIX.mk vendor/NetBSD/bmake/dist/mk/sys/Linux.mk vendor/NetBSD/bmake/dist/mk/sys/NetBSD.mk vendor/NetBSD/bmake/dist/mk/sys/OSF1.mk vendor/NetBSD/bmake/dist/mk/sys/OpenBSD.mk vendor/NetBSD/bmake/dist/mk/sys/SunOS.mk vendor/NetBSD/bmake/dist/mk/sys/UnixWare.mk vendor/NetBSD/bmake/dist/mk/target-flags.mk vendor/NetBSD/bmake/dist/mk/warnings.mk vendor/NetBSD/bmake/dist/mk/yacc.mk Deleted: vendor/NetBSD/bmake/dist/Makefile.in Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/FILES vendor/NetBSD/bmake/dist/bmake.1 vendor/NetBSD/bmake/dist/bmake.cat1 vendor/NetBSD/bmake/dist/boot-strap vendor/NetBSD/bmake/dist/bsd.after-import.mk vendor/NetBSD/bmake/dist/compat.c vendor/NetBSD/bmake/dist/configure vendor/NetBSD/bmake/dist/configure.in vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/make-bootstrap.sh.in vendor/NetBSD/bmake/dist/make.1 vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/realpath.c vendor/NetBSD/bmake/dist/unit-tests/Makefile.in vendor/NetBSD/bmake/dist/var.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Thu Jan 31 16:39:50 2013 (r246148) +++ vendor/NetBSD/bmake/dist/ChangeLog Thu Jan 31 16:44:23 2013 (r246149) @@ -1,3 +1,35 @@ +2013-01-27 Simon J. Gerraty + + * Merge with NetBSD make, pick up + o make.1: more info on how shell commands are handled. + o job.c,main.c: detect write errors to job pipes. + +2013-01-25 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20130123 + Merge with NetBSD make, pick up + o meta.c: if script uses .OODATE and meta_oodate() decides + rebuild is needed, .OODATE will be empty - set it to .ALLSRC. + o var.c: in debug output indicate which variabale modifiers + apply to. + o remove Check_Cwd logic the makefiles have been fixed. + +2012-12-12 Simon J. Gerraty + + * makefile.in: add a simple makefile for folk who insist on + ./configure; make; make install + it just runs boot-strap + * include mk/* to accommodate the above + * boot-strap: re-work to accommodate the above + mksrc defaults to $Mydir/mk + allow op={configure,build,install,clean,all} + add options to facilitate install + * Makefile.config.in: just the bits set by configure + * Makefile: bump version to 20121212 + abandon Makefile.in (NetBSD Makefile) + leverage mk/* instead + * configure.in: ensure srcdir is absolute + 2012-11-11 Simon J. Gerraty * Makefile.in (MAKE_VERSION): 20121111 Modified: vendor/NetBSD/bmake/dist/FILES ============================================================================== --- vendor/NetBSD/bmake/dist/FILES Thu Jan 31 16:39:50 2013 (r246148) +++ vendor/NetBSD/bmake/dist/FILES Thu Jan 31 16:44:23 2013 (r246149) @@ -4,7 +4,9 @@ bmake.cat1 boot-strap bsd.after-import.mk os.sh -Makefile.in +makefile.in +Makefile +Makefile.config.in PSD.doc/Makefile PSD.doc/tutorial.ms README @@ -120,3 +122,63 @@ unit-tests/test.exp unit-tests/unexport unit-tests/unexport-env unit-tests/varcmd +mk/ChangeLog +mk/FILES +mk/README +mk/auto.obj.mk +mk/autoconf.mk +mk/autodep.mk +mk/auto.dep.mk +mk/dep.mk +mk/doc.mk +mk/dpadd.mk +mk/final.mk +mk/host-target.mk +mk/host.libnames.mk +mk/inc.mk +mk/init.mk +mk/install-mk +mk/java.mk +mk/lib.mk +mk/libnames.mk +mk/libs.mk +mk/links.mk +mk/man.mk +mk/mk-files.txt +mk/nls.mk +mk/obj.mk +mk/options.mk +mk/own.mk +mk/prlist.mk +mk/prog.mk +mk/progs.mk +mk/rst2htm.mk +mk/scripts.mk +mk/srctop.mk +mk/subdir.mk +mk/sys.mk +mk/sys.clean-env.mk +mk/sys.dependfile.mk +mk/sys/AIX.mk +mk/sys/Darwin.mk +mk/sys/Generic.mk +mk/sys/HP-UX.mk +mk/sys/IRIX.mk +mk/sys/Linux.mk +mk/sys/NetBSD.mk +mk/sys/OSF1.mk +mk/sys/OpenBSD.mk +mk/sys/SunOS.mk +mk/sys/UnixWare.mk +mk/target-flags.mk +mk/warnings.mk +mk/yacc.mk +mk/dirdeps.mk +mk/gendirdeps.mk +mk/install-new.mk +mk/meta2deps.py +mk/meta2deps.sh +mk/meta.sys.mk +mk/meta.autodep.mk +mk/meta.stage.mk +mk/meta.subdir.mk Added: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/bmake/dist/Makefile Thu Jan 31 16:44:23 2013 (r246149) @@ -0,0 +1,221 @@ +# $Id: Makefile,v 1.5 2013/01/28 19:31:58 sjg Exp $ + +# Base version on src date +MAKE_VERSION= 20130123 + +PROG= bmake + +SRCS= \ + arch.c \ + buf.c \ + compat.c \ + cond.c \ + dir.c \ + for.c \ + hash.c \ + job.c \ + main.c \ + make.c \ + make_malloc.c \ + meta.c \ + parse.c \ + str.c \ + strlist.c \ + suff.c \ + targ.c \ + trace.c \ + util.c \ + var.c + +# from lst.lib/ +SRCS+= \ + lstAppend.c \ + lstAtEnd.c \ + lstAtFront.c \ + lstClose.c \ + lstConcat.c \ + lstDatum.c \ + lstDeQueue.c \ + lstDestroy.c \ + lstDupl.c \ + lstEnQueue.c \ + lstFind.c \ + lstFindFrom.c \ + lstFirst.c \ + lstForEach.c \ + lstForEachFrom.c \ + lstInit.c \ + lstInsert.c \ + lstIsAtEnd.c \ + lstIsEmpty.c \ + lstLast.c \ + lstMember.c \ + lstNext.c \ + lstOpen.c \ + lstPrev.c \ + lstRemove.c \ + lstReplace.c \ + lstSucc.c + +# this file gets generated by configure +.-include "Makefile.config" + +.if !empty(LIBOBJS) +SRCS+= ${LIBOBJS:T:.o=.c} +.endif + +# just in case +prefix?= /usr +srcdir?= ${.CURDIR} + +DEFAULT_SYS_PATH?= .../share/mk:${prefix}/share/mk + +CPPFLAGS+= -DUSE_META +CFLAGS+= ${CPPFLAGS} +CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" +CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE +CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} +COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\"" + +# meta mode can be useful even without filemon +FILEMON_H ?= /usr/include/dev/filemon/filemon.h +.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" +COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} +.endif + +.PATH: ${srcdir} +.PATH: ${srcdir}/lst.lib + +.if make(obj) || make(clean) +SUBDIR+= unit-tests +.endif + +# start-delete1 for bsd.after-import.mk +# we skip a lot of this when building as part of FreeBSD etc. + +# list of OS's which are derrived from BSD4.4 +BSD44_LIST= NetBSD FreeBSD OpenBSD DragonFly +# we are... +OS!= uname -s +# are we 4.4BSD ? +isBSD44:=${BSD44_LIST:M${OS}} + +.if ${isBSD44} == "" +MANTARGET= cat +INSTALL?=${srcdir}/install-sh +.if (${MACHINE} == "sun386") +# even I don't have one of these anymore :-) +CFLAGS+= -DPORTAR +.elif (${MACHINE} != "sunos") +SRCS+= sigcompat.c +CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART +.endif +.else +MANTARGET?= man +.endif + +# turn this on by default - ignored if we are root +WITH_INSTALL_AS_USER= + +# supress with -DWITHOUT_* +OPTIONS_DEFAULT_YES+= \ + AUTOCONF_MK \ + INSTALL_MK \ + PROG_LINK + +OPTIONS_DEFAULT_NO+= \ + PROG_VERSION + +# process options now +.include + +.if ${MK_PROG_VERSION} == "yes" +PROG_NAME= ${PROG}-${MAKE_VERSION} +.if ${MK_PROG_LINK} == "yes" +SYMLINKS+= ${PROG}-${MAKE_VERSION} ${BINDIR}/${PROG} +.endif +.endif + +EXTRACT_MAN=no +# end-delete1 + +MAN= ${PROG}.1 +MAN1= ${MAN} + +.if (${PROG} != "make") +CLEANFILES+= my.history +.if make(${MAN}) || !exists(${srcdir}/${MAN}) +my.history: ${MAKEFILE} + @(echo ".Nm"; \ + echo "is derived from NetBSD"; \ + echo ".Xr make 1 ."; \ + echo "It uses autoconf to facilitate portability to other platforms."; \ + echo ".Pp") > $@ + +.NOPATH: ${MAN} +${MAN}: make.1 my.history + @echo making $@ + @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \ + -e '/^.Sh HISTORY/rmy.history' \ + -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@ + +all beforeinstall: ${MAN} +_mfromdir=. +.endif +.endif + +MANTARGET?= cat +MANDEST?= ${MANDIR}/${MANTARGET}1 + +.if ${MANTARGET} == "cat" +_mfromdir=${srcdir} +.endif + +.include + +CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H +COPTS.var.c += -Wno-cast-qual +COPTS.job.c += -Wno-format-nonliteral +COPTS.parse.c += -Wno-format-nonliteral +COPTS.var.c += -Wno-format-nonliteral + +# Force these +SHAREDIR= ${prefix}/share +BINDIR= ${prefix}/bin +MANDIR= ${SHAREDIR}/man + +.if !exists(.depend) +${OBJS}: config.h +.endif +.if ${MK_AUTOCONF_MK} == "yes" +.include +.endif + +# make sure that MAKE_VERSION gets updated. +main.o: ${SRCS} ${MAKEFILE} + +# start-delete2 for bsd.after-import.mk +SHARE_MK?=${SHAREDIR}/mk +MKSRC=${srcdir}/mk +INSTALL?=${srcdir}/install-sh + +.if ${MK_INSTALL_MK} == "yes" +install: install-mk +.endif + +beforeinstall: + test -d ${DESTDIR}${BINDIR} || ${INSTALL} -m 775 -d ${DESTDIR}${BINDIR} + test -d ${DESTDIR}${MANDEST} || ${INSTALL} -m 775 -d ${DESTDIR}${MANDEST} + +install-mk: +.if exists(${MKSRC}/install-mk) + test -d ${DESTDIR}${SHARE_MK} || ${INSTALL} -m 775 -d ${DESTDIR}${SHARE_MK} + sh ${MKSRC}/install-mk -v -m 644 ${DESTDIR}${SHARE_MK} +.else + @echo need to unpack mk.tar.gz under ${srcdir} or set MKSRC; false +.endif +# end-delete2 + +# A simple unit-test driver to help catch regressions +accept test: + cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET} Added: vendor/NetBSD/bmake/dist/Makefile.config.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/bmake/dist/Makefile.config.in Thu Jan 31 16:44:23 2013 (r246149) @@ -0,0 +1,16 @@ +# things set by configure + +prefix= @prefix@ +srcdir= @srcdir@ +CC?= @CC@ +MACHINE= @machine@ +MACHINE_ARCH= @machine_arch@ +DEFAULT_SYS_PATH= @default_sys_path@ + +CPPFLAGS+= @CPPFLAGS@ +CFLAGS+= ${CPPFLAGS} @DEFS@ +LDFLAGS= @LDFLAGS@ +LIBOBJS= @LIBOBJS@ +LDADD= @LIBS@ +USE_META= @use_meta@ +FILEMON_H= @filemon_h@ Modified: vendor/NetBSD/bmake/dist/bmake.1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.1 Thu Jan 31 16:39:50 2013 (r246148) +++ vendor/NetBSD/bmake/dist/bmake.1 Thu Jan 31 16:44:23 2013 (r246149) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.209 2012/10/08 15:09:48 christos Exp $ +.\" $NetBSD: make.1,v 1.210 2013/01/27 18:52:01 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd October 8, 2012 +.Dd January 23, 2013 .Dt MAKE 1 .Os .Sh NAME @@ -468,6 +468,50 @@ except that the effect can be limited to A .Ql Ic \- causes any non-zero exit status of the command line to be ignored. +.Pp +When +.Nm +is run in jobs mode with +.Fl j Ar max_jobs , +the entire script for the target is fed to a +single instance of the shell. +.Pp +In compatibility (non-jobs) mode, each command is run in a separate process. +If the command contains any shell meta characters +.Pq Ql #=|^(){};&<>*?[]:$`\e\en +it will be passed to the shell, otherwise +.Nm +will attempt direct execution. +.Pp +Since +.Nm +will +.Xr chdir 2 +to +.Ql Va .OBJDIR +before executing any targets, each child process +starts with that as its current working directory. +.Pp +Makefiles should be written so that the mode of +.Nm +operation does not change their behavior. +For example, any command which needs to use +.Dq cd +or +.Dq chdir , +without side-effect should be put in parenthesis: +.Bd -literal -offset indent + +avoid-chdir-side-effects: + @echo Building $@ in `pwd` + @(cd ${.CURDIR} && ${.MAKE} $@) + @echo Back in `pwd` + +ensure-one-shell-regardless-of-mode: + @echo Building $@ in `pwd`; \\ + (cd ${.CURDIR} && ${.MAKE} $@); \\ + echo Back in `pwd` +.Ed .Sh VARIABLE ASSIGNMENTS Variables in make are much like variables in the shell, and, by tradition, consist of all upper-case letters. @@ -2027,28 +2071,6 @@ NetBSD 5.0 so that they still appear to be variable expansions. In particular this stops them being treated as syntax, and removes some obscure problems using them in .if statements. -.Pp -Unlike other -.Nm -programs, this implementation by default executes all commands for a given -target using a single shell invocation. -This is done for both efficiency and to simplify error handling in remote -command invocations. -Typically this is transparent to the user, unless the target commands change -the current working directory using -.Dq cd -or -.Dq chdir . -To be compatible with Makefiles that do this, one can use -.Fl B -to disable this behavior. -.Pp -In compatibility mode, each command is run in a separate process. -If the command contains any shell meta characters -.Pq Ql #=|^(){};&<>*?[]:$`\e\en -it will be passed to the shell, otherwise -.Nm -will attempt direct execution. .Sh SEE ALSO .Xr mkdep 1 .Sh HISTORY Modified: vendor/NetBSD/bmake/dist/bmake.cat1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.cat1 Thu Jan 31 16:39:50 2013 (r246148) +++ vendor/NetBSD/bmake/dist/bmake.cat1 Thu Jan 31 16:44:23 2013 (r246149) @@ -284,6 +284,32 @@ SSHHEELLLL CCOOMMMMAANNDDSS line of a script. A `--' causes any non-zero exit status of the command line to be ignored. + When bbmmaakkee is run in jobs mode with --jj _m_a_x___j_o_b_s, the entire script for + the target is fed to a single instance of the shell. + + In compatibility (non-jobs) mode, each command is run in a separate + process. If the command contains any shell meta characters + (`#=|^(){};&<>*?[]:$`\\n') it will be passed to the shell, otherwise + bbmmaakkee will attempt direct execution. + + Since bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R' before executing any targets, each + child process starts with that as its current working directory. + + Makefiles should be written so that the mode of bbmmaakkee operation does not + change their behavior. For example, any command which needs to use + ``cd'' or ``chdir'', without side-effect should be put in parenthesis: + + + avoid-chdir-side-effects: + @echo Building $@ in `pwd` + @(cd ${.CURDIR} && ${.MAKE} $@) + @echo Back in `pwd` + + ensure-one-shell-regardless-of-mode: + @echo Building $@ in `pwd`; \ + (cd ${.CURDIR} && ${.MAKE} $@); \ + echo Back in `pwd` + VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS Variables in make are much like variables in the shell, and, by tradi- tion, consist of all upper-case letters. @@ -1293,19 +1319,6 @@ CCOOMMPPAATTIIBBIILLIITTYY stops them being treated as syntax, and removes some obscure problems using them in .if statements. - Unlike other bbmmaakkee programs, this implementation by default executes all - commands for a given target using a single shell invocation. This is - done for both efficiency and to simplify error handling in remote command - invocations. Typically this is transparent to the user, unless the tar- - get commands change the current working directory using ``cd'' or - ``chdir''. To be compatible with Makefiles that do this, one can use --BB - to disable this behavior. - - In compatibility mode, each command is run in a separate process. If the - command contains any shell meta characters (`#=|^(){};&<>*?[]:$`\\n') it - will be passed to the shell, otherwise bbmmaakkee will attempt direct execu- - tion. - SSEEEE AALLSSOO mkdep(1) @@ -1327,4 +1340,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 October 8, 2012 NetBSD 5.1 +NetBSD 5.1 January 23, 2013 NetBSD 5.1 Modified: vendor/NetBSD/bmake/dist/boot-strap ============================================================================== --- vendor/NetBSD/bmake/dist/boot-strap Thu Jan 31 16:39:50 2013 (r246148) +++ vendor/NetBSD/bmake/dist/boot-strap Thu Jan 31 16:44:23 2013 (r246149) @@ -3,23 +3,52 @@ # boot-strap # # SYNOPSIS: -# boot-strap [--"configure_arg" ... ][-s "srcdir"][-m "mksrc"]\\ -# ["prefix" ["bmakesrc" ["mksrc"]]] +# boot-strap ["options"] +# boot-strap --prefix=/opt --install +# boot-strap --prefix=$HOME --install-host-target -DWITH_PROG_VERSION +# boot-strap ["options"] op=build +# boot-strap ["options"] op=install # # DESCRIPTION: # This script is used to configure/build bmake it builds for -# each OS in a subdir to keep the src clean. -# On successful completion it echos commands to put the new -# bmake binary into the /configs tree (if it exists) -# (http://www.crufty.net/FreeWare/configs.html), $prefix/bin -# and a suitable ~/*bin directory. +# each host-target in a different subdir to keep the src clean. +# There is no requirement for an existing make(1). # +# On successful completion if no '--install' flag is given, +# it echos a command to do installation. +# +# The variable "op" defaults to 'all', and is affected by +# '--install' flag as above. +# Other values include: +# +# configure +# Just run 'configure' +# +# build +# If 'configure' has not been done, do it, then +# run the build script, and finally 'test'. +# +# install +# If 'build' has not been done, do it, 'test' then +# install. +# +# clean +# attempt to clean up +# +# test +# run the unit-tests. Done automatically after 'build' +# and before 'install'. +# +# The above are leveraged by a trivial makefile for the benefit +# of those that have './configure; make; make install' baked +# into them. +# # Options: # # -c "rc" # Pick up settings from "rc". # We look for '.bmake-boot-strap.rc' before processing -# options. +# options (unless SKIP_RC is set in environment). # # --share "share_dir" # Where to put man pages and mk files. @@ -28,9 +57,28 @@ # # --mksrc "mksrc" # Indicate where the mk files can be found. -# Default is ./mk or ../mk, set to 'none' to force -# building without "mksrc" but in that case a sys.mk -# needs to exist in the default syspath ($share_dir/mk) +# Default is $Mydir/mk +# +# --install +# If build and test work, run bmake install. +# BINDIR=$prefix/bin +# SHAREDIR=$prefix/share +# +# --install-host-target +# As for '--install' but BINDIR=$prefix/$HOST_TARGET/bin +# This is useful when $prefix/ is shared by multiple +# machines. +# +# Flags relevant when installing: +# +# -DWITHOUT_INSTALL_MK +# Skip installing mk files. +# By default they will be installed to $prefix/share/mk +# +# -DWITH_PROG_VERSION +# Install 'bmake' as 'bmake-$MAKE_VERSION' +# A symlink will be made as 'bmake' unless +# -DWITHOUT_PROG_LINK is set. # # Possibly useful configure_args: # @@ -63,7 +111,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.39 2012/03/26 17:08:22 sjg Exp $ +# $Id: boot-strap,v 1.42 2013/01/25 20:20:33 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -85,11 +133,10 @@ case "$Mydir" in *) Mydir=`cd "$Mydir" && 'pwd'`;; esac - Usage() { [ "$1" ] && echo "ERROR: $@" >&2 echo "Usage:" >&2 - echo "$0 [-- ...][-s ][-m ][ [[] []]]" >&2 + echo "$0 [-- ...][][--install]" >&2 exit 1 } @@ -110,28 +157,55 @@ source_rc() { done } +cmd_args="$@" + +# --install[-host-target] will set this +INSTALL_PREFIX= +# other things we pass to install step +INSTALL_ARGS= CONFIGURE_ARGS= MAKESYSPATH= # pick a useful default prefix (for me at least ;-) for prefix in /opt/$HOST_TARGET "$HOME/$HOST_TARGET" /usr/pkg /usr/local "" do - [ -d "${prefix:-.}" ] && break + [ -d "${prefix:-.}" ] || continue + case "$prefix" in + */$HOST_TARGET) + p=`dirname $prefix` + if [ -d $p/share ]; then + INSTALL_BIN=$HOST_TARGET/bin + prefix=$p + fi + ;; + esac + echo "NOTE: default prefix=$prefix ${INSTALL_BIN:+INSTALL_BIN=$INSTALL_BIN}" + break done -srcdir= -mksrc= +srcdir=$Mydir +mksrc=$Mydir/mk objdir= quiet=: -source_rc .bmake-boot-strap.rc . "$Mydir/.." "$HOME" +${SKIP_RC:+:} source_rc .bmake-boot-strap.rc . "$Mydir/.." "$HOME" get_optarg() { expr "x$1" : "x[^=]*=\\(.*\\)" } +here=`'pwd'` +if [ $here = $Mydir ]; then + # avoid polution + OBJROOT=../ +fi + +op=all +BMAKE= + while : do case "$1" in --) shift; break;; + --help) sed -n -e "1d;/RCSid/,\$d" -e '/^#\.[a-z]/d' -e '/^#/s,^# *,,p' $0; exit 0;; --prefix) prefix="$2"; shift;; --prefix=*) prefix=`get_optarg "$1"`;; --src=*) srcdir=`get_optarg "$1"`;; @@ -144,6 +218,13 @@ do --with-default-sys-path) CONFIGURE_ARGS="$1 $2" MAKESYSPATH="$2"; shift;; + --install) INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix};; + --install-host-target) + INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix} + INSTALL_BIN=$HOST_TARGET/bin;; + --install-destdir=*) INSTALL_DESTDIR=`get_optarg "$1"`;; + --install-prefix=*) INSTALL_PREFIX=`get_optarg "$1"`;; + -DWITH*) INSTALL_ARGS="$INSTALL_ARGS $1";; -s|--src) srcdir="$2"; shift;; -m|--mksrc) mksrc="$2"; shift;; -o|--objdir) objdir="$2"; shift;; @@ -261,7 +342,7 @@ none|-) # we don't want it esac # Ok, get to work... -objdir="${objdir:-$OS}" +objdir="${objdir:-$OBJROOT$HOST_TARGET}" [ -d "$objdir" ] || mkdir -p "$objdir" [ -d "$objdir" ] || mkdir "$objdir" cd "$objdir" || exit 1 @@ -301,88 +382,80 @@ if [ "$mksrc" ]; then export CFLAGS_MF CFLAGS_MD fi -$srcdir/configure $CONFIGURE_ARGS || exit 1 -chmod 755 make-bootstrap.sh || exit 1 -./make-bootstrap.sh || exit 1 -if [ -z "$MAKESYSPATH" ]; then - add_path "${share_dir:-...}/mk" MAKESYSPATH - case "$HOST_TARGET" in - netbsd*) add_path /usr/share/mk MAKESYSPATH;; - esac -fi -if [ -s "${mksrc:-/dev/null}/install-mk" ]; then - sh "${mksrc}/install-mk" "$objdir/mk" - case "$MAKESYSPATH" in - .../mk*) ;; - *) MAKESYSPATH=".../mk:${MAKESYSPATH}";; - esac -fi +# this makes it easy to run the bmake we just built +# the :tA dance is needed because 'pwd' and even /bin/pwd +# may not give the same result as realpath(). +Bmake() { + ( + cd $Mydir && + MAKESYSPATH=$mksrc SRCTOP=$Mydir OBJTOP=$objdir \ + MAKEOBJDIR='${.CURDIR:S,${SRCTOP:tA},${OBJTOP:tA},}' \ + ${BMAKE:-$objdir/bmake} -f $Mydir/Makefile "$@" + ) +} + # make sure test below uses the same diff that configure did TOOL_DIFF=`type diff | sed 's,[()],,g;s,^[^/][^/]*,,;q'` -export MAKESYSPATH TOOL_DIFF -if [ "$mksrc" ]; then - $objdir/bmake test || exit 1 -else - # assume nothing - $objdir/bmake -r -m / test || exit 1 -fi -# If -q given, we don't want all the install instructions -$quiet exit 0 +export TOOL_DIFF -make_version=`./bmake -r -m / -f ./Makefile -V MAKE_VERSION | ( read one two; echo $one )` -bmake_version=bmake-$make_version +op_configure() { + $srcdir/configure $CONFIGURE_ARGS || exit 1 +} -if [ -s /usr/share/tmac/andoc.tmac ]; then - # this should be ok - man_subdir=man1 - man_src=$srcdir/bmake.1 -else - # guess not - man_subdir=cat1 - man_src=$srcdir/bmake.cat1 -fi +op_build() { + [ -s make-bootstrap.sh ] || op_configure + chmod 755 make-bootstrap.sh || exit 1 + ./make-bootstrap.sh || exit 1 + case "$op" in + build) op_test;; + esac +} -install_prefix() { - ( - bin_dir= - share_dir= - man_dir= - mk_dir= - while : - do - case "$1" in - *=*) eval "$1"; shift;; - *) break;; - esac - done - bin_dir=${bin_dir:-$1/bin} - share_dir=${share_dir:-`ShareDir "$1"`} - man_dir=${man_dir:-$share_dir/man} - mk_dir=${mk_dir:-$share_dir/mk} - echo - echo Commands to install into $1/ - echo - echo mkdir -p $bin_dir - echo cp $objdir/bmake $bin_dir/$bmake_version - echo rm -f $bin_dir/bmake - echo ln -s $bmake_version $bin_dir/bmake - echo mkdir -p $man_dir/$man_subdir - echo cp $man_src $man_dir/$man_subdir/bmake.1 - if [ "$mksrc" ]; then - ev=`env | grep '_MK='` - echo $ev sh $mksrc/install-mk $mk_dir +op_test() { + [ -x bmake ] || op_build + Bmake test || exit 1 +} + +op_clean() { + if [ -x bmake ]; then + ln bmake bmake$$ + BMAKE=$objdir/bmake$$ Bmake clean + rm -f bmake$$ + elif [ $objdir != $srcdir ]; then + rm -rf * fi - ) } -case "$prefix/" in -"$HOME"/*) ;; -*) CONFIGS=${CONFIGS:-/configs} - [ -d $CONFIGS ] && - install_prefix mksrc= "$CONFIGS/$OS/$OSMAJOR.X/$MACHINE_ARCH$prefix" - # I like to keep a copy here... - install_prefix share_dir="$HOME/share" "$HOME/$HOST_TARGET" - ;; -esac +op_install() { + op_test + case "$INSTALL_PREFIX,$INSTALL_BIN,$prefix" in + ,$HOST_TARGET/bin,*/$HOST_TARGET) + INSTALL_PREFIX=`dirname $prefix` + ;; + esac + INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix} + Bmake install prefix=$INSTALL_PREFIX BINDIR=$INSTALL_PREFIX/${INSTALL_BIN:-bin} ${INSTALL_DESTDIR:+DESTDIR=$INSTALL_DESTDIR} $INSTALL_ARGS || exit 1 +} + +op_all() { + rm -f make-bootstrap.sh bmake *.o + if [ -n "$INSTALL_PREFIX" ]; then + op_install + else + op_test + MAKE_VERSION=`sed -n '/^MAKE_VERSION/ { s,.*= *,,;p; }' $srcdir/Makefile` + echo You can install by running: + echo + echo $0 $cmd_args op=install + echo + echo "Use --install-prefix=/something to install somewhere other than $prefix" + echo "Use --install-destdir=/somewhere to set DESTDIR during install" + echo "Use --install-host-target to use INSTALL_BIN=$HOST_TARGET/bin" + echo "Use -DWITH_PROG_VERSION to install as bmake-$MAKE_VERSION" + echo "Use -DWITHOUT_PROG_LINK to supress bmake -> bmake-$MAKE_VERSION symlink" + echo "Use -DWITHOUT_INSTALL_MK to skip installing files to $prefix/share/mk" + fi +} -install_prefix "$prefix" +op_$op +exit 0 Modified: vendor/NetBSD/bmake/dist/bsd.after-import.mk ============================================================================== --- vendor/NetBSD/bmake/dist/bsd.after-import.mk Thu Jan 31 16:39:50 2013 (r246148) +++ vendor/NetBSD/bmake/dist/bsd.after-import.mk Thu Jan 31 16:44:23 2013 (r246149) @@ -1,4 +1,4 @@ -# $Id: bsd.after-import.mk,v 1.9 2012/09/20 00:30:15 sjg Exp $ +# $Id: bsd.after-import.mk,v 1.11 2012/12/29 19:32:25 sjg Exp $ # This makefile is for use when integrating bmake into a BSD build # system. Use this makefile after importing bmake. @@ -48,36 +48,36 @@ DEFAULT_SYS_PATH= .../share/mk:/usr/shar BOOTSTRAP_ARGS = \ --with-default-sys-path='${DEFAULT_SYS_PATH}' \ --prefix /usr \ - --share /usr/share \ - --mksrc none + --share /usr/share + # run boot-strap with minimal influence bootstrap: ${BMAKE_SRC}/boot-strap ${MAKEFILE} - HOME=/ ${BMAKE_SRC}/boot-strap ${BOOTSTRAP_ARGS} ${BOOTSTRAP_XTRAS} + HOME=/ ${BMAKE_SRC}/boot-strap -o ${HOST_OS} ${BOOTSTRAP_ARGS} ${BOOTSTRAP_XTRAS} touch ${.TARGET} # Makefiles need a little more tweaking than say config.h MAKEFILE_SED = sed -e '/^MACHINE/d' \ -e '/^PROG/ { s,=,?=,;s,bmake,$${.CURDIR:T},; }' \ -e 's,^.-include,.sinclude,' \ + -e '/^\..*include * ${.CURDIR}/$f .endfor -.for f in ${configured_files:M*Makefile} +.for f in ${configured_files:M*Makefile*} @echo Capturing $f @mkdir -p ${${.CURDIR}/$f:L:H} @(echo '# This is a generated file, do NOT edit!'; \ echo '# See ${_this:S,${SRCTOP}/,,}'; \ - echo '#'; echo '# $$${OS}$$'; echo; \ + echo '#'; echo '# $$${HOST_OS}$$'; echo; \ echo 'SRCTOP?= $${.CURDIR:${${.CURDIR}/$f:L:H:S,${SRCTOP}/,,:C,[^/]+,H,g:S,/,:,g}}'; echo; \ ${MAKEFILE_SED} ${HOST_OS}/$f ) > ${.CURDIR}/$f .endfor @@ -87,18 +87,22 @@ _makefile: bootstrap ${MAKEFILE} @echo Generating ${.CURDIR}/Makefile @(echo '# This is a generated file, do NOT edit!'; \ echo '# See ${_this:S,${SRCTOP}/,,}'; \ - echo '#'; echo '# $$${OS}$$'; \ + echo '#'; echo '# $$${HOST_OS}$$'; \ echo; echo '.sinclude "Makefile.inc"'; \ echo; echo 'SRCTOP?= $${.CURDIR:${.CURDIR:S,${SRCTOP}/,,:C,[^/]+,H,g:S,/,:,g}}'; \ echo; echo '# look here first for config.h'; \ echo 'CFLAGS+= -I$${.CURDIR}'; echo; \ - ${MAKEFILE_SED} ${HOST_OS}/Makefile; \ + echo '# for after-import'; \ + echo 'CLEANDIRS+= ${HOST_OS}'; \ + echo 'CLEANFILES+= bootstrap'; echo; \ + ${MAKEFILE_SED} \ + ${1 2:L:@n@-e '/start-delete$n/,/end-delete$n/d'@} \ + ${BMAKE_SRC}/Makefile; \ echo; echo '# override some simple things'; \ echo 'BINDIR= /usr/bin'; \ echo 'MANDIR= ${MANDIR:U/usr/share/man}'; \ echo; echo '# make sure we get this'; \ echo 'CFLAGS+= $${COPTS.$${.IMPSRC:T}}'; \ - echo 'CLEANFILES+= bootstrap'; \ echo; echo 'after-import: ${_this:S,${SRCTOP},\${SRCTOP},}'; \ echo ' cd $${.CURDIR} && $${.MAKE} -f ${_this:S,${SRCTOP},\${SRCTOP},}'; \ echo ) > ${.TARGET} Modified: vendor/NetBSD/bmake/dist/compat.c ============================================================================== --- vendor/NetBSD/bmake/dist/compat.c Thu Jan 31 16:39:50 2013 (r246148) +++ vendor/NetBSD/bmake/dist/compat.c Thu Jan 31 16:44:23 2013 (r246149) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.90 2012/10/07 19:17:31 sjg Exp $ */ +/* $NetBSD: compat.c,v 1.91 2013/01/25 02:01:10 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.90 2012/10/07 19:17:31 sjg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.91 2013/01/25 02:01:10 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.90 2012/10/07 19:17:31 sjg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.91 2013/01/25 02:01:10 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -377,7 +377,6 @@ again: Fatal("Could not fork"); } if (cpid == 0) { - Check_Cwd(av); Var_ExportVars(); #ifdef USE_META if (useMeta) { Modified: vendor/NetBSD/bmake/dist/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/NetBSD/bmake/dist/configure.in ============================================================================== --- vendor/NetBSD/bmake/dist/configure.in Thu Jan 31 16:39:50 2013 (r246148) +++ vendor/NetBSD/bmake/dist/configure.in Thu Jan 31 16:44:23 2013 (r246149) @@ -1,12 +1,18 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.45 2012/06/20 22:43:41 sjg Exp $ +dnl $Id: configure.in,v 1.46 2012/12/28 21:28:18 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl -AC_INIT([bmake], [20120620], [sjg@NetBSD.org]) +AC_INIT([bmake], [20121212], [sjg@NetBSD.org]) AC_CONFIG_HEADER(config.h) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 16:47:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 883FBC58; Thu, 31 Jan 2013 16:47:35 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2F02BD; Thu, 31 Jan 2013 16:47:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VGlZM1046942; Thu, 31 Jan 2013 16:47:35 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VGlZAT046941; Thu, 31 Jan 2013 16:47:35 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201301311647.r0VGlZAT046941@svn.freebsd.org> From: "Simon J. Gerraty" Date: Thu, 31 Jan 2013 16:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246150 - vendor/NetBSD/bmake/20130123 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 16:47:35 -0000 Author: sjg Date: Thu Jan 31 16:47:34 2013 New Revision: 246150 URL: http://svnweb.freebsd.org/changeset/base/246150 Log: Tag bmake-20130123 Approved by: marcel (mentor) Added: vendor/NetBSD/bmake/20130123/ - copied from r246149, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 17:04:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B6C1FD3; Thu, 31 Jan 2013 17:04:19 +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 5D16A387; Thu, 31 Jan 2013 17:04:19 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 44DF7B922; Thu, 31 Jan 2013 12:04:18 -0500 (EST) From: John Baldwin To: Pietro Cerutti Subject: Re: svn commit: r246120 - in head: include lib/libc/stdio tools/regression/lib/libc/stdio Date: Thu, 31 Jan 2013 11:23:08 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301301459.r0UExQKw074249@svn.freebsd.org> In-Reply-To: <201301301459.r0UExQKw074249@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201301311123.09015.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 31 Jan 2013 12:04:18 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 17:04:19 -0000 On Wednesday, January 30, 2013 9:59:26 am Pietro Cerutti wrote: > Author: gahr (ports committer) > Date: Wed Jan 30 14:59:26 2013 > New Revision: 246120 > URL: http://svnweb.freebsd.org/changeset/base/246120 > > Log: > Add fmemopen(3), an interface to get a FILE * from a buffer in memory, along > with the respective regression test. > See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html > > Reviewed by: cognet > Approved by: cognet A few style suggestions: > Added: head/lib/libc/stdio/fmemopen.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libc/stdio/fmemopen.c Wed Jan 30 14:59:26 2013 (r246120) > @@ -0,0 +1,182 @@ > +/*- > +Copyright (C) 2013 Pietro Cerutti > + > +Redistribution and use in source and binary forms, with or without > +modification, are permitted provided that the following conditions > +are met: This is atypical style for license blocks. They always have a leading ' *' in other C files. In as much as possible this should match the template in /usr/share/examples/etc/bsd-style-copyright as much as possible. > +static int fmemopen_read (void *cookie, char *buf, int nbytes); > +static int fmemopen_write (void *cookie, const char *buf, int nbytes); > +static fpos_t fmemopen_seek (void *cookie, fpos_t offset, int whence); > +static int fmemopen_close (void *cookie); BSD style does not have spaces between function names and the list of arguments both in prototypes and calls. > + > +FILE * > +fmemopen (void * __restrict buf, size_t size, const char * __restrict mode) > +{ > + /* allocate cookie */ Banal comment (this is already obvious from the code). > + struct __fmemopen_cookie *ck = malloc (sizeof (struct __fmemopen_cookie)); Extra spaces after 'malloc' and 'sizeof'. Bruce also generally frowns upon assignments in declarations. > + if (ck == NULL) { > + errno = ENOMEM; > + return (NULL); > + } > + > + ck->off = 0; > + ck->len = size; > + > + /* do we have to allocate the buffer ourselves? */ Capitalize 'do' here as this is a sentence. (Comments should be full sentences when possible) > + ck->own = ((ck->buf = buf) == NULL); > + if (ck->own) { > + ck->buf = malloc (size); > + if (ck->buf == NULL) { > + free (ck); Not sure if you should save errno around free (once you let the malloc() error fall through per jilles@ notes). > + errno = ENOMEM; > + return (NULL); > + } > + ck->buf[0] = '\0'; > + } > + > + if (mode[0] == 'a') > + ck->off = strnlen(ck->buf, ck->len); > + > + /* actuall wrapper */ s/actuall/actual/, but I would just remove this comment instead. > + FILE *f = funopen ((void *)ck, fmemopen_read, fmemopen_write, > + fmemopen_seek, fmemopen_close); Cast to (void *) is not required in ANSI C and is just ugly. > + /* turn off buffering, so a write past the end of the buffer > + * correctly returns a short object count */ Please format this per style(9): /* * Turn off buffering so a write past the end of the buffer * correctl returns a short object count. */ > + setvbuf (f, (char *) NULL, _IONBF, 0); Note that a user can override this by calling setvbuf() on the returned FILE object. Not sure that is worth obsessing over. > +static int > +fmemopen_read (void *cookie, char *buf, int nbytes) > +{ > + struct __fmemopen_cookie *ck = cookie; > + > + if (nbytes > ck->len - ck->off) > + nbytes = ck->len - ck->off; > + > + if (nbytes == 0) > + return (0); > + > + memcpy (buf, ck->buf + ck->off, nbytes); > + > + ck->off += nbytes; > + > + return (nbytes); I would probably trim the blank lines here a bit. Certainly between the memcpy() and ck->off assignment, but I would probably trim this down to just one blank line between the variable declarations and the code body. Similar in other places. > +static fpos_t > +fmemopen_seek (void *cookie, fpos_t offset, int whence) > +{ > + struct __fmemopen_cookie *ck = cookie; > + > + > + switch (whence) { > + case SEEK_SET: > + if (offset > ck->len) { > + errno = EINVAL; > + return (-1); This should return POS_ERR on failure. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 17:12:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0061B3BD for ; Thu, 31 Jan 2013 17:12:06 +0000 (UTC) (envelope-from tarap@ecdcllc.org) Received: from mail01.abxconnect.net (arpa-166.010.atl-001.abraxis.com [64.29.166.10]) by mx1.freebsd.org (Postfix) with ESMTP id B6A2562D for ; Thu, 31 Jan 2013 17:12:06 +0000 (UTC) Received: (qmail 716 invoked by uid 399); 31 Jan 2013 17:05:20 -0000 Received: from unknown (HELO PERSONAL-8AE75D) (tarap@ecdcllc.org@190.249.30.94) (de-)crypted with TLSv1: RC4-MD5 [128/128] DN=unknown by mail01.abxconnect.net with ESMTPSAMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM; 31 Jan 2013 17:05:20 -0000 X-Originating-IP: 190.249.30.94 X-Sender: tarap@ecdcllc.org From: Gene Wilder To: svn-src-all@freebsd.org Subject: Fwd: Photos X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 Message-Id: <20130131171207.0061B3BD@hub.freebsd.org> Date: Thu, 31 Jan 2013 17:12:06 +0000 (UTC) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 17:12:07 -0000 R29vZCBkYXksIA0KeW91ciBwaG90b3MgaGVyZSBodHRwOi8vc29uY2Eub3JnL3Bob3Rvcy5odG0= From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 19:24:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7AD0E2F; Thu, 31 Jan 2013 19:24:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DBBFCB5; Thu, 31 Jan 2013 19:24:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VJOYxC095035; Thu, 31 Jan 2013 19:24:34 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VJOYgp095032; Thu, 31 Jan 2013 19:24:34 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301311924.r0VJOYgp095032@svn.freebsd.org> From: Sean Bruno Date: Thu, 31 Jan 2013 19:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246152 - stable/9/sys/dev/ciss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 19:24:34 -0000 Author: sbruno Date: Thu Jan 31 19:24:33 2013 New Revision: 246152 URL: http://svnweb.freebsd.org/changeset/base/246152 Log: MFC r245459 Satisfy the intent of kern/151564: [ciss] ciss(4) should increase CISS_MAX_LOGICAL to 107 Submitter wanted to increase the number of logical disks supported by ciss(4) by simply raising the CISS_MAX_LOGICAL value even higher. Instead, consult the documentation for the raid controller (OPENCISS) and poke the controller bits to ask it for how many logical/physical disks it can handle. Revert svn R242089 that raised CISS_MAX_LOGICAL to 64 for all controllers. For older controllers that don't support this mechanism, fallback to the old value of 16 logical disks. Tested on P420, P410, P400 and 6i model ciss(4) controllers. This should will be MFC'd back to stable/9 stable/8 and stable/7 after the MFC period. Modified: stable/9/sys/dev/ciss/ciss.c stable/9/sys/dev/ciss/cissreg.h stable/9/sys/dev/ciss/cissvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Thu Jan 31 18:56:58 2013 (r246151) +++ stable/9/sys/dev/ciss/ciss.c Thu Jan 31 19:24:33 2013 (r246152) @@ -1202,13 +1202,21 @@ ciss_identify_adapter(struct ciss_softc /* XXX only really required for old 5300 adapters? */ sc->ciss_flags |= CISS_FLAG_BMIC_ABORT; + /* + * Earlier controller specs do not contain these config + * entries, so assume that a 0 means its old and assign + * these values to the defaults that were established + * when this driver was developed for them + */ + if (sc->ciss_cfg->max_logical_supported == 0) + sc->ciss_cfg->max_logical_supported = CISS_MAX_LOGICAL; + if (sc->ciss_cfg->max_physical_supported == 0) + sc->ciss_cfg->max_physical_supported = CISS_MAX_PHYSICAL; /* print information */ if (bootverbose) { -#if 0 /* XXX proxy volumes??? */ ciss_printf(sc, " %d logical drive%s configured\n", sc->ciss_id->configured_logical_drives, (sc->ciss_id->configured_logical_drives == 1) ? "" : "s"); -#endif ciss_printf(sc, " firmware %4.4s\n", sc->ciss_id->running_firmware_revision); ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_bus_count); @@ -1231,6 +1239,9 @@ ciss_identify_adapter(struct ciss_softc "\20\1ultra2\2ultra3\10fibre1\11fibre2\n"); ciss_printf(sc, " server name '%.16s'\n", sc->ciss_cfg->server_name); ciss_printf(sc, " heartbeat 0x%x\n", sc->ciss_cfg->heartbeat); + ciss_printf(sc, " max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); + ciss_printf(sc, " max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported); + ciss_printf(sc, " max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); } out: @@ -1318,7 +1329,7 @@ ciss_report_luns(struct ciss_softc *sc, break; case CISS_CMD_STATUS_DATA_OVERRUN: ciss_printf(sc, "WARNING: more units than driver limit (%d)\n", - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); break; default: ciss_printf(sc, "error detecting logical drive configuration (%s)\n", @@ -1352,7 +1363,7 @@ ciss_init_logical(struct ciss_softc *sc) debug_called(1); cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1360,9 +1371,9 @@ ciss_init_logical(struct ciss_softc *sc) /* sanity-check reply */ ndrives = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); - if ((ndrives < 0) || (ndrives > CISS_MAX_LOGICAL)) { + if ((ndrives < 0) || (ndrives > sc->ciss_cfg->max_logical_supported)) { ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", - ndrives, CISS_MAX_LOGICAL); + ndrives, sc->ciss_cfg->max_logical_supported); error = ENXIO; goto out; } @@ -1385,19 +1396,20 @@ ciss_init_logical(struct ciss_softc *sc) for (i = 0; i <= sc->ciss_max_logical_bus; i++) { sc->ciss_logical[i] = - malloc(CISS_MAX_LOGICAL * sizeof(struct ciss_ldrive), + malloc(sc->ciss_cfg->max_logical_supported * + sizeof(struct ciss_ldrive), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_logical[i] == NULL) { error = ENXIO; goto out; } - for (j = 0; j < CISS_MAX_LOGICAL; j++) + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) sc->ciss_logical[i][j].cl_status = CISS_LD_NONEXISTENT; } - for (i = 0; i < CISS_MAX_LOGICAL; i++) { + for (i = 0; i < sc->ciss_cfg->max_logical_supported; i++) { if (i < ndrives) { struct ciss_ldrive *ld; int bus, target; @@ -1439,7 +1451,7 @@ ciss_init_physical(struct ciss_softc *sc target = 0; cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1982,7 +1994,7 @@ ciss_free(struct ciss_softc *sc) bus_dma_tag_destroy(sc->ciss_parent_dmat); if (sc->ciss_logical) { for (i = 0; i <= sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { if (sc->ciss_logical[i][j].cl_ldrive) free(sc->ciss_logical[i][j].cl_ldrive, CISS_MALLOC_CLASS); if (sc->ciss_logical[i][j].cl_lstatus) @@ -2965,9 +2977,9 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->hba_inquiry = PI_TAG_ABLE; /* XXX is this correct? */ cpi->target_sprt = 0; cpi->hba_misc = 0; - cpi->max_target = CISS_MAX_LOGICAL; + cpi->max_target = sc->ciss_cfg->max_logical_supported; cpi->max_lun = 0; /* 'logical drive' channel only */ - cpi->initiator_id = CISS_MAX_LOGICAL; + cpi->initiator_id = sc->ciss_cfg->max_logical_supported; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "msmith@freebsd.org", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); @@ -3878,7 +3890,7 @@ ciss_notify_rescan_logical(struct ciss_s * drive address. */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) return; @@ -3889,7 +3901,7 @@ ciss_notify_rescan_logical(struct ciss_s * firmware. */ for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ld = &sc->ciss_logical[i][j]; if (ld->cl_update == 0) @@ -4058,7 +4070,7 @@ ciss_notify_hotplug(struct ciss_softc *s * Rescan the physical lun list for new items */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { ciss_printf(sc, "Warning, cannot get physical lun list\n"); break; @@ -4306,7 +4318,7 @@ ciss_print_adapter(struct ciss_softc *sc "\20\1notify_ok\2control_open\3aborting\4running\21fake_synch\22bmic_abort\n"); for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ciss_printf(sc, "LOGICAL DRIVE %d: ", i); ciss_print_ldrive(sc, &sc->ciss_logical[i][j]); } Modified: stable/9/sys/dev/ciss/cissreg.h ============================================================================== --- stable/9/sys/dev/ciss/cissreg.h Thu Jan 31 18:56:58 2013 (r246151) +++ stable/9/sys/dev/ciss/cissreg.h Thu Jan 31 19:24:33 2013 (r246152) @@ -425,6 +425,15 @@ struct ciss_config_table #define CISS_DRIVER_DAUGHTER_ATTACHED (1<<8) #define CISS_DRIVER_SCSI_PREFETCH (1<<9) u_int32_t max_sg_length; /* 31 in older firmware */ +/* + * these fields appear in OpenCISS Spec 1.06 + * http://cciss.sourceforge.net/#docs + */ + u_int32_t max_logical_supported; + u_int32_t max_physical_supported; + u_int32_t max_physical_per_logical; + u_int32_t max_perfomant_mode_cmds; + u_int32_t max_block_fetch_count; } __packed; /* Modified: stable/9/sys/dev/ciss/cissvar.h ============================================================================== --- stable/9/sys/dev/ciss/cissvar.h Thu Jan 31 18:56:58 2013 (r246151) +++ stable/9/sys/dev/ciss/cissvar.h Thu Jan 31 19:24:33 2013 (r246152) @@ -45,8 +45,11 @@ typedef STAILQ_HEAD(, ciss_request) cr_q /* * Maximum number of logical drives we support. + * If the controller does not indicate a maximum + * value. This is a compatibiliy value to support + * older ciss controllers (e.g. model 6i) */ -#define CISS_MAX_LOGICAL 63 +#define CISS_MAX_LOGICAL 16 /* * Maximum number of physical devices we support. From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 20:01:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A2326AFA; Thu, 31 Jan 2013 20:01:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 7F5F6E6E; Thu, 31 Jan 2013 20:01:46 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B1E85B94B; Thu, 31 Jan 2013 15:01:45 -0500 (EST) From: John Baldwin To: Pietro Cerutti Subject: Re: svn commit: r246120 - in head: include lib/libc/stdio tools/regression/lib/libc/stdio Date: Thu, 31 Jan 2013 15:01:39 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301301459.r0UExQKw074249@svn.freebsd.org> <201301311123.09015.jhb@freebsd.org> In-Reply-To: <201301311123.09015.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201301311501.39671.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 31 Jan 2013 15:01:45 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 20:01:46 -0000 On Thursday, January 31, 2013 11:23:08 am John Baldwin wrote: > On Wednesday, January 30, 2013 9:59:26 am Pietro Cerutti wrote: > > +static fpos_t > > +fmemopen_seek (void *cookie, fpos_t offset, int whence) > > +{ > > + struct __fmemopen_cookie *ck = cookie; > > + > > + > > + switch (whence) { > > + case SEEK_SET: > > + if (offset > ck->len) { > > + errno = EINVAL; > > + return (-1); > > This should return POS_ERR on failure. I'm wrong on this one. POS_ERR is internal to fseek.c and the funopen() manpage is clear that -1 should be returned in this case. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 20:15:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 60AFDE45; Thu, 31 Jan 2013 20:15:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B727F01; Thu, 31 Jan 2013 20:15:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VKFhAD010754; Thu, 31 Jan 2013 20:15:43 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VKFhDN010753; Thu, 31 Jan 2013 20:15:43 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201301312015.r0VKFhDN010753@svn.freebsd.org> From: Glen Barber Date: Thu, 31 Jan 2013 20:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246153 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 20:15:44 -0000 Author: gjb (doc,ports committer) Date: Thu Jan 31 20:15:43 2013 New Revision: 246153 URL: http://svnweb.freebsd.org/changeset/base/246153 Log: Update svn port directory in release(7). Submitted by: Nikolai Lifanov Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Thu Jan 31 19:24:33 2013 (r246152) +++ head/share/man/man7/release.7 Thu Jan 31 20:15:43 2013 (r246153) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 16, 2012 +.Dd January 31, 2013 .Dt RELEASE 7 .Os .Sh NAME @@ -310,7 +310,7 @@ directory. .Xr cc 1 , .Xr install 1 , .Xr make 1 , -.Xr svn 1 Pq Pa ports/devel/subversion-freebsd , +.Xr svn 1 Pq Pa ports/devel/subversion , .Xr uname 1 , .Xr md 4 , .Xr make.conf 5 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 20:17:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71CC56D; Thu, 31 Jan 2013 20:17:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4F9F19; Thu, 31 Jan 2013 20:17:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VKH3De010987; Thu, 31 Jan 2013 20:17:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VKH3Me010986; Thu, 31 Jan 2013 20:17:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201301312017.r0VKH3Me010986@svn.freebsd.org> From: Glen Barber Date: Thu, 31 Jan 2013 20:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246154 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 20:17:03 -0000 Author: gjb (doc,ports committer) Date: Thu Jan 31 20:17:02 2013 New Revision: 246154 URL: http://svnweb.freebsd.org/changeset/base/246154 Log: Force commit to mark MFC for r246153. MFC after: 2 days X-MFC-With: r246153 Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 ============================================================================== From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 20:32:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C15F3C8; Thu, 31 Jan 2013 20:32:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D712F99; Thu, 31 Jan 2013 20:32:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VKWCBE016212; Thu, 31 Jan 2013 20:32:12 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VKWBSC016209; Thu, 31 Jan 2013 20:32:11 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301312032.r0VKWBSC016209@svn.freebsd.org> From: Sean Bruno Date: Thu, 31 Jan 2013 20:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246155 - stable/8/sys/dev/ciss X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 20:32:12 -0000 Author: sbruno Date: Thu Jan 31 20:32:11 2013 New Revision: 246155 URL: http://svnweb.freebsd.org/changeset/base/246155 Log: MFC r245459 Satisfy the intent of kern/151564: [ciss] ciss(4) should increase CISS_MAX_LOGICAL to 107 Submitter wanted to increase the number of logical disks supported by ciss(4) by simply raising the CISS_MAX_LOGICAL value even higher. Instead, consult the documentation for the raid controller (OPENCISS) and poke the controller bits to ask it for how many logical/physical disks it can handle. Revert svn R242089 that raised CISS_MAX_LOGICAL to 64 for all controllers. For older controllers that don't support this mechanism, fallback to the old value of 16 logical disks. Tested on P420, P410, P400 and 6i model ciss(4) controllers. This should will be MFC'd back to stable/9 stable/8 and stable/7 after the MFC period. Modified: stable/8/sys/dev/ciss/ciss.c stable/8/sys/dev/ciss/cissreg.h stable/8/sys/dev/ciss/cissvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ciss/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Thu Jan 31 20:17:02 2013 (r246154) +++ stable/8/sys/dev/ciss/ciss.c Thu Jan 31 20:32:11 2013 (r246155) @@ -1202,13 +1202,21 @@ ciss_identify_adapter(struct ciss_softc /* XXX only really required for old 5300 adapters? */ sc->ciss_flags |= CISS_FLAG_BMIC_ABORT; + /* + * Earlier controller specs do not contain these config + * entries, so assume that a 0 means its old and assign + * these values to the defaults that were established + * when this driver was developed for them + */ + if (sc->ciss_cfg->max_logical_supported == 0) + sc->ciss_cfg->max_logical_supported = CISS_MAX_LOGICAL; + if (sc->ciss_cfg->max_physical_supported == 0) + sc->ciss_cfg->max_physical_supported = CISS_MAX_PHYSICAL; /* print information */ if (bootverbose) { -#if 0 /* XXX proxy volumes??? */ ciss_printf(sc, " %d logical drive%s configured\n", sc->ciss_id->configured_logical_drives, (sc->ciss_id->configured_logical_drives == 1) ? "" : "s"); -#endif ciss_printf(sc, " firmware %4.4s\n", sc->ciss_id->running_firmware_revision); ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_bus_count); @@ -1231,6 +1239,9 @@ ciss_identify_adapter(struct ciss_softc "\20\1ultra2\2ultra3\10fibre1\11fibre2\n"); ciss_printf(sc, " server name '%.16s'\n", sc->ciss_cfg->server_name); ciss_printf(sc, " heartbeat 0x%x\n", sc->ciss_cfg->heartbeat); + ciss_printf(sc, " max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); + ciss_printf(sc, " max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported); + ciss_printf(sc, " max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); } out: @@ -1318,7 +1329,7 @@ ciss_report_luns(struct ciss_softc *sc, break; case CISS_CMD_STATUS_DATA_OVERRUN: ciss_printf(sc, "WARNING: more units than driver limit (%d)\n", - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); break; default: ciss_printf(sc, "error detecting logical drive configuration (%s)\n", @@ -1352,7 +1363,7 @@ ciss_init_logical(struct ciss_softc *sc) debug_called(1); cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1360,9 +1371,9 @@ ciss_init_logical(struct ciss_softc *sc) /* sanity-check reply */ ndrives = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); - if ((ndrives < 0) || (ndrives > CISS_MAX_LOGICAL)) { + if ((ndrives < 0) || (ndrives > sc->ciss_cfg->max_logical_supported)) { ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", - ndrives, CISS_MAX_LOGICAL); + ndrives, sc->ciss_cfg->max_logical_supported); error = ENXIO; goto out; } @@ -1385,19 +1396,20 @@ ciss_init_logical(struct ciss_softc *sc) for (i = 0; i <= sc->ciss_max_logical_bus; i++) { sc->ciss_logical[i] = - malloc(CISS_MAX_LOGICAL * sizeof(struct ciss_ldrive), + malloc(sc->ciss_cfg->max_logical_supported * + sizeof(struct ciss_ldrive), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_logical[i] == NULL) { error = ENXIO; goto out; } - for (j = 0; j < CISS_MAX_LOGICAL; j++) + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) sc->ciss_logical[i][j].cl_status = CISS_LD_NONEXISTENT; } - for (i = 0; i < CISS_MAX_LOGICAL; i++) { + for (i = 0; i < sc->ciss_cfg->max_logical_supported; i++) { if (i < ndrives) { struct ciss_ldrive *ld; int bus, target; @@ -1439,7 +1451,7 @@ ciss_init_physical(struct ciss_softc *sc target = 0; cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1982,7 +1994,7 @@ ciss_free(struct ciss_softc *sc) bus_dma_tag_destroy(sc->ciss_parent_dmat); if (sc->ciss_logical) { for (i = 0; i <= sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { if (sc->ciss_logical[i][j].cl_ldrive) free(sc->ciss_logical[i][j].cl_ldrive, CISS_MALLOC_CLASS); if (sc->ciss_logical[i][j].cl_lstatus) @@ -2965,9 +2977,9 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->hba_inquiry = PI_TAG_ABLE; /* XXX is this correct? */ cpi->target_sprt = 0; cpi->hba_misc = 0; - cpi->max_target = CISS_MAX_LOGICAL; + cpi->max_target = sc->ciss_cfg->max_logical_supported; cpi->max_lun = 0; /* 'logical drive' channel only */ - cpi->initiator_id = CISS_MAX_LOGICAL; + cpi->initiator_id = sc->ciss_cfg->max_logical_supported; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "msmith@freebsd.org", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); @@ -3874,7 +3886,7 @@ ciss_notify_rescan_logical(struct ciss_s * drive address. */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) return; @@ -3885,7 +3897,7 @@ ciss_notify_rescan_logical(struct ciss_s * firmware. */ for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ld = &sc->ciss_logical[i][j]; if (ld->cl_update == 0) @@ -4054,7 +4066,7 @@ ciss_notify_hotplug(struct ciss_softc *s * Rescan the physical lun list for new items */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { ciss_printf(sc, "Warning, cannot get physical lun list\n"); break; @@ -4302,7 +4314,7 @@ ciss_print_adapter(struct ciss_softc *sc "\20\1notify_ok\2control_open\3aborting\4running\21fake_synch\22bmic_abort\n"); for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ciss_printf(sc, "LOGICAL DRIVE %d: ", i); ciss_print_ldrive(sc, &sc->ciss_logical[i][j]); } Modified: stable/8/sys/dev/ciss/cissreg.h ============================================================================== --- stable/8/sys/dev/ciss/cissreg.h Thu Jan 31 20:17:02 2013 (r246154) +++ stable/8/sys/dev/ciss/cissreg.h Thu Jan 31 20:32:11 2013 (r246155) @@ -425,6 +425,15 @@ struct ciss_config_table #define CISS_DRIVER_DAUGHTER_ATTACHED (1<<8) #define CISS_DRIVER_SCSI_PREFETCH (1<<9) u_int32_t max_sg_length; /* 31 in older firmware */ +/* + * these fields appear in OpenCISS Spec 1.06 + * http://cciss.sourceforge.net/#docs + */ + u_int32_t max_logical_supported; + u_int32_t max_physical_supported; + u_int32_t max_physical_per_logical; + u_int32_t max_perfomant_mode_cmds; + u_int32_t max_block_fetch_count; } __packed; /* Modified: stable/8/sys/dev/ciss/cissvar.h ============================================================================== --- stable/8/sys/dev/ciss/cissvar.h Thu Jan 31 20:17:02 2013 (r246154) +++ stable/8/sys/dev/ciss/cissvar.h Thu Jan 31 20:32:11 2013 (r246155) @@ -45,6 +45,9 @@ typedef STAILQ_HEAD(, ciss_request) cr_q /* * Maximum number of logical drives we support. + * If the controller does not indicate a maximum + * value. This is a compatibiliy value to support + * older ciss controllers (e.g. model 6i) */ #define CISS_MAX_LOGICAL 15 From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 20:47:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D827A67D; Thu, 31 Jan 2013 20:47:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B21A696; Thu, 31 Jan 2013 20:47:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VKlZs0019816; Thu, 31 Jan 2013 20:47:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VKlZKl019815; Thu, 31 Jan 2013 20:47:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312047.r0VKlZKl019815@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 20:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246156 - stable/9/sys/dev/ahci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 20:47:35 -0000 Author: mav Date: Thu Jan 31 20:47:35 2013 New Revision: 246156 URL: http://svnweb.freebsd.org/changeset/base/246156 Log: MFC r245875: Disable MSI interrupts for SB600 chipset. According to the report they are not functional. PR: kern/174880, kern/174985, kern/175002 Modified: stable/9/sys/dev/ahci/ahci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Thu Jan 31 20:32:11 2013 (r246155) +++ stable/9/sys/dev/ahci/ahci.c Thu Jan 31 20:47:35 2013 (r246156) @@ -120,8 +120,9 @@ static struct { #define AHCI_Q_NOAA 512 #define AHCI_Q_NOCOUNT 1024 #define AHCI_Q_ALTSIG 2048 +#define AHCI_Q_NOMSI 4096 } ahci_ids[] = { - {0x43801002, 0x00, "ATI IXP600", 0}, + {0x43801002, 0x00, "ATI IXP600", AHCI_Q_NOMSI}, {0x43901002, 0x00, "ATI IXP700", 0}, {0x43911002, 0x00, "ATI IXP700", 0}, {0x43921002, 0x00, "ATI IXP700", 0}, @@ -638,6 +639,8 @@ ahci_setup_interrupt(device_t dev) int i, msi = 1; /* Process hints. */ + if (ctlr->quirks & AHCI_Q_NOMSI) + msi = 0; resource_int_value(device_get_name(dev), device_get_unit(dev), "msi", &msi); if (msi < 0) From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 20:48:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 17C73810; Thu, 31 Jan 2013 20:48:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F193BB5; Thu, 31 Jan 2013 20:48:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VKmuRY020035; Thu, 31 Jan 2013 20:48:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VKmuxH020034; Thu, 31 Jan 2013 20:48:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312048.r0VKmuxH020034@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 20:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246157 - stable/8/sys/dev/ahci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 20:48:57 -0000 Author: mav Date: Thu Jan 31 20:48:56 2013 New Revision: 246157 URL: http://svnweb.freebsd.org/changeset/base/246157 Log: MFC r245875: Disable MSI interrupts for SB600 chipset. According to the report they are not functional. PR: kern/174880, kern/174985, kern/175002 Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ahci/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Thu Jan 31 20:47:35 2013 (r246156) +++ stable/8/sys/dev/ahci/ahci.c Thu Jan 31 20:48:56 2013 (r246157) @@ -120,8 +120,9 @@ static struct { #define AHCI_Q_NOAA 512 #define AHCI_Q_NOCOUNT 1024 #define AHCI_Q_ALTSIG 2048 +#define AHCI_Q_NOMSI 4096 } ahci_ids[] = { - {0x43801002, 0x00, "ATI IXP600", 0}, + {0x43801002, 0x00, "ATI IXP600", AHCI_Q_NOMSI}, {0x43901002, 0x00, "ATI IXP700", 0}, {0x43911002, 0x00, "ATI IXP700", 0}, {0x43921002, 0x00, "ATI IXP700", 0}, @@ -641,6 +642,8 @@ ahci_setup_interrupt(device_t dev) int i, msi = 1; /* Process hints. */ + if (ctlr->quirks & AHCI_Q_NOMSI) + msi = 0; resource_int_value(device_get_name(dev), device_get_unit(dev), "msi", &msi); if (msi < 0) From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 20:53:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03D72D1B; Thu, 31 Jan 2013 20:53:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D3C1F126; Thu, 31 Jan 2013 20:53:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VKrV8U022299; Thu, 31 Jan 2013 20:53:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VKrVLo022298; Thu, 31 Jan 2013 20:53:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301312053.r0VKrVLo022298@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 31 Jan 2013 20:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246158 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 20:53:32 -0000 Author: kib Date: Thu Jan 31 20:53:31 2013 New Revision: 246158 URL: http://svnweb.freebsd.org/changeset/base/246158 Log: Use pmap_kextract() instead of inlining the page table walk. Remove the comment referencing non-existing code. Reviewed by: cognet, ian (previous version) Tested by: ian Modified: head/sys/arm/arm/busdma_machdep.c Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Thu Jan 31 20:48:56 2013 (r246157) +++ head/sys/arm/arm/busdma_machdep.c Thu Jan 31 20:53:31 2013 (r246158) @@ -849,9 +849,6 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma vm_offset_t vaddr = (vm_offset_t)buf; int seg; int error = 0; - pd_entry_t *pde; - pt_entry_t pte; - pt_entry_t *ptep; lastaddr = *lastaddrp; bmask = ~(dmat->boundary - 1); @@ -868,34 +865,9 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma for (seg = *segp; buflen > 0 ; ) { /* * Get the physical address for this segment. - * - * XXX Don't support checking for coherent mappings - * XXX in user address space. */ if (__predict_true(pmap == pmap_kernel())) { - if (pmap_get_pde_pte(pmap, vaddr, &pde, &ptep) == FALSE) - return (EFAULT); - - if (__predict_false(pmap_pde_section(pde))) { - if (*pde & L1_S_SUPERSEC) - curaddr = (*pde & L1_SUP_FRAME) | - (vaddr & L1_SUP_OFFSET); - else - curaddr = (*pde & L1_S_FRAME) | - (vaddr & L1_S_OFFSET); - } else { - pte = *ptep; - KASSERT((pte & L2_TYPE_MASK) != L2_TYPE_INV, - ("INV type")); - if (__predict_false((pte & L2_TYPE_MASK) - == L2_TYPE_L)) { - curaddr = (pte & L2_L_FRAME) | - (vaddr & L2_L_OFFSET); - } else { - curaddr = (pte & L2_S_FRAME) | - (vaddr & L2_S_OFFSET); - } - } + curaddr = pmap_kextract(vaddr); } else { curaddr = pmap_extract(pmap, vaddr); map->flags &= ~DMAMAP_COHERENT; From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 21:24:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7F7A65C6; Thu, 31 Jan 2013 21:24:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D13B26D; Thu, 31 Jan 2013 21:24:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VLOcAm032013; Thu, 31 Jan 2013 21:24:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VLOcNK032012; Thu, 31 Jan 2013 21:24:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312124.r0VLOcNK032012@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 21:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246160 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 21:24:39 -0000 Author: mav Date: Thu Jan 31 21:24:38 2013 New Revision: 246160 URL: http://svnweb.freebsd.org/changeset/base/246160 Log: MFC r245519: Recalculate volume size only for real CONCATs. For SINGLE trust volume size given by metadata, as it should be correct and in some cases can be smaller then subdisk size. Modified: stable/9/sys/geom/raid/tr_concat.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/tr_concat.c ============================================================================== --- stable/9/sys/geom/raid/tr_concat.c Thu Jan 31 21:01:42 2013 (r246159) +++ stable/9/sys/geom/raid/tr_concat.c Thu Jan 31 21:24:38 2013 (r246160) @@ -124,7 +124,8 @@ g_raid_tr_update_state_concat(struct g_r * Some metadata modules may not know CONCAT volume * mediasize until all disks connected. Recalculate. */ - if (G_RAID_VOLUME_S_ALIVE(s) && + if (vol->v_raid_level == G_RAID_VOLUME_RL_CONCAT && + G_RAID_VOLUME_S_ALIVE(s) && !G_RAID_VOLUME_S_ALIVE(vol->v_state)) { size = 0; for (i = 0; i < vol->v_disks_count; i++) { From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 21:26:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 31251735; Thu, 31 Jan 2013 21:26:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F451278; Thu, 31 Jan 2013 21:26:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VLQ2Tx032256; Thu, 31 Jan 2013 21:26:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VLQ2Fu032255; Thu, 31 Jan 2013 21:26:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312126.r0VLQ2Fu032255@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 21:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246161 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 21:26:03 -0000 Author: mav Date: Thu Jan 31 21:26:02 2013 New Revision: 246161 URL: http://svnweb.freebsd.org/changeset/base/246161 Log: MFC r245519: Recalculate volume size only for real CONCATs. For SINGLE trust volume size given by metadata, as it should be correct and in some cases can be smaller then subdisk size. Modified: stable/8/sys/geom/raid/tr_concat.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/tr_concat.c ============================================================================== --- stable/8/sys/geom/raid/tr_concat.c Thu Jan 31 21:24:38 2013 (r246160) +++ stable/8/sys/geom/raid/tr_concat.c Thu Jan 31 21:26:02 2013 (r246161) @@ -124,7 +124,8 @@ g_raid_tr_update_state_concat(struct g_r * Some metadata modules may not know CONCAT volume * mediasize until all disks connected. Recalculate. */ - if (G_RAID_VOLUME_S_ALIVE(s) && + if (vol->v_raid_level == G_RAID_VOLUME_RL_CONCAT && + G_RAID_VOLUME_S_ALIVE(s) && !G_RAID_VOLUME_S_ALIVE(vol->v_state)) { size = 0; for (i = 0; i < vol->v_disks_count; i++) { From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 21:50:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EF947B76; Thu, 31 Jan 2013 21:50:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E1F5D364; Thu, 31 Jan 2013 21:50:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VLoiNA038781; Thu, 31 Jan 2013 21:50:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VLoiqV038780; Thu, 31 Jan 2013 21:50:44 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301312150.r0VLoiqV038780@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 31 Jan 2013 21:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246162 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 21:50:45 -0000 Author: jilles Date: Thu Jan 31 21:50:44 2013 New Revision: 246162 URL: http://svnweb.freebsd.org/changeset/base/246162 Log: sh: Show negated commands (!) in jobs output. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Thu Jan 31 21:26:02 2013 (r246161) +++ head/bin/sh/jobs.c Thu Jan 31 21:50:44 2013 (r246162) @@ -1298,6 +1298,10 @@ until: cmdputs(n->narg.text); cmdputs("() ..."); break; + case NNOT: + cmdputs("! "); + cmdtxt(n->nnot.com); + break; case NCMD: for (np = n->ncmd.args ; np ; np = np->narg.next) { cmdtxt(np); From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 21:53:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 324FDF79; Thu, 31 Jan 2013 21:53:56 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1583B3C8; Thu, 31 Jan 2013 21:53:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VLrtLK040637; Thu, 31 Jan 2013 21:53:55 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VLrtEg040634; Thu, 31 Jan 2013 21:53:55 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301312153.r0VLrtEg040634@svn.freebsd.org> From: Sean Bruno Date: Thu, 31 Jan 2013 21:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246163 - stable/7/sys/dev/ciss X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 21:53:56 -0000 Author: sbruno Date: Thu Jan 31 21:53:55 2013 New Revision: 246163 URL: http://svnweb.freebsd.org/changeset/base/246163 Log: MFC r245459 Satisfy the intent of kern/151564: [ciss] ciss(4) should increase CISS_MAX_LOGICAL to 107 Submitter wanted to increase the number of logical disks supported by ciss(4) by simply raising the CISS_MAX_LOGICAL value even higher. Instead, consult the documentation for the raid controller (OPENCISS) and poke the controller bits to ask it for how many logical/physical disks it can handle. Revert svn R242089 that raised CISS_MAX_LOGICAL to 64 for all controllers. For older controllers that don't support this mechanism, fallback to the old value of 16 logical disks. Tested on P420, P410, P400 and 6i model ciss(4) controllers. This should will be MFC'd back to stable/9 stable/8 and stable/7 after the MFC period. Modified: stable/7/sys/dev/ciss/ciss.c stable/7/sys/dev/ciss/cissreg.h stable/7/sys/dev/ciss/cissvar.h Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/ciss/ciss.c ============================================================================== --- stable/7/sys/dev/ciss/ciss.c Thu Jan 31 21:50:44 2013 (r246162) +++ stable/7/sys/dev/ciss/ciss.c Thu Jan 31 21:53:55 2013 (r246163) @@ -990,13 +990,21 @@ ciss_identify_adapter(struct ciss_softc /* XXX only really required for old 5300 adapters? */ sc->ciss_flags |= CISS_FLAG_BMIC_ABORT; + /* + * Earlier controller specs do not contain these config + * entries, so assume that a 0 means its old and assign + * these values to the defaults that were established + * when this driver was developed for them + */ + if (sc->ciss_cfg->max_logical_supported == 0) + sc->ciss_cfg->max_logical_supported = CISS_MAX_LOGICAL; + if (sc->ciss_cfg->max_physical_supported == 0) + sc->ciss_cfg->max_physical_supported = CISS_MAX_PHYSICAL; /* print information */ if (bootverbose) { -#if 0 /* XXX proxy volumes??? */ ciss_printf(sc, " %d logical drive%s configured\n", sc->ciss_id->configured_logical_drives, (sc->ciss_id->configured_logical_drives == 1) ? "" : "s"); -#endif ciss_printf(sc, " firmware %4.4s\n", sc->ciss_id->running_firmware_revision); ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_bus_count); @@ -1019,6 +1027,9 @@ ciss_identify_adapter(struct ciss_softc "\20\1ultra2\2ultra3\10fibre1\11fibre2\n"); ciss_printf(sc, " server name '%.16s'\n", sc->ciss_cfg->server_name); ciss_printf(sc, " heartbeat 0x%x\n", sc->ciss_cfg->heartbeat); + ciss_printf(sc, " max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); + ciss_printf(sc, " max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported); + ciss_printf(sc, " max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); } out: @@ -1106,7 +1117,7 @@ ciss_report_luns(struct ciss_softc *sc, break; case CISS_CMD_STATUS_DATA_OVERRUN: ciss_printf(sc, "WARNING: more units than driver limit (%d)\n", - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); break; default: ciss_printf(sc, "error detecting logical drive configuration (%s)\n", @@ -1140,7 +1151,7 @@ ciss_init_logical(struct ciss_softc *sc) debug_called(1); cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1148,9 +1159,9 @@ ciss_init_logical(struct ciss_softc *sc) /* sanity-check reply */ ndrives = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); - if ((ndrives < 0) || (ndrives >= CISS_MAX_LOGICAL)) { + if ((ndrives < 0) || (ndrives > sc->ciss_cfg->max_logical_supported)) { ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", - ndrives, CISS_MAX_LOGICAL); + ndrives, sc->ciss_cfg->max_logical_supported); error = ENXIO; goto out; } @@ -1173,19 +1184,20 @@ ciss_init_logical(struct ciss_softc *sc) for (i = 0; i <= sc->ciss_max_logical_bus; i++) { sc->ciss_logical[i] = - malloc(CISS_MAX_LOGICAL * sizeof(struct ciss_ldrive), + malloc(sc->ciss_cfg->max_logical_supported * + sizeof(struct ciss_ldrive), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_logical[i] == NULL) { error = ENXIO; goto out; } - for (j = 0; j < CISS_MAX_LOGICAL; j++) + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) sc->ciss_logical[i][j].cl_status = CISS_LD_NONEXISTENT; } - for (i = 0; i < CISS_MAX_LOGICAL; i++) { + for (i = 0; i < sc->ciss_cfg->max_logical_supported; i++) { if (i < ndrives) { struct ciss_ldrive *ld; int bus, target; @@ -1227,7 +1239,7 @@ ciss_init_physical(struct ciss_softc *sc target = 0; cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1762,7 +1774,7 @@ ciss_free(struct ciss_softc *sc) if (sc->ciss_logical) { for (i = 0; i <= sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { if (sc->ciss_logical[i][j].cl_ldrive) free(sc->ciss_logical[i][j].cl_ldrive, CISS_MALLOC_CLASS); if (sc->ciss_logical[i][j].cl_lstatus) @@ -2688,9 +2700,9 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->hba_inquiry = PI_TAG_ABLE; /* XXX is this correct? */ cpi->target_sprt = 0; cpi->hba_misc = 0; - cpi->max_target = CISS_MAX_LOGICAL; + cpi->max_target = sc->ciss_cfg->max_logical_supported; cpi->max_lun = 0; /* 'logical drive' channel only */ - cpi->initiator_id = CISS_MAX_LOGICAL; + cpi->initiator_id = sc->ciss_cfg->max_logical_supported; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "msmith@freebsd.org", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); @@ -3584,7 +3596,7 @@ ciss_notify_rescan_logical(struct ciss_s * drive address. */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) return; @@ -3595,7 +3607,7 @@ ciss_notify_rescan_logical(struct ciss_s * firmware. */ for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ld = &sc->ciss_logical[i][j]; if (ld->cl_update == 0) @@ -3766,7 +3778,7 @@ ciss_notify_hotplug(struct ciss_softc *s * Rescan the physical lun list for new items */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { ciss_printf(sc, "Warning, cannot get physical lun list\n"); break; @@ -4020,7 +4032,7 @@ ciss_print_adapter(struct ciss_softc *sc "\20\1notify_ok\2control_open\3aborting\4running\21fake_synch\22bmic_abort\n"); for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ciss_printf(sc, "LOGICAL DRIVE %d: ", i); ciss_print_ldrive(sc, &sc->ciss_logical[i][j]); } Modified: stable/7/sys/dev/ciss/cissreg.h ============================================================================== --- stable/7/sys/dev/ciss/cissreg.h Thu Jan 31 21:50:44 2013 (r246162) +++ stable/7/sys/dev/ciss/cissreg.h Thu Jan 31 21:53:55 2013 (r246163) @@ -424,6 +424,15 @@ struct ciss_config_table #define CISS_DRIVER_DAUGHTER_ATTACHED (1<<8) #define CISS_DRIVER_SCSI_PREFETCH (1<<9) u_int32_t max_sg_length; /* 31 in older firmware */ +/* + * these fields appear in OpenCISS Spec 1.06 + * http://cciss.sourceforge.net/#docs + */ + u_int32_t max_logical_supported; + u_int32_t max_physical_supported; + u_int32_t max_physical_per_logical; + u_int32_t max_perfomant_mode_cmds; + u_int32_t max_block_fetch_count; } __packed; /* Modified: stable/7/sys/dev/ciss/cissvar.h ============================================================================== --- stable/7/sys/dev/ciss/cissvar.h Thu Jan 31 21:50:44 2013 (r246162) +++ stable/7/sys/dev/ciss/cissvar.h Thu Jan 31 21:53:55 2013 (r246163) @@ -43,8 +43,11 @@ /* * Maximum number of logical drives we support. + * If the controller does not indicate a maximum + * value. This is a compatibiliy value to support + * older ciss controllers (e.g. model 6i) */ -#define CISS_MAX_LOGICAL 15 +#define CISS_MAX_LOGICAL 16 /* * Maximum number of physical devices we support. From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:05:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2A8EF386; Thu, 31 Jan 2013 22:05:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1A168E; Thu, 31 Jan 2013 22:05:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VM5IgC043961; Thu, 31 Jan 2013 22:05:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VM5ILq043959; Thu, 31 Jan 2013 22:05:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312205.r0VM5ILq043959@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246164 - in stable/9: sbin/geom/class/raid sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:05:19 -0000 Author: mav Date: Thu Jan 31 22:05:18 2013 New Revision: 246164 URL: http://svnweb.freebsd.org/changeset/base/246164 Log: MFC r245522, r245533: For Promise/AMD metadata add support for disks with capacity above 2TiB and for volumes with sector size above 512 bytes. Modified: stable/9/sbin/geom/class/raid/graid.8 stable/9/sys/geom/raid/md_promise.c Directory Properties: stable/9/sbin/geom/class/raid/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/9/sbin/geom/class/raid/graid.8 Thu Jan 31 21:53:55 2013 (r246163) +++ stable/9/sbin/geom/class/raid/graid.8 Thu Jan 31 22:05:18 2013 (r246164) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2012 +.Dd January 16, 2013 .Dt GRAID 8 .Os .Sh NAME @@ -274,7 +274,6 @@ complete it there. Do not run GEOM RAID class on migrating volumes under pain of possible data corruption! .Sh 2TiB BARRIERS -Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. .Sh SYSCTL VARIABLES The following Modified: stable/9/sys/geom/raid/md_promise.c ============================================================================== --- stable/9/sys/geom/raid/md_promise.c Thu Jan 31 21:53:55 2013 (r246163) +++ stable/9/sys/geom/raid/md_promise.c Thu Jan 31 22:05:18 2013 (r246164) @@ -84,7 +84,7 @@ struct promise_raid_conf { struct promise_raid_disk disk; /* This subdisk info. */ uint32_t disk_offset; /* Subdisk offset. */ uint32_t disk_sectors; /* Subdisk size */ - uint32_t rebuild_lba; /* Rebuild position. */ + uint32_t disk_rebuild; /* Rebuild position. */ uint16_t generation; /* Generation number. */ uint8_t status; /* Volume status. */ #define PROMISE_S_VALID 0x01 @@ -123,7 +123,18 @@ struct promise_raid_conf { uint32_t magic_4; uint32_t magic_5; uint32_t total_sectors_high; - uint32_t filler3[324]; + uint8_t magic_6; + uint8_t sector_size; + uint16_t magic_7; + uint32_t magic_8[31]; + uint32_t backup_time; + uint16_t magic_9; + uint32_t disk_offset_high; + uint32_t disk_sectors_high; + uint32_t disk_rebuild_high; + uint16_t magic_10; + uint32_t magic_11[3]; + uint32_t filler3[284]; uint32_t checksum; } __packed; @@ -191,7 +202,7 @@ g_raid_md_promise_print(struct promise_r meta->disk.device, meta->disk.id); printf("disk_offset %u\n", meta->disk_offset); printf("disk_sectors %u\n", meta->disk_sectors); - printf("rebuild_lba %u\n", meta->rebuild_lba); + printf("disk_rebuild %u\n", meta->disk_rebuild); printf("generation %u\n", meta->generation); printf("status 0x%02x\n", meta->status); printf("type %u\n", meta->type); @@ -217,6 +228,11 @@ g_raid_md_promise_print(struct promise_r printf("magic_4 0x%08x\n", meta->magic_4); printf("magic_5 0x%08x\n", meta->magic_5); printf("total_sectors_high 0x%08x\n", meta->total_sectors_high); + printf("sector_size %u\n", meta->sector_size); + printf("backup_time %d\n", meta->backup_time); + printf("disk_offset_high 0x%08x\n", meta->disk_offset_high); + printf("disk_sectors_high 0x%08x\n", meta->disk_sectors_high); + printf("disk_rebuild_high 0x%08x\n", meta->disk_rebuild_high); printf("=================================================\n"); } @@ -244,9 +260,9 @@ promise_meta_find_disk(struct promise_ra static int promise_meta_unused_range(struct promise_raid_conf **metaarr, int nsd, - uint32_t sectors, uint32_t *off, uint32_t *size) + off_t sectors, off_t *off, off_t *size) { - uint32_t coff, csize; + off_t coff, csize, tmp; int i, j; sectors -= 131072; @@ -257,10 +273,10 @@ promise_meta_unused_range(struct promise i = 0; while (1) { for (j = 0; j < nsd; j++) { - if (metaarr[j]->disk_offset >= coff) { - csize = MIN(csize, - metaarr[j]->disk_offset - coff); - } + tmp = ((off_t)metaarr[j]->disk_offset_high << 32) + + metaarr[j]->disk_offset; + if (tmp >= coff) + csize = MIN(csize, tmp - coff); } if (csize > *size) { *off = coff; @@ -268,7 +284,10 @@ promise_meta_unused_range(struct promise } if (i >= nsd) break; - coff = metaarr[i]->disk_offset + metaarr[i]->disk_sectors; + coff = ((off_t)metaarr[i]->disk_offset_high << 32) + + metaarr[i]->disk_offset + + ((off_t)metaarr[i]->disk_sectors_high << 32) + + metaarr[i]->disk_sectors; csize = sectors - coff; i++; }; @@ -369,6 +388,26 @@ next: return (subdisks); } + /* Remove filler garbage from fields used in newer metadata. */ + if (meta->disk_offset_high == 0x8b8c8d8e && + meta->disk_sectors_high == 0x8788898a && + meta->disk_rebuild_high == 0x83848586) { + meta->disk_offset_high = 0; + meta->disk_sectors_high = 0; + if (meta->disk_rebuild == UINT32_MAX) + meta->disk_rebuild_high = UINT32_MAX; + else + meta->disk_rebuild_high = 0; + if (meta->total_sectors_high == 0x15161718) { + meta->total_sectors_high = 0; + meta->backup_time = 0; + if (meta->rebuild_lba64 == 0x2122232425262728) + meta->rebuild_lba64 = UINT64_MAX; + } + } + if (meta->sector_size < 1 || meta->sector_size > 8) + meta->sector_size = 1; + /* Save this part and look for next. */ *metaarr = meta; metaarr++; @@ -386,8 +425,9 @@ promise_meta_write(struct g_consumer *cp struct g_provider *pp; struct promise_raid_conf *meta; char *buf; + off_t off, size; int error, i, subdisk, fake; - uint32_t checksum, *ptr, off, size; + uint32_t checksum, *ptr; pp = cp->provider; subdisk = 0; @@ -409,9 +449,12 @@ next: meta->disk.flags = PROMISE_F_ONLINE | PROMISE_F_VALID; meta->disk.number = 0xff; arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_offset = off; - meta->disk_sectors = size; - meta->rebuild_lba = UINT32_MAX; + meta->disk_offset_high = off >> 32; + meta->disk_offset = (uint32_t)off; + meta->disk_sectors_high = size >> 32; + meta->disk_sectors = (uint32_t)size; + meta->disk_rebuild_high = UINT32_MAX; + meta->disk_rebuild = UINT32_MAX; fake = 1; } if (meta != NULL) { @@ -464,6 +507,7 @@ static int promise_meta_write_spare(struct g_consumer *cp) { struct promise_raid_conf *meta; + off_t tmp; int error; meta = malloc(sizeof(*meta), M_MD_PROMISE, M_WAITOK | M_ZERO); @@ -473,9 +517,11 @@ promise_meta_write_spare(struct g_consum meta->disk.flags = PROMISE_F_SPARE | PROMISE_F_ONLINE | PROMISE_F_VALID; meta->disk.number = 0xff; arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_sectors = cp->provider->mediasize / cp->provider->sectorsize; - meta->disk_sectors -= 131072; - meta->rebuild_lba = UINT32_MAX; + tmp = cp->provider->mediasize / cp->provider->sectorsize - 131072; + meta->disk_sectors_high = tmp >> 32; + meta->disk_sectors = (uint32_t)tmp; + meta->disk_rebuild_high = UINT32_MAX; + meta->disk_rebuild = UINT32_MAX; error = promise_meta_write(cp, &meta, 1); free(meta, M_MD_PROMISE); return (error); @@ -617,9 +663,8 @@ g_raid_md_promise_start_disk(struct g_ra struct g_raid_md_promise_perdisk *pd; struct g_raid_md_promise_pervolume *pv; struct promise_raid_conf *meta; - off_t size; + off_t eoff, esize, size; int disk_pos, md_disk_pos, i, resurrection = 0; - uint32_t eoff, esize; sc = disk->d_softc; pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; @@ -729,8 +774,10 @@ nofit: sd->sd_offset = (off_t)eoff * 512; sd->sd_size = (off_t)esize * 512; } else { - sd->sd_offset = (off_t)pd->pd_meta[sdn]->disk_offset * 512; - sd->sd_size = (off_t)pd->pd_meta[sdn]->disk_sectors * 512; + sd->sd_offset = (((off_t)pd->pd_meta[sdn]->disk_offset_high + << 32) + pd->pd_meta[sdn]->disk_offset) * 512; + sd->sd_size = (((off_t)pd->pd_meta[sdn]->disk_sectors_high + << 32) + pd->pd_meta[sdn]->disk_sectors) * 512; } if (resurrection) { @@ -749,7 +796,8 @@ nofit: sd->sd_rebuild_pos = 0; else { sd->sd_rebuild_pos = - (off_t)pd->pd_meta[sdn]->rebuild_lba * 512; + (((off_t)pd->pd_meta[sdn]->disk_rebuild_high << 32) + + pd->pd_meta[sdn]->disk_rebuild) * 512; } } else if (!(meta->disks[md_disk_pos].flags & PROMISE_F_ONLINE)) { /* Rebuilding disk. */ @@ -875,13 +923,15 @@ g_raid_md_promise_start(struct g_raid_vo vol->v_disks_count = meta->total_disks; vol->v_mediasize = (off_t)meta->total_sectors * 512; //ZZZ if (meta->total_sectors_high < 256) /* If value looks sane. */ - vol->v_mediasize |= + vol->v_mediasize += ((off_t)meta->total_sectors_high << 32) * 512; //ZZZ - vol->v_sectorsize = 512; //ZZZ + vol->v_sectorsize = 512 * meta->sector_size; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; - sd->sd_offset = (off_t)meta->disk_offset * 512; //ZZZ - sd->sd_size = (off_t)meta->disk_sectors * 512; //ZZZ + sd->sd_offset = (((off_t)meta->disk_offset_high << 32) + + meta->disk_offset) * 512; + sd->sd_size = (((off_t)meta->disk_sectors_high << 32) + + meta->disk_sectors) * 512; } g_raid_start_volume(vol); @@ -1213,9 +1263,8 @@ g_raid_md_ctl_promise(struct g_raid_md_o const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; - off_t size, sectorsize, strip; + off_t esize, offs[PROMISE_MAX_DISKS], size, sectorsize, strip; intmax_t *sizearg, *striparg; - uint32_t offs[PROMISE_MAX_DISKS], esize; int numdisks, i, len, level, qual; int error; @@ -1323,13 +1372,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - error = -8; - break; - } - g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ @@ -1394,10 +1436,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o gctl_error(req, "Size too small."); return (-13); } - if (size > 0xffffffffllu * sectorsize) { - gctl_error(req, "Size too big."); - return (-14); - } /* We have all we need, create things: volume, ... */ pv = malloc(sizeof(*pv), M_MD_PROMISE, M_WAITOK | M_ZERO); @@ -1629,14 +1667,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o pp = cp->provider; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - g_raid_kill_consumer(sc, cp); - error = -8; - break; - } - pd = malloc(sizeof(*pd), M_MD_PROMISE, M_WAITOK | M_ZERO); disk = g_raid_create_disk(sc); @@ -1733,9 +1763,9 @@ g_raid_md_write_promise(struct g_raid_md vol->v_raid_level == G_RAID_VOLUME_RL_RAID1E) meta->array_width /= 2; meta->array_number = vol->v_global_id; - meta->total_sectors = vol->v_mediasize / vol->v_sectorsize; - meta->total_sectors_high = - (vol->v_mediasize / vol->v_sectorsize) >> 32; + meta->total_sectors = vol->v_mediasize / 512; + meta->total_sectors_high = (vol->v_mediasize / 512) >> 32; + meta->sector_size = vol->v_sectorsize / 512; meta->cylinders = meta->total_sectors / (255 * 63) - 1; meta->heads = 254; meta->sectors = 63; @@ -1828,15 +1858,24 @@ g_raid_md_write_promise(struct g_raid_md pd->pd_meta[j] = promise_meta_copy(meta); pd->pd_meta[j]->disk = meta->disks[pos]; pd->pd_meta[j]->disk.number = pos; + pd->pd_meta[j]->disk_offset_high = + (sd->sd_offset / 512) >> 32; pd->pd_meta[j]->disk_offset = sd->sd_offset / 512; + pd->pd_meta[j]->disk_sectors_high = + (sd->sd_size / 512) >> 32; pd->pd_meta[j]->disk_sectors = sd->sd_size / 512; if (sd->sd_state == G_RAID_SUBDISK_S_REBUILD) { - pd->pd_meta[j]->rebuild_lba = + pd->pd_meta[j]->disk_rebuild_high = + (sd->sd_rebuild_pos / 512) >> 32; + pd->pd_meta[j]->disk_rebuild = sd->sd_rebuild_pos / 512; - } else if (sd->sd_state < G_RAID_SUBDISK_S_REBUILD) - pd->pd_meta[j]->rebuild_lba = 0; - else - pd->pd_meta[j]->rebuild_lba = UINT32_MAX; + } else if (sd->sd_state < G_RAID_SUBDISK_S_REBUILD) { + pd->pd_meta[j]->disk_rebuild_high = 0; + pd->pd_meta[j]->disk_rebuild = 0; + } else { + pd->pd_meta[j]->disk_rebuild_high = UINT32_MAX; + pd->pd_meta[j]->disk_rebuild = UINT32_MAX; + } pd->pd_updated = 1; } } From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:07:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9EE84514; Thu, 31 Jan 2013 22:07:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 84A256A6; Thu, 31 Jan 2013 22:07:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VM7WvB044386; Thu, 31 Jan 2013 22:07:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VM7Wt4044384; Thu, 31 Jan 2013 22:07:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312207.r0VM7Wt4044384@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246165 - in stable/8: sbin/geom/class/raid sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:07:32 -0000 Author: mav Date: Thu Jan 31 22:07:31 2013 New Revision: 246165 URL: http://svnweb.freebsd.org/changeset/base/246165 Log: MFC r245522, r245533: For Promise/AMD metadata add support for disks with capacity above 2TiB and for volumes with sector size above 512 bytes. Modified: stable/8/sbin/geom/class/raid/graid.8 stable/8/sys/geom/raid/md_promise.c Directory Properties: stable/8/sbin/geom/class/raid/ (props changed) stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/8/sbin/geom/class/raid/graid.8 Thu Jan 31 22:05:18 2013 (r246164) +++ stable/8/sbin/geom/class/raid/graid.8 Thu Jan 31 22:07:31 2013 (r246165) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2012 +.Dd January 16, 2013 .Dt GRAID 8 .Os .Sh NAME @@ -274,7 +274,6 @@ complete it there. Do not run GEOM RAID class on migrating volumes under pain of possible data corruption! .Sh 2TiB BARRIERS -Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. .Sh SYSCTL VARIABLES The following Modified: stable/8/sys/geom/raid/md_promise.c ============================================================================== --- stable/8/sys/geom/raid/md_promise.c Thu Jan 31 22:05:18 2013 (r246164) +++ stable/8/sys/geom/raid/md_promise.c Thu Jan 31 22:07:31 2013 (r246165) @@ -84,7 +84,7 @@ struct promise_raid_conf { struct promise_raid_disk disk; /* This subdisk info. */ uint32_t disk_offset; /* Subdisk offset. */ uint32_t disk_sectors; /* Subdisk size */ - uint32_t rebuild_lba; /* Rebuild position. */ + uint32_t disk_rebuild; /* Rebuild position. */ uint16_t generation; /* Generation number. */ uint8_t status; /* Volume status. */ #define PROMISE_S_VALID 0x01 @@ -123,7 +123,18 @@ struct promise_raid_conf { uint32_t magic_4; uint32_t magic_5; uint32_t total_sectors_high; - uint32_t filler3[324]; + uint8_t magic_6; + uint8_t sector_size; + uint16_t magic_7; + uint32_t magic_8[31]; + uint32_t backup_time; + uint16_t magic_9; + uint32_t disk_offset_high; + uint32_t disk_sectors_high; + uint32_t disk_rebuild_high; + uint16_t magic_10; + uint32_t magic_11[3]; + uint32_t filler3[284]; uint32_t checksum; } __packed; @@ -191,7 +202,7 @@ g_raid_md_promise_print(struct promise_r meta->disk.device, meta->disk.id); printf("disk_offset %u\n", meta->disk_offset); printf("disk_sectors %u\n", meta->disk_sectors); - printf("rebuild_lba %u\n", meta->rebuild_lba); + printf("disk_rebuild %u\n", meta->disk_rebuild); printf("generation %u\n", meta->generation); printf("status 0x%02x\n", meta->status); printf("type %u\n", meta->type); @@ -217,6 +228,11 @@ g_raid_md_promise_print(struct promise_r printf("magic_4 0x%08x\n", meta->magic_4); printf("magic_5 0x%08x\n", meta->magic_5); printf("total_sectors_high 0x%08x\n", meta->total_sectors_high); + printf("sector_size %u\n", meta->sector_size); + printf("backup_time %d\n", meta->backup_time); + printf("disk_offset_high 0x%08x\n", meta->disk_offset_high); + printf("disk_sectors_high 0x%08x\n", meta->disk_sectors_high); + printf("disk_rebuild_high 0x%08x\n", meta->disk_rebuild_high); printf("=================================================\n"); } @@ -244,9 +260,9 @@ promise_meta_find_disk(struct promise_ra static int promise_meta_unused_range(struct promise_raid_conf **metaarr, int nsd, - uint32_t sectors, uint32_t *off, uint32_t *size) + off_t sectors, off_t *off, off_t *size) { - uint32_t coff, csize; + off_t coff, csize, tmp; int i, j; sectors -= 131072; @@ -257,10 +273,10 @@ promise_meta_unused_range(struct promise i = 0; while (1) { for (j = 0; j < nsd; j++) { - if (metaarr[j]->disk_offset >= coff) { - csize = MIN(csize, - metaarr[j]->disk_offset - coff); - } + tmp = ((off_t)metaarr[j]->disk_offset_high << 32) + + metaarr[j]->disk_offset; + if (tmp >= coff) + csize = MIN(csize, tmp - coff); } if (csize > *size) { *off = coff; @@ -268,7 +284,10 @@ promise_meta_unused_range(struct promise } if (i >= nsd) break; - coff = metaarr[i]->disk_offset + metaarr[i]->disk_sectors; + coff = ((off_t)metaarr[i]->disk_offset_high << 32) + + metaarr[i]->disk_offset + + ((off_t)metaarr[i]->disk_sectors_high << 32) + + metaarr[i]->disk_sectors; csize = sectors - coff; i++; }; @@ -369,6 +388,26 @@ next: return (subdisks); } + /* Remove filler garbage from fields used in newer metadata. */ + if (meta->disk_offset_high == 0x8b8c8d8e && + meta->disk_sectors_high == 0x8788898a && + meta->disk_rebuild_high == 0x83848586) { + meta->disk_offset_high = 0; + meta->disk_sectors_high = 0; + if (meta->disk_rebuild == UINT32_MAX) + meta->disk_rebuild_high = UINT32_MAX; + else + meta->disk_rebuild_high = 0; + if (meta->total_sectors_high == 0x15161718) { + meta->total_sectors_high = 0; + meta->backup_time = 0; + if (meta->rebuild_lba64 == 0x2122232425262728) + meta->rebuild_lba64 = UINT64_MAX; + } + } + if (meta->sector_size < 1 || meta->sector_size > 8) + meta->sector_size = 1; + /* Save this part and look for next. */ *metaarr = meta; metaarr++; @@ -386,8 +425,9 @@ promise_meta_write(struct g_consumer *cp struct g_provider *pp; struct promise_raid_conf *meta; char *buf; + off_t off, size; int error, i, subdisk, fake; - uint32_t checksum, *ptr, off, size; + uint32_t checksum, *ptr; pp = cp->provider; subdisk = 0; @@ -409,9 +449,12 @@ next: meta->disk.flags = PROMISE_F_ONLINE | PROMISE_F_VALID; meta->disk.number = 0xff; arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_offset = off; - meta->disk_sectors = size; - meta->rebuild_lba = UINT32_MAX; + meta->disk_offset_high = off >> 32; + meta->disk_offset = (uint32_t)off; + meta->disk_sectors_high = size >> 32; + meta->disk_sectors = (uint32_t)size; + meta->disk_rebuild_high = UINT32_MAX; + meta->disk_rebuild = UINT32_MAX; fake = 1; } if (meta != NULL) { @@ -464,6 +507,7 @@ static int promise_meta_write_spare(struct g_consumer *cp) { struct promise_raid_conf *meta; + off_t tmp; int error; meta = malloc(sizeof(*meta), M_MD_PROMISE, M_WAITOK | M_ZERO); @@ -473,9 +517,11 @@ promise_meta_write_spare(struct g_consum meta->disk.flags = PROMISE_F_SPARE | PROMISE_F_ONLINE | PROMISE_F_VALID; meta->disk.number = 0xff; arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_sectors = cp->provider->mediasize / cp->provider->sectorsize; - meta->disk_sectors -= 131072; - meta->rebuild_lba = UINT32_MAX; + tmp = cp->provider->mediasize / cp->provider->sectorsize - 131072; + meta->disk_sectors_high = tmp >> 32; + meta->disk_sectors = (uint32_t)tmp; + meta->disk_rebuild_high = UINT32_MAX; + meta->disk_rebuild = UINT32_MAX; error = promise_meta_write(cp, &meta, 1); free(meta, M_MD_PROMISE); return (error); @@ -617,9 +663,8 @@ g_raid_md_promise_start_disk(struct g_ra struct g_raid_md_promise_perdisk *pd; struct g_raid_md_promise_pervolume *pv; struct promise_raid_conf *meta; - off_t size; + off_t eoff, esize, size; int disk_pos, md_disk_pos, i, resurrection = 0; - uint32_t eoff, esize; sc = disk->d_softc; pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; @@ -729,8 +774,10 @@ nofit: sd->sd_offset = (off_t)eoff * 512; sd->sd_size = (off_t)esize * 512; } else { - sd->sd_offset = (off_t)pd->pd_meta[sdn]->disk_offset * 512; - sd->sd_size = (off_t)pd->pd_meta[sdn]->disk_sectors * 512; + sd->sd_offset = (((off_t)pd->pd_meta[sdn]->disk_offset_high + << 32) + pd->pd_meta[sdn]->disk_offset) * 512; + sd->sd_size = (((off_t)pd->pd_meta[sdn]->disk_sectors_high + << 32) + pd->pd_meta[sdn]->disk_sectors) * 512; } if (resurrection) { @@ -749,7 +796,8 @@ nofit: sd->sd_rebuild_pos = 0; else { sd->sd_rebuild_pos = - (off_t)pd->pd_meta[sdn]->rebuild_lba * 512; + (((off_t)pd->pd_meta[sdn]->disk_rebuild_high << 32) + + pd->pd_meta[sdn]->disk_rebuild) * 512; } } else if (!(meta->disks[md_disk_pos].flags & PROMISE_F_ONLINE)) { /* Rebuilding disk. */ @@ -875,13 +923,15 @@ g_raid_md_promise_start(struct g_raid_vo vol->v_disks_count = meta->total_disks; vol->v_mediasize = (off_t)meta->total_sectors * 512; //ZZZ if (meta->total_sectors_high < 256) /* If value looks sane. */ - vol->v_mediasize |= + vol->v_mediasize += ((off_t)meta->total_sectors_high << 32) * 512; //ZZZ - vol->v_sectorsize = 512; //ZZZ + vol->v_sectorsize = 512 * meta->sector_size; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; - sd->sd_offset = (off_t)meta->disk_offset * 512; //ZZZ - sd->sd_size = (off_t)meta->disk_sectors * 512; //ZZZ + sd->sd_offset = (((off_t)meta->disk_offset_high << 32) + + meta->disk_offset) * 512; + sd->sd_size = (((off_t)meta->disk_sectors_high << 32) + + meta->disk_sectors) * 512; } g_raid_start_volume(vol); @@ -1213,9 +1263,8 @@ g_raid_md_ctl_promise(struct g_raid_md_o const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; - off_t size, sectorsize, strip; + off_t esize, offs[PROMISE_MAX_DISKS], size, sectorsize, strip; intmax_t *sizearg, *striparg; - uint32_t offs[PROMISE_MAX_DISKS], esize; int numdisks, i, len, level, qual; int error; @@ -1323,13 +1372,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - error = -8; - break; - } - g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ @@ -1394,10 +1436,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o gctl_error(req, "Size too small."); return (-13); } - if (size > 0xffffffffllu * sectorsize) { - gctl_error(req, "Size too big."); - return (-14); - } /* We have all we need, create things: volume, ... */ pv = malloc(sizeof(*pv), M_MD_PROMISE, M_WAITOK | M_ZERO); @@ -1629,14 +1667,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o pp = cp->provider; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - g_raid_kill_consumer(sc, cp); - error = -8; - break; - } - pd = malloc(sizeof(*pd), M_MD_PROMISE, M_WAITOK | M_ZERO); disk = g_raid_create_disk(sc); @@ -1733,9 +1763,9 @@ g_raid_md_write_promise(struct g_raid_md vol->v_raid_level == G_RAID_VOLUME_RL_RAID1E) meta->array_width /= 2; meta->array_number = vol->v_global_id; - meta->total_sectors = vol->v_mediasize / vol->v_sectorsize; - meta->total_sectors_high = - (vol->v_mediasize / vol->v_sectorsize) >> 32; + meta->total_sectors = vol->v_mediasize / 512; + meta->total_sectors_high = (vol->v_mediasize / 512) >> 32; + meta->sector_size = vol->v_sectorsize / 512; meta->cylinders = meta->total_sectors / (255 * 63) - 1; meta->heads = 254; meta->sectors = 63; @@ -1828,15 +1858,24 @@ g_raid_md_write_promise(struct g_raid_md pd->pd_meta[j] = promise_meta_copy(meta); pd->pd_meta[j]->disk = meta->disks[pos]; pd->pd_meta[j]->disk.number = pos; + pd->pd_meta[j]->disk_offset_high = + (sd->sd_offset / 512) >> 32; pd->pd_meta[j]->disk_offset = sd->sd_offset / 512; + pd->pd_meta[j]->disk_sectors_high = + (sd->sd_size / 512) >> 32; pd->pd_meta[j]->disk_sectors = sd->sd_size / 512; if (sd->sd_state == G_RAID_SUBDISK_S_REBUILD) { - pd->pd_meta[j]->rebuild_lba = + pd->pd_meta[j]->disk_rebuild_high = + (sd->sd_rebuild_pos / 512) >> 32; + pd->pd_meta[j]->disk_rebuild = sd->sd_rebuild_pos / 512; - } else if (sd->sd_state < G_RAID_SUBDISK_S_REBUILD) - pd->pd_meta[j]->rebuild_lba = 0; - else - pd->pd_meta[j]->rebuild_lba = UINT32_MAX; + } else if (sd->sd_state < G_RAID_SUBDISK_S_REBUILD) { + pd->pd_meta[j]->disk_rebuild_high = 0; + pd->pd_meta[j]->disk_rebuild = 0; + } else { + pd->pd_meta[j]->disk_rebuild_high = UINT32_MAX; + pd->pd_meta[j]->disk_rebuild = UINT32_MAX; + } pd->pd_updated = 1; } } From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:09:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5431D698; Thu, 31 Jan 2013 22:09:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6346B9; Thu, 31 Jan 2013 22:09:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VM9shM044810; Thu, 31 Jan 2013 22:09:54 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VM9rrs044798; Thu, 31 Jan 2013 22:09:53 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301312209.r0VM9rrs044798@svn.freebsd.org> From: Sean Bruno Date: Thu, 31 Jan 2013 22:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246166 - in head: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:09:54 -0000 Author: sbruno Date: Thu Jan 31 22:09:53 2013 New Revision: 246166 URL: http://svnweb.freebsd.org/changeset/base/246166 Log: Update hwpmc to support the Xeon class of Ivybridge processors. case 0x3E: /* Per Intel document 325462-045US 01/2013. */ Add manpage to document all the goodness that is available in this processor model. No support for uncore events at this time. Submitted by: hiren panchasara Reviewed by: davide, jimharris, sbruno Obtained from: Yahoo! Inc. MFC after: 2 weeks Added: head/lib/libpmc/pmc.ivybridgexeon.3 (contents, props changed) Modified: head/lib/libpmc/Makefile head/lib/libpmc/libpmc.c head/lib/libpmc/pmc.ivybridge.3 head/lib/libpmc/pmc.sandybridge.3 head/lib/libpmc/pmc.sandybridgexeon.3 head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_intel.c head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Thu Jan 31 22:07:31 2013 (r246165) +++ head/lib/libpmc/Makefile Thu Jan 31 22:09:53 2013 (r246166) @@ -29,6 +29,7 @@ MAN+= pmc.core.3 MAN+= pmc.core2.3 MAN+= pmc.iaf.3 MAN+= pmc.ivybridge.3 +MAN+= pmc.ivybridgexeon.3 MAN+= pmc.ucf.3 MAN+= pmc.k7.3 MAN+= pmc.k8.3 Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Thu Jan 31 22:07:31 2013 (r246165) +++ head/lib/libpmc/libpmc.c Thu Jan 31 22:09:53 2013 (r246166) @@ -188,6 +188,11 @@ static const struct pmc_event_descr ivyb __PMC_EV_ALIAS_IVYBRIDGE() }; +static const struct pmc_event_descr ivybridge_xeon_event_table[] = +{ + __PMC_EV_ALIAS_IVYBRIDGE_XEON() +}; + static const struct pmc_event_descr sandybridge_event_table[] = { __PMC_EV_ALIAS_SANDYBRIDGE() @@ -233,6 +238,7 @@ PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); +PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(sandybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); @@ -272,6 +278,7 @@ PMC_CLASS_TABLE_DESC(core, IAP, core, ia PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); +PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); PMC_CLASS_TABLE_DESC(sandybridge_xeon, IAP, sandybridge_xeon, iap); PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); @@ -577,6 +584,8 @@ static struct pmc_event_alias core2_alia #define corei7_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_aliases core2_aliases #define ivybridge_aliases_without_iaf core2_aliases_without_iaf +#define ivybridge_xeon_aliases core2_aliases +#define ivybridge_xeon_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_aliases core2_aliases #define sandybridge_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_xeon_aliases core2_aliases @@ -807,7 +816,8 @@ iap_allocate_pmc(enum pmc_event pe, char return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE || cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON || - cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE || + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE_XEON ) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else @@ -2684,6 +2694,10 @@ pmc_event_names_of_class(enum pmc_class ev = ivybridge_event_table; count = PMC_EVENT_TABLE_SIZE(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + ev = ivybridge_xeon_event_table; + count = PMC_EVENT_TABLE_SIZE(ivybridge_xeon); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridge_event_table; count = PMC_EVENT_TABLE_SIZE(sandybridge); @@ -2983,6 +2997,9 @@ pmc_init(void) case PMC_CPU_INTEL_IVYBRIDGE: PMC_MDEP_INIT_INTEL_V2(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + PMC_MDEP_INIT_INTEL_V2(ivybridge_xeon); + break; case PMC_CPU_INTEL_SANDYBRIDGE: pmc_class_table[n++] = &ucf_class_table_descr; pmc_class_table[n++] = &sandybridgeuc_class_table_descr; @@ -3125,6 +3142,10 @@ _pmc_name_of_event(enum pmc_event pe, en ev = ivybridge_event_table; evfence = ivybridge_event_table + PMC_EVENT_TABLE_SIZE(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + ev = ivybridge_xeon_event_table; + evfence = ivybridge_xeon_event_table + PMC_EVENT_TABLE_SIZE(ivybridge_xeon); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridge_event_table; evfence = sandybridge_event_table + PMC_EVENT_TABLE_SIZE(sandybridge); Modified: head/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- head/lib/libpmc/pmc.ivybridge.3 Thu Jan 31 22:07:31 2013 (r246165) +++ head/lib/libpmc/pmc.ivybridge.3 Thu Jan 31 22:09:53 2013 (r246166) @@ -853,6 +853,7 @@ Dirty L2 cache lines evicted by the MLC .Xr pmc.p6 3 , .Xr pmc.corei7 3 , .Xr pmc.corei7uc 3 , +.Xr pmc.ivybridgexeon 3 , .Xr pmc.sandybridge 3 , .Xr pmc.sandybridgeuc 3 , .Xr pmc.sandybridgexeon 3 , Added: head/lib/libpmc/pmc.ivybridgexeon.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpmc/pmc.ivybridgexeon.3 Thu Jan 31 22:09:53 2013 (r246166) @@ -0,0 +1,911 @@ +.\" Copyright (c) 2013 Hiren Panchasara +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Jan 25, 2013 +.Dt PMC.IVYBRIDGEXEON 3 +.Os +.Sh NAME +.Nm pmc.ivybridgexeon +.Nd measurement events for +.Tn Intel +.Tn Ivy Bridge Xeon +family CPUs +.Sh LIBRARY +.Lb libpmc +.Sh SYNOPSIS +.In pmc.h +.Sh DESCRIPTION +.Tn Intel +.Tn "Ivy Bridge Xeon" +CPUs contain PMCs conforming to version 2 of the +.Tn Intel +performance measurement architecture. +These CPUs may contain up to three classes of PMCs: +.Bl -tag -width "Li PMC_CLASS_IAP" +.It Li PMC_CLASS_IAF +Fixed-function counters that count only one hardware event per counter. +.It Li PMC_CLASS_IAP +Programmable counters that may be configured to count one of a defined +set of hardware events. +.El +.Pp +The number of PMCs available in each class and their widths need to be +determined at run time by calling +.Xr pmc_cpuinfo 3 . +.Pp +Intel Ivy Bridge Xeon PMCs are documented in +.Rs +.%B "Intel(R) 64 and IA-32 Architectures Software Developer's Manual" +.%N "Order Number: 325462-045US" +.%D January 2013 +.%Q "Intel Corporation" +.Re +.Ss IVYBRIDGE FIXED FUNCTION PMCS +These PMCs and their supported events are documented in +.Xr pmc.iaf 3 . +.Ss IVYBRIDGE PROGRAMMABLE PMCS +The programmable PMCs support the following capabilities: +.Bl -column "PMC_CAP_INTERRUPT" "Support" +.It Em Capability Ta Em Support +.It PMC_CAP_CASCADE Ta \&No +.It PMC_CAP_EDGE Ta Yes +.It PMC_CAP_INTERRUPT Ta Yes +.It PMC_CAP_INVERT Ta Yes +.It PMC_CAP_READ Ta Yes +.It PMC_CAP_PRECISE Ta \&No +.It PMC_CAP_SYSTEM Ta Yes +.It PMC_CAP_TAGGING Ta \&No +.It PMC_CAP_THRESHOLD Ta Yes +.It PMC_CAP_USER Ta Yes +.It PMC_CAP_WRITE Ta Yes +.El +.Ss Event Qualifiers +Event specifiers for these PMCs support the following common +qualifiers: +.Bl -tag -width indent +.It Li rsp= Ns Ar value +Configure the Off-core Response bits. +.Bl -tag -width indent +.It Li REQ_DMND_DATA_RD +Counts the number of demand and DCU prefetch data reads of full and partial +cachelines as well as demand data page table entry cacheline reads. Does not +count L2 data read prefetches or instruction fetches. +.It Li REQ_DMND_RFO +Counts the number of demand and DCU prefetch reads for ownership (RFO) +requests generated by a write to data cacheline. Does not count L2 RFO +prefetches. +.It Li REQ_DMND_IFETCH +Counts the number of demand and DCU prefetch instruction cacheline reads. +Does not count L2 code read prefetches. +.It Li REQ_WB +Counts the number of writeback (modified to exclusive) transactions. +.It Li REQ_PF_DATA_RD +Counts the number of data cacheline reads generated by L2 prefetchers. +.It Li REQ_PF_RFO +Counts the number of RFO requests generated by L2 prefetchers. +.It Li REQ_PF_IFETCH +Counts the number of code reads generated by L2 prefetchers. +.It Li REQ_PF_LLC_DATA_RD +L2 prefetcher to L3 for loads. +.It Li REQ_PF_LLC_RFO +RFO requests generated by L2 prefetcher +.It Li REQ_PF_LLC_IFETCH +L2 prefetcher to L3 for instruction fetches. +.It Li REQ_BUS_LOCKS +Bus lock and split lock requests. +.It Li REQ_STRM_ST +Streaming store requests. +.It Li REQ_OTHER +Any other request that crosses IDI, including I/O. +.It Li RES_ANY +Catch all value for any response types. +.It Li RES_SUPPLIER_NO_SUPP +No Supplier Information available. +.It Li RES_SUPPLIER_LLC_HITM +M-state initial lookup stat in L3. +.It Li RES_SUPPLIER_LLC_HITE +E-state. +.It Li RES_SUPPLIER_LLC_HITS +S-state. +.It Li RES_SUPPLIER_LLC_HITF +F-state. +.It Li RES_SUPPLIER_LOCAL +Local DRAM Controller. +.It Li RES_SNOOP_SNP_NONE +No details on snoop-related information. +.It Li RES_SNOOP_SNP_NO_NEEDED +No snoop was needed to satisfy the request. +.It Li RES_SNOOP_SNP_MISS +A snoop was needed and it missed all snooped caches: +-For LLC Hit, ReslHitl was returned by all cores +-For LLC Miss, Rspl was returned by all sockets and data was returned from +DRAM. +.It Li RES_SNOOP_HIT_NO_FWD +A snoop was needed and it hits in at least one snooped cache. Hit denotes a +cache-line was valid before snoop effect. This includes: +-Snoop Hit w/ Invalidation (LLC Hit, RFO) +-Snoop Hit, Left Shared (LLC Hit/Miss, IFetch/Data_RD) +-Snoop Hit w/ Invalidation and No Forward (LLC Miss, RFO Hit S) +In the LLC Miss case, data is returned from DRAM. +.It Li RES_SNOOP_HIT_FWD +A snoop was needed and data was forwarded from a remote socket. +This includes: +-Snoop Forward Clean, Left Shared (LLC Hit/Miss, IFetch/Data_RD/RFT). +.It Li RES_SNOOP_HITM +A snoop was needed and it HitM-ed in local or remote cache. HitM denotes a +cache-line was in modified state before effect as a results of snoop. This +includes: +-Snoop HitM w/ WB (LLC miss, IFetch/Data_RD) +-Snoop Forward Modified w/ Invalidation (LLC Hit/Miss, RFO) +-Snoop MtoS (LLC Hit, IFetch/Data_RD). +.It Li RES_NON_DRAM +Target was non-DRAM system address. This includes MMIO transactions. +.El +.It Li cmask= Ns Ar value +Configure the PMC to increment only if the number of configured +events measured in a cycle is greater than or equal to +.Ar value . +.It Li edge +Configure the PMC to count the number of de-asserted to asserted +transitions of the conditions expressed by the other qualifiers. +If specified, the counter will increment only once whenever a +condition becomes true, irrespective of the number of clocks during +which the condition remains true. +.It Li inv +Invert the sense of comparison when the +.Dq Li cmask +qualifier is present, making the counter increment when the number of +events per cycle is less than the value specified by the +.Dq Li cmask +qualifier. +.It Li os +Configure the PMC to count events happening at processor privilege +level 0. +.It Li usr +Configure the PMC to count events occurring at privilege levels 1, 2 +or 3. +.El +.Pp +If neither of the +.Dq Li os +or +.Dq Li usr +qualifiers are specified, the default is to enable both. +.Ss Event Specifiers (Programmable PMCs) +Ivy Bridge programmable PMCs support the following events: +.Bl -tag -width indent +.It Li LD_BLOCKS.STORE_FORWARD +.Pq Event 03H , Umask 02H +loads blocked by overlapping with store buffer that cannot be forwarded . +.It Li MISALIGN_MEM_REF.LOADS +.Pq Event 05H , Umask 01H +Speculative cache-line split load uops dispatched to L1D. +.It Li MISALIGN_MEM_REF.STORES +.Pq Event 05H , Umask 02H +Speculative cache-line split Store- address uops dispatched to L1D. +.It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS +.Pq Event 07H , Umask 01H +False dependencies in MOB due to partial compare on address. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_MISS_CAUSES_A_WALK +.Pq Event 08H , Umask 81H +Misses in all TLB levels that cause a page walk of any page size from demand loads. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_WALK_COMPLETED +.Pq Event 08H , Umask 82H +Misses in all TLB levels that caused page walk completed of any size by demand loads. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_WALK_DURATION +.Pq Event 08H , Umask 84H +Cycle PMH is busy with a walk due to demand loads. +.It Li UOPS_ISSUED.ANY +.Pq Event 0EH , Umask 01H +Increments each cycle the # of Uops issued by the RAT to RS. +Set Cmask = 1, Inv = 1to count stalled cycles. +Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles of this core. +.It Li UOPS_ISSUED.FLAGS_MERGE +.Pq Event 0EH , Umask 10H +Number of flags-merge uops allocated. Such uops adds delay. +.It Li UOPS_ISSUED.SLOW_LEA +.Pq Event 0EH , Umask 20H +Number of slow LEA or similar uops allocated. Such uop has 3 sources (e.g. 2 +sources + immediate) regardless if as a result of LEA instruction or not. +.It Li UOPS_ISSUED.SINGLE_MUL +.Pq Event 0EH , Umask 40H +Number of multiply packed/scalar single precision uops allocated. +.It Li ARITH.FPU_DIV_ACTIVE +.Pq Event 14H , Umask 01H +Cycles that the divider is active, includes INT and FP. Set 'edge =1, +cmask=1' to count the number of divides. +.It Li L2_RQSTS.DEMAND_DATA_RD_HIT +.Pq Event 24H , Umask 01H +Demand Data Read requests that hit L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_DATA_RD +.Pq Event 24H , Umask 03H +Counts any demand and L1 HW prefetch data load requests to L2. +.It Li L2_RQSTS.RFO_HITS +.Pq Event 24H , Umask 04H +Counts the number of store RFO requests that hit the L2 cache. +.It Li L2_RQSTS.RFO_MISS +.Pq Event 24H , Umask 08H +Counts the number of store RFO requests that miss the L2 cache. +.It Li L2_RQSTS.ALL_RFO +.Pq Event 24H , Umask 0CH +Counts all L2 store RFO requests. +.It Li L2_RQSTS.CODE_RD_HIT +.Pq Event 24H , Umask 10H +Number of instruction fetches that hit the L2 cache. +.It Li L2_RQSTS.CODE_RD_MISS +.Pq Event 24H , Umask 20H +Number of instruction fetches that missed the L2 cache. +.It Li L2_RQSTS.ALL_CODE_RD +.Pq Event 24H , Umask 30H +Counts all L2 code requests. +.It Li L2_RQSTS.PF_HIT +.Pq Event 24H , Umask 40H +Counts all L2 HW prefetcher requests that hit L2. +.It Li L2_RQSTS.PF_MISS +.Pq Event 24H , Umask 80H +Counts all L2 HW prefetcher requests that missed L2. +.It Li L2_RQSTS.ALL_PF +.Pq Event 24H , Umask C0H +Counts all L2 HW prefetcher requests. +.It Li L2_STORE_LOCK_RQSTS.MISS +.Pq Event 27H , Umask 01H +RFOs that miss cache lines. +.It Li L2_STORE_LOCK_RQSTS.HIT_M +.Pq Event 27H , Umask 08H +RFOs that hit cache lines in M state. +.It Li L2_STORE_LOCK_RQSTS.ALL +.Pq Event 27H , Umask 0FH +RFOs that access cache lines in any state. +.It Li L2_L1D_WB_RQSTS.MISS +.Pq Event 28H , Umask 01H +Not rejected writebacks that missed LLC. +.It Li L2_L1D_WB_RQSTS.HIT_E +.Pq Event 28H , Umask 04H +Not rejected writebacks from L1D to L2 cache lines in E state. +.It Li L2_L1D_WB_RQSTS.HIT_M +.Pq Event 28H , Umask 08H +Not rejected writebacks from L1D to L2 cache lines in M state. +.It Li L2_L1D_WB_RQSTS.ALL +.Pq Event 28H , Umask 0FH +Not rejected writebacks from L1D to L2 cache lines in any state. +.It Li LONGEST_LAT_CACHE.REFERENCE +.Pq Event 2EH , Umask 4FH +This event counts requests originating from the core that reference a cache +line in the last level cache. +.It Li LONGEST_LAT_CACHE.MISS +.Pq Event 2EH , Umask 41H +This event counts each cache miss condition for references to the last level +cache. +.It Li CPU_CLK_UNHALTED.THREAD_P +.Pq Event 3CH , Umask 00H +Counts the number of thread cycles while the thread is not in a halt state. +The thread enters the halt state when it is running the HLT instruction. The +core frequency may change from time to time due to power or thermal +throttling. +.It Li CPU_CLK_THREAD_UNHALTED.REF_XCLK +.Pq Event 3CH , Umask 01H +Increments at the frequency of XCLK (100 MHz) when not halted. +.It Li L1D_PEND_MISS.PENDING +.Pq Event 48H , Umask 01H +Increments the number of outstanding L1D misses every cycle. Set Cmaks = 1 +and Edge =1 to count occurrences. +Counter 2 only. +Set Cmask = 1 to count cycles. +.It Li DTLB_STORE_MISSES.MISS_CAUSES_A_WALK +.Pq Event 49H , Umask 01H +Miss in all TLB levels causes an page walk of any page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_COMPLETED +.Pq Event 49H , Umask 02H +Miss in all TLB levels causes a page walk that completes of any page size +(4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_DURATION +.Pq Event 49H , Umask 04H +Cycles PMH is busy with this walk. +.It Li DTLB_STORE_MISSES.STLB_HIT +.Pq Event 49H , Umask 10H +Store operations that miss the first TLB level but hit the second and do not +cause page walks. +.It Li LOAD_HIT_PRE.SW_PF +.Pq Event 4CH , Umask 01H +Non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch. +.It Li LOAD_HIT_PRE.HW_PF +.Pq Event 4CH , Umask 02H +Non-SW-prefetch load dispatches that hit fill buffer allocated for H/W prefetch. +.It Li L1D.REPLACEMENT +.Pq Event 51H , Umask 01H +Counts the number of lines brought into the L1 data cache. +.It Li MOVE_ELIMINATION.INT_NOT_ELIMINATED +.Pq Event 58H , Umask 01H +Number of integer Move Elimination candidate uops that were not eliminated. +.It Li MOVE_ELIMINATION.SIMD_NOT_ELIMINATED +.Pq Event 58H , Umask 02H +Number of SIMD Move Elimination candidate uops that were not eliminated. +.It Li MOVE_ELIMINATION.INT_ELIMINATED +.Pq Event 58H , Umask 04H +Number of integer Move Elimination candidate uops that were eliminated. +.It Li MOVE_ELIMINATION.SIMD_ELIMINATED +.Pq Event 58H , Umask 08H +Number of SIMD Move Elimination candidate uops that were eliminated. +.It Li CPL_CYCLES.RING0 +.Pq Event 5CH , Umask 01H +Unhalted core cycles when the thread is in ring 0. +Use Edge to count transition. +.It Li CPL_CYCLES.RING123 +.Pq Event 5CH , Umask 02H +Unhalted core cycles when the thread is not in ring 0. +.It Li RS_EVENTS.EMPTY_CYCLES +.Pq Event 5EH , Umask 01H +Cycles the RS is empty for the thread. +.It Li DTLB_LOAD_MISSES.STLB_HIT +.Pq Event 5FH , Umask 04H +Counts load operations that missed 1st level DTLB but hit the 2nd level. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +.Pq Event 60H , Umask 01H +Offcore outstanding Demand Data Read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD +.Pq Event 60H , Umask 02H +Offcore outstanding Demand Code Read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.Pq Event 60H , Umask 04H +Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to +count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.Pq Event 60H , Umask 08H +Offcore outstanding cacheable data read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.Pq Event 63H , Umask 01H +Cycles in which the L1D and L2 are locked, due to a UC lock or split lock. +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.Pq Event 63H , Umask 02H +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY +.Pq Event 79H , Umask 02H +Counts cycles the IDQ is empty. +.It Li IDQ.MITE_UOPS +.Pq Event 79H , Umask 04H +Increment each cycle # of uops delivered to IDQ from MITE path. +Can combine Umask 04H and 20H. +Set Cmask = 1 to count cycles. +.It Li IDQ.DSB_UOPS +.Pq Event 79H , Umask 08H +Increment each cycle. # of uops delivered to IDQ from DSB path. +Can combine Umask 08H and 10H +Set Cmask = 1 to count cycles. +.It Li IDQ.MS_DSB_UOPS +.Pq Event 79H , Umask 10H +Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set +Cmask = 1 to count cycles. Add Edge=1 to count # of delivery. +Can combine Umask 04H, 08H. +.It Li IDQ.MS_MITE_UOPS +.Pq Event 79H , Umask 20H +Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set +Cmask = 1 to count cycles. +Can combine Umask 04H, 08H. +.It Li IDQ.MS_UOPS +.Pq Event 79H , Umask 30H +Increment each cycle # of uops delivered to IDQ from MS by either DSB or +MITE. Set Cmask = 1 to count cycles. +Can combine Umask 04H, 08H. +.It Li IDQ.ALL_DSB_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered at least one uops. Set Cmask = 1. +.It Li IDQ.ALL_DSB_CYCLES_4_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered four uops. Set Cmask = 4. +.It Li IDQ.ALL_MITE_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered at least one uops. Set Cmask = 1. +.It Li IDQ.ALL_MITE_CYCLES_4_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered four uops. Set Cmask = 4. +.It Li IDQ.MITE_ALL_UOPS +.Pq Event 79H , Umask 3CH +# of uops delivered to IDQ from any path. +.It Li ICACHE.MISSES +.Pq Event 80H , Umask 02H +Number of Instruction Cache, Streaming Buffer and Victim Cache Misses. +Includes UC accesses. +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.Pq Event 85H , Umask 01H +Misses in all ITLB levels that cause page walks. +.It Li ITLB_MISSES.WALK_COMPLETED +.Pq Event 85H , Umask 02H +Misses in all ITLB levels that cause completed page walks. +.It Li ITLB_MISSES.WALK_DURATION +.Pq Event 85H , Umask 04H +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT +.Pq Event 85H , Umask 10H +Number of cache load STLB hits. No page walk. +.It Li ILD_STALL.LCP +.Pq Event 87H , Umask 01H +Stalls caused by changing prefix length of the instruction. +.It Li ILD_STALL.IQ_FULL +.Pq Event 87H , Umask 04H +Stall cycles due to IQ is full. +.It Li BR_INST_EXEC.COND +.Pq Event 88H , Umask 01H +Qualify conditional near branch instructions executed, but not necessarily +retired. +Must combine with umask 40H, 80H. +.It Li BR_INST_EXEC.DIRECT_JMP +.Pq Event 88H , Umask 02H +Qualify all unconditional near branch instructions excluding calls and +indirect branches. +Must combine with umask 80H. +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 88H , Umask 04H +Qualify executed indirect near branch instructions that are not calls nor +returns. +Must combine with umask 80H. +.It Li BR_INST_EXEC.RETURN_NEAR +.Pq Event 88H , Umask 08H +Qualify indirect near branches that have a return mnemonic. +Must combine with umask 80H. +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.Pq Event 88H , Umask 10H +Qualify unconditional near call branch instructions, excluding non call +branch, executed. +Must combine with umask 80H. +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.Pq Event 88H , Umask 20H +Qualify indirect near calls, including both register and memory indirect, +executed. +Must combine with umask 80H. +.It Li BR_INST_EXEC.NONTAKEN +.Pq Event 88H , Umask 40H +Qualify non-taken near branches executed. +Applicable to umask 01H only. +.It Li BR_INST_EXEC.TAKEN +.Pq Event 88H , Umask 80H +Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H, +10H, 20H. +.It Li BR_INST_EXEC.ALL_BRANCHES +.Pq Event 88H , Umask FFH +Counts all near executed branches (not necessarily retired). +.It Li BR_MISP_EXEC.COND +.Pq Event 89H , Umask 01H +Qualify conditional near branch instructions mispredicted. +Must combine with umask 40H, 80H. +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 89H , Umask 04H +Qualify mispredicted indirect near branch instructions that are not calls +nor returns. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.RETURN_NEAR +.Pq Event 89H , Umask 08H +Qualify mispredicted indirect near branches that have a return mnemonic. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.Pq Event 89H , Umask 10H +Qualify mispredicted unconditional near call branch instructions, excluding +non call branch, executed. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.Pq Event 89H , Umask 20H +Qualify mispredicted indirect near calls, including both register and memory +indirect, executed. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.NONTAKEN +.Pq Event 89H , Umask 40H +Qualify mispredicted non-taken near branches executed. +Applicable to umask 01H only. +.It Li BR_MISP_EXEC.TAKEN +.Pq Event 89H , Umask 80H +Qualify mispredicted taken near branches executed. Must combine with +01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_MISP_EXEC.ALL_BRANCHES +.Pq Event 89H , Umask FFH +Counts all near executed branches (not necessarily retired). +.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.Pq Event 9CH , Umask 01H +Count number of non-delivered uops to RAT per thread. +Use Cmask to qualify uop b/w. +.It Li UOPS_DISPATCHED_PORT.PORT_0 +.Pq Event A1H , Umask 01H +Cycles which a Uop is dispatched on port 0. +.It Li UOPS_DISPATCHED_PORT.PORT_1 +.Pq Event A1H , Umask 02H +Cycles which a Uop is dispatched on port 1. +.It Li UOPS_DISPATCHED_PORT.PORT_2_LD +.Pq Event A1H , Umask 04H +Cycles which a load uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2_STA +.Pq Event A1H , Umask 08H +Cycles which a store address uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2 +.Pq Event A1H , Umask 0CH +Cycles which a Uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_3_LD +.Pq Event A1H , Umask 10H +Cycles which a load uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3_STA +.Pq Event A1H , Umask 20H +Cycles which a store address uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3 +.Pq Event A1H , Umask 30H +Cycles which a Uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_4 +.Pq Event A1H , Umask 40H +Cycles which a Uop is dispatched on port 4. +.It Li UOPS_DISPATCHED_PORT.PORT_5 +.Pq Event A1H , Umask 80H +Cycles which a Uop is dispatched on port 5. +.It Li RESOURCE_STALLS.ANY +.Pq Event A2H , Umask 01H +Cycles Allocation is stalled due to Resource Related reason. +.It Li RESOURCE_STALLS.RS +.Pq Event A2H , Umask 04H +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB +.Pq Event A2H , Umask 08H +Cycles stalled due to no store buffers available. (not including draining +form sync). +.It Li RESOURCE_STALLS.ROB +.Pq Event A2H , Umask 10H +Cycles stalled due to re-order buffer full. +.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING +.Pq Event A3H , Umask 01H +Cycles with pending L2 miss loads. Set AnyThread to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_LDM_PENDING +.Pq Event A3H , Umask 02H +Cycles with pending memory loads. Set AnyThread to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_NO_EXECUTE +.Pq Event A3H , Umask 04H +Cycles of dispatch stalls. Set AnyThread to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING +.Pq Event A3H , Umask 08H +Cycles with pending L1 cache miss loads. Set AnyThread to count per core. +.It Li DSB2MITE_SWITCHES.COUNT +.Pq Event ABH , Umask 01H +Number of DSB to MITE switches. +.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES +.Pq Event ABH , Umask 02H +Cycles DSB to MITE switches caused delay. +.It Li DSB_FILL.EXCEED_DSB_LINES +.Pq Event ACH , Umask 08H +DSB Fill encountered > 3 DSB lines. +.It Li ITLB.ITLB_FLUSH +.Pq Event AEH , Umask 01H +Counts the number of ITLB flushes, includes 4k/2M/4M pages. +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.Pq Event B0H , Umask 01H +Demand data read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_CODE_RD +.Pq Event B0H , Umask 02H +Demand code read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_RFO +.Pq Event B0H , Umask 04H +Demand RFO read requests sent to uncore, including regular RFOs, locks, +ItoM. +.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.Pq Event B0H , Umask 08H +Data read requests sent to uncore (demand and prefetch). +.It Li UOPS_EXECUTED.THREAD +.Pq Event B1H , Umask 01H +Counts total number of uops to be executed per-thread each cycle. Set Cmask += 1, INV =1 to count stall cycles. +.It Li UOPS_EXECUTED.CORE +.Pq Event B1H , Umask 02H +Counts total number of uops to be executed per-core each cycle. +Do not need to set ANY. +.It Li OFF_CORE_RESPONSE_0 +.Pq Event B7H , Umask 01H +Off-core Response Performance Monitoring. +PMC0 only. +Requires programming MSR 01A6H. +.It Li OFF_CORE_RESPONSE_1 +.Pq Event BBH , Umask 01H +Off-core Response Performance Monitoring. +PMC3 only. +Requires programming MSR 01A7H. +.It Li TLB_FLUSH.DTLB_THREAD +.Pq Event BDH , Umask 01H +DTLB flush attempts of the thread- specific entries. +.It Li TLB_FLUSH.STLB_ANY +.Pq Event BDH , Umask 20H +Count number of STLB flush attempts. +.It Li INST_RETIRED.ANY_P +.Pq Event C0H , Umask 00H +Number of instructions at retirement. +.It Li INST_RETIRED.ALL +.Pq Event C0H , Umask 01H +Precise instruction retired event with HW to reduce effect of PEBS shadow in +IP distribution. +PMC1 only. +Must quiesce other PMCs. +.It Li OTHER_ASSISTS.AVX_STORE +.Pq Event C1H , Umask 08H +Number of assists associated with 256-bit AVX store operations. +.It Li OTHER_ASSISTS.AVX_TO_SSE +.Pq Event C1H , Umask 10H +Number of transitions from AVX- 256 to legacy SSE when penalty applicable. +.It Li OTHER_ASSISTS.SSE_TO_AVX +.Pq Event C1H , Umask 20H +Number of transitions from SSE to AVX-256 when penalty applicable. +.It Li UOPS_RETIRED.ALL +.Pq Event C2H , Umask 01H +Counts the number of micro-ops retired, Use cmask=1 and invert to count +active cycles or stalled cycles. +Supports PEBS, use Any=1 for core granular. +.It Li UOPS_RETIRED.RETIRE_SLOTS +.Pq Event C2H , Umask 02H +Counts the number of retirement slots used each cycle. +.It Li MACHINE_CLEARS.MEMORY_ORDERING +.Pq Event C3H , Umask 02H +Counts the number of machine clears due to memory order conflicts. +.It Li MACHINE_CLEARS.SMC +.Pq Event C3H , Umask 04H +Number of self-modifying-code machine clears detected. +.It Li MACHINE_CLEARS.MASKMOV +.Pq Event C3H , Umask 20H +Counts the number of executed AVX masked load operations that refer to an +illegal address range with the mask bits set to 0. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 00H +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL +.Pq Event C4H , Umask 01H +Counts the number of conditional branch instructions retired. +Supports PEBS. +.It Li BR_INST_RETIRED.NEAR_CALL +.Pq Event C4H , Umask 02H +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 04H +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN +.Pq Event C4H , Umask 08H +Counts the number of near return instructions retired. +.It Li BR_INST_RETIRED.NOT_TAKEN +.Pq Event C4H , Umask 10H +Counts the number of not taken branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_TAKEN +.Pq Event C4H , Umask 20H +Number of near taken branches retired. +.It Li BR_INST_RETIRED.FAR_BRANCH +.Pq Event C4H , Umask 40H +Number of far branches retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 00H +Mispredicted branch instructions at retirement. +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 01H +Mispredicted conditional branch instructions retired. +Supports PEBS. +.It Li BR_MISP_RETIRED.NEAR_CALL +.Pq Event C5H , Umask 02H +Direct and indirect mispredicted near call instructions retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 04H +Mispredicted macro branch instructions retired. +.It Li BR_MISP_RETIRED.NOT_TAKEN +.Pq Event C5H , Umask 10H +Mispredicted not taken branch instructions retired. +.It Li BR_MISP_RETIRED.TAKEN +.Pq Event C5H , Umask 20H +Mispredicted taken branch instructions retired. +.It Li FP_ASSIST.X87_OUTPUT +.Pq Event CAH , Umask 02H +Number of X87 FP assists due to Output values. +.It Li FP_ASSIST.X87_INPUT +.Pq Event CAH , Umask 04H +Number of X87 FP assists due to input values. +.It Li FP_ASSIST.SIMD_OUTPUT +.Pq Event CAH , Umask 08H +Number of SIMD FP assists due to Output values. +.It Li FP_ASSIST.SIMD_INPUT +.Pq Event CAH , Umask 10H +Number of SIMD FP assists due to input values. +.It Li FP_ASSIST.ANY +.Pq Event CAH , Umask 1EH +Cycles with any input/output SSE* or FP assists. +.It Li ROB_MISC_EVENTS.LBR_INSERTS +.Pq Event CCH , Umask 20H +Count cases of saving new LBR records by hardware. +.It Li MEM_TRANS_RETIRED.LOAD_LATENCY +.Pq Event CDH , Umask 01H +Sample loads with specified latency threshold. +PMC3 only. +Specify threshold in MSR 0x3F6. +.It Li MEM_TRANS_RETIRED.PRECISE_STORE +.Pq Event CDH , Umask 02H +Sample stores and collect precise store operation via PEBS record. +PMC3 only. +.It Li MEM_UOP_RETIRED.LOADS +.Pq Event D0H , Umask 01H +Qualify retired memory uops that are loads. Combine with umask 10H, 20H, +40H, 80H. +Supports PEBS. +.It Li MEM_UOP_RETIRED.STORES +.Pq Event D0H , Umask 02H +Qualify retired memory uops that are stores. Combine with umask 10H, 20H, +40H, 80H. +.It Li MEM_UOP_RETIRED.STLB_MISS +.Pq Event D0H , Umask 10H +Qualify retired memory uops with STLB miss. Must combine with umask 01H, +02H, to produce counts. +.It Li MEM_UOP_RETIRED.LOCK +.Pq Event D0H , Umask 20H +Qualify retired memory uops with lock. Must combine with umask 01H, 02H, to +produce counts. +.It Li MEM_UOP_RETIRED.SPLIT +.Pq Event D0H , Umask 40H +Qualify retired memory uops with line split. Must combine with umask 01H, +02H, to produce counts. +.It Li MEM_UOP_RETIRED.ALL +.Pq Event D0H , Umask 80H +Qualify any retired memory uops. Must combine with umask 01H, 02H, to +produce counts. +.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT +.Pq Event D1H , Umask 01H +Retired load uops with L1 cache hits as data sources. +Supports PEBS. +.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT +.Pq Event D1H , Umask 02H +Retired load uops with L2 cache hits as data sources. +.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT +.Pq Event D1H , Umask 04H +Retired load uops whose data source was LLC hit with no snoop required. +.It Li MEM_LOAD_UOPS_RETIRED.LLC_MISS +.Pq Event D1H , Umask 20H +Retired load uops whose data source is LLC miss. +.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB +.Pq Event D1H , Umask 40H +Retired load uops which data sources were load uops missed L1 but hit FB due +to preceding miss to the same cache line with data not ready. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS +.Pq Event D2H , Umask 01H +Retired load uops which data sources were LLC hit and cross-core snoop +missed in on-pkg core cache. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT +.Pq Event D2H , Umask 02H +Retired load uops which data sources were LLC and cross-core snoop hits in +on-pkg core cache. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM +.Pq Event D2H , Umask 04H +Retired load uops which data sources were HitM responses from shared LLC. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE +.Pq Event D2H , Umask 08H +Retired load uops which data sources were hits in LLC without snoops +required. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM +.Pq Event D3H , Umask 01H +Retired load uops which data sources missed LLC but serviced from local +dram. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.REMOTE_DRAM +.Pq Event D3H , Umask 04H +Retired load uops whose data source was remote DRAM. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.REMOTE_HITM +.Pq Event D3H , Umask 10H +Retired load uops whose data source was remote HITM. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.REMOTE_FWD +.Pq Event D3H , Umask 20H +Retired load uops whose data source was forwards from a remote cache. +.It Li BACLEARS.ANY +.Pq Event E6H , Umask 1FH +Number of front end re-steers due to BPU misprediction. +.It Li L2_TRANS.DEMAND_DATA_RD +.Pq Event F0H , Umask 01H +Demand Data Read requests that access L2 cache. +.It Li L2_TRANS.RFO +.Pq Event F0H , Umask 02H +RFO requests that access L2 cache. +.It Li L2_TRANS.CODE_RD +.Pq Event F0H , Umask 04H +L2 cache accesses when fetching instructions. +.It Li L2_TRANS.ALL_PF +.Pq Event F0H , Umask 08H +Any MLC or LLC HW prefetch accessing L2, including rejects. +.It Li L2_TRANS.L1D_WB +.Pq Event F0H , Umask 10H +L1D writebacks that access L2 cache. +.It Li L2_TRANS.L2_FILL +.Pq Event F0H , Umask 20H +L2 fill requests that access L2 cache. +.It Li L2_TRANS.L2_WB +.Pq Event F0H , Umask 40H +L2 writebacks that access L2 cache. +.It Li L2_TRANS.ALL_REQUESTS +.Pq Event F0H , Umask 80H +Transactions accessing L2 pipe. +.It Li L2_LINES_IN.I +.Pq Event F1H , Umask 01H +L2 cache lines in I state filling L2. +Counting does not cover rejects. +.It Li L2_LINES_IN.S +.Pq Event F1H , Umask 02H +L2 cache lines in S state filling L2. +Counting does not cover rejects. +.It Li L2_LINES_IN.E +.Pq Event F1H , Umask 04H +L2 cache lines in E state filling L2. +Counting does not cover rejects. +.It Li L2_LINES_IN.ALL +.Pq Event F1H , Umask 07H +L2 cache lines filling L2. +Counting does not cover rejects. +.It Li L2_LINES_OUT.DEMAND_CLEAN +.Pq Event F2H , Umask 01H +Clean L2 cache lines evicted by demand. +.It Li L2_LINES_OUT.DEMAND_DIRTY +.Pq Event F2H , Umask 02H +Dirty L2 cache lines evicted by demand. +.It Li L2_LINES_OUT.PF_CLEAN +.Pq Event F2H , Umask 04H +Clean L2 cache lines evicted by the MLC prefetcher. +.It Li L2_LINES_OUT.PF_DIRTY +.Pq Event F2H , Umask 08H +Dirty L2 cache lines evicted by the MLC prefetcher. +.It Li L2_LINES_OUT.DIRTY_ALL +.Pq Event F2H , Umask 0AH +Dirty L2 cache lines filling the L2. +.El +.Sh SEE ALSO +.Xr pmc 3 , +.Xr pmc.atom 3 , +.Xr pmc.core 3 , +.Xr pmc.iaf 3 , +.Xr pmc.ucf 3 , +.Xr pmc.k7 3 , +.Xr pmc.k8 3 , +.Xr pmc.p4 3 , +.Xr pmc.p5 3 , +.Xr pmc.p6 3 , +.Xr pmc.corei7 3 , +.Xr pmc.corei7uc 3 , +.Xr pmc.ivybridge 3 , +.Xr pmc.sandybridge 3 , +.Xr pmc.sandybridgeuc 3 , +.Xr pmc.sandybridgexeon 3 , +.Xr pmc.westmere 3 , +.Xr pmc.westmereuc 3 , +.Xr pmc.soft 3 , +.Xr pmc.tsc 3 , +.Xr pmc_cpuinfo 3 , +.Xr pmclog 3 , +.Xr hwpmc 4 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:10:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 99C1881E; Thu, 31 Jan 2013 22:10:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8C51B6CA; Thu, 31 Jan 2013 22:10:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMAwXt046624; Thu, 31 Jan 2013 22:10:58 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMAwlO046622; Thu, 31 Jan 2013 22:10:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301312210.r0VMAwlO046622@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 31 Jan 2013 22:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246167 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:10:58 -0000 Author: jilles Date: Thu Jan 31 22:10:57 2013 New Revision: 246167 URL: http://svnweb.freebsd.org/changeset/base/246167 Log: sh: Prefer our character classification functions to . Modified: head/bin/sh/miscbltin.c head/bin/sh/mksyntax.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Thu Jan 31 22:09:53 2013 (r246166) +++ head/bin/sh/miscbltin.c Thu Jan 31 22:10:57 2013 (r246167) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -60,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include "memalloc.h" #include "error.h" #include "mystring.h" +#include "syntax.h" #undef eflag @@ -307,7 +307,7 @@ umaskcmd(int argc __unused, char **argv out1fmt("%.4o\n", mask); } } else { - if (isdigit(*ap)) { + if (is_digit(*ap)) { mask = 0; do { if (*ap >= '8' || *ap < '0') Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Thu Jan 31 22:09:53 2013 (r246166) +++ head/bin/sh/mksyntax.c Thu Jan 31 22:10:57 2013 (r246167) @@ -165,7 +165,6 @@ main(int argc __unused, char **argv __un } fputs("#include \n", hfile); - fputs("#include \n", hfile); /* Generate the #define statements in the header file */ fputs("/* Syntax classes */\n", hfile); From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:12:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 59F389C5; Thu, 31 Jan 2013 22:12:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3236E6E2; Thu, 31 Jan 2013 22:12:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMCQE7046947; Thu, 31 Jan 2013 22:12:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMCP3S046944; Thu, 31 Jan 2013 22:12:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312212.r0VMCP3S046944@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246168 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:12:26 -0000 Author: mav Date: Thu Jan 31 22:12:25 2013 New Revision: 246168 URL: http://svnweb.freebsd.org/changeset/base/246168 Log: MFC r245326: Add basic support for Intel Rapid Recover Technology (Intel RRT). It is alike to RAID1, but with dedicating master and recovery disks and providing manual control over synchronization. It allows to use recovery disk as snapshot of the master disk from the time of the last sync. This implementation is not functionaly complete comparing to Windows, but it is better then silent conversion to RAID1 on first boot. Modified: stable/9/sys/geom/raid/g_raid.c stable/9/sys/geom/raid/g_raid.h stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Thu Jan 31 22:10:57 2013 (r246167) +++ stable/9/sys/geom/raid/g_raid.c Thu Jan 31 22:12:25 2013 (r246168) @@ -163,6 +163,8 @@ g_raid_disk_state2str(int state) return ("NONE"); case G_RAID_DISK_S_OFFLINE: return ("OFFLINE"); + case G_RAID_DISK_S_DISABLED: + return ("DISABLED"); case G_RAID_DISK_S_FAILED: return ("FAILED"); case G_RAID_DISK_S_STALE_FAILED: @@ -535,7 +537,9 @@ g_raid_report_disk_state(struct g_raid_d if (disk->d_consumer == NULL) return; - if (disk->d_state == G_RAID_DISK_S_FAILED || + if (disk->d_state == G_RAID_DISK_S_DISABLED) { + ; + } else if (disk->d_state == G_RAID_DISK_S_FAILED || disk->d_state == G_RAID_DISK_S_STALE_FAILED) { s = G_STATE_FAILED; } else { Modified: stable/9/sys/geom/raid/g_raid.h ============================================================================== --- stable/9/sys/geom/raid/g_raid.h Thu Jan 31 22:10:57 2013 (r246167) +++ stable/9/sys/geom/raid/g_raid.h Thu Jan 31 22:12:25 2013 (r246168) @@ -140,11 +140,12 @@ struct g_raid_event { }; #define G_RAID_DISK_S_NONE 0x00 /* State is unknown. */ #define G_RAID_DISK_S_OFFLINE 0x01 /* Missing disk placeholder. */ -#define G_RAID_DISK_S_FAILED 0x02 /* Failed. */ -#define G_RAID_DISK_S_STALE_FAILED 0x03 /* Old failed. */ -#define G_RAID_DISK_S_SPARE 0x04 /* Hot-spare. */ -#define G_RAID_DISK_S_STALE 0x05 /* Old disk, unused now. */ -#define G_RAID_DISK_S_ACTIVE 0x06 /* Operational. */ +#define G_RAID_DISK_S_DISABLED 0x02 /* Disabled. */ +#define G_RAID_DISK_S_FAILED 0x03 /* Failed. */ +#define G_RAID_DISK_S_STALE_FAILED 0x04 /* Old failed. */ +#define G_RAID_DISK_S_SPARE 0x05 /* Hot-spare. */ +#define G_RAID_DISK_S_STALE 0x06 /* Old disk, unused now. */ +#define G_RAID_DISK_S_ACTIVE 0x07 /* Operational. */ #define G_RAID_DISK_E_DISCONNECTED 0x01 Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:10:57 2013 (r246167) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:12:25 2013 (r246168) @@ -98,6 +98,8 @@ struct intel_raid_vol { uint8_t cng_master_disk; uint16_t cache_policy; uint8_t cng_state; +#define INTEL_SNGST_NEEDS_UPDATE 1 +#define INTEL_SNGST_MASTER_MISSING 2 uint8_t cng_sub_state; uint32_t filler_0[10]; @@ -130,6 +132,7 @@ struct intel_raid_disk { #define INTEL_F_ASSIGNED 0x02 #define INTEL_F_FAILED 0x04 #define INTEL_F_ONLINE 0x08 +#define INTEL_F_DISABLED 0x80 uint32_t owner_cfg_num; uint32_t sectors_hi; uint32_t filler[3]; @@ -187,6 +190,13 @@ struct g_raid_md_intel_perdisk { struct intel_raid_disk pd_disk_meta; }; +struct g_raid_md_intel_pervolume { + int pv_volume_pos; + int pv_cng; + int pv_cng_man_sync; + int pv_cng_master_disk; +}; + struct g_raid_md_intel_object { struct g_raid_md_object mdio_base; uint32_t mdio_config_id; @@ -206,6 +216,7 @@ static g_raid_md_ctl_t g_raid_md_ctl_int static g_raid_md_write_t g_raid_md_write_intel; static g_raid_md_fail_disk_t g_raid_md_fail_disk_intel; static g_raid_md_free_disk_t g_raid_md_free_disk_intel; +static g_raid_md_free_volume_t g_raid_md_free_volume_intel; static g_raid_md_free_t g_raid_md_free_intel; static kobj_method_t g_raid_md_intel_methods[] = { @@ -216,6 +227,7 @@ static kobj_method_t g_raid_md_intel_met KOBJMETHOD(g_raid_md_write, g_raid_md_write_intel), KOBJMETHOD(g_raid_md_fail_disk, g_raid_md_fail_disk_intel), KOBJMETHOD(g_raid_md_free_disk, g_raid_md_free_disk_intel), + KOBJMETHOD(g_raid_md_free_volume, g_raid_md_free_volume_intel), KOBJMETHOD(g_raid_md_free, g_raid_md_free_intel), { 0, 0 } }; @@ -369,8 +381,15 @@ g_raid_md_intel_print(struct intel_raid_ printf(" ****** Volume %d ******\n", i); printf(" name %.16s\n", mvol->name); printf(" total_sectors %ju\n", mvol->total_sectors); - printf(" state %u\n", mvol->state); + printf(" state 0x%08x\n", mvol->state); printf(" reserved %u\n", mvol->reserved); + printf(" migr_priority %u\n", mvol->migr_priority); + printf(" num_sub_vols %u\n", mvol->num_sub_vols); + printf(" tid %u\n", mvol->tid); + printf(" cng_master_disk %u\n", mvol->cng_master_disk); + printf(" cache_policy %u\n", mvol->cache_policy); + printf(" cng_state %u\n", mvol->cng_state); + printf(" cng_sub_state %u\n", mvol->cng_sub_state); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); @@ -699,9 +718,11 @@ static struct g_raid_volume * g_raid_md_intel_get_volume(struct g_raid_softc *sc, int id) { struct g_raid_volume *mvol; + struct g_raid_md_intel_pervolume *pv; TAILQ_FOREACH(mvol, &sc->sc_volumes, v_next) { - if ((intptr_t)(mvol->v_md_data) == id) + pv = mvol->v_md_data; + if (pv->pv_volume_pos == id) break; } return (mvol); @@ -715,6 +736,7 @@ g_raid_md_intel_start_disk(struct g_raid struct g_raid_disk *olddisk, *tmpdisk; struct g_raid_md_object *md; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd, *oldpd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -732,6 +754,11 @@ g_raid_md_intel_start_disk(struct g_raid disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); + /* Disabled disk is useless for us. */ + if (pd->pd_disk_meta.flags & INTEL_F_DISABLED) { + g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); + return (0); + } /* Failed stale disk is useless for us. */ if (pd->pd_disk_meta.flags & INTEL_F_FAILED) { g_raid_change_disk_state(disk, G_RAID_DISK_S_STALE_FAILED); @@ -826,6 +853,8 @@ nofit: /* Welcome the new disk. */ if (resurrection) g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); + else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) + g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else if (meta->disk[disk_pos].flags & INTEL_F_SPARE) @@ -833,8 +862,8 @@ nofit: else g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { - mvol = intel_get_volume(meta, - (uintptr_t)(sd->sd_volume->v_md_data)); + pv = sd->sd_volume->v_md_data; + mvol = intel_get_volume(meta, pv->pv_volume_pos); mmap0 = intel_get_map(mvol, 0); if (mvol->migr_state) mmap1 = intel_get_map(mvol, 1); @@ -845,12 +874,17 @@ nofit: /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); + } else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) { + /* Disabled disk, useless. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NONE); } else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) { /* Failed disk, almost useless. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_FAILED); } else if (mvol->migr_state == 0) { - if (mmap0->status == INTEL_S_UNINITIALIZED) { + if (mmap0->status == INTEL_S_UNINITIALIZED && + (!pv->pv_cng || pv->pv_cng_master_disk != disk_pos)) { /* Freshly created uninitialized volume. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_UNINITIALIZED); @@ -858,7 +892,8 @@ nofit: /* Freshly inserted disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (mvol->dirty) { + } else if (mvol->dirty && (!pv->pv_cng || + pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_STALE); @@ -885,7 +920,8 @@ nofit: sd->sd_volume->v_strip_size * mmap0->total_domains; } - } else if (mvol->dirty) { + } else if (mvol->dirty && (!pv->pv_cng || + pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_STALE); @@ -1014,6 +1050,7 @@ g_raid_md_intel_start(struct g_raid_soft { struct g_raid_md_object *md; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -1032,7 +1069,13 @@ g_raid_md_intel_start(struct g_raid_soft mvol = intel_get_volume(meta, i); mmap = intel_get_map(mvol, 0); vol = g_raid_create_volume(sc, mvol->name, -1); - vol->v_md_data = (void *)(intptr_t)i; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = i; + pv->pv_cng = (mvol->state & INTEL_ST_CLONE_N_GO) != 0; + pv->pv_cng_man_sync = (mvol->state & INTEL_ST_CLONE_MAN_SYNC) != 0; + if (mvol->cng_master_disk < mmap->total_disks) + pv->pv_cng_master_disk = mvol->cng_master_disk; + vol->v_md_data = pv; vol->v_raid_level_qualifier = G_RAID_VOLUME_RLQ_NONE; if (mmap->type == INTEL_T_RAID0) vol->v_raid_level = G_RAID_VOLUME_RL_RAID0; @@ -1450,6 +1493,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct g_consumer *cp; struct g_provider *pp; @@ -1621,7 +1665,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* We have all we need, create things: volume, ... */ mdi->mdio_started = 1; vol = g_raid_create_volume(sc, volname, -1); - vol->v_md_data = (void *)(intptr_t)0; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = 0; + vol->v_md_data = pv; vol->v_raid_level = level; vol->v_raid_level_qualifier = qual; vol->v_strip_size = strip; @@ -1814,7 +1860,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* We have all we need, create things: volume, ... */ vol = g_raid_create_volume(sc, volname, -1); - vol->v_md_data = (void *)(intptr_t)i; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = i; + vol->v_md_data = pv; vol->v_raid_level = level; vol->v_raid_level_qualifier = qual; vol->v_strip_size = strip; @@ -2105,6 +2153,7 @@ g_raid_md_write_intel(struct g_raid_md_o struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -2133,7 +2182,11 @@ g_raid_md_write_intel(struct g_raid_md_o pd->pd_disk_meta.flags = INTEL_F_ONLINE | INTEL_F_ASSIGNED; } else if (disk->d_state == G_RAID_DISK_S_FAILED) { - pd->pd_disk_meta.flags = INTEL_F_FAILED | INTEL_F_ASSIGNED; + pd->pd_disk_meta.flags = INTEL_F_FAILED | + INTEL_F_ASSIGNED; + } else if (disk->d_state == G_RAID_DISK_S_DISABLED) { + pd->pd_disk_meta.flags = INTEL_F_FAILED | + INTEL_F_ASSIGNED | INTEL_F_DISABLED; } else { pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; if (pd->pd_disk_meta.id != 0xffffffff) { @@ -2165,12 +2218,13 @@ g_raid_md_write_intel(struct g_raid_md_o vi = 0; version = INTEL_VERSION_1000; TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + pv = vol->v_md_data; if (vol->v_stopping) continue; mvol = intel_get_volume(meta, vi); /* New metadata may have different volumes order. */ - vol->v_md_data = (void *)(intptr_t)vi; + pv->pv_volume_pos = vi; for (sdi = 0; sdi < vol->v_disks_count; sdi++) { sd = &vol->v_subdisks[sdi]; @@ -2192,8 +2246,8 @@ g_raid_md_write_intel(struct g_raid_md_o if (meta->attributes & INTEL_ATTR_2TB) cv = INTEL_VERSION_1300; -// else if (dev->status == DEV_CLONE_N_GO) -// cv = INTEL_VERSION_1206; + else if (pv->pv_cng) + cv = INTEL_VERSION_1206; else if (vol->v_disks_count > 4) cv = INTEL_VERSION_1204; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID5) @@ -2211,6 +2265,17 @@ g_raid_md_write_intel(struct g_raid_md_o strlcpy(&mvol->name[0], vol->v_name, sizeof(mvol->name)); mvol->total_sectors = vol->v_mediasize / sectorsize; + if (pv->pv_cng) { + mvol->state |= INTEL_ST_CLONE_N_GO; + if (pv->pv_cng_man_sync) + mvol->state |= INTEL_ST_CLONE_MAN_SYNC; + mvol->cng_master_disk = pv->pv_cng_master_disk; + if (vol->v_subdisks[pv->pv_cng_master_disk].sd_state == + G_RAID_SUBDISK_S_NONE) + mvol->cng_state = INTEL_SNGST_MASTER_MISSING; + else if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) + mvol->cng_state = INTEL_SNGST_NEEDS_UPDATE; + } /* Check for any recovery in progress. */ state = G_RAID_SUBDISK_S_ACTIVE; @@ -2403,6 +2468,18 @@ g_raid_md_free_disk_intel(struct g_raid_ } static int +g_raid_md_free_volume_intel(struct g_raid_md_object *md, + struct g_raid_volume *vol) +{ + struct g_raid_md_intel_pervolume *pv; + + pv = (struct g_raid_md_intel_pervolume *)vol->v_md_data; + free(pv, M_MD_INTEL); + vol->v_md_data = NULL; + return (0); +} + +static int g_raid_md_free_intel(struct g_raid_md_object *md) { struct g_raid_md_intel_object *mdi; From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:12:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0D377B34; Thu, 31 Jan 2013 22:12:49 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 004856EC; Thu, 31 Jan 2013 22:12:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMCmNB047044; Thu, 31 Jan 2013 22:12:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMCmrC047043; Thu, 31 Jan 2013 22:12:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201301312212.r0VMCmrC047043@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 31 Jan 2013 22:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246169 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:12:49 -0000 Author: pjd Date: Thu Jan 31 22:12:48 2013 New Revision: 246169 URL: http://svnweb.freebsd.org/changeset/base/246169 Log: Simplify code a bit. This is leftover after Giant removal from VFS. Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jan 31 22:12:25 2013 (r246168) +++ head/sys/kern/vfs_vnops.c Thu Jan 31 22:12:48 2013 (r246169) @@ -1683,10 +1683,8 @@ vfs_write_resume(struct mount *mp, int f static int vn_kqfilter(struct file *fp, struct knote *kn) { - int error; - error = VOP_KQFILTER(fp->f_vnode, kn); - return (error); + return (VOP_KQFILTER(fp->f_vnode, kn)); } /* From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:13:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 693C8CB3; Thu, 31 Jan 2013 22:13:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A9A76FD; Thu, 31 Jan 2013 22:13:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMDbYL047243; Thu, 31 Jan 2013 22:13:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMDaWM047237; Thu, 31 Jan 2013 22:13:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312213.r0VMDaWM047237@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246170 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:13:37 -0000 Author: mav Date: Thu Jan 31 22:13:36 2013 New Revision: 246170 URL: http://svnweb.freebsd.org/changeset/base/246170 Log: MFC r245326: Add basic support for Intel Rapid Recover Technology (Intel RRT). It is alike to RAID1, but with dedicating master and recovery disks and providing manual control over synchronization. It allows to use recovery disk as snapshot of the master disk from the time of the last sync. This implementation is not functionaly complete comparing to Windows, but it is better then silent conversion to RAID1 on first boot. Modified: stable/8/sys/geom/raid/g_raid.c stable/8/sys/geom/raid/g_raid.h stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/g_raid.c ============================================================================== --- stable/8/sys/geom/raid/g_raid.c Thu Jan 31 22:12:48 2013 (r246169) +++ stable/8/sys/geom/raid/g_raid.c Thu Jan 31 22:13:36 2013 (r246170) @@ -162,6 +162,8 @@ g_raid_disk_state2str(int state) return ("NONE"); case G_RAID_DISK_S_OFFLINE: return ("OFFLINE"); + case G_RAID_DISK_S_DISABLED: + return ("DISABLED"); case G_RAID_DISK_S_FAILED: return ("FAILED"); case G_RAID_DISK_S_STALE_FAILED: @@ -532,7 +534,9 @@ g_raid_report_disk_state(struct g_raid_d if (disk->d_consumer == NULL) return; - if (disk->d_state == G_RAID_DISK_S_FAILED || + if (disk->d_state == G_RAID_DISK_S_DISABLED) { + ; + } else if (disk->d_state == G_RAID_DISK_S_FAILED || disk->d_state == G_RAID_DISK_S_STALE_FAILED) { s = G_STATE_FAILED; } else { Modified: stable/8/sys/geom/raid/g_raid.h ============================================================================== --- stable/8/sys/geom/raid/g_raid.h Thu Jan 31 22:12:48 2013 (r246169) +++ stable/8/sys/geom/raid/g_raid.h Thu Jan 31 22:13:36 2013 (r246170) @@ -140,11 +140,12 @@ struct g_raid_event { }; #define G_RAID_DISK_S_NONE 0x00 /* State is unknown. */ #define G_RAID_DISK_S_OFFLINE 0x01 /* Missing disk placeholder. */ -#define G_RAID_DISK_S_FAILED 0x02 /* Failed. */ -#define G_RAID_DISK_S_STALE_FAILED 0x03 /* Old failed. */ -#define G_RAID_DISK_S_SPARE 0x04 /* Hot-spare. */ -#define G_RAID_DISK_S_STALE 0x05 /* Old disk, unused now. */ -#define G_RAID_DISK_S_ACTIVE 0x06 /* Operational. */ +#define G_RAID_DISK_S_DISABLED 0x02 /* Disabled. */ +#define G_RAID_DISK_S_FAILED 0x03 /* Failed. */ +#define G_RAID_DISK_S_STALE_FAILED 0x04 /* Old failed. */ +#define G_RAID_DISK_S_SPARE 0x05 /* Hot-spare. */ +#define G_RAID_DISK_S_STALE 0x06 /* Old disk, unused now. */ +#define G_RAID_DISK_S_ACTIVE 0x07 /* Operational. */ #define G_RAID_DISK_E_DISCONNECTED 0x01 Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:12:48 2013 (r246169) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:13:36 2013 (r246170) @@ -98,6 +98,8 @@ struct intel_raid_vol { uint8_t cng_master_disk; uint16_t cache_policy; uint8_t cng_state; +#define INTEL_SNGST_NEEDS_UPDATE 1 +#define INTEL_SNGST_MASTER_MISSING 2 uint8_t cng_sub_state; uint32_t filler_0[10]; @@ -130,6 +132,7 @@ struct intel_raid_disk { #define INTEL_F_ASSIGNED 0x02 #define INTEL_F_FAILED 0x04 #define INTEL_F_ONLINE 0x08 +#define INTEL_F_DISABLED 0x80 uint32_t owner_cfg_num; uint32_t sectors_hi; uint32_t filler[3]; @@ -187,6 +190,13 @@ struct g_raid_md_intel_perdisk { struct intel_raid_disk pd_disk_meta; }; +struct g_raid_md_intel_pervolume { + int pv_volume_pos; + int pv_cng; + int pv_cng_man_sync; + int pv_cng_master_disk; +}; + struct g_raid_md_intel_object { struct g_raid_md_object mdio_base; uint32_t mdio_config_id; @@ -206,6 +216,7 @@ static g_raid_md_ctl_t g_raid_md_ctl_int static g_raid_md_write_t g_raid_md_write_intel; static g_raid_md_fail_disk_t g_raid_md_fail_disk_intel; static g_raid_md_free_disk_t g_raid_md_free_disk_intel; +static g_raid_md_free_volume_t g_raid_md_free_volume_intel; static g_raid_md_free_t g_raid_md_free_intel; static kobj_method_t g_raid_md_intel_methods[] = { @@ -216,6 +227,7 @@ static kobj_method_t g_raid_md_intel_met KOBJMETHOD(g_raid_md_write, g_raid_md_write_intel), KOBJMETHOD(g_raid_md_fail_disk, g_raid_md_fail_disk_intel), KOBJMETHOD(g_raid_md_free_disk, g_raid_md_free_disk_intel), + KOBJMETHOD(g_raid_md_free_volume, g_raid_md_free_volume_intel), KOBJMETHOD(g_raid_md_free, g_raid_md_free_intel), { 0, 0 } }; @@ -369,8 +381,15 @@ g_raid_md_intel_print(struct intel_raid_ printf(" ****** Volume %d ******\n", i); printf(" name %.16s\n", mvol->name); printf(" total_sectors %ju\n", mvol->total_sectors); - printf(" state %u\n", mvol->state); + printf(" state 0x%08x\n", mvol->state); printf(" reserved %u\n", mvol->reserved); + printf(" migr_priority %u\n", mvol->migr_priority); + printf(" num_sub_vols %u\n", mvol->num_sub_vols); + printf(" tid %u\n", mvol->tid); + printf(" cng_master_disk %u\n", mvol->cng_master_disk); + printf(" cache_policy %u\n", mvol->cache_policy); + printf(" cng_state %u\n", mvol->cng_state); + printf(" cng_sub_state %u\n", mvol->cng_sub_state); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); @@ -699,9 +718,11 @@ static struct g_raid_volume * g_raid_md_intel_get_volume(struct g_raid_softc *sc, int id) { struct g_raid_volume *mvol; + struct g_raid_md_intel_pervolume *pv; TAILQ_FOREACH(mvol, &sc->sc_volumes, v_next) { - if ((intptr_t)(mvol->v_md_data) == id) + pv = mvol->v_md_data; + if (pv->pv_volume_pos == id) break; } return (mvol); @@ -715,6 +736,7 @@ g_raid_md_intel_start_disk(struct g_raid struct g_raid_disk *olddisk, *tmpdisk; struct g_raid_md_object *md; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd, *oldpd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -732,6 +754,11 @@ g_raid_md_intel_start_disk(struct g_raid disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); + /* Disabled disk is useless for us. */ + if (pd->pd_disk_meta.flags & INTEL_F_DISABLED) { + g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); + return (0); + } /* Failed stale disk is useless for us. */ if (pd->pd_disk_meta.flags & INTEL_F_FAILED) { g_raid_change_disk_state(disk, G_RAID_DISK_S_STALE_FAILED); @@ -826,6 +853,8 @@ nofit: /* Welcome the new disk. */ if (resurrection) g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); + else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) + g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else if (meta->disk[disk_pos].flags & INTEL_F_SPARE) @@ -833,8 +862,8 @@ nofit: else g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { - mvol = intel_get_volume(meta, - (uintptr_t)(sd->sd_volume->v_md_data)); + pv = sd->sd_volume->v_md_data; + mvol = intel_get_volume(meta, pv->pv_volume_pos); mmap0 = intel_get_map(mvol, 0); if (mvol->migr_state) mmap1 = intel_get_map(mvol, 1); @@ -845,12 +874,17 @@ nofit: /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); + } else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) { + /* Disabled disk, useless. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NONE); } else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) { /* Failed disk, almost useless. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_FAILED); } else if (mvol->migr_state == 0) { - if (mmap0->status == INTEL_S_UNINITIALIZED) { + if (mmap0->status == INTEL_S_UNINITIALIZED && + (!pv->pv_cng || pv->pv_cng_master_disk != disk_pos)) { /* Freshly created uninitialized volume. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_UNINITIALIZED); @@ -858,7 +892,8 @@ nofit: /* Freshly inserted disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (mvol->dirty) { + } else if (mvol->dirty && (!pv->pv_cng || + pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_STALE); @@ -885,7 +920,8 @@ nofit: sd->sd_volume->v_strip_size * mmap0->total_domains; } - } else if (mvol->dirty) { + } else if (mvol->dirty && (!pv->pv_cng || + pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_STALE); @@ -1014,6 +1050,7 @@ g_raid_md_intel_start(struct g_raid_soft { struct g_raid_md_object *md; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -1032,7 +1069,13 @@ g_raid_md_intel_start(struct g_raid_soft mvol = intel_get_volume(meta, i); mmap = intel_get_map(mvol, 0); vol = g_raid_create_volume(sc, mvol->name, -1); - vol->v_md_data = (void *)(intptr_t)i; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = i; + pv->pv_cng = (mvol->state & INTEL_ST_CLONE_N_GO) != 0; + pv->pv_cng_man_sync = (mvol->state & INTEL_ST_CLONE_MAN_SYNC) != 0; + if (mvol->cng_master_disk < mmap->total_disks) + pv->pv_cng_master_disk = mvol->cng_master_disk; + vol->v_md_data = pv; vol->v_raid_level_qualifier = G_RAID_VOLUME_RLQ_NONE; if (mmap->type == INTEL_T_RAID0) vol->v_raid_level = G_RAID_VOLUME_RL_RAID0; @@ -1450,6 +1493,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct g_consumer *cp; struct g_provider *pp; @@ -1621,7 +1665,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* We have all we need, create things: volume, ... */ mdi->mdio_started = 1; vol = g_raid_create_volume(sc, volname, -1); - vol->v_md_data = (void *)(intptr_t)0; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = 0; + vol->v_md_data = pv; vol->v_raid_level = level; vol->v_raid_level_qualifier = qual; vol->v_strip_size = strip; @@ -1814,7 +1860,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* We have all we need, create things: volume, ... */ vol = g_raid_create_volume(sc, volname, -1); - vol->v_md_data = (void *)(intptr_t)i; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = i; + vol->v_md_data = pv; vol->v_raid_level = level; vol->v_raid_level_qualifier = qual; vol->v_strip_size = strip; @@ -2105,6 +2153,7 @@ g_raid_md_write_intel(struct g_raid_md_o struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -2133,7 +2182,11 @@ g_raid_md_write_intel(struct g_raid_md_o pd->pd_disk_meta.flags = INTEL_F_ONLINE | INTEL_F_ASSIGNED; } else if (disk->d_state == G_RAID_DISK_S_FAILED) { - pd->pd_disk_meta.flags = INTEL_F_FAILED | INTEL_F_ASSIGNED; + pd->pd_disk_meta.flags = INTEL_F_FAILED | + INTEL_F_ASSIGNED; + } else if (disk->d_state == G_RAID_DISK_S_DISABLED) { + pd->pd_disk_meta.flags = INTEL_F_FAILED | + INTEL_F_ASSIGNED | INTEL_F_DISABLED; } else { pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; if (pd->pd_disk_meta.id != 0xffffffff) { @@ -2165,12 +2218,13 @@ g_raid_md_write_intel(struct g_raid_md_o vi = 0; version = INTEL_VERSION_1000; TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + pv = vol->v_md_data; if (vol->v_stopping) continue; mvol = intel_get_volume(meta, vi); /* New metadata may have different volumes order. */ - vol->v_md_data = (void *)(intptr_t)vi; + pv->pv_volume_pos = vi; for (sdi = 0; sdi < vol->v_disks_count; sdi++) { sd = &vol->v_subdisks[sdi]; @@ -2192,8 +2246,8 @@ g_raid_md_write_intel(struct g_raid_md_o if (meta->attributes & INTEL_ATTR_2TB) cv = INTEL_VERSION_1300; -// else if (dev->status == DEV_CLONE_N_GO) -// cv = INTEL_VERSION_1206; + else if (pv->pv_cng) + cv = INTEL_VERSION_1206; else if (vol->v_disks_count > 4) cv = INTEL_VERSION_1204; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID5) @@ -2211,6 +2265,17 @@ g_raid_md_write_intel(struct g_raid_md_o strlcpy(&mvol->name[0], vol->v_name, sizeof(mvol->name)); mvol->total_sectors = vol->v_mediasize / sectorsize; + if (pv->pv_cng) { + mvol->state |= INTEL_ST_CLONE_N_GO; + if (pv->pv_cng_man_sync) + mvol->state |= INTEL_ST_CLONE_MAN_SYNC; + mvol->cng_master_disk = pv->pv_cng_master_disk; + if (vol->v_subdisks[pv->pv_cng_master_disk].sd_state == + G_RAID_SUBDISK_S_NONE) + mvol->cng_state = INTEL_SNGST_MASTER_MISSING; + else if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) + mvol->cng_state = INTEL_SNGST_NEEDS_UPDATE; + } /* Check for any recovery in progress. */ state = G_RAID_SUBDISK_S_ACTIVE; @@ -2403,6 +2468,18 @@ g_raid_md_free_disk_intel(struct g_raid_ } static int +g_raid_md_free_volume_intel(struct g_raid_md_object *md, + struct g_raid_volume *vol) +{ + struct g_raid_md_intel_pervolume *pv; + + pv = (struct g_raid_md_intel_pervolume *)vol->v_md_data; + free(pv, M_MD_INTEL); + vol->v_md_data = NULL; + return (0); +} + +static int g_raid_md_free_intel(struct g_raid_md_object *md) { struct g_raid_md_intel_object *mdi; From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:14:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 62D3CE49; Thu, 31 Jan 2013 22:14:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 512D1723; Thu, 31 Jan 2013 22:14:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMEH8X047406; Thu, 31 Jan 2013 22:14:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMEHl3047405; Thu, 31 Jan 2013 22:14:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201301312214.r0VMEHl3047405@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 31 Jan 2013 22:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246171 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:14:17 -0000 Author: pjd Date: Thu Jan 31 22:14:16 2013 New Revision: 246171 URL: http://svnweb.freebsd.org/changeset/base/246171 Log: Remove label that was accidentally moved during Giant removal from VFS. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Jan 31 22:13:36 2013 (r246170) +++ head/sys/kern/kern_descrip.c Thu Jan 31 22:14:16 2013 (r246171) @@ -779,8 +779,10 @@ kern_fcntl(struct thread *td, int fd, in if (arg != 0) { vp = fp->f_vnode; error = vn_lock(vp, LK_SHARED); - if (error != 0) - goto readahead_vnlock_fail; + if (error != 0) { + fdrop(fp, td); + break; + } bsize = fp->f_vnode->v_mount->mnt_stat.f_iosize; VOP_UNLOCK(vp, 0); fp->f_seqcount = (arg + bsize - 1) / bsize; @@ -788,7 +790,6 @@ kern_fcntl(struct thread *td, int fd, in new = old = fp->f_flag; new |= FRDAHEAD; } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); - readahead_vnlock_fail:; } else { do { new = old = fp->f_flag; From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:15:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8890BFD4; Thu, 31 Jan 2013 22:15:42 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64D4573A; Thu, 31 Jan 2013 22:15:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMFgV5047664; Thu, 31 Jan 2013 22:15:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMFgb6047663; Thu, 31 Jan 2013 22:15:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201301312215.r0VMFgb6047663@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 31 Jan 2013 22:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246172 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:15:42 -0000 Author: pjd Date: Thu Jan 31 22:15:41 2013 New Revision: 246172 URL: http://svnweb.freebsd.org/changeset/base/246172 Log: Remove leftover label after Giant removal from VFS. Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Jan 31 22:14:16 2013 (r246171) +++ head/sys/kern/vfs_syscalls.c Thu Jan 31 22:15:41 2013 (r246172) @@ -1108,7 +1108,7 @@ kern_openat(struct thread *td, int fd, c if (error == ERESTART) error = EINTR; - goto bad_unlocked; + goto bad; } td->td_dupfd = 0; NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1150,12 +1150,11 @@ success: */ if ((error = kern_capwrap(td, fp, nd.ni_baserights, &indx)) != 0) - goto bad_unlocked; + goto bad; } else #endif if ((error = finstall(td, fp, &indx, flags)) != 0) - goto bad_unlocked; - + goto bad; } /* @@ -1166,7 +1165,6 @@ success: td->td_retval[0] = indx; return (0); bad: -bad_unlocked: KASSERT(indx == -1, ("indx=%d, should be -1", indx)); fdrop(fp, td); return (error); From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:15:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5743016B; Thu, 31 Jan 2013 22:15:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3973373F; Thu, 31 Jan 2013 22:15:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMFmGF047718; Thu, 31 Jan 2013 22:15:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMFmnN047717; Thu, 31 Jan 2013 22:15:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312215.r0VMFmnN047717@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246173 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:15:51 -0000 Author: mav Date: Thu Jan 31 22:15:47 2013 New Revision: 246173 URL: http://svnweb.freebsd.org/changeset/base/246173 Log: MFC r245338: Implement migration from single disk to RAID1/IRRT for Intel metadata. Windows driver uses such migration when it creates new arrays. While GEOM RAID has no mechanism to implement migration in general case, this specifc case still can be handled easily via degraded RAID1 creation followed by regular rebuild. Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:15:41 2013 (r246172) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:15:47 2013 (r246173) @@ -171,8 +171,13 @@ struct intel_raid_conf { uint8_t total_disks; uint8_t total_volumes; - uint8_t dummy_2[2]; - uint32_t filler_0[39]; + uint8_t error_log_pos; + uint8_t dummy_2[1]; + uint32_t cache_size; + uint32_t orig_family_num; + uint32_t pwr_cycle_count; + uint32_t bbm_log_size; + uint32_t filler_0[35]; struct intel_raid_disk disk[1]; /* total_disks entries. */ /* Here goes total_volumes of struct intel_raid_vol. */ } __packed; @@ -366,9 +371,12 @@ g_raid_md_intel_print(struct intel_raid_ printf("config_size 0x%08x\n", meta->config_size); printf("config_id 0x%08x\n", meta->config_id); printf("generation 0x%08x\n", meta->generation); + printf("error_log_size %d\n", meta->error_log_size); printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); + printf("orig_family_num 0x%08x\n", meta->orig_family_num); + printf("bbm_log_size %u\n", meta->bbm_log_size); printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); for (i = 0; i < meta->total_disks; i++ ) { printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, @@ -451,7 +459,7 @@ intel_meta_read(struct g_consumer *cp) struct g_provider *pp; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; - struct intel_raid_map *mmap; + struct intel_raid_map *mmap, *mmap1; char *buf; int error, i, j, k, left, size; uint32_t checksum, *ptr; @@ -544,6 +552,8 @@ badsize: } } + g_raid_md_intel_print(meta); + /* Validate disk indexes. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -566,16 +576,39 @@ badsize: /* Validate migration types. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); + /* Deny unknown migration types. */ if (mvol->migr_state && mvol->migr_type != INTEL_MT_INIT && mvol->migr_type != INTEL_MT_REBUILD && mvol->migr_type != INTEL_MT_VERIFY && + mvol->migr_type != INTEL_MT_GEN_MIGR && mvol->migr_type != INTEL_MT_REPAIR) { G_RAID_DEBUG(1, "Intel metadata has unsupported" " migration type %d", mvol->migr_type); free(meta, M_MD_INTEL); return (NULL); } + /* Deny general migrations except SINGLE->RAID1. */ + if (mvol->migr_state && + mvol->migr_type == INTEL_MT_GEN_MIGR) { + mmap = intel_get_map(mvol, 0); + mmap1 = intel_get_map(mvol, 1); + if (mmap1->total_disks != 1 || + mmap->type != INTEL_T_RAID1 || + mmap->total_disks != 2 || + mmap->offset != mmap1->offset || + mmap->disk_sectors != mmap1->disk_sectors || + mmap->total_domains != mmap->total_disks || + mmap->offset_hi != mmap1->offset_hi || + mmap->disk_sectors_hi != mmap1->disk_sectors_hi || + (mmap->disk_idx[0] != mmap1->disk_idx[0] && + mmap->disk_idx[0] != mmap1->disk_idx[1])) { + G_RAID_DEBUG(1, "Intel metadata has unsupported" + " variant of general migration"); + free(meta, M_MD_INTEL); + return (NULL); + } + } } return (meta); @@ -957,6 +990,16 @@ nofit: g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_ACTIVE); } + } else if (mvol->migr_type == INTEL_MT_GEN_MIGR) { + if ((mmap1->disk_idx[0] & INTEL_DI_IDX) != disk_pos) { + /* Freshly inserted disk. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NEW); + } else { + /* Up to date disk. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_ACTIVE); + } } g_raid_event_send(sd, G_RAID_SUBDISK_E_NEW, G_RAID_EVENT_SUBDISK); @@ -1337,8 +1380,6 @@ g_raid_md_taste_intel(struct g_raid_md_o goto fail1; } - /* Metadata valid. Print it. */ - g_raid_md_intel_print(meta); G_RAID_DEBUG(1, "Intel disk position %d", disk_pos); spare = meta->disk[disk_pos].flags & INTEL_F_SPARE; @@ -2370,7 +2411,8 @@ g_raid_md_write_intel(struct g_raid_md_o mmap1->disk_idx[sdi] |= INTEL_DI_RBLD; } if ((sd->sd_state == G_RAID_SUBDISK_S_NONE || - sd->sd_state == G_RAID_SUBDISK_S_FAILED) && + sd->sd_state == G_RAID_SUBDISK_S_FAILED || + sd->sd_state == G_RAID_SUBDISK_S_REBUILD) && mmap0->failed_disk_num == 0xff) { mmap0->failed_disk_num = sdi; if (mvol->migr_state) From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:16:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E4B5534E; Thu, 31 Jan 2013 22:16:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C88F3751; Thu, 31 Jan 2013 22:16:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMGq7j047924; Thu, 31 Jan 2013 22:16:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMGqMO047923; Thu, 31 Jan 2013 22:16:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312216.r0VMGqMO047923@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246174 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:16:53 -0000 Author: mav Date: Thu Jan 31 22:16:52 2013 New Revision: 246174 URL: http://svnweb.freebsd.org/changeset/base/246174 Log: MFC r245338: Implement migration from single disk to RAID1/IRRT for Intel metadata. Windows driver uses such migration when it creates new arrays. While GEOM RAID has no mechanism to implement migration in general case, this specifc case still can be handled easily via degraded RAID1 creation followed by regular rebuild. Modified: stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:15:47 2013 (r246173) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:16:52 2013 (r246174) @@ -171,8 +171,13 @@ struct intel_raid_conf { uint8_t total_disks; uint8_t total_volumes; - uint8_t dummy_2[2]; - uint32_t filler_0[39]; + uint8_t error_log_pos; + uint8_t dummy_2[1]; + uint32_t cache_size; + uint32_t orig_family_num; + uint32_t pwr_cycle_count; + uint32_t bbm_log_size; + uint32_t filler_0[35]; struct intel_raid_disk disk[1]; /* total_disks entries. */ /* Here goes total_volumes of struct intel_raid_vol. */ } __packed; @@ -366,9 +371,12 @@ g_raid_md_intel_print(struct intel_raid_ printf("config_size 0x%08x\n", meta->config_size); printf("config_id 0x%08x\n", meta->config_id); printf("generation 0x%08x\n", meta->generation); + printf("error_log_size %d\n", meta->error_log_size); printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); + printf("orig_family_num 0x%08x\n", meta->orig_family_num); + printf("bbm_log_size %u\n", meta->bbm_log_size); printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); for (i = 0; i < meta->total_disks; i++ ) { printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, @@ -451,7 +459,7 @@ intel_meta_read(struct g_consumer *cp) struct g_provider *pp; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; - struct intel_raid_map *mmap; + struct intel_raid_map *mmap, *mmap1; char *buf; int error, i, j, k, left, size; uint32_t checksum, *ptr; @@ -544,6 +552,8 @@ badsize: } } + g_raid_md_intel_print(meta); + /* Validate disk indexes. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -566,16 +576,39 @@ badsize: /* Validate migration types. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); + /* Deny unknown migration types. */ if (mvol->migr_state && mvol->migr_type != INTEL_MT_INIT && mvol->migr_type != INTEL_MT_REBUILD && mvol->migr_type != INTEL_MT_VERIFY && + mvol->migr_type != INTEL_MT_GEN_MIGR && mvol->migr_type != INTEL_MT_REPAIR) { G_RAID_DEBUG(1, "Intel metadata has unsupported" " migration type %d", mvol->migr_type); free(meta, M_MD_INTEL); return (NULL); } + /* Deny general migrations except SINGLE->RAID1. */ + if (mvol->migr_state && + mvol->migr_type == INTEL_MT_GEN_MIGR) { + mmap = intel_get_map(mvol, 0); + mmap1 = intel_get_map(mvol, 1); + if (mmap1->total_disks != 1 || + mmap->type != INTEL_T_RAID1 || + mmap->total_disks != 2 || + mmap->offset != mmap1->offset || + mmap->disk_sectors != mmap1->disk_sectors || + mmap->total_domains != mmap->total_disks || + mmap->offset_hi != mmap1->offset_hi || + mmap->disk_sectors_hi != mmap1->disk_sectors_hi || + (mmap->disk_idx[0] != mmap1->disk_idx[0] && + mmap->disk_idx[0] != mmap1->disk_idx[1])) { + G_RAID_DEBUG(1, "Intel metadata has unsupported" + " variant of general migration"); + free(meta, M_MD_INTEL); + return (NULL); + } + } } return (meta); @@ -957,6 +990,16 @@ nofit: g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_ACTIVE); } + } else if (mvol->migr_type == INTEL_MT_GEN_MIGR) { + if ((mmap1->disk_idx[0] & INTEL_DI_IDX) != disk_pos) { + /* Freshly inserted disk. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NEW); + } else { + /* Up to date disk. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_ACTIVE); + } } g_raid_event_send(sd, G_RAID_SUBDISK_E_NEW, G_RAID_EVENT_SUBDISK); @@ -1337,8 +1380,6 @@ g_raid_md_taste_intel(struct g_raid_md_o goto fail1; } - /* Metadata valid. Print it. */ - g_raid_md_intel_print(meta); G_RAID_DEBUG(1, "Intel disk position %d", disk_pos); spare = meta->disk[disk_pos].flags & INTEL_F_SPARE; @@ -2370,7 +2411,8 @@ g_raid_md_write_intel(struct g_raid_md_o mmap1->disk_idx[sdi] |= INTEL_DI_RBLD; } if ((sd->sd_state == G_RAID_SUBDISK_S_NONE || - sd->sd_state == G_RAID_SUBDISK_S_FAILED) && + sd->sd_state == G_RAID_SUBDISK_S_FAILED || + sd->sd_state == G_RAID_SUBDISK_S_REBUILD) && mmap0->failed_disk_num == 0xff) { mmap0->failed_disk_num = sdi; if (mvol->migr_state) From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:18:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8924581; Thu, 31 Jan 2013 22:18:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE13782; Thu, 31 Jan 2013 22:18:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMIfH3048564; Thu, 31 Jan 2013 22:18:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMIf5n048563; Thu, 31 Jan 2013 22:18:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312218.r0VMIf5n048563@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246175 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:18:41 -0000 Author: mav Date: Thu Jan 31 22:18:40 2013 New Revision: 246175 URL: http://svnweb.freebsd.org/changeset/base/246175 Log: MFC r245341: Windows handles INIT and VERIFY as array-wide and it doesn't specify which disks should be rebuilt. Our rebuild code is same time disk-centric. To handle this situation properly check all disks for RBLD flags, and if no disk specified try rebuild/resync all of them except newly inserted. Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:16:52 2013 (r246174) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:18:40 2013 (r246175) @@ -774,7 +774,7 @@ g_raid_md_intel_start_disk(struct g_raid struct intel_raid_conf *meta; struct intel_raid_vol *mvol; struct intel_raid_map *mmap0, *mmap1; - int disk_pos, resurrection = 0; + int disk_pos, resurrection = 0, migr_global, i; sc = disk->d_softc; md = sc->sc_md; @@ -903,6 +903,13 @@ nofit: else mmap1 = mmap0; + migr_global = 1; + for (i = 0; i < mmap0->total_disks; i++) { + if ((mmap0->disk_idx[i] & INTEL_DI_RBLD) == 0 && + (mmap1->disk_idx[i] & INTEL_DI_RBLD) != 0) + migr_global = 0; + } + if (resurrection) { /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, @@ -953,6 +960,11 @@ nofit: sd->sd_volume->v_strip_size * mmap0->total_domains; } + } else if (mvol->migr_type == INTEL_MT_INIT && + migr_global) { + /* Freshly created uninitialized volume. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_UNINITIALIZED); } else if (mvol->dirty && (!pv->pv_cng || pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ @@ -969,7 +981,8 @@ nofit: /* Freshly inserted disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) { + } else if ((mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) || + migr_global) { /* Resyncing disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_RESYNC); From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:19:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B562D6F0; Thu, 31 Jan 2013 22:19:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F07C78A; Thu, 31 Jan 2013 22:19:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMJeri048739; Thu, 31 Jan 2013 22:19:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMJe6P048738; Thu, 31 Jan 2013 22:19:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312219.r0VMJe6P048738@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246176 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:19:40 -0000 Author: mav Date: Thu Jan 31 22:19:39 2013 New Revision: 246176 URL: http://svnweb.freebsd.org/changeset/base/246176 Log: MFC r245341: Windows handles INIT and VERIFY as array-wide and it doesn't specify which disks should be rebuilt. Our rebuild code is same time disk-centric. To handle this situation properly check all disks for RBLD flags, and if no disk specified try rebuild/resync all of them except newly inserted. Modified: stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:18:40 2013 (r246175) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:19:39 2013 (r246176) @@ -774,7 +774,7 @@ g_raid_md_intel_start_disk(struct g_raid struct intel_raid_conf *meta; struct intel_raid_vol *mvol; struct intel_raid_map *mmap0, *mmap1; - int disk_pos, resurrection = 0; + int disk_pos, resurrection = 0, migr_global, i; sc = disk->d_softc; md = sc->sc_md; @@ -903,6 +903,13 @@ nofit: else mmap1 = mmap0; + migr_global = 1; + for (i = 0; i < mmap0->total_disks; i++) { + if ((mmap0->disk_idx[i] & INTEL_DI_RBLD) == 0 && + (mmap1->disk_idx[i] & INTEL_DI_RBLD) != 0) + migr_global = 0; + } + if (resurrection) { /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, @@ -953,6 +960,11 @@ nofit: sd->sd_volume->v_strip_size * mmap0->total_domains; } + } else if (mvol->migr_type == INTEL_MT_INIT && + migr_global) { + /* Freshly created uninitialized volume. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_UNINITIALIZED); } else if (mvol->dirty && (!pv->pv_cng || pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ @@ -969,7 +981,8 @@ nofit: /* Freshly inserted disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) { + } else if ((mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) || + migr_global) { /* Resyncing disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_RESYNC); From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:20:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5F3485C; Thu, 31 Jan 2013 22:20:05 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8042794; Thu, 31 Jan 2013 22:20:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMK52B048872; Thu, 31 Jan 2013 22:20:05 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMK5OE048871; Thu, 31 Jan 2013 22:20:05 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201301312220.r0VMK5OE048871@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 31 Jan 2013 22:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246177 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:20:05 -0000 Author: pjd Date: Thu Jan 31 22:20:05 2013 New Revision: 246177 URL: http://svnweb.freebsd.org/changeset/base/246177 Log: Now that MPSAFE flag is gone, we can arrange code a bit better. Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Jan 31 22:19:39 2013 (r246176) +++ head/sys/kern/vfs_syscalls.c Thu Jan 31 22:20:05 2013 (r246177) @@ -187,8 +187,8 @@ sys_quotactl(td, uap) AUDIT_ARG_UID(uap->uid); if (!prison_allow(td->td_ucred, PR_ALLOW_QUOTAS)) return (EPERM); - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, - UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, + uap->path, td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -293,8 +293,8 @@ kern_statfs(struct thread *td, char *pat int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | - AUDITVNODE1, pathseg, path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, + pathseg, path, td); error = namei(&nd); if (error) return (error); @@ -871,8 +871,8 @@ sys_chroot(td, uap) error = priv_check(td, PRIV_VFS_CHROOT); if (error) return (error); - NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | - AUDITVNODE1, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, + UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) goto error; @@ -1077,8 +1077,8 @@ kern_openat(struct thread *td, int fd, c /* Set the flags early so the finit in devfs can pick them up. */ fp->f_flag = flags & FMASK; cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT; - NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, - path, fd, rights_needed, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, fd, + rights_needed, td); td->td_dupfd = -1; /* XXX check for fdopen */ error = vn_open(&nd, &flags, cmode, fp); if (error) { @@ -1277,9 +1277,8 @@ kern_mknodat(struct thread *td, int fd, return (error); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, - LOCKPARENT | SAVENAME | AUDITVNODE1, pathseg, path, fd, - CAP_MKNOD, td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, + pathseg, path, fd, CAP_MKNOD, td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1398,9 +1397,8 @@ kern_mkfifoat(struct thread *td, int fd, AUDIT_ARG_MODE(mode); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, - LOCKPARENT | SAVENAME | AUDITVNODE1, pathseg, path, fd, - CAP_MKFIFO, td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, + pathseg, path, fd, CAP_MKFIFO, td); if ((error = namei(&nd)) != 0) return (error); if (nd.ni_vp != NULL) { @@ -1539,8 +1537,7 @@ kern_linkat(struct thread *td, int fd1, int error; bwillwrite(); - NDINIT_AT(&nd, LOOKUP, follow | AUDITVNODE1, segflg, path1, - fd1, td); + NDINIT_AT(&nd, LOOKUP, follow | AUDITVNODE1, segflg, path1, fd1, td); if ((error = namei(&nd)) != 0) return (error); @@ -1554,8 +1551,8 @@ kern_linkat(struct thread *td, int fd1, vrele(vp); return (error); } - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | - AUDITVNODE2, segflg, path2, fd2, CAP_CREATE, td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE2, + segflg, path2, fd2, CAP_CREATE, td); if ((error = namei(&nd)) == 0) { if (nd.ni_vp != NULL) { if (nd.ni_dvp == nd.ni_vp) @@ -1647,8 +1644,8 @@ kern_symlinkat(struct thread *td, char * AUDIT_ARG_TEXT(syspath); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | - AUDITVNODE1, segflg, path2, fd, CAP_CREATE, td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, + segflg, path2, fd, CAP_CREATE, td); if ((error = namei(&nd)) != 0) goto out; if (nd.ni_vp) { @@ -1799,8 +1796,8 @@ kern_unlinkat(struct thread *td, int fd, restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | - AUDITVNODE1, pathseg, path, fd, CAP_DELETE, td); + NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1, + pathseg, path, fd, CAP_DELETE, td); if ((error = namei(&nd)) != 0) return (error == EINVAL ? EPERM : error); vp = nd.ni_vp; @@ -2307,8 +2304,8 @@ kern_statat_vnhook(struct thread *td, in return (EINVAL); NDINIT_ATRIGHTS(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : - FOLLOW) | LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, - path, fd, CAP_FSTAT, td); + FOLLOW) | LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, path, fd, + CAP_FSTAT, td); if ((error = namei(&nd)) != 0) return (error); @@ -2484,7 +2481,8 @@ sys_lpathconf(td, uap) } */ *uap; { - return (kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name, NOFOLLOW)); + return (kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name, + NOFOLLOW)); } int @@ -2570,8 +2568,8 @@ kern_readlinkat(struct thread *td, int f if (count > IOSIZE_MAX) return (EINVAL); - NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | - AUDITVNODE1, pathseg, path, fd, td); + NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, + pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error); @@ -2668,8 +2666,7 @@ sys_chflags(td, uap) struct nameidata nd; AUDIT_ARG_FFLAGS(uap->flags); - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -2693,8 +2690,8 @@ sys_lchflags(td, uap) struct nameidata nd; AUDIT_ARG_FFLAGS(uap->flags); - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, + td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -2850,8 +2847,8 @@ kern_fchmodat(struct thread *td, int fd, AUDIT_ARG_MODE(mode); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; - NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, - path, fd, CAP_FCHMOD, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd, + CAP_FCHMOD, td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -2980,8 +2977,8 @@ kern_fchownat(struct thread *td, int fd, AUDIT_ARG_OWNER(uid, gid); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; - NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, - path, fd, CAP_FCHOWN, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd, + CAP_FCHOWN, td); if ((error = namei(&nd)) != 0) return (error); @@ -3186,8 +3183,8 @@ kern_utimesat(struct thread *td, int fd, if ((error = getutimes(tptr, tptrseg, ts)) != 0) return (error); - NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, - path, fd, CAP_FUTIMES, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, fd, + CAP_FUTIMES, td); if ((error = namei(&nd)) != 0) return (error); @@ -3508,8 +3505,8 @@ kern_renameat(struct thread *td, int old NDINIT_ATRIGHTS(&fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | AUDITVNODE1, pathseg, old, oldfd, CAP_DELETE, td); #else - NDINIT_ATRIGHTS(&fromnd, DELETE, WANTPARENT | SAVESTART | - AUDITVNODE1, pathseg, old, oldfd, CAP_DELETE, td); + NDINIT_ATRIGHTS(&fromnd, DELETE, WANTPARENT | SAVESTART | AUDITVNODE1, + pathseg, old, oldfd, CAP_DELETE, td); #endif if ((error = namei(&fromnd)) != 0) @@ -3654,8 +3651,8 @@ kern_mkdirat(struct thread *td, int fd, AUDIT_ARG_MODE(mode); restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | - AUDITVNODE1, segflg, path, fd, CAP_MKDIR, td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, + segflg, path, fd, CAP_MKDIR, td); nd.ni_cnd.cn_flags |= WILLBEDIR; if ((error = namei(&nd)) != 0) return (error); @@ -3738,8 +3735,8 @@ kern_rmdirat(struct thread *td, int fd, restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | - AUDITVNODE1, pathseg, path, fd, CAP_RMDIR, td); + NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1, + pathseg, path, fd, CAP_RMDIR, td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -4121,8 +4118,8 @@ sys_revoke(td, uap) int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, - UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, + uap->path, td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -4228,8 +4225,8 @@ sys_lgetfh(td, uap) error = priv_check(td, PRIV_VFS_GETFH); if (error) return (error); - NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | AUDITVNODE1, - UIO_USERSPACE, uap->fname, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, + uap->fname, td); error = namei(&nd); if (error) return (error); @@ -4264,8 +4261,8 @@ sys_getfh(td, uap) error = priv_check(td, PRIV_VFS_GETFH); if (error) return (error); - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, - UIO_USERSPACE, uap->fname, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, + uap->fname, td); error = namei(&nd); if (error) return (error); From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:21:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 628F2A06; Thu, 31 Jan 2013 22:21:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 540357B1; Thu, 31 Jan 2013 22:21:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMLdtC050689; Thu, 31 Jan 2013 22:21:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMLddw050687; Thu, 31 Jan 2013 22:21:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312221.r0VMLddw050687@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246178 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:21:40 -0000 Author: mav Date: Thu Jan 31 22:21:39 2013 New Revision: 246178 URL: http://svnweb.freebsd.org/changeset/base/246178 Log: MFC r245363: Improve support for disabled disks. If disabled disk disconnected and then reconnected back, leave it as disabled. If new disk inserted instead of disabled, rebuild it and leave as enabled. Modified: stable/9/sys/geom/raid/g_raid.c stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Thu Jan 31 22:20:05 2013 (r246177) +++ stable/9/sys/geom/raid/g_raid.c Thu Jan 31 22:21:39 2013 (r246178) @@ -538,7 +538,7 @@ g_raid_report_disk_state(struct g_raid_d if (disk->d_consumer == NULL) return; if (disk->d_state == G_RAID_DISK_S_DISABLED) { - ; + s = G_STATE_ACTIVE; /* XXX */ } else if (disk->d_state == G_RAID_DISK_S_FAILED || disk->d_state == G_RAID_DISK_S_STALE_FAILED) { s = G_STATE_FAILED; Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:20:05 2013 (r246177) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:21:39 2013 (r246178) @@ -787,13 +787,9 @@ g_raid_md_intel_start_disk(struct g_raid disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); - /* Disabled disk is useless for us. */ - if (pd->pd_disk_meta.flags & INTEL_F_DISABLED) { - g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); - return (0); - } /* Failed stale disk is useless for us. */ - if (pd->pd_disk_meta.flags & INTEL_F_FAILED) { + if ((pd->pd_disk_meta.flags & INTEL_F_FAILED) && + !(pd->pd_disk_meta.flags & INTEL_F_DISABLED)) { g_raid_change_disk_state(disk, G_RAID_DISK_S_STALE_FAILED); return (0); } @@ -884,10 +880,11 @@ nofit: } /* Welcome the new disk. */ - if (resurrection) - g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); - else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) + if ((meta->disk[disk_pos].flags & INTEL_F_DISABLED) && + !(pd->pd_disk_meta.flags & INTEL_F_SPARE)) g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); + else if (resurrection) + g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else if (meta->disk[disk_pos].flags & INTEL_F_SPARE) @@ -910,14 +907,15 @@ nofit: migr_global = 0; } - if (resurrection) { - /* Stale disk, almost same as new. */ - g_raid_change_subdisk_state(sd, - G_RAID_SUBDISK_S_NEW); - } else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) { + if ((meta->disk[disk_pos].flags & INTEL_F_DISABLED) && + !(pd->pd_disk_meta.flags & INTEL_F_SPARE)) { /* Disabled disk, useless. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); + } else if (resurrection) { + /* Stale disk, almost same as new. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NEW); } else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) { /* Failed disk, almost useless. */ g_raid_change_subdisk_state(sd, @@ -1021,7 +1019,8 @@ nofit: /* Update status of our need for spare. */ if (mdi->mdio_started) { mdi->mdio_incomplete = - (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) < + (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED) < meta->total_disks); } @@ -1053,7 +1052,8 @@ g_raid_md_intel_refill(struct g_raid_sof update = 0; do { /* Make sure we miss anything. */ - na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE); + na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED); if (na == meta->total_disks) break; @@ -1065,7 +1065,8 @@ g_raid_md_intel_refill(struct g_raid_sof TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_state == G_RAID_DISK_S_STALE) { update += g_raid_md_intel_start_disk(disk); - if (disk->d_state == G_RAID_DISK_S_ACTIVE) + if (disk->d_state == G_RAID_DISK_S_ACTIVE || + disk->d_state == G_RAID_DISK_S_DISABLED) break; } } @@ -1089,8 +1090,8 @@ g_raid_md_intel_refill(struct g_raid_sof } /* Update status of our need for spare. */ - mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) < - meta->total_disks); + mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED) < meta->total_disks); /* Request retaste hoping to find spare. */ if (mdi->mdio_incomplete) { @@ -2242,7 +2243,8 @@ g_raid_md_write_intel(struct g_raid_md_o pd->pd_disk_meta.flags = INTEL_F_FAILED | INTEL_F_ASSIGNED | INTEL_F_DISABLED; } else { - pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; + if (!(pd->pd_disk_meta.flags & INTEL_F_DISABLED)) + pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; if (pd->pd_disk_meta.id != 0xffffffff) { pd->pd_disk_meta.id = 0xffffffff; len = strlen(pd->pd_disk_meta.serial); From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:22:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 65E6AB77; Thu, 31 Jan 2013 22:22:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 490D57BA; Thu, 31 Jan 2013 22:22:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMMNui050868; Thu, 31 Jan 2013 22:22:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMMM3Q050866; Thu, 31 Jan 2013 22:22:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312222.r0VMMM3Q050866@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246179 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:22:23 -0000 Author: mav Date: Thu Jan 31 22:22:22 2013 New Revision: 246179 URL: http://svnweb.freebsd.org/changeset/base/246179 Log: MFC r245363: Improve support for disabled disks. If disabled disk disconnected and then reconnected back, leave it as disabled. If new disk inserted instead of disabled, rebuild it and leave as enabled. Modified: stable/8/sys/geom/raid/g_raid.c stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/g_raid.c ============================================================================== --- stable/8/sys/geom/raid/g_raid.c Thu Jan 31 22:21:39 2013 (r246178) +++ stable/8/sys/geom/raid/g_raid.c Thu Jan 31 22:22:22 2013 (r246179) @@ -535,7 +535,7 @@ g_raid_report_disk_state(struct g_raid_d if (disk->d_consumer == NULL) return; if (disk->d_state == G_RAID_DISK_S_DISABLED) { - ; + s = G_STATE_ACTIVE; /* XXX */ } else if (disk->d_state == G_RAID_DISK_S_FAILED || disk->d_state == G_RAID_DISK_S_STALE_FAILED) { s = G_STATE_FAILED; Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:21:39 2013 (r246178) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:22:22 2013 (r246179) @@ -787,13 +787,9 @@ g_raid_md_intel_start_disk(struct g_raid disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); - /* Disabled disk is useless for us. */ - if (pd->pd_disk_meta.flags & INTEL_F_DISABLED) { - g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); - return (0); - } /* Failed stale disk is useless for us. */ - if (pd->pd_disk_meta.flags & INTEL_F_FAILED) { + if ((pd->pd_disk_meta.flags & INTEL_F_FAILED) && + !(pd->pd_disk_meta.flags & INTEL_F_DISABLED)) { g_raid_change_disk_state(disk, G_RAID_DISK_S_STALE_FAILED); return (0); } @@ -884,10 +880,11 @@ nofit: } /* Welcome the new disk. */ - if (resurrection) - g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); - else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) + if ((meta->disk[disk_pos].flags & INTEL_F_DISABLED) && + !(pd->pd_disk_meta.flags & INTEL_F_SPARE)) g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); + else if (resurrection) + g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else if (meta->disk[disk_pos].flags & INTEL_F_SPARE) @@ -910,14 +907,15 @@ nofit: migr_global = 0; } - if (resurrection) { - /* Stale disk, almost same as new. */ - g_raid_change_subdisk_state(sd, - G_RAID_SUBDISK_S_NEW); - } else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) { + if ((meta->disk[disk_pos].flags & INTEL_F_DISABLED) && + !(pd->pd_disk_meta.flags & INTEL_F_SPARE)) { /* Disabled disk, useless. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); + } else if (resurrection) { + /* Stale disk, almost same as new. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NEW); } else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) { /* Failed disk, almost useless. */ g_raid_change_subdisk_state(sd, @@ -1021,7 +1019,8 @@ nofit: /* Update status of our need for spare. */ if (mdi->mdio_started) { mdi->mdio_incomplete = - (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) < + (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED) < meta->total_disks); } @@ -1053,7 +1052,8 @@ g_raid_md_intel_refill(struct g_raid_sof update = 0; do { /* Make sure we miss anything. */ - na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE); + na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED); if (na == meta->total_disks) break; @@ -1065,7 +1065,8 @@ g_raid_md_intel_refill(struct g_raid_sof TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_state == G_RAID_DISK_S_STALE) { update += g_raid_md_intel_start_disk(disk); - if (disk->d_state == G_RAID_DISK_S_ACTIVE) + if (disk->d_state == G_RAID_DISK_S_ACTIVE || + disk->d_state == G_RAID_DISK_S_DISABLED) break; } } @@ -1089,8 +1090,8 @@ g_raid_md_intel_refill(struct g_raid_sof } /* Update status of our need for spare. */ - mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) < - meta->total_disks); + mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED) < meta->total_disks); /* Request retaste hoping to find spare. */ if (mdi->mdio_incomplete) { @@ -2242,7 +2243,8 @@ g_raid_md_write_intel(struct g_raid_md_o pd->pd_disk_meta.flags = INTEL_F_FAILED | INTEL_F_ASSIGNED | INTEL_F_DISABLED; } else { - pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; + if (!(pd->pd_disk_meta.flags & INTEL_F_DISABLED)) + pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; if (pd->pd_disk_meta.id != 0xffffffff) { pd->pd_disk_meta.id = 0xffffffff; len = strlen(pd->pd_disk_meta.serial); From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:24:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 76573DC8; Thu, 31 Jan 2013 22:24:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DB217D4; Thu, 31 Jan 2013 22:24:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMO6pH051233; Thu, 31 Jan 2013 22:24:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMO6Yb051232; Thu, 31 Jan 2013 22:24:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312224.r0VMO6Yb051232@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246180 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:24:06 -0000 Author: mav Date: Thu Jan 31 22:24:05 2013 New Revision: 246180 URL: http://svnweb.freebsd.org/changeset/base/246180 Log: MFC r245398: - Add checks for Intel metadata version and attributes. Ignore disks with unsupported metadata types like Intel Smart Response to not corrupt them. - Improve setting of these things during metadata writing to protect from incapable BIOS'es and other implementations. Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:22:22 2013 (r246179) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:24:05 2013 (r246180) @@ -165,6 +165,11 @@ struct intel_raid_conf { #define INTEL_ATTR_RAID1E 0x00000008 #define INTEL_ATTR_RAID5 0x00000010 #define INTEL_ATTR_RAIDCNG 0x00000020 +#define INTEL_ATTR_EXT_STRIP 0x00000040 +#define INTEL_ATTR_NVM_CACHE 0x02000000 +#define INTEL_ATTR_2TB_DISK 0x04000000 +#define INTEL_ATTR_BBM 0x08000000 +#define INTEL_ATTR_NVM_CACHE2 0x10000000 #define INTEL_ATTR_2TB 0x20000000 #define INTEL_ATTR_PM 0x40000000 #define INTEL_ATTR_CHECKSUM 0x80000000 @@ -182,6 +187,11 @@ struct intel_raid_conf { /* Here goes total_volumes of struct intel_raid_vol. */ } __packed; +#define INTEL_ATTR_SUPPORTED ( INTEL_ATTR_RAID0 | INTEL_ATTR_RAID1 | \ + INTEL_ATTR_RAID10 | INTEL_ATTR_RAID1E | INTEL_ATTR_RAID5 | \ + INTEL_ATTR_RAIDCNG | INTEL_ATTR_EXT_STRIP | INTEL_ATTR_2TB_DISK | \ + INTEL_ATTR_2TB | INTEL_ATTR_PM | INTEL_ATTR_CHECKSUM ) + #define INTEL_MAX_MD_SIZE(ndisks) \ (sizeof(struct intel_raid_conf) + \ sizeof(struct intel_raid_disk) * (ndisks - 1) + \ @@ -554,6 +564,21 @@ badsize: g_raid_md_intel_print(meta); + if (strncmp(meta->version, INTEL_VERSION_1300, 6) > 0) { + G_RAID_DEBUG(1, "Intel unsupported version: '%.6s'", + meta->version); + free(meta, M_MD_INTEL); + return (NULL); + } + + if (strncmp(meta->version, INTEL_VERSION_1300, 6) >= 0 && + (meta->attributes & ~INTEL_ATTR_SUPPORTED) != 0) { + G_RAID_DEBUG(1, "Intel unsupported attributes: 0x%08x", + meta->attributes & ~INTEL_ATTR_SUPPORTED); + free(meta, M_MD_INTEL); + return (NULL); + } + /* Validate disk indexes. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -2268,6 +2293,8 @@ g_raid_md_write_intel(struct g_raid_md_o if (pd->pd_disk_pos < 0) continue; meta->disk[pd->pd_disk_pos] = pd->pd_disk_meta; + if (pd->pd_disk_meta.sectors_hi != 0) + meta->attributes |= INTEL_ATTR_2TB_DISK; } /* Fill volumes and maps. */ @@ -2297,12 +2324,16 @@ g_raid_md_write_intel(struct g_raid_md_o meta->attributes |= INTEL_ATTR_RAID1; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID5) meta->attributes |= INTEL_ATTR_RAID5; - else + else if ((vol->v_disks_count & 1) == 0) meta->attributes |= INTEL_ATTR_RAID10; + else + meta->attributes |= INTEL_ATTR_RAID1E; + if (pv->pv_cng) + meta->attributes |= INTEL_ATTR_RAIDCNG; + if (vol->v_strip_size > 131072) + meta->attributes |= INTEL_ATTR_EXT_STRIP; - if (meta->attributes & INTEL_ATTR_2TB) - cv = INTEL_VERSION_1300; - else if (pv->pv_cng) + if (pv->pv_cng) cv = INTEL_VERSION_1206; else if (vol->v_disks_count > 4) cv = INTEL_VERSION_1204; @@ -2310,8 +2341,6 @@ g_raid_md_write_intel(struct g_raid_md_o cv = INTEL_VERSION_1202; else if (vol->v_disks_count > 2) cv = INTEL_VERSION_1201; - else if (vi > 0) - cv = INTEL_VERSION_1200; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1) cv = INTEL_VERSION_1100; else @@ -2321,6 +2350,8 @@ g_raid_md_write_intel(struct g_raid_md_o strlcpy(&mvol->name[0], vol->v_name, sizeof(mvol->name)); mvol->total_sectors = vol->v_mediasize / sectorsize; + mvol->state = (INTEL_ST_READ_COALESCING | + INTEL_ST_WRITE_COALESCING); if (pv->pv_cng) { mvol->state |= INTEL_ST_CLONE_N_GO; if (pv->pv_cng_man_sync) @@ -2437,7 +2468,10 @@ g_raid_md_write_intel(struct g_raid_md_o vi++; } meta->total_volumes = vi; - if (strcmp(version, INTEL_VERSION_1300) != 0) + if (vi > 1 || meta->attributes & + (INTEL_ATTR_EXT_STRIP | INTEL_ATTR_2TB_DISK | INTEL_ATTR_2TB)) + version = INTEL_VERSION_1300; + if (strcmp(version, INTEL_VERSION_1300) < 0) meta->attributes &= INTEL_ATTR_CHECKSUM; memcpy(&meta->version[0], version, sizeof(INTEL_VERSION_1000) - 1); From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:24:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C441C7C; Thu, 31 Jan 2013 22:24:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6C7E7E6; Thu, 31 Jan 2013 22:24:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMOlQo051449; Thu, 31 Jan 2013 22:24:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMOlGi051448; Thu, 31 Jan 2013 22:24:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312224.r0VMOlGi051448@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246181 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:24:47 -0000 Author: mav Date: Thu Jan 31 22:24:46 2013 New Revision: 246181 URL: http://svnweb.freebsd.org/changeset/base/246181 Log: MFC r245398: - Add checks for Intel metadata version and attributes. Ignore disks with unsupported metadata types like Intel Smart Response to not corrupt them. - Improve setting of these things during metadata writing to protect from incapable BIOS'es and other implementations. Modified: stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:24:05 2013 (r246180) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:24:46 2013 (r246181) @@ -165,6 +165,11 @@ struct intel_raid_conf { #define INTEL_ATTR_RAID1E 0x00000008 #define INTEL_ATTR_RAID5 0x00000010 #define INTEL_ATTR_RAIDCNG 0x00000020 +#define INTEL_ATTR_EXT_STRIP 0x00000040 +#define INTEL_ATTR_NVM_CACHE 0x02000000 +#define INTEL_ATTR_2TB_DISK 0x04000000 +#define INTEL_ATTR_BBM 0x08000000 +#define INTEL_ATTR_NVM_CACHE2 0x10000000 #define INTEL_ATTR_2TB 0x20000000 #define INTEL_ATTR_PM 0x40000000 #define INTEL_ATTR_CHECKSUM 0x80000000 @@ -182,6 +187,11 @@ struct intel_raid_conf { /* Here goes total_volumes of struct intel_raid_vol. */ } __packed; +#define INTEL_ATTR_SUPPORTED ( INTEL_ATTR_RAID0 | INTEL_ATTR_RAID1 | \ + INTEL_ATTR_RAID10 | INTEL_ATTR_RAID1E | INTEL_ATTR_RAID5 | \ + INTEL_ATTR_RAIDCNG | INTEL_ATTR_EXT_STRIP | INTEL_ATTR_2TB_DISK | \ + INTEL_ATTR_2TB | INTEL_ATTR_PM | INTEL_ATTR_CHECKSUM ) + #define INTEL_MAX_MD_SIZE(ndisks) \ (sizeof(struct intel_raid_conf) + \ sizeof(struct intel_raid_disk) * (ndisks - 1) + \ @@ -554,6 +564,21 @@ badsize: g_raid_md_intel_print(meta); + if (strncmp(meta->version, INTEL_VERSION_1300, 6) > 0) { + G_RAID_DEBUG(1, "Intel unsupported version: '%.6s'", + meta->version); + free(meta, M_MD_INTEL); + return (NULL); + } + + if (strncmp(meta->version, INTEL_VERSION_1300, 6) >= 0 && + (meta->attributes & ~INTEL_ATTR_SUPPORTED) != 0) { + G_RAID_DEBUG(1, "Intel unsupported attributes: 0x%08x", + meta->attributes & ~INTEL_ATTR_SUPPORTED); + free(meta, M_MD_INTEL); + return (NULL); + } + /* Validate disk indexes. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -2268,6 +2293,8 @@ g_raid_md_write_intel(struct g_raid_md_o if (pd->pd_disk_pos < 0) continue; meta->disk[pd->pd_disk_pos] = pd->pd_disk_meta; + if (pd->pd_disk_meta.sectors_hi != 0) + meta->attributes |= INTEL_ATTR_2TB_DISK; } /* Fill volumes and maps. */ @@ -2297,12 +2324,16 @@ g_raid_md_write_intel(struct g_raid_md_o meta->attributes |= INTEL_ATTR_RAID1; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID5) meta->attributes |= INTEL_ATTR_RAID5; - else + else if ((vol->v_disks_count & 1) == 0) meta->attributes |= INTEL_ATTR_RAID10; + else + meta->attributes |= INTEL_ATTR_RAID1E; + if (pv->pv_cng) + meta->attributes |= INTEL_ATTR_RAIDCNG; + if (vol->v_strip_size > 131072) + meta->attributes |= INTEL_ATTR_EXT_STRIP; - if (meta->attributes & INTEL_ATTR_2TB) - cv = INTEL_VERSION_1300; - else if (pv->pv_cng) + if (pv->pv_cng) cv = INTEL_VERSION_1206; else if (vol->v_disks_count > 4) cv = INTEL_VERSION_1204; @@ -2310,8 +2341,6 @@ g_raid_md_write_intel(struct g_raid_md_o cv = INTEL_VERSION_1202; else if (vol->v_disks_count > 2) cv = INTEL_VERSION_1201; - else if (vi > 0) - cv = INTEL_VERSION_1200; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1) cv = INTEL_VERSION_1100; else @@ -2321,6 +2350,8 @@ g_raid_md_write_intel(struct g_raid_md_o strlcpy(&mvol->name[0], vol->v_name, sizeof(mvol->name)); mvol->total_sectors = vol->v_mediasize / sectorsize; + mvol->state = (INTEL_ST_READ_COALESCING | + INTEL_ST_WRITE_COALESCING); if (pv->pv_cng) { mvol->state |= INTEL_ST_CLONE_N_GO; if (pv->pv_cng_man_sync) @@ -2437,7 +2468,10 @@ g_raid_md_write_intel(struct g_raid_md_o vi++; } meta->total_volumes = vi; - if (strcmp(version, INTEL_VERSION_1300) != 0) + if (vi > 1 || meta->attributes & + (INTEL_ATTR_EXT_STRIP | INTEL_ATTR_2TB_DISK | INTEL_ATTR_2TB)) + version = INTEL_VERSION_1300; + if (strcmp(version, INTEL_VERSION_1300) < 0) meta->attributes &= INTEL_ATTR_CHECKSUM; memcpy(&meta->version[0], version, sizeof(INTEL_VERSION_1000) - 1); From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:26:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 901C8371; Thu, 31 Jan 2013 22:26:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6970E82A; Thu, 31 Jan 2013 22:26:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMQn2V051781; Thu, 31 Jan 2013 22:26:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMQnjm051780; Thu, 31 Jan 2013 22:26:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312226.r0VMQnjm051780@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246182 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:26:49 -0000 Author: mav Date: Thu Jan 31 22:26:48 2013 New Revision: 246182 URL: http://svnweb.freebsd.org/changeset/base/246182 Log: MFC r245400: Windows driver writes relative volume IDs to metadata field. Use that value as a hint for raid/rX device number to make it persistent across reboots. Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:24:46 2013 (r246181) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:26:48 2013 (r246182) @@ -1150,7 +1150,7 @@ g_raid_md_intel_start(struct g_raid_soft for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); mmap = intel_get_map(mvol, 0); - vol = g_raid_create_volume(sc, mvol->name, -1); + vol = g_raid_create_volume(sc, mvol->name, mvol->tid - 1); pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); pv->pv_volume_pos = i; pv->pv_cng = (mvol->state & INTEL_ST_CLONE_N_GO) != 0; @@ -2352,6 +2352,7 @@ g_raid_md_write_intel(struct g_raid_md_o mvol->total_sectors = vol->v_mediasize / sectorsize; mvol->state = (INTEL_ST_READ_COALESCING | INTEL_ST_WRITE_COALESCING); + mvol->tid = vol->v_global_id + 1; if (pv->pv_cng) { mvol->state |= INTEL_ST_CLONE_N_GO; if (pv->pv_cng_man_sync) From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:27:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D496F4E2; Thu, 31 Jan 2013 22:27:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C6836835; Thu, 31 Jan 2013 22:27:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMRVa8051921; Thu, 31 Jan 2013 22:27:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMRVc0051920; Thu, 31 Jan 2013 22:27:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312227.r0VMRVc0051920@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246183 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:27:31 -0000 Author: mav Date: Thu Jan 31 22:27:31 2013 New Revision: 246183 URL: http://svnweb.freebsd.org/changeset/base/246183 Log: MFC r245400: Windows driver writes relative volume IDs to metadata field. Use that value as a hint for raid/rX device number to make it persistent across reboots. Modified: stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:26:48 2013 (r246182) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:27:31 2013 (r246183) @@ -1150,7 +1150,7 @@ g_raid_md_intel_start(struct g_raid_soft for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); mmap = intel_get_map(mvol, 0); - vol = g_raid_create_volume(sc, mvol->name, -1); + vol = g_raid_create_volume(sc, mvol->name, mvol->tid - 1); pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); pv->pv_volume_pos = i; pv->pv_cng = (mvol->state & INTEL_ST_CLONE_N_GO) != 0; @@ -2352,6 +2352,7 @@ g_raid_md_write_intel(struct g_raid_md_o mvol->total_sectors = vol->v_mediasize / sectorsize; mvol->state = (INTEL_ST_READ_COALESCING | INTEL_ST_WRITE_COALESCING); + mvol->tid = vol->v_global_id + 1; if (pv->pv_cng) { mvol->state |= INTEL_ST_CLONE_N_GO; if (pv->pv_cng_man_sync) From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:30:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 30758725; Thu, 31 Jan 2013 22:30:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 147E3862; Thu, 31 Jan 2013 22:30:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMUNsO052537; Thu, 31 Jan 2013 22:30:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMUNYK052528; Thu, 31 Jan 2013 22:30:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312230.r0VMUNYK052528@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246184 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:30:24 -0000 Author: mav Date: Thu Jan 31 22:30:23 2013 New Revision: 246184 URL: http://svnweb.freebsd.org/changeset/base/246184 Log: MFC r245423, r245425, r245433: - Print some more metadata fields. - Small cosmetic tuning of the IRRT status constants. - Keep value of orig_config_id metadata field. Windows driver writes there previous value of config_id when it is changed in some cases. I guess it may be used do avoid some split-brain conditions. Modified: stable/9/sys/geom/raid/md_intel.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:27:31 2013 (r246183) +++ stable/9/sys/geom/raid/md_intel.c Thu Jan 31 22:30:23 2013 (r246184) @@ -98,8 +98,9 @@ struct intel_raid_vol { uint8_t cng_master_disk; uint16_t cache_policy; uint8_t cng_state; -#define INTEL_SNGST_NEEDS_UPDATE 1 -#define INTEL_SNGST_MASTER_MISSING 2 +#define INTEL_CNGST_UPDATED 0 +#define INTEL_CNGST_NEEDS_UPDATE 1 +#define INTEL_CNGST_MASTER_MISSING 2 uint8_t cng_sub_state; uint32_t filler_0[10]; @@ -179,7 +180,7 @@ struct intel_raid_conf { uint8_t error_log_pos; uint8_t dummy_2[1]; uint32_t cache_size; - uint32_t orig_family_num; + uint32_t orig_config_id; uint32_t pwr_cycle_count; uint32_t bbm_log_size; uint32_t filler_0[35]; @@ -215,6 +216,7 @@ struct g_raid_md_intel_pervolume { struct g_raid_md_intel_object { struct g_raid_md_object mdio_base; uint32_t mdio_config_id; + uint32_t mdio_orig_config_id; uint32_t mdio_generation; struct intel_raid_conf *mdio_meta; struct callout mdio_start_co; /* STARTING state timer. */ @@ -385,14 +387,17 @@ g_raid_md_intel_print(struct intel_raid_ printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); - printf("orig_family_num 0x%08x\n", meta->orig_family_num); + printf("error_log_pos %u\n", meta->error_log_pos); + printf("cache_size %u\n", meta->cache_size); + printf("orig_config_id 0x%08x\n", meta->orig_config_id); + printf("pwr_cycle_count %u\n", meta->pwr_cycle_count); printf("bbm_log_size %u\n", meta->bbm_log_size); - printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); + printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags owner\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%08x %08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, - meta->disk[i].sectors_hi, - meta->disk[i].id, meta->disk[i].flags); + meta->disk[i].sectors_hi, meta->disk[i].id, + meta->disk[i].flags, meta->disk[i].owner_cfg_num); } for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -414,6 +419,9 @@ g_raid_md_intel_print(struct intel_raid_ printf(" migr_state %u\n", mvol->migr_state); printf(" migr_type %u\n", mvol->migr_type); printf(" dirty %u\n", mvol->dirty); + printf(" fs_state %u\n", mvol->fs_state); + printf(" verify_errors %u\n", mvol->verify_errors); + printf(" bad_blocks %u\n", mvol->bad_blocks); for (j = 0; j < (mvol->migr_state ? 2 : 1); j++) { printf(" *** Map %d ***\n", j); @@ -710,7 +718,7 @@ intel_meta_write_spare(struct g_consumer memcpy(&meta->version[0], INTEL_VERSION_1000, sizeof(INTEL_VERSION_1000) - 1); meta->config_size = INTEL_MAX_MD_SIZE(1); - meta->config_id = arc4random(); + meta->config_id = meta->orig_config_id = arc4random(); meta->generation = 1; meta->total_disks = 1; meta->disk[0] = *d; @@ -1311,7 +1319,7 @@ g_raid_md_create_intel(struct g_raid_md_ char name[16]; mdi = (struct g_raid_md_intel_object *)md; - mdi->mdio_config_id = arc4random(); + mdi->mdio_config_id = mdi->mdio_orig_config_id = arc4random(); mdi->mdio_generation = 0; snprintf(name, sizeof(name), "Intel-%08x", mdi->mdio_config_id); sc = g_raid_create_node(mp, name, md); @@ -1456,6 +1464,7 @@ search: } else { /* Not found matching node -- create one. */ result = G_RAID_MD_TASTE_NEW; mdi->mdio_config_id = meta->config_id; + mdi->mdio_orig_config_id = meta->orig_config_id; snprintf(name, sizeof(name), "Intel-%08x", meta->config_id); sc = g_raid_create_node(mp, name, md); md->mdo_softc = sc; @@ -2285,6 +2294,7 @@ g_raid_md_write_intel(struct g_raid_md_o memcpy(&meta->intel_id[0], INTEL_MAGIC, sizeof(INTEL_MAGIC) - 1); meta->config_size = INTEL_MAX_MD_SIZE(numdisks); meta->config_id = mdi->mdio_config_id; + meta->orig_config_id = mdi->mdio_orig_config_id; meta->generation = mdi->mdio_generation; meta->attributes = INTEL_ATTR_CHECKSUM; meta->total_disks = numdisks; @@ -2360,9 +2370,11 @@ g_raid_md_write_intel(struct g_raid_md_o mvol->cng_master_disk = pv->pv_cng_master_disk; if (vol->v_subdisks[pv->pv_cng_master_disk].sd_state == G_RAID_SUBDISK_S_NONE) - mvol->cng_state = INTEL_SNGST_MASTER_MISSING; + mvol->cng_state = INTEL_CNGST_MASTER_MISSING; else if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) - mvol->cng_state = INTEL_SNGST_NEEDS_UPDATE; + mvol->cng_state = INTEL_CNGST_NEEDS_UPDATE; + else + mvol->cng_state = INTEL_CNGST_UPDATED; } /* Check for any recovery in progress. */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 22:31:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9B0D895; Thu, 31 Jan 2013 22:31:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9CA0286E; Thu, 31 Jan 2013 22:31:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMVP9V054126; Thu, 31 Jan 2013 22:31:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMVPne054124; Thu, 31 Jan 2013 22:31:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312231.r0VMVPne054124@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246185 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 22:31:25 -0000 Author: mav Date: Thu Jan 31 22:31:25 2013 New Revision: 246185 URL: http://svnweb.freebsd.org/changeset/base/246185 Log: MFC r245423, r245425, r245433: - Print some more metadata fields. - Small cosmetic tuning of the IRRT status constants. - Keep value of orig_config_id metadata field. Windows driver writes there previous value of config_id when it is changed in some cases. I guess it may be used do avoid some split-brain conditions. Modified: stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:30:23 2013 (r246184) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:31:25 2013 (r246185) @@ -98,8 +98,9 @@ struct intel_raid_vol { uint8_t cng_master_disk; uint16_t cache_policy; uint8_t cng_state; -#define INTEL_SNGST_NEEDS_UPDATE 1 -#define INTEL_SNGST_MASTER_MISSING 2 +#define INTEL_CNGST_UPDATED 0 +#define INTEL_CNGST_NEEDS_UPDATE 1 +#define INTEL_CNGST_MASTER_MISSING 2 uint8_t cng_sub_state; uint32_t filler_0[10]; @@ -179,7 +180,7 @@ struct intel_raid_conf { uint8_t error_log_pos; uint8_t dummy_2[1]; uint32_t cache_size; - uint32_t orig_family_num; + uint32_t orig_config_id; uint32_t pwr_cycle_count; uint32_t bbm_log_size; uint32_t filler_0[35]; @@ -215,6 +216,7 @@ struct g_raid_md_intel_pervolume { struct g_raid_md_intel_object { struct g_raid_md_object mdio_base; uint32_t mdio_config_id; + uint32_t mdio_orig_config_id; uint32_t mdio_generation; struct intel_raid_conf *mdio_meta; struct callout mdio_start_co; /* STARTING state timer. */ @@ -385,14 +387,17 @@ g_raid_md_intel_print(struct intel_raid_ printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); - printf("orig_family_num 0x%08x\n", meta->orig_family_num); + printf("error_log_pos %u\n", meta->error_log_pos); + printf("cache_size %u\n", meta->cache_size); + printf("orig_config_id 0x%08x\n", meta->orig_config_id); + printf("pwr_cycle_count %u\n", meta->pwr_cycle_count); printf("bbm_log_size %u\n", meta->bbm_log_size); - printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); + printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags owner\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%08x %08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, - meta->disk[i].sectors_hi, - meta->disk[i].id, meta->disk[i].flags); + meta->disk[i].sectors_hi, meta->disk[i].id, + meta->disk[i].flags, meta->disk[i].owner_cfg_num); } for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -414,6 +419,9 @@ g_raid_md_intel_print(struct intel_raid_ printf(" migr_state %u\n", mvol->migr_state); printf(" migr_type %u\n", mvol->migr_type); printf(" dirty %u\n", mvol->dirty); + printf(" fs_state %u\n", mvol->fs_state); + printf(" verify_errors %u\n", mvol->verify_errors); + printf(" bad_blocks %u\n", mvol->bad_blocks); for (j = 0; j < (mvol->migr_state ? 2 : 1); j++) { printf(" *** Map %d ***\n", j); @@ -710,7 +718,7 @@ intel_meta_write_spare(struct g_consumer memcpy(&meta->version[0], INTEL_VERSION_1000, sizeof(INTEL_VERSION_1000) - 1); meta->config_size = INTEL_MAX_MD_SIZE(1); - meta->config_id = arc4random(); + meta->config_id = meta->orig_config_id = arc4random(); meta->generation = 1; meta->total_disks = 1; meta->disk[0] = *d; @@ -1311,7 +1319,7 @@ g_raid_md_create_intel(struct g_raid_md_ char name[16]; mdi = (struct g_raid_md_intel_object *)md; - mdi->mdio_config_id = arc4random(); + mdi->mdio_config_id = mdi->mdio_orig_config_id = arc4random(); mdi->mdio_generation = 0; snprintf(name, sizeof(name), "Intel-%08x", mdi->mdio_config_id); sc = g_raid_create_node(mp, name, md); @@ -1456,6 +1464,7 @@ search: } else { /* Not found matching node -- create one. */ result = G_RAID_MD_TASTE_NEW; mdi->mdio_config_id = meta->config_id; + mdi->mdio_orig_config_id = meta->orig_config_id; snprintf(name, sizeof(name), "Intel-%08x", meta->config_id); sc = g_raid_create_node(mp, name, md); md->mdo_softc = sc; @@ -2285,6 +2294,7 @@ g_raid_md_write_intel(struct g_raid_md_o memcpy(&meta->intel_id[0], INTEL_MAGIC, sizeof(INTEL_MAGIC) - 1); meta->config_size = INTEL_MAX_MD_SIZE(numdisks); meta->config_id = mdi->mdio_config_id; + meta->orig_config_id = mdi->mdio_orig_config_id; meta->generation = mdi->mdio_generation; meta->attributes = INTEL_ATTR_CHECKSUM; meta->total_disks = numdisks; @@ -2360,9 +2370,11 @@ g_raid_md_write_intel(struct g_raid_md_o mvol->cng_master_disk = pv->pv_cng_master_disk; if (vol->v_subdisks[pv->pv_cng_master_disk].sd_state == G_RAID_SUBDISK_S_NONE) - mvol->cng_state = INTEL_SNGST_MASTER_MISSING; + mvol->cng_state = INTEL_CNGST_MASTER_MISSING; else if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) - mvol->cng_state = INTEL_SNGST_NEEDS_UPDATE; + mvol->cng_state = INTEL_CNGST_NEEDS_UPDATE; + else + mvol->cng_state = INTEL_CNGST_UPDATED; } /* Check for any recovery in progress. */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 00:32:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B106BD0; Fri, 1 Feb 2013 00:32:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 039D6DBB; Fri, 1 Feb 2013 00:32:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r110W1xR090382; Fri, 1 Feb 2013 00:32:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r110W1ZY090381; Fri, 1 Feb 2013 00:32:01 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302010032.r110W1ZY090381@svn.freebsd.org> From: Xin LI Date: Fri, 1 Feb 2013 00:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246187 - stable/9/sys/fs/nfsserver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 00:32:02 -0000 Author: delphij Date: Fri Feb 1 00:32:01 2013 New Revision: 246187 URL: http://svnweb.freebsd.org/changeset/base/246187 Log: MFC r245613: Make it possible to force async at server side on new NFS server, similar to the old one's nfs.nfsrv.async. Please note that by enabling this option (default is disabled), the system could potentionally have silent data corruption if the server crashes before write is committed to non-volatile storage, as the client side have no way to tell if the data is already written. Submitted by: rmacklem Modified: stable/9/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdserv.c Thu Jan 31 22:43:38 2013 (r246186) +++ stable/9/sys/fs/nfsserver/nfs_nfsdserv.c Fri Feb 1 00:32:01 2013 (r246187) @@ -55,6 +55,11 @@ extern int nfs_rootfhset; extern int nfsrv_enable_crossmntpt; #endif /* !APPLEKEXT */ +static int nfs_async = 0; +SYSCTL_DECL(_vfs_nfsd); +SYSCTL_INT(_vfs_nfsd, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, + "Tell client that writes were synced even though they were not"); + /* * This list defines the GSS mechanisms supported. * (Don't ask me how you get these strings from the RFC stuff like @@ -912,7 +917,13 @@ nfsrvd_write(struct nfsrv_descript *nd, goto out; NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(retlen); - if (stable == NFSWRITE_UNSTABLE) + /* + * If nfs_async is set, then pretend the write was FILESYNC. + * Warning: Doing this violates RFC1813 and runs a risk + * of data written by a client being lost when the server + * crashes/reboots. + */ + if (stable == NFSWRITE_UNSTABLE && nfs_async == 0) *tl++ = txdr_unsigned(stable); else *tl++ = txdr_unsigned(NFSWRITE_FILESYNC); From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 01:16:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BB907839; Fri, 1 Feb 2013 01:16:27 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7F2F7FB2; Fri, 1 Feb 2013 01:16:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r111GRHU003352; Fri, 1 Feb 2013 01:16:27 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r111GRAG003350; Fri, 1 Feb 2013 01:16:27 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201302010116.r111GRAG003350@svn.freebsd.org> From: Neel Natu Date: Fri, 1 Feb 2013 01:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246188 - in head/sys/amd64/vmm: . io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 01:16:27 -0000 Author: neel Date: Fri Feb 1 01:16:26 2013 New Revision: 246188 URL: http://svnweb.freebsd.org/changeset/base/246188 Log: Increase the number of passthru devices supported by bhyve. The maximum length of an environment variable puts a limitation on the number of passthru devices that can be specified via a single variable. The workaround is to allow user to specify passthru devices via multiple environment variables instead of a single one. Obtained from: NetApp Modified: head/sys/amd64/vmm/io/ppt.c head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Fri Feb 1 00:32:01 2013 (r246187) +++ head/sys/amd64/vmm/io/ppt.c Fri Feb 1 01:16:26 2013 (r246188) @@ -89,7 +89,7 @@ static struct pptdev { void **cookie; struct pptintr_arg *arg; } msix; -} pptdevs[32]; +} pptdevs[64]; static int num_pptdevs; Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Fri Feb 1 00:32:01 2013 (r246187) +++ head/sys/amd64/vmm/vmm.c Fri Feb 1 01:16:26 2013 (r246188) @@ -862,30 +862,42 @@ vm_lapic(struct vm *vm, int cpu) boolean_t vmm_is_pptdev(int bus, int slot, int func) { - int found, b, s, f, n; + int found, i, n; + int b, s, f; char *val, *cp, *cp2; /* - * setenv pptdevs "1/2/3 4/5/6 7/8/9 10/11/12" + * XXX + * The length of an environment variable is limited to 128 bytes which + * puts an upper limit on the number of passthru devices that may be + * specified using a single environment variable. + * + * Work around this by scanning multiple environment variable + * names instead of a single one - yuck! */ + const char *names[] = { "pptdevs", "pptdevs2", "pptdevs3", NULL }; + + /* set pptdevs="1/2/3 4/5/6 7/8/9 10/11/12" */ found = 0; - cp = val = getenv("pptdevs"); - while (cp != NULL && *cp != '\0') { - if ((cp2 = strchr(cp, ' ')) != NULL) - *cp2 = '\0'; - - n = sscanf(cp, "%d/%d/%d", &b, &s, &f); - if (n == 3 && bus == b && slot == s && func == f) { - found = 1; - break; - } + for (i = 0; names[i] != NULL && !found; i++) { + cp = val = getenv(names[i]); + while (cp != NULL && *cp != '\0') { + if ((cp2 = strchr(cp, ' ')) != NULL) + *cp2 = '\0'; + + n = sscanf(cp, "%d/%d/%d", &b, &s, &f); + if (n == 3 && bus == b && slot == s && func == f) { + found = 1; + break; + } - if (cp2 != NULL) - *cp2++ = ' '; + if (cp2 != NULL) + *cp2++ = ' '; - cp = cp2; + cp = cp2; + } + freeenv(val); } - freeenv(val); return (found); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 02:41:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1D5FA983; Fri, 1 Feb 2013 02:41:49 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 00C212F6; Fri, 1 Feb 2013 02:41:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r112fmp2029750; Fri, 1 Feb 2013 02:41:48 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r112fm2S029746; Fri, 1 Feb 2013 02:41:48 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201302010241.r112fm2S029746@svn.freebsd.org> From: Neel Natu Date: Fri, 1 Feb 2013 02:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246190 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 02:41:49 -0000 Author: neel Date: Fri Feb 1 02:41:47 2013 New Revision: 246190 URL: http://svnweb.freebsd.org/changeset/base/246190 Log: Fix a bug in the passthru implementation where it would assume that all devices are MSI-X capable. This in turn would lead it to treat bar 0 as the MSI-X table bar even if the underlying device did not support MSI-X. Fix this by providing an API to query the MSI-X table index of the emulated device. If the underlying device does not support MSI-X then this API will return -1. Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_passthru.c head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri Feb 1 01:34:59 2013 (r246189) +++ head/usr.sbin/bhyve/pci_emul.c Fri Feb 1 02:41:47 2013 (r246190) @@ -254,6 +254,26 @@ pci_emul_msix_tread(struct pci_devinst * return (retval); } +int +pci_msix_table_bar(struct pci_devinst *pi) +{ + + if (pi->pi_msix.table != NULL) + return (pi->pi_msix.table_bar); + else + return (-1); +} + +int +pci_msix_pba_bar(struct pci_devinst *pi) +{ + + if (pi->pi_msix.table != NULL) + return (pi->pi_msix.pba_bar); + else + return (-1); +} + static int pci_emul_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Fri Feb 1 01:34:59 2013 (r246189) +++ head/usr.sbin/bhyve/pci_emul.h Fri Feb 1 02:41:47 2013 (r246190) @@ -169,6 +169,8 @@ void pci_lintr_deassert(struct pci_devin int pci_lintr_request(struct pci_devinst *pi, int ivec); int pci_msi_enabled(struct pci_devinst *pi); int pci_msix_enabled(struct pci_devinst *pi); +int pci_msix_table_bar(struct pci_devinst *pi); +int pci_msix_pba_bar(struct pci_devinst *pi); int pci_msi_msgnum(struct pci_devinst *pi); void pci_parse_slot(char *opt, int legacy); void pci_populate_msicap(struct msicap *cap, int msgs, int nextptr); Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Fri Feb 1 01:34:59 2013 (r246189) +++ head/usr.sbin/bhyve/pci_passthru.c Fri Feb 1 02:41:47 2013 (r246190) @@ -361,6 +361,8 @@ init_msix_table(struct vmctx *ctx, struc size_t len; struct pci_devinst *pi = sc->psc_pi; + assert(pci_msix_table_bar(pi) >= 0 && pci_msix_pba_bar(pi) >= 0); + /* * If the MSI-X table BAR maps memory intended for * other uses, it is at least assured that the table @@ -370,7 +372,9 @@ init_msix_table(struct vmctx *ctx, struc if (pi->pi_msix.pba_bar == pi->pi_msix.table_bar && ((pi->pi_msix.pba_offset - pi->pi_msix.table_offset) < 4096)) { /* Need to also emulate the PBA, not supported yet */ - printf("Unsupported MSI-X table and PBA in same page\n"); + printf("Unsupported MSI-X configuration: %d/%d/%d\n", + sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, + sc->psc_sel.pc_func); return (-1); } @@ -447,7 +451,7 @@ cfginitbar(struct vmctx *ctx, struct pas return (-1); /* The MSI-X table needs special handling */ - if (i == pi->pi_msix.table_bar) { + if (i == pci_msix_table_bar(pi)) { error = init_msix_table(ctx, sc, base); if (error) return (-1); @@ -688,7 +692,7 @@ passthru_write(struct vmctx *ctx, int vc sc = pi->pi_arg; - if (pi->pi_msix.table_bar == baridx) { + if (baridx == pci_msix_table_bar(pi)) { msix_table_write(ctx, vcpu, sc, offset, size, value); } else { assert(pi->pi_bar[baridx].type == PCIBAR_IO); @@ -712,7 +716,7 @@ passthru_read(struct vmctx *ctx, int vcp sc = pi->pi_arg; - if (pi->pi_msix.table_bar == baridx) { + if (baridx == pci_msix_table_bar(pi)) { val = msix_table_read(sc, offset, size); } else { assert(pi->pi_bar[baridx].type == PCIBAR_IO); Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Fri Feb 1 01:34:59 2013 (r246189) +++ head/usr.sbin/bhyve/pci_virtio_net.c Fri Feb 1 02:41:47 2013 (r246190) @@ -685,8 +685,8 @@ pci_vtnet_write(struct vmctx *ctx, int v void *ptr; if (use_msix) { - if (baridx == pi->pi_msix.table_bar || - baridx == pi->pi_msix.pba_bar) { + if (baridx == pci_msix_table_bar(pi) || + baridx == pci_msix_pba_bar(pi)) { pci_emul_msix_twrite(pi, offset, size, value); return; } @@ -781,8 +781,8 @@ pci_vtnet_read(struct vmctx *ctx, int vc uint64_t value; if (use_msix) { - if (baridx == pi->pi_msix.table_bar || - baridx == pi->pi_msix.pba_bar) { + if (baridx == pci_msix_table_bar(pi) || + baridx == pci_msix_pba_bar(pi)) { return (pci_emul_msix_tread(pi, offset, size)); } } From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 03:49:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E782B179; Fri, 1 Feb 2013 03:49:10 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D51E37C7; Fri, 1 Feb 2013 03:49:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r113nA7U049266; Fri, 1 Feb 2013 03:49:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r113nAFE049263; Fri, 1 Feb 2013 03:49:10 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201302010349.r113nAFE049263@svn.freebsd.org> From: Neel Natu Date: Fri, 1 Feb 2013 03:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246191 - in head: sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 03:49:11 -0000 Author: neel Date: Fri Feb 1 03:49:09 2013 New Revision: 246191 URL: http://svnweb.freebsd.org/changeset/base/246191 Log: Fix a broken assumption in the passthru implementation that the MSI-X table can only be located at the beginning or the end of the BAR. If the MSI-table is located in the middle of a BAR then we will split the BAR into two and create two mappings - one before the table and one after the table - leaving a hole in place of the table so accesses to it can be trapped and emulated. Obtained from: NetApp Modified: head/sys/amd64/vmm/io/ppt.c head/usr.sbin/bhyve/pci_passthru.c Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Fri Feb 1 02:41:47 2013 (r246190) +++ head/sys/amd64/vmm/io/ppt.c Fri Feb 1 03:49:09 2013 (r246191) @@ -56,9 +56,18 @@ __FBSDID("$FreeBSD$"); /* XXX locking */ #define MAX_PPTDEVS (sizeof(pptdevs) / sizeof(pptdevs[0])) -#define MAX_MMIOSEGS (PCIR_MAX_BAR_0 + 1) #define MAX_MSIMSGS 32 +/* + * If the MSI-X table is located in the middle of a BAR then that MMIO + * region gets split into two segments - one segment above the MSI-X table + * and the other segment below the MSI-X table - with a hole in place of + * the MSI-X table so accesses to it can be trapped and emulated. + * + * So, allocate a MMIO segment for each BAR register + 1 additional segment. + */ +#define MAX_MMIOSEGS ((PCIR_MAX_BAR_0 + 1) + 1) + MALLOC_DEFINE(M_PPTMSIX, "pptmsix", "Passthru MSI-X resources"); struct pptintr_arg { /* pptintr(pptintr_arg) */ Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Fri Feb 1 02:41:47 2013 (r246190) +++ head/usr.sbin/bhyve/pci_passthru.c Fri Feb 1 03:49:09 2013 (r246191) @@ -355,14 +355,18 @@ msix_table_write(struct vmctx *ctx, int static int init_msix_table(struct vmctx *ctx, struct passthru_softc *sc, uint64_t base) { - int idx; - size_t table_size; + int b, s, f; + int error, idx; + size_t len, remaining, table_size; vm_paddr_t start; - size_t len; struct pci_devinst *pi = sc->psc_pi; assert(pci_msix_table_bar(pi) >= 0 && pci_msix_pba_bar(pi) >= 0); + b = sc->psc_sel.pc_bus; + s = sc->psc_sel.pc_dev; + f = sc->psc_sel.pc_func; + /* * If the MSI-X table BAR maps memory intended for * other uses, it is at least assured that the table @@ -372,34 +376,44 @@ init_msix_table(struct vmctx *ctx, struc if (pi->pi_msix.pba_bar == pi->pi_msix.table_bar && ((pi->pi_msix.pba_offset - pi->pi_msix.table_offset) < 4096)) { /* Need to also emulate the PBA, not supported yet */ - printf("Unsupported MSI-X configuration: %d/%d/%d\n", - sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, - sc->psc_sel.pc_func); + printf("Unsupported MSI-X configuration: %d/%d/%d\n", b, s, f); return (-1); } - /* - * May need to split the BAR into 3 regions: - * Before the MSI-X table, the MSI-X table, and after it - * XXX for now, assume that the table is not in the middle - */ + /* Compute the MSI-X table size */ table_size = pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE; + table_size = roundup2(table_size, 4096); + idx = pi->pi_msix.table_bar; + start = pi->pi_bar[idx].addr; + remaining = pi->pi_bar[idx].size; - /* Round up to page size */ - table_size = roundup2(table_size, 4096); - if (pi->pi_msix.table_offset == 0) { - /* Map everything after the MSI-X table */ - start = pi->pi_bar[idx].addr + table_size; - len = pi->pi_bar[idx].size - table_size; - } else { - /* Map everything before the MSI-X table */ - start = pi->pi_bar[idx].addr; + /* Map everything before the MSI-X table */ + if (pi->pi_msix.table_offset > 0) { len = pi->pi_msix.table_offset; + error = vm_map_pptdev_mmio(ctx, b, s, f, start, len, base); + if (error) + return (error); + + base += len; + start += len; + remaining -= len; + } + + /* Skip the MSI-X table */ + base += table_size; + start += table_size; + remaining -= table_size; + + /* Map everything beyond the end of the MSI-X table */ + if (remaining > 0) { + len = remaining; + error = vm_map_pptdev_mmio(ctx, b, s, f, start, len, base); + if (error) + return (error); } - return (vm_map_pptdev_mmio(ctx, sc->psc_sel.pc_bus, - sc->psc_sel.pc_dev, sc->psc_sel.pc_func, - start, len, base + table_size)); + + return (0); } static int From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 05:19:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CD99FCF1; Fri, 1 Feb 2013 05:19:50 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B5E85A80; Fri, 1 Feb 2013 05:19:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r115Jo73076263; Fri, 1 Feb 2013 05:19:50 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r115Jorx076262; Fri, 1 Feb 2013 05:19:50 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <201302010519.r115Jorx076262@svn.freebsd.org> From: Daniel Eischen Date: Fri, 1 Feb 2013 05:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246192 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 05:19:50 -0000 Author: deischen Date: Fri Feb 1 05:19:49 2013 New Revision: 246192 URL: http://svnweb.freebsd.org/changeset/base/246192 Log: Prevent a null pointer dereference in pw userdel when deleting a user whose group != username. Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Fri Feb 1 03:49:09 2013 (r246191) +++ head/usr.sbin/pw/pw_user.c Fri Feb 1 05:19:49 2013 (r246192) @@ -425,7 +425,7 @@ pw_user(struct userconf * cnf, int mode, } grp = GETGRNAM(a_name->val); - if (*grp->gr_mem == NULL) + if (grp != NULL && *grp->gr_mem == NULL) delgrent(GETGRNAM(a_name->val)); SETGRENT(); while ((grp = GETGRENT()) != NULL) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 06:40:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D67D74EA; Fri, 1 Feb 2013 06:40:54 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 258E0DD7; Fri, 1 Feb 2013 06:40:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r116erkM001402; Fri, 1 Feb 2013 06:40:53 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r116erN1001401; Fri, 1 Feb 2013 06:40:53 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201302010640.r116erN1001401@svn.freebsd.org> From: Neel Natu Date: Fri, 1 Feb 2013 06:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246193 - in head/sys: dev/blackhole modules modules/blackhole X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 06:40:54 -0000 Author: neel Date: Fri Feb 1 06:40:53 2013 New Revision: 246193 URL: http://svnweb.freebsd.org/changeset/base/246193 Log: Delete the "blackhole" driver - it is not needed anymore. The "blackhole" driver was used in conjunction with bhyve to sequester pci devices intended for passthru until vmm.ko was loaded. This was useful at one point because vmm.ko could not be loaded at boot time. The same functionality can now be achieved by loading vmm.ko via the loader along with the kernel. Discussed with: grehan Obtained from: NetApp Deleted: head/sys/dev/blackhole/ head/sys/modules/blackhole/ Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Feb 1 05:19:49 2013 (r246192) +++ head/sys/modules/Makefile Fri Feb 1 06:40:53 2013 (r246193) @@ -48,7 +48,6 @@ SUBDIR= \ ${_bxe} \ ${_bios} \ ${_bktr} \ - ${_blackhole} \ ${_bm} \ bridgestp \ bwi \ @@ -626,7 +625,6 @@ _amdtemp= amdtemp _arcmsr= arcmsr _asmc= asmc _bktr= bktr -_blackhole= blackhole _bxe= bxe _cardbus= cardbus _cbb= cbb From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 07:05:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B21791C; Fri, 1 Feb 2013 07:05:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CBC4EAD; Fri, 1 Feb 2013 07:05:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1175i3v008072; Fri, 1 Feb 2013 07:05:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1175hvB008065; Fri, 1 Feb 2013 07:05:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302010705.r1175hvB008065@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 1 Feb 2013 07:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246194 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:05:44 -0000 Author: hselasky Date: Fri Feb 1 07:05:43 2013 New Revision: 246194 URL: http://svnweb.freebsd.org/changeset/base/246194 Log: Make use of USB ID sections configurable. Modified: head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_lookup.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Fri Feb 1 06:40:53 2013 (r246193) +++ head/sys/dev/usb/usb_freebsd.h Fri Feb 1 07:05:43 2013 (r246194) @@ -43,6 +43,7 @@ #define USB_HAVE_MSCTEST 1 #define USB_HAVE_PF 1 #define USB_HAVE_ROOT_MOUNT_HOLD 1 +#define USB_HAVE_ID_SECTION 1 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Fri Feb 1 06:40:53 2013 (r246193) +++ head/sys/dev/usb/usb_freebsd_loader.h Fri Feb 1 07:05:43 2013 (r246194) @@ -43,6 +43,7 @@ #define USB_HAVE_MSCTEST 0 #define USB_HAVE_PF 0 #define USB_HAVE_ROOT_MOUNT_HOLD 0 +#define USB_HAVE_ID_SECTION 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid Modified: head/sys/dev/usb/usb_lookup.c ============================================================================== --- head/sys/dev/usb/usb_lookup.c Fri Feb 1 06:40:53 2013 (r246193) +++ head/sys/dev/usb/usb_lookup.c Fri Feb 1 07:05:43 2013 (r246194) @@ -178,7 +178,7 @@ usbd_lookup_id_by_uaa(const struct usb_d #define MFL_SIZE "0" #endif -#ifdef KLD_MODULE +#if defined(KLD_MODULE) && (USB_HAVE_ID_SECTION != 0) static const char __section("bus_autoconf_format") __used usb_id_format[] = { /* Declare that three different sections use the same format */ Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Fri Feb 1 06:40:53 2013 (r246193) +++ head/sys/dev/usb/usbdi.h Fri Feb 1 07:05:43 2013 (r246194) @@ -241,12 +241,21 @@ struct usb_config { * have your driver module automatically loaded in host, device or * both modes respectivly: */ +#if USB_HAVE_ID_SECTION #define STRUCT_USB_HOST_ID \ struct usb_device_id __section("usb_host_id") #define STRUCT_USB_DEVICE_ID \ struct usb_device_id __section("usb_device_id") #define STRUCT_USB_DUAL_ID \ struct usb_device_id __section("usb_dual_id") +#else +#define STRUCT_USB_HOST_ID \ + struct usb_device_id +#define STRUCT_USB_DEVICE_ID \ + struct usb_device_id +#define STRUCT_USB_DUAL_ID \ + struct usb_device_id +#endif /* USB_HAVE_ID_SECTION */ /* * The following structure is used when looking up an USB driver for From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 07:19:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C4C1C15; Fri, 1 Feb 2013 07:19:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F07CF31; Fri, 1 Feb 2013 07:19:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117JJMV011738; Fri, 1 Feb 2013 07:19:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117JJdR011736; Fri, 1 Feb 2013 07:19:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302010719.r117JJdR011736@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 1 Feb 2013 07:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246195 - in head/sys/modules/usb: . smsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:19:20 -0000 Author: hselasky Date: Fri Feb 1 07:19:19 2013 New Revision: 246195 URL: http://svnweb.freebsd.org/changeset/base/246195 Log: Include SMSC driver into default kernel build. Modified: head/sys/modules/usb/Makefile head/sys/modules/usb/smsc/Makefile Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Fri Feb 1 07:05:43 2013 (r246194) +++ head/sys/modules/usb/Makefile Fri Feb 1 07:19:19 2013 (r246195) @@ -36,7 +36,7 @@ SUBDIR += ${_rum} run ${_uath} upgt usie SUBDIR += atp uhid ukbd ums udbp ufm uep SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umcs umodem umoscom uplcom uslcom uvisor uvscom -SUBDIR += uether aue axe cdce cue ${_kue} mos rue udav uhso ipheth +SUBDIR += uether aue axe cdce cue ${_kue} mos rue smsc udav uhso ipheth SUBDIR += usfs umass urio SUBDIR += quirk template Modified: head/sys/modules/usb/smsc/Makefile ============================================================================== --- head/sys/modules/usb/smsc/Makefile Fri Feb 1 07:05:43 2013 (r246194) +++ head/sys/modules/usb/smsc/Makefile Fri Feb 1 07:19:19 2013 (r246195) @@ -31,7 +31,7 @@ S= ${.CURDIR}/../../.. KMOD= if_smsc SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ - miibus_if.h opt_inet.h \ + miibus_if.h opt_inet.h opt_platform.h \ if_smsc.c .include From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 07:26:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1BECAEA8; Fri, 1 Feb 2013 07:26:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EBA82F8C; Fri, 1 Feb 2013 07:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117QPSH014239; Fri, 1 Feb 2013 07:26:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117QPgs014238; Fri, 1 Feb 2013 07:26:25 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302010726.r117QPgs014238@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 1 Feb 2013 07:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246196 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:26:26 -0000 Author: hselasky Date: Fri Feb 1 07:26:25 2013 New Revision: 246196 URL: http://svnweb.freebsd.org/changeset/base/246196 Log: Fix for hardware checksum offloading in SMSC driver. This also fixes IPv6 support for this particular hardware. Submitted by: Daisuke Aoyama Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Fri Feb 1 07:19:19 2013 (r246195) +++ head/sys/dev/usb/net/if_smsc.c Fri Feb 1 07:26:25 2013 (r246196) @@ -1009,6 +1009,10 @@ smsc_bulk_read_callback(struct usb_xfer /* Check if RX TCP/UDP checksumming is being offloaded */ if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) { + + struct ether_header *eh; + + eh = mtod(m, struct ether_header *); /* Remove the extra 2 bytes of the csum */ pktlen -= 2; @@ -1020,8 +1024,10 @@ smsc_bulk_read_callback(struct usb_xfer * the padding bytes as well. Therefore to be safe we * ignore the H/W csum on frames less than or equal to * 64 bytes. + * + * Ignore H/W csum for non-IPv4 packets. */ - if (pktlen > ETHER_MIN_LEN) { + if (be16toh(eh->ether_type) == ETHERTYPE_IP && pktlen > ETHER_MIN_LEN) { /* Indicate the UDP/TCP csum has been calculated */ m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 07:36:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D77DA267; Fri, 1 Feb 2013 07:36:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C99F46A; Fri, 1 Feb 2013 07:36:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117aMDS017112; Fri, 1 Feb 2013 07:36:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117aMU5017111; Fri, 1 Feb 2013 07:36:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302010736.r117aMU5017111@svn.freebsd.org> From: Xin LI Date: Fri, 1 Feb 2013 07:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246197 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:36:22 -0000 Author: delphij Date: Fri Feb 1 07:36:22 2013 New Revision: 246197 URL: http://svnweb.freebsd.org/changeset/base/246197 Log: MFC r244568: - Reduce buffer size from LINE_MAX to PATH_MAX, there is no point to store path longer than this. - Fix an unreached case of check against sizeof buf, which in turn leads to an off-by-one nul byte write on the stack. The original condition can never be satisfied because the passed boundary is the maximum value that can be returned, so code was harmless. Modified: stable/9/lib/libc/gen/check_utility_compat.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/check_utility_compat.c ============================================================================== --- stable/9/lib/libc/gen/check_utility_compat.c Fri Feb 1 07:26:25 2013 (r246196) +++ stable/9/lib/libc/gen/check_utility_compat.c Fri Feb 1 07:36:22 2013 (r246197) @@ -35,32 +35,28 @@ __FBSDID("$FreeBSD$"); * are threaded, so I'm not concerned about cancellation points or other * niceties. */ +#include + #include #include #include #include -#ifndef LINE_MAX -#define LINE_MAX _POSIX2_LINE_MAX -#endif - #define _PATH_UTIL_COMPAT "/etc/compat-FreeBSD-4-util" #define _ENV_UTIL_COMPAT "_COMPAT_FreeBSD_4" int check_utility_compat(const char *utility) { - char buf[LINE_MAX]; + char buf[PATH_MAX]; char *p, *bp; int len; if ((p = getenv(_ENV_UTIL_COMPAT)) != NULL) { strlcpy(buf, p, sizeof buf); } else { - if ((len = readlink(_PATH_UTIL_COMPAT, buf, sizeof buf)) < 0) + if ((len = readlink(_PATH_UTIL_COMPAT, buf, sizeof(buf) - 1)) < 0) return 0; - if (len > sizeof buf) - len = sizeof buf; buf[len] = '\0'; } if (buf[0] == '\0') From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 07:38:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 54A693E9; Fri, 1 Feb 2013 07:38:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4776682; Fri, 1 Feb 2013 07:38:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117cR79017415; Fri, 1 Feb 2013 07:38:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117cR4b017414; Fri, 1 Feb 2013 07:38:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302010738.r117cR4b017414@svn.freebsd.org> From: Xin LI Date: Fri, 1 Feb 2013 07:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246198 - stable/8/lib/libc/gen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:38:27 -0000 Author: delphij Date: Fri Feb 1 07:38:26 2013 New Revision: 246198 URL: http://svnweb.freebsd.org/changeset/base/246198 Log: MFC r244568: - Reduce buffer size from LINE_MAX to PATH_MAX, there is no point to store path longer than this. - Fix an unreached case of check against sizeof buf, which in turn leads to an off-by-one nul byte write on the stack. The original condition can never be satisfied because the passed boundary is the maximum value that can be returned, so code was harmless. Modified: stable/8/lib/libc/gen/check_utility_compat.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/check_utility_compat.c ============================================================================== --- stable/8/lib/libc/gen/check_utility_compat.c Fri Feb 1 07:36:22 2013 (r246197) +++ stable/8/lib/libc/gen/check_utility_compat.c Fri Feb 1 07:38:26 2013 (r246198) @@ -35,32 +35,28 @@ __FBSDID("$FreeBSD$"); * are threaded, so I'm not concerned about cancellation points or other * niceties. */ +#include + #include #include #include #include -#ifndef LINE_MAX -#define LINE_MAX _POSIX2_LINE_MAX -#endif - #define _PATH_UTIL_COMPAT "/etc/compat-FreeBSD-4-util" #define _ENV_UTIL_COMPAT "_COMPAT_FreeBSD_4" int check_utility_compat(const char *utility) { - char buf[LINE_MAX]; + char buf[PATH_MAX]; char *p, *bp; int len; if ((p = getenv(_ENV_UTIL_COMPAT)) != NULL) { strlcpy(buf, p, sizeof buf); } else { - if ((len = readlink(_PATH_UTIL_COMPAT, buf, sizeof buf)) < 0) + if ((len = readlink(_PATH_UTIL_COMPAT, buf, sizeof(buf) - 1)) < 0) return 0; - if (len > sizeof buf) - len = sizeof buf; buf[len] = '\0'; } if (buf[0] == '\0') From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 07:40:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 73CE9576; Fri, 1 Feb 2013 07:40:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5BFC7A8; Fri, 1 Feb 2013 07:40:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117elnj018005; Fri, 1 Feb 2013 07:40:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117elIC018002; Fri, 1 Feb 2013 07:40:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302010740.r117elIC018002@svn.freebsd.org> From: Xin LI Date: Fri, 1 Feb 2013 07:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246199 - stable/9/usr.bin/apply X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:40:47 -0000 Author: delphij Date: Fri Feb 1 07:40:46 2013 New Revision: 246199 URL: http://svnweb.freebsd.org/changeset/base/246199 Log: MFC r245048: Constify arguments. While I'm there, also add a static for usage(). Modified: stable/9/usr.bin/apply/apply.c Directory Properties: stable/9/usr.bin/apply/ (props changed) Modified: stable/9/usr.bin/apply/apply.c ============================================================================== --- stable/9/usr.bin/apply/apply.c Fri Feb 1 07:38:26 2013 (r246198) +++ stable/9/usr.bin/apply/apply.c Fri Feb 1 07:40:46 2013 (r246199) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #define EXEC "exec " -static int exec_shell(const char *, char *, char *); +static int exec_shell(const char *, const char *, const char *); static void usage(void); int @@ -222,7 +222,7 @@ main(int argc, char *argv[]) * arguments. */ static int -exec_shell(const char *command, char *use_shell, char *use_name) +exec_shell(const char *command, const char *use_shell, const char *use_name) { pid_t pid; int omask, pstat; @@ -250,7 +250,7 @@ exec_shell(const char *command, char *us return(pid == -1 ? -1 : pstat); } -void +static void usage(void) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 07:48:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 831129B6; Fri, 1 Feb 2013 07:48:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6695811B; Fri, 1 Feb 2013 07:48:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117mEN3020527; Fri, 1 Feb 2013 07:48:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117mEfT020526; Fri, 1 Feb 2013 07:48:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302010748.r117mEfT020526@svn.freebsd.org> From: Xin LI Date: Fri, 1 Feb 2013 07:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246200 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 07:48:14 -0000 Author: delphij Date: Fri Feb 1 07:48:13 2013 New Revision: 246200 URL: http://svnweb.freebsd.org/changeset/base/246200 Log: MFC r245511: Improve the comment in txg.c Obtained from: Illumos (13910:f3454e0a097c) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Feb 1 07:40:46 2013 (r246199) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Feb 1 07:48:13 2013 (r246200) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright 2011 Martin Matuska - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -33,7 +33,76 @@ #include /* - * Pool-wide transaction groups. + * ZFS Transaction Groups + * ---------------------- + * + * ZFS transaction groups are, as the name implies, groups of transactions + * that act on persistent state. ZFS asserts consistency at the granularity of + * these transaction groups. Each successive transaction group (txg) is + * assigned a 64-bit consecutive identifier. There are three active + * transaction group states: open, quiescing, or syncing. At any given time, + * there may be an active txg associated with each state; each active txg may + * either be processing, or blocked waiting to enter the next state. There may + * be up to three active txgs, and there is always a txg in the open state + * (though it may be blocked waiting to enter the quiescing state). In broad + * strokes, transactions — operations that change in-memory structures — are + * accepted into the txg in the open state, and are completed while the txg is + * in the open or quiescing states. The accumulated changes are written to + * disk in the syncing state. + * + * Open + * + * When a new txg becomes active, it first enters the open state. New + * transactions — updates to in-memory structures — are assigned to the + * currently open txg. There is always a txg in the open state so that ZFS can + * accept new changes (though the txg may refuse new changes if it has hit + * some limit). ZFS advances the open txg to the next state for a variety of + * reasons such as it hitting a time or size threshold, or the execution of an + * administrative action that must be completed in the syncing state. + * + * Quiescing + * + * After a txg exits the open state, it enters the quiescing state. The + * quiescing state is intended to provide a buffer between accepting new + * transactions in the open state and writing them out to stable storage in + * the syncing state. While quiescing, transactions can continue their + * operation without delaying either of the other states. Typically, a txg is + * in the quiescing state very briefly since the operations are bounded by + * software latencies rather than, say, slower I/O latencies. After all + * transactions complete, the txg is ready to enter the next state. + * + * Syncing + * + * In the syncing state, the in-memory state built up during the open and (to + * a lesser degree) the quiescing states is written to stable storage. The + * process of writing out modified data can, in turn modify more data. For + * example when we write new blocks, we need to allocate space for them; those + * allocations modify metadata (space maps)... which themselves must be + * written to stable storage. During the sync state, ZFS iterates, writing out + * data until it converges and all in-memory changes have been written out. + * The first such pass is the largest as it encompasses all the modified user + * data (as opposed to filesystem metadata). Subsequent passes typically have + * far less data to write as they consist exclusively of filesystem metadata. + * + * To ensure convergence, after a certain number of passes ZFS begins + * overwriting locations on stable storage that had been allocated earlier in + * the syncing state (and subsequently freed). ZFS usually allocates new + * blocks to optimize for large, continuous, writes. For the syncing state to + * converge however it must complete a pass where no new blocks are allocated + * since each allocation requires a modification of persistent metadata. + * Further, to hasten convergence, after a prescribed number of passes, ZFS + * also defers frees, and stops compressing. + * + * In addition to writing out user data, we must also execute synctasks during + * the syncing context. A synctask is the mechanism by which some + * administrative activities work such as creating and destroying snapshots or + * datasets. Note that when a synctask is initiated it enters the open txg, + * and ZFS then pushes that txg as quickly as possible to completion of the + * syncing state in order to reduce the latency of the administrative + * activity. To complete the syncing state, ZFS writes out a new uberblock, + * the root of the tree of blocks that comprise all state stored on the ZFS + * pool. Finally, if there is a quiesced txg waiting, we signal that it can + * now transition to the syncing state. */ static void txg_sync_thread(void *arg); From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 10:26:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E33F5CA9; Fri, 1 Feb 2013 10:26:31 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D5D0B9D1; Fri, 1 Feb 2013 10:26:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11AQVxE068428; Fri, 1 Feb 2013 10:26:31 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11AQVL9068427; Fri, 1 Feb 2013 10:26:31 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201302011026.r11AQVL9068427@svn.freebsd.org> From: Andre Oppermann Date: Fri, 1 Feb 2013 10:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246204 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 10:26:32 -0000 Author: andre Date: Fri Feb 1 10:26:31 2013 New Revision: 246204 URL: http://svnweb.freebsd.org/changeset/base/246204 Log: Add VM_KMEM_SIZE_SCALE parameter set to 2 (50%) for all ARM platforms. VM_KMEM_SIZE_SCALE specifies which fraction of the available physical memory, after deduction of the kernel itself and other early statically allocated memory, can be used for the kmem_map. The kmem_map provides for all UMA/malloc allocations in KVM space. Previously ARM was using a fixed kmem_map size of (12*1024*1024) = 12MB without regard to effectively available memory. This is too small for recent ARM SoC with more than 128MB of RAM. For reference a description of others related kmem_map parameters: VM_KMEM_SIZE default start size of kmem_map if SCALE is not defined VM_KMEM_SIZE_MIN hard floor on the kmem_map size VM_KMEM_SIZE_MAX hard ceiling on the kmem_map size VM_KMEM_SIZE_SCALE fraction of the available real memory to be used for the kmem_map, limited by the MIN and MAX parameters. Tested by: ian MFC after: 1 week Modified: head/sys/arm/include/vmparam.h Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Fri Feb 1 10:00:21 2013 (r246203) +++ head/sys/arm/include/vmparam.h Fri Feb 1 10:26:31 2013 (r246204) @@ -134,12 +134,15 @@ #endif #define VM_MAX_KERNEL_ADDRESS 0xffffffff + /* * Virtual size (bytes) for various kernel submaps. */ - #ifndef VM_KMEM_SIZE -#define VM_KMEM_SIZE (12*1024*1024) +#define VM_KMEM_SIZE (12*1024*1024) +#endif +#ifndef VM_KMEM_SIZE_SCALE +#define VM_KMEM_SIZE_SCALE (2) #endif #define MAXTSIZ (16*1024*1024) From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 11:39:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9C0D92D8; Fri, 1 Feb 2013 11:39:04 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 89605E6E; Fri, 1 Feb 2013 11:39:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11Bd4L9089765; Fri, 1 Feb 2013 11:39:04 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11Bd49R089763; Fri, 1 Feb 2013 11:39:04 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201302011139.r11Bd49R089763@svn.freebsd.org> From: Grzegorz Bernacki Date: Fri, 1 Feb 2013 11:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246205 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 11:39:04 -0000 Author: gber Date: Fri Feb 1 11:39:03 2013 New Revision: 246205 URL: http://svnweb.freebsd.org/changeset/base/246205 Log: Get time of next event from other cores only if SMP is already started. Reviewed by: mav Obtained from: Semihalf Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Fri Feb 1 10:26:31 2013 (r246204) +++ head/sys/kern/kern_clocksource.c Fri Feb 1 11:39:03 2013 (r246205) @@ -317,14 +317,16 @@ getnextevent(struct bintime *event) nonidle = !state->idle; if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { #ifdef SMP - CPU_FOREACH(cpu) { - if (curcpu == cpu) - continue; - state = DPCPU_ID_PTR(cpu, timerstate); - nonidle += !state->idle; - if (bintime_cmp(event, &state->nextevent, >)) { - *event = state->nextevent; - c = cpu; + if (smp_started) { + CPU_FOREACH(cpu) { + if (curcpu == cpu) + continue; + state = DPCPU_ID_PTR(cpu, timerstate); + nonidle += !state->idle; + if (bintime_cmp(event, &state->nextevent, >)) { + *event = state->nextevent; + c = cpu; + } } } #endif From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 13:04:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A0DE8FA6; Fri, 1 Feb 2013 13:04:07 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8508E388; Fri, 1 Feb 2013 13:04:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11D478t016200; Fri, 1 Feb 2013 13:04:07 GMT (envelope-from gahr@svn.freebsd.org) Received: (from gahr@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11D47tt016197; Fri, 1 Feb 2013 13:04:07 GMT (envelope-from gahr@svn.freebsd.org) Message-Id: <201302011304.r11D47tt016197@svn.freebsd.org> From: Pietro Cerutti Date: Fri, 1 Feb 2013 13:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246206 - in head: lib/libc/stdio tools/regression/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 13:04:07 -0000 Author: gahr (ports committer) Date: Fri Feb 1 13:04:06 2013 New Revision: 246206 URL: http://svnweb.freebsd.org/changeset/base/246206 Log: - Fix more style(9)-related issues (copyright header, spaces after function names, unnecessary casts) - Change type of boolean variable from char to bool Suggested by: jhb, zont, jmallett Reviewed by: cognet Approved by: cognet Modified: head/lib/libc/stdio/fmemopen.c head/tools/regression/lib/libc/stdio/test-fmemopen.c Modified: head/lib/libc/stdio/fmemopen.c ============================================================================== --- head/lib/libc/stdio/fmemopen.c Fri Feb 1 11:39:03 2013 (r246205) +++ head/lib/libc/stdio/fmemopen.c Fri Feb 1 13:04:06 2013 (r246206) @@ -1,32 +1,33 @@ /*- -Copyright (C) 2013 Pietro Cerutti - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. -*/ + * Copyright (C) 2013 Pietro Cerutti + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ #include __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -36,36 +37,36 @@ __FBSDID("$FreeBSD$"); struct fmemopen_cookie { char *buf; /* pointer to the memory region */ - char own; /* did we allocate the buffer ourselves? */ + bool own; /* did we allocate the buffer ourselves? */ char bin; /* is this a binary buffer? */ size_t size; /* buffer length in bytes */ size_t len; /* data length in bytes */ size_t off; /* current offset into the buffer */ }; -static int fmemopen_read (void *cookie, char *buf, int nbytes); -static int fmemopen_write (void *cookie, const char *buf, int nbytes); -static fpos_t fmemopen_seek (void *cookie, fpos_t offset, int whence); -static int fmemopen_close (void *cookie); +static int fmemopen_read(void *cookie, char *buf, int nbytes); +static int fmemopen_write(void *cookie, const char *buf, int nbytes); +static fpos_t fmemopen_seek(void *cookie, fpos_t offset, int whence); +static int fmemopen_close(void *cookie); FILE * -fmemopen (void * __restrict buf, size_t size, const char * __restrict mode) +fmemopen(void * __restrict buf, size_t size, const char * __restrict mode) { struct fmemopen_cookie *ck; FILE *f; int flags, rc; - /* + /* * Retrieve the flags as used by open(2) from the mode argument, and * validate them. - * */ - rc = __sflags (mode, &flags); + */ + rc = __sflags(mode, &flags); if (rc == 0) { errno = EINVAL; return (NULL); } - /* + /* * There's no point in requiring an automatically allocated buffer * in write-only mode. */ @@ -74,8 +75,7 @@ fmemopen (void * __restrict buf, size_t return (NULL); } - /* Allocate a cookie. */ - ck = malloc (sizeof (struct fmemopen_cookie)); + ck = malloc(sizeof(struct fmemopen_cookie)); if (ck == NULL) { return (NULL); } @@ -86,9 +86,9 @@ fmemopen (void * __restrict buf, size_t /* Check whether we have to allocate the buffer ourselves. */ ck->own = ((ck->buf = buf) == NULL); if (ck->own) { - ck->buf = malloc (size); + ck->buf = malloc(size); if (ck->buf == NULL) { - free (ck); + free(ck); return (NULL); } } @@ -107,22 +107,22 @@ fmemopen (void * __restrict buf, size_t /* * The size of the current buffer contents is set depending on the * mode: - * + * * for append (text-mode), the position of the first NULL byte, or the * size of the buffer if none is found * * for append (binary-mode), the size of the buffer - * + * * for read, the size of the buffer - * + * * for write, 0 */ switch (mode[0]) { case 'a': if (ck->bin) { - /* - * This isn't useful, since the buffer isn't - * allowed to grow. + /* + * This isn't useful, since the buffer isn't allowed + * to grow. */ ck->off = ck->len = size; } else @@ -136,16 +136,15 @@ fmemopen (void * __restrict buf, size_t break; } - /* Actuall wrapper. */ - f = funopen ((void *)ck, + f = funopen(ck, flags & O_WRONLY ? NULL : fmemopen_read, flags & O_RDONLY ? NULL : fmemopen_write, fmemopen_seek, fmemopen_close); if (f == NULL) { if (ck->own) - free (ck->buf); - free (ck); + free(ck->buf); + free(ck); return (NULL); } @@ -153,13 +152,13 @@ fmemopen (void * __restrict buf, size_t * Turn off buffering, so a write past the end of the buffer * correctly returns a short object count. */ - setvbuf (f, (char *) NULL, _IONBF, 0); + setvbuf(f, NULL, _IONBF, 0); return (f); } static int -fmemopen_read (void *cookie, char *buf, int nbytes) +fmemopen_read(void *cookie, char *buf, int nbytes) { struct fmemopen_cookie *ck = cookie; @@ -169,7 +168,7 @@ fmemopen_read (void *cookie, char *buf, if (nbytes == 0) return (0); - memcpy (buf, ck->buf + ck->off, nbytes); + memcpy(buf, ck->buf + ck->off, nbytes); ck->off += nbytes; @@ -177,7 +176,7 @@ fmemopen_read (void *cookie, char *buf, } static int -fmemopen_write (void *cookie, const char *buf, int nbytes) +fmemopen_write(void *cookie, const char *buf, int nbytes) { struct fmemopen_cookie *ck = cookie; @@ -187,7 +186,7 @@ fmemopen_write (void *cookie, const char if (nbytes == 0) return (0); - memcpy (ck->buf + ck->off, buf, nbytes); + memcpy(ck->buf + ck->off, buf, nbytes); ck->off += nbytes; @@ -207,7 +206,7 @@ fmemopen_write (void *cookie, const char } static fpos_t -fmemopen_seek (void *cookie, fpos_t offset, int whence) +fmemopen_seek(void *cookie, fpos_t offset, int whence) { struct fmemopen_cookie *ck = cookie; @@ -246,14 +245,14 @@ fmemopen_seek (void *cookie, fpos_t offs } static int -fmemopen_close (void *cookie) +fmemopen_close(void *cookie) { struct fmemopen_cookie *ck = cookie; if (ck->own) - free (ck->buf); + free(ck->buf); - free (ck); + free(ck); return (0); } Modified: head/tools/regression/lib/libc/stdio/test-fmemopen.c ============================================================================== --- head/tools/regression/lib/libc/stdio/test-fmemopen.c Fri Feb 1 11:39:03 2013 (r246205) +++ head/tools/regression/lib/libc/stdio/test-fmemopen.c Fri Feb 1 13:04:06 2013 (r246206) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include void -test_preexisting () +test_preexisting() { /* * Use a pre-existing buffer. @@ -54,56 +54,56 @@ test_preexisting () int rc; /* Open a FILE * using fmemopen. */ - fp = fmemopen (buf, sizeof(buf), "w"); - assert (fp != NULL); + fp = fmemopen(buf, sizeof(buf), "w"); + assert(fp != NULL); /* Write to the buffer. */ - nofw = fwrite (str, 1, sizeof(str), fp); - assert (nofw == sizeof(str)); + nofw = fwrite(str, 1, sizeof(str), fp); + assert(nofw == sizeof(str)); /* Close the FILE *. */ - rc = fclose (fp); - assert (rc == 0); + rc = fclose(fp); + assert(rc == 0); /* Re-open the FILE * to read back the data. */ - fp = fmemopen (buf, sizeof(buf), "r"); - assert (fp != NULL); + fp = fmemopen(buf, sizeof(buf), "r"); + assert(fp != NULL); /* Read from the buffer. */ - bzero (buf2, sizeof(buf2)); - nofr = fread (buf2, 1, sizeof(buf2), fp); - assert (nofr == sizeof(buf2)); + bzero(buf2, sizeof(buf2)); + nofr = fread(buf2, 1, sizeof(buf2), fp); + assert(nofr == sizeof(buf2)); /* * Since a write on a FILE * retrieved by fmemopen * will add a '\0' (if there's space), we can check * the strings for equality. */ - assert (strcmp(str, buf2) == 0); + assert(strcmp(str, buf2) == 0); /* Close the FILE *. */ - rc = fclose (fp); - assert (rc == 0); + rc = fclose(fp); + assert(rc == 0); /* Now open a FILE * on the first 4 bytes of the string. */ - fp = fmemopen (str, 4, "w"); - assert (fp != NULL); + fp = fmemopen(str, 4, "w"); + assert(fp != NULL); /* * Try to write more bytes than we shoud, we'll get a short count (4). */ - nofw = fwrite (str2, 1, sizeof(str2), fp); - assert (nofw == 4); + nofw = fwrite(str2, 1, sizeof(str2), fp); + assert(nofw == 4); /* Close the FILE *. */ - rc = fclose (fp); + rc = fclose(fp); /* Check that the string was not modified after the first 4 bytes. */ - assert (strcmp (str, str3) == 0); + assert(strcmp(str, str3) == 0); } void -test_autoalloc () +test_autoalloc() { /* * Let fmemopen allocate the buffer. @@ -116,32 +116,32 @@ test_autoalloc () int rc; /* Open a FILE * using fmemopen. */ - fp = fmemopen (NULL, 512, "w+"); - assert (fp != NULL); + fp = fmemopen(NULL, 512, "w+"); + assert(fp != NULL); /* fill the buffer */ for (i = 0; i < 512; i++) { - nofw = fwrite ("a", 1, 1, fp); - assert (nofw == 1); + nofw = fwrite("a", 1, 1, fp); + assert(nofw == 1); } /* Get the current position into the stream. */ - pos = ftell (fp); - assert (pos == 512); + pos = ftell(fp); + assert(pos == 512); /* * Try to write past the end, we should get a short object count (0) */ - nofw = fwrite ("a", 1, 1, fp); - assert (nofw == 0); + nofw = fwrite("a", 1, 1, fp); + assert(nofw == 0); /* Close the FILE *. */ - rc = fclose (fp); - assert (rc == 0); + rc = fclose(fp); + assert(rc == 0); } void -test_data_length () +test_data_length() { /* * Here we test that a read operation doesn't go past the end of the @@ -158,57 +158,57 @@ test_data_length () int rc; /* Open a FILE * for updating our buffer. */ - fp = fmemopen (buf, sizeof(buf), "w+"); - assert (fp != NULL); + fp = fmemopen(buf, sizeof(buf), "w+"); + assert(fp != NULL); /* Write our string into the buffer. */ - nofw = fwrite (str, 1, sizeof(str), fp); - assert (nofw == sizeof(str)); + nofw = fwrite(str, 1, sizeof(str), fp); + assert(nofw == sizeof(str)); /* * Now seek to the end and check that ftell * gives us sizeof(str). */ - rc = fseek (fp, 0, SEEK_END); - assert (rc == 0); - pos = ftell (fp); - assert (pos == sizeof(str)); + rc = fseek(fp, 0, SEEK_END); + assert(rc == 0); + pos = ftell(fp); + assert(pos == sizeof(str)); /* Close the FILE *. */ - rc = fclose (fp); - assert (rc == 0); + rc = fclose(fp); + assert(rc == 0); /* Reopen the buffer for appending. */ - fp = fmemopen (buf, sizeof(buf), "a+"); - assert (fp != NULL); + fp = fmemopen(buf, sizeof(buf), "a+"); + assert(fp != NULL); /* We should now be writing after the first string. */ - nofw = fwrite (str2, 1, sizeof(str2), fp); - assert (nofw == sizeof(str2)); + nofw = fwrite(str2, 1, sizeof(str2), fp); + assert(nofw == sizeof(str2)); /* Rewind the FILE *. */ - rc = fseek (fp, 0, SEEK_SET); - assert (rc == 0); + rc = fseek(fp, 0, SEEK_SET); + assert(rc == 0); /* Make sure we're at the beginning. */ - pos = ftell (fp); - assert (pos == 0); + pos = ftell(fp); + assert(pos == 0); /* Read the whole buffer. */ - nofr = fread (str3, 1, sizeof(buf), fp); - assert (nofr == sizeof(str3)); + nofr = fread(str3, 1, sizeof(buf), fp); + assert(nofr == sizeof(str3)); /* Make sure the two strings are there. */ - assert (strncmp (str3, str, sizeof(str) - 1) == 0); - assert (strncmp (str3 + sizeof(str) - 1, str2, sizeof(str2)) == 0); + assert(strncmp(str3, str, sizeof(str) - 1) == 0); + assert(strncmp(str3 + sizeof(str) - 1, str2, sizeof(str2)) == 0); /* Close the FILE *. */ - rc = fclose (fp); - assert (rc == 0); + rc = fclose(fp); + assert(rc == 0); } void -test_binary () +test_binary() { /* * Make sure that NULL bytes are never appended when opening a buffer @@ -222,31 +222,31 @@ test_binary () int rc, i; /* Pre-fill the buffer. */ - memset (buf, 'A', sizeof(buf)); + memset(buf, 'A', sizeof(buf)); /* Open a FILE * in binary mode. */ - fp = fmemopen (buf, sizeof(buf), "w+b"); - assert (fp != NULL); + fp = fmemopen(buf, sizeof(buf), "w+b"); + assert(fp != NULL); /* Write some data into it. */ - nofw = fwrite (str, 1, strlen(str), fp); - assert (nofw == strlen(str)); + nofw = fwrite(str, 1, strlen(str), fp); + assert(nofw == strlen(str)); /* Make sure that the buffer doesn't contain any NULL bytes. */ for (i = 0; i < sizeof(buf); i++) - assert (buf[i] != '\0'); + assert(buf[i] != '\0'); /* Close the FILE *. */ - rc = fclose (fp); - assert (rc == 0); + rc = fclose(fp); + assert(rc == 0); } int -main (void) +main(void) { - test_autoalloc (); - test_preexisting (); - test_data_length (); - test_binary (); + test_autoalloc(); + test_preexisting(); + test_data_length(); + test_binary(); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 14:16:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4676C26C; Fri, 1 Feb 2013 14:16:38 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2215C944; Fri, 1 Feb 2013 14:16:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11EGbPq038134; Fri, 1 Feb 2013 14:16:38 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11EGbcA038133; Fri, 1 Feb 2013 14:16:37 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201302011416.r11EGbcA038133@svn.freebsd.org> From: Andre Oppermann Date: Fri, 1 Feb 2013 14:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246207 - head/sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 14:16:38 -0000 Author: andre Date: Fri Feb 1 14:16:37 2013 New Revision: 246207 URL: http://svnweb.freebsd.org/changeset/base/246207 Log: Remove unused VM_MAX_AUTOTUNE_NMBCLUSTERS define. Modified: head/sys/i386/include/vmparam.h Modified: head/sys/i386/include/vmparam.h ============================================================================== --- head/sys/i386/include/vmparam.h Fri Feb 1 13:04:06 2013 (r246206) +++ head/sys/i386/include/vmparam.h Fri Feb 1 14:16:37 2013 (r246207) @@ -206,9 +206,4 @@ #define VM_MAX_AUTOTUNE_MAXUSERS 384 #endif -#ifndef VM_MAX_AUTOTUNE_NMBCLUSTERS -/* old maxusers max value. */ -#define VM_MAX_AUTOTUNE_NMBCLUSTERS (1024 + VM_MAX_AUTOTUNE_MAXUSERS * 64) -#endif - #endif /* _MACHINE_VMPARAM_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 14:21:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CD12589; Fri, 1 Feb 2013 14:21:10 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26F98981; Fri, 1 Feb 2013 14:21:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11ELASF040395; Fri, 1 Feb 2013 14:21:10 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11EL9ek040392; Fri, 1 Feb 2013 14:21:09 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201302011421.r11EL9ek040392@svn.freebsd.org> From: Andre Oppermann Date: Fri, 1 Feb 2013 14:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246208 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 14:21:10 -0000 Author: andre Date: Fri Feb 1 14:21:09 2013 New Revision: 246208 URL: http://svnweb.freebsd.org/changeset/base/246208 Log: uma_zone_set_max() directly returns the rounded effective zone limit. Use the return value directly instead of doing a second uma_zone_set_max() step. MFC after: 1 week Modified: head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Fri Feb 1 14:16:37 2013 (r246207) +++ head/sys/netinet/tcp_reass.c Fri Feb 1 14:21:09 2013 (r246208) @@ -106,8 +106,8 @@ tcp_reass_zone_change(void *tag) /* Set the zone limit and read back the effective value. */ V_tcp_reass_maxseg = nmbclusters / 16; - uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); - V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); + V_tcp_reass_maxseg = uma_zone_set_max(V_tcp_reass_zone, + V_tcp_reass_maxseg); } void @@ -120,8 +120,8 @@ tcp_reass_init(void) V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); /* Set the zone limit and read back the effective value. */ - uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); - V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); + V_tcp_reass_maxseg = uma_zone_set_max(V_tcp_reass_zone, + V_tcp_reass_maxseg); EVENTHANDLER_REGISTER(nmbclusters_change, tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY); } Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Fri Feb 1 14:16:37 2013 (r246207) +++ head/sys/netinet/tcp_syncache.c Fri Feb 1 14:21:09 2013 (r246208) @@ -268,8 +268,8 @@ syncache_init(void) /* Create the syncache entry zone. */ V_tcp_syncache.zone = uma_zcreate("syncache", sizeof(struct syncache), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - uma_zone_set_max(V_tcp_syncache.zone, V_tcp_syncache.cache_limit); - V_tcp_syncache.cache_limit = uma_zone_get_max(V_tcp_syncache.zone); + V_tcp_syncache.cache_limit = uma_zone_set_max(V_tcp_syncache.zone, + V_tcp_syncache.cache_limit); } #ifdef VIMAGE From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 14:26:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC26B922; Fri, 1 Feb 2013 14:26:57 +0000 (UTC) (envelope-from charnier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9EECE9BF; Fri, 1 Feb 2013 14:26:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11EQv02041349; Fri, 1 Feb 2013 14:26:57 GMT (envelope-from charnier@svn.freebsd.org) Received: (from charnier@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11EQtMK041336; Fri, 1 Feb 2013 14:26:55 GMT (envelope-from charnier@svn.freebsd.org) Message-Id: <201302011426.r11EQtMK041336@svn.freebsd.org> From: Philippe Charnier Date: Fri, 1 Feb 2013 14:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246209 - in head/usr.sbin/timed: timed timedc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 14:26:57 -0000 Author: charnier Date: Fri Feb 1 14:26:54 2013 New Revision: 246209 URL: http://svnweb.freebsd.org/changeset/base/246209 Log: Change old-style function definition Modified: head/usr.sbin/timed/timed/acksend.c head/usr.sbin/timed/timed/byteorder.c head/usr.sbin/timed/timed/candidate.c head/usr.sbin/timed/timed/cksum.c head/usr.sbin/timed/timed/correct.c head/usr.sbin/timed/timed/master.c head/usr.sbin/timed/timed/measure.c head/usr.sbin/timed/timed/networkdelta.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 head/usr.sbin/timed/timedc/timedc.c Modified: head/usr.sbin/timed/timed/acksend.c ============================================================================== --- head/usr.sbin/timed/timed/acksend.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/acksend.c Fri Feb 1 14:26:54 2013 (r246209) @@ -42,10 +42,7 @@ struct tsp *answer; extern u_short sequence; void -xmit(type, seq, addr) - int type; - u_int seq; - struct sockaddr_in *addr; +xmit(int type, u_int seq, struct sockaddr_in *addr) { static struct tsp msg; @@ -68,15 +65,15 @@ xmit(type, seq, addr) * * Because this function calls readmsg(), none of its args may be in * a message provided by readmsg(). + * message this message + * addr to here + * ack look for this ack + * net receive from this network + * bad 1=losing patience */ struct tsp * -acksend(message, addr, name, ack, net, bad) - struct tsp *message; /* this message */ - struct sockaddr_in *addr; /* to here */ - char *name; - int ack; /* look for this ack */ - struct netinfo *net; /* receive from this network */ - int bad; /* 1=losing patience */ +acksend(struct tsp *message, struct sockaddr_in *addr, char *name, + int ack, struct netinfo *net, int bad) { struct timeval twait; int count; Modified: head/usr.sbin/timed/timed/byteorder.c ============================================================================== --- head/usr.sbin/timed/timed/byteorder.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/byteorder.c Fri Feb 1 14:26:54 2013 (r246209) @@ -42,8 +42,7 @@ static const char rcsid[] = * messages. Protocol is defined in /usr/include/protocols/timed.h */ void -bytenetorder(ptr) - struct tsp *ptr; +bytenetorder(struct tsp *ptr) { ptr->tsp_seq = htons((u_short)ptr->tsp_seq); switch (ptr->tsp_type) { @@ -62,8 +61,7 @@ bytenetorder(ptr) } void -bytehostorder(ptr) - struct tsp *ptr; +bytehostorder(struct tsp *ptr) { ptr->tsp_seq = ntohs((u_short)ptr->tsp_seq); switch (ptr->tsp_type) { Modified: head/usr.sbin/timed/timed/candidate.c ============================================================================== --- head/usr.sbin/timed/timed/candidate.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/candidate.c Fri Feb 1 14:26:54 2013 (r246209) @@ -44,8 +44,7 @@ static const char rcsid[] = * candidate sends an election request, the candidature is withdrawn. */ int -election(net) - struct netinfo *net; +election(struct netinfo *net) { struct tsp *resp, msg; struct timeval then, wait; Modified: head/usr.sbin/timed/timed/cksum.c ============================================================================== --- head/usr.sbin/timed/timed/cksum.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/cksum.c Fri Feb 1 14:26:54 2013 (r246209) @@ -49,9 +49,7 @@ static const char rcsid[] = * worry about carries except at the end. */ int -in_cksum(addr, len) - u_short *addr; - int len; +in_cksum(u_short *addr, int len) { register int nleft = len; register u_short *w = addr; Modified: head/usr.sbin/timed/timed/correct.c ============================================================================== --- head/usr.sbin/timed/timed/correct.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/correct.c Fri Feb 1 14:26:54 2013 (r246209) @@ -47,8 +47,7 @@ static void adjclock(struct timeval *); * own */ void -correct(avdelta) - long avdelta; +correct(long avdelta) { struct hosttbl *htp; int corr; @@ -112,8 +111,7 @@ correct(avdelta) static void -adjclock(corr) - struct timeval *corr; +adjclock(struct timeval *corr) { static int passes = 0; static int smoother = 0; @@ -176,9 +174,7 @@ adjclock(corr) * spent in the queue */ void -adj_msg_time(msg, now) - struct tsp *msg; - struct timeval *now; +adj_msg_time(struct tsp *msg, struct timeval *now) { msg->tsp_time.tv_sec += (now->tv_sec - from_when.tv_sec); msg->tsp_time.tv_usec += (now->tv_usec - from_when.tv_usec); Modified: head/usr.sbin/timed/timed/master.c ============================================================================== --- head/usr.sbin/timed/timed/master.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/master.c Fri Feb 1 14:26:54 2013 (r246209) @@ -63,7 +63,7 @@ static void mchgdate(struct tsp *); * takes the appropriate action. */ int -master() +master(void) { struct hosttbl *htp; long pollingtime; @@ -339,8 +339,7 @@ loop: * change the system date on the master */ static void -mchgdate(msg) - struct tsp *msg; +mchgdate(struct tsp *msg) { char tname[MAXHOSTNAMELEN]; char olddate[32]; @@ -386,8 +385,7 @@ mchgdate(msg) * synchronize all of the slaves */ void -synch(mydelta) - long mydelta; +synch(long mydelta) { struct hosttbl *htp; int measure_status; @@ -460,7 +458,7 @@ synch(mydelta) * has received the command to set the network time */ void -spreadtime() +spreadtime(void) { struct hosttbl *htp; struct tsp to; @@ -499,8 +497,7 @@ spreadtime() } void -prthp(delta) - clock_t delta; +prthp(clock_t delta) { static time_t next_time; time_t this_time; @@ -538,8 +535,7 @@ static struct hosttbl *lasthfree = &host struct hosttbl * /* answer or 0 */ -findhost(name) - char *name; +findhost(char *name) { int i, j; struct hosttbl *htp; @@ -565,10 +561,7 @@ findhost(name) * add a host to the list of controlled machines if not already there */ struct hosttbl * -addmach(name, addr, ntp) - char *name; - struct sockaddr_in *addr; - struct netinfo *ntp; +addmach(char *name, struct sockaddr_in *addr, struct netinfo *ntp) { struct hosttbl *ret, *p, *b, *f; @@ -654,8 +647,7 @@ addmach(name, addr, ntp) * remove the machine with the given index in the host table. */ struct hosttbl * -remmach(htp) - struct hosttbl *htp; +remmach(struct hosttbl *htp) { struct hosttbl *lprv, *hnxt, *f, *b; @@ -706,8 +698,7 @@ remmach(htp) * given network. */ void -rmnetmachs(ntp) - struct netinfo *ntp; +rmnetmachs(struct netinfo *ntp) { struct hosttbl *htp; @@ -722,8 +713,7 @@ rmnetmachs(ntp) } void -masterup(net) - struct netinfo *net; +masterup(struct netinfo *net) { xmit(TSP_MASTERUP, 0, &net->dest_addr); @@ -736,8 +726,7 @@ masterup(net) } void -newslave(msg) - struct tsp *msg; +newslave(struct tsp *msg) { struct hosttbl *htp; struct tsp *answer, to; @@ -782,8 +771,7 @@ newslave(msg) * react to a TSP_QUIT: */ void -doquit(msg) - struct tsp *msg; +doquit(struct tsp *msg) { if (fromnet->status == MASTER) { if (!good_host_name(msg->tsp_name)) { @@ -814,7 +802,7 @@ doquit(msg) } void -traceon() +traceon(void) { if (!fd) { fd = fopen(_PATH_TIMEDLOG, "w"); @@ -832,8 +820,7 @@ traceon() void -traceoff(msg) - char *msg; +traceoff(char *msg) { get_goodgroup(1); setstatus(); Modified: head/usr.sbin/timed/timed/measure.c ============================================================================== --- head/usr.sbin/timed/timed/measure.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/measure.c Fri Feb 1 14:26:54 2013 (r246209) @@ -56,14 +56,12 @@ static n_short seqno = 0; /* * Measures the differences between machines' clocks using * ICMP timestamp messages. + * maxmsec wait this many msec at most + * wmsec msec to wait for an answer + * print print complaints on stderr */ int /* status val defined in globals.h */ -measure(maxmsec, wmsec, hname, addr, print) - u_long maxmsec; /* wait this many msec at most */ - u_long wmsec; /* msec to wait for an answer */ - char *hname; - struct sockaddr_in *addr; - int print; /* print complaints on stderr */ +measure(u_long maxmsec, u_long wmsec, char *hname, struct sockaddr_in *addr, int print) { int length; int measure_status; @@ -292,9 +290,7 @@ quit: * round a number of milliseconds into a struct timeval */ void -mstotvround(res, x) - struct timeval *res; - long x; +mstotvround(struct timeval *res, long x) { if (x < 0) x = -((-x + 3)/5); @@ -310,8 +306,7 @@ mstotvround(res, x) } void -timevaladd(tv1, tv2) - struct timeval *tv1, *tv2; +timevaladd(struct timeval *tv1, struct timeval *tv2) { tv1->tv_sec += tv2->tv_sec; tv1->tv_usec += tv2->tv_usec; @@ -326,8 +321,7 @@ timevaladd(tv1, tv2) } void -timevalsub(res, tv1, tv2) - struct timeval *res, *tv1, *tv2; +timevalsub(struct timeval *res, struct timeval *tv1, struct timeval *tv2) { res->tv_sec = tv1->tv_sec - tv2->tv_sec; res->tv_usec = tv1->tv_usec - tv2->tv_usec; Modified: head/usr.sbin/timed/timed/networkdelta.c ============================================================================== --- head/usr.sbin/timed/timed/networkdelta.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/networkdelta.c Fri Feb 1 14:26:54 2013 (r246209) @@ -62,7 +62,7 @@ static long median(float, float *, long * bad values. */ long -networkdelta() +networkdelta(void) { struct hosttbl *htp; long med; Modified: head/usr.sbin/timed/timed/readmsg.c ============================================================================== --- head/usr.sbin/timed/timed/readmsg.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/readmsg.c Fri Feb 1 14:26:54 2013 (r246209) @@ -69,11 +69,7 @@ struct timeval from_when; */ struct tsp * -readmsg(type, machfrom, intvl, netfrom) - int type; - char *machfrom; - struct timeval *intvl; - struct netinfo *netfrom; +readmsg(int type, char *machfrom, struct timeval *intvl, struct netinfo *netfrom) { int length; fd_set ready; @@ -342,7 +338,7 @@ again: * only the type ACK is to be sent by a slave */ void -slaveack() +slaveack(void) { switch(msgin.tsp_type) { @@ -374,7 +370,7 @@ slaveack() * These packets should be acknowledged. */ void -ignoreack() +ignoreack(void) { switch(msgin.tsp_type) { @@ -402,7 +398,7 @@ ignoreack() * to the messages received by a master */ void -masterack() +masterack(void) { struct tsp resp; @@ -445,9 +441,7 @@ masterack() * Print a TSP message */ void -print(msg, addr) - struct tsp *msg; - struct sockaddr_in *addr; +print(struct tsp *msg, struct sockaddr_in *addr) { char tm[26]; time_t tsp_time_sec; Modified: head/usr.sbin/timed/timed/slave.c ============================================================================== --- head/usr.sbin/timed/timed/slave.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/slave.c Fri Feb 1 14:26:54 2013 (r246209) @@ -55,7 +55,7 @@ static void setmaster(struct tsp *); static void answerdelay(void); int -slave() +slave(void) { int tries; long electiontime, refusetime, looktime, looptime, adjtime; @@ -610,8 +610,7 @@ loop: * tell the world who our master is */ static void -setmaster(msg) - struct tsp *msg; +setmaster(struct tsp *msg) { if (slavenet && (slavenet != old_slavenet @@ -640,9 +639,7 @@ setmaster(msg) * handle date change request on a slave */ static void -schgdate(msg, newdate) - struct tsp *msg; - char *newdate; +schgdate(struct tsp *msg, char *newdate) { struct tsp to; u_short seq; @@ -680,7 +677,7 @@ schgdate(msg, newdate) * contention and likely collisions. */ static void -answerdelay() +answerdelay(void) { struct timeval timeout; Modified: head/usr.sbin/timed/timed/timed.c ============================================================================== --- head/usr.sbin/timed/timed/timed.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timed/timed.c Fri Feb 1 14:26:54 2013 (r246209) @@ -110,9 +110,7 @@ static void usage(void); * overhauled at Silicon Graphics */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int on; int ret; @@ -434,7 +432,7 @@ main(argc, argv) } static void -usage() +usage(void) { #ifdef HAVENIS fprintf(stderr, @@ -450,10 +448,7 @@ usage() * suppress an upstart, untrustworthy, self-appointed master */ void -suppress(addr, name,net) - struct sockaddr_in *addr; - char *name; - struct netinfo *net; +suppress(struct sockaddr_in *addr, char *name, struct netinfo *net) { struct sockaddr_in tgt; char tname[MAXHOSTNAMELEN]; @@ -478,8 +473,7 @@ suppress(addr, name,net) } void -lookformaster(ntp) - struct netinfo *ntp; +lookformaster(struct netinfo *ntp) { struct tsp resp, conflict, *answer; struct timeval ntime; @@ -578,7 +572,7 @@ lookformaster(ntp) * networks; */ void -setstatus() +setstatus(void) { struct netinfo *ntp; @@ -631,8 +625,7 @@ setstatus() } void -makeslave(net) - struct netinfo *net; +makeslave(struct netinfo *net) { register struct netinfo *ntp; @@ -647,7 +640,7 @@ makeslave(net) * Try to become master over ignored nets.. */ static void -checkignorednets() +checkignorednets(void) { register struct netinfo *ntp; @@ -669,8 +662,7 @@ checkignorednets() * Take a hint about for a good network. */ static void -pickslavenet(ntp) - struct netinfo *ntp; +pickslavenet(struct netinfo *ntp) { if (slavenet != 0 && slavenet->status == SLAVE) { makeslave(slavenet); /* prune extras */ @@ -690,8 +682,7 @@ pickslavenet(ntp) * returns a random number in the range [inf, sup] */ long -casual(inf, sup) - long inf, sup; +casual(long inf, long sup) { double value; @@ -700,7 +691,7 @@ casual(inf, sup) } char * -date() +date(void) { time_t tv_sec; @@ -709,8 +700,7 @@ date() } void -addnetname(name) - char *name; +addnetname(char *name) { register struct nets **netlist = &nets; @@ -723,11 +713,11 @@ addnetname(name) (*netlist)->name = name; } -/* note a host as trustworthy */ +/* note a host as trustworthy + * perm 1=not part of the netgroup + */ static void -add_good_host(name, perm) - char *name; - int perm; /* 1=not part of the netgroup */ +add_good_host(char *name, int perm) { register struct goodhost *ghp; register struct hostent *hentp; @@ -753,8 +743,7 @@ add_good_host(name, perm) /* update our image of the net-group of trustworthy hosts */ void -get_goodgroup(force) - int force; +get_goodgroup(int force) { # define NG_DELAY (30*60*CLK_TCK) /* 30 minutes */ static unsigned long last_update = -NG_DELAY; @@ -822,8 +811,7 @@ get_goodgroup(force) /* see if a machine is trustworthy */ int /* 1=trust hp to change our date */ -good_host_name(name) - char *name; +good_host_name(char *name) { register struct goodhost *ghp = goodhosts; register char c; Modified: head/usr.sbin/timed/timedc/cmds.c ============================================================================== --- head/usr.sbin/timed/timedc/cmds.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timedc/cmds.c Fri Feb 1 14:26:54 2013 (r246209) @@ -32,7 +32,6 @@ static char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #endif - #include __FBSDID("$FreeBSD$"); @@ -78,8 +77,7 @@ void bytehostorder(struct tsp *); /* compute the difference between our date and another machine */ static int /* difference in days from our time */ -daydiff(hostname) - char *hostname; +daydiff(char *hostname) { int i; int trials; @@ -164,9 +162,7 @@ daydiff(hostname) * measurement. */ void -clockdiff(argc, argv) - int argc; - char *argv[]; +clockdiff(int argc, char *argv[]) { int measure_status; extern int measure(u_long, u_long, char *, struct sockaddr_in*, int); @@ -263,9 +259,7 @@ clockdiff(argc, argv) * finds location of master timedaemon */ void -msite(argc, argv) - int argc; - char *argv[]; +msite(int argc, char *argv[]) { ssize_t cc; fd_set ready; @@ -360,7 +354,7 @@ msite(argc, argv) * quits timedc */ void -quit() +quit(void) { exit(0); } @@ -372,9 +366,7 @@ quit() * reliability of communication channel. */ void -testing(argc, argv) - int argc; - char *argv[]; +testing(int argc, char *argv[]) { struct servent *srvp; struct sockaddr_in sin; @@ -422,9 +414,7 @@ testing(argc, argv) * Enables or disables tracing on local timedaemon */ void -tracing(argc, argv) - int argc; - char *argv[]; +tracing(int argc, char *argv[]) { int onflag; int length; @@ -513,7 +503,7 @@ tracing(argc, argv) } int -priv_resources() +priv_resources(void) { int port; struct sockaddr_in sin; Modified: head/usr.sbin/timed/timedc/timedc.c ============================================================================== --- head/usr.sbin/timed/timedc/timedc.c Fri Feb 1 14:21:09 2013 (r246208) +++ head/usr.sbin/timed/timedc/timedc.c Fri Feb 1 14:26:54 2013 (r246209) @@ -62,9 +62,7 @@ jmp_buf toplevel; static struct cmd *getcmd(char *); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { register struct cmd *c; @@ -131,8 +129,7 @@ main(argc, argv) } void -intr(signo) - int signo; +intr(int signo __unused) { if (!fromatty) exit(0); @@ -141,8 +138,7 @@ intr(signo) static struct cmd * -getcmd(name) - char *name; +getcmd(char *name) { register char *p, *q; register struct cmd *c, *found; @@ -175,7 +171,7 @@ getcmd(name) * Slice a string up into argc/argv. */ void -makeargv() +makeargv(void) { register char *cp; register char **argp = margv; @@ -203,9 +199,7 @@ makeargv() * Help command. */ void -help(argc, argv) - int argc; - char *argv[]; +help(int argc, char *argv[]) { register struct cmd *c; From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 15:32:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE49DE70; Fri, 1 Feb 2013 15:32:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 86CEBDAF; Fri, 1 Feb 2013 15:32:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11FWLND064677; Fri, 1 Feb 2013 15:32:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11FWKZf064670; Fri, 1 Feb 2013 15:32:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302011532.r11FWKZf064670@svn.freebsd.org> From: John Baldwin Date: Fri, 1 Feb 2013 15:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246210 - in head/sys: netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 15:32:21 -0000 Author: jhb Date: Fri Feb 1 15:32:20 2013 New Revision: 246210 URL: http://svnweb.freebsd.org/changeset/base/246210 Log: Add placeholder constants to reserve a portion of the socket option name space for use by downstream vendors to add custom options. MFC after: 2 weeks Modified: head/sys/netinet/tcp.h head/sys/netinet/udp.h head/sys/sys/socket.h head/sys/sys/un.h Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Fri Feb 1 14:26:54 2013 (r246209) +++ head/sys/netinet/tcp.h Fri Feb 1 15:32:20 2013 (r246210) @@ -166,6 +166,9 @@ struct tcphdr { #define TCP_KEEPINTVL 512 /* L,N interval between keepalives */ #define TCP_KEEPCNT 1024 /* L,N number of keepalives before close */ +/* Start of reserved space for third-party user-settable options. */ +#define TCP_VENDOR SO_VENDOR + #define TCP_CA_NAME_MAX 16 /* max congestion control name length */ #define TCPI_OPT_TIMESTAMPS 0x01 Modified: head/sys/netinet/udp.h ============================================================================== --- head/sys/netinet/udp.h Fri Feb 1 14:26:54 2013 (r246209) +++ head/sys/netinet/udp.h Fri Feb 1 15:32:20 2013 (r246210) @@ -50,6 +50,8 @@ struct udphdr { */ #define UDP_ENCAP 1 +/* Start of reserved space for third-party user-settable options. */ +#define UDP_VENDOR SO_VENDOR /* * UDP Encapsulation of IPsec Packets options. Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Fri Feb 1 14:26:54 2013 (r246209) +++ head/sys/sys/socket.h Fri Feb 1 15:32:20 2013 (r246210) @@ -143,6 +143,15 @@ typedef __uid_t uid_t; #endif /* + * Space reserved for new socket options added by third-party vendors. + * This range applies to all socket option levels. New socket options + * in FreeBSD should always use an option value less than SO_VENDOR. + */ +#if __BSD_VISIBLE +#define SO_VENDOR 0x80000000 +#endif + +/* * Structure used for manipulating linger option. */ struct linger { Modified: head/sys/sys/un.h ============================================================================== --- head/sys/sys/un.h Fri Feb 1 14:26:54 2013 (r246209) +++ head/sys/sys/un.h Fri Feb 1 15:32:20 2013 (r246210) @@ -57,6 +57,9 @@ struct sockaddr_un { #define LOCAL_CREDS 2 /* pass credentials to receiver */ #define LOCAL_CONNWAIT 4 /* connects block until accepted */ +/* Start of reserved space for third-party socket options. */ +#define LOCAL_VENDOR SO_VENDOR + #ifndef _KERNEL /* actual length of an initialized sockaddr_un */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 15:48:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 55F5D509; Fri, 1 Feb 2013 15:48:30 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E30DE7A; Fri, 1 Feb 2013 15:48:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11FmUjk068443; Fri, 1 Feb 2013 15:48:30 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11FmUZh068442; Fri, 1 Feb 2013 15:48:30 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302011548.r11FmUZh068442@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 1 Feb 2013 15:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246211 - stable/8 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 15:48:30 -0000 Author: pluknet Date: Fri Feb 1 15:48:29 2013 New Revision: 246211 URL: http://svnweb.freebsd.org/changeset/base/246211 Log: MFC r200596 (by imp): Add NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN}, which disables doing a make obj. Use it when you know it will work only. KERNFAST now implies NO_KERNELOBJ, since you don't need to keep doing obj when doing incremental kernel builds. Approved by: imp Modified: stable/8/Makefile.inc1 (contents, props changed) Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Fri Feb 1 15:32:20 2013 (r246210) +++ stable/8/Makefile.inc1 Fri Feb 1 15:48:29 2013 (r246211) @@ -5,10 +5,11 @@ # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir # -DNO_CLEAN do not clean at all # -DNO_SHARE do not go into share subdir -# -DKERNFAST define NO_KERNELCONFIG, NO_KERNELCLEAN and NO_KERNELDEPEND +# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ} # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel +# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_DOCUPDATE do not update doc in ${MAKE} update # -DNO_CTF do not run the DTrace CTF conversion tools on built objects @@ -694,6 +695,7 @@ distrib-dirs distribution: NO_KERNELCLEAN= t NO_KERNELCONFIG= t NO_KERNELDEPEND= t +NO_KERNELOBJ= t # Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah .if !defined(KERNCONF) && ${KERNFAST} != "1" KERNCONF=${KERNFAST} @@ -763,11 +765,13 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} .endif +.if !defined(NO_KERNELOBJ) @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.2: rebuilding the object tree" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj +.endif @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.3: build tools" From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 16:48:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C6D9053E; Fri, 1 Feb 2013 16:48:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A960B165; Fri, 1 Feb 2013 16:48:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11GmtKf086389; Fri, 1 Feb 2013 16:48:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11Gmt2K086388; Fri, 1 Feb 2013 16:48:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302011648.r11Gmt2K086388@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Feb 2013 16:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246212 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 16:48:55 -0000 Author: kib Date: Fri Feb 1 16:48:55 2013 New Revision: 246212 URL: http://svnweb.freebsd.org/changeset/base/246212 Log: The change to reduce default smp_tsc_shift caused tsc shift to become zero on slower machines, which make the fenced get_timecount methods not used despite needed. Remove the (shift > 0) condition when selecting the get_timecount() implementation. Rename smp_tsc_shift to tsc_shift, and apply it for the UP case too. Allow shift to reach value of 31 instead of 30, as it was previously (should be nop). Reorganize the tc quality calculation to remove the conditionally compiled block. Rename test_smp_tsc() to test_tsc() and provide separate versions for SMP and UP builds. The check for virtialized hardware is more natural to perform in the smp version of the test_tsc(), since it is only done for smp case. Noted and reviewed by: bde (previous version) MFC after: 12 days Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Fri Feb 1 15:48:29 2013 (r246211) +++ head/sys/x86/x86/tsc.c Fri Feb 1 16:48:55 2013 (r246212) @@ -65,14 +65,13 @@ static int smp_tsc; SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc, CTLFLAG_RDTUN, &smp_tsc, 0, "Indicates whether the TSC is safe to use in SMP mode"); TUNABLE_INT("kern.timecounter.smp_tsc", &smp_tsc); - -static int smp_tsc_shift = 1; -SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc_shift, CTLFLAG_RDTUN, - &smp_tsc_shift, 0, - "Shift to pre-apply for the maximum TSC frequency in SMP mode"); -TUNABLE_INT("kern.timecounter.smp_tsc_shift", &smp_tsc_shift); #endif +static int tsc_shift = 1; +SYSCTL_INT(_kern_timecounter, OID_AUTO, tsc_shift, CTLFLAG_RDTUN, + &tsc_shift, 0, "Shift to pre-apply for the maximum TSC frequency"); +TUNABLE_INT("kern.timecounter.tsc_shift", &tsc_shift); + static int tsc_disabled; SYSCTL_INT(_machdep, OID_AUTO, disable_tsc, CTLFLAG_RDTUN, &tsc_disabled, 0, "Disable x86 Time Stamp Counter"); @@ -405,12 +404,12 @@ comp_smp_tsc(void *arg) } static int -test_smp_tsc(void) +test_tsc(void) { uint64_t *data, *tsc; u_int i, size; - if (!smp_tsc && !tsc_is_invariant) + if ((!smp_tsc && !tsc_is_invariant) || vm_guest) return (-100); size = (mp_maxid + 1) * 3; data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); @@ -450,6 +449,19 @@ test_smp_tsc(void) #undef N +#else + +/* + * The function is not called, it is provided to avoid linking failure + * on uniprocessor kernel. + */ +static int +test_tsc(void) +{ + + return (0); +} + #endif /* SMP */ static void @@ -498,41 +510,37 @@ init_TSC_tc(void) goto init; } -#ifdef SMP /* - * We can not use the TSC in SMP mode unless the TSCs on all CPUs are - * synchronized. If the user is sure that the system has synchronized - * TSCs, set kern.timecounter.smp_tsc tunable to a non-zero value. - * We also limit the frequency even lower to avoid "temporal anomalies" - * as much as possible. The TSC seems unreliable in virtualized SMP + * We can not use the TSC in SMP mode unless the TSCs on all CPUs + * are synchronized. If the user is sure that the system has + * synchronized TSCs, set kern.timecounter.smp_tsc tunable to a + * non-zero value. The TSC seems unreliable in virtualized SMP * environments, so it is set to a negative quality in those cases. */ - if (smp_cpus > 1) { - if (vm_guest != 0) { - tsc_timecounter.tc_quality = -100; - } else { - tsc_timecounter.tc_quality = test_smp_tsc(); - max_freq >>= smp_tsc_shift; - } - } else -#endif - if (tsc_is_invariant) + if (mp_ncpus > 1) + tsc_timecounter.tc_quality = test_tsc(); + else if (tsc_is_invariant) tsc_timecounter.tc_quality = 1000; + max_freq >>= tsc_shift; init: - for (shift = 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++) + for (shift = 0; shift <= 31 && (tsc_freq >> shift) > max_freq; shift++) ; + if ((cpu_feature & CPUID_SSE2) != 0 && mp_ncpus > 1) { + if (cpu_vendor_id == CPU_VENDOR_AMD) { + tsc_timecounter.tc_get_timecount = shift > 0 ? + tsc_get_timecount_low_mfence : + tsc_get_timecount_mfence; + } else { + tsc_timecounter.tc_get_timecount = shift > 0 ? + tsc_get_timecount_low_lfence : + tsc_get_timecount_lfence; + } + } else { + tsc_timecounter.tc_get_timecount = shift > 0 ? + tsc_get_timecount_low : tsc_get_timecount; + } if (shift > 0) { - if (cpu_feature & CPUID_SSE2) { - if (cpu_vendor_id == CPU_VENDOR_AMD) { - tsc_timecounter.tc_get_timecount = - tsc_get_timecount_low_mfence; - } else { - tsc_timecounter.tc_get_timecount = - tsc_get_timecount_low_lfence; - } - } else - tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; tsc_timecounter.tc_name = "TSC-low"; if (bootverbose) printf("TSC timecounter discards lower %d bit(s)\n", From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 16:57:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D77E472A; Fri, 1 Feb 2013 16:57:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C706B1A8; Fri, 1 Feb 2013 16:57:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11Gv2X7089084; Fri, 1 Feb 2013 16:57:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11Gv2An089083; Fri, 1 Feb 2013 16:57:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302011657.r11Gv2An089083@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Feb 2013 16:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246213 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 16:57:02 -0000 Author: kib Date: Fri Feb 1 16:57:02 2013 New Revision: 246213 URL: http://svnweb.freebsd.org/changeset/base/246213 Log: Assert that the mbuf in the chain has sane length. Proper place for this check is somewhere in the network code, but this assertion already proven to be useful in catching what seems to be driver bugs causing NFS scrambling random memory. Discussed with: rmacklem MFC after: 1 week Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri Feb 1 16:48:55 2013 (r246212) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Feb 1 16:57:02 2013 (r246213) @@ -218,6 +218,7 @@ nfsm_mbufuio(struct nfsrv_descript *nd, } mbufcp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); + KASSERT(len > 0, ("len %d", len)); } xfer = (left > len) ? len : left; #ifdef notdef From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 16:59:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 83219AAD; Fri, 1 Feb 2013 16:59:00 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 670C81CF; Fri, 1 Feb 2013 16:59:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11Gx0Dt089424; Fri, 1 Feb 2013 16:59:00 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11Gx07G089423; Fri, 1 Feb 2013 16:59:00 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201302011659.r11Gx07G089423@svn.freebsd.org> From: Neel Natu Date: Fri, 1 Feb 2013 16:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246214 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 16:59:00 -0000 Author: neel Date: Fri Feb 1 16:58:59 2013 New Revision: 246214 URL: http://svnweb.freebsd.org/changeset/base/246214 Log: Add support for MSI-X interrupts in the virtio block device and make that the default. The current behavior of advertising a single MSI vector can be requested by setting the environment variable "BHYVE_USE_MSI" to "yes". The use of MSI is not compliant with the virtio specification and will be eventually phased out. Submitted by: Gopakumar T Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Fri Feb 1 16:57:02 2013 (r246213) +++ head/usr.sbin/bhyve/pci_virtio_block.c Fri Feb 1 16:58:59 2013 (r246214) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #define VTBLK_CFGSZ 28 -#define VTBLK_R_CFG VTCFG_R_CFG0 +#define VTBLK_R_CFG VTCFG_R_CFG1 #define VTBLK_R_CFG_END VTBLK_R_CFG + VTBLK_CFGSZ -1 #define VTBLK_R_MAX VTBLK_R_CFG_END @@ -73,6 +73,8 @@ __FBSDID("$FreeBSD$"); ( 0x00000004 | /* host maximum request segments */ \ 0x10000000 ) /* supports indirect descriptors */ +static int use_msix = 1; + struct vring_hqueue { /* Internal state */ uint16_t hq_size; @@ -135,8 +137,25 @@ struct pci_vtblk_softc { uint64_t vbsc_pfn; struct vring_hqueue vbsc_q; struct vtblk_config vbsc_cfg; + uint16_t msix_table_idx_req; + uint16_t msix_table_idx_cfg; }; +/* + * Return the size of IO BAR that maps virtio header and device specific + * region. The size would vary depending on whether MSI-X is enabled or + * not + */ +static uint64_t +pci_vtblk_iosize(struct pci_devinst *pi) +{ + + if (pci_msix_enabled(pi)) + return (VTBLK_REGSZ); + else + return (VTBLK_REGSZ - (VTCFG_R_CFG1 - VTCFG_R_MSIX)); +} + /* * Return the number of available descriptors in the vring taking care * of the 16-bit index wraparound. @@ -290,10 +309,13 @@ pci_vtblk_qnotify(struct pci_vtblk_softc /* * Generate an interrupt if able */ - if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0 && - sc->vbsc_isr == 0) { - sc->vbsc_isr = 1; - pci_generate_msi(sc->vbsc_pi, 0); + if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) { + if (use_msix) { + pci_generate_msix(sc->vbsc_pi, sc->msix_table_idx_req); + } else if (sc->vbsc_isr == 0) { + sc->vbsc_isr = 1; + pci_generate_msi(sc->vbsc_pi, 0); + } } } @@ -335,6 +357,7 @@ pci_vtblk_init(struct vmctx *ctx, struct off_t size; int fd; int sectsz; + const char *env_msi; if (opts == NULL) { printf("virtio-block: backing device required\n"); @@ -401,26 +424,68 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR); pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_STORAGE); pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_BLOCK); - pci_emul_add_msicap(pi, 1); + + if ((env_msi = getenv("BHYVE_USE_MSI"))) { + if (strcasecmp(env_msi, "yes") == 0) + use_msix = 0; + } + + if (use_msix) { + /* MSI-X Support */ + sc->msix_table_idx_req = VIRTIO_MSI_NO_VECTOR; + sc->msix_table_idx_cfg = VIRTIO_MSI_NO_VECTOR; + + if (pci_emul_add_msixcap(pi, 2, 1)) + return (1); + } else { + /* MSI Support */ + pci_emul_add_msicap(pi, 1); + } + pci_emul_alloc_bar(pi, 0, PCIBAR_IO, VTBLK_REGSZ); return (0); } +static uint64_t +vtblk_adjust_offset(struct pci_devinst *pi, uint64_t offset) +{ + /* + * Device specific offsets used by guest would change + * based on whether MSI-X capability is enabled or not + */ + if (!pci_msix_enabled(pi)) { + if (offset >= VTCFG_R_MSIX) + return (offset + (VTCFG_R_CFG1 - VTCFG_R_MSIX)); + } + + return (offset); +} + static void pci_vtblk_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx, uint64_t offset, int size, uint64_t value) { struct pci_vtblk_softc *sc = pi->pi_arg; + if (use_msix) { + if (baridx == pci_msix_table_bar(pi) || + baridx == pci_msix_pba_bar(pi)) { + pci_emul_msix_twrite(pi, offset, size, value); + return; + } + } + assert(baridx == 0); - if (offset + size > VTBLK_REGSZ) { + if (offset + size > pci_vtblk_iosize(pi)) { DPRINTF(("vtblk_write: 2big, offset %ld size %d\n", offset, size)); return; } + offset = vtblk_adjust_offset(pi, offset); + switch (offset) { case VTCFG_R_GUESTCAP: assert(size == 4); @@ -443,6 +508,14 @@ pci_vtblk_write(struct vmctx *ctx, int v assert(size == 1); pci_vtblk_update_status(sc, value); break; + case VTCFG_R_CFGVEC: + assert(size == 2); + sc->msix_table_idx_cfg = value; + break; + case VTCFG_R_QVEC: + assert(size == 2); + sc->msix_table_idx_req = value; + break; case VTCFG_R_HOSTCAP: case VTCFG_R_QNUM: case VTCFG_R_ISR: @@ -464,14 +537,23 @@ pci_vtblk_read(struct vmctx *ctx, int vc void *ptr; uint32_t value; + if (use_msix) { + if (baridx == pci_msix_table_bar(pi) || + baridx == pci_msix_pba_bar(pi)) { + return (pci_emul_msix_tread(pi, offset, size)); + } + } + assert(baridx == 0); - if (offset + size > VTBLK_REGSZ) { + if (offset + size > pci_vtblk_iosize(pi)) { DPRINTF(("vtblk_read: 2big, offset %ld size %d\n", offset, size)); return (0); } + offset = vtblk_adjust_offset(pi, offset); + switch (offset) { case VTCFG_R_HOSTCAP: assert(size == 4); @@ -505,6 +587,14 @@ pci_vtblk_read(struct vmctx *ctx, int vc value = sc->vbsc_isr; sc->vbsc_isr = 0; /* a read clears this flag */ break; + case VTCFG_R_CFGVEC: + assert(size == 2); + value = sc->msix_table_idx_cfg; + break; + case VTCFG_R_QVEC: + assert(size == 2); + value = sc->msix_table_idx_req; + break; case VTBLK_R_CFG ... VTBLK_R_CFG_END: assert(size + offset <= (VTBLK_R_CFG_END + 1)); ptr = (uint8_t *)&sc->vbsc_cfg + offset - VTBLK_R_CFG; From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 17:52:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 08C4181F; Fri, 1 Feb 2013 17:52:14 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by mx1.freebsd.org (Postfix) with ESMTP id C4EC13FD; Fri, 1 Feb 2013 17:52:13 +0000 (UTC) Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id F145A500123; Fri, 1 Feb 2013 11:52:12 -0600 (CST) Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id F01BB50011D; Fri, 1 Feb 2013 11:52:12 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel Received: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id ztzTpOBD-ig8; Fri, 1 Feb 2013 11:52:12 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh2.mail.rice.edu (Postfix) with ESMTPSA id 6DE8A500100; Fri, 1 Feb 2013 11:52:12 -0600 (CST) Message-ID: <510C00CB.8000409@rice.edu> Date: Fri, 01 Feb 2013 11:52:11 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130127 Thunderbird/17.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r246204 - head/sys/arm/include References: <201302011026.r11AQVL9068427@svn.freebsd.org> In-Reply-To: <201302011026.r11AQVL9068427@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 17:52:14 -0000 On 02/01/2013 04:26, Andre Oppermann wrote: > Author: andre > Date: Fri Feb 1 10:26:31 2013 > New Revision: 246204 > URL: http://svnweb.freebsd.org/changeset/base/246204 > > Log: > Add VM_KMEM_SIZE_SCALE parameter set to 2 (50%) for all ARM platforms. > > VM_KMEM_SIZE_SCALE specifies which fraction of the available physical > memory, after deduction of the kernel itself and other early statically > allocated memory, can be used for the kmem_map. The kmem_map provides > for all UMA/malloc allocations in KVM space. > Not always. Off the top of my head, two things immediately come to mind: 9KB and 16KB jumbo frames come from the kernel map, because we allocate physically contiguous memory for them, and some swap metadata also comes from the kernel map. Yes, all "ordinary" heap allocations come from the kmem map, but a number of things that are special for one reason or another don't. > Previously ARM was using a fixed kmem_map size of (12*1024*1024) = 12MB > without regard to effectively available memory. This is too small for > recent ARM SoC with more than 128MB of RAM. > > For reference a description of others related kmem_map parameters: > > VM_KMEM_SIZE default start size of kmem_map if SCALE is > not defined > VM_KMEM_SIZE_MIN hard floor on the kmem_map size > VM_KMEM_SIZE_MAX hard ceiling on the kmem_map size > VM_KMEM_SIZE_SCALE fraction of the available real memory to > be used for the kmem_map, limited by the > MIN and MAX parameters. > > Tested by: ian > MFC after: 1 week > > Modified: > head/sys/arm/include/vmparam.h > > Modified: head/sys/arm/include/vmparam.h > ============================================================================== > --- head/sys/arm/include/vmparam.h Fri Feb 1 10:00:21 2013 (r246203) > +++ head/sys/arm/include/vmparam.h Fri Feb 1 10:26:31 2013 (r246204) > @@ -134,12 +134,15 @@ > #endif > > #define VM_MAX_KERNEL_ADDRESS 0xffffffff > + > /* > * Virtual size (bytes) for various kernel submaps. > */ > - > #ifndef VM_KMEM_SIZE > -#define VM_KMEM_SIZE (12*1024*1024) > +#define VM_KMEM_SIZE (12*1024*1024) > +#endif > +#ifndef VM_KMEM_SIZE_SCALE > +#define VM_KMEM_SIZE_SCALE (2) > #endif > > #define MAXTSIZ (16*1024*1024) > From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 17:58:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7BCF4BBC; Fri, 1 Feb 2013 17:58:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64452683; Fri, 1 Feb 2013 17:58:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11HwcZA007499; Fri, 1 Feb 2013 17:58:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11HwcmY007498; Fri, 1 Feb 2013 17:58:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302011758.r11HwcmY007498@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Feb 2013 17:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246215 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 17:58:38 -0000 Author: kib Date: Fri Feb 1 17:58:37 2013 New Revision: 246215 URL: http://svnweb.freebsd.org/changeset/base/246215 Log: Fix a backwards comment in markvoldirty(). Submitted by: bde MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_fat.c Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 1 16:58:59 2013 (r246214) +++ head/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 1 17:58:37 2013 (r246215) @@ -1114,7 +1114,7 @@ extendfile(dep, count, bpp, ncp, flags) * Routine to mark a FAT16 or FAT32 volume as "clean" or "dirty" by * manipulating the upper bit of the FAT entry for cluster 1. Note that * this bit is not defined for FAT12 volumes, which are always assumed to - * be dirty. + * be clean. * * The fatentry() routine only works on cluster numbers that a file could * occupy, so it won't manipulate the entry for cluster 1. So we have to do From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 18:01:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 57614D81; Fri, 1 Feb 2013 18:01:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49E646A6; Fri, 1 Feb 2013 18:01:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11I144r009559; Fri, 1 Feb 2013 18:01:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11I14Tq009558; Fri, 1 Feb 2013 18:01:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302011801.r11I14Tq009558@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Feb 2013 18:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246216 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 18:01:04 -0000 Author: kib Date: Fri Feb 1 18:01:03 2013 New Revision: 246216 URL: http://svnweb.freebsd.org/changeset/base/246216 Log: The mountmsdosfs() function had an insane sanity test, remove it. Trying FAT32 on a small partition failed to mount because pmp->pm_Sectors was nonzero. Normally, FAT32 file systems are so large that the 16-bit pm_Sectors can't hold the size. This is indicated by setting it to 0 and using only pm_HugeSectors. But at least old versions of newfs_msdos use the 16-bit field if possible, and msdosfs supports this except for breaking its own support in the sanity check. This is quite different from the handling of pm_FATsecs -- now the 16-bit value is always ignored for FAT32 except for checking that it is 0, and newfs_msdos doesn't use the 16-bit value for FAT32. Submitted by: bde MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 1 17:58:37 2013 (r246215) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 1 18:01:03 2013 (r246216) @@ -553,8 +553,7 @@ mountmsdosfs(struct vnode *devvp, struct } if (pmp->pm_RootDirEnts == 0) { - if (pmp->pm_Sectors - || pmp->pm_FATsecs + if (pmp->pm_FATsecs || getushort(b710->bpbFSVers)) { error = EINVAL; #ifdef MSDOSFS_DEBUG From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 18:06:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2ECC5FEB; Fri, 1 Feb 2013 18:06:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 02C8D6F4; Fri, 1 Feb 2013 18:06:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11I660k010437; Fri, 1 Feb 2013 18:06:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11I66aP010436; Fri, 1 Feb 2013 18:06:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302011806.r11I66aP010436@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Feb 2013 18:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246217 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 18:06:07 -0000 Author: kib Date: Fri Feb 1 18:06:06 2013 New Revision: 246217 URL: http://svnweb.freebsd.org/changeset/base/246217 Log: The directory entry for dotdot was corrupted in the FAT32 case when moving a directory to a subdir of the root directory from somewhere else. For all directory moves that change the parent directory, the dotdot entry must be fixed up. For msdosfs, the root directory is magic for non-FAT32. It is less magic for FAT32, but needs the same magic for the dotdot fixup. It didn't have it. Both chkdsk and fsck_msdosfs fix the corrupt directory entries with no problems. The fix is to use the same magic for dotdot in msdosfs_rename() as in msdosfs_mkdir(). For msdosfs_mkdir(), document the magic. When writing the dotdot entry in mkdir, use explicitly set pcl variable instead on relying on the start cluster of the root directory typically has a value < 65536. Submitted by: bde MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Fri Feb 1 18:01:03 2013 (r246216) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Fri Feb 1 18:06:06 2013 (r246217) @@ -973,7 +973,7 @@ msdosfs_rename(ap) u_char to_count; int doingdirectory = 0, newparent = 0; int error; - u_long cn; + u_long cn, pcl; daddr_t bn; struct denode *fddep; /* from file's parent directory */ struct msdosfsmount *pmp; @@ -1246,9 +1246,12 @@ abortit: goto bad; } dotdotp = (struct direntry *)bp->b_data + 1; - putushort(dotdotp->deStartCluster, dp->de_StartCluster); + pcl = dp->de_StartCluster; + if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) + pcl = MSDOSFSROOT; + putushort(dotdotp->deStartCluster, pcl); if (FAT32(pmp)) - putushort(dotdotp->deHighClust, dp->de_StartCluster >> 16); + putushort(dotdotp->deHighClust, pcl >> 16); if (DOINGASYNC(fvp)) bdwrite(bp); else if ((error = bwrite(bp)) != 0) { @@ -1369,8 +1372,13 @@ msdosfs_mkdir(ap) putushort(denp[0].deMDate, ndirent.de_MDate); putushort(denp[0].deMTime, ndirent.de_MTime); pcl = pdep->de_StartCluster; + /* + * Although the root directory has a non-magic starting cluster + * number for FAT32, chkdsk and fsck_msdosfs still require + * references to it in dotdot entries to be magic. + */ if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) - pcl = 0; + pcl = MSDOSFSROOT; putushort(denp[1].deStartCluster, pcl); putushort(denp[1].deCDate, ndirent.de_CDate); putushort(denp[1].deCTime, ndirent.de_CTime); @@ -1380,7 +1388,7 @@ msdosfs_mkdir(ap) putushort(denp[1].deMTime, ndirent.de_MTime); if (FAT32(pmp)) { putushort(denp[0].deHighClust, newcluster >> 16); - putushort(denp[1].deHighClust, pdep->de_StartCluster >> 16); + putushort(denp[1].deHighClust, pcl >> 16); } if (DOINGASYNC(ap->a_dvp)) From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 18:25:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC2F5526; Fri, 1 Feb 2013 18:25:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BE9547D1; Fri, 1 Feb 2013 18:25:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11IPrX8016554; Fri, 1 Feb 2013 18:25:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11IPrAX016553; Fri, 1 Feb 2013 18:25:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302011825.r11IPrAX016553@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Feb 2013 18:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246218 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 18:25:53 -0000 Author: kib Date: Fri Feb 1 18:25:53 2013 New Revision: 246218 URL: http://svnweb.freebsd.org/changeset/base/246218 Log: Backup FATs were sometimes marked dirty by copying their first block from the primary FAT, and then they were not marked clean on unmount. Force marking them clean when appropriate. Submitted by: bde MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_fat.c Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 1 18:06:06 2013 (r246217) +++ head/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 1 18:25:53 2013 (r246218) @@ -321,8 +321,8 @@ updatefats(pmp, bp, fatbn) struct buf *bp; u_long fatbn; { - int i; struct buf *bpn; + int cleanfat, i; #ifdef MSDOSFS_DEBUG printf("updatefats(pmp %p, bp %p, fatbn %lu)\n", pmp, bp, fatbn); @@ -362,12 +362,23 @@ updatefats(pmp, bp, fatbn) * filesystem was mounted. If synch is asked for then use * bwrite()'s and really slow things down. */ + if (fatbn != pmp->pm_fatblk || FAT12(pmp)) + cleanfat = 0; + else if (FAT16(pmp)) + cleanfat = 16; + else + cleanfat = 32; for (i = 1; i < pmp->pm_FATs; i++) { fatbn += pmp->pm_FATsecs; /* getblk() never fails */ bpn = getblk(pmp->pm_devvp, fatbn, bp->b_bcount, 0, 0, 0); bcopy(bp->b_data, bpn->b_data, bp->b_bcount); + /* Force the clean bit on in the other copies. */ + if (cleanfat == 16) + ((u_int8_t *)bpn->b_data)[3] |= 0x80; + else if (cleanfat == 32) + ((u_int8_t *)bpn->b_data)[7] |= 0x08; if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) bwrite(bpn); else From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 18:30:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 63F8D818; Fri, 1 Feb 2013 18:30:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52835817; Fri, 1 Feb 2013 18:30:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11IUgZW018637; Fri, 1 Feb 2013 18:30:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11IUgEJ018636; Fri, 1 Feb 2013 18:30:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302011830.r11IUgEJ018636@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Feb 2013 18:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246219 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 18:30:42 -0000 Author: kib Date: Fri Feb 1 18:30:41 2013 New Revision: 246219 URL: http://svnweb.freebsd.org/changeset/base/246219 Log: The MSDOSFSMNT_WAITONFAT flag is bogus and broken. It does less than track the MNT_SYNCHRONOUS flag. It is set to the latter at mount time but not updated by MNT_UPDATE. Use MNT_SYNCHRONOUS to decide to write the FAT updates syncrhonously. Submitted by: bde MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_fat.c Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 1 18:25:53 2013 (r246218) +++ head/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 1 18:30:41 2013 (r246219) @@ -379,7 +379,7 @@ updatefats(pmp, bp, fatbn) ((u_int8_t *)bpn->b_data)[3] |= 0x80; else if (cleanfat == 32) ((u_int8_t *)bpn->b_data)[7] |= 0x08; - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) + if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS) bwrite(bpn); else bdwrite(bpn); @@ -389,7 +389,7 @@ updatefats(pmp, bp, fatbn) /* * Write out the first (or current) fat last. */ - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) + if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS) bwrite(bp); else bdwrite(bp); From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 18:56:31 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 914A0E77; Fri, 1 Feb 2013 18:56:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by mx1.freebsd.org (Postfix) with ESMTP id 1A18F945; Fri, 1 Feb 2013 18:56:30 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r11IuLp7010312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 2 Feb 2013 05:56:23 +1100 Date: Sat, 2 Feb 2013 05:56:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r246217 - head/sys/fs/msdosfs In-Reply-To: <201302011806.r11I66aP010436@svn.freebsd.org> Message-ID: <20130202055559.W3890@besplex.bde.org> References: <201302011806.r11I66aP010436@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=evCHVfVX c=1 sm=1 a=aMzxrNFpgZ0A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=AH4PAgtxFLYA:10 a=mUdXZ0t08xOriRn7bX4A:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 18:56:31 -0000 On Fri, 1 Feb 2013, Konstantin Belousov wrote: > Log: > The directory entry for dotdot was corrupted in the FAT32 case when moving > a directory to a subdir of the root directory from somewhere else. > > For all directory moves that change the parent directory, the dotdot > entry must be fixed up. For msdosfs, the root directory is magic for > non-FAT32. It is less magic for FAT32, but needs the same magic for > the dotdot fixup. It didn't have it. > > Both chkdsk and fsck_msdosfs fix the corrupt directory entries with no > problems. > > The fix is to use the same magic for dotdot in msdosfs_rename() as in > msdosfs_mkdir(). > > For msdosfs_mkdir(), document the magic. When writing the dotdot entry > in mkdir, use explicitly set pcl variable instead on relying on the > start cluster of the root directory typically has a value < 65536. > > Submitted by: bde > MFC after: 1 week Thanks. That was fast. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 19:24:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C33BC671; Fri, 1 Feb 2013 19:24:16 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AB04CA67; Fri, 1 Feb 2013 19:24:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11JOGd0034392; Fri, 1 Feb 2013 19:24:16 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11JOGcW034391; Fri, 1 Feb 2013 19:24:16 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201302011924.r11JOGcW034391@svn.freebsd.org> From: Neel Natu Date: Fri, 1 Feb 2013 19:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246221 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 19:24:16 -0000 Author: neel Date: Fri Feb 1 19:24:16 2013 New Revision: 246221 URL: http://svnweb.freebsd.org/changeset/base/246221 Log: Display MSI-X table and PBA offsets when displaying information about MSI-X capability. Reviewed by: jhb, jimharris (initial version) Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Fri Feb 1 18:59:14 2013 (r246220) +++ head/usr.sbin/pciconf/cap.c Fri Feb 1 19:24:16 2013 (r246221) @@ -449,24 +449,28 @@ cap_express(int fd, struct pci_conf *p, static void cap_msix(int fd, struct pci_conf *p, uint8_t ptr) { - uint32_t val; + uint32_t pba_offset, table_offset, val; + int msgnum, pba_bar, table_bar; uint16_t ctrl; - int msgnum, table_bar, pba_bar; ctrl = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_CTRL, 2); msgnum = (ctrl & PCIM_MSIXCTRL_TABLE_SIZE) + 1; + val = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_TABLE, 4); table_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK); + table_offset = val & ~PCIM_MSIX_BIR_MASK; + val = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_PBA, 4); - pba_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK); - printf("MSI-X supports %d message%s ", msgnum, - (msgnum == 1) ? "" : "s"); - if (table_bar == pba_bar) - printf("in map 0x%x", table_bar); - else - printf("in maps 0x%x and 0x%x", table_bar, pba_bar); - if (ctrl & PCIM_MSIXCTRL_MSIX_ENABLE) - printf(" enabled"); + pba_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK); + pba_offset = val & ~PCIM_MSIX_BIR_MASK; + + printf("MSI-X supports %d message%s%s\n", msgnum, + (msgnum == 1) ? "" : "s", + (ctrl & PCIM_MSIXCTRL_MSIX_ENABLE) ? ", enabled" : ""); + + printf(" "); + printf("Table in map 0x%x[0x%x], PBA in map 0x%x[0x%x]", + table_bar, table_offset, pba_bar, pba_offset); } static void From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 19:58:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C75D1E95 for ; Fri, 1 Feb 2013 19:58:57 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 3DB73C23 for ; Fri, 1 Feb 2013 19:58:56 +0000 (UTC) Received: (qmail 45507 invoked from network); 1 Feb 2013 21:18:32 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 1 Feb 2013 21:18:32 -0000 Message-ID: <510C1E7A.2090509@freebsd.org> Date: Fri, 01 Feb 2013 20:58:50 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r246204 - head/sys/arm/include References: <201302011026.r11AQVL9068427@svn.freebsd.org> <510C00CB.8000409@rice.edu> In-Reply-To: <510C00CB.8000409@rice.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 19:58:57 -0000 On 01.02.2013 18:52, Alan Cox wrote: > On 02/01/2013 04:26, Andre Oppermann wrote: >> Author: andre >> Date: Fri Feb 1 10:26:31 2013 >> New Revision: 246204 >> URL: http://svnweb.freebsd.org/changeset/base/246204 >> >> Log: >> Add VM_KMEM_SIZE_SCALE parameter set to 2 (50%) for all ARM platforms. >> >> VM_KMEM_SIZE_SCALE specifies which fraction of the available physical >> memory, after deduction of the kernel itself and other early statically >> allocated memory, can be used for the kmem_map. The kmem_map provides >> for all UMA/malloc allocations in KVM space. >> > > Not always. Off the top of my head, two things immediately come to > mind: 9KB and 16KB jumbo frames come from the kernel map, because we > allocate physically contiguous memory for them, and some swap metadata > also comes from the kernel map. I'd love to remove jumbo clusters that are larger than PAGE_SIZE. The hard need of s/g challenged network cards is gone. All contemporary networks can deliver a jumbo frame into a PAGE_SIZE'd mbuf cluster chains. Some can even split off the headers into a separate mbuf. A quick search for kernel_map allocations didn't show many other direct users of the kernel_map. The XEN net and blk backends do make use of it. Other users have their own submaps: exec_map, pipe_map, buffer_map and pager_map. > Yes, all "ordinary" heap allocations come from the kmem map, but a > number of things that are special for one reason or another don't. -- Andre From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 20:17:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A3428200; Fri, 1 Feb 2013 20:17:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 79405D2A; Fri, 1 Feb 2013 20:17:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11KHCxV049864; Fri, 1 Feb 2013 20:17:12 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11KHB2j049860; Fri, 1 Feb 2013 20:17:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302012017.r11KHB2j049860@svn.freebsd.org> From: Eitan Adler Date: Fri, 1 Feb 2013 20:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246222 - in head/sys: amd64/conf i386/conf pc98/conf sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 20:17:12 -0000 Author: eadler Date: Fri Feb 1 20:17:11 2013 New Revision: 246222 URL: http://svnweb.freebsd.org/changeset/base/246222 Log: Remove support for plip from the GENERIC kernel as no systems in the last 10 years require this support. Discussed with: db Discussed with: kib Reviewed by: imp Reviewed by: jhb Reviewed by: -hackers Approved by: cperciva (mentor) Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Feb 1 19:24:16 2013 (r246221) +++ head/sys/amd64/conf/GENERIC Fri Feb 1 20:17:11 2013 (r246222) @@ -197,7 +197,6 @@ device uart # Generic UART driver device ppc device ppbus # Parallel port bus (required) device lpt # Printer -device plip # TCP/IP over parallel device ppi # Parallel port interface device #device vpo # Requires scbus and da Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Feb 1 19:24:16 2013 (r246221) +++ head/sys/i386/conf/GENERIC Fri Feb 1 20:17:11 2013 (r246222) @@ -208,7 +208,6 @@ device uart # Generic UART driver device ppc device ppbus # Parallel port bus (required) device lpt # Printer -device plip # TCP/IP over parallel device ppi # Parallel port interface device #device vpo # Requires scbus and da Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Fri Feb 1 19:24:16 2013 (r246221) +++ head/sys/pc98/conf/GENERIC Fri Feb 1 20:17:11 2013 (r246222) @@ -151,7 +151,6 @@ device mse device ppc device ppbus # Parallel port bus (required) device lpt # Printer -device plip # TCP/IP over parallel device ppi # Parallel port interface device #device vpo # Requires scbus and da # OLD Parallel port Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Feb 1 19:24:16 2013 (r246221) +++ head/sys/sparc64/conf/GENERIC Fri Feb 1 20:17:11 2013 (r246222) @@ -161,7 +161,6 @@ device uart # Multi-uart driver #device ppc #device ppbus # Parallel port bus (required) #device lpt # Printer -#device plip # TCP/IP over parallel #device ppi # Parallel port interface device #device vpo # Requires scbus and da From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 20:23:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2BEA63E7; Fri, 1 Feb 2013 20:23:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by mx1.freebsd.org (Postfix) with ESMTP id 40DD7D61; Fri, 1 Feb 2013 20:23:08 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id dr13so3260249wgb.14 for ; Fri, 01 Feb 2013 12:23:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=WUpgSZSgXytgjBJQFrCUng18biYqWDiZcLyn956XsEI=; b=HBG+2n8PDf21q1DgcnK7yBqQP9LmdBQQkuf31jqMH+aRbEWXkVvZfKkYRhLGYbzjO3 LsaGQAijtMERDC+uTpBNGZhSjNvHABum+5kOpNh8jVjfngEQRv3f19L9XQQRczpIz/AX 2wi0ZMI18lBobyismdcN6X1z8KaITDhrLyiMZqOWodfEJpj1qZ/bEFP947ReIHNTzznu um8ga6z6+59l3/Om7y9Jt5HoNnpK4GF8YWUAwWHiw3n8tW7QF3gSGt6yPRKYUPDCADrS 7rmSlx3oriq4O+VhbJULoQ/6HHlL58mxWmTtOzBtaQYrT/84dYqKdZvqpDayOEBjRBNZ uDxQ== MIME-Version: 1.0 X-Received: by 10.180.101.98 with SMTP id ff2mr119275wib.0.1359750181521; Fri, 01 Feb 2013 12:23:01 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.98.5 with HTTP; Fri, 1 Feb 2013 12:23:01 -0800 (PST) In-Reply-To: <510C1E7A.2090509@freebsd.org> References: <201302011026.r11AQVL9068427@svn.freebsd.org> <510C00CB.8000409@rice.edu> <510C1E7A.2090509@freebsd.org> Date: Fri, 1 Feb 2013 12:23:01 -0800 X-Google-Sender-Auth: Lpx_1a9agxs5Awozz8sx06ddzt8 Message-ID: Subject: Re: svn commit: r246204 - head/sys/arm/include From: Adrian Chadd To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alan Cox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 20:23:10 -0000 .. before you make that assumption, please re-visit some the .. lower-end integrated ethernet MACs in embedded chips. I don't know whether the Atheros stuff does (I think it does, but I don't know under what conditions it's possible.) Maybe have it by default not return jumbo mbufs, and if a driver wants jumbo mbufs it can explicitly ask for them. Adrian From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 21:01:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 11811C00 for ; Fri, 1 Feb 2013 21:01:33 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 7297FEB4 for ; Fri, 1 Feb 2013 21:01:32 +0000 (UTC) Received: (qmail 45708 invoked from network); 1 Feb 2013 22:21:07 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 1 Feb 2013 22:21:07 -0000 Message-ID: <510C2D24.60303@freebsd.org> Date: Fri, 01 Feb 2013 22:01:24 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r246204 - head/sys/arm/include References: <201302011026.r11AQVL9068427@svn.freebsd.org> <510C00CB.8000409@rice.edu> <510C1E7A.2090509@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, Alan Cox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 21:01:33 -0000 On 01.02.2013 21:23, Adrian Chadd wrote: > .. before you make that assumption, please re-visit some the .. > lower-end integrated ethernet MACs in embedded chips. > > I don't know whether the Atheros stuff does (I think it does, but I > don't know under what conditions it's possible.) > > Maybe have it by default not return jumbo mbufs, and if a driver wants > jumbo mbufs it can explicitly ask for them. Jumbo frames do not see wide-spread use. If they are used, then in data centre LAN environments and possibly also inter-datacenter. That is high performance environments. I seriously doubt that lower-end ethernet MACs you're referring to fit that bill. -- Andre From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 21:16:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5EC40EAB for ; Fri, 1 Feb 2013 21:16:59 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by mx1.freebsd.org (Postfix) with ESMTP id D7FF3F2A for ; Fri, 1 Feb 2013 21:16:58 +0000 (UTC) Received: by mail-lb0-f181.google.com with SMTP id gm6so4883328lbb.26 for ; Fri, 01 Feb 2013 13:16:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=X7pXsSJcibOao3bDHR/usd6LUVwttPHjC56c9/DFsW4=; b=Gnu0JnHBCsaqYRLQDq8K0hycOlvxzEWTJIFEJQ4qGp9q+GmDJv2F/G7v0J6qG6kft0 wj9Tir5oQrfgk59xKMYQG3qfDTJRIhQrMSc8eT/IW+dMtf4BJ3aQhEuVZ4vFKAnySFd5 /BrED6S23cpxc3Ky6Jp4y9t8mZid/BENO1L44BNr87z40YfmStj85/rgQy7qfNEZ+Zh7 eLxwCXkcxuotX+PJ6/fIWb0nVtQuRHc0SGsbmB1FKSuTPIbNxq7KkKgnof7oebPpk8Br HcJAc4TMACNxaORT4JWqYle4Yrxp4tLkp8QRyy5gb8bQKXf31G48Xu2yttUNAov316MR i/Sw== X-Received: by 10.112.98.71 with SMTP id eg7mr5265035lbb.133.1359753411938; Fri, 01 Feb 2013 13:16:51 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.111.39 with HTTP; Fri, 1 Feb 2013 13:16:31 -0800 (PST) In-Reply-To: <510C2D24.60303@freebsd.org> References: <201302011026.r11AQVL9068427@svn.freebsd.org> <510C00CB.8000409@rice.edu> <510C1E7A.2090509@freebsd.org> <510C2D24.60303@freebsd.org> From: Juli Mallett Date: Fri, 1 Feb 2013 13:16:31 -0800 X-Google-Sender-Auth: toha6PV54ykkDEZYwe9GfBZaMKU Message-ID: Subject: Re: svn commit: r246204 - head/sys/arm/include To: Andre Oppermann Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnyDIAEAvoprUei2nAG8pcatvp+C1EMV6qp93c7lFqfvv9y/q9oL8ZqppzOAKh9U+xuFNTH Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, Alan Cox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 21:16:59 -0000 On Fri, Feb 1, 2013 at 1:01 PM, Andre Oppermann wrote: > On 01.02.2013 21:23, Adrian Chadd wrote: >> >> .. before you make that assumption, please re-visit some the .. >> lower-end integrated ethernet MACs in embedded chips. >> >> I don't know whether the Atheros stuff does (I think it does, but I >> don't know under what conditions it's possible.) >> >> Maybe have it by default not return jumbo mbufs, and if a driver wants >> jumbo mbufs it can explicitly ask for them. > > > Jumbo frames do not see wide-spread use. If they are used, then > in data centre LAN environments and possibly also inter-datacenter. > That is high performance environments. > > I seriously doubt that lower-end ethernet MACs you're referring to > fit that bill. These are silly generalizations, Andre. I know of low-end systems in jumbo frame environments. I think Adrian's implication that Atheros hardware can't handle doing scatter-gather into multiple buffers for jumbo frames is probably an unlikely one, but if we have hardware that requires jumbo mbufs, we should obviously keep supporting jumbo mbufs to some extent. Hypotheticals are somewhat irrelevant, but I find it surprising that you're being so glib about breaking FreeBSD networking just because of an idea you have about where jumbo frame use is appropriate and what kinds of hardware should be connected to jumbo frame networks. From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 21:57:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C96DA8BF for ; Fri, 1 Feb 2013 21:57:16 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 25878E5 for ; Fri, 1 Feb 2013 21:57:15 +0000 (UTC) Received: (qmail 46866 invoked from network); 1 Feb 2013 23:16:50 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 1 Feb 2013 23:16:50 -0000 Message-ID: <510C3A34.3040702@freebsd.org> Date: Fri, 01 Feb 2013 22:57:08 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Juli Mallett Subject: Re: svn commit: r246204 - head/sys/arm/include References: <201302011026.r11AQVL9068427@svn.freebsd.org> <510C00CB.8000409@rice.edu> <510C1E7A.2090509@freebsd.org> <510C2D24.60303@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, Alan Cox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 21:57:16 -0000 On 01.02.2013 22:16, Juli Mallett wrote: > On Fri, Feb 1, 2013 at 1:01 PM, Andre Oppermann wrote: >> On 01.02.2013 21:23, Adrian Chadd wrote: >>> >>> .. before you make that assumption, please re-visit some the .. >>> lower-end integrated ethernet MACs in embedded chips. >>> >>> I don't know whether the Atheros stuff does (I think it does, but I >>> don't know under what conditions it's possible.) >>> >>> Maybe have it by default not return jumbo mbufs, and if a driver wants >>> jumbo mbufs it can explicitly ask for them. >> >> >> Jumbo frames do not see wide-spread use. If they are used, then >> in data centre LAN environments and possibly also inter-datacenter. >> That is high performance environments. >> >> I seriously doubt that lower-end ethernet MACs you're referring to >> fit that bill. > > These are silly generalizations, Andre. I know of low-end systems in > jumbo frame environments. I think Adrian's implication that Atheros > hardware can't handle doing scatter-gather into multiple buffers for > jumbo frames is probably an unlikely one, but if we have hardware that > requires jumbo mbufs, we should obviously keep supporting jumbo mbufs > to some extent. My generalizations are about as silly as Adrian's handwaving. ;) The reason jumbo mbufs (> PAGE_SIZE) ever came into existence was for non-s/g DMA network cards, the Tigeon(II) in particular IIRC. Jumbo mbufs are much more taxing on the on VM and the kernel_map because of the contigmalloc requirement. They should only be used when really necessary in the receive path and not as general purpose extra large mbufs. That's what we've got mbuf chains for. The send path from userspace uses PAGE_SIZE (jumbo) mbuf's whenever possible. The same is true for sendfile() because it wraps file object pages to mbufs. > Hypotheticals are somewhat irrelevant, but I find it surprising that > you're being so glib about breaking FreeBSD networking just because of > an idea you have about where jumbo frame use is appropriate and what > kinds of hardware should be connected to jumbo frame networks. First I said I'd love to remove it. Not that I'm doing now or soon. It's an opinion and expression of desire. Second very little would break because any contemporary network card (I have looked at so far) supports jumbo frame s/g into 2K or 4K mbufs on receive. Jumbo frames are only available with GigE and 10GigE. It was never supported on 100M. Any patch removing large jumbo support wouldn't go unnoticed. ;) -- Andre From owner-svn-src-all@FreeBSD.ORG Fri Feb 1 22:55:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9C4934A5; Fri, 1 Feb 2013 22:55:29 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7F3962BC; Fri, 1 Feb 2013 22:55:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11MtTTS097481; Fri, 1 Feb 2013 22:55:29 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11MtROt097467; Fri, 1 Feb 2013 22:55:27 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201302012255.r11MtROt097467@svn.freebsd.org> From: "Simon J. Gerraty" Date: Fri, 1 Feb 2013 22:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246223 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 22:55:29 -0000 Author: sjg Date: Fri Feb 1 22:55:27 2013 New Revision: 246223 URL: http://svnweb.freebsd.org/changeset/base/246223 Log: Merge bmake-20130123 Approved by: marcel (mentor) Added: head/contrib/bmake/Makefile - copied unchanged from r246222, vendor/NetBSD/bmake/dist/Makefile head/contrib/bmake/Makefile.config.in - copied unchanged from r246222, vendor/NetBSD/bmake/dist/Makefile.config.in head/contrib/bmake/makefile.in - copied unchanged from r246222, vendor/NetBSD/bmake/dist/makefile.in head/contrib/bmake/mk/ - copied from r246222, vendor/NetBSD/bmake/dist/mk/ Deleted: head/contrib/bmake/Makefile.in Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/FILES head/contrib/bmake/bmake.1 head/contrib/bmake/bmake.cat1 head/contrib/bmake/boot-strap head/contrib/bmake/bsd.after-import.mk head/contrib/bmake/compat.c head/contrib/bmake/configure head/contrib/bmake/configure.in head/contrib/bmake/job.c head/contrib/bmake/main.c head/contrib/bmake/make-bootstrap.sh.in head/contrib/bmake/make.1 head/contrib/bmake/meta.c head/contrib/bmake/realpath.c head/contrib/bmake/unit-tests/Makefile.in head/contrib/bmake/var.c head/usr.bin/bmake/Makefile head/usr.bin/bmake/config.h head/usr.bin/bmake/unit-tests/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Fri Feb 1 20:17:11 2013 (r246222) +++ head/contrib/bmake/ChangeLog Fri Feb 1 22:55:27 2013 (r246223) @@ -1,3 +1,35 @@ +2013-01-27 Simon J. Gerraty + + * Merge with NetBSD make, pick up + o make.1: more info on how shell commands are handled. + o job.c,main.c: detect write errors to job pipes. + +2013-01-25 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20130123 + Merge with NetBSD make, pick up + o meta.c: if script uses .OODATE and meta_oodate() decides + rebuild is needed, .OODATE will be empty - set it to .ALLSRC. + o var.c: in debug output indicate which variabale modifiers + apply to. + o remove Check_Cwd logic the makefiles have been fixed. + +2012-12-12 Simon J. Gerraty + + * makefile.in: add a simple makefile for folk who insist on + ./configure; make; make install + it just runs boot-strap + * include mk/* to accommodate the above + * boot-strap: re-work to accommodate the above + mksrc defaults to $Mydir/mk + allow op={configure,build,install,clean,all} + add options to facilitate install + * Makefile.config.in: just the bits set by configure + * Makefile: bump version to 20121212 + abandon Makefile.in (NetBSD Makefile) + leverage mk/* instead + * configure.in: ensure srcdir is absolute + 2012-11-11 Simon J. Gerraty * Makefile.in (MAKE_VERSION): 20121111 Modified: head/contrib/bmake/FILES ============================================================================== --- head/contrib/bmake/FILES Fri Feb 1 20:17:11 2013 (r246222) +++ head/contrib/bmake/FILES Fri Feb 1 22:55:27 2013 (r246223) @@ -4,7 +4,9 @@ bmake.cat1 boot-strap bsd.after-import.mk os.sh -Makefile.in +makefile.in +Makefile +Makefile.config.in PSD.doc/Makefile PSD.doc/tutorial.ms README @@ -120,3 +122,63 @@ unit-tests/test.exp unit-tests/unexport unit-tests/unexport-env unit-tests/varcmd +mk/ChangeLog +mk/FILES +mk/README +mk/auto.obj.mk +mk/autoconf.mk +mk/autodep.mk +mk/auto.dep.mk +mk/dep.mk +mk/doc.mk +mk/dpadd.mk +mk/final.mk +mk/host-target.mk +mk/host.libnames.mk +mk/inc.mk +mk/init.mk +mk/install-mk +mk/java.mk +mk/lib.mk +mk/libnames.mk +mk/libs.mk +mk/links.mk +mk/man.mk +mk/mk-files.txt +mk/nls.mk +mk/obj.mk +mk/options.mk +mk/own.mk +mk/prlist.mk +mk/prog.mk +mk/progs.mk +mk/rst2htm.mk +mk/scripts.mk +mk/srctop.mk +mk/subdir.mk +mk/sys.mk +mk/sys.clean-env.mk +mk/sys.dependfile.mk +mk/sys/AIX.mk +mk/sys/Darwin.mk +mk/sys/Generic.mk +mk/sys/HP-UX.mk +mk/sys/IRIX.mk +mk/sys/Linux.mk +mk/sys/NetBSD.mk +mk/sys/OSF1.mk +mk/sys/OpenBSD.mk +mk/sys/SunOS.mk +mk/sys/UnixWare.mk +mk/target-flags.mk +mk/warnings.mk +mk/yacc.mk +mk/dirdeps.mk +mk/gendirdeps.mk +mk/install-new.mk +mk/meta2deps.py +mk/meta2deps.sh +mk/meta.sys.mk +mk/meta.autodep.mk +mk/meta.stage.mk +mk/meta.subdir.mk Copied: head/contrib/bmake/Makefile (from r246222, vendor/NetBSD/bmake/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/bmake/Makefile Fri Feb 1 22:55:27 2013 (r246223, copy of r246222, vendor/NetBSD/bmake/dist/Makefile) @@ -0,0 +1,221 @@ +# $Id: Makefile,v 1.5 2013/01/28 19:31:58 sjg Exp $ + +# Base version on src date +MAKE_VERSION= 20130123 + +PROG= bmake + +SRCS= \ + arch.c \ + buf.c \ + compat.c \ + cond.c \ + dir.c \ + for.c \ + hash.c \ + job.c \ + main.c \ + make.c \ + make_malloc.c \ + meta.c \ + parse.c \ + str.c \ + strlist.c \ + suff.c \ + targ.c \ + trace.c \ + util.c \ + var.c + +# from lst.lib/ +SRCS+= \ + lstAppend.c \ + lstAtEnd.c \ + lstAtFront.c \ + lstClose.c \ + lstConcat.c \ + lstDatum.c \ + lstDeQueue.c \ + lstDestroy.c \ + lstDupl.c \ + lstEnQueue.c \ + lstFind.c \ + lstFindFrom.c \ + lstFirst.c \ + lstForEach.c \ + lstForEachFrom.c \ + lstInit.c \ + lstInsert.c \ + lstIsAtEnd.c \ + lstIsEmpty.c \ + lstLast.c \ + lstMember.c \ + lstNext.c \ + lstOpen.c \ + lstPrev.c \ + lstRemove.c \ + lstReplace.c \ + lstSucc.c + +# this file gets generated by configure +.-include "Makefile.config" + +.if !empty(LIBOBJS) +SRCS+= ${LIBOBJS:T:.o=.c} +.endif + +# just in case +prefix?= /usr +srcdir?= ${.CURDIR} + +DEFAULT_SYS_PATH?= .../share/mk:${prefix}/share/mk + +CPPFLAGS+= -DUSE_META +CFLAGS+= ${CPPFLAGS} +CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" +CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE +CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} +COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\"" + +# meta mode can be useful even without filemon +FILEMON_H ?= /usr/include/dev/filemon/filemon.h +.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" +COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} +.endif + +.PATH: ${srcdir} +.PATH: ${srcdir}/lst.lib + +.if make(obj) || make(clean) +SUBDIR+= unit-tests +.endif + +# start-delete1 for bsd.after-import.mk +# we skip a lot of this when building as part of FreeBSD etc. + +# list of OS's which are derrived from BSD4.4 +BSD44_LIST= NetBSD FreeBSD OpenBSD DragonFly +# we are... +OS!= uname -s +# are we 4.4BSD ? +isBSD44:=${BSD44_LIST:M${OS}} + +.if ${isBSD44} == "" +MANTARGET= cat +INSTALL?=${srcdir}/install-sh +.if (${MACHINE} == "sun386") +# even I don't have one of these anymore :-) +CFLAGS+= -DPORTAR +.elif (${MACHINE} != "sunos") +SRCS+= sigcompat.c +CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART +.endif +.else +MANTARGET?= man +.endif + +# turn this on by default - ignored if we are root +WITH_INSTALL_AS_USER= + +# supress with -DWITHOUT_* +OPTIONS_DEFAULT_YES+= \ + AUTOCONF_MK \ + INSTALL_MK \ + PROG_LINK + +OPTIONS_DEFAULT_NO+= \ + PROG_VERSION + +# process options now +.include + +.if ${MK_PROG_VERSION} == "yes" +PROG_NAME= ${PROG}-${MAKE_VERSION} +.if ${MK_PROG_LINK} == "yes" +SYMLINKS+= ${PROG}-${MAKE_VERSION} ${BINDIR}/${PROG} +.endif +.endif + +EXTRACT_MAN=no +# end-delete1 + +MAN= ${PROG}.1 +MAN1= ${MAN} + +.if (${PROG} != "make") +CLEANFILES+= my.history +.if make(${MAN}) || !exists(${srcdir}/${MAN}) +my.history: ${MAKEFILE} + @(echo ".Nm"; \ + echo "is derived from NetBSD"; \ + echo ".Xr make 1 ."; \ + echo "It uses autoconf to facilitate portability to other platforms."; \ + echo ".Pp") > $@ + +.NOPATH: ${MAN} +${MAN}: make.1 my.history + @echo making $@ + @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \ + -e '/^.Sh HISTORY/rmy.history' \ + -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@ + +all beforeinstall: ${MAN} +_mfromdir=. +.endif +.endif + +MANTARGET?= cat +MANDEST?= ${MANDIR}/${MANTARGET}1 + +.if ${MANTARGET} == "cat" +_mfromdir=${srcdir} +.endif + +.include + +CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H +COPTS.var.c += -Wno-cast-qual +COPTS.job.c += -Wno-format-nonliteral +COPTS.parse.c += -Wno-format-nonliteral +COPTS.var.c += -Wno-format-nonliteral + +# Force these +SHAREDIR= ${prefix}/share +BINDIR= ${prefix}/bin +MANDIR= ${SHAREDIR}/man + +.if !exists(.depend) +${OBJS}: config.h +.endif +.if ${MK_AUTOCONF_MK} == "yes" +.include +.endif + +# make sure that MAKE_VERSION gets updated. +main.o: ${SRCS} ${MAKEFILE} + +# start-delete2 for bsd.after-import.mk +SHARE_MK?=${SHAREDIR}/mk +MKSRC=${srcdir}/mk +INSTALL?=${srcdir}/install-sh + +.if ${MK_INSTALL_MK} == "yes" +install: install-mk +.endif + +beforeinstall: + test -d ${DESTDIR}${BINDIR} || ${INSTALL} -m 775 -d ${DESTDIR}${BINDIR} + test -d ${DESTDIR}${MANDEST} || ${INSTALL} -m 775 -d ${DESTDIR}${MANDEST} + +install-mk: +.if exists(${MKSRC}/install-mk) + test -d ${DESTDIR}${SHARE_MK} || ${INSTALL} -m 775 -d ${DESTDIR}${SHARE_MK} + sh ${MKSRC}/install-mk -v -m 644 ${DESTDIR}${SHARE_MK} +.else + @echo need to unpack mk.tar.gz under ${srcdir} or set MKSRC; false +.endif +# end-delete2 + +# A simple unit-test driver to help catch regressions +accept test: + cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET} Copied: head/contrib/bmake/Makefile.config.in (from r246222, vendor/NetBSD/bmake/dist/Makefile.config.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/bmake/Makefile.config.in Fri Feb 1 22:55:27 2013 (r246223, copy of r246222, vendor/NetBSD/bmake/dist/Makefile.config.in) @@ -0,0 +1,16 @@ +# things set by configure + +prefix= @prefix@ +srcdir= @srcdir@ +CC?= @CC@ +MACHINE= @machine@ +MACHINE_ARCH= @machine_arch@ +DEFAULT_SYS_PATH= @default_sys_path@ + +CPPFLAGS+= @CPPFLAGS@ +CFLAGS+= ${CPPFLAGS} @DEFS@ +LDFLAGS= @LDFLAGS@ +LIBOBJS= @LIBOBJS@ +LDADD= @LIBS@ +USE_META= @use_meta@ +FILEMON_H= @filemon_h@ Modified: head/contrib/bmake/bmake.1 ============================================================================== --- head/contrib/bmake/bmake.1 Fri Feb 1 20:17:11 2013 (r246222) +++ head/contrib/bmake/bmake.1 Fri Feb 1 22:55:27 2013 (r246223) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.209 2012/10/08 15:09:48 christos Exp $ +.\" $NetBSD: make.1,v 1.210 2013/01/27 18:52:01 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd October 8, 2012 +.Dd January 23, 2013 .Dt MAKE 1 .Os .Sh NAME @@ -468,6 +468,50 @@ except that the effect can be limited to A .Ql Ic \- causes any non-zero exit status of the command line to be ignored. +.Pp +When +.Nm +is run in jobs mode with +.Fl j Ar max_jobs , +the entire script for the target is fed to a +single instance of the shell. +.Pp +In compatibility (non-jobs) mode, each command is run in a separate process. +If the command contains any shell meta characters +.Pq Ql #=|^(){};&<>*?[]:$`\e\en +it will be passed to the shell, otherwise +.Nm +will attempt direct execution. +.Pp +Since +.Nm +will +.Xr chdir 2 +to +.Ql Va .OBJDIR +before executing any targets, each child process +starts with that as its current working directory. +.Pp +Makefiles should be written so that the mode of +.Nm +operation does not change their behavior. +For example, any command which needs to use +.Dq cd +or +.Dq chdir , +without side-effect should be put in parenthesis: +.Bd -literal -offset indent + +avoid-chdir-side-effects: + @echo Building $@ in `pwd` + @(cd ${.CURDIR} && ${.MAKE} $@) + @echo Back in `pwd` + +ensure-one-shell-regardless-of-mode: + @echo Building $@ in `pwd`; \\ + (cd ${.CURDIR} && ${.MAKE} $@); \\ + echo Back in `pwd` +.Ed .Sh VARIABLE ASSIGNMENTS Variables in make are much like variables in the shell, and, by tradition, consist of all upper-case letters. @@ -2027,28 +2071,6 @@ NetBSD 5.0 so that they still appear to be variable expansions. In particular this stops them being treated as syntax, and removes some obscure problems using them in .if statements. -.Pp -Unlike other -.Nm -programs, this implementation by default executes all commands for a given -target using a single shell invocation. -This is done for both efficiency and to simplify error handling in remote -command invocations. -Typically this is transparent to the user, unless the target commands change -the current working directory using -.Dq cd -or -.Dq chdir . -To be compatible with Makefiles that do this, one can use -.Fl B -to disable this behavior. -.Pp -In compatibility mode, each command is run in a separate process. -If the command contains any shell meta characters -.Pq Ql #=|^(){};&<>*?[]:$`\e\en -it will be passed to the shell, otherwise -.Nm -will attempt direct execution. .Sh SEE ALSO .Xr mkdep 1 .Sh HISTORY Modified: head/contrib/bmake/bmake.cat1 ============================================================================== --- head/contrib/bmake/bmake.cat1 Fri Feb 1 20:17:11 2013 (r246222) +++ head/contrib/bmake/bmake.cat1 Fri Feb 1 22:55:27 2013 (r246223) @@ -284,6 +284,32 @@ SSHHEELLLL CCOOMMMMAANNDDSS line of a script. A `--' causes any non-zero exit status of the command line to be ignored. + When bbmmaakkee is run in jobs mode with --jj _m_a_x___j_o_b_s, the entire script for + the target is fed to a single instance of the shell. + + In compatibility (non-jobs) mode, each command is run in a separate + process. If the command contains any shell meta characters + (`#=|^(){};&<>*?[]:$`\\n') it will be passed to the shell, otherwise + bbmmaakkee will attempt direct execution. + + Since bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R' before executing any targets, each + child process starts with that as its current working directory. + + Makefiles should be written so that the mode of bbmmaakkee operation does not + change their behavior. For example, any command which needs to use + ``cd'' or ``chdir'', without side-effect should be put in parenthesis: + + + avoid-chdir-side-effects: + @echo Building $@ in `pwd` + @(cd ${.CURDIR} && ${.MAKE} $@) + @echo Back in `pwd` + + ensure-one-shell-regardless-of-mode: + @echo Building $@ in `pwd`; \ + (cd ${.CURDIR} && ${.MAKE} $@); \ + echo Back in `pwd` + VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS Variables in make are much like variables in the shell, and, by tradi- tion, consist of all upper-case letters. @@ -1293,19 +1319,6 @@ CCOOMMPPAATTIIBBIILLIITTYY stops them being treated as syntax, and removes some obscure problems using them in .if statements. - Unlike other bbmmaakkee programs, this implementation by default executes all - commands for a given target using a single shell invocation. This is - done for both efficiency and to simplify error handling in remote command - invocations. Typically this is transparent to the user, unless the tar- - get commands change the current working directory using ``cd'' or - ``chdir''. To be compatible with Makefiles that do this, one can use --BB - to disable this behavior. - - In compatibility mode, each command is run in a separate process. If the - command contains any shell meta characters (`#=|^(){};&<>*?[]:$`\\n') it - will be passed to the shell, otherwise bbmmaakkee will attempt direct execu- - tion. - SSEEEE AALLSSOO mkdep(1) @@ -1327,4 +1340,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 October 8, 2012 NetBSD 5.1 +NetBSD 5.1 January 23, 2013 NetBSD 5.1 Modified: head/contrib/bmake/boot-strap ============================================================================== --- head/contrib/bmake/boot-strap Fri Feb 1 20:17:11 2013 (r246222) +++ head/contrib/bmake/boot-strap Fri Feb 1 22:55:27 2013 (r246223) @@ -3,23 +3,52 @@ # boot-strap # # SYNOPSIS: -# boot-strap [--"configure_arg" ... ][-s "srcdir"][-m "mksrc"]\\ -# ["prefix" ["bmakesrc" ["mksrc"]]] +# boot-strap ["options"] +# boot-strap --prefix=/opt --install +# boot-strap --prefix=$HOME --install-host-target -DWITH_PROG_VERSION +# boot-strap ["options"] op=build +# boot-strap ["options"] op=install # # DESCRIPTION: # This script is used to configure/build bmake it builds for -# each OS in a subdir to keep the src clean. -# On successful completion it echos commands to put the new -# bmake binary into the /configs tree (if it exists) -# (http://www.crufty.net/FreeWare/configs.html), $prefix/bin -# and a suitable ~/*bin directory. +# each host-target in a different subdir to keep the src clean. +# There is no requirement for an existing make(1). # +# On successful completion if no '--install' flag is given, +# it echos a command to do installation. +# +# The variable "op" defaults to 'all', and is affected by +# '--install' flag as above. +# Other values include: +# +# configure +# Just run 'configure' +# +# build +# If 'configure' has not been done, do it, then +# run the build script, and finally 'test'. +# +# install +# If 'build' has not been done, do it, 'test' then +# install. +# +# clean +# attempt to clean up +# +# test +# run the unit-tests. Done automatically after 'build' +# and before 'install'. +# +# The above are leveraged by a trivial makefile for the benefit +# of those that have './configure; make; make install' baked +# into them. +# # Options: # # -c "rc" # Pick up settings from "rc". # We look for '.bmake-boot-strap.rc' before processing -# options. +# options (unless SKIP_RC is set in environment). # # --share "share_dir" # Where to put man pages and mk files. @@ -28,9 +57,28 @@ # # --mksrc "mksrc" # Indicate where the mk files can be found. -# Default is ./mk or ../mk, set to 'none' to force -# building without "mksrc" but in that case a sys.mk -# needs to exist in the default syspath ($share_dir/mk) +# Default is $Mydir/mk +# +# --install +# If build and test work, run bmake install. +# BINDIR=$prefix/bin +# SHAREDIR=$prefix/share +# +# --install-host-target +# As for '--install' but BINDIR=$prefix/$HOST_TARGET/bin +# This is useful when $prefix/ is shared by multiple +# machines. +# +# Flags relevant when installing: +# +# -DWITHOUT_INSTALL_MK +# Skip installing mk files. +# By default they will be installed to $prefix/share/mk +# +# -DWITH_PROG_VERSION +# Install 'bmake' as 'bmake-$MAKE_VERSION' +# A symlink will be made as 'bmake' unless +# -DWITHOUT_PROG_LINK is set. # # Possibly useful configure_args: # @@ -63,7 +111,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.39 2012/03/26 17:08:22 sjg Exp $ +# $Id: boot-strap,v 1.42 2013/01/25 20:20:33 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -85,11 +133,10 @@ case "$Mydir" in *) Mydir=`cd "$Mydir" && 'pwd'`;; esac - Usage() { [ "$1" ] && echo "ERROR: $@" >&2 echo "Usage:" >&2 - echo "$0 [-- ...][-s ][-m ][ [[] []]]" >&2 + echo "$0 [-- ...][][--install]" >&2 exit 1 } @@ -110,28 +157,55 @@ source_rc() { done } +cmd_args="$@" + +# --install[-host-target] will set this +INSTALL_PREFIX= +# other things we pass to install step +INSTALL_ARGS= CONFIGURE_ARGS= MAKESYSPATH= # pick a useful default prefix (for me at least ;-) for prefix in /opt/$HOST_TARGET "$HOME/$HOST_TARGET" /usr/pkg /usr/local "" do - [ -d "${prefix:-.}" ] && break + [ -d "${prefix:-.}" ] || continue + case "$prefix" in + */$HOST_TARGET) + p=`dirname $prefix` + if [ -d $p/share ]; then + INSTALL_BIN=$HOST_TARGET/bin + prefix=$p + fi + ;; + esac + echo "NOTE: default prefix=$prefix ${INSTALL_BIN:+INSTALL_BIN=$INSTALL_BIN}" + break done -srcdir= -mksrc= +srcdir=$Mydir +mksrc=$Mydir/mk objdir= quiet=: -source_rc .bmake-boot-strap.rc . "$Mydir/.." "$HOME" +${SKIP_RC:+:} source_rc .bmake-boot-strap.rc . "$Mydir/.." "$HOME" get_optarg() { expr "x$1" : "x[^=]*=\\(.*\\)" } +here=`'pwd'` +if [ $here = $Mydir ]; then + # avoid polution + OBJROOT=../ +fi + +op=all +BMAKE= + while : do case "$1" in --) shift; break;; + --help) sed -n -e "1d;/RCSid/,\$d" -e '/^#\.[a-z]/d' -e '/^#/s,^# *,,p' $0; exit 0;; --prefix) prefix="$2"; shift;; --prefix=*) prefix=`get_optarg "$1"`;; --src=*) srcdir=`get_optarg "$1"`;; @@ -144,6 +218,13 @@ do --with-default-sys-path) CONFIGURE_ARGS="$1 $2" MAKESYSPATH="$2"; shift;; + --install) INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix};; + --install-host-target) + INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix} + INSTALL_BIN=$HOST_TARGET/bin;; + --install-destdir=*) INSTALL_DESTDIR=`get_optarg "$1"`;; + --install-prefix=*) INSTALL_PREFIX=`get_optarg "$1"`;; + -DWITH*) INSTALL_ARGS="$INSTALL_ARGS $1";; -s|--src) srcdir="$2"; shift;; -m|--mksrc) mksrc="$2"; shift;; -o|--objdir) objdir="$2"; shift;; @@ -261,7 +342,7 @@ none|-) # we don't want it esac # Ok, get to work... -objdir="${objdir:-$OS}" +objdir="${objdir:-$OBJROOT$HOST_TARGET}" [ -d "$objdir" ] || mkdir -p "$objdir" [ -d "$objdir" ] || mkdir "$objdir" cd "$objdir" || exit 1 @@ -301,88 +382,80 @@ if [ "$mksrc" ]; then export CFLAGS_MF CFLAGS_MD fi -$srcdir/configure $CONFIGURE_ARGS || exit 1 -chmod 755 make-bootstrap.sh || exit 1 -./make-bootstrap.sh || exit 1 -if [ -z "$MAKESYSPATH" ]; then - add_path "${share_dir:-...}/mk" MAKESYSPATH - case "$HOST_TARGET" in - netbsd*) add_path /usr/share/mk MAKESYSPATH;; - esac -fi -if [ -s "${mksrc:-/dev/null}/install-mk" ]; then - sh "${mksrc}/install-mk" "$objdir/mk" - case "$MAKESYSPATH" in - .../mk*) ;; - *) MAKESYSPATH=".../mk:${MAKESYSPATH}";; - esac -fi +# this makes it easy to run the bmake we just built +# the :tA dance is needed because 'pwd' and even /bin/pwd +# may not give the same result as realpath(). +Bmake() { + ( + cd $Mydir && + MAKESYSPATH=$mksrc SRCTOP=$Mydir OBJTOP=$objdir \ + MAKEOBJDIR='${.CURDIR:S,${SRCTOP:tA},${OBJTOP:tA},}' \ + ${BMAKE:-$objdir/bmake} -f $Mydir/Makefile "$@" + ) +} + # make sure test below uses the same diff that configure did TOOL_DIFF=`type diff | sed 's,[()],,g;s,^[^/][^/]*,,;q'` -export MAKESYSPATH TOOL_DIFF -if [ "$mksrc" ]; then - $objdir/bmake test || exit 1 -else - # assume nothing - $objdir/bmake -r -m / test || exit 1 -fi -# If -q given, we don't want all the install instructions -$quiet exit 0 +export TOOL_DIFF -make_version=`./bmake -r -m / -f ./Makefile -V MAKE_VERSION | ( read one two; echo $one )` -bmake_version=bmake-$make_version +op_configure() { + $srcdir/configure $CONFIGURE_ARGS || exit 1 +} -if [ -s /usr/share/tmac/andoc.tmac ]; then - # this should be ok - man_subdir=man1 - man_src=$srcdir/bmake.1 -else - # guess not - man_subdir=cat1 - man_src=$srcdir/bmake.cat1 -fi +op_build() { + [ -s make-bootstrap.sh ] || op_configure + chmod 755 make-bootstrap.sh || exit 1 + ./make-bootstrap.sh || exit 1 + case "$op" in + build) op_test;; + esac +} -install_prefix() { - ( - bin_dir= - share_dir= - man_dir= - mk_dir= - while : - do - case "$1" in - *=*) eval "$1"; shift;; - *) break;; - esac - done - bin_dir=${bin_dir:-$1/bin} - share_dir=${share_dir:-`ShareDir "$1"`} - man_dir=${man_dir:-$share_dir/man} - mk_dir=${mk_dir:-$share_dir/mk} - echo - echo Commands to install into $1/ - echo - echo mkdir -p $bin_dir - echo cp $objdir/bmake $bin_dir/$bmake_version - echo rm -f $bin_dir/bmake - echo ln -s $bmake_version $bin_dir/bmake - echo mkdir -p $man_dir/$man_subdir - echo cp $man_src $man_dir/$man_subdir/bmake.1 - if [ "$mksrc" ]; then - ev=`env | grep '_MK='` - echo $ev sh $mksrc/install-mk $mk_dir +op_test() { + [ -x bmake ] || op_build + Bmake test || exit 1 +} + +op_clean() { + if [ -x bmake ]; then + ln bmake bmake$$ + BMAKE=$objdir/bmake$$ Bmake clean + rm -f bmake$$ + elif [ $objdir != $srcdir ]; then + rm -rf * fi - ) } -case "$prefix/" in -"$HOME"/*) ;; -*) CONFIGS=${CONFIGS:-/configs} - [ -d $CONFIGS ] && - install_prefix mksrc= "$CONFIGS/$OS/$OSMAJOR.X/$MACHINE_ARCH$prefix" - # I like to keep a copy here... - install_prefix share_dir="$HOME/share" "$HOME/$HOST_TARGET" - ;; -esac +op_install() { + op_test + case "$INSTALL_PREFIX,$INSTALL_BIN,$prefix" in + ,$HOST_TARGET/bin,*/$HOST_TARGET) + INSTALL_PREFIX=`dirname $prefix` + ;; + esac + INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix} + Bmake install prefix=$INSTALL_PREFIX BINDIR=$INSTALL_PREFIX/${INSTALL_BIN:-bin} ${INSTALL_DESTDIR:+DESTDIR=$INSTALL_DESTDIR} $INSTALL_ARGS || exit 1 +} + +op_all() { + rm -f make-bootstrap.sh bmake *.o + if [ -n "$INSTALL_PREFIX" ]; then + op_install + else + op_test + MAKE_VERSION=`sed -n '/^MAKE_VERSION/ { s,.*= *,,;p; }' $srcdir/Makefile` + echo You can install by running: + echo + echo $0 $cmd_args op=install + echo + echo "Use --install-prefix=/something to install somewhere other than $prefix" + echo "Use --install-destdir=/somewhere to set DESTDIR during install" + echo "Use --install-host-target to use INSTALL_BIN=$HOST_TARGET/bin" + echo "Use -DWITH_PROG_VERSION to install as bmake-$MAKE_VERSION" + echo "Use -DWITHOUT_PROG_LINK to supress bmake -> bmake-$MAKE_VERSION symlink" + echo "Use -DWITHOUT_INSTALL_MK to skip installing files to $prefix/share/mk" + fi +} -install_prefix "$prefix" +op_$op +exit 0 Modified: head/contrib/bmake/bsd.after-import.mk ============================================================================== --- head/contrib/bmake/bsd.after-import.mk Fri Feb 1 20:17:11 2013 (r246222) +++ head/contrib/bmake/bsd.after-import.mk Fri Feb 1 22:55:27 2013 (r246223) @@ -1,4 +1,4 @@ -# $Id: bsd.after-import.mk,v 1.9 2012/09/20 00:30:15 sjg Exp $ +# $Id: bsd.after-import.mk,v 1.11 2012/12/29 19:32:25 sjg Exp $ # This makefile is for use when integrating bmake into a BSD build # system. Use this makefile after importing bmake. @@ -48,36 +48,36 @@ DEFAULT_SYS_PATH= .../share/mk:/usr/shar BOOTSTRAP_ARGS = \ --with-default-sys-path='${DEFAULT_SYS_PATH}' \ --prefix /usr \ - --share /usr/share \ - --mksrc none + --share /usr/share + # run boot-strap with minimal influence bootstrap: ${BMAKE_SRC}/boot-strap ${MAKEFILE} - HOME=/ ${BMAKE_SRC}/boot-strap ${BOOTSTRAP_ARGS} ${BOOTSTRAP_XTRAS} + HOME=/ ${BMAKE_SRC}/boot-strap -o ${HOST_OS} ${BOOTSTRAP_ARGS} ${BOOTSTRAP_XTRAS} touch ${.TARGET} # Makefiles need a little more tweaking than say config.h MAKEFILE_SED = sed -e '/^MACHINE/d' \ -e '/^PROG/ { s,=,?=,;s,bmake,$${.CURDIR:T},; }' \ -e 's,^.-include,.sinclude,' \ + -e '/^\..*include * ${.CURDIR}/$f .endfor -.for f in ${configured_files:M*Makefile} +.for f in ${configured_files:M*Makefile*} @echo Capturing $f @mkdir -p ${${.CURDIR}/$f:L:H} @(echo '# This is a generated file, do NOT edit!'; \ echo '# See ${_this:S,${SRCTOP}/,,}'; \ - echo '#'; echo '# $$${OS}$$'; echo; \ + echo '#'; echo '# $$${HOST_OS}$$'; echo; \ echo 'SRCTOP?= $${.CURDIR:${${.CURDIR}/$f:L:H:S,${SRCTOP}/,,:C,[^/]+,H,g:S,/,:,g}}'; echo; \ ${MAKEFILE_SED} ${HOST_OS}/$f ) > ${.CURDIR}/$f .endfor @@ -87,18 +87,22 @@ _makefile: bootstrap ${MAKEFILE} @echo Generating ${.CURDIR}/Makefile @(echo '# This is a generated file, do NOT edit!'; \ echo '# See ${_this:S,${SRCTOP}/,,}'; \ - echo '#'; echo '# $$${OS}$$'; \ + echo '#'; echo '# $$${HOST_OS}$$'; \ echo; echo '.sinclude "Makefile.inc"'; \ echo; echo 'SRCTOP?= $${.CURDIR:${.CURDIR:S,${SRCTOP}/,,:C,[^/]+,H,g:S,/,:,g}}'; \ echo; echo '# look here first for config.h'; \ echo 'CFLAGS+= -I$${.CURDIR}'; echo; \ - ${MAKEFILE_SED} ${HOST_OS}/Makefile; \ + echo '# for after-import'; \ + echo 'CLEANDIRS+= ${HOST_OS}'; \ + echo 'CLEANFILES+= bootstrap'; echo; \ + ${MAKEFILE_SED} \ + ${1 2:L:@n@-e '/start-delete$n/,/end-delete$n/d'@} \ + ${BMAKE_SRC}/Makefile; \ echo; echo '# override some simple things'; \ echo 'BINDIR= /usr/bin'; \ echo 'MANDIR= ${MANDIR:U/usr/share/man}'; \ echo; echo '# make sure we get this'; \ echo 'CFLAGS+= $${COPTS.$${.IMPSRC:T}}'; \ - echo 'CLEANFILES+= bootstrap'; \ echo; echo 'after-import: ${_this:S,${SRCTOP},\${SRCTOP},}'; \ echo ' cd $${.CURDIR} && $${.MAKE} -f ${_this:S,${SRCTOP},\${SRCTOP},}'; \ echo ) > ${.TARGET} Modified: head/contrib/bmake/compat.c ============================================================================== --- head/contrib/bmake/compat.c Fri Feb 1 20:17:11 2013 (r246222) +++ head/contrib/bmake/compat.c Fri Feb 1 22:55:27 2013 (r246223) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.90 2012/10/07 19:17:31 sjg Exp $ */ +/* $NetBSD: compat.c,v 1.91 2013/01/25 02:01:10 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.90 2012/10/07 19:17:31 sjg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.91 2013/01/25 02:01:10 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.90 2012/10/07 19:17:31 sjg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.91 2013/01/25 02:01:10 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -377,7 +377,6 @@ again: Fatal("Could not fork"); } if (cpid == 0) { - Check_Cwd(av); Var_ExportVars(); #ifdef USE_META if (useMeta) { Modified: head/contrib/bmake/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bmake/configure.in ============================================================================== --- head/contrib/bmake/configure.in Fri Feb 1 20:17:11 2013 (r246222) +++ head/contrib/bmake/configure.in Fri Feb 1 22:55:27 2013 (r246223) @@ -1,12 +1,18 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.45 2012/06/20 22:43:41 sjg Exp $ +dnl $Id: configure.in,v 1.46 2012/12/28 21:28:18 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl -AC_INIT([bmake], [20120620], [sjg@NetBSD.org]) +AC_INIT([bmake], [20121212], [sjg@NetBSD.org]) AC_CONFIG_HEADER(config.h) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 01:11:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81B66A40; Sat, 2 Feb 2013 01:11:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 71B098D8; Sat, 2 Feb 2013 01:11:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r121B3wA039116; Sat, 2 Feb 2013 01:11:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r121B3X8039110; Sat, 2 Feb 2013 01:11:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201302020111.r121B3X8039110@svn.freebsd.org> From: Glen Barber Date: Sat, 2 Feb 2013 01:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246224 - stable/9/share/man/man7 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 01:11:03 -0000 Author: gjb (doc,ports committer) Date: Sat Feb 2 01:11:02 2013 New Revision: 246224 URL: http://svnweb.freebsd.org/changeset/base/246224 Log: MFC r246153, r246154: r246153: - Update svn port directory in release(7). r246154: - Force commit to mark MFC for r246153. Modified: stable/9/share/man/man7/release.7 Directory Properties: stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/release.7 ============================================================================== --- stable/9/share/man/man7/release.7 Fri Feb 1 22:55:27 2013 (r246223) +++ stable/9/share/man/man7/release.7 Sat Feb 2 01:11:02 2013 (r246224) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 16, 2012 +.Dd January 31, 2013 .Dt RELEASE 7 .Os .Sh NAME @@ -310,7 +310,7 @@ directory. .Xr cc 1 , .Xr install 1 , .Xr make 1 , -.Xr svn 1 Pq Pa ports/devel/subversion-freebsd , +.Xr svn 1 Pq Pa ports/devel/subversion , .Xr uname 1 , .Xr md 4 , .Xr make.conf 5 , From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 01:11:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0207CB51; Sat, 2 Feb 2013 01:11:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8F128DB; Sat, 2 Feb 2013 01:11:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r121BCkA039185; Sat, 2 Feb 2013 01:11:12 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r121BCgY039184; Sat, 2 Feb 2013 01:11:12 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201302020111.r121BCgY039184@svn.freebsd.org> From: Glen Barber Date: Sat, 2 Feb 2013 01:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246225 - stable/8/share/man/man7 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 01:11:13 -0000 Author: gjb (doc,ports committer) Date: Sat Feb 2 01:11:12 2013 New Revision: 246225 URL: http://svnweb.freebsd.org/changeset/base/246225 Log: MFC r246153, r246154: r246153: - Update svn port directory in release(7). r246154: - Force commit to mark MFC for r246153. Modified: stable/8/share/man/man7/release.7 Directory Properties: stable/8/share/man/man7/ (props changed) Modified: stable/8/share/man/man7/release.7 ============================================================================== --- stable/8/share/man/man7/release.7 Sat Feb 2 01:11:02 2013 (r246224) +++ stable/8/share/man/man7/release.7 Sat Feb 2 01:11:12 2013 (r246225) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2009 +.Dd January 31, 2013 .Dt RELEASE 7 .Os .Sh NAME @@ -507,7 +507,7 @@ make release CHROOTDIR=/local3/release B .Xr install 1 , .Xr make 1 , .Xr patch 1 , -.Xr svn 1 Pq Pa ports/devel/subversion-freebsd , +.Xr svn 1 Pq Pa ports/devel/subversion , .Xr uname 1 , .Xr md 4 , .Xr make.conf 5 , From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 02:00:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5808FFC; Sat, 2 Feb 2013 02:00:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 45385A09; Sat, 2 Feb 2013 02:00:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1220AcZ051869; Sat, 2 Feb 2013 02:00:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1220ARZ051868; Sat, 2 Feb 2013 02:00:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302020200.r1220ARZ051868@svn.freebsd.org> From: Adrian Chadd Date: Sat, 2 Feb 2013 02:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246226 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 02:00:11 -0000 Author: adrian Date: Sat Feb 2 02:00:10 2013 New Revision: 246226 URL: http://svnweb.freebsd.org/changeset/base/246226 Log: Wrap this in an #ifdef so IEEE80211_SUPPORT_SUPERG will work correctly in a wlan.ko module. Modified: head/sys/net80211/ieee80211_superg.c Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Sat Feb 2 01:11:12 2013 (r246225) +++ head/sys/net80211/ieee80211_superg.c Sat Feb 2 02:00:10 2013 (r246226) @@ -28,6 +28,8 @@ __FBSDID("$FreeBSD$"); #include "opt_wlan.h" +#ifdef IEEE80211_SUPPORT_SUPERG + #include #include #include @@ -921,3 +923,5 @@ superg_ioctl_set80211(struct ieee80211va return 0; } IEEE80211_IOCTL_SET(superg, superg_ioctl_set80211); + +#endif /* IEEE80211_SUPPORT_SUPERG */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 02:00:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C73C0267; Sat, 2 Feb 2013 02:00:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA252A10; Sat, 2 Feb 2013 02:00:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1220THa052102; Sat, 2 Feb 2013 02:00:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1220TWU052101; Sat, 2 Feb 2013 02:00:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302020200.r1220TWU052101@svn.freebsd.org> From: Adrian Chadd Date: Sat, 2 Feb 2013 02:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246227 - head/sys/modules/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 02:00:29 -0000 Author: adrian Date: Sat Feb 2 02:00:29 2013 New Revision: 246227 URL: http://svnweb.freebsd.org/changeset/base/246227 Log: Allow IEEE80211_SUPPORT_SUPERG to be defined _and_ have a working wlan module. Modified: head/sys/modules/wlan/Makefile Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Sat Feb 2 02:00:10 2013 (r246226) +++ head/sys/modules/wlan/Makefile Sat Feb 2 02:00:29 2013 (r246227) @@ -12,7 +12,7 @@ SRCS= ieee80211.c ieee80211_action.c iee ieee80211_ratectl_none.c ieee80211_regdomain.c \ ieee80211_ht.c ieee80211_hwmp.c ieee80211_adhoc.c ieee80211_hostap.c \ ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c \ - ieee80211_tdma.c + ieee80211_tdma.c ieee80211_superg.c SRCS+= bus_if.h device_if.h opt_ddb.h opt_inet.h opt_inet6.h opt_ipx.h \ opt_tdma.h opt_wlan.h From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 06:01:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F24ABB4A; Sat, 2 Feb 2013 06:01:57 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CE28113E; Sat, 2 Feb 2013 06:01:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1261v4J026171; Sat, 2 Feb 2013 06:01:57 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1261vZx026170; Sat, 2 Feb 2013 06:01:57 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302020601.r1261vZx026170@svn.freebsd.org> From: Tim Kientzle Date: Sat, 2 Feb 2013 06:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246228 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 06:01:58 -0000 Author: kientzle Date: Sat Feb 2 06:01:57 2013 New Revision: 246228 URL: http://svnweb.freebsd.org/changeset/base/246228 Log: Tweaks to standard BEAGLEBONE config, as recently discussed on FreeBSD-ARM. Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sat Feb 2 02:00:29 2013 (r246227) +++ head/sys/arm/conf/BEAGLEBONE Sat Feb 2 06:01:57 2013 (r246228) @@ -37,6 +37,7 @@ options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework +options TMPFS #Efficient memory filesystem options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) support @@ -61,9 +62,9 @@ options WITNESS_SKIPSPIN #Don't run wit #options DIAGNOSTIC # NFS support -#options NFSCL +options NFSCL #options NFSD -#options NFSLOCKD +options NFSLOCKD # Uncomment this for NFS root #options NFS_ROOT #NFS usable as /, requires NFSCL @@ -124,4 +125,3 @@ device axe # ASIX Electronics USB Eth options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=beaglebone.dts - From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 06:06:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CC678D00; Sat, 2 Feb 2013 06:06:40 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9B691164; Sat, 2 Feb 2013 06:06:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1266eCt027037; Sat, 2 Feb 2013 06:06:40 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1266eFA027035; Sat, 2 Feb 2013 06:06:40 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302020606.r1266eFA027035@svn.freebsd.org> From: Tim Kientzle Date: Sat, 2 Feb 2013 06:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246229 - in head/contrib/libarchive/libarchive: . test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 06:06:40 -0000 Author: kientzle Date: Sat Feb 2 06:06:39 2013 New Revision: 246229 URL: http://svnweb.freebsd.org/changeset/base/246229 Log: Fix an obvious typo that broke time specifications of the form "2 hours ago". Modified: head/contrib/libarchive/libarchive/archive_getdate.c head/contrib/libarchive/libarchive/test/test_archive_getdate.c Modified: head/contrib/libarchive/libarchive/archive_getdate.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_getdate.c Sat Feb 2 06:01:57 2013 (r246228) +++ head/contrib/libarchive/libarchive/archive_getdate.c Sat Feb 2 06:06:39 2013 (r246229) @@ -369,8 +369,8 @@ relunitphrase(struct gdstate *gds) && gds->tokenp[1].token == tSEC_UNIT) { /* "1 day" */ gds->HaveRel++; - gds->RelSeconds += gds->tokenp[1].value * gds->tokenp[2].value; - gds->tokenp += 3; + gds->RelSeconds += gds->tokenp[0].value * gds->tokenp[1].value; + gds->tokenp += 2; return 1; } if (gds->tokenp[0].token == '-' @@ -403,7 +403,7 @@ relunitphrase(struct gdstate *gds) /* "now", "tomorrow" */ gds->HaveRel++; gds->RelSeconds += gds->tokenp[0].value; - ++gds->tokenp; + gds->tokenp += 1; return 1; } if (gds->tokenp[0].token == tMONTH_UNIT) { @@ -1022,10 +1022,11 @@ int main(int argc, char **argv) { time_t d; + time_t now = time(NULL); while (*++argv != NULL) { (void)printf("Input: %s\n", *argv); - d = get_date(*argv); + d = get_date(now, *argv); if (d == -1) (void)printf("Bad format - couldn't convert.\n"); else Modified: head/contrib/libarchive/libarchive/test/test_archive_getdate.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_archive_getdate.c Sat Feb 2 06:01:57 2013 (r246228) +++ head/contrib/libarchive/libarchive/test/test_archive_getdate.c Sat Feb 2 06:06:39 2013 (r246229) @@ -43,6 +43,8 @@ DEFINE_TEST(test_archive_getdate) assertEqualInt(get_date(now, "2004/01/29 513 mest"), 1075345980); assertEqualInt(get_date(now, "99/02/17 7pm utc"), 919278000); assertEqualInt(get_date(now, "02/17/99 7:11am est"), 919253460); + assertEqualInt(get_date(now, "now - 2 hours"), + get_date(now, "2 hours ago")); /* It's important that we handle ctime() format. */ assertEqualInt(get_date(now, "Sun Feb 22 17:38:26 PST 2009"), 1235353106); @@ -77,5 +79,6 @@ DEFINE_TEST(test_archive_getdate) /* "last tuesday" is one week before "tuesday" */ assertEqualInt(get_date(now, "last tuesday UTC"), now - 6 * 24 * 60 * 60); + /* TODO: Lots more tests here. */ } From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 09:57:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A8F6668E; Sat, 2 Feb 2013 09:57:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7FBE6858; Sat, 2 Feb 2013 09:57:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r129vaA7094910; Sat, 2 Feb 2013 09:57:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r129vY6f094897; Sat, 2 Feb 2013 09:57:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302020957.r129vY6f094897@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 2 Feb 2013 09:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246234 - in stable/9: include sys/boot/powerpc/boot1.chrp sys/boot/sparc64/boot1 sys/conf sys/modules/ufs sys/ufs/ffs sys/ufs/ufs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 09:57:36 -0000 Author: trasz Date: Sat Feb 2 09:57:34 2013 New Revision: 246234 URL: http://svnweb.freebsd.org/changeset/base/246234 Log: MFC r243245: Add UFS writesuspension mechanism, designed to allow userland processes to modify on-disk metadata for filesystems mounted for write. Reviewed by: kib, mckusick Sponsored by: FreeBSD Foundation MFC r243247: Add change missed in 243245. MFC r243250: Fix build of kdump(1). MFC r243254: Fix build on powerpc. Reviewed by: nwhitehorn MFC r243305 by marius: Fix build after r243245. Submitted by: trasz MFC r243339 by kib: Fix module build after r243245. Added: stable/9/sys/ufs/ffs/ffs_suspend.c - copied unchanged from r243245, head/sys/ufs/ffs/ffs_suspend.c Modified: stable/9/include/paths.h stable/9/sys/boot/powerpc/boot1.chrp/boot1.c stable/9/sys/boot/sparc64/boot1/boot1.c stable/9/sys/conf/files stable/9/sys/modules/ufs/Makefile stable/9/sys/ufs/ffs/ffs_extern.h stable/9/sys/ufs/ffs/ffs_vfsops.c stable/9/sys/ufs/ffs/fs.h stable/9/sys/ufs/ufs/ufsmount.h Directory Properties: stable/9/include/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/include/paths.h ============================================================================== --- stable/9/include/paths.h Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/include/paths.h Sat Feb 2 09:57:34 2013 (r246234) @@ -85,6 +85,7 @@ #define _PATH_SHELLS "/etc/shells" #define _PATH_TTY "/dev/tty" #define _PATH_UNIX "don't use _PATH_UNIX" +#define _PATH_UFSSUSPEND "/dev/ufssuspend" #define _PATH_VI "/usr/bin/vi" #define _PATH_WALL "/usr/bin/wall" Modified: stable/9/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- stable/9/sys/boot/powerpc/boot1.chrp/boot1.c Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/boot/powerpc/boot1.chrp/boot1.c Sat Feb 2 09:57:34 2013 (r246234) @@ -62,7 +62,7 @@ static void usage(void); static void bcopy(const void *src, void *dst, size_t len); static void bzero(void *b, size_t len); -static int mount(const char *device, int quiet); +static int domount(const char *device, int quiet); static void panic(const char *fmt, ...) __dead2; static int printf(const char *fmt, ...); @@ -432,7 +432,7 @@ main(int ac, char **av) bootpath_full[len+2] = '\0'; } - if (mount(bootpath_full,1) >= 0) + if (domount(bootpath_full,1) >= 0) break; if (bootdev > 0) @@ -440,10 +440,10 @@ main(int ac, char **av) } if (i >= 16) - panic("mount"); + panic("domount"); } else { - if (mount(bootpath_full,0) == -1) - panic("mount"); + if (domount(bootpath_full,0) == -1) + panic("domount"); } printf(" Boot volume: %s\n",bootpath_full); @@ -470,17 +470,17 @@ exit(int code) static struct dmadat __dmadat; static int -mount(const char *device, int quiet) +domount(const char *device, int quiet) { dmadat = &__dmadat; if ((bootdev = ofw_open(device)) == -1) { - printf("mount: can't open device\n"); + printf("domount: can't open device\n"); return (-1); } if (fsread(0, NULL, 0)) { if (!quiet) - printf("mount: can't read superblock\n"); + printf("domount: can't read superblock\n"); return (-1); } return (0); Modified: stable/9/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/9/sys/boot/sparc64/boot1/boot1.c Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/boot/sparc64/boot1/boot1.c Sat Feb 2 09:57:34 2013 (r246234) @@ -60,7 +60,7 @@ static void load(const char *); static void bcopy(const void *src, void *dst, size_t len); static void bzero(void *b, size_t len); -static int mount(const char *device); +static int domount(const char *device); static int dskread(void *buf, u_int64_t lba, int nblk); static void panic(const char *fmt, ...) __dead2; @@ -347,8 +347,8 @@ main(int ac, char **av) " Boot loader: %s\n", bootpath, path); #endif - if (mount(bootpath) == -1) - panic("mount"); + if (domount(bootpath) == -1) + panic("domount"); #ifdef ZFSBOOT loadzfs(); @@ -498,17 +498,17 @@ load(const char *fname) #endif /* ZFSBOOT */ static int -mount(const char *device) +domount(const char *device) { if ((bootdev = ofw_open(device)) == -1) { - printf("mount: can't open device\n"); + printf("domount: can't open device\n"); return (-1); } #ifndef ZFSBOOT dmadat = &__dmadat; if (fsread(0, NULL, 0)) { - printf("mount: can't read superblock\n"); + printf("domount: can't read superblock\n"); return (-1); } #endif Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/conf/files Sat Feb 2 09:57:34 2013 (r246234) @@ -3385,6 +3385,7 @@ ufs/ffs/ffs_tables.c optional ffs ufs/ffs/ffs_vfsops.c optional ffs ufs/ffs/ffs_vnops.c optional ffs ufs/ffs/ffs_rawread.c optional directio +ufs/ffs/ffs_suspend.c optional ffs ufs/ufs/ufs_acl.c optional ffs ufs/ufs/ufs_bmap.c optional ffs ufs/ufs/ufs_dirhash.c optional ffs Modified: stable/9/sys/modules/ufs/Makefile ============================================================================== --- stable/9/sys/modules/ufs/Makefile Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/modules/ufs/Makefile Sat Feb 2 09:57:34 2013 (r246234) @@ -7,7 +7,8 @@ SRCS= opt_ddb.h opt_directio.h opt_ffs.h vnode_if.h ufs_acl.c ufs_bmap.c ufs_dirhash.c ufs_extattr.c \ ufs_gjournal.c ufs_inode.c ufs_lookup.c ufs_quota.c ufs_vfsops.c \ ufs_vnops.c ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_snapshot.c \ - ffs_softdep.c ffs_subr.c ffs_tables.c ffs_vfsops.c ffs_vnops.c + ffs_softdep.c ffs_subr.c ffs_suspend.c ffs_tables.c ffs_vfsops.c \ + ffs_vnops.c .if !defined(KERNBUILDDIR) CFLAGS+= -DSOFTUPDATES -DUFS_DIRHASH Modified: stable/9/sys/ufs/ffs/ffs_extern.h ============================================================================== --- stable/9/sys/ufs/ffs/ffs_extern.h Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/ufs/ffs/ffs_extern.h Sat Feb 2 09:57:34 2013 (r246234) @@ -79,9 +79,11 @@ int ffs_isfreeblock(struct fs *, u_char void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t); int ffs_mountroot(void); void ffs_oldfscompat_write(struct fs *, struct ufsmount *); +int ffs_own_mount(const struct mount *mp); int ffs_reallocblks(struct vop_reallocblks_args *); int ffs_realloccg(struct inode *, ufs2_daddr_t, ufs2_daddr_t, ufs2_daddr_t, int, int, int, struct ucred *, struct buf **); +int ffs_reload(struct mount *, struct thread *, int); int ffs_sbupdate(struct ufsmount *, int, int); void ffs_setblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, @@ -100,6 +102,8 @@ int ffs_valloc(struct vnode *, int, stru int ffs_vfree(struct vnode *, ino_t, int); vfs_vget_t ffs_vget; int ffs_vgetf(struct mount *, ino_t, int, struct vnode **, int); +void ffs_susp_initialize(void); +void ffs_susp_uninitialize(void); #define FFSV_FORCEINSMQ 0x0001 Copied: stable/9/sys/ufs/ffs/ffs_suspend.c (from r243245, head/sys/ufs/ffs/ffs_suspend.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/ufs/ffs/ffs_suspend.c Sat Feb 2 09:57:34 2013 (r246234, copy of r243245, head/sys/ufs/ffs/ffs_suspend.c) @@ -0,0 +1,338 @@ +/*- + * Copyright (c) 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Edward Tomasz Napierala under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +static d_open_t ffs_susp_open; +static d_write_t ffs_susp_rdwr; +static d_ioctl_t ffs_susp_ioctl; + +static struct cdevsw ffs_susp_cdevsw = { + .d_version = D_VERSION, + .d_open = ffs_susp_open, + .d_read = ffs_susp_rdwr, + .d_write = ffs_susp_rdwr, + .d_ioctl = ffs_susp_ioctl, + .d_name = "ffs_susp", +}; + +static struct cdev *ffs_susp_dev; +static struct sx ffs_susp_lock; + +static int +ffs_susp_suspended(struct mount *mp) +{ + struct ufsmount *ump; + + sx_assert(&ffs_susp_lock, SA_LOCKED); + + ump = VFSTOUFS(mp); + if (ump->um_writesuspended) + return (1); + return (0); +} + +static int +ffs_susp_open(struct cdev *dev __unused, int flags __unused, + int fmt __unused, struct thread *td __unused) +{ + + return (0); +} + +static int +ffs_susp_rdwr(struct cdev *dev, struct uio *uio, int ioflag) +{ + int error, i; + struct vnode *devvp; + struct mount *mp; + struct ufsmount *ump; + struct buf *bp; + void *base; + size_t len; + ssize_t cnt; + struct fs *fs; + + sx_slock(&ffs_susp_lock); + + error = devfs_get_cdevpriv((void **)&mp); + if (error != 0) { + sx_sunlock(&ffs_susp_lock); + return (ENXIO); + } + + ump = VFSTOUFS(mp); + devvp = ump->um_devvp; + fs = ump->um_fs; + + if (ffs_susp_suspended(mp) == 0) { + sx_sunlock(&ffs_susp_lock); + return (ENXIO); + } + + KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, + ("neither UIO_READ or UIO_WRITE")); + KASSERT(uio->uio_segflg == UIO_USERSPACE, + ("uio->uio_segflg != UIO_USERSPACE")); + + cnt = uio->uio_resid; + + for (i = 0; i < uio->uio_iovcnt; i++) { + while (uio->uio_iov[i].iov_len) { + base = uio->uio_iov[i].iov_base; + len = uio->uio_iov[i].iov_len; + if (len > fs->fs_bsize) + len = fs->fs_bsize; + if (fragoff(fs, uio->uio_offset) != 0 || + fragoff(fs, len) != 0) { + error = EINVAL; + goto out; + } + error = bread(devvp, btodb(uio->uio_offset), len, + NOCRED, &bp); + if (error != 0) + goto out; + if (uio->uio_rw == UIO_WRITE) { + error = copyin(base, bp->b_data, len); + if (error != 0) { + bp->b_flags |= B_INVAL | B_NOCACHE; + brelse(bp); + goto out; + } + error = bwrite(bp); + if (error != 0) + goto out; + } else { + error = copyout(bp->b_data, base, len); + brelse(bp); + if (error != 0) + goto out; + } + uio->uio_iov[i].iov_base = + (char *)uio->uio_iov[i].iov_base + len; + uio->uio_iov[i].iov_len -= len; + uio->uio_resid -= len; + uio->uio_offset += len; + } + } + +out: + sx_sunlock(&ffs_susp_lock); + + if (uio->uio_resid < cnt) + return (0); + + return (error); +} + +static int +ffs_susp_suspend(struct mount *mp) +{ + struct fs *fs; + struct ufsmount *ump; + int error; + + sx_assert(&ffs_susp_lock, SA_XLOCKED); + + if (!ffs_own_mount(mp)) + return (EINVAL); + if (ffs_susp_suspended(mp)) + return (EBUSY); + + ump = VFSTOUFS(mp); + fs = ump->um_fs; + + /* + * Make sure the calling thread is permitted to access the mounted + * device. The permissions can change after we unlock the vnode; + * it's harmless. + */ + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); + error = VOP_ACCESS(ump->um_devvp, VREAD | VWRITE, + curthread->td_ucred, curthread); + VOP_UNLOCK(ump->um_devvp, 0); + if (error != 0) + return (error); +#ifdef MAC + if (mac_mount_check_stat(curthread->td_ucred, mp) != 0) + return (EPERM); +#endif + + if ((error = vfs_write_suspend(mp)) != 0) + return (error); + + ump->um_writesuspended = 1; + + return (0); +} + +static void +ffs_susp_dtor(void *data) +{ + struct fs *fs; + struct ufsmount *ump; + struct mount *mp; + int error; + + sx_xlock(&ffs_susp_lock); + + mp = (struct mount *)data; + ump = VFSTOUFS(mp); + fs = ump->um_fs; + + if (ffs_susp_suspended(mp) == 0) { + sx_xunlock(&ffs_susp_lock); + return; + } + + KASSERT((mp->mnt_kern_flag & MNTK_SUSPEND) != 0, + ("MNTK_SUSPEND not set")); + + error = ffs_reload(mp, curthread, 1); + if (error != 0) + panic("failed to unsuspend writes on %s", fs->fs_fsmnt); + + /* + * XXX: The status is kept per-process; the vfs_write_resume() routine + * asserts that the resuming thread is the same one that called + * vfs_write_suspend(). The cdevpriv data, however, is attached + * to the file descriptor, e.g. is inherited during fork. Thus, + * it's possible that the resuming process will be different from + * the one that started the suspension. + * + * Work around by fooling the check in vfs_write_resume(). + */ + mp->mnt_susp_owner = curthread; + + vfs_write_resume(mp); + vfs_unbusy(mp); + ump->um_writesuspended = 0; + + sx_xunlock(&ffs_susp_lock); +} + +static int +ffs_susp_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, + struct thread *td) +{ + struct mount *mp; + fsid_t *fsidp; + int error; + + /* + * No suspend inside the jail. Allowing it would require making + * sure that e.g. the devfs ruleset for that jail permits access + * to the devvp. + */ + if (jailed(td->td_ucred)) + return (EPERM); + + sx_xlock(&ffs_susp_lock); + + switch (cmd) { + case UFSSUSPEND: + fsidp = (fsid_t *)addr; + mp = vfs_getvfs(fsidp); + if (mp == NULL) { + error = ENOENT; + break; + } + error = vfs_busy(mp, 0); + vfs_rel(mp); + if (error != 0) + break; + error = ffs_susp_suspend(mp); + if (error != 0) { + vfs_unbusy(mp); + break; + } + error = devfs_set_cdevpriv(mp, ffs_susp_dtor); + KASSERT(error == 0, ("devfs_set_cdevpriv failed")); + break; + case UFSRESUME: + error = devfs_get_cdevpriv((void **)&mp); + if (error != 0) + break; + /* + * This calls ffs_susp_dtor, which in turn unsuspends the fs. + * The dtor expects to be called without lock held, because + * sometimes it's called from here, and sometimes due to the + * file being closed or process exiting. + */ + sx_xunlock(&ffs_susp_lock); + devfs_clear_cdevpriv(); + return (0); + default: + error = ENXIO; + break; + } + + sx_xunlock(&ffs_susp_lock); + + return (error); +} + +void +ffs_susp_initialize(void) +{ + + sx_init(&ffs_susp_lock, "ffs_susp"); + ffs_susp_dev = make_dev(&ffs_susp_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + "ufssuspend"); +} + +void +ffs_susp_uninitialize(void) +{ + + destroy_dev(ffs_susp_dev); + sx_destroy(&ffs_susp_lock); +} Modified: stable/9/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vfsops.c Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/ufs/ffs/ffs_vfsops.c Sat Feb 2 09:57:34 2013 (r246234) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -75,7 +76,6 @@ __FBSDID("$FreeBSD$"); static uma_zone_t uma_inode, uma_ufs1, uma_ufs2; -static int ffs_reload(struct mount *, struct thread *); static int ffs_mountfs(struct vnode *, struct mount *, struct thread *); static void ffs_oldfscompat_read(struct fs *, struct ufsmount *, ufs2_daddr_t); @@ -333,7 +333,7 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp); } if ((mp->mnt_flag & MNT_RELOAD) && - (error = ffs_reload(mp, td)) != 0) + (error = ffs_reload(mp, td, 0)) != 0) return (error); if (fs->fs_ronly && !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { @@ -595,8 +595,8 @@ ffs_cmount(struct mntarg *ma, void *data /* * Reload all incore data for a filesystem (used after running fsck on - * the root filesystem and finding things to fix). The filesystem must - * be mounted read-only. + * the root filesystem and finding things to fix). If the 'force' flag + * is 0, the filesystem must be mounted read-only. * * Things to do to update the mount: * 1) invalidate all cached meta-data. @@ -606,8 +606,8 @@ ffs_cmount(struct mntarg *ma, void *data * 5) invalidate all cached file data. * 6) re-read inode data for all active vnodes. */ -static int -ffs_reload(struct mount *mp, struct thread *td) +int +ffs_reload(struct mount *mp, struct thread *td, int force) { struct vnode *vp, *mvp, *devvp; struct inode *ip; @@ -619,9 +619,15 @@ ffs_reload(struct mount *mp, struct thre int i, blks, size, error; int32_t *lp; - if ((mp->mnt_flag & MNT_RDONLY) == 0) - return (EINVAL); ump = VFSTOUFS(mp); + + MNT_ILOCK(mp); + if ((mp->mnt_flag & MNT_RDONLY) == 0 && force == 0) { + MNT_IUNLOCK(mp); + return (EINVAL); + } + MNT_IUNLOCK(mp); + /* * Step 1: invalidate all cached meta-data. */ @@ -655,8 +661,7 @@ ffs_reload(struct mount *mp, struct thre newfs->fs_maxcluster = fs->fs_maxcluster; newfs->fs_contigdirs = fs->fs_contigdirs; newfs->fs_active = fs->fs_active; - /* The file system is still read-only. */ - newfs->fs_ronly = 1; + newfs->fs_ronly = fs->fs_ronly; sblockloc = fs->fs_sblockloc; bcopy(newfs, fs, (u_int)fs->fs_sbsize); brelse(bp); @@ -711,6 +716,13 @@ ffs_reload(struct mount *mp, struct thre loop: MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { /* + * Skip syncer vnode. + */ + if (vp->v_type == VNON) { + VI_UNLOCK(vp); + continue; + } + /* * Step 4: invalidate all cached file data. */ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { @@ -1834,6 +1846,7 @@ ffs_init(vfsp) struct vfsconf *vfsp; { + ffs_susp_initialize(); softdep_initialize(); return (ufs_init(vfsp)); } @@ -1849,6 +1862,7 @@ ffs_uninit(vfsp) ret = ufs_uninit(vfsp); softdep_uninitialize(); + ffs_susp_uninitialize(); return (ret); } @@ -2198,6 +2212,15 @@ ffs_geom_strategy(struct bufobj *bo, str g_vfs_strategy(bo, bp); } +int +ffs_own_mount(const struct mount *mp) +{ + + if (mp->mnt_op == &ufs_vfsops) + return (1); + return (0); +} + #ifdef DDB static void Modified: stable/9/sys/ufs/ffs/fs.h ============================================================================== --- stable/9/sys/ufs/ffs/fs.h Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/ufs/ffs/fs.h Sat Feb 2 09:57:34 2013 (r246234) @@ -33,6 +33,9 @@ #ifndef _UFS_FFS_FS_H_ #define _UFS_FFS_FS_H_ +#include +#include + /* * Each disk drive contains some number of filesystems. * A filesystem consists of a number of cylinder groups. @@ -762,4 +765,10 @@ CTASSERT(sizeof(union jrec) == JREC_SIZE extern int inside[], around[]; extern u_char *fragtbl[]; +/* + * IOCTLs used for filesystem write suspension. + */ +#define UFSSUSPEND _IOW('U', 1, fsid_t) +#define UFSRESUME _IO('U', 2) + #endif Modified: stable/9/sys/ufs/ufs/ufsmount.h ============================================================================== --- stable/9/sys/ufs/ufs/ufsmount.h Sat Feb 2 09:35:14 2013 (r246233) +++ stable/9/sys/ufs/ufs/ufsmount.h Sat Feb 2 09:57:34 2013 (r246234) @@ -98,6 +98,7 @@ struct ufsmount { char um_qflags[MAXQUOTAS]; /* quota specific flags */ int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ int um_candelete; /* devvp supports TRIM */ + int um_writesuspended; /* suspension in progress */ int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **); int (*um_truncate)(struct vnode *, off_t, int, struct ucred *, struct thread *); From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 10:00:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 89A2482E; Sat, 2 Feb 2013 10:00:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D85E87A; Sat, 2 Feb 2013 10:00:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12A0lMD095621; Sat, 2 Feb 2013 10:00:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12A0lTQ095619; Sat, 2 Feb 2013 10:00:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302021000.r12A0lTQ095619@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 2 Feb 2013 10:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246235 - stable/9/sbin/growfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 10:00:47 -0000 Author: trasz Date: Sat Feb 2 10:00:46 2013 New Revision: 246235 URL: http://svnweb.freebsd.org/changeset/base/246235 Log: MFC r243246: Make it possible to resize filesystems mounted read-write, using newly introduced UFS write suspension mechanism. Reviewed by: kib, mckusick Sponsored by: FreeBSD Foundation Modified: stable/9/sbin/growfs/growfs.8 stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.8 ============================================================================== --- stable/9/sbin/growfs/growfs.8 Sat Feb 2 09:57:34 2013 (r246234) +++ stable/9/sbin/growfs/growfs.8 Sat Feb 2 10:00:46 2013 (r246235) @@ -115,11 +115,17 @@ The .Nm utility first appeared in .Fx 4.4 . +The ability to resize mounted filesystems was added in +.Fx 10.0 . .Sh AUTHORS .An Christoph Herrmann Aq chm@FreeBSD.org .An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org .An The GROWFS team Aq growfs@Tomsoft.COM .An Edward Tomasz Napierala Aq trasz@FreeBSD.org +.Sh CAVEATS +.Pp +When expanding a file system mounted read-write, any writes to that file system +will be temporarily suspended until the expansion is finished. .Sh BUGS .Pp Normally Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Feb 2 09:57:34 2013 (r246234) +++ stable/9/sbin/growfs/growfs.c Sat Feb 2 10:00:46 2013 (r246235) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1523,8 +1524,9 @@ main(int argc, char **argv) if (yflag == 0 && Nflag == 0) { if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) - errx(1, "%s is mounted read-write on %s", - statfsp->f_mntfromname, statfsp->f_mntonname); + printf("Device is mounted read-write; resizing will " + "result in temporary write suspension for %s.\n", + statfsp->f_mntonname); printf("It's strongly recommended to make a backup " "before growing the file system.\n" "OK to grow filesystem on %s", device); @@ -1553,9 +1555,18 @@ main(int argc, char **argv) if (Nflag) { fso = -1; } else { - fso = open(device, O_WRONLY); - if (fso < 0) - err(1, "%s", device); + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { + fso = open(_PATH_UFSSUSPEND, O_RDWR); + if (fso == -1) + err(1, "unable to open %s", _PATH_UFSSUSPEND); + error = ioctl(fso, UFSSUSPEND, &statfsp->f_fsid); + if (error != 0) + err(1, "UFSSUSPEND"); + } else { + fso = open(device, O_WRONLY); + if (fso < 0) + err(1, "%s", device); + } } /* @@ -1625,12 +1636,17 @@ main(int argc, char **argv) close(fsi); if (fso > -1) { + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { + error = ioctl(fso, UFSRESUME); + if (error != 0) + err(1, "UFSRESUME"); + } error = close(fso); if (error != 0) err(1, "close"); + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) != 0) + mount_reload(statfsp); } - if (statfsp != NULL) - mount_reload(statfsp); DBG_CLOSE; From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 10:02:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CB4E09DE; Sat, 2 Feb 2013 10:02:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD4E9889; Sat, 2 Feb 2013 10:02:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12A2Qvj097417; Sat, 2 Feb 2013 10:02:26 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12A2QnC097415; Sat, 2 Feb 2013 10:02:26 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302021002.r12A2QnC097415@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 2 Feb 2013 10:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246236 - stable/9/sbin/growfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 10:02:26 -0000 Author: trasz Date: Sat Feb 2 10:02:26 2013 New Revision: 246236 URL: http://svnweb.freebsd.org/changeset/base/246236 Log: MFC r244243: Fix extending filesystems of weird size by making sure the actual size is always multiple of fragment size. Modified: stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Feb 2 10:00:46 2013 (r246235) +++ stable/9/sbin/growfs/growfs.c Sat Feb 2 10:02:26 2013 (r246236) @@ -1486,6 +1486,12 @@ main(int argc, char **argv) } } + /* + * Make sure the new size is a multiple of fs_fsize; /dev/ufssuspend + * only supports fragment-aligned IO requests. + */ + size -= size % osblock.fs_fsize; + if (size <= (uint64_t)(osblock.fs_size * osblock.fs_fsize)) { humanize_number(oldsizebuf, sizeof(oldsizebuf), osblock.fs_size * osblock.fs_fsize, From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 10:04:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 166A9C8A; Sat, 2 Feb 2013 10:04:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F240B89E; Sat, 2 Feb 2013 10:04:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12A4N8I097820; Sat, 2 Feb 2013 10:04:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12A4N9x097819; Sat, 2 Feb 2013 10:04:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302021004.r12A4N9x097819@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 2 Feb 2013 10:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246237 - stable/9/sbin/growfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 10:04:24 -0000 Author: trasz Date: Sat Feb 2 10:04:23 2013 New Revision: 246237 URL: http://svnweb.freebsd.org/changeset/base/246237 Log: MFC r244295: When growing a filesystem, don't leave unused space at the end if there is not enough room for a full cylinder group. Reviewed by: mckusick@ Modified: stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Feb 2 10:02:26 2013 (r246236) +++ stable/9/sbin/growfs/growfs.c Sat Feb 2 10:04:23 2013 (r246237) @@ -1609,17 +1609,20 @@ main(int argc, char **argv) } sblock.fs_ncg = howmany(sblock.fs_size, sblock.fs_fpg); + /* + * Allocate last cylinder group only if there is enough room + * for at least one data block. + */ if (sblock.fs_size % sblock.fs_fpg != 0 && - sblock.fs_size % sblock.fs_fpg < cgdmin(&sblock, sblock.fs_ncg)) { - /* - * The space in the new last cylinder group is too small, - * so revert back. - */ + sblock.fs_size <= cgdmin(&sblock, sblock.fs_ncg - 1)) { + humanize_number(oldsizebuf, sizeof(oldsizebuf), + (sblock.fs_size % sblock.fs_fpg) * sblock.fs_fsize, + "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + warnx("no room to allocate last cylinder group; " + "leaving %s unused", oldsizebuf); sblock.fs_ncg--; if (sblock.fs_magic == FS_UFS1_MAGIC) sblock.fs_old_ncyl = sblock.fs_ncg * sblock.fs_old_cpg; - printf("Warning: %jd sector(s) cannot be allocated.\n", - (intmax_t)fsbtodb(&sblock, sblock.fs_size % sblock.fs_fpg)); sblock.fs_size = sblock.fs_ncg * sblock.fs_fpg; } From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 11:20:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C78C71C; Sat, 2 Feb 2013 11:20:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4EDABAE6; Sat, 2 Feb 2013 11:20:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12BKbMB020114; Sat, 2 Feb 2013 11:20:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12BKbGX020113; Sat, 2 Feb 2013 11:20:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021120.r12BKbGX020113@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246239 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 11:20:37 -0000 Author: avg Date: Sat Feb 2 11:20:36 2013 New Revision: 246239 URL: http://svnweb.freebsd.org/changeset/base/246239 Log: MFC r245945: spa_generate_rootconf: add support for old vdev labels Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Feb 2 11:04:04 2013 (r246238) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Feb 2 11:20:36 2013 (r246239) @@ -3775,9 +3775,8 @@ spa_generate_rootconf(const char *name) /* * Multi-vdev root pool configuration discovery is not supported yet. */ - nchildren = 0; - VERIFY(nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, - &nchildren) == 0); + nchildren = 1; + nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); holes = NULL; nvlist_lookup_uint64_array(best_cfg, ZPOOL_CONFIG_HOLE_ARRAY, &holes, &nholes); From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 11:25:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2E158E1; Sat, 2 Feb 2013 11:25:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B06A9B12; Sat, 2 Feb 2013 11:25:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12BPAal022177; Sat, 2 Feb 2013 11:25:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12BPA1F022176; Sat, 2 Feb 2013 11:25:10 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021125.r12BPA1F022176@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246240 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 11:25:10 -0000 Author: avg Date: Sat Feb 2 11:25:10 2013 New Revision: 246240 URL: http://svnweb.freebsd.org/changeset/base/246240 Log: MFC r245945: spa_generate_rootconf: add support for old vdev labels Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Feb 2 11:20:36 2013 (r246239) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Feb 2 11:25:10 2013 (r246240) @@ -3775,9 +3775,8 @@ spa_generate_rootconf(const char *name) /* * Multi-vdev root pool configuration discovery is not supported yet. */ - nchildren = 0; - VERIFY(nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, - &nchildren) == 0); + nchildren = 1; + nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); holes = NULL; nvlist_lookup_uint64_array(best_cfg, ZPOOL_CONFIG_HOLE_ARRAY, &holes, &nholes); From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 11:30:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D79B4AB6; Sat, 2 Feb 2013 11:30:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C937BB3C; Sat, 2 Feb 2013 11:30:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12BUr9V022991; Sat, 2 Feb 2013 11:30:53 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12BUrup022990; Sat, 2 Feb 2013 11:30:53 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021130.r12BUrup022990@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246241 - stable/9/sys/geom/mirror X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 11:30:53 -0000 Author: avg Date: Sat Feb 2 11:30:53 2013 New Revision: 246241 URL: http://svnweb.freebsd.org/changeset/base/246241 Log: MFC r245946: g_mirror: g_getattr() failure should not be fatal PR: kern/175323 Modified: stable/9/sys/geom/mirror/g_mirror.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Sat Feb 2 11:25:10 2013 (r246240) +++ stable/9/sys/geom/mirror/g_mirror.c Sat Feb 2 11:30:53 2013 (r246241) @@ -456,9 +456,7 @@ g_mirror_init_disk(struct g_mirror_softc disk->d_priority = md->md_priority; disk->d_flags = md->md_dflags; error = g_getattr("GEOM::candelete", disk->d_consumer, &i); - if (error != 0) - goto fail; - if (i) + if (error == 0 && i != 0) disk->d_flags |= G_MIRROR_DISK_FLAG_CANDELETE; if (md->md_provider[0] != '\0') disk->d_flags |= G_MIRROR_DISK_FLAG_HARDCODED; From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 11:35:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C3C12C4C; Sat, 2 Feb 2013 11:35:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9F537B5C; Sat, 2 Feb 2013 11:35:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12BZIaQ025140; Sat, 2 Feb 2013 11:35:18 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12BZIHe025139; Sat, 2 Feb 2013 11:35:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021135.r12BZIHe025139@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246242 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 11:35:18 -0000 Author: avg Date: Sat Feb 2 11:35:18 2013 New Revision: 246242 URL: http://svnweb.freebsd.org/changeset/base/246242 Log: zfs: add MODULE_VERSION for zfsctrl This should allow the kernel linker to easily detect a situation when the module is present both in a kernel and in a preloaded file (zfs.ko). Reviewed by: jhb MFC after: 5 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Feb 2 11:30:53 2013 (r246241) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Feb 2 11:35:18 2013 (r246242) @@ -5536,6 +5536,7 @@ static moduledata_t zfs_mod = { 0 }; DECLARE_MODULE(zfsctrl, zfs_mod, SI_SUB_VFS, SI_ORDER_ANY); +MODULE_VERSION(zfsctrl, 1); MODULE_DEPEND(zfsctrl, opensolaris, 1, 1, 1); MODULE_DEPEND(zfsctrl, krpc, 1, 1, 1); MODULE_DEPEND(zfsctrl, acl_nfs4, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 11:38:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 756A5E7C; Sat, 2 Feb 2013 11:38:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5955CBDE; Sat, 2 Feb 2013 11:38:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12BcSen025581; Sat, 2 Feb 2013 11:38:28 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12BcRwr025576; Sat, 2 Feb 2013 11:38:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021138.r12BcRwr025576@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246243 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 11:38:28 -0000 Author: avg Date: Sat Feb 2 11:38:26 2013 New Revision: 246243 URL: http://svnweb.freebsd.org/changeset/base/246243 Log: uart: add resume method and enable it for attachments on the most common x86 buses Otherwise the uart hardware could be in such a state after the resume where IER is cleared and thus no interrupts are generated. This behavior is observed and tested with QEMU, so I am comitting this change to help with my debugging. There has been no feedback from users of serial ports on real hardware. MFC after: 20 days Modified: head/sys/dev/uart/uart_bus.h head/sys/dev/uart/uart_bus_acpi.c head/sys/dev/uart/uart_bus_isa.c head/sys/dev/uart/uart_bus_pci.c head/sys/dev/uart/uart_core.c Modified: head/sys/dev/uart/uart_bus.h ============================================================================== --- head/sys/dev/uart/uart_bus.h Sat Feb 2 11:35:18 2013 (r246242) +++ head/sys/dev/uart/uart_bus.h Sat Feb 2 11:38:26 2013 (r246243) @@ -138,6 +138,7 @@ extern char uart_driver_name[]; int uart_bus_attach(device_t dev); int uart_bus_detach(device_t dev); +int uart_bus_resume(device_t dev); serdev_intr_t *uart_bus_ihand(device_t dev, int ipend); int uart_bus_ipend(device_t dev); int uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan); Modified: head/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- head/sys/dev/uart/uart_bus_acpi.c Sat Feb 2 11:35:18 2013 (r246242) +++ head/sys/dev/uart/uart_bus_acpi.c Sat Feb 2 11:38:26 2013 (r246243) @@ -47,6 +47,7 @@ static device_method_t uart_acpi_methods DEVMETHOD(device_probe, uart_acpi_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: head/sys/dev/uart/uart_bus_isa.c ============================================================================== --- head/sys/dev/uart/uart_bus_isa.c Sat Feb 2 11:35:18 2013 (r246242) +++ head/sys/dev/uart/uart_bus_isa.c Sat Feb 2 11:38:26 2013 (r246243) @@ -50,6 +50,7 @@ static device_method_t uart_isa_methods[ DEVMETHOD(device_probe, uart_isa_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Sat Feb 2 11:35:18 2013 (r246242) +++ head/sys/dev/uart/uart_bus_pci.c Sat Feb 2 11:38:26 2013 (r246243) @@ -51,6 +51,7 @@ static device_method_t uart_pci_methods[ DEVMETHOD(device_probe, uart_pci_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Sat Feb 2 11:35:18 2013 (r246242) +++ head/sys/dev/uart/uart_core.c Sat Feb 2 11:38:26 2013 (r246243) @@ -590,3 +590,12 @@ uart_bus_detach(device_t dev) return (0); } + +int +uart_bus_resume(device_t dev) +{ + struct uart_softc *sc; + + sc = device_get_softc(dev); + return (UART_ATTACH(sc)); +} From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 11:41:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E6BE75; Sat, 2 Feb 2013 11:41:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 482C1BF3; Sat, 2 Feb 2013 11:41:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12Bf61U027529; Sat, 2 Feb 2013 11:41:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12Bf6cV027528; Sat, 2 Feb 2013 11:41:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021141.r12Bf6cV027528@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246244 - head/sys/cddl/compat/opensolaris/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 11:41:06 -0000 Author: avg Date: Sat Feb 2 11:41:05 2013 New Revision: 246244 URL: http://svnweb.freebsd.org/changeset/base/246244 Log: solaris compat: remove KM_ZERO - there is no such flag in Solaris and derivatives - the flag was added in an unrelated change - the flag is not used The proper way to allocate zeroed out memory is to use kmem_zalloc. MFC after: 3 days Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Feb 2 11:38:26 2013 (r246243) +++ head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Feb 2 11:41:05 2013 (r246244) @@ -45,7 +45,6 @@ MALLOC_DECLARE(M_SOLARIS); #define KM_SLEEP M_WAITOK #define KM_PUSHPAGE M_WAITOK #define KM_NOSLEEP M_NOWAIT -#define KM_ZERO M_ZERO #define KM_NODEBUG M_NODUMP #define KMC_NODEBUG UMA_ZONE_NODUMP #define KMC_NOTOUCH 0 From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 11:54:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B8488668; Sat, 2 Feb 2013 11:54:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AB93DCFD; Sat, 2 Feb 2013 11:54:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12Bs0uI030832; Sat, 2 Feb 2013 11:54:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12Bs0tp030831; Sat, 2 Feb 2013 11:54:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021154.r12Bs0tp030831@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246245 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 11:54:00 -0000 Author: avg Date: Sat Feb 2 11:54:00 2013 New Revision: 246245 URL: http://svnweb.freebsd.org/changeset/base/246245 Log: ng_ether: track interface renaming Also sanitize interface names that can potentially contain characters that are prohibited in netgraph names. PR: kern/154850 (sanitizing of names) Discussed with: eri, melifaro Submitted by: Nikolay Denev (sanitizing code) Reviewed by: eri, glebius MFC after: 17 days Modified: head/sys/netgraph/ng_ether.c Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Sat Feb 2 11:41:05 2013 (r246244) +++ head/sys/netgraph/ng_ether.c Sat Feb 2 11:54:00 2013 (r246245) @@ -117,6 +117,8 @@ static ng_rcvdata_t ng_ether_rcvdata; static ng_disconnect_t ng_ether_disconnect; static int ng_ether_mod_event(module_t mod, int event, void *data); +static eventhandler_tag ng_ether_ifnet_arrival_cookie; + /* List of commands and how to convert arguments to/from ASCII */ static const struct ng_cmdlist ng_ether_cmdlist[] = { { @@ -214,6 +216,24 @@ static struct ng_type ng_ether_typestruc NETGRAPH_INIT(ether, &ng_ether_typestruct); /****************************************************************** + UTILITY FUNCTIONS +******************************************************************/ +static void +ng_ether_sanitize_ifname(const char *ifname, char *name) +{ + int i; + + for (i = 0; i < IFNAMSIZ; i++) { + if (ifname[i] == '.' || ifname[i] == ':') + name[i] = '_'; + else + name[i] = ifname[i]; + if (name[i] == '\0') + break; + } +} + +/****************************************************************** ETHERNET FUNCTION HOOKS ******************************************************************/ @@ -282,6 +302,7 @@ ng_ether_output(struct ifnet *ifp, struc static void ng_ether_attach(struct ifnet *ifp) { + char name[IFNAMSIZ]; priv_p priv; node_p node; @@ -319,10 +340,9 @@ ng_ether_attach(struct ifnet *ifp) priv->hwassist = ifp->if_hwassist; /* Try to give the node the same name as the interface */ - if (ng_name_node(node, ifp->if_xname) != 0) { - log(LOG_WARNING, "%s: can't name node %s\n", - __func__, ifp->if_xname); - } + ng_ether_sanitize_ifname(ifp->if_xname, name); + if (ng_name_node(node, name) != 0) + log(LOG_WARNING, "%s: can't name node %s\n", __func__, name); } /* @@ -378,6 +398,32 @@ ng_ether_link_state(struct ifnet *ifp, i } } +/* + * Interface arrival notification handler. + * The notification is produced in two cases: + * o a new interface arrives + * o an existing interface got renamed + * Currently the first case is handled by ng_ether_attach via special + * hook ng_ether_attach_p. + */ +static void +ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) +{ + char name[IFNAMSIZ]; + node_p node = IFP2NG(ifp); + + /* + * Just return if it's a new interface without an ng_ether companion. + */ + if (node == NULL) + return; + + /* Try to give the node the same name as the new interface name */ + ng_ether_sanitize_ifname(ifp->if_xname, name); + if (ng_name_node(node, name) != 0) + log(LOG_WARNING, "%s: can't re-name node %s\n", __func__, name); +} + /****************************************************************** NETGRAPH NODE METHODS ******************************************************************/ @@ -771,6 +817,9 @@ ng_ether_mod_event(module_t mod, int eve ng_ether_input_orphan_p = ng_ether_input_orphan; ng_ether_link_state_p = ng_ether_link_state; + ng_ether_ifnet_arrival_cookie = + EVENTHANDLER_REGISTER(ifnet_arrival_event, + ng_ether_ifnet_arrival_event, NULL, EVENTHANDLER_PRI_ANY); break; case MOD_UNLOAD: @@ -783,6 +832,9 @@ ng_ether_mod_event(module_t mod, int eve * is MOD_UNLOAD, so there's no need to detach any nodes. */ + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, + ng_ether_ifnet_arrival_cookie); + /* Unregister function hooks */ ng_ether_attach_p = NULL; ng_ether_detach_p = NULL; From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 11:58:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C41F2810; Sat, 2 Feb 2013 11:58:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A817BD22; Sat, 2 Feb 2013 11:58:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12Bwa5i031465; Sat, 2 Feb 2013 11:58:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12BwZ7a031460; Sat, 2 Feb 2013 11:58:35 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021158.r12BwZ7a031460@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246246 - in head/sys: conf kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 11:58:36 -0000 Author: avg Date: Sat Feb 2 11:58:35 2013 New Revision: 246246 URL: http://svnweb.freebsd.org/changeset/base/246246 Log: print compiler version in the kernel banner And provide kernel compiler version as a sysctl as well. This is useful while we have gcc and clang cohabitation. This could be even more useful when we have support for external toolchains. In cooperation with: mjg MFC after: 13 days Modified: head/sys/conf/newvers.sh head/sys/kern/init_main.c head/sys/kern/kern_mib.c head/sys/sys/systm.h Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sat Feb 2 11:54:00 2013 (r246245) +++ head/sys/conf/newvers.sh Sat Feb 2 11:58:35 2013 (r246246) @@ -86,6 +86,7 @@ fi touch version v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` i=`${MAKE:-make} -V KERN_IDENT` +compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version') for dir in /bin /usr/bin /usr/local/bin; do if [ -x "${dir}/svnversion" ] && [ -z ${svnversion} ] ; then @@ -159,6 +160,7 @@ $COPYRIGHT char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; +char compiler_version[] = "${compiler_v}"; char ostype[] = "${TYPE}"; char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; int osreldate = ${RELDATE}; Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sat Feb 2 11:54:00 2013 (r246245) +++ head/sys/kern/init_main.c Sat Feb 2 11:58:35 2013 (r246246) @@ -325,6 +325,7 @@ print_version(void *data __unused) while (len > 0 && version[len - 1] == '\n') len--; printf("%.*s %s\n", len, version, machine); + printf("%s\n", compiler_version); } SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Sat Feb 2 11:54:00 2013 (r246245) +++ head/sys/kern/kern_mib.c Sat Feb 2 11:58:35 2013 (r246246) @@ -99,6 +99,9 @@ SYSCTL_INT(_kern, KERN_OSREV, osrevision SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE, version, 0, "Kernel version"); +SYSCTL_STRING(_kern, KERN_VERSION, compiler_version, CTLFLAG_RD|CTLFLAG_MPSAFE, + compiler_version, 0, "Version of compiler used to compile kernel"); + SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE| CTLFLAG_CAPRD, ostype, 0, "Operating system type"); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat Feb 2 11:54:00 2013 (r246245) +++ head/sys/sys/systm.h Sat Feb 2 11:58:35 2013 (r246246) @@ -49,6 +49,7 @@ extern int cold; /* nonzero if we are d extern int rebooting; /* kern_reboot() has been called. */ extern const char *panicstr; /* panic message */ extern char version[]; /* system version */ +extern char compiler_version[]; /* system version */ extern char copyright[]; /* system copyright */ extern int kstack_pages; /* number of kernel stack pages */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 12:02:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 19C71C86; Sat, 2 Feb 2013 12:02:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 00F92DA8; Sat, 2 Feb 2013 12:02:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12C2hJ0033799; Sat, 2 Feb 2013 12:02:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12C2hPE033794; Sat, 2 Feb 2013 12:02:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021202.r12C2hPE033794@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 12:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246247 - in head/sys: amd64/include i386/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 12:02:44 -0000 Author: avg Date: Sat Feb 2 12:02:42 2013 New Revision: 246247 URL: http://svnweb.freebsd.org/changeset/base/246247 Log: x86 suspend/resume: suspend pics and pseudo-pics in reverse order - change 'pics' from STAILQ to TAILQ - ensure that Local APIC is always first in 'pics' Reviewed by: jhb Tested by: Sergey V. Dyatko , KAHO Toshikazu MFC after: 12 days Modified: head/sys/amd64/include/intr_machdep.h head/sys/i386/include/intr_machdep.h head/sys/x86/x86/intr_machdep.c head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/include/intr_machdep.h ============================================================================== --- head/sys/amd64/include/intr_machdep.h Sat Feb 2 11:58:35 2013 (r246246) +++ head/sys/amd64/include/intr_machdep.h Sat Feb 2 12:02:42 2013 (r246247) @@ -94,7 +94,7 @@ struct pic { int (*pic_config_intr)(struct intsrc *, enum intr_trigger, enum intr_polarity); int (*pic_assign_cpu)(struct intsrc *, u_int apic_id); - STAILQ_ENTRY(pic) pics; + TAILQ_ENTRY(pic) pics; }; /* Flags for pic_disable_source() */ Modified: head/sys/i386/include/intr_machdep.h ============================================================================== --- head/sys/i386/include/intr_machdep.h Sat Feb 2 11:58:35 2013 (r246246) +++ head/sys/i386/include/intr_machdep.h Sat Feb 2 12:02:42 2013 (r246247) @@ -94,7 +94,7 @@ struct pic { int (*pic_config_intr)(struct intsrc *, enum intr_trigger, enum intr_polarity); int (*pic_assign_cpu)(struct intsrc *, u_int apic_id); - STAILQ_ENTRY(pic) pics; + TAILQ_ENTRY(pic) pics; }; /* Flags for pic_disable_source() */ Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Sat Feb 2 11:58:35 2013 (r246246) +++ head/sys/x86/x86/intr_machdep.c Sat Feb 2 12:02:42 2013 (r246247) @@ -78,7 +78,7 @@ static int intrcnt_index; static struct intsrc *interrupt_sources[NUM_IO_INTS]; static struct mtx intr_table_lock; static struct mtx intrcnt_lock; -static STAILQ_HEAD(, pic) pics; +static TAILQ_HEAD(pics_head, pic) pics; #ifdef SMP static int assign_cpu; @@ -102,7 +102,7 @@ intr_pic_registered(struct pic *pic) { struct pic *p; - STAILQ_FOREACH(p, &pics, pics) { + TAILQ_FOREACH(p, &pics, pics) { if (p == pic) return (1); } @@ -124,7 +124,7 @@ intr_register_pic(struct pic *pic) if (intr_pic_registered(pic)) error = EBUSY; else { - STAILQ_INSERT_TAIL(&pics, pic, pics); + TAILQ_INSERT_TAIL(&pics, pic, pics); error = 0; } mtx_unlock(&intr_table_lock); @@ -287,7 +287,7 @@ intr_resume(void) atpic_reset(); #endif mtx_lock(&intr_table_lock); - STAILQ_FOREACH(pic, &pics, pics) { + TAILQ_FOREACH(pic, &pics, pics) { if (pic->pic_resume != NULL) pic->pic_resume(pic); } @@ -300,7 +300,7 @@ intr_suspend(void) struct pic *pic; mtx_lock(&intr_table_lock); - STAILQ_FOREACH(pic, &pics, pics) { + TAILQ_FOREACH_REVERSE(pic, &pics, pics_head, pics) { if (pic->pic_suspend != NULL) pic->pic_suspend(pic); } @@ -381,7 +381,7 @@ intr_init(void *dummy __unused) intrcnt_setname("???", 0); intrcnt_index = 1; - STAILQ_INIT(&pics); + TAILQ_INIT(&pics); mtx_init(&intr_table_lock, "intr sources", NULL, MTX_DEF); mtx_init(&intrcnt_lock, "intrcnt", NULL, MTX_SPIN); } Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Sat Feb 2 11:58:35 2013 (r246246) +++ head/sys/x86/x86/local_apic.c Sat Feb 2 12:02:42 2013 (r246247) @@ -1360,11 +1360,19 @@ apic_setup_io(void *dummy __unused) if (best_enum == NULL) return; + + /* + * Local APIC must be registered before other PICs and pseudo PICs + * for proper suspend/resume order. + */ +#ifndef XEN + intr_register_pic(&lapic_pic); +#endif + retval = best_enum->apic_setup_io(); if (retval != 0) printf("%s: Failed to setup I/O APICs: returned %d\n", best_enum->apic_name, retval); - #ifdef XEN return; #endif @@ -1373,7 +1381,6 @@ apic_setup_io(void *dummy __unused) * properly program the LINT pins. */ lapic_setup(1); - intr_register_pic(&lapic_pic); if (bootverbose) lapic_dump("BSP"); From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 12:04:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AAD4CE1A; Sat, 2 Feb 2013 12:04:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9244EDBD; Sat, 2 Feb 2013 12:04:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12C4X0b034137; Sat, 2 Feb 2013 12:04:33 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12C4XP5034135; Sat, 2 Feb 2013 12:04:33 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021204.r12C4XP5034135@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 12:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246248 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 12:04:33 -0000 Author: avg Date: Sat Feb 2 12:04:32 2013 New Revision: 246248 URL: http://svnweb.freebsd.org/changeset/base/246248 Log: cpususpend_handler: mark AP as resumed only after fully setting up lapic Reviewed by: jhb Tested by: Sergey V. Dyatko , KAHO Toshikazu MFC after: 12 days Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sat Feb 2 12:02:42 2013 (r246247) +++ head/sys/amd64/amd64/mp_machdep.c Sat Feb 2 12:04:32 2013 (r246248) @@ -1431,11 +1431,11 @@ cpususpend_handler(void) while (!CPU_ISSET(cpu, &started_cpus)) ia32_pause(); - CPU_CLR_ATOMIC(cpu, &started_cpus); - /* Resume MCA and local APIC */ mca_resume(); lapic_setup(0); + + CPU_CLR_ATOMIC(cpu, &started_cpus); } /* Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Sat Feb 2 12:02:42 2013 (r246247) +++ head/sys/i386/i386/mp_machdep.c Sat Feb 2 12:04:32 2013 (r246248) @@ -1528,11 +1528,11 @@ cpususpend_handler(void) while (!CPU_ISSET(cpu, &started_cpus)) ia32_pause(); - CPU_CLR_ATOMIC(cpu, &started_cpus); - /* Resume MCA and local APIC */ mca_resume(); lapic_setup(0); + + CPU_CLR_ATOMIC(cpu, &started_cpus); } /* * This is called once the rest of the system is up and running and we're From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 12:08:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB27E15F; Sat, 2 Feb 2013 12:08:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3A62DEF; Sat, 2 Feb 2013 12:08:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12C8SfB034903; Sat, 2 Feb 2013 12:08:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12C8S3M034902; Sat, 2 Feb 2013 12:08:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302021208.r12C8S3M034902@svn.freebsd.org> From: Dimitry Andric Date: Sat, 2 Feb 2013 12:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246249 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 12:08:28 -0000 Author: dim Date: Sat Feb 2 12:08:28 2013 New Revision: 246249 URL: http://svnweb.freebsd.org/changeset/base/246249 Log: MFC r246131: Fix a problem introduced in r231057: in bsd.own.mk, move the test for whether clang is enabled to just after the last place where it could have been forced to "no". Modified: stable/9/share/mk/bsd.own.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Sat Feb 2 12:04:32 2013 (r246248) +++ stable/9/share/mk/bsd.own.mk Sat Feb 2 12:08:28 2013 (r246249) @@ -531,10 +531,6 @@ MK_ZFS:= no MK_CTF:= no .endif -.if ${MK_CLANG} == "no" -MK_CLANG_EXTRAS:= no -.endif - .if ${MK_CRYPT} == "no" MK_OPENSSL:= no MK_OPENSSH:= no @@ -581,6 +577,7 @@ MK_GDB:= no .endif .if ${MK_CLANG} == "no" +MK_CLANG_EXTRAS:= no MK_CLANG_IS_CC:= no .endif From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 12:42:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 94FAA7AE; Sat, 2 Feb 2013 12:42:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FE3BF25; Sat, 2 Feb 2013 12:42:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12Cg8FS045740; Sat, 2 Feb 2013 12:42:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12Cg8Sb045739; Sat, 2 Feb 2013 12:42:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021242.r12Cg8Sb045739@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 12:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246250 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 12:42:08 -0000 Author: avg Date: Sat Feb 2 12:42:07 2013 New Revision: 246250 URL: http://svnweb.freebsd.org/changeset/base/246250 Log: acpi: after wakeup from a state > S1 re-enable SCI_EN with a direct write This hack is picked up from Linux, which claims that it follows Windows behavior. PR: amd64/174409 Tested by: Sergey V. Dyatko , KAHO Toshikazu , Slawa Olhovchenkov MFC after: 13 days Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sat Feb 2 12:08:28 2013 (r246249) +++ head/sys/dev/acpica/acpi.c Sat Feb 2 12:42:07 2013 (r246250) @@ -278,7 +278,7 @@ TUNABLE_INT("debug.acpi.interpreter_slac SYSCTL_INT(_debug_acpi, OID_AUTO, interpreter_slack, CTLFLAG_RDTUN, &acpi_interpreter_slack, 1, "Turn on interpreter slack mode."); -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) /* Reset system clock while resuming. XXX Remove once tested. */ static int acpi_reset_clock = 1; TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock); @@ -2744,6 +2744,19 @@ acpi_EnterSleepState(struct acpi_softc * if (state != ACPI_STATE_S1) { sleep_result = acpi_sleep_machdep(sc, state); acpi_wakeup_machdep(sc, state, sleep_result, 0); + + /* + * XXX According to ACPI specification SCI_EN bit should be restored + * by ACPI platform (BIOS, firmware) to its pre-sleep state. + * Unfortunately some BIOSes fail to do that and that leads to + * unexpected and serious consequences during wake up like a system + * getting stuck in SMI handlers. + * This hack is picked up from Linux, which claims that it follows + * Windows behavior. + */ + if (sleep_result == 1 && state != ACPI_STATE_S4) + AcpiWriteBitRegister(ACPI_BITREG_SCI_ENABLE, ACPI_ENABLE_EVENT); + AcpiLeaveSleepStatePrep(state); intr_restore(intr); @@ -2810,7 +2823,7 @@ backout: static void acpi_resync_clock(struct acpi_softc *sc) { -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) if (!acpi_reset_clock) return; From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 12:44:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5635993F; Sat, 2 Feb 2013 12:44:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D686F3D; Sat, 2 Feb 2013 12:44:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12CiKNv046080; Sat, 2 Feb 2013 12:44:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12CiKgj046079; Sat, 2 Feb 2013 12:44:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021244.r12CiKgj046079@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 12:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246251 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 12:44:20 -0000 Author: avg Date: Sat Feb 2 12:44:19 2013 New Revision: 246251 URL: http://svnweb.freebsd.org/changeset/base/246251 Log: acpi: clear power button status bit after waking up... so that it is not confused for a new power off request. Learned from: Linux and ACPI specification Tested by: gjb MFC after: 12 days Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sat Feb 2 12:42:07 2013 (r246250) +++ head/sys/dev/acpica/acpi.c Sat Feb 2 12:44:19 2013 (r246251) @@ -2659,6 +2659,7 @@ acpi_EnterSleepState(struct acpi_softc * { register_t intr; ACPI_STATUS status; + ACPI_EVENT_STATUS power_button_status; enum acpi_sleep_state slp_state; int sleep_result; @@ -2758,6 +2759,30 @@ acpi_EnterSleepState(struct acpi_softc * AcpiWriteBitRegister(ACPI_BITREG_SCI_ENABLE, ACPI_ENABLE_EVENT); AcpiLeaveSleepStatePrep(state); + + if (sleep_result == 1 && state == ACPI_STATE_S3) { + /* + * Prevent mis-interpretation of the wakeup by power button + * as a request for power off. + * Ideally we should post an appropriate wakeup event, + * perhaps using acpi_event_power_button_wake or alike. + * + * Clearing of power button status after wakeup is mandated + * by ACPI specification in section "Fixed Power Button". + * + * XXX As of ACPICA 20121114 AcpiGetEventStatus provides + * status as 0/1 corressponding to inactive/active despite + * its type being ACPI_EVENT_STATUS. In other words, + * we should not test for ACPI_EVENT_FLAG_SET for time being. + */ + if (ACPI_SUCCESS(AcpiGetEventStatus(ACPI_EVENT_POWER_BUTTON, + &power_button_status)) && power_button_status != 0) { + AcpiClearEvent(ACPI_EVENT_POWER_BUTTON); + device_printf(sc->acpi_dev, + "cleared fixed power button status\n"); + } + } + intr_restore(intr); /* call acpi_wakeup_machdep() again with interrupt enabled */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 12:51:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 7BC7BB52; Sat, 2 Feb 2013 12:51:22 +0000 (UTC) Date: Sat, 2 Feb 2013 12:51:22 +0000 From: Alexey Dokuchaev To: Andriy Gapon Subject: Re: svn commit: r246251 - head/sys/dev/acpica Message-ID: <20130202125122.GA4975@FreeBSD.org> References: <201302021244.r12CiKgj046079@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201302021244.r12CiKgj046079@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 12:51:22 -0000 On Sat, Feb 02, 2013 at 12:44:20PM +0000, Andriy Gapon wrote: > New Revision: 246251 > URL: http://svnweb.freebsd.org/changeset/base/246251 > > Log: > acpi: clear power button status bit after waking up... > > so that it is not confused for a new power off request. Hmm, I was annoyed by this bug for a while. Will try to test it with 8-stable tonight, thanks! ./danfe From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 12:52:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F185D0E; Sat, 2 Feb 2013 12:52:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D817F99; Sat, 2 Feb 2013 12:52:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12CqiV8048759; Sat, 2 Feb 2013 12:52:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12CqiNT048758; Sat, 2 Feb 2013 12:52:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021252.r12CqiNT048758@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 12:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246252 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 12:52:44 -0000 Author: avg Date: Sat Feb 2 12:52:43 2013 New Revision: 246252 URL: http://svnweb.freebsd.org/changeset/base/246252 Log: revert accidentally committed unneeded changes from r246250 MFC after: 7 days X-MFC with: r246250 Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sat Feb 2 12:44:19 2013 (r246251) +++ head/sys/dev/acpica/acpi.c Sat Feb 2 12:52:43 2013 (r246252) @@ -278,7 +278,7 @@ TUNABLE_INT("debug.acpi.interpreter_slac SYSCTL_INT(_debug_acpi, OID_AUTO, interpreter_slack, CTLFLAG_RDTUN, &acpi_interpreter_slack, 1, "Turn on interpreter slack mode."); -#if defined(__amd64__) || defined(__i386__) +#ifdef __amd64__ /* Reset system clock while resuming. XXX Remove once tested. */ static int acpi_reset_clock = 1; TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock); @@ -2848,7 +2848,7 @@ backout: static void acpi_resync_clock(struct acpi_softc *sc) { -#if defined(__amd64__) || defined(__i386__) +#ifdef __amd64__ if (!acpi_reset_clock) return; From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 13:47:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 39D0CD35; Sat, 2 Feb 2013 13:47:35 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2AB081E0; Sat, 2 Feb 2013 13:47:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12DlZRo064754; Sat, 2 Feb 2013 13:47:35 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12DlYWZ064753; Sat, 2 Feb 2013 13:47:34 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201302021347.r12DlYWZ064753@svn.freebsd.org> From: Antoine Brodin Date: Sat, 2 Feb 2013 13:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246253 - stable/9/libexec/tftpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 13:47:35 -0000 Author: antoine Date: Sat Feb 2 13:47:34 2013 New Revision: 246253 URL: http://svnweb.freebsd.org/changeset/base/246253 Log: MFC r244686 to stable/9: Use correct size in snprintf. Remove unused buffer. PR: 174631 Submitted by: Henning Petersen Modified: stable/9/libexec/tftpd/tftp-io.c Directory Properties: stable/9/libexec/tftpd/ (props changed) Modified: stable/9/libexec/tftpd/tftp-io.c ============================================================================== --- stable/9/libexec/tftpd/tftp-io.c Sat Feb 2 12:52:43 2013 (r246252) +++ stable/9/libexec/tftpd/tftp-io.c Sat Feb 2 13:47:34 2013 (r246253) @@ -87,14 +87,13 @@ errtomsg(int error) { static char ebuf[40]; struct errmsg *pe; - char buf[MAXPKTSIZE]; if (error == 0) return ("success"); for (pe = errmsgs; pe->e_code >= 0; pe++) if (pe->e_code == error) return (pe->e_msg); - snprintf(ebuf, sizeof(buf), "error %d", error); + snprintf(ebuf, sizeof(ebuf), "error %d", error); return (ebuf); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 14:19:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 99E6F630; Sat, 2 Feb 2013 14:19:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8351C3C7; Sat, 2 Feb 2013 14:19:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12EJpq0074191; Sat, 2 Feb 2013 14:19:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12EJpOs074189; Sat, 2 Feb 2013 14:19:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021419.r12EJpOs074189@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 14:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246254 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 14:19:51 -0000 Author: avg Date: Sat Feb 2 14:19:50 2013 New Revision: 246254 URL: http://svnweb.freebsd.org/changeset/base/246254 Log: fix some fat-fingering in r246246 Submitted by: mjg Pointyhat to: avg MFC after: 5 days X-MFC with: r246246 Modified: head/sys/kern/kern_mib.c head/sys/sys/systm.h Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Sat Feb 2 13:47:34 2013 (r246253) +++ head/sys/kern/kern_mib.c Sat Feb 2 14:19:50 2013 (r246254) @@ -99,7 +99,7 @@ SYSCTL_INT(_kern, KERN_OSREV, osrevision SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE, version, 0, "Kernel version"); -SYSCTL_STRING(_kern, KERN_VERSION, compiler_version, CTLFLAG_RD|CTLFLAG_MPSAFE, +SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD|CTLFLAG_MPSAFE, compiler_version, 0, "Version of compiler used to compile kernel"); SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE| Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat Feb 2 13:47:34 2013 (r246253) +++ head/sys/sys/systm.h Sat Feb 2 14:19:50 2013 (r246254) @@ -49,7 +49,7 @@ extern int cold; /* nonzero if we are d extern int rebooting; /* kern_reboot() has been called. */ extern const char *panicstr; /* panic message */ extern char version[]; /* system version */ -extern char compiler_version[]; /* system version */ +extern char compiler_version[]; /* compiler version */ extern char copyright[]; /* system copyright */ extern int kstack_pages; /* number of kernel stack pages */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 15:11:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id A82661D5; Sat, 2 Feb 2013 15:11:37 +0000 (UTC) Date: Sat, 2 Feb 2013 15:11:37 +0000 From: Alexey Dokuchaev To: Andriy Gapon Subject: Re: svn commit: r246251 - head/sys/dev/acpica Message-ID: <20130202151137.GA28366@FreeBSD.org> References: <201302021244.r12CiKgj046079@svn.freebsd.org> <20130202125122.GA4975@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20130202125122.GA4975@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 15:11:37 -0000 On Sat, Feb 02, 2013 at 12:51:22PM +0000, Alexey Dokuchaev wrote: > On Sat, Feb 02, 2013 at 12:44:20PM +0000, Andriy Gapon wrote: > > New Revision: 246251 > > URL: http://svnweb.freebsd.org/changeset/base/246251 > > > > Log: > > acpi: clear power button status bit after waking up... > > so that it is not confused for a new power off request. > > Hmm, I was annoyed by this bug for a while. Will try to test it with > 8-stable tonight, thanks! Andriy, it appears to me that ACPI code is substantially different between 8-stable and head, so the patch cannot be applied as is. I'm not sure where exactly inside acpi_EnterSleepState() does it belong. Could you provide me with some guidance (or even patch for 8-stable)? Thanks. ./danfe From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 18:08:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B2F668B; Sat, 2 Feb 2013 18:08:10 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 843F5E8D; Sat, 2 Feb 2013 18:08:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12I8AWG043255; Sat, 2 Feb 2013 18:08:10 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12I8AJr043254; Sat, 2 Feb 2013 18:08:10 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201302021808.r12I8AJr043254@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 2 Feb 2013 18:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246255 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 18:08:10 -0000 Author: ume Date: Sat Feb 2 18:08:09 2013 New Revision: 246255 URL: http://svnweb.freebsd.org/changeset/base/246255 Log: Use the default policy table of RFC 6724. MFC after: 1 weeks Modified: head/etc/rc.d/ip6addrctl Modified: head/etc/rc.d/ip6addrctl ============================================================================== --- head/etc/rc.d/ip6addrctl Sat Feb 2 14:19:50 2013 (r246254) +++ head/etc/rc.d/ip6addrctl Sat Feb 2 18:08:09 2013 (r246255) @@ -29,11 +29,15 @@ ip6addrctl_prefer_ipv6() afexists inet6 || return 0 ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::1/128 50 0 - ip6addrctl add ::/0 40 1 - ip6addrctl add 2002::/16 30 2 - ip6addrctl add ::/96 20 3 - ip6addrctl add ::ffff:0:0/96 10 4 + ip6addrctl add ::1/128 50 0 + ip6addrctl add ::/0 40 1 + ip6addrctl add ::ffff:0:0/96 35 4 + ip6addrctl add 2002::/16 30 2 + ip6addrctl add 2001::/32 5 5 + ip6addrctl add fc00::/7 3 13 + ip6addrctl add ::/96 1 3 + ip6addrctl add fec0::/10 1 11 + ip6addrctl add 3ffe::/16 1 12 checkyesno ip6addrctl_verbose && ip6addrctl } @@ -42,11 +46,15 @@ ip6addrctl_prefer_ipv4() afexists inet6 || return 0 ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::ffff:0:0/96 50 0 - ip6addrctl add ::1/128 40 1 - ip6addrctl add ::/0 30 2 - ip6addrctl add 2002::/16 20 3 - ip6addrctl add ::/96 10 4 + ip6addrctl add ::1/128 50 0 + ip6addrctl add ::/0 40 1 + ip6addrctl add ::ffff:0:0/96 100 4 + ip6addrctl add 2002::/16 30 2 + ip6addrctl add 2001::/32 5 5 + ip6addrctl add fc00::/7 3 13 + ip6addrctl add ::/96 1 3 + ip6addrctl add fec0::/10 1 11 + ip6addrctl add 3ffe::/16 1 12 checkyesno ip6addrctl_verbose && ip6addrctl } From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 19:23:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0E9C245A; Sat, 2 Feb 2013 19:23:48 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id C8B14141; Sat, 2 Feb 2013 19:23:47 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 2B4004C0244; Sat, 2 Feb 2013 13:23:41 -0600 (CST) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 298EC4C0243; Sat, 2 Feb 2013 13:23:41 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 8rBAWbQo7bWK; Sat, 2 Feb 2013 13:23:41 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 4BF714C0233; Sat, 2 Feb 2013 13:23:40 -0600 (CST) Message-ID: <510D67BA.7070105@rice.edu> Date: Sat, 02 Feb 2013 13:23:38 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130127 Thunderbird/17.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r246204 - head/sys/arm/include References: <201302011026.r11AQVL9068427@svn.freebsd.org> <510C00CB.8000409@rice.edu> <510C1E7A.2090509@freebsd.org> <510C2D24.60303@freebsd.org> <510C3A34.3040702@freebsd.org> In-Reply-To: <510C3A34.3040702@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Juli Mallett , svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 19:23:48 -0000 On 02/01/2013 15:57, Andre Oppermann wrote: > On 01.02.2013 22:16, Juli Mallett wrote: >> On Fri, Feb 1, 2013 at 1:01 PM, Andre Oppermann >> wrote: >>> On 01.02.2013 21:23, Adrian Chadd wrote: >>>> >>>> .. before you make that assumption, please re-visit some the .. >>>> lower-end integrated ethernet MACs in embedded chips. >>>> >>>> I don't know whether the Atheros stuff does (I think it does, but I >>>> don't know under what conditions it's possible.) >>>> >>>> Maybe have it by default not return jumbo mbufs, and if a driver wants >>>> jumbo mbufs it can explicitly ask for them. >>> >>> >>> Jumbo frames do not see wide-spread use. If they are used, then >>> in data centre LAN environments and possibly also inter-datacenter. >>> That is high performance environments. >>> >>> I seriously doubt that lower-end ethernet MACs you're referring to >>> fit that bill. >> >> These are silly generalizations, Andre. I know of low-end systems in >> jumbo frame environments. I think Adrian's implication that Atheros >> hardware can't handle doing scatter-gather into multiple buffers for >> jumbo frames is probably an unlikely one, but if we have hardware that >> requires jumbo mbufs, we should obviously keep supporting jumbo mbufs >> to some extent. > > My generalizations are about as silly as Adrian's handwaving. ;) > > The reason jumbo mbufs (> PAGE_SIZE) ever came into existence was for > non-s/g DMA network cards, the Tigeon(II) in particular IIRC. Jumbo > mbufs are much more taxing on the on VM and the kernel_map because of > the contigmalloc requirement. Not really. The lowest layer in the physical memory management system has used a binary buddy system-based allocator since FreeBSD 7.0. It's no more costly to ask for 16KB than 4KB, and if it exists, to allocate it. It just may not exist. Only then, will the cost be greater than an ordinary multipage allocation, such as a kmem_malloc() call. However, 16KB of contiguous pages typically exist, especially on machines with larger physical memories. > ... They should only be used when really > necessary in the receive path and not as general purpose extra large > mbufs. That's what we've got mbuf chains for. The send path from > userspace uses PAGE_SIZE (jumbo) mbuf's whenever possible. The same > is true for sendfile() because it wraps file object pages to mbufs. > >> Hypotheticals are somewhat irrelevant, but I find it surprising that >> you're being so glib about breaking FreeBSD networking just because of >> an idea you have about where jumbo frame use is appropriate and what >> kinds of hardware should be connected to jumbo frame networks. > > First I said I'd love to remove it. Not that I'm doing now or soon. > It's an opinion and expression of desire. Second very little would > break because any contemporary network card (I have looked at so far) > supports jumbo frame s/g into 2K or 4K mbufs on receive. Jumbo frames > are only available with GigE and 10GigE. It was never supported on > 100M. Any patch removing large jumbo support wouldn't go unnoticed. ;) > From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 21:51:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BBDB4720; Sat, 2 Feb 2013 21:51:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 949247FB; Sat, 2 Feb 2013 21:51:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12LpFo5011120; Sat, 2 Feb 2013 21:51:15 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12LpFJX011117; Sat, 2 Feb 2013 21:51:15 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302022151.r12LpFJX011117@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 2 Feb 2013 21:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246256 - in head/usr.sbin/crunch: crunchgen crunchide examples X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 21:51:15 -0000 Author: pfg Date: Sat Feb 2 21:51:14 2013 New Revision: 246256 URL: http://svnweb.freebsd.org/changeset/base/246256 Log: crunch: Sync some NetBSD changes. crunchide: Apr 11, 2009: fix some -Wsign-compare issues. Sep 20, 1999: Free the right thing. crunchgen: Apr 14, 2009: Fix some WARNS=4 issues (-Wshadow -Wcast-qual) Oct 30, 2004: Add (unsigned char) cast to ctype functions Feb 5, 2001: fix nested extern. examples: Aug 30, 2007: NetBSD 36867 - trsp references are deprecated Obtained from: NetBSD MFC after: 1 week Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c head/usr.sbin/crunch/crunchide/exec_elf32.c head/usr.sbin/crunch/examples/really-big.conf Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Sat Feb 2 18:08:09 2013 (r246255) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Sat Feb 2 21:51:14 2013 (r246256) @@ -105,15 +105,16 @@ int list_mode; /* general library routines */ -void status(char *str); +void status(const char *str); void out_of_memory(void); void add_string(strlst_t **listp, char *str); -int is_dir(char *pathname); -int is_nonempty_file(char *pathname); +int is_dir(const char *pathname); +int is_nonempty_file(const char *pathname); int subtract_strlst(strlst_t **lista, strlst_t **listb); int in_list(strlst_t **listp, char *str); -/* helper routines for main() */ + +extern char *crunched_skel[]; void usage(void); void parse_conf_file(void); @@ -245,7 +246,7 @@ usage(void) /* helper routines for parse_conf_file */ void parse_one_file(char *filename); -void parse_line(char *line, int *fc, char **fv, int nf); +void parse_line(char *pline, int *fc, char **fv, int nf); void add_srcdirs(int argc, char **argv); void add_progs(int argc, char **argv); void add_link(int argc, char **argv); @@ -340,15 +341,15 @@ parse_one_file(char *filename) void -parse_line(char *line, int *fc, char **fv, int nf) +parse_line(char *pline, int *fc, char **fv, int nf) { char *p; - p = line; + p = pline; *fc = 0; while (1) { - while (isspace(*p)) + while (isspace((unsigned char)*p)) p++; if (*p == '\0' || *p == '#') @@ -357,7 +358,7 @@ parse_line(char *line, int *fc, char **f if (*fc < nf) fv[(*fc)++] = p; - while (*p && !isspace(*p) && *p != '#') + while (*p && !isspace((unsigned char)*p) && *p != '#') p++; if (*p == '\0' || *p == '#') @@ -767,17 +768,17 @@ fillin_program_objs(prog_t *p, char *pat } cp = line + 6; - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; while(*cp) { obj = cp; - while (*cp && !isspace(*cp)) + while (*cp && !isspace((unsigned char)*cp)) cp++; if (*cp) *cp++ = '\0'; add_string(&p->objs, obj); - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; } } @@ -887,7 +888,6 @@ gen_output_makefile(void) void gen_output_cfile(void) { - extern char *crunched_skel[]; char **cp; FILE *outcf; prog_t *p; @@ -945,7 +945,7 @@ char *genident(char *str) for (d = s = n; *s != '\0'; s++) { if (*s == '-') *d++ = '_'; - else if (*s == '_' || isalnum(*s)) + else if (*s == '_' || isalnum((unsigned char)*s)) *d++ = *s; } *d = '\0'; @@ -1135,7 +1135,7 @@ output_strlst(FILE *outf, strlst_t *lst) */ void -status(char *str) +status(const char *str) { static int lastlen = 0; int len, spaces; @@ -1211,7 +1211,7 @@ in_list(strlst_t **listp, char *str) } int -is_dir(char *pathname) +is_dir(const char *pathname) { struct stat buf; @@ -1222,7 +1222,7 @@ is_dir(char *pathname) } int -is_nonempty_file(char *pathname) +is_nonempty_file(const char *pathname) { struct stat buf; Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- head/usr.sbin/crunch/crunchide/exec_elf32.c Sat Feb 2 18:08:09 2013 (r246255) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Sat Feb 2 21:51:14 2013 (r246256) @@ -31,7 +31,7 @@ #include #ifndef lint #if 0 -__RCSID("$NetBSD: exec_elf32.c,v 1.4 1997/08/12 06:07:24 mikel Exp $"); +__RCSID("$NetBSD: exec_elf32.c,v 1.6 1999/09/20 04:12:16 christos Exp $"); #endif #endif __FBSDID("$FreeBSD$"); @@ -98,7 +98,7 @@ xreadatoff(int fd, void *buf, off_t off, perror(fn); return -1; } - if ((rv = read(fd, buf, size)) != size) { + if ((size_t)(rv = read(fd, buf, size)) != size) { fprintf(stderr, "%s: read error: %s\n", fn, rv == -1 ? strerror(errno) : "short read"); return -1; @@ -115,7 +115,7 @@ xwriteatoff(int fd, void *buf, off_t off perror(fn); return -1; } - if ((rv = write(fd, buf, size)) != size) { + if ((size_t)(rv = write(fd, buf, size)) != size) { fprintf(stderr, "%s: write error: %s\n", fn, rv == -1 ? strerror(errno) : "short write"); return -1; @@ -162,7 +162,7 @@ ELFNAMEEND(check)(int fd, const char *fn */ if (fstat(fd, &sb) == -1) return 0; - if (sb.st_size < sizeof eh) + if (sb.st_size < (off_t)(sizeof eh)) return 0; if (read(fd, &eh, sizeof eh) != sizeof eh) return 0; @@ -305,7 +305,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) if ((symtabp = xmalloc(xewtoh(symtabshdr->sh_size), fn, "symbol table")) == NULL) goto bad; - if (xreadatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), + if ((size_t)xreadatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), xewtoh(symtabshdr->sh_size), fn) != xewtoh(symtabshdr->sh_size)) goto bad; @@ -313,7 +313,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) if ((strtabp = xmalloc(xewtoh(strtabshdr->sh_size), fn, "string table")) == NULL) goto bad; - if (xreadatoff(fd, strtabp, xewtoh(strtabshdr->sh_offset), + if ((size_t)xreadatoff(fd, strtabp, xewtoh(strtabshdr->sh_offset), xewtoh(strtabshdr->sh_size), fn) != xewtoh(strtabshdr->sh_size)) goto bad; @@ -370,7 +370,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) if (xwriteatoff(fd, shdrp, xewtoh(ehdr.e_shoff), shdrsize, fn) != shdrsize) goto bad; - if (xwriteatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), + if ((size_t)xwriteatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), xewtoh(symtabshdr->sh_size), fn) != xewtoh(symtabshdr->sh_size)) goto bad; /* write new symbol table strings */ @@ -384,7 +384,7 @@ out: if (symtabp != NULL) free(symtabp); if (strtabp != NULL) - free(strtabp); + free(nstrtabp); return (rv); bad: Modified: head/usr.sbin/crunch/examples/really-big.conf ============================================================================== --- head/usr.sbin/crunch/examples/really-big.conf Sat Feb 2 18:08:09 2013 (r246255) +++ head/usr.sbin/crunch/examples/really-big.conf Sat Feb 2 21:51:14 2013 (r246256) @@ -72,7 +72,7 @@ progs dev_mkdb diskpart edquota flcopy g progs iostat iteconfig kvm_mkdb mtree named portmap pppd progs pstat pwd_mkdb quot quotaon rarpd rbootd repquota rmt rpc.bootparamd progs rwhod sa spray sysctl syslogd tcpdump -progs traceroute trpt trsp update vipw vnconfig ypbind yppoll ypset +progs traceroute trpt update vipw vnconfig ypbind yppoll ypset special amd srcdir /usr/src/usr.sbin/amd/amd special amd objs vers.amd.o afs_ops.o am_ops.o clock.o util.o xutil.o efs_ops.o mapc.o info_file.o info_hes.o info_ndbm.o info_passwd.o info_nis.o info_union.o map.o srvr_afs.o srvr_nfs.o mntfs.o misc_rpc.o mount_fs.o mtab.o mtab_bsd.o nfs_ops.o nfs_prot_svc.o nfs_start.o nfs_subr.o opts.o pfs_ops.o rpc_fwd.o sched.o sfs_ops.o amq_svc.o amq_subr.o umount_fs.o host_ops.o nfsx_ops.o ufs_ops.o ifs_ops.o amd.o get_args.o restart.o wire.o From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 21:57:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1B1BB8D7; Sat, 2 Feb 2013 21:57:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F32CF825; Sat, 2 Feb 2013 21:57:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12Lv6W9011909; Sat, 2 Feb 2013 21:57:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12Lv6xw011905; Sat, 2 Feb 2013 21:57:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201302022157.r12Lv6xw011905@svn.freebsd.org> From: Marius Strobl Date: Sat, 2 Feb 2013 21:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246257 - head/sys/dev/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 21:57:07 -0000 Author: marius Date: Sat Feb 2 21:57:06 2013 New Revision: 246257 URL: http://svnweb.freebsd.org/changeset/base/246257 Log: Improve r238673 to additionally allow for odd-aligned buffers as passed in by smartd of smartmontools. While at it, hint the compiler that 32-bit PIO is the most likely case (idea from Linux) and use bus_{read,write}_stream_2(9) instead of bus_{read,write}_multi_stream_2(9) for single count reads/writes. MFC after: 1 week Modified: head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-lowlevel.c Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Sat Feb 2 21:51:14 2013 (r246256) +++ head/sys/dev/ata/ata-all.h Sat Feb 2 21:57:06 2013 (r246257) @@ -698,6 +698,8 @@ MALLOC_DECLARE(M_ATA); #define ATA_INW(res, offset) \ bus_read_2((res), (offset)) +#define ATA_INW_STRM(res, offset) \ + bus_read_stream_2((res), (offset)) #define ATA_INL(res, offset) \ bus_read_4((res), (offset)) #define ATA_INSW(res, offset, addr, count) \ @@ -712,6 +714,8 @@ MALLOC_DECLARE(M_ATA); bus_write_1((res), (offset), (value)) #define ATA_OUTW(res, offset, value) \ bus_write_2((res), (offset), (value)) +#define ATA_OUTW_STRM(res, offset, value) \ + bus_write_stream_2((res), (offset), (value)) #define ATA_OUTL(res, offset, value) \ bus_write_4((res), (offset), (value)) #define ATA_OUTSW(res, offset, addr, count) \ @@ -729,6 +733,9 @@ MALLOC_DECLARE(M_ATA); #define ATA_IDX_INW(ch, idx) \ ATA_INW(ch->r_io[idx].res, ch->r_io[idx].offset) +#define ATA_IDX_INW_STRM(ch, idx) \ + ATA_INW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset) + #define ATA_IDX_INL(ch, idx) \ ATA_INL(ch->r_io[idx].res, ch->r_io[idx].offset) @@ -750,6 +757,9 @@ MALLOC_DECLARE(M_ATA); #define ATA_IDX_OUTW(ch, idx, value) \ ATA_OUTW(ch->r_io[idx].res, ch->r_io[idx].offset, value) +#define ATA_IDX_OUTW_STRM(ch, idx, value) \ + ATA_OUTW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, value) + #define ATA_IDX_OUTL(ch, idx, value) \ ATA_OUTL(ch->r_io[idx].res, ch->r_io[idx].offset, value) Modified: head/sys/dev/ata/ata-lowlevel.c ============================================================================== --- head/sys/dev/ata/ata-lowlevel.c Sat Feb 2 21:51:14 2013 (r246256) +++ head/sys/dev/ata/ata-lowlevel.c Sat Feb 2 21:57:06 2013 (r246257) @@ -846,14 +846,28 @@ ata_pio_read(struct ata_request *request uint8_t *addr; int size = min(request->transfersize, length); int resid; - uint8_t buf[2]; + uint8_t buf[2] __aligned(sizeof(int16_t)); +#ifndef __NO_STRICT_ALIGNMENT + int i; +#endif addr = (uint8_t *)request->data + request->donecount; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || - ((uintptr_t)addr % sizeof(int32_t))) { - ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); + if (__predict_false(ch->flags & ATA_USE_16BIT || + (size % sizeof(int32_t)) || ((uintptr_t)addr % sizeof(int32_t)))) { +#ifndef __NO_STRICT_ALIGNMENT + if (__predict_false((uintptr_t)addr % sizeof(int16_t))) { + for (i = 0, resid = size & ~1; resid > 0; resid -= + sizeof(int16_t)) { + *(uint16_t *)&buf = ATA_IDX_INW_STRM(ch, ATA_DATA); + addr[i++] = buf[0]; + addr[i++] = buf[1]; + } + } else +#endif + ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / + sizeof(int16_t)); if (size & 1) { - ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)buf, 1); + *(uint16_t *)&buf = ATA_IDX_INW_STRM(ch, ATA_DATA); (addr + (size & ~1))[0] = buf[0]; } } else @@ -875,15 +889,30 @@ ata_pio_write(struct ata_request *reques uint8_t *addr; int size = min(request->transfersize, length); int resid; - uint8_t buf[2]; + uint8_t buf[2] __aligned(sizeof(int16_t)); +#ifndef __NO_STRICT_ALIGNMENT + int i; +#endif + size = min(request->transfersize, length); addr = (uint8_t *)request->data + request->donecount; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || - ((uintptr_t)addr % sizeof(int32_t))) { - ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); + if (__predict_false(ch->flags & ATA_USE_16BIT || + (size % sizeof(int32_t)) || ((uintptr_t)addr % sizeof(int32_t)))) { +#ifndef __NO_STRICT_ALIGNMENT + if (__predict_false((uintptr_t)addr % sizeof(int16_t))) { + for (i = 0, resid = size & ~1; resid > 0; resid -= + sizeof(int16_t)) { + buf[0] = addr[i++]; + buf[1] = addr[i++]; + ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf); + } + } else +#endif + ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / + sizeof(int16_t)); if (size & 1) { buf[0] = (addr + (size & ~1))[0]; - ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)buf, 1); + ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf); } } else ATA_IDX_OUTSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 22:23:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CF1F0CEA; Sat, 2 Feb 2013 22:23:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA2508C3; Sat, 2 Feb 2013 22:23:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12MNlxs020965; Sat, 2 Feb 2013 22:23:47 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12MNkj0020952; Sat, 2 Feb 2013 22:23:46 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302022223.r12MNkj0020952@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 2 Feb 2013 22:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246258 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 22:23:47 -0000 Author: pfg Date: Sat Feb 2 22:23:45 2013 New Revision: 246258 URL: http://svnweb.freebsd.org/changeset/base/246258 Log: ext2fs: general cleanup. - Remove unused extern declarations in fs.h - Correct comments in ext2_dir.h - Several panic() messages showed wrong function names. - Remove commented out stray line in ext2_alloc.c. - Remove the unused macro EXT2_BLOCK_SIZE_BITS() and the then write-only member e2fs_blocksize_bits from struct m_ext2fs. - Remove the unused macro EXT2_FIRST_INO() and the then write-only member e2fs_first_inode from struct m_ext2fs. - Remove EXT2_DESC_PER_BLOCK() and the member e2fs_descpb from struct m_ext2fs. - Remove the unused members e2fs_bmask, e2fs_dbpg and e2fs_mount_opt from struct m_ext2fs - Correct harmless off-by-one error for fspath in ext2_vfsops.c. - Remove the unused and broken macros EXT2_ADDR_PER_BLOCK_BITS() and EXT2_DESC_PER_BLOCK_BITS(). - Remove the !_KERNEL versions of the EXT2_* macros. Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_dir.h head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/fs.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sat Feb 2 21:57:06 2013 (r246257) +++ head/sys/fs/ext2fs/ext2_alloc.c Sat Feb 2 22:23:45 2013 (r246258) @@ -242,7 +242,7 @@ ext2_reallocblks(ap) } else { #ifdef DIAGNOSTIC if (start_ap[start_lvl-1].in_lbn == idp->in_lbn) - panic("ext2_reallocblk: start == end"); + panic("ext2_reallocblks: start == end"); #endif ssize = len - (idp->in_off + 1); if (bread(vp, idp->in_lbn, (int)fs->e2fs_bsize, NOCRED, &ebp)) @@ -1004,7 +1004,7 @@ ext2_blkfree(ip, bno, size) if (isclr(bbp, bno)) { printf("block = %lld, fs = %s\n", (long long)bno, fs->e2fs_fsmnt); - panic("blkfree: freeing free block"); + panic("ext2_blkfree: freeing free block"); } clrbit(bbp, bno); EXT2_LOCK(ump); @@ -1032,7 +1032,6 @@ ext2_vfree(pvp, ino, mode) struct ext2mount *ump; int error, cg; char * ibp; -/* mode_t save_i_mode; */ pip = VTOI(pvp); fs = pip->i_e2fs; @@ -1055,7 +1054,7 @@ ext2_vfree(pvp, ino, mode) printf("ino = %llu, fs = %s\n", (unsigned long long)ino, fs->e2fs_fsmnt); if (fs->e2fs_ronly == 0) - panic("ifree: freeing free inode"); + panic("ext2_vfree: freeing free inode"); } clrbit(ibp, ino); EXT2_LOCK(ump); @@ -1100,7 +1099,7 @@ ext2_mapsearch(struct m_ext2fs *fs, char if (loc == NULL) { printf("start = %d, len = %d, fs = %s\n", start, len, fs->e2fs_fsmnt); - panic("ext2fs_alloccg: map corrupted"); + panic("ext2_mapsearch: map corrupted"); /* NOTREACHED */ } } Modified: head/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dir.h Sat Feb 2 21:57:06 2013 (r246257) +++ head/sys/fs/ext2fs/ext2_dir.h Sat Feb 2 22:23:45 2013 (r246258) @@ -37,7 +37,7 @@ struct ext2fs_direct { uint32_t e2d_ino; /* inode number of entry */ uint16_t e2d_reclen; /* length of this record */ - uint16_t e2d_namlen; /* length of string in d_name */ + uint16_t e2d_namlen; /* length of string in e2d_name */ char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */ }; /* @@ -49,7 +49,7 @@ struct ext2fs_direct { struct ext2fs_direct_2 { uint32_t e2d_ino; /* inode number of entry */ uint16_t e2d_reclen; /* length of this record */ - uint8_t e2d_namlen; /* length of string in d_name */ + uint8_t e2d_namlen; /* length of string in e2d_name */ uint8_t e2d_type; /* file type */ char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */ }; Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Sat Feb 2 21:57:06 2013 (r246257) +++ head/sys/fs/ext2fs/ext2_inode.c Sat Feb 2 22:23:45 2013 (r246258) @@ -311,7 +311,7 @@ ext2_truncate(vp, length, flags, cred, t oip->i_size = length; newspace = blksize(fs, oip, lastblock); if (newspace == 0) - panic("itrunc: newspace"); + panic("ext2_truncate: newspace"); if (oldspace - newspace > 0) { /* * Block number of space to be free'd is Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Sat Feb 2 21:57:06 2013 (r246257) +++ head/sys/fs/ext2fs/ext2_lookup.c Sat Feb 2 22:23:45 2013 (r246258) @@ -812,7 +812,7 @@ ext2_direnter(ip, dvp, cnp) #ifdef DIAGNOSTIC if ((cnp->cn_flags & SAVENAME) == 0) - panic("direnter: missing name"); + panic("ext2_direnter: missing name"); #endif dp = VTOI(dvp); newdir.e2d_ino = ip->i_number; Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Sat Feb 2 21:57:06 2013 (r246257) +++ head/sys/fs/ext2fs/ext2_vfsops.c Sat Feb 2 22:23:45 2013 (r246258) @@ -127,7 +127,7 @@ ext2_mount(struct mount *mp) vfs_getopt(opts, "fspath", (void **)&path, NULL); /* Double-check the length of path.. */ - if (strlen(path) >= MAXMNTLEN - 1) + if (strlen(path) >= MAXMNTLEN) return (ENAMETOOLONG); fspec = NULL; @@ -318,12 +318,12 @@ compute_sb_data(struct vnode *devvp, str int i; int logic_sb_block = 1; /* XXX for now */ struct buf *bp; + uint32_t e2fs_descpb; fs->e2fs_bsize = EXT2_MIN_BLOCK_SIZE << es->e2fs_log_bsize; fs->e2fs_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->e2fs_log_bsize; fs->e2fs_fsbtodb = es->e2fs_log_bsize + 1; fs->e2fs_qbmask = fs->e2fs_bsize - 1; - fs->e2fs_blocksize_bits = es->e2fs_log_bsize + 10; fs->e2fs_fsize = EXT2_MIN_FRAG_SIZE << es->e2fs_log_fsize; if (fs->e2fs_fsize) fs->e2fs_fpb = fs->e2fs_bsize / fs->e2fs_fsize; @@ -331,10 +331,8 @@ compute_sb_data(struct vnode *devvp, str fs->e2fs_fpg = es->e2fs_fpg; fs->e2fs_ipg = es->e2fs_ipg; if (es->e2fs_rev == E2FS_REV0) { - fs->e2fs_first_inode = EXT2_FIRSTINO; fs->e2fs_isize = E2FS_REV0_INODE_SIZE ; } else { - fs->e2fs_first_inode = es->e2fs_first_ino; fs->e2fs_isize = es->e2fs_inode_size; /* @@ -357,12 +355,11 @@ compute_sb_data(struct vnode *devvp, str fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); fs->e2fs_itpg = fs->e2fs_ipg /fs->e2fs_ipb; - fs->e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); /* s_resuid / s_resgid ? */ fs->e2fs_gcount = (es->e2fs_bcount - es->e2fs_first_dblock + EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs); - db_count = (fs->e2fs_gcount + EXT2_DESC_PER_BLOCK(fs) - 1) / - EXT2_DESC_PER_BLOCK(fs); + e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); + db_count = (fs->e2fs_gcount + e2fs_descpb - 1) / e2fs_descpb; fs->e2fs_gdbcount = db_count; fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, M_EXT2MNT, M_WAITOK); @@ -766,7 +763,7 @@ ext2_statfs(struct mount *mp, struct sta ump = VFSTOEXT2(mp); fs = ump->um_e2fs; if (fs->e2fs->e2fs_magic != E2FS_MAGIC) - panic("ext2fs_statfs"); + panic("ext2_statfs"); /* * Compute the overhead (FS structures) Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Sat Feb 2 21:57:06 2013 (r246257) +++ head/sys/fs/ext2fs/ext2fs.h Sat Feb 2 22:23:45 2013 (r246258) @@ -153,7 +153,6 @@ struct m_ext2fs { char e2fs_fmod; /* super block modified flag */ uint32_t e2fs_bsize; /* Block size */ uint32_t e2fs_bshift; /* calc of logical block no */ - int32_t e2fs_bmask; /* calc of block offset */ int32_t e2fs_bpg; /* Number of blocks per group */ int64_t e2fs_qbmask; /* = s_blocksize -1 */ uint32_t e2fs_fsbtodb; /* Shift to get disk block */ @@ -163,14 +162,9 @@ struct m_ext2fs { uint32_t e2fs_fsize; /* Size of fragments per block */ uint32_t e2fs_fpb; /* Number of fragments per block */ uint32_t e2fs_fpg; /* Number of fragments per group */ - uint32_t e2fs_dbpg; /* Number of descriptor blocks per group */ - uint32_t e2fs_descpb; /* Number of group descriptors per block */ uint32_t e2fs_gdbcount; /* Number of group descriptors */ uint32_t e2fs_gcount; /* Number of groups */ - uint32_t e2fs_first_inode;/* First inode on fs */ int32_t e2fs_isize; /* Size of inode */ - uint32_t e2fs_mount_opt; - uint32_t e2fs_blocksize_bits; uint32_t e2fs_total_dir; /* Total number of directories */ uint8_t *e2fs_contigdirs; /* (u) # of contig. allocated dirs */ char e2fs_wasvalid; /* valid at mount time */ @@ -313,27 +307,9 @@ struct csum { #define EXT2_MIN_BLOCK_SIZE 1024 #define EXT2_MAX_BLOCK_SIZE 4096 #define EXT2_MIN_BLOCK_LOG_SIZE 10 -#if defined(_KERNEL) -# define EXT2_BLOCK_SIZE(s) ((s)->e2fs_bsize) -#else -# define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->e2fs_log_bsize) -#endif +#define EXT2_BLOCK_SIZE(s) ((s)->e2fs_bsize) #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(uint32_t)) -#if defined(_KERNEL) -# define EXT2_BLOCK_SIZE_BITS(s) ((s)->e2fs_blocksize_bits) -#else -# define EXT2_BLOCK_SIZE_BITS(s) ((s)->e2fs_log_bsize + 10) -#endif -#if defined(_KERNEL) -#define EXT2_ADDR_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_addr_per_block_bits) #define EXT2_INODE_SIZE(s) (EXT2_SB(s)->e2fs_isize) -#define EXT2_FIRST_INO(s) (EXT2_SB(s)->e2fs_first_inode) -#else -#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == E2FS_REV0) ? \ - E2FS_REV0 : (s)->s_inode_size) -#define EXT2_FIRST_INO(s) (((s)->s_rev_level == E2FS_REV0) ? \ - E2FS_REV0 : (s)->e2fs_first_ino) -#endif /* * Macro-instructions used to manage fragments @@ -341,25 +317,12 @@ struct csum { #define EXT2_MIN_FRAG_SIZE 1024 #define EXT2_MAX_FRAG_SIZE 4096 #define EXT2_MIN_FRAG_LOG_SIZE 10 -#if defined(_KERNEL) -# define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->e2fs_fsize) -# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->e2fs_fpb) -#else -# define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->e2fs_log_fsize) -# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) -#endif +#define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->e2fs_fsize) +#define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->e2fs_fpb) /* * Macro-instructions used to manage group descriptors */ -#if defined(_KERNEL) -# define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->e2fs_bpg) -# define EXT2_DESC_PER_BLOCK(s) (EXT2_SB(s)->e2fs_descpb) -# define EXT2_DESC_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_desc_per_block_bits) -#else -# define EXT2_BLOCKS_PER_GROUP(s) ((s)->e2fs_bpg) -# define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(struct ext2_gd)) - -#endif +#define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->e2fs_bpg) #endif /* !_FS_EXT2FS_EXT2FS_H_ */ Modified: head/sys/fs/ext2fs/fs.h ============================================================================== --- head/sys/fs/ext2fs/fs.h Sat Feb 2 21:57:06 2013 (r246257) +++ head/sys/fs/ext2fs/fs.h Sat Feb 2 22:23:45 2013 (r246258) @@ -149,7 +149,4 @@ */ #define NINDIR(fs) (EXT2_ADDR_PER_BLOCK(fs)) -extern int inside[], around[]; -extern u_char *fragtbl[]; - #endif /* !_FS_EXT2FS_FS_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 22:28:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 50C44E77; Sat, 2 Feb 2013 22:28:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C1D18DA; Sat, 2 Feb 2013 22:28:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12MSin9021691; Sat, 2 Feb 2013 22:28:44 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12MSU9p021594; Sat, 2 Feb 2013 22:28:30 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302022228.r12MSU9p021594@svn.freebsd.org> From: Dimitry Andric Date: Sat, 2 Feb 2013 22:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246259 - in head: contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/lib/FrontendTool lib/clang lib/clang/libclanganalysis lib/clang/libclangarcmigrate lib/clang/lib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 22:28:44 -0000 Author: dim Date: Sat Feb 2 22:28:29 2013 New Revision: 246259 URL: http://svnweb.freebsd.org/changeset/base/246259 Log: Pull in r170135 from upstream clang trunk: Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user specifies not to. Dont build ASTMatchers with Rewriter disabled and StaticAnalyzer when it's disabled. Without all those three, the clang binary shrinks (x86_64) from ~36MB to ~32MB (unstripped). To disable these clang components, and get a smaller clang binary built and installed, set WITHOUT_CLANG_FULL in src.conf(5). During the initial stages of buildworld, those extra components are already disabled automatically, to save some build time. MFC after: 1 week Added: head/tools/build/options/WITHOUT_CLANG_FULL (contents, props changed) head/tools/build/options/WITH_CLANG_FULL (contents, props changed) Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp head/lib/clang/Makefile head/lib/clang/clang.build.mk head/lib/clang/libclanganalysis/Makefile head/lib/clang/libclangarcmigrate/Makefile head/lib/clang/libclangast/Makefile head/lib/clang/libclangbasic/Makefile head/lib/clang/libclangcodegen/Makefile head/lib/clang/libclangdriver/Makefile head/lib/clang/libclangedit/Makefile head/lib/clang/libclangfrontend/Makefile head/lib/clang/libclangfrontendtool/Makefile head/lib/clang/libclanglex/Makefile head/lib/clang/libclangparse/Makefile head/lib/clang/libclangrewritecore/Makefile head/lib/clang/libclangrewritefrontend/Makefile head/lib/clang/libclangsema/Makefile head/lib/clang/libclangserialization/Makefile head/lib/clang/libclangstaticanalyzercheckers/Makefile head/lib/clang/libclangstaticanalyzercore/Makefile head/lib/clang/libclangstaticanalyzerfrontend/Makefile head/lib/clang/libllvmarchive/Makefile head/lib/clang/libllvmarmasmparser/Makefile head/lib/clang/libllvmarmcodegen/Makefile head/lib/clang/libllvmarmdesc/Makefile head/lib/clang/libllvmarmdisassembler/Makefile head/lib/clang/libllvmarminfo/Makefile head/lib/clang/libllvmarminstprinter/Makefile head/lib/clang/libllvmasmparser/Makefile head/lib/clang/libllvmasmprinter/Makefile head/lib/clang/libllvmbitreader/Makefile head/lib/clang/libllvmbitwriter/Makefile head/lib/clang/libllvmcodegen/Makefile head/lib/clang/libllvmcore/Makefile head/lib/clang/libllvmdebuginfo/Makefile head/lib/clang/libllvmexecutionengine/Makefile head/lib/clang/libllvminstcombine/Makefile head/lib/clang/libllvminstrumentation/Makefile head/lib/clang/libllvminterpreter/Makefile head/lib/clang/libllvmjit/Makefile head/lib/clang/libllvmlinker/Makefile head/lib/clang/libllvmmcdisassembler/Makefile head/lib/clang/libllvmmcparser/Makefile head/lib/clang/libllvmmipsasmparser/Makefile head/lib/clang/libllvmmipscodegen/Makefile head/lib/clang/libllvmmipsdesc/Makefile head/lib/clang/libllvmmipsdisassembler/Makefile head/lib/clang/libllvmmipsinfo/Makefile head/lib/clang/libllvmmipsinstprinter/Makefile head/lib/clang/libllvmobject/Makefile head/lib/clang/libllvmpowerpccodegen/Makefile head/lib/clang/libllvmpowerpcdesc/Makefile head/lib/clang/libllvmpowerpcinfo/Makefile head/lib/clang/libllvmpowerpcinstprinter/Makefile head/lib/clang/libllvmruntimedyld/Makefile head/lib/clang/libllvmselectiondag/Makefile head/lib/clang/libllvmtablegen/Makefile head/lib/clang/libllvmtarget/Makefile head/lib/clang/libllvmvectorize/Makefile head/lib/clang/libllvmx86asmparser/Makefile head/lib/clang/libllvmx86codegen/Makefile head/lib/clang/libllvmx86desc/Makefile head/lib/clang/libllvmx86info/Makefile head/lib/clang/libllvmx86instprinter/Makefile head/lib/clang/libllvmx86utils/Makefile head/share/mk/bsd.own.mk head/usr.bin/clang/clang/Makefile Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td Sat Feb 2 22:23:45 2013 (r246258) +++ head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td Sat Feb 2 22:28:29 2013 (r246259) @@ -60,6 +60,8 @@ def warn_fe_cc_log_diagnostics_failure : "unable to open CC_LOG_DIAGNOSTICS file: %0 (using stderr)">; def err_fe_no_pch_in_dir : Error< "no suitable precompiled header file found in directory '%0'">; +def err_fe_action_not_available : Error< + "action %0 not compiled in">; def warn_fe_serialized_diag_failure : Warning< "unable to open file %0 for serializing diagnostics (%1)">, Modified: head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp Sat Feb 2 22:23:45 2013 (r246258) +++ head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp Sat Feb 2 22:28:29 2013 (r246259) @@ -31,6 +31,7 @@ using namespace clang; static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) { using namespace clang::frontend; + StringRef Action("unknown"); switch (CI.getFrontendOpts().ProgramAction) { case ASTDeclList: return new ASTDeclListAction(); @@ -42,12 +43,20 @@ static FrontendAction *CreateFrontendBas case DumpTokens: return new DumpTokensAction(); case EmitAssembly: return new EmitAssemblyAction(); case EmitBC: return new EmitBCAction(); +#ifdef CLANG_ENABLE_REWRITER case EmitHTML: return new HTMLPrintAction(); +#else + case EmitHTML: Action = "EmitHTML"; break; +#endif case EmitLLVM: return new EmitLLVMAction(); case EmitLLVMOnly: return new EmitLLVMOnlyAction(); case EmitCodeGenOnly: return new EmitCodeGenOnlyAction(); case EmitObj: return new EmitObjAction(); +#ifdef CLANG_ENABLE_REWRITER case FixIt: return new FixItAction(); +#else + case FixIt: Action = "FixIt"; break; +#endif case GenerateModule: return new GenerateModuleAction; case GeneratePCH: return new GeneratePCHAction; case GeneratePTH: return new GeneratePTHAction(); @@ -74,19 +83,46 @@ static FrontendAction *CreateFrontendBas case PrintDeclContext: return new DeclContextPrintAction(); case PrintPreamble: return new PrintPreambleAction(); case PrintPreprocessedInput: { - if (CI.getPreprocessorOutputOpts().RewriteIncludes) + if (CI.getPreprocessorOutputOpts().RewriteIncludes) { +#ifdef CLANG_ENABLE_REWRITER return new RewriteIncludesAction(); +#else + Action = "RewriteIncludesAction"; + break; +#endif + } return new PrintPreprocessedAction(); } +#ifdef CLANG_ENABLE_REWRITER case RewriteMacros: return new RewriteMacrosAction(); case RewriteObjC: return new RewriteObjCAction(); case RewriteTest: return new RewriteTestAction(); - case RunAnalysis: return new ento::AnalysisAction(); +#else + case RewriteMacros: Action = "RewriteMacros"; break; + case RewriteObjC: Action = "RewriteObjC"; break; + case RewriteTest: Action = "RewriteTest"; break; +#endif +#ifdef CLANG_ENABLE_ARCMT case MigrateSource: return new arcmt::MigrateSourceAction(); +#else + case MigrateSource: Action = "MigrateSource"; break; +#endif +#ifdef CLANG_ENABLE_STATIC_ANALYZER + case RunAnalysis: return new ento::AnalysisAction(); +#else + case RunAnalysis: Action = "RunAnalysis"; break; +#endif case RunPreprocessorOnly: return new PreprocessOnlyAction(); } + +#if !defined(CLANG_ENABLE_ARCMT) || !defined(CLANG_ENABLE_STATIC_ANALYZER) \ + || !defined(CLANG_ENABLE_REWRITER) + CI.getDiagnostics().Report(diag::err_fe_action_not_available) << Action; + return 0; +#else llvm_unreachable("Invalid program action!"); +#endif } static FrontendAction *CreateFrontendAction(CompilerInstance &CI) { @@ -97,10 +133,13 @@ static FrontendAction *CreateFrontendAct const FrontendOptions &FEOpts = CI.getFrontendOpts(); +#ifdef CLANG_ENABLE_REWRITER if (FEOpts.FixAndRecompile) { Act = new FixItRecompile(Act); } +#endif +#ifdef CLANG_ENABLE_ARCMT // Potentially wrap the base FE action in an ARC Migrate Tool action. switch (FEOpts.ARCMTAction) { case FrontendOptions::ARCMT_None: @@ -124,6 +163,7 @@ static FrontendAction *CreateFrontendAct FEOpts.ObjCMTAction & ~FrontendOptions::ObjCMT_Literals, FEOpts.ObjCMTAction & ~FrontendOptions::ObjCMT_Subscripting); } +#endif // If there are any AST files to merge, create a frontend action // adaptor to perform the merge. @@ -176,12 +216,14 @@ bool clang::ExecuteCompilerInvocation(Co llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args); } +#ifdef CLANG_ENABLE_STATIC_ANALYZER // Honor -analyzer-checker-help. // This should happen AFTER plugins have been loaded! if (Clang->getAnalyzerOpts()->ShowCheckerHelp) { ento::printCheckerHelp(llvm::outs(), Clang->getFrontendOpts().Plugins); return 0; } +#endif // If there were errors in processing arguments, don't do anything else. bool Success = false; Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -3,8 +3,20 @@ .include .if !make(install) +.if !defined(EARLY_BUILD) && defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no" +_libclangstaticanalyzer= \ + libclangstaticanalyzercheckers \ + libclangstaticanalyzercore \ + libclangstaticanalyzerfrontend +_libclangarcmigrate= \ + libclangarcmigrate +_libclangrewriter= \ + libclangrewritecore \ + libclangrewritefrontend +.endif # !EARLY_BUILD && MK_CLANG_FULL + SUBDIR= libclanganalysis \ - libclangarcmigrate \ + ${_libclangarcmigrate} \ libclangast \ libclangbasic \ libclangcodegen \ @@ -14,13 +26,10 @@ SUBDIR= libclanganalysis \ libclangfrontendtool \ libclanglex \ libclangparse \ - libclangrewritecore \ - libclangrewritefrontend \ + ${_libclangrewriter} \ libclangsema \ libclangserialization \ - libclangstaticanalyzercheckers \ - libclangstaticanalyzercore \ - libclangstaticanalyzerfrontend \ + ${_libclangstaticanalyzer} \ \ libllvmanalysis \ libllvmarchive \ @@ -78,8 +87,8 @@ SUBDIR+=libllvmdebuginfo \ libllvmmcdisassembler \ libllvmmcjit \ libllvmruntimedyld -.endif -.endif +.endif # MK_CLANG_EXTRAS +.endif # !make(install) SUBDIR+= include Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/clang.build.mk Sat Feb 2 22:28:29 2013 (r246259) @@ -8,6 +8,12 @@ CFLAGS+= -I${LLVM_SRCS}/include -I${CLAN -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG +.if !defined(EARLY_BUILD) && defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no" +CFLAGS+= -DCLANG_ENABLE_ARCMT \ + -DCLANG_ENABLE_REWRITER \ + -DCLANG_ENABLE_STATIC_ANALYZER +.endif # !EARLY_BUILD && MK_CLANG_FULL + # LLVM is not strict aliasing safe as of 12/31/2011 CFLAGS+= -fno-strict-aliasing Modified: head/lib/clang/libclanganalysis/Makefile ============================================================================== --- head/lib/clang/libclanganalysis/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclanganalysis/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clanganalysis SRCDIR= tools/clang/lib/Analysis Modified: head/lib/clang/libclangarcmigrate/Makefile ============================================================================== --- head/lib/clang/libclangarcmigrate/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangarcmigrate/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangarcmigrate SRCDIR= tools/clang/lib/ARCMigrate Modified: head/lib/clang/libclangast/Makefile ============================================================================== --- head/lib/clang/libclangast/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangast/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangast SRCDIR= tools/clang/lib/AST Modified: head/lib/clang/libclangbasic/Makefile ============================================================================== --- head/lib/clang/libclangbasic/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangbasic/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangbasic SRCDIR= tools/clang/lib/Basic Modified: head/lib/clang/libclangcodegen/Makefile ============================================================================== --- head/lib/clang/libclangcodegen/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangcodegen/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangcodegen SRCDIR= tools/clang/lib/CodeGen Modified: head/lib/clang/libclangdriver/Makefile ============================================================================== --- head/lib/clang/libclangdriver/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangdriver/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangdriver SRCDIR= tools/clang/lib/Driver Modified: head/lib/clang/libclangedit/Makefile ============================================================================== --- head/lib/clang/libclangedit/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangedit/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangedit SRCDIR= tools/clang/lib/Edit Modified: head/lib/clang/libclangfrontend/Makefile ============================================================================== --- head/lib/clang/libclangfrontend/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangfrontend/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangfrontend SRCDIR= tools/clang/lib/Frontend Modified: head/lib/clang/libclangfrontendtool/Makefile ============================================================================== --- head/lib/clang/libclangfrontendtool/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangfrontendtool/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangfrontendtool SRCDIR= tools/clang/lib/FrontendTool Modified: head/lib/clang/libclanglex/Makefile ============================================================================== --- head/lib/clang/libclanglex/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclanglex/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clanglex SRCDIR= tools/clang/lib/Lex Modified: head/lib/clang/libclangparse/Makefile ============================================================================== --- head/lib/clang/libclangparse/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangparse/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangparse SRCDIR= tools/clang/lib/Parse Modified: head/lib/clang/libclangrewritecore/Makefile ============================================================================== --- head/lib/clang/libclangrewritecore/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangrewritecore/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangrewritecore SRCDIR= tools/clang/lib/Rewrite/Core Modified: head/lib/clang/libclangrewritefrontend/Makefile ============================================================================== --- head/lib/clang/libclangrewritefrontend/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangrewritefrontend/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangrewritefrontend SRCDIR= tools/clang/lib/Rewrite/Frontend Modified: head/lib/clang/libclangsema/Makefile ============================================================================== --- head/lib/clang/libclangsema/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangsema/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangsema SRCDIR= tools/clang/lib/Sema Modified: head/lib/clang/libclangserialization/Makefile ============================================================================== --- head/lib/clang/libclangserialization/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangserialization/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangserialization SRCDIR= tools/clang/lib/Serialization Modified: head/lib/clang/libclangstaticanalyzercheckers/Makefile ============================================================================== --- head/lib/clang/libclangstaticanalyzercheckers/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangstaticanalyzercheckers/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangstaticanalyzercheckers SRCDIR= tools/clang/lib/StaticAnalyzer/Checkers Modified: head/lib/clang/libclangstaticanalyzercore/Makefile ============================================================================== --- head/lib/clang/libclangstaticanalyzercore/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangstaticanalyzercore/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangstaticanalyzercore SRCDIR= tools/clang/lib/StaticAnalyzer/Core Modified: head/lib/clang/libclangstaticanalyzerfrontend/Makefile ============================================================================== --- head/lib/clang/libclangstaticanalyzerfrontend/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libclangstaticanalyzerfrontend/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= clangstaticanalyzerfrontend SRCDIR= tools/clang/lib/StaticAnalyzer/Frontend Modified: head/lib/clang/libllvmarchive/Makefile ============================================================================== --- head/lib/clang/libllvmarchive/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmarchive/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmarchive SRCDIR= lib/Archive Modified: head/lib/clang/libllvmarmasmparser/Makefile ============================================================================== --- head/lib/clang/libllvmarmasmparser/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmarmasmparser/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmarmasmparser SRCDIR= lib/Target/ARM/AsmParser Modified: head/lib/clang/libllvmarmcodegen/Makefile ============================================================================== --- head/lib/clang/libllvmarmcodegen/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmarmcodegen/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmarmcodegen SRCDIR= lib/Target/ARM Modified: head/lib/clang/libllvmarmdesc/Makefile ============================================================================== --- head/lib/clang/libllvmarmdesc/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmarmdesc/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmarmdesc SRCDIR= lib/Target/ARM/MCTargetDesc Modified: head/lib/clang/libllvmarmdisassembler/Makefile ============================================================================== --- head/lib/clang/libllvmarmdisassembler/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmarmdisassembler/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmarmdisassembler SRCDIR= lib/Target/ARM/Disassembler Modified: head/lib/clang/libllvmarminfo/Makefile ============================================================================== --- head/lib/clang/libllvmarminfo/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmarminfo/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmarminfo SRCDIR= lib/Target/ARM/TargetInfo Modified: head/lib/clang/libllvmarminstprinter/Makefile ============================================================================== --- head/lib/clang/libllvmarminstprinter/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmarminstprinter/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmarminstprinter SRCDIR= lib/Target/ARM/InstPrinter Modified: head/lib/clang/libllvmasmparser/Makefile ============================================================================== --- head/lib/clang/libllvmasmparser/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmasmparser/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmasmparser SRCDIR= lib/AsmParser Modified: head/lib/clang/libllvmasmprinter/Makefile ============================================================================== --- head/lib/clang/libllvmasmprinter/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmasmprinter/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmasmprinter SRCDIR= lib/CodeGen/AsmPrinter Modified: head/lib/clang/libllvmbitreader/Makefile ============================================================================== --- head/lib/clang/libllvmbitreader/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmbitreader/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmbitreader SRCDIR= lib/Bitcode/Reader Modified: head/lib/clang/libllvmbitwriter/Makefile ============================================================================== --- head/lib/clang/libllvmbitwriter/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmbitwriter/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmbitwriter SRCDIR= lib/Bitcode/Writer Modified: head/lib/clang/libllvmcodegen/Makefile ============================================================================== --- head/lib/clang/libllvmcodegen/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmcodegen/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmcodegen SRCDIR= lib/CodeGen Modified: head/lib/clang/libllvmcore/Makefile ============================================================================== --- head/lib/clang/libllvmcore/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmcore/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmcore SRCDIR= lib/VMCore Modified: head/lib/clang/libllvmdebuginfo/Makefile ============================================================================== --- head/lib/clang/libllvmdebuginfo/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmdebuginfo/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmdebuginfo SRCDIR= lib/DebugInfo Modified: head/lib/clang/libllvmexecutionengine/Makefile ============================================================================== --- head/lib/clang/libllvmexecutionengine/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmexecutionengine/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmexecutionengine SRCDIR= lib/ExecutionEngine Modified: head/lib/clang/libllvminstcombine/Makefile ============================================================================== --- head/lib/clang/libllvminstcombine/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvminstcombine/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvminstcombine SRCDIR= lib/Transforms/InstCombine Modified: head/lib/clang/libllvminstrumentation/Makefile ============================================================================== --- head/lib/clang/libllvminstrumentation/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvminstrumentation/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvminstrumentation SRCDIR= lib/Transforms/Instrumentation Modified: head/lib/clang/libllvminterpreter/Makefile ============================================================================== --- head/lib/clang/libllvminterpreter/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvminterpreter/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvminterpreter SRCDIR= lib/ExecutionEngine/Interpreter Modified: head/lib/clang/libllvmjit/Makefile ============================================================================== --- head/lib/clang/libllvmjit/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmjit/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmjit SRCDIR= lib/ExecutionEngine/JIT Modified: head/lib/clang/libllvmlinker/Makefile ============================================================================== --- head/lib/clang/libllvmlinker/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmlinker/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmlinker SRCDIR= lib/Linker Modified: head/lib/clang/libllvmmcdisassembler/Makefile ============================================================================== --- head/lib/clang/libllvmmcdisassembler/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmmcdisassembler/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmcdisassembler SRCDIR= lib/MC/MCDisassembler Modified: head/lib/clang/libllvmmcparser/Makefile ============================================================================== --- head/lib/clang/libllvmmcparser/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmmcparser/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmcparser SRCDIR= lib/MC/MCParser Modified: head/lib/clang/libllvmmipsasmparser/Makefile ============================================================================== --- head/lib/clang/libllvmmipsasmparser/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmmipsasmparser/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmipsasmparser SRCDIR= lib/Target/Mips/AsmParser Modified: head/lib/clang/libllvmmipscodegen/Makefile ============================================================================== --- head/lib/clang/libllvmmipscodegen/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmmipscodegen/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmipscodegen SRCDIR= lib/Target/Mips Modified: head/lib/clang/libllvmmipsdesc/Makefile ============================================================================== --- head/lib/clang/libllvmmipsdesc/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmmipsdesc/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmipsdesc SRCDIR= lib/Target/Mips/MCTargetDesc Modified: head/lib/clang/libllvmmipsdisassembler/Makefile ============================================================================== --- head/lib/clang/libllvmmipsdisassembler/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmmipsdisassembler/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmipsdisassembler SRCDIR= lib/Target/Mips/Disassembler Modified: head/lib/clang/libllvmmipsinfo/Makefile ============================================================================== --- head/lib/clang/libllvmmipsinfo/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmmipsinfo/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmipsinfo SRCDIR= lib/Target/Mips/TargetInfo Modified: head/lib/clang/libllvmmipsinstprinter/Makefile ============================================================================== --- head/lib/clang/libllvmmipsinstprinter/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmmipsinstprinter/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmipsinstprinter SRCDIR= lib/Target/Mips/InstPrinter Modified: head/lib/clang/libllvmobject/Makefile ============================================================================== --- head/lib/clang/libllvmobject/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmobject/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmobject SRCDIR= lib/Object Modified: head/lib/clang/libllvmpowerpccodegen/Makefile ============================================================================== --- head/lib/clang/libllvmpowerpccodegen/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmpowerpccodegen/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmpowerpccodegen SRCDIR= lib/Target/PowerPC Modified: head/lib/clang/libllvmpowerpcdesc/Makefile ============================================================================== --- head/lib/clang/libllvmpowerpcdesc/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmpowerpcdesc/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmpowerpcdesc SRCDIR= lib/Target/PowerPC/MCTargetDesc Modified: head/lib/clang/libllvmpowerpcinfo/Makefile ============================================================================== --- head/lib/clang/libllvmpowerpcinfo/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmpowerpcinfo/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmpowerpcinfo SRCDIR= lib/Target/PowerPC/TargetInfo Modified: head/lib/clang/libllvmpowerpcinstprinter/Makefile ============================================================================== --- head/lib/clang/libllvmpowerpcinstprinter/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmpowerpcinstprinter/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmpowerpcinstprinter SRCDIR= lib/Target/PowerPC/InstPrinter Modified: head/lib/clang/libllvmruntimedyld/Makefile ============================================================================== --- head/lib/clang/libllvmruntimedyld/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmruntimedyld/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmruntimedyld SRCDIR= lib/ExecutionEngine/RuntimeDyld Modified: head/lib/clang/libllvmselectiondag/Makefile ============================================================================== --- head/lib/clang/libllvmselectiondag/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmselectiondag/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmselectiondag SRCDIR= lib/CodeGen/SelectionDAG Modified: head/lib/clang/libllvmtablegen/Makefile ============================================================================== --- head/lib/clang/libllvmtablegen/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmtablegen/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmtablegen SRCDIR= lib/TableGen Modified: head/lib/clang/libllvmtarget/Makefile ============================================================================== --- head/lib/clang/libllvmtarget/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmtarget/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmtarget SRCDIR= lib/Target Modified: head/lib/clang/libllvmvectorize/Makefile ============================================================================== --- head/lib/clang/libllvmvectorize/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmvectorize/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmvectorize SRCDIR= lib/Transforms/Vectorize Modified: head/lib/clang/libllvmx86asmparser/Makefile ============================================================================== --- head/lib/clang/libllvmx86asmparser/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmx86asmparser/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmx86asmparser SRCDIR= lib/Target/X86/AsmParser Modified: head/lib/clang/libllvmx86codegen/Makefile ============================================================================== --- head/lib/clang/libllvmx86codegen/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmx86codegen/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmx86codegen SRCDIR= lib/Target/X86 Modified: head/lib/clang/libllvmx86desc/Makefile ============================================================================== --- head/lib/clang/libllvmx86desc/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmx86desc/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmx86desc SRCDIR= lib/Target/X86/MCTargetDesc Modified: head/lib/clang/libllvmx86info/Makefile ============================================================================== --- head/lib/clang/libllvmx86info/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmx86info/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmx86info SRCDIR= lib/Target/X86/TargetInfo Modified: head/lib/clang/libllvmx86instprinter/Makefile ============================================================================== --- head/lib/clang/libllvmx86instprinter/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmx86instprinter/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmx86instprinter SRCDIR= lib/Target/X86/InstPrinter Modified: head/lib/clang/libllvmx86utils/Makefile ============================================================================== --- head/lib/clang/libllvmx86utils/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/lib/clang/libllvmx86utils/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmx86utils SRCDIR= lib/Target/X86/Utils Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat Feb 2 22:23:45 2013 (r246258) +++ head/share/mk/bsd.own.mk Sat Feb 2 22:28:29 2013 (r246259) @@ -391,9 +391,9 @@ __T=${MACHINE_ARCH} .endif # Clang is only for x86 and powerpc right now, by default. .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} -__DEFAULT_YES_OPTIONS+=CLANG +__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL .else -__DEFAULT_NO_OPTIONS+=CLANG +__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL .endif # Clang the default system compiler only on x86. .if ${__T} == "amd64" || ${__T} == "i386" @@ -524,6 +524,7 @@ MK_GDB:= no .if ${MK_CLANG} == "no" MK_CLANG_EXTRAS:= no +MK_CLANG_FULL:= no MK_CLANG_IS_CC:= no .endif Added: head/tools/build/options/WITHOUT_CLANG_FULL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_CLANG_FULL Sat Feb 2 22:28:29 2013 (r246259) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of +the Clang C/C++ compiler. Added: head/tools/build/options/WITH_CLANG_FULL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_CLANG_FULL Sat Feb 2 22:28:29 2013 (r246259) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the +Clang C/C++ compiler. Modified: head/usr.bin/clang/clang/Makefile ============================================================================== --- head/usr.bin/clang/clang/Makefile Sat Feb 2 22:23:45 2013 (r246258) +++ head/usr.bin/clang/clang/Makefile Sat Feb 2 22:28:29 2013 (r246259) @@ -35,6 +35,19 @@ TGHDRS= CC1AsOptions \ DiagnosticLexKinds \ DiagnosticSemaKinds \ Options + +.if !defined(EARLY_BUILD) && defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no" +_clangstaticanalyzer= \ + clangstaticanalyzerfrontend \ + clangstaticanalyzercheckers \ + clangstaticanalyzercore +_clangarcmigrate= \ + clangarcmigrate +_clangrewriter= \ + clangrewritefrontend \ + clangrewritecore +.endif # !EARLY_BUILD && MK_CLANG_FULL + LIBDEPS=clangfrontendtool \ clangfrontend \ clangdriver \ @@ -42,13 +55,10 @@ LIBDEPS=clangfrontendtool \ clangcodegen \ clangparse \ clangsema \ - clangstaticanalyzerfrontend \ - clangstaticanalyzercheckers \ - clangstaticanalyzercore \ + ${_clangstaticanalyzer} \ clanganalysis \ - clangarcmigrate \ - clangrewritefrontend \ - clangrewritecore \ + ${_clangarcmigrate} \ + ${_clangrewriter} \ clangedit \ clangast \ clanglex \ From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 22:36:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6DB1D198; Sat, 2 Feb 2013 22:36:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 305F3958; Sat, 2 Feb 2013 22:36:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12Ma3l4024276; Sat, 2 Feb 2013 22:36:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12Ma3BT024275; Sat, 2 Feb 2013 22:36:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302022236.r12Ma3BT024275@svn.freebsd.org> From: Dimitry Andric Date: Sat, 2 Feb 2013 22:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246260 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 22:36:03 -0000 Author: dim Date: Sat Feb 2 22:36:02 2013 New Revision: 246260 URL: http://svnweb.freebsd.org/changeset/base/246260 Log: Regenerate src.conf(5). Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Feb 2 22:28:29 2013 (r246259) +++ head/share/man/man5/src.conf.5 Sat Feb 2 22:36:02 2013 (r246260) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd January 29, 2013 +.Dd February 2, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -298,6 +298,8 @@ When set, it also enforces the following .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FULL +.It .Va WITHOUT_CLANG_IS_CC .El .It Va WITH_CLANG @@ -309,6 +311,20 @@ amd64/amd64, i386/i386, pc98/i386, power .It Va WITH_CLANG_EXTRAS .\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim Set to build additional clang and llvm tools, such as bugpoint. +.It Va WITHOUT_CLANG_FULL +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_FULL 246259 2013-02-02 22:28:29Z dim +Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of +the Clang C/C++ compiler. +.Pp +It is a default setting on +arm/arm, arm/armeb, arm/armv6, arm/armv6eb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. +.It Va WITH_CLANG_FULL +.\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim +Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the +Clang C/C++ compiler. +.Pp +It is a default setting on +amd64/amd64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_CLANG_IS_CC .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks Set to install the GCC compiler as @@ -385,6 +401,10 @@ When set, it also enforces the following .It .Va WITHOUT_CLANG .It +.Va WITHOUT_CLANG_EXTRAS +.It +.Va WITHOUT_CLANG_FULL +.It .Va WITHOUT_CLANG_IS_CC .It .Va WITHOUT_GROFF @@ -646,9 +666,6 @@ and On amd64, set to not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. -.It Va WITH_LIBCPLUSPLUS -.\" from FreeBSD: head/tools/build/options/WITH_LIBCPLUSPLUS 228082 2011-11-28 17:56:46Z dim -Set to build libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD .\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm Set to not build the @@ -1053,6 +1070,10 @@ When set, it also enforces the following .It .Va WITHOUT_CLANG .It +.Va WITHOUT_CLANG_EXTRAS +.It +.Va WITHOUT_CLANG_FULL +.It .Va WITHOUT_CLANG_IS_CC .It .Va WITHOUT_GCC From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 22:39:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7666C32A; Sat, 2 Feb 2013 22:39:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5245497F; Sat, 2 Feb 2013 22:39:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12MdMMt024709; Sat, 2 Feb 2013 22:39:22 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12MdMFH024708; Sat, 2 Feb 2013 22:39:22 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302022239.r12MdMFH024708@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 2 Feb 2013 22:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246261 - head/usr.sbin/crunch/crunchgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 22:39:22 -0000 Author: pfg Date: Sat Feb 2 22:39:21 2013 New Revision: 246261 URL: http://svnweb.freebsd.org/changeset/base/246261 Log: crunch: Sync some NetBSD changes Revert a comment that was not supposed to go away. Obtained from: NetBSD Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Sat Feb 2 22:36:02 2013 (r246260) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Sat Feb 2 22:39:21 2013 (r246261) @@ -113,13 +113,14 @@ int is_nonempty_file(const char *pathnam int subtract_strlst(strlst_t **lista, strlst_t **listb); int in_list(strlst_t **listp, char *str); - -extern char *crunched_skel[]; +/* helper routines for main() */ void usage(void); void parse_conf_file(void); void gen_outputs(void); +extern char *crunched_skel[]; + int main(int argc, char **argv) From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 22:42:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B43964E7; Sat, 2 Feb 2013 22:42:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 904B99AC; Sat, 2 Feb 2013 22:42:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12MglHc026751; Sat, 2 Feb 2013 22:42:47 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12MglgO026749; Sat, 2 Feb 2013 22:42:47 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302022242.r12MglgO026749@svn.freebsd.org> From: Dimitry Andric Date: Sat, 2 Feb 2013 22:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246262 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 22:42:47 -0000 Author: dim Date: Sat Feb 2 22:42:46 2013 New Revision: 246262 URL: http://svnweb.freebsd.org/changeset/base/246262 Log: Add missing src.conf(5) fragments for WITHOUT_LIBCPLUSPLUS and WITH_GPL_DTC. Added: head/tools/build/options/WITHOUT_LIBCPLUSPLUS (contents, props changed) head/tools/build/options/WITH_GPL_DTC (contents, props changed) Added: head/tools/build/options/WITHOUT_LIBCPLUSPLUS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LIBCPLUSPLUS Sat Feb 2 22:42:46 2013 (r246262) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to avoid building libcxxrt and libc++. Added: head/tools/build/options/WITH_GPL_DTC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GPL_DTC Sat Feb 2 22:42:46 2013 (r246262) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build the GPL'd version of the device tree compiler from elinux.org, +instead of the BSD licensed one. From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 22:52:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6943B707; Sat, 2 Feb 2013 22:52:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 455CA9E3; Sat, 2 Feb 2013 22:52:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12MqPIt029640; Sat, 2 Feb 2013 22:52:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12MqPEB029638; Sat, 2 Feb 2013 22:52:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302022252.r12MqPEB029638@svn.freebsd.org> From: Dimitry Andric Date: Sat, 2 Feb 2013 22:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246263 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 22:52:25 -0000 Author: dim Date: Sat Feb 2 22:52:24 2013 New Revision: 246263 URL: http://svnweb.freebsd.org/changeset/base/246263 Log: Regenerate src.conf(5). Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Feb 2 22:42:46 2013 (r246262) +++ head/share/man/man5/src.conf.5 Sat Feb 2 22:52:24 2013 (r246263) @@ -502,6 +502,10 @@ Set to not build GPIB bus support. Set to not build .Xr gpioctl 8 as part of the base system. +.It Va WITH_GPL_DTC +.\" from FreeBSD: head/tools/build/options/WITH_GPL_DTC 246262 2013-02-02 22:42:46Z dim +Set to build the GPL'd version of the device tree compiler from elinux.org, +instead of the BSD licensed one. .It Va WITHOUT_GROFF .\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs Set to not build @@ -666,6 +670,9 @@ and On amd64, set to not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. +.It Va WITHOUT_LIBCPLUSPLUS +.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBCPLUSPLUS 246262 2013-02-02 22:42:46Z dim +Set to avoid building libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD .\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm Set to not build the From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 23:01:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7D5ED93C; Sat, 2 Feb 2013 23:01:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5B38DA1C; Sat, 2 Feb 2013 23:01:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12N1tat032690; Sat, 2 Feb 2013 23:01:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12N1shK032685; Sat, 2 Feb 2013 23:01:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022301.r12N1shK032685@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246264 - in stable/9: share/mk tools/build/mk tools/build/options usr.sbin X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:01:55 -0000 Author: eadler Date: Sat Feb 2 23:01:54 2013 New Revision: 246264 URL: http://svnweb.freebsd.org/changeset/base/246264 Log: MFC r245606: Add option to make pc-sysinstall optional PR: bin/173931 Approved by: cperciva (implicit) Added: stable/9/tools/build/options/WITHOUT_PC_SYSINSTALL - copied unchanged from r245606, head/tools/build/options/WITHOUT_PC_SYSINSTALL Modified: stable/9/share/mk/bsd.own.mk stable/9/tools/build/mk/OptionalObsoleteFiles.inc stable/9/usr.sbin/Makefile (contents, props changed) Directory Properties: stable/9/share/mk/ (props changed) stable/9/tools/build/ (props changed) stable/9/tools/build/options/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Sat Feb 2 22:52:24 2013 (r246263) +++ stable/9/share/mk/bsd.own.mk Sat Feb 2 23:01:54 2013 (r246264) @@ -385,6 +385,7 @@ __DEFAULT_YES_OPTIONS = \ OPENSSH \ OPENSSL \ PAM \ + PC_SYSINSTALL \ PF \ PKGTOOLS \ PMC \ Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat Feb 2 22:52:24 2013 (r246263) +++ stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat Feb 2 23:01:54 2013 (r246264) @@ -3089,6 +3089,95 @@ OLD_FILES+=usr/share/man/man8/ntptime.8. # to be filled in #.endif +.if ${MK_PC_SYSINSTALL} == no +# backend-partmanager +OLD_FILES+=usr/share/pc-sysinstall/backend-partmanager/create-part.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-partmanager/delete-part.sh +# backend-query +OLD_FILES+=usr/share/pc-sysinstall/backend-query/detect-emulation.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/detect-laptop.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/detect-nics.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/disk-info.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/disk-list.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/disk-part.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/enable-net.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/get-packages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-components.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-config.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-mirrors.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-packages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-rsync-backups.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/list-tzones.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/query-langs.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/send-logs.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/setup-ssh-keys.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/set-mirror.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/sys-mem.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/test-live.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/test-netup.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/update-part-list.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/xkeyboard-layouts.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/xkeyboard-models.sh +OLD_FILES+=usr/share/pc-sysinstall/backend-query/xkeyboard-variants.sh +# backend +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-bsdlabel.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-cleanup.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-disk.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-extractimage.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-ftp.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-installcomponents.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-installpackages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-localize.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-mountdisk.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-mountoptical.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-networking.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-newfs.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-parse.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-packages.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-runcommands.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-unmount.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-upgrade.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions-users.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/functions.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/installimage.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/parseconfig.sh +OLD_FILES+=usr/share/pc-sysinstall/backend/startautoinstall.sh +# conf +OLD_FILES+=usr/share/pc-sysinstall/conf/avail-langs +OLD_FILES+=usr/share/pc-sysinstall/conf/exclude-from-upgrade +OLD_FILES+=usr/share/pc-sysinstall/conf/license/bsd-en.txt +OLD_FILES+=usr/share/pc-sysinstall/conf/license/intel-en.txt +OLD_FILES+=usr/share/pc-sysinstall/conf/license/nvidia-en.txt +OLD_FILES+=usr/share/pc-sysinstall/conf/pc-sysinstall.conf +# doc +OLD_FILES+=usr/share/pc-sysinstall/doc/help-disk-list +OLD_FILES+=usr/share/pc-sysinstall/doc/help-disk-size +OLD_FILES+=usr/share/pc-sysinstall/doc/help-index +OLD_FILES+=usr/share/pc-sysinstall/doc/help-start-autoinstall +# examples +OLD_FILES+=usr/share/examples/pc-sysinstall/README +OLD_FILES+=usr/share/examples/pc-sysinstall/pc-autoinstall.conf +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.fbsd-netinstall +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.geli +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.gmirror +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.netinstall +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.restore +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.rsync +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.upgrade +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.zfs +# pc-sysinstall +OLD_FILES+=usr/sbin/pc-sysinstall +OLD_FILES+=usr/share/man/man8/pc-sysinstall.8.gz +OLD_DIRS+=usr/share/pc-sysinstall/backend +OLD_DIRS+=usr/share/pc-sysinstall/backend-partmanager +OLD_DIRS+=usr/share/pc-sysinstall/backend-query +OLD_DIRS+=usr/share/pc-sysinstall/conf/license +OLD_DIRS+=usr/share/pc-sysinstall/conf +OLD_DIRS+=usr/share/pc-sysinstall/doc +OLD_DIRS+=usr/share/pc-sysinstall +OLD_DIRS+=usr/share/examples/pc-sysinstall +.endif + .if ${MK_PF} == no OLD_FILES+=etc/periodic/security/520.pfdenied OLD_FILES+=etc/pf.os Copied: stable/9/tools/build/options/WITHOUT_PC_SYSINSTALL (from r245606, head/tools/build/options/WITHOUT_PC_SYSINSTALL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/build/options/WITHOUT_PC_SYSINSTALL Sat Feb 2 23:01:54 2013 (r246264, copy of r245606, head/tools/build/options/WITHOUT_PC_SYSINSTALL) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr pc-sysinstall 8 +and related programs. Modified: stable/9/usr.sbin/Makefile ============================================================================== --- stable/9/usr.sbin/Makefile Sat Feb 2 22:52:24 2013 (r246263) +++ stable/9/usr.sbin/Makefile Sat Feb 2 23:01:54 2013 (r246264) @@ -56,7 +56,7 @@ SUBDIR= adduser \ nfsuserd \ nmtree \ nologin \ - pc-sysinstall \ + ${_pc_sysinstall} \ pciconf \ periodic \ powerd \ @@ -254,6 +254,10 @@ SUBDIR+= ntp SUBDIR+= keyserv .endif +.if ${MK_PC_SYSINSTALL} != "no" +_pc_sysinstall= pc-sysinstall +.endif + .if ${MK_PF} != "no" SUBDIR+= ftp-proxy .endif From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 23:11:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6E468CC3; Sat, 2 Feb 2013 23:11:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 558B0A65; Sat, 2 Feb 2013 23:11:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NBHmM036078; Sat, 2 Feb 2013 23:11:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NBHPk036077; Sat, 2 Feb 2013 23:11:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022311.r12NBHPk036077@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246265 - stable/8/bin/cp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:11:17 -0000 Author: eadler Date: Sat Feb 2 23:11:16 2013 New Revision: 246265 URL: http://svnweb.freebsd.org/changeset/base/246265 Log: MFC r245535: Remove useless variable 'Pflag': -P is an alternative to -H and -L, and it is implemented using the Hflag and Lflag variables. Approved by: cperciva (mentor, implicit) Modified: stable/8/bin/cp/cp.c Directory Properties: stable/8/bin/cp/ (props changed) Modified: stable/8/bin/cp/cp.c ============================================================================== --- stable/8/bin/cp/cp.c Sat Feb 2 23:01:54 2013 (r246264) +++ stable/8/bin/cp/cp.c Sat Feb 2 23:11:16 2013 (r246265) @@ -98,30 +98,28 @@ main(int argc, char *argv[]) { struct stat to_stat, tmp_stat; enum op type; - int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash; + int Hflag, Lflag, ch, fts_options, r, have_trailing_slash; char *target; fts_options = FTS_NOCHDIR | FTS_PHYSICAL; - Hflag = Lflag = Pflag = 0; + Hflag = Lflag = 0; while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1) switch (ch) { case 'H': Hflag = 1; - Lflag = Pflag = 0; + Lflag = 0; break; case 'L': Lflag = 1; - Hflag = Pflag = 0; + Hflag = 0; break; case 'P': - Pflag = 1; Hflag = Lflag = 0; break; case 'R': Rflag = 1; break; case 'a': - Pflag = 1; pflag = 1; Rflag = 1; Hflag = Lflag = 0; @@ -146,7 +144,7 @@ main(int argc, char *argv[]) break; case 'r': rflag = Lflag = 1; - Hflag = Pflag = 0; + Hflag = 0; break; case 'v': vflag = 1; From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 23:11:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 990F7CC6; Sat, 2 Feb 2013 23:11:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8105CA67; Sat, 2 Feb 2013 23:11:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NBLv5036120; Sat, 2 Feb 2013 23:11:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NBLiR036119; Sat, 2 Feb 2013 23:11:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022311.r12NBLiR036119@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246266 - stable/9/bin/cp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:11:21 -0000 Author: eadler Date: Sat Feb 2 23:11:20 2013 New Revision: 246266 URL: http://svnweb.freebsd.org/changeset/base/246266 Log: MFC r245535: Remove useless variable 'Pflag': -P is an alternative to -H and -L, and it is implemented using the Hflag and Lflag variables. Approved by: cperciva (mentor, implicit) Modified: stable/9/bin/cp/cp.c Directory Properties: stable/9/bin/cp/ (props changed) Modified: stable/9/bin/cp/cp.c ============================================================================== --- stable/9/bin/cp/cp.c Sat Feb 2 23:11:16 2013 (r246265) +++ stable/9/bin/cp/cp.c Sat Feb 2 23:11:20 2013 (r246266) @@ -98,30 +98,28 @@ main(int argc, char *argv[]) { struct stat to_stat, tmp_stat; enum op type; - int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash; + int Hflag, Lflag, ch, fts_options, r, have_trailing_slash; char *target; fts_options = FTS_NOCHDIR | FTS_PHYSICAL; - Hflag = Lflag = Pflag = 0; + Hflag = Lflag = 0; while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1) switch (ch) { case 'H': Hflag = 1; - Lflag = Pflag = 0; + Lflag = 0; break; case 'L': Lflag = 1; - Hflag = Pflag = 0; + Hflag = 0; break; case 'P': - Pflag = 1; Hflag = Lflag = 0; break; case 'R': Rflag = 1; break; case 'a': - Pflag = 1; pflag = 1; Rflag = 1; Hflag = Lflag = 0; @@ -146,7 +144,7 @@ main(int argc, char *argv[]) break; case 'r': rflag = Lflag = 1; - Hflag = Pflag = 0; + Hflag = 0; break; case 'v': vflag = 1; From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 23:22:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8AB8810B; Sat, 2 Feb 2013 23:22:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63057AAF; Sat, 2 Feb 2013 23:22:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NMSjg039182; Sat, 2 Feb 2013 23:22:28 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NMSkL039181; Sat, 2 Feb 2013 23:22:28 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022322.r12NMSkL039181@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246267 - stable/9/share/examples/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:22:28 -0000 Author: eadler Date: Sat Feb 2 23:22:27 2013 New Revision: 246267 URL: http://svnweb.freebsd.org/changeset/base/246267 Log: MFC r244122: Remove 'dangerous' instructions from the example make.conf. Clarify when and why these might be used and that this isn't a supported configuration. PR: docs/144488 Approved by: cperciva (mentor, implicit) Modified: stable/9/share/examples/etc/make.conf Directory Properties: stable/9/share/examples/ (props changed) stable/9/share/examples/etc/ (props changed) Modified: stable/9/share/examples/etc/make.conf ============================================================================== --- stable/9/share/examples/etc/make.conf Sat Feb 2 23:11:20 2013 (r246266) +++ stable/9/share/examples/etc/make.conf Sat Feb 2 23:22:27 2013 (r246267) @@ -51,21 +51,20 @@ # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings other than -O and -O2 are not recommended # or supported for compiling the world or the kernel - please revert any -# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing" +# nonstandard optimization settings # before submitting bug reports without patches to the developers. # -# Compiling with -fstrict-aliasing optimization breaks some [notable] ports. -# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so -# explicitly turn it off when using compiling with the -O2 optimization level. -# -#CFLAGS= -O2 -fno-strict-aliasing -pipe -# # CXXFLAGS controls the compiler settings used when compiling C++ code. # Note that CXXFLAGS is initially set to the value of CFLAGS. If you wish # to add to CXXFLAGS value, "+=" must be used rather than "=". Using "=" # alone will remove the often needed contents of CFLAGS from CXXFLAGS. # -#CXXFLAGS+= -fconserve-space +# Additional compiler flags can be specified that extend or override +# default ones. However, neither the base system nor ports are guaranteed +# to build and function without problems with non-default settings. +# +# CFLAGS+= -msse3 +# CXXFLAGS+= -msse3 # # MAKE_SHELL controls the shell used internally by make(1) to process the # command scripts in makefiles. Three shells are supported, sh, ksh, and From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 23:22:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D9ADF10C; Sat, 2 Feb 2013 23:22:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AE70CAB0; Sat, 2 Feb 2013 23:22:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NMV7r039222; Sat, 2 Feb 2013 23:22:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NMVZ9039221; Sat, 2 Feb 2013 23:22:31 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022322.r12NMVZ9039221@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246268 - stable/7/share/examples/etc X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:22:31 -0000 Author: eadler Date: Sat Feb 2 23:22:31 2013 New Revision: 246268 URL: http://svnweb.freebsd.org/changeset/base/246268 Log: MFC r244122: Remove 'dangerous' instructions from the example make.conf. Clarify when and why these might be used and that this isn't a supported configuration. PR: docs/144488 Approved by: cperciva (mentor, implicit) Modified: stable/7/share/examples/etc/make.conf Directory Properties: stable/7/share/examples/ (props changed) Modified: stable/7/share/examples/etc/make.conf ============================================================================== --- stable/7/share/examples/etc/make.conf Sat Feb 2 23:22:27 2013 (r246267) +++ stable/7/share/examples/etc/make.conf Sat Feb 2 23:22:31 2013 (r246268) @@ -52,21 +52,20 @@ # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings other than -O and -O2 are not recommended # or supported for compiling the world or the kernel - please revert any -# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing" +# nonstandard optimization settings # before submitting bug reports without patches to the developers. # -# Compiling with -fstrict-aliasing optimization breaks some [notable] ports. -# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so -# explicitly turn it off when using compiling with the -O2 optimization level. -# -#CFLAGS= -O2 -fno-strict-aliasing -pipe -# # CXXFLAGS controls the compiler settings used when compiling C++ code. # Note that CXXFLAGS is initially set to the value of CFLAGS. If you wish # to add to CXXFLAGS value, "+=" must be used rather than "=". Using "=" # alone will remove the often needed contents of CFLAGS from CXXFLAGS. # -#CXXFLAGS+= -fconserve-space +# Additional compiler flags can be specified that extend or override +# default ones. However, neither the base system nor ports are guaranteed +# to build and function without problems with non-default settings. +# +# CFLAGS+= -msse3 +# CXXFLAGS+= -msse3 # # MAKE_SHELL controls the shell used internally by make(1) to process the # command scripts in makefiles. Three shells are supported, sh, ksh, and From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 23:22:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9859A327; Sat, 2 Feb 2013 23:22:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 150DBAB3; Sat, 2 Feb 2013 23:22:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NMdEV039311; Sat, 2 Feb 2013 23:22:39 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NMdiw039310; Sat, 2 Feb 2013 23:22:39 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022322.r12NMdiw039310@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246269 - stable/8/share/examples/etc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:22:41 -0000 Author: eadler Date: Sat Feb 2 23:22:39 2013 New Revision: 246269 URL: http://svnweb.freebsd.org/changeset/base/246269 Log: MFC r244122: Remove 'dangerous' instructions from the example make.conf. Clarify when and why these might be used and that this isn't a supported configuration. PR: docs/144488 Approved by: cperciva (mentor, implicit) Modified: stable/8/share/examples/etc/make.conf Directory Properties: stable/8/share/examples/ (props changed) Modified: stable/8/share/examples/etc/make.conf ============================================================================== --- stable/8/share/examples/etc/make.conf Sat Feb 2 23:22:31 2013 (r246268) +++ stable/8/share/examples/etc/make.conf Sat Feb 2 23:22:39 2013 (r246269) @@ -52,21 +52,20 @@ # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings other than -O and -O2 are not recommended # or supported for compiling the world or the kernel - please revert any -# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing" +# nonstandard optimization settings # before submitting bug reports without patches to the developers. # -# Compiling with -fstrict-aliasing optimization breaks some [notable] ports. -# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so -# explicitly turn it off when using compiling with the -O2 optimization level. -# -#CFLAGS= -O2 -fno-strict-aliasing -pipe -# # CXXFLAGS controls the compiler settings used when compiling C++ code. # Note that CXXFLAGS is initially set to the value of CFLAGS. If you wish # to add to CXXFLAGS value, "+=" must be used rather than "=". Using "=" # alone will remove the often needed contents of CFLAGS from CXXFLAGS. # -#CXXFLAGS+= -fconserve-space +# Additional compiler flags can be specified that extend or override +# default ones. However, neither the base system nor ports are guaranteed +# to build and function without problems with non-default settings. +# +# CFLAGS+= -msse3 +# CXXFLAGS+= -msse3 # # MAKE_SHELL controls the shell used internally by make(1) to process the # command scripts in makefiles. Three shells are supported, sh, ksh, and From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 23:30:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 263DD6F5; Sat, 2 Feb 2013 23:30:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 09AD6AF8; Sat, 2 Feb 2013 23:30:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NUwnZ041980; Sat, 2 Feb 2013 23:30:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NUwqq041979; Sat, 2 Feb 2013 23:30:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022330.r12NUwqq041979@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246270 - stable/9/sbin/devd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:30:59 -0000 Author: eadler Date: Sat Feb 2 23:30:58 2013 New Revision: 246270 URL: http://svnweb.freebsd.org/changeset/base/246270 Log: MFC r243931: Avoid the creation of a temporary object by using the prefix operator for non-primitive types. Approved by: cperciva (mentor, implicit) Modified: stable/9/sbin/devd/devd.cc Directory Properties: stable/9/sbin/devd/ (props changed) Modified: stable/9/sbin/devd/devd.cc ============================================================================== --- stable/9/sbin/devd/devd.cc Sat Feb 2 23:22:39 2013 (r246269) +++ stable/9/sbin/devd/devd.cc Sat Feb 2 23:30:58 2013 (r246270) @@ -127,7 +127,7 @@ delete_and_clear(vector &v) { typename vector::const_iterator i; - for (i = v.begin(); i != v.end(); i++) + for (i = v.begin(); i != v.end(); ++i) delete *i; v.clear(); } @@ -155,7 +155,7 @@ event_proc::matches(config &c) { vector::const_iterator i; - for (i = _epsvec.begin(); i != _epsvec.end(); i++) + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_match(c)) return (false); return (true); @@ -166,7 +166,7 @@ event_proc::run(config &c) { vector::const_iterator i; - for (i = _epsvec.begin(); i != _epsvec.end(); i++) + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_action(c)) return (false); return (true); @@ -291,7 +291,7 @@ media::media(config &, const char *var, { -1, "unknown" }, { 0, NULL }, }; - for (int i = 0; media_types[i].ifmt_string != NULL; i++) + for (int i = 0; media_types[i].ifmt_string != NULL; ++i) if (strcasecmp(type, media_types[i].ifmt_string) == 0) { _type = media_types[i].ifmt_word; break; @@ -444,7 +444,7 @@ config::parse(void) vector::const_iterator i; parse_one_file(configfile); - for (i = _dir_list.begin(); i != _dir_list.end(); i++) + for (i = _dir_list.begin(); i != _dir_list.end(); ++i) parse_files_in_dir((*i).c_str()); sort_vector(_attach_list); sort_vector(_detach_list); @@ -559,7 +559,7 @@ config::get_variable(const string &var) { vector::reverse_iterator i; - for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); i++) { + for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); ++i) { if ((*i)->is_set(var)) return ((*i)->get_variable(var)); } @@ -716,7 +716,7 @@ config::find_and_execute(char type) } if (Dflag) fprintf(stderr, "Processing %s event\n", s); - for (i = l->begin(); i != l->end(); i++) { + for (i = l->begin(); i != l->end(); ++i) { if ((*i)->matches(*this)) { (*i)->run(*this); break; @@ -813,14 +813,14 @@ notify_clients(const char *data, int len list bad; list::const_iterator i; - for (i = clients.begin(); i != clients.end(); i++) { + for (i = clients.begin(); i != clients.end(); ++i) { if (write(*i, data, len) <= 0) { bad.push_back(*i); close(*i); } } - for (i = bad.begin(); i != bad.end(); i++) + for (i = bad.begin(); i != bad.end(); ++i) clients.erase(find(clients.begin(), clients.end(), *i)); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 23:31:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5792A6F6; Sat, 2 Feb 2013 23:31:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B0A7AF9; Sat, 2 Feb 2013 23:31:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NV2Tk042036; Sat, 2 Feb 2013 23:31:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NV2AU042035; Sat, 2 Feb 2013 23:31:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022331.r12NV2AU042035@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246271 - stable/8/sbin/devd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:31:02 -0000 Author: eadler Date: Sat Feb 2 23:31:01 2013 New Revision: 246271 URL: http://svnweb.freebsd.org/changeset/base/246271 Log: MFC r243931: Avoid the creation of a temporary object by using the prefix operator for non-primitive types. Approved by: cperciva (mentor, implicit) Modified: stable/8/sbin/devd/devd.cc Directory Properties: stable/8/sbin/devd/ (props changed) Modified: stable/8/sbin/devd/devd.cc ============================================================================== --- stable/8/sbin/devd/devd.cc Sat Feb 2 23:30:58 2013 (r246270) +++ stable/8/sbin/devd/devd.cc Sat Feb 2 23:31:01 2013 (r246271) @@ -96,7 +96,7 @@ delete_and_clear(vector &v) { typename vector::const_iterator i; - for (i = v.begin(); i != v.end(); i++) + for (i = v.begin(); i != v.end(); ++i) delete *i; v.clear(); } @@ -124,7 +124,7 @@ event_proc::matches(config &c) { vector::const_iterator i; - for (i = _epsvec.begin(); i != _epsvec.end(); i++) + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_match(c)) return (false); return (true); @@ -135,7 +135,7 @@ event_proc::run(config &c) { vector::const_iterator i; - for (i = _epsvec.begin(); i != _epsvec.end(); i++) + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_action(c)) return (false); return (true); @@ -208,7 +208,7 @@ media::media(config &, const char *var, { -1, "unknown" }, { 0, NULL }, }; - for (int i = 0; media_types[i].ifmt_string != NULL; i++) + for (int i = 0; media_types[i].ifmt_string != NULL; ++i) if (strcasecmp(type, media_types[i].ifmt_string) == 0) { _type = media_types[i].ifmt_word; break; @@ -361,7 +361,7 @@ config::parse(void) vector::const_iterator i; parse_one_file(configfile); - for (i = _dir_list.begin(); i != _dir_list.end(); i++) + for (i = _dir_list.begin(); i != _dir_list.end(); ++i) parse_files_in_dir((*i).c_str()); sort_vector(_attach_list); sort_vector(_detach_list); @@ -469,7 +469,7 @@ config::get_variable(const string &var) { vector::reverse_iterator i; - for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); i++) { + for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); ++i) { if ((*i)->is_set(var)) return ((*i)->get_variable(var)); } @@ -627,7 +627,7 @@ config::find_and_execute(char type) } if (Dflag) fprintf(stderr, "Processing %s event\n", s); - for (i = l->begin(); i != l->end(); i++) { + for (i = l->begin(); i != l->end(); ++i) { if ((*i)->matches(*this)) { (*i)->run(*this); break; @@ -716,14 +716,14 @@ notify_clients(const char *data, int len list bad; list::const_iterator i; - for (i = clients.begin(); i != clients.end(); i++) { + for (i = clients.begin(); i != clients.end(); ++i) { if (write(*i, data, len) <= 0) { bad.push_back(*i); close(*i); } } - for (i = bad.begin(); i != bad.end(); i++) + for (i = bad.begin(); i != bad.end(); ++i) clients.erase(find(clients.begin(), clients.end(), *i)); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 2 23:31:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 279D3956; Sat, 2 Feb 2013 23:31:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 28324AFE; Sat, 2 Feb 2013 23:31:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NVB6x042098; Sat, 2 Feb 2013 23:31:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NVBYN042097; Sat, 2 Feb 2013 23:31:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022331.r12NVBYN042097@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246272 - stable/7/sbin/devd X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:31:12 -0000 Author: eadler Date: Sat Feb 2 23:31:10 2013 New Revision: 246272 URL: http://svnweb.freebsd.org/changeset/base/246272 Log: MFC r243931: Avoid the creation of a temporary object by using the prefix operator for non-primitive types. Approved by: cperciva (mentor, implicit) Modified: stable/7/sbin/devd/devd.cc Directory Properties: stable/7/sbin/devd/ (props changed) Modified: stable/7/sbin/devd/devd.cc ============================================================================== --- stable/7/sbin/devd/devd.cc Sat Feb 2 23:31:01 2013 (r246271) +++ stable/7/sbin/devd/devd.cc Sat Feb 2 23:31:10 2013 (r246272) @@ -96,7 +96,7 @@ delete_and_clear(vector &v) { typename vector::const_iterator i; - for (i = v.begin(); i != v.end(); i++) + for (i = v.begin(); i != v.end(); ++i) delete *i; v.clear(); } @@ -124,7 +124,7 @@ event_proc::matches(config &c) { vector::const_iterator i; - for (i = _epsvec.begin(); i != _epsvec.end(); i++) + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_match(c)) return (false); return (true); @@ -135,7 +135,7 @@ event_proc::run(config &c) { vector::const_iterator i; - for (i = _epsvec.begin(); i != _epsvec.end(); i++) + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_action(c)) return (false); return (true); @@ -208,7 +208,7 @@ media::media(config &, const char *var, { -1, "unknown" }, { 0, NULL }, }; - for (int i = 0; media_types[i].ifmt_string != NULL; i++) + for (int i = 0; media_types[i].ifmt_string != NULL; ++i) if (strcasecmp(type, media_types[i].ifmt_string) == 0) { _type = media_types[i].ifmt_word; break; @@ -360,7 +360,7 @@ config::parse(void) vector::const_iterator i; parse_one_file(configfile); - for (i = _dir_list.begin(); i != _dir_list.end(); i++) + for (i = _dir_list.begin(); i != _dir_list.end(); ++i) parse_files_in_dir((*i).c_str()); sort_vector(_attach_list); sort_vector(_detach_list); @@ -468,7 +468,7 @@ config::get_variable(const string &var) { vector::reverse_iterator i; - for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); i++) { + for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); ++i) { if ((*i)->is_set(var)) return ((*i)->get_variable(var)); } @@ -626,7 +626,7 @@ config::find_and_execute(char type) } if (Dflag) fprintf(stderr, "Processing %s event\n", s); - for (i = l->begin(); i != l->end(); i++) { + for (i = l->begin(); i != l->end(); ++i) { if ((*i)->matches(*this)) { (*i)->run(*this); break; @@ -715,14 +715,14 @@ notify_clients(const char *data, int len list bad; list::const_iterator i; - for (i = clients.begin(); i != clients.end(); i++) { + for (i = clients.begin(); i != clients.end(); ++i) { if (write(*i, data, len) <= 0) { bad.push_back(*i); close(*i); } } - for (i = bad.begin(); i != bad.end(); i++) + for (i = bad.begin(); i != bad.end(); ++i) clients.erase(find(clients.begin(), clients.end(), *i)); }