From owner-svn-src-head@FreeBSD.ORG Sun May 15 00:46:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48143106566C; Sun, 15 May 2011 00:46:26 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 380E28FC0C; Sun, 15 May 2011 00:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F0kQhW021016; Sun, 15 May 2011 00:46:26 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F0kQ0t021014; Sun, 15 May 2011 00:46:26 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201105150046.p4F0kQ0t021014@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 15 May 2011 00:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221936 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 00:46:26 -0000 Author: stas Date: Sun May 15 00:46:25 2011 New Revision: 221936 URL: http://svn.freebsd.org/changeset/base/221936 Log: - Whitespace fix. Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sun May 15 00:43:51 2011 (r221935) +++ head/lib/libprocstat/libprocstat.c Sun May 15 00:46:25 2011 (r221936) @@ -253,7 +253,7 @@ procstat_getfiles(struct procstat *procs if (procstat->type == PROCSTAT_SYSCTL) return (procstat_getfiles_sysctl(procstat, kp, mmapped)); else if (procstat->type == PROCSTAT_KVM) - return (procstat_getfiles_kvm(procstat, kp, mmapped)); + return (procstat_getfiles_kvm(procstat, kp, mmapped)); else return (NULL); } From owner-svn-src-head@FreeBSD.ORG Sun May 15 01:01:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 156AF106564A; Sun, 15 May 2011 01:01:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 056C98FC12; Sun, 15 May 2011 01:01:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F11rOq021477; Sun, 15 May 2011 01:01:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F11rDF021475; Sun, 15 May 2011 01:01:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201105150101.p4F11rDF021475@svn.freebsd.org> From: Alexander Motin Date: Sun, 15 May 2011 01:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221938 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 01:01:54 -0000 Author: mav Date: Sun May 15 01:01:53 2011 New Revision: 221938 URL: http://svn.freebsd.org/changeset/base/221938 Log: Fix few typos. Submitted by: uqs MFC after: 1 week Modified: head/share/man/man4/hpet.4 Modified: head/share/man/man4/hpet.4 ============================================================================== --- head/share/man/man4/hpet.4 Sun May 15 00:47:22 2011 (r221937) +++ head/share/man/man4/hpet.4 Sun May 15 01:01:53 2011 (r221938) @@ -69,14 +69,14 @@ This driver uses High Precision Event Ti usually enumerated via ACPI) to supply kernel with one time counter and several (usually from 3 to 8) event timers. This hardware includes single main counter with known increment frequency -(10MHz or more), and several programable comparators (optionally with +(10MHz or more), and several programmable comparators (optionally with automatic reload feature). When value of the main counter matches current value of any comparator, interrupt can be generated. Depending on hardware capabilities and configuration, interrupt can be delivered as regular I/O APIC interrupt (ISA or PCI) in range from 0 to 31, or as Front Side Bus interrupt, alike to PCI MSI interrupts, or in so called -"LegacyReplacement Route" HPET can speal IRQ0 of i8254 and IRQ8 of the RTC. +"LegacyReplacement Route" HPET can steal IRQ0 of i8254 and IRQ8 of the RTC. Interrupt can be either edge- or level-triggered. In last case they could be safely shared with PCI IRQs. Driver prefers to use FSB interrupts, if supported, to avoid sharing. From owner-svn-src-head@FreeBSD.ORG Sun May 15 04:19:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA81F1065780; Sun, 15 May 2011 04:19:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7F08FC0C; Sun, 15 May 2011 04:19:58 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D73FF25D388E; Sun, 15 May 2011 04:19:56 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id EF46C159F7C7; Sun, 15 May 2011 04:19:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id j5zwwO4NVj6U; Sun, 15 May 2011 04:19:55 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id ED04F159F7CA; Sun, 15 May 2011 04:19:54 +0000 (UTC) Date: Sun, 15 May 2011 04:19:54 +0000 (UTC) From: "Bjoern A. Zeeb" To: simon@freebsd.org, benl@freebsd.org, Colin Percival In-Reply-To: <201105141744.p4EHiCpx010486@svn.freebsd.org> Message-ID: References: <201105141744.p4EHiCpx010486@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221900 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 04:19:58 -0000 On Sat, 14 May 2011, Colin Percival wrote: > Author: cperciva > Date: Sat May 14 17:44:12 2011 > New Revision: 221900 > URL: http://svn.freebsd.org/changeset/base/221900 > > Log: > Encourage Ben Laurie to finish getting his commit bit by appointing him > as the OpenSSL maintainer. I'd like to thanks Simon for doing this all the years! Great job! I am also happy Ben volunteered to pick up the task:) Great to have you doing this for FreeBSD! /bz -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Sun May 15 04:35:42 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21FC01065673; Sun, 15 May 2011 04:35:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id B38D08FC0A; Sun, 15 May 2011 04:35:41 +0000 (UTC) Received: from c122-106-158-76.carlnfd1.nsw.optusnet.com.au (c122-106-158-76.carlnfd1.nsw.optusnet.com.au [122.106.158.76]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p4F4ZbKR001856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 May 2011 14:35:38 +1000 Date: Sun, 15 May 2011 14:35:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marius Strobl In-Reply-To: <201105142031.p4EKV5el014531@svn.freebsd.org> Message-ID: <20110515135737.B825@besplex.bde.org> References: <201105142031.p4EKV5el014531@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221913 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 04:35:42 -0000 On Sat, 14 May 2011, Marius Strobl wrote: > Log: > - There's no need for nibbletab to be static, it's const however. > - Fix whitespace. There is every reason for it to be static. > Modified: head/sys/dev/mii/mii.c > ============================================================================== > --- head/sys/dev/mii/mii.c Sat May 14 19:36:12 2011 (r221912) > +++ head/sys/dev/mii/mii.c Sat May 14 20:31:04 2011 (r221913) > @@ -552,7 +552,7 @@ mii_down(struct mii_data *mii) > static unsigned char > mii_bitreverse(unsigned char x) > { > - static unsigned char nibbletab[16] = { > + unsigned const char const nibbletab[16] = { > 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 > }; Making it non-static asks the compiler to pessimize it by initializing it on every entry to the function. Some versions of gcc do a very good job with this pessimization. The normal pessimzation is to keep a static copy of the array anyway, and copy this to the stack on every entry to the function. However, the pessimization seems to be broken by gcc-4.3.1 in -current. gcc-3.3.3 on i386 gives: %%% $ cat z.c int foo(void) { const unsigned char foo[16] = { 1, 2, 3, 4, }; test(foo[0], foo[1]); } $ gcc-3.3.3 -O2 -S z.c $ cat z.S .file "z.c" .text .p2align 2,,3 .globl foo .type foo, @function foo: pushl %ebp movl %esp, %ebp pushl %edi subl $28, %esp leal -24(%ebp), %edi cld xorl %eax, %eax movl $4, %ecx rep stosl pushl $2 pushl $1 movb $1, -24(%ebp) movb $2, -23(%ebp) movb $3, -22(%ebp) movb $4, -21(%ebp) call test movl -4(%ebp), %edi leave ret .size foo, .-foo .ident "GCC: (GNU) 3.3.3 [FreeBSD] 20031106" %%% For this small array, gcc does an even better pessimization for space than copying from a static copy. It constructs the array entirely on the stack. First it bzeros 16 bytes on the stack using an inefficient string instruction (so that the unused top 12 bytes of the array are initialized). Then uses individual stores to initialize the low 4 bytes of the array. Now it knows that individual stores are faster than string instructions for small data. The low 4 bytes are unused too. The top 2 of these bytes are entirely unused, and the low 2 bytes are optimized to constants at compile time. Declaring the array as static breaks the pessimization for gcc-3.3.3 fairly well. The code is then "pushl $2; pushl $1; call test". The breakage is not quite complete -- data for the unused static array is still generated. Using gcc-4.2.1 breaks the pessimization completely. The code is then "pushl $2; pushl $1; call test", and data for the unused array is not generated, irrespective of whether the array is declared static or const. Using -O instead of -O2 makes little difference. Using -O0 fixes the pessimization for gcc-4.2.1 and gives the minor additional pessimization of loading the function parameters from the array. Changing the array size from 16 to 1024 gives the normal pessimization for gcc-3.3.3 of memcpy()'ing the array from a static copy. The code is then much more readable than the above, since it is not fully pessimized for space. This pessimization is not common in the kernel. K&R compilers have the feature that initialization of auto arrays is a syntax error. Thus old code doesn't even have nighmares about this pessimization. I noticed this pessimization mainly in the old ata driver. That has lots of smallish arrays of data, and sqillions of function calls hidden in access macros. Stepping through the generated code using ddb was very painful since what should be single memory accesses or constant loads was a function call or three for the memcpy()'s and access functions. Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 15 07:59:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 960E5106564A; Sun, 15 May 2011 07:59:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 862038FC14; Sun, 15 May 2011 07:59:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F7xXEN029737; Sun, 15 May 2011 07:59:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F7xX5d029735; Sun, 15 May 2011 07:59:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105150759.p4F7xX5d029735@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 May 2011 07:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221944 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 07:59:33 -0000 Author: adrian Date: Sun May 15 07:59:33 2011 New Revision: 221944 URL: http://svn.freebsd.org/changeset/base/221944 Log: Fix NF calibration breakage introduced by me in a past commit. Since the returned NF will be -ve, checking for <= 0 is not good enough. For now, check whether it equals 0 or -1; a future commit will tidy this mess up and have it return HAL_BOOL instead. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sun May 15 06:42:32 2011 (r221943) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sun May 15 07:59:33 2011 (r221944) @@ -501,7 +501,7 @@ ar5416PerCalibrationN(struct ath_hal *ah * and update the history buffer. */ r = ar5416GetNf(ah, chan); - if (r <= 0) { + if (r == 0 || r == -1) { /* NF calibration result isn't valid */ HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "%s: NF calibration" " didn't finish; delaying CCA\n", __func__); From owner-svn-src-head@FreeBSD.ORG Sun May 15 08:09:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F8CB1065672; Sun, 15 May 2011 08:09:36 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54D738FC08; Sun, 15 May 2011 08:09:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F89agh029977; Sun, 15 May 2011 08:09:36 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F89aHK029975; Sun, 15 May 2011 08:09:36 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105150809.p4F89aHK029975@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 15 May 2011 08:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221945 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 08:09:36 -0000 Author: bschmidt Date: Sun May 15 08:09:36 2011 New Revision: 221945 URL: http://svn.freebsd.org/changeset/base/221945 Log: Only update the scheduler's byte count table for aggregation queues. The other queues, especially the command queue, uses the FIFO mode which doesn't require the byte count table because queued entries are processed in order. Pointed out by: Lucius Windschuh Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 15 07:59:33 2011 (r221944) +++ head/sys/dev/iwn/if_iwn.c Sun May 15 08:09:36 2011 (r221945) @@ -3527,7 +3527,8 @@ iwn_tx_data(struct iwn_softc *sc, struct BUS_DMASYNC_PREWRITE); /* Update TX scheduler. */ - ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); + if (ring->qid >= sc->firstaggqueue) + ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); /* Kick TX ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3730,7 +3731,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, st BUS_DMASYNC_PREWRITE); /* Update TX scheduler. */ - ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); + if (ring->qid >= sc->firstaggqueue) + ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); /* Kick TX ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3894,7 +3896,6 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, static int iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) { - struct iwn_ops *ops = &sc->ops; struct iwn_tx_ring *ring = &sc->txq[4]; struct iwn_tx_desc *desc; struct iwn_tx_data *data; @@ -3954,9 +3955,6 @@ iwn_cmd(struct iwn_softc *sc, int code, bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); - /* Update TX scheduler. */ - ops->update_sched(sc, ring->qid, ring->cur, 0, 0); - /* Kick command ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); From owner-svn-src-head@FreeBSD.ORG Sun May 15 08:29:54 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F25F7106564A; Sun, 15 May 2011 08:29:53 +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 9F8408FC0A; Sun, 15 May 2011 08:29:52 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA10365; Sun, 15 May 2011 11:29:51 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QLWhy-0004z7-Qr; Sun, 15 May 2011 11:29:50 +0300 Message-ID: <4DCF8EFE.2050807@FreeBSD.org> Date: Sun, 15 May 2011 11:29:50 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Jung-uk Kim References: <201105091734.p49HY0P3006180@svn.freebsd.org> <201105121239.31340.jkim@FreeBSD.org> <4DCD2875.9040808@FreeBSD.org> <201105131257.34009.jkim@FreeBSD.org> In-Reply-To: <201105131257.34009.jkim@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 08:29:54 -0000 on 13/05/2011 19:57 Jung-uk Kim said the following: > You guys keep saying some code derived from OpenSolaris exists to > sync. TSCs. Can you let me see it, pretty please? I don't know what > else to say. :-( http://people.freebsd.org/~avg/tsc/ I think I've posted this before. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Sun May 15 08:34:30 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF796106566B; Sun, 15 May 2011 08:34:30 +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 640AA8FC0C; Sun, 15 May 2011 08:34:28 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA10404; Sun, 15 May 2011 11:34:15 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QLWmF-0004zO-Ht; Sun, 15 May 2011 11:34:15 +0300 Message-ID: <4DCF9007.7010606@FreeBSD.org> Date: Sun, 15 May 2011 11:34:15 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Bruce Evans References: <201105091734.p49HY0P3006180@svn.freebsd.org> <201105121239.31340.jkim@FreeBSD.org> <4DCD2875.9040808@FreeBSD.org> <201105131257.34009.jkim@FreeBSD.org> <20110514041838.S2545@besplex.bde.org> In-Reply-To: <20110514041838.S2545@besplex.bde.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Jung-uk Kim Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 08:34:30 -0000 on 13/05/2011 22:14 Bruce Evans said the following: > It might happen for clock_gettime() > in separate threads where the threads somehow know and depend on the > order of the calls. My simplistic world view is that those threads then should be the place to do all the fence dances, not the generic tsc read function. But, hey, I am speaking beyond my knowledge of their code and situation. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Sun May 15 10:37:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD2A2106566C; Sun, 15 May 2011 10:37:55 +0000 (UTC) (envelope-from brix@FreeBSD.org) Received: from solow.pil.dk (relay.pil.dk [195.41.47.164]) by mx1.freebsd.org (Postfix) with ESMTP id 1FC3F8FC0C; Sun, 15 May 2011 10:37:54 +0000 (UTC) Received: from druadan.brixandersen.dk (0x55534f5f.adsl.cybercity.dk [85.83.79.95]) by solow.pil.dk (Postfix) with ESMTPA id 066831CC011; Sun, 15 May 2011 12:21:05 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-10-730147787" From: Henrik Brix Andersen In-Reply-To: <201105131828.p4DISPYa078965@svn.freebsd.org> Date: Sun, 15 May 2011 12:21:02 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <201105131828.p4DISPYa078965@svn.freebsd.org> To: Warner Losh X-Pgp-Agent: GPGMail 1.3.3 X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221850 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 10:37:55 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-10-730147787 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On May 13, 2011, at 20:28, Warner Losh wrote: > Author: imp > Date: Fri May 13 18:28:25 2011 > New Revision: 221850 > URL: http://svn.freebsd.org/changeset/base/221850 >=20 > Log: > Copy symbolic links as files rather than recreating the links. >=20 > PR: misc/151697 > Submitted by: lev@ > MFC after: 2 weeks >=20 > Modified: > head/tools/tools/nanobsd/nanobsd.sh >=20 > Modified: head/tools/tools/nanobsd/nanobsd.sh > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/tools/tools/nanobsd/nanobsd.sh Fri May 13 18:20:24 2011 = (r221849) > +++ head/tools/tools/nanobsd/nanobsd.sh Fri May 13 18:28:25 2011 = (r221850) > @@ -418,7 +418,7 @@ populate_slice ( ) ( > echo "Creating ${dev} with ${dir} (mounting on ${mnt})" > newfs_part $dev $mnt $lbl > cd ${dir} > - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} > + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -Ldumpv ${mnt} > df -i ${mnt} > umount ${mnt} > ) > @@ -674,7 +674,7 @@ cust_allow_ssh_root () ( The above change breaks nanobsd.sh for me. CPIO will now try to follow all symbolic links in _.w/ - e.g. _.w/sys, = which points to a non-existing _.w/usr/src/sys - and fail with "cpio: = Can't stat ./sys". > cust_install_files () ( > cd ${NANO_TOOLS}/Files > - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv = ${NANO_WORLDDIR} > + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -Ldumpv = ${NANO_WORLDDIR} > ) >=20 > = ####################################################################### > @@ -687,7 +687,7 @@ cust_pkg () ( > ( > cd ${NANO_PACKAGE_DIR} > find ${NANO_PACKAGE_LIST} -print | > - cpio -dumpv ${NANO_WORLDDIR}/Pkg > + cpio -Ldumpv ${NANO_WORLDDIR}/Pkg > ) >=20 > # Count & report how many we have to install --=20 Henrik Brix Andersen --Apple-Mail-10-730147787 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAk3PqQ4ACgkQv+Q4flTiePjaiQCfd4kgUvMNu93cPAU3eIZbsYL4 qW8AoLMPSYqhnVHHF0pXCQkhR42FgatY =RxPx -----END PGP SIGNATURE----- --Apple-Mail-10-730147787-- From owner-svn-src-head@FreeBSD.ORG Sun May 15 10:50:06 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6EF3106566C; Sun, 15 May 2011 10:50:06 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 5D41E8FC12; Sun, 15 May 2011 10:50:06 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id p4FAo46Q060998; Sun, 15 May 2011 12:50:04 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id p4FAo4Af060997; Sun, 15 May 2011 12:50:04 +0200 (CEST) (envelope-from marius) Date: Sun, 15 May 2011 12:50:04 +0200 From: Marius Strobl To: Bruce Evans Message-ID: <20110515105004.GG92688@alchemy.franken.de> References: <201105142031.p4EKV5el014531@svn.freebsd.org> <20110515135737.B825@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110515135737.B825@besplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221913 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 10:50:07 -0000 On Sun, May 15, 2011 at 02:35:37PM +1000, Bruce Evans wrote: > On Sat, 14 May 2011, Marius Strobl wrote: > > >Log: > > - There's no need for nibbletab to be static, it's const however. > > - Fix whitespace. > > There is every reason for it to be static. > > >Modified: head/sys/dev/mii/mii.c > >============================================================================== > >--- head/sys/dev/mii/mii.c Sat May 14 19:36:12 2011 (r221912) > >+++ head/sys/dev/mii/mii.c Sat May 14 20:31:04 2011 (r221913) > >@@ -552,7 +552,7 @@ mii_down(struct mii_data *mii) > >static unsigned char > >mii_bitreverse(unsigned char x) > >{ > >- static unsigned char nibbletab[16] = { > >+ unsigned const char const nibbletab[16] = { > > 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 > > }; > > Making it non-static asks the compiler to pessimize it by initializing > it on every entry to the function. Some versions of gcc do a very good This function is mostly used during device probing (and the result of the caller cached afterwards) and not in the hot path, thus there's no need to tell the compiler that it _must_ keep a static copy of the array. > job with this pessimization. The normal pessimzation is to keep a > static copy of the array anyway, and copy this to the stack on every > entry to the function. However, the pessimization seems to be broken > by gcc-4.3.1 in -current. gcc-3.3.3 on i386 gives: > > %%% > $ cat z.c > int > foo(void) > { > const unsigned char foo[16] = { 1, 2, 3, 4, }; > > test(foo[0], foo[1]); > } > $ gcc-3.3.3 -O2 -S z.c > $ cat z.S > .file "z.c" > .text > .p2align 2,,3 > .globl foo > .type foo, @function > foo: > pushl %ebp > movl %esp, %ebp > pushl %edi > subl $28, %esp > leal -24(%ebp), %edi > cld > xorl %eax, %eax > movl $4, %ecx > rep > stosl > pushl $2 > pushl $1 > movb $1, -24(%ebp) > movb $2, -23(%ebp) > movb $3, -22(%ebp) > movb $4, -21(%ebp) > call test > movl -4(%ebp), %edi > leave > ret > .size foo, .-foo > .ident "GCC: (GNU) 3.3.3 [FreeBSD] 20031106" > %%% > > For this small array, gcc does an even better pessimization for space > than copying from a static copy. It constructs the array entirely on > the stack. First it bzeros 16 bytes on the stack using an inefficient > string instruction (so that the unused top 12 bytes of the array are > initialized). Then uses individual stores to initialize the low 4 > bytes of the array. Now it knows that individual stores are faster > than string instructions for small data. The low 4 bytes are unused > too. The top 2 of these bytes are entirely unused, and the low 2 bytes > are optimized to constants at compile time. > > Declaring the array as static breaks the pessimization for gcc-3.3.3 > fairly well. The code is then "pushl $2; pushl $1; call test". The > breakage is not quite complete -- data for the unused static array is > still generated. > > Using gcc-4.2.1 breaks the pessimization completely. The code is then > "pushl $2; pushl $1; call test", and data for the unused array is not > generated, irrespective of whether the array is declared static or const. > > Using -O instead of -O2 makes little difference. Using -O0 fixes the > pessimization for gcc-4.2.1 and gives the minor additional pessimization > of loading the function parameters from the array. > > Changing the array size from 16 to 1024 gives the normal pessimization > for gcc-3.3.3 of memcpy()'ing the array from a static copy. The code is > then much more readable than the above, since it is not fully pessimized > for space. > > This pessimization is not common in the kernel. K&R compilers have > the feature that initialization of auto arrays is a syntax error. Thus > old code doesn't even have nighmares about this pessimization. > > I noticed this pessimization mainly in the old ata driver. That has > lots of smallish arrays of data, and sqillions of function calls hidden > in access macros. Stepping through the generated code using ddb was > very painful since what should be single memory accesses or constant > loads was a function call or three for the memcpy()'s and access > functions. > I agree that such code shoudn't be used in the hot path. Marius From owner-svn-src-head@FreeBSD.ORG Sun May 15 11:45:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D71A6106564A; Sun, 15 May 2011 11:45:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEAFD8FC08; Sun, 15 May 2011 11:45:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FBjDVl038541; Sun, 15 May 2011 11:45:13 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FBjDVR038539; Sun, 15 May 2011 11:45:13 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105151145.p4FBjDVR038539@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 15 May 2011 11:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221952 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 11:45:13 -0000 Author: ae Date: Sun May 15 11:45:13 2011 New Revision: 221952 URL: http://svn.freebsd.org/changeset/base/221952 Log: Simplify the code a bit. For own providers GEOM_PART always provides "start" and "end" config attributes. MFC after: 1 week Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Sun May 15 10:01:38 2011 (r221951) +++ head/sbin/geom/class/part/geom_part.c Sun May 15 11:45:13 2011 (r221952) @@ -253,13 +253,7 @@ find_provider(struct ggeom *gp, off_t mi bestsector = 0; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "start"); - if (s == NULL) { - s = find_provcfg(pp, "offset"); - sector = - (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; - } else - sector = (off_t)strtoimax(s, NULL, 0); - + sector = (off_t)strtoimax(s, NULL, 0); if (sector < minsector) continue; if (bestpp != NULL && sector >= bestsector) @@ -379,18 +373,9 @@ gpart_autofill_resize(struct gctl_req *r errx(EXIT_FAILURE, "invalid partition index"); s = find_provcfg(pp, "start"); - if (s == NULL) { - s = find_provcfg(pp, "offset"); - start = (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; - } else - start = (off_t)strtoimax(s, NULL, 0); + start = (off_t)strtoimax(s, NULL, 0); s = find_provcfg(pp, "end"); - if (s == NULL) { - s = find_provcfg(pp, "length"); - lba = start + - (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; - } else - lba = (off_t)strtoimax(s, NULL, 0) + 1; + lba = (off_t)strtoimax(s, NULL, 0) + 1; if (lba > last) { geom_deletetree(&mesh); @@ -402,12 +387,7 @@ gpart_autofill_resize(struct gctl_req *r new_size = ALIGNDOWN(last - start + 1, alignment); else { s = find_provcfg(pp, "start"); - if (s == NULL) { - s = find_provcfg(pp, "offset"); - new_lba = - (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; - } else - new_lba = (off_t)strtoimax(s, NULL, 0); + new_lba = (off_t)strtoimax(s, NULL, 0); /* * Is there any free space between current and * next providers? @@ -512,12 +492,7 @@ gpart_autofill(struct gctl_req *req) last = ALIGNDOWN(last, alignment); while ((pp = find_provider(gp, first)) != NULL) { s = find_provcfg(pp, "start"); - if (s == NULL) { - s = find_provcfg(pp, "offset"); - lba = (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; - } else - lba = (off_t)strtoimax(s, NULL, 0); - + lba = (off_t)strtoimax(s, NULL, 0); a_lba = ALIGNDOWN(lba, alignment); if (first < a_lba && a_first < a_lba) { /* Free space [first, lba> */ @@ -543,12 +518,7 @@ gpart_autofill(struct gctl_req *req) } s = find_provcfg(pp, "end"); - if (s == NULL) { - s = find_provcfg(pp, "length"); - first = lba + - (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; - } else - first = (off_t)strtoimax(s, NULL, 0) + 1; + first = (off_t)strtoimax(s, NULL, 0) + 1; a_first = ALIGNUP(first, alignment); } if (a_first <= last) { @@ -625,21 +595,12 @@ gpart_show_geom(struct ggeom *gp, const while ((pp = find_provider(gp, first)) != NULL) { s = find_provcfg(pp, "start"); - if (s == NULL) { - s = find_provcfg(pp, "offset"); - sector = (off_t)strtoimax(s, NULL, 0) / secsz; - } else - sector = (off_t)strtoimax(s, NULL, 0); + sector = (off_t)strtoimax(s, NULL, 0); s = find_provcfg(pp, "end"); - if (s == NULL) { - s = find_provcfg(pp, "length"); - length = (off_t)strtoimax(s, NULL, 0) / secsz; - end = sector + length - 1; - } else { - end = (off_t)strtoimax(s, NULL, 0); - length = end - sector + 1; - } + end = (off_t)strtoimax(s, NULL, 0); + length = end - sector + 1; + s = find_provcfg(pp, "index"); idx = atoi(s); if (first < sector) { @@ -782,20 +743,12 @@ gpart_backup(struct gctl_req *req, unsig printf("%s %s\n", scheme, s); LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "start"); - if (s == NULL) { - s = find_provcfg(pp, "offset"); - sector = (off_t)strtoimax(s, NULL, 0) / secsz; - } else - sector = (off_t)strtoimax(s, NULL, 0); + sector = (off_t)strtoimax(s, NULL, 0); s = find_provcfg(pp, "end"); - if (s == NULL) { - s = find_provcfg(pp, "length"); - length = (off_t)strtoimax(s, NULL, 0) / secsz; - } else { - end = (off_t)strtoimax(s, NULL, 0); - length = end - sector + 1; - } + end = (off_t)strtoimax(s, NULL, 0); + length = end - sector + 1; + s = find_provcfg(pp, "label"); printf("%-*s %*s %*jd %*jd %s %s\n", windex, find_provcfg(pp, "index"), From owner-svn-src-head@FreeBSD.ORG Sun May 15 12:39:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4042B106566C; Sun, 15 May 2011 12:39:31 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30B188FC16; Sun, 15 May 2011 12:39:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FCdVtK039583; Sun, 15 May 2011 12:39:31 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FCdVQd039581; Sun, 15 May 2011 12:39:31 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201105151239.p4FCdVQd039581@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 15 May 2011 12:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221953 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 12:39:31 -0000 Author: trociny Date: Sun May 15 12:39:30 2011 New Revision: 221953 URL: http://svn.freebsd.org/changeset/base/221953 Log: Fix a memory leak possible in g_eli_key_allocate() if the key with the same keyno is added while we aren't holding the lock. Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/geom/eli/g_eli_key_cache.c Modified: head/sys/geom/eli/g_eli_key_cache.c ============================================================================== --- head/sys/geom/eli/g_eli_key_cache.c Sun May 15 11:45:13 2011 (r221952) +++ head/sys/geom/eli/g_eli_key_cache.c Sun May 15 12:39:30 2011 (r221953) @@ -124,6 +124,7 @@ g_eli_key_allocate(struct g_eli_softc *s ekey = RB_FIND(g_eli_key_tree, &sc->sc_ekeys_tree, &keysearch); if (ekey != NULL) { bzero(key, sizeof(*key)); + free(key, M_ELI); key = ekey; TAILQ_REMOVE(&sc->sc_ekeys_queue, key, gek_next); } else { From owner-svn-src-head@FreeBSD.ORG Sun May 15 12:51:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71D3B106566B; Sun, 15 May 2011 12:51:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26C038FC0A; Sun, 15 May 2011 12:51:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FCp1HS039814; Sun, 15 May 2011 12:51:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FCp1P5039812; Sun, 15 May 2011 12:51:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105151251.p4FCp1P5039812@svn.freebsd.org> From: Marius Strobl Date: Sun, 15 May 2011 12:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221954 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 12:51:01 -0000 Author: marius Date: Sun May 15 12:51:00 2011 New Revision: 221954 URL: http://svn.freebsd.org/changeset/base/221954 Log: When setting media always and not just in case of switching to IFM_AUTO clear the options of the current media, i.e. only inherit the instance, which matches what NetBSD does. Without this it's really non-intuitive that the following sequence: ifconfig bge0 media 1000baseT mediaopt full-duplex ifconfig bge0 media 100baseTX results in 100baseTX full-duplex to be set or that: ifconfig bge0 media autoselect mediaopt flowcontrol ifconfig bge0 media 1000baseT mediaopt full-duplex tries to set 1000baseT full-duplex with flowcontrol, which isn't suported und thus fails while the following: ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex ifconfig re0 media autoselect just switches to autoselection without flowcontrol. MFC after: 2 weeks Modified: head/sbin/ifconfig/ifmedia.c Modified: head/sbin/ifconfig/ifmedia.c ============================================================================== --- head/sbin/ifconfig/ifmedia.c Sun May 15 12:39:30 2011 (r221953) +++ head/sbin/ifconfig/ifmedia.c Sun May 15 12:51:00 2011 (r221954) @@ -268,13 +268,9 @@ setmedia(const char *val, int d, int s, subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - ifr.ifr_media = (ifmr->ifm_current & ~(IFM_NMASK|IFM_TMASK)) | + ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; - if ((ifr.ifr_media & IFM_TMASK) == 0) { - ifr.ifr_media &= ~(IFM_GMASK | IFM_OMASK); - } - ifmr->ifm_current = ifr.ifr_media; callback_register(setifmediacallback, (void *)ifmr); } From owner-svn-src-head@FreeBSD.ORG Sun May 15 12:58:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD6AB106566B; Sun, 15 May 2011 12:58:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93AF68FC08; Sun, 15 May 2011 12:58:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FCwTRf039976; Sun, 15 May 2011 12:58:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FCwTrx039974; Sun, 15 May 2011 12:58:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105151258.p4FCwTrx039974@svn.freebsd.org> From: Marius Strobl Date: Sun, 15 May 2011 12:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221955 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 12:58:29 -0000 Author: marius Date: Sun May 15 12:58:29 2011 New Revision: 221955 URL: http://svn.freebsd.org/changeset/base/221955 Log: - Add 10baseT as an alias for 10baseT/UTP. - Add shorthand aliases for common media+option combinations as announced by miibus(4) so that one can actually supply the media strings found in the dmesg output to ifconfig(8). Obtained from: NetBSD (in principle) MFC after: 2 weeks Modified: head/sys/net/if_media.h Modified: head/sys/net/if_media.h ============================================================================== --- head/sys/net/if_media.h Sun May 15 12:51:00 2011 (r221954) +++ head/sys/net/if_media.h Sun May 15 12:58:29 2011 (r221955) @@ -370,6 +370,7 @@ struct ifmedia_description { } #define IFM_SUBTYPE_ETHERNET_ALIASES { \ + { IFM_10_T, "10baseT" }, \ { IFM_10_T, "UTP" }, \ { IFM_10_T, "10UTP" }, \ { IFM_10_2, "BNC" }, \ @@ -389,6 +390,23 @@ struct ifmedia_description { { IFM_1000_T, "1000TX" }, \ { IFM_1000_T, "1000T" }, \ { IFM_2500_SX, "2500SX" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_10_T | IFM_FDX, "10baseT-FDX" }, \ + { IFM_10_T | IFM_FDX | IFM_FLOW, "10baseT-FDX-flow" }, \ + { IFM_100_TX | IFM_FDX, "100baseTX-FDX" }, \ + { IFM_100_TX | IFM_FDX | IFM_FLOW, "100baseTX-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX, "1000baseT-FDX" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW, "1000baseT-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW | IFM_ETH_MASTER, \ + "1000baseT-FDX-flow-master" }, \ + { IFM_1000_T | IFM_FDX | IFM_ETH_MASTER, \ + "1000baseT-FDX-master" }, \ + { IFM_1000_T | IFM_ETH_MASTER, "1000baseT-master" }, \ + \ { 0, NULL }, \ } @@ -584,6 +602,13 @@ struct ifmedia_description { #define IFM_SUBTYPE_SHARED_ALIASES { \ { IFM_AUTO, "auto" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_AUTO | IFM_FLOW, "auto-flow" }, \ + \ { 0, NULL }, \ } From owner-svn-src-head@FreeBSD.ORG Sun May 15 13:17:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB5E31065672; Sun, 15 May 2011 13:17:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA6F8FC14; Sun, 15 May 2011 13:17:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FDH8It040435; Sun, 15 May 2011 13:17:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FDH8Mf040432; Sun, 15 May 2011 13:17:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105151317.p4FDH8Mf040432@svn.freebsd.org> From: Marius Strobl Date: Sun, 15 May 2011 13:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221957 - head/sys/dev/mk48txx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 13:17:08 -0000 Author: marius Date: Sun May 15 13:17:08 2011 New Revision: 221957 URL: http://svn.freebsd.org/changeset/base/221957 Log: Add support for MK48T37. Modified: head/sys/dev/mk48txx/mk48txx.c head/sys/dev/mk48txx/mk48txxreg.h Modified: head/sys/dev/mk48txx/mk48txx.c ============================================================================== --- head/sys/dev/mk48txx/mk48txx.c Sun May 15 13:07:34 2011 (r221956) +++ head/sys/dev/mk48txx/mk48txx.c Sun May 15 13:17:08 2011 (r221957) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); /* - * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines + * Mostek MK48T02, MK48T08, MK48T18, MK48T37 and MK48T59 time-of-day chip + * subroutines */ #include @@ -67,6 +68,7 @@ static const struct { { "mk48t02", MK48T02_CLKSZ, MK48T02_CLKOFF, 0 }, { "mk48t08", MK48T08_CLKSZ, MK48T08_CLKOFF, 0 }, { "mk48t18", MK48T18_CLKSZ, MK48T18_CLKOFF, 0 }, + { "mk48t37", MK48T37_CLKSZ, MK48T37_CLKOFF, MK48TXX_EXT_REGISTERS }, { "mk48t59", MK48T59_CLKSZ, MK48T59_CLKOFF, MK48TXX_EXT_REGISTERS }, }; Modified: head/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- head/sys/dev/mk48txx/mk48txxreg.h Sun May 15 13:07:34 2011 (r221956) +++ head/sys/dev/mk48txx/mk48txxreg.h Sun May 15 13:17:08 2011 (r221957) @@ -152,5 +152,8 @@ #define MK48T18_CLKSZ 8192 #define MK48T18_CLKOFF 0x1ff0 +#define MK48T37_CLKSZ 32768 +#define MK48T37_CLKOFF 0x1ff0 + #define MK48T59_CLKSZ 8192 #define MK48T59_CLKOFF 0x1ff0 From owner-svn-src-head@FreeBSD.ORG Sun May 15 13:25:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CF90106564A; Sun, 15 May 2011 13:25:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D0458FC17; Sun, 15 May 2011 13:25:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FDPQev040624; Sun, 15 May 2011 13:25:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FDPQmo040622; Sun, 15 May 2011 13:25:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105151325.p4FDPQmo040622@svn.freebsd.org> From: Marius Strobl Date: Sun, 15 May 2011 13:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221958 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 13:25:26 -0000 Author: marius Date: Sun May 15 13:25:26 2011 New Revision: 221958 URL: http://svn.freebsd.org/changeset/base/221958 Log: Recognize the eeprom device found in Fujitsu PRIMEPOWER650 and 900. Modified: head/sys/sparc64/sparc64/eeprom.c Modified: head/sys/sparc64/sparc64/eeprom.c ============================================================================== --- head/sys/sparc64/sparc64/eeprom.c Sun May 15 13:17:08 2011 (r221957) +++ head/sys/sparc64/sparc64/eeprom.c Sun May 15 13:25:26 2011 (r221958) @@ -107,8 +107,11 @@ DRIVER_MODULE(eeprom, sbus, eeprom_drive static int eeprom_probe(device_t dev) { + const char *name; - if (strcmp("eeprom", ofw_bus_get_name(dev)) == 0) { + name = ofw_bus_get_name(dev); + if (strcmp(name, "eeprom") == 0 || + strcmp(name, "FJSV,eeprom") == 0) { device_set_desc(dev, "EEPROM/clock"); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun May 15 13:27:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0728C106564A; Sun, 15 May 2011 13:27:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB4248FC12; Sun, 15 May 2011 13:27:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FDRcO9040742; Sun, 15 May 2011 13:27:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FDRcZi040739; Sun, 15 May 2011 13:27:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105151327.p4FDRcZi040739@svn.freebsd.org> From: Marius Strobl Date: Sun, 15 May 2011 13:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221960 - in head/sys/dev: scc uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 13:27:39 -0000 Author: marius Date: Sun May 15 13:27:38 2011 New Revision: 221960 URL: http://svn.freebsd.org/changeset/base/221960 Log: Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900. Modified: head/sys/dev/scc/scc_bfe_ebus.c head/sys/dev/uart/uart_cpu_sparc64.c Modified: head/sys/dev/scc/scc_bfe_ebus.c ============================================================================== --- head/sys/dev/scc/scc_bfe_ebus.c Sun May 15 13:27:28 2011 (r221959) +++ head/sys/dev/scc/scc_bfe_ebus.c Sun May 15 13:27:38 2011 (r221960) @@ -56,7 +56,8 @@ scc_ebus_probe(device_t dev) cmpt = ofw_bus_get_compat(dev); if (cmpt == NULL) cmpt = ""; - if (!strcmp(nm, "se") || !strcmp(cmpt, "sab82532")) { + if (!strcmp(nm, "se") || !strcmp(nm, "FJSV,se") || + !strcmp(cmpt, "sab82532")) { device_set_desc(dev, "Siemens SAB 82532 dual channel SCC"); sc->sc_class = &scc_sab82532_class; return (scc_bfe_probe(dev, EBUS_REGSHFT, EBUS_RCLK, 0)); Modified: head/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- head/sys/dev/uart/uart_cpu_sparc64.c Sun May 15 13:27:28 2011 (r221959) +++ head/sys/dev/uart/uart_cpu_sparc64.c Sun May 15 13:27:38 2011 (r221960) @@ -238,7 +238,8 @@ uart_cpu_getdev(int devtype, struct uart di->bas.regshft = 0; di->bas.rclk = 0; class = NULL; - if (!strcmp(buf, "se") || !strcmp(compat, "sab82532")) { + if (!strcmp(buf, "se") || !strcmp(buf, "FJSV,se") || + !strcmp(compat, "sab82532")) { class = &uart_sab82532_class; /* SAB82532 are only known to be used for TTYs. */ if ((di->bas.chan = uart_cpu_channel(dev)) == 0) From owner-svn-src-head@FreeBSD.ORG Sun May 15 14:01:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BD47106564A; Sun, 15 May 2011 14:01:23 +0000 (UTC) (envelope-from brix@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48D338FC12; Sun, 15 May 2011 14:01:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FE1N5v041447; Sun, 15 May 2011 14:01:23 GMT (envelope-from brix@svn.freebsd.org) Received: (from brix@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FE1NnL041441; Sun, 15 May 2011 14:01:23 GMT (envelope-from brix@svn.freebsd.org) Message-Id: <201105151401.p4FE1NnL041441@svn.freebsd.org> From: Henrik Brix Andersen Date: Sun, 15 May 2011 14:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221961 - in head: share/man/man4/man4.i386 sys/conf sys/dev/glxiic sys/i386/conf sys/modules sys/modules/glxiic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 14:01:23 -0000 Author: brix (ports committer) Date: Sun May 15 14:01:23 2011 New Revision: 221961 URL: http://svn.freebsd.org/changeset/base/221961 Log: Add I2C bus driver for the AMD Geode LX series CS5536 Companion Device. Reviewed by: jhb (newbus bits only), adrian Added: head/share/man/man4/man4.i386/glxiic.4 (contents, props changed) head/sys/dev/glxiic/ head/sys/dev/glxiic/glxiic.c (contents, props changed) head/sys/modules/glxiic/ head/sys/modules/glxiic/Makefile (contents, props changed) Modified: head/share/man/man4/man4.i386/Makefile head/sys/conf/files.i386 head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Sun May 15 13:27:38 2011 (r221960) +++ head/share/man/man4/man4.i386/Makefile Sun May 15 14:01:23 2011 (r221961) @@ -12,6 +12,7 @@ MAN= aic.4 \ ep.4 \ ex.4 \ fe.4 \ + glxiic.4 \ glxsb.4 \ ie.4 \ longrun.4 \ Added: head/share/man/man4/man4.i386/glxiic.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.i386/glxiic.4 Sun May 15 14:01:23 2011 (r221961) @@ -0,0 +1,106 @@ +.\" Copyright (c) 2011 Henrik Brix Andersen +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 15, 2011 +.Dt GLXIIC 4 i386 +.Os +.Sh NAME +.Nm glxiic +.Nd Geode LX CS5536 I2C controller driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pci" +.Cd "device isa" +.Cd "device glxiic" +.Cd "device iicbus" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +glxiic_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports the System Management Bus controller of the Geode LX +series CS5536 Companion Device. The Geode LX is a member of the AMD +Geode family of integrated x86 system chips. +.Pp +Although AMD refers to this device as a System Management Bus (SMBus) +controller, it is really an I2C controller (it lacks SMBus ALERT# and +Alert Response support). +.Pp +The +.Nm +driver supports both I2C master and slave mode. +.Sh SYSCTL VARIABLE +The +.Nm +driver supports the following variable as both +.Xr sysctl 8 +and +.Xr loader 8 +tunable: +.Bl -tag -width indent +.It Va dev.glxiic.0.timeout +This variable controls the I2C bus timeout in milliseconds. The +default timeout is 35 milliseconds. A value of zero disables the +timeout. +.El +.Sh CAVEAT +The +.Nm +driver uses the interrupt line number configured by the board firmware +by default. If no interrupt line number has been configured by the +board firmware (or to override the interrupt line number configured by +board firmware), place the following line in +.Xr device.hints 5 : +.Bd -ragged -offset indent +hint.glxiic.0.irq="10" +.Ed +.Pp +The interrupt line number must be between 1 and 15. +.Sh SEE ALSO +.Xr iicbus 4 , +.Xr device.hints 5 , +.Xr loader.conf 5 , +.Xr loader 8 , +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +device driver and manual page first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver and manual page were written by +.An Henrik Brix Andersen Aq brix@FreeBSD.org . Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun May 15 13:27:38 2011 (r221960) +++ head/sys/conf/files.i386 Sun May 15 14:01:23 2011 (r221961) @@ -171,6 +171,7 @@ dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard dev/fe/if_fe_isa.c optional fe isa +dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb dev/hptmv/entry.c optional hptmv Added: head/sys/dev/glxiic/glxiic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/glxiic/glxiic.c Sun May 15 14:01:23 2011 (r221961) @@ -0,0 +1,1077 @@ +/*- + * Copyright (c) 2011 Henrik Brix Andersen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +/* + * AMD Geode LX CS5536 System Management Bus controller. + * + * Although AMD refers to this device as an SMBus controller, it + * really is an I2C controller (It lacks SMBus ALERT# and Alert + * Response support). + * + * The driver is implemented as an interrupt-driven state machine, + * supporting both master and slave mode. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef GLXIIC_DEBUG +#include +#endif + +#include +#include + +#include +#include +#include + +#include +#include + +#include "iicbus_if.h" + +/* CS5536 PCI-ISA ID. */ +#define GLXIIC_CS5536_DEV_ID 0x20901022 + +/* MSRs. */ +#define GLXIIC_MSR_PIC_YSEL_HIGH 0x51400021 + +/* Bus speeds. */ +#define GLXIIC_SLOW 0x0258 /* 10 kHz. */ +#define GLXIIC_FAST 0x0078 /* 50 kHz. */ +#define GLXIIC_FASTEST 0x003c /* 100 kHz. */ + +/* Default bus activity timeout in milliseconds. */ +#define GLXIIC_DEFAULT_TIMEOUT 35 + +/* GPIO register offsets. */ +#define GLXIIC_GPIOL_OUT_AUX1_SEL 0x10 +#define GLXIIC_GPIOL_IN_AUX1_SEL 0x34 + +/* GPIO 14 (SMB_CLK) and 15 (SMB_DATA) bitmasks. */ +#define GLXIIC_GPIO_14_15_ENABLE 0x0000c000 +#define GLXIIC_GPIO_14_15_DISABLE 0xc0000000 + +/* SMB register offsets. */ +#define GLXIIC_SMB_SDA 0x00 +#define GLXIIC_SMB_STS 0x01 +#define GLXIIC_SMB_STS_SLVSTP_BIT (1 << 7) +#define GLXIIC_SMB_STS_SDAST_BIT (1 << 6) +#define GLXIIC_SMB_STS_BER_BIT (1 << 5) +#define GLXIIC_SMB_STS_NEGACK_BIT (1 << 4) +#define GLXIIC_SMB_STS_STASTR_BIT (1 << 3) +#define GLXIIC_SMB_STS_NMATCH_BIT (1 << 2) +#define GLXIIC_SMB_STS_MASTER_BIT (1 << 1) +#define GLXIIC_SMB_STS_XMIT_BIT (1 << 0) +#define GLXIIC_SMB_CTRL_STS 0x02 +#define GLXIIC_SMB_CTRL_STS_TGSCL_BIT (1 << 5) +#define GLXIIC_SMB_CTRL_STS_TSDA_BIT (1 << 4) +#define GLXIIC_SMB_CTRL_STS_GCMTCH_BIT (1 << 3) +#define GLXIIC_SMB_CTRL_STS_MATCH_BIT (1 << 2) +#define GLXIIC_SMB_CTRL_STS_BB_BIT (1 << 1) +#define GLXIIC_SMB_CTRL_STS_BUSY_BIT (1 << 0) +#define GLXIIC_SMB_CTRL1 0x03 +#define GLXIIC_SMB_CTRL1_STASTRE_BIT (1 << 7) +#define GLXIIC_SMB_CTRL1_NMINTE_BIT (1 << 6) +#define GLXIIC_SMB_CTRL1_GCMEN_BIT (1 << 5) +#define GLXIIC_SMB_CTRL1_ACK_BIT (1 << 4) +#define GLXIIC_SMB_CTRL1_INTEN_BIT (1 << 2) +#define GLXIIC_SMB_CTRL1_STOP_BIT (1 << 1) +#define GLXIIC_SMB_CTRL1_START_BIT (1 << 0) +#define GLXIIC_SMB_ADDR 0x04 +#define GLXIIC_SMB_ADDR_SAEN_BIT (1 << 7) +#define GLXIIC_SMB_CTRL2 0x05 +#define GLXIIC_SMB_CTRL2_EN_BIT (1 << 0) +#define GLXIIC_SMB_CTRL3 0x06 + +typedef enum { + GLXIIC_STATE_IDLE, + GLXIIC_STATE_SLAVE_TX, + GLXIIC_STATE_SLAVE_RX, + GLXIIC_STATE_MASTER_ADDR, + GLXIIC_STATE_MASTER_TX, + GLXIIC_STATE_MASTER_RX, + GLXIIC_STATE_MASTER_STOP, + GLXIIC_STATE_MAX, +} glxiic_state_t; + +struct glxiic_softc { + device_t dev; /* Myself. */ + device_t iicbus; /* IIC bus. */ + struct mtx mtx; /* Lock. */ + glxiic_state_t state; /* Driver state. */ + struct callout callout; /* Driver state timeout callout. */ + int timeout; /* Driver state timeout (ms). */ + + int smb_rid; /* SMB controller resource ID. */ + struct resource *smb_res; /* SMB controller resource. */ + int gpio_rid; /* GPIO resource ID. */ + struct resource *gpio_res; /* GPIO resource. */ + + int irq_rid; /* IRQ resource ID. */ + struct resource *irq_res; /* IRQ resource. */ + void *irq_handler; /* IRQ handler cookie. */ + int old_irq; /* IRQ mapped by board firmware. */ + + struct iic_msg *msg; /* Current master mode message. */ + uint32_t nmsgs; /* Number of messages remaining. */ + uint8_t *data; /* Current master mode data byte. */ + uint16_t ndata; /* Number of data bytes remaining. */ + int error; /* Last master mode error. */ + + uint8_t addr; /* Own address. */ + uint16_t sclfrq; /* Bus frequency. */ +}; + +#ifdef GLXIIC_DEBUG +#define DEBUG(fmt, args...) log(LOG_DEBUG, "%s: " fmt "\n" , __func__ , ## args) +#else +#define DEBUG(fmt, args...) +#endif + +#define GLXIIC_SCLFRQ(n) ((n << 1)) +#define GLXIIC_SMBADDR(n) ((n >> 1)) +#define GLXIIC_SMB_IRQ_TO_MAP(n) ((n << 16)) +#define GLXIIC_MAP_TO_SMB_IRQ(n) ((n >> 16) & 0xf) + +#define GLXIIC_LOCK(_sc) mtx_lock(&_sc->mtx) +#define GLXIIC_UNLOCK(_sc) mtx_unlock(&_sc->mtx) +#define GLXIIC_LOCK_INIT(_sc) \ + mtx_init(&_sc->mtx, device_get_nameunit(_sc->dev), "glxiic", MTX_DEF) +#define GLXIIC_SLEEP(_sc) \ + mtx_sleep(_sc, &_sc->mtx, IICPRI, "glxiic", 0) +#define GLXIIC_WAKEUP(_sc) wakeup(_sc); +#define GLXIIC_LOCK_DESTROY(_sc) mtx_destroy(&_sc->mtx); +#define GLXIIC_ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED); + +typedef int (glxiic_state_callback_t)(struct glxiic_softc *sc, + uint8_t status); + +static glxiic_state_callback_t glxiic_state_idle_callback; +static glxiic_state_callback_t glxiic_state_slave_tx_callback; +static glxiic_state_callback_t glxiic_state_slave_rx_callback; +static glxiic_state_callback_t glxiic_state_master_addr_callback; +static glxiic_state_callback_t glxiic_state_master_tx_callback; +static glxiic_state_callback_t glxiic_state_master_rx_callback; +static glxiic_state_callback_t glxiic_state_master_stop_callback; + +struct glxiic_state_table_entry { + glxiic_state_callback_t *callback; + boolean_t master; +}; +typedef struct glxiic_state_table_entry glxiic_state_table_entry_t; + +static glxiic_state_table_entry_t glxiic_state_table[GLXIIC_STATE_MAX] = { + [GLXIIC_STATE_IDLE] = { + .callback = &glxiic_state_idle_callback, + .master = FALSE, + }, + + [GLXIIC_STATE_SLAVE_TX] = { + .callback = &glxiic_state_slave_tx_callback, + .master = FALSE, + }, + + [GLXIIC_STATE_SLAVE_RX] = { + .callback = &glxiic_state_slave_rx_callback, + .master = FALSE, + }, + + [GLXIIC_STATE_MASTER_ADDR] = { + .callback = &glxiic_state_master_addr_callback, + .master = TRUE, + }, + + [GLXIIC_STATE_MASTER_TX] = { + .callback = &glxiic_state_master_tx_callback, + .master = TRUE, + }, + + [GLXIIC_STATE_MASTER_RX] = { + .callback = &glxiic_state_master_rx_callback, + .master = TRUE, + }, + + [GLXIIC_STATE_MASTER_STOP] = { + .callback = &glxiic_state_master_stop_callback, + .master = TRUE, + }, +}; + +static void glxiic_identify(driver_t *driver, device_t parent); +static int glxiic_probe(device_t dev); +static int glxiic_attach(device_t dev); +static int glxiic_detach(device_t dev); + +static uint8_t glxiic_read_status_locked(struct glxiic_softc *sc); +static void glxiic_stop_locked(struct glxiic_softc *sc); +static void glxiic_timeout(void *arg); +static void glxiic_start_timeout_locked(struct glxiic_softc *sc); +static void glxiic_set_state_locked(struct glxiic_softc *sc, + glxiic_state_t state); +static int glxiic_handle_slave_match_locked(struct glxiic_softc *sc, + uint8_t status); +static void glxiic_intr(void *arg); + +static int glxiic_reset(device_t dev, u_char speed, u_char addr, + u_char *oldaddr); +static int glxiic_transfer(device_t dev, struct iic_msg *msgs, + uint32_t nmsgs); + +static void glxiic_smb_map_interrupt(int irq); +static void glxiic_gpio_enable(struct glxiic_softc *sc); +static void glxiic_gpio_disable(struct glxiic_softc *sc); +static void glxiic_smb_enable(struct glxiic_softc *sc, uint8_t speed, + uint8_t addr); +static void glxiic_smb_disable(struct glxiic_softc *sc); + +static device_method_t glxiic_methods[] = { + DEVMETHOD(device_identify, glxiic_identify), + DEVMETHOD(device_probe, glxiic_probe), + DEVMETHOD(device_attach, glxiic_attach), + DEVMETHOD(device_detach, glxiic_detach), + + DEVMETHOD(iicbus_reset, glxiic_reset), + DEVMETHOD(iicbus_transfer, glxiic_transfer), + DEVMETHOD(iicbus_callback, iicbus_null_callback), + + { 0, 0 } +}; + +static driver_t glxiic_driver = { + "glxiic", + glxiic_methods, + sizeof(struct glxiic_softc), +}; + +static devclass_t glxiic_devclass; + +DRIVER_MODULE(glxiic, isab, glxiic_driver, glxiic_devclass, 0, 0); +DRIVER_MODULE(iicbus, glxiic, iicbus_driver, iicbus_devclass, 0, 0); +MODULE_DEPEND(glxiic, iicbus, 1, 1, 1); + +static void +glxiic_identify(driver_t *driver, device_t parent) +{ + + /* Prevent child from being added more than once. */ + if (device_find_child(parent, driver->name, -1) != NULL) + return; + + if (pci_get_devid(parent) == GLXIIC_CS5536_DEV_ID) { + if (device_add_child(parent, driver->name, -1) == NULL) + device_printf(parent, "Could not add glxiic child\n"); + } +} + +static int +glxiic_probe(device_t dev) +{ + + if (resource_disabled("glxiic", device_get_unit(dev))) + return (ENXIO); + + device_set_desc(dev, "AMD Geode CS5536 SMBus controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +glxiic_attach(device_t dev) +{ + struct glxiic_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + int error, irq, unit; + uint32_t irq_map; + char tn[32]; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->state = GLXIIC_STATE_IDLE; + error = 0; + + GLXIIC_LOCK_INIT(sc); + callout_init_mtx(&sc->callout, &sc->mtx, 0); + + sc->smb_rid = PCIR_BAR(0); + sc->smb_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->smb_rid, + RF_ACTIVE); + if (sc->smb_res == NULL) { + device_printf(dev, "Could not allocate SMBus I/O port\n"); + error = ENXIO; + goto out; + } + + sc->gpio_rid = PCIR_BAR(1); + sc->gpio_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->gpio_rid, RF_SHAREABLE | RF_ACTIVE); + if (sc->gpio_res == NULL) { + device_printf(dev, "Could not allocate GPIO I/O port\n"); + error = ENXIO; + goto out; + } + + /* Ensure the controller is not enabled by firmware. */ + glxiic_smb_disable(sc); + + /* Read the existing IRQ map. */ + irq_map = rdmsr(GLXIIC_MSR_PIC_YSEL_HIGH); + sc->old_irq = GLXIIC_MAP_TO_SMB_IRQ(irq_map); + + unit = device_get_unit(dev); + if (resource_int_value("glxiic", unit, "irq", &irq) == 0) { + if (irq < 1 || irq > 15) { + device_printf(dev, "Bad value %d for glxiic.%d.irq\n", + irq, unit); + error = ENXIO; + goto out; + } + + if (bootverbose) + device_printf(dev, "Using irq %d set by hint\n", irq); + } else if (sc->old_irq != 0) { + if (bootverbose) + device_printf(dev, "Using irq %d set by firmware\n", + irq); + irq = sc->old_irq; + } else { + device_printf(dev, "No irq mapped by firmware"); + printf(" and no glxiic.%d.irq hint provided\n", unit); + error = ENXIO; + goto out; + } + + /* Map the SMBus interrupt to the requested legacy IRQ. */ + glxiic_smb_map_interrupt(irq); + + sc->irq_rid = 0; + sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, + irq, irq, 1, RF_SHAREABLE | RF_ACTIVE); + if (sc->irq_res == NULL) { + device_printf(dev, "Could not allocate IRQ %d\n", irq); + error = ENXIO; + goto out; + } + + error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, glxiic_intr, sc, &(sc->irq_handler)); + if (error != 0) { + device_printf(dev, "Could not setup IRQ handler\n"); + error = ENXIO; + goto out; + } + + if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) { + device_printf(dev, "Could not allocate iicbus instance\n"); + error = ENXIO; + goto out; + } + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + + sc->timeout = GLXIIC_DEFAULT_TIMEOUT; + snprintf(tn, sizeof(tn), "dev.glxiic.%d.timeout", unit); + TUNABLE_INT_FETCH(tn, &sc->timeout); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "timeout", CTLFLAG_RW | CTLFLAG_TUN, &sc->timeout, 0, + "activity timeout in ms"); + + glxiic_gpio_enable(sc); + glxiic_smb_enable(sc, IIC_FASTEST, 0); + + error = bus_generic_attach(dev); + if (error != 0) { + device_printf(dev, "Could not probe and attach children\n"); + error = ENXIO; + } +out: + if (error != 0) { + callout_drain(&sc->callout); + + if (sc->iicbus != NULL) + device_delete_child(dev, sc->iicbus); + if (sc->smb_res != NULL) { + glxiic_smb_disable(sc); + bus_release_resource(dev, SYS_RES_IOPORT, sc->smb_rid, + sc->smb_res); + } + if (sc->gpio_res != NULL) { + glxiic_gpio_disable(sc); + bus_release_resource(dev, SYS_RES_IOPORT, sc->gpio_rid, + sc->gpio_res); + } + if (sc->irq_handler != NULL) + bus_teardown_intr(dev, sc->irq_res, sc->irq_handler); + if (sc->irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, + sc->irq_res); + + /* Restore the old SMBus interrupt mapping. */ + glxiic_smb_map_interrupt(sc->old_irq); + + GLXIIC_LOCK_DESTROY(sc); + } + + return (error); +} + +static int +glxiic_detach(device_t dev) +{ + struct glxiic_softc *sc; + int error; + + sc = device_get_softc(dev); + + error = bus_generic_detach(dev); + if (error != 0) + goto out; + if (sc->iicbus != NULL) + error = device_delete_child(dev, sc->iicbus); + +out: + callout_drain(&sc->callout); + + if (sc->smb_res != NULL) { + glxiic_smb_disable(sc); + bus_release_resource(dev, SYS_RES_IOPORT, sc->smb_rid, + sc->smb_res); + } + if (sc->gpio_res != NULL) { + glxiic_gpio_disable(sc); + bus_release_resource(dev, SYS_RES_IOPORT, sc->gpio_rid, + sc->gpio_res); + } + if (sc->irq_handler != NULL) + bus_teardown_intr(dev, sc->irq_res, sc->irq_handler); + if (sc->irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, + sc->irq_res); + + /* Restore the old SMBus interrupt mapping. */ + glxiic_smb_map_interrupt(sc->old_irq); + + GLXIIC_LOCK_DESTROY(sc); + + return (error); +} + +static uint8_t +glxiic_read_status_locked(struct glxiic_softc *sc) +{ + uint8_t status; + + GLXIIC_ASSERT_LOCKED(sc); + + status = bus_read_1(sc->smb_res, GLXIIC_SMB_STS); + + /* Clear all status flags except SDAST and STASTR after reading. */ + bus_write_1(sc->smb_res, GLXIIC_SMB_STS, (GLXIIC_SMB_STS_SLVSTP_BIT | + GLXIIC_SMB_STS_BER_BIT | GLXIIC_SMB_STS_NEGACK_BIT | + GLXIIC_SMB_STS_NMATCH_BIT)); + + return (status); +} + +static void +glxiic_stop_locked(struct glxiic_softc *sc) +{ + uint8_t status, ctrl1; + + GLXIIC_ASSERT_LOCKED(sc); + + status = glxiic_read_status_locked(sc); + + ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1); + bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1, + ctrl1 | GLXIIC_SMB_CTRL1_STOP_BIT); + + /* + * Perform a dummy read of SDA in master receive mode to clear + * SDAST if set. + */ + if ((status & GLXIIC_SMB_STS_XMIT_BIT) == 0 && + (status & GLXIIC_SMB_STS_SDAST_BIT) != 0) + bus_read_1(sc->smb_res, GLXIIC_SMB_SDA); + + /* Check stall after start bit and clear if needed */ + if ((status & GLXIIC_SMB_STS_STASTR_BIT) != 0) { + bus_write_1(sc->smb_res, GLXIIC_SMB_STS, + GLXIIC_SMB_STS_STASTR_BIT); + } +} + +static void +glxiic_timeout(void *arg) +{ + struct glxiic_softc *sc; + uint8_t error; + + sc = (struct glxiic_softc *)arg; + + DEBUG("timeout in state %d", sc->state); + + if (glxiic_state_table[sc->state].master) { + sc->error = IIC_ETIMEOUT; + GLXIIC_WAKEUP(sc); + } else { + error = IIC_ETIMEOUT; + iicbus_intr(sc->iicbus, INTR_ERROR, &error); + } + + glxiic_smb_disable(sc); + glxiic_smb_enable(sc, IIC_UNKNOWN, sc->addr); + glxiic_set_state_locked(sc, GLXIIC_STATE_IDLE); +} + +static void +glxiic_start_timeout_locked(struct glxiic_softc *sc) +{ + + GLXIIC_ASSERT_LOCKED(sc); + + callout_reset(&sc->callout, sc->timeout * 1000 / hz, glxiic_timeout, + sc); +} + +static void +glxiic_set_state_locked(struct glxiic_softc *sc, glxiic_state_t state) +{ + + GLXIIC_ASSERT_LOCKED(sc); + + if (state == GLXIIC_STATE_IDLE) + callout_stop(&sc->callout); + else if (sc->timeout > 0) + glxiic_start_timeout_locked(sc); + + sc->state = state; +} + +static int +glxiic_handle_slave_match_locked(struct glxiic_softc *sc, uint8_t status) +{ + uint8_t ctrl_sts, addr; + + GLXIIC_ASSERT_LOCKED(sc); + + ctrl_sts = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL_STS); + + if ((ctrl_sts & GLXIIC_SMB_CTRL_STS_MATCH_BIT) != 0) { + if ((status & GLXIIC_SMB_STS_XMIT_BIT) != 0) { + addr = sc->addr | LSB; + glxiic_set_state_locked(sc, + GLXIIC_STATE_SLAVE_TX); + } else { + addr = sc->addr & ~LSB; + glxiic_set_state_locked(sc, + GLXIIC_STATE_SLAVE_RX); + } + iicbus_intr(sc->iicbus, INTR_START, &addr); + } else if ((ctrl_sts & GLXIIC_SMB_CTRL_STS_GCMTCH_BIT) != 0) { + addr = 0; + glxiic_set_state_locked(sc, GLXIIC_STATE_SLAVE_RX); + iicbus_intr(sc->iicbus, INTR_GENERAL, &addr); + } else { + DEBUG("unknown slave match"); + return (IIC_ESTATUS); + } + + return (IIC_NOERR); +} + +static int +glxiic_state_idle_callback(struct glxiic_softc *sc, uint8_t status) +{ + + GLXIIC_ASSERT_LOCKED(sc); + + if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { + DEBUG("bus error in idle"); + return (IIC_EBUSERR); + } + + if ((status & GLXIIC_SMB_STS_NMATCH_BIT) != 0) { + return (glxiic_handle_slave_match_locked(sc, status)); + } + + return (IIC_NOERR); +} + +static int +glxiic_state_slave_tx_callback(struct glxiic_softc *sc, uint8_t status) +{ + uint8_t data; + + GLXIIC_ASSERT_LOCKED(sc); + + if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { + DEBUG("bus error in slave tx"); + return (IIC_EBUSERR); + } + + if ((status & GLXIIC_SMB_STS_SLVSTP_BIT) != 0) { + iicbus_intr(sc->iicbus, INTR_STOP, NULL); + glxiic_set_state_locked(sc, GLXIIC_STATE_IDLE); + return (IIC_NOERR); + } + + if ((status & GLXIIC_SMB_STS_NEGACK_BIT) != 0) { + iicbus_intr(sc->iicbus, INTR_NOACK, NULL); + return (IIC_NOERR); + } + + if ((status & GLXIIC_SMB_STS_NMATCH_BIT) != 0) { + /* Handle repeated start in slave mode. */ + return (glxiic_handle_slave_match_locked(sc, status)); + } + + if ((status & GLXIIC_SMB_STS_SDAST_BIT) == 0) { + DEBUG("not awaiting data in slave tx"); + return (IIC_ESTATUS); + } + + iicbus_intr(sc->iicbus, INTR_TRANSMIT, &data); + bus_write_1(sc->smb_res, GLXIIC_SMB_SDA, data); + + glxiic_start_timeout_locked(sc); + + return (IIC_NOERR); +} + +static int +glxiic_state_slave_rx_callback(struct glxiic_softc *sc, uint8_t status) +{ + uint8_t data; + + GLXIIC_ASSERT_LOCKED(sc); + + if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { + DEBUG("bus error in slave rx"); + return (IIC_EBUSERR); + } + + if ((status & GLXIIC_SMB_STS_SLVSTP_BIT) != 0) { + iicbus_intr(sc->iicbus, INTR_STOP, NULL); + glxiic_set_state_locked(sc, GLXIIC_STATE_IDLE); + return (IIC_NOERR); + } + + if ((status & GLXIIC_SMB_STS_NMATCH_BIT) != 0) { + /* Handle repeated start in slave mode. */ + return (glxiic_handle_slave_match_locked(sc, status)); + } + + if ((status & GLXIIC_SMB_STS_SDAST_BIT) == 0) { + DEBUG("no pending data in slave rx"); + return (IIC_ESTATUS); + } + + data = bus_read_1(sc->smb_res, GLXIIC_SMB_SDA); + iicbus_intr(sc->iicbus, INTR_RECEIVE, &data); + + glxiic_start_timeout_locked(sc); + + return (IIC_NOERR); +} + +static int +glxiic_state_master_addr_callback(struct glxiic_softc *sc, uint8_t status) +{ + uint8_t slave; + + GLXIIC_ASSERT_LOCKED(sc); + + if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { + DEBUG("bus error after master start"); + return (IIC_EBUSERR); + } + + if ((status & GLXIIC_SMB_STS_MASTER_BIT) == 0) { + DEBUG("not bus master after master start"); + return (IIC_ESTATUS); + } + + if ((status & GLXIIC_SMB_STS_SDAST_BIT) == 0) { + DEBUG("not awaiting address in master addr"); + return (IIC_ESTATUS); + } + + if ((sc->msg->flags & IIC_M_RD) != 0) { + slave = sc->msg->slave | LSB; + glxiic_set_state_locked(sc, GLXIIC_STATE_MASTER_RX); + } else { + slave = sc->msg->slave & ~LSB; + glxiic_set_state_locked(sc, GLXIIC_STATE_MASTER_TX); + } + + sc->data = sc->msg->buf; + sc->ndata = sc->msg->len; + + /* Handle address-only transfer. */ + if (sc->ndata == 0) + glxiic_set_state_locked(sc, GLXIIC_STATE_MASTER_STOP); + + bus_write_1(sc->smb_res, GLXIIC_SMB_SDA, slave); + + return (IIC_NOERR); +} + +static int +glxiic_state_master_tx_callback(struct glxiic_softc *sc, uint8_t status) +{ + + GLXIIC_ASSERT_LOCKED(sc); + + if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { + DEBUG("bus error in master tx"); + return (IIC_EBUSERR); + } + + if ((status & GLXIIC_SMB_STS_MASTER_BIT) == 0) { + DEBUG("not bus master in master tx"); + return (IIC_ESTATUS); + } + + if ((status & GLXIIC_SMB_STS_NEGACK_BIT) != 0) { + DEBUG("slave nack in master tx"); + return (IIC_ENOACK); + } + + if ((status & GLXIIC_SMB_STS_STASTR_BIT) != 0) { + bus_write_1(sc->smb_res, GLXIIC_SMB_STS, + GLXIIC_SMB_STS_STASTR_BIT); + } + + if ((status & GLXIIC_SMB_STS_SDAST_BIT) == 0) { + DEBUG("not awaiting data in master tx"); + return (IIC_ESTATUS); + } + + bus_write_1(sc->smb_res, GLXIIC_SMB_SDA, *sc->data++); + if (--sc->ndata == 0) + glxiic_set_state_locked(sc, GLXIIC_STATE_MASTER_STOP); + else + glxiic_start_timeout_locked(sc); + + return (IIC_NOERR); +} + +static int +glxiic_state_master_rx_callback(struct glxiic_softc *sc, uint8_t status) +{ + uint8_t ctrl1; + + GLXIIC_ASSERT_LOCKED(sc); + + if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { + DEBUG("bus error in master rx"); + return (IIC_EBUSERR); + } + + if ((status & GLXIIC_SMB_STS_MASTER_BIT) == 0) { + DEBUG("not bus master in master rx"); + return (IIC_ESTATUS); + } + + if ((status & GLXIIC_SMB_STS_NEGACK_BIT) != 0) { + DEBUG("slave nack in rx"); + return (IIC_ENOACK); + } + + if (sc->ndata == 1) { + /* Last byte from slave, set NACK. */ + ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1); + bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1, + ctrl1 | GLXIIC_SMB_CTRL1_ACK_BIT); + } + + if ((status & GLXIIC_SMB_STS_STASTR_BIT) != 0) { + /* Bus is stalled, clear and wait for data. */ + bus_write_1(sc->smb_res, GLXIIC_SMB_STS, + GLXIIC_SMB_STS_STASTR_BIT); + return (IIC_NOERR); + } + + if ((status & GLXIIC_SMB_STS_SDAST_BIT) == 0) { + DEBUG("no pending data in master rx"); + return (IIC_ESTATUS); + } + + *sc->data++ = bus_read_1(sc->smb_res, GLXIIC_SMB_SDA); + if (--sc->ndata == 0) { + /* Proceed with stop on reading last byte. */ + glxiic_set_state_locked(sc, GLXIIC_STATE_MASTER_STOP); + return (glxiic_state_table[sc->state].callback(sc, status)); + } + + glxiic_start_timeout_locked(sc); + + return (IIC_NOERR); +} + +static int +glxiic_state_master_stop_callback(struct glxiic_softc *sc, uint8_t status) +{ + uint8_t ctrl1; + + GLXIIC_ASSERT_LOCKED(sc); + + if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { + DEBUG("bus error in master stop"); + return (IIC_EBUSERR); + } + + if ((status & GLXIIC_SMB_STS_MASTER_BIT) == 0) { + DEBUG("not bus master in master stop"); + return (IIC_ESTATUS); + } + + if ((status & GLXIIC_SMB_STS_NEGACK_BIT) != 0) { + DEBUG("slave nack in master stop"); + return (IIC_ENOACK); + } + + if (--sc->nmsgs > 0) { + /* Start transfer of next message. */ + if ((sc->msg->flags & IIC_M_NOSTOP) == 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun May 15 14:52:23 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1060F106564A; Sun, 15 May 2011 14:52:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id A00038FC0A; Sun, 15 May 2011 14:52:21 +0000 (UTC) Received: from c122-106-158-76.carlnfd1.nsw.optusnet.com.au (c122-106-158-76.carlnfd1.nsw.optusnet.com.au [122.106.158.76]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p4FEqDrU031346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 May 2011 00:52:15 +1000 Date: Mon, 16 May 2011 00:52:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marius Strobl In-Reply-To: <20110515105004.GG92688@alchemy.franken.de> Message-ID: <20110516002156.T911@besplex.bde.org> References: <201105142031.p4EKV5el014531@svn.freebsd.org> <20110515135737.B825@besplex.bde.org> <20110515105004.GG92688@alchemy.franken.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r221913 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 14:52:23 -0000 On Sun, 15 May 2011, Marius Strobl wrote: > On Sun, May 15, 2011 at 02:35:37PM +1000, Bruce Evans wrote: >> On Sat, 14 May 2011, Marius Strobl wrote: >> >>> Log: >>> - There's no need for nibbletab to be static, it's const however. >>> - Fix whitespace. >> >> There is every reason for it to be static. >> >>> Modified: head/sys/dev/mii/mii.c >>> ============================================================================== >>> --- head/sys/dev/mii/mii.c Sat May 14 19:36:12 2011 (r221912) >>> +++ head/sys/dev/mii/mii.c Sat May 14 20:31:04 2011 (r221913) >>> @@ -552,7 +552,7 @@ mii_down(struct mii_data *mii) >>> static unsigned char >>> mii_bitreverse(unsigned char x) >>> { >>> - static unsigned char nibbletab[16] = { >>> + unsigned const char const nibbletab[16] = { >>> 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 >>> }; >> >> Making it non-static asks the compiler to pessimize it by initializing >> it on every entry to the function. Some versions of gcc do a very good > > This function is mostly used during device probing (and the result of > the caller cached afterwards) and not in the hot path, thus there's no > need to tell the compiler that it _must_ keep a static copy of the array. Actually, in a more realistic example, and in this function, it is impossible for the compiler to avoid static storage. The result probably depends on the arg, in a form like table[arg] Better example below. Another good pessimization in the above is passing the arg as an unsigned char. The caller may have to demote to this type, and the function will probably have to promote it to use it as an index. Similarly for returning a type shorter than int. These pessimizations are also shown in the example below. > ... > I agree that such code shoudn't be used in the hot path. I agree that this doesn't matter much for efficiency. Auto initializers are also worse for debugging (without full debugging info or debuggers that understand it). Better example: %%% $ cat z.c unsigned char data; int result; unsigned char foo(unsigned char n) { const unsigned char foo[16] = { 1, 2, 3, 4, }; return (foo[n]); } void use(void) { result += foo(data); } $ gcc42 -O2 -S z.c $ cat z.s [edited] % .file "z.c" % .text % .p2align 4,,15 % .globl foo % .type foo, @function % foo: % pushl %ebp % movl %esp, %ebp % movzbl 8(%ebp), %eax Extra work to promote the arg. movzbl instead of movl normally only costs space on modern x86. % popl %ebp % movzbl foo.1543(%eax), %eax The table needs to be of unsigned char's to optimize for space. Although we only return an unsigned char byte, the ABI may bogusly require this movzbl. % ret % .size foo, .-foo % .p2align 4,,15 % .globl use % .type use, @function % use: % pushl %ebp % movl %esp, %ebp % subl $4, %esp % movzbl data, %eax % movl %eax, (%esp) Extra work to promote the arg. Although we start with an unsigned char and the function takes an unsigned char, the ABI may bogusly require this movzbl. Avoiding partial register stalls and memory store-to-load mismatches may also require this movzbl. But I think only making the ABI portable to K&R code requires this. Storing garbage from the top bits of %eax after movb to %al might cause a stall, but storing only %al wouldn't, and the garbage in memory wouldn't cause any problems, since the pessimizations in the caller result in only the low bits in memory being loaded. % call foo % movzbl %al, %eax Extra work to promote the result of foo(). Although the caller has already promoted it, the ABI might not allow depending on this. % addl %eax, result % leave % ret % .size use, .-use % .section .rodata % .type foo.1543, @object % .size foo.1543, 16 % foo.1543: % .byte 1 % .byte 2 % .byte 3 % .byte 4 % .zero 12 The compiler can't avoid static allocation for this area. The worseness of auto initializers for debugging is also shown here. Instead of a static array named foo, there is a static array with mangled name foo.1543. This mangled name is not too hard to guess or type in a primitive debugger like ddb (except in old versions of ddb that didn't support dots in identifiers), but others might be harder. % .comm data,1,1 % .comm result,4,4 % .ident "GCC: (GNU) 4.2.1 20070719 [FreeBSD]" % Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 15 15:09:23 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 164E5106566B; Sun, 15 May 2011 15:09:23 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id D99718FC16; Sun, 15 May 2011 15:09:22 +0000 (UTC) Received: from [10.1.224.20] (67-210-173.2.static.tel-ott.com [67.210.173.2] (may be forged)) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p4FF9Fqv087253 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 15 May 2011 08:09:21 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201105151145.p4FBjDVR038539@svn.freebsd.org> Date: Sun, 15 May 2011 11:09:10 -0400 Content-Transfer-Encoding: 7bit Message-Id: <7B2294F7-8383-42F2-8127-759DBCD3540A@xcllnt.net> References: <201105151145.p4FBjDVR038539@svn.freebsd.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221952 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 15:09:23 -0000 On May 15, 2011, at 7:45 AM, Andrey V. Elsukov wrote: > Author: ae > Date: Sun May 15 11:45:13 2011 > New Revision: 221952 > URL: http://svn.freebsd.org/changeset/base/221952 > > Log: > Simplify the code a bit. For own providers GEOM_PART always provides > "start" and "end" config attributes. > > MFC after: 1 week Just to make sure: the code deals with backward compatibility. If you're aware of the issue, but don't care (anymore) about it, then the change is fine (as I can't quite remember the case in point, and I don't care enough to speculatively page in the details). If you weren't aware, we should probably determine the impact before you MFC this. Let me know and I'll dig up the details. FYI, -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Sun May 15 15:22:40 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id B581E106566C; Sun, 15 May 2011 15:22:40 +0000 (UTC) Date: Sun, 15 May 2011 15:22:40 +0000 From: Alexey Dokuchaev To: Marcel Moolenaar Message-ID: <20110515152240.GA19328@FreeBSD.org> References: <201105151145.p4FBjDVR038539@svn.freebsd.org> <7B2294F7-8383-42F2-8127-759DBCD3540A@xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <7B2294F7-8383-42F2-8127-759DBCD3540A@xcllnt.net> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@FreeBSD.org, "Andrey V. Elsukov" , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221952 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 15:22:40 -0000 On Sun, May 15, 2011 at 11:09:10AM -0400, Marcel Moolenaar wrote: > On May 15, 2011, at 7:45 AM, Andrey V. Elsukov wrote: > > Author: ae > > Date: Sun May 15 11:45:13 2011 > > New Revision: 221952 > > URL: http://svn.freebsd.org/changeset/base/221952 > > > > Log: > > Simplify the code a bit. For own providers GEOM_PART always provides > > "start" and "end" config attributes. > > > > MFC after: 1 week > > Just to make sure: the code deals with backward compatibility. > If you're aware of the issue, but don't care (anymore) about it, > then the change is fine (as I can't quite remember the case in > point, and I don't care enough to speculatively page in the > details). > > If you weren't aware, we should probably determine the impact > before you MFC this. Let me know and I'll dig up the details. I would also suggest increasing "MFC after" period in this particular case for couple of months maybe. ./danfe From owner-svn-src-head@FreeBSD.ORG Sun May 15 15:27:35 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 53F68106566B; Sun, 15 May 2011 15:27:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 0AF1014EAD4; Sun, 15 May 2011 15:27:33 +0000 (UTC) Message-ID: <4DCFF0D5.3080309@FreeBSD.org> Date: Sun, 15 May 2011 19:27:17 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: Marcel Moolenaar References: <201105151145.p4FBjDVR038539@svn.freebsd.org> <7B2294F7-8383-42F2-8127-759DBCD3540A@xcllnt.net> In-Reply-To: <7B2294F7-8383-42F2-8127-759DBCD3540A@xcllnt.net> X-Enigmail-Version: 1.1.2 OpenPGP: id=10C8A17A Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig7317D217ADB51A5E1A68AFAA" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221952 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 15:27:35 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7317D217ADB51A5E1A68AFAA Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 15.05.2011 19:09, Marcel Moolenaar wrote: >> Simplify the code a bit. For own providers GEOM_PART always provides >> "start" and "end" config attributes. >> >> MFC after: 1 week >=20 > Just to make sure: the code deals with backward compatibility. > If you're aware of the issue, but don't care (anymore) about it, > then the change is fine (as I can't quite remember the case in > point, and I don't care enough to speculatively page in the > details). g_part_dumpconf() function does set both pair of parameters: (start, end) and (offset, length). I do not see a way how one pair can not be present in XML tree. > If you weren't aware, we should probably determine the impact > before you MFC this. Let me know and I'll dig up the details. --=20 WBR, Andrey V. Elsukov --------------enig7317D217ADB51A5E1A68AFAA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBAgAGBQJNz/DaAAoJEAHF6gQQyKF6igwH/jXqzeCobQscxOdGDts/e90e iVUO6AL48VplHgY5EHbMWyD/sqhx80Bk/AXoESJVj+WysEpMLZ0chcVHhFAyXW+d /l7WD9jamO+zgV0R7xSiIGZ+500TxiSJ26dohPDqoGhjoqwETEEHQzZIGMQ/ik0z h5lxsbg/oeWNl0YhlcuxIROK/2mR6wLs6LyXk/CJ6QQ6o+LzVvRR5oQpIj/fi7u0 9+n3XakHTHr5GZKwovbSL0oHi7OAQNhvNW+m9wRrZWbpGflZyOYR2kOvTs9a77fV vXrquldmvW10ZA+OWzr/zvgwjeatTofiH/NA3ulBoTd4+GHexF/tEn2sZ9hXVck= =XWfM -----END PGP SIGNATURE----- --------------enig7317D217ADB51A5E1A68AFAA-- From owner-svn-src-head@FreeBSD.ORG Sun May 15 15:54:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7A6C106564A; Sun, 15 May 2011 15:54:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD16D8FC14; Sun, 15 May 2011 15:54:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FFsYe5043734; Sun, 15 May 2011 15:54:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FFsYfO043730; Sun, 15 May 2011 15:54:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105151554.p4FFsYfO043730@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 May 2011 15:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221965 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 15:54:35 -0000 Author: adrian Date: Sun May 15 15:54:34 2011 New Revision: 221965 URL: http://svn.freebsd.org/changeset/base/221965 Log: * Add some more TX descriptor error counters; this'll be helpful when implementing TX aggregation * Whilst I'm there, comment some RX error counters Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 15 15:47:16 2011 (r221964) +++ head/sys/dev/ath/if_ath.c Sun May 15 15:54:34 2011 (r221965) @@ -3966,9 +3966,21 @@ ath_tx_processq(struct ath_softc *sc, st sc->sc_stats.ast_tx_fifoerr++; if (ts->ts_status & HAL_TXERR_FILT) sc->sc_stats.ast_tx_filtered++; + if (ts->ts_status & HAL_TXERR_XTXOP) + sc->sc_stats.ast_tx_xtxop++; + if (ts->ts_status & HAL_TXERR_TIMER_EXPIRED) + sc->sc_stats.ast_tx_timerexpired++; + + /* XXX HAL_TX_DATA_UNDERRUN */ + /* XXX HAL_TX_DELIM_UNDERRUN */ + if (bf->bf_m->m_flags & M_FF) sc->sc_stats.ast_ff_txerr++; } + /* XXX when is this valid? */ + if (ts->ts_status & HAL_TX_DESC_CFG_ERR) + sc->sc_stats.ast_tx_desccfgerr++; + sr = ts->ts_shortretry; lr = ts->ts_longretry; sc->sc_stats.ast_tx_shortretry += sr; Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Sun May 15 15:47:16 2011 (r221964) +++ head/sys/dev/ath/if_ath_sysctl.c Sun May 15 15:54:34 2011 (r221965) @@ -709,6 +709,12 @@ ath_sysctl_stats_attach(struct ath_softc &sc->sc_stats.ast_tx_timeout, 0, "TX Global Timeout"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_cst", CTLFLAG_RD, &sc->sc_stats.ast_tx_cst, 0, "TX Carrier Sense Timeout"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_xtxop", CTLFLAG_RD, + &sc->sc_stats.ast_tx_xtxop, 0, "TX exceeded TXOP"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_timerexpired", CTLFLAG_RD, + &sc->sc_stats.ast_tx_timerexpired, 0, "TX exceeded TX_TIMER register"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_desccfgerr", CTLFLAG_RD, + &sc->sc_stats.ast_tx_desccfgerr, 0, "TX Descriptor Cfg Error"); /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Sun May 15 15:47:16 2011 (r221964) +++ head/sys/dev/ath/if_athioctl.h Sun May 15 15:54:34 2011 (r221965) @@ -121,17 +121,20 @@ struct ath_stats { u_int32_t ast_be_missed; /* missed beacons */ u_int32_t ast_ani_cal; /* ANI calibrations performed */ u_int32_t ast_rx_agg; /* number of aggregate frames RX'ed */ - u_int32_t ast_rx_halfgi; - u_int32_t ast_rx_2040; - u_int32_t ast_rx_pre_crc_err; - u_int32_t ast_rx_post_crc_err; - u_int32_t ast_rx_decrypt_busy_err; + u_int32_t ast_rx_halfgi; /* RX half-GI */ + u_int32_t ast_rx_2040; /* RX 40mhz frame */ + u_int32_t ast_rx_pre_crc_err; /* RX pre-delimiter CRC error */ + u_int32_t ast_rx_post_crc_err; /* RX post-delimiter CRC error */ + u_int32_t ast_rx_decrypt_busy_err; /* RX decrypt engine busy error */ u_int32_t ast_rx_hi_rx_chain; u_int32_t ast_tx_htprotect; /* HT tx frames with protection */ - u_int32_t ast_rx_hitqueueend; + u_int32_t ast_rx_hitqueueend; /* RX hit descr queue end */ u_int32_t ast_tx_timeout; /* Global TX timeout */ u_int32_t ast_tx_cst; /* Carrier sense timeout */ - u_int32_t ast_pad[16]; + u_int32_t ast_tx_xtxop; /* tx exceeded TXOP */ + u_int32_t ast_tx_timerexpired; /* tx exceeded TX_TIMER */ + u_int32_t ast_tx_desccfgerr; /* tx desc cfg error */ + u_int32_t ast_pad[13]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) From owner-svn-src-head@FreeBSD.ORG Sun May 15 16:07:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AA241065670; Sun, 15 May 2011 16:07:21 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id E58628FC08; Sun, 15 May 2011 16:07:20 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id CFFCC1FFC35; Sun, 15 May 2011 16:07:19 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 9CE7884530; Sun, 15 May 2011 18:07:19 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Matthew D Fleming References: <201105131848.p4DIm1j7079495@svn.freebsd.org> Date: Sun, 15 May 2011 18:07:19 +0200 In-Reply-To: <201105131848.p4DIm1j7079495@svn.freebsd.org> (Matthew D. Fleming's message of "Fri, 13 May 2011 18:48:01 +0000 (UTC)") Message-ID: <86aaeokkw8.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221853 - in head/sys: dev/md dev/null sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 16:07:21 -0000 Matthew D Fleming writes: > Log: > Usa a globally visible region of zeros for both /dev/zero and the md > device. There are likely other kernel uses of "blob of zeros" than can > be converted. Excellent, thank you! DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Sun May 15 16:16:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 427E81065673; Sun, 15 May 2011 16:16:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31F438FC12; Sun, 15 May 2011 16:16:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FGGnnc044240; Sun, 15 May 2011 16:16:49 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FGGnSn044238; Sun, 15 May 2011 16:16:49 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105151616.p4FGGnSn044238@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 15 May 2011 16:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221967 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 16:16:49 -0000 Author: ae Date: Sun May 15 16:16:48 2011 New Revision: 221967 URL: http://svn.freebsd.org/changeset/base/221967 Log: Some partitioning schemes want to have partitions that are aligned with geometry. And they do recalculation of user specified parameters. MBR, PC98, VTOC8, EBR schemes are doing that. For these schemes an auto alignment feature (ie. gpart add -a alignment) would not work. But it can work for GPT and BSD schemes. BSD scheme usualy is created inside MBR, so we can use knowledge about offset of MBR partition to calculate aligned values for BSD partitions. Use "offset" attribute of the parent provider for better alignment. MFC after: 2 weeks Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Sun May 15 16:15:39 2011 (r221966) +++ head/sbin/geom/class/part/geom_part.c Sun May 15 16:16:48 2011 (r221967) @@ -416,7 +416,7 @@ gpart_autofill(struct gctl_req *req) struct gprovider *pp; off_t first, last, a_first; off_t size, start, a_lba; - off_t lba, len, alignment; + off_t lba, len, alignment, offset; uintmax_t grade; const char *s; int error, has_size, has_start, has_alignment; @@ -467,8 +467,6 @@ gpart_autofill(struct gctl_req *req) error = g_parse_lba(s, pp->lg_sectorsize, &size); if (error) errc(EXIT_FAILURE, error, "Invalid size param"); - if (size > alignment) - size = ALIGNDOWN(size, alignment); } s = gctl_get_ascii(req, "start"); @@ -478,22 +476,29 @@ gpart_autofill(struct gctl_req *req) error = g_parse_lba(s, pp->lg_sectorsize, &start); if (error) errc(EXIT_FAILURE, error, "Invalid start param"); - start = ALIGNUP(start, alignment); } /* No autofill necessary. */ if (has_size && has_start && !has_alignment) goto done; + /* Adjust parameters to offset value for better alignment */ + s = find_provcfg(pp, "offset"); + offset = (s == NULL) ? 0: + (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; + start = ALIGNUP(start + offset, alignment); + if (size + offset > alignment) + size = ALIGNDOWN(size + offset, alignment); + first = (off_t)strtoimax(find_geomcfg(gp, "first"), NULL, 0); last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); grade = ~0ULL; - a_first = ALIGNUP(first, alignment); - last = ALIGNDOWN(last, alignment); + a_first = ALIGNUP(first + offset, alignment); + last = ALIGNDOWN(last + offset, alignment); while ((pp = find_provider(gp, first)) != NULL) { s = find_provcfg(pp, "start"); lba = (off_t)strtoimax(s, NULL, 0); - a_lba = ALIGNDOWN(lba, alignment); + a_lba = ALIGNDOWN(lba + offset, alignment); if (first < a_lba && a_first < a_lba) { /* Free space [first, lba> */ len = a_lba - a_first; @@ -519,7 +524,7 @@ gpart_autofill(struct gctl_req *req) s = find_provcfg(pp, "end"); first = (off_t)strtoimax(s, NULL, 0) + 1; - a_first = ALIGNUP(first, alignment); + a_first = ALIGNUP(first + offset, alignment); } if (a_first <= last) { /* Free space [first-last] */ @@ -543,12 +548,11 @@ gpart_autofill(struct gctl_req *req) } } } - if (grade == ~0ULL) { geom_deletetree(&mesh); return (ENOSPC); } - + start -= offset; /* Return back to real offset */ done: snprintf(ssize, sizeof(ssize), "%jd", (intmax_t)size); gctl_change_param(req, "size", -1, ssize); From owner-svn-src-head@FreeBSD.ORG Sun May 15 16:59:30 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFF831065670; Sun, 15 May 2011 16:59:30 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 5C64D8FC0C; Sun, 15 May 2011 16:59:30 +0000 (UTC) Received: from [10.75.44.147] (wsp04373635wss.cr.net.cable.rogers.com [24.235.98.20]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p4FGxNJI087601 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 15 May 2011 09:59:28 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4DCFF0D5.3080309@FreeBSD.org> Date: Sun, 15 May 2011 12:59:17 -0400 Content-Transfer-Encoding: 7bit Message-Id: References: <201105151145.p4FBjDVR038539@svn.freebsd.org> <7B2294F7-8383-42F2-8127-759DBCD3540A@xcllnt.net> <4DCFF0D5.3080309@FreeBSD.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221952 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 16:59:30 -0000 On May 15, 2011, at 11:27 AM, Andrey V. Elsukov wrote: > On 15.05.2011 19:09, Marcel Moolenaar wrote: >>> Simplify the code a bit. For own providers GEOM_PART always provides >>> "start" and "end" config attributes. >>> >>> MFC after: 1 week >> >> Just to make sure: the code deals with backward compatibility. >> If you're aware of the issue, but don't care (anymore) about it, >> then the change is fine (as I can't quite remember the case in >> point, and I don't care enough to speculatively page in the >> details). > > g_part_dumpconf() function does set both pair of parameters: > (start, end) and (offset, length). I do not see a way how one pair > can not be present in XML tree. /* ... paging in non-commit details ... */ The point is that this is what's happening *now*. This is not what happened before. With support for logical partitions (i.e. the EBR scheme), the total partition bounds and the effective usable space are not the same. This is because the partition starts with an MBR look-alike. The usable space is therefore 1 sector less and start at offset 1 (0-based) from the start of the partition. In any case: this particular scenario had to be handled and for that we have offset+size (the usable area, as per GEOM standards) and start+end (the total space occupied by the partition) separately. They do not represent the same info. The start+end parameters did not exist before and I had to add that "later". To have the utility work with older kernels (that did not support the EBR scheme) I added the fall-back to using offset+length, because those two would encode what we needed in that case. As I said: I'm fine with the change, but please assess the consequences of dropping the fall-back, for it may be better to make this change on -current after 9-stable branched and without the MFC. That's it... Nothing major... FYI, -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Sun May 15 17:00:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21E30106566C; Sun, 15 May 2011 17:00:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 120328FC12; Sun, 15 May 2011 17:00:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FH0hlb045540; Sun, 15 May 2011 17:00:43 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FH0hHp045538; Sun, 15 May 2011 17:00:43 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105151700.p4FH0hHp045538@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 May 2011 17:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221970 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 17:00:44 -0000 Author: jilles Date: Sun May 15 17:00:43 2011 New Revision: 221970 URL: http://svn.freebsd.org/changeset/base/221970 Log: sh: Avoid close(-1) when evaluating a multi-command pipeline. Valgrind complains about this. Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun May 15 16:40:42 2011 (r221969) +++ head/bin/sh/eval.c Sun May 15 17:00:43 2011 (r221970) @@ -552,7 +552,8 @@ evalpipe(union node *n) if (prevfd >= 0) close(prevfd); prevfd = pip[0]; - close(pip[1]); + if (pip[1] != -1) + close(pip[1]); } INTON; if (n->npipe.backgnd == 0) { From owner-svn-src-head@FreeBSD.ORG Sun May 15 17:12:29 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DBF0106566B; Sun, 15 May 2011 17:12:29 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6986B8FC08; Sun, 15 May 2011 17:12:29 +0000 (UTC) Received: from [10.75.44.147] (wsp04373635wss.cr.net.cable.rogers.com [24.235.98.20]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p4FHCMwm087663 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 15 May 2011 10:12:27 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: Date: Sun, 15 May 2011 13:12:17 -0400 Content-Transfer-Encoding: 7bit Message-Id: <9D0B1F3A-27C1-4CB8-B619-FF4C5F199802@xcllnt.net> References: <201105151145.p4FBjDVR038539@svn.freebsd.org> <7B2294F7-8383-42F2-8127-759DBCD3540A@xcllnt.net> <4DCFF0D5.3080309@FreeBSD.org> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, "Andrey V. Elsukov" , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221952 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 17:12:29 -0000 On May 15, 2011, at 12:59 PM, Marcel Moolenaar wrote: > > /* ... paging in non-commit details ... */ > > The point is that this is what's happening *now*. This is not > what happened before. With support for logical partitions (i.e. > the EBR scheme), the total partition bounds and the effective > usable space are not the same. This is because the partition > starts with an MBR look-alike. The usable space is therefore > 1 sector less and start at offset 1 (0-based) from the start > of the partition. /* ... compensate for data poisoning while paging in ... */ The usable space starts a *track* from the beginning of the partition as per standard MBR rules. Not 1 sector in... -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Sun May 15 17:25:54 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 997F41065670; Sun, 15 May 2011 17:25:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 677AF14EA07; Sun, 15 May 2011 17:25:53 +0000 (UTC) Message-ID: <4DD00C8F.1020700@FreeBSD.org> Date: Sun, 15 May 2011 21:25:35 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: Marcel Moolenaar References: <201105151145.p4FBjDVR038539@svn.freebsd.org> <7B2294F7-8383-42F2-8127-759DBCD3540A@xcllnt.net> <4DCFF0D5.3080309@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=10C8A17A Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig001759CB17BAC0D51AFE7306" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221952 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 17:25:54 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig001759CB17BAC0D51AFE7306 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 15.05.2011 20:59, Marcel Moolenaar wrote: >> g_part_dumpconf() function does set both pair of parameters: >> (start, end) and (offset, length). I do not see a way how one pair >> can not be present in XML tree. >=20 > /* ... paging in non-commit details ... */ >=20 > The point is that this is what's happening *now*. This is not > what happened before. With support for logical partitions (i.e. > the EBR scheme), the total partition bounds and the effective > usable space are not the same. This is because the partition > starts with an MBR look-alike. The usable space is therefore > 1 sector less and start at offset 1 (0-based) from the start > of the partition. >=20 > In any case: this particular scenario had to be handled and > for that we have offset+size (the usable area, as per GEOM > standards) and start+end (the total space occupied by the > partition) separately. They do not represent the same info. >=20 > The start+end parameters did not exist before and I had to add > that "later". To have the utility work with older kernels (that > did not support the EBR scheme) I added the fall-back to using > offset+length, because those two would encode what we needed > in that case. Yes, i looked in the commit log before doing this change. And i did not do any changes in the kernel. Removing code that never triggers seems no so bad for me. I'm also do not see how MFC can affect the stable branch, because this code only used inside gpart(8) and it is problematic to reuse it from not here (and also it never triggers in stable/8 too). > As I said: I'm fine with the change, but please assess the > consequences of dropping the fall-back, for it may be better > to make this change on -current after 9-stable branched and > without the MFC. So, would you like to revert this change? --=20 WBR, Andrey V. Elsukov --------------enig001759CB17BAC0D51AFE7306 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBAgAGBQJN0AyVAAoJEAHF6gQQyKF6WU0H/jmm1ZYrWNIYgW6gCsL3PJHc Kv+UMPBzPoPdchkcV80A/X9sUOAZDgVn62xWK9j5xa3JOVfnxZiS/jpm3sGcs675 FCrECPr60H9j3Krki1v86pGBrUvA++D/hiCrkWseF9eM6qq31N+gBx9Po4R4DvfV nIg3pU9yAHXmhY/vnz4jws0XzNHHBlPpywJkNkei591QD+70MaHXWBZbvGFeIxb8 B+ETu+0x7ii2uTu/QpD+FoySTIRjmR2Tx7iHd3rtJcoUqzax/cO+bLyl5bGra57a 7nyD0TJ82rW/ZbF+UAnQ/FdloS8+0oS747ZncWSG0gBKS7UkiGgbaV+NaZ3T764= =0IIC -----END PGP SIGNATURE----- --------------enig001759CB17BAC0D51AFE7306-- From owner-svn-src-head@FreeBSD.ORG Sun May 15 19:04:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 702DC106564A; Sun, 15 May 2011 19:04:09 +0000 (UTC) (envelope-from brix@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E0DC8FC0A; Sun, 15 May 2011 19:04:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FJ49HK049137; Sun, 15 May 2011 19:04:09 GMT (envelope-from brix@svn.freebsd.org) Received: (from brix@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FJ488I049135; Sun, 15 May 2011 19:04:09 GMT (envelope-from brix@svn.freebsd.org) Message-Id: <201105151904.p4FJ488I049135@svn.freebsd.org> From: Henrik Brix Andersen Date: Sun, 15 May 2011 19:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221971 - head/sys/dev/glxiic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 19:04:09 -0000 Author: brix (ports committer) Date: Sun May 15 19:04:08 2011 New Revision: 221971 URL: http://svn.freebsd.org/changeset/base/221971 Log: Fix breakage on pc98 by redefining DEBUG(). Pointy hat to: brix Modified: head/sys/dev/glxiic/glxiic.c Modified: head/sys/dev/glxiic/glxiic.c ============================================================================== --- head/sys/dev/glxiic/glxiic.c Sun May 15 17:00:43 2011 (r221970) +++ head/sys/dev/glxiic/glxiic.c Sun May 15 19:04:08 2011 (r221971) @@ -153,9 +153,10 @@ struct glxiic_softc { }; #ifdef GLXIIC_DEBUG -#define DEBUG(fmt, args...) log(LOG_DEBUG, "%s: " fmt "\n" , __func__ , ## args) +#define GLXIIC_DEBUG_LOG(fmt, args...) \ + log(LOG_DEBUG, "%s: " fmt "\n" , __func__ , ## args) #else -#define DEBUG(fmt, args...) +#define GLXIIC_DEBUG_LOG(fmt, args...) #endif #define GLXIIC_SCLFRQ(n) ((n << 1)) @@ -540,7 +541,7 @@ glxiic_timeout(void *arg) sc = (struct glxiic_softc *)arg; - DEBUG("timeout in state %d", sc->state); + GLXIIC_DEBUG_LOG("timeout in state %d", sc->state); if (glxiic_state_table[sc->state].master) { sc->error = IIC_ETIMEOUT; @@ -604,7 +605,7 @@ glxiic_handle_slave_match_locked(struct glxiic_set_state_locked(sc, GLXIIC_STATE_SLAVE_RX); iicbus_intr(sc->iicbus, INTR_GENERAL, &addr); } else { - DEBUG("unknown slave match"); + GLXIIC_DEBUG_LOG("unknown slave match"); return (IIC_ESTATUS); } @@ -618,7 +619,7 @@ glxiic_state_idle_callback(struct glxiic GLXIIC_ASSERT_LOCKED(sc); if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { - DEBUG("bus error in idle"); + GLXIIC_DEBUG_LOG("bus error in idle"); return (IIC_EBUSERR); } @@ -637,7 +638,7 @@ glxiic_state_slave_tx_callback(struct gl GLXIIC_ASSERT_LOCKED(sc); if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { - DEBUG("bus error in slave tx"); + GLXIIC_DEBUG_LOG("bus error in slave tx"); return (IIC_EBUSERR); } @@ -658,7 +659,7 @@ glxiic_state_slave_tx_callback(struct gl } if ((status & GLXIIC_SMB_STS_SDAST_BIT) == 0) { - DEBUG("not awaiting data in slave tx"); + GLXIIC_DEBUG_LOG("not awaiting data in slave tx"); return (IIC_ESTATUS); } @@ -678,7 +679,7 @@ glxiic_state_slave_rx_callback(struct gl GLXIIC_ASSERT_LOCKED(sc); if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { - DEBUG("bus error in slave rx"); + GLXIIC_DEBUG_LOG("bus error in slave rx"); return (IIC_EBUSERR); } @@ -694,7 +695,7 @@ glxiic_state_slave_rx_callback(struct gl } if ((status & GLXIIC_SMB_STS_SDAST_BIT) == 0) { - DEBUG("no pending data in slave rx"); + GLXIIC_DEBUG_LOG("no pending data in slave rx"); return (IIC_ESTATUS); } @@ -714,17 +715,17 @@ glxiic_state_master_addr_callback(struct GLXIIC_ASSERT_LOCKED(sc); if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { - DEBUG("bus error after master start"); + GLXIIC_DEBUG_LOG("bus error after master start"); return (IIC_EBUSERR); } if ((status & GLXIIC_SMB_STS_MASTER_BIT) == 0) { - DEBUG("not bus master after master start"); + GLXIIC_DEBUG_LOG("not bus master after master start"); return (IIC_ESTATUS); } if ((status & GLXIIC_SMB_STS_SDAST_BIT) == 0) { - DEBUG("not awaiting address in master addr"); + GLXIIC_DEBUG_LOG("not awaiting address in master addr"); return (IIC_ESTATUS); } @@ -755,17 +756,17 @@ glxiic_state_master_tx_callback(struct g GLXIIC_ASSERT_LOCKED(sc); if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { - DEBUG("bus error in master tx"); + GLXIIC_DEBUG_LOG("bus error in master tx"); return (IIC_EBUSERR); } if ((status & GLXIIC_SMB_STS_MASTER_BIT) == 0) { - DEBUG("not bus master in master tx"); + GLXIIC_DEBUG_LOG("not bus master in master tx"); return (IIC_ESTATUS); } if ((status & GLXIIC_SMB_STS_NEGACK_BIT) != 0) { - DEBUG("slave nack in master tx"); + GLXIIC_DEBUG_LOG("slave nack in master tx"); return (IIC_ENOACK); } @@ -775,7 +776,7 @@ glxiic_state_master_tx_callback(struct g } if ((status & GLXIIC_SMB_STS_SDAST_BIT) == 0) { - DEBUG("not awaiting data in master tx"); + GLXIIC_DEBUG_LOG("not awaiting data in master tx"); return (IIC_ESTATUS); } @@ -796,17 +797,17 @@ glxiic_state_master_rx_callback(struct g GLXIIC_ASSERT_LOCKED(sc); if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { - DEBUG("bus error in master rx"); + GLXIIC_DEBUG_LOG("bus error in master rx"); return (IIC_EBUSERR); } if ((status & GLXIIC_SMB_STS_MASTER_BIT) == 0) { - DEBUG("not bus master in master rx"); + GLXIIC_DEBUG_LOG("not bus master in master rx"); return (IIC_ESTATUS); } if ((status & GLXIIC_SMB_STS_NEGACK_BIT) != 0) { - DEBUG("slave nack in rx"); + GLXIIC_DEBUG_LOG("slave nack in rx"); return (IIC_ENOACK); } @@ -825,7 +826,7 @@ glxiic_state_master_rx_callback(struct g } if ((status & GLXIIC_SMB_STS_SDAST_BIT) == 0) { - DEBUG("no pending data in master rx"); + GLXIIC_DEBUG_LOG("no pending data in master rx"); return (IIC_ESTATUS); } @@ -849,17 +850,17 @@ glxiic_state_master_stop_callback(struct GLXIIC_ASSERT_LOCKED(sc); if ((status & GLXIIC_SMB_STS_BER_BIT) != 0) { - DEBUG("bus error in master stop"); + GLXIIC_DEBUG_LOG("bus error in master stop"); return (IIC_EBUSERR); } if ((status & GLXIIC_SMB_STS_MASTER_BIT) == 0) { - DEBUG("not bus master in master stop"); + GLXIIC_DEBUG_LOG("not bus master in master stop"); return (IIC_ESTATUS); } if ((status & GLXIIC_SMB_STS_NEGACK_BIT) != 0) { - DEBUG("slave nack in master stop"); + GLXIIC_DEBUG_LOG("slave nack in master stop"); return (IIC_ENOACK); } From owner-svn-src-head@FreeBSD.ORG Sun May 15 19:14:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BDF71065675; Sun, 15 May 2011 19:14:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 731458FC15; Sun, 15 May 2011 19:14:31 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p4FJEN4Z061916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 May 2011 22:14:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p4FJENR5019972; Sun, 15 May 2011 22:14:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p4FJENL4019971; Sun, 15 May 2011 22:14:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 15 May 2011 22:14:23 +0300 From: Kostik Belousov To: Henrik Brix Andersen Message-ID: <20110515191423.GF48734@deviant.kiev.zoral.com.ua> References: <201105151904.p4FJ488I049135@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="N+tBtqvhbbu3guFw" Content-Disposition: inline In-Reply-To: <201105151904.p4FJ488I049135@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221971 - head/sys/dev/glxiic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 19:14:33 -0000 --N+tBtqvhbbu3guFw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 15, 2011 at 07:04:08PM +0000, Henrik Brix Andersen wrote: > Author: brix (ports committer) > Date: Sun May 15 19:04:08 2011 > New Revision: 221971 > URL: http://svn.freebsd.org/changeset/base/221971 >=20 > Log: > Fix breakage on pc98 by redefining DEBUG(). Why this was built on pc98 at all ? Are there any pc98 machines with Geode ? --N+tBtqvhbbu3guFw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3QJg8ACgkQC3+MBN1Mb4h5gQCgxpXjO/Yd0KZkTibLX2Xjmh2k 6EoAoMRvSBb4Sm+jup5cF2xPFZXElQ2b =Z0Mo -----END PGP SIGNATURE----- --N+tBtqvhbbu3guFw-- From owner-svn-src-head@FreeBSD.ORG Sun May 15 20:03:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AFC71065675; Sun, 15 May 2011 20:03:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B5548FC0C; Sun, 15 May 2011 20:03:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FK3toH050891; Sun, 15 May 2011 20:03:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FK3tnS050889; Sun, 15 May 2011 20:03:55 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105152003.p4FK3tnS050889@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 15 May 2011 20:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221972 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 20:03:55 -0000 Author: ae Date: Sun May 15 20:03:54 2011 New Revision: 221972 URL: http://svn.freebsd.org/changeset/base/221972 Log: Add a sysctl kern.geom.part.check_integrity for those who has corrupt partition tables and lost an ability to boot after r221788. Also unhide an error message from bootverbose, this would help to easier determine the problem. Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun May 15 19:04:08 2011 (r221971) +++ head/sys/geom/part/g_part.c Sun May 15 20:03:54 2011 (r221972) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -104,6 +105,13 @@ struct g_part_alias_list { { "netbsd-swap", G_PART_ALIAS_NETBSD_SWAP }, }; +SYSCTL_DECL(_kern_geom); +SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, "GEOM_PART stuff"); +static u_int check_integrity = 1; +TUNABLE_INT("kern.geom.part.check_integrity", &check_integrity); +SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, CTLFLAG_RW, + &check_integrity, 1, "Enable integrity checking"); + /* * The GEOM partitioning class. */ @@ -267,9 +275,12 @@ g_part_check_integrity(struct g_part_tab } return (0); fail: - if (bootverbose) - printf("GEOM_PART: integrity check failed (%s, %s)\n", - pp->name, table->gpt_scheme->name); + printf("GEOM_PART: integrity check failed (%s, %s)\n", pp->name, + table->gpt_scheme->name); + if (check_integrity == 0) { + table->gpt_corrupt = 1; + return (0); + } return (EINVAL); } From owner-svn-src-head@FreeBSD.ORG Sun May 15 20:52:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26AB91065670; Sun, 15 May 2011 20:52:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 142AC8FC18; Sun, 15 May 2011 20:52:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FKqi3l052356; Sun, 15 May 2011 20:52:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FKqhAD052341; Sun, 15 May 2011 20:52:43 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105152052.p4FKqhAD052341@svn.freebsd.org> From: Rick Macklem Date: Sun, 15 May 2011 20:52:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221973 - in head: sys/fs/nfs sys/fs/nfsclient sys/nfs sys/nfsclient usr.bin/nfsstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 20:52:44 -0000 Author: rmacklem Date: Sun May 15 20:52:43 2011 New Revision: 221973 URL: http://svn.freebsd.org/changeset/base/221973 Log: Change the sysctl naming for the old and new NFS clients to vfs.oldnfs.xxx and vfs.nfs.xxx respectively. This makes the default nfs client use vfs.nfs.xxx after r221124. Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfsclient/nfs_clkrpc.c head/sys/fs/nfsclient/nfs_clnfsiod.c head/sys/fs/nfsclient/nfs_clsubs.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/nfs/nfs_common.c head/sys/nfsclient/nfs_krpc.c head/sys/nfsclient/nfs_nfsiod.c head/sys/nfsclient/nfs_subs.c head/sys/nfsclient/nfs_vfsops.c head/sys/nfsclient/nfs_vnops.c head/usr.bin/nfsstat/nfsstat.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/fs/nfs/nfs_commonkrpc.c Sun May 15 20:52:43 2011 (r221973) @@ -78,17 +78,17 @@ static int nfs3_jukebox_delay = 10; static int nfs_skip_wcc_data_onerr = 1; static int nfs_keytab_enctype = ETYPE_DES_CBC_CRC; -SYSCTL_DECL(_vfs_newnfs); +SYSCTL_DECL(_vfs_nfs); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, bufpackets, CTLFLAG_RW, &nfs_bufpackets, 0, +SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpackets, CTLFLAG_RW, &nfs_bufpackets, 0, "Buffer reservation size 2 < x < 64"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, reconnects, CTLFLAG_RD, &nfs_reconnects, 0, +SYSCTL_INT(_vfs_nfs, OID_AUTO, reconnects, CTLFLAG_RD, &nfs_reconnects, 0, "Number of times the nfs client has had to reconnect"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, &nfs3_jukebox_delay, 0, +SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, &nfs3_jukebox_delay, 0, "Number of seconds to delay a retry after receiving EJUKEBOX"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0, +SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0, "Disable weak cache consistency checking when server returns an error"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, keytab_enctype, CTLFLAG_RW, &nfs_keytab_enctype, 0, +SYSCTL_INT(_vfs_nfs, OID_AUTO, keytab_enctype, CTLFLAG_RW, &nfs_keytab_enctype, 0, "Encryption type for the keytab entry used by nfs"); static void nfs_down(struct nfsmount *, struct thread *, const char *, Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/fs/nfs/nfs_commonport.c Sun May 15 20:52:43 2011 (r221973) @@ -69,14 +69,12 @@ void (*ncl_call_invalcaches)(struct vnod static int nfs_realign_test; static int nfs_realign_count; -SYSCTL_NODE(_vfs, OID_AUTO, newnfs, CTLFLAG_RW, 0, "New NFS filesystem"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, +SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "New NFS filesystem"); +SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, 0, "Number of realign tests done"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, realign_count, CTLFLAG_RW, &nfs_realign_count, +SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RW, &nfs_realign_count, 0, "Number of mbuf realignments done"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs4acl_enable, CTLFLAG_RW, &nfsrv_useacl, - 0, "Enable NFSv4 ACLs"); -SYSCTL_STRING(_vfs_newnfs, OID_AUTO, callback_addr, CTLFLAG_RW, +SYSCTL_STRING(_vfs_nfs, OID_AUTO, callback_addr, CTLFLAG_RW, nfsv4_callbackaddr, sizeof(nfsv4_callbackaddr), "NFSv4 callback addr for server to use"); Modified: head/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clkrpc.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/fs/nfsclient/nfs_clkrpc.c Sun May 15 20:52:43 2011 (r221973) @@ -46,8 +46,6 @@ __FBSDID("$FreeBSD$"); NFSDLOCKMUTEX; -SYSCTL_DECL(_vfs_newnfs); - SVCPOOL *nfscbd_pool; static int nfs_cbproc(struct nfsrv_descript *, u_int32_t); Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnfsiod.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/fs/nfsclient/nfs_clnfsiod.c Sun May 15 20:52:43 2011 (r221973) @@ -80,11 +80,11 @@ static void nfssvc_iod(void *); static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON]; -SYSCTL_DECL(_vfs_newnfs); +SYSCTL_DECL(_vfs_nfs); /* Maximum number of seconds a nfsiod kthread will sleep before exiting */ static unsigned int nfs_iodmaxidle = 120; -SYSCTL_UINT(_vfs_newnfs, OID_AUTO, iodmaxidle, CTLFLAG_RW, &nfs_iodmaxidle, 0, +SYSCTL_UINT(_vfs_nfs, OID_AUTO, iodmaxidle, CTLFLAG_RW, &nfs_iodmaxidle, 0, "Max number of seconds an nfsiod kthread will sleep before exiting"); /* Maximum number of nfsiod kthreads */ @@ -123,7 +123,7 @@ out: mtx_unlock(&ncl_iod_mutex); return (0); } -SYSCTL_PROC(_vfs_newnfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0, +SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0, sizeof (nfs_iodmin), sysctl_iodmin, "IU", "Min number of nfsiod kthreads to keep as spares"); @@ -159,7 +159,7 @@ out: mtx_unlock(&ncl_iod_mutex); return (0); } -SYSCTL_PROC(_vfs_newnfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0, +SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0, sizeof (ncl_iodmax), sysctl_iodmax, "IU", "Max number of nfsiod kthreads"); @@ -214,7 +214,7 @@ nfsiod_setup(void *dummy) { int error; - TUNABLE_INT_FETCH("vfs.newnfs.iodmin", &nfs_iodmin); + TUNABLE_INT_FETCH("vfs.nfs.iodmin", &nfs_iodmin); nfscl_init(); mtx_lock(&ncl_iod_mutex); /* Silently limit the start number of nfsiod's */ @@ -231,7 +231,7 @@ nfsiod_setup(void *dummy) SYSINIT(newnfsiod, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, nfsiod_setup, NULL); static int nfs_defect = 0; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, defect, CTLFLAG_RW, &nfs_defect, 0, +SYSCTL_INT(_vfs_nfs, OID_AUTO, defect, CTLFLAG_RW, &nfs_defect, 0, "Allow nfsiods to migrate serving different mounts"); /* Modified: head/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clsubs.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/fs/nfsclient/nfs_clsubs.c Sun May 15 20:52:43 2011 (r221973) @@ -174,9 +174,9 @@ ncl_printf(const char *fmt, ...) #ifdef NFS_ACDEBUG #include -SYSCTL_DECL(_vfs_newnfs); +SYSCTL_DECL(_vfs_nfs); static int nfs_acdebug; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, acdebug, CTLFLAG_RW, &nfs_acdebug, 0, ""); +SYSCTL_INT(_vfs_nfs, OID_AUTO, acdebug, CTLFLAG_RW, &nfs_acdebug, 0, ""); #endif /* Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun May 15 20:52:43 2011 (r221973) @@ -83,18 +83,16 @@ extern struct nfsstats newnfsstats; MALLOC_DEFINE(M_NEWNFSREQ, "newnfsclient_req", "New NFS request header"); MALLOC_DEFINE(M_NEWNFSMNT, "newnfsmnt", "New NFS mount struct"); -SYSCTL_DECL(_vfs_newnfs); -SYSCTL_STRUCT(_vfs_newnfs, NFS_NFSSTATS, nfsstats, CTLFLAG_RW, - &newnfsstats, nfsstats, "S,nfsstats"); +SYSCTL_DECL(_vfs_nfs); static int nfs_ip_paranoia = 1; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs_ip_paranoia, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_ip_paranoia, CTLFLAG_RW, &nfs_ip_paranoia, 0, ""); static int nfs_tprintf_initial_delay = NFS_TPRINTF_INITIAL_DELAY; -SYSCTL_INT(_vfs_newnfs, NFS_TPRINTF_INITIAL_DELAY, +SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_INITIAL_DELAY, downdelayinitial, CTLFLAG_RW, &nfs_tprintf_initial_delay, 0, ""); /* how long between console messages "nfs server foo not responding" */ static int nfs_tprintf_delay = NFS_TPRINTF_DELAY; -SYSCTL_INT(_vfs_newnfs, NFS_TPRINTF_DELAY, +SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_DELAY, downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, ""); static int nfs_mountroot(struct mount *); @@ -152,14 +150,14 @@ struct nfsv3_diskless nfsv3_diskless = { int nfs_diskless_valid = 0; #endif -SYSCTL_INT(_vfs_newnfs, OID_AUTO, diskless_valid, CTLFLAG_RD, +SYSCTL_INT(_vfs_nfs, OID_AUTO, diskless_valid, CTLFLAG_RD, &nfs_diskless_valid, 0, "Has the diskless struct been filled correctly"); -SYSCTL_STRING(_vfs_newnfs, OID_AUTO, diskless_rootpath, CTLFLAG_RD, +SYSCTL_STRING(_vfs_nfs, OID_AUTO, diskless_rootpath, CTLFLAG_RD, nfsv3_diskless.root_hostnam, 0, "Path to nfs root"); -SYSCTL_OPAQUE(_vfs_newnfs, OID_AUTO, diskless_rootaddr, CTLFLAG_RD, +SYSCTL_OPAQUE(_vfs_nfs, OID_AUTO, diskless_rootaddr, CTLFLAG_RD, &nfsv3_diskless.root_saddr, sizeof(nfsv3_diskless.root_saddr), "%Ssockaddr_in", "Diskless root nfs address"); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun May 15 20:52:43 2011 (r221973) @@ -199,27 +199,27 @@ static int nfs_renameit(struct vnode *sd */ #define DIRHDSIZ (sizeof (struct dirent) - (MAXNAMLEN + 1)) -SYSCTL_DECL(_vfs_newnfs); +SYSCTL_DECL(_vfs_nfs); static int nfsaccess_cache_timeout = NFS_MAXATTRTIMO; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW, &nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout"); static int nfs_prime_access_cache = 0; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, prime_access_cache, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfs, OID_AUTO, prime_access_cache, CTLFLAG_RW, &nfs_prime_access_cache, 0, "Prime NFS ACCESS cache when fetching attributes"); static int newnfs_commit_on_close = 0; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, commit_on_close, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfs, OID_AUTO, commit_on_close, CTLFLAG_RW, &newnfs_commit_on_close, 0, "write+commit on close, else only write"); static int nfs_clean_pages_on_close = 1; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, clean_pages_on_close, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfs, OID_AUTO, clean_pages_on_close, CTLFLAG_RW, &nfs_clean_pages_on_close, 0, "NFS clean dirty pages on close"); int newnfs_directio_enable = 0; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs_directio_enable, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_directio_enable, CTLFLAG_RW, &newnfs_directio_enable, 0, "Enable NFS directio"); /* @@ -234,14 +234,14 @@ SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs_di * meaningful. */ int newnfs_directio_allow_mmap = 1; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs_directio_allow_mmap, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_directio_allow_mmap, CTLFLAG_RW, &newnfs_directio_allow_mmap, 0, "Enable mmaped IO on file with O_DIRECT opens"); #if 0 -SYSCTL_INT(_vfs_newnfs, OID_AUTO, access_cache_hits, CTLFLAG_RD, +SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_hits, CTLFLAG_RD, &newnfsstats.accesscache_hits, 0, "NFS ACCESS cache hit count"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, access_cache_misses, CTLFLAG_RD, +SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_misses, CTLFLAG_RD, &newnfsstats.accesscache_misses, 0, "NFS ACCESS cache miss count"); #endif Modified: head/sys/nfs/nfs_common.c ============================================================================== --- head/sys/nfs/nfs_common.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/nfs/nfs_common.c Sun May 15 20:52:43 2011 (r221973) @@ -361,7 +361,7 @@ nfsm_adv_xx(int s, struct mbuf **md, cad * * We would prefer to avoid this situation entirely. The situation does not * occur with NFS/UDP and is supposed to only occassionally occur with TCP. - * Use vfs.nfs.realign_count and realign_test to check this. + * Use vfs.nfs_common.realign_count and realign_test to check this. */ int nfs_realign(struct mbuf **pm, int how) Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/nfsclient/nfs_krpc.c Sun May 15 20:52:43 2011 (r221973) @@ -93,16 +93,16 @@ static int nfs3_jukebox_delay = 10; static int nfs_skip_wcc_data_onerr = 1; static int fake_wchan; -SYSCTL_DECL(_vfs_nfs); +SYSCTL_DECL(_vfs_oldnfs); -SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpackets, CTLFLAG_RW, &nfs_bufpackets, 0, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, bufpackets, CTLFLAG_RW, &nfs_bufpackets, 0, "Buffer reservation size 2 < x < 64"); -SYSCTL_INT(_vfs_nfs, OID_AUTO, reconnects, CTLFLAG_RD, &nfs_reconnects, 0, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, reconnects, CTLFLAG_RD, &nfs_reconnects, 0, "Number of times the nfs client has had to reconnect"); -SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, &nfs3_jukebox_delay, 0, "Number of seconds to delay a retry after receiving EJUKEBOX"); -SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0, "Disable weak cache consistency checking when server returns an error"); Modified: head/sys/nfsclient/nfs_nfsiod.c ============================================================================== --- head/sys/nfsclient/nfs_nfsiod.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/nfsclient/nfs_nfsiod.c Sun May 15 20:52:43 2011 (r221973) @@ -78,11 +78,11 @@ static void nfssvc_iod(void *); static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON]; -SYSCTL_DECL(_vfs_nfs); +SYSCTL_DECL(_vfs_oldnfs); /* Maximum number of seconds a nfsiod kthread will sleep before exiting */ static unsigned int nfs_iodmaxidle = 120; -SYSCTL_UINT(_vfs_nfs, OID_AUTO, iodmaxidle, CTLFLAG_RW, &nfs_iodmaxidle, 0, +SYSCTL_UINT(_vfs_oldnfs, OID_AUTO, iodmaxidle, CTLFLAG_RW, &nfs_iodmaxidle, 0, "Max number of seconds an nfsiod kthread will sleep before exiting"); /* Maximum number of nfsiod kthreads */ @@ -121,7 +121,7 @@ out: mtx_unlock(&nfs_iod_mtx); return (0); } -SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0, +SYSCTL_PROC(_vfs_oldnfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0, sizeof (nfs_iodmin), sysctl_iodmin, "IU", "Min number of nfsiod kthreads to keep as spares"); @@ -158,7 +158,7 @@ out: mtx_unlock(&nfs_iod_mtx); return (0); } -SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0, +SYSCTL_PROC(_vfs_oldnfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0, sizeof (nfs_iodmax), sysctl_iodmax, "IU", "Max number of nfsiod kthreads"); @@ -213,7 +213,7 @@ nfsiod_setup(void *dummy) { int error; - TUNABLE_INT_FETCH("vfs.nfs.iodmin", &nfs_iodmin); + TUNABLE_INT_FETCH("vfs.oldnfs.iodmin", &nfs_iodmin); mtx_lock(&nfs_iod_mtx); /* Silently limit the start number of nfsiod's */ if (nfs_iodmin > NFS_MAXASYNCDAEMON) @@ -229,7 +229,7 @@ nfsiod_setup(void *dummy) SYSINIT(nfsiod, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, nfsiod_setup, NULL); static int nfs_defect = 0; -SYSCTL_INT(_vfs_nfs, OID_AUTO, defect, CTLFLAG_RW, &nfs_defect, 0, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, defect, CTLFLAG_RW, &nfs_defect, 0, "Allow nfsiods to migrate serving different mounts"); /* Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/nfsclient/nfs_subs.c Sun May 15 20:52:43 2011 (r221973) @@ -653,9 +653,9 @@ out: #ifdef NFS_ACDEBUG #include -SYSCTL_DECL(_vfs_nfs); +SYSCTL_DECL(_vfs_oldnfs); static int nfs_acdebug; -SYSCTL_INT(_vfs_nfs, OID_AUTO, acdebug, CTLFLAG_RW, &nfs_acdebug, 0, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, acdebug, CTLFLAG_RW, &nfs_acdebug, 0, "Toggle acdebug (attribute cache debug) flag"); #endif Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/nfsclient/nfs_vfsops.c Sun May 15 20:52:43 2011 (r221973) @@ -90,25 +90,25 @@ uma_zone_t nfsmount_zone; struct nfsstats nfsstats; -SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "NFS filesystem"); -SYSCTL_STRUCT(_vfs_nfs, NFS_NFSSTATS, nfsstats, CTLFLAG_RW, +SYSCTL_NODE(_vfs, OID_AUTO, oldnfs, CTLFLAG_RW, 0, "Old NFS filesystem"); +SYSCTL_STRUCT(_vfs_oldnfs, NFS_NFSSTATS, nfsstats, CTLFLAG_RW, &nfsstats, nfsstats, "S,nfsstats"); static int nfs_ip_paranoia = 1; -SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_ip_paranoia, CTLFLAG_RW, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, nfs_ip_paranoia, CTLFLAG_RW, &nfs_ip_paranoia, 0, "Disallow accepting replies from IPs which differ from those sent"); #ifdef NFS_DEBUG int nfs_debug; -SYSCTL_INT(_vfs_nfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0, "Toggle debug flag"); #endif static int nfs_tprintf_initial_delay = NFS_TPRINTF_INITIAL_DELAY; -SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_INITIAL_DELAY, +SYSCTL_INT(_vfs_oldnfs, NFS_TPRINTF_INITIAL_DELAY, downdelayinitial, CTLFLAG_RW, &nfs_tprintf_initial_delay, 0, "Delay before printing \"nfs server not responding\" messages"); /* how long between console messages "nfs server foo not responding" */ static int nfs_tprintf_delay = NFS_TPRINTF_DELAY; -SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_DELAY, +SYSCTL_INT(_vfs_oldnfs, NFS_TPRINTF_DELAY, downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, "Delay between printing \"nfs server not responding\" messages"); @@ -176,14 +176,14 @@ struct nfsv3_diskless nfsv3_diskless = { int nfs_diskless_valid = 0; #endif -SYSCTL_INT(_vfs_nfs, OID_AUTO, diskless_valid, CTLFLAG_RD, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, diskless_valid, CTLFLAG_RD, &nfs_diskless_valid, 0, "Has the diskless struct been filled correctly"); -SYSCTL_STRING(_vfs_nfs, OID_AUTO, diskless_rootpath, CTLFLAG_RD, +SYSCTL_STRING(_vfs_oldnfs, OID_AUTO, diskless_rootpath, CTLFLAG_RD, nfsv3_diskless.root_hostnam, 0, "Path to nfs root"); -SYSCTL_OPAQUE(_vfs_nfs, OID_AUTO, diskless_rootaddr, CTLFLAG_RD, +SYSCTL_OPAQUE(_vfs_oldnfs, OID_AUTO, diskless_rootaddr, CTLFLAG_RD, &nfsv3_diskless.root_saddr, sizeof nfsv3_diskless.root_saddr, "%Ssockaddr_in", "Diskless root nfs address"); Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Sun May 15 20:03:54 2011 (r221972) +++ head/sys/nfsclient/nfs_vnops.c Sun May 15 20:52:43 2011 (r221973) @@ -217,27 +217,27 @@ struct nfsmount *nfs_iodmount[NFS_MAXASY int nfs_numasync = 0; #define DIRHDSIZ (sizeof (struct dirent) - (MAXNAMLEN + 1)) -SYSCTL_DECL(_vfs_nfs); +SYSCTL_DECL(_vfs_oldnfs); static int nfsaccess_cache_timeout = NFS_MAXATTRTIMO; -SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW, &nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout"); static int nfs_prime_access_cache = 0; -SYSCTL_INT(_vfs_nfs, OID_AUTO, prime_access_cache, CTLFLAG_RW, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, prime_access_cache, CTLFLAG_RW, &nfs_prime_access_cache, 0, "Prime NFS ACCESS cache when fetching attributes"); static int nfsv3_commit_on_close = 0; -SYSCTL_INT(_vfs_nfs, OID_AUTO, nfsv3_commit_on_close, CTLFLAG_RW, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, nfsv3_commit_on_close, CTLFLAG_RW, &nfsv3_commit_on_close, 0, "write+commit on close, else only write"); static int nfs_clean_pages_on_close = 1; -SYSCTL_INT(_vfs_nfs, OID_AUTO, clean_pages_on_close, CTLFLAG_RW, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, clean_pages_on_close, CTLFLAG_RW, &nfs_clean_pages_on_close, 0, "NFS clean dirty pages on close"); int nfs_directio_enable = 0; -SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_directio_enable, CTLFLAG_RW, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, nfs_directio_enable, CTLFLAG_RW, &nfs_directio_enable, 0, "Enable NFS directio"); /* @@ -252,14 +252,14 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_direc * meaningful. */ int nfs_directio_allow_mmap = 1; -SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_directio_allow_mmap, CTLFLAG_RW, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, nfs_directio_allow_mmap, CTLFLAG_RW, &nfs_directio_allow_mmap, 0, "Enable mmaped IO on file with O_DIRECT opens"); #if 0 -SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_hits, CTLFLAG_RD, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, access_cache_hits, CTLFLAG_RD, &nfsstats.accesscache_hits, 0, "NFS ACCESS cache hit count"); -SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_misses, CTLFLAG_RD, +SYSCTL_INT(_vfs_oldnfs, OID_AUTO, access_cache_misses, CTLFLAG_RD, &nfsstats.accesscache_misses, 0, "NFS ACCESS cache miss count"); #endif Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Sun May 15 20:03:54 2011 (r221972) +++ head/usr.bin/nfsstat/nfsstat.c Sun May 15 20:52:43 2011 (r221973) @@ -221,10 +221,10 @@ readstats(struct nfsstats **stp, struct if (zero) bzero(&zerostat, sizeof(zerostat)); buflen = sizeof(struct nfsstats); - if (*stp != NULL && sysctlbyname("vfs.nfs.nfsstats", *stp, + if (*stp != NULL && sysctlbyname("vfs.oldnfs.nfsstats", *stp, &buflen, zero ? &zerostat : NULL, zero ? buflen : 0) < 0) { if (errno != ENOENT) - err(1, "sysctl: vfs.nfs.nfsstats"); + err(1, "sysctl: vfs.oldnfs.nfsstats"); *stp = NULL; } buflen = sizeof(struct nfsrvstats); From owner-svn-src-head@FreeBSD.ORG Sun May 15 21:44:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F03D01065672; Sun, 15 May 2011 21:44:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E06E18FC17; Sun, 15 May 2011 21:44:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FLipVh053896; Sun, 15 May 2011 21:44:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FLipYx053894; Sun, 15 May 2011 21:44:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105152144.p4FLipYx053894@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 May 2011 21:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221974 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 21:44:52 -0000 Author: yongari Date: Sun May 15 21:44:51 2011 New Revision: 221974 URL: http://svn.freebsd.org/changeset/base/221974 Log: Correctly disable jumbo frame support for BCM5719 A0. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun May 15 20:52:43 2011 (r221973) +++ head/sys/dev/bge/if_bge.c Sun May 15 21:44:51 2011 (r221974) @@ -2836,7 +2836,7 @@ bge_attach(device_t dev) if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { /* Jumbo frame on BCM5719 A0 does not work. */ - sc->bge_flags &= ~BGE_FLAG_JUMBO_FRAME; + sc->bge_flags &= ~BGE_FLAG_JUMBO; } break; case BGE_ASICREV_BCM5755: From owner-svn-src-head@FreeBSD.ORG Sun May 15 22:09:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D5E2106566B; Sun, 15 May 2011 22:09:28 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D6F58FC13; Sun, 15 May 2011 22:09:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FM9SX1054639; Sun, 15 May 2011 22:09:28 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FM9SmN054636; Sun, 15 May 2011 22:09:28 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105152209.p4FM9SmN054636@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 May 2011 22:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221975 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 22:09:28 -0000 Author: jilles Date: Sun May 15 22:09:27 2011 New Revision: 221975 URL: http://svn.freebsd.org/changeset/base/221975 Log: sh: Minor optimization to output from ulimit/export/readonly. No functional change is intended. Modified: head/bin/sh/miscbltin.c head/bin/sh/var.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun May 15 21:44:51 2011 (r221974) +++ head/bin/sh/miscbltin.c Sun May 15 22:09:27 2011 (r221975) @@ -465,7 +465,7 @@ ulimitcmd(int argc __unused, char **argv "(-%c) ", l->option); out1fmt("%-18s %18s ", l->name, optbuf); if (val == RLIM_INFINITY) - out1fmt("unlimited\n"); + out1str("unlimited\n"); else { val /= l->factor; @@ -491,7 +491,7 @@ ulimitcmd(int argc __unused, char **argv val = limit.rlim_max; if (val == RLIM_INFINITY) - out1fmt("unlimited\n"); + out1str("unlimited\n"); else { val /= l->factor; Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sun May 15 21:44:51 2011 (r221974) +++ head/bin/sh/var.c Sun May 15 22:09:27 2011 (r221975) @@ -681,14 +681,13 @@ exportcmd(int argc, char **argv) out1str(cmdname); out1c(' '); } - p = strchr(vp->text, '='); if (values && !(vp->flags & VUNSET)) { - p++; - outbin(vp->text, p - vp->text, - out1); - out1qstr(p); + outbin(vp->text, + vp->name_len + 1, out1); + out1qstr(vp->text + + vp->name_len + 1); } else - outbin(vp->text, p - vp->text, + outbin(vp->text, vp->name_len, out1); out1c('\n'); } From owner-svn-src-head@FreeBSD.ORG Sun May 15 22:46:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2B62106564A; Sun, 15 May 2011 22:46:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A85F88FC0C; Sun, 15 May 2011 22:46:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FMkjJO055747; Sun, 15 May 2011 22:46:45 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FMkjNA055745; Sun, 15 May 2011 22:46:45 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105152246.p4FMkjNA055745@svn.freebsd.org> From: Rick Macklem Date: Sun, 15 May 2011 22:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221976 - head/usr.sbin/nfsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 22:46:45 -0000 Author: rmacklem Date: Sun May 15 22:46:45 2011 New Revision: 221976 URL: http://svn.freebsd.org/changeset/base/221976 Log: Fix the nfsv4 man page to reflect the changes related to making the new NFS client and server the default. This is a content change. Modified: head/usr.sbin/nfsd/nfsv4.4 Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Sun May 15 22:09:27 2011 (r221975) +++ head/usr.sbin/nfsd/nfsv4.4 Sun May 15 22:46:45 2011 (r221976) @@ -24,14 +24,14 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2011 +.Dd May 15, 2011 .Dt NFSV4 4 .Os .Sh NAME .Nm NFSv4 .Nd NFS Version 4 Protocol .Sh DESCRIPTION -The experimental NFS client and server provides support for the +The NFS client and server provides support for the .Tn NFSv4 specification; see .%T "Network File System (NFS) Version 4 Protocol RFC 3530" . @@ -153,36 +153,26 @@ with RPCSEC_GSS (sec=krb5, krb5i, krb5p) will go on the wire. .Sh SERVER SETUP .Pp -To set up the experimental NFS server that supports +To set up the NFS server that supports .Nm , -you will need to either build a kernel with: +you will need to either set the variables in +.Xr rc.conf 5 +as follows: .sp .Bd -literal -offset indent -compact -options NFSD -.Ed -and not -.Bd -literal -offset indent -compact -options NFSSERVER +nfs_server_enable="YES" +nfsv4_server_enable="YES" +nfsuserd_enable="YES" .Ed .sp or start .Xr mountd 8 and .Xr nfsd 8 -with the ``-e'' option to force use of the experimental server. +without the ``-o'' option, which would force use of the old server. The .Xr nfsuserd 8 daemon must also be running. -This will occur if -.sp -.Bd -literal -offset indent -compact -nfs_server_enable="YES" -nfsv4_server_enable="YES" -nfsuserd_enable="YES" -.Ed -.sp -are set in -.Xr rc.conf 5 . .Pp You will also need to add at least one ``V4:'' line to the .Xr exports 5 @@ -196,7 +186,7 @@ there are a couple of .Xr sysctl 8 variables that you can change, which might improve performance. .Bl -tag -width Ds -.It Cm vfs.newnfs.issue_delegations +.It Cm vfs.nfsd.issue_delegations when set non-zero, allows the server to issue Open Delegations to clients. These delegations permit the client to manipulate the file @@ -208,7 +198,7 @@ This can only be enabled when the file s clients are not being accessed locally on the server and, if being accessed via NFS Version 2 or 3 clients, these clients cannot be using the NLM. -.It Cm vfs.newnfs.enable_locallocks +.It Cm vfs.nfsd.enable_locallocks can be set to 0 to disable acquisition of local byte range locks. Disabling local locking can only be done if neither local accesses to the exported file systems nor the NLM is operating on them. @@ -217,7 +207,7 @@ to the exported file systems nor the NLM Note that Samba server access would be considered ``local access'' for the above discussion. .Pp -To build a kernel with the experimental +To build a kernel with the NFS server that supports .Nm linked into it, the .sp @@ -235,7 +225,9 @@ To do an mount, specify the ``nfsv4'' option on the .Xr mount_nfs 8 command line. -This will force use of the experimental client plus set ``tcp'' and +This will force use of the client that supports +.Nm +plus set ``tcp'' and .Nm . .Pp The @@ -269,16 +261,16 @@ To get callbacks to work when behind a N service will need to be set up on the NAT gateway and then the address of the NAT gateway (host IP plus port#) will need to be set by assigning the .Xr sysctl 8 -variable vfs.newnfs.callback_addr to a string of the form: +variable vfs.nfs.callback_addr to a string of the form: .sp N.N.N.N.N.N .sp where the first 4 Ns are the host IP address and the last two are the port# in network byte order (all decimal #s in the range 0-255). .Pp -To build a kernel with the experimental +To build a kernel with the client that supports .Nm -client linked into it, the option +linked into it, the option .sp .Bd -literal -offset indent -compact options NFSCL From owner-svn-src-head@FreeBSD.ORG Mon May 16 02:38:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB406106566B; Mon, 16 May 2011 02:38:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF488FC15; Mon, 16 May 2011 02:38:44 +0000 (UTC) Received: by yie12 with SMTP id 12so1606253yie.13 for ; Sun, 15 May 2011 19:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=t1WnOHptiBDGjOzT6AwU5nTYX7UOBuExHRBN/Nr/EjI=; b=AseAZsL5WoBeyW/GcPZwC/0qdnrjjy7u5nTpFA3IgObMIW2dnOiKPpWt/Phiz3R9+d qTKtSMahhsFkh/mlxxR6SRQAmB1NO4PjSK+arVrWkGqNWEVuOW2+ig4Ny+G1JPch1vvm Tp0JasVfGT7XcIXqZgoxMx8M8LsZxw4Gl5cCU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=v6NkZTPcDwkmFBJNhhe54KyUCQRptrNsU1uI63y74ZHrmZQH4Y4vz8QWI1b5sHrgRY /gK5QVC4PQ4+DF9vnVgIHw9o/Sx88gObvb+6O7DDjw2HRUmGx5VAHo0WNvpSUWAk8k54 I3bygU5lfFj4L7NDTPF0QwSdpinwKoJp/M1Ks= MIME-Version: 1.0 Received: by 10.150.187.18 with SMTP id k18mr3379426ybf.19.1305513523476; Sun, 15 May 2011 19:38:43 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.91.12 with HTTP; Sun, 15 May 2011 19:38:43 -0700 (PDT) In-Reply-To: <201105141425.p4EEPFTr005919@svn.freebsd.org> References: <201105141425.p4EEPFTr005919@svn.freebsd.org> Date: Mon, 16 May 2011 10:38:43 +0800 X-Google-Sender-Auth: Ga0qjpbx00LlmX1VsHoQXM53dZI Message-ID: From: Adrian Chadd To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r221888 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 02:38:44 -0000 On 14 May 2011 22:25, Adrian Chadd wrote: > =A0Import initial EEPROM code for Kite (AR9287). That should be "Kiwi" (AR9287.) Sorry. Adrian From owner-svn-src-head@FreeBSD.ORG Mon May 16 03:32:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A449106564A; Mon, 16 May 2011 03:32:40 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69E078FC12; Mon, 16 May 2011 03:32:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4G3WeYR064587; Mon, 16 May 2011 03:32:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4G3WeG1064585; Mon, 16 May 2011 03:32:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105160332.p4G3WeG1064585@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 16 May 2011 03:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221981 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 03:32:40 -0000 Author: nwhitehorn Date: Mon May 16 03:32:40 2011 New Revision: 221981 URL: http://svn.freebsd.org/changeset/base/221981 Log: Remove a useless check that served only to make 64-bit PPC systems unbootable after r221855. Submitted by: andreast MFC after: 1 week Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon May 16 03:23:50 2011 (r221980) +++ head/sys/powerpc/aim/mmu_oea64.c Mon May 16 03:32:40 2011 (r221981) @@ -1141,8 +1141,6 @@ moea64_zero_page_area(mmu_t mmu, vm_page { vm_offset_t pa = VM_PAGE_TO_PHYS(m); - if (!moea64_initialized) - panic("moea64_zero_page: can't zero pa %#" PRIxPTR, pa); if (size + off > PAGE_SIZE) panic("moea64_zero_page: size + off > PAGE_SIZE"); @@ -1165,9 +1163,6 @@ moea64_zero_page(mmu_t mmu, vm_page_t m) vm_offset_t pa = VM_PAGE_TO_PHYS(m); vm_offset_t va, off; - if (!moea64_initialized) - panic("moea64_zero_page: can't zero pa %#zx", pa); - if (!hw_direct_map) { mtx_lock(&moea64_scratchpage_mtx); From owner-svn-src-head@FreeBSD.ORG Mon May 16 12:00:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65A41106571D; Mon, 16 May 2011 12:00:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54B218FC13; Mon, 16 May 2011 12:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GC0WDo081281; Mon, 16 May 2011 12:00:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GC0WWf081279; Mon, 16 May 2011 12:00:32 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105161200.p4GC0WWf081279@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 16 May 2011 12:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221984 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 12:00:32 -0000 Author: ae Date: Mon May 16 12:00:32 2011 New Revision: 221984 URL: http://svn.freebsd.org/changeset/base/221984 Log: Add diagnostic messages for integrity checks. Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Mon May 16 07:03:06 2011 (r221983) +++ head/sys/geom/part/g_part.c Mon May 16 12:00:32 2011 (r221984) @@ -245,6 +245,7 @@ g_part_check_integrity(struct g_part_tab struct g_part_entry *e1, *e2; struct g_provider *pp; + e1 = e2 = NULL; pp = cp->provider; if (table->gpt_first > table->gpt_last || table->gpt_last > pp->mediasize / pp->sectorsize - 1) @@ -277,6 +278,25 @@ g_part_check_integrity(struct g_part_tab fail: printf("GEOM_PART: integrity check failed (%s, %s)\n", pp->name, table->gpt_scheme->name); + if (bootverbose) { + if (e1 == NULL) + printf("GEOM_PART: invalid geom configuration:\n"); + else if (e2 == NULL) + printf("GEOM_PART: invalid partition entry:\n"); + else + printf("GEOM_PART: overlapped partition entries:\n"); + if (e1 != NULL) + printf("GEOM_PART: index: %d, start: %jd, end: %jd\n", + e1->gpe_index, + (intmax_t)e1->gpe_start, (intmax_t)e1->gpe_end); + if (e2 != NULL) + printf("GEOM_PART: index: %d, start: %jd, end: %jd\n", + e2->gpe_index, + (intmax_t)e2->gpe_start, (intmax_t)e2->gpe_end); + printf("GEOM_PART: first: %jd, last: %jd, sectors: %jd\n", + (intmax_t)table->gpt_first, (intmax_t)table->gpt_last, + (intmax_t)pp->mediasize / pp->sectorsize - 1); + } if (check_integrity == 0) { table->gpt_corrupt = 1; return (0); From owner-svn-src-head@FreeBSD.ORG Mon May 16 13:12:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8C24106566B; Mon, 16 May 2011 13:12:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C81948FC13; Mon, 16 May 2011 13:12:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GDC9Sw083427; Mon, 16 May 2011 13:12:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GDC9Zj083425; Mon, 16 May 2011 13:12:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105161312.p4GDC9Zj083425@svn.freebsd.org> From: Rick Macklem Date: Mon, 16 May 2011 13:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221986 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 13:12:09 -0000 Author: rmacklem Date: Mon May 16 13:12:09 2011 New Revision: 221986 URL: http://svn.freebsd.org/changeset/base/221986 Log: Fix a comment that got missed by r221973 which changed the sysctl naming for the old NFS client to vfs.oldnfs. Modified: head/sys/nfsclient/nfs.h Modified: head/sys/nfsclient/nfs.h ============================================================================== --- head/sys/nfsclient/nfs.h Mon May 16 12:11:29 2011 (r221985) +++ head/sys/nfsclient/nfs.h Mon May 16 13:12:09 2011 (r221986) @@ -107,7 +107,7 @@ #endif /* - * vfs.nfs sysctl(3) identifiers + * vfs.oldnfs sysctl(3) identifiers */ #define NFS_NFSSTATS 1 /* struct: struct nfsstats */ From owner-svn-src-head@FreeBSD.ORG Mon May 16 14:36:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A942E106567B; Mon, 16 May 2011 14:36:37 +0000 (UTC) (envelope-from brix@freebsd.org) Received: from solow.pil.dk (relay.pil.dk [195.41.47.164]) by mx1.freebsd.org (Postfix) with ESMTP id 65CC38FC18; Mon, 16 May 2011 14:36:36 +0000 (UTC) Received: from druadan.brixandersen.dk (0x55534f5f.adsl.cybercity.dk [85.83.79.95]) by solow.pil.dk (Postfix) with ESMTPA id 653971CC007; Mon, 16 May 2011 16:36:35 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-3-831877617" From: Henrik Brix Andersen In-Reply-To: <20110515191423.GF48734@deviant.kiev.zoral.com.ua> Date: Mon, 16 May 2011 16:36:31 +0200 Content-Transfer-Encoding: 7bit Message-Id: <55375C87-69C1-4070-8380-C351524F88AC@freebsd.org> References: <201105151904.p4FJ488I049135@svn.freebsd.org> <20110515191423.GF48734@deviant.kiev.zoral.com.ua> To: Kostik Belousov X-Pgp-Agent: GPGMail 1.3.3 X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221971 - head/sys/dev/glxiic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 14:36:37 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-3-831877617 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, On May 15, 2011, at 21:14, Kostik Belousov wrote: > On Sun, May 15, 2011 at 07:04:08PM +0000, Henrik Brix Andersen wrote: >> Author: brix (ports committer) >> Date: Sun May 15 19:04:08 2011 >> New Revision: 221971 >> URL: http://svn.freebsd.org/changeset/base/221971 >>=20 >> Log: >> Fix breakage on pc98 by redefining DEBUG(). Actually, my commit message should have read i386 and pc98. Sorry about = that. > Why this was built on pc98 at all ? As to why tinderbox decided to build glxiic(4) as a module on pc98, I'm = a bit at a loss. I can tell from the tinderbox logs that other i386-only drivers such as = glxsb(4) are also built as modules in pc98 LINT (see = http://tinderbox.freebsd.org/tinderbox-head-HEAD-i386-pc98.full). > Are there any pc98 machines with Geode ? Not likely, no. Regards, Brix --=20 Henrik Brix Andersen --Apple-Mail-3-831877617 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAk3RNnAACgkQv+Q4flTiePiTIQCeIfFOhHHnf8BarPvPxznVrYXP kTsAoLcUuXHsxlR4HwBY8h8x4UWnznlQ =ku1a -----END PGP SIGNATURE----- --Apple-Mail-3-831877617-- From owner-svn-src-head@FreeBSD.ORG Mon May 16 15:20:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A31341065670; Mon, 16 May 2011 15:20:54 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9214C8FC22; Mon, 16 May 2011 15:20:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GFKsCV087839; Mon, 16 May 2011 15:20:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GFKsaq087837; Mon, 16 May 2011 15:20:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105161520.p4GFKsaq087837@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 16 May 2011 15:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221988 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 15:20:54 -0000 Author: nwhitehorn Date: Mon May 16 15:20:54 2011 New Revision: 221988 URL: http://svn.freebsd.org/changeset/base/221988 Log: Fix a = pregions[i].mr_start) - && (addr + len < pregions[i].mr_start + pregions[i].mr_size)) + && (addr + len <= pregions[i].mr_start + pregions[i].mr_size)) return (0); return (EFAULT); From owner-svn-src-head@FreeBSD.ORG Mon May 16 15:29:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC91A1065672; Mon, 16 May 2011 15:29:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA5098FC18; Mon, 16 May 2011 15:29:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GFTxFo088273; Mon, 16 May 2011 15:29:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GFTxj6088267; Mon, 16 May 2011 15:29:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105161529.p4GFTxj6088267@svn.freebsd.org> From: Andriy Gapon Date: Mon, 16 May 2011 15:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221990 - in head/sys: cddl/compat/opensolaris/sys cddl/dev/cyclic cddl/dev/cyclic/i386 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 15:30:00 -0000 Author: avg Date: Mon May 16 15:29:59 2011 New Revision: 221990 URL: http://svn.freebsd.org/changeset/base/221990 Log: better integrate cyclic module with clocksource/eventtimer subsystem Now in the case when one-shot timers are used cyclic events should fire closer to theier scheduled times. As the cyclic is currently used only to drive DTrace profile provider, this is the area where the change makes a difference. Reviewed by: mav (earlier version, a while ago) X-MFC after: clocksource/eventtimer subsystem Modified: head/sys/cddl/compat/opensolaris/sys/time.h head/sys/cddl/dev/cyclic/cyclic.c head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c head/sys/kern/kern_clocksource.c head/sys/sys/dtrace_bsd.h Modified: head/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/time.h Mon May 16 15:23:17 2011 (r221989) +++ head/sys/cddl/compat/opensolaris/sys/time.h Mon May 16 15:29:59 2011 (r221990) @@ -53,7 +53,7 @@ gethrtime(void) { struct timespec ts; hrtime_t nsec; - getnanouptime(&ts); + nanouptime(&ts); nsec = (hrtime_t)ts.tv_sec * NANOSEC + ts.tv_nsec; return (nsec); } Modified: head/sys/cddl/dev/cyclic/cyclic.c ============================================================================== --- head/sys/cddl/dev/cyclic/cyclic.c Mon May 16 15:23:17 2011 (r221989) +++ head/sys/cddl/dev/cyclic/cyclic.c Mon May 16 15:29:59 2011 (r221990) @@ -341,6 +341,16 @@ static cyc_backend_t cyclic_backend; MALLOC_DEFINE(M_CYCLIC, "cyclic", "Cyclic timer subsystem"); +static __inline hrtime_t +cyc_gethrtime(void) +{ + struct bintime bt; + + binuptime(&bt); + return ((hrtime_t)bt.sec * NANOSEC + + (((uint64_t)NANOSEC * (uint32_t)(bt.frac >> 32)) >> 32)); +} + /* * Returns 1 if the upheap propagated to the root, 0 if it did not. This * allows the caller to reprogram the backend only when the root has been @@ -507,7 +517,7 @@ cyclic_fire(cpu_t *c) cyc_index_t *heap = cpu->cyp_heap; cyclic_t *cyclic, *cyclics = cpu->cyp_cyclics; void *arg = be->cyb_arg; - hrtime_t now = gethrtime(); + hrtime_t now = cyc_gethrtime(); hrtime_t exp; if (cpu->cyp_nelems == 0) { @@ -687,7 +697,7 @@ cyclic_add_xcall(cyc_xcallarg_t *arg) * If a start time hasn't been explicitly specified, we'll * start on the next interval boundary. */ - cyclic->cy_expire = (gethrtime() / cyclic->cy_interval + 1) * + cyclic->cy_expire = (cyc_gethrtime() / cyclic->cy_interval + 1) * cyclic->cy_interval; } else { cyclic->cy_expire = when->cyt_when; Modified: head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c ============================================================================== --- head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Mon May 16 15:23:17 2011 (r221989) +++ head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Mon May 16 15:29:59 2011 (r221990) @@ -30,6 +30,7 @@ static void enable(cyb_arg_t); static void disable(cyb_arg_t); static void reprogram(cyb_arg_t, hrtime_t); static void xcall(cyb_arg_t, cpu_t *, cyc_func_t, void *); +static void cyclic_clock(struct trapframe *frame); static cyc_backend_t be = { NULL, /* cyb_configure */ @@ -45,6 +46,7 @@ static void cyclic_ap_start(void *dummy) { /* Initialise the rest of the CPUs. */ + cyclic_clock_func = cyclic_clock; cyclic_mp_init(); } @@ -63,18 +65,10 @@ cyclic_machdep_init(void) static void cyclic_machdep_uninit(void) { - int i; - - for (i = 0; i <= mp_maxid; i++) - /* Reset the cyclic clock callback hook. */ - cyclic_clock_func[i] = NULL; - /* De-register the cyclic backend. */ cyclic_uninit(); } -static hrtime_t exp_due[MAXCPU]; - /* * This function is the one registered by the machine dependent * initialiser as the callback for high speed timer events. @@ -84,7 +78,7 @@ cyclic_clock(struct trapframe *frame) { cpu_t *c = &solaris_cpu[curcpu]; - if (c->cpu_cyclic != NULL && gethrtime() >= exp_due[curcpu]) { + if (c->cpu_cyclic != NULL) { if (TRAPF_USERMODE(frame)) { c->cpu_profile_pc = 0; c->cpu_profile_upc = TRAPF_PC(frame); @@ -102,26 +96,34 @@ cyclic_clock(struct trapframe *frame) } } -static void enable(cyb_arg_t arg) +static void +enable(cyb_arg_t arg __unused) { - /* Register the cyclic clock callback function. */ - cyclic_clock_func[curcpu] = cyclic_clock; + } -static void disable(cyb_arg_t arg) +static void +disable(cyb_arg_t arg __unused) { - /* Reset the cyclic clock callback function. */ - cyclic_clock_func[curcpu] = NULL; + } -static void reprogram(cyb_arg_t arg, hrtime_t exp) +static void +reprogram(cyb_arg_t arg __unused, hrtime_t exp) { - exp_due[curcpu] = exp; + struct bintime bt; + struct timespec ts; + + ts.tv_sec = exp / 1000000000; + ts.tv_nsec = exp % 1000000000; + timespec2bintime(&ts, &bt); + clocksource_cyc_set(&bt); } -static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param) +static void xcall(cyb_arg_t arg __unused, cpu_t *c, cyc_func_t func, + void *param) { - smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), + smp_rendezvous_cpus((cpumask_t)1 << c->cpuid, smp_no_rendevous_barrier, func, smp_no_rendevous_barrier, param); } Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Mon May 16 15:23:17 2011 (r221989) +++ head/sys/kern/kern_clocksource.c Mon May 16 15:29:59 2011 (r221990) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); #ifdef KDTRACE_HOOKS #include -cyclic_clock_func_t cyclic_clock_func[MAXCPU]; +cyclic_clock_func_t cyclic_clock_func = NULL; #endif int cpu_disable_deep_sleep = 0; /* Timer dies in C3. */ @@ -128,6 +128,9 @@ struct pcpu_state { struct bintime nexthard; /* Next hardlock() event. */ struct bintime nextstat; /* Next statclock() event. */ struct bintime nextprof; /* Next profclock() event. */ +#ifdef KDTRACE_HOOKS + struct bintime nextcyc; /* Next OpenSolaris cyclics event. */ +#endif int ipi; /* This CPU needs IPI. */ int idle; /* This CPU is in idle mode. */ }; @@ -190,17 +193,10 @@ handleevents(struct bintime *now, int fa usermode = TRAPF_USERMODE(frame); pc = TRAPF_PC(frame); } -#ifdef KDTRACE_HOOKS - /* - * If the DTrace hooks are configured and a callback function - * has been registered, then call it to process the high speed - * timers. - */ - if (!fake && cyclic_clock_func[curcpu] != NULL) - (*cyclic_clock_func[curcpu])(frame); -#endif + runs = 0; state = DPCPU_PTR(timerstate); + while (bintime_cmp(now, &state->nexthard, >=)) { bintime_add(&state->nexthard, &hardperiod); runs++; @@ -224,6 +220,16 @@ handleevents(struct bintime *now, int fa } } else state->nextprof = state->nextstat; + +#ifdef KDTRACE_HOOKS + if (fake == 0 && cyclic_clock_func != NULL && + state->nextcyc.sec != -1 && + bintime_cmp(now, &state->nextcyc, >=)) { + state->nextcyc.sec = -1; + (*cyclic_clock_func)(frame); + } +#endif + getnextcpuevent(&t, 0); if (fake == 2) { state->nextevent = t; @@ -263,10 +269,13 @@ getnextcpuevent(struct bintime *event, i } else { /* If CPU is active - handle all types of events. */ if (bintime_cmp(event, &state->nextstat, >)) *event = state->nextstat; - if (profiling && - bintime_cmp(event, &state->nextprof, >)) + if (profiling && bintime_cmp(event, &state->nextprof, >)) *event = state->nextprof; } +#ifdef KDTRACE_HOOKS + if (state->nextcyc.sec != -1 && bintime_cmp(event, &state->nextcyc, >)) + *event = state->nextcyc; +#endif } /* @@ -590,6 +599,9 @@ cpu_initclocks_bsp(void) CPU_FOREACH(cpu) { state = DPCPU_ID_PTR(cpu, timerstate); mtx_init(&state->et_hw_mtx, "et_hw_mtx", NULL, MTX_SPIN); +#ifdef KDTRACE_HOOKS + state->nextcyc.sec = -1; +#endif } #ifdef SMP callout_new_inserted = cpu_new_callout; @@ -784,6 +796,43 @@ cpu_activeclock(void) spinlock_exit(); } +#ifdef KDTRACE_HOOKS +void +clocksource_cyc_set(const struct bintime *t) +{ + struct bintime now; + struct pcpu_state *state; + + state = DPCPU_PTR(timerstate); + if (periodic) + now = state->now; + else + binuptime(&now); + + CTR4(KTR_SPARE2, "set_cyc at %d: now %d.%08x%08x", + curcpu, now.sec, (unsigned int)(now.frac >> 32), + (unsigned int)(now.frac & 0xffffffff)); + CTR4(KTR_SPARE2, "set_cyc at %d: t %d.%08x%08x", + curcpu, t->sec, (unsigned int)(t->frac >> 32), + (unsigned int)(t->frac & 0xffffffff)); + + ET_HW_LOCK(state); + if (bintime_cmp(t, &state->nextcyc, ==)) { + ET_HW_UNLOCK(state); + return; + } + state->nextcyc = *t; + if (bintime_cmp(&state->nextcyc, &state->nextevent, >=)) { + ET_HW_UNLOCK(state); + return; + } + state->nextevent = state->nextcyc; + if (!periodic) + loadtimer(&now, 0); + ET_HW_UNLOCK(state); +} +#endif + #ifdef SMP static void cpu_new_callout(int cpu, int ticks) Modified: head/sys/sys/dtrace_bsd.h ============================================================================== --- head/sys/sys/dtrace_bsd.h Mon May 16 15:23:17 2011 (r221989) +++ head/sys/sys/dtrace_bsd.h Mon May 16 15:29:59 2011 (r221990) @@ -44,14 +44,9 @@ struct reg; * subsystem into the appropriate timer interrupt. */ typedef void (*cyclic_clock_func_t)(struct trapframe *); +extern cyclic_clock_func_t cyclic_clock_func; -/* - * These external variables are actually machine-dependent, so - * they might not actually exist. - * - * Defining them here avoids a proliferation of header files. - */ -extern cyclic_clock_func_t cyclic_clock_func[]; +void clocksource_cyc_set(const struct bintime *t); /* * The dtrace module handles traps that occur during a DTrace probe. From owner-svn-src-head@FreeBSD.ORG Mon May 16 15:36:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8218106566B; Mon, 16 May 2011 15:36:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97A818FC14; Mon, 16 May 2011 15:36:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GFaBpG088506; Mon, 16 May 2011 15:36:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GFaBc8088504; Mon, 16 May 2011 15:36:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105161536.p4GFaBc8088504@svn.freebsd.org> From: Andriy Gapon Date: Mon, 16 May 2011 15:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221991 - head/sys/cddl/compat/opensolaris/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 15:36:11 -0000 Author: avg Date: Mon May 16 15:36:11 2011 New Revision: 221991 URL: http://svn.freebsd.org/changeset/base/221991 Log: Revert accidentally committed local change in r221990 Pointyhat to: avg Modified: head/sys/cddl/compat/opensolaris/sys/time.h Modified: head/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/time.h Mon May 16 15:29:59 2011 (r221990) +++ head/sys/cddl/compat/opensolaris/sys/time.h Mon May 16 15:36:11 2011 (r221991) @@ -53,7 +53,7 @@ gethrtime(void) { struct timespec ts; hrtime_t nsec; - nanouptime(&ts); + getnanouptime(&ts); nsec = (hrtime_t)ts.tv_sec * NANOSEC + ts.tv_nsec; return (nsec); } From owner-svn-src-head@FreeBSD.ORG Mon May 16 15:59:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 358C9106564A; Mon, 16 May 2011 15:59:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24AF68FC0A; Mon, 16 May 2011 15:59:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GFxpAH089239; Mon, 16 May 2011 15:59:51 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GFxpuF089237; Mon, 16 May 2011 15:59:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105161559.p4GFxpuF089237@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 16 May 2011 15:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221992 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 15:59:51 -0000 Author: ae Date: Mon May 16 15:59:50 2011 New Revision: 221992 URL: http://svn.freebsd.org/changeset/base/221992 Log: Make diagnostic messages more specific. With bootverbose print out all inconsistencies of integrity in the partition table, not first found only. Requested by: kib Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Mon May 16 15:36:11 2011 (r221991) +++ head/sys/geom/part/g_part.c Mon May 16 15:59:50 2011 (r221992) @@ -239,70 +239,111 @@ g_part_geometry(struct g_part_table *tab } } +#define DPRINTF(...) if (bootverbose) { \ + printf("GEOM_PART: " __VA_ARGS__); \ +} + static int g_part_check_integrity(struct g_part_table *table, struct g_consumer *cp) { struct g_part_entry *e1, *e2; struct g_provider *pp; + int failed; - e1 = e2 = NULL; + failed = 0; pp = cp->provider; - if (table->gpt_first > table->gpt_last || - table->gpt_last > pp->mediasize / pp->sectorsize - 1) - goto fail; - + if (table->gpt_last < table->gpt_first) { + DPRINTF("last LBA is below first LBA: %jd < %jd\n", + (intmax_t)table->gpt_last, (intmax_t)table->gpt_first); + failed++; + } + if (table->gpt_last > pp->mediasize / pp->sectorsize - 1) { + DPRINTF("last LBA extends beyond mediasize: " + "%jd > %jd\n", (intmax_t)table->gpt_last, + (intmax_t)pp->mediasize / pp->sectorsize - 1); + failed++; + } LIST_FOREACH(e1, &table->gpt_entry, gpe_entry) { if (e1->gpe_deleted || e1->gpe_internal) continue; - if (e1->gpe_start < table->gpt_first || - e1->gpe_start > table->gpt_last || - e1->gpe_end < e1->gpe_start || - e1->gpe_end > table->gpt_last) - goto fail; + if (e1->gpe_start < table->gpt_first) { + DPRINTF("partition %d has start offset below first " + "LBA: %jd < %jd\n", e1->gpe_index, + (intmax_t)e1->gpe_start, + (intmax_t)table->gpt_first); + failed++; + } + if (e1->gpe_start > table->gpt_last) { + DPRINTF("partition %d has start offset beyond last " + "LBA: %jd > %jd\n", e1->gpe_index, + (intmax_t)e1->gpe_start, + (intmax_t)table->gpt_last); + failed++; + } + if (e1->gpe_end < e1->gpe_start) { + DPRINTF("partition %d has end offset below start " + "offset: %jd < %jd\n", e1->gpe_index, + (intmax_t)e1->gpe_end, + (intmax_t)e1->gpe_start); + failed++; + } + if (e1->gpe_end > table->gpt_last) { + DPRINTF("partition %d has end offset beyond last " + "LBA: %jd > %jd\n", e1->gpe_index, + (intmax_t)e1->gpe_end, + (intmax_t)table->gpt_last); + failed++; + } e2 = e1; while ((e2 = LIST_NEXT(e2, gpe_entry)) != NULL) { if (e2->gpe_deleted || e2->gpe_internal) continue; if (e1->gpe_start >= e2->gpe_start && - e1->gpe_start <= e2->gpe_end) - goto fail; + e1->gpe_start <= e2->gpe_end) { + DPRINTF("partition %d has start offset inside " + "partition %d: start[%d] %jd >= start[%d] " + "%jd <= end[%d] %jd\n", + e1->gpe_index, e2->gpe_index, + e2->gpe_index, (intmax_t)e2->gpe_start, + e1->gpe_index, (intmax_t)e1->gpe_start, + e2->gpe_index, (intmax_t)e2->gpe_end); + failed++; + } if (e1->gpe_end >= e2->gpe_start && - e1->gpe_end <= e2->gpe_end) - goto fail; + e1->gpe_end <= e2->gpe_end) { + DPRINTF("partition %d has end offset inside " + "partition %d: start[%d] %jd >= end[%d] " + "%jd <= end[%d] %jd\n", + e1->gpe_index, e2->gpe_index, + e2->gpe_index, (intmax_t)e2->gpe_start, + e1->gpe_index, (intmax_t)e1->gpe_end, + e2->gpe_index, (intmax_t)e2->gpe_end); + failed++; + } if (e1->gpe_start < e2->gpe_start && - e1->gpe_end > e2->gpe_end) - goto fail; + e1->gpe_end > e2->gpe_end) { + DPRINTF("partition %d contains partition %d: " + "start[%d] %jd > start[%d] %jd, end[%d] " + "%jd < end[%d] %jd\n", + e1->gpe_index, e2->gpe_index, + e1->gpe_index, (intmax_t)e1->gpe_start, + e2->gpe_index, (intmax_t)e2->gpe_start, + e2->gpe_index, (intmax_t)e2->gpe_end, + e1->gpe_index, (intmax_t)e1->gpe_end); + failed++; + } } } - return (0); -fail: - printf("GEOM_PART: integrity check failed (%s, %s)\n", pp->name, - table->gpt_scheme->name); - if (bootverbose) { - if (e1 == NULL) - printf("GEOM_PART: invalid geom configuration:\n"); - else if (e2 == NULL) - printf("GEOM_PART: invalid partition entry:\n"); - else - printf("GEOM_PART: overlapped partition entries:\n"); - if (e1 != NULL) - printf("GEOM_PART: index: %d, start: %jd, end: %jd\n", - e1->gpe_index, - (intmax_t)e1->gpe_start, (intmax_t)e1->gpe_end); - if (e2 != NULL) - printf("GEOM_PART: index: %d, start: %jd, end: %jd\n", - e2->gpe_index, - (intmax_t)e2->gpe_start, (intmax_t)e2->gpe_end); - printf("GEOM_PART: first: %jd, last: %jd, sectors: %jd\n", - (intmax_t)table->gpt_first, (intmax_t)table->gpt_last, - (intmax_t)pp->mediasize / pp->sectorsize - 1); - } - if (check_integrity == 0) { + if (failed != 0) { + printf("GEOM_PART: integrity check failed (%s, %s)\n", + pp->name, table->gpt_scheme->name); + if (check_integrity != 0) + return (EINVAL); table->gpt_corrupt = 1; - return (0); } - return (EINVAL); + return (0); } +#undef DPRINTF struct g_part_entry * g_part_new_entry(struct g_part_table *table, int index, quad_t start, From owner-svn-src-head@FreeBSD.ORG Mon May 16 16:18:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95F691065670; Mon, 16 May 2011 16:18:40 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B14A8FC0C; Mon, 16 May 2011 16:18:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GGIefl089854; Mon, 16 May 2011 16:18:40 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GGIeDd089851; Mon, 16 May 2011 16:18:40 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201105161618.p4GGIeDd089851@svn.freebsd.org> From: Poul-Henning Kamp Date: Mon, 16 May 2011 16:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 16:18:40 -0000 Author: phk Date: Mon May 16 16:18:40 2011 New Revision: 221993 URL: http://svn.freebsd.org/changeset/base/221993 Log: Change the length quantities of sbufs to be ssize_t rather than int. Constify a couple of arguments. Modified: head/sys/kern/subr_sbuf.c head/sys/sys/sbuf.h Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Mon May 16 15:59:50 2011 (r221992) +++ head/sys/kern/subr_sbuf.c Mon May 16 16:18:40 2011 (r221993) @@ -94,7 +94,8 @@ _assert_sbuf_integrity(const char *fun, KASSERT(s->s_buf != NULL, ("%s called with uninitialized or corrupt sbuf", fun)); KASSERT(s->s_len < s->s_size, - ("wrote past end of sbuf (%d >= %d)", s->s_len, s->s_size)); + ("wrote past end of sbuf (%jd >= %jd)", + (intmax_t)s->s_len, (intmax_t)s->s_size)); } static void @@ -255,16 +256,17 @@ sbuf_clear(struct sbuf *s) * Effectively truncates the sbuf at the new position. */ int -sbuf_setpos(struct sbuf *s, int pos) +sbuf_setpos(struct sbuf *s, ssize_t pos) { assert_sbuf_integrity(s); assert_sbuf_state(s, 0); KASSERT(pos >= 0, - ("attempt to seek to a negative position (%d)", pos)); + ("attempt to seek to a negative position (%jd)", (intmax_t)pos)); KASSERT(pos < s->s_size, - ("attempt to seek past end of sbuf (%d >= %d)", pos, s->s_size)); + ("attempt to seek past end of sbuf (%jd >= %jd)", + (intmax_t)pos, (intmax_t)s->s_size)); if (pos < 0 || pos > s->s_len) return (-1); @@ -640,7 +642,7 @@ sbuf_trim(struct sbuf *s) * Check if an sbuf has an error. */ int -sbuf_error(struct sbuf *s) +sbuf_error(const struct sbuf *s) { return (s->s_error); @@ -691,7 +693,7 @@ sbuf_data(struct sbuf *s) /* * Return the length of the sbuf data. */ -int +ssize_t sbuf_len(struct sbuf *s) { @@ -728,7 +730,7 @@ sbuf_delete(struct sbuf *s) * Check if an sbuf has been finished. */ int -sbuf_done(struct sbuf *s) +sbuf_done(const struct sbuf *s) { return (SBUF_ISFINISHED(s)); Modified: head/sys/sys/sbuf.h ============================================================================== --- head/sys/sys/sbuf.h Mon May 16 15:59:50 2011 (r221992) +++ head/sys/sys/sbuf.h Mon May 16 16:18:40 2011 (r221993) @@ -44,8 +44,8 @@ struct sbuf { sbuf_drain_func *s_drain_func; /* drain function */ void *s_drain_arg; /* user-supplied drain argument */ int s_error; /* current error code */ - int s_size; /* size of storage buffer */ - int s_len; /* current length of string */ + ssize_t s_size; /* size of storage buffer */ + ssize_t s_len; /* current length of string */ #define SBUF_FIXEDLEN 0x00000000 /* fixed length buffer (default) */ #define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */ #define SBUF_USRFLAGMSK 0x0000ffff /* mask of flags the user may specify */ @@ -63,7 +63,7 @@ struct sbuf *sbuf_new(struct sbuf *, cha #define sbuf_new_auto() \ sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND) void sbuf_clear(struct sbuf *); -int sbuf_setpos(struct sbuf *, int); +int sbuf_setpos(struct sbuf *, ssize_t); int sbuf_bcat(struct sbuf *, const void *, size_t); int sbuf_bcpy(struct sbuf *, const void *, size_t); int sbuf_cat(struct sbuf *, const char *); @@ -75,11 +75,11 @@ int sbuf_vprintf(struct sbuf *, const int sbuf_putc(struct sbuf *, int); void sbuf_set_drain(struct sbuf *, sbuf_drain_func *, void *); int sbuf_trim(struct sbuf *); -int sbuf_error(struct sbuf *); +int sbuf_error(const struct sbuf *); int sbuf_finish(struct sbuf *); char *sbuf_data(struct sbuf *); -int sbuf_len(struct sbuf *); -int sbuf_done(struct sbuf *); +ssize_t sbuf_len(struct sbuf *); +int sbuf_done(const struct sbuf *); void sbuf_delete(struct sbuf *); #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Mon May 16 17:35:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 521841065741; Mon, 16 May 2011 17:35:21 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7A9BC8FC18; Mon, 16 May 2011 17:35:19 +0000 (UTC) Received: by wyf23 with SMTP id 23so4819693wyf.13 for ; Mon, 16 May 2011 10:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=TZ2OM833kNMOtNSBqaIOQCrDwISyetbRkIalRtUJJmE=; b=kqE7SkoihWcT9MpkjmVfsca1+/epK25NoaNIq5N1H9b+pPltild46e/V7Kp8dsCgFD YmTLzXIsjtRibk/4VCAs1vgWorfrTh18pZyu4qST8tyxQbMN1xikGKMAT5LkxcNZSiD+ 0g/1mAlB/l2SUHTRzsV6E7v7MeEB+NxGQNxJQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=LjYfb3EHjMlz4HxV8bb86xwfZ04+jXmaai6csldl4y0+5Rm6A6oqdHXwF7LUW07Xuu 7ckDgIsTfBiaqcwU6daamerP6xjaKarC+yO07c7dqskbSLkxcFrlmGLI5ugIrEs/gCG1 s8WRaEXkBcRoR7jFXYAfGU3lYxnNrGz4Wnug4= MIME-Version: 1.0 Received: by 10.216.65.8 with SMTP id e8mr2529248wed.35.1305567319004; Mon, 16 May 2011 10:35:19 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.216.153.104 with HTTP; Mon, 16 May 2011 10:35:18 -0700 (PDT) In-Reply-To: <201105161618.p4GGIeDd089851@svn.freebsd.org> References: <201105161618.p4GGIeDd089851@svn.freebsd.org> Date: Mon, 16 May 2011 10:35:18 -0700 X-Google-Sender-Auth: swh-YLcOXAxsnKw9yMLqVHf06NM Message-ID: From: mdf@FreeBSD.org To: Poul-Henning Kamp Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 17:35:21 -0000 On Mon, May 16, 2011 at 9:18 AM, Poul-Henning Kamp wrote: > Author: phk > Date: Mon May 16 16:18:40 2011 > New Revision: 221993 > URL: http://svn.freebsd.org/changeset/base/221993 > > Log: > =A0Change the length quantities of sbufs to be ssize_t rather than int. Why? I don't object at all to changing the API to return ssize_t (though I see no need), but changing the struct breaks the KBI for no perceivable gain. Do we really expect someone to put more than 2GB into something that is a string buffer? Thanks, matthew > =A0Constify a couple of arguments. > > Modified: > =A0head/sys/kern/subr_sbuf.c > =A0head/sys/sys/sbuf.h > > Modified: head/sys/kern/subr_sbuf.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/kern/subr_sbuf.c =A0 Mon May 16 15:59:50 2011 =A0 =A0 =A0 = =A0(r221992) > +++ head/sys/kern/subr_sbuf.c =A0 Mon May 16 16:18:40 2011 =A0 =A0 =A0 = =A0(r221993) > @@ -94,7 +94,8 @@ _assert_sbuf_integrity(const char *fun, > =A0 =A0 =A0 =A0KASSERT(s->s_buf !=3D NULL, > =A0 =A0 =A0 =A0 =A0 =A0("%s called with uninitialized or corrupt sbuf", f= un)); > =A0 =A0 =A0 =A0KASSERT(s->s_len < s->s_size, > - =A0 =A0 =A0 =A0 =A0 ("wrote past end of sbuf (%d >=3D %d)", s->s_len, s= ->s_size)); > + =A0 =A0 =A0 =A0 =A0 ("wrote past end of sbuf (%jd >=3D %jd)", > + =A0 =A0 =A0 =A0 =A0 (intmax_t)s->s_len, (intmax_t)s->s_size)); > =A0} > > =A0static void > @@ -255,16 +256,17 @@ sbuf_clear(struct sbuf *s) > =A0* Effectively truncates the sbuf at the new position. > =A0*/ > =A0int > -sbuf_setpos(struct sbuf *s, int pos) > +sbuf_setpos(struct sbuf *s, ssize_t pos) > =A0{ > > =A0 =A0 =A0 =A0assert_sbuf_integrity(s); > =A0 =A0 =A0 =A0assert_sbuf_state(s, 0); > > =A0 =A0 =A0 =A0KASSERT(pos >=3D 0, > - =A0 =A0 =A0 =A0 =A0 ("attempt to seek to a negative position (%d)", pos= )); > + =A0 =A0 =A0 =A0 =A0 ("attempt to seek to a negative position (%jd)", (i= ntmax_t)pos)); > =A0 =A0 =A0 =A0KASSERT(pos < s->s_size, > - =A0 =A0 =A0 =A0 =A0 ("attempt to seek past end of sbuf (%d >=3D %d)", p= os, s->s_size)); > + =A0 =A0 =A0 =A0 =A0 ("attempt to seek past end of sbuf (%jd >=3D %jd)", > + =A0 =A0 =A0 =A0 =A0 (intmax_t)pos, (intmax_t)s->s_size)); > > =A0 =A0 =A0 =A0if (pos < 0 || pos > s->s_len) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (-1); > @@ -640,7 +642,7 @@ sbuf_trim(struct sbuf *s) > =A0* Check if an sbuf has an error. > =A0*/ > =A0int > -sbuf_error(struct sbuf *s) > +sbuf_error(const struct sbuf *s) > =A0{ > > =A0 =A0 =A0 =A0return (s->s_error); > @@ -691,7 +693,7 @@ sbuf_data(struct sbuf *s) > =A0/* > =A0* Return the length of the sbuf data. > =A0*/ > -int > +ssize_t > =A0sbuf_len(struct sbuf *s) > =A0{ > > @@ -728,7 +730,7 @@ sbuf_delete(struct sbuf *s) > =A0* Check if an sbuf has been finished. > =A0*/ > =A0int > -sbuf_done(struct sbuf *s) > +sbuf_done(const struct sbuf *s) > =A0{ > > =A0 =A0 =A0 =A0return (SBUF_ISFINISHED(s)); > > Modified: head/sys/sys/sbuf.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/sbuf.h Mon May 16 15:59:50 2011 =A0 =A0 =A0 =A0(r221992) > +++ head/sys/sys/sbuf.h Mon May 16 16:18:40 2011 =A0 =A0 =A0 =A0(r221993) > @@ -44,8 +44,8 @@ struct sbuf { > =A0 =A0 =A0 =A0sbuf_drain_func *s_drain_func; =A0/* drain function */ > =A0 =A0 =A0 =A0void =A0 =A0 =A0 =A0 =A0 =A0*s_drain_arg; =A0 /* user-supp= lied drain argument */ > =A0 =A0 =A0 =A0int =A0 =A0 =A0 =A0 =A0 =A0 =A0s_error; =A0 =A0 =A0 /* cur= rent error code */ > - =A0 =A0 =A0 int =A0 =A0 =A0 =A0 =A0 =A0 =A0s_size; =A0 =A0 =A0 =A0/* si= ze of storage buffer */ > - =A0 =A0 =A0 int =A0 =A0 =A0 =A0 =A0 =A0 =A0s_len; =A0 =A0 =A0 =A0 /* cu= rrent length of string */ > + =A0 =A0 =A0 ssize_t =A0 =A0 =A0 =A0 =A0s_size; =A0 =A0 =A0 =A0/* size o= f storage buffer */ > + =A0 =A0 =A0 ssize_t =A0 =A0 =A0 =A0 =A0s_len; =A0 =A0 =A0 =A0 /* curren= t length of string */ > =A0#define =A0 =A0 =A0 =A0SBUF_FIXEDLEN =A0 0x00000000 =A0 =A0 =A0/* fixe= d length buffer (default) */ > =A0#define =A0 =A0 =A0 =A0SBUF_AUTOEXTEND 0x00000001 =A0 =A0 =A0/* automa= tically extend buffer */ > =A0#define =A0 =A0 =A0 =A0SBUF_USRFLAGMSK 0x0000ffff =A0 =A0 =A0/* mask o= f flags the user may specify */ > @@ -63,7 +63,7 @@ struct sbuf =A0 *sbuf_new(struct sbuf *, cha > =A0#define =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sbuf_new_auto() =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ > =A0 =A0 =A0 =A0sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND) > =A0void =A0 =A0 =A0 =A0 =A0 =A0sbuf_clear(struct sbuf *); > -int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_setpos(struct sbuf *, int); > +int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_setpos(struct sbuf *, ssize_t); > =A0int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_bcat(struct sbuf *, const void *, siz= e_t); > =A0int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_bcpy(struct sbuf *, const void *, siz= e_t); > =A0int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_cat(struct sbuf *, const char *); > @@ -75,11 +75,11 @@ int =A0 =A0 =A0 =A0 =A0sbuf_vprintf(struct sbuf *, co= nst > =A0int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_putc(struct sbuf *, int); > =A0void =A0 =A0 =A0 =A0 =A0 =A0sbuf_set_drain(struct sbuf *, sbuf_drain_f= unc *, void *); > =A0int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_trim(struct sbuf *); > -int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_error(struct sbuf *); > +int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_error(const struct sbuf *); > =A0int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_finish(struct sbuf *); > =A0char =A0 =A0 =A0 =A0 =A0 *sbuf_data(struct sbuf *); > -int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_len(struct sbuf *); > -int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_done(struct sbuf *); > +ssize_t =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sbuf_len(struct sbuf *); > +int =A0 =A0 =A0 =A0 =A0 =A0 sbuf_done(const struct sbuf *); > =A0void =A0 =A0 =A0 =A0 =A0 =A0sbuf_delete(struct sbuf *); > > =A0#ifdef _KERNEL > From owner-svn-src-head@FreeBSD.ORG Mon May 16 17:41:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id D00B7106566C; Mon, 16 May 2011 17:41:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: benl@freebsd.org Date: Mon, 16 May 2011 13:41:16 -0400 User-Agent: KMail/1.6.2 References: <201105141744.p4EHiCpx010486@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105161341.28460.jkim@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, simon@freebsd.org, "Bjoern A. Zeeb" , Colin Percival , svn-src-head@freebsd.org Subject: Re: svn commit: r221900 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 17:41:41 -0000 On Sunday 15 May 2011 12:19 am, Bjoern A. Zeeb wrote: > On Sat, 14 May 2011, Colin Percival wrote: > > Author: cperciva > > Date: Sat May 14 17:44:12 2011 > > New Revision: 221900 > > URL: http://svn.freebsd.org/changeset/base/221900 > > > > Log: > > Encourage Ben Laurie to finish getting his commit bit by > > appointing him as the OpenSSL maintainer. > > I'd like to thanks Simon for doing this all the years! Great job! > > I am also happy Ben volunteered to pick up the task:) Great to > have you doing this for FreeBSD! +1. Here is my first contribution (against head): http://people.freebsd.org/~jkim/openssl-head.diff Changes: 1. Fix amd64 asm generators. http://rt.openssl.org/Ticket/Display.html?id=2466&user=guest&pass=guest 2. Generate amd64 asm files and connect to build. 3. Regen i386 asm files and add new ones (except for sha512-sse2.s). 4. Regen opensslconf-${ARCH}.h to reduce diff against 'config' script generated files. This patch was "make universe" tested couple of weeks ago. :-) Cheers, Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon May 16 19:39:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 108F7106564A; Mon, 16 May 2011 19:39:03 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A2CE48FC1C; Mon, 16 May 2011 19:39:02 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 0835A45E48; Mon, 16 May 2011 21:39:00 +0200 (CEST) Received: from localhost (unknown [209.226.201.250]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 5616845CD9; Mon, 16 May 2011 21:38:54 +0200 (CEST) Date: Mon, 16 May 2011 21:38:33 +0200 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20110516193833.GA2020@garage.freebsd.pl> References: <201105161618.p4GGIeDd089851@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: <201105161618.p4GGIeDd089851@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=4.5 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 19:39:03 -0000 --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 16, 2011 at 04:18:40PM +0000, Poul-Henning Kamp wrote: > Author: phk > Date: Mon May 16 16:18:40 2011 > New Revision: 221993 > URL: http://svn.freebsd.org/changeset/base/221993 >=20 > Log: > Change the length quantities of sbufs to be ssize_t rather than int. > =20 > Constify a couple of arguments. >=20 > Modified: > head/sys/kern/subr_sbuf.c > head/sys/sys/sbuf.h >=20 > Modified: head/sys/kern/subr_sbuf.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/kern/subr_sbuf.c Mon May 16 15:59:50 2011 (r221992) > +++ head/sys/kern/subr_sbuf.c Mon May 16 16:18:40 2011 (r221993) > @@ -94,7 +94,8 @@ _assert_sbuf_integrity(const char *fun,=20 > KASSERT(s->s_buf !=3D NULL, > ("%s called with uninitialized or corrupt sbuf", fun)); > KASSERT(s->s_len < s->s_size, > - ("wrote past end of sbuf (%d >=3D %d)", s->s_len, s->s_size)); > + ("wrote past end of sbuf (%jd >=3D %jd)", > + (intmax_t)s->s_len, (intmax_t)s->s_size)); For ssize_t we have %zd. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --9amGYk9869ThD9tj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk3RfTkACgkQForvXbEpPzSyBgCgvZzTCNA2wXUn00ySLXqQY4s8 zUMAni1QLMW/QGk/hOimxV/zx5Z8zKxj =dQt2 -----END PGP SIGNATURE----- --9amGYk9869ThD9tj-- From owner-svn-src-head@FreeBSD.ORG Mon May 16 20:47:09 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AACAC1065673; Mon, 16 May 2011 20:47:09 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 69D818FC1F; Mon, 16 May 2011 20:47:09 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 3F9BC5E08; Mon, 16 May 2011 20:27:12 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p4GKRBHO020915; Mon, 16 May 2011 20:27:11 GMT (envelope-from phk@critter.freebsd.dk) To: Pawel Jakub Dawidek From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 16 May 2011 21:38:33 +0200." <20110516193833.GA2020@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1 Date: Mon, 16 May 2011 20:27:11 +0000 Message-ID: <20914.1305577631@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 20:47:09 -0000 In message <20110516193833.GA2020@garage.freebsd.pl>, Pawel Jakub Dawidek write s: >> - ("wrote past end of sbuf (%d >=3D %d)", s->s_len, s->s_size)); >> + ("wrote past end of sbuf (%jd >=3D %jd)", >> + (intmax_t)s->s_len, (intmax_t)s->s_size)); > >For ssize_t we have %zd. Yes I know, but sbufs are used on platforms where %z is not available so I prefer to use %jd, in particular since this is only assert strings. Poul-Henning -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Mon May 16 20:47:09 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC361065674; Mon, 16 May 2011 20:47:09 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 69DC28FC23; Mon, 16 May 2011 20:47:09 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id AAFDB5E2F; Mon, 16 May 2011 20:29:02 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p4GKT2rU020926; Mon, 16 May 2011 20:29:02 GMT (envelope-from phk@critter.freebsd.dk) To: mdf@FreeBSD.org From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 16 May 2011 10:35:18 MST." Content-Type: text/plain; charset=ISO-8859-1 Date: Mon, 16 May 2011 20:29:02 +0000 Message-ID: <20925.1305577742@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 20:47:09 -0000 In message , mdf@FreeBSD.or g writes: >> Log: >> Change the length quantities of sbufs to be ssize_t rather than int. > >Why? > >Do we really expect someone to put more than 2GB >into something that is a string buffer? That is exactly why I am doing it. sbufs have gained a life outside FreeBSD, and while that particular implementation has different internals, I would prefer if we can keep the API unified across platforms. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Mon May 16 21:20:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B455106564A; Mon, 16 May 2011 21:20:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id CCF088FC08; Mon, 16 May 2011 21:20:02 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p4GLJtqL088494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 May 2011 00:19:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p4GLJtaB038080; Tue, 17 May 2011 00:19:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p4GLJsB2038079; Tue, 17 May 2011 00:19:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 17 May 2011 00:19:54 +0300 From: Kostik Belousov To: Poul-Henning Kamp Message-ID: <20110516211954.GJ48734@deviant.kiev.zoral.com.ua> References: <201105161618.p4GGIeDd089851@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="caqKA7PbDQ8UCDMt" Content-Disposition: inline In-Reply-To: <201105161618.p4GGIeDd089851@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 21:20:06 -0000 --caqKA7PbDQ8UCDMt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 16, 2011 at 04:18:40PM +0000, Poul-Henning Kamp wrote: > Author: phk > Date: Mon May 16 16:18:40 2011 > New Revision: 221993 > URL: http://svn.freebsd.org/changeset/base/221993 >=20 > Log: > Change the length quantities of sbufs to be ssize_t rather than int. > =20 > Constify a couple of arguments. > Modified: head/sys/sys/sbuf.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/sbuf.h Mon May 16 15:59:50 2011 (r221992) > +++ head/sys/sys/sbuf.h Mon May 16 16:18:40 2011 (r221993) > @@ -44,8 +44,8 @@ struct sbuf { > sbuf_drain_func *s_drain_func; /* drain function */ > void *s_drain_arg; /* user-supplied drain argument */ > int s_error; /* current error code */ > - int s_size; /* size of storage buffer */ > - int s_len; /* current length of string */ > + ssize_t s_size; /* size of storage buffer */ > + ssize_t s_len; /* current length of string */ struct sbuf is exposed to the libsubf.so consumers. I think that libsbuf.so version shall be bumped (since no symver compat can be provided, due to lack of versioning for libsbuf). The bump was also needed after the r212367. Lets do one for two changes. --caqKA7PbDQ8UCDMt Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3RlPoACgkQC3+MBN1Mb4iIBgCeJSB3gUmIawqR1JVgD4NUsnN4 elAAn08V8lylLUlcopYiAcR59LuMn/5U =viEz -----END PGP SIGNATURE----- --caqKA7PbDQ8UCDMt-- From owner-svn-src-head@FreeBSD.ORG Mon May 16 21:47:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EB29106564A; Mon, 16 May 2011 21:47:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 359BB8FC1D; Mon, 16 May 2011 21:47:42 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id C824346B0A; Mon, 16 May 2011 17:47:41 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3D8018A050; Mon, 16 May 2011 17:47:41 -0400 (EDT) From: John Baldwin To: "Poul-Henning Kamp" Date: Mon, 16 May 2011 17:47:40 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <20914.1305577631@critter.freebsd.dk> In-Reply-To: <20914.1305577631@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105161747.40824.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 16 May 2011 17:47:41 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 21:47:42 -0000 On Monday, May 16, 2011 4:27:11 pm Poul-Henning Kamp wrote: > In message <20110516193833.GA2020@garage.freebsd.pl>, Pawel Jakub Dawidek write > s: > > >> - ("wrote past end of sbuf (%d >=3D %d)", s->s_len, s->s_size)); > >> + ("wrote past end of sbuf (%jd >=3D %jd)", > >> + (intmax_t)s->s_len, (intmax_t)s->s_size)); > > > >For ssize_t we have %zd. > > Yes I know, but sbufs are used on platforms where %z is not available > so I prefer to use %jd, in particular since this is only assert strings. Really? They have %j but not %z? intmax_t is newer than size_t. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon May 16 23:04:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 8C178106564A; Mon, 16 May 2011 23:04:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: benl@freebsd.org Date: Mon, 16 May 2011 19:04:31 -0400 User-Agent: KMail/1.6.2 References: <201105141744.p4EHiCpx010486@svn.freebsd.org> <201105161341.28460.jkim@FreeBSD.org> In-Reply-To: <201105161341.28460.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105161904.33216.jkim@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, simon@freebsd.org, "Bjoern A. Zeeb" , Colin Percival , svn-src-head@freebsd.org Subject: Re: svn commit: r221900 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 23:04:38 -0000 On Monday 16 May 2011 01:41 pm, Jung-uk Kim wrote: > On Sunday 15 May 2011 12:19 am, Bjoern A. Zeeb wrote: > > On Sat, 14 May 2011, Colin Percival wrote: > > > Author: cperciva > > > Date: Sat May 14 17:44:12 2011 > > > New Revision: 221900 > > > URL: http://svn.freebsd.org/changeset/base/221900 > > > > > > Log: > > > Encourage Ben Laurie to finish getting his commit bit by > > > appointing him as the OpenSSL maintainer. > > > > I'd like to thanks Simon for doing this all the years! Great job! > > > > I am also happy Ben volunteered to pick up the task:) Great to > > have you doing this for FreeBSD! > > +1. > > Here is my first contribution (against head): > > http://people.freebsd.org/~jkim/openssl-head.diff I forgot to do svn add amd64 asm files. :-( Complete patch is available from the same URL now. Sorry, Jung-uk Kim > Changes: > > 1. Fix amd64 asm generators. > http://rt.openssl.org/Ticket/Display.html?id=2466&user=guest&pass=g >uest 2. Generate amd64 asm files and connect to build. > 3. Regen i386 asm files and add new ones (except for > sha512-sse2.s). 4. Regen opensslconf-${ARCH}.h to reduce diff > against 'config' script generated files. > > This patch was "make universe" tested couple of weeks ago. :-) > > Cheers, > > Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon May 16 23:20:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30457106566B; Mon, 16 May 2011 23:20:13 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 205028FC13; Mon, 16 May 2011 23:20:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GNKDbB003009; Mon, 16 May 2011 23:20:13 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GNKCuN003005; Mon, 16 May 2011 23:20:12 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105162320.p4GNKCuN003005@svn.freebsd.org> From: Attilio Rao Date: Mon, 16 May 2011 23:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222001 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 23:20:13 -0000 Author: attilio Date: Mon May 16 23:20:12 2011 New Revision: 222001 URL: http://svn.freebsd.org/changeset/base/222001 Log: Merge r221278 from largeSMP project: idle_cpus_mask is just used in sched_4bsd, thus make it private for it. Tested by: several Modified: head/sys/kern/sched_4bsd.c head/sys/kern/subr_smp.c head/sys/sys/smp.h Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Mon May 16 19:29:58 2011 (r222000) +++ head/sys/kern/sched_4bsd.c Mon May 16 23:20:12 2011 (r222001) @@ -155,6 +155,8 @@ static struct runq runq; */ static struct runq runq_pcpu[MAXCPU]; long runq_length[MAXCPU]; + +static cpumask_t idle_cpus_mask; #endif struct pcpuidlestat { Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Mon May 16 19:29:58 2011 (r222000) +++ head/sys/kern/subr_smp.c Mon May 16 23:20:12 2011 (r222001) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #ifdef SMP volatile cpumask_t stopped_cpus; volatile cpumask_t started_cpus; -cpumask_t idle_cpus_mask; cpumask_t hlt_cpus_mask; cpumask_t logical_cpus_mask; Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Mon May 16 19:29:58 2011 (r222000) +++ head/sys/sys/smp.h Mon May 16 23:20:12 2011 (r222001) @@ -73,7 +73,6 @@ extern int smp_active; extern int smp_cpus; extern volatile cpumask_t started_cpus; extern volatile cpumask_t stopped_cpus; -extern cpumask_t idle_cpus_mask; extern cpumask_t hlt_cpus_mask; extern cpumask_t logical_cpus_mask; #endif /* SMP */ From owner-svn-src-head@FreeBSD.ORG Mon May 16 23:35:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E14291065673; Mon, 16 May 2011 23:35:14 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1D9A8FC0C; Mon, 16 May 2011 23:35:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GNZEva003509; Mon, 16 May 2011 23:35:14 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GNZEUV003507; Mon, 16 May 2011 23:35:14 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105162335.p4GNZEUV003507@svn.freebsd.org> From: Attilio Rao Date: Mon, 16 May 2011 23:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222002 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 23:35:15 -0000 Author: attilio Date: Mon May 16 23:35:14 2011 New Revision: 222002 URL: http://svn.freebsd.org/changeset/base/222002 Log: Merge r221279,221280 from largeSMP project: pmc_mask doesn't need to use memory barriers. Reviewed by: fabient Tested by: several MFC after: 1 week Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon May 16 23:20:12 2011 (r222001) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon May 16 23:35:14 2011 (r222002) @@ -4083,7 +4083,7 @@ pmc_process_interrupt(int cpu, struct pm done: /* mark CPU as needing processing */ - atomic_set_rel_int(&pmc_cpumask, (1 << cpu)); + atomic_set_int(&pmc_cpumask, (1 << cpu)); return (error); } @@ -4193,7 +4193,7 @@ pmc_process_samples(int cpu) break; if (ps->ps_nsamples == PMC_SAMPLE_INUSE) { /* Need a rescan at a later time. */ - atomic_set_rel_int(&pmc_cpumask, (1 << cpu)); + atomic_set_int(&pmc_cpumask, (1 << cpu)); break; } @@ -4782,7 +4782,7 @@ pmc_cleanup(void) PMCDBG(MOD,INI,0, "%s", "cleanup"); /* switch off sampling */ - atomic_store_rel_int(&pmc_cpumask, 0); + pmc_cpumask = 0; pmc_intr = NULL; sx_xlock(&pmc_sx); From owner-svn-src-head@FreeBSD.ORG Tue May 17 00:40:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDAE91065690; Tue, 17 May 2011 00:40:11 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE89A8FC17; Tue, 17 May 2011 00:40:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H0eBaj005450; Tue, 17 May 2011 00:40:11 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4H0eB19005448; Tue, 17 May 2011 00:40:11 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201105170040.p4H0eB19005448@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 17 May 2011 00:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222003 - head/sys/dev/cxgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 00:40:12 -0000 Author: np Date: Tue May 17 00:40:11 2011 New Revision: 222003 URL: http://svn.freebsd.org/changeset/base/222003 Log: Add missing header. The test for VLAN_CAPABILITIES later in the file doesn't make sense without it. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon May 16 23:35:14 2011 (r222002) +++ head/sys/dev/cxgbe/t4_main.c Tue May 17 00:40:11 2011 (r222003) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "common/t4_hw.h" #include "common/common.h" From owner-svn-src-head@FreeBSD.ORG Tue May 17 03:49:10 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8F83106564A; Tue, 17 May 2011 03:49:10 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 86C148FC08; Tue, 17 May 2011 03:49:10 +0000 (UTC) Received: from dhcp-192-168-2-22.wifi.xcllnt.net (atm.xcllnt.net [70.36.220.6]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p4H3n3W4094901 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 16 May 2011 20:49:09 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4DD00C8F.1020700@FreeBSD.org> Date: Mon, 16 May 2011 20:49:02 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201105151145.p4FBjDVR038539@svn.freebsd.org> <7B2294F7-8383-42F2-8127-759DBCD3540A@xcllnt.net> <4DCFF0D5.3080309@FreeBSD.org> <4DD00C8F.1020700@FreeBSD.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221952 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 03:49:10 -0000 On May 15, 2011, at 10:25 AM, Andrey V. Elsukov wrote: > >> As I said: I'm fine with the change, but please assess the >> consequences of dropping the fall-back, for it may be better >> to make this change on -current after 9-stable branched and >> without the MFC. > > So, would you like to revert this change? No. If you think it's ok, then I'm fine with it. FYI, -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Tue May 17 06:16:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDB10106564A; Tue, 17 May 2011 06:16:04 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 7B1E38FC08; Tue, 17 May 2011 06:16:04 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 15D675DC0; Tue, 17 May 2011 06:16:03 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p4H6G2Yd022628; Tue, 17 May 2011 06:16:02 GMT (envelope-from phk@critter.freebsd.dk) To: Kostik Belousov From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 17 May 2011 00:19:54 +0300." <20110516211954.GJ48734@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1 Date: Tue, 17 May 2011 06:16:02 +0000 Message-ID: <22627.1305612962@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 06:16:04 -0000 In message <20110516211954.GJ48734@deviant.kiev.zoral.com.ua>, Kostik Belousov writes: >The bump was also needed after the r212367. Lets do one for two changes. I have a few more changes coming, before the bump should happen. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Tue May 17 06:16:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FBE310656D7; Tue, 17 May 2011 06:16:36 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 5B3798FC16; Tue, 17 May 2011 06:16:36 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 6D7BC5DC0; Tue, 17 May 2011 06:16:35 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p4H6GZBl022639; Tue, 17 May 2011 06:16:35 GMT (envelope-from phk@critter.freebsd.dk) To: John Baldwin From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 16 May 2011 17:47:40 -0400." <201105161747.40824.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Date: Tue, 17 May 2011 06:16:35 +0000 Message-ID: <22638.1305612995@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 06:16:36 -0000 In message <201105161747.40824.jhb@freebsd.org>, John Baldwin writes: >> Yes I know, but sbufs are used on platforms where %z is not available >> so I prefer to use %jd, in particular since this is only assert strings. > >Really? They have %j but not %z? intmax_t is newer than size_t. Appearantly. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Tue May 17 06:36:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA99F106564A; Tue, 17 May 2011 06:36:32 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE6A88FC13; Tue, 17 May 2011 06:36:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H6aWcm016433; Tue, 17 May 2011 06:36:32 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4H6aWtF016431; Tue, 17 May 2011 06:36:32 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201105170636.p4H6aWtF016431@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 17 May 2011 06:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222004 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 06:36:33 -0000 Author: phk Date: Tue May 17 06:36:32 2011 New Revision: 222004 URL: http://svn.freebsd.org/changeset/base/222004 Log: Don't expect PAGE_SIZE to exist on all platforms (It is a pretty arbitrary choice of default size in the first place) Reverse the order of arguments to the internal static sbuf_put_byte() function to match everything else in this file. Move sbuf_putc_func() inside the kernel version of sbuf_vprintf where it belongs. sbuf_putc() incorrectly used sbuf_putc_func() which supress NUL characters, it should use sbuf_put_byte(). Make sbuf_finish() return -1 on error. Minor stylistic nits fixed. Modified: head/sys/kern/subr_sbuf.c Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Tue May 17 00:40:11 2011 (r222003) +++ head/sys/kern/subr_sbuf.c Tue May 17 06:36:32 2011 (r222004) @@ -67,7 +67,7 @@ static MALLOC_DEFINE(M_SBUF, "sbuf", "st #define SBUF_ISDYNSTRUCT(s) ((s)->s_flags & SBUF_DYNSTRUCT) #define SBUF_ISFINISHED(s) ((s)->s_flags & SBUF_FINISHED) #define SBUF_HASROOM(s) ((s)->s_len < (s)->s_size - 1) -#define SBUF_FREESPACE(s) ((s)->s_size - (s)->s_len - 1) +#define SBUF_FREESPACE(s) ((s)->s_size - ((s)->s_len + 1)) #define SBUF_CANEXTEND(s) ((s)->s_flags & SBUF_AUTOEXTEND) /* @@ -77,8 +77,14 @@ static MALLOC_DEFINE(M_SBUF, "sbuf", "st #define SBUF_CLEARFLAG(s, f) do { (s)->s_flags &= ~(f); } while (0) #define SBUF_MINEXTENDSIZE 16 /* Should be power of 2. */ + +#ifdef PAGE_SIZE #define SBUF_MAXEXTENDSIZE PAGE_SIZE #define SBUF_MAXEXTENDINCR PAGE_SIZE +#else +#define SBUF_MAXEXTENDSIZE 4096 +#define SBUF_MAXEXTENDINCR 4096 +#endif /* * Debugging support @@ -328,7 +334,7 @@ sbuf_drain(struct sbuf *s) * buffer and marking overflow. */ static void -sbuf_put_byte(int c, struct sbuf *s) +sbuf_put_byte(struct sbuf *s, int c) { assert_sbuf_integrity(s); @@ -337,7 +343,7 @@ sbuf_put_byte(int c, struct sbuf *s) if (s->s_error != 0) return; if (SBUF_FREESPACE(s) <= 0) { - /* + /* * If there is a drain, use it, otherwise extend the * buffer. */ @@ -352,18 +358,6 @@ sbuf_put_byte(int c, struct sbuf *s) } /* - * Append a non-NUL character to an sbuf. This prototype signature is - * suitable for use with kvprintf(9). - */ -static void -sbuf_putc_func(int c, void *arg) -{ - - if (c != '\0') - sbuf_put_byte(c, arg); -} - -/* * Append a byte string to an sbuf. */ int @@ -378,10 +372,10 @@ sbuf_bcat(struct sbuf *s, const void *bu if (s->s_error != 0) return (-1); for (; str < end; str++) { - sbuf_put_byte(*str, s); + sbuf_put_byte(s, *str); if (s->s_error != 0) return (-1); - } + } return (0); } @@ -443,7 +437,7 @@ sbuf_cat(struct sbuf *s, const char *str return (-1); while (*str != '\0') { - sbuf_put_byte(*str++, s); + sbuf_put_byte(s, *str++); if (s->s_error != 0) return (-1); } @@ -507,6 +501,19 @@ sbuf_cpy(struct sbuf *s, const char *str * Format the given argument list and append the resulting string to an sbuf. */ #ifdef _KERNEL + +/* + * Append a non-NUL character to an sbuf. This prototype signature is + * suitable for use with kvprintf(9). + */ +static void +sbuf_putc_func(int c, void *arg) +{ + + if (c != '\0') + sbuf_put_byte(arg, c); +} + int sbuf_vprintf(struct sbuf *s, const char *fmt, va_list ap) { @@ -611,7 +618,7 @@ int sbuf_putc(struct sbuf *s, int c) { - sbuf_putc_func(c, s); + sbuf_put_byte(s, c); if (s->s_error != 0) return (-1); return (0); @@ -654,24 +661,23 @@ sbuf_error(const struct sbuf *s) int sbuf_finish(struct sbuf *s) { - int error; assert_sbuf_integrity(s); assert_sbuf_state(s, 0); - error = s->s_error; if (s->s_drain_func != NULL) { - while (s->s_len > 0 && error == 0) - error = sbuf_drain(s); + while (s->s_len > 0 && s->s_error == 0) + s->s_error = sbuf_drain(s); } s->s_buf[s->s_len] = '\0'; - s->s_error = 0; SBUF_SETFLAG(s, SBUF_FINISHED); #ifdef _KERNEL - return (error); + return (s->s_error); #else - errno = error; - return (-1); + errno = s->s_error; + if (s->s_error) + return (-1); + return (0); #endif } From owner-svn-src-head@FreeBSD.ORG Tue May 17 07:40:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09BBB1065677; Tue, 17 May 2011 07:40:14 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED1BA8FC36; Tue, 17 May 2011 07:40:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H7eD1I018413; Tue, 17 May 2011 07:40:13 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4H7eD4A018410; Tue, 17 May 2011 07:40:13 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201105170740.p4H7eD4A018410@svn.freebsd.org> From: Hiroki Sato Date: Tue, 17 May 2011 07:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222007 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 07:40:14 -0000 Author: hrs Date: Tue May 17 07:40:13 2011 New Revision: 222007 URL: http://svn.freebsd.org/changeset/base/222007 Log: Remove redundant keywords. Submitted by: wxs Modified: head/etc/rc.d/ipfilter head/etc/rc.d/pf Modified: head/etc/rc.d/ipfilter ============================================================================== --- head/etc/rc.d/ipfilter Tue May 17 07:16:35 2011 (r222006) +++ head/etc/rc.d/ipfilter Tue May 17 07:40:13 2011 (r222007) @@ -23,7 +23,7 @@ resync_precmd="$stop_precmd" resync_cmd="ipfilter_resync" status_precmd="$stop_precmd" status_cmd="ipfilter_status" -extra_commands="reload resync status" +extra_commands="reload resync" required_modules="ipl:ipfilter" ipfilter_start() Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Tue May 17 07:16:35 2011 (r222006) +++ head/etc/rc.d/pf Tue May 17 07:40:13 2011 (r222007) @@ -19,7 +19,7 @@ check_cmd="pf_check" reload_cmd="pf_reload" resync_cmd="pf_resync" status_cmd="pf_status" -extra_commands="check reload resync status" +extra_commands="check reload resync" required_files="$pf_rules" required_modules="pf" From owner-svn-src-head@FreeBSD.ORG Tue May 17 08:12:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 800D21065679; Tue, 17 May 2011 08:12:59 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6466B8FC12; Tue, 17 May 2011 08:12:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H8Cx9i019472; Tue, 17 May 2011 08:12:59 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4H8CxPw019470; Tue, 17 May 2011 08:12:59 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201105170812.p4H8CxPw019470@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 17 May 2011 08:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222008 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 08:12:59 -0000 Author: uqs Date: Tue May 17 08:12:59 2011 New Revision: 222008 URL: http://svn.freebsd.org/changeset/base/222008 Log: Typos, wording and mdoc fixes. Modified: head/share/man/man4/geom_map.4 Modified: head/share/man/man4/geom_map.4 ============================================================================== --- head/share/man/man4/geom_map.4 Tue May 17 07:40:13 2011 (r222007) +++ head/share/man/man4/geom_map.4 Tue May 17 08:12:59 2011 (r222008) @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm geom_map -.Nd "GEOM module that map difined items as separate partitions" +.Nd "GEOM module that maps defined items as separate partitions" .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your @@ -41,16 +41,16 @@ kernel configuration file: .Sh DESCRIPTION The .Nm -framework provides support for mapping defined parts of the media. Basicaly it -is helpful in the embedded devices where in the one continous flash are loader, -kernel and rootfs parts. The +framework provides support for mapping defined parts of the media. +Basically it is helpful for embedded devices where in the one continuous +flash are loader, kernel and rootfs parts. .Nm -allows making them available as separate parts and protect loader from -overwriting. +allows making them available as separate parts and protects the loader from +being overwritten. .Pp At boot time .Nm -partitions listed (only with bootverbose) as: +partitions are listed (only with bootverbose) as: .Bd -literal -offset indent MAP: 0x30000, data=0x30000 "/dev/map/bootloader" MAP: 30000x10000, data=0x10000 "/dev/map/factory" @@ -62,10 +62,12 @@ MAP: 150000x690000, data=0x690000 "/dev/ MAP: 7e0000x20000, data=0x20000 "/dev/map/config" .Ed .Pp -Also +The current .Nm -current configuration can be accessible with sysctl's kern.geom.conftxt, -kern.geom.confxml, kern.geom.confdot or geom map list. +configuration can be accessed with the following +.Xr sysctl 8 +nodes: kern.geom.conftxt, kern.geom.confxml, and kern.geom.confdot +or by using "geom map list". .Bd -literal -offset indent # sysctl kern.geom.conftxt kern.geom.conftxt: 0 MD md0 10485760 512 u 0 s 512 f 0 fs 0 l 10485760 t malloc @@ -84,7 +86,7 @@ Driver configuration can be done in devi .It Fa at select media to attach .It Fa name -name of partiton (will create device /dev/map/that_name) +name of partition (will create device /dev/map/that_name) .It Fa start offset from the beginning of the parent media to start of the mapped partition. This field can also have special value @@ -119,9 +121,7 @@ MAP: 150000x690000, data=0x690000 "/dev/ "map/rootfs" - new media will be accessible via /dev/map/rootfs dev. .Ed .Sh EXAMPLES -.Pp -.Bl -bullet -compact -If we need to implement layout shown above, we need to define the folowing +If we need to implement layout shown above, we need to define the following hints: .Bd -literal -offset indent hint.map.0.at="cfid0" @@ -129,8 +129,8 @@ hint.map.0.start=0x00000000 hint.map.0.end=0x00030000 hint.map.0.name="bootloader" hint.map.0.readonly=1 - .Ed +.Pp define "/dev/map/bootloader" at disk "cfid0" starting at 0x00000000 and end 0x00030000, also marked as readonly. .Bd -literal -offset indent @@ -148,8 +148,8 @@ hint.map.3.at="cfid0" hint.map.3.name="kernel" hint.map.3.start=0x00040000 hint.map.3.end="search:0x00100000:0x10000:.!/bin/sh" - .Ed +.Pp define "/dev/map/kernel" at disk "cfid0" starting at 0x00040000, but end position must be searched by the key ".!/bin/sh", from offset 0x00100000 to end of media with step 0x10000. Real marker in that case is "#!/bin/sh", but "#" @@ -166,7 +166,6 @@ hint.map.5.start=0x007e0000 hint.map.5.end=0x00800000 hint.map.5.name="config" .Ed -.El .Sh SEE ALSO .Xr GEOM 4 , .Xr geom 8 , From owner-svn-src-head@FreeBSD.ORG Tue May 17 08:13:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E9781065675; Tue, 17 May 2011 08:13:10 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D9B08FC1B; Tue, 17 May 2011 08:13:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H8DAAM019518; Tue, 17 May 2011 08:13:10 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4H8DA7p019516; Tue, 17 May 2011 08:13:10 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201105170813.p4H8DA7p019516@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 17 May 2011 08:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222009 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 08:13:10 -0000 Author: uqs Date: Tue May 17 08:13:10 2011 New Revision: 222009 URL: http://svn.freebsd.org/changeset/base/222009 Log: Typo fix. Modified: head/share/man/man4/cc_hd.4 Modified: head/share/man/man4/cc_hd.4 ============================================================================== --- head/share/man/man4/cc_hd.4 Tue May 17 08:12:59 2011 (r222008) +++ head/share/man/man4/cc_hd.4 Tue May 17 08:13:10 2011 (r222009) @@ -98,7 +98,7 @@ Community Foundation Silicon Valley. .Sh FUTURE WORK The Hamilton Institute have recently made some improvements to the algorithm implemented by this module and have called it Coexistent-TCP (C-TCP). -The improvments should be evaluated and potentially incorporated into this +The improvements should be evaluated and potentially incorporated into this module. .Sh HISTORY The From owner-svn-src-head@FreeBSD.ORG Tue May 17 08:13:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66BFE106564A; Tue, 17 May 2011 08:13:19 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B10D8FC15; Tue, 17 May 2011 08:13:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H8DJ51019561; Tue, 17 May 2011 08:13:19 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4H8DJfU019559; Tue, 17 May 2011 08:13:19 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201105170813.p4H8DJfU019559@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 17 May 2011 08:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222010 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 08:13:19 -0000 Author: uqs Date: Tue May 17 08:13:18 2011 New Revision: 222010 URL: http://svn.freebsd.org/changeset/base/222010 Log: Whitespace and typo fixes. Found by: codespell Reviewed by: ru Modified: head/share/misc/iso3166 Modified: head/share/misc/iso3166 ============================================================================== --- head/share/misc/iso3166 Tue May 17 08:13:10 2011 (r222009) +++ head/share/misc/iso3166 Tue May 17 08:13:18 2011 (r222010) @@ -395,7 +395,7 @@ ZW ZWE 716 Zimbabwe # Newsletter III-41 1993-07-28 # MAURITIUS, changes outside this document # -# Newletter III-42 1993-07-12 +# Newsletter III-42 1993-07-12 # SAINT VINCENT AND THE GRENADINES, changes outside this document # # Newsletter III-43 1993-07-12 @@ -426,15 +426,15 @@ ZW ZWE 716 Zimbabwe # Czechoslovakia officially deleted # # Newsletter III-52, 1993-07-02 -# Angola, changing information not included in this file. Offical name +# Angola, changing information not included in this file. Official name # change to Republic of Angola # # Newsletter III-53, 1993-07-12 -# Madagascar, changing information not included in this file. Official +# Madagascar, changing information not included in this file. Official # name change to Republic of Madagascar # # Newsletter III-54, 1993-07-23 -# South Georgia and the South Sandwich Islands, previously covered by +# South Georgia and the South Sandwich Islands, previously covered by # Falkland Islands # # Newsletter III-55, 1993-07-16 @@ -450,23 +450,23 @@ ZW ZWE 716 Zimbabwe # # Newsletter III-58, 1993-07-16 # Afghanistan, changing information not included in this file -# Official name change to Islamic State of Afghanistan +# Official name change to Islamic State of Afghanistan # -# Newsletter III-32, 1993-07-25 ammendment -# Kyrgyzstan, changing information not included in this file. Offical name +# Newsletter III-32, 1993-07-25 amendment +# Kyrgyzstan, changing information not included in this file. Official name # change to Kyrgyz Republic # # Newsletter III-59, 1994-01-26 -# Andorra, changing information not included in this file. Offical name +# Andorra, changing information not included in this file. Official name # change to Pricipality of Andorra # # Newsletter III-60, 1994-01-26 -# Cambodia, changing information not included in this file. Offical name +# Cambodia, changing information not included in this file. Official name # change to Kingdom of Cambodia # # Thu Feb 10 1994 # At this point the fourth edition of ISO 3166 appears. It can *now* be -# ordered from national standards institutions. The RIPE NCC will continue +# ordered from national standards institutions. The RIPE NCC will continue # tracking changes. # # [deletia] From owner-svn-src-head@FreeBSD.ORG Tue May 17 08:13:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2017410657AC; Tue, 17 May 2011 08:13:28 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E90A48FC1D; Tue, 17 May 2011 08:13:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H8DRrJ019602; Tue, 17 May 2011 08:13:27 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4H8DR4X019600; Tue, 17 May 2011 08:13:27 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201105170813.p4H8DR4X019600@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 17 May 2011 08:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222011 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 08:13:28 -0000 Author: uqs Date: Tue May 17 08:13:27 2011 New Revision: 222011 URL: http://svn.freebsd.org/changeset/base/222011 Log: ISO3166: Update for newsletters VI-7 and VI-8 from 2010 - Name change for SH - BQ, CW, and SX replace AN Reviewed by: ru Modified: head/share/misc/iso3166 Modified: head/share/misc/iso3166 ============================================================================== --- head/share/misc/iso3166 Tue May 17 08:13:18 2011 (r222010) +++ head/share/misc/iso3166 Tue May 17 08:13:27 2011 (r222011) @@ -46,6 +46,7 @@ BJ BEN 204 Benin BM BMU 060 Bermuda BT BTN 064 Bhutan BO BOL 068 Bolivia, Plurinational State of +BQ BES 535 Bonaire, Saint Eustatius and Saba BA BIH 070 Bosnia and Herzegovina BW BWA 072 Botswana BV BVT 074 Bouvet Island @@ -75,6 +76,7 @@ CR CRI 188 Costa Rica CI CIV 384 Cote d'Ivoire HR HRV 191 Croatia CU CUB 192 Cuba +CW CUW 531 Curacao CY CYP 196 Cyprus CZ CZE 203 Czech Republic DK DNK 208 Denmark @@ -174,7 +176,6 @@ NA NAM 516 Namibia NR NRU 520 Nauru NP NPL 524 Nepal NL NLD 528 Netherlands -AN ANT 530 Netherlands Antilles NC NCL 540 New Caledonia NZ NZL 554 New Zealand NI NIC 558 Nicaragua @@ -216,6 +217,7 @@ RS SRB 688 Serbia SC SYC 690 Seychelles SL SLE 694 Sierra Leone SG SGP 702 Singapore +SX SXM 534 Sint Maarten (Dutch part) SK SVK 703 Slovakia SI SVN 705 Slovenia SB SLB 090 Solomon Islands @@ -224,7 +226,7 @@ ZA ZAF 710 South Africa GS SGS 239 South Georgia and the South Sandwich Islands ES ESP 724 Spain LK LKA 144 Sri Lanka -SH SHN 654 Saint Helena +SH SHN 654 Saint Helena, Ascension and Tristan da Cunha PM SPM 666 Saint Pierre and Miquelon SD SDN 736 Sudan SR SUR 740 Suriname @@ -537,3 +539,11 @@ ZW ZWE 716 Zimbabwe # # Newsletter VI-6 2009-05-08 # Name change for Plurinational State of Bolivia. +# +# Newsletter VI-7 2010-02-22 +# Name change for Saint Helena, Ascension and Tristan da Cunha +# +# Newsletter VI-8 2010-12-15 +# BONAIRE, SAINT EUSTATIUS AND SABA (BQ), CURACAO (CW) and +# SINT MAARTEN (DUTCH PART) (SX) added as new entries. +# NETHERLANDS ANTILLES (AN) removed. From owner-svn-src-head@FreeBSD.ORG Tue May 17 09:51:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE445106566B; Tue, 17 May 2011 09:51:02 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D75B8FC12; Tue, 17 May 2011 09:51:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H9p2wM022423; Tue, 17 May 2011 09:51:02 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4H9p24a022421; Tue, 17 May 2011 09:51:02 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201105170951.p4H9p24a022421@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 17 May 2011 09:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222012 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 09:51:02 -0000 Author: uqs Date: Tue May 17 09:51:02 2011 New Revision: 222012 URL: http://svn.freebsd.org/changeset/base/222012 Log: More thorough mdoc and language fixes. Submitted by: ru Modified: head/share/man/man4/geom_map.4 Modified: head/share/man/man4/geom_map.4 ============================================================================== --- head/share/man/man4/geom_map.4 Tue May 17 08:13:27 2011 (r222011) +++ head/share/man/man4/geom_map.4 Tue May 17 09:51:02 2011 (r222012) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 5, 2011 +.Dd May 17, 2011 .Dt GEOM_MAP 4 .Os .Sh NAME @@ -66,11 +66,15 @@ The current .Nm configuration can be accessed with the following .Xr sysctl 8 -nodes: kern.geom.conftxt, kern.geom.confxml, and kern.geom.confdot -or by using "geom map list". +nodes: +.Va kern.geom.conftxt , kern.geom.confxml , +and +.Va kern.geom.confdot +or by using +.Dq Li "geom map list" . .Bd -literal -offset indent -# sysctl kern.geom.conftxt -kern.geom.conftxt: 0 MD md0 10485760 512 u 0 s 512 f 0 fs 0 l 10485760 t malloc +# sysctl -n kern.geom.conftxt +0 MD md0 10485760 512 u 0 s 512 f 0 fs 0 l 10485760 t malloc 0 DISK cfid0 8388608 4 hd 0 sc 0 1 MAP map/config 131072 4 i 5 o 8257536 entry 0 dsize 131072 1 MAP map/rootfs 6881280 4 i 4 o 1376256 entry 0 dsize 6881280 @@ -81,40 +85,48 @@ kern.geom.conftxt: 0 MD md0 10485760 512 1 MAP map/bootloader 196608 4 i 0 o 0 entry 0 dsize 196608 .Ed .Pp -Driver configuration can be done in device hints file. List of used parameters: +Driver configuration can be done in +.Xr device.hints 5 . +List of used parameters: .Bl -tag -width indent -.It Fa at +.It Va at select media to attach -.It Fa name -name of partition (will create device /dev/map/that_name) -.It Fa start +.It Va name +name of partition (will create device +.Pa /dev/map/ Ns Ar that_name ) +.It Va start offset from the beginning of the parent media to start of the mapped partition. -This field can also have special value -"search:searchstart:searchstep:searchkey", where: +This field can also have a special value +.Qq Li search: Ns Ar searchstart Ns Li : Ns Ar searchstep Ns Li : Ns Ar searchkey , +where: .Bl -tag -width indent -.It Fa searchstart +.It Ar searchstart offset from the beginning of the parent media where search will be started -.It Fa searchstep +.It Ar searchstep value of the increment used while searching for the partition boundary markers -.It Fa searchkey -key which will be used to find partition boundary markers. Wildcard "." char -can be used to match any char on that position +.It Ar searchkey +key which will be used to find partition boundary markers. +The wildcard +.Ql .\& +can be used to match any character on that position .El -.It Fa end -offset from the beginning of the parent media to end of the mapped partition. -This field can also have special value -"search:searchstart:searchstep:searchkey", look "start" for details. -.It Fa offset -offset where the data of mapped partition begins +.It Va end +offset from the beginning of the parent media to the end of the mapped partition. +This field can also have the special value +.Qq Li search: Ns Ar searchstart Ns Li : Ns Ar searchstep Ns Li : Ns Ar searchkey , +as described above. +.It Va offset +offset where the data of the mapped partition begins .El .Pp -Each record contains start address(bytes) from the media begin, size(bytes), -offset where the data of mapped partition begins, and the name of new device. +Each record contains the start address (in bytes) from the media begin, size +(in bytes), offset where the data of mapped partition begins, and the name of +new device. .Bd -literal -offset indent MAP: 150000x690000, data=0x690000 "/dev/map/rootfs" .Ed .Bd -literal -00150000 - begin address +00150000 - start address 00690000 - size 00000000 - data begin from zero offset 00690000 - data size @@ -131,8 +143,15 @@ hint.map.0.name="bootloader" hint.map.0.readonly=1 .Ed .Pp -define "/dev/map/bootloader" at disk "cfid0" starting at 0x00000000 and end -0x00030000, also marked as readonly. +This defines +.Pa /dev/map/bootloader +at disk +.Pa cfid0 +starting at +.Li 0x00000000 +and ending at +.Li 0x00030000 , +it is also marked as readonly. .Bd -literal -offset indent hint.map.1.at="cfid0" hint.map.1.start=0x00030000 @@ -150,11 +169,26 @@ hint.map.3.start=0x00040000 hint.map.3.end="search:0x00100000:0x10000:.!/bin/sh" .Ed .Pp -define "/dev/map/kernel" at disk "cfid0" starting at 0x00040000, but end -position must be searched by the key ".!/bin/sh", from offset 0x00100000 to end -of media with step 0x10000. Real marker in that case is "#!/bin/sh", but "#" -terminates the line when hints file is parsed, so we need to use wildcard "." -instead of "#". +This defines +.Pa /dev/map/kernel +at disk +.Pa cfid0 +starting at +.Li 0x00040000 , +but the end position must be searched by finding the key +.Dq Li ".!/bin/sh" , +from offset +.Li 0x00100000 +to the end of media with step +.Li 0x10000 . +The real marker in this case is +.Dq Li "#!/bin/sh" , +but +.Ql # +terminates the line when the hints file is parsed, so we need to use wildcard +.Ql .\& +instead of +.Ql # . .Bd -literal -offset indent hint.map.4.at="cfid0" hint.map.4.name="rootfs" @@ -167,11 +201,10 @@ hint.map.5.end=0x00800000 hint.map.5.name="config" .Ed .Sh SEE ALSO -.Xr GEOM 4 , +.Xr geom 4 , .Xr geom 8 , .Xr sysctl 8 .Sh AUTHORS -.An -nosplit The .Nm driver was written by From owner-svn-src-head@FreeBSD.ORG Tue May 17 10:38:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E091065670; Tue, 17 May 2011 10:38:45 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 108BC8FC19; Tue, 17 May 2011 10:38:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HAcito027422; Tue, 17 May 2011 10:38:44 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HAci5l027420; Tue, 17 May 2011 10:38:44 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201105171038.p4HAci5l027420@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 17 May 2011 10:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222013 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 10:38:45 -0000 Author: pluknet Date: Tue May 17 10:38:44 2011 New Revision: 222013 URL: http://svn.freebsd.org/changeset/base/222013 Log: Add missing section number for .Xr jail. MFC after: 3 days Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Tue May 17 09:51:02 2011 (r222012) +++ head/share/man/man5/rc.conf.5 Tue May 17 10:38:44 2011 (r222013) @@ -3772,7 +3772,7 @@ Set to .Dq Li -l -U root by default. These are flags to pass to -.Xr jail . +.Xr jail 8 . .It Va jail_ Ns Ao Ar jname Ac Ns Va _interface .Pq Vt str Unset by default. From owner-svn-src-head@FreeBSD.ORG Tue May 17 10:44:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3641065700; Tue, 17 May 2011 10:44:11 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA27E8FC15; Tue, 17 May 2011 10:44:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HAiBRK027634; Tue, 17 May 2011 10:44:11 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HAiBVQ027632; Tue, 17 May 2011 10:44:11 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105171044.p4HAiBVQ027632@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 17 May 2011 10:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222014 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 10:44:11 -0000 Author: ru Date: Tue May 17 10:44:11 2011 New Revision: 222014 URL: http://svn.freebsd.org/changeset/base/222014 Log: Revert change to "MF" I made in r189767. I bet that at the time of r189767 I checked with http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm and "MF" was officially spelled in English as "Saint Martin" there, but now that "SX" exists (for "Sint Maarten (Dutch part)") (nice official "English" spelling!) they seem to have added a "(French part)" suffix to "MF". Since this is also in line with Newsletter VI-1 (2007-09-21), catch up. Modified: head/share/misc/iso3166 Modified: head/share/misc/iso3166 ============================================================================== --- head/share/misc/iso3166 Tue May 17 10:38:44 2011 (r222013) +++ head/share/misc/iso3166 Tue May 17 10:44:11 2011 (r222014) @@ -206,7 +206,7 @@ RW RWA 646 Rwanda BL BLM 652 Saint Barthelemy KN KNA 659 Saint Kitts and Nevis LC LCA 662 Saint Lucia -MF MAF 663 Saint Martin +MF MAF 663 Saint Martin (French Part) VC VCT 670 Saint Vincent and the Grenadines WS WSM 882 Samoa SM SMR 674 San Marino From owner-svn-src-head@FreeBSD.ORG Tue May 17 11:04:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E778C106564A; Tue, 17 May 2011 11:04:50 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCE128FC0C; Tue, 17 May 2011 11:04:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HB4o5Y028310; Tue, 17 May 2011 11:04:50 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HB4oD0028308; Tue, 17 May 2011 11:04:50 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201105171104.p4HB4oD0028308@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 17 May 2011 11:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222015 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 11:04:51 -0000 Author: phk Date: Tue May 17 11:04:50 2011 New Revision: 222015 URL: http://svn.freebsd.org/changeset/base/222015 Log: Use memset() instead of bzero() and memcpy() instead of bcopy(), there is no relevant difference for sbufs, and it increases portability of the source code. Split the actual initialization of the sbuf into a separate local function, so that certain static code checkers can understand what sbuf_new() does, thus eliminating on silly annoyance of MISRA compliance testing. Contributed by: An anonymous company in the last business I expected sbufs to invade. Modified: head/sys/kern/subr_sbuf.c Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Tue May 17 10:44:11 2011 (r222014) +++ head/sys/kern/subr_sbuf.c Tue May 17 11:04:50 2011 (r222015) @@ -144,7 +144,6 @@ sbuf_extendsize(int size) return (newsize); } - /* * Extend an sbuf. */ @@ -160,7 +159,7 @@ sbuf_extend(struct sbuf *s, int addlen) newbuf = SBMALLOC(newsize); if (newbuf == NULL) return (-1); - bcopy(s->s_buf, newbuf, s->s_size); + memcpy(newbuf, s->s_buf, s->s_size); if (SBUF_ISDYNAMIC(s)) SBFREE(s->s_buf); else @@ -171,6 +170,38 @@ sbuf_extend(struct sbuf *s, int addlen) } /* + * Initialize the internals of an sbuf. + * If buf is non-NULL, it points to a static or already-allocated string + * big enough to hold at least length characters. + */ +static struct sbuf * +sbuf_newbuf(struct sbuf *s, char *buf, int length, int flags) +{ + + memset(s, 0, sizeof(*s)); + s->s_flags = flags; + s->s_size = length; + s->s_buf = buf; + + if ((s->s_flags & SBUF_AUTOEXTEND) == 0) { + KASSERT(s->s_size > 1, + ("attempt to create a too small sbuf")); + } + + if (s->s_buf != NULL) + return (s); + + if ((flags & SBUF_AUTOEXTEND) != 0) + s->s_size = sbuf_extendsize(s->s_size); + + s->s_buf = SBMALLOC(s->s_size); + if (s->s_buf == NULL) + return (NULL); + SBUF_SETFLAG(s, SBUF_DYNAMIC); + return (s); +} + +/* * Initialize an sbuf. * If buf is non-NULL, it points to a static or already-allocated string * big enough to hold at least length characters. @@ -185,31 +216,17 @@ sbuf_new(struct sbuf *s, char *buf, int ("%s called with invalid flags", __func__)); flags &= SBUF_USRFLAGMSK; - if (s == NULL) { - s = SBMALLOC(sizeof(*s)); - if (s == NULL) - return (NULL); - bzero(s, sizeof(*s)); - s->s_flags = flags; - SBUF_SETFLAG(s, SBUF_DYNSTRUCT); - } else { - bzero(s, sizeof(*s)); - s->s_flags = flags; - } - s->s_size = length; - if (buf != NULL) { - s->s_buf = buf; - return (s); - } - if ((flags & SBUF_AUTOEXTEND) != 0) - s->s_size = sbuf_extendsize(s->s_size); - s->s_buf = SBMALLOC(s->s_size); - if (s->s_buf == NULL) { - if (SBUF_ISDYNSTRUCT(s)) - SBFREE(s); + if (s != NULL) + return (sbuf_newbuf(s, buf, length, flags)); + + s = SBMALLOC(sizeof(*s)); + if (s == NULL) + return (NULL); + if (sbuf_newbuf(s, buf, length, flags) == NULL) { + SBFREE(s); return (NULL); } - SBUF_SETFLAG(s, SBUF_DYNAMIC); + SBUF_SETFLAG(s, SBUF_DYNSTRUCT); return (s); } @@ -727,7 +744,7 @@ sbuf_delete(struct sbuf *s) if (SBUF_ISDYNAMIC(s)) SBFREE(s->s_buf); isdyn = SBUF_ISDYNSTRUCT(s); - bzero(s, sizeof(*s)); + memset(s, 0, sizeof(*s)); if (isdyn) SBFREE(s); } From owner-svn-src-head@FreeBSD.ORG Tue May 17 11:06:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9BDF1065672; Tue, 17 May 2011 11:06:41 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6D78FC0A; Tue, 17 May 2011 11:06:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HB6f8L028405; Tue, 17 May 2011 11:06:41 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HB6fo5028404; Tue, 17 May 2011 11:06:41 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105171106.p4HB6fo5028404@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 17 May 2011 11:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222016 - head/tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 11:06:41 -0000 Author: ru Date: Tue May 17 11:06:41 2011 New Revision: 222016 URL: http://svn.freebsd.org/changeset/base/222016 Log: Added description for WITH_OFED. Added: head/tools/build/options/WITH_OFED (contents, props changed) Added: head/tools/build/options/WITH_OFED ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_OFED Tue May 17 11:06:41 2011 (r222016) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build the +.Dq "OpenFabrics Enterprise Distribution" +Infiniband software stack. From owner-svn-src-head@FreeBSD.ORG Tue May 17 11:08:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C15761065679; Tue, 17 May 2011 11:08:15 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B16668FC14; Tue, 17 May 2011 11:08:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HB8Fm8028501; Tue, 17 May 2011 11:08:15 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HB8Fw3028499; Tue, 17 May 2011 11:08:15 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105171108.p4HB8Fw3028499@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 17 May 2011 11:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222017 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 11:08:15 -0000 Author: ru Date: Tue May 17 11:08:15 2011 New Revision: 222017 URL: http://svn.freebsd.org/changeset/base/222017 Log: Regen for WITH_OFED. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue May 17 11:06:41 2011 (r222016) +++ head/share/man/man5/src.conf.5 Tue May 17 11:08:15 2011 (r222017) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd May 10, 2011 +.Dd May 17, 2011 .Dt SRC.CONF 5 .Os .Sh NAME @@ -712,6 +712,11 @@ will not be built either if this option Set to not build .Xr ntpd 8 and related programs. +.It Va WITH_OFED +.\" from FreeBSD: head/tools/build/options/WITH_OFED 222016 2011-05-17 11:06:41Z ru +Set to build the +.Dq "OpenFabrics Enterprise Distribution" +Infiniband software stack. .It Va WITHOUT_OPENSSH .\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSH. From owner-svn-src-head@FreeBSD.ORG Tue May 17 11:23:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 935AB106566C; Tue, 17 May 2011 11:23:43 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68D7D8FC12; Tue, 17 May 2011 11:23:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HBNh7H029008; Tue, 17 May 2011 11:23:43 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HBNhYI029004; Tue, 17 May 2011 11:23:43 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105171123.p4HBNhYI029004@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 17 May 2011 11:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222018 - in head/sys/dev: pci usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 11:23:43 -0000 Author: ru Date: Tue May 17 11:23:43 2011 New Revision: 222018 URL: http://svn.freebsd.org/changeset/base/222018 Log: Renamed PCI_INTERFACE_XHCI to PCIP_SERIALBUS_USB_XHCI and moved it to . Reviewed by: hselasky MFC after: 3 days Modified: head/sys/dev/pci/pcireg.h head/sys/dev/usb/controller/xhci_pci.c head/sys/dev/usb/controller/xhcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue May 17 11:08:15 2011 (r222017) +++ head/sys/dev/pci/pcireg.h Tue May 17 11:23:43 2011 (r222018) @@ -367,6 +367,7 @@ #define PCIP_SERIALBUS_USB_UHCI 0x00 #define PCIP_SERIALBUS_USB_OHCI 0x10 #define PCIP_SERIALBUS_USB_EHCI 0x20 +#define PCIP_SERIALBUS_USB_XHCI 0x30 #define PCIP_SERIALBUS_USB_DEVICE 0xfe #define PCIS_SERIALBUS_FC 0x04 #define PCIS_SERIALBUS_SMBUS 0x05 Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Tue May 17 11:08:15 2011 (r222017) +++ head/sys/dev/usb/controller/xhci_pci.c Tue May 17 11:23:43 2011 (r222018) @@ -137,7 +137,7 @@ xhci_pci_match(device_t self) { if ((pci_get_class(self) == PCIC_SERIALBUS) && (pci_get_subclass(self) == PCIS_SERIALBUS_USB) - && (pci_get_progif(self) == PCI_INTERFACE_XHCI)) { + && (pci_get_progif(self) == PCIP_SERIALBUS_USB_XHCI)) { return ("XHCI (generic) USB 3.0 controller"); } return (NULL); /* dunno */ Modified: head/sys/dev/usb/controller/xhcireg.h ============================================================================== --- head/sys/dev/usb/controller/xhcireg.h Tue May 17 11:08:15 2011 (r222017) +++ head/sys/dev/usb/controller/xhcireg.h Tue May 17 11:23:43 2011 (r222018) @@ -33,7 +33,6 @@ #define PCI_XHCI_USBREV 0x60 /* RO USB protocol revision */ #define PCI_USB_REV_3_0 0x30 /* USB 3.0 */ #define PCI_XHCI_FLADJ 0x61 /* RW frame length adjust */ -#define PCI_INTERFACE_XHCI 0x30 /* USB 3.0 - XHCI */ /* XHCI capability registers */ #define XHCI_CAPLENGTH 0x00 /* RO capability */ From owner-svn-src-head@FreeBSD.ORG Tue May 17 11:27:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EF9B1065673; Tue, 17 May 2011 11:27:00 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F2AE8FC19; Tue, 17 May 2011 11:27:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HBR0jT029141; Tue, 17 May 2011 11:27:00 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HBR0Ba029139; Tue, 17 May 2011 11:27:00 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105171127.p4HBR0Ba029139@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 17 May 2011 11:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222019 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 11:27:00 -0000 Author: ru Date: Tue May 17 11:26:59 2011 New Revision: 222019 URL: http://svn.freebsd.org/changeset/base/222019 Log: Document the supported hardware, somewhat. Reviewed by: hselasky MFC after: 3 days Modified: head/share/man/man4/xhci.4 Modified: head/share/man/man4/xhci.4 ============================================================================== --- head/share/man/man4/xhci.4 Tue May 17 11:23:43 2011 (r222018) +++ head/share/man/man4/xhci.4 Tue May 17 11:26:59 2011 (r222019) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 24, 2011 +.Dd May 17, 2011 .Dt XHCI 4 .Os .Sh NAME @@ -49,6 +49,13 @@ The controller supports .Tn USB connection speeds up to 5.0Gbps when using a USB 3.0 compliant device. +.Sh HARDWARE +The +.Nm +driver supports +.Tn XHCI +compatible controllers having PCI class 12 (serial bus), +subclass 3 (USB) and programming interface 48 (XHCI). .Sh SEE ALSO .Xr ehci 4 , .Xr ohci 4 , From owner-svn-src-head@FreeBSD.ORG Tue May 17 11:52:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8251E106566B; Tue, 17 May 2011 11:52:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 724C48FC14; Tue, 17 May 2011 11:52:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HBqrwP029911; Tue, 17 May 2011 11:52:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HBqrx9029909; Tue, 17 May 2011 11:52:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105171152.p4HBqrx9029909@svn.freebsd.org> From: Adrian Chadd Date: Tue, 17 May 2011 11:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222020 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 11:52:53 -0000 Author: adrian Date: Tue May 17 11:52:53 2011 New Revision: 222020 URL: http://svn.freebsd.org/changeset/base/222020 Log: Set this HAL capabilities flag correctly even though it isn't currently being used. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue May 17 11:26:59 2011 (r222019) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue May 17 11:52:53 2011 (r222020) @@ -816,7 +816,7 @@ ar5416FillCapabilityInfo(struct ath_hal pCap->halPSPollBroken = AH_TRUE; /* XXX fixed in later revs? */ pCap->halVEOLSupport = AH_TRUE; pCap->halBssIdMaskSupport = AH_TRUE; - pCap->halMcastKeySrchSupport = AH_FALSE; + pCap->halMcastKeySrchSupport = AH_TRUE; /* Works on AR5416 and later */ pCap->halTsfAddSupport = AH_TRUE; pCap->hal4AddrAggrSupport = AH_FALSE; /* Broken in Owl */ From owner-svn-src-head@FreeBSD.ORG Tue May 17 11:56:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEF16106566B; Tue, 17 May 2011 11:56:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEE1A8FC13; Tue, 17 May 2011 11:56:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HBuoYu030072; Tue, 17 May 2011 11:56:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HBuoNb030070; Tue, 17 May 2011 11:56:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105171156.p4HBuoNb030070@svn.freebsd.org> From: Adrian Chadd Date: Tue, 17 May 2011 11:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222021 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 11:56:50 -0000 Author: adrian Date: Tue May 17 11:56:50 2011 New Revision: 222021 URL: http://svn.freebsd.org/changeset/base/222021 Log: Use the halMcastKeySrchSupport capability bit to selectively enable/disable the multicast key search support for AR5212, AR5416 and later. The general HAL routine ath_hal_getcapability() implement checking this but it's overridden by a check in ar5212_misc:ar5212GetCapability(). This restores the later functionality in case it's found to be broken in any of the 11n chipsets. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Tue May 17 11:52:53 2011 (r222020) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Tue May 17 11:56:50 2011 (r222021) @@ -857,7 +857,7 @@ ar5212GetCapability(struct ath_hal *ah, case HAL_CAP_MCAST_KEYSRCH: /* multicast frame keycache search */ switch (capability) { case 0: /* hardware capability */ - return HAL_OK; + return pcap->halMcastKeySrchSupport ? HAL_OK : HAL_ENXIO; case 1: return (ahp->ah_staId1Defaults & AR_STA_ID1_MCAST_KSRCH) ? HAL_OK : HAL_ENXIO; From owner-svn-src-head@FreeBSD.ORG Tue May 17 12:58:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34FDC1065673; Tue, 17 May 2011 12:58:20 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 256348FC13; Tue, 17 May 2011 12:58:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HCwKwL031941; Tue, 17 May 2011 12:58:20 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HCwKfp031939; Tue, 17 May 2011 12:58:20 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201105171258.p4HCwKfp031939@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 17 May 2011 12:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222023 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 12:58:20 -0000 Author: pluknet Date: Tue May 17 12:58:19 2011 New Revision: 222023 URL: http://svn.freebsd.org/changeset/base/222023 Log: mdoc: - use a proper macro for interface name ipfw0. - add missing section number for bpf cross reference. Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue May 17 12:47:38 2011 (r222022) +++ head/sbin/ipfw/ipfw.8 Tue May 17 12:58:19 2011 (r222023) @@ -565,9 +565,9 @@ if the sysctl variable is set to 0 (default), one can use .Xr bpf 4 attached to the -.Xr ipfw0 +.Li ipfw0 pseudo interface. There is no overhead if no -.Xr bpf +.Xr bpf 4 is attached to the pseudo interface. .Pp If From owner-svn-src-head@FreeBSD.ORG Tue May 17 13:36:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F81A106564A; Tue, 17 May 2011 13:36:13 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 0BAF78FC18; Tue, 17 May 2011 13:36:12 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id A94F95DF8; Tue, 17 May 2011 13:36:11 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p4HDaBN4022628; Tue, 17 May 2011 13:36:11 GMT (envelope-from phk@critter.freebsd.dk) To: Kostik Belousov From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 17 May 2011 00:19:54 +0300." <20110516211954.GJ48734@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1 Date: Tue, 17 May 2011 13:36:11 +0000 Message-ID: <22627.1305639371@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 13:36:13 -0000 In message <20110516211954.GJ48734@deviant.kiev.zoral.com.ua>, Kostik Belousov writes: >struct sbuf is exposed to the libsubf.so consumers. >I think that libsbuf.so version shall be bumped (since no symver >compat can be provided, due to lack of versioning for libsbuf). > >The bump was also needed after the r212367. Lets do one for two changes. Ok, I'm done, Question: Do we bumb the libsbuf version, or do we start using symbol-versioning, and if so, how is that done ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Tue May 17 13:44:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8454A1065672; Tue, 17 May 2011 13:44:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DB1188FC1F; Tue, 17 May 2011 13:44:07 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p4HDi2rx075840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 May 2011 16:44:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p4HDi2p2092185; Tue, 17 May 2011 16:44:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p4HDi2qh092184; Tue, 17 May 2011 16:44:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 17 May 2011 16:44:02 +0300 From: Kostik Belousov To: Poul-Henning Kamp Message-ID: <20110517134402.GL48734@deviant.kiev.zoral.com.ua> References: <20110516211954.GJ48734@deviant.kiev.zoral.com.ua> <22627.1305639371@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fzqeIE+j4cN25Pqf" Content-Disposition: inline In-Reply-To: <22627.1305639371@critter.freebsd.dk> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 13:44:08 -0000 --fzqeIE+j4cN25Pqf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 17, 2011 at 01:36:11PM +0000, Poul-Henning Kamp wrote: > In message <20110516211954.GJ48734@deviant.kiev.zoral.com.ua>, Kostik Bel= ousov=20 > writes: >=20 > >struct sbuf is exposed to the libsubf.so consumers. > >I think that libsbuf.so version shall be bumped (since no symver > >compat can be provided, due to lack of versioning for libsbuf). > > > >The bump was also needed after the r212367. Lets do one for two changes. >=20 > Ok, I'm done, >=20 > Question: Do we bumb the libsbuf version, or do we start using > symbol-versioning, and if so, how is that done ? We do bump the libsbuf version, regardless of the symbol versioning. If symver is introduced, then it can be combined with the bump. Please see http://people.freebsd.org/~deischen/symver/freebsd_versioning.txt for the document describing the rules. The exemplary use of the versioning for newly introduced library is r221931. --fzqeIE+j4cN25Pqf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3Se6IACgkQC3+MBN1Mb4j8egCbBX5KMkXb6MTZfNcHVUPWaF2W fqIAoM5wB38WblwUrdY94VYktxowwj1o =BLUl -----END PGP SIGNATURE----- --fzqeIE+j4cN25Pqf-- From owner-svn-src-head@FreeBSD.ORG Tue May 17 14:46:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13F66106566C; Tue, 17 May 2011 14:46:29 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04C4C8FC13; Tue, 17 May 2011 14:46:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HEkSrn035266; Tue, 17 May 2011 14:46:28 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HEkShb035264; Tue, 17 May 2011 14:46:28 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201105171446.p4HEkShb035264@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 17 May 2011 14:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222025 - head/usr.sbin/ifmcstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 14:46:29 -0000 Author: pluknet Date: Tue May 17 14:46:28 2011 New Revision: 222025 URL: http://svn.freebsd.org/changeset/base/222025 Log: Fix manual section number for netstat(1). MFC after: 5 days Modified: head/usr.sbin/ifmcstat/ifmcstat.8 Modified: head/usr.sbin/ifmcstat/ifmcstat.8 ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.8 Tue May 17 13:47:32 2011 (r222024) +++ head/usr.sbin/ifmcstat/ifmcstat.8 Tue May 17 14:46:28 2011 (r222025) @@ -125,7 +125,7 @@ This support is recommended for debuggin It requires super-user privilege if used to inspect a running kernel. .Pp .Sh SEE ALSO +.Xr netstat 1 , .Xr getifaddrs 3 , .Xr getifmaddrs 3 , -.Xr kvm 3 , -.Xr netstat 8 +.Xr kvm 3 From owner-svn-src-head@FreeBSD.ORG Tue May 17 15:03:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D7631065673; Tue, 17 May 2011 15:03:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E0B98FC14; Tue, 17 May 2011 15:03:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HF3eNT035922; Tue, 17 May 2011 15:03:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HF3eOK035920; Tue, 17 May 2011 15:03:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105171503.p4HF3eOK035920@svn.freebsd.org> From: Adrian Chadd Date: Tue, 17 May 2011 15:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222027 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 15:03:40 -0000 Author: adrian Date: Tue May 17 15:03:39 2011 New Revision: 222027 URL: http://svn.freebsd.org/changeset/base/222027 Log: Fix case, introduced in my previous commit. Pointy hat goes to: adrian, for having multiple build screens open and checking the wrong one. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Tue May 17 14:50:23 2011 (r222026) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Tue May 17 15:03:39 2011 (r222027) @@ -857,7 +857,7 @@ ar5212GetCapability(struct ath_hal *ah, case HAL_CAP_MCAST_KEYSRCH: /* multicast frame keycache search */ switch (capability) { case 0: /* hardware capability */ - return pcap->halMcastKeySrchSupport ? HAL_OK : HAL_ENXIO; + return pCap->halMcastKeySrchSupport ? HAL_OK : HAL_ENXIO; case 1: return (ahp->ah_staId1Defaults & AR_STA_ID1_MCAST_KSRCH) ? HAL_OK : HAL_ENXIO; From owner-svn-src-head@FreeBSD.ORG Tue May 17 15:46:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CCC9106566B; Tue, 17 May 2011 15:46:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1AA18FC16; Tue, 17 May 2011 15:46:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HFkSBf037181; Tue, 17 May 2011 15:46:28 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HFkSZG037179; Tue, 17 May 2011 15:46:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201105171546.p4HFkSZG037179@svn.freebsd.org> From: Michael Tuexen Date: Tue, 17 May 2011 15:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222028 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 15:46:29 -0000 Author: tuexen Date: Tue May 17 15:46:28 2011 New Revision: 222028 URL: http://svn.freebsd.org/changeset/base/222028 Log: Fix whitespacing. Reported by scf@ MFC after: 1 week. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue May 17 15:03:39 2011 (r222027) +++ head/sys/netinet/sctp_output.c Tue May 17 15:46:28 2011 (r222028) @@ -2210,26 +2210,26 @@ sctp_is_ifa_addr_preferred(struct sctp_i * means it is the same scope or higher scope then the destination. * L = loopback, P = private, G = global * ----------------------------------------- - * src | dest | result - * ---------------------------------------- - * L | L | yes - * ----------------------------------------- - * P | L | yes-v4 no-v6 - * ----------------------------------------- - * G | L | yes-v4 no-v6 - * ----------------------------------------- - * L | P | no - * ----------------------------------------- - * P | P | yes - * ----------------------------------------- - * G | P | no - * ----------------------------------------- - * L | G | no - * ----------------------------------------- - * P | G | no - * ----------------------------------------- - * G | G | yes - * ----------------------------------------- + * src | dest | result + * ---------------------------------------- + * L | L | yes + * ----------------------------------------- + * P | L | yes-v4 no-v6 + * ----------------------------------------- + * G | L | yes-v4 no-v6 + * ----------------------------------------- + * L | P | no + * ----------------------------------------- + * P | P | yes + * ----------------------------------------- + * G | P | no + * ----------------------------------------- + * L | G | no + * ----------------------------------------- + * P | G | no + * ----------------------------------------- + * G | G | yes + * ----------------------------------------- */ if (ifa->address.sa.sa_family != fam) { @@ -2310,14 +2310,14 @@ sctp_is_ifa_addr_acceptable(struct sctp_ * * L = loopback, P = private, G = global * ----------------------------------------- - * src | dest | result + * src | dest | result * ----------------------------------------- * L | L | yes * ----------------------------------------- * P | L | yes-v4 no-v6 * ----------------------------------------- * G | L | yes - * ----------------------------------------- + * ----------------------------------------- * L | P | no * ----------------------------------------- * P | P | yes @@ -2325,7 +2325,7 @@ sctp_is_ifa_addr_acceptable(struct sctp_ * G | P | yes - May not work * ----------------------------------------- * L | G | no - * ----------------------------------------- + * ----------------------------------------- * P | G | yes - May not work * ----------------------------------------- * G | G | yes From owner-svn-src-head@FreeBSD.ORG Tue May 17 15:57:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED4501065670; Tue, 17 May 2011 15:57:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE34B8FC13; Tue, 17 May 2011 15:57:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HFvV8v037538; Tue, 17 May 2011 15:57:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HFvVQh037536; Tue, 17 May 2011 15:57:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201105171557.p4HFvVQh037536@svn.freebsd.org> From: Michael Tuexen Date: Tue, 17 May 2011 15:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222029 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 15:57:32 -0000 Author: tuexen Date: Tue May 17 15:57:31 2011 New Revision: 222029 URL: http://svn.freebsd.org/changeset/base/222029 Log: Copy out the mtu when calling getsockopt() with SCTP_GET_PEER_ADDR_INFO. MFC after: 1 week. Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue May 17 15:46:28 2011 (r222028) +++ head/sys/netinet/sctp_usrreq.c Tue May 17 15:57:31 2011 (r222029) @@ -2489,6 +2489,7 @@ flags_out: paddri->spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; paddri->spinfo_rto = net->RTO; paddri->spinfo_assoc_id = sctp_get_associd(stcb); + paddri->spinfo_mtu = net->mtu; SCTP_TCB_UNLOCK(stcb); } else { if (stcb) { From owner-svn-src-head@FreeBSD.ORG Tue May 17 16:04:02 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B063106566C; Tue, 17 May 2011 16:04:02 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1325B8FC15; Tue, 17 May 2011 16:04:01 +0000 (UTC) Received: from [10.30.101.52] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p4HFvm1P019718 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 17 May 2011 09:57:49 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20110517134402.GL48734@deviant.kiev.zoral.com.ua> Date: Tue, 17 May 2011 09:57:41 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <2D767D47-5034-468B-9BC6-B69FDF4DC1D2@bsdimp.com> References: <20110516211954.GJ48734@deviant.kiev.zoral.com.ua> <22627.1305639371@critter.freebsd.dk> <20110517134402.GL48734@deviant.kiev.zoral.com.ua> To: Kostik Belousov X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 17 May 2011 09:57:50 -0600 (MDT) Cc: svn-src-head@FreeBSD.org, Poul-Henning Kamp , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r221993 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 16:04:02 -0000 On May 17, 2011, at 7:44 AM, Kostik Belousov wrote: > On Tue, May 17, 2011 at 01:36:11PM +0000, Poul-Henning Kamp wrote: >> In message <20110516211954.GJ48734@deviant.kiev.zoral.com.ua>, Kostik = Belousov=20 >> writes: >>=20 >>> struct sbuf is exposed to the libsubf.so consumers. >>> I think that libsbuf.so version shall be bumped (since no symver >>> compat can be provided, due to lack of versioning for libsbuf). >>>=20 >>> The bump was also needed after the r212367. Lets do one for two = changes. >>=20 >> Ok, I'm done, >>=20 >> Question: Do we bumb the libsbuf version, or do we start using >> symbol-versioning, and if so, how is that done ? >=20 > We do bump the libsbuf version, regardless of the symbol versioning. > If symver is introduced, then it can be combined with the bump. >=20 > Please see = http://people.freebsd.org/~deischen/symver/freebsd_versioning.txt > for the document describing the rules. >=20 > The exemplary use of the versioning for newly introduced library is > r221931. Also, there's a strong encouragement to go to symbol versioning as that = makes our lives much easier going forward. Warner From owner-svn-src-head@FreeBSD.ORG Tue May 17 16:30:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DACF106566B; Tue, 17 May 2011 16:30:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E4548FC13; Tue, 17 May 2011 16:30:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HGUYmQ038550; Tue, 17 May 2011 16:30:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HGUYMV038548; Tue, 17 May 2011 16:30:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105171630.p4HGUYMV038548@svn.freebsd.org> From: Adrian Chadd Date: Tue, 17 May 2011 16:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222031 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 16:30:34 -0000 Author: adrian Date: Tue May 17 16:30:34 2011 New Revision: 222031 URL: http://svn.freebsd.org/changeset/base/222031 Log: Fix the debugging code path to correctly support HAL_DEBUG_UNMASKABLE. Modified: head/sys/dev/ath/ah_osdep.c Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Tue May 17 16:13:59 2011 (r222030) +++ head/sys/dev/ath/ah_osdep.c Tue May 17 16:30:34 2011 (r222031) @@ -140,16 +140,20 @@ ath_hal_ether_sprintf(const u_int8_t *ma } #ifdef AH_DEBUG + +/* This must match the definition in ath_hal/ah_debug.h */ +#define HAL_DEBUG_UNMASKABLE 0xf0000000 void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) { - if (ath_hal_debug & mask) { + if ((mask == HAL_DEBUG_UNMASKABLE) || (ath_hal_debug & mask)) { __va_list ap; va_start(ap, fmt); ath_hal_vprintf(ah, fmt, ap); va_end(ap); } } +#undef HAL_DEBUG_UNMASKABLE #endif /* AH_DEBUG */ #ifdef AH_DEBUG_ALQ From owner-svn-src-head@FreeBSD.ORG Tue May 17 16:39:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE33C106564A; Tue, 17 May 2011 16:39:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEAE58FC0C; Tue, 17 May 2011 16:39:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HGd8pP038820; Tue, 17 May 2011 16:39:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HGd8q6038818; Tue, 17 May 2011 16:39:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201105171639.p4HGd8q6038818@svn.freebsd.org> From: John Baldwin Date: Tue, 17 May 2011 16:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222032 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 16:39:09 -0000 Author: jhb Date: Tue May 17 16:39:08 2011 New Revision: 222032 URL: http://svn.freebsd.org/changeset/base/222032 Log: Fix a race in the SMP rendezvous code. Specifically, the write by the last CPU to to finish the rendezvous action may become visible to different CPUs at different times. As a result, the CPU that initiated the rendezvous may exit the rendezvous and drop the lock allowing another rendezvous to be initiated on the same CPU or a different CPU. In that case the exit sentinel may be cleared before all CPUs have noticed causing those CPUs to hang forever. Workaround this by using a generation count to notice when this race occurs and to exit the rendezvous in that case. The problem was independently diagnosted by mlaier@ and avg@ as well. Submitted by: neel Reviewed by: avg, mlaier Obtained from: NetApp MFC after: 1 week Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Tue May 17 16:30:34 2011 (r222031) +++ head/sys/kern/subr_smp.c Tue May 17 16:39:08 2011 (r222032) @@ -110,6 +110,7 @@ static void (*volatile smp_rv_action_fun static void (*volatile smp_rv_teardown_func)(void *arg); static void *volatile smp_rv_func_arg; static volatile int smp_rv_waiters[3]; +static volatile int smp_rv_generation; /* * Shared mutex to restrict busywaits between smp_rendezvous() and @@ -310,39 +311,63 @@ restart_cpus(cpumask_t map) void smp_rendezvous_action(void) { - void* local_func_arg = smp_rv_func_arg; - void (*local_setup_func)(void*) = smp_rv_setup_func; - void (*local_action_func)(void*) = smp_rv_action_func; - void (*local_teardown_func)(void*) = smp_rv_teardown_func; + void *local_func_arg; + void (*local_setup_func)(void*); + void (*local_action_func)(void*); + void (*local_teardown_func)(void*); + int generation; /* Ensure we have up-to-date values. */ atomic_add_acq_int(&smp_rv_waiters[0], 1); while (smp_rv_waiters[0] < smp_rv_ncpus) cpu_spinwait(); - /* setup function */ + /* Fetch rendezvous parameters after acquire barrier. */ + local_func_arg = smp_rv_func_arg; + local_setup_func = smp_rv_setup_func; + local_action_func = smp_rv_action_func; + local_teardown_func = smp_rv_teardown_func; + generation = smp_rv_generation; + + /* + * If requested, run a setup function before the main action + * function. Ensure all CPUs have completed the setup + * function before moving on to the action function. + */ if (local_setup_func != smp_no_rendevous_barrier) { if (smp_rv_setup_func != NULL) smp_rv_setup_func(smp_rv_func_arg); - - /* spin on entry rendezvous */ atomic_add_int(&smp_rv_waiters[1], 1); while (smp_rv_waiters[1] < smp_rv_ncpus) cpu_spinwait(); } - /* action function */ if (local_action_func != NULL) local_action_func(local_func_arg); - /* spin on exit rendezvous */ + /* + * Signal that the main action has been completed. If a + * full exit rendezvous is requested, then all CPUs will + * wait here until all CPUs have finished the main action. + * + * Note that the write by the last CPU to finish the action + * may become visible to different CPUs at different times. + * As a result, the CPU that initiated the rendezvous may + * exit the rendezvous and drop the lock allowing another + * rendezvous to be initiated on the same CPU or a different + * CPU. In that case the exit sentinel may be cleared before + * all CPUs have noticed causing those CPUs to hang forever. + * Workaround this by using a generation count to notice when + * this race occurs and to exit the rendezvous in that case. + */ + MPASS(generation == smp_rv_generation); atomic_add_int(&smp_rv_waiters[2], 1); if (local_teardown_func == smp_no_rendevous_barrier) return; - while (smp_rv_waiters[2] < smp_rv_ncpus) + while (smp_rv_waiters[2] < smp_rv_ncpus && + generation == smp_rv_generation) cpu_spinwait(); - /* teardown function */ if (local_teardown_func != NULL) local_teardown_func(local_func_arg); } @@ -373,10 +398,11 @@ smp_rendezvous_cpus(cpumask_t map, if (ncpus == 0) panic("ncpus is 0 with map=0x%x", map); - /* obtain rendezvous lock */ mtx_lock_spin(&smp_ipi_mtx); - /* set static function pointers */ + atomic_add_acq_int(&smp_rv_generation, 1); + + /* Pass rendezvous parameters via global variables. */ smp_rv_ncpus = ncpus; smp_rv_setup_func = setup_func; smp_rv_action_func = action_func; @@ -386,18 +412,25 @@ smp_rendezvous_cpus(cpumask_t map, smp_rv_waiters[2] = 0; atomic_store_rel_int(&smp_rv_waiters[0], 0); - /* signal other processors, which will enter the IPI with interrupts off */ + /* + * Signal other processors, which will enter the IPI with + * interrupts off. + */ ipi_selected(map & ~(1 << curcpu), IPI_RENDEZVOUS); /* Check if the current CPU is in the map */ if ((map & (1 << curcpu)) != 0) smp_rendezvous_action(); + /* + * If the caller did not request an exit barrier to be enforced + * on each CPU, ensure that this CPU waits for all the other + * CPUs to finish the rendezvous. + */ if (teardown_func == smp_no_rendevous_barrier) while (atomic_load_acq_int(&smp_rv_waiters[2]) < ncpus) cpu_spinwait(); - /* release lock */ mtx_unlock_spin(&smp_ipi_mtx); } From owner-svn-src-head@FreeBSD.ORG Tue May 17 17:37:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A3821065677; Tue, 17 May 2011 17:37:59 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AD018FC0A; Tue, 17 May 2011 17:37:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HHbwMa040702; Tue, 17 May 2011 17:37:58 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HHbwHF040698; Tue, 17 May 2011 17:37:58 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201105171737.p4HHbwHF040698@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 17 May 2011 17:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222033 - head/lib/libsbuf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 17:37:59 -0000 Author: phk Date: Tue May 17 17:37:58 2011 New Revision: 222033 URL: http://svn.freebsd.org/changeset/base/222033 Log: Bump shlib version Instigate symbol versioning Pray that I don't break the build. Added: head/lib/libsbuf/Symbol.map (contents, props changed) head/lib/libsbuf/Version.def (contents, props changed) Modified: head/lib/libsbuf/Makefile Modified: head/lib/libsbuf/Makefile ============================================================================== --- head/lib/libsbuf/Makefile Tue May 17 16:39:08 2011 (r222032) +++ head/lib/libsbuf/Makefile Tue May 17 17:37:58 2011 (r222033) @@ -1,8 +1,13 @@ # $FreeBSD$ -LIB= sbuf -SHLIBDIR?= /lib -SRCS= subr_sbuf.c +LIB= sbuf +SHLIBDIR?= /lib +SRCS= subr_sbuf.c + +SHLIB_MAJOR = 6 + +SYMBOL_MAPS= ${.CURDIR}/Symbol.map +VERSION_DEF= ${.CURDIR}/Version.def .PATH: ${.CURDIR}/../../sys/kern Added: head/lib/libsbuf/Symbol.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsbuf/Symbol.map Tue May 17 17:37:58 2011 (r222033) @@ -0,0 +1,24 @@ +/* + * $FreeBSD$ + */ + +FBSD_1.2 { + sbuf_new; + sbuf_clear; + sbuf_setpos; + sbuf_bcat; + sbuf_bcpy; + sbuf_cat; + sbuf_cpy; + sbuf_printf; + sbuf_vprintf; + sbuf_putc; + sbuf_set_drain; + sbuf_trim; + sbuf_error; + sbuf_finish; + sbuf_data; + sbuf_len; + sbuf_done; + sbuf_delete; +}; Added: head/lib/libsbuf/Version.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsbuf/Version.def Tue May 17 17:37:58 2011 (r222033) @@ -0,0 +1,6 @@ +/* + * $FreeBSD$ + */ + +FBSD_1.2 { +}; From owner-svn-src-head@FreeBSD.ORG Tue May 17 18:20:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170D71065676; Tue, 17 May 2011 18:20:38 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 712BA8FC15; Tue, 17 May 2011 18:20:37 +0000 (UTC) Received: by qyk27 with SMTP id 27so544579qyk.13 for ; Tue, 17 May 2011 11:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7v1VBsgPjU3dhsPlO0tc+blsS/vvjtteR5F229tZ3O8=; b=mFFFDLFy2mj/VFPAm1MMsxYJQU6u/n1kXEsI/fn4H+PyECbeQvkvXpbcLmRMQfd8HI reh6OSTfzbHvKhJmw7p7sVkdmCO0qrrz1gz/J/LbLnmTIcI9HQus41qmqZwC2eaqImUT fFXeS0DuVovp0nrU/j8un8/+/sstxmO8GeN4A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bLgitOm5wTjg9pF1v28Tw5cqtbMkbZpfo32W32yaUaefJ+z5mEo8yINVGgvTlTZCN/ lppo4pzrOYLibJi8ppnVA7+DXyxbxgbpjzKUAMMi/nQmt0pff5bf9YtdN3tFXi2is/3M cYgpSbRqD3KJAeQiTSFFBqCn+dUsV4TWg+kvs= MIME-Version: 1.0 Received: by 10.229.63.96 with SMTP id a32mr671735qci.285.1305654954188; Tue, 17 May 2011 10:55:54 -0700 (PDT) Received: by 10.229.111.218 with HTTP; Tue, 17 May 2011 10:55:54 -0700 (PDT) In-Reply-To: <201105171737.p4HHbwHF040698@svn.freebsd.org> References: <201105171737.p4HHbwHF040698@svn.freebsd.org> Date: Tue, 17 May 2011 21:55:54 +0400 Message-ID: From: Sergey Kandaurov To: Poul-Henning Kamp Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222033 - head/lib/libsbuf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 18:20:38 -0000 On 17 May 2011 21:37, Poul-Henning Kamp wrote: > Author: phk > Date: Tue May 17 17:37:58 2011 > New Revision: 222033 > URL: http://svn.freebsd.org/changeset/base/222033 > > Log: > =A0Bump shlib version > =A0Instigate symbol versioning > =A0Pray that I don't break the build. File /usr/src/lib/libsbuf/Version.def: Unknown directive: `/*'. File /usr/src/lib/libsbuf/Version.def: Unknown directive: `* $FreeBSD$'. File /usr/src/lib/libsbuf/Version.def: Unknown directive: `*/'. It seems it doesn't like C-style comments, but shell-style ones. Index: Version.def =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Version.def (revision 222033) +++ Version.def (working copy) @@ -1,6 +1,4 @@ -/* - * $FreeBSD$ - */ +# $FreeBSD$ FBSD_1.2 { }; > > Added: > =A0head/lib/libsbuf/Symbol.map =A0 (contents, props changed) > =A0head/lib/libsbuf/Version.def =A0 (contents, props changed) > Modified: > =A0head/lib/libsbuf/Makefile [...] > > Added: head/lib/libsbuf/Version.def > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null =A0 00:00:00 1970 =A0 (empty, because file is newly added) > +++ head/lib/libsbuf/Version.def =A0 =A0 =A0 =A0Tue May 17 17:37:58 2011 = =A0 =A0 =A0 =A0(r222033) > @@ -0,0 +1,6 @@ > +/* > + * $FreeBSD$ > + */ > + > +FBSD_1.2 { > +}; --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Tue May 17 18:25:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44A881065673; Tue, 17 May 2011 18:25:00 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A9EF8FC17; Tue, 17 May 2011 18:25:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HIOxD6042154; Tue, 17 May 2011 18:24:59 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HIOxHY042152; Tue, 17 May 2011 18:24:59 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201105171824.p4HIOxHY042152@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 17 May 2011 18:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222034 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 18:25:00 -0000 Author: phk Date: Tue May 17 18:24:59 2011 New Revision: 222034 URL: http://svn.freebsd.org/changeset/base/222034 Log: Try to explain what sbufs do and add an example to show it. Clarify return values. Modified: head/share/man/man9/sbuf.9 Modified: head/share/man/man9/sbuf.9 ============================================================================== --- head/share/man/man9/sbuf.9 Tue May 17 17:37:58 2011 (r222033) +++ head/share/man/man9/sbuf.9 Tue May 17 18:24:59 2011 (r222034) @@ -52,7 +52,7 @@ .Nm sbuf_len , .Nm sbuf_done , .Nm sbuf_delete -.Nd safe string formatting +.Nd safe string composition .Sh SYNOPSIS .In sys/types.h .In sys/sbuf.h @@ -106,14 +106,20 @@ .Sh DESCRIPTION The .Nm -family of functions allows one to safely allocate, construct and -release bounded NUL-terminated strings in kernel space. +family of functions allows one to safely allocate, compose and +release strings in kernel or user space. +.Pp Instead of arrays of characters, these functions operate on structures called .Fa sbufs , defined in .In sys/sbuf.h . .Pp +Any errors encountered during the allocation or composition of the +string will be latched in the data structure, +making a single error test at the end of the composition +sufficient to determine success or failure of the entire process. +.Pp The .Fn sbuf_new function initializes the @@ -468,14 +474,35 @@ The function returns \-1 if copying string from userland failed, and number of bytes copied otherwise. +.Pp The -.Fn sbuf_finish -function returns ENOMEM if the sbuf overflowed before being finished, +.Fn sbuf_finish 9 +function (the kernel version) returns ENOMEM if the sbuf overflowed before +being finished, or returns the error code from the drain if one is attached. -When used as -.Xr sbuf_finish 3 , -.Fn sbuf_finish -will return \-1 and set errno on error instead. +.Pp +The +.Fn sbuf_finish 3 +function (the userland version) +will return zero for success and \-1 and set errno on error. +.Sh EXAMPLES +.Bd -literal -compact +#include + +struct sbuf *sb; + +sb = sbuf_new_auto(); +sbuf_cat("Customers found:\en"); +TAILQ_FOREACH(foo, &foolist, list) { + sbuf_printf(" %4d %s\en", foo->index, foo->name); + sbuf_printf(" Address: %s\en", foo->address); + sbuf_printf(" Zip: %s\en", foo->zipcode); +} +if (sbuf_finish(sb)) + err(1,"Could not generate message"); +transmit_msg(sbuf_data(sb), sbuf_len(sb)); +sbuf_delete(sb); +.Ed .Sh SEE ALSO .Xr printf 3 , .Xr strcat 3 , From owner-svn-src-head@FreeBSD.ORG Tue May 17 19:11:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CF41106566B; Tue, 17 May 2011 19:11:48 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 295478FC0A; Tue, 17 May 2011 19:11:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HJBmKs043633; Tue, 17 May 2011 19:11:48 GMT (envelope-from flz@svn.freebsd.org) Received: (from flz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HJBlLV043605; Tue, 17 May 2011 19:11:47 GMT (envelope-from flz@svn.freebsd.org) Message-Id: <201105171911.p4HJBlLV043605@svn.freebsd.org> From: Florent Thoumie Date: Tue, 17 May 2011 19:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222035 - in head: . lib lib/libpkg share/mk usr.sbin/pkg_install usr.sbin/pkg_install/add usr.sbin/pkg_install/create usr.sbin/pkg_install/delete usr.sbin/pkg_install/info usr.sbin/pkg... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 19:11:48 -0000 Author: flz Date: Tue May 17 19:11:47 2011 New Revision: 222035 URL: http://svn.freebsd.org/changeset/base/222035 Log: Backout libinstall.a -> libpkg commit. Discussed with: erwin, brooks, bapt Added: head/usr.sbin/pkg_install/lib/ - copied from r207112, head/usr.sbin/pkg_install/lib/ Deleted: head/lib/libpkg/ Modified: head/Makefile.inc1 head/lib/Makefile head/share/mk/bsd.libnames.mk head/usr.sbin/pkg_install/Makefile head/usr.sbin/pkg_install/Makefile.inc head/usr.sbin/pkg_install/add/Makefile head/usr.sbin/pkg_install/add/extract.c head/usr.sbin/pkg_install/add/futil.c head/usr.sbin/pkg_install/add/main.c head/usr.sbin/pkg_install/add/perform.c head/usr.sbin/pkg_install/create/Makefile head/usr.sbin/pkg_install/create/main.c head/usr.sbin/pkg_install/create/perform.c head/usr.sbin/pkg_install/create/pl.c head/usr.sbin/pkg_install/delete/Makefile head/usr.sbin/pkg_install/delete/main.c head/usr.sbin/pkg_install/delete/perform.c head/usr.sbin/pkg_install/info/Makefile head/usr.sbin/pkg_install/info/info.h head/usr.sbin/pkg_install/info/main.c head/usr.sbin/pkg_install/info/perform.c head/usr.sbin/pkg_install/info/show.c head/usr.sbin/pkg_install/updating/Makefile head/usr.sbin/pkg_install/updating/main.c head/usr.sbin/pkg_install/version/Makefile head/usr.sbin/pkg_install/version/main.c head/usr.sbin/pkg_install/version/perform.c Directory Properties: head/share/mk/bsd.arch.inc.mk (props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 17 18:24:59 2011 (r222034) +++ head/Makefile.inc1 Tue May 17 19:11:47 2011 (r222035) @@ -1205,7 +1205,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libroken} \ lib/libbz2 lib/libcom_err lib/libcrypt \ - lib/libexpat lib/libfetch \ + lib/libexpat \ ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ @@ -1238,7 +1238,6 @@ _cddl_lib= cddl/lib _secure_lib_libcrypto= secure/lib/libcrypto _secure_lib_libssl= secure/lib/libssl lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L -lib/libfetch__L: secure/lib/libcrypto__L secure/lib/libssl__L lib/libmd__L .if ${MK_OPENSSH} != "no" _secure_lib_libssh= secure/lib/libssh secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L @@ -1274,7 +1273,7 @@ _lib_libypclnt= lib/libypclnt .endif .if ${MK_OPENSSL} == "no" -lib/libfetch__L lib/libradius__L: lib/libmd__L +lib/libradius__L: lib/libmd__L .endif .for _lib in ${_prereq_libs} Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue May 17 18:24:59 2011 (r222034) +++ head/lib/Makefile Tue May 17 19:11:47 2011 (r222035) @@ -89,7 +89,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ libopie \ libpam \ libpcap \ - ${_libpkg} \ ${_libpmc} \ ${_libproc} \ libprocstat \ @@ -215,10 +214,6 @@ _libmp= libmp _libpmc= libpmc .endif -.if ${MK_PKGTOOLS} != "no" -_libpkg= libpkg -.endif - .if ${MK_SENDMAIL} != "no" _libmilter= libmilter _libsm= libsm Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Tue May 17 18:24:59 2011 (r222034) +++ head/share/mk/bsd.libnames.mk Tue May 17 19:11:47 2011 (r222035) @@ -129,7 +129,6 @@ MINUSLPAM+= -lypclnt LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a -LIBPKG?= ${DESTDIR}${LIBDIR}/libpkg.a LIBPMC?= ${DESTDIR}${LIBDIR}/libpmc.a LIBPROC?= ${DESTDIR}${LIBDIR}/libproc.a LIBPTHREAD?= ${DESTDIR}${LIBDIR}/libpthread.a Modified: head/usr.sbin/pkg_install/Makefile ============================================================================== --- head/usr.sbin/pkg_install/Makefile Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/Makefile Tue May 17 19:11:47 2011 (r222035) @@ -2,11 +2,11 @@ .include -SUBDIR= add create delete info updating version +SUBDIR= lib add create delete info updating version .include -DATE!= grep PKG_INSTALL_VERSION ${.CURDIR}/Makefile.inc | sed 's|.*=||' +DATE!= grep PKG_INSTALL_VERSION ${.CURDIR}/lib/lib.h | sed 's|.*[ ]||' distfile: clean @(cd ${.CURDIR}/..; \ Modified: head/usr.sbin/pkg_install/Makefile.inc ============================================================================== --- head/usr.sbin/pkg_install/Makefile.inc Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/Makefile.inc Tue May 17 19:11:47 2011 (r222035) @@ -2,11 +2,16 @@ .include -CFLAGS+= -DPKG_INSTALL_VERSION=20101012 -CFLAGS+= -DYES_I_KNOW_THE_API_IS_RUBBISH_AND_IS_DOOMED_TO_CHANGE +LIBINSTALL= ${.OBJDIR}/../lib/libinstall.a -DPADD+= ${LIBPKG} -LDADD+= -lpkg +DPADD+= ${LIBUTIL} +LDADD+= -lutil + +.if ${MK_OPENSSL} != "no" && \ + defined(LDADD) && ${LDADD:M-lfetch} != "" +DPADD+= ${LIBSSL} ${LIBCRYPTO} +LDADD+= -lssl -lcrypto +.endif # Inherit BINDIR from one level up. .include "../Makefile.inc" Modified: head/usr.sbin/pkg_install/add/Makefile ============================================================================== --- head/usr.sbin/pkg_install/add/Makefile Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/add/Makefile Tue May 17 19:11:47 2011 (r222035) @@ -1,11 +1,14 @@ # $FreeBSD$ -.include - PROG= pkg_add SRCS= main.c perform.c futil.c extract.c +CFLAGS+= -I${.CURDIR}/../lib + WARNS?= 3 WFORMAT?= 1 +DPADD= ${LIBINSTALL} ${LIBFETCH} ${LIBMD} +LDADD= ${LIBINSTALL} -lfetch -lmd + .include Modified: head/usr.sbin/pkg_install/add/extract.c ============================================================================== --- head/usr.sbin/pkg_install/add/extract.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/add/extract.c Tue May 17 19:11:47 2011 (r222035) @@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "lib.h" #include "add.h" Modified: head/usr.sbin/pkg_install/add/futil.c ============================================================================== --- head/usr.sbin/pkg_install/add/futil.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/add/futil.c Tue May 17 19:11:47 2011 (r222035) @@ -22,7 +22,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include "lib.h" #include "add.h" /* Modified: head/usr.sbin/pkg_install/add/main.c ============================================================================== --- head/usr.sbin/pkg_install/add/main.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/add/main.c Tue May 17 19:11:47 2011 (r222035) @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "lib.h" #include "add.h" char *Prefix = NULL; @@ -132,8 +132,6 @@ main(int argc, char **argv) static char temppackageroot[MAXPATHLEN]; static char pkgaddpath[MAXPATHLEN]; - pkg_wrap(PKG_INSTALL_VERSION, argv); - if (*argv[0] != '/' && strchr(argv[0], '/') != NULL) PkgAddCmd = realpath(argv[0], pkgaddpath); else Modified: head/usr.sbin/pkg_install/add/perform.c ============================================================================== --- head/usr.sbin/pkg_install/add/perform.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/add/perform.c Tue May 17 19:11:47 2011 (r222035) @@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "lib.h" #include "add.h" #include Modified: head/usr.sbin/pkg_install/create/Makefile ============================================================================== --- head/usr.sbin/pkg_install/create/Makefile Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/create/Makefile Tue May 17 19:11:47 2011 (r222035) @@ -3,10 +3,12 @@ PROG= pkg_create SRCS= main.c perform.c pl.c +CFLAGS+= -I${.CURDIR}/../lib + WARNS?= 3 WFORMAT?= 1 -DPADD= ${LIBMD} -LDADD= -lmd +DPADD= ${LIBINSTALL} ${LIBMD} +LDADD= ${LIBINSTALL} -lmd .include Modified: head/usr.sbin/pkg_install/create/main.c ============================================================================== --- head/usr.sbin/pkg_install/create/main.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/create/main.c Tue May 17 19:11:47 2011 (r222035) @@ -15,7 +15,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "lib.h" #include "create.h" match_t MatchType = MATCH_GLOB; @@ -72,8 +72,6 @@ main(int argc, char **argv) int ch; char **pkgs, **start, *tmp; - pkg_wrap(PKG_INSTALL_VERSION, argv); - pkgs = start = argv; while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1) switch(ch) { Modified: head/usr.sbin/pkg_install/create/perform.c ============================================================================== --- head/usr.sbin/pkg_install/create/perform.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/create/perform.c Tue May 17 19:11:47 2011 (r222035) @@ -21,7 +21,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "lib.h" #include "create.h" #include Modified: head/usr.sbin/pkg_install/create/pl.c ============================================================================== --- head/usr.sbin/pkg_install/create/pl.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/create/pl.c Tue May 17 19:11:47 2011 (r222035) @@ -21,7 +21,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "lib.h" #include "create.h" #include #include Modified: head/usr.sbin/pkg_install/delete/Makefile ============================================================================== --- head/usr.sbin/pkg_install/delete/Makefile Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/delete/Makefile Tue May 17 19:11:47 2011 (r222035) @@ -3,6 +3,11 @@ PROG= pkg_delete SRCS= main.c perform.c +CFLAGS+= -I${.CURDIR}/../lib + WFORMAT?= 1 +DPADD= ${LIBINSTALL} ${LIBMD} +LDADD= ${LIBINSTALL} -lmd + .include Modified: head/usr.sbin/pkg_install/delete/main.c ============================================================================== --- head/usr.sbin/pkg_install/delete/main.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/delete/main.c Tue May 17 19:11:47 2011 (r222035) @@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "lib.h" #include "delete.h" char *Prefix = NULL; @@ -67,8 +67,6 @@ main(int argc, char **argv) const char *tmp; struct stat stat_s; - pkg_wrap(PKG_INSTALL_VERSION, argv); - pkgs = start = argv; while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1) switch(ch) { Modified: head/usr.sbin/pkg_install/delete/perform.c ============================================================================== --- head/usr.sbin/pkg_install/delete/perform.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/delete/perform.c Tue May 17 19:11:47 2011 (r222035) @@ -22,7 +22,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include "lib.h" #include "delete.h" static int pkg_do(char *); Modified: head/usr.sbin/pkg_install/info/Makefile ============================================================================== --- head/usr.sbin/pkg_install/info/Makefile Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/info/Makefile Tue May 17 19:11:47 2011 (r222035) @@ -3,9 +3,11 @@ PROG= pkg_info SRCS= main.c perform.c show.c +CFLAGS+= -I${.CURDIR}/../lib + WFORMAT?= 1 -DPADD= ${LIBMD} -LDADD= -lmd +DPADD= ${LIBINSTALL} ${LIBFETCH} ${LIBMD} +LDADD= ${LIBINSTALL} -lfetch -lmd .include Modified: head/usr.sbin/pkg_install/info/info.h ============================================================================== --- head/usr.sbin/pkg_install/info/info.h Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/info/info.h Tue May 17 19:11:47 2011 (r222035) @@ -33,26 +33,25 @@ #define MAXNAMESIZE 20 #endif -#define SHOW_COMMENT 0x000001 -#define SHOW_DESC 0x000002 -#define SHOW_PLIST 0x000004 -#define SHOW_INSTALL 0x000008 -#define SHOW_DEINSTALL 0x000010 -#define SHOW_REQUIRE 0x000020 -#define SHOW_PREFIX 0x000040 -#define SHOW_INDEX 0x000080 -#define SHOW_FILES 0x000100 -#define SHOW_DISPLAY 0x000200 -#define SHOW_REQBY 0x000400 -#define SHOW_MTREE 0x000800 -#define SHOW_SIZE 0x001000 -#define SHOW_ORIGIN 0x002000 -#define SHOW_CKSUM 0x004000 -#define SHOW_FMTREV 0x008000 -#define SHOW_PTREV 0x010000 -#define SHOW_DEPEND 0x020000 -#define SHOW_PKGNAME 0x040000 -#define SHOW_LPREV 0x100000 +#define SHOW_COMMENT 0x00001 +#define SHOW_DESC 0x00002 +#define SHOW_PLIST 0x00004 +#define SHOW_INSTALL 0x00008 +#define SHOW_DEINSTALL 0x00010 +#define SHOW_REQUIRE 0x00020 +#define SHOW_PREFIX 0x00040 +#define SHOW_INDEX 0x00080 +#define SHOW_FILES 0x00100 +#define SHOW_DISPLAY 0x00200 +#define SHOW_REQBY 0x00400 +#define SHOW_MTREE 0x00800 +#define SHOW_SIZE 0x01000 +#define SHOW_ORIGIN 0x02000 +#define SHOW_CKSUM 0x04000 +#define SHOW_FMTREV 0x08000 +#define SHOW_PTREV 0x10000 +#define SHOW_DEPEND 0x20000 +#define SHOW_PKGNAME 0x40000 struct which_entry { TAILQ_ENTRY(which_entry) next; Modified: head/usr.sbin/pkg_install/info/main.c ============================================================================== --- head/usr.sbin/pkg_install/info/main.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/info/main.c Tue May 17 19:11:47 2011 (r222035) @@ -25,7 +25,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "lib.h" #include "info.h" int Flags = 0; @@ -68,8 +68,6 @@ main(int argc, char **argv) char **pkgs, **start; char *pkgs_split; - pkg_wrap(PKG_INSTALL_VERSION, argv); - whead = malloc(sizeof(struct which_head)); if (whead == NULL) err(2, NULL); @@ -227,10 +225,7 @@ main(int argc, char **argv) } case 'P': - if (Flags & SHOW_PTREV) - Flags |= SHOW_LPREV; - else - Flags = SHOW_PTREV; + Flags = SHOW_PTREV; break; case 'h': @@ -247,11 +242,6 @@ main(int argc, char **argv) if (!Quiet) printf("Package tools revision: "); printf("%d\n", PKG_INSTALL_VERSION); - if (Flags & SHOW_LPREV) { - if (!Quiet) - printf("Libpkg revision: "); - printf("%d\n", libpkg_version()); - } exit(0); } Modified: head/usr.sbin/pkg_install/info/perform.c ============================================================================== --- head/usr.sbin/pkg_install/info/perform.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/info/perform.c Tue May 17 19:11:47 2011 (r222035) @@ -21,7 +21,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "lib.h" #include "info.h" #include #include Modified: head/usr.sbin/pkg_install/info/show.c ============================================================================== --- head/usr.sbin/pkg_install/info/show.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/info/show.c Tue May 17 19:11:47 2011 (r222035) @@ -21,7 +21,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "lib.h" #include "info.h" #include #include Modified: head/usr.sbin/pkg_install/updating/Makefile ============================================================================== --- head/usr.sbin/pkg_install/updating/Makefile Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/updating/Makefile Tue May 17 19:11:47 2011 (r222035) @@ -3,6 +3,11 @@ PROG= pkg_updating SRCS= main.c +CFLAGS+= -I${.CURDIR}/../lib + WFORMAT?= 1 +DPADD= ${LIBINSTALL} ${LIBFETCH} ${LIBMD} +LDADD= ${LIBINSTALL} -lfetch -lmd + .include Modified: head/usr.sbin/pkg_install/updating/main.c ============================================================================== --- head/usr.sbin/pkg_install/updating/main.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/updating/main.c Tue May 17 19:11:47 2011 (r222035) @@ -19,7 +19,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "lib.h" #include "pathnames.h" typedef struct installedport { @@ -87,8 +87,6 @@ main(int argc, char *argv[]) DIR *dir; FILE *fd; - pkg_wrap(PKG_INSTALL_VERSION, argv); - while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1) { switch (ch) { case 'd': Modified: head/usr.sbin/pkg_install/version/Makefile ============================================================================== --- head/usr.sbin/pkg_install/version/Makefile Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/version/Makefile Tue May 17 19:11:47 2011 (r222035) @@ -3,8 +3,13 @@ PROG= pkg_version SRCS= main.c perform.c +CFLAGS+= -I${.CURDIR}/../lib + WFORMAT?= 1 +DPADD= ${LIBINSTALL} ${LIBFETCH} ${LIBMD} +LDADD= ${LIBINSTALL} -lfetch -lmd + test: sh ${.CURDIR}/test-pkg_version.sh Modified: head/usr.sbin/pkg_install/version/main.c ============================================================================== --- head/usr.sbin/pkg_install/version/main.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/version/main.c Tue May 17 19:11:47 2011 (r222035) @@ -25,7 +25,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "lib.h" #include "version.h" char *LimitChars = NULL; @@ -58,8 +58,6 @@ main(int argc, char **argv) { int ch, cmp = 0; - pkg_wrap(PKG_INSTALL_VERSION, argv); - if (argc == 4 && !strcmp(argv[1], "-t")) { cmp = version_cmp(argv[2], argv[3]); printf(cmp > 0 ? ">\n" : (cmp < 0 ? "<\n" : "=\n")); Modified: head/usr.sbin/pkg_install/version/perform.c ============================================================================== --- head/usr.sbin/pkg_install/version/perform.c Tue May 17 18:24:59 2011 (r222034) +++ head/usr.sbin/pkg_install/version/perform.c Tue May 17 19:11:47 2011 (r222035) @@ -21,7 +21,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "lib.h" #include "version.h" #include #include From owner-svn-src-head@FreeBSD.ORG Tue May 17 19:20:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6694106566C; Tue, 17 May 2011 19:20:32 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCA258FC0A; Tue, 17 May 2011 19:20:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HJKWwV043918; Tue, 17 May 2011 19:20:32 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HJKWKv043916; Tue, 17 May 2011 19:20:32 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201105171920.p4HJKWKv043916@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 17 May 2011 19:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222036 - head/lib/libsbuf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 19:20:33 -0000 Author: phk Date: Tue May 17 19:20:32 2011 New Revision: 222036 URL: http://svn.freebsd.org/changeset/base/222036 Log: Ok, so we use different comment conventions in Symbol.map and Version.def "#notimpressed" as my twittering friends would say. Modified: head/lib/libsbuf/Version.def Modified: head/lib/libsbuf/Version.def ============================================================================== --- head/lib/libsbuf/Version.def Tue May 17 19:11:47 2011 (r222035) +++ head/lib/libsbuf/Version.def Tue May 17 19:20:32 2011 (r222036) @@ -1,6 +1,4 @@ -/* - * $FreeBSD$ - */ +# $FreeBSD$ FBSD_1.2 { }; From owner-svn-src-head@FreeBSD.ORG Tue May 17 21:03:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 341D7106566B; Tue, 17 May 2011 21:03:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 235098FC12; Tue, 17 May 2011 21:03:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HL3ZEO046979; Tue, 17 May 2011 21:03:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HL3ZY0046977; Tue, 17 May 2011 21:03:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105172103.p4HL3ZY0046977@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 17 May 2011 21:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222037 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 21:03:35 -0000 Author: jilles Date: Tue May 17 21:03:34 2011 New Revision: 222037 URL: http://svn.freebsd.org/changeset/base/222037 Log: mq_setattr(2): Add missing const to man page. The declaration in the header file is correct. MFC after: 1 week Modified: head/lib/libc/sys/mq_setattr.2 Modified: head/lib/libc/sys/mq_setattr.2 ============================================================================== --- head/lib/libc/sys/mq_setattr.2 Tue May 17 19:20:32 2011 (r222036) +++ head/lib/libc/sys/mq_setattr.2 Tue May 17 21:03:34 2011 (r222037) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2005 +.Dd May 17, 2011 .Dt MQ_SETATTR 2 .Os .Sh NAME @@ -50,7 +50,7 @@ .Ft int .Fo mq_setattr .Fa "mqd_t mqdes" -.Fa "struct mq_attr *restrict mqstat" +.Fa "const struct mq_attr *restrict mqstat" .Fa "struct mq_attr *restrict omqstat" .Fc .Sh DESCRIPTION From owner-svn-src-head@FreeBSD.ORG Tue May 17 22:07:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F1451065670; Tue, 17 May 2011 22:07:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C9D18FC1B; Tue, 17 May 2011 22:07:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HM7j8r048960; Tue, 17 May 2011 22:07:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HM7jpV048956; Tue, 17 May 2011 22:07:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201105172207.p4HM7jpV048956@svn.freebsd.org> From: Alexander Motin Date: Tue, 17 May 2011 22:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222039 - in head: share/man/man4 sys/dev/ahci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 22:07:45 -0000 Author: mav Date: Tue May 17 22:07:45 2011 New Revision: 222039 URL: http://svn.freebsd.org/changeset/base/222039 Log: Add support for "LED" enclosure management messages, defined by the AHCI. When supported by hardware, this allows to control per-port activity, locate and fault LEDs via the led(4) API for localization and status reporting purposes. Supporting AHCI controllers may transmit that information to the backplane controllers via SGPIO interface. Backplane controllers interpret received statuses in some way (IBPI standard) to report them using present indicators. Modified: head/share/man/man4/ahci.4 head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h Modified: head/share/man/man4/ahci.4 ============================================================================== --- head/share/man/man4/ahci.4 Tue May 17 22:03:01 2011 (r222038) +++ head/share/man/man4/ahci.4 Tue May 17 22:07:45 2011 (r222039) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 28, 2010 +.Dd May 17, 2011 .Dt AHCI 4 .Os .Sh NAME @@ -121,6 +121,15 @@ hardware command queues (up to 32 comman Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. .Pp +Driver supports "LED" enclosure management messages, defined by the AHCI. +When supported by hardware, it allows to control per-port activity, locate +and fault LEDs via the +.Xr led 4 +API for localization and status reporting purposes. +Supporting AHCI controllers may transmit that information to the backplane +controllers via SGPIO interface. Backplane controllers interpret received +statuses in some way (IBPI standard) to report them using present indicators. +.Pp AHCI hardware is also supported by ataahci driver from .Xr ata 4 subsystem. @@ -135,6 +144,15 @@ subclass 6 (SATA) and programming interf Also, in cooperation with atamarvell and atajmicron drivers of ata(4), it supports AHCI part of legacy-PATA + AHCI-SATA combined controllers, such as JMicron JMB36x and Marvell 88SX61xx. +.Sh FILES +.Bl -tag -width /dev/led/ahcich*.locate +.It Pa /dev/led/ahcich*.act +activity LED device nodes +.It Pa /dev/led/ahcich*.fault +fault LED device nodes +.It Pa /dev/led/ahcich*.locate +locate LED device nodes +.El .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Tue May 17 22:03:01 2011 (r222038) +++ head/sys/dev/ahci/ahci.c Tue May 17 22:07:45 2011 (r222039) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "ahci.h" @@ -68,6 +69,7 @@ static int ahci_ch_resume(device_t dev); static void ahci_ch_pm(void *arg); static void ahci_ch_intr_locked(void *data); static void ahci_ch_intr(void *data); +static void ahci_ch_led(void *priv, int onoff); static int ahci_ctlr_reset(device_t dev); static int ahci_ctlr_setup(device_t dev); static void ahci_begin_transaction(device_t dev, union ccb *ccb); @@ -418,6 +420,8 @@ ahci_attach(device_t dev) ctlr->caps &= ~AHCI_CAP_SNCQ; if ((ctlr->caps & AHCI_CAP_CCCS) == 0) ctlr->ccc = 0; + mtx_init(&ctlr->em_mtx, "AHCI EM lock", NULL, MTX_DEF); + ctlr->emloc = ATA_INL(ctlr->r_mem, AHCI_EM_LOC); ahci_ctlr_setup(dev); /* Setup interrupts. */ if (ahci_setup_interrupt(dev)) { @@ -521,6 +525,7 @@ ahci_detach(device_t dev) rman_fini(&ctlr->sc_iomem); if (ctlr->r_mem) bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); + mtx_destroy(&ctlr->em_mtx); return (0); } @@ -887,6 +892,7 @@ ahci_ch_attach(device_t dev) struct cam_devq *devq; int rid, error, i, sata_rev = 0; u_int32_t version; + char buf[32]; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); @@ -995,6 +1001,25 @@ ahci_ch_attach(device_t dev) ahci_ch_pm, dev); } mtx_unlock(&ch->mtx); + if ((ch->caps & AHCI_CAP_EMS) && + (ctlr->capsem & AHCI_EM_LED)) { + for (i = 0; i < AHCI_NUM_LEDS; i++) { + ch->leds[i].dev = dev; + ch->leds[i].num = i; + } + if ((ctlr->capsem & AHCI_EM_ALHD) == 0) { + snprintf(buf, sizeof(buf), "%s.act", + device_get_nameunit(dev)); + ch->leds[0].led = led_create(ahci_ch_led, + &ch->leds[0], buf); + } + snprintf(buf, sizeof(buf), "%s.locate", + device_get_nameunit(dev)); + ch->leds[1].led = led_create(ahci_ch_led, &ch->leds[1], buf); + snprintf(buf, sizeof(buf), "%s.fault", + device_get_nameunit(dev)); + ch->leds[2].led = led_create(ahci_ch_led, &ch->leds[2], buf); + } return (0); err3: @@ -1014,7 +1039,12 @@ static int ahci_ch_detach(device_t dev) { struct ahci_channel *ch = device_get_softc(dev); + int i; + for (i = 0; i < AHCI_NUM_LEDS; i++) { + if (ch->leds[i].led) + led_destroy(ch->leds[i].led); + } mtx_lock(&ch->mtx); xpt_async(AC_LOST_DEVICE, ch->path, NULL); /* Forget about reset. */ @@ -1137,6 +1167,47 @@ static driver_t ahcich_driver = { }; DRIVER_MODULE(ahcich, ahci, ahcich_driver, ahcich_devclass, 0, 0); +static void +ahci_ch_setleds(device_t dev) +{ + struct ahci_channel *ch; + struct ahci_controller *ctlr; + size_t buf; + int i, timeout; + int16_t val; + + ctlr = device_get_softc(device_get_parent(dev)); + ch = device_get_softc(dev); + + val = 0; + for (i = 0; i < AHCI_NUM_LEDS; i++) + val |= ch->leds[i].state << (i * 3); + + buf = (ctlr->emloc & 0xffff0000) >> 14; + mtx_lock(&ctlr->em_mtx); + timeout = 1000; + while (ATA_INL(ctlr->r_mem, AHCI_EM_CTL) & (AHCI_EM_TM | AHCI_EM_RST) && + --timeout > 0) + DELAY(1000); + if (timeout == 0) + device_printf(dev, "EM timeout\n"); + ATA_OUTL(ctlr->r_mem, buf, (1 << 8) | (0 << 16) | (0 << 24)); + ATA_OUTL(ctlr->r_mem, buf + 4, ch->unit | (val << 16)); + ATA_OUTL(ctlr->r_mem, AHCI_EM_CTL, AHCI_EM_TM); + mtx_unlock(&ctlr->em_mtx); +} + +static void +ahci_ch_led(void *priv, int onoff) +{ + struct ahci_led *led; + + led = (struct ahci_led *)priv; + + led->state = onoff; + ahci_ch_setleds(led->dev); +} + struct ahci_dc_cb_args { bus_addr_t maddr; int error; Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Tue May 17 22:03:01 2011 (r222038) +++ head/sys/dev/ahci/ahci.h Tue May 17 22:07:45 2011 (r222039) @@ -376,6 +376,15 @@ struct ahci_device { u_int caps; }; +struct ahci_led { + device_t dev; /* Device handle */ + struct cdev *led; + uint8_t num; /* Number of this led */ + uint8_t state; /* State of this led */ +}; + +#define AHCI_NUM_LEDS 3 + /* structure describing an ATA channel */ struct ahci_channel { device_t dev; /* Device handle */ @@ -386,6 +395,7 @@ struct ahci_channel { struct ata_dma dma; /* DMA data */ struct cam_sim *sim; struct cam_path *path; + struct ahci_led leds[3]; uint32_t caps; /* Controller capabilities */ uint32_t caps2; /* Controller capabilities */ uint32_t chcaps; /* Channel capabilities */ @@ -443,6 +453,7 @@ struct ahci_controller { uint32_t caps; /* Controller capabilities */ uint32_t caps2; /* Controller capabilities */ uint32_t capsem; /* Controller capabilities */ + uint32_t emloc; /* EM buffer location */ int quirks; int numirqs; int channels; @@ -453,6 +464,7 @@ struct ahci_controller { void (*function)(void *); void *argument; } interrupt[AHCI_MAX_PORTS]; + struct mtx em_mtx; /* EM access lock */ }; enum ahci_err_type { From owner-svn-src-head@FreeBSD.ORG Tue May 17 22:14:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BD39106566B; Tue, 17 May 2011 22:14:01 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FFC48FC15; Tue, 17 May 2011 22:14:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HME1JQ049186; Tue, 17 May 2011 22:14:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HME1DO049184; Tue, 17 May 2011 22:14:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105172214.p4HME1DO049184@svn.freebsd.org> From: Attilio Rao Date: Tue, 17 May 2011 22:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222040 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 22:14:01 -0000 Author: attilio Date: Tue May 17 22:14:00 2011 New Revision: 222040 URL: http://svn.freebsd.org/changeset/base/222040 Log: Merge r221285 from largeSMP project: - Remove the following sysctl: kern.sched.ipiwakeup.onecpu kern.sched.ipiwakeup.htt2 Because they are absolutely obsolete. Probabilly the whole wakeup forward mechanism should be revisited for a better fitting in modern hw, in the future. - As map2 variable is no longer used rename map3 to map2 - Fix a string by making more informative the msg and removing the arguments passing. Reviewed by: julian Tested by: several Modified: head/sys/kern/sched_4bsd.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Tue May 17 22:07:45 2011 (r222039) +++ head/sys/kern/sched_4bsd.c Tue May 17 22:14:00 2011 (r222040) @@ -235,16 +235,6 @@ SYSCTL_INT(_kern_sched_ipiwakeup, OID_AU &forward_wakeup_use_loop, 0, "Use a loop to find idle cpus"); -static int forward_wakeup_use_single = 0; -SYSCTL_INT(_kern_sched_ipiwakeup, OID_AUTO, onecpu, CTLFLAG_RW, - &forward_wakeup_use_single, 0, - "Only signal one idle cpu"); - -static int forward_wakeup_use_htt = 0; -SYSCTL_INT(_kern_sched_ipiwakeup, OID_AUTO, htt2, CTLFLAG_RW, - &forward_wakeup_use_htt, 0, - "account for htt"); - #endif #if 0 static int sched_followon = 0; @@ -1064,7 +1054,7 @@ static int forward_wakeup(int cpunum) { struct pcpu *pc; - cpumask_t dontuse, id, map, map2, map3, me; + cpumask_t dontuse, id, map, map2, me; mtx_assert(&sched_lock, MA_OWNED); @@ -1089,13 +1079,13 @@ forward_wakeup(int cpunum) return (0); dontuse = me | stopped_cpus | hlt_cpus_mask; - map3 = 0; + map2 = 0; if (forward_wakeup_use_loop) { SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { id = pc->pc_cpumask; if ((id & dontuse) == 0 && pc->pc_curthread == pc->pc_idlethread) { - map3 |= id; + map2 |= id; } } } @@ -1106,33 +1096,19 @@ forward_wakeup(int cpunum) /* If they are both on, compare and use loop if different. */ if (forward_wakeup_use_loop) { - if (map != map3) { - printf("map (%02X) != map3 (%02X)\n", map, - map3); - map = map3; + if (map != map2) { + printf("map != map2, loop method preferred\n"); + map = map2; } } } else { - map = map3; + map = map2; } /* If we only allow a specific CPU, then mask off all the others. */ if (cpunum != NOCPU) { KASSERT((cpunum <= mp_maxcpus),("forward_wakeup: bad cpunum.")); map &= (1 << cpunum); - } else { - /* Try choose an idle die. */ - if (forward_wakeup_use_htt) { - map2 = (map & (map >> 1)) & 0x5555; - if (map2) { - map = map2; - } - } - - /* Set only one bit. */ - if (forward_wakeup_use_single) { - map = map & ((~map) + 1); - } } if (map) { forward_wakeups_delivered++; From owner-svn-src-head@FreeBSD.ORG Tue May 17 22:15:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D373D106567D; Tue, 17 May 2011 22:15:53 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C21F78FC21; Tue, 17 May 2011 22:15:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HMFrNv049278; Tue, 17 May 2011 22:15:53 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HMFrYP049276; Tue, 17 May 2011 22:15:53 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105172215.p4HMFrYP049276@svn.freebsd.org> From: Attilio Rao Date: Tue, 17 May 2011 22:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222041 - head/sys/i386/include/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 22:15:53 -0000 Author: attilio Date: Tue May 17 22:15:53 2011 New Revision: 222041 URL: http://svn.freebsd.org/changeset/base/222041 Log: Remove an unused typedef. Tested by: sbruno, pluknet Modified: head/sys/i386/include/xen/xenvar.h Modified: head/sys/i386/include/xen/xenvar.h ============================================================================== --- head/sys/i386/include/xen/xenvar.h Tue May 17 22:14:00 2011 (r222040) +++ head/sys/i386/include/xen/xenvar.h Tue May 17 22:15:53 2011 (r222041) @@ -99,7 +99,6 @@ void xpq_init(void); (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) #define DECLARE_BITMAP(name,bits) \ unsigned long name[BITS_TO_LONGS(bits)] -typedef struct { DECLARE_BITMAP(bits, NR_CPUS); } xen_cpumask_t; int xen_create_contiguous_region(vm_page_t pages, int npages); From owner-svn-src-head@FreeBSD.ORG Tue May 17 22:36:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 230D2106564A; Tue, 17 May 2011 22:36:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 100598FC18; Tue, 17 May 2011 22:36:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HMaGO9049966; Tue, 17 May 2011 22:36:16 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HMaGgD049961; Tue, 17 May 2011 22:36:16 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201105172236.p4HMaGgD049961@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 17 May 2011 22:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222043 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 22:36:17 -0000 Author: jkim Date: Tue May 17 22:36:16 2011 New Revision: 222043 URL: http://svn.freebsd.org/changeset/base/222043 Log: Update CPUID bits to reflect AMD Bulldozer and Intel Sandy Bridge features. Note AMD dropped SSE5 extensions in order to avoid ISA overlap with Intel AVX instructions. The SSE5 bit was recycled as XOP extended instruction bit, CVT16 was deprecated in favor of F16C (half-precision float conversion instructions for AVX), and the remaining FMA4 (4-operand FMA instructions) gained a separate CPUID bit. Replace non-existent references with today's CPUID specifications. Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/include/specialreg.h head/sys/i386/i386/identcpu.c head/sys/i386/include/specialreg.h Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Tue May 17 22:27:35 2011 (r222042) +++ head/sys/amd64/amd64/identcpu.c Tue May 17 22:36:16 2011 (r222043) @@ -216,6 +216,14 @@ printcpuinfo(void) printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); printf(" Stepping = %u", cpu_id & CPUID_STEPPING); + + /* + * AMD CPUID Specification + * http://support.amd.com/us/Embedded_TechDocs/25481.pdf + * + * Intel Processor Identification and CPUID Instruction + * http://www.intel.com/assets/pdf/appnote/241618.pdf + */ if (cpu_high > 0) { /* @@ -277,38 +285,29 @@ printcpuinfo(void) "\012SSSE3" /* SSSE3 */ "\013CNXT-ID" /* L1 context ID available */ "\014" - "\015" + "\015FMA" /* Fused Multiply Add */ "\016CX16" /* CMPXCHG16B Instruction */ "\017xTPR" /* Send Task Priority Messages*/ "\020PDCM" /* Perf/Debug Capability MSR */ "\021" - "\022PCID" /* Process-context Identifiers */ + "\022PCID" /* Process-context Identifiers*/ "\023DCA" /* Direct Cache Access */ - "\024SSE4.1" - "\025SSE4.2" + "\024SSE4.1" /* SSE 4.1 */ + "\025SSE4.2" /* SSE 4.2 */ "\026x2APIC" /* xAPIC Extensions */ - "\027MOVBE" - "\030POPCNT" - "\031" - "\032AESNI" /* AES Crypto*/ - "\033XSAVE" - "\034OSXSAVE" - "\035" - "\036" + "\027MOVBE" /* MOVBE Instruction */ + "\030POPCNT" /* POPCNT Instruction */ + "\031TSCDLT" /* TSC-Deadline Timer */ + "\032AESNI" /* AES Crypto */ + "\033XSAVE" /* XSAVE/XRSTOR States */ + "\034OSXSAVE" /* OS-Enabled State Management*/ + "\035AVX" /* Advanced Vector Extensions */ + "\036F16C" /* Half-precision conversions */ "\037" "\040HV" /* Hypervisor */ ); } - /* - * AMD64 Architecture Programmer's Manual Volume 3: - * General-Purpose and System Instructions - * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24594.pdf - * - * IA-32 Intel Architecture Software Developer's Manual, - * Volume 2A: Instruction Set Reference, A-M - * ftp://download.intel.com/design/Pentium4/manuals/25366617.pdf - */ if (amd_feature != 0) { printf("\n AMD Features=0x%b", amd_feature, "\020" /* in hex */ @@ -361,18 +360,18 @@ printcpuinfo(void) "\011Prefetch" /* 3DNow! Prefetch/PrefetchW */ "\012OSVW" /* OS visible workaround */ "\013IBS" /* Instruction based sampling */ - "\014SSE5" /* SSE5 */ + "\014XOP" /* XOP extended instructions */ "\015SKINIT" /* SKINIT/STGI */ "\016WDT" /* Watchdog timer */ "\017" - "\020" - "\021" + "\020LWP" /* Lightweight Profiling */ + "\021FMA4" /* 4-operand FMA instructions */ "\022" "\023" - "\024" + "\024NodeId" /* NodeId MSR support */ "\025" - "\026" - "\027" + "\026TBM" /* Trailing Bit Manipulation */ + "\027Topology" /* Topology Extensions */ "\030" "\031" "\032" Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Tue May 17 22:27:35 2011 (r222042) +++ head/sys/amd64/include/specialreg.h Tue May 17 22:36:16 2011 (r222043) @@ -123,6 +123,7 @@ #define CPUID2_TM2 0x00000100 #define CPUID2_SSSE3 0x00000200 #define CPUID2_CNXTID 0x00000400 +#define CPUID2_FMA 0x00001000 #define CPUID2_CX16 0x00002000 #define CPUID2_XTPR 0x00004000 #define CPUID2_PDCM 0x00008000 @@ -133,7 +134,12 @@ #define CPUID2_X2APIC 0x00200000 #define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 +#define CPUID2_TSCDLT 0x01000000 #define CPUID2_AESNI 0x02000000 +#define CPUID2_XSAVE 0x04000000 +#define CPUID2_OSXSAVE 0x08000000 +#define CPUID2_AVX 0x10000000 +#define CPUID2_F16C 0x20000000 #define CPUID2_HV 0x80000000 /* @@ -170,9 +176,14 @@ #define AMDID2_PREFETCH 0x00000100 #define AMDID2_OSVW 0x00000200 #define AMDID2_IBS 0x00000400 -#define AMDID2_SSE5 0x00000800 +#define AMDID2_XOP 0x00000800 #define AMDID2_SKINIT 0x00001000 #define AMDID2_WDT 0x00002000 +#define AMDID2_LWP 0x00008000 +#define AMDID2_FMA4 0x00010000 +#define AMDID2_NODE_ID 0x00080000 +#define AMDID2_TBM 0x00200000 +#define AMDID2_TOPOLOGY 0x00400000 /* * CPUID instruction 1 eax info Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Tue May 17 22:27:35 2011 (r222042) +++ head/sys/i386/i386/identcpu.c Tue May 17 22:36:16 2011 (r222043) @@ -693,6 +693,13 @@ printcpuinfo(void) printf(" Stepping = %u", cpu_id & CPUID_STEPPING); if (cpu_vendor_id == CPU_VENDOR_CYRIX) printf("\n DIR=0x%04x", cyrix_did); + /* + * AMD CPUID Specification + * http://support.amd.com/us/Embedded_TechDocs/25481.pdf + * + * Intel Processor Identification and CPUID Instruction + * http://www.intel.com/assets/pdf/appnote/241618.pdf + */ if (cpu_high > 0) { /* @@ -754,38 +761,29 @@ printcpuinfo(void) "\012SSSE3" /* SSSE3 */ "\013CNXT-ID" /* L1 context ID available */ "\014" - "\015" + "\015FMA" /* Fused Multiply Add */ "\016CX16" /* CMPXCHG16B Instruction */ "\017xTPR" /* Send Task Priority Messages*/ "\020PDCM" /* Perf/Debug Capability MSR */ "\021" - "\022PCID" /* Process-context Identifiers */ + "\022PCID" /* Process-context Identifiers*/ "\023DCA" /* Direct Cache Access */ - "\024SSE4.1" - "\025SSE4.2" + "\024SSE4.1" /* SSE 4.1 */ + "\025SSE4.2" /* SSE 4.2 */ "\026x2APIC" /* xAPIC Extensions */ - "\027MOVBE" - "\030POPCNT" - "\031" - "\032AESNI" /* AES Crypto*/ - "\033XSAVE" - "\034OSXSAVE" - "\035" - "\036" + "\027MOVBE" /* MOVBE Instruction */ + "\030POPCNT" /* POPCNT Instruction */ + "\031TSCDLT" /* TSC-Deadline Timer */ + "\032AESNI" /* AES Crypto */ + "\033XSAVE" /* XSAVE/XRSTOR States */ + "\034OSXSAVE" /* OS-Enabled State Management*/ + "\035AVX" /* Advanced Vector Extensions */ + "\036F16C" /* Half-precision conversions */ "\037" "\040HV" /* Hypervisor */ ); } - /* - * AMD64 Architecture Programmer's Manual Volume 3: - * General-Purpose and System Instructions - * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24594.pdf - * - * IA-32 Intel Architecture Software Developer's Manual, - * Volume 2A: Instruction Set Reference, A-M - * ftp://download.intel.com/design/Pentium4/manuals/25366617.pdf - */ if (amd_feature != 0) { printf("\n AMD Features=0x%b", amd_feature, "\020" /* in hex */ @@ -838,18 +836,18 @@ printcpuinfo(void) "\011Prefetch" /* 3DNow! Prefetch/PrefetchW */ "\012OSVW" /* OS visible workaround */ "\013IBS" /* Instruction based sampling */ - "\014SSE5" /* SSE5 */ + "\014XOP" /* XOP extended instructions */ "\015SKINIT" /* SKINIT/STGI */ "\016WDT" /* Watchdog timer */ "\017" - "\020" - "\021" + "\020LWP" /* Lightweight Profiling */ + "\021FMA4" /* 4-operand FMA instructions */ "\022" "\023" - "\024" + "\024NodeId" /* NodeId MSR support */ "\025" - "\026" - "\027" + "\026TBM" /* Trailing Bit Manipulation */ + "\027Topology" /* Topology Extensions */ "\030" "\031" "\032" Modified: head/sys/i386/include/specialreg.h ============================================================================== --- head/sys/i386/include/specialreg.h Tue May 17 22:27:35 2011 (r222042) +++ head/sys/i386/include/specialreg.h Tue May 17 22:36:16 2011 (r222043) @@ -120,6 +120,7 @@ #define CPUID2_TM2 0x00000100 #define CPUID2_SSSE3 0x00000200 #define CPUID2_CNXTID 0x00000400 +#define CPUID2_FMA 0x00001000 #define CPUID2_CX16 0x00002000 #define CPUID2_XTPR 0x00004000 #define CPUID2_PDCM 0x00008000 @@ -130,7 +131,12 @@ #define CPUID2_X2APIC 0x00200000 #define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 +#define CPUID2_TSCDLT 0x01000000 #define CPUID2_AESNI 0x02000000 +#define CPUID2_XSAVE 0x04000000 +#define CPUID2_OSXSAVE 0x08000000 +#define CPUID2_AVX 0x10000000 +#define CPUID2_F16C 0x20000000 #define CPUID2_HV 0x80000000 /* @@ -167,9 +173,14 @@ #define AMDID2_PREFETCH 0x00000100 #define AMDID2_OSVW 0x00000200 #define AMDID2_IBS 0x00000400 -#define AMDID2_SSE5 0x00000800 +#define AMDID2_XOP 0x00000800 #define AMDID2_SKINIT 0x00001000 #define AMDID2_WDT 0x00002000 +#define AMDID2_LWP 0x00008000 +#define AMDID2_FMA4 0x00010000 +#define AMDID2_NODE_ID 0x00080000 +#define AMDID2_TBM 0x00200000 +#define AMDID2_TOPOLOGY 0x00400000 /* * CPUID instruction 1 eax info From owner-svn-src-head@FreeBSD.ORG Wed May 18 07:20:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 928171065670; Wed, 18 May 2011 07:20:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 784AC8FC08; Wed, 18 May 2011 07:20:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4I7KVqr065763; Wed, 18 May 2011 07:20:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4I7KVqb065761; Wed, 18 May 2011 07:20:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105180720.p4I7KVqb065761@svn.freebsd.org> From: Adrian Chadd Date: Wed, 18 May 2011 07:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222049 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 07:20:31 -0000 Author: adrian Date: Wed May 18 07:20:30 2011 New Revision: 222049 URL: http://svn.freebsd.org/changeset/base/222049 Log: Modify the sample rate control algorithm to only select/sample HT rates for HT nodes. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Wed May 18 02:14:26 2011 (r222048) +++ head/sys/dev/ath/ath_rate/sample/sample.c Wed May 18 07:20:30 2011 (r222049) @@ -161,9 +161,10 @@ dot11rate_label(const HAL_RATE_TABLE *rt * or -1 if all the average_tx_times are 0. */ static __inline int -pick_best_rate(struct sample_node *sn, const HAL_RATE_TABLE *rt, +pick_best_rate(struct ath_node *an, const HAL_RATE_TABLE *rt, int size_bin, int require_acked_before) { + struct sample_node *sn = ATH_NODE_SAMPLE(an); int best_rate_rix, best_rate_tt; uint32_t mask; int rix, tt; @@ -174,6 +175,12 @@ pick_best_rate(struct sample_node *sn, c if ((mask & 1) == 0) /* not a supported rate */ continue; + /* Don't pick a non-HT rate for a HT node */ + if ((an->an_node.ni_flags & IEEE80211_NODE_HT) && + (rt->info[rix].phy != IEEE80211_T_HT)) { + continue; + } + tt = sn->stats[size_bin][rix].average_tx_time; if (tt <= 0 || (require_acked_before && @@ -196,11 +203,12 @@ pick_best_rate(struct sample_node *sn, c * Pick a good "random" bit-rate to sample other than the current one. */ static __inline int -pick_sample_rate(struct sample_softc *ssc , struct sample_node *sn, +pick_sample_rate(struct sample_softc *ssc , struct ath_node *an, const HAL_RATE_TABLE *rt, int size_bin) { #define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) #define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) + struct sample_node *sn = ATH_NODE_SAMPLE(an); int current_rix, rix; unsigned current_tt; uint32_t mask; @@ -208,6 +216,7 @@ pick_sample_rate(struct sample_softc *ss current_rix = sn->current_rix[size_bin]; if (current_rix < 0) { /* no successes yet, send at the lowest bit-rate */ + /* XXX should return MCS0 if HT */ return 0; } @@ -223,6 +232,13 @@ pick_sample_rate(struct sample_softc *ss continue; } + /* if the node is HT and the rate isn't HT, don't bother sample */ + if ((an->an_node.ni_flags & IEEE80211_NODE_HT) && + (rt->info[rix].phy != IEEE80211_T_HT)) { + mask &= ~(1<stats[size_bin][rix].perfect_tx_time > current_tt) { mask &= ~(1< 11M */ - if (DOT11RATE(rix) > 2*11 && rix > current_rix + 2) { - mask &= ~(1< 11M for non-HT rates */ + if (! (an->an_node.ni_flags & IEEE80211_NODE_HT)) { + if (DOT11RATE(rix) > 2*11 && rix > current_rix + 2) { + mask &= ~(1<last_sample_rix[size_bin] = rix; @@ -327,7 +345,7 @@ ath_rate_findrate(struct ath_softc *sc, /* XXX TODO: this doesn't know about 11gn vs 11g protection; teach it */ mrr = sc->sc_mrretry && !(ic->ic_flags & IEEE80211_F_USEPROT); - best_rix = pick_best_rate(sn, rt, size_bin, !mrr); + best_rix = pick_best_rate(an, rt, size_bin, !mrr); if (best_rix >= 0) { average_tx_time = sn->stats[size_bin][best_rix].average_tx_time; } else { @@ -338,7 +356,7 @@ ath_rate_findrate(struct ath_softc *sc, * rates to sample_rate% of the total transmission time. */ if (sn->sample_tt[size_bin] < average_tx_time * (sn->packets_since_sample[size_bin]*ssc->sample_rate/100)) { - rix = pick_sample_rate(ssc, sn, rt, size_bin); + rix = pick_sample_rate(ssc, an, rt, size_bin); IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, "size %u sample rate %d current rate %d", bin_to_size(size_bin), RATE(rix), From owner-svn-src-head@FreeBSD.ORG Wed May 18 07:37:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40E0E106564A; Wed, 18 May 2011 07:37:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30D978FC0A; Wed, 18 May 2011 07:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4I7b3hf066299; Wed, 18 May 2011 07:37:03 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4I7b3Up066297; Wed, 18 May 2011 07:37:03 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201105180737.p4I7b3Up066297@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 May 2011 07:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222050 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 07:37:03 -0000 Author: mm Date: Wed May 18 07:37:02 2011 New Revision: 222050 URL: http://svn.freebsd.org/changeset/base/222050 Log: Restore old (v15) behaviour for a recursive snapshot destroy. (zfs destroy -r pool/dataset@snapshot) To destroy all descendent snapshots with the same name the top level snapshot was not required to exist. So if the top level snapshot does not exist, check permissions of the parent dataset instead. Filed as Illumos Bug #1043 Reviewed by: delphij Approved by: pjd MFC after: together with v28 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 Wed May 18 07:20:30 2011 (r222049) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed May 18 07:37:02 2011 (r222050) @@ -689,6 +689,9 @@ zfs_secpolicy_destroy(zfs_cmd_t *zc, cre * and destroying snapshots requires descendent permissions, a successfull * check of the top level snapshot applies to snapshots of all descendent * datasets as well. + * + * The top level snapshot may not exist when doing a recursive destroy. + * In this case fallback to permissions of the parent dataset. */ static int zfs_secpolicy_destroy_snaps(zfs_cmd_t *zc, cred_t *cr) @@ -700,6 +703,9 @@ zfs_secpolicy_destroy_snaps(zfs_cmd_t *z error = zfs_secpolicy_destroy_perms(dsname, cr); + if (error == ENOENT) + error = zfs_secpolicy_destroy_perms(zc->zc_name, cr); + strfree(dsname); return (error); } From owner-svn-src-head@FreeBSD.ORG Wed May 18 07:40:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A425106566B; Wed, 18 May 2011 07:40:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 199EB8FC18; Wed, 18 May 2011 07:40:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4I7eCvT066435; Wed, 18 May 2011 07:40:12 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4I7eCVx066426; Wed, 18 May 2011 07:40:12 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105180740.p4I7eCVx066426@svn.freebsd.org> From: Andriy Gapon Date: Wed, 18 May 2011 07:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222051 - in head/sys/dev: sound/usb usb usb/input usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 07:40:13 -0000 Author: avg Date: Wed May 18 07:40:12 2011 New Revision: 222051 URL: http://svn.freebsd.org/changeset/base/222051 Log: usb: change to one-pass probing of device drivers This brings USB bus more in line with how newbus is supposed to be used. Also, because of the two-pass probing the following message was produced by devd in default configuration when almost any USB device was connected: Unknown USB device: vendor <> product <> bus <> This should be fixed now. Note that many USB device drivers pass some information from probe method to attach method via ivars. For this to continue working we rely on the fact that the subr_bus code calls probe method of a winning driver again before calling its attach method in the case where multiple drivers claim to support a device. This is done because device description is set in successful probe methods and we want to get a correct device description from a winning driver. So now this logic is re-used for setting ivars too. Reviewed by: hselasky MFC after: 1 month Modified: head/sys/dev/sound/usb/uaudio.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/storage/umass.c head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed May 18 07:37:02 2011 (r222050) +++ head/sys/dev/sound/usb/uaudio.c Wed May 18 07:40:12 2011 (r222051) @@ -539,9 +539,6 @@ uaudio_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - if (uaa->use_generic == 0) - return (ENXIO); - /* lookup non-standard device */ if (uaa->info.bInterfaceClass != UICLASS_AUDIO) { @@ -555,7 +552,7 @@ uaudio_probe(device_t dev) if (usb_test_quirk(uaa, UQ_BAD_AUDIO)) return (ENXIO); else - return (0); + return (BUS_PROBE_GENERIC); } /* check for MIDI stream */ @@ -564,7 +561,7 @@ uaudio_probe(device_t dev) if (usb_test_quirk(uaa, UQ_BAD_MIDI)) return (ENXIO); else - return (0); + return (BUS_PROBE_GENERIC); } return (ENXIO); } Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Wed May 18 07:37:02 2011 (r222050) +++ head/sys/dev/usb/input/uhid.c Wed May 18 07:40:12 2011 (r222051) @@ -617,10 +617,6 @@ uhid_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) { return (ENXIO); } - if (uaa->use_generic == 0) { - /* give Mouse and Keyboard drivers a try first */ - return (ENXIO); - } if (uaa->info.bInterfaceClass != UICLASS_HID) { /* the Xbox 360 gamepad doesn't use the HID class */ Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Wed May 18 07:37:02 2011 (r222050) +++ head/sys/dev/usb/input/ukbd.c Wed May 18 07:40:12 2011 (r222051) @@ -771,7 +771,7 @@ ukbd_probe(device_t dev) if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) return (ENXIO); else - return (BUS_PROBE_GENERIC); + return (BUS_PROBE_DEFAULT); } error = usbd_req_get_hid_desc(uaa->device, NULL, @@ -793,7 +793,7 @@ ukbd_probe(device_t dev) if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) error = ENXIO; else - error = BUS_PROBE_GENERIC; + error = BUS_PROBE_DEFAULT; } else error = ENXIO; Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Wed May 18 07:37:02 2011 (r222050) +++ head/sys/dev/usb/input/ums.c Wed May 18 07:40:12 2011 (r222051) @@ -373,7 +373,7 @@ ums_probe(device_t dev) if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE)) - return (BUS_PROBE_GENERIC); + return (BUS_PROBE_DEFAULT); error = usbd_req_get_hid_desc(uaa->device, NULL, &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex); @@ -383,7 +383,7 @@ ums_probe(device_t dev) if (hid_is_collection(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) - error = BUS_PROBE_GENERIC; + error = BUS_PROBE_DEFAULT; else error = ENXIO; Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Wed May 18 07:37:02 2011 (r222050) +++ head/sys/dev/usb/storage/umass.c Wed May 18 07:40:12 2011 (r222051) @@ -782,6 +782,7 @@ umass_probe_proto(device_t dev, struct u uint32_t proto = umass_get_proto(uaa->iface); memset(&ret, 0, sizeof(ret)); + ret.error = BUS_PROBE_GENERIC; /* Search for protocol enforcement */ @@ -870,10 +871,6 @@ umass_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) { return (ENXIO); } - if (uaa->use_generic == 0) { - /* give other drivers a try first */ - return (ENXIO); - } temp = umass_probe_proto(dev, uaa); return (temp.error); Modified: head/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- head/sys/dev/usb/storage/ustorage_fs.c Wed May 18 07:37:02 2011 (r222050) +++ head/sys/dev/usb/storage/ustorage_fs.c Wed May 18 07:40:12 2011 (r222051) @@ -334,10 +334,6 @@ ustorage_fs_probe(device_t dev) if (uaa->usb_mode != USB_MODE_DEVICE) { return (ENXIO); } - if (uaa->use_generic == 0) { - /* give other drivers a try first */ - return (ENXIO); - } /* Check for a standards compliant device */ id = usbd_get_interface_descriptor(uaa->iface); if ((id == NULL) || @@ -346,7 +342,7 @@ ustorage_fs_probe(device_t dev) (id->bInterfaceProtocol != UIPROTO_MASS_BBB)) { return (ENXIO); } - return (0); + return (BUS_PROBE_GENERIC); } static int Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Wed May 18 07:37:02 2011 (r222050) +++ head/sys/dev/usb/usb_device.c Wed May 18 07:40:12 2011 (r222051) @@ -1334,7 +1334,6 @@ usb_probe_and_attach(struct usb_device * uaa.info.bIfaceIndex = i; uaa.info.bIfaceNum = iface->idesc->bInterfaceNumber; - uaa.use_generic = 0; uaa.driver_info = 0; /* reset driver_info */ DPRINTFN(2, "iclass=%u/%u/%u iindex=%u/%u\n", @@ -1344,16 +1343,6 @@ usb_probe_and_attach(struct usb_device * uaa.info.bIfaceIndex, uaa.info.bIfaceNum); - /* try specific interface drivers first */ - - if (usb_probe_and_attach_sub(udev, &uaa)) { - /* ignore */ - } - /* try generic interface drivers last */ - - uaa.use_generic = 1; - uaa.driver_info = 0; /* reset driver_info */ - if (usb_probe_and_attach_sub(udev, &uaa)) { /* ignore */ } Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Wed May 18 07:37:02 2011 (r222050) +++ head/sys/dev/usb/usbdi.h Wed May 18 07:40:12 2011 (r222051) @@ -357,7 +357,6 @@ struct usb_attach_arg { struct usb_interface *iface; /* current interface */ enum usb_hc_mode usb_mode; /* host or device mode */ uint8_t port; - uint8_t use_generic; /* hint for generic drivers */ uint8_t dev_state; #define UAA_DEV_READY 0 #define UAA_DEV_DISABLED 1 From owner-svn-src-head@FreeBSD.ORG Wed May 18 10:04:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA3BA106564A; Wed, 18 May 2011 10:04:54 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB6798FC08; Wed, 18 May 2011 10:04:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IA4sRA071287; Wed, 18 May 2011 10:04:54 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IA4sRF071285; Wed, 18 May 2011 10:04:54 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201105181004.p4IA4sRF071285@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 18 May 2011 10:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222053 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 10:04:55 -0000 Author: pluknet Date: Wed May 18 10:04:54 2011 New Revision: 222053 URL: http://svn.freebsd.org/changeset/base/222053 Log: Release allocated memory in procstat_close(). Reviewed by: stass Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Wed May 18 08:26:59 2011 (r222052) +++ head/lib/libprocstat/libprocstat.c Wed May 18 10:04:54 2011 (r222053) @@ -132,6 +132,7 @@ procstat_close(struct procstat *procstat assert(procstat); if (procstat->type == PROCSTAT_KVM) kvm_close(procstat->kd); + free(procstat); } struct procstat * From owner-svn-src-head@FreeBSD.ORG Wed May 18 11:21:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 906CF106564A; Wed, 18 May 2011 11:21:34 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 717658FC12; Wed, 18 May 2011 11:21:32 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=6QwXiDozn7Gnsf2tGidwH+ndAwLlGixx7JAIKZICKmI= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=u5Tu-HhieqoA:10 a=dBRESv0yCI8A:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=h0r91CyQN9zrCnRR5pQA:9 a=pILNOxqGKmIA:10 a=Jmo6dA6avm11kL81:21 a=bwF__ucf-cuQjGx2:21 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 128219579; Wed, 18 May 2011 13:21:31 +0200 Received-SPF: softfail receiver=mailfe08.swip.net; client-ip=188.126.198.129; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: Andriy Gapon Date: Wed, 18 May 2011 13:20:24 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201105180740.p4I7eCVx066426@svn.freebsd.org> In-Reply-To: <201105180740.p4I7eCVx066426@svn.freebsd.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201105181320.24252.hselasky@freebsd.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r222051 - in head/sys/dev: sound/usb usb usb/input usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 11:21:34 -0000 On Wednesday 18 May 2011 09:40:12 Andriy Gapon wrote: > Author: avg > Date: Wed May 18 07:40:12 2011 > New Revision: 222051 > URL: http://svn.freebsd.org/changeset/base/222051 > > Log: > usb: change to one-pass probing of device drivers > > This brings USB bus more in line with how newbus is supposed to be used. > Also, because of the two-pass probing the following message was produced > by devd in default configuration when almost any USB device was > connected: > Unknown USB device: vendor <> product <> bus <> > This should be fixed now. > > Note that many USB device drivers pass some information from probe > method to attach method via ivars. For this to continue working we rely > on the fact that the subr_bus code calls probe method of a winning driver > again before calling its attach method in the case where multiple > drivers claim to support a device. This is done because device > description is set in successful probe methods and we want to get a > correct device description from a winning driver. So now this logic is > re-used for setting ivars too. > > Reviewed by: hselasky > MFC after: 1 month > > Modified: > head/sys/dev/sound/usb/uaudio.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/storage/umass.c > head/sys/dev/usb/storage/ustorage_fs.c > head/sys/dev/usb/usb_device.c > head/sys/dev/usb/usbdi.h > Looks like you missed ng_ubt.c. Just do a "grep -r" for the replaced fields. --HPS From owner-svn-src-head@FreeBSD.ORG Wed May 18 11:28:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F28DD106566C; Wed, 18 May 2011 11:28:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E34128FC08; Wed, 18 May 2011 11:28:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IBSN8q090181; Wed, 18 May 2011 11:28:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IBSNos090179; Wed, 18 May 2011 11:28:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105181128.p4IBSNos090179@svn.freebsd.org> From: Adrian Chadd Date: Wed, 18 May 2011 11:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222054 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 11:28:24 -0000 Author: adrian Date: Wed May 18 11:28:23 2011 New Revision: 222054 URL: http://svn.freebsd.org/changeset/base/222054 Log: This isn't needed any longer, it's defined in ah_internal.h. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed May 18 10:04:54 2011 (r222053) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed May 18 11:28:23 2011 (r222054) @@ -1368,10 +1368,6 @@ ar5416UpdateChainMasks(struct ath_hal *a AH5416(ah)->ah_rx_chainmask); } -#ifndef IS_5GHZ_FAST_CLOCK_EN -#define IS_5GHZ_FAST_CLOCK_EN(ah, chan) AH_FALSE -#endif - void ar5416InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan) { From owner-svn-src-head@FreeBSD.ORG Wed May 18 11:32:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8B3D106564A; Wed, 18 May 2011 11:32:45 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 235EB8FC12; Wed, 18 May 2011 11:32:44 +0000 (UTC) Received: by vws18 with SMTP id 18so1372149vws.13 for ; Wed, 18 May 2011 04:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=mdfqFda1bysczYY4PKwNS7Fw8FvICNZnKmGicOPdU6A=; b=F4t/SjGCPytnMw2r1tfesPbLD4tzZbnQd03ucmzSIuzBJrAcJmZYjUl4OSED/mKwiQ GVl58Pht24KbM5SXqXz23K00Jl97aYyz7XwW2y4JArz7H0pAqzpp0mHGd7c2PwafagaF FJobA/o6ipwcWcJRDk9CueP2i13e+3XvfPiVM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=HB/bxPMP8clq2HNil9SWUv0WrBZtCeYrD98OECQ3gLQ5pDgE2CarrZBbCtQd0MGiTd yGf14Ojgf3HplnpnK2dT56Onrj1O655j2KYNMaB4UnUgejE1voYyPkwti695YAhu0DIm 7ZvjCyEQRFFh4GNVbwtoE5tWdAuFsLkiCJpmQ= MIME-Version: 1.0 Received: by 10.52.181.168 with SMTP id dx8mr2520729vdc.172.1305718364149; Wed, 18 May 2011 04:32:44 -0700 (PDT) Received: by 10.220.188.202 with HTTP; Wed, 18 May 2011 04:32:44 -0700 (PDT) In-Reply-To: <201105181320.24252.hselasky@freebsd.org> References: <201105180740.p4I7eCVx066426@svn.freebsd.org> <201105181320.24252.hselasky@freebsd.org> Date: Wed, 18 May 2011 04:32:44 -0700 Message-ID: From: Garrett Cooper To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andriy Gapon Subject: Re: svn commit: r222051 - in head/sys/dev: sound/usb usb usb/input usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 11:32:45 -0000 On Wed, May 18, 2011 at 4:20 AM, Hans Petter Selasky wrote: > On Wednesday 18 May 2011 09:40:12 Andriy Gapon wrote: >> Author: avg >> Date: Wed May 18 07:40:12 2011 >> New Revision: 222051 >> URL: http://svn.freebsd.org/changeset/base/222051 >> >> Log: >> =A0 usb: change to one-pass probing of device drivers >> >> =A0 This brings USB bus more in line with how newbus is supposed to be u= sed. >> =A0 Also, because of the two-pass probing the following message was prod= uced >> =A0 by devd in default configuration when almost any USB device was >> =A0 connected: >> =A0 =A0 =A0 Unknown USB device: vendor <> product <> bus <> >> =A0 This should be fixed now. >> >> =A0 Note that many USB device drivers pass some information from probe >> =A0 method to attach method via ivars. =A0For this to continue working w= e rely >> =A0 on the fact that the subr_bus code calls probe method of a winning d= river >> =A0 again before calling its attach method in the case where multiple >> =A0 drivers claim to support a device. =A0This is done because device >> =A0 description is set in successful probe methods and we want to get a >> correct device description from a winning driver. =A0So now this logic i= s >> re-used for setting ivars too. >> >> =A0 Reviewed by: =A0 =A0 =A0 =A0hselasky >> =A0 MFC after: =A01 month >> >> Modified: >> =A0 head/sys/dev/sound/usb/uaudio.c >> =A0 head/sys/dev/usb/input/uhid.c >> =A0 head/sys/dev/usb/input/ukbd.c >> =A0 head/sys/dev/usb/input/ums.c >> =A0 head/sys/dev/usb/storage/umass.c >> =A0 head/sys/dev/usb/storage/ustorage_fs.c >> =A0 head/sys/dev/usb/usb_device.c >> =A0 head/sys/dev/usb/usbdi.h >> > > Looks like you missed ng_ubt.c. Just do a "grep -r" for the replaced fiel= ds. The patch I sent offline to you guys was the only affected file based on a grep around /sys/... ; I based my patch on other code patterns in this commit. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Wed May 18 11:38:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC333106564A; Wed, 18 May 2011 11:38:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0AC8FC0A; Wed, 18 May 2011 11:38:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IBcaod090517; Wed, 18 May 2011 11:38:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IBcaos090515; Wed, 18 May 2011 11:38:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105181138.p4IBcaos090515@svn.freebsd.org> From: Andriy Gapon Date: Wed, 18 May 2011 11:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222055 - head/sys/netgraph/bluetooth/drivers/ubt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 11:38:36 -0000 Author: avg Date: Wed May 18 11:38:36 2011 New Revision: 222055 URL: http://svn.freebsd.org/changeset/base/222055 Log: usb: fix a missed use of use_generic in r222051 Submitted by: gcooper Pointyhat to: avg MFC after: 1 month X-MFC with: r222051 Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Wed May 18 11:28:23 2011 (r222054) +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Wed May 18 11:38:36 2011 (r222055) @@ -409,6 +409,7 @@ static int ubt_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); @@ -416,14 +417,14 @@ ubt_probe(device_t dev) if (uaa->info.bIfaceIndex != 0) return (ENXIO); - if (uaa->use_generic == 0) - return (ENXIO); - if (usbd_lookup_id_by_uaa(ubt_ignore_devs, sizeof(ubt_ignore_devs), uaa) == 0) return (ENXIO); - return (usbd_lookup_id_by_uaa(ubt_devs, sizeof(ubt_devs), uaa)); + error = usbd_lookup_id_by_uaa(ubt_devs, sizeof(ubt_devs), uaa); + if (error == 0) + return (BUS_PROBE_GENERIC); + return (error); } /* ubt_probe */ /* From owner-svn-src-head@FreeBSD.ORG Wed May 18 11:41:03 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7A3D106566C; Wed, 18 May 2011 11:41:03 +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 951D58FC1C; Wed, 18 May 2011 11:41:02 +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 OAA19283; Wed, 18 May 2011 14:41:00 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DD3B04B.10504@FreeBSD.org> Date: Wed, 18 May 2011 14:40:59 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Garrett Cooper References: <201105180740.p4I7eCVx066426@svn.freebsd.org> <201105181320.24252.hselasky@freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 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" , Hans Petter Selasky Subject: Re: svn commit: r222051 - in head/sys/dev: sound/usb usb usb/input usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 11:41:04 -0000 on 18/05/2011 14:32 Garrett Cooper said the following: > On Wed, May 18, 2011 at 4:20 AM, Hans Petter Selasky > wrote: >> Looks like you missed ng_ubt.c. Just do a "grep -r" for the replaced fields. I thought I did, but... Thank you for the report. > The patch I sent offline to you guys was the only affected file > based on a grep around /sys/... ; I based my patch on other code > patterns in this commit. Thank you Garrett for the patch and the report. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed May 18 16:07:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40858106577C; Wed, 18 May 2011 16:07:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23E048FC0A; Wed, 18 May 2011 16:07:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IG7VaV098841; Wed, 18 May 2011 16:07:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IG7VxN098839; Wed, 18 May 2011 16:07:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105181607.p4IG7VxN098839@svn.freebsd.org> From: Attilio Rao Date: Wed, 18 May 2011 16:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222065 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 16:07:32 -0000 Author: attilio Date: Wed May 18 16:07:30 2011 New Revision: 222065 URL: http://svn.freebsd.org/changeset/base/222065 Log: Merge part of r221322 from largeSMP project: Sync XEN support with i386 about the usage of ipi_send_cpu() Tested by: pluknet MFC after: 2 weeks Modified: head/sys/i386/xen/mp_machdep.c Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Wed May 18 16:07:24 2011 (r222064) +++ head/sys/i386/xen/mp_machdep.c Wed May 18 16:07:30 2011 (r222065) @@ -960,6 +960,30 @@ start_ap(int apic_id) } /* + * send an IPI to a specific CPU. + */ +static void +ipi_send_cpu(int cpu, u_int ipi) +{ + u_int bitmap, old_pending, new_pending; + + if (IPI_IS_BITMAPED(ipi)) { + bitmap = 1 << ipi; + ipi = IPI_BITMAP_VECTOR; + do { + old_pending = cpu_ipi_pending[cpu]; + new_pending = old_pending | bitmap; + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); + if (!old_pending) + ipi_pcpu(cpu, RESCHEDULE_VECTOR); + } else { + KASSERT(call_data != NULL, ("call_data not set")); + ipi_pcpu(cpu, CALL_FUNCTION_VECTOR); + } +} + +/* * Flush the TLB on all other CPU's */ static void @@ -1101,14 +1125,6 @@ void ipi_selected(cpumask_t cpus, u_int ipi) { int cpu; - u_int bitmap = 0; - u_int old_pending; - u_int new_pending; - - if (IPI_IS_BITMAPED(ipi)) { - bitmap = 1 << ipi; - ipi = IPI_BITMAP_VECTOR; - } /* * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit @@ -1118,23 +1134,11 @@ ipi_selected(cpumask_t cpus, u_int ipi) if (ipi == IPI_STOP_HARD) atomic_set_int(&ipi_nmi_pending, cpus); - CTR3(KTR_SMP, "%s: cpus: %x ipi: %x", __func__, cpus, ipi); while ((cpu = ffs(cpus)) != 0) { cpu--; cpus &= ~(1 << cpu); - - if (bitmap) { - do { - old_pending = cpu_ipi_pending[cpu]; - new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], - old_pending, new_pending)); - if (!old_pending) - ipi_pcpu(cpu, RESCHEDULE_VECTOR); - } else { - KASSERT(call_data != NULL, ("call_data not set")); - ipi_pcpu(cpu, CALL_FUNCTION_VECTOR); - } + CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); + ipi_send_cpu(cpu, ipi); } } @@ -1144,14 +1148,6 @@ ipi_selected(cpumask_t cpus, u_int ipi) void ipi_cpu(int cpu, u_int ipi) { - u_int bitmap = 0; - u_int old_pending; - u_int new_pending; - - if (IPI_IS_BITMAPED(ipi)) { - bitmap = 1 << ipi; - ipi = IPI_BITMAP_VECTOR; - } /* * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit @@ -1162,19 +1158,7 @@ ipi_cpu(int cpu, u_int ipi) atomic_set_int(&ipi_nmi_pending, 1 << cpu); CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); - - if (bitmap) { - do { - old_pending = cpu_ipi_pending[cpu]; - new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], - old_pending, new_pending)); - if (!old_pending) - ipi_pcpu(cpu, RESCHEDULE_VECTOR); - } else { - KASSERT(call_data != NULL, ("call_data not set")); - ipi_pcpu(cpu, CALL_FUNCTION_VECTOR); - } + ipi_send_cpu(cpu, ipi); } /* From owner-svn-src-head@FreeBSD.ORG Wed May 18 16:35:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47E0D1065670; Wed, 18 May 2011 16:35:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id A308A8FC15; Wed, 18 May 2011 16:35:04 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 6877D25D3888; Wed, 18 May 2011 16:35:03 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 94655159FBD1; Wed, 18 May 2011 16:35:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id MLWFaqPkDbTB; Wed, 18 May 2011 16:35:01 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 02188159FBD0; Wed, 18 May 2011 16:35:00 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201105141822.p4EIMFuB011323@svn.freebsd.org> Date: Wed, 18 May 2011 16:35:00 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <796DC8CC-57FB-4C71-966F-F36519D5DA6E@FreeBSD.org> References: <201105141822.p4EIMFuB011323@svn.freebsd.org> To: Michael Tuexen X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221904 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 16:35:05 -0000 On May 14, 2011, at 6:22 PM, Michael Tuexen wrote: > Author: tuexen > Date: Sat May 14 18:22:14 2011 > New Revision: 221904 > URL: http://svn.freebsd.org/changeset/base/221904 >=20 > Log: > Fix the source address selection for boundall sockets > when sending INITs to a global IPv4 address having > only private IPv4 address. > Allow the usage of a private address and make sure > that no other private address will be used by the > association. > Initial work was done by rrs@. >=20 > MFC after: 1 week. >=20 > Modified: > head/sys/netinet/sctp_output.c > head/sys/netinet/sctp_output.h >=20 > Modified: head/sys/netinet/sctp_output.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/netinet/sctp_output.c Sat May 14 18:22:08 2011 = (r221903) > +++ head/sys/netinet/sctp_output.c Sat May 14 18:22:14 2011 = (r221904) ... > @@ -3068,19 +3112,81 @@ plan_d: > * It is restricted for some > * reason.. probably not yet = added. > */ > + sifa =3D NULL; > continue; > } > } > - atomic_add_int(&sifa->refcount, 1); > - return (sifa); > + goto out; > } > } > - /* > - * Ok we can find NO address to source from that is not on our > - * restricted list and non_asoc_address is NOT ok, or it is on = our > - * restricted list. We can't source to it :-( > - */ > - return (NULL); > +#ifdef INET > + if ((retried =3D=3D 0) && (stcb->asoc.ipv4_local_scope =3D=3D = 0)) { > + stcb->asoc.ipv4_local_scope =3D 1; > + retried =3D 1; > + goto again_with_private_addresses_allowed; > + } else if (retried =3D=3D 1) { > + stcb->asoc.ipv4_local_scope =3D 0; > + } > +#endif > +out: > + if (sifa) { > +#ifdef INET either this needs to go outside the if() or ... > + if (retried =3D=3D 1) { > + LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) = { > + if (dest_is_loop =3D=3D 0 && = SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { > + /* wrong base scope */ > + continue; > + } > + LIST_FOREACH(sctp_ifa, = &sctp_ifn->ifalist, next_ifa) { > + struct sctp_ifa *tmp_sifa; > + > + if ((sctp_ifa->localifa_flags & = SCTP_ADDR_DEFER_USE) && > + (non_asoc_addr_ok =3D=3D 0)) > + continue; > + tmp_sifa =3D = sctp_is_ifa_addr_acceptable(sctp_ifa, > + dest_is_loop, > + dest_is_priv, fam); > + if (tmp_sifa =3D=3D NULL) { > + continue; > + } > + if (tmp_sifa =3D=3D sifa) { > + continue; > + } > + if (stcb) { > + if = (sctp_is_address_in_scope(tmp_sifa, > + = stcb->asoc.ipv4_addr_legal, > + = stcb->asoc.ipv6_addr_legal, > + = stcb->asoc.loopback_scope, > + = stcb->asoc.ipv4_local_scope, > + = stcb->asoc.local_scope, > + = stcb->asoc.site_scope, 0) =3D=3D 0) { > + continue; > + } > + if (((non_asoc_addr_ok = =3D=3D 0) && > + = (sctp_is_addr_restricted(stcb, tmp_sifa))) || > + (non_asoc_addr_ok && > + = (sctp_is_addr_restricted(stcb, tmp_sifa)) && > + = (!sctp_is_addr_pending(stcb, tmp_sifa)))) { > + /* > + * It is = restricted > + * for some = reason.. > + * probably not = yet > + * added. > + */ > + continue; > + } > + } > + if = ((tmp_sifa->address.sin.sin_family =3D=3D AF_INET) && > + = (IN4_ISPRIVATE_ADDRESS(&(tmp_sifa->address.sin.sin_addr)))) { > + = sctp_add_local_addr_restricted(stcb, tmp_sifa); > + } > + } > + } > + } > + atomic_add_int(&sifa->refcount, 1); > + } > +#endif ... this needs to be inside the block. Either way will unbreak INET = free kernels again. > + return (sifa); > } --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Wed May 18 16:41:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CFE4106566B; Wed, 18 May 2011 16:41:38 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D94C8FC13; Wed, 18 May 2011 16:41:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IGfcfn000125; Wed, 18 May 2011 16:41:38 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IGfcIC000123; Wed, 18 May 2011 16:41:38 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105181641.p4IGfcIC000123@svn.freebsd.org> From: Attilio Rao Date: Wed, 18 May 2011 16:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222068 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 16:41:38 -0000 Author: attilio Date: Wed May 18 16:41:38 2011 New Revision: 222068 URL: http://svn.freebsd.org/changeset/base/222068 Log: Fix newly introduced code. Reported by: sbruno Modified: head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Wed May 18 16:28:28 2011 (r222067) +++ head/sys/powerpc/booke/platform_bare.c Wed May 18 16:41:38 2011 (r222068) @@ -241,7 +241,7 @@ bare_smp_start_cpu(platform_t plat, stru int timeout; eebpcr = ccsr_read4(OCP85XX_EEBPCR); - if ((eebpcr & (pc->pc_cpumask << 24)) != 0) { + if ((eebpcr & (1 << (pc->pc_cpuid + 24))) != 0) { printf("%s: CPU=%d already out of hold-off state!\n", __func__, pc->pc_cpuid); return (ENXIO); @@ -259,7 +259,8 @@ bare_smp_start_cpu(platform_t plat, stru /* * Release AP from hold-off state */ - eebpcr |= (pc->pc_cpumask << 24); + + eebpcr |= (1 << (pc->pc_cpuid + 24)); ccsr_write4(OCP85XX_EEBPCR, eebpcr); __asm __volatile("isync; msync"); From owner-svn-src-head@FreeBSD.ORG Wed May 18 16:42:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DDCB106564A; Wed, 18 May 2011 16:42:01 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E6838FC22; Wed, 18 May 2011 16:42:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IGg1uR000175; Wed, 18 May 2011 16:42:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IGg1uf000173; Wed, 18 May 2011 16:42:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105181642.p4IGg1uf000173@svn.freebsd.org> From: Attilio Rao Date: Wed, 18 May 2011 16:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222069 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 16:42:01 -0000 Author: attilio Date: Wed May 18 16:42:01 2011 New Revision: 222069 URL: http://svn.freebsd.org/changeset/base/222069 Log: Fix warning spit out. Reported by: sbruno Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed May 18 16:41:38 2011 (r222068) +++ head/sys/powerpc/booke/pmap.c Wed May 18 16:42:01 2011 (r222069) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1228,7 +1229,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset PTE_VALID; } /* Mark kernel_pmap active on all CPUs */ - kernel_pmap->pm_active = ~0; + CPU_FILL(&kernel_pmap->pm_active); /*******************************************************/ /* Final setup */ @@ -1483,7 +1484,7 @@ mmu_booke_pinit(mmu_t mmu, pmap_t pmap) PMAP_LOCK_INIT(pmap); for (i = 0; i < MAXCPU; i++) pmap->pm_tid[i] = TID_NONE; - pmap->pm_active = 0; + CPU_ZERO(&kernel_pmap->pm_active); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); bzero(&pmap->pm_pdir, sizeof(pte_t *) * PDIR_NENTRIES); TAILQ_INIT(&pmap->pm_ptbl_list); @@ -1838,7 +1839,7 @@ mmu_booke_activate(mmu_t mmu, struct thr mtx_lock_spin(&sched_lock); - atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask)); + CPU_OR_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask)); PCPU_SET(curpmap, pmap); if (pmap->pm_tid[PCPU_GET(cpuid)] == TID_NONE) @@ -1867,7 +1868,9 @@ mmu_booke_deactivate(mmu_t mmu, struct t CTR5(KTR_PMAP, "%s: td=%p, proc = '%s', id = %d, pmap = 0x%08x", __func__, td, td->td_proc->p_comm, td->td_proc->p_pid, pmap); - atomic_clear_int(&pmap->pm_active, PCPU_GET(cpumask)); + sched_pin(); + CPU_NAND_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask)); + sched_unpin(); PCPU_SET(curpmap, NULL); } From owner-svn-src-head@FreeBSD.ORG Wed May 18 16:50:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 036A71065672; Wed, 18 May 2011 16:50:14 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9627D8FC2C; Wed, 18 May 2011 16:50:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IGoDqR000466; Wed, 18 May 2011 16:50:13 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IGoDvd000463; Wed, 18 May 2011 16:50:13 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105181650.p4IGoDvd000463@svn.freebsd.org> From: Attilio Rao Date: Wed, 18 May 2011 16:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222070 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 16:50:14 -0000 Author: attilio Date: Wed May 18 16:50:13 2011 New Revision: 222070 URL: http://svn.freebsd.org/changeset/base/222070 Log: Revert r222069,222068 as they were intended to be committed to the largeSMP branch. Reported by: pluknet Modified: head/sys/powerpc/booke/platform_bare.c head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Wed May 18 16:42:01 2011 (r222069) +++ head/sys/powerpc/booke/platform_bare.c Wed May 18 16:50:13 2011 (r222070) @@ -241,7 +241,7 @@ bare_smp_start_cpu(platform_t plat, stru int timeout; eebpcr = ccsr_read4(OCP85XX_EEBPCR); - if ((eebpcr & (1 << (pc->pc_cpuid + 24))) != 0) { + if ((eebpcr & (pc->pc_cpumask << 24)) != 0) { printf("%s: CPU=%d already out of hold-off state!\n", __func__, pc->pc_cpuid); return (ENXIO); @@ -259,8 +259,7 @@ bare_smp_start_cpu(platform_t plat, stru /* * Release AP from hold-off state */ - - eebpcr |= (1 << (pc->pc_cpuid + 24)); + eebpcr |= (pc->pc_cpumask << 24); ccsr_write4(OCP85XX_EEBPCR, eebpcr); __asm __volatile("isync; msync"); Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed May 18 16:42:01 2011 (r222069) +++ head/sys/powerpc/booke/pmap.c Wed May 18 16:50:13 2011 (r222070) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -1229,7 +1228,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset PTE_VALID; } /* Mark kernel_pmap active on all CPUs */ - CPU_FILL(&kernel_pmap->pm_active); + kernel_pmap->pm_active = ~0; /*******************************************************/ /* Final setup */ @@ -1484,7 +1483,7 @@ mmu_booke_pinit(mmu_t mmu, pmap_t pmap) PMAP_LOCK_INIT(pmap); for (i = 0; i < MAXCPU; i++) pmap->pm_tid[i] = TID_NONE; - CPU_ZERO(&kernel_pmap->pm_active); + pmap->pm_active = 0; bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); bzero(&pmap->pm_pdir, sizeof(pte_t *) * PDIR_NENTRIES); TAILQ_INIT(&pmap->pm_ptbl_list); @@ -1839,7 +1838,7 @@ mmu_booke_activate(mmu_t mmu, struct thr mtx_lock_spin(&sched_lock); - CPU_OR_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask)); + atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask)); PCPU_SET(curpmap, pmap); if (pmap->pm_tid[PCPU_GET(cpuid)] == TID_NONE) @@ -1868,9 +1867,7 @@ mmu_booke_deactivate(mmu_t mmu, struct t CTR5(KTR_PMAP, "%s: td=%p, proc = '%s', id = %d, pmap = 0x%08x", __func__, td, td->td_proc->p_comm, td->td_proc->p_pid, pmap); - sched_pin(); - CPU_NAND_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask)); - sched_unpin(); + atomic_clear_int(&pmap->pm_active, PCPU_GET(cpumask)); PCPU_SET(curpmap, NULL); } From owner-svn-src-head@FreeBSD.ORG Wed May 18 17:06:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B712106564A; Wed, 18 May 2011 17:06:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C7888FC16; Wed, 18 May 2011 17:06:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IH6Clx001017; Wed, 18 May 2011 17:06:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IH6Ccv001015; Wed, 18 May 2011 17:06:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201105181706.p4IH6Ccv001015@svn.freebsd.org> From: Warner Losh Date: Wed, 18 May 2011 17:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222072 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 17:06:12 -0000 Author: imp Date: Wed May 18 17:06:11 2011 New Revision: 222072 URL: http://svn.freebsd.org/changeset/base/222072 Log: Clean up a loose end from the conversion from gnu ar/ranlib to the BSD one. Without this, we don't have ar or randlib in the tool path, leading to much pain for some users. This pain is exposed by the external toolchain enhancements that I'm working on. Submitted by: John Hein (ages ago, and dropped on the floor by me: sorry) Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 18 16:56:36 2011 (r222071) +++ head/Makefile.inc1 Wed May 18 17:06:11 2011 (r222072) @@ -1552,7 +1552,8 @@ _xb-build-tools: _xb-cross-tools: .for _tool in \ gnu/usr.bin/binutils \ - gnu/usr.bin/cc + gnu/usr.bin/cc \ + usr.bin/ar ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ @@ -1577,7 +1578,8 @@ _xi-cross-tools: @echo "_xi-cross-tools" .for _tool in \ gnu/usr.bin/binutils \ - gnu/usr.bin/cc + gnu/usr.bin/cc \ + usr.bin/ar ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} From owner-svn-src-head@FreeBSD.ORG Wed May 18 17:39:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E8AD106564A; Wed, 18 May 2011 17:39:29 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E90398FC13; Wed, 18 May 2011 17:39:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IHdS7R002090; Wed, 18 May 2011 17:39:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IHdSQL002087; Wed, 18 May 2011 17:39:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105181739.p4IHdSQL002087@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 18 May 2011 17:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222074 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 17:39:29 -0000 Author: nwhitehorn Date: Wed May 18 17:39:28 2011 New Revision: 222074 URL: http://svn.freebsd.org/changeset/base/222074 Log: As requested by many people, with final prodding from Jason Hall, fix this so that running make release causes make obj to be run before doing anything. This fixes a bug wherein, when run for the first time, and without -DNOSRC, make release would attempt to recursively tar up the src directory including its own output and enter an infinite loop. While here, make the cross-building stuff work a little more the way it should if only one of TARGET/TARGET_ARCH is specified. Modified: head/release/Makefile head/release/generate-release.sh Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Wed May 18 17:18:44 2011 (r222073) +++ head/release/Makefile Wed May 18 17:39:28 2011 (r222074) @@ -25,11 +25,11 @@ PORTSDIR?= /usr/ports DOCDIR?= /usr/doc RELNOTES_LANG?= en_US.ISO8859-1 -TARGET_ARCH?= ${MACHINE_ARCH} -.if ${TARGET_ARCH} == ${MACHINE_ARCH} TARGET?= ${MACHINE} +.if ${TARGET} == ${MACHINE} +TARGET_ARCH?= ${MACHINE_ARCH} .else -TARGET?= ${TARGET_ARCH} +TARGET_ARCH?= ${TARGET} .endif IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} DISTDIR= ${.OBJDIR}/dist @@ -169,7 +169,9 @@ ftp: packagesystem mkdir ftp cp *.txz MANIFEST ftp -release: obj ${RELEASE_TARGETS} +release: + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} clean: chflags -R noschg ${.OBJDIR} Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Wed May 18 17:18:44 2011 (r222073) +++ head/release/generate-release.sh Wed May 18 17:39:28 2011 (r222074) @@ -63,7 +63,6 @@ if [ -d $2/usr/doc ]; then fi chroot $2 make -C /usr/src $MAKE_FLAGS buildworld buildkernel -chroot $2 make -C /usr/src/release obj chroot $2 make -C /usr/src/release release chroot $2 make -C /usr/src/release install DESTDIR=/R From owner-svn-src-head@FreeBSD.ORG Wed May 18 18:36:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2883510656D0; Wed, 18 May 2011 18:36:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2B1B8FC1E; Wed, 18 May 2011 18:36:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IIaelq003773; Wed, 18 May 2011 18:36:40 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IIaeQj003770; Wed, 18 May 2011 18:36:40 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105181836.p4IIaeQj003770@svn.freebsd.org> From: Rick Macklem Date: Wed, 18 May 2011 18:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222075 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 18:36:41 -0000 Author: rmacklem Date: Wed May 18 18:36:40 2011 New Revision: 222075 URL: http://svn.freebsd.org/changeset/base/222075 Log: Add a sanity check for the existence of an "addr" option to both NFS clients. This avoids the crash reported by Sergey Kandaurov (pluknet@gmail.com) to the freebsd-fs@ list with subject "[old nfsclient] different nmount() args passed from mount vs mount_nfs" dated May 17, 2011. Tested by: pluknet at gmail.com (old nfs client) MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/nfsclient/nfs_vfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Wed May 18 17:39:28 2011 (r222074) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Wed May 18 18:36:40 2011 (r222075) @@ -1079,15 +1079,21 @@ nfs_mount(struct mount *mp) dirpath[0] = '\0'; dirlen = strlen(dirpath); - if (has_nfs_args_opt == 0 && vfs_getopt(mp->mnt_optnew, "addr", - (void **)&args.addr, &args.addrlen) == 0) { - if (args.addrlen > SOCK_MAXADDRLEN) { - error = ENAMETOOLONG; + if (has_nfs_args_opt == 0) { + if (vfs_getopt(mp->mnt_optnew, "addr", + (void **)&args.addr, &args.addrlen) == 0) { + if (args.addrlen > SOCK_MAXADDRLEN) { + error = ENAMETOOLONG; + goto out; + } + nam = malloc(args.addrlen, M_SONAME, M_WAITOK); + bcopy(args.addr, nam, args.addrlen); + nam->sa_len = args.addrlen; + } else { + vfs_mount_error(mp, "No server address"); + error = EINVAL; goto out; } - nam = malloc(args.addrlen, M_SONAME, M_WAITOK); - bcopy(args.addr, nam, args.addrlen); - nam->sa_len = args.addrlen; } args.fh = nfh; Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Wed May 18 17:39:28 2011 (r222074) +++ head/sys/nfsclient/nfs_vfsops.c Wed May 18 18:36:40 2011 (r222075) @@ -1149,6 +1149,10 @@ nfs_mount(struct mount *mp) goto out; } } + } else if (has_addr_opt == 0) { + vfs_mount_error(mp, "No server address"); + error = EINVAL; + goto out; } error = mountnfs(&args, mp, nam, args.hostname, &vp, curthread->td_ucred, negnametimeo); From owner-svn-src-head@FreeBSD.ORG Wed May 18 19:49:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A652106564A; Wed, 18 May 2011 19:49:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C2138FC16; Wed, 18 May 2011 19:49:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IJnd24006024; Wed, 18 May 2011 19:49:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IJnd0h006022; Wed, 18 May 2011 19:49:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201105181949.p4IJnd0h006022@svn.freebsd.org> From: Michael Tuexen Date: Wed, 18 May 2011 19:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222077 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 19:49:40 -0000 Author: tuexen Date: Wed May 18 19:49:39 2011 New Revision: 222077 URL: http://svn.freebsd.org/changeset/base/222077 Log: Unbreak INET-less build. Reported by bz@ MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed May 18 19:46:26 2011 (r222076) +++ head/sys/netinet/sctp_output.c Wed May 18 19:49:39 2011 (r222077) @@ -3129,8 +3129,8 @@ plan_d: } #endif out: - if (sifa) { #ifdef INET + if (sifa) { if (retried == 1) { LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { From owner-svn-src-head@FreeBSD.ORG Wed May 18 19:52:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F1F51065674; Wed, 18 May 2011 19:52:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 57FB08FC21; Wed, 18 May 2011 19:52:34 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 6C3F525D3872; Wed, 18 May 2011 19:52:33 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D7818159FC8F; Wed, 18 May 2011 19:52:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Kckk1pdA3GOE; Wed, 18 May 2011 19:52:32 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id A8C9F159FC5F; Wed, 18 May 2011 19:52:31 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201105181949.p4IJnd0h006022@svn.freebsd.org> Date: Wed, 18 May 2011 19:52:31 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201105181949.p4IJnd0h006022@svn.freebsd.org> To: Michael Tuexen X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222077 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 19:52:34 -0000 On May 18, 2011, at 7:49 PM, Michael Tuexen wrote: > Author: tuexen > Date: Wed May 18 19:49:39 2011 > New Revision: 222077 > URL: http://svn.freebsd.org/changeset/base/222077 >=20 > Log: > Unbreak INET-less build. > Reported by bz@ Thanks a lot! > MFC after: 1 week >=20 > Modified: > head/sys/netinet/sctp_output.c >=20 > Modified: head/sys/netinet/sctp_output.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/netinet/sctp_output.c Wed May 18 19:46:26 2011 = (r222076) > +++ head/sys/netinet/sctp_output.c Wed May 18 19:49:39 2011 = (r222077) > @@ -3129,8 +3129,8 @@ plan_d: > } > #endif > out: > - if (sifa) { > #ifdef INET > + if (sifa) { > if (retried =3D=3D 1) { > LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) = { > if (dest_is_loop =3D=3D 0 && = SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Wed May 18 19:53:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DF2B1065678; Wed, 18 May 2011 19:53:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id A07EF8FC08; Wed, 18 May 2011 19:53:21 +0000 (UTC) Received: from [192.168.1.195] (p508FC1D9.dip.t-dialin.net [80.143.193.217]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 676E11C0C0BD8; Wed, 18 May 2011 21:53:19 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Michael Tuexen In-Reply-To: <796DC8CC-57FB-4C71-966F-F36519D5DA6E@FreeBSD.org> Date: Wed, 18 May 2011 21:53:18 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201105141822.p4EIMFuB011323@svn.freebsd.org> <796DC8CC-57FB-4C71-966F-F36519D5DA6E@FreeBSD.org> To: Bjoern A. Zeeb X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221904 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 19:53:22 -0000 Hi Bjoern, fixed in http://svn.freebsd.org/changeset/base/222077 Thanks for reporting it. Best regards Michael On May 18, 2011, at 6:35 PM, Bjoern A. Zeeb wrote: >=20 > On May 14, 2011, at 6:22 PM, Michael Tuexen wrote: >=20 >> Author: tuexen >> Date: Sat May 14 18:22:14 2011 >> New Revision: 221904 >> URL: http://svn.freebsd.org/changeset/base/221904 >>=20 >> Log: >> Fix the source address selection for boundall sockets >> when sending INITs to a global IPv4 address having >> only private IPv4 address. >> Allow the usage of a private address and make sure >> that no other private address will be used by the >> association. >> Initial work was done by rrs@. >>=20 >> MFC after: 1 week. >>=20 >> Modified: >> head/sys/netinet/sctp_output.c >> head/sys/netinet/sctp_output.h >>=20 >> Modified: head/sys/netinet/sctp_output.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/netinet/sctp_output.c Sat May 14 18:22:08 2011 = (r221903) >> +++ head/sys/netinet/sctp_output.c Sat May 14 18:22:14 2011 = (r221904) >=20 > ... >=20 >> @@ -3068,19 +3112,81 @@ plan_d: >> * It is restricted for some >> * reason.. probably not yet = added. >> */ >> + sifa =3D NULL; >> continue; >> } >> } >> - atomic_add_int(&sifa->refcount, 1); >> - return (sifa); >> + goto out; >> } >> } >> - /* >> - * Ok we can find NO address to source from that is not on our >> - * restricted list and non_asoc_address is NOT ok, or it is on = our >> - * restricted list. We can't source to it :-( >> - */ >> - return (NULL); >> +#ifdef INET >> + if ((retried =3D=3D 0) && (stcb->asoc.ipv4_local_scope =3D=3D = 0)) { >> + stcb->asoc.ipv4_local_scope =3D 1; >> + retried =3D 1; >> + goto again_with_private_addresses_allowed; >> + } else if (retried =3D=3D 1) { >> + stcb->asoc.ipv4_local_scope =3D 0; >> + } >> +#endif >> +out: >> + if (sifa) { >> +#ifdef INET >=20 > either this needs to go outside the if() or ... >=20 >> + if (retried =3D=3D 1) { >> + LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) = { >> + if (dest_is_loop =3D=3D 0 && = SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { >> + /* wrong base scope */ >> + continue; >> + } >> + LIST_FOREACH(sctp_ifa, = &sctp_ifn->ifalist, next_ifa) { >> + struct sctp_ifa *tmp_sifa; >> + >> + if ((sctp_ifa->localifa_flags & = SCTP_ADDR_DEFER_USE) && >> + (non_asoc_addr_ok =3D=3D 0)) >> + continue; >> + tmp_sifa =3D = sctp_is_ifa_addr_acceptable(sctp_ifa, >> + dest_is_loop, >> + dest_is_priv, fam); >> + if (tmp_sifa =3D=3D NULL) { >> + continue; >> + } >> + if (tmp_sifa =3D=3D sifa) { >> + continue; >> + } >> + if (stcb) { >> + if = (sctp_is_address_in_scope(tmp_sifa, >> + = stcb->asoc.ipv4_addr_legal, >> + = stcb->asoc.ipv6_addr_legal, >> + = stcb->asoc.loopback_scope, >> + = stcb->asoc.ipv4_local_scope, >> + = stcb->asoc.local_scope, >> + = stcb->asoc.site_scope, 0) =3D=3D 0) { >> + continue; >> + } >> + if (((non_asoc_addr_ok = =3D=3D 0) && >> + = (sctp_is_addr_restricted(stcb, tmp_sifa))) || >> + (non_asoc_addr_ok && >> + = (sctp_is_addr_restricted(stcb, tmp_sifa)) && >> + = (!sctp_is_addr_pending(stcb, tmp_sifa)))) { >> + /* >> + * It is = restricted >> + * for some = reason.. >> + * probably not = yet >> + * added. >> + */ >> + continue; >> + } >> + } >> + if = ((tmp_sifa->address.sin.sin_family =3D=3D AF_INET) && >> + = (IN4_ISPRIVATE_ADDRESS(&(tmp_sifa->address.sin.sin_addr)))) { >> + = sctp_add_local_addr_restricted(stcb, tmp_sifa); >> + } >> + } >> + } >> + } >> + atomic_add_int(&sifa->refcount, 1); >> + } >> +#endif >=20 > ... this needs to be inside the block. Either way will unbreak INET = free kernels again. >=20 >> + return (sifa); >> } >=20 >=20 >=20 > --=20 > Bjoern A. Zeeb You have to have = visions! > Stop bit received. Insert coin for new address family. >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Wed May 18 20:29:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69D211065672; Wed, 18 May 2011 20:29:07 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B1DD8FC14; Wed, 18 May 2011 20:29:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IKT7XE007256; Wed, 18 May 2011 20:29:07 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IKT7OG007254; Wed, 18 May 2011 20:29:07 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201105182029.p4IKT7OG007254@svn.freebsd.org> From: Josh Paetzel Date: Wed, 18 May 2011 20:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222078 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 20:29:07 -0000 Author: jpaetzel Date: Wed May 18 20:29:07 2011 New Revision: 222078 URL: http://svn.freebsd.org/changeset/base/222078 Log: Extracting optional components requires mounting devfs Submitted by: Kris Moore Approved by: kib (mentor) Sponsored by: iXsystems Modified: head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh Wed May 18 19:49:39 2011 (r222077) +++ head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh Wed May 18 20:29:07 2011 (r222078) @@ -120,9 +120,11 @@ COMPTMPDIR=\"${COMPTMPDIR}\" export COMPTMPDIR CFILE=\"${CFILE}\" export CFILE +mount -t devfs devfs /dev sh ${COMPTMPDIR}/install.sh +umount /dev " >${FSMNT}/.componentwrapper.sh chmod 755 ${FSMNT}/.componentwrapper.sh From owner-svn-src-head@FreeBSD.ORG Wed May 18 20:38:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34B8F1065672; Wed, 18 May 2011 20:38:29 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25F9A8FC18; Wed, 18 May 2011 20:38:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IKcTk9007570; Wed, 18 May 2011 20:38:29 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IKcT7Q007568; Wed, 18 May 2011 20:38:29 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201105182038.p4IKcT7Q007568@svn.freebsd.org> From: Josh Paetzel Date: Wed, 18 May 2011 20:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222079 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 20:38:29 -0000 Author: jpaetzel Date: Wed May 18 20:38:28 2011 New Revision: 222079 URL: http://svn.freebsd.org/changeset/base/222079 Log: Wipeout the end of disks, home to things like gmirror metadata, backup GPT tables, and other potential evil. Submitted by: Kris Moore Approved by: kib (mentor) Sponsored by: iXsystems Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Wed May 18 20:29:07 2011 (r222078) +++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Wed May 18 20:38:28 2011 (r222079) @@ -582,17 +582,9 @@ stop_gjournal() # Function to wipe the potential backup gpt table from a disk clear_backup_gpt_table() { - # Get the disk block size - local dSize="`gpart show $1 | grep $1 | tr -s ' ' | cut -d ' ' -f 3`" - - # Make sure this is a valid number - is_num "${dSize}" >/dev/null 2>/dev/null - [ $? -ne 0 ] && return - - # Die backup label, DIE echo_log "Clearing gpt backup table location on disk" - rc_nohalt "dd if=/dev/zero of=${1} bs=512 seek=${dSize}" - + rc_nohalt "dd if=/dev/zero of=${1} bs=1m count=1" + rc_nohalt "dd if=/dev/zero of=${1} bs=1m oseek=`diskinfo ${1} | awk '{print int($3 / (1024*1024)) - 4;}'`" } ; From owner-svn-src-head@FreeBSD.ORG Wed May 18 20:52:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AF6E1065674; Wed, 18 May 2011 20:52:52 +0000 (UTC) (envelope-from benl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7241B8FC13; Wed, 18 May 2011 20:52:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IKqqjj008072; Wed, 18 May 2011 20:52:52 GMT (envelope-from benl@svn.freebsd.org) Received: (from benl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IKqqeV008068; Wed, 18 May 2011 20:52:52 GMT (envelope-from benl@svn.freebsd.org) Message-Id: <201105182052.p4IKqqeV008068@svn.freebsd.org> From: Ben Laurie Date: Wed, 18 May 2011 20:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222080 - head/usr.bin/rpcgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 20:52:52 -0000 Author: benl Date: Wed May 18 20:52:52 2011 New Revision: 222080 URL: http://svn.freebsd.org/changeset/base/222080 Log: Fix clang warnings. Note: these were actually bugs (printf with no format string). Approved by: philip (mentor) Modified: head/usr.bin/rpcgen/rpc_hout.c head/usr.bin/rpcgen/rpc_svcout.c head/usr.bin/rpcgen/rpc_tblout.c Modified: head/usr.bin/rpcgen/rpc_hout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_hout.c Wed May 18 20:38:28 2011 (r222079) +++ head/usr.bin/rpcgen/rpc_hout.c Wed May 18 20:52:52 2011 (r222080) @@ -500,7 +500,7 @@ pdeclaration(const char *name, declarati break; } } - f_print(fout, separator); + fputs(separator, fout); } static int Modified: head/usr.bin/rpcgen/rpc_svcout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_svcout.c Wed May 18 20:38:28 2011 (r222079) +++ head/usr.bin/rpcgen/rpc_svcout.c Wed May 18 20:52:52 2011 (r222080) @@ -349,7 +349,7 @@ write_real_program(definition *def) f_print(fout, "("); /* arg name */ if (proc->arg_num > 1) - f_print(fout, proc->args.argname); + fputs(proc->args.argname, fout); else ptype(proc->args.decls->decl.prefix, proc->args.decls->decl.type, 0); Modified: head/usr.bin/rpcgen/rpc_tblout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_tblout.c Wed May 18 20:38:28 2011 (r222079) +++ head/usr.bin/rpcgen/rpc_tblout.c Wed May 18 20:52:52 2011 (r222080) @@ -103,7 +103,7 @@ write_table(definition *def) expected = 0; } else { expected = 1; - f_print(fout, null_entry); + fputs(null_entry, fout); } for (proc = vp->procs; proc != NULL; proc = proc->next) { current = atoi(proc->proc_num); @@ -141,7 +141,7 @@ write_table(definition *def) } /* print the table trailer */ - f_print(fout, tbl_end); + fputs(tbl_end, fout); f_print(fout, tbl_nproc, progvers, progvers, progvers); } } From owner-svn-src-head@FreeBSD.ORG Wed May 18 20:53:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16145106566B; Wed, 18 May 2011 20:53:04 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF688FC0C; Wed, 18 May 2011 20:53:03 +0000 (UTC) Received: by vxc34 with SMTP id 34so1997195vxc.13 for ; Wed, 18 May 2011 13:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=U9VquFpvjBuIM+Ia3DcXICFuuDR80XAljkrsy7K1ZiM=; b=OmgCPwrOJf1z7XXJilYOlHVbQPE9PmKyoVAkz4weggruEYb+n3vLBRFs7Y57d408oD KhzW6AsWeNrLxfsWCnLURL8IcVVei0UwhCO7qMMyuDkMQHf6pcUmfC8OuYb04qEACUQD /CfDuyPrPdhPWTYuMiaL+deCPYP9oEobdWoBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=SbXHRiGmPFT1iCW4lcni3FVFjcNGGkXcTOikXTCNPwPrqcA7pQxsArwsKs5pFRE0UI tcc9QuDbKN1Ars8grSTedSJKvNPMpo701vq8iId88lVLmEygCMxXEwyAgEodFefmdJSd NdfT5Ou5yKmqv5Zj5wvVHZ4eL/HEKlitWT1K0= MIME-Version: 1.0 Received: by 10.220.136.206 with SMTP id s14mr699225vct.2.1305751982536; Wed, 18 May 2011 13:53:02 -0700 (PDT) Received: by 10.220.188.202 with HTTP; Wed, 18 May 2011 13:53:02 -0700 (PDT) In-Reply-To: <201105182029.p4IKT7OG007254@svn.freebsd.org> References: <201105182029.p4IKT7OG007254@svn.freebsd.org> Date: Wed, 18 May 2011 13:53:02 -0700 Message-ID: From: Garrett Cooper To: Josh Paetzel Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222078 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 20:53:04 -0000 On Wed, May 18, 2011 at 1:29 PM, Josh Paetzel wrote: > Author: jpaetzel > Date: Wed May 18 20:29:07 2011 > New Revision: 222078 > URL: http://svn.freebsd.org/changeset/base/222078 > > Log: > =A0Extracting optional components requires mounting devfs > > =A0Submitted by: Kris Moore > =A0Approved by: =A0kib (mentor) > =A0Sponsored by: iXsystems > > Modified: > =A0head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh > > Modified: head/usr.sbin/pc-sysinstall/backend/functions-installcomponents= .sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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.sbin/pc-sysinstall/backend/functions-installcomponents.sh = =A0Wed May 18 19:49:39 2011 =A0 =A0 =A0 =A0(r222077) > +++ head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh = =A0Wed May 18 20:29:07 2011 =A0 =A0 =A0 =A0(r222078) > @@ -120,9 +120,11 @@ COMPTMPDIR=3D\"${COMPTMPDIR}\" > =A0export COMPTMPDIR > =A0CFILE=3D\"${CFILE}\" > =A0export CFILE > +mount -t devfs devfs /dev > > =A0sh ${COMPTMPDIR}/install.sh > > +umount /dev > =A0" >${FSMNT}/.componentwrapper.sh > =A0 chmod 755 ${FSMNT}/.componentwrapper.sh Is pc-sysinstall run with set -e anywhere? Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Wed May 18 20:57:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2237106564A; Wed, 18 May 2011 20:57:23 +0000 (UTC) (envelope-from benl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3D0E8FC08; Wed, 18 May 2011 20:57:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IKvNUh008253; Wed, 18 May 2011 20:57:23 GMT (envelope-from benl@svn.freebsd.org) Received: (from benl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IKvNxG008251; Wed, 18 May 2011 20:57:23 GMT (envelope-from benl@svn.freebsd.org) Message-Id: <201105182057.p4IKvNxG008251@svn.freebsd.org> From: Ben Laurie Date: Wed, 18 May 2011 20:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222081 - head/crypto/heimdal/lib/sl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 20:57:24 -0000 Author: benl Date: Wed May 18 20:57:23 2011 New Revision: 222081 URL: http://svn.freebsd.org/changeset/base/222081 Log: Fix clang warning (why is there nowhere yyparse() is declared?). Approved by: philip (mentor) Modified: head/crypto/heimdal/lib/sl/slc-gram.y Modified: head/crypto/heimdal/lib/sl/slc-gram.y ============================================================================== --- head/crypto/heimdal/lib/sl/slc-gram.y Wed May 18 20:52:52 2011 (r222080) +++ head/crypto/heimdal/lib/sl/slc-gram.y Wed May 18 20:57:23 2011 (r222081) @@ -49,6 +49,7 @@ RCSID("$Id: slc-gram.y 20767 2007-06-01 #include "slc.h" extern FILE *yyin; extern struct assignment *assignment; +extern int yyparse(void); %} %union { From owner-svn-src-head@FreeBSD.ORG Wed May 18 21:00:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F219D106566B; Wed, 18 May 2011 21:00:27 +0000 (UTC) (envelope-from benl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3F578FC12; Wed, 18 May 2011 21:00:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IL0R97008408; Wed, 18 May 2011 21:00:27 GMT (envelope-from benl@svn.freebsd.org) Received: (from benl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IL0Rku008406; Wed, 18 May 2011 21:00:27 GMT (envelope-from benl@svn.freebsd.org) Message-Id: <201105182100.p4IL0Rku008406@svn.freebsd.org> From: Ben Laurie Date: Wed, 18 May 2011 21:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222082 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 21:00:28 -0000 Author: benl Date: Wed May 18 21:00:27 2011 New Revision: 222082 URL: http://svn.freebsd.org/changeset/base/222082 Log: Fix clang warnings. Approved by: philip (mentor) Modified: head/contrib/gcc/genmodes.c Modified: head/contrib/gcc/genmodes.c ============================================================================== --- head/contrib/gcc/genmodes.c Wed May 18 20:57:23 2011 (r222081) +++ head/contrib/gcc/genmodes.c Wed May 18 21:00:27 2011 (r222082) @@ -787,7 +787,7 @@ calc_wider_mode (void) #define tagged_printf(FMT, ARG, TAG) do { \ int count_; \ - printf (" " FMT ",%n", ARG, &count_); \ + count_ = printf (" " FMT ",", ARG); \ printf ("%*s/* %s */\n", 27 - count_, "", TAG); \ } while (0) @@ -822,7 +822,7 @@ enum machine_mode\n{"); for (m = modes[c]; m; m = m->next) { int count_; - printf (" %smode,%n", m->name, &count_); + count_ = printf (" %smode,", m->name); printf ("%*s/* %s:%d */\n", 27 - count_, "", trim_filename (m->file), m->line); } From owner-svn-src-head@FreeBSD.ORG Wed May 18 21:04:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FCFE106566B; Wed, 18 May 2011 21:04:30 +0000 (UTC) (envelope-from benl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25F328FC1B; Wed, 18 May 2011 21:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IL4Uwl008568; Wed, 18 May 2011 21:04:30 GMT (envelope-from benl@svn.freebsd.org) Received: (from benl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IL4Toc008562; Wed, 18 May 2011 21:04:29 GMT (envelope-from benl@svn.freebsd.org) Message-Id: <201105182104.p4IL4Toc008562@svn.freebsd.org> From: Ben Laurie Date: Wed, 18 May 2011 21:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222083 - in head/contrib/groff/src: devices/grohtml libs/libdriver roff/troff utils/hpftodit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 21:04:30 -0000 Author: benl Date: Wed May 18 21:04:29 2011 New Revision: 222083 URL: http://svn.freebsd.org/changeset/base/222083 Log: Fix clang warnings. Note: possible minor security issues fixed (untrusted string used as printf format string). Approved by: philip (mentor) Modified: head/contrib/groff/src/devices/grohtml/post-html.cpp head/contrib/groff/src/libs/libdriver/input.cpp head/contrib/groff/src/roff/troff/mtsm.cpp head/contrib/groff/src/roff/troff/node.cpp head/contrib/groff/src/utils/hpftodit/hpftodit.cpp Modified: head/contrib/groff/src/devices/grohtml/post-html.cpp ============================================================================== --- head/contrib/groff/src/devices/grohtml/post-html.cpp Wed May 18 21:00:27 2011 (r222082) +++ head/contrib/groff/src/devices/grohtml/post-html.cpp Wed May 18 21:04:29 2011 (r222083) @@ -1587,7 +1587,7 @@ void header_desc::write_headings (FILE * buffer += as_string(h); buffer += '\0'; - fprintf(f, buffer.contents()); + fputs(buffer.contents(), f); } else fputs(g->text_string, f); h++; Modified: head/contrib/groff/src/libs/libdriver/input.cpp ============================================================================== --- head/contrib/groff/src/libs/libdriver/input.cpp Wed May 18 21:00:27 2011 (r222082) +++ head/contrib/groff/src/libs/libdriver/input.cpp Wed May 18 21:04:29 2011 (r222083) @@ -995,7 +995,7 @@ next_command(void) inline bool odd(const int n) { - return (n & 1 == 1) ? true : false; + return ((n & 1) == 1) ? true : false; } ////////////////////////////////////////////////////////////////////// Modified: head/contrib/groff/src/roff/troff/mtsm.cpp ============================================================================== --- head/contrib/groff/src/roff/troff/mtsm.cpp Wed May 18 21:00:27 2011 (r222082) +++ head/contrib/groff/src/roff/troff/mtsm.cpp Wed May 18 21:04:29 2011 (r222083) @@ -611,14 +611,16 @@ int state_set::is_in(int_value_state i) return (intset & (1 << (int)i)) != 0; } +// Note: this used to have a bug s.t. it always tested for bit 0 (benl 18/5/11) int state_set::is_in(units_value_state u) { - return (unitsset & (1 << (int)u) != 0); + return (unitsset & (1 << (int)u)) != 0; } +// Note: this used to have a bug s.t. it always tested for bit 0 (benl 18/5/11) int state_set::is_in(string_value_state s) { - return (stringset & (1 << (int)s) != 0); + return (stringset & (1 << (int)s)) != 0; } void state_set::add(units_value_state, int n) Modified: head/contrib/groff/src/roff/troff/node.cpp ============================================================================== --- head/contrib/groff/src/roff/troff/node.cpp Wed May 18 21:00:27 2011 (r222082) +++ head/contrib/groff/src/roff/troff/node.cpp Wed May 18 21:04:29 2011 (r222083) @@ -2157,7 +2157,7 @@ void glyph_node::debug_node() if (c) fprintf(stderr, "%c", c); else - fprintf(stderr, ci->nm.contents()); + fputs(ci->nm.contents(), stderr); if (push_state) fprintf(stderr, " "); if (state) Modified: head/contrib/groff/src/utils/hpftodit/hpftodit.cpp ============================================================================== --- head/contrib/groff/src/utils/hpftodit/hpftodit.cpp Wed May 18 21:00:27 2011 (r222082) +++ head/contrib/groff/src/utils/hpftodit/hpftodit.cpp Wed May 18 21:04:29 2011 (r222083) @@ -870,9 +870,9 @@ output_charset(const int tfm_type) else if (!all_flag) continue; else if (tfm_type == MSL) - printf(hp_msl_to_ucode_name(charcode)); + fputs(hp_msl_to_ucode_name(charcode), stdout); else - printf(unicode_to_ucode_name(charcode)); + fputs(unicode_to_ucode_name(charcode), stdout); printf("\t%d,%d", scale(char_table[i].width), scale(char_table[i].ascent)); From owner-svn-src-head@FreeBSD.ORG Wed May 18 21:06:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B78B106566C; Wed, 18 May 2011 21:06:20 +0000 (UTC) (envelope-from benl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CBE58FC0C; Wed, 18 May 2011 21:06:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IL6K7r008661; Wed, 18 May 2011 21:06:20 GMT (envelope-from benl@svn.freebsd.org) Received: (from benl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IL6KkE008657; Wed, 18 May 2011 21:06:20 GMT (envelope-from benl@svn.freebsd.org) Message-Id: <201105182106.p4IL6KkE008657@svn.freebsd.org> From: Ben Laurie Date: Wed, 18 May 2011 21:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222084 - head/contrib/gperf/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 21:06:20 -0000 Author: benl Date: Wed May 18 21:06:20 2011 New Revision: 222084 URL: http://svn.freebsd.org/changeset/base/222084 Log: Fix clang warnings. Approved by: philip (mentor) Modified: head/contrib/gperf/src/gen-perf.cc head/contrib/gperf/src/key-list.cc head/contrib/gperf/src/options.cc Modified: head/contrib/gperf/src/gen-perf.cc ============================================================================== --- head/contrib/gperf/src/gen-perf.cc Wed May 18 21:04:29 2011 (r222083) +++ head/contrib/gperf/src/gen-perf.cc Wed May 18 21:06:20 2011 (r222084) @@ -246,7 +246,7 @@ Gen_Perf::change (List_Node *prior, List { if (option[DEBUG]) { - fprintf (stderr, " by changing asso_value['%c'] (char #%d) to %d\n", + fprintf (stderr, " by changing asso_value['%c'] (char #%zd) to %d\n", *p, p - union_set + 1, asso_values[(unsigned char)(*p)]); fflush (stderr); } Modified: head/contrib/gperf/src/key-list.cc ============================================================================== --- head/contrib/gperf/src/key-list.cc Wed May 18 21:04:29 2011 (r222083) +++ head/contrib/gperf/src/key-list.cc Wed May 18 21:06:20 2011 (r222084) @@ -497,8 +497,8 @@ Key_List::merge (List_Node *list1, List_ *resultp = list1; break; } - if (occurrence_sort && list1->occurrence < list2->occurrence - || hash_sort && list1->hash_value > list2->hash_value) + if ((occurrence_sort && list1->occurrence < list2->occurrence) + || (hash_sort && list1->hash_value > list2->hash_value)) { *resultp = list2; resultp = &list2->next; list2 = list1; list1 = *resultp; @@ -1035,17 +1035,16 @@ Key_List::output_hash_function (void) if (option[CPLUSPLUS]) printf ("%s::", option.get_class_name ()); printf ("%s ", option.get_hash_name ()); - printf (option[KRC] ? - "(str, len)\n" - " register char *str;\n" - " register unsigned int len;\n" : - option[C] ? - "(str, len)\n" - " register const char *str;\n" - " register unsigned int len;\n" : - option[ANSIC] | option[CPLUSPLUS] ? - "(register const char *str, register unsigned int len)\n" : - ""); + if (option[KRC] || option[C] || option [ANSIC] || option[CPLUSPLUS]) + printf (option[KRC] ? + "(str, len)\n" + " register char *str;\n" + " register unsigned int len;\n" : + option[C] ? + "(str, len)\n" + " register const char *str;\n" + " register unsigned int len;\n" : + "(register const char *str, register unsigned int len)\n"); /* Note that when the hash function is called, it has already been verified that min_key_len <= len <= max_key_len. */ @@ -1442,7 +1441,7 @@ Key_List::output_lookup_array (void) if (option[DEBUG]) fprintf (stderr, - "dup_ptr[%d]: hash_value = %d, index = %d, count = %d\n", + "dup_ptr[%zd]: hash_value = %d, index = %d, count = %d\n", dup_ptr - duplicates, dup_ptr->hash_value, dup_ptr->index, dup_ptr->count); @@ -1986,17 +1985,16 @@ Key_List::output_lookup_function (void) if (option[CPLUSPLUS]) printf ("%s::", option.get_class_name ()); printf ("%s ", option.get_function_name ()); - printf (option[KRC] ? - "(str, len)\n" - " register char *str;\n" - " register unsigned int len;\n" : - option[C] ? - "(str, len)\n" - " register const char *str;\n" - " register unsigned int len;\n" : - option[ANSIC] | option[CPLUSPLUS] ? - "(register const char *str, register unsigned int len)\n" : - ""); + if (option[KRC] || option[C] || option[ANSIC] || option[CPLUSPLUS]) + printf (option[KRC] ? + "(str, len)\n" + " register char *str;\n" + " register unsigned int len;\n" : + option[C] ? + "(str, len)\n" + " register const char *str;\n" + " register unsigned int len;\n" : + "(register const char *str, register unsigned int len)\n"); /* Output the function's body. */ printf ("{\n"); Modified: head/contrib/gperf/src/options.cc ============================================================================== --- head/contrib/gperf/src/options.cc Wed May 18 21:04:29 2011 (r222083) +++ head/contrib/gperf/src/options.cc Wed May 18 21:06:20 2011 (r222084) @@ -237,7 +237,7 @@ Options::print_options (void) { putchar (*arg); arg++; - if (*arg >= 'A' && *arg <= 'Z' || *arg >= 'a' && *arg <= 'z') + if ((*arg >= 'A' && *arg <= 'Z') || (*arg >= 'a' && *arg <= 'z')) { putchar (*arg); arg++; From owner-svn-src-head@FreeBSD.ORG Wed May 18 21:13:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 798201065672; Wed, 18 May 2011 21:13:04 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 1A37B8FC0A; Wed, 18 May 2011 21:13:03 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id D799545E94; Wed, 18 May 2011 23:13:02 +0200 (CEST) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 1116445E86; Wed, 18 May 2011 23:12:57 +0200 (CEST) Date: Wed, 18 May 2011 23:12:36 +0200 From: Pawel Jakub Dawidek To: Josh Paetzel Message-ID: <20110518211236.GD2273@garage.freebsd.pl> References: <201105182038.p4IKcT7Q007568@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MAH+hnPXVZWQ5cD/" Content-Disposition: inline In-Reply-To: <201105182038.p4IKcT7Q007568@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222079 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 21:13:04 -0000 --MAH+hnPXVZWQ5cD/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 18, 2011 at 08:38:29PM +0000, Josh Paetzel wrote: > Author: jpaetzel > Date: Wed May 18 20:38:28 2011 > New Revision: 222079 > URL: http://svn.freebsd.org/changeset/base/222079 >=20 > Log: > Wipeout the end of disks, home to things like gmirror metadata, backup = GPT tables, > and other potential evil. If geom_mirror.ko is loaded it won't work, as gmirror keeps its components open for writing. But if this is GENERIC and geom_mirror.ko is not loaded, you should be fine. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --MAH+hnPXVZWQ5cD/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk3UNkQACgkQForvXbEpPzTNpgCfSGU9G6Qz9qxE8lE19NcFKQ4q KNIAoK6sUsStd0AYE4hjTaqP1BhwKxlN =RfC1 -----END PGP SIGNATURE----- --MAH+hnPXVZWQ5cD/-- From owner-svn-src-head@FreeBSD.ORG Wed May 18 21:17:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D85D3106564A; Wed, 18 May 2011 21:17:18 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 79FB78FC12; Wed, 18 May 2011 21:17:18 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 65D3545EA7; Wed, 18 May 2011 23:17:17 +0200 (CEST) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 16D1345CDD; Wed, 18 May 2011 23:17:12 +0200 (CEST) Date: Wed, 18 May 2011 23:16:51 +0200 From: Pawel Jakub Dawidek To: Ben Laurie Message-ID: <20110518211651.GE2273@garage.freebsd.pl> References: <201105182106.p4IL6KkE008657@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7LkOrbQMr4cezO2T" Content-Disposition: inline In-Reply-To: <201105182106.p4IL6KkE008657@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222084 - head/contrib/gperf/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 21:17:18 -0000 --7LkOrbQMr4cezO2T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 18, 2011 at 09:06:20PM +0000, Ben Laurie wrote: > Author: benl > Date: Wed May 18 21:06:20 2011 > New Revision: 222084 > URL: http://svn.freebsd.org/changeset/base/222084 >=20 > Log: > Fix clang warnings. > =20 > Approved by: philip (mentor) [...] > - fprintf (stderr, " by changing asso_value['%c'] (char #%d) t= o %d\n", > + fprintf (stderr, " by changing asso_value['%c'] (char #%zd) = to %d\n", > *p, p - union_set + 1, asso_values[(unsigned char)(= *p)]); Hmm, both 'p' and 'union_set' are 'char *' and %zd is for ssize_t. It is a bit strange that it fixes the warning. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --7LkOrbQMr4cezO2T Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk3UN0IACgkQForvXbEpPzTZTACaA2O52ZfJwqf6psjvOwmvA7Ec 9+4AnR4qgyeJwv/sAgSewkajlVseyZhy =A2HV -----END PGP SIGNATURE----- --7LkOrbQMr4cezO2T-- From owner-svn-src-head@FreeBSD.ORG Wed May 18 21:31:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFD311065670; Wed, 18 May 2011 21:31:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id A28548FC0C; Wed, 18 May 2011 21:31:36 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:7528:4084:758a:e8ff] (unknown [IPv6:2001:7b8:3a7:0:7528:4084:758a:e8ff]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id EF7CE5C37; Wed, 18 May 2011 23:31:35 +0200 (CEST) Message-ID: <4DD43AB7.7060705@FreeBSD.org> Date: Wed, 18 May 2011 23:31:35 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18pre) Gecko/20110506 Lanikai/3.1.11pre MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201105182106.p4IL6KkE008657@svn.freebsd.org> <20110518211651.GE2273@garage.freebsd.pl> In-Reply-To: <20110518211651.GE2273@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Ben Laurie , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222084 - head/contrib/gperf/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 21:31:37 -0000 On 2011-05-18 23:16, Pawel Jakub Dawidek wrote: > On Wed, May 18, 2011 at 09:06:20PM +0000, Ben Laurie wrote: >> Author: benl >> Date: Wed May 18 21:06:20 2011 >> New Revision: 222084 >> URL: http://svn.freebsd.org/changeset/base/222084 >> >> Log: >> Fix clang warnings. >> >> Approved by: philip (mentor) > [...] >> - fprintf (stderr, " by changing asso_value['%c'] (char #%d) to %d\n", >> + fprintf (stderr, " by changing asso_value['%c'] (char #%zd) to %d\n", >> *p, p - union_set + 1, asso_values[(unsigned char)(*p)]); > > Hmm, both 'p' and 'union_set' are 'char *' and %zd is for ssize_t. It is > a bit strange that it fixes the warning. If you subtract two pointers, such as in this case, you get a ptrdiff_t. Strictly, this doesn't have to be exactly the same type as ssize_t, but in practice it will almost always be. You can also cast the result to intmax_t, and use %jd, then it will always be correct, but possibly have some small overhead. From owner-svn-src-head@FreeBSD.ORG Wed May 18 21:38:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 564E11065670; Wed, 18 May 2011 21:38:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1A8658FC1C; Wed, 18 May 2011 21:38:35 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:7528:4084:758a:e8ff] (unknown [IPv6:2001:7b8:3a7:0:7528:4084:758a:e8ff]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6F3955C37; Wed, 18 May 2011 23:38:34 +0200 (CEST) Message-ID: <4DD43C5A.8090804@FreeBSD.org> Date: Wed, 18 May 2011 23:38:34 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18pre) Gecko/20110506 Lanikai/3.1.11pre MIME-Version: 1.0 To: Ben Laurie References: <201105182052.p4IKqqeV008068@svn.freebsd.org> In-Reply-To: <201105182052.p4IKqqeV008068@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222080 - head/usr.bin/rpcgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 21:38:35 -0000 On 2011-05-18 22:52, Ben Laurie wrote: > Author: benl > Date: Wed May 18 20:52:52 2011 > New Revision: 222080 > URL: http://svn.freebsd.org/changeset/base/222080 > > Log: > Fix clang warnings. > > Note: these were actually bugs (printf with no format string). On 2011-05-18 22:52, Ben Laurie wrote: > Author: benl > Date: Wed May 18 20:52:52 2011 > New Revision: 222080 > URL: http://svn.freebsd.org/changeset/base/222080 > > Log: > Fix clang warnings. > > Note: these were actually bugs (printf with no format string). Thanks for fixing these, I had a bunch of similar fixes in a git branch here, but never got to commit them... :) From owner-svn-src-head@FreeBSD.ORG Wed May 18 21:38:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26267106564A; Wed, 18 May 2011 21:38:55 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id B21D78FC18; Wed, 18 May 2011 21:38:53 +0000 (UTC) Received: by wwc33 with SMTP id 33so2153174wwc.31 for ; Wed, 18 May 2011 14:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=fSkXHjfLfG/Xh7QdtRtr7o/jG3yUf8pNwUlcOpgN+sg=; b=ZasQebzXKuXi0cu5St8j17qNhn1lqR8N4ZUZzWaucZDTxZH1xLNhWwbjY2dEmszJ19 aiNXg6qH7ZDwUlEeeBnU+yJBxDQ6lElwKKY4SEfeIUuDW9MZcrI7KOXWKUD5ckp5FyKk EN1VhxKI8zjnreDaF3N+NUfcmiMHVAnBptC5c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=x2Xws8DFQoSKNaGsv1mXrvB3ANMofuIdjOs4G4i4uafDaUjILbNAtVrno9H64ZLnNe FDiZscdJLm4cERs01oenfONDFXrVJxQYjq0iL6iNzOsge7LkPCrZ5CAIRU6JM6A1DERD wnGR1BD4lm1M3X56hT5iQsiItm9X0Ndo4+yLQ= MIME-Version: 1.0 Received: by 10.216.79.10 with SMTP id h10mr2302544wee.20.1305754732765; Wed, 18 May 2011 14:38:52 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.216.153.104 with HTTP; Wed, 18 May 2011 14:38:52 -0700 (PDT) In-Reply-To: <4DD43AB7.7060705@FreeBSD.org> References: <201105182106.p4IL6KkE008657@svn.freebsd.org> <20110518211651.GE2273@garage.freebsd.pl> <4DD43AB7.7060705@FreeBSD.org> Date: Wed, 18 May 2011 14:38:52 -0700 X-Google-Sender-Auth: ByVMmZRxMpUw8M3JIdXfR78tKWQ Message-ID: From: mdf@FreeBSD.org To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Ben Laurie , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r222084 - head/contrib/gperf/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 21:38:55 -0000 On Wed, May 18, 2011 at 2:31 PM, Dimitry Andric wrote: > On 2011-05-18 23:16, Pawel Jakub Dawidek wrote: >> >> On Wed, May 18, 2011 at 09:06:20PM +0000, Ben Laurie wrote: >>> >>> Author: benl >>> Date: Wed May 18 21:06:20 2011 >>> New Revision: 222084 >>> URL: http://svn.freebsd.org/changeset/base/222084 >>> >>> Log: >>> =A0 Fix clang warnings. >>> >>> =A0 Approved by: philip (mentor) >> >> [...] >>> >>> - =A0 =A0 =A0 =A0 =A0 =A0fprintf (stderr, " by changing asso_value['%c'= ] (char #%d) >>> to %d\n", >>> + =A0 =A0 =A0 =A0 =A0 =A0fprintf (stderr, " by changing asso_value['%c'= ] (char #%zd) >>> to %d\n", >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 *p, p - union_set + 1, asso= _values[(unsigned >>> char)(*p)]); >> >> Hmm, both 'p' and 'union_set' are 'char *' and %zd is for ssize_t. It is >> a bit strange that it fixes the warning. > > If you subtract two pointers, such as in this case, you get a ptrdiff_t. > > Strictly, this doesn't have to be exactly the same type as ssize_t, but > in practice it will almost always be. > > You can also cast the result to intmax_t, and use %jd, then it will > always be correct, but possibly have some small overhead. Or you can use %td which is the C99 conversion specifier for ptrdiff_t. Thanks, matthew From owner-svn-src-head@FreeBSD.ORG Wed May 18 22:09:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1FAC106566C; Wed, 18 May 2011 22:09:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9885E8FC13; Wed, 18 May 2011 22:09:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IM943p010702; Wed, 18 May 2011 22:09:04 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IM94lh010699; Wed, 18 May 2011 22:09:04 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201105182209.p4IM94lh010699@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 18 May 2011 22:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222085 - head/sys/dev/cxgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 22:09:04 -0000 Author: np Date: Wed May 18 22:09:04 2011 New Revision: 222085 URL: http://svn.freebsd.org/changeset/base/222085 Log: - Enable per-channel congestion notification. - Enable PCIe relaxed ordering for all egress queues and rx data buffers. 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 Wed May 18 21:06:20 2011 (r222084) +++ head/sys/dev/cxgbe/t4_main.c Wed May 18 22:09:04 2011 (r222085) @@ -366,7 +366,13 @@ t4_attach(device_t dev) sc->mbox = sc->pf; pci_enable_busmaster(dev); - pci_set_max_read_req(dev, 4096); + if (pci_find_cap(dev, PCIY_EXPRESS, &i) == 0) { + pci_set_max_read_req(dev, 4096); + v = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); + v |= PCIM_EXP_CTL_RELAXED_ORD_ENABLE; + pci_write_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, v, 2); + } + snprintf(sc->lockname, sizeof(sc->lockname), "%s", device_get_nameunit(dev)); mtx_init(&sc->sc_lock, sc->lockname, 0, MTX_DEF); @@ -3206,6 +3212,7 @@ filter_rpl(struct adapter *sc, const str } } +/* XXX: use pci_find_cap */ int t4_os_find_pci_capability(struct adapter *sc, int cap) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Wed May 18 21:06:20 2011 (r222084) +++ head/sys/dev/cxgbe/t4_sge.c Wed May 18 22:09:04 2011 (r222085) @@ -100,7 +100,7 @@ static int alloc_ring(struct adapter *, static int free_ring(struct adapter *, bus_dma_tag_t, bus_dmamap_t, bus_addr_t, void *); static int alloc_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *, - int); + int, int); static int free_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *); static int alloc_iq(struct sge_iq *, int); static int free_iq(struct sge_iq *); @@ -1104,7 +1104,7 @@ free_ring(struct adapter *sc, bus_dma_ta */ static int alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl, - int intr_idx) + int intr_idx, int cong) { int rc, i, cntxt_id; size_t len; @@ -1155,6 +1155,8 @@ alloc_iq_fl(struct port_info *pi, struct V_FW_IQ_CMD_IQESIZE(ilog2(iq->esize) - 4)); c.iqsize = htobe16(iq->qsize); c.iqaddr = htobe64(iq->ba); + if (cong >= 0) + c.iqns_to_fl0congen = htobe32(F_FW_IQ_CMD_IQFLINTCONGEN); if (fl) { mtx_init(&fl->fl_lock, fl->lockname, NULL, MTX_DEF); @@ -1198,7 +1200,15 @@ alloc_iq_fl(struct port_info *pi, struct fl->needed = fl->cap; c.iqns_to_fl0congen = - htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE)); + htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) | + F_FW_IQ_CMD_FL0FETCHRO | F_FW_IQ_CMD_FL0DATARO | + F_FW_IQ_CMD_FL0PADEN); + if (cong >= 0) { + c.iqns_to_fl0congen |= + htobe32(V_FW_IQ_CMD_FL0CNGCHMAP(cong) | + F_FW_IQ_CMD_FL0CONGCIF | + F_FW_IQ_CMD_FL0CONGEN); + } c.fl0dcaen_to_fl0cidxfthresh = htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) | V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); @@ -1325,7 +1335,7 @@ free_iq_fl(struct port_info *pi, struct static int alloc_iq(struct sge_iq *iq, int intr_idx) { - return alloc_iq_fl(NULL, iq, NULL, intr_idx); + return alloc_iq_fl(NULL, iq, NULL, intr_idx, -1); } static int @@ -1342,7 +1352,7 @@ alloc_rxq(struct port_info *pi, struct s struct sysctl_oid_list *children; char name[16]; - rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx); + rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx, 1 << pi->tx_chan); if (rc != 0) return (rc); @@ -1436,7 +1446,7 @@ alloc_ctrlq(struct adapter *sc, struct s c.physeqid_pkd = htobe32(0); c.fetchszm_to_iqid = htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | - V_FW_EQ_CTRL_CMD_PCIECHN(idx) | + V_FW_EQ_CTRL_CMD_PCIECHN(idx) | F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | @@ -1561,7 +1571,7 @@ alloc_txq(struct port_info *pi, struct s c.viid_pkd = htobe32(V_FW_EQ_ETH_CMD_VIID(pi->viid)); c.fetchszm_to_iqid = htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | - V_FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) | + V_FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO | V_FW_EQ_ETH_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_ETH_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_ETH_CMD_FBMAX(X_FETCHBURSTMAX_512B) | From owner-svn-src-head@FreeBSD.ORG Wed May 18 22:36:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25C1C106564A; Wed, 18 May 2011 22:36:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 169D68FC13; Wed, 18 May 2011 22:36:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IMawZI011601; Wed, 18 May 2011 22:36:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IMawrB011599; Wed, 18 May 2011 22:36:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201105182236.p4IMawrB011599@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 18 May 2011 22:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222086 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 22:36:59 -0000 Author: kib Date: Wed May 18 22:36:58 2011 New Revision: 222086 URL: http://svn.freebsd.org/changeset/base/222086 Log: The CDP_ACTIVE flag is cleared at the beginning of destroy_devl(), and destroy_devl() drops dev_mtx. The protection against the race with dev_rel(), introduced in r163328, should be extended to cover destroy_devl() calls for the children of the destroyed dev. Reported and tested by: joerg MFC after: 1 week Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Wed May 18 22:09:04 2011 (r222085) +++ head/sys/kern/kern_conf.c Wed May 18 22:36:58 2011 (r222086) @@ -981,6 +981,8 @@ destroy_devl(struct cdev *dev) /* Remove name marking */ dev->si_flags &= ~SI_NAMED; + dev->si_refcount++; /* Avoid race with dev_rel() */ + /* If we are a child, remove us from the parents list */ if (dev->si_flags & SI_CHILD) { LIST_REMOVE(dev, si_siblings); @@ -997,7 +999,6 @@ destroy_devl(struct cdev *dev) dev->si_flags &= ~SI_CLONELIST; } - dev->si_refcount++; /* Avoid race with dev_rel() */ csw = dev->si_devsw; dev->si_devsw = NULL; /* already NULL for SI_ALIAS */ while (csw != NULL && csw->d_purge != NULL && dev->si_threadcount) { From owner-svn-src-head@FreeBSD.ORG Wed May 18 22:43:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B590D106564A; Wed, 18 May 2011 22:43:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BCD18FC1B; Wed, 18 May 2011 22:43:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IMhuui011847; Wed, 18 May 2011 22:43:56 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IMhuHX011845; Wed, 18 May 2011 22:43:56 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105182243.p4IMhuHX011845@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 18 May 2011 22:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222087 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 22:43:56 -0000 Author: pjd Date: Wed May 18 22:43:56 2011 New Revision: 222087 URL: http://svn.freebsd.org/changeset/base/222087 Log: - Add support for AF_INET6 sockets for %S format character. - Use inet_ntop(3) instead of reimplementing it. - Use %hhu for unsigned char instead of casting it to unsigned int and using %u. MFC after: 1 week Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Wed May 18 22:36:58 2011 (r222086) +++ head/sbin/hastd/pjdlog.c Wed May 18 22:43:56 2011 (r222087) @@ -31,8 +31,10 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include +#include #include #include @@ -103,22 +105,39 @@ pjdlog_printf_render_sockaddr(struct __p switch (ss->ss_family) { case AF_INET: { + char addr[INET_ADDRSTRLEN]; const struct sockaddr_in *sin; - in_addr_t ip; unsigned int port; sin = (const struct sockaddr_in *)ss; - ip = ntohl(sin->sin_addr.s_addr); port = ntohs(sin->sin_port); + if (inet_ntop(ss->ss_family, &sin->sin_addr, addr, + sizeof(addr)) == NULL) { + PJDLOG_ABORT("inet_ntop(AF_INET) failed: %s.", + strerror(errno)); + } + snprintf(buf, sizeof(buf), "%s:%u", addr, port); + break; + } + case AF_INET6: + { + char addr[INET6_ADDRSTRLEN]; + const struct sockaddr_in6 *sin; + unsigned int port; - snprintf(buf, sizeof(buf), "%u.%u.%u.%u:%u", - ((ip >> 24) & 0xff), ((ip >> 16) & 0xff), - ((ip >> 8) & 0xff), (ip & 0xff), port); + sin = (const struct sockaddr_in6 *)ss; + port = ntohs(sin->sin6_port); + if (inet_ntop(ss->ss_family, &sin->sin6_addr, addr, + sizeof(addr)) == NULL) { + PJDLOG_ABORT("inet_ntop(AF_INET6) failed: %s.", + strerror(errno)); + } + snprintf(buf, sizeof(buf), "[%s]:%u", addr, port); break; } default: - snprintf(buf, sizeof(buf), "[unsupported family %u]", - (unsigned int)ss->ss_family); + snprintf(buf, sizeof(buf), "[unsupported family %hhu]", + ss->ss_family); break; } ret = __printf_out(io, pi, buf, strlen(buf)); From owner-svn-src-head@FreeBSD.ORG Wed May 18 23:09:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FEE106564A; Wed, 18 May 2011 23:09:21 +0000 (UTC) (envelope-from kris@pcbsd.org) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) by mx1.freebsd.org (Postfix) with ESMTP id AEC5F8FC13; Wed, 18 May 2011 23:09:21 +0000 (UTC) Received: from mail.ixsystems.com (localhost [127.0.0.1]) by mail.iXsystems.com (Postfix) with ESMTP id 32CA9A6647C; Wed, 18 May 2011 15:53:02 -0700 (PDT) Received: from mail.iXsystems.com ([127.0.0.1]) by mail.ixsystems.com (mail.ixsystems.com [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 97157-09; Wed, 18 May 2011 15:53:02 -0700 (PDT) Received: from [192.168.0.133] (75-130-56-30.static.kgpt.tn.charter.com [75.130.56.30]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id 24E9CA66472; Wed, 18 May 2011 15:53:00 -0700 (PDT) Message-ID: <4DD44DCB.6000000@pcbsd.org> Date: Wed, 18 May 2011 18:52:59 -0400 From: Kris Moore User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110509 Thunderbird/3.1.10 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201105182038.p4IKcT7Q007568@svn.freebsd.org> <20110518211236.GD2273@garage.freebsd.pl> In-Reply-To: <20110518211236.GD2273@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Josh Paetzel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222079 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 23:09:21 -0000 On 05/18/11 17:12, Pawel Jakub Dawidek wrote: > On Wed, May 18, 2011 at 08:38:29PM +0000, Josh Paetzel wrote: >> Author: jpaetzel >> Date: Wed May 18 20:38:28 2011 >> New Revision: 222079 >> URL: http://svn.freebsd.org/changeset/base/222079 >> >> Log: >> Wipeout the end of disks, home to things like gmirror metadata, backup GPT tables, >> and other potential evil. > > If geom_mirror.ko is loaded it won't work, as gmirror keeps its > components open for writing. But if this is GENERIC and geom_mirror.ko > is not loaded, you should be fine. > Before it gets to this point it does a check and stops / clears any gmirrors on the particular disk(s), so hopefully this wont be an issue. -- Kris Moore PC-BSD Software iXsystems From owner-svn-src-head@FreeBSD.ORG Thu May 19 07:39:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7101D1065673; Thu, 19 May 2011 07:39:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 649128FC1D; Thu, 19 May 2011 07:39:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4J5DPOo023690; Thu, 19 May 2011 05:13:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4J5DPFP023684; Thu, 19 May 2011 05:13:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201105190513.p4J5DPFP023684@svn.freebsd.org> From: Warner Losh Date: Thu, 19 May 2011 05:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222090 - in head: . gnu/usr.bin share/mk tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 07:39:27 -0000 Author: imp Date: Thu May 19 05:13:25 2011 New Revision: 222090 URL: http://svn.freebsd.org/changeset/base/222090 Log: Implement WITH{,OUT}_{GCC,BINUTILS} to provide finer-grained control over building gcc and binutils. They default to true, unless MK_TOOLCHAIN is no. Reviewed by: ru@ Added: head/tools/build/options/WITHOUT_BINUTILS (contents, props changed) head/tools/build/options/WITHOUT_GCC (contents, props changed) Modified: head/Makefile.inc1 head/gnu/usr.bin/Makefile head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 19 01:56:46 2011 (r222089) +++ head/Makefile.inc1 Thu May 19 05:13:25 2011 (r222090) @@ -1132,6 +1132,10 @@ _kgzip= usr.sbin/kgzip .endif .endif +.if ${MK_BINUTILS} != "no" +_binutils= gnu/usr.bin/binutils +.endif + .if ${MK_CLANG} != "no" .if ${CC:T:Mclang} == "clang" _clang= usr.bin/clang @@ -1139,12 +1143,16 @@ _clang_libs= lib/clang .endif .endif +.if ${MK_GCC} != "no" +_cc= gnu/usr.bin/cc +.endif + cross-tools: .for _tool in \ ${_clang_libs} \ ${_clang} \ - gnu/usr.bin/binutils \ - gnu/usr.bin/cc \ + ${_binutils} \ + ${_cc} \ usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ ${_btxld} \ ${_crunchide} \ Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Thu May 19 01:56:46 2011 (r222089) +++ head/gnu/usr.bin/Makefile Thu May 19 05:13:25 2011 (r222090) @@ -47,12 +47,14 @@ _texinfo= texinfo _rcs= rcs .endif -.if ${MK_TOOLCHAIN} != "no" +.if ${MK_BINUTILS} != "no" _binutils= binutils +.endif +.if ${MK_GCC} != "no" _cc= cc +.endif .if ${MK_GDB} != "no" _gdb= gdb .endif -.endif .include Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu May 19 01:56:46 2011 (r222089) +++ head/share/mk/bsd.own.mk Thu May 19 05:13:25 2011 (r222090) @@ -297,6 +297,7 @@ __DEFAULT_YES_OPTIONS = \ BIND_MTREE \ BIND_NAMED \ BIND_UTILS \ + BINUTILS \ BLUETOOTH \ BOOT \ BSD_CPIO \ @@ -317,6 +318,7 @@ __DEFAULT_YES_OPTIONS = \ FP_LIBC \ FREEBSD_UPDATE \ GAMES \ + GCC \ GCOV \ GDB \ GNU \ @@ -529,7 +531,9 @@ MK_GROFF:= no .endif .if ${MK_TOOLCHAIN} == "no" +MK_BINUTILS:= no MK_CLANG:= no +MK_GCC:= no MK_GDB:= no .endif Added: head/tools/build/options/WITHOUT_BINUTILS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_BINUTILS Thu May 19 05:13:25 2011 (r222090) @@ -0,0 +1,7 @@ +.\" $FreeBSD$ +Set to not install binutils (as, c++-filt, gconv, gnu-ar, gnu-randlib, +ld, nm, objcopy, objdump, readelf, size and strip) +.Bf -symbolic +The option does not generally work for build targets, unless some alternative +toolchain is enabled. +.Ef Added: head/tools/build/options/WITHOUT_GCC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_GCC Thu May 19 05:13:25 2011 (r222090) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to not install gcc and g++. +.Bf -symbolic +The option does not generally work for build targets, unless some alternative +toolchain is enabled. +.Ef From owner-svn-src-head@FreeBSD.ORG Thu May 19 11:41:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD029106566B; Thu, 19 May 2011 11:41:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACA968FC1A; Thu, 19 May 2011 11:41:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JBfC4O036110; Thu, 19 May 2011 11:41:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JBfCjC036108; Thu, 19 May 2011 11:41:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201105191141.p4JBfCjC036108@svn.freebsd.org> From: John Baldwin Date: Thu, 19 May 2011 11:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222093 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 11:41:12 -0000 Author: jhb Date: Thu May 19 11:41:12 2011 New Revision: 222093 URL: http://svn.freebsd.org/changeset/base/222093 Log: Add support for the SIIG Cyber 2S PCIe adapter. It is based on an Oxford Semiconductor OX16PCI954 but uses only two ports with a non-default clock rate. PR: kern/152034 Tested by: Hans Fiedler hans of hermes louisville edu MFC after: 1 week Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Thu May 19 07:09:13 2011 (r222092) +++ head/sys/dev/puc/pucdata.c Thu May 19 11:41:12 2011 (r222093) @@ -656,6 +656,12 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x10, 0, 8, }, + { 0x1415, 0x950a, 0x131f, 0x2030, + "SIIG Cyber 2S PCIe", + DEFAULT_RCLK * 10, + PUC_PORT_2S, 0x10, 0, 8, + }, + { 0x1415, 0x950a, 0xffff, 0, "Oxford Semiconductor OX16PCI954 UARTs", DEFAULT_RCLK, From owner-svn-src-head@FreeBSD.ORG Thu May 19 13:09:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2A3A106564A; Thu, 19 May 2011 13:09:39 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1A748FC0A; Thu, 19 May 2011 13:09:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JD9dMq038736; Thu, 19 May 2011 13:09:39 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JD9dXY038734; Thu, 19 May 2011 13:09:39 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201105191309.p4JD9dXY038734@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 May 2011 13:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222094 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 13:09:40 -0000 Author: edwin Date: Thu May 19 13:09:39 2011 New Revision: 222094 URL: http://svn.freebsd.org/changeset/base/222094 Log: Put AN back after finding out that tzsetup(1) will complain that it doesn't exist. It will be removed again once the tzdata distribution files have been updated with the replacements for AN. Modified: head/share/misc/iso3166 Modified: head/share/misc/iso3166 ============================================================================== --- head/share/misc/iso3166 Thu May 19 11:41:12 2011 (r222093) +++ head/share/misc/iso3166 Thu May 19 13:09:39 2011 (r222094) @@ -176,6 +176,7 @@ NA NAM 516 Namibia NR NRU 520 Nauru NP NPL 524 Nepal NL NLD 528 Netherlands +AN ANT 530 Netherlands Antilles NC NCL 540 New Caledonia NZ NZL 554 New Zealand NI NIC 558 Nicaragua From owner-svn-src-head@FreeBSD.ORG Thu May 19 13:42:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A8EA106566B; Thu, 19 May 2011 13:42:20 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A2948FC1A; Thu, 19 May 2011 13:42:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JDgKEb039718; Thu, 19 May 2011 13:42:20 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JDgKoH039716; Thu, 19 May 2011 13:42:20 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201105191342.p4JDgKoH039716@svn.freebsd.org> From: Poul-Henning Kamp Date: Thu, 19 May 2011 13:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222095 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 13:42:20 -0000 Author: phk Date: Thu May 19 13:42:19 2011 New Revision: 222095 URL: http://svn.freebsd.org/changeset/base/222095 Log: When adding examples to man-pages, try to make them at least look like they might work. Prodded by: Vadim Goncharov Modified: head/share/man/man9/sbuf.9 Modified: head/share/man/man9/sbuf.9 ============================================================================== --- head/share/man/man9/sbuf.9 Thu May 19 13:09:39 2011 (r222094) +++ head/share/man/man9/sbuf.9 Thu May 19 13:42:19 2011 (r222095) @@ -492,13 +492,13 @@ will return zero for success and \-1 and struct sbuf *sb; sb = sbuf_new_auto(); -sbuf_cat("Customers found:\en"); +sbuf_cat(sb, "Customers found:\en"); TAILQ_FOREACH(foo, &foolist, list) { - sbuf_printf(" %4d %s\en", foo->index, foo->name); - sbuf_printf(" Address: %s\en", foo->address); - sbuf_printf(" Zip: %s\en", foo->zipcode); + sbuf_printf(sb, " %4d %s\en", foo->index, foo->name); + sbuf_printf(sb, " Address: %s\en", foo->address); + sbuf_printf(sb, " Zip: %s\en", foo->zipcode); } -if (sbuf_finish(sb)) +if (sbuf_finish(sb)) /* Check for any and all errors */ err(1,"Could not generate message"); transmit_msg(sbuf_data(sb), sbuf_len(sb)); sbuf_delete(sb); From owner-svn-src-head@FreeBSD.ORG Thu May 19 14:45:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F25E21065680; Thu, 19 May 2011 14:45:05 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id A80488FC20; Thu, 19 May 2011 14:45:05 +0000 (UTC) Received: by pvg11 with SMTP id 11so1578847pvg.13 for ; Thu, 19 May 2011 07:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:references:in-reply-to:mime-version :content-transfer-encoding:content-type:message-id:cc:x-mailer:from :subject:date:to; bh=k4fTJNDHdikfRacI27HvgPxXyvesaiSldTKfEl8peFI=; b=m91OoHTVX1nmP+VF/1y2PxGwqNV6ddR7vk5E5XzhvDxnPeNTj37lWPCnsCad2uLNlV Yrx1g3pFEdEbloeb2G7a30/3hgES8gBuwWvavGa0Y2LuOuKBjv4M5WD7iSDrXByZcbe1 YLf2W614sHTJZqM6GRp6mahyT0+TRYP+V2tqU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=qf/ox7UrMwn5GmjpQBFFV4uvn3vzxUovBjv9SfSS66Zq/lyE1xiKwJTk6ebkq1wggS U1ZChASGqf6C1eTQXWWZ+g4FoUo/hlWmCu3mHtaZcz0qQYbVyOsCpiih5PovkWdvru79 iy7bPfinoctuzOqPn22thmCpZ0heo4J2K5sdo= Received: by 10.68.14.69 with SMTP id n5mr4940675pbc.315.1305816304979; Thu, 19 May 2011 07:45:04 -0700 (PDT) Received: from [192.168.20.56] (c-24-6-49-154.hsd1.ca.comcast.net [24.6.49.154]) by mx.google.com with ESMTPS id r7sm423355pbj.85.2011.05.19.07.45.03 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 May 2011 07:45:04 -0700 (PDT) References: <201105191309.p4JD9dXY038734@svn.freebsd.org> In-Reply-To: <201105191309.p4JD9dXY038734@svn.freebsd.org> Mime-Version: 1.0 (iPhone Mail 8J2) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <7E395246-F9E6-4099-8771-AB630FE9CF98@gmail.com> X-Mailer: iPhone Mail (8J2) From: Garrett Cooper Date: Thu, 19 May 2011 07:44:59 -0700 To: Edwin Groothuis Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r222094 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 14:45:06 -0000 On May 19, 2011, at 6:09 AM, Edwin Groothuis wrote: > Author: edwin > Date: Thu May 19 13:09:39 2011 > New Revision: 222094 > URL: http://svn.freebsd.org/changeset/base/222094 >=20 > Log: > Put AN back after finding out that tzsetup(1) will complain that > it doesn't exist. It will be removed again once the tzdata distribution > files have been updated with the replacements for AN. >=20 > Modified: > head/share/misc/iso3166 >=20 > Modified: head/share/misc/iso3166 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/share/misc/iso3166 Thu May 19 11:41:12 2011 (r222093) > +++ head/share/misc/iso3166 Thu May 19 13:09:39 2011 (r222094) > @@ -176,6 +176,7 @@ NA NAM 516 Namibia > NR NRU 520 Nauru > NP NPL 524 Nepal > NL NLD 528 Netherlands > +AN ANT 530 Netherlands Antilles > NC NCL 540 New Caledonia > NZ NZL 554 New Zealand > NI NIC 558 Nicaragua Thanks! -Garrett= From owner-svn-src-head@FreeBSD.ORG Thu May 19 15:00:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC991065675; Thu, 19 May 2011 15:00:07 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (unknown [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 269358FC0C; Thu, 19 May 2011 15:00:05 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id EE11C4000E; Thu, 19 May 2011 17:00:03 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id E303F40009; Thu, 19 May 2011 17:00:03 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.1 Received: from mx.daemonic.se (h-90-99.A163.priv.bahnhof.se [79.136.90.99]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id CC4CF4000E; Thu, 19 May 2011 17:00:02 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id 51DA4119C04; Thu, 19 May 2011 17:00:02 +0200 (CEST) Received: from [IPv6:2001:470:dca9:1::4] (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 1BCB112B2DA; Thu, 19 May 2011 17:00:01 +0200 (CEST) Message-ID: <4DD5306F.3080304@daemonic.se> Date: Thu, 19 May 2011 16:59:59 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Warner Losh References: <201105190513.p4J5DPFP023684@svn.freebsd.org> In-Reply-To: <201105190513.p4J5DPFP023684@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222090 - in head: . gnu/usr.bin share/mk tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 15:00:07 -0000 On 2011-05-19 07:13, Warner Losh wrote: > Author: imp > Date: Thu May 19 05:13:25 2011 > New Revision: 222090 > URL: http://svn.freebsd.org/changeset/base/222090 > > Log: > Implement WITH{,OUT}_{GCC,BINUTILS} to provide finer-grained control > over building gcc and binutils. They default to true, unless > MK_TOOLCHAIN is no. > > Reviewed by: ru@ > > Added: > head/tools/build/options/WITHOUT_BINUTILS (contents, props changed) > head/tools/build/options/WITHOUT_GCC (contents, props changed) > Modified: > head/Makefile.inc1 > head/gnu/usr.bin/Makefile > head/share/mk/bsd.own.mk > Can you please regenerate src.conf.5 and commit that as well? Regards! -- Niclas From owner-svn-src-head@FreeBSD.ORG Thu May 19 15:18:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFF61106566C; Thu, 19 May 2011 15:18:35 +0000 (UTC) (envelope-from benl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF92A8FC12; Thu, 19 May 2011 15:18:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JFIZ5C042768; Thu, 19 May 2011 15:18:35 GMT (envelope-from benl@svn.freebsd.org) Received: (from benl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JFIZRW042763; Thu, 19 May 2011 15:18:35 GMT (envelope-from benl@svn.freebsd.org) Message-Id: <201105191518.p4JFIZRW042763@svn.freebsd.org> From: Ben Laurie Date: Thu, 19 May 2011 15:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222097 - in head: contrib/gcc share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 15:18:35 -0000 Author: benl Date: Thu May 19 15:18:35 2011 New Revision: 222097 URL: http://svn.freebsd.org/changeset/base/222097 Log: Fix clang warnings. Approved by: philip (mentor) Modified: head/contrib/gcc/genattrtab.c head/contrib/gcc/genautomata.c head/contrib/gcc/gengtype-lex.l head/share/misc/committers-src.dot Modified: head/contrib/gcc/genattrtab.c ============================================================================== --- head/contrib/gcc/genattrtab.c Thu May 19 14:07:32 2011 (r222096) +++ head/contrib/gcc/genattrtab.c Thu May 19 15:18:35 2011 (r222097) @@ -1652,7 +1652,7 @@ simplify_cond (rtx exp, int insn_code, i rtx ret; /* This lets us free all storage allocated below, if appropriate. */ - obstack_finish (rtl_obstack); + (void) obstack_finish (rtl_obstack); memcpy (tests, XVEC (exp, 0)->elem, len * sizeof (rtx)); Modified: head/contrib/gcc/genautomata.c ============================================================================== --- head/contrib/gcc/genautomata.c Thu May 19 14:07:32 2011 (r222096) +++ head/contrib/gcc/genautomata.c Thu May 19 15:18:35 2011 (r222097) @@ -1099,7 +1099,7 @@ create_node (size_t size) obstack_blank (&irp, size); result = obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); /* Default values of members are NULL and zero. */ memset (result, 0, size); return result; @@ -1170,7 +1170,7 @@ next_sep_el (const char **pstr, int sep, } obstack_1grow (&irp, '\0'); out_str = obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); *pstr = p; if (**pstr == sep) @@ -1221,7 +1221,7 @@ get_str_vect (const char *str, int *els_ return NULL; obstack_blank (&irp, sizeof (char *) * (*els_num + 1)); vect = (char **) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); pstr = &str; for (i = 0; i < *els_num; i++) vect [i] = next_sep_el (pstr, sep, paren_p); @@ -3343,7 +3343,7 @@ alloc_empty_reserv_sets (void) obstack_blank (&irp, els_in_reservs * sizeof (set_el_t)); result = (reserv_sets_t) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); memset (result, 0, els_in_reservs * sizeof (set_el_t)); return result; } @@ -4117,10 +4117,10 @@ initiate_excl_sets (void) obstack_blank (&irp, els_in_cycle_reserv * sizeof (set_el_t)); excl_set = (reserv_sets_t) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); obstack_blank (&irp, description->units_num * sizeof (reserv_sets_t)); unit_excl_set_table = (reserv_sets_t *) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); /* Evaluate unit exclusion sets. */ for (i = 0; i < description->decls_num; i++) { @@ -4129,7 +4129,7 @@ initiate_excl_sets (void) { obstack_blank (&irp, els_in_cycle_reserv * sizeof (set_el_t)); unit_excl_set = (reserv_sets_t) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); memset (unit_excl_set, 0, els_in_cycle_reserv * sizeof (set_el_t)); for (el = DECL_UNIT (decl)->excl_list; el != NULL; @@ -4224,16 +4224,16 @@ initiate_presence_absence_pattern_sets ( obstack_blank (&irp, description->units_num * sizeof (pattern_reserv_t)); unit_presence_set_table = (pattern_reserv_t *) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); obstack_blank (&irp, description->units_num * sizeof (pattern_reserv_t)); unit_final_presence_set_table = (pattern_reserv_t *) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); obstack_blank (&irp, description->units_num * sizeof (pattern_reserv_t)); unit_absence_set_table = (pattern_reserv_t *) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); obstack_blank (&irp, description->units_num * sizeof (pattern_reserv_t)); unit_final_absence_set_table = (pattern_reserv_t *) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); /* Evaluate unit presence/absence sets. */ for (i = 0; i < description->decls_num; i++) { @@ -4935,7 +4935,7 @@ store_alt_unit_usage (regexp_t regexp, r obstack_blank (&unit_usages, sizeof (struct unit_usage)); unit_usage_ptr = (struct unit_usage *) obstack_base (&unit_usages); - obstack_finish (&unit_usages); + (void) obstack_finish (&unit_usages); unit_usage_ptr->unit_decl = unit_decl; index = cycle * REGEXP_ONEOF (regexp)->regexps_num + alt_num; unit_usage_ptr->next = VEC_index (unit_usage_t, cycle_alt_unit_usages, index); @@ -8975,7 +8975,7 @@ initiate_automaton_gen (int argc, char * strlen (STANDARD_OUTPUT_DESCRIPTION_FILE_SUFFIX) + 1); obstack_1grow (&irp, '\0'); output_description_file_name = obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); } /* The following function checks existence at least one arc marked by Modified: head/contrib/gcc/gengtype-lex.l ============================================================================== --- head/contrib/gcc/gengtype-lex.l Thu May 19 14:07:32 2011 (r222096) +++ head/contrib/gcc/gengtype-lex.l Thu May 19 15:18:35 2011 (r222097) @@ -590,7 +590,7 @@ macro_input (char *buffer, unsigned size void yyerror (const char *s) { - error_at_line (&lexer_line, s); + error_at_line (&lexer_line, "%s", s); } void Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu May 19 14:07:32 2011 (r222096) +++ head/share/misc/committers-src.dot Thu May 19 15:18:35 2011 (r222097) @@ -100,6 +100,7 @@ antoine [label="Antoine Brodin\nantoine@ ariff [label="Ariff Abdullah\nariff@FreeBSD.org\n2005/11/14"] art [label="Artem Belevich\nart@FreeBSD.org\n2011/03/29"] avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18"] +benl [label="Ben Laurie\nbenl@FreeBSD.org\n2011/05/18"] benno [label="Benno Rice\nbenno@FreeBSD.org\n2000/11/02"] bms [label="Bruce M Simpson\nbms@FreeBSD.org\n2003/08/06"] brian [label="Brian Somers\nbrian@FreeBSD.org\n1996/12/16"] @@ -486,6 +487,7 @@ peter -> asmodai peter -> jayanth peter -> ps +philip -> benl philip -> ed philip -> jls philip -> matteo @@ -546,6 +548,8 @@ sheldonh -> iedowse shin -> ume +simon -> benl + sos -> marcel thompsa -> weongyo From owner-svn-src-head@FreeBSD.ORG Thu May 19 15:45:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80A39106564A; Thu, 19 May 2011 15:45:31 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id E08418FC1D; Thu, 19 May 2011 15:45:30 +0000 (UTC) Received: by vxc34 with SMTP id 34so2784881vxc.13 for ; Thu, 19 May 2011 08:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type; bh=32vewNKUDdcKakPhi9ziSlFUlKO0/i3XmHlrHZ41VHs=; b=b1xA5pWxBeK4P6Q6ymbQNjhoMg4Cw3T5EO7PkMnki0tkOzKUj219aoG/auDY1I4N1q rgKraSW66J5gpXc1xzq6VE8ixw43cjYTmJ1netWFIpz9+b2jAQfUS+j92IkQiOiBkkgK rrHn4aNoGhfYc3dEFGXxrCZrw/p10f496eu5c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=JFA20nJxFF678Ea8icWsViEvRWIPDB+PlWJVumnaveXst5bGhJ7tbsu8HZ5y3IH1Q1 xkaqlUT6+S/yIpnmP542fYnVJEHODpuhf+igo1hTpl49gZFzeep2UZ8wQHXQV76ppjwn sWZ8N0RMphLSrOX1gsS+wyYLksqjTYcQI/ISM= Received: by 10.220.65.96 with SMTP id h32mr156868vci.131.1305818590287; Thu, 19 May 2011 08:23:10 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id b5sm589923vcx.4.2011.05.19.08.23.07 (version=SSLv3 cipher=OTHER); Thu, 19 May 2011 08:23:07 -0700 (PDT) Date: Thu, 19 May 2011 11:23:00 -0400 From: Alexander Kabaev To: Ben Laurie Message-ID: <20110519112300.7251a787@kan.dnsalias.net> In-Reply-To: <201105191518.p4JFIZRW042763@svn.freebsd.org> References: <201105191518.p4JFIZRW042763@svn.freebsd.org> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/6+5evUxfspL2_DvDfg1Gqv+"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222097 - in head: contrib/gcc share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 15:45:31 -0000 --Sig_/6+5evUxfspL2_DvDfg1Gqv+ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 19 May 2011 15:18:35 +0000 (UTC) Ben Laurie wrote: > Author: benl > Date: Thu May 19 15:18:35 2011 > New Revision: 222097 > URL: http://svn.freebsd.org/changeset/base/222097 >=20 > Log: > Fix clang warnings. > =20 > Modified: head/share/misc/committers-src.dot > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/misc/committers-src.dot Thu May 19 14:07:32 > 2011 (r222096) +++ head/share/misc/committers-src.dot > Thu May 19 15:18:35 2011 (r222097) @@ -100,6 +100,7 @@ antoine > [label=3D"Antoine Brodin\nantoine@ ariff [label=3D"Ariff > Abdullah\nariff@FreeBSD.org\n2005/11/14"] art [label=3D"Artem > Belevich\nart@FreeBSD.org\n2011/03/29"] avg [label=3D"Andriy > Gapon\navg@FreeBSD.org\n2009/02/18"] +benl [label=3D"Ben > Laurie\nbenl@FreeBSD.org\n2011/05/18"] benno [label=3D"Benno > Rice\nbenno@FreeBSD.org\n2000/11/02"] bms [label=3D"Bruce M > Simpson\nbms@FreeBSD.org\n2003/08/06"] brian [label=3D"Brian > Somers\nbrian@FreeBSD.org\n1996/12/16"] @@ -486,6 +487,7 @@ peter -> > asmodai peter -> jayanth > peter -> ps > =20 > +philip -> benl > philip -> ed > philip -> jls > philip -> matteo > @@ -546,6 +548,8 @@ sheldonh -> iedowse > =20 > shin -> ume > =20 > +simon -> benl > + > sos -> marcel > =20 > thompsa -> weongyo Huh, clang complains about missing committer ascendancy information too these days? --=20 Alexander Kabaev --Sig_/6+5evUxfspL2_DvDfg1Gqv+ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFN1TXaQ6z1jMm+XZYRAmoqAJ9voAxipsgM0by8uvImUsOxX+VHEACgswDw a4OCCd7n4beDq1mvs/G2bhU= =maHj -----END PGP SIGNATURE----- --Sig_/6+5evUxfspL2_DvDfg1Gqv+-- From owner-svn-src-head@FreeBSD.ORG Thu May 19 17:22:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 381AA106566B; Thu, 19 May 2011 17:22:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DDC28FC1A; Thu, 19 May 2011 17:22:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JHMmrB046600; Thu, 19 May 2011 17:22:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JHMm7W046598; Thu, 19 May 2011 17:22:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201105191722.p4JHMm7W046598@svn.freebsd.org> From: John Baldwin Date: Thu, 19 May 2011 17:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222100 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 17:22:49 -0000 Author: jhb Date: Thu May 19 17:22:48 2011 New Revision: 222100 URL: http://svn.freebsd.org/changeset/base/222100 Log: Style fixes: - Sort forward declarations of structures. - Prefer uint64_t to u_int64_t. Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu May 19 17:20:13 2011 (r222099) +++ head/sys/sys/proc.h Thu May 19 17:22:48 2011 (r222100) @@ -157,21 +157,21 @@ struct pargs { * either lock is sufficient for read access, but both locks must be held * for write access. */ -struct racct; +struct cpuset; +struct kaioinfo; struct kaudit_record; -struct td_sched; +struct kdtrace_proc; +struct kdtrace_thread; +struct mqueue_notifier; struct nlminfo; -struct kaioinfo; struct p_sched; struct proc; +struct racct; struct sleepqueue; +struct td_sched; struct thread; struct trapframe; struct turnstile; -struct mqueue_notifier; -struct kdtrace_proc; -struct kdtrace_thread; -struct cpuset; /* * XXX: Does this belong in resource.h or resourcevar.h instead? @@ -185,13 +185,13 @@ struct cpuset; * Locking for td_rux: (t) for all fields. */ struct rusage_ext { - u_int64_t rux_runtime; /* (cj) Real time. */ - u_int64_t rux_uticks; /* (cj) Statclock hits in user mode. */ - u_int64_t rux_sticks; /* (cj) Statclock hits in sys mode. */ - u_int64_t rux_iticks; /* (cj) Statclock hits in intr mode. */ - u_int64_t rux_uu; /* (c) Previous user time in usec. */ - u_int64_t rux_su; /* (c) Previous sys time in usec. */ - u_int64_t rux_tu; /* (c) Previous total time in usec. */ + uint64_t rux_runtime; /* (cj) Real time. */ + uint64_t rux_uticks; /* (cj) Statclock hits in user mode. */ + uint64_t rux_sticks; /* (cj) Statclock hits in sys mode. */ + uint64_t rux_iticks; /* (cj) Statclock hits in intr mode. */ + uint64_t rux_uu; /* (c) Previous user time in usec. */ + uint64_t rux_su; /* (c) Previous sys time in usec. */ + uint64_t rux_tu; /* (c) Previous total time in usec. */ }; /* From owner-svn-src-head@FreeBSD.ORG Thu May 19 19:37:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3189106564A; Thu, 19 May 2011 19:37:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 920EA8FC1A; Thu, 19 May 2011 19:37:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JJbfVN050576; Thu, 19 May 2011 19:37:41 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JJbfIJ050574; Thu, 19 May 2011 19:37:41 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201105191937.p4JJbfIJ050574@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 19 May 2011 19:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222102 - head/sys/dev/cxgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 19:37:41 -0000 Author: np Date: Thu May 19 19:37:41 2011 New Revision: 222102 URL: http://svn.freebsd.org/changeset/base/222102 Log: Simplify t4_os_find_pci_capability. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu May 19 17:24:53 2011 (r222101) +++ head/sys/dev/cxgbe/t4_main.c Thu May 19 19:37:41 2011 (r222102) @@ -3212,45 +3212,12 @@ filter_rpl(struct adapter *sc, const str } } -/* XXX: use pci_find_cap */ int t4_os_find_pci_capability(struct adapter *sc, int cap) { - device_t dev; - struct pci_devinfo *dinfo; - pcicfgregs *cfg; - uint32_t status; - uint8_t ptr; - - dev = sc->dev; - dinfo = device_get_ivars(dev); - cfg = &dinfo->cfg; - - status = pci_read_config(dev, PCIR_STATUS, 2); - if (!(status & PCIM_STATUS_CAPPRESENT)) - return (0); - - switch (cfg->hdrtype & PCIM_HDRTYPE) { - case 0: - case 1: - ptr = PCIR_CAP_PTR; - break; - case 2: - ptr = PCIR_CAP_PTR_2; - break; - default: - return (0); - break; - } - ptr = pci_read_config(dev, ptr, 1); + int i; - while (ptr != 0) { - if (pci_read_config(dev, ptr + PCICAP_ID, 1) == cap) - return (ptr); - ptr = pci_read_config(dev, ptr + PCICAP_NEXTPTR, 1); - } - - return (0); + return (pci_find_cap(sc->dev, cap, &i) == 0 ? i : 0); } int From owner-svn-src-head@FreeBSD.ORG Thu May 19 20:35:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2490106566B; Thu, 19 May 2011 20:35:40 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0C148FC19; Thu, 19 May 2011 20:35:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JKZef3052287; Thu, 19 May 2011 20:35:40 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JKZex4052278; Thu, 19 May 2011 20:35:40 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201105192035.p4JKZex4052278@svn.freebsd.org> From: Benedict Reuschling Date: Thu, 19 May 2011 20:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222103 - head/usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 20:35:40 -0000 Author: bcr (doc committer) Date: Thu May 19 20:35:40 2011 New Revision: 222103 URL: http://svn.freebsd.org/changeset/base/222103 Log: Fix typos in comments, no functional changes. Found by: codespell Reviewed by: alfred MFC after: 1 week Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/ia64-fbsd.c head/usr.bin/truss/main.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c head/usr.bin/truss/sparc64-fbsd.c Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Thu May 19 19:37:41 2011 (r222102) +++ head/usr.bin/truss/amd64-fbsd.c Thu May 19 20:35:40 2011 (r222103) @@ -128,7 +128,7 @@ amd64_syscall_entry(struct trussinfo *tr /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ reg = 0; syscall_num = regs.r_rax; Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Thu May 19 19:37:41 2011 (r222102) +++ head/usr.bin/truss/amd64-fbsd32.c Thu May 19 20:35:40 2011 (r222103) @@ -136,7 +136,7 @@ amd64_fbsd32_syscall_entry(struct trussi /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ syscall_num = regs.r_rax; switch (syscall_num) { Modified: head/usr.bin/truss/i386-fbsd.c ============================================================================== --- head/usr.bin/truss/i386-fbsd.c Thu May 19 19:37:41 2011 (r222102) +++ head/usr.bin/truss/i386-fbsd.c Thu May 19 20:35:40 2011 (r222103) @@ -131,7 +131,7 @@ i386_syscall_entry(struct trussinfo *tru /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ syscall_num = regs.r_eax; switch (syscall_num) { Modified: head/usr.bin/truss/ia64-fbsd.c ============================================================================== --- head/usr.bin/truss/ia64-fbsd.c Thu May 19 19:37:41 2011 (r222102) +++ head/usr.bin/truss/ia64-fbsd.c Thu May 19 20:35:40 2011 (r222103) @@ -128,7 +128,7 @@ ia64_syscall_entry(struct trussinfo *tru /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ syscall_num = regs.r_scratch.gr15; /* XXX double-check. */ if (syscall_num == SYS_syscall || syscall_num == SYS___syscall) Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Thu May 19 19:37:41 2011 (r222102) +++ head/usr.bin/truss/main.c Thu May 19 20:35:40 2011 (r222103) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); /* - * The main module for truss. Suprisingly simple, but, then, the other + * The main module for truss. Surprisingly simple, but, then, the other * files handle the bulk of the work. And, of course, the kernel has to * do a lot of the work :). */ Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Thu May 19 19:37:41 2011 (r222102) +++ head/usr.bin/truss/powerpc-fbsd.c Thu May 19 20:35:40 2011 (r222103) @@ -137,7 +137,7 @@ powerpc_syscall_entry(struct trussinfo * /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ regargs = NARGREG; syscall_num = regs.fixreg[0]; Modified: head/usr.bin/truss/powerpc64-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-fbsd.c Thu May 19 19:37:41 2011 (r222102) +++ head/usr.bin/truss/powerpc64-fbsd.c Thu May 19 20:35:40 2011 (r222103) @@ -129,7 +129,7 @@ powerpc64_syscall_entry(struct trussinfo /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ regargs = NARGREG; syscall_num = regs.fixreg[0]; Modified: head/usr.bin/truss/sparc64-fbsd.c ============================================================================== --- head/usr.bin/truss/sparc64-fbsd.c Thu May 19 19:37:41 2011 (r222102) +++ head/usr.bin/truss/sparc64-fbsd.c Thu May 19 20:35:40 2011 (r222103) @@ -135,7 +135,7 @@ sparc64_syscall_entry(struct trussinfo * /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ syscall_num = regs.r_global[1]; if (syscall_num == SYS_syscall || syscall_num == SYS___syscall) { From owner-svn-src-head@FreeBSD.ORG Thu May 19 23:13:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D441D106564A; Thu, 19 May 2011 23:13:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A922C8FC15; Thu, 19 May 2011 23:13:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JND8V9057153; Thu, 19 May 2011 23:13:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JND86r057150; Thu, 19 May 2011 23:13:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105192313.p4JND86r057150@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 19 May 2011 23:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222107 - in head/sys/dev: alc ale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 23:13:08 -0000 Author: yongari Date: Thu May 19 23:13:08 2011 New Revision: 222107 URL: http://svn.freebsd.org/changeset/base/222107 Log: Fix typo. Submitted by: brad at OpenBSD Modified: head/sys/dev/alc/if_alcreg.h head/sys/dev/ale/if_alereg.h Modified: head/sys/dev/alc/if_alcreg.h ============================================================================== --- head/sys/dev/alc/if_alcreg.h Thu May 19 22:55:37 2011 (r222106) +++ head/sys/dev/alc/if_alcreg.h Thu May 19 23:13:08 2011 (r222107) @@ -17,12 +17,12 @@ * 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 - * DAMATES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * 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 DAMATE. + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: head/sys/dev/ale/if_alereg.h ============================================================================== --- head/sys/dev/ale/if_alereg.h Thu May 19 22:55:37 2011 (r222106) +++ head/sys/dev/ale/if_alereg.h Thu May 19 23:13:08 2011 (r222107) @@ -17,12 +17,12 @@ * 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 - * DAMATES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * 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 DAMATE. + * SUCH DAMAGE. * * $FreeBSD$ */ From owner-svn-src-head@FreeBSD.ORG Thu May 19 23:18:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 710A21065670; Thu, 19 May 2011 23:18:42 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F77D8FC14; Thu, 19 May 2011 23:18:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JNIgov057348; Thu, 19 May 2011 23:18:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JNIgsA057343; Thu, 19 May 2011 23:18:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105192318.p4JNIgsA057343@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 19 May 2011 23:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222108 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 23:18:42 -0000 Author: pjd Date: Thu May 19 23:18:42 2011 New Revision: 222108 URL: http://svn.freebsd.org/changeset/base/222108 Log: In preparation for IPv6 support allow to specify multiple addresses to listen on. MFC after: 3 weeks Modified: head/sbin/hastd/hast.conf.5 head/sbin/hastd/hast.h head/sbin/hastd/hastd.c head/sbin/hastd/parse.y Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Thu May 19 23:13:08 2011 (r222107) +++ head/sbin/hastd/hast.conf.5 Thu May 19 23:18:42 2011 (r222108) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 2, 2011 +.Dd May 20, 2011 .Dt HAST.CONF 5 .Os .Sh NAME @@ -159,6 +159,7 @@ tcp4://0.0.0.0 tcp4://0.0.0.0:8457 .Ed .Pp +Multiple listen addresses can be specified. The default value is .Pa tcp4://0.0.0.0:8457 . .It Ic replication Aq mode Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Thu May 19 23:13:08 2011 (r222107) +++ head/sbin/hastd/hast.h Thu May 19 23:18:42 2011 (r222108) @@ -82,12 +82,13 @@ #define HIO_FLUSH 4 #define HIO_KEEPALIVE 5 -#define HAST_USER "hast" -#define HAST_TIMEOUT 20 -#define HAST_CONFIG "/etc/hast.conf" -#define HAST_CONTROL "/var/run/hastctl" -#define HASTD_LISTEN "tcp4://0.0.0.0:8457" -#define HASTD_PIDFILE "/var/run/hastd.pid" +#define HAST_USER "hast" +#define HAST_TIMEOUT 20 +#define HAST_CONFIG "/etc/hast.conf" +#define HAST_CONTROL "/var/run/hastctl" +#define HASTD_LISTEN_IPV4 "tcp4://0.0.0.0:8457" +#define HASTD_LISTEN_IPV6 "tcp6://[::]:8457" +#define HASTD_PIDFILE "/var/run/hastd.pid" /* Default extent size. */ #define HAST_EXTENTSIZE 2097152 @@ -100,6 +101,14 @@ /* Number of seconds to sleep between reconnect retries or keepalive packets. */ #define HAST_KEEPALIVE 10 +struct hastd_listen { + /* Address to listen on. */ + char hl_addr[HAST_ADDRSIZE]; + /* Protocol-specific data. */ + struct proto_conn *hl_conn; + TAILQ_ENTRY(hastd_listen) hl_next; +}; + struct hastd_config { /* Address to communicate with hastctl(8). */ char hc_controladdr[HAST_ADDRSIZE]; @@ -107,10 +116,8 @@ struct hastd_config { struct proto_conn *hc_controlconn; /* Incoming control connection. */ struct proto_conn *hc_controlin; - /* Address to listen on. */ - char hc_listenaddr[HAST_ADDRSIZE]; - /* Protocol-specific data. */ - struct proto_conn *hc_listenconn; + /* List of addresses to listen on. */ + TAILQ_HEAD(, hastd_listen) hc_listen; /* List of resources. */ TAILQ_HEAD(, hast_resource) hc_resources; }; Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Thu May 19 23:13:08 2011 (r222107) +++ head/sbin/hastd/hastd.c Thu May 19 23:18:42 2011 (r222108) @@ -98,6 +98,7 @@ void descriptors_cleanup(struct hast_resource *res) { struct hast_resource *tres; + struct hastd_listen *lst; TAILQ_FOREACH(tres, &cfg->hc_resources, hr_next) { if (tres == res) { @@ -120,7 +121,10 @@ descriptors_cleanup(struct hast_resource if (cfg->hc_controlin != NULL) proto_close(cfg->hc_controlin); proto_close(cfg->hc_controlconn); - proto_close(cfg->hc_listenconn); + TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { + if (lst->hl_conn != NULL) + proto_close(lst->hl_conn); + } (void)pidfile_close(pfh); hook_fini(); pjdlog_fini(); @@ -462,6 +466,8 @@ hastd_reload(void) { struct hastd_config *newcfg; struct hast_resource *nres, *cres, *tres; + struct hastd_listen *nlst, *clst; + unsigned int nlisten; uint8_t role; pjdlog_info("Reloading configuration..."); @@ -483,19 +489,37 @@ hastd_reload(void) } } /* - * Check if listen address has changed. + * Check if any listen address has changed. */ - if (strcmp(cfg->hc_listenaddr, newcfg->hc_listenaddr) != 0) { - if (proto_server(newcfg->hc_listenaddr, - &newcfg->hc_listenconn) < 0) { - pjdlog_errno(LOG_ERR, "Unable to listen on address %s", - newcfg->hc_listenaddr); - goto failed; + nlisten = 0; + TAILQ_FOREACH(nlst, &newcfg->hc_listen, hl_next) { + TAILQ_FOREACH(clst, &cfg->hc_listen, hl_next) { + if (strcmp(nlst->hl_addr, clst->hl_addr) == 0) + break; + } + if (clst != NULL && clst->hl_conn != NULL) { + pjdlog_info("Keep listening on address %s.", + nlst->hl_addr); + nlst->hl_conn = clst->hl_conn; + nlisten++; + } else if (proto_server(nlst->hl_addr, &nlst->hl_conn) == 0) { + pjdlog_info("Listening on new address %s.", + nlst->hl_addr); + nlisten++; + } else { + pjdlog_errno(LOG_WARNING, + "Unable to listen on address %s", nlst->hl_addr); } } + if (nlisten == 0) { + pjdlog_error("No addresses to listen on."); + goto failed; + } + + /* No failures from now on. */ + /* - * Only when both control and listen sockets are successfully - * initialized switch them to new configuration. + * Switch to new control socket. */ if (newcfg->hc_controlconn != NULL) { pjdlog_info("Control socket changed from %s to %s.", @@ -506,15 +530,23 @@ hastd_reload(void) strlcpy(cfg->hc_controladdr, newcfg->hc_controladdr, sizeof(cfg->hc_controladdr)); } - if (newcfg->hc_listenconn != NULL) { - pjdlog_info("Listen socket changed from %s to %s.", - cfg->hc_listenaddr, newcfg->hc_listenaddr); - proto_close(cfg->hc_listenconn); - cfg->hc_listenconn = newcfg->hc_listenconn; - newcfg->hc_listenconn = NULL; - strlcpy(cfg->hc_listenaddr, newcfg->hc_listenaddr, - sizeof(cfg->hc_listenaddr)); + /* + * Switch to new listen addresses. Close all that were removed. + */ + while ((clst = TAILQ_FIRST(&cfg->hc_listen)) != NULL) { + TAILQ_FOREACH(nlst, &newcfg->hc_listen, hl_next) { + if (strcmp(nlst->hl_addr, clst->hl_addr) == 0) + break; + } + if (nlst == NULL && clst->hl_conn != NULL) { + proto_close(clst->hl_conn); + pjdlog_info("No longer listening on address %s.", + clst->hl_addr); + } + TAILQ_REMOVE(&cfg->hc_listen, clst, hl_next); + free(clst); } + TAILQ_CONCAT(&cfg->hc_listen, &newcfg->hc_listen, hl_next); /* * Stop and remove resources that were removed from the configuration. @@ -607,8 +639,20 @@ failed: if (newcfg != NULL) { if (newcfg->hc_controlconn != NULL) proto_close(newcfg->hc_controlconn); - if (newcfg->hc_listenconn != NULL) - proto_close(newcfg->hc_listenconn); + while ((nlst = TAILQ_FIRST(&newcfg->hc_listen)) != NULL) { + if (nlst->hl_conn != NULL) { + TAILQ_FOREACH(clst, &cfg->hc_listen, hl_next) { + if (strcmp(nlst->hl_addr, + clst->hl_addr) == 0) { + break; + } + } + if (clst == NULL || clst->hl_conn == NULL) + proto_close(nlst->hl_conn); + } + TAILQ_REMOVE(&newcfg->hc_listen, nlst, hl_next); + free(nlst); + } yy_config_free(newcfg); } pjdlog_warning("Configuration not reloaded."); @@ -634,7 +678,7 @@ terminate_workers(void) } static void -listen_accept(void) +listen_accept(struct hastd_listen *lst) { struct hast_resource *res; struct proto_conn *conn; @@ -646,10 +690,10 @@ listen_accept(void) pid_t pid; int status; - proto_local_address(cfg->hc_listenconn, laddr, sizeof(laddr)); + proto_local_address(lst->hl_conn, laddr, sizeof(laddr)); pjdlog_debug(1, "Accepting connection to %s.", laddr); - if (proto_accept(cfg->hc_listenconn, &conn) < 0) { + if (proto_accept(lst->hl_conn, &conn) < 0) { pjdlog_errno(LOG_ERR, "Unable to accept connection %s", laddr); return; } @@ -943,6 +987,7 @@ static void main_loop(void) { struct hast_resource *res; + struct hastd_listen *lst; struct timeval seltimeout; int fd, maxfd, ret; time_t lastcheck, now; @@ -952,9 +997,6 @@ main_loop(void) seltimeout.tv_sec = REPORT_INTERVAL; seltimeout.tv_usec = 0; - pjdlog_info("Started successfully, running protocol version %d.", - HAST_PROTO_VERSION); - for (;;) { check_signals(); @@ -963,10 +1005,14 @@ main_loop(void) maxfd = fd = proto_descriptor(cfg->hc_controlconn); PJDLOG_ASSERT(fd >= 0); FD_SET(fd, &rfds); - fd = proto_descriptor(cfg->hc_listenconn); - PJDLOG_ASSERT(fd >= 0); - FD_SET(fd, &rfds); - maxfd = fd > maxfd ? fd : maxfd; + TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { + if (lst->hl_conn == NULL) + continue; + fd = proto_descriptor(lst->hl_conn); + PJDLOG_ASSERT(fd >= 0); + FD_SET(fd, &rfds); + maxfd = fd > maxfd ? fd : maxfd; + } TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { if (res->hr_event == NULL) continue; @@ -1014,8 +1060,12 @@ main_loop(void) if (FD_ISSET(proto_descriptor(cfg->hc_controlconn), &rfds)) control_handle(cfg); - if (FD_ISSET(proto_descriptor(cfg->hc_listenconn), &rfds)) - listen_accept(); + TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { + if (lst->hl_conn == NULL) + continue; + if (FD_ISSET(proto_descriptor(lst->hl_conn), &rfds)) + listen_accept(lst); + } TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { if (res->hr_event == NULL) continue; @@ -1053,6 +1103,7 @@ dummy_sighandler(int sig __unused) int main(int argc, char *argv[]) { + struct hastd_listen *lst; const char *pidfile; pid_t otherpid; bool foreground; @@ -1136,10 +1187,12 @@ main(int argc, char *argv[]) cfg->hc_controladdr); } /* Listen for remote connections. */ - if (proto_server(cfg->hc_listenaddr, &cfg->hc_listenconn) < 0) { - KEEP_ERRNO((void)pidfile_remove(pfh)); - pjdlog_exit(EX_OSERR, "Unable to listen on address %s", - cfg->hc_listenaddr); + TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { + if (proto_server(lst->hl_addr, &lst->hl_conn) < 0) { + KEEP_ERRNO((void)pidfile_remove(pfh)); + pjdlog_exit(EX_OSERR, "Unable to listen on address %s", + lst->hl_addr); + } } if (!foreground) { @@ -1158,6 +1211,14 @@ main(int argc, char *argv[]) } } + pjdlog_info("Started successfully, running protocol version %d.", + HAST_PROTO_VERSION); + + pjdlog_debug(1, "Listening on control address %s.", + cfg->hc_controladdr); + TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) + pjdlog_info("Listening on address %s.", lst->hl_addr); + hook_init(); main_loop(); Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Thu May 19 23:13:08 2011 (r222107) +++ head/sbin/hastd/parse.y Thu May 19 23:18:42 2011 (r222108) @@ -33,12 +33,14 @@ #include /* MAXHOSTNAMELEN */ #include +#include #include #include #include #include +#include #include #include #include @@ -59,7 +61,9 @@ static struct hast_resource *curres; static bool mynode, hadmynode; static char depth0_control[HAST_ADDRSIZE]; -static char depth0_listen[HAST_ADDRSIZE]; +static char depth0_listen_ipv4[HAST_ADDRSIZE]; +static char depth0_listen_ipv6[HAST_ADDRSIZE]; +static TAILQ_HEAD(, hastd_listen) depth0_listen; static int depth0_replication; static int depth0_checksum; static int depth0_compression; @@ -114,6 +118,19 @@ isitme(const char *name) return (0); } +static bool +family_supported(int family) +{ + int sock; + + sock = socket(family, SOCK_STREAM, 0); + if (sock == -1 && errno == EPROTONOSUPPORT) + return (false); + if (sock >= 0) + (void)close(sock); + return (true); +} + static int node_names(char **namesp) { @@ -175,7 +192,11 @@ yy_config_parse(const char *config, bool depth0_checksum = HAST_CHECKSUM_NONE; depth0_compression = HAST_COMPRESSION_HOLE; strlcpy(depth0_control, HAST_CONTROL, sizeof(depth0_control)); - strlcpy(depth0_listen, HASTD_LISTEN, sizeof(depth0_listen)); + TAILQ_INIT(&depth0_listen); + strlcpy(depth0_listen_ipv4, HASTD_LISTEN_IPV4, + sizeof(depth0_listen_ipv4)); + strlcpy(depth0_listen_ipv6, HASTD_LISTEN_IPV6, + sizeof(depth0_listen_ipv6)); depth0_exec[0] = '\0'; lconfig = calloc(1, sizeof(*lconfig)); @@ -186,6 +207,7 @@ yy_config_parse(const char *config, bool return (NULL); } + TAILQ_INIT(&lconfig->hc_listen); TAILQ_INIT(&lconfig->hc_resources); yyin = fopen(config, "r"); @@ -214,9 +236,52 @@ yy_config_parse(const char *config, bool strlcpy(lconfig->hc_controladdr, depth0_control, sizeof(lconfig->hc_controladdr)); } - if (lconfig->hc_listenaddr[0] == '\0') { - strlcpy(lconfig->hc_listenaddr, depth0_listen, - sizeof(lconfig->hc_listenaddr)); + if (!TAILQ_EMPTY(&depth0_listen)) + TAILQ_CONCAT(&lconfig->hc_listen, &depth0_listen, hl_next); + if (TAILQ_EMPTY(&lconfig->hc_listen)) { + struct hastd_listen *lst; + + if (family_supported(AF_INET)) { + lst = calloc(1, sizeof(*lst)); + if (lst == NULL) { + pjdlog_error("Unable to allocate memory for listen address."); + yy_config_free(lconfig); + if (exitonerror) + exit(EX_TEMPFAIL); + return (NULL); + } + (void)strlcpy(lst->hl_addr, depth0_listen_ipv4, + sizeof(lst->hl_addr)); + TAILQ_INSERT_TAIL(&lconfig->hc_listen, lst, hl_next); + } else { + pjdlog_debug(1, + "No IPv4 support in the kernel, not listening on IPv4 address."); + } +#ifdef notyet + if (family_supported(AF_INET6)) { + lst = calloc(1, sizeof(*lst)); + if (lst == NULL) { + pjdlog_error("Unable to allocate memory for listen address."); + yy_config_free(lconfig); + if (exitonerror) + exit(EX_TEMPFAIL); + return (NULL); + } + (void)strlcpy(lst->hl_addr, depth0_listen_ipv6, + sizeof(lst->hl_addr)); + TAILQ_INSERT_TAIL(&lconfig->hc_listen, lst, hl_next); + } else { + pjdlog_debug(1, + "No IPv6 support in the kernel, not listening on IPv6 address."); + } +#endif + if (TAILQ_EMPTY(&lconfig->hc_listen)) { + pjdlog_error("No address to listen on."); + yy_config_free(lconfig); + if (exitonerror) + exit(EX_TEMPFAIL); + return (NULL); + } } TAILQ_FOREACH(curres, &lconfig->hc_resources, hr_next) { assert(curres->hr_provname[0] != '\0'); @@ -274,8 +339,17 @@ yy_config_parse(const char *config, bool void yy_config_free(struct hastd_config *config) { + struct hastd_listen *lst; struct hast_resource *res; + while ((lst = TAILQ_FIRST(&depth0_listen)) != NULL) { + TAILQ_REMOVE(&depth0_listen, lst, hl_next); + free(lst); + } + while ((lst = TAILQ_FIRST(&config->hc_listen)) != NULL) { + TAILQ_REMOVE(&config->hc_listen, lst, hl_next); + free(lst); + } while ((res = TAILQ_FIRST(&config->hc_resources)) != NULL) { TAILQ_REMOVE(&config->hc_resources, res, hr_next); free(res); @@ -362,26 +436,30 @@ control_statement: CONTROL STR listen_statement: LISTEN STR { + struct hastd_listen *lst; + + lst = calloc(1, sizeof(*lst)); + if (lst == NULL) { + pjdlog_error("Unable to allocate memory for listen address."); + free($2); + return (1); + } + if (strlcpy(lst->hl_addr, $2, sizeof(lst->hl_addr)) >= + sizeof(lst->hl_addr)) { + pjdlog_error("listen argument is too long."); + free($2); + free(lst); + return (1); + } switch (depth) { case 0: - if (strlcpy(depth0_listen, $2, - sizeof(depth0_listen)) >= - sizeof(depth0_listen)) { - pjdlog_error("listen argument is too long."); - free($2); - return (1); - } + TAILQ_INSERT_TAIL(&depth0_listen, lst, hl_next); break; case 1: - if (!mynode) - break; - if (strlcpy(lconfig->hc_listenaddr, $2, - sizeof(lconfig->hc_listenaddr)) >= - sizeof(lconfig->hc_listenaddr)) { - pjdlog_error("listen argument is too long."); - free($2); - return (1); - } + if (mynode) + TAILQ_INSERT_TAIL(&depth0_listen, lst, hl_next); + else + free(lst); break; default: assert(!"listen at wrong depth level"); From owner-svn-src-head@FreeBSD.ORG Fri May 20 11:06:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41C5F106564A; Fri, 20 May 2011 11:06:18 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 301138FC14; Fri, 20 May 2011 11:06:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KB6IR8081227; Fri, 20 May 2011 11:06:18 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KB6Ir4081224; Fri, 20 May 2011 11:06:18 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105201106.p4KB6Ir4081224@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 20 May 2011 11:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222115 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 11:06:18 -0000 Author: pjd Date: Fri May 20 11:06:17 2011 New Revision: 222115 URL: http://svn.freebsd.org/changeset/base/222115 Log: Rename proto_tcp4.c to proto_tcp.c in preparation for IPv6 support. MFC after: 2 weeks Added: head/sbin/hastd/proto_tcp.c - copied unchanged from r222085, head/sbin/hastd/proto_tcp4.c Deleted: head/sbin/hastd/proto_tcp4.c Modified: head/sbin/hastd/Makefile Modified: head/sbin/hastd/Makefile ============================================================================== --- head/sbin/hastd/Makefile Fri May 20 07:51:46 2011 (r222114) +++ head/sbin/hastd/Makefile Fri May 20 11:06:17 2011 (r222115) @@ -12,7 +12,7 @@ SRCS+= metadata.c SRCS+= nv.c SRCS+= secondary.c SRCS+= parse.y pjdlog.c primary.c -SRCS+= proto.c proto_common.c proto_socketpair.c proto_tcp4.c proto_uds.c +SRCS+= proto.c proto_common.c proto_socketpair.c proto_tcp.c proto_uds.c SRCS+= rangelock.c SRCS+= subr.c SRCS+= token.l Copied: head/sbin/hastd/proto_tcp.c (from r222085, head/sbin/hastd/proto_tcp4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/proto_tcp.c Fri May 20 11:06:17 2011 (r222115, copy of r222085, head/sbin/hastd/proto_tcp4.c) @@ -0,0 +1,597 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek 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 AUTHORS 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 AUTHORS 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 /* MAXHOSTNAMELEN */ +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pjdlog.h" +#include "proto_impl.h" +#include "subr.h" + +#define TCP4_CTX_MAGIC 0x7c441c +struct tcp4_ctx { + int tc_magic; + struct sockaddr_in tc_sin; + int tc_fd; + int tc_side; +#define TCP4_SIDE_CLIENT 0 +#define TCP4_SIDE_SERVER_LISTEN 1 +#define TCP4_SIDE_SERVER_WORK 2 +}; + +static int tcp4_connect_wait(void *ctx, int timeout); +static void tcp4_close(void *ctx); + +static in_addr_t +str2ip(const char *str) +{ + struct hostent *hp; + in_addr_t ip; + + ip = inet_addr(str); + if (ip != INADDR_NONE) { + /* It is a valid IP address. */ + return (ip); + } + /* Check if it is a valid host name. */ + hp = gethostbyname(str); + if (hp == NULL) + return (INADDR_NONE); + return (((struct in_addr *)(void *)hp->h_addr)->s_addr); +} + +/* + * Function converts the given string to unsigned number. + */ +static int +numfromstr(const char *str, intmax_t minnum, intmax_t maxnum, intmax_t *nump) +{ + intmax_t digit, num; + + if (str[0] == '\0') + goto invalid; /* Empty string. */ + num = 0; + for (; *str != '\0'; str++) { + if (*str < '0' || *str > '9') + goto invalid; /* Non-digit character. */ + digit = *str - '0'; + if (num > num * 10 + digit) + goto invalid; /* Overflow. */ + num = num * 10 + digit; + if (num > maxnum) + goto invalid; /* Too big. */ + } + if (num < minnum) + goto invalid; /* Too small. */ + *nump = num; + return (0); +invalid: + errno = EINVAL; + return (-1); +} + +static int +tcp4_addr(const char *addr, int defport, struct sockaddr_in *sinp) +{ + char iporhost[MAXHOSTNAMELEN]; + const char *pp; + size_t size; + in_addr_t ip; + + if (addr == NULL) + return (-1); + + if (strncasecmp(addr, "tcp4://", 7) == 0) + addr += 7; + else if (strncasecmp(addr, "tcp://", 6) == 0) + addr += 6; + else { + /* + * Because TCP4 is the default assume IP or host is given without + * prefix. + */ + } + + sinp->sin_family = AF_INET; + sinp->sin_len = sizeof(*sinp); + /* Extract optional port. */ + pp = strrchr(addr, ':'); + if (pp == NULL) { + /* Port not given, use the default. */ + sinp->sin_port = htons(defport); + } else { + intmax_t port; + + if (numfromstr(pp + 1, 1, 65535, &port) < 0) + return (errno); + sinp->sin_port = htons(port); + } + /* Extract host name or IP address. */ + if (pp == NULL) { + size = sizeof(iporhost); + if (strlcpy(iporhost, addr, size) >= size) + return (ENAMETOOLONG); + } else { + size = (size_t)(pp - addr + 1); + if (size > sizeof(iporhost)) + return (ENAMETOOLONG); + (void)strlcpy(iporhost, addr, size); + } + /* Convert string (IP address or host name) to in_addr_t. */ + ip = str2ip(iporhost); + if (ip == INADDR_NONE) + return (EINVAL); + sinp->sin_addr.s_addr = ip; + + return (0); +} + +static int +tcp4_setup_new(const char *addr, int side, void **ctxp) +{ + struct tcp4_ctx *tctx; + int ret, nodelay; + + PJDLOG_ASSERT(addr != NULL); + PJDLOG_ASSERT(side == TCP4_SIDE_CLIENT || + side == TCP4_SIDE_SERVER_LISTEN); + PJDLOG_ASSERT(ctxp != NULL); + + tctx = malloc(sizeof(*tctx)); + if (tctx == NULL) + return (errno); + + /* Parse given address. */ + if ((ret = tcp4_addr(addr, PROTO_TCP4_DEFAULT_PORT, + &tctx->tc_sin)) != 0) { + free(tctx); + return (ret); + } + + PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); + + tctx->tc_fd = socket(AF_INET, SOCK_STREAM, 0); + if (tctx->tc_fd == -1) { + ret = errno; + free(tctx); + return (ret); + } + + PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); + + /* Socket settings. */ + nodelay = 1; + if (setsockopt(tctx->tc_fd, IPPROTO_TCP, TCP_NODELAY, &nodelay, + sizeof(nodelay)) == -1) { + pjdlog_errno(LOG_WARNING, "Unable to set TCP_NOELAY"); + } + + tctx->tc_side = side; + tctx->tc_magic = TCP4_CTX_MAGIC; + *ctxp = tctx; + + return (0); +} + +static int +tcp4_setup_wrap(int fd, int side, void **ctxp) +{ + struct tcp4_ctx *tctx; + + PJDLOG_ASSERT(fd >= 0); + PJDLOG_ASSERT(side == TCP4_SIDE_CLIENT || + side == TCP4_SIDE_SERVER_WORK); + PJDLOG_ASSERT(ctxp != NULL); + + tctx = malloc(sizeof(*tctx)); + if (tctx == NULL) + return (errno); + + tctx->tc_fd = fd; + tctx->tc_sin.sin_family = AF_UNSPEC; + tctx->tc_side = side; + tctx->tc_magic = TCP4_CTX_MAGIC; + *ctxp = tctx; + + return (0); +} + +static int +tcp4_client(const char *srcaddr, const char *dstaddr, void **ctxp) +{ + struct tcp4_ctx *tctx; + struct sockaddr_in sin; + int ret; + + ret = tcp4_setup_new(dstaddr, TCP4_SIDE_CLIENT, ctxp); + if (ret != 0) + return (ret); + tctx = *ctxp; + if (srcaddr == NULL) + return (0); + ret = tcp4_addr(srcaddr, 0, &sin); + if (ret != 0) { + tcp4_close(tctx); + return (ret); + } + if (bind(tctx->tc_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { + ret = errno; + tcp4_close(tctx); + return (ret); + } + return (0); +} + +static int +tcp4_connect(void *ctx, int timeout) +{ + struct tcp4_ctx *tctx = ctx; + int error, flags; + + PJDLOG_ASSERT(tctx != NULL); + PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_side == TCP4_SIDE_CLIENT); + PJDLOG_ASSERT(tctx->tc_fd >= 0); + PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); + PJDLOG_ASSERT(timeout >= -1); + + flags = fcntl(tctx->tc_fd, F_GETFL); + if (flags == -1) { + KEEP_ERRNO(pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_GETFL) failed")); + return (errno); + } + /* + * We make socket non-blocking so we can handle connection timeout + * manually. + */ + flags |= O_NONBLOCK; + if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { + KEEP_ERRNO(pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_SETFL, O_NONBLOCK) failed")); + return (errno); + } + + if (connect(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, + sizeof(tctx->tc_sin)) == 0) { + if (timeout == -1) + return (0); + error = 0; + goto done; + } + if (errno != EINPROGRESS) { + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, "connect() failed"); + goto done; + } + if (timeout == -1) + return (0); + return (tcp4_connect_wait(ctx, timeout)); +done: + flags &= ~O_NONBLOCK; + if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { + if (error == 0) + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_SETFL, ~O_NONBLOCK) failed"); + } + return (error); +} + +static int +tcp4_connect_wait(void *ctx, int timeout) +{ + struct tcp4_ctx *tctx = ctx; + struct timeval tv; + fd_set fdset; + socklen_t esize; + int error, flags, ret; + + PJDLOG_ASSERT(tctx != NULL); + PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_side == TCP4_SIDE_CLIENT); + PJDLOG_ASSERT(tctx->tc_fd >= 0); + PJDLOG_ASSERT(timeout >= 0); + + tv.tv_sec = timeout; + tv.tv_usec = 0; +again: + FD_ZERO(&fdset); + FD_SET(tctx->tc_fd, &fdset); + ret = select(tctx->tc_fd + 1, NULL, &fdset, NULL, &tv); + if (ret == 0) { + error = ETIMEDOUT; + goto done; + } else if (ret == -1) { + if (errno == EINTR) + goto again; + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, "select() failed"); + goto done; + } + PJDLOG_ASSERT(ret > 0); + PJDLOG_ASSERT(FD_ISSET(tctx->tc_fd, &fdset)); + esize = sizeof(error); + if (getsockopt(tctx->tc_fd, SOL_SOCKET, SO_ERROR, &error, + &esize) == -1) { + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, + "getsockopt(SO_ERROR) failed"); + goto done; + } + if (error != 0) { + pjdlog_common(LOG_DEBUG, 1, error, + "getsockopt(SO_ERROR) returned error"); + goto done; + } + error = 0; +done: + flags = fcntl(tctx->tc_fd, F_GETFL); + if (flags == -1) { + if (error == 0) + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, "fcntl(F_GETFL) failed"); + return (error); + } + flags &= ~O_NONBLOCK; + if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { + if (error == 0) + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_SETFL, ~O_NONBLOCK) failed"); + } + return (error); +} + +static int +tcp4_server(const char *addr, void **ctxp) +{ + struct tcp4_ctx *tctx; + int ret, val; + + ret = tcp4_setup_new(addr, TCP4_SIDE_SERVER_LISTEN, ctxp); + if (ret != 0) + return (ret); + + tctx = *ctxp; + + val = 1; + /* Ignore failure. */ + (void)setsockopt(tctx->tc_fd, SOL_SOCKET, SO_REUSEADDR, &val, + sizeof(val)); + + PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); + + if (bind(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, + sizeof(tctx->tc_sin)) < 0) { + ret = errno; + tcp4_close(tctx); + return (ret); + } + if (listen(tctx->tc_fd, 8) < 0) { + ret = errno; + tcp4_close(tctx); + return (ret); + } + + return (0); +} + +static int +tcp4_accept(void *ctx, void **newctxp) +{ + struct tcp4_ctx *tctx = ctx; + struct tcp4_ctx *newtctx; + socklen_t fromlen; + int ret; + + PJDLOG_ASSERT(tctx != NULL); + PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_side == TCP4_SIDE_SERVER_LISTEN); + PJDLOG_ASSERT(tctx->tc_fd >= 0); + PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); + + newtctx = malloc(sizeof(*newtctx)); + if (newtctx == NULL) + return (errno); + + fromlen = sizeof(tctx->tc_sin); + newtctx->tc_fd = accept(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, + &fromlen); + if (newtctx->tc_fd < 0) { + ret = errno; + free(newtctx); + return (ret); + } + + newtctx->tc_side = TCP4_SIDE_SERVER_WORK; + newtctx->tc_magic = TCP4_CTX_MAGIC; + *newctxp = newtctx; + + return (0); +} + +static int +tcp4_wrap(int fd, bool client, void **ctxp) +{ + + return (tcp4_setup_wrap(fd, + client ? TCP4_SIDE_CLIENT : TCP4_SIDE_SERVER_WORK, ctxp)); +} + +static int +tcp4_send(void *ctx, const unsigned char *data, size_t size, int fd) +{ + struct tcp4_ctx *tctx = ctx; + + PJDLOG_ASSERT(tctx != NULL); + PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_fd >= 0); + PJDLOG_ASSERT(fd == -1); + + return (proto_common_send(tctx->tc_fd, data, size, -1)); +} + +static int +tcp4_recv(void *ctx, unsigned char *data, size_t size, int *fdp) +{ + struct tcp4_ctx *tctx = ctx; + + PJDLOG_ASSERT(tctx != NULL); + PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_fd >= 0); + PJDLOG_ASSERT(fdp == NULL); + + return (proto_common_recv(tctx->tc_fd, data, size, NULL)); +} + +static int +tcp4_descriptor(const void *ctx) +{ + const struct tcp4_ctx *tctx = ctx; + + PJDLOG_ASSERT(tctx != NULL); + PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + + return (tctx->tc_fd); +} + +static bool +tcp4_address_match(const void *ctx, const char *addr) +{ + const struct tcp4_ctx *tctx = ctx; + struct sockaddr_in sin; + socklen_t sinlen; + in_addr_t ip1, ip2; + + PJDLOG_ASSERT(tctx != NULL); + PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + + if (tcp4_addr(addr, PROTO_TCP4_DEFAULT_PORT, &sin) != 0) + return (false); + ip1 = sin.sin_addr.s_addr; + + sinlen = sizeof(sin); + if (getpeername(tctx->tc_fd, (struct sockaddr *)&sin, &sinlen) < 0) + return (false); + ip2 = sin.sin_addr.s_addr; + + return (ip1 == ip2); +} + +static void +tcp4_local_address(const void *ctx, char *addr, size_t size) +{ + const struct tcp4_ctx *tctx = ctx; + struct sockaddr_in sin; + socklen_t sinlen; + + PJDLOG_ASSERT(tctx != NULL); + PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + + sinlen = sizeof(sin); + if (getsockname(tctx->tc_fd, (struct sockaddr *)&sin, &sinlen) < 0) { + PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size); + return; + } + PJDLOG_VERIFY(snprintf(addr, size, "tcp4://%S", &sin) < (ssize_t)size); +} + +static void +tcp4_remote_address(const void *ctx, char *addr, size_t size) +{ + const struct tcp4_ctx *tctx = ctx; + struct sockaddr_in sin; + socklen_t sinlen; + + PJDLOG_ASSERT(tctx != NULL); + PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + + sinlen = sizeof(sin); + if (getpeername(tctx->tc_fd, (struct sockaddr *)&sin, &sinlen) < 0) { + PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size); + return; + } + PJDLOG_VERIFY(snprintf(addr, size, "tcp4://%S", &sin) < (ssize_t)size); +} + +static void +tcp4_close(void *ctx) +{ + struct tcp4_ctx *tctx = ctx; + + PJDLOG_ASSERT(tctx != NULL); + PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + + if (tctx->tc_fd >= 0) + close(tctx->tc_fd); + tctx->tc_magic = 0; + free(tctx); +} + +static struct proto tcp4_proto = { + .prt_name = "tcp4", + .prt_client = tcp4_client, + .prt_connect = tcp4_connect, + .prt_connect_wait = tcp4_connect_wait, + .prt_server = tcp4_server, + .prt_accept = tcp4_accept, + .prt_wrap = tcp4_wrap, + .prt_send = tcp4_send, + .prt_recv = tcp4_recv, + .prt_descriptor = tcp4_descriptor, + .prt_address_match = tcp4_address_match, + .prt_local_address = tcp4_local_address, + .prt_remote_address = tcp4_remote_address, + .prt_close = tcp4_close +}; + +static __constructor void +tcp4_ctor(void) +{ + + proto_register(&tcp4_proto, true); +} From owner-svn-src-head@FreeBSD.ORG Fri May 20 11:09:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48929106564A; Fri, 20 May 2011 11:09:03 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36FC38FC15; Fri, 20 May 2011 11:09:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KB93vl081338; Fri, 20 May 2011 11:09:03 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KB93fb081335; Fri, 20 May 2011 11:09:03 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105201109.p4KB93fb081335@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 20 May 2011 11:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222116 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 11:09:03 -0000 Author: pjd Date: Fri May 20 11:09:02 2011 New Revision: 222116 URL: http://svn.freebsd.org/changeset/base/222116 Log: Rename tcp4 to tcp in preparation for IPv6 support. MFC after: 3 weeks Modified: head/sbin/hastd/Makefile head/sbin/hastd/proto_tcp.c Modified: head/sbin/hastd/Makefile ============================================================================== --- head/sbin/hastd/Makefile Fri May 20 11:06:17 2011 (r222115) +++ head/sbin/hastd/Makefile Fri May 20 11:09:02 2011 (r222116) @@ -20,7 +20,7 @@ SRCS+= y.tab.h MAN= hastd.8 hast.conf.5 NO_WFORMAT= -CFLAGS+=-DPROTO_TCP4_DEFAULT_PORT=8457 +CFLAGS+=-DPROTO_TCP_DEFAULT_PORT=8457 CFLAGS+=-I${.CURDIR} CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" Modified: head/sbin/hastd/proto_tcp.c ============================================================================== --- head/sbin/hastd/proto_tcp.c Fri May 20 11:06:17 2011 (r222115) +++ head/sbin/hastd/proto_tcp.c Fri May 20 11:09:02 2011 (r222116) @@ -51,19 +51,19 @@ __FBSDID("$FreeBSD$"); #include "proto_impl.h" #include "subr.h" -#define TCP4_CTX_MAGIC 0x7c441c -struct tcp4_ctx { +#define TCP_CTX_MAGIC 0x7c441c +struct tcp_ctx { int tc_magic; struct sockaddr_in tc_sin; int tc_fd; int tc_side; -#define TCP4_SIDE_CLIENT 0 -#define TCP4_SIDE_SERVER_LISTEN 1 -#define TCP4_SIDE_SERVER_WORK 2 +#define TCP_SIDE_CLIENT 0 +#define TCP_SIDE_SERVER_LISTEN 1 +#define TCP_SIDE_SERVER_WORK 2 }; -static int tcp4_connect_wait(void *ctx, int timeout); -static void tcp4_close(void *ctx); +static int tcp_connect_wait(void *ctx, int timeout); +static void tcp_close(void *ctx); static in_addr_t str2ip(const char *str) @@ -114,7 +114,7 @@ invalid: } static int -tcp4_addr(const char *addr, int defport, struct sockaddr_in *sinp) +tcp_addr(const char *addr, int defport, struct sockaddr_in *sinp) { char iporhost[MAXHOSTNAMELEN]; const char *pp; @@ -124,13 +124,13 @@ tcp4_addr(const char *addr, int defport, if (addr == NULL) return (-1); - if (strncasecmp(addr, "tcp4://", 7) == 0) + if (strncasecmp(addr, "tcp://", 7) == 0) addr += 7; else if (strncasecmp(addr, "tcp://", 6) == 0) addr += 6; else { /* - * Because TCP4 is the default assume IP or host is given without + * Because TCP is the default assume IP or host is given without * prefix. */ } @@ -170,14 +170,14 @@ tcp4_addr(const char *addr, int defport, } static int -tcp4_setup_new(const char *addr, int side, void **ctxp) +tcp_setup_new(const char *addr, int side, void **ctxp) { - struct tcp4_ctx *tctx; + struct tcp_ctx *tctx; int ret, nodelay; PJDLOG_ASSERT(addr != NULL); - PJDLOG_ASSERT(side == TCP4_SIDE_CLIENT || - side == TCP4_SIDE_SERVER_LISTEN); + PJDLOG_ASSERT(side == TCP_SIDE_CLIENT || + side == TCP_SIDE_SERVER_LISTEN); PJDLOG_ASSERT(ctxp != NULL); tctx = malloc(sizeof(*tctx)); @@ -185,7 +185,7 @@ tcp4_setup_new(const char *addr, int sid return (errno); /* Parse given address. */ - if ((ret = tcp4_addr(addr, PROTO_TCP4_DEFAULT_PORT, + if ((ret = tcp_addr(addr, PROTO_TCP_DEFAULT_PORT, &tctx->tc_sin)) != 0) { free(tctx); return (ret); @@ -210,20 +210,20 @@ tcp4_setup_new(const char *addr, int sid } tctx->tc_side = side; - tctx->tc_magic = TCP4_CTX_MAGIC; + tctx->tc_magic = TCP_CTX_MAGIC; *ctxp = tctx; return (0); } static int -tcp4_setup_wrap(int fd, int side, void **ctxp) +tcp_setup_wrap(int fd, int side, void **ctxp) { - struct tcp4_ctx *tctx; + struct tcp_ctx *tctx; PJDLOG_ASSERT(fd >= 0); - PJDLOG_ASSERT(side == TCP4_SIDE_CLIENT || - side == TCP4_SIDE_SERVER_WORK); + PJDLOG_ASSERT(side == TCP_SIDE_CLIENT || + side == TCP_SIDE_SERVER_WORK); PJDLOG_ASSERT(ctxp != NULL); tctx = malloc(sizeof(*tctx)); @@ -233,47 +233,47 @@ tcp4_setup_wrap(int fd, int side, void * tctx->tc_fd = fd; tctx->tc_sin.sin_family = AF_UNSPEC; tctx->tc_side = side; - tctx->tc_magic = TCP4_CTX_MAGIC; + tctx->tc_magic = TCP_CTX_MAGIC; *ctxp = tctx; return (0); } static int -tcp4_client(const char *srcaddr, const char *dstaddr, void **ctxp) +tcp_client(const char *srcaddr, const char *dstaddr, void **ctxp) { - struct tcp4_ctx *tctx; + struct tcp_ctx *tctx; struct sockaddr_in sin; int ret; - ret = tcp4_setup_new(dstaddr, TCP4_SIDE_CLIENT, ctxp); + ret = tcp_setup_new(dstaddr, TCP_SIDE_CLIENT, ctxp); if (ret != 0) return (ret); tctx = *ctxp; if (srcaddr == NULL) return (0); - ret = tcp4_addr(srcaddr, 0, &sin); + ret = tcp_addr(srcaddr, 0, &sin); if (ret != 0) { - tcp4_close(tctx); + tcp_close(tctx); return (ret); } if (bind(tctx->tc_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { ret = errno; - tcp4_close(tctx); + tcp_close(tctx); return (ret); } return (0); } static int -tcp4_connect(void *ctx, int timeout) +tcp_connect(void *ctx, int timeout) { - struct tcp4_ctx *tctx = ctx; + struct tcp_ctx *tctx = ctx; int error, flags; PJDLOG_ASSERT(tctx != NULL); - PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); - PJDLOG_ASSERT(tctx->tc_side == TCP4_SIDE_CLIENT); + PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_side == TCP_SIDE_CLIENT); PJDLOG_ASSERT(tctx->tc_fd >= 0); PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); PJDLOG_ASSERT(timeout >= -1); @@ -309,7 +309,7 @@ tcp4_connect(void *ctx, int timeout) } if (timeout == -1) return (0); - return (tcp4_connect_wait(ctx, timeout)); + return (tcp_connect_wait(ctx, timeout)); done: flags &= ~O_NONBLOCK; if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { @@ -322,17 +322,17 @@ done: } static int -tcp4_connect_wait(void *ctx, int timeout) +tcp_connect_wait(void *ctx, int timeout) { - struct tcp4_ctx *tctx = ctx; + struct tcp_ctx *tctx = ctx; struct timeval tv; fd_set fdset; socklen_t esize; int error, flags, ret; PJDLOG_ASSERT(tctx != NULL); - PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); - PJDLOG_ASSERT(tctx->tc_side == TCP4_SIDE_CLIENT); + PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_side == TCP_SIDE_CLIENT); PJDLOG_ASSERT(tctx->tc_fd >= 0); PJDLOG_ASSERT(timeout >= 0); @@ -387,12 +387,12 @@ done: } static int -tcp4_server(const char *addr, void **ctxp) +tcp_server(const char *addr, void **ctxp) { - struct tcp4_ctx *tctx; + struct tcp_ctx *tctx; int ret, val; - ret = tcp4_setup_new(addr, TCP4_SIDE_SERVER_LISTEN, ctxp); + ret = tcp_setup_new(addr, TCP_SIDE_SERVER_LISTEN, ctxp); if (ret != 0) return (ret); @@ -408,12 +408,12 @@ tcp4_server(const char *addr, void **ctx if (bind(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, sizeof(tctx->tc_sin)) < 0) { ret = errno; - tcp4_close(tctx); + tcp_close(tctx); return (ret); } if (listen(tctx->tc_fd, 8) < 0) { ret = errno; - tcp4_close(tctx); + tcp_close(tctx); return (ret); } @@ -421,16 +421,16 @@ tcp4_server(const char *addr, void **ctx } static int -tcp4_accept(void *ctx, void **newctxp) +tcp_accept(void *ctx, void **newctxp) { - struct tcp4_ctx *tctx = ctx; - struct tcp4_ctx *newtctx; + struct tcp_ctx *tctx = ctx; + struct tcp_ctx *newtctx; socklen_t fromlen; int ret; PJDLOG_ASSERT(tctx != NULL); - PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); - PJDLOG_ASSERT(tctx->tc_side == TCP4_SIDE_SERVER_LISTEN); + PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_side == TCP_SIDE_SERVER_LISTEN); PJDLOG_ASSERT(tctx->tc_fd >= 0); PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); @@ -447,28 +447,28 @@ tcp4_accept(void *ctx, void **newctxp) return (ret); } - newtctx->tc_side = TCP4_SIDE_SERVER_WORK; - newtctx->tc_magic = TCP4_CTX_MAGIC; + newtctx->tc_side = TCP_SIDE_SERVER_WORK; + newtctx->tc_magic = TCP_CTX_MAGIC; *newctxp = newtctx; return (0); } static int -tcp4_wrap(int fd, bool client, void **ctxp) +tcp_wrap(int fd, bool client, void **ctxp) { - return (tcp4_setup_wrap(fd, - client ? TCP4_SIDE_CLIENT : TCP4_SIDE_SERVER_WORK, ctxp)); + return (tcp_setup_wrap(fd, + client ? TCP_SIDE_CLIENT : TCP_SIDE_SERVER_WORK, ctxp)); } static int -tcp4_send(void *ctx, const unsigned char *data, size_t size, int fd) +tcp_send(void *ctx, const unsigned char *data, size_t size, int fd) { - struct tcp4_ctx *tctx = ctx; + struct tcp_ctx *tctx = ctx; PJDLOG_ASSERT(tctx != NULL); - PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); PJDLOG_ASSERT(tctx->tc_fd >= 0); PJDLOG_ASSERT(fd == -1); @@ -476,12 +476,12 @@ tcp4_send(void *ctx, const unsigned char } static int -tcp4_recv(void *ctx, unsigned char *data, size_t size, int *fdp) +tcp_recv(void *ctx, unsigned char *data, size_t size, int *fdp) { - struct tcp4_ctx *tctx = ctx; + struct tcp_ctx *tctx = ctx; PJDLOG_ASSERT(tctx != NULL); - PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); PJDLOG_ASSERT(tctx->tc_fd >= 0); PJDLOG_ASSERT(fdp == NULL); @@ -489,28 +489,28 @@ tcp4_recv(void *ctx, unsigned char *data } static int -tcp4_descriptor(const void *ctx) +tcp_descriptor(const void *ctx) { - const struct tcp4_ctx *tctx = ctx; + const struct tcp_ctx *tctx = ctx; PJDLOG_ASSERT(tctx != NULL); - PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); return (tctx->tc_fd); } static bool -tcp4_address_match(const void *ctx, const char *addr) +tcp_address_match(const void *ctx, const char *addr) { - const struct tcp4_ctx *tctx = ctx; + const struct tcp_ctx *tctx = ctx; struct sockaddr_in sin; socklen_t sinlen; in_addr_t ip1, ip2; PJDLOG_ASSERT(tctx != NULL); - PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); - if (tcp4_addr(addr, PROTO_TCP4_DEFAULT_PORT, &sin) != 0) + if (tcp_addr(addr, PROTO_TCP_DEFAULT_PORT, &sin) != 0) return (false); ip1 = sin.sin_addr.s_addr; @@ -523,48 +523,48 @@ tcp4_address_match(const void *ctx, cons } static void -tcp4_local_address(const void *ctx, char *addr, size_t size) +tcp_local_address(const void *ctx, char *addr, size_t size) { - const struct tcp4_ctx *tctx = ctx; + const struct tcp_ctx *tctx = ctx; struct sockaddr_in sin; socklen_t sinlen; PJDLOG_ASSERT(tctx != NULL); - PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); sinlen = sizeof(sin); if (getsockname(tctx->tc_fd, (struct sockaddr *)&sin, &sinlen) < 0) { PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size); return; } - PJDLOG_VERIFY(snprintf(addr, size, "tcp4://%S", &sin) < (ssize_t)size); + PJDLOG_VERIFY(snprintf(addr, size, "tcp://%S", &sin) < (ssize_t)size); } static void -tcp4_remote_address(const void *ctx, char *addr, size_t size) +tcp_remote_address(const void *ctx, char *addr, size_t size) { - const struct tcp4_ctx *tctx = ctx; + const struct tcp_ctx *tctx = ctx; struct sockaddr_in sin; socklen_t sinlen; PJDLOG_ASSERT(tctx != NULL); - PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); sinlen = sizeof(sin); if (getpeername(tctx->tc_fd, (struct sockaddr *)&sin, &sinlen) < 0) { PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size); return; } - PJDLOG_VERIFY(snprintf(addr, size, "tcp4://%S", &sin) < (ssize_t)size); + PJDLOG_VERIFY(snprintf(addr, size, "tcp://%S", &sin) < (ssize_t)size); } static void -tcp4_close(void *ctx) +tcp_close(void *ctx) { - struct tcp4_ctx *tctx = ctx; + struct tcp_ctx *tctx = ctx; PJDLOG_ASSERT(tctx != NULL); - PJDLOG_ASSERT(tctx->tc_magic == TCP4_CTX_MAGIC); + PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); if (tctx->tc_fd >= 0) close(tctx->tc_fd); @@ -572,26 +572,26 @@ tcp4_close(void *ctx) free(tctx); } -static struct proto tcp4_proto = { - .prt_name = "tcp4", - .prt_client = tcp4_client, - .prt_connect = tcp4_connect, - .prt_connect_wait = tcp4_connect_wait, - .prt_server = tcp4_server, - .prt_accept = tcp4_accept, - .prt_wrap = tcp4_wrap, - .prt_send = tcp4_send, - .prt_recv = tcp4_recv, - .prt_descriptor = tcp4_descriptor, - .prt_address_match = tcp4_address_match, - .prt_local_address = tcp4_local_address, - .prt_remote_address = tcp4_remote_address, - .prt_close = tcp4_close +static struct proto tcp_proto = { + .prt_name = "tcp", + .prt_client = tcp_client, + .prt_connect = tcp_connect, + .prt_connect_wait = tcp_connect_wait, + .prt_server = tcp_server, + .prt_accept = tcp_accept, + .prt_wrap = tcp_wrap, + .prt_send = tcp_send, + .prt_recv = tcp_recv, + .prt_descriptor = tcp_descriptor, + .prt_address_match = tcp_address_match, + .prt_local_address = tcp_local_address, + .prt_remote_address = tcp_remote_address, + .prt_close = tcp_close }; static __constructor void -tcp4_ctor(void) +tcp_ctor(void) { - proto_register(&tcp4_proto, true); + proto_register(&tcp_proto, true); } From owner-svn-src-head@FreeBSD.ORG Fri May 20 11:10:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 791281065672; Fri, 20 May 2011 11:10:39 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68D228FC15; Fri, 20 May 2011 11:10:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KBAdsW081422; Fri, 20 May 2011 11:10:39 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KBAd2r081420; Fri, 20 May 2011 11:10:39 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105201110.p4KBAd2r081420@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 20 May 2011 11:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222117 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 11:10:39 -0000 Author: pjd Date: Fri May 20 11:10:39 2011 New Revision: 222117 URL: http://svn.freebsd.org/changeset/base/222117 Log: Allow [ ] characters in strings. They might be used in IPv6 addresses. MFC after: 3 weeks Modified: head/sbin/hastd/token.l Modified: head/sbin/hastd/token.l ============================================================================== --- head/sbin/hastd/token.l Fri May 20 11:09:02 2011 (r222116) +++ head/sbin/hastd/token.l Fri May 20 11:10:39 2011 (r222117) @@ -68,7 +68,7 @@ sha256 { DP; return SHA256; } hole { DP; return HOLE; } lzf { DP; return LZF; } [0-9]+ { DP; yylval.num = atoi(yytext); return NUM; } -[a-zA-Z0-9\.\-_/\:]+ { DP; yylval.str = strdup(yytext); return STR; } +[a-zA-Z0-9\.\-_/\:\[\]]+ { DP; yylval.str = strdup(yytext); return STR; } \{ { DP; depth++; return OB; } \} { DP; depth--; return CB; } #.*$ /* ignore comments */; From owner-svn-src-head@FreeBSD.ORG Fri May 20 11:14:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3846B1065673; Fri, 20 May 2011 11:14:06 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BC1B8FC0A; Fri, 20 May 2011 11:14:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KBE6t1081574; Fri, 20 May 2011 11:14:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KBE5vx081572; Fri, 20 May 2011 11:14:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105201114.p4KBE5vx081572@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 20 May 2011 11:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222118 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 11:14:06 -0000 Author: pjd Date: Fri May 20 11:14:05 2011 New Revision: 222118 URL: http://svn.freebsd.org/changeset/base/222118 Log: Now that hell is fully frozen it is good time to add IPv6 support to HAST. MFC after: 3 weeks Modified: head/sbin/hastd/proto_tcp.c Modified: head/sbin/hastd/proto_tcp.c ============================================================================== --- head/sbin/hastd/proto_tcp.c Fri May 20 11:10:39 2011 (r222117) +++ head/sbin/hastd/proto_tcp.c Fri May 20 11:14:05 2011 (r222118) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -51,10 +52,10 @@ __FBSDID("$FreeBSD$"); #include "proto_impl.h" #include "subr.h" -#define TCP_CTX_MAGIC 0x7c441c +#define TCP_CTX_MAGIC 0x7c41c struct tcp_ctx { int tc_magic; - struct sockaddr_in tc_sin; + struct sockaddr_storage tc_sa; int tc_fd; int tc_side; #define TCP_SIDE_CLIENT 0 @@ -65,24 +66,6 @@ struct tcp_ctx { static int tcp_connect_wait(void *ctx, int timeout); static void tcp_close(void *ctx); -static in_addr_t -str2ip(const char *str) -{ - struct hostent *hp; - in_addr_t ip; - - ip = inet_addr(str); - if (ip != INADDR_NONE) { - /* It is a valid IP address. */ - return (ip); - } - /* Check if it is a valid host name. */ - hp = gethostbyname(str); - if (hp == NULL) - return (INADDR_NONE); - return (((struct in_addr *)(void *)hp->h_addr)->s_addr); -} - /* * Function converts the given string to unsigned number. */ @@ -114,57 +97,93 @@ invalid: } static int -tcp_addr(const char *addr, int defport, struct sockaddr_in *sinp) +tcp_addr(const char *addr, int defport, struct sockaddr_storage *sap) { - char iporhost[MAXHOSTNAMELEN]; + char iporhost[MAXHOSTNAMELEN], portstr[6]; + struct addrinfo hints; + struct addrinfo *res; const char *pp; + intmax_t port; size_t size; - in_addr_t ip; + int error; if (addr == NULL) return (-1); - if (strncasecmp(addr, "tcp://", 7) == 0) + bzero(&hints, sizeof(hints)); + hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV; + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + + if (strncasecmp(addr, "tcp4://", 7) == 0) { + addr += 7; + hints.ai_family = PF_INET; + } else if (strncasecmp(addr, "tcp6://", 7) == 0) { addr += 7; - else if (strncasecmp(addr, "tcp://", 6) == 0) + hints.ai_family = PF_INET6; + } else if (strncasecmp(addr, "tcp://", 6) == 0) { addr += 6; - else { + } else { /* * Because TCP is the default assume IP or host is given without * prefix. */ } - sinp->sin_family = AF_INET; - sinp->sin_len = sizeof(*sinp); - /* Extract optional port. */ - pp = strrchr(addr, ':'); + /* + * Extract optional port. + * There are three cases to consider. + * 1. hostname with port, eg. freefall.freebsd.org:8457 + * 2. IPv4 address with port, eg. 192.168.0.101:8457 + * 3. IPv6 address with port, eg. [fe80::1]:8457 + * We discover IPv6 address by checking for two colons and if port is + * given, the address has to start with [. + */ + pp = NULL; + if (strchr(addr, ':') != strrchr(addr, ':')) { + if (addr[0] == '[') + pp = strrchr(addr, ':'); + } else { + pp = strrchr(addr, ':'); + } if (pp == NULL) { /* Port not given, use the default. */ - sinp->sin_port = htons(defport); + port = defport; } else { - intmax_t port; - if (numfromstr(pp + 1, 1, 65535, &port) < 0) return (errno); - sinp->sin_port = htons(port); } + (void)snprintf(portstr, sizeof(portstr), "%jd", (intmax_t)port); /* Extract host name or IP address. */ if (pp == NULL) { size = sizeof(iporhost); if (strlcpy(iporhost, addr, size) >= size) return (ENAMETOOLONG); + } else if (addr[0] == '[' && pp[-1] == ']') { + size = (size_t)(pp - addr - 2 + 1); + if (size > sizeof(iporhost)) + return (ENAMETOOLONG); + (void)strlcpy(iporhost, addr + 1, size); } else { size = (size_t)(pp - addr + 1); if (size > sizeof(iporhost)) return (ENAMETOOLONG); (void)strlcpy(iporhost, addr, size); } - /* Convert string (IP address or host name) to in_addr_t. */ - ip = str2ip(iporhost); - if (ip == INADDR_NONE) + + error = getaddrinfo(iporhost, portstr, &hints, &res); + if (error != 0) { + pjdlog_debug(1, "getaddrinfo(%s, %s) failed: %s.", iporhost, + portstr, gai_strerror(error)); return (EINVAL); - sinp->sin_addr.s_addr = ip; + } + if (res == NULL) + return (ENOENT); + + memcpy(sap, res->ai_addr, res->ai_addrlen); + + freeaddrinfo(res); return (0); } @@ -185,22 +204,21 @@ tcp_setup_new(const char *addr, int side return (errno); /* Parse given address. */ - if ((ret = tcp_addr(addr, PROTO_TCP_DEFAULT_PORT, - &tctx->tc_sin)) != 0) { + if ((ret = tcp_addr(addr, PROTO_TCP_DEFAULT_PORT, &tctx->tc_sa)) != 0) { free(tctx); return (ret); } - PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); + PJDLOG_ASSERT(tctx->tc_sa.ss_family != AF_UNSPEC); - tctx->tc_fd = socket(AF_INET, SOCK_STREAM, 0); + tctx->tc_fd = socket(tctx->tc_sa.ss_family, SOCK_STREAM, 0); if (tctx->tc_fd == -1) { ret = errno; free(tctx); return (ret); } - PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); + PJDLOG_ASSERT(tctx->tc_sa.ss_family != AF_UNSPEC); /* Socket settings. */ nodelay = 1; @@ -231,7 +249,7 @@ tcp_setup_wrap(int fd, int side, void ** return (errno); tctx->tc_fd = fd; - tctx->tc_sin.sin_family = AF_UNSPEC; + tctx->tc_sa.ss_family = AF_UNSPEC; tctx->tc_side = side; tctx->tc_magic = TCP_CTX_MAGIC; *ctxp = tctx; @@ -243,7 +261,7 @@ static int tcp_client(const char *srcaddr, const char *dstaddr, void **ctxp) { struct tcp_ctx *tctx; - struct sockaddr_in sin; + struct sockaddr_storage sa; int ret; ret = tcp_setup_new(dstaddr, TCP_SIDE_CLIENT, ctxp); @@ -252,12 +270,12 @@ tcp_client(const char *srcaddr, const ch tctx = *ctxp; if (srcaddr == NULL) return (0); - ret = tcp_addr(srcaddr, 0, &sin); + ret = tcp_addr(srcaddr, 0, &sa); if (ret != 0) { tcp_close(tctx); return (ret); } - if (bind(tctx->tc_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { + if (bind(tctx->tc_fd, (struct sockaddr *)&sa, sa.ss_len) < 0) { ret = errno; tcp_close(tctx); return (ret); @@ -275,7 +293,7 @@ tcp_connect(void *ctx, int timeout) PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); PJDLOG_ASSERT(tctx->tc_side == TCP_SIDE_CLIENT); PJDLOG_ASSERT(tctx->tc_fd >= 0); - PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); + PJDLOG_ASSERT(tctx->tc_sa.ss_family != AF_UNSPEC); PJDLOG_ASSERT(timeout >= -1); flags = fcntl(tctx->tc_fd, F_GETFL); @@ -295,8 +313,8 @@ tcp_connect(void *ctx, int timeout) return (errno); } - if (connect(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, - sizeof(tctx->tc_sin)) == 0) { + if (connect(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sa, + tctx->tc_sa.ss_len) == 0) { if (timeout == -1) return (0); error = 0; @@ -403,10 +421,10 @@ tcp_server(const char *addr, void **ctxp (void)setsockopt(tctx->tc_fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); - PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); + PJDLOG_ASSERT(tctx->tc_sa.ss_family != AF_UNSPEC); - if (bind(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, - sizeof(tctx->tc_sin)) < 0) { + if (bind(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sa, + tctx->tc_sa.ss_len) < 0) { ret = errno; tcp_close(tctx); return (ret); @@ -432,14 +450,14 @@ tcp_accept(void *ctx, void **newctxp) PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); PJDLOG_ASSERT(tctx->tc_side == TCP_SIDE_SERVER_LISTEN); PJDLOG_ASSERT(tctx->tc_fd >= 0); - PJDLOG_ASSERT(tctx->tc_sin.sin_family != AF_UNSPEC); + PJDLOG_ASSERT(tctx->tc_sa.ss_family != AF_UNSPEC); newtctx = malloc(sizeof(*newtctx)); if (newtctx == NULL) return (errno); - fromlen = sizeof(tctx->tc_sin); - newtctx->tc_fd = accept(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, + fromlen = tctx->tc_sa.ss_len; + newtctx->tc_fd = accept(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sa, &fromlen); if (newtctx->tc_fd < 0) { ret = errno; @@ -503,59 +521,82 @@ static bool tcp_address_match(const void *ctx, const char *addr) { const struct tcp_ctx *tctx = ctx; - struct sockaddr_in sin; - socklen_t sinlen; - in_addr_t ip1, ip2; + struct sockaddr_storage sa1, sa2; + socklen_t salen; PJDLOG_ASSERT(tctx != NULL); PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); - if (tcp_addr(addr, PROTO_TCP_DEFAULT_PORT, &sin) != 0) + if (tcp_addr(addr, PROTO_TCP_DEFAULT_PORT, &sa1) != 0) + return (false); + + salen = sizeof(sa2); + if (getpeername(tctx->tc_fd, (struct sockaddr *)&sa2, &salen) < 0) return (false); - ip1 = sin.sin_addr.s_addr; - sinlen = sizeof(sin); - if (getpeername(tctx->tc_fd, (struct sockaddr *)&sin, &sinlen) < 0) + if (sa1.ss_family != sa2.ss_family || sa1.ss_len != sa2.ss_len) return (false); - ip2 = sin.sin_addr.s_addr; - return (ip1 == ip2); + switch (sa1.ss_family) { + case AF_INET: + { + struct sockaddr_in *sin1, *sin2; + + sin1 = (struct sockaddr_in *)&sa1; + sin2 = (struct sockaddr_in *)&sa2; + + return (memcmp(&sin1->sin_addr, &sin2->sin_addr, + sizeof(sin1->sin_addr)) == 0); + } + case AF_INET6: + { + struct sockaddr_in6 *sin1, *sin2; + + sin1 = (struct sockaddr_in6 *)&sa1; + sin2 = (struct sockaddr_in6 *)&sa2; + + return (memcmp(&sin1->sin6_addr, &sin2->sin6_addr, + sizeof(sin1->sin6_addr)) == 0); + } + default: + return (false); + } } static void tcp_local_address(const void *ctx, char *addr, size_t size) { const struct tcp_ctx *tctx = ctx; - struct sockaddr_in sin; - socklen_t sinlen; + struct sockaddr_storage sa; + socklen_t salen; PJDLOG_ASSERT(tctx != NULL); PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); - sinlen = sizeof(sin); - if (getsockname(tctx->tc_fd, (struct sockaddr *)&sin, &sinlen) < 0) { + salen = sizeof(sa); + if (getsockname(tctx->tc_fd, (struct sockaddr *)&sa, &salen) < 0) { PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size); return; } - PJDLOG_VERIFY(snprintf(addr, size, "tcp://%S", &sin) < (ssize_t)size); + PJDLOG_VERIFY(snprintf(addr, size, "tcp://%S", &sa) < (ssize_t)size); } static void tcp_remote_address(const void *ctx, char *addr, size_t size) { const struct tcp_ctx *tctx = ctx; - struct sockaddr_in sin; - socklen_t sinlen; + struct sockaddr_storage sa; + socklen_t salen; PJDLOG_ASSERT(tctx != NULL); PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); - sinlen = sizeof(sin); - if (getpeername(tctx->tc_fd, (struct sockaddr *)&sin, &sinlen) < 0) { + salen = sizeof(sa); + if (getpeername(tctx->tc_fd, (struct sockaddr *)&sa, &salen) < 0) { PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size); return; } - PJDLOG_VERIFY(snprintf(addr, size, "tcp://%S", &sin) < (ssize_t)size); + PJDLOG_VERIFY(snprintf(addr, size, "tcp://%S", &sa) < (ssize_t)size); } static void From owner-svn-src-head@FreeBSD.ORG Fri May 20 11:15:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C258F1065674; Fri, 20 May 2011 11:15:27 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97CB68FC1D; Fri, 20 May 2011 11:15:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KBFRm9081657; Fri, 20 May 2011 11:15:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KBFRdM081654; Fri, 20 May 2011 11:15:27 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105201115.p4KBFRdM081654@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 20 May 2011 11:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222119 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 11:15:27 -0000 Author: pjd Date: Fri May 20 11:15:27 2011 New Revision: 222119 URL: http://svn.freebsd.org/changeset/base/222119 Log: Rename ipv4/ipv6 to tcp4/tcp6. MFC after: 3 weeks Modified: head/sbin/hastd/hast.h head/sbin/hastd/parse.y Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Fri May 20 11:14:05 2011 (r222118) +++ head/sbin/hastd/hast.h Fri May 20 11:15:27 2011 (r222119) @@ -86,8 +86,8 @@ #define HAST_TIMEOUT 20 #define HAST_CONFIG "/etc/hast.conf" #define HAST_CONTROL "/var/run/hastctl" -#define HASTD_LISTEN_IPV4 "tcp4://0.0.0.0:8457" -#define HASTD_LISTEN_IPV6 "tcp6://[::]:8457" +#define HASTD_LISTEN_TCP4 "tcp4://0.0.0.0:8457" +#define HASTD_LISTEN_TCP6 "tcp6://[::]:8457" #define HASTD_PIDFILE "/var/run/hastd.pid" /* Default extent size. */ Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Fri May 20 11:14:05 2011 (r222118) +++ head/sbin/hastd/parse.y Fri May 20 11:15:27 2011 (r222119) @@ -61,8 +61,8 @@ static struct hast_resource *curres; static bool mynode, hadmynode; static char depth0_control[HAST_ADDRSIZE]; -static char depth0_listen_ipv4[HAST_ADDRSIZE]; -static char depth0_listen_ipv6[HAST_ADDRSIZE]; +static char depth0_listen_tcp4[HAST_ADDRSIZE]; +static char depth0_listen_tcp6[HAST_ADDRSIZE]; static TAILQ_HEAD(, hastd_listen) depth0_listen; static int depth0_replication; static int depth0_checksum; @@ -193,10 +193,10 @@ yy_config_parse(const char *config, bool depth0_compression = HAST_COMPRESSION_HOLE; strlcpy(depth0_control, HAST_CONTROL, sizeof(depth0_control)); TAILQ_INIT(&depth0_listen); - strlcpy(depth0_listen_ipv4, HASTD_LISTEN_IPV4, - sizeof(depth0_listen_ipv4)); - strlcpy(depth0_listen_ipv6, HASTD_LISTEN_IPV6, - sizeof(depth0_listen_ipv6)); + strlcpy(depth0_listen_tcp4, HASTD_LISTEN_TCP4, + sizeof(depth0_listen_tcp4)); + strlcpy(depth0_listen_tcp6, HASTD_LISTEN_TCP6, + sizeof(depth0_listen_tcp6)); depth0_exec[0] = '\0'; lconfig = calloc(1, sizeof(*lconfig)); @@ -250,7 +250,7 @@ yy_config_parse(const char *config, bool exit(EX_TEMPFAIL); return (NULL); } - (void)strlcpy(lst->hl_addr, depth0_listen_ipv4, + (void)strlcpy(lst->hl_addr, depth0_listen_tcp4, sizeof(lst->hl_addr)); TAILQ_INSERT_TAIL(&lconfig->hc_listen, lst, hl_next); } else { @@ -267,7 +267,7 @@ yy_config_parse(const char *config, bool exit(EX_TEMPFAIL); return (NULL); } - (void)strlcpy(lst->hl_addr, depth0_listen_ipv6, + (void)strlcpy(lst->hl_addr, depth0_listen_tcp6, sizeof(lst->hl_addr)); TAILQ_INSERT_TAIL(&lconfig->hc_listen, lst, hl_next); } else { From owner-svn-src-head@FreeBSD.ORG Fri May 20 11:16:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29885106564A; Fri, 20 May 2011 11:16:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 193EC8FC0A; Fri, 20 May 2011 11:16:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KBGPNv081731; Fri, 20 May 2011 11:16:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KBGPCR081729; Fri, 20 May 2011 11:16:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105201116.p4KBGPCR081729@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 20 May 2011 11:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222120 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 11:16:26 -0000 Author: pjd Date: Fri May 20 11:16:25 2011 New Revision: 222120 URL: http://svn.freebsd.org/changeset/base/222120 Log: If no listen address is specified, bind by default to: tcp4://0.0.0.0:8457 tcp6://[::]:8457 MFC after: 3 weeks Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Fri May 20 11:15:27 2011 (r222119) +++ head/sbin/hastd/parse.y Fri May 20 11:16:25 2011 (r222120) @@ -257,7 +257,6 @@ yy_config_parse(const char *config, bool pjdlog_debug(1, "No IPv4 support in the kernel, not listening on IPv4 address."); } -#ifdef notyet if (family_supported(AF_INET6)) { lst = calloc(1, sizeof(*lst)); if (lst == NULL) { @@ -274,7 +273,6 @@ yy_config_parse(const char *config, bool pjdlog_debug(1, "No IPv6 support in the kernel, not listening on IPv6 address."); } -#endif if (TAILQ_EMPTY(&lconfig->hc_listen)) { pjdlog_error("No address to listen on."); yy_config_free(lconfig); From owner-svn-src-head@FreeBSD.ORG Fri May 20 11:21:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C7F8106566B; Fri, 20 May 2011 11:21:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1468FC13; Fri, 20 May 2011 11:21:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KBLejH081916; Fri, 20 May 2011 11:21:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KBLe8Y081914; Fri, 20 May 2011 11:21:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105201121.p4KBLe8Y081914@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 20 May 2011 11:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222121 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 11:21:40 -0000 Author: pjd Date: Fri May 20 11:21:39 2011 New Revision: 222121 URL: http://svn.freebsd.org/changeset/base/222121 Log: Document IPv6 support. MFC after: 3 weeks Modified: head/sbin/hastd/hast.conf.5 Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Fri May 20 11:16:25 2011 (r222120) +++ head/sbin/hastd/hast.conf.5 Fri May 20 11:21:39 2011 (r222121) @@ -160,8 +160,13 @@ tcp4://0.0.0.0:8457 .Ed .Pp Multiple listen addresses can be specified. -The default value is -.Pa tcp4://0.0.0.0:8457 . +By default +.Nm hastd +listens on +.Pa tcp4://0.0.0.0:8457 +and +.Pa tcp6://[::]:8457 +if kernel supports IPv4 and IPv6 respectively. .It Ic replication Aq mode .Pp Replication mode should be one of the following: @@ -365,26 +370,35 @@ daemon. .Sh EXAMPLES The example configuration file can look as follows: .Bd -literal -offset indent +listen tcp://0.0.0.0 + +on hasta { + listen tcp://2001:db8::1/64 +} +on hastb { + listen tcp://2001:db8::2/64 +} + resource shared { local /dev/da0 on hasta { - remote tcp4://10.0.0.2 + remote tcp://10.0.0.2 } on hastb { - remote tcp4://10.0.0.1 + remote tcp://10.0.0.1 } } resource tank { on hasta { local /dev/mirror/tanka - source tcp4://10.0.0.1 - remote tcp4://10.0.0.2 + source tcp://10.0.0.1 + remote tcp://10.0.0.2 } on hastb { local /dev/mirror/tankb - source tcp4://10.0.0.2 - remote tcp4://10.0.0.1 + source tcp://10.0.0.2 + remote tcp://10.0.0.1 } } .Ed From owner-svn-src-head@FreeBSD.ORG Fri May 20 11:29:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E345106564A; Fri, 20 May 2011 11:29:09 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D8468FC0C; Fri, 20 May 2011 11:29:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KBT9us082178; Fri, 20 May 2011 11:29:09 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KBT9p9082174; Fri, 20 May 2011 11:29:09 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201105201129.p4KBT9p9082174@svn.freebsd.org> From: Benedict Reuschling Date: Fri, 20 May 2011 11:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222122 - head/usr.bin/ar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 11:29:09 -0000 Author: bcr (doc committer) Date: Fri May 20 11:29:09 2011 New Revision: 222122 URL: http://svn.freebsd.org/changeset/base/222122 Log: Correct typos in comments, no functional changes. Found by: codespell Reviewed by: kaiw MFC after: 1 week Modified: head/usr.bin/ar/acpyacc.y head/usr.bin/ar/ar.c head/usr.bin/ar/write.c Modified: head/usr.bin/ar/acpyacc.y ============================================================================== --- head/usr.bin/ar/acpyacc.y Fri May 20 11:21:39 2011 (r222121) +++ head/usr.bin/ar/acpyacc.y Fri May 20 11:29:09 2011 (r222122) @@ -358,7 +358,7 @@ arscp_copy(int ifd, int ofd) /* * Add all modules of archive to current archive, if list != NULL, - * only those modules speicifed in 'list' will be added. + * only those modules specified in 'list' will be added. */ static void arscp_addlib(char *archive, struct list *list) @@ -545,7 +545,7 @@ arscp_end(int eval) } /* - * Check if target spcified, i.e, whether OPEN or CREATE has been + * Check if target specified, i.e, whether OPEN or CREATE has been * issued by user. */ static int Modified: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Fri May 20 11:21:39 2011 (r222121) +++ head/usr.bin/ar/ar.c Fri May 20 11:29:09 2011 (r222122) @@ -109,7 +109,7 @@ main(int argc, char **argv) bsdar->progname = "ar"; /* Act like ranlib if our name ends in "ranlib"; this - * accomodates arm-freebsd7.1-ranlib, bsdranlib, etc. */ + * accommodates arm-freebsd7.1-ranlib, bsdranlib, etc. */ len = strlen(bsdar->progname); if (len >= strlen("ranlib") && strcmp(bsdar->progname + len - strlen("ranlib"), "ranlib") == 0) { Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Fri May 20 11:21:39 2011 (r222121) +++ head/usr.bin/ar/write.c Fri May 20 11:29:09 2011 (r222122) @@ -113,7 +113,7 @@ ar_mode_A(struct bsdar *bsdar) /* * Create object from file, return created obj upon success, or NULL * when an error occurs or the member is not newer than existing - * one while -u is specifed. + * one while -u is specified. */ static struct ar_obj * create_obj_from_file(struct bsdar *bsdar, const char *name, time_t mtime) @@ -220,7 +220,7 @@ insert_obj(struct bsdar *bsdar, struct a if (pos == NULL || obj == pos) /* - * If the object to move happens to be the posistion obj, + * If the object to move happens to be the position obj, * or if there is not a pos obj, move it to tail. */ goto tail; @@ -418,7 +418,7 @@ write_archive(struct bsdar *bsdar, char if (mode == 'A') { /* * Read objects from the target archive of ADDLIB command. - * If there are members spcified in argv, read those members + * If there are members specified in argv, read those members * only, otherwise the entire archive will be read. */ read_objs(bsdar, bsdar->addlib, 1); @@ -438,7 +438,7 @@ write_archive(struct bsdar *bsdar, char /* * If can't find `pos' specified by user, - * sliently insert objects at tail. + * silently insert objects at tail. */ if (pos == NULL) bsdar->options &= ~(AR_A | AR_B); @@ -699,7 +699,7 @@ create_symtab_entry(struct bsdar *bsdar, return; } if (elf_kind(e) != ELF_K_ELF) { - /* Sliently ignore non-elf member. */ + /* Silently ignore non-elf member. */ elf_end(e); return; } From owner-svn-src-head@FreeBSD.ORG Fri May 20 14:07:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63501106566B; Fri, 20 May 2011 14:07:08 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5315E8FC15; Fri, 20 May 2011 14:07:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KE78fJ087392; Fri, 20 May 2011 14:07:08 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KE78JK087390; Fri, 20 May 2011 14:07:08 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201105201407.p4KE78JK087390@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 20 May 2011 14:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222127 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 14:07:08 -0000 Author: pluknet Date: Fri May 20 14:07:08 2011 New Revision: 222127 URL: http://svn.freebsd.org/changeset/base/222127 Log: Fix the description of the "paddr" keyword. It shows a process pointer just like a dublicating "uprocp". MFC after: 1 week Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Fri May 20 12:52:08 2011 (r222126) +++ head/bin/ps/ps.1 Fri May 20 14:07:08 2011 (r222127) @@ -549,7 +549,7 @@ wait channel (as an address) total blocks written (alias .Cm oublock ) .It Cm paddr -swap address +process pointer .It Cm pagein pageins (same as majflt) .It Cm pgid From owner-svn-src-head@FreeBSD.ORG Fri May 20 14:32:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C019106564A; Fri, 20 May 2011 14:32:29 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BC8C8FC12; Fri, 20 May 2011 14:32:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KEWTwY088301; Fri, 20 May 2011 14:32:29 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KEWSfV088299; Fri, 20 May 2011 14:32:28 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201105201432.p4KEWSfV088299@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 20 May 2011 14:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222130 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 14:32:29 -0000 Author: pluknet Date: Fri May 20 14:32:28 2011 New Revision: 222130 URL: http://svn.freebsd.org/changeset/base/222130 Log: Spelling in P_HADTHREADS. MFC after: 1 week Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Fri May 20 14:26:13 2011 (r222129) +++ head/bin/ps/ps.1 Fri May 20 14:32:28 2011 (r222130) @@ -301,7 +301,7 @@ the include file .It Dv "P_PPWAIT" Ta No "0x00010 Parent is waiting for child to exec/exit" .It Dv "P_PROFIL" Ta No "0x00020 Has started profiling" .It Dv "P_STOPPROF" Ta No "0x00040 Has thread in requesting to stop prof" -.It Dv "P_HASTHREADS" Ta No "0x00080 Has had threads (no cleanup shortcuts)" +.It Dv "P_HADTHREADS" Ta No "0x00080 Has had threads (no cleanup shortcuts)" .It Dv "P_SUGID" Ta No "0x00100 Had set id privileges since last exec" .It Dv "P_SYSTEM" Ta No "0x00200 System proc: no sigs, stats or swapping" .It Dv "P_SINGLE_EXIT" Ta No "0x00400 Threads suspending should exit, not wait" From owner-svn-src-head@FreeBSD.ORG Fri May 20 15:26:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A1231065670; Fri, 20 May 2011 15:26:32 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E424F8FC18; Fri, 20 May 2011 15:26:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KFQVMO089955; Fri, 20 May 2011 15:26:31 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KFQVto089953; Fri, 20 May 2011 15:26:31 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201105201526.p4KFQVto089953@svn.freebsd.org> From: Alan Cox Date: Fri, 20 May 2011 15:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222132 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 15:26:32 -0000 Author: alc Date: Fri May 20 15:26:31 2011 New Revision: 222132 URL: http://svn.freebsd.org/changeset/base/222132 Log: Eliminate a redundant #include. ("vm/vm_param.h" already includes "machine/vmparam.h".) Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri May 20 14:53:16 2011 (r222131) +++ head/sys/vm/uma_core.c Fri May 20 15:26:31 2011 (r222132) @@ -86,8 +86,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include /* From owner-svn-src-head@FreeBSD.ORG Fri May 20 16:03:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F8571065672; Fri, 20 May 2011 16:03:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44CA88FC1F; Fri, 20 May 2011 16:03:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KG3bs5091208; Fri, 20 May 2011 16:03:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KG3bAa091205; Fri, 20 May 2011 16:03:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105201603.p4KG3bAa091205@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 20 May 2011 16:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222134 - in head: bin/sh tools/regression/bin/sh/parser X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 16:03:37 -0000 Author: jilles Date: Fri May 20 16:03:36 2011 New Revision: 222134 URL: http://svn.freebsd.org/changeset/base/222134 Log: sh: Allow terminating a heredoc with a terminator at EOF without a newline. This is sometimes used with eval or old-style command substitution, and most shells other than ash derivatives allow it. It can also be used with scripts that violate POSIX's requirement on the application that they end in a newline (scripts must be text files except that line length is unlimited). Example: v=`cat < Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A009106564A; Fri, 20 May 2011 17:01:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE4948FC13; Fri, 20 May 2011 17:01:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KH1MdP092948; Fri, 20 May 2011 17:01:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KH1MK6092946; Fri, 20 May 2011 17:01:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105201701.p4KH1MK6092946@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 20 May 2011 17:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222135 - head/sys/dev/gem X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 17:01:23 -0000 Author: yongari Date: Fri May 20 17:01:22 2011 New Revision: 222135 URL: http://svn.freebsd.org/changeset/base/222135 Log: Remove unnecessary controller reinitialization by checking IFF_DRV_RUNNING flag. Previously running dhclient or adding alias addresses reinitialized controller and it resulted in unnecessary link flips. Reviewed by: marius Modified: head/sys/dev/gem/if_gem.c Modified: head/sys/dev/gem/if_gem.c ============================================================================== --- head/sys/dev/gem/if_gem.c Fri May 20 16:03:36 2011 (r222134) +++ head/sys/dev/gem/if_gem.c Fri May 20 17:01:22 2011 (r222135) @@ -739,8 +739,10 @@ gem_reset_rxdma(struct gem_softc *sc) { int i; - if (gem_reset_rx(sc) != 0) + if (gem_reset_rx(sc) != 0) { + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return (gem_init_locked(sc)); + } for (i = 0; i < GEM_NRXDESC; i++) if (sc->sc_rxsoft[i].rxs_mbuf != NULL) GEM_UPDATE_RXDESC(sc, i); @@ -924,6 +926,9 @@ gem_init_locked(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: %s: calling stop", device_get_name(sc->sc_dev), __func__); @@ -1762,6 +1767,7 @@ gem_intr(void *v) if ((status2 & (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) != 0) { sc->sc_ifp->if_oerrors++; + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; gem_init_locked(sc); } } @@ -1814,6 +1820,7 @@ gem_watchdog(struct gem_softc *sc) ++ifp->if_oerrors; /* Try to get more packets going. */ + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; gem_init_locked(sc); gem_start_locked(ifp); return (EJUSTRETURN); From owner-svn-src-head@FreeBSD.ORG Fri May 20 17:03:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E995106566C; Fri, 20 May 2011 17:03:24 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8C458FC0A; Fri, 20 May 2011 17:03:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KH3N8p093038; Fri, 20 May 2011 17:03:23 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KH3NrR093036; Fri, 20 May 2011 17:03:23 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201105201703.p4KH3NrR093036@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 20 May 2011 17:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222136 - head/usr.bin/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 17:03:24 -0000 Author: pluknet Date: Fri May 20 17:03:23 2011 New Revision: 222136 URL: http://svn.freebsd.org/changeset/base/222136 Log: Add missing header file. MFC after: 1 week Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri May 20 17:01:22 2011 (r222135) +++ head/usr.bin/top/machine.c Fri May 20 17:03:23 2011 (r222136) @@ -35,6 +35,7 @@ #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Fri May 20 17:09:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 252C4106564A; Fri, 20 May 2011 17:09:47 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id A36CF8FC14; Fri, 20 May 2011 17:09:46 +0000 (UTC) Received: by qwc9 with SMTP id 9so2669183qwc.13 for ; Fri, 20 May 2011 10:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=/v/Iu9Df+I2kHHTZNA6O8KCTZmEIiD1PoUNACNnUiWQ=; b=gzSJZVzj0UDilFW8p6czO4NYBIWceO0zRGCoZrinWdBBZ2Jj/ZOIpb1AS4Dbvxzqd6 8kwpzw0QTK4fa2Oj4AfWsjiMi3h1YrqYGmZJQMGqOZbfzPfIcWx8WSWeEyP5ehmeizM4 Ds9Z7eToW93pq+OWNx7R76PL3eLlkQVheBmn4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=c2RTfa3D5zPdPYm9VIMvym59sI5yEvIAdboNzc5bjLLcegDaCN7NHMy10Cf0Jt7wBO zqZ2h/52v9I9nLp6yCapwHQjqviTfubJ+DF1rWwH/t6T589NAuWQCccB2IMb8gsXskNi JIYEhQt+mh+Og5dUP7s3up2TkDHBDBtTYVUJg= MIME-Version: 1.0 Received: by 10.229.20.210 with SMTP id g18mr3454752qcb.115.1305911385783; Fri, 20 May 2011 10:09:45 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.229.72.133 with HTTP; Fri, 20 May 2011 10:09:45 -0700 (PDT) In-Reply-To: <201105201703.p4KH3NrR093036@svn.freebsd.org> References: <201105201703.p4KH3NrR093036@svn.freebsd.org> Date: Fri, 20 May 2011 21:09:45 +0400 X-Google-Sender-Auth: yPPNe4Si_cAW9YnURibHgevm1gU Message-ID: From: Sergey Kandaurov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r222136 - head/usr.bin/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 17:09:47 -0000 On 20 May 2011 21:03, Sergey Kandaurov wrote: > Author: pluknet > Date: Fri May 20 17:03:23 2011 > New Revision: 222136 > URL: http://svn.freebsd.org/changeset/base/222136 > > Log: > =A0Add missing header file. > > =A0MFC after: =A0 =A01 week > > Modified: > =A0head/usr.bin/top/machine.c > > Modified: head/usr.bin/top/machine.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/top/machine.c =A0Fri May 20 17:01:22 2011 =A0 =A0 =A0 = =A0(r222135) > +++ head/usr.bin/top/machine.c =A0Fri May 20 17:03:23 2011 =A0 =A0 =A0 = =A0(r222136) > @@ -35,6 +35,7 @@ > =A0#include > =A0#include > > +#include > =A0#include > =A0#include > =A0#include > There's still a lot of warnings but all of them reside in contrib part. --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Fri May 20 17:28:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5106D106566C; Fri, 20 May 2011 17:28:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F04E8FC15; Fri, 20 May 2011 17:28:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KHS1Ao093787; Fri, 20 May 2011 17:28:01 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KHS1ke093785; Fri, 20 May 2011 17:28:01 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201105201728.p4KHS1ke093785@svn.freebsd.org> From: Alan Cox Date: Fri, 20 May 2011 17:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222137 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 17:28:01 -0000 Author: alc Date: Fri May 20 17:28:00 2011 New Revision: 222137 URL: http://svn.freebsd.org/changeset/base/222137 Log: Fix spelling errors. Modified: head/sys/vm/uma_int.h Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Fri May 20 17:03:23 2011 (r222136) +++ head/sys/vm/uma_int.h Fri May 20 17:28:00 2011 (r222137) @@ -45,7 +45,7 @@ * * The uma_slab_t may be embedded in a UMA_SLAB_SIZE chunk of memory or it may * be allocated off the page from a special slab zone. The free list within a - * slab is managed with a linked list of indexes, which are 8 bit values. If + * slab is managed with a linked list of indices, which are 8 bit values. If * UMA_SLAB_SIZE is defined to be too large I will have to switch to 16bit * values. Currently on alpha you can get 250 or so 32 byte items and on x86 * you can get 250 or so 16byte items. For item sizes that would yield more @@ -56,9 +56,9 @@ * wasted between items due to alignment problems. This may yield a much better * memory footprint for certain sizes of objects. Another alternative is to * increase the UMA_SLAB_SIZE, or allow for dynamic slab sizes. I prefer - * dynamic slab sizes because we could stick with 8 bit indexes and only use + * dynamic slab sizes because we could stick with 8 bit indices and only use * large slab sizes for zones with a lot of waste per slab. This may create - * ineffeciencies in the vm subsystem due to fragmentation in the address space. + * inefficiencies in the vm subsystem due to fragmentation in the address space. * * The only really gross cases, with regards to memory waste, are for those * items that are just over half the page size. You can get nearly 50% waste, From owner-svn-src-head@FreeBSD.ORG Fri May 20 17:35:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7EBE1065672; Fri, 20 May 2011 17:35:10 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEB5C8FC19; Fri, 20 May 2011 17:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KHZAwZ094087; Fri, 20 May 2011 17:35:10 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KHZAZP094084; Fri, 20 May 2011 17:35:10 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105201735.p4KHZAZP094084@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 20 May 2011 17:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222139 - head/usr.sbin/tzsetup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 17:35:11 -0000 Author: ru Date: Fri May 20 17:35:10 2011 New Revision: 222139 URL: http://svn.freebsd.org/changeset/base/222139 Log: - add missing options and arguments to program's usage() and sync it with manpage's SYNOPSIS - generally clean up a manpage's formatting Reviewed by: edwin Modified: head/usr.sbin/tzsetup/tzsetup.8 head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.8 ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.8 Fri May 20 17:29:03 2011 (r222138) +++ head/usr.sbin/tzsetup/tzsetup.8 Fri May 20 17:35:10 2011 (r222139) @@ -23,7 +23,8 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd July 4, 2009 +.\" +.Dd October 21, 2009 .Dt TZSETUP 8 .Os .Sh NAME @@ -32,8 +33,8 @@ .Sh SYNOPSIS .Nm .Op Fl nrs -.Op Fl C Ar chroot directory -.Op Ar zoneinfo file | zoneinfo name +.Op Fl C Ar chroot_directory +.Op Ar zoneinfo_file | zoneinfo_name .Sh DESCRIPTION The .Nm @@ -50,24 +51,25 @@ the hardware clock does not keep .Pp The following option is available: .Bl -tag -offset indent -width Fl -.It Fl C Ar chroot directory +.It Fl C Ar chroot_directory Open all files and directories relative to -.Ar chroot directory . +.Ar chroot_directory . .It Fl n Do not create or copy files. .It Fl r -Reinstall the zoneinfo file installed last time. The name is obtained from +Reinstall the zoneinfo file installed last time. +The name is obtained from .Pa /var/db/zoneinfo . -.It Fl s +.It Fl s Skip the initial question about adjusting the clock if not set to .Tn UTC . .El .Pp It is possible to short-circuit the menu system by specifying the location of a -.Ar zoneinfo file +.Ar zoneinfo_file or the name of the -.Ar zoneinfo name +.Ar zoneinfo_name on the command line; this is intended mainly for pre-configured installation scripts or people who know which zoneinfo they want to install. .Sh TIMEZONE DATABASE @@ -101,38 +103,41 @@ The source code to the database contains many additional comments and documentation references for the historically minded. .Sh FILES -.Bl -tag -width /usr/share/zoneinfo/zone.tab -compact +.Bl -tag -width ".Pa /usr/share/zoneinfo/zone.tab" -compact .It Pa /etc/localtime -current time zone file. +current time zone file .It Pa /etc/wall_cmos_clock see -.Xr adjkerntz 8 . +.Xr adjkerntz 8 .It Pa /usr/share/misc/iso3166 mapping of .Tn ISO -3166 territory codes to names. +3166 territory codes to names .It Pa /usr/share/zoneinfo -directory for zoneinfo files. +directory for zoneinfo files .It Pa /usr/share/zoneinfo/zone.tab -mapping of timezone file to country and location. +mapping of timezone file to country and location .It Pa /var/db/zoneinfo -saved name of the timezone file installed last. +saved name of the timezone file installed last .El .Sh EXAMPLES Normal usage, to select the right zoneinfo file via the dialog-based user interface: -.Dl # tzsetup +.Dl tzsetup +.Pp Install the file .Pa /usr/share/zoneinfo/Australia/Sydney : -.Dl # tzsetup /usr/share/zoneinfo/Australia/Sydney +.Dl "tzsetup /usr/share/zoneinfo/Australia/Sydney" +.Pp Install the zoneinfo file for Australia/Sydney, assumed to be located in .Pa /usr/share/zoneinfo : -.Dl # tzsetup Australia/Sydney +.Dl "tzsetup Australia/Sydney" +.Pp After a reinstall of the zoneinfo files, you can reinstall the -latest installed zoneinfo file: (as specified in -.Pa /var/db/zoneinfo ) -.Dl # tzsetup -r +latest installed zoneinfo file (as specified in +.Pa /var/db/zoneinfo ) : +.Dl "tzsetup -r" .Sh SEE ALSO .Xr date 1 , .Xr adjtime 2 , Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Fri May 20 17:29:03 2011 (r222138) +++ head/usr.sbin/tzsetup/tzsetup.c Fri May 20 17:35:10 2011 (r222139) @@ -731,7 +731,8 @@ static void usage(void) { - fprintf(stderr, "usage: tzsetup [-nrs] [zoneinfo file]\n"); + fprintf(stderr, "usage: tzsetup [-nrs] [-C chroot_directory]" + " [zoneinfo_file | zoneinfo_name]\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Fri May 20 18:27:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F12201065675; Fri, 20 May 2011 18:27:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6E688FC18; Fri, 20 May 2011 18:27:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KIRDtM095708; Fri, 20 May 2011 18:27:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KIRDON095706; Fri, 20 May 2011 18:27:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105201827.p4KIRDON095706@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 20 May 2011 18:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222142 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 18:27:14 -0000 Author: yongari Date: Fri May 20 18:27:13 2011 New Revision: 222142 URL: http://svn.freebsd.org/changeset/base/222142 Log: Datasheet says vge(4) controllers support DAC but it seems that's not true on old PCI based controllers. DAC configuration is read from EEPROM in device reset phase and driver can override DAC configuration. However I guess there is an undocumented reason why EEPROM configuration does not enable DAC so do not blindly override DAC configuration. Recent PCIe based controllers are supposed to support 64bit DMA so allow 64bit DMA only on PCIe based controllers. PR: kern/157184 MFC after: 1 week Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Fri May 20 17:43:38 2011 (r222141) +++ head/sys/dev/vge/if_vge.c Fri May 20 18:27:13 2011 (r222142) @@ -685,7 +685,18 @@ vge_dma_alloc(struct vge_softc *sc) bus_addr_t lowaddr, tx_ring_end, rx_ring_end; int error, i; - lowaddr = BUS_SPACE_MAXADDR; + /* + * It seems old PCI controllers do not support DAC. DAC + * configuration can be enabled by accessing VGE_CHIPCFG3 + * register but honor EEPROM configuration instead of + * blindly overriding DAC configuration. PCIe based + * controllers are supposed to support 64bit DMA so enable + * 64bit DMA on these controllers. + */ + if ((sc->vge_flags & VGE_FLAG_PCIE) != 0) + lowaddr = BUS_SPACE_MAXADDR; + else + lowaddr = BUS_SPACE_MAXADDR_32BIT; again: /* Create parent ring tag. */ @@ -802,10 +813,14 @@ again: goto again; } + if ((sc->vge_flags & VGE_FLAG_PCIE) != 0) + lowaddr = VGE_BUF_DMA_MAXADDR; + else + lowaddr = BUS_SPACE_MAXADDR_32BIT; /* Create parent buffer tag. */ error = bus_dma_tag_create(bus_get_dma_tag(sc->vge_dev),/* parent */ 1, 0, /* algnmnt, boundary */ - VGE_BUF_DMA_MAXADDR, /* lowaddr */ + lowaddr, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ From owner-svn-src-head@FreeBSD.ORG Fri May 20 19:12:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8948106564A; Fri, 20 May 2011 19:12:20 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D75E58FC0A; Fri, 20 May 2011 19:12:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KJCKuq097105; Fri, 20 May 2011 19:12:20 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KJCKdu097098; Fri, 20 May 2011 19:12:20 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201105201912.p4KJCKdu097098@svn.freebsd.org> From: Qing Li Date: Fri, 20 May 2011 19:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222143 - in head/sys: net netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 19:12:21 -0000 Author: qingli Date: Fri May 20 19:12:20 2011 New Revision: 222143 URL: http://svn.freebsd.org/changeset/base/222143 Log: The statically configured (permanent) ARP entries are removed when an interface is brought down, even though the interface address is still valid. This patch maintains the permanent ARP entries as long as the interface address (having the same prefix as that of the ARP entries) is valid. Reviewed by: delphij MFC after: 5 days Modified: head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/netinet/in.c head/sys/netinet/in_var.h head/sys/netinet/raw_ip.c head/sys/netinet6/in6.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Fri May 20 18:27:13 2011 (r222142) +++ head/sys/net/if_llatbl.c Fri May 20 19:12:20 2011 (r222143) @@ -228,7 +228,8 @@ lltable_drain(int af) #endif void -lltable_prefix_free(int af, struct sockaddr *prefix, struct sockaddr *mask) +lltable_prefix_free(int af, struct sockaddr *prefix, struct sockaddr *mask, + u_int flags) { struct lltable *llt; @@ -237,7 +238,7 @@ lltable_prefix_free(int af, struct socka if (llt->llt_af != af) continue; - llt->llt_prefix_free(llt, prefix, mask); + llt->llt_prefix_free(llt, prefix, mask, flags); } LLTABLE_RUNLOCK(); } Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Fri May 20 18:27:13 2011 (r222142) +++ head/sys/net/if_llatbl.h Fri May 20 19:12:20 2011 (r222143) @@ -155,7 +155,8 @@ struct lltable { void (*llt_free)(struct lltable *, struct llentry *); void (*llt_prefix_free)(struct lltable *, const struct sockaddr *prefix, - const struct sockaddr *mask); + const struct sockaddr *mask, + u_int flags); struct llentry * (*llt_lookup)(struct lltable *, u_int flags, const struct sockaddr *l3addr); int (*llt_rtcheck)(struct ifnet *, u_int flags, @@ -184,7 +185,7 @@ MALLOC_DECLARE(M_LLTABLE); struct lltable *lltable_init(struct ifnet *, int); void lltable_free(struct lltable *); void lltable_prefix_free(int, struct sockaddr *, - struct sockaddr *); + struct sockaddr *, u_int); #if 0 void lltable_drain(int); #endif Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Fri May 20 18:27:13 2011 (r222142) +++ head/sys/netinet/in.c Fri May 20 19:12:20 2011 (r222143) @@ -70,7 +70,7 @@ static int in_lifaddr_ioctl(struct socke struct ifnet *, struct thread *); static int in_addprefix(struct in_ifaddr *, int); -static int in_scrubprefix(struct in_ifaddr *); +static int in_scrubprefix(struct in_ifaddr *, u_int); static void in_socktrim(struct sockaddr_in *); static int in_ifinit(struct ifnet *, struct in_ifaddr *, struct sockaddr_in *, int); @@ -548,7 +548,7 @@ in_control(struct socket *so, u_long cmd * is the same as before, then the call is * un-necessarily executed here. */ - in_ifscrub(ifp, ia); + in_ifscrub(ifp, ia, 0); ia->ia_sockmask = ifra->ifra_mask; ia->ia_sockmask.sin_family = AF_INET; ia->ia_subnetmask = @@ -557,7 +557,7 @@ in_control(struct socket *so, u_long cmd } if ((ifp->if_flags & IFF_POINTOPOINT) && (ifra->ifra_dstaddr.sin_family == AF_INET)) { - in_ifscrub(ifp, ia); + in_ifscrub(ifp, ia, 0); ia->ia_dstaddr = ifra->ifra_dstaddr; maskIsNew = 1; /* We lie; but the effect's the same */ } @@ -585,7 +585,7 @@ in_control(struct socket *so, u_long cmd /* * in_ifscrub kills the interface route. */ - in_ifscrub(ifp, ia); + in_ifscrub(ifp, ia, LLE_STATIC); /* * in_ifadown gets rid of all the rest of @@ -829,10 +829,10 @@ in_lifaddr_ioctl(struct socket *so, u_lo * Delete any existing route for an interface. */ void -in_ifscrub(struct ifnet *ifp, struct in_ifaddr *ia) +in_ifscrub(struct ifnet *ifp, struct in_ifaddr *ia, u_int flags) { - in_scrubprefix(ia); + in_scrubprefix(ia, flags); } /* @@ -887,7 +887,7 @@ in_ifinit(struct ifnet *ifp, struct in_i splx(s); if (scrub) { ia->ia_ifa.ifa_addr = (struct sockaddr *)&oldaddr; - in_ifscrub(ifp, ia); + in_ifscrub(ifp, ia, LLE_STATIC); ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr; } if (IN_CLASSA(i)) @@ -1095,7 +1095,7 @@ extern void arp_ifscrub(struct ifnet *if * otherwise. */ static int -in_scrubprefix(struct in_ifaddr *target) +in_scrubprefix(struct in_ifaddr *target, u_int flags) { struct in_ifaddr *ia; struct in_addr prefix, mask, p; @@ -1130,13 +1130,15 @@ in_scrubprefix(struct in_ifaddr *target) RT_REMREF(ia_ro.ro_rt); RTFREE_LOCKED(ia_ro.ro_rt); } - if (freeit) + if (freeit && (flags & LLE_STATIC)) { error = ifa_del_loopback_route((struct ifaddr *)target, (struct sockaddr *)&target->ia_addr); - if (error == 0) - target->ia_flags &= ~IFA_RTSELF; - /* remove arp cache */ - arp_ifscrub(target->ia_ifp, IA_SIN(target)->sin_addr.s_addr); + if (error == 0) + target->ia_flags &= ~IFA_RTSELF; + } + if (flags & LLE_STATIC) + /* remove arp cache */ + arp_ifscrub(target->ia_ifp, IA_SIN(target)->sin_addr.s_addr); } if (rtinitflags(target)) @@ -1203,7 +1205,7 @@ in_scrubprefix(struct in_ifaddr *target) mask0.sin_family = AF_INET; mask0.sin_addr.s_addr = target->ia_subnetmask; lltable_prefix_free(AF_INET, (struct sockaddr *)&prefix0, - (struct sockaddr *)&mask0); + (struct sockaddr *)&mask0, flags); /* * As no-one seem to have this prefix, we can remove the route. @@ -1362,7 +1364,8 @@ in_lltable_free(struct lltable *llt, str static void in_lltable_prefix_free(struct lltable *llt, const struct sockaddr *prefix, - const struct sockaddr *mask) + const struct sockaddr *mask, + u_int flags) { const struct sockaddr_in *pfx = (const struct sockaddr_in *)prefix; const struct sockaddr_in *msk = (const struct sockaddr_in *)mask; @@ -1373,8 +1376,13 @@ in_lltable_prefix_free(struct lltable *l for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) { + /* + * (flags & LLE_STATIC) means deleting all entries + * including static ARP entries + */ if (IN_ARE_MASKED_ADDR_EQUAL((struct sockaddr_in *)L3_ADDR(lle), - pfx, msk)) { + pfx, msk) && + ((flags & LLE_STATIC) || !(lle->la_flags & LLE_STATIC))) { int canceled; canceled = callout_drain(&lle->la_timer); Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Fri May 20 18:27:13 2011 (r222142) +++ head/sys/netinet/in_var.h Fri May 20 19:12:20 2011 (r222143) @@ -447,7 +447,7 @@ int in_control(struct socket *, u_long, void in_rtqdrain(void); void ip_input(struct mbuf *); int in_ifadown(struct ifaddr *ifa, int); -void in_ifscrub(struct ifnet *, struct in_ifaddr *); +void in_ifscrub(struct ifnet *, struct in_ifaddr *, u_int); struct mbuf *ip_fastforward(struct mbuf *); void *in_domifattach(struct ifnet *); void in_domifdetach(struct ifnet *, void *); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Fri May 20 18:27:13 2011 (r222142) +++ head/sys/netinet/raw_ip.c Fri May 20 19:12:20 2011 (r222143) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -721,7 +722,7 @@ rip_ctlinput(int cmd, struct sockaddr *s /* * in_ifscrub kills the interface route. */ - in_ifscrub(ia->ia_ifp, ia); + in_ifscrub(ia->ia_ifp, ia, 0); /* * in_ifadown gets rid of all the rest of the * routes. This is not quite the right thing @@ -756,12 +757,18 @@ rip_ctlinput(int cmd, struct sockaddr *s || (ifp->if_flags & IFF_POINTOPOINT)) flags |= RTF_HOST; + err = ifa_del_loopback_route((struct ifaddr *)ia, sa); + if (err == 0) + ia->ia_flags &= ~IFA_RTSELF; + err = rtinit(&ia->ia_ifa, RTM_ADD, flags); if (err == 0) ia->ia_flags |= IFA_ROUTE; + err = ifa_add_loopback_route((struct ifaddr *)ia, sa); if (err == 0) ia->ia_flags |= IFA_RTSELF; + ifa_free(&ia->ia_ifa); break; } Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Fri May 20 18:27:13 2011 (r222142) +++ head/sys/netinet6/in6.c Fri May 20 19:12:20 2011 (r222143) @@ -2376,19 +2376,25 @@ in6_lltable_free(struct lltable *llt, st static void in6_lltable_prefix_free(struct lltable *llt, const struct sockaddr *prefix, - const struct sockaddr *mask) + const struct sockaddr *mask, + u_int flags) { const struct sockaddr_in6 *pfx = (const struct sockaddr_in6 *)prefix; const struct sockaddr_in6 *msk = (const struct sockaddr_in6 *)mask; struct llentry *lle, *next; register int i; + /* + * (flags & LLE_STATIC) means deleting all entries + * including static ND6 entries + */ for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) { if (IN6_ARE_MASKED_ADDR_EQUAL( &((struct sockaddr_in6 *)L3_ADDR(lle))->sin6_addr, &pfx->sin6_addr, - &msk->sin6_addr)) { + &msk->sin6_addr) && + ((flags & LLE_STATIC) || !(lle->la_flags & LLE_STATIC))) { int canceled; canceled = callout_drain(&lle->la_timer); From owner-svn-src-head@FreeBSD.ORG Fri May 20 22:36:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98CB51065670; Fri, 20 May 2011 22:36:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FB408FC12; Fri, 20 May 2011 22:36:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KMaHoA003665; Fri, 20 May 2011 22:36:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KMaH28003661; Fri, 20 May 2011 22:36:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201105202236.p4KMaH28003661@svn.freebsd.org> From: Xin LI Date: Fri, 20 May 2011 22:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222152 - in head: share/man/man4 sys/dev/atkbdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 22:36:17 -0000 Author: delphij Date: Fri May 20 22:36:17 2011 New Revision: 222152 URL: http://svn.freebsd.org/changeset/base/222152 Log: Add a new knob to atkbd(4) to enable typematic rate detection on boot, which is now disabled by default. The detection is known to cause hangs on boot with some new Lenovo laptops on FreeBSD/amd64. Reported by: gnn Discussed with: jkim MFC after: 3 months Modified: head/share/man/man4/atkbd.4 head/sys/dev/atkbdc/atkbd.c head/sys/dev/atkbdc/atkbdreg.h Modified: head/share/man/man4/atkbd.4 ============================================================================== --- head/share/man/man4/atkbd.4 Fri May 20 22:24:26 2011 (r222151) +++ head/share/man/man4/atkbd.4 Fri May 20 22:36:17 2011 (r222152) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2008 +.Dd May 20, 2011 .Dt ATKBD 4 .Os .Sh NAME @@ -176,6 +176,11 @@ When this option is given, the .Nm driver will not test the keyboard port during the probe routine. Some machines hang during boot when this test is performed. +.It bit 4 (PROBE_TYPEMATIC) +When this option is given, the +.Nm +driver will try to probe the keyboard typematic rate on boot. +Some machines hang during boot when this test is performed. .El .\".Sh FILES .Sh EXAMPLES Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Fri May 20 22:24:26 2011 (r222151) +++ head/sys/dev/atkbdc/atkbd.c Fri May 20 22:36:17 2011 (r222152) @@ -1097,6 +1097,9 @@ get_typematic(keyboard_t *kbd) x86regs_t regs; uint8_t *p; + if (!(kbd->kb_config & KB_CONF_PROBE_TYPEMATIC)) + return (ENODEV); + if (x86bios_get_intr(0x15) == 0 || x86bios_get_intr(0x16) == 0) return (ENODEV); Modified: head/sys/dev/atkbdc/atkbdreg.h ============================================================================== --- head/sys/dev/atkbdc/atkbdreg.h Fri May 20 22:24:26 2011 (r222151) +++ head/sys/dev/atkbdc/atkbdreg.h Fri May 20 22:36:17 2011 (r222152) @@ -36,6 +36,7 @@ #define KB_CONF_NO_RESET (1 << 1) /* don't reset the keyboard */ #define KB_CONF_ALT_SCANCODESET (1 << 2) /* assume the XT type keyboard */ #define KB_CONF_NO_PROBE_TEST (1 << 3) /* don't test keyboard during probe */ +#define KB_CONF_PROBE_TYPEMATIC (1 << 4) /* probe keyboard typematic */ #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Fri May 20 22:55:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AAAD106566C; Fri, 20 May 2011 22:55:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 326768FC13; Fri, 20 May 2011 22:55:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KMtJrq004290; Fri, 20 May 2011 22:55:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KMtJGY004285; Fri, 20 May 2011 22:55:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105202255.p4KMtJGY004285@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 20 May 2011 22:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222154 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 22:55:19 -0000 Author: jilles Date: Fri May 20 22:55:18 2011 New Revision: 222154 URL: http://svn.freebsd.org/changeset/base/222154 Log: sh: Implement the cd -e flag proposed for the next POSIX issue. This reflects failure to determine the pathname of the new directory in the exit status (1). Normally, cd returns successfully if it did chdir() and the call was successful. In POSIX, -e only has meaning with -P; because our -L is not entirely compliant and may fall back to -P mode, -e has some effect with -L as well. Added: head/tools/regression/bin/sh/builtins/cd3.0 (contents, props changed) head/tools/regression/bin/sh/builtins/cd4.0 (contents, props changed) Modified: head/bin/sh/cd.c head/bin/sh/sh.1 Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Fri May 20 22:38:02 2011 (r222153) +++ head/bin/sh/cd.c Fri May 20 22:55:18 2011 (r222154) @@ -84,12 +84,16 @@ cdcmd(int argc, char **argv) const char *path; char *p; struct stat statb; - int ch, phys, print = 0; + int ch, phys, print = 0, getcwderr = 0; + int rc; optreset = 1; optind = 1; opterr = 0; /* initialize getopt */ phys = Pflag; - while ((ch = getopt(argc, argv, "LP")) != -1) { + while ((ch = getopt(argc, argv, "eLP")) != -1) { switch (ch) { + case 'e': + getcwderr = 1; + break; case 'L': phys = 0; break; @@ -131,8 +135,9 @@ cdcmd(int argc, char **argv) else print = strcmp(p, dest); } - if (docd(p, print, phys) >= 0) - return 0; + rc = docd(p, print, phys); + if (rc >= 0) + return getcwderr ? rc : 0; } } error("can't cd to %s", dest); @@ -148,17 +153,18 @@ cdcmd(int argc, char **argv) static int docd(char *dest, int print, int phys) { + int rc; TRACE(("docd(\"%s\", %d, %d) called\n", dest, print, phys)); /* If logical cd fails, fall back to physical. */ - if ((phys || cdlogical(dest) < 0) && cdphysical(dest) < 0) + if ((phys || (rc = cdlogical(dest)) < 0) && (rc = cdphysical(dest)) < 0) return (-1); if (print && iflag && curdir) out1fmt("%s\n", curdir); - return 0; + return (rc); } static int @@ -216,6 +222,7 @@ static int cdphysical(char *dest) { char *p; + int rc = 0; INTOFF; if (chdir(dest) < 0) { @@ -223,11 +230,13 @@ cdphysical(char *dest) return (-1); } p = findcwd(NULL); - if (p == NULL) + if (p == NULL) { warning("warning: failed to get name of current directory"); + rc = 1; + } updatepwd(p); INTON; - return (0); + return (rc); } /* Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri May 20 22:38:02 2011 (r222153) +++ head/bin/sh/sh.1 Fri May 20 22:55:18 2011 (r222154) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd May 8, 2011 +.Dd May 20, 2011 .Dt SH 1 .Os .Sh NAME @@ -1729,7 +1729,7 @@ Execute the specified built-in command, .Ar cmd . This is useful when the user wishes to override a shell function with the same name as a built-in command. -.It Ic cd Oo Fl L | P Oc Op Ar directory +.It Ic cd Oo Fl L | P Oc Oo Fl e Oc Op Ar directory Switch to the specified .Ar directory , or to the directory specified in the @@ -1778,6 +1778,15 @@ option is specified, .Pa .. is handled logically. This is the default. +.Pp +The +.Fl e +option causes +.Ic cd +to return exit status 1 if the full pathname of the new directory +cannot be determined reliably or at all. +Normally this is not considered an error, +although a warning is printed. .It Ic chdir A synonym for the .Ic cd Added: head/tools/regression/bin/sh/builtins/cd3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/cd3.0 Fri May 20 22:55:18 2011 (r222154) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +# If fully successful, cd -Pe must be like cd -P. + +set -e + +cd "${TMPDIR:-/tmp}" +cd -Pe / +[ "$PWD" = / ] +[ "$(pwd)" = / ] +cd "${TMPDIR:-/tmp}" +cd -eP / +[ "$PWD" = / ] +[ "$(pwd)" = / ] + +set +e + +# If cd -Pe cannot chdir, the exit status must be greater than 1. + +v=$( (cd -Pe /var/empty/nonexistent) 2>&1 >/dev/null) +[ $? -gt 1 ] && [ -n "$v" ] Added: head/tools/regression/bin/sh/builtins/cd4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/cd4.0 Fri May 20 22:55:18 2011 (r222154) @@ -0,0 +1,38 @@ +# $FreeBSD$ + +# This test assumes that whatever mechanism cd -P uses to determine the +# pathname to the current directory if it is longer than PATH_MAX requires +# read permission on all parent directories. It also works if this +# requirement always applies. + +set -e +L=$(getconf PATH_MAX / 2>/dev/null) || L=4096 +[ "$L" -lt 100000 ] 2>/dev/null || L=4096 +L=$((L+100)) +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +trap 'chmod u+r ${T}; rm -rf ${T}' 0 +cd -Pe $T +D=$(pwd) +chmod u-r "$D" +if [ -r "$D" ]; then + # Running as root, cannot test. + exit 0 +fi +set +e +while [ ${#D} -lt $L ]; do + mkdir veryverylongdirectoryname || exit + cd -Pe veryverylongdirectoryname 2>/dev/null + r=$? + [ $r -gt 1 ] && exit $r + if [ $r -eq 1 ]; then + # Verify that the directory was changed correctly. + cd -Pe .. || exit + [ "$(pwd)" = "$D" ] || exit + # Verify that omitting -e results in success. + cd -P veryverylongdirectoryname 2>/dev/null || exit + exit 0 + fi + D=$D/veryverylongdirectoryname +done +echo "cd -Pe never returned 1" +exit 0 From owner-svn-src-head@FreeBSD.ORG Sat May 21 09:23:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A6B4106566B; Sat, 21 May 2011 09:23:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A5388FC08; Sat, 21 May 2011 09:23:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4L9NImf022995; Sat, 21 May 2011 09:23:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4L9NILL022992; Sat, 21 May 2011 09:23:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105210923.p4L9NILL022992@svn.freebsd.org> From: Adrian Chadd Date: Sat, 21 May 2011 09:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222157 - in head/sys/dev/ath/ath_hal: . ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 09:23:19 -0000 Author: adrian Date: Sat May 21 09:23:18 2011 New Revision: 222157 URL: http://svn.freebsd.org/changeset/base/222157 Log: The Merlin analog register bank is from 0x7800 -> 0x78fc; fix the code to reflect this. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Sat May 21 01:44:13 2011 (r222156) +++ head/sys/dev/ath/ath_hal/ah.c Sat May 21 09:23:18 2011 (r222157) @@ -1069,7 +1069,7 @@ ath_hal_ini_write(struct ath_hal *ah, co HAL_INI_VAL(ia, r, col)); /* Analog shift register delay seems needed for Merlin - PR kern/154220 */ - if (HAL_INI_VAL(ia, r, 0) >= 0x7800 && HAL_INI_VAL(ia, r, 0) < 0x78a0) + if (HAL_INI_VAL(ia, r, 0) >= 0x7800 && HAL_INI_VAL(ia, r, 0) < 0x7900) OS_DELAY(100); DMA_YIELD(regWr); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat May 21 01:44:13 2011 (r222156) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat May 21 09:23:18 2011 (r222157) @@ -430,7 +430,7 @@ ar9280WriteIni(struct ath_hal *ah, const OS_REG_WRITE(ah, reg, val); /* Analog shift register delay seems needed for Merlin - PR kern/154220 */ - if (reg >= 0x7800 && reg < 0x78a0) + if (reg >= 0x7800 && reg < 0x7900) OS_DELAY(100); DMA_YIELD(regWrites); From owner-svn-src-head@FreeBSD.ORG Sat May 21 14:52:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD241065675; Sat, 21 May 2011 14:52:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A9B18FC13; Sat, 21 May 2011 14:52:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4LEqRe4034306; Sat, 21 May 2011 14:52:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4LEqRLw034305; Sat, 21 May 2011 14:52:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105211452.p4LEqRLw034305@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 21 May 2011 14:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222158 - head/tools/regression/bin/sh/parameters X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 14:52:27 -0000 Author: jilles Date: Sat May 21 14:52:26 2011 New Revision: 222158 URL: http://svn.freebsd.org/changeset/base/222158 Log: sh: Add test for positional parameters with more than one digit. This also passes on stable/8. Added: head/tools/regression/bin/sh/parameters/positional1.0 (contents, props changed) Added: head/tools/regression/bin/sh/parameters/positional1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parameters/positional1.0 Sat May 21 14:52:26 2011 (r222158) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +set -- a b c d e f g h i j +[ "$1" = a ] || echo "error at line $LINENO" +[ "${1}" = a ] || echo "error at line $LINENO" +[ "${1-foo}" = a ] || echo "error at line $LINENO" +[ "${1+foo}" = foo ] || echo "error at line $LINENO" +[ "$1+foo" = a+foo ] || echo "error at line $LINENO" +[ "$10" = a0 ] || echo "error at line $LINENO" +[ "$100" = a00 ] || echo "error at line $LINENO" +[ "${10}" = j ] || echo "error at line $LINENO" +[ "${10-foo}" = j ] || echo "error at line $LINENO" +[ "${100-foo}" = foo ] || echo "error at line $LINENO" From owner-svn-src-head@FreeBSD.ORG Sat May 21 16:34:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 158821065673; Sat, 21 May 2011 16:34:54 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05F338FC16; Sat, 21 May 2011 16:34:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4LGYrK1037480; Sat, 21 May 2011 16:34:53 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4LGYrdx037478; Sat, 21 May 2011 16:34:53 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105211634.p4LGYrdx037478@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 21 May 2011 16:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222161 - head/sys/modules/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 16:34:54 -0000 Author: bschmidt Date: Sat May 21 16:34:53 2011 New Revision: 222161 URL: http://svn.freebsd.org/changeset/base/222161 Log: Fix a typo, it is MPDU not MDPU. Modified: head/sys/modules/wlan/Makefile Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Sat May 21 16:17:39 2011 (r222160) +++ head/sys/modules/wlan/Makefile Sat May 21 16:34:53 2011 (r222161) @@ -18,7 +18,7 @@ SRCS+= bus_if.h device_if.h opt_inet.h o .if !defined(KERNBUILDDIR) opt_wlan.h: echo "#define IEEE80211_DEBUG 1" > ${.TARGET} - echo "#define IEEE80211_AMDPU_AGE 1" >> ${.TARGET} + echo "#define IEEE80211_AMPDU_AGE 1" >> ${.TARGET} echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET} opt_inet.h: echo "#define INET 1" > ${.TARGET} From owner-svn-src-head@FreeBSD.ORG Sat May 21 16:41:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1791E1065670; Sat, 21 May 2011 16:41:42 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0842F8FC0A; Sat, 21 May 2011 16:41:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4LGffaN037699; Sat, 21 May 2011 16:41:41 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4LGffLB037697; Sat, 21 May 2011 16:41:41 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105211641.p4LGffLB037697@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 21 May 2011 16:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222162 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 16:41:42 -0000 Author: bschmidt Date: Sat May 21 16:41:41 2011 New Revision: 222162 URL: http://svn.freebsd.org/changeset/base/222162 Log: Fix typo, it is MPDU not MDPU. Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat May 21 16:34:53 2011 (r222161) +++ head/sys/net80211/ieee80211_var.h Sat May 21 16:41:41 2011 (r222162) @@ -578,7 +578,7 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FHT_BITS \ "\20\1NONHT_PR" \ - "\23GF\24HT\25AMDPU_TX\26AMPDU_TX" \ + "\23GF\24HT\25AMPDU_TX\26AMPDU_TX" \ "\27AMSDU_TX\30AMSDU_RX\31USEHT40\32PUREN\33SHORTGI20\34SHORTGI40" \ "\35HTCOMPAT\36RIFS\37STBC_TX\40STBC_RX" From owner-svn-src-head@FreeBSD.ORG Sat May 21 17:43:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B151106566C; Sat, 21 May 2011 17:43:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BE558FC08; Sat, 21 May 2011 17:43:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4LHhh03039505; Sat, 21 May 2011 17:43:43 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4LHhhwe039502; Sat, 21 May 2011 17:43:43 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201105211743.p4LHhhwe039502@svn.freebsd.org> From: Alan Cox Date: Sat, 21 May 2011 17:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222163 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 17:43:43 -0000 Author: alc Date: Sat May 21 17:43:43 2011 New Revision: 222163 URL: http://svn.freebsd.org/changeset/base/222163 Log: 1. Prior to r214782, UMA did not support multipage allocations before uma_startup2() was called. Thus, setting the variable "booted" to true in uma_startup() was ok on machines with UMA_MD_SMALL_ALLOC defined, because any allocations made after uma_startup() but before uma_startup2() could be satisfied by uma_small_alloc(). Now, however, some multipage allocations are necessary before uma_startup2() just to allocate zone structures on machines with a large number of processors. Thus, a Boolean can no longer effectively describe the state of the UMA allocator. Instead, make "booted" have three values to describe how far initialization has progressed. This allows multipage allocations to continue using startup_alloc() until uma_startup2(), but single-page allocations may begin using uma_small_alloc() after uma_startup(). 2. With the aforementioned change, only a modest increase in boot pages is necessary to boot UMA on a large number of processors. 3. Retire UMA_MD_SMALL_ALLOC_NEEDS_VM. It has only been used between r182028 and r204128. Reviewed by: attilio [1], nwhitehorn [3] Tested by: sbruno Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat May 21 16:41:41 2011 (r222162) +++ head/sys/vm/uma_core.c Sat May 21 17:43:43 2011 (r222163) @@ -134,6 +134,8 @@ static struct mtx uma_boot_pages_mtx; /* Is the VM done starting up? */ static int booted = 0; +#define UMA_STARTUP 1 +#define UMA_STARTUP2 2 /* Maximum number of allowed items-per-slab if the slab header is OFFPAGE */ static u_int uma_max_ipers; @@ -959,7 +961,7 @@ startup_alloc(uma_zone_t zone, int bytes return (tmps->us_data); } mtx_unlock(&uma_boot_pages_mtx); - if (booted == 0) + if (booted < UMA_STARTUP2) panic("UMA: Increase vm.boot_pages"); /* * Now that we've booted reset these users to their real allocator. @@ -1317,9 +1319,10 @@ keg_ctor(void *mem, int size, void *udat keg->uk_allocf = uma_small_alloc; keg->uk_freef = uma_small_free; #endif - if (booted == 0) + if (booted < UMA_STARTUP) keg->uk_allocf = startup_alloc; - } else if (booted == 0 && (keg->uk_flags & UMA_ZFLAG_INTERNAL)) + } else if (booted < UMA_STARTUP2 && + (keg->uk_flags & UMA_ZFLAG_INTERNAL)) keg->uk_allocf = startup_alloc; /* @@ -1752,9 +1755,7 @@ uma_startup(void *bootmem, int boot_page bucket_init(); -#if defined(UMA_MD_SMALL_ALLOC) && !defined(UMA_MD_SMALL_ALLOC_NEEDS_VM) - booted = 1; -#endif + booted = UMA_STARTUP; #ifdef UMA_DEBUG printf("UMA startup complete.\n"); @@ -1765,7 +1766,7 @@ uma_startup(void *bootmem, int boot_page void uma_startup2(void) { - booted = 1; + booted = UMA_STARTUP2; bucket_enable(); #ifdef UMA_DEBUG printf("UMA startup2 complete.\n"); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Sat May 21 16:41:41 2011 (r222162) +++ head/sys/vm/uma_int.h Sat May 21 17:43:43 2011 (r222163) @@ -118,7 +118,7 @@ #define UMA_SLAB_MASK (PAGE_SIZE - 1) /* Mask to get back to the page */ #define UMA_SLAB_SHIFT PAGE_SHIFT /* Number of bits PAGE_MASK */ -#define UMA_BOOT_PAGES 48 /* Pages allocated for startup */ +#define UMA_BOOT_PAGES 64 /* Pages allocated for startup */ /* Max waste before going to off page slab management */ #define UMA_MAX_WASTE (UMA_SLAB_SIZE / 10) From owner-svn-src-head@FreeBSD.ORG Sat May 21 18:12:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DA5E106564A; Sat, 21 May 2011 18:12:44 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id DB6C58FC08; Sat, 21 May 2011 18:12:43 +0000 (UTC) Received: by gwb15 with SMTP id 15so2121746gwb.13 for ; Sat, 21 May 2011 11:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=J6VzmTOaoCS40fMaoEeZUxcMHMVNfV+Fn5YLaR4hsGU=; b=aDYwPDZaOq/pzffzcWMiEvMBhiAIkzZ5ezqyRug+PcW6WzdFN0MVZqfntlxOjhcYNG k0dIsGcEyLbwgf+nOjAAPXJYXy1STn/XhwY8LShf1PBaGTCa3+bsqqjKIW36vQqePnVO HN2gk71s5Kve8d1XyMPOkc/kQAt/cgjxLHkfE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=UFI2fRMsERE1axmcFx05Q4USRpmHGWi1dzxzmZVwijw7mvCiU1omFO9vDPrpvqv3eG +Z9A6ZhnJQ0nrv7xvB5aEGrKJKErAX+uKwdFxHEPBWm8b1PTK7FrTnAE+RwpHXad70IN 7GrUsCdQE10pi1XDSK3k4LITjlr1/M8G785+A= MIME-Version: 1.0 Received: by 10.236.183.193 with SMTP id q41mr914260yhm.80.1306001563054; Sat, 21 May 2011 11:12:43 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.103.130 with HTTP; Sat, 21 May 2011 11:12:43 -0700 (PDT) In-Reply-To: <201105211743.p4LHhhwe039502@svn.freebsd.org> References: <201105211743.p4LHhhwe039502@svn.freebsd.org> Date: Sat, 21 May 2011 20:12:43 +0200 X-Google-Sender-Auth: 4hBhvgVHVydsb1ramdIQ2b506MM Message-ID: From: Attilio Rao To: Alan Cox Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222163 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 18:12:44 -0000 2011/5/21 Alan Cox : > Author: alc > Date: Sat May 21 17:43:43 2011 > New Revision: 222163 > URL: http://svn.freebsd.org/changeset/base/222163 > > Log: > =C2=A01. Prior to r214782, UMA did not support multipage allocations befo= re > =C2=A0uma_startup2() was called. =C2=A0Thus, setting the variable "booted= " to true in > =C2=A0uma_startup() was ok on machines with UMA_MD_SMALL_ALLOC defined, b= ecause > =C2=A0any allocations made after uma_startup() but before uma_startup2() = could be > =C2=A0satisfied by uma_small_alloc(). =C2=A0Now, however, some multipage = allocations > =C2=A0are necessary before uma_startup2() just to allocate zone structure= s on > =C2=A0machines with a large number of processors. =C2=A0Thus, a Boolean c= an no longer > =C2=A0effectively describe the state of the UMA allocator. =C2=A0Instead,= make "booted" > =C2=A0have three values to describe how far initialization has progressed= . =C2=A0This > =C2=A0allows multipage allocations to continue using startup_alloc() unti= l > =C2=A0uma_startup2(), but single-page allocations may begin using > =C2=A0uma_small_alloc() after uma_startup(). Thanks. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sat May 21 18:53:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 15F761065672; Sat, 21 May 2011 18:53:26 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 7FD3814FB80; Sat, 21 May 2011 18:53:23 +0000 (UTC) Message-ID: <4DD80A22.3090300@FreeBSD.org> Date: Sat, 21 May 2011 11:53:22 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: Sergey Kandaurov References: <201105201703.p4KH3NrR093036@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222136 - head/usr.bin/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 18:53:26 -0000 On 05/20/2011 10:09, Sergey Kandaurov wrote: > There's still a lot of warnings but all of them reside in contrib part. That doesn't mean that they shouldn't be fixed. :) The great thing about the way that the contrib sources are arranged in svn is that we can fix things in src/contrib with no concern to any "costs" imposed by the VCS. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat May 21 20:21:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7904106566C; Sat, 21 May 2011 20:21:20 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FB018FC13; Sat, 21 May 2011 20:21:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4LKLKUq044217; Sat, 21 May 2011 20:21:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4LKLK0E044215; Sat, 21 May 2011 20:21:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105212021.p4LKLK0E044215@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 21 May 2011 20:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222164 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 20:21:20 -0000 Author: pjd Date: Sat May 21 20:21:20 2011 New Revision: 222164 URL: http://svn.freebsd.org/changeset/base/222164 Log: Recognize HIO_FLUSH requests. MFC after: 1 week Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Sat May 21 17:43:43 2011 (r222163) +++ head/sbin/hastd/secondary.c Sat May 21 20:21:20 2011 (r222164) @@ -514,6 +514,7 @@ requnpack(struct hast_resource *res, str goto end; } switch (hio->hio_cmd) { + case HIO_FLUSH: case HIO_KEEPALIVE: break; case HIO_READ: From owner-svn-src-head@FreeBSD.ORG Sat May 21 22:03:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25741106564A; Sat, 21 May 2011 22:03:07 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BD9C8FC13; Sat, 21 May 2011 22:03:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4LM36Rn047165; Sat, 21 May 2011 22:03:06 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4LM362v047158; Sat, 21 May 2011 22:03:06 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105212203.p4LM362v047158@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 21 May 2011 22:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222165 - in head: bin/sh tools/regression/bin/sh/parser X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 22:03:07 -0000 Author: jilles Date: Sat May 21 22:03:06 2011 New Revision: 222165 URL: http://svn.freebsd.org/changeset/base/222165 Log: sh: Expand aliases after assignments and redirections. Added: head/tools/regression/bin/sh/parser/alias4.0 (contents, props changed) head/tools/regression/bin/sh/parser/alias5.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/parser.c head/bin/sh/parser.h head/bin/sh/sh.1 Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sat May 21 20:21:20 2011 (r222164) +++ head/bin/sh/eval.c Sat May 21 22:03:06 2011 (r222165) @@ -714,15 +714,9 @@ evalcommand(union node *cmd, int flags, oexitstatus = exitstatus; exitstatus = 0; for (argp = cmd->ncmd.args ; argp ; argp = argp->narg.next) { - char *p = argp->narg.text; - if (varflag && is_name(*p)) { - do { - p++; - } while (is_in_name(*p)); - if (*p == '=') { - expandarg(argp, &varlist, EXP_VARTILDE); - continue; - } + if (varflag && isassignment(argp->narg.text)) { + expandarg(argp, &varlist, EXP_VARTILDE); + continue; } expandarg(argp, &arglist, EXP_FULL | EXP_TILDE); varflag = 0; Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sat May 21 20:21:20 2011 (r222164) +++ head/bin/sh/parser.c Sat May 21 22:03:06 2011 (r222165) @@ -619,6 +619,7 @@ simplecmd(union node **rpp, union node * union node **orig_rpp = rpp; union node *n = NULL; int special; + int savecheckkwd; /* If we don't have any redirections already, then we must reset */ /* rpp to be the address of the local redir variable. */ @@ -634,7 +635,10 @@ simplecmd(union node **rpp, union node * */ orig_rpp = rpp; + savecheckkwd = CHKALIAS; + for (;;) { + checkkwd = savecheckkwd; if (readtoken() == TWORD) { n = (union node *)stalloc(sizeof (struct narg)); n->type = NARG; @@ -642,6 +646,8 @@ simplecmd(union node **rpp, union node * n->narg.backquote = backquotelist; *app = n; app = &n->narg.next; + if (savecheckkwd != 0 && !isassignment(wordtext)) + savecheckkwd = 0; } else if (lasttoken == TREDIR) { *rpp = n = redirnode; rpp = &n->nfile.next; @@ -1859,6 +1865,22 @@ goodname(const char *name) } +int +isassignment(const char *p) +{ + if (!is_name(*p)) + return 0; + p++; + for (;;) { + if (*p == '=') + return 1; + else if (!is_in_name(*p)) + return 0; + p++; + } +} + + /* * Called when an unexpected token is read during the parse. The argument * is the token that is expected, or -1 if more than one type of token can Modified: head/bin/sh/parser.h ============================================================================== --- head/bin/sh/parser.h Sat May 21 20:21:20 2011 (r222164) +++ head/bin/sh/parser.h Sat May 21 22:03:06 2011 (r222165) @@ -80,4 +80,5 @@ extern const char *const parsekwd[]; union node *parsecmd(int); void fixredir(union node *, const char *, int); int goodname(const char *); +int isassignment(const char *); char *getprompt(void *); Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sat May 21 20:21:20 2011 (r222164) +++ head/bin/sh/sh.1 Sat May 21 22:03:06 2011 (r222165) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd May 20, 2011 +.Dd May 21, 2011 .Dt SH 1 .Os .Sh NAME @@ -506,8 +506,8 @@ The following are keywords: An alias is a name and corresponding value set using the .Ic alias built-in command. -Whenever a keyword may occur (see above), -and after checking for keywords, the shell +Wherever the command word of a simple command may occur, +and after checking for keywords if a keyword may occur, the shell checks the word to see if it matches an alias. If it does, it replaces it in the input stream with its value. For example, if there is an alias called Added: head/tools/regression/bin/sh/parser/alias4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias4.0 Sat May 21 22:03:06 2011 (r222165) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +alias alias0=exit +eval 'x=1 alias0 0' +exit 1 Added: head/tools/regression/bin/sh/parser/alias5.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias5.0 Sat May 21 22:03:06 2011 (r222165) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +alias alias0=exit +eval ' Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43B8E106564A; Sat, 21 May 2011 22:26:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1FD618FC0C; Sat, 21 May 2011 22:26:37 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id CA05646B06; Sat, 21 May 2011 18:26:36 -0400 (EDT) Date: Sat, 21 May 2011 23:26:36 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: <201011121305.oACD5Htm009484@svn.freebsd.org> Message-ID: References: <201011121305.oACD5Htm009484@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215179 - in head: sbin/ipfw sys/netinet sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 22:26:37 -0000 On Fri, 12 Nov 2010, Luigi Rizzo wrote: > --- head/sys/netinet/ipfw/ip_fw2.c Fri Nov 12 13:02:26 2010 (r215178) > +++ head/sys/netinet/ipfw/ip_fw2.c Fri Nov 12 13:05:17 2010 (r215179) > @@ -1801,6 +1801,39 @@ do { \ ... > + /* For incomming packet, lookup up the > + inpcb using the src/dest ip/port tuple */ > + if (inp == NULL) { > + INP_INFO_RLOCK(pi); > + inp = in_pcblookup_hash(pi, > + src_ip, htons(src_port), > + dst_ip, htons(dst_port), > + 0, NULL); > + INP_INFO_RUNLOCK(pi); > + } > + > + if (inp && inp->inp_socket) { > + tablearg = inp->inp_socket->so_user_cookie; > + if (tablearg) > + match = 1; > + } This locking seems questionable -- what keeps 'inp' valid between INP_INFO_RUNLOCK(pi) and dereferencing 'inp' a few lines later to extract 'tablearg'? Normally, consumer code locks 'inp' after looking it up. (In my new version of the code, the caller can request it be returned locked, or simply referenced, which changes the function signature, hence my bumping into this while doing a merge forward). Robert From owner-svn-src-head@FreeBSD.ORG Sat May 21 22:30:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 412D41065672; Sat, 21 May 2011 22:30:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 182E88FC08; Sat, 21 May 2011 22:30:01 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id C1D6A46B2A; Sat, 21 May 2011 18:30:00 -0400 (EDT) Date: Sat, 21 May 2011 23:30:00 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: <201011121302.oACD2Qjt009385@svn.freebsd.org> Message-ID: References: <201011121302.oACD2Qjt009385@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215178 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 22:30:01 -0000 On Fri, 12 Nov 2010, Luigi Rizzo wrote: > Modified: head/sys/sys/socketvar.h > ============================================================================== > --- head/sys/sys/socketvar.h Fri Nov 12 12:48:41 2010 (r215177) > +++ head/sys/sys/socketvar.h Fri Nov 12 13:02:26 2010 (r215178) > @@ -117,7 +117,14 @@ struct socket { > void *so_accept_filter_arg; /* saved filter args */ > char *so_accept_filter_str; /* saved user args */ > } *so_accf; > + /* > + * so_fibnum, so_user_cookie and friends can be used to attach > + * some user-specified metadata to a socket, which then can be > + * used by the kernel for various actions. > + * so_user_cookie is used by ipfw/dummynet. > + */ > int so_fibnum; /* routing domain for this socket */ > + uint32_t so_user_cookie; > }; This seems like it should be an inpcb-layer field, set by an IP-layer socket option, not a socket-layer field. Remember that, in some cases, we have inpcb's floating around without sockets, if the socket has been closed but TCP is still winding down (such as in TCPS_TIMEWAIT, where we've discarded not only the socket, but also the tcpcb, and substituted a tcptw). In fact, the code I pointed at in my previous e-mail will probably panic in that case, since it improperly dereferences the inpcb's socket field without first testing for NULL. Robert From owner-svn-src-head@FreeBSD.ORG Sat May 21 22:31:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51E821065672; Sat, 21 May 2011 22:31:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2DBFF8FC16; Sat, 21 May 2011 22:31:27 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id C1FE946B06; Sat, 21 May 2011 18:31:26 -0400 (EDT) Date: Sat, 21 May 2011 23:31:26 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: Message-ID: References: <201011121302.oACD2Qjt009385@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215178 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 22:31:27 -0000 On Sat, 21 May 2011, Robert Watson wrote: > In fact, the code I pointed at in my previous e-mail will probably panic in > that case, since it improperly dereferences the inpcb's socket field without > first testing for NULL. Or, looking more closely, only because the locking is broken, as it does test inp_socket. However, it really shouldn't need to -- we try quite hard never to dereference inp_socket in the firewall code for this reason. Hence, among other things, propagating so_cred down as inp_cred. Robert