From owner-svn-src-all@freebsd.org Sun Jan 3 00:28:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D14E2A530C5 for ; Sun, 3 Jan 2016 00:28:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A74691D9D for ; Sun, 3 Jan 2016 00:28:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sun, 3 Jan 2016 00:29:26 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id u030StfE026951; Sat, 2 Jan 2016 17:28:55 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1451780934.1369.129.camel@freebsd.org> Subject: Re: svn commit: r293064 - head/sys/boot/uboot/lib From: Ian Lepore To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 02 Jan 2016 17:28:54 -0700 In-Reply-To: <20160103101219.C1033@besplex.bde.org> References: <201601022255.u02Mtxe4043921@repo.freebsd.org> <20160103101219.C1033@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 00:28:58 -0000 On Sun, 2016-01-03 at 10:59 +1100, Bruce Evans wrote: > On Sat, 2 Jan 2016, Ian Lepore wrote: > > > Log: > > Cast pointer through uintptr_t on the way to uint64_t to squelch a warning. > > > > Modified: head/sys/boot/uboot/lib/copy.c > > ============================================================================== > > --- head/sys/boot/uboot/lib/copy.c Sat Jan 2 22:31:14 2016 (r293063) > > +++ head/sys/boot/uboot/lib/copy.c Sat Jan 2 22:55:59 2016 (r293064) > > @@ -100,7 +100,7 @@ uboot_loadaddr(u_int type, void *data, u > > > > biggest_block = 0; > > biggest_size = 0; > > - subldr = rounddown2((uint64_t)_start, KERN_ALIGN); > > + subldr = rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN); > > eubldr = roundup2((uint64_t)uboot_heap_end, KERN_ALIGN); > > for (i = 0; i < si->mr_no; i++) { > > if (si->mr[i].flags != MR_ATTR_DRAM) > > This gives 1 more bogus cast here: > - _start is a function pointer, so it should be cast to uintfptr_t > - rounddown2() acts on any integer and subldr is an integer, and both of the > integers are unsigned, and KERN_ALIGN is a small signed int, and so there > is no need for any further cast, except possibily on arches with > uintfptr_t larger than uint64_t or the type of subldr where the compiler > warns about downwards cast, but then the downcast may be a bug since it > just breaks the warning > > - if there is a need for a further cast, then it should be of rounddown2(), > not of one of its args, so that the args and the internals of rounddown2() > don't have to be analysed for promotions. I did some of did analysis > above -- KERN_ALIGN is a small int, so its promotion is int and that is > presumably smaller than uintfptr_t. > > rounddown2() is of course undocumented, but everyone knows that macros > like it are supposed to mix the args without any casts and end up with > a type related to the arg types. > > - subldr actually has type uintptr_t, so the old cast to uint64_t was > just a double type mismatch (mismatched with both the source and target) > and leaving it makes it just change the correct type to a wrong one > before converting back to the correct type. Since you cast to uintptr_t > and not uintfptr_t and KERN_ALIGN is small int, the rvalue would already > have the same type as the lvalue unless it is messed up by the uint64_t > cast. > > - not quite similarly on the next line: > - the lvalue has type uintptr_t > - casting to uint64_t is wrong, as in the new version of the previous > line. uboot_heap_end already has type uintptr_t, and casting it to > uint64_t just breaks it or complicates the analysis: > - if uintptr_t is 64 bits, then casting to uint64_t has no effect > - if uintptr_t is 128 bits, then casting to uint64_t just breaks things > - if uintptr_t is 32, bits, then casting to uint64_t doesn't even > break things. > > There is an overflow problem in theory, but the bogus cast doesn't > fix the problem. roundup2() normally overflows if the address is > at a nonzero offset on the last "page" (of size KERN_ALIGN bytes > here). Then roundup2() should overflow to 0. On 32-bit arches, > the bogus cast avoids the overflow and gives a result of > 0x100000000. But since the rvalue has type uintptr_t, it cannot > represent this result, and the value overflows to 0 on assignment > instead of in roundup2(). > > roundup2() and its overflow problems are of course undocumented. > This analysis is at least partly wrong because you've missed the fact that the prior commit (that caused the warning I had to fix) changed the type of subldr, eubdlr, and friends to uint64_t. With the uintptr_t types, the theoretical overflow you mention was in fact an actual overflow on 32-bit hardware people use, which is why I'm fixing it (however ineptly). So while a rigorous analysis would have to conclude that rounddown2() can't create the overflow and thus the cast of its arg to 64 bits is unneeded, I wasn't really thinking that way at the time so I just cast the args in both of the rounding invocations to 64 bits. I had no idea there was such a thing as uintfptr_t, it does seem like that's the right one to use on _start. -- Ian From owner-svn-src-all@freebsd.org Sun Jan 3 01:24:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F0D1A5F10F; Sun, 3 Jan 2016 01:24:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 955C7147B; Sun, 3 Jan 2016 01:24:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 24C931045F9D; Sun, 3 Jan 2016 12:24:45 +1100 (AEDT) Date: Sun, 3 Jan 2016 12:24:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293053 - head/sys/boot/uboot/lib In-Reply-To: <201601021816.u02IGOXQ060620@repo.freebsd.org> Message-ID: <20160103112530.Q1220@besplex.bde.org> References: <201601021816.u02IGOXQ060620@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=uh6MPLOrl7Xpo6US5dgA:9 a=9R64MTe1H_08cVun:21 a=cwHEBaPuE8GakeBG:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 01:24:53 -0000 On Sat, 2 Jan 2016, Ian Lepore wrote: > Log: > Use 64-bit math when finding a block of ram to hold the kernel. This fixes > a problem on 32-bit systems which have ram occupying the end of the physical > address space -- for example, a block of ram at 0x80000000 with a size of > 0x80000000 was overflowing 32 bit math and ending up with a calculated size > of zero. > > This is a fix for one of the two problems mentioned in the PR. Something > similar will need to be done on the kernel side before the PR is closed. I don't like this. It gives a type morass, and has no effect if uintptr_t has 64 bits, and is just broken when uintptr_t has more that 64-bits. The corresponding hack for 64-bit arches is to use uint128_t, and for 128-bit arches to use uint256_t, and that is more obviously excessive and more likely to expose type errors (for example, __uint128_t compiles, but is unprintable since printf() hasn't dreamed of its existence yet, and its existence breaks uintmax_t since it is larger than uintmax_t). I see that you committed related changes in many places. Only the one in arm/physmem.c looks right -- don't change types, but handle the top page specially. I once looked at vm to see how it handles this. It seemed to use (offset, size) pairs a lot where it would simpler to use offset+size except for the problem that this would overflow. This would avoid most problems with the top page. Eventually I decided that it didn't really care about the top page but was just doing this because it was over-engineered. > Modified: head/sys/boot/uboot/lib/copy.c > ============================================================================== > --- head/sys/boot/uboot/lib/copy.c Sat Jan 2 18:15:10 2016 (r293052) > +++ head/sys/boot/uboot/lib/copy.c Sat Jan 2 18:16:24 2016 (r293053) > @@ -69,11 +69,11 @@ uint64_t > uboot_loadaddr(u_int type, void *data, uint64_t addr) > { > struct sys_info *si; > - uintptr_t sblock, eblock, subldr, eubldr; > - uintptr_t biggest_block, this_block; > - size_t biggest_size, this_size; > + uint64_t sblock, eblock, subldr, eubldr; > + uint64_t biggest_block, this_block; > + uint64_t biggest_size, this_size; This obviously breaks the 128-bit case. I replied out of order about a fixup for the type morass created by this, and said that subldr and euldr have type uintptr_t. They only had this correct (less incorrect) type before this change. Making everything 64-bit mostly avoids the type morass but gives a lot of bloat in the 32-bit case. It doesn't completely avoid the type morass since sizeof() still gives type uint32_t in the 32-bit case. > @@ -100,14 +100,15 @@ uboot_loadaddr(u_int type, void *data, u > > biggest_block = 0; > biggest_size = 0; > - subldr = rounddown2((uintptr_t)_start, KERN_ALIGN); My previous reply was about this. This was correct except for using uintptr_t instead of uintfptr_t. > - eubldr = roundup2(uboot_heap_end, KERN_ALIGN); > + subldr = rounddown2((uint64_t)_start, KERN_ALIGN); This has various type errors -- see previous reply. > + eubldr = roundup2((uint64_t)uboot_heap_end, KERN_ALIGN); Most of the uintptr_t types were also wrong. vm_offset_t or vm_addr_t or vm_paddr_t or vm_size_t would be better (I think the boot code is low enough level to use these instead of Standard "portable" types). Except vm_addr_t doesn't exist. vm has its own type morass, but not enough complications to express the difference beteen offsets and addresses in the type (virtual addresses have to abuse vm_offset_t and physical offsets have to abuse vm_physaddr_t). OTOH, all these types except vm_paddr_t are the same, so it is too easy to misuse vm_size_t for an address of offset. Using uintptr_t was wrong since it is just a C type large enough to represent pointers. It has little relation to virtual addresses and no relation to physical addresses. It tends to be large enough to represent virtual addresses since it has to be large enough to represent all C pointers uniquely. But this is not required. Perhaps a general pointer has 36 bits but C pointers have only 32 bits, or C pointers have 36 bits but can be encoded uniquely in 32 bits and casting them to uint32_t does the encoding. Boot code and vm should operate at a lower level than C pointers and use raw offsets (probably represented as raw bits). Even casting pointers to uintptr_t is technically wrong. If this cast does special encoding, then it is probably not what is wanted. A recalcitrant implement of C could use the simple encoding of reversing all the bits. The resulting uintptr_t's would be useless for most existing (ab)uses of the result. Boot and vm code is low enough level to be honestly unportable and convert the bits using a type pun, or better memcpy(), or better still, portable using a conversion function that usually just casts through uintptr_t for virtual addresses. Bruce From owner-svn-src-all@freebsd.org Sun Jan 3 02:47:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0716A5F13E for ; Sun, 3 Jan 2016 02:47:57 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ECC218D8 for ; Sun, 3 Jan 2016 02:47:56 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x22a.google.com with SMTP id l65so130343964wmf.1 for ; Sat, 02 Jan 2016 18:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=cOnX6bIqJ36lNThzoX6g/ewsV094UlgFIahdjLmUYYc=; b=Bk1tMTAOhDqTf8JYgdjT9i6qHGlTxyIGDBAhpyxQvp4A8uAazegJaMA40wUO2Bc+C2 QTSAnuF7sGE/ZiR1K9rpFST/TDk7bXjje8KzSH2NWeIOBTc3+8VWXruREmt7o626SFZd PsdTE1D2rD/A7rihFZc0dYRVl/kaB3VlwtWsKFTevQx/eNzgTsttZiygdo5ofhHF87NJ JFpSScNzdZl6G6gI6EaA5wZOdSY0EkAH1Sl6Vjct0POVv/wzLDDSeS4uP59QSQQIKU8p iLRddFvvjRvMXhg+hoqK7o5OAeptx64dVl55MsuqFNRSZcU1xWF8oIzwuopHFQhZm1gf KTVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=cOnX6bIqJ36lNThzoX6g/ewsV094UlgFIahdjLmUYYc=; b=Lcgedfa1m7EY7PeA2rlDLsdt36lcfvg/KHztgxGEFRcBiPaxVnN+GPwAS7hhqWqcUe LHgQ0jRjqggNVtVZsU5xa9+9UiBp1iHFvUR3ctfsRnxhIhE0DjEmhSWjcjeDigBUlPeH xT/DN098ygae8+Qr/kHsStnxaczUqhY9C7+ksaGSA2n+ardOJ2aQhAl3BJgxxMewuURz Q4vGlfqL/f4udiL7YEa649ZDsFqqfSVPXPIeof+TrNGOn4QRcig+3d3I9ybxwNKvL4U9 Hsx1ZmIY6bGOin57+g531mqGeXAxsTbJbC/IqB5tnbtJH4/o/NgZIZVGWvvQX5JZkLvA 1apg== X-Gm-Message-State: ALoCoQl9T9+GapFjsoHDV+ihUBJmcH34JHv4r2rOg8PMLQ0xTJb2N234GXbJbKpWlFbDArVZuT1DvF3Clp62DMpWwJIG0B6Dwuj+aKYGw7RBVbcqN0NImiI= MIME-Version: 1.0 X-Received: by 10.28.222.5 with SMTP id v5mr45556601wmg.94.1451789274961; Sat, 02 Jan 2016 18:47:54 -0800 (PST) Received: by 10.27.39.195 with HTTP; Sat, 2 Jan 2016 18:47:54 -0800 (PST) Received: by 10.27.39.195 with HTTP; Sat, 2 Jan 2016 18:47:54 -0800 (PST) In-Reply-To: <1451774206.1369.109.camel@freebsd.org> References: <201601022231.u02MVEb5037283@repo.freebsd.org> <1451774206.1369.109.camel@freebsd.org> Date: Sat, 2 Jan 2016 18:47:54 -0800 Message-ID: Subject: Re: svn commit: r293063 - head/sys/arm/arm From: Maxim Sobolev To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 02:47:57 -0000 Don't save commit message and just exit your editor. That should make it abort. Works with CVS, git and svn all the same. Killing your editor with -9 should do as well, as long it doesn't do periodic autosave of some sort. On Jan 2, 2016 2:37 PM, "Ian Lepore" wrote: > On Sat, 2016-01-02 at 22:31 +0000, Ian Lepore wrote: > > Author: ian > > Date: Sat Jan 2 22:31:14 2016 > > New Revision: 293063 > > URL: https://svnweb.freebsd.org/changeset/base/293063 > > > > Log: > > Work around problems that happen when there is ram at the end of the > > physical address space. > > > > Modified: > > head/sys/arm/arm/physmem.c > > > > Modified: head/sys/arm/arm/physmem.c > > > ============================================================================== > > --- head/sys/arm/arm/physmem.c> > Sat Jan 2 22:04:37 2016> > > (r293062) > > +++ head/sys/arm/arm/physmem.c> > Sat Jan 2 22:31:14 2016> > > (r293063) > > @@ -280,10 +280,24 @@ arm_physmem_hardware_region(vm_paddr_t p > > > > /* > > > > * Filter out the page at PA 0x00000000. The VM can't handle > it, as > > > > * pmap_extract() == 0 means failure. > > +> > * > > +> > * Also filter out the page at the end of the physical address > space -- > > +> > * if addr is non-zero and addr+size is zero that means we > wrapped to > > +> > * the next byte beyond what vm_paddr_t can express. The > calculations > > +> > * in vm_page_startup() are going to have the same problem, so > just work > > +> > * around it by leaving the last page out. > > +> > * > > +> > * XXX This just in: subtract out a whole megabyte, not just 1 > page. > > +> > * Reducing the size by anything less than 1MB results in a NULL > pointer > > +> > * deref in _vm_map_lock_read() very early in startup. Better > to give > > +> > * up a whole megabyte than leave some folks with an unusable > system > > +> > * while we investigate. > > > > */ > > > > if (pa == 0) { > > > > > pa = PAGE_SIZE; > > > > > sz -= PAGE_SIZE; > > +> > } else if (pa + sz == 0) { > > +> > > sz -= 1024 * 1024; > > > > } > > > > > > /* > > > > Bah. This is not what I intended to commit, I was going to reword that > comment block to better match what I found while testing. I was > editing the commit message when I decided to do that, so I hit ^C in > the shell that was waiting for me to finish editing in emacs, and to my > surprise it sent the commit instead of cancelling. What's the right > way to change your mind at this late stage of a commit? > > -- Ian > > From owner-svn-src-all@freebsd.org Sun Jan 3 03:40:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DD35A601C4; Sun, 3 Jan 2016 03:40:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 750CF1189; Sun, 3 Jan 2016 03:40:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x236.google.com with SMTP id ho8so419428pac.2; Sat, 02 Jan 2016 19:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=EI1lwv93deZtqiIAgJJVu0k3KY7z/xkPsxlHgoMC8Cw=; b=CGcpZGHhkWHnQak7TSnLALC1m/ggt05tkmr3CBfgky3fZPuy59yEyHMYGEeBn98hzE bfTWYpoTsZsTxNtlZ3ML4p1N0Et1Ov6fNdJgA6vWtqCgpktNe9rWCxwBU6H1QB8eaV/S Fr6pEdbtIGGTYgzwQzVueDdFheE3gTq4+mEmngJCbIwqkOR2bHIX417vlZIZznGJDIV9 pS+lM/YNIOAejw4wPJljuk253SbHOlXhSEmrMmPsvJ971aU7oSdV3+6m8fRxPQF4eMkp SzpjzwWaggkbd53ey5BXTtBzlQN8Dx+8iSropKUdWADX+tIdkrL0yrCNRpkzAp2QTptX 5aHg== X-Received: by 10.66.252.136 with SMTP id zs8mr43974457pac.110.1451792425096; Sat, 02 Jan 2016 19:40:25 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:44c7:137c:1c65:f048? ([2601:601:800:126d:44c7:137c:1c65:f048]) by smtp.gmail.com with ESMTPSA id x22sm99173024pfa.82.2016.01.02.19.40.23 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Jan 2016 19:40:23 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293063 - head/sys/arm/arm From: NGie Cooper In-Reply-To: Date: Sat, 2 Jan 2016 19:40:21 -0800 Cc: Ian Lepore , src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201601022231.u02MVEb5037283@repo.freebsd.org> <1451774206.1369.109.camel@freebsd.org> To: Maxim Sobolev X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 03:40:25 -0000 > On Jan 2, 2016, at 18:47, Maxim Sobolev wrote: >=20 > Don't save commit message and just exit your editor. That should make = it abort. Works with CVS, git and svn all the same. Killing your editor = with -9 should do as well, as long it doesn't do periodic autosave of = some sort. `killall -9 svn; svn cleanup` works every time! Cheers, -NGie= From owner-svn-src-all@freebsd.org Sun Jan 3 04:32:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D093A5329B; Sun, 3 Jan 2016 04:32:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EBC118F2; Sun, 3 Jan 2016 04:32:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u034W3Zi043548; Sun, 3 Jan 2016 04:32:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u034W25Y043537; Sun, 3 Jan 2016 04:32:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601030432.u034W25Y043537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 04:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293066 - in head/libexec/rtld-elf: . aarch64 amd64 arm i386 mips powerpc powerpc64 sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 04:32:04 -0000 Author: imp Date: Sun Jan 3 04:32:02 2016 New Revision: 293066 URL: https://svnweb.freebsd.org/changeset/base/293066 Log: Create a generalized exec hook that different architectures can hook into if they need to, but default to no action. Differential Review: https://reviews.freebsd.org/D2718 Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h head/libexec/rtld-elf/amd64/rtld_machdep.h head/libexec/rtld-elf/arm/reloc.c head/libexec/rtld-elf/arm/rtld_machdep.h head/libexec/rtld-elf/i386/rtld_machdep.h head/libexec/rtld-elf/mips/rtld_machdep.h head/libexec/rtld-elf/paths.h head/libexec/rtld-elf/powerpc/rtld_machdep.h head/libexec/rtld-elf/powerpc64/rtld_machdep.h head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/sparc64/rtld_machdep.h Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/aarch64/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -80,4 +80,6 @@ extern void *__tls_get_addr(tls_index *t #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/amd64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/amd64/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/amd64/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -79,4 +79,6 @@ void *__tls_get_addr(tls_index *ti) __ex #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/arm/reloc.c ============================================================================== --- head/libexec/rtld-elf/arm/reloc.c Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/arm/reloc.c Sun Jan 3 04:32:02 2016 (r293066) @@ -18,6 +18,41 @@ __FBSDID("$FreeBSD$"); #include "paths.h" void +arm_abi_variant_hook(Elf_Auxinfo **aux_info) +{ + Elf_Word ehdr; + + /* + * If we're running an old kernel that doesn't provide any data fail + * safe by doing nothing. + */ + if (aux_info[AT_EHDRFLAGS] == NULL) + return; + ehdr = aux_info[AT_EHDRFLAGS]->a_un.a_val; + + /* + * Hard float ABI binaries are the default, and use the default paths + * and such. + */ + if ((ehdr & EF_ARM_VFP_FLOAT) != 0) + return; + + /* + * This is a soft float ABI binary. We need to use the soft float + * settings. For the moment, the standard library path includes the hard + * float paths as well. When upgrading, we need to execute the wrong + * kind of binary until we've installed the new binaries. We could go + * off whether or not /libsoft exists, but the simplicity of having it + * in the path wins. + */ + ld_elf_hints_default = _PATH_SOFT_ELF_HINTS; + ld_path_libmap_conf = _PATH_SOFT_LIBMAP_CONF; + ld_path_rtld = _PATH_SOFT_RTLD; + ld_standard_library_path = SOFT_STANDARD_LIBRARY_PATH; + ld_env_prefix = LD_SOFT_; +} + +void init_pltgot(Obj_Entry *obj) { if (obj->pltgot != NULL) { Modified: head/libexec/rtld-elf/arm/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/arm/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/arm/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -75,4 +75,9 @@ extern void *__tls_get_addr(tls_index *t #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +extern void arm_abi_variant_hook(Elf_Auxinfo **); + +#define md_abi_variant_hook(x) arm_abi_variant_hook(x) +#define RTLD_VARIANT_ENV_NAMES + #endif Modified: head/libexec/rtld-elf/i386/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/i386/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/i386/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -80,4 +80,6 @@ void *__tls_get_addr(tls_index *ti) __ex #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -75,4 +75,6 @@ extern void *__tls_get_addr(tls_index *t #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/paths.h ============================================================================== --- head/libexec/rtld-elf/paths.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/paths.h Sun Jan 3 04:32:02 2016 (r293066) @@ -1,8 +1,6 @@ /*- * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra. * Copyright 2003 Alexander Kabaev . - * Copyright 2009-2012 Konstantin Belousov . - * Copyright 2012 John Marino . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,7 +59,13 @@ #define LD_ "LD_" #endif -extern char *ld_path_elf_hints; +#define _PATH_SOFT_ELF_HINTS "/var/run/ld-elf-soft.so.hints" +#define _PATH_SOFT_LIBMAP_CONF "/etc/libmap-soft.conf" +#define _PATH_SOFT_RTLD "/libexec/ld-elf.so.1" +#define SOFT_STANDARD_LIBRARY_PATH "/libsoft:/usr/libsoft:/lib:/usr/lib" +#define LD_SOFT_ "LD_SOFT_" + +extern char *ld_elf_hints_default; extern char *ld_path_libmap_conf; extern char *ld_path_rtld; extern char *ld_standard_library_path; Modified: head/libexec/rtld-elf/powerpc/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/powerpc/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -90,4 +90,6 @@ extern void *__tls_get_addr(tls_index* t #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/powerpc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc64/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/powerpc64/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -82,4 +82,6 @@ extern void *__tls_get_addr(tls_index* t #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/rtld.c Sun Jan 3 04:32:02 2016 (r293066) @@ -419,6 +419,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ trust = !issetugid(); + md_abi_variant_hook(aux_info); + ld_bind_now = getenv(_LD("BIND_NOW")); /* * If the process is tainted, then we un-set the dangerous environment Modified: head/libexec/rtld-elf/sparc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/sparc64/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/sparc64/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -71,4 +71,6 @@ extern void *__tls_get_addr(tls_index *t #define RTLD_DEFAULT_STACK_PF_EXEC 0 #define RTLD_DEFAULT_STACK_EXEC 0 +#define md_abi_variant_hook(x) + #endif From owner-svn-src-all@freebsd.org Sun Jan 3 04:32:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 936C8A532C1; Sun, 3 Jan 2016 04:32:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 493431938; Sun, 3 Jan 2016 04:32:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u034W68u043636; Sun, 3 Jan 2016 04:32:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u034W6en043633; Sun, 3 Jan 2016 04:32:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601030432.u034W6en043633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 04:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293068 - in head/etc: . mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 04:32:07 -0000 Author: imp Date: Sun Jan 3 04:32:05 2016 New Revision: 293068 URL: https://svnweb.freebsd.org/changeset/base/293068 Log: Add libsoft to the tree, just like lib32. Added: head/etc/mtree/BSD.libsoft.dist - copied, changed from r293067, head/etc/mtree/BSD.lib32.dist Modified: head/etc/Makefile head/etc/mtree/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Jan 3 04:32:04 2016 (r293067) +++ head/etc/Makefile Sun Jan 3 04:32:05 2016 (r293068) @@ -154,6 +154,9 @@ MTREE= BSD.debug.dist BSD.include.dist B .if ${MK_LIB32} != "no" MTREE+= BSD.lib32.dist .endif +.if ${MK_LIBSOFT} != "no" +MTREE+= BSD.libsoft.dist +.endif .if ${MK_TESTS} != "no" MTREE+= BSD.tests.dist .endif @@ -354,6 +357,10 @@ MTREES+= mtree/BSD.groff.dist /usr MTREES+= mtree/BSD.lib32.dist /usr MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr .endif +.if ${MK_LIBSOFT} != "no" +MTREES+= mtree/BSD.libsoft.dist /usr +MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr +.endif .if ${MK_TESTS} != "no" MTREES+= mtree/BSD.tests.dist ${TESTSBASE} MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE} Copied and modified: head/etc/mtree/BSD.libsoft.dist (from r293067, head/etc/mtree/BSD.lib32.dist) ============================================================================== --- head/etc/mtree/BSD.lib32.dist Sun Jan 3 04:32:04 2016 (r293067, copy source) +++ head/etc/mtree/BSD.libsoft.dist Sun Jan 3 04:32:05 2016 (r293068) @@ -5,7 +5,7 @@ /set type=dir uname=root gname=wheel mode=0755 . - lib32 + libsoft dtrace .. i18n Modified: head/etc/mtree/Makefile ============================================================================== --- head/etc/mtree/Makefile Sun Jan 3 04:32:04 2016 (r293067) +++ head/etc/mtree/Makefile Sun Jan 3 04:32:05 2016 (r293068) @@ -6,6 +6,7 @@ FILES= ${_BSD.debug.dist} \ BSD.include.dist \ BSD.root.dist \ ${_BSD.lib32.dist} \ + ${_BSD.libsoft.dist} \ ${_BSD.sendmail.dist} \ ${_BSD.tests.dist} \ BSD.usr.dist \ @@ -20,6 +21,9 @@ _BSD.groff.dist= BSD.groff.dist .if ${MK_LIB32} != "no" _BSD.lib32.dist= BSD.lib32.dist .endif +.if ${MK_LIBSOFT} != "no" +_BSD.libsoft.dist= BSD.libsoft.dist +.endif .if ${MK_SENDMAIL} != "no" _BSD.sendmail.dist= BSD.sendmail.dist .endif From owner-svn-src-all@freebsd.org Sun Jan 3 04:32:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 832A1A532A3; Sun, 3 Jan 2016 04:32:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 541BA18F4; Sun, 3 Jan 2016 04:32:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u034W485043591; Sun, 3 Jan 2016 04:32:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u034W47r043590; Sun, 3 Jan 2016 04:32:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601030432.u034W47r043590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 04:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293067 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 04:32:05 -0000 Author: imp Date: Sun Jan 3 04:32:04 2016 New Revision: 293067 URL: https://svnweb.freebsd.org/changeset/base/293067 Log: Add new LIBSOFT option. This is similar to the LIB32 option, except for libraries that follow the soft float ABI. It's only supported on armv6 as a transition to the new hard float ABI, so mark as broken everywhere else. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Jan 3 04:32:02 2016 (r293066) +++ head/share/mk/src.opts.mk Sun Jan 3 04:32:04 2016 (r293067) @@ -180,6 +180,7 @@ __DEFAULT_NO_OPTIONS = \ DTRACE_TESTS \ EISA \ HESIOD \ + LIBSOFT \ NAND \ OFED \ OPENLDAP \ @@ -248,6 +249,10 @@ __DEFAULT_NO_OPTIONS+=LLDB .if ${__T} == "arm" || ${__T} == "armeb" BROKEN_OPTIONS+=LLDB .endif +# Only doing soft float API stuff on armv6 +.if ${__T} != "armv6" +BROKEN_OPTIONS+=LIBSOFT +.endif .include From owner-svn-src-all@freebsd.org Sun Jan 3 04:32:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 362B2A53335; Sun, 3 Jan 2016 04:32:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF9E91C20; Sun, 3 Jan 2016 04:32:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u034WE7K043684; Sun, 3 Jan 2016 04:32:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u034WDnl043683; Sun, 3 Jan 2016 04:32:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601030432.u034WDnl043683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 04:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293069 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 04:32:15 -0000 Author: imp Date: Sun Jan 3 04:32:13 2016 New Revision: 293069 URL: https://svnweb.freebsd.org/changeset/base/293069 Log: If md_exec_hook is defined, provide a way to create the strings for the environment variables we look up at runtime. Otherwise, there's no way they will change, optimize it at compile time. Differential Review: https://reviews.freebsd.org/D2718 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sun Jan 3 04:32:05 2016 (r293068) +++ head/libexec/rtld-elf/rtld.c Sun Jan 3 04:32:13 2016 (r293069) @@ -204,8 +204,6 @@ extern Elf_Dyn _DYNAMIC; #define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) #endif -#define _LD(x) LD_ x - int dlclose(void *) __exported; char *dlerror(void) __exported; void *dlopen(const char *, int) __exported; @@ -325,6 +323,24 @@ ld_utrace_log(int event, void *handle, v utrace(&ut, sizeof(ut)); } +#ifdef RTLD_VARIANT_ENV_NAMES +/* + * construct the env variable based on the type of binary that's + * running. + */ +static inline const char * +_LD(const char *var) +{ + static char buffer[128]; + + strlcpy(buffer, ld_env_prefix, sizeof(buffer)); + strlcat(buffer, var, sizeof(buffer)); + return (buffer); +} +#else +#define _LD(x) LD_ x +#endif + /* * Main entry point for dynamic linking. The first argument is the * stack pointer. The stack is expected to be laid out as described From owner-svn-src-all@freebsd.org Sun Jan 3 04:38:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0991A5375C; Sun, 3 Jan 2016 04:38:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1460121E; Sun, 3 Jan 2016 04:38:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u034cHUD043935; Sun, 3 Jan 2016 04:38:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u034cHSP043934; Sun, 3 Jan 2016 04:38:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601030438.u034cHSP043934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 04:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293070 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 04:38:19 -0000 Author: ngie Date: Sun Jan 3 04:38:17 2016 New Revision: 293070 URL: https://svnweb.freebsd.org/changeset/base/293070 Log: Add "options ZFS" to NOTES so this will be tested with the LINT KERNCONF when "make tinderbox" is run This will help ensure that "options ZFS" will not be accidentally regressed, as the current LINT configuration tests the zfs module MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jan 3 04:32:13 2016 (r293069) +++ head/sys/conf/NOTES Sun Jan 3 04:38:17 2016 (r293070) @@ -3012,3 +3012,6 @@ options EM_MULTIQUEUE # Activate multiq # zlib I/O stream support # This enables support for compressed core dumps. options GZIO + +# ZFS (Zeta File System) support +options ZFS From owner-svn-src-all@freebsd.org Sun Jan 3 06:02:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A5FA5FF2C; Sun, 3 Jan 2016 06:02:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07B3C1293; Sun, 3 Jan 2016 06:02:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0362vKu070409; Sun, 3 Jan 2016 06:02:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0362u4H070401; Sun, 3 Jan 2016 06:02:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601030602.u0362u4H070401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 06:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293073 - head/tools/regression/geom_mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 06:02:58 -0000 Author: ngie Date: Sun Jan 3 06:02:56 2016 New Revision: 293073 URL: https://svnweb.freebsd.org/changeset/base/293073 Log: - Use attach_md instead of hardcoding md(4) provider unit numbers - Implement a gmirror_test_cleanup function, which in turn calls geom_test_cleanup to clean up all md(4) providers allocated in the test run. - Remove duplicate logic in test scripts for removing md(4) providers. - Don't create files in /tmp (outside the kyua sandbox); use the current directory instead MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/geom_mirror/conf.sh head/tools/regression/geom_mirror/test-1.t head/tools/regression/geom_mirror/test-2.t head/tools/regression/geom_mirror/test-3.t head/tools/regression/geom_mirror/test-4.t head/tools/regression/geom_mirror/test-5.t head/tools/regression/geom_mirror/test-6.t head/tools/regression/geom_mirror/test-7.t Modified: head/tools/regression/geom_mirror/conf.sh ============================================================================== --- head/tools/regression/geom_mirror/conf.sh Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/conf.sh Sun Jan 3 06:02:56 2016 (r293073) @@ -5,4 +5,11 @@ name="$(mktemp -u mirror.XXXXXX)" class="mirror" base=`basename $0` +gmirror_test_cleanup() +{ + [ -c /dev/$class/$name ] && gmirror destroy $name + geom_test_cleanup +} +trap gmirror_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: head/tools/regression/geom_mirror/test-1.t ============================================================================== --- head/tools/regression/geom_mirror/test-1.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-1.t Sun Jan 3 06:02:56 2016 (r293073) @@ -5,15 +5,11 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` - -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -gmirror label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait # Size of created device should be 1MB - 512b. @@ -25,10 +21,3 @@ if [ $size -eq 1048064 ]; then else echo "not ok 1" fi - -gmirror remove $name md${us0} -gmirror remove $name md${us1} -gmirror remove $name md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: head/tools/regression/geom_mirror/test-2.t ============================================================================== --- head/tools/regression/geom_mirror/test-2.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-2.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,22 +6,19 @@ echo "1..4" balance="round-robin" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,28 +29,24 @@ if [ `md5 -q ${src}` != `md5 -q ${dst}` else echo "ok 1" fi -dd if=/dev/md${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -dd if=/dev/md${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" else echo "ok 3" fi -dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" else echo "ok 4" fi -gmirror remove $name md${us0} md${us1} md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_mirror/test-3.t ============================================================================== --- head/tools/regression/geom_mirror/test-3.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-3.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,22 +6,19 @@ echo "1..5" balance="round-robin" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_mirror/test-4.t ============================================================================== --- head/tools/regression/geom_mirror/test-4.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-4.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,22 +6,19 @@ echo "1..5" balance="load" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -57,6 +54,8 @@ else echo "ok 4" fi +gmirror destroy $name + # mirror/${name} should be removed. if [ -c /dev/${name} ]; then echo "not ok 5" @@ -64,7 +63,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_mirror/test-5.t ============================================================================== --- head/tools/regression/geom_mirror/test-5.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-5.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,22 +6,19 @@ echo "1..5" balance="split" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=8192 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_mirror/test-6.t ============================================================================== --- head/tools/regression/geom_mirror/test-6.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-6.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,26 +6,23 @@ echo "1..2" balance="split" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=8192 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} || exit 1 +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -dd if=/dev/zero of=/dev/md${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -35,18 +32,14 @@ else fi # Connect disk to the mirror. -gmirror insert ${name} md${us2} +gmirror insert ${name} ${us2} # Wait for synchronization. sleep 1 -dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -gmirror remove $name md${us0} md${us1} md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_mirror/test-7.t ============================================================================== --- head/tools/regression/geom_mirror/test-7.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-7.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,22 +6,19 @@ echo "1..5" balance="prefer" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} From owner-svn-src-all@freebsd.org Sun Jan 3 08:38:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF75EA6076D; Sun, 3 Jan 2016 08:38:10 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 91CA11BCF; Sun, 3 Jan 2016 08:38:09 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 108D225D386D; Sun, 3 Jan 2016 08:38:00 +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 35AB9C76FED; Sun, 3 Jan 2016 08:38:00 +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 RkuFwt8f2-HE; Sun, 3 Jan 2016 08:37:58 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:cd32:511d:f40b:c35] (unknown [IPv6:fde9:577b:c1a9:4410:cd32:511d:f40b:c35]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 61A51C76FEC; Sun, 3 Jan 2016 08:37:58 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293070 - head/sys/conf From: "Bjoern A. Zeeb" In-Reply-To: <201601030438.u034cHSP043934@repo.freebsd.org> Date: Sun, 3 Jan 2016 08:37:38 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201601030438.u034cHSP043934@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 08:38:10 -0000 > On 03 Jan 2016, at 04:38 , Garrett Cooper wrote: >=20 > Author: ngie > Date: Sun Jan 3 04:38:17 2016 > New Revision: 293070 > URL: https://svnweb.freebsd.org/changeset/base/293070 >=20 > Log: > Add "options ZFS" to NOTES so this will be tested with the LINT > KERNCONF when "make tinderbox" is run >=20 > This will help ensure that "options ZFS" will not be accidentally > regressed, as the current LINT configuration tests the zfs module >=20 and it broke the build. linking kernel inflate.o: In function `inflate': /scratch/tmp/bz/head.svn/sys/kern/inflate.c:(.text+0x0): multiple = definition of `inflate' inflate.o:/scratch/tmp/bz/head.svn/sys/kern/inflate.c:(.text+0x0): first = defined here zmod.o: In function `z_uncompress': = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x63): undefined reference to `z_inflateInit2_' = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x78): undefined reference to `z_inflate' = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x92): undefined reference to `z_inflateEnd' = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0xa0): undefined reference to `z_inflateEnd' --- kernel --- *** [kernel] Error code 1 /bz= From owner-svn-src-all@freebsd.org Sun Jan 3 08:48:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 073CAA60A4D; Sun, 3 Jan 2016 08:48:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C10171254; Sun, 3 Jan 2016 08:48:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u038mNM9019792; Sun, 3 Jan 2016 08:48:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u038mN1d019791; Sun, 3 Jan 2016 08:48:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601030848.u038mN1d019791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 08:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293091 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 08:48:25 -0000 Author: ngie Date: Sun Jan 3 08:48:23 2016 New Revision: 293091 URL: https://svnweb.freebsd.org/changeset/base/293091 Log: Revert r293070 It seems that `options GZIP` and `options ZFS` collide because they both define inconsistent definitions for inflate, etc Fixing this will require upgrading zlib in the kernel, as suggested in r245102. Pointyhat to: ngie Reported by: bz Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jan 3 08:30:18 2016 (r293090) +++ head/sys/conf/NOTES Sun Jan 3 08:48:23 2016 (r293091) @@ -3012,6 +3012,3 @@ options EM_MULTIQUEUE # Activate multiq # zlib I/O stream support # This enables support for compressed core dumps. options GZIO - -# ZFS (Zeta File System) support -options ZFS From owner-svn-src-all@freebsd.org Sun Jan 3 08:55:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A764AA60D1F; Sun, 3 Jan 2016 08:55:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72A7817FA; Sun, 3 Jan 2016 08:55:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ob0-x230.google.com with SMTP id bx1so203790580obb.0; Sun, 03 Jan 2016 00:55:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LTFDUFl0qNUOIXyDXIO0WKGac9CpuyoKuaS7bOM++2Y=; b=ZjU3fuSv2fJkUrl7ITu0uUBWvaAhYzv9a/W4kuMlhg5QP/n4N7zi6QObDzbcBmPUN4 xSYObX8d8ecv8mTxtGRgV1QuwdKvahBPyxMVHy8knT0hR4yZnrYPSuh4OE0sXEG8qHjU OgbRwAvgFTuopyl5M1HGsVKQ3upgL62Qf9Vz8EXr5ccVgBvHhk8Rw1bploD6l4An4+da K1MaIgp6Pq7H4bLOasW7pJPoXkxDZWOaV0KYa6trX52jB2HJ9uJL9Yr8l+Qf1Bef+6uX 4XTfePlv9/OA2ULBbwVggw7I1CzVtytATTFOGPAcPOiizkBZdC8JlZYKGigkNWSb2pf9 qMlg== X-Received: by 10.60.146.237 with SMTP id tf13mr30260799oeb.70.1451811314751; Sun, 03 Jan 2016 00:55:14 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:44c7:137c:1c65:f048? ([2601:601:800:126d:44c7:137c:1c65:f048]) by smtp.gmail.com with ESMTPSA id sd7sm27856011oec.13.2016.01.03.00.55.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jan 2016 00:55:13 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293070 - head/sys/conf From: NGie Cooper In-Reply-To: Date: Sun, 3 Jan 2016 00:55:11 -0800 Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <825B9C10-92B8-40FE-B34A-34EF285D6844@gmail.com> References: <201601030438.u034cHSP043934@repo.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 08:55:15 -0000 > On Jan 3, 2016, at 00:37, Bjoern A. Zeeb = wrote: >=20 >> On 03 Jan 2016, at 04:38 , Garrett Cooper wrote: >>=20 >> Author: ngie >> Date: Sun Jan 3 04:38:17 2016 >> New Revision: 293070 >> URL: https://svnweb.freebsd.org/changeset/base/293070 >>=20 >> Log: >> Add "options ZFS" to NOTES so this will be tested with the LINT >> KERNCONF when "make tinderbox" is run >>=20 >> This will help ensure that "options ZFS" will not be accidentally >> regressed, as the current LINT configuration tests the zfs module >>=20 >=20 > and it broke the build. >=20 > linking kernel > inflate.o: In function `inflate': > /scratch/tmp/bz/head.svn/sys/kern/inflate.c:(.text+0x0): multiple = definition of `inflate' > inflate.o:/scratch/tmp/bz/head.svn/sys/kern/inflate.c:(.text+0x0): = first defined here > zmod.o: In function `z_uncompress': > = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x63): undefined reference to `z_inflateInit2_' > = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x78): undefined reference to `z_inflate' > = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x92): undefined reference to `z_inflateEnd' > = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0xa0): undefined reference to `z_inflateEnd' > --- kernel --- > *** [kernel] Error code 1 Thank you for the report ;(... I=E2=80=99ve reverted r293091 and have = filed this bug to track the issue: = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205822 . -NGie= From owner-svn-src-all@freebsd.org Sun Jan 3 09:54:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF57A600C6; Sun, 3 Jan 2016 09:54:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ECBE1783; Sun, 3 Jan 2016 09:54:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u039s3jk041112; Sun, 3 Jan 2016 09:54:03 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u039s3fS041109; Sun, 3 Jan 2016 09:54:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601030954.u039s3fS041109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 3 Jan 2016 09:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293098 - in head/sys: net netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 09:54:04 -0000 Author: melifaro Date: Sun Jan 3 09:54:03 2016 New Revision: 293098 URL: https://svnweb.freebsd.org/changeset/base/293098 Log: Handle IPV6_PATHMTU option by spliting ip6_getpmtu_ctl() from ip6_getpmtu(). Add ro_mtu field to 'struct route' to be able to pass lookup MTU back to the caller. Currently, ip6_getpmtu() has 2 totally different use cases: 1) control plane (IPV6_PATHMTU req), where we just need to calculate MTU and return it, w/o any reusability. 2) Actual ip6_output() data path where we (nearly) always use the provided route lookup data. If this data is not 'valid' we need to perform another lookup and save the result (which cannot be re-used by ip6_output()). Given that, handle 1) by calling separate function doing rte lookup itself. Resulting MTU is calculated by (newly-added) ip6_calcmtu() used by both ip6_getpmtu_ctl() and ip6_getpmtu(). For 2) instead of storing ref'ed rte, store mtu (the only needed data from the lookup result) inside newly-added ro_mtu field. 'struct route' was shrinked by 8(or 4 bytes) in r292978. Grow it again by 4 bytes. New ro_mtu field will be used in other places like ip/tcp_output (EMSGSIZE handling from output routines). Reviewed by: ae Modified: head/sys/net/route.h head/sys/netinet6/in6.h head/sys/netinet6/ip6_output.c Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Jan 3 09:44:26 2016 (r293097) +++ head/sys/net/route.h Sun Jan 3 09:54:03 2016 (r293098) @@ -44,16 +44,17 @@ */ /* - * A route consists of a destination address, a reference - * to a routing entry, and a reference to an llentry. - * These are often held by protocols in their control - * blocks, e.g. inpcb. + * Struct route consiste of a destination address, + * a route entry pointer, link-layer prepend data pointer along + * with its length. */ struct route { struct rtentry *ro_rt; char *ro_prepend; uint16_t ro_plen; uint16_t ro_flags; + uint16_t ro_mtu; /* saved ro_rt mtu */ + uint16_t spare; struct sockaddr ro_dst; }; Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Sun Jan 3 09:44:26 2016 (r293097) +++ head/sys/netinet6/in6.h Sun Jan 3 09:54:03 2016 (r293098) @@ -378,6 +378,8 @@ struct route_in6 { char *ro_prepend; uint16_t ro_plen; uint16_t ro_flags; + uint16_t ro_mtu; /* saved ro_rt mtu */ + uint16_t spare; struct sockaddr_in6 ro_dst; }; #endif Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Jan 3 09:44:26 2016 (r293097) +++ head/sys/netinet6/ip6_output.c Sun Jan 3 09:54:03 2016 (r293098) @@ -147,8 +147,11 @@ static int ip6_insertfraghdr(struct mbuf struct ip6_frag **); static int ip6_insert_jumboopt(struct ip6_exthdrs *, u_int32_t); static int ip6_splithdr(struct mbuf *, struct ip6_exthdrs *); -static int ip6_getpmtu(struct route_in6 *, struct route_in6 *, +static int ip6_getpmtu(struct route_in6 *, int, struct ifnet *, struct in6_addr *, u_long *, int *, u_int); +static int ip6_calcmtu(struct ifnet *, const struct in6_addr *, u_long, + u_long *, int *); +static int ip6_getpmtu_ctl(u_int, struct in6_addr *, u_long *); static int copypktopts(struct ip6_pktopts *, struct ip6_pktopts *, int); @@ -712,7 +715,7 @@ again: *ifpp = ifp; /* Determine path MTU. */ - if ((error = ip6_getpmtu(ro_pmtu, ro, ifp, &finaldst, &mtu, + if ((error = ip6_getpmtu(ro_pmtu, ro != ro_pmtu, ifp, &finaldst, &mtu, &alwaysfrag, fibnum)) != 0) goto bad; @@ -1045,8 +1048,6 @@ sendorfree: done: if (ro == &ip6route) RO_RTFREE(ro); - if (ro_pmtu == &ip6route) - RO_RTFREE(ro_pmtu); return (error); freehdrs: @@ -1215,35 +1216,104 @@ ip6_insertfraghdr(struct mbuf *m0, struc return (0); } +/* + * Calculates IPv6 path mtu for destination @dst. + * Resulting MTU is stored in @mtup. + * + * Returns 0 on success. + */ +static int +ip6_getpmtu_ctl(u_int fibnum, struct in6_addr *dst, u_long *mtup) +{ + struct route_in6 ro_pmtu; + struct ifnet *ifp; + struct sockaddr_in6 *sa6_dst; + u_long mtu; + + sa6_dst = (struct sockaddr_in6 *)&ro_pmtu.ro_dst; + bzero(sa6_dst, sizeof(*sa6_dst)); + sa6_dst->sin6_family = AF_INET6; + sa6_dst->sin6_len = sizeof(struct sockaddr_in6); + sa6_dst->sin6_addr = *dst; + + in6_rtalloc(&ro_pmtu, fibnum); + + if (ro_pmtu.ro_rt == NULL) + return (EHOSTUNREACH); + + ifp = ro_pmtu.ro_rt->rt_ifp; + mtu = ro_pmtu.ro_rt->rt_mtu; + RO_RTFREE(&ro_pmtu); + + return (ip6_calcmtu(ifp, dst, mtu, mtup, NULL)); +} + +/* + * Calculates IPv6 path MTU for @dst based on transmit @ifp, + * and cached data in @ro_pmtu. + * MTU from (successful) route lookup is saved (along with dst) + * inside @ro_pmtu to avoid subsequent route lookups after packet + * filter processing. + * + * Stores mtu and always-frag value into @mtup and @alwaysfragp. + * Returns 0 on success. + */ static int -ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, +ip6_getpmtu(struct route_in6 *ro_pmtu, int do_lookup, struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, int *alwaysfragp, u_int fibnum) { - u_int32_t mtu = 0; - int alwaysfrag = 0; - int error = 0; + struct sockaddr_in6 *sa6_dst; + u_long mtu; - if (ro_pmtu != ro) { - /* The first hop and the final destination may differ. */ - struct sockaddr_in6 *sa6_dst = - (struct sockaddr_in6 *)&ro_pmtu->ro_dst; - if (ro_pmtu->ro_rt && - ((ro_pmtu->ro_rt->rt_flags & RTF_UP) == 0 || - !IN6_ARE_ADDR_EQUAL(&sa6_dst->sin6_addr, dst))) { - RTFREE(ro_pmtu->ro_rt); - ro_pmtu->ro_rt = (struct rtentry *)NULL; - } - if (ro_pmtu->ro_rt == NULL) { + mtu = 0; + if (do_lookup) { + + /* + * Here ro_pmtu has final destination address, while + * ro might represent immediate destination. + * Use ro_pmtu destination since mtu might differ. + */ + sa6_dst = (struct sockaddr_in6 *)&ro_pmtu->ro_dst; + if (!IN6_ARE_ADDR_EQUAL(&sa6_dst->sin6_addr, dst)) + ro_pmtu->ro_mtu = 0; + + if (ro_pmtu->ro_mtu == 0) { bzero(sa6_dst, sizeof(*sa6_dst)); sa6_dst->sin6_family = AF_INET6; sa6_dst->sin6_len = sizeof(struct sockaddr_in6); sa6_dst->sin6_addr = *dst; in6_rtalloc(ro_pmtu, fibnum); + if (ro_pmtu->ro_rt) { + mtu = ro_pmtu->ro_rt->rt_mtu; + RO_RTFREE(ro_pmtu); + } } } - if (ro_pmtu->ro_rt) { + + if (ro_pmtu->ro_rt) + mtu = ro_pmtu->ro_rt->rt_mtu; + + return (ip6_calcmtu(ifp, dst, mtu, mtup, alwaysfragp)); +} + +/* + * Calculate MTU based on transmit @ifp, route mtu @rt_mtu and + * hostcache data for @dst. + * Stores mtu and always-frag value into @mtup and @alwaysfragp. + * + * Returns 0 on success. + */ +static int +ip6_calcmtu(struct ifnet *ifp, const struct in6_addr *dst, u_long rt_mtu, + u_long *mtup, int *alwaysfragp) +{ + u_long mtu = 0; + int alwaysfrag = 0; + int error = 0; + + if (rt_mtu > 0) { u_int32_t ifmtu; struct in_conninfo inc; @@ -1251,14 +1321,12 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s inc.inc_flags |= INC_ISIPV6; inc.inc6_faddr = *dst; - if (ifp == NULL) - ifp = ro_pmtu->ro_rt->rt_ifp; ifmtu = IN6_LINKMTU(ifp); mtu = tcp_hc_getmtu(&inc); if (mtu) - mtu = min(mtu, ro_pmtu->ro_rt->rt_mtu); + mtu = min(mtu, rt_mtu); else - mtu = ro_pmtu->ro_rt->rt_mtu; + mtu = rt_mtu; if (mtu == 0) mtu = ifmtu; else if (mtu < IPV6_MMTU) { @@ -1936,9 +2004,6 @@ do { \ { u_long pmtu = 0; struct ip6_mtuinfo mtuinfo; - struct route_in6 sro; - - bzero(&sro, sizeof(sro)); if (!(so->so_state & SS_ISCONNECTED)) return (ENOTCONN); @@ -1947,11 +2012,8 @@ do { \ * routing, or optional information to specify * the outgoing interface. */ - error = ip6_getpmtu(&sro, NULL, NULL, - &in6p->in6p_faddr, &pmtu, NULL, - so->so_fibnum); - if (sro.ro_rt) - RTFREE(sro.ro_rt); + error = ip6_getpmtu_ctl(so->so_fibnum, + &in6p->in6p_faddr, &pmtu); if (error) break; if (pmtu > IPV6_MAXPACKET) From owner-svn-src-all@freebsd.org Sun Jan 3 10:06:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0522A60771; Sun, 3 Jan 2016 10:06:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 619D91282; Sun, 3 Jan 2016 10:06:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03A6AhC044539; Sun, 3 Jan 2016 10:06:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03A6AfT044536; Sun, 3 Jan 2016 10:06:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601031006.u03A6AfT044536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 3 Jan 2016 10:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293099 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 10:06:11 -0000 Author: avos Date: Sun Jan 3 10:06:10 2016 New Revision: 293099 URL: https://svnweb.freebsd.org/changeset/base/293099 Log: iwm: reorganize if_iwmvar.h - Change order of data in if_iwmvar.h (like it is in other drivers: defines, data structures, vap/node structures, softc struct and locks); use indentation. - Fix IWM_LOCK(_sc) / IWM_UNLOCK(_sc) macro. - Add IWM_LOCK_INIT / DESTROY(sc) + fix mtx_init() usage. - Wrap iwm_node casts into IWM_NODE() macro. - Drop some fields: * wt_hwqueue from Tx radiotap header; * macaddr[6] from iwm_vap; Approved by: adrian Differential Revision: https://reviews.freebsd.org/D4753 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sun Jan 3 09:54:03 2016 (r293098) +++ head/sys/dev/iwm/if_iwm.c Sun Jan 3 10:06:10 2016 (r293099) @@ -2649,7 +2649,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - struct iwm_node *in = (struct iwm_node *)ni; + struct iwm_node *in = IWM_NODE(ni); struct iwm_tx_ring *ring; struct iwm_tx_data *data; struct iwm_tfd *desc; @@ -2706,7 +2706,6 @@ iwm_tx(struct iwm_softc *sc, struct mbuf tap->wt_chan_freq = htole16(ni->ni_chan->ic_freq); tap->wt_chan_flags = htole16(ni->ni_chan->ic_flags); tap->wt_rate = rinfo->rate; - tap->wt_hwqueue = ac; if (k != NULL) tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; ieee80211_radiotap_tx(vap, m); @@ -3182,7 +3181,7 @@ iwm_auth(struct ieee80211vap *vap, struc * freed from underneath us. Grr. */ ni = ieee80211_ref_node(vap->iv_bss); - in = (struct iwm_node *) ni; + in = IWM_NODE(ni); IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_STATE, "%s: called; vap=%p, bss ni=%p\n", __func__, @@ -3289,7 +3288,7 @@ out: static int iwm_assoc(struct ieee80211vap *vap, struct iwm_softc *sc) { - struct iwm_node *in = (struct iwm_node *)vap->iv_bss; + struct iwm_node *in = IWM_NODE(vap->iv_bss); int error; if ((error = iwm_mvm_update_sta(sc, in)) != 0) { @@ -3515,7 +3514,7 @@ iwm_newstate(struct ieee80211vap *vap, e if (vap->iv_state == IEEE80211_S_RUN && nstate != vap->iv_state) { iwm_mvm_disable_beacon_filter(sc); - if (((in = (void *)vap->iv_bss) != NULL)) + if (((in = IWM_NODE(vap->iv_bss)) != NULL)) in->in_assoc = 0; iwm_release(sc, NULL); @@ -3591,7 +3590,7 @@ iwm_newstate(struct ieee80211vap *vap, e break; } - in = (struct iwm_node *)vap->iv_bss; + in = IWM_NODE(vap->iv_bss); iwm_mvm_power_mac_update_mode(sc, in); iwm_mvm_enable_beacon_filter(sc, in); iwm_mvm_update_quotas(sc, in); @@ -4596,7 +4595,7 @@ iwm_attach(device_t dev) int txq_i, i; sc->sc_dev = dev; - mtx_init(&sc->sc_mtx, "iwm_mtx", MTX_DEF, 0); + IWM_LOCK_INIT(sc); mbufq_init(&sc->sc_snd, ifqmaxlen); callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); @@ -4985,7 +4984,7 @@ iwm_detach_local(struct iwm_softc *sc, i iwm_pci_detach(dev); mbufq_drain(&sc->sc_snd); - mtx_destroy(&sc->sc_mtx); + IWM_LOCK_DESTROY(sc); return (0); } Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- head/sys/dev/iwm/if_iwm_mac_ctxt.c Sun Jan 3 09:54:03 2016 (r293098) +++ head/sys/dev/iwm/if_iwm_mac_ctxt.c Sun Jan 3 10:06:10 2016 (r293099) @@ -426,7 +426,7 @@ iwm_mvm_mac_ctxt_cmd_station(struct iwm_ uint32_t action) { struct ieee80211_node *ni = vap->iv_bss; - struct iwm_node *in = (struct iwm_node *) ni; + struct iwm_node *in = IWM_NODE(ni); struct iwm_mac_ctx_cmd cmd; IWM_DPRINTF(sc, IWM_DEBUG_RESET, Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Sun Jan 3 09:54:03 2016 (r293098) +++ head/sys/dev/iwm/if_iwmvar.h Sun Jan 3 10:06:10 2016 (r293099) @@ -129,7 +129,6 @@ struct iwm_tx_radiotap_header { uint8_t wt_rate; uint16_t wt_chan_freq; uint16_t wt_chan_flags; - uint8_t wt_hwqueue; } __packed; #define IWM_TX_RADIOTAP_PRESENT \ @@ -152,9 +151,6 @@ struct iwm_tx_radiotap_header { #define IWM_FW_STATUS_INPROGRESS 1 #define IWM_FW_STATUS_DONE 2 -#define IWM_LOCK(_sc) mtx_lock(&sc->sc_mtx) -#define IWM_UNLOCK(_sc) mtx_unlock(&sc->sc_mtx) - enum iwm_ucode_type { IWM_UCODE_TYPE_INIT, IWM_UCODE_TYPE_REGULAR, @@ -244,12 +240,12 @@ struct iwm_dma_info { #define IWM_TX_RING_HIMARK 224 struct iwm_tx_data { - bus_dmamap_t map; - bus_addr_t cmd_paddr; - bus_addr_t scratch_paddr; - struct mbuf *m; - struct iwm_node *in; - int done; + bus_dmamap_t map; + bus_addr_t cmd_paddr; + bus_addr_t scratch_paddr; + struct mbuf *m; + struct iwm_node *in; + int done; }; struct iwm_tx_ring { @@ -295,12 +291,6 @@ struct iwm_rx_ring { int cur; }; -#define IWM_FLAG_USE_ICT 0x01 -#define IWM_FLAG_HW_INITED 0x02 -#define IWM_FLAG_STOPPED 0x04 -#define IWM_FLAG_RFKILL 0x08 -#define IWM_FLAG_BUSY 0x10 - struct iwm_ucode_status { uint32_t uc_error_event_table; uint32_t uc_log_event_table; @@ -371,68 +361,97 @@ struct iwm_bf_data { }; struct iwm_vap { - struct ieee80211vap iv_vap; - uint8_t macaddr[IEEE80211_ADDR_LEN]; - int is_uploaded; + struct ieee80211vap iv_vap; + int is_uploaded; + + int (*iv_newstate)(struct ieee80211vap *, + enum ieee80211_state, int); +}; +#define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) + +struct iwm_node { + struct ieee80211_node in_ni; + struct iwm_mvm_phy_ctxt *in_phyctxt; + + /* status "bits" */ + int in_assoc; + + struct iwm_lq_cmd in_lq; - int (*iv_newstate)(struct ieee80211vap *, enum ieee80211_state, int); + uint8_t in_ridx[IEEE80211_RATE_MAXSIZE]; }; +#define IWM_NODE(_ni) ((struct iwm_node *)(_ni)) + +#define IWM_STATION_ID 0 + +#define IWM_DEFAULT_MACID 0 +#define IWM_DEFAULT_COLOR 0 +#define IWM_DEFAULT_TSFID 0 -#define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) +#define IWM_ICT_SIZE 4096 +#define IWM_ICT_COUNT (IWM_ICT_SIZE / sizeof (uint32_t)) +#define IWM_ICT_PADDR_SHIFT 12 struct iwm_softc { + device_t sc_dev; + uint32_t sc_debug; + struct mtx sc_mtx; struct mbufq sc_snd; struct ieee80211com sc_ic; - device_t sc_dev; + + int sc_flags; +#define IWM_FLAG_USE_ICT (1 << 0) +#define IWM_FLAG_HW_INITED (1 << 1) +#define IWM_FLAG_STOPPED (1 << 2) +#define IWM_FLAG_RFKILL (1 << 3) +#define IWM_FLAG_BUSY (1 << 4) struct intr_config_hook sc_preinit_hook; - struct callout sc_watchdog_to; + struct callout sc_watchdog_to; struct task init_task; - struct resource *sc_irq; - struct resource *sc_mem; - bus_space_tag_t sc_st; - bus_space_handle_t sc_sh; - bus_size_t sc_sz; - bus_dma_tag_t sc_dmat; - void *sc_ih; + struct resource *sc_irq; + struct resource *sc_mem; + bus_space_tag_t sc_st; + bus_space_handle_t sc_sh; + bus_size_t sc_sz; + bus_dma_tag_t sc_dmat; + void *sc_ih; /* TX scheduler rings. */ - struct iwm_dma_info sched_dma; - uint32_t sched_base; + struct iwm_dma_info sched_dma; + uint32_t sched_base; /* TX/RX rings. */ - struct iwm_tx_ring txq[IWM_MVM_MAX_QUEUES]; - struct iwm_rx_ring rxq; - int qfullmsk; + struct iwm_tx_ring txq[IWM_MVM_MAX_QUEUES]; + struct iwm_rx_ring rxq; + int qfullmsk; - int sc_sf_state; + int sc_sf_state; /* ICT table. */ struct iwm_dma_info ict_dma; int ict_cur; - int sc_hw_rev; - int sc_hw_id; + int sc_hw_rev; + int sc_hw_id; - struct iwm_dma_info kw_dma; - struct iwm_dma_info fw_dma; + struct iwm_dma_info kw_dma; + struct iwm_dma_info fw_dma; - int sc_fw_chunk_done; - int sc_init_complete; + int sc_fw_chunk_done; + int sc_init_complete; - struct iwm_ucode_status sc_uc; - enum iwm_ucode_type sc_uc_current; - int sc_fwver; + struct iwm_ucode_status sc_uc; + enum iwm_ucode_type sc_uc_current; + int sc_fwver; - int sc_capaflags; - int sc_capa_max_probe_len; + int sc_capaflags; + int sc_capa_max_probe_len; - int sc_intmask; - int sc_flags; - uint32_t sc_debug; + int sc_intmask; /* * So why do we need a separate stopped flag and a generation? @@ -443,86 +462,63 @@ struct iwm_softc { * the device from interrupt context when it craps out, so we * don't have the luxury of waiting for quiescense. */ - int sc_generation; + int sc_generation; - const char *sc_fwname; - bus_size_t sc_fwdmasegsz; - struct iwm_fw_info sc_fw; - int sc_fw_phy_config; + const char *sc_fwname; + bus_size_t sc_fwdmasegsz; + struct iwm_fw_info sc_fw; + int sc_fw_phy_config; struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; - struct iwm_nvm_data sc_nvm; - struct iwm_phy_db sc_phy_db; + struct iwm_nvm_data sc_nvm; + struct iwm_phy_db sc_phy_db; - struct iwm_bf_data sc_bf; + struct iwm_bf_data sc_bf; - int sc_tx_timer; + int sc_tx_timer; - struct iwm_scan_cmd *sc_scan_cmd; - size_t sc_scan_cmd_len; - int sc_scan_last_antenna; - int sc_scanband; + struct iwm_scan_cmd *sc_scan_cmd; + size_t sc_scan_cmd_len; + int sc_scan_last_antenna; + int sc_scanband; - int sc_auth_prot; + int sc_auth_prot; - int sc_fixed_ridx; + int sc_fixed_ridx; - int sc_staid; - int sc_nodecolor; + int sc_staid; + int sc_nodecolor; - uint8_t sc_cmd_resp[IWM_CMD_RESP_MAX]; - int sc_wantresp; + uint8_t sc_cmd_resp[IWM_CMD_RESP_MAX]; + int sc_wantresp; - struct taskqueue *sc_tq; - struct task sc_es_task; + struct taskqueue *sc_tq; + struct task sc_es_task; - struct iwm_rx_phy_info sc_last_phy_info; - int sc_ampdu_ref; + struct iwm_rx_phy_info sc_last_phy_info; + int sc_ampdu_ref; - struct iwm_int_sta sc_aux_sta; + struct iwm_int_sta sc_aux_sta; /* phy contexts. we only use the first one */ - struct iwm_mvm_phy_ctxt sc_phyctxt[IWM_NUM_PHY_CTX]; + struct iwm_mvm_phy_ctxt sc_phyctxt[IWM_NUM_PHY_CTX]; struct iwm_notif_statistics sc_stats; - int sc_noise; + int sc_noise; - int host_interrupt_operation_mode; + int host_interrupt_operation_mode; caddr_t sc_drvbpf; - union { - struct iwm_rx_radiotap_header th; - uint8_t pad[IEEE80211_RADIOTAP_HDRLEN]; - } sc_rxtapu; -#define sc_rxtap sc_rxtapu.th - - union { - struct iwm_tx_radiotap_header th; - uint8_t pad[IEEE80211_RADIOTAP_HDRLEN]; - } sc_txtapu; -#define sc_txtap sc_txtapu.th - - int sc_max_rssi; -}; - -#define IWM_DEFAULT_MACID 0 -#define IWM_DEFAULT_COLOR 0 -#define IWM_DEFAULT_TSFID 0 - -struct iwm_node { - struct ieee80211_node in_ni; - struct iwm_mvm_phy_ctxt *in_phyctxt; - - /* status "bits" */ - int in_assoc; - - struct iwm_lq_cmd in_lq; + struct iwm_rx_radiotap_header sc_rxtap; + struct iwm_tx_radiotap_header sc_txtap; - uint8_t in_ridx[IEEE80211_RATE_MAXSIZE]; + int sc_max_rssi; }; -#define IWM_STATION_ID 0 -#define IWM_ICT_SIZE 4096 -#define IWM_ICT_COUNT (IWM_ICT_SIZE / sizeof (uint32_t)) -#define IWM_ICT_PADDR_SHIFT 12 +#define IWM_LOCK_INIT(_sc) \ + mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \ + MTX_NETWORK_LOCK, MTX_DEF); +#define IWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define IWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define IWM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) From owner-svn-src-all@freebsd.org Sun Jan 3 10:10:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EFD7A60897; Sun, 3 Jan 2016 10:10:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09387149C; Sun, 3 Jan 2016 10:10:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03AACt3044713; Sun, 3 Jan 2016 10:10:12 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03AACwR044712; Sun, 3 Jan 2016 10:10:12 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601031010.u03AACwR044712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 3 Jan 2016 10:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293100 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 10:10:13 -0000 Author: avos Date: Sun Jan 3 10:10:11 2016 New Revision: 293100 URL: https://svnweb.freebsd.org/changeset/base/293100 Log: iwm: convert to ieee80211_tx_complete() Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4755 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sun Jan 3 10:06:10 2016 (r293099) +++ head/sys/dev/iwm/if_iwm.c Sun Jan 3 10:10:11 2016 (r293100) @@ -270,7 +270,7 @@ static void iwm_mvm_rx_rx_phy_cmd(struct static int iwm_get_noise(const struct iwm_mvm_statistics_rx_non_phy *); static void iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_rx_data *); -static void iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, +static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_node *); static void iwm_mvm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *, @@ -2400,12 +2400,13 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, IWM_LOCK(sc); } -static void +static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, struct iwm_node *in) { struct iwm_mvm_tx_resp *tx_resp = (void *)pkt->data; - struct ieee80211vap *vap = in->in_ni.ni_vap; + struct ieee80211_node *ni = &in->in_ni; + struct ieee80211vap *vap = ni->ni_vap; int status = le16toh(tx_resp->status.status) & IWM_TX_STATUS_MSK; int failack = tx_resp->failure_frame; @@ -2414,14 +2415,13 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_soft /* Update rate control statistics. */ if (status != IWM_TX_STATUS_SUCCESS && status != IWM_TX_STATUS_DIRECT_DONE) { - if_inc_counter(vap->iv_ifp, IFCOUNTER_OERRORS, 1); - ieee80211_ratectl_tx_complete(vap, &in->in_ni, + ieee80211_ratectl_tx_complete(vap, ni, IEEE80211_RATECTL_TX_FAILURE, &failack, NULL); + return (1); } else { - if_inc_counter(vap->iv_ifp, IFCOUNTER_OPACKETS, 1); - ieee80211_ratectl_tx_complete(vap, &in->in_ni, + ieee80211_ratectl_tx_complete(vap, ni, IEEE80211_RATECTL_TX_SUCCESS, &failack, NULL); - + return (0); } } @@ -2435,33 +2435,30 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_tx_ring *ring = &sc->txq[qid]; struct iwm_tx_data *txd = &ring->data[idx]; struct iwm_node *in = txd->in; + struct mbuf *m = txd->m; + int status; + + KASSERT(txd->done == 0, ("txd not done")); + KASSERT(txd->in != NULL, ("txd without node")); + KASSERT(txd->m != NULL, ("txd without mbuf")); - if (txd->done) { - device_printf(sc->sc_dev, - "%s: got tx interrupt that's already been handled!\n", - __func__); - return; - } bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); sc->sc_tx_timer = 0; - iwm_mvm_rx_tx_cmd_single(sc, pkt, in); + status = iwm_mvm_rx_tx_cmd_single(sc, pkt, in); /* Unmap and free mbuf. */ bus_dmamap_sync(ring->data_dmat, txd->map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ring->data_dmat, txd->map); - m_freem(txd->m); IWM_DPRINTF(sc, IWM_DEBUG_XMIT, "free txd %p, in %p\n", txd, txd->in); - KASSERT(txd->done == 0, ("txd not done")); txd->done = 1; - KASSERT(txd->in, ("txd without node")); - txd->m = NULL; txd->in = NULL; - ieee80211_free_node((struct ieee80211_node *)in); + + ieee80211_tx_complete(&in->in_ni, m, status); if (--ring->queued < IWM_TX_RING_LOMARK) { sc->qfullmsk &= ~(1 << ring->qid); From owner-svn-src-all@freebsd.org Sun Jan 3 10:43:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A95C8A5F58B; Sun, 3 Jan 2016 10:43:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A41F19A3; Sun, 3 Jan 2016 10:43:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03AhOx6056481; Sun, 3 Jan 2016 10:43:24 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03AhNha056474; Sun, 3 Jan 2016 10:43:23 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601031043.u03AhNha056474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 3 Jan 2016 10:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293101 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 10:43:25 -0000 Author: melifaro Date: Sun Jan 3 10:43:23 2016 New Revision: 293101 URL: https://svnweb.freebsd.org/changeset/base/293101 Log: Remove 'struct route_int6' argument from in6_selectsrc() and in6_selectif(). The main task of in6_selectsrc() is to return IPv6 SAS (along with output interface used for scope checks). No data-path code uses route argument for caching. The only users are icmp6 (reflect code), ND6 ns/na generation code. All this fucntions are control-plane, so there is no reason to try to 'optimize' something by passing cached route into to ip6_output(). Given that, simplify code by eliminating in6_selectsrc() 'struct route_in6' argument. Since in6_selectif() is used only by in6_selectsrc(), eliminate its 'struct route_in6' argument, too. While here, reshape rte-related code inside in6_selectif() to free lookup result immediately after saving all the needed fields. Modified: head/sys/netinet6/icmp6.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_var.h head/sys/netinet6/nd6_nbr.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/icmp6.c Sun Jan 3 10:43:23 2016 (r293101) @@ -2184,7 +2184,6 @@ icmp6_reflect(struct mbuf *m, size_t off if (srcp == NULL) { int e; struct sockaddr_in6 sin6; - struct route_in6 ro; /* * This case matches to multicasts, our anycast, or unicasts @@ -2196,10 +2195,7 @@ icmp6_reflect(struct mbuf *m, size_t off sin6.sin6_len = sizeof(sin6); sin6.sin6_addr = ip6->ip6_dst; /* zone ID should be embedded */ - bzero(&ro, sizeof(ro)); - e = in6_selectsrc(&sin6, NULL, NULL, &ro, NULL, &outif, &src); - if (ro.ro_rt) - RTFREE(ro.ro_rt); /* XXX: we could use this */ + e = in6_selectsrc(&sin6, NULL, NULL, NULL, &outif, &src); if (e) { char ip6buf[INET6_ADDRSTRLEN]; nd6log((LOG_DEBUG, Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/in6_pcb.c Sun Jan 3 10:43:23 2016 (r293101) @@ -359,7 +359,7 @@ in6_pcbladdr(register struct inpcb *inp, return (error); error = in6_selectsrc(sin6, inp->in6p_outputopts, - inp, NULL, inp->inp_cred, &ifp, &in6a); + inp, inp->inp_cred, &ifp, &in6a); if (error) return (error); Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/in6_src.c Sun Jan 3 10:43:23 2016 (r293101) @@ -134,7 +134,7 @@ static int selectroute(struct sockaddr_i struct ip6_moptions *, struct route_in6 *, struct ifnet **, struct rtentry **, int, u_int); static int in6_selectif(struct sockaddr_in6 *, struct ip6_pktopts *, - struct ip6_moptions *, struct route_in6 *ro, struct ifnet **, + struct ip6_moptions *, struct ifnet **, struct ifnet *, u_int); static struct in6_addrpolicy *lookup_addrsel_policy(struct sockaddr_in6 *); @@ -177,7 +177,7 @@ static struct in6_addrpolicy *match_addr int in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, - struct inpcb *inp, struct route_in6 *ro, struct ucred *cred, + struct inpcb *inp, struct ucred *cred, struct ifnet **ifpp, struct in6_addr *srcp) { struct rm_priotracker in6_ifa_tracker; @@ -227,7 +227,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso struct in6_ifaddr *ia6; /* get the outgoing interface */ - if ((error = in6_selectif(dstsock, opts, mopts, ro, &ifp, oifp, + if ((error = in6_selectif(dstsock, opts, mopts, &ifp, oifp, (inp != NULL) ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB)) != 0) return (error); @@ -293,7 +293,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso * the outgoing interface and the destination address. */ /* get the outgoing interface */ - if ((error = in6_selectif(dstsock, opts, mopts, ro, &ifp, oifp, + if ((error = in6_selectif(dstsock, opts, mopts, &ifp, oifp, (inp != NULL) ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB)) != 0) return (error); @@ -761,24 +761,27 @@ selectroute(struct sockaddr_in6 *dstsock static int in6_selectif(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, - struct ip6_moptions *mopts, struct route_in6 *ro, struct ifnet **retifp, + struct ip6_moptions *mopts, struct ifnet **retifp, struct ifnet *oifp, u_int fibnum) { int error; struct route_in6 sro; struct rtentry *rt = NULL; + int rt_flags; KASSERT(retifp != NULL, ("%s: retifp is NULL", __func__)); - if (ro == NULL) { - bzero(&sro, sizeof(sro)); - ro = &sro; - } + bzero(&sro, sizeof(sro)); + rt_flags = 0; + + error = selectroute(dstsock, opts, mopts, &sro, retifp, &rt, 1, fibnum); + + if (rt) + rt_flags = rt->rt_flags; + if (rt && rt == sro.ro_rt) + RTFREE(rt); - if ((error = selectroute(dstsock, opts, mopts, ro, retifp, - &rt, 1, fibnum)) != 0) { - if (ro == &sro && rt && rt == sro.ro_rt) - RTFREE(rt); + if (error != 0) { /* Help ND. See oifp comment in in6_selectsrc(). */ if (oifp != NULL && fibnum == RT_DEFAULT_FIB) { *retifp = oifp; @@ -804,16 +807,12 @@ in6_selectif(struct sockaddr_in6 *dstsoc * Although this may not be very harmful, it should still be confusing. * We thus reject the case here. */ - if (rt && (rt->rt_flags & (RTF_REJECT | RTF_BLACKHOLE))) { - int flags = (rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH); - if (ro == &sro && rt && rt == sro.ro_rt) - RTFREE(rt); - return (flags); + if (rt_flags & (RTF_REJECT | RTF_BLACKHOLE)) { + error = (rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH); + return (error); } - if (ro == &sro && rt && rt == sro.ro_rt) - RTFREE(rt); return (0); } Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/ip6_var.h Sun Jan 3 10:43:23 2016 (r293101) @@ -419,7 +419,7 @@ int dest6_input(struct mbuf **, int *, i int none_input(struct mbuf **, int *, int); int in6_selectsrc(struct sockaddr_in6 *, struct ip6_pktopts *, - struct inpcb *inp, struct route_in6 *, struct ucred *cred, + struct inpcb *inp, struct ucred *cred, struct ifnet **, struct in6_addr *); int in6_selectroute(struct sockaddr_in6 *, struct ip6_pktopts *, struct ip6_moptions *, struct route_in6 *, struct ifnet **, Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/nd6_nbr.c Sun Jan 3 10:43:23 2016 (r293101) @@ -408,7 +408,6 @@ nd6_ns_output_fib(struct ifnet *ifp, con int icmp6len; int maxlen; caddr_t mac; - struct route_in6 ro; if (IN6_IS_ADDR_MULTICAST(taddr6)) return; @@ -428,8 +427,6 @@ nd6_ns_output_fib(struct ifnet *ifp, con return; M_SETFIB(m, fibnum); - bzero(&ro, sizeof(ro)); - if (daddr6 == NULL || IN6_IS_ADDR_MULTICAST(daddr6)) { m->m_flags |= M_MCAST; im6o.im6o_multicast_ifp = ifp; @@ -497,7 +494,7 @@ nd6_ns_output_fib(struct ifnet *ifp, con oifp = ifp; error = in6_selectsrc(&dst_sa, NULL, - NULL, &ro, NULL, &oifp, &src_in); + NULL, NULL, &oifp, &src_in); if (error) { char ip6buf[INET6_ADDRSTRLEN]; nd6log((LOG_DEBUG, "%s: source can't be " @@ -585,21 +582,15 @@ nd6_ns_output_fib(struct ifnet *ifp, con m_tag_prepend(m, mtag); } - ip6_output(m, NULL, &ro, (nonce != NULL) ? IPV6_UNSPECSRC : 0, + ip6_output(m, NULL, NULL, (nonce != NULL) ? IPV6_UNSPECSRC : 0, &im6o, NULL, NULL); icmp6_ifstat_inc(ifp, ifs6_out_msg); icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit); ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_SOLICIT]); - /* We don't cache this route. */ - RO_RTFREE(&ro); - return; bad: - if (ro.ro_rt) { - RTFREE(ro.ro_rt); - } m_freem(m); return; } @@ -960,9 +951,6 @@ nd6_na_output_fib(struct ifnet *ifp, con struct sockaddr_in6 dst_sa; int icmp6len, maxlen, error; caddr_t mac = NULL; - struct route_in6 ro; - - bzero(&ro, sizeof(ro)); daddr6 = *daddr6_0; /* make a local copy for modification */ @@ -1020,9 +1008,8 @@ nd6_na_output_fib(struct ifnet *ifp, con /* * Select a source whose scope is the same as that of the dest. */ - bcopy(&dst_sa, &ro.ro_dst, sizeof(dst_sa)); oifp = ifp; - error = in6_selectsrc(&dst_sa, NULL, NULL, &ro, NULL, &oifp, &src); + error = in6_selectsrc(&dst_sa, NULL, NULL, NULL, &oifp, &src); if (error) { char ip6buf[INET6_ADDRSTRLEN]; nd6log((LOG_DEBUG, "nd6_na_output: source can't be " @@ -1093,20 +1080,14 @@ nd6_na_output_fib(struct ifnet *ifp, con m_tag_prepend(m, mtag); } - ip6_output(m, NULL, &ro, 0, &im6o, NULL, NULL); + ip6_output(m, NULL, NULL, 0, &im6o, NULL, NULL); icmp6_ifstat_inc(ifp, ifs6_out_msg); icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert); ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_ADVERT]); - /* We don't cache this route. */ - RO_RTFREE(&ro); - return; bad: - if (ro.ro_rt) { - RTFREE(ro.ro_rt); - } m_freem(m); return; } Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/raw_ip6.c Sun Jan 3 10:43:23 2016 (r293101) @@ -460,7 +460,7 @@ rip6_output(struct mbuf *m, struct socke /* * Source address selection. */ - error = in6_selectsrc(dstsock, optp, in6p, NULL, so->so_cred, + error = in6_selectsrc(dstsock, optp, in6p, so->so_cred, &oifp, &in6a); if (error) goto bad; @@ -814,7 +814,7 @@ rip6_connect(struct socket *so, struct s INP_WLOCK(inp); /* Source address selection. XXX: need pcblookup? */ error = in6_selectsrc(addr, inp->in6p_outputopts, - inp, NULL, so->so_cred, &ifp, &in6a); + inp, so->so_cred, &ifp, &in6a); if (error) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_ripcbinfo); Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/udp6_usrreq.c Sun Jan 3 10:43:23 2016 (r293101) @@ -731,7 +731,7 @@ udp6_output(struct inpcb *inp, struct mb } if (!IN6_IS_ADDR_V4MAPPED(faddr)) { - error = in6_selectsrc(sin6, optp, inp, NULL, + error = in6_selectsrc(sin6, optp, inp, td->td_ucred, &oifp, &in6a); if (error) goto release; From owner-svn-src-all@freebsd.org Sun Jan 3 11:22:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9F1DA602D3; Sun, 3 Jan 2016 11:22:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8662119CA; Sun, 3 Jan 2016 11:22:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03BMFcU067991; Sun, 3 Jan 2016 11:22:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03BMFl0067990; Sun, 3 Jan 2016 11:22:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601031122.u03BMFl0067990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 11:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293102 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 11:22:16 -0000 Author: ngie Date: Sun Jan 3 11:22:15 2016 New Revision: 293102 URL: https://svnweb.freebsd.org/changeset/base/293102 Log: Add sys/types.h for for size_t, etc stable/10 requires it due to header pollution MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libnv/tests/dnv_tests.cc Modified: head/lib/libnv/tests/dnv_tests.cc ============================================================================== --- head/lib/libnv/tests/dnv_tests.cc Sun Jan 3 10:43:23 2016 (r293101) +++ head/lib/libnv/tests/dnv_tests.cc Sun Jan 3 11:22:15 2016 (r293102) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include From owner-svn-src-all@freebsd.org Sun Jan 3 14:42:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7549AA60981; Sun, 3 Jan 2016 14:42:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 434D61FA0; Sun, 3 Jan 2016 14:42:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03EgSjl028559; Sun, 3 Jan 2016 14:42:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03EgSZq028558; Sun, 3 Jan 2016 14:42:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601031442.u03EgSZq028558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 3 Jan 2016 14:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293104 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 14:42:29 -0000 Author: ian Date: Sun Jan 3 14:42:28 2016 New Revision: 293104 URL: https://svnweb.freebsd.org/changeset/base/293104 Log: Store the pointer to the bootloader-provided env data in a static var for use in debug printing. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Jan 3 12:25:57 2016 (r293103) +++ head/sys/arm/arm/machdep.c Sun Jan 3 14:42:28 2016 (r293104) @@ -194,6 +194,8 @@ int _min_bzero_size = 0; extern int *end; #ifdef FDT +static char *loader_envp; + vm_paddr_t pmap_pa; #ifdef ARM_NEW_PMAP @@ -1110,7 +1112,8 @@ freebsd_parse_boot_param(struct arm_boot return 0; boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - init_static_kenv(MD_FETCH(kmdp, MODINFOMD_ENVP, char *), 0); + loader_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); + init_static_kenv(loader_envp, 0); lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); @@ -1433,13 +1436,13 @@ print_kenv(void) char *cp; debugf("loader passed (static) kenv:\n"); - if (kern_envp == NULL) { + if (loader_envp == NULL) { debugf(" no env, null ptr\n"); return; } - debugf(" kern_envp = 0x%08x\n", (uint32_t)kern_envp); + debugf(" loader_envp = 0x%08x\n", (uint32_t)loader_envp); - for (cp = kern_envp; cp != NULL; cp = kenv_next(cp)) + for (cp = loader_envp; cp != NULL; cp = kenv_next(cp)) debugf(" %x %s\n", (uint32_t)cp, cp); } From owner-svn-src-all@freebsd.org Sun Jan 3 14:46:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1670DA60B95; Sun, 3 Jan 2016 14:46:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D808014A5; Sun, 3 Jan 2016 14:46:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03EkJT5029160; Sun, 3 Jan 2016 14:46:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03EkJdH029159; Sun, 3 Jan 2016 14:46:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601031446.u03EkJdH029159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 3 Jan 2016 14:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293105 - head/sys/dev/rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 14:46:21 -0000 Author: ian Date: Sun Jan 3 14:46:19 2016 New Revision: 293105 URL: https://svnweb.freebsd.org/changeset/base/293105 Log: Eliminate code for walking through the early static env data. This code is called from a device attach routine, and thus cannot be called before the cutover from static to dynamic kernel env. Modified: head/sys/dev/rt/if_rt.c Modified: head/sys/dev/rt/if_rt.c ============================================================================== --- head/sys/dev/rt/if_rt.c Sun Jan 3 14:42:28 2016 (r293104) +++ head/sys/dev/rt/if_rt.c Sun Jan 3 14:46:19 2016 (r293105) @@ -227,20 +227,6 @@ macaddr_atoi(const char *str, uint8_t *m } #ifdef USE_GENERATED_MAC_ADDRESS -static char * -kernenv_next(char *cp) -{ - - if (cp != NULL) { - while (*cp != 0) - cp++; - cp++; - if (*cp == 0) - cp = NULL; - } - return (cp); -} - /* * generate_mac(uin8_t *mac) * This is MAC address generator for cases when real device MAC address @@ -259,14 +245,8 @@ generate_mac(uint8_t *mac) uint32_t crc = 0xffffffff; /* Generate CRC32 on kenv */ - if (dynamic_kenv) { - for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) { - crc = calculate_crc32c(crc, cp, strlen(cp) + 1); - } - } else { - for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { - crc = calculate_crc32c(crc, cp, strlen(cp) + 1); - } + for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) { + crc = calculate_crc32c(crc, cp, strlen(cp) + 1); } crc = ~crc; From owner-svn-src-all@freebsd.org Sun Jan 3 15:24:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E0A1A5F9A1; Sun, 3 Jan 2016 15:24:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 001C41D13; Sun, 3 Jan 2016 15:24:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03FOw7h041545; Sun, 3 Jan 2016 15:24:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03FOwgC041544; Sun, 3 Jan 2016 15:24:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601031524.u03FOwgC041544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 3 Jan 2016 15:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293106 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 15:24:59 -0000 Author: jhibbits Date: Sun Jan 3 15:24:57 2016 New Revision: 293106 URL: https://svnweb.freebsd.org/changeset/base/293106 Log: Add error interrupt handler for Freescale PCI errors This eliminates a 'interrupt storm' warning spam with the P5020. Obtained from: Semihalf Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sun Jan 3 14:46:19 2016 (r293105) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sun Jan 3 15:24:57 2016 (r293106) @@ -94,6 +94,29 @@ __FBSDID("$FreeBSD$"); #define REG_PEX_ERR_DR 0x0e00 #define REG_PEX_ERR_EN 0x0e08 +#define REG_PEX_ERR_DR 0x0e00 +#define REG_PEX_ERR_DR_ME 0x80000000 +#define REG_PEX_ERR_DR_PCT 0x800000 +#define REG_PEX_ERR_DR_PAT 0x400000 +#define REG_PEX_ERR_DR_PCAC 0x200000 +#define REG_PEX_ERR_DR_PNM 0x100000 +#define REG_PEX_ERR_DR_CDNSC 0x80000 +#define REG_PEX_ERR_DR_CRSNC 0x40000 +#define REG_PEX_ERR_DR_ICCA 0x20000 +#define REG_PEX_ERR_DR_IACA 0x10000 +#define REG_PEX_ERR_DR_CRST 0x8000 +#define REG_PEX_ERR_DR_MIS 0x4000 +#define REG_PEX_ERR_DR_IOIS 0x2000 +#define REG_PEX_ERR_DR_CIS 0x1000 +#define REG_PEX_ERR_DR_CIEP 0x800 +#define REG_PEX_ERR_DR_IOIEP 0x400 +#define REG_PEX_ERR_DR_OAC 0x200 +#define REG_PEX_ERR_DR_IOIA 0x100 +#define REG_PEX_ERR_DR_IMBA 0x80 +#define REG_PEX_ERR_DR_IIOBA 0x40 +#define REG_PEX_ERR_DR_LDDE 0x20 +#define REG_PEX_ERR_EN 0x0e08 + #define PCIR_LTSSM 0x404 #define LTSSM_STAT_L0 0x16 @@ -113,6 +136,9 @@ struct fsl_pcib_softc { bus_space_tag_t sc_bst; int sc_rid; + struct resource *sc_irq_res; + void *sc_ih; + int sc_busnr; int sc_pcie; uint8_t sc_pcie_capreg; /* PCI-E Capability Reg Set */ @@ -122,6 +148,34 @@ struct fsl_pcib_softc { int sc_devfn_via_ide; }; +struct fsl_pcib_err_dr { + const char *msg; + uint32_t err_dr_mask; +}; + +static const struct fsl_pcib_err_dr pci_err[] = { + {"ME", REG_PEX_ERR_DR_ME}, + {"PCT", REG_PEX_ERR_DR_PCT}, + {"PAT", REG_PEX_ERR_DR_PAT}, + {"PCAC", REG_PEX_ERR_DR_PCAC}, + {"PNM", REG_PEX_ERR_DR_PNM}, + {"CDNSC", REG_PEX_ERR_DR_CDNSC}, + {"CRSNC", REG_PEX_ERR_DR_CRSNC}, + {"ICCA", REG_PEX_ERR_DR_ICCA}, + {"IACA", REG_PEX_ERR_DR_IACA}, + {"CRST", REG_PEX_ERR_DR_CRST}, + {"MIS", REG_PEX_ERR_DR_MIS}, + {"IOIS", REG_PEX_ERR_DR_IOIS}, + {"CIS", REG_PEX_ERR_DR_CIS}, + {"CIEP", REG_PEX_ERR_DR_CIEP}, + {"IOIEP", REG_PEX_ERR_DR_IOIEP}, + {"OAC", REG_PEX_ERR_DR_OAC}, + {"IOIA", REG_PEX_ERR_DR_IOIA}, + {"IMBA", REG_PEX_ERR_DR_IMBA}, + {"IIOBA", REG_PEX_ERR_DR_IIOBA}, + {"LDDE", REG_PEX_ERR_DR_LDDE} +}; + /* Local forward declerations. */ static uint32_t fsl_pcib_cfgread(struct fsl_pcib_softc *, u_int, u_int, u_int, u_int, int); @@ -173,6 +227,35 @@ DEFINE_CLASS_1(pcib, fsl_pcib_driver, fs DRIVER_MODULE(pcib, ofwbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0); static int +fsl_pcib_err_intr(void *v) +{ + struct fsl_pcib_softc *sc; + device_t dev; + uint32_t err_reg, clear_reg; + uint8_t i; + + dev = (device_t)v; + sc = device_get_softc(dev); + + clear_reg = 0; + err_reg = bus_space_read_4(sc->sc_bst, sc->sc_bsh, REG_PEX_ERR_DR); + + /* Check which one error occurred */ + for (i = 0; i < sizeof(pci_err)/sizeof(struct fsl_pcib_err_dr); i++) { + if (err_reg & pci_err[i].err_dr_mask) { + device_printf(dev, "PCI %d: report %s error\n", + device_get_unit(dev), pci_err[i].msg); + clear_reg |= pci_err[i].err_dr_mask; + } + } + + /* Clear pending errors */ + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_PEX_ERR_DR, clear_reg); + + return (0); +} + +static int fsl_pcib_probe(device_t dev) { @@ -198,7 +281,7 @@ fsl_pcib_attach(device_t dev) struct fsl_pcib_softc *sc; phandle_t node; uint32_t cfgreg; - int maxslot, error; + int error, maxslot, rid; uint8_t ltssm, capptr; sc = device_get_softc(dev); @@ -279,6 +362,34 @@ fsl_pcib_attach(device_t dev) } } + /* Allocate irq */ + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE | RF_SHAREABLE); + if (sc->sc_irq_res == NULL) { + error = fsl_pcib_detach(dev); + if (error != 0) { + device_printf(dev, + "Detach of the driver failed with error %d\n", + error); + } + return (ENXIO); + } + + /* Setup interrupt handler */ + error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, (driver_intr_t *)fsl_pcib_err_intr, dev, &sc->sc_ih); + if (error != 0) { + device_printf(dev, "Could not setup irq, %d\n", error); + sc->sc_ih = NULL; + error = fsl_pcib_detach(dev); + if (error != 0) { + device_printf(dev, + "Detach of the driver failed with error %d\n", + error); + } + return (ENXIO); + } + fsl_pcib_err_init(dev); return (ofw_pci_attach(dev)); From owner-svn-src-all@freebsd.org Sun Jan 3 15:35:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57A35A5FCDD; Sun, 3 Jan 2016 15:35:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24F741151; Sun, 3 Jan 2016 15:35:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03FZ18x044359; Sun, 3 Jan 2016 15:35:01 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03FZ188044358; Sun, 3 Jan 2016 15:35:01 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601031535.u03FZ188044358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 3 Jan 2016 15:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293107 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 15:35:02 -0000 Author: jhibbits Date: Sun Jan 3 15:35:01 2016 New Revision: 293107 URL: https://svnweb.freebsd.org/changeset/base/293107 Log: Initialize the rid for input. Left uninitialized, random rid causes the IRQ setup to fail, and the PCI device to not be attached. Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sun Jan 3 15:24:57 2016 (r293106) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sun Jan 3 15:35:01 2016 (r293107) @@ -363,6 +363,7 @@ fsl_pcib_attach(device_t dev) } /* Allocate irq */ + rid = 0; sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | RF_SHAREABLE); if (sc->sc_irq_res == NULL) { From owner-svn-src-all@freebsd.org Sun Jan 3 16:13:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02586A607A8; Sun, 3 Jan 2016 16:13:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC46A1169; Sun, 3 Jan 2016 16:13:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03GD31J057209; Sun, 3 Jan 2016 16:13:03 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03GD3mG057208; Sun, 3 Jan 2016 16:13:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601031613.u03GD3mG057208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 3 Jan 2016 16:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293108 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 16:13:05 -0000 Author: melifaro Date: Sun Jan 3 16:13:03 2016 New Revision: 293108 URL: https://svnweb.freebsd.org/changeset/base/293108 Log: Fix fib4_lookup_nh_ext() flags/flowid order messed up while merging. Modified: head/sys/netinet/in_fib.c Modified: head/sys/netinet/in_fib.c ============================================================================== --- head/sys/netinet/in_fib.c Sun Jan 3 15:35:01 2016 (r293107) +++ head/sys/netinet/in_fib.c Sun Jan 3 16:13:03 2016 (r293108) @@ -175,8 +175,8 @@ fib4_lookup_nh_basic(uint32_t fibnum, st * - howewer mtu from "transmit" interface will be returned. */ int -fib4_lookup_nh_ext(uint32_t fibnum, struct in_addr dst, uint32_t flowid, - uint32_t flags, struct nhop4_extended *pnh4) +fib4_lookup_nh_ext(uint32_t fibnum, struct in_addr dst, uint32_t flags, + uint32_t flowid, struct nhop4_extended *pnh4) { struct radix_node_head *rh; struct radix_node *rn; From owner-svn-src-all@freebsd.org Sun Jan 3 17:19:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4A0BA60123; Sun, 3 Jan 2016 17:19:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B27561987; Sun, 3 Jan 2016 17:19:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03HJHXf075637; Sun, 3 Jan 2016 17:19:17 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03HJHBB075636; Sun, 3 Jan 2016 17:19:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601031719.u03HJHBB075636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 3 Jan 2016 17:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r293109 - in stable: 10/share/mk 9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:19:19 -0000 Author: dim Date: Sun Jan 3 17:19:17 2016 New Revision: 293109 URL: https://svnweb.freebsd.org/changeset/base/293109 Log: MFC r293014: Merge r293006 from clang380-import branch: For determining the compiler version, quote the string to be echo'd, otherwise the command might fail. This is because clang -v now results in the following: FreeBSD clang version 3.8.0 (trunk 256633) (based on LLVM 3.8.0svn) The second "3.8.8svn)" string tripped up the shell command. Modified: stable/9/share/mk/bsd.compiler.mk Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/mk/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/mk/bsd.compiler.mk Directory Properties: stable/10/ (props changed) Modified: stable/9/share/mk/bsd.compiler.mk ============================================================================== --- stable/9/share/mk/bsd.compiler.mk Sun Jan 3 16:13:03 2016 (r293108) +++ stable/9/share/mk/bsd.compiler.mk Sun Jan 3 17:19:17 2016 (r293109) @@ -40,7 +40,7 @@ COMPILER_TYPE:= clang . endif .endif .if !defined(COMPILER_VERSION) -COMPILER_VERSION!=echo ${_v:M[1-9].[0-9]*} | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' +COMPILER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .endif .undef _v .endif From owner-svn-src-all@freebsd.org Sun Jan 3 17:19:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 270DCA60127; Sun, 3 Jan 2016 17:19:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8CFA1988; Sun, 3 Jan 2016 17:19:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03HJIOS075643; Sun, 3 Jan 2016 17:19:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03HJIo7075642; Sun, 3 Jan 2016 17:19:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601031719.u03HJIo7075642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 3 Jan 2016 17:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293109 - in stable: 10/share/mk 9/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:19:19 -0000 Author: dim Date: Sun Jan 3 17:19:17 2016 New Revision: 293109 URL: https://svnweb.freebsd.org/changeset/base/293109 Log: MFC r293014: Merge r293006 from clang380-import branch: For determining the compiler version, quote the string to be echo'd, otherwise the command might fail. This is because clang -v now results in the following: FreeBSD clang version 3.8.0 (trunk 256633) (based on LLVM 3.8.0svn) The second "3.8.8svn)" string tripped up the shell command. Modified: stable/10/share/mk/bsd.compiler.mk Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/mk/bsd.compiler.mk Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/mk/ (props changed) Modified: stable/10/share/mk/bsd.compiler.mk ============================================================================== --- stable/10/share/mk/bsd.compiler.mk Sun Jan 3 16:13:03 2016 (r293108) +++ stable/10/share/mk/bsd.compiler.mk Sun Jan 3 17:19:17 2016 (r293109) @@ -40,7 +40,7 @@ COMPILER_TYPE:= clang . endif .endif .if !defined(COMPILER_VERSION) -COMPILER_VERSION!=echo ${_v:M[1-9].[0-9]*} | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' +COMPILER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .endif .undef _v .endif From owner-svn-src-all@freebsd.org Sun Jan 3 17:23:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC16CA60368; Sun, 3 Jan 2016 17:23:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B1631E90; Sun, 3 Jan 2016 17:23:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03HNGC6078400; Sun, 3 Jan 2016 17:23:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03HNGoU078399; Sun, 3 Jan 2016 17:23:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601031723.u03HNGoU078399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 3 Jan 2016 17:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r293110 - in stable: 10/contrib/pf/pflogd 9/contrib/pf/pflogd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:23:17 -0000 Author: dim Date: Sun Jan 3 17:23:16 2016 New Revision: 293110 URL: https://svnweb.freebsd.org/changeset/base/293110 Log: MFC r293015: Merge r293013 from clang380-import branch: Fix a clang 3.8.0 warning in pflogd.c: contrib/pf/pflogd/pflogd.c:769:8: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses] if (!if_exists(interface) == -1) { ^ ~~ The if_exists() function does not return -1, and even if it did, it would not be the correct way to check. Just ditch the == -1 instead. Obtained from: OpenBSD's pflogd.c 1.49 Modified: stable/9/contrib/pf/pflogd/pflogd.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/pf/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/pf/pflogd/pflogd.c Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/pf/pflogd/pflogd.c ============================================================================== --- stable/9/contrib/pf/pflogd/pflogd.c Sun Jan 3 17:19:17 2016 (r293109) +++ stable/9/contrib/pf/pflogd/pflogd.c Sun Jan 3 17:23:16 2016 (r293110) @@ -766,7 +766,7 @@ main(int argc, char **argv) np = pcap_dispatch(hpcap, PCAP_NUM_PKTS, phandler, (u_char *)dpcap); if (np < 0) { - if (!if_exists(interface) == -1) { + if (!if_exists(interface)) { logmsg(LOG_NOTICE, "interface %s went away", interface); ret = -1; From owner-svn-src-all@freebsd.org Sun Jan 3 17:23:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D294A6036C; Sun, 3 Jan 2016 17:23:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E03611E92; Sun, 3 Jan 2016 17:23:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03HNGHq078406; Sun, 3 Jan 2016 17:23:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03HNG5f078405; Sun, 3 Jan 2016 17:23:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601031723.u03HNG5f078405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 3 Jan 2016 17:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293110 - in stable: 10/contrib/pf/pflogd 9/contrib/pf/pflogd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:23:18 -0000 Author: dim Date: Sun Jan 3 17:23:16 2016 New Revision: 293110 URL: https://svnweb.freebsd.org/changeset/base/293110 Log: MFC r293015: Merge r293013 from clang380-import branch: Fix a clang 3.8.0 warning in pflogd.c: contrib/pf/pflogd/pflogd.c:769:8: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses] if (!if_exists(interface) == -1) { ^ ~~ The if_exists() function does not return -1, and even if it did, it would not be the correct way to check. Just ditch the == -1 instead. Obtained from: OpenBSD's pflogd.c 1.49 Modified: stable/10/contrib/pf/pflogd/pflogd.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/pf/pflogd/pflogd.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/pf/ (props changed) Modified: stable/10/contrib/pf/pflogd/pflogd.c ============================================================================== --- stable/10/contrib/pf/pflogd/pflogd.c Sun Jan 3 17:19:17 2016 (r293109) +++ stable/10/contrib/pf/pflogd/pflogd.c Sun Jan 3 17:23:16 2016 (r293110) @@ -766,7 +766,7 @@ main(int argc, char **argv) np = pcap_dispatch(hpcap, PCAP_NUM_PKTS, phandler, (u_char *)dpcap); if (np < 0) { - if (!if_exists(interface) == -1) { + if (!if_exists(interface)) { logmsg(LOG_NOTICE, "interface %s went away", interface); ret = -1; From owner-svn-src-all@freebsd.org Sun Jan 3 17:38:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18337A607A4; Sun, 3 Jan 2016 17:38:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D478E18CC; Sun, 3 Jan 2016 17:38:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::8c53:746d:a745:9178] (unknown [IPv6:2001:7b8:3a7:0:8c53:746d:a745:9178]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id EB45B15323; Sun, 3 Jan 2016 18:38:17 +0100 (CET) Subject: Re: svn commit: r293063 - head/sys/arm/arm Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_81799234-ABAC-430F-ABDC-8FBB58FAD3BF"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: <1451774206.1369.109.camel@freebsd.org> Date: Sun, 3 Jan 2016 18:39:21 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <11380830-624D-437F-B305-902C3BBA4C4C@FreeBSD.org> References: <201601022231.u02MVEb5037283@repo.freebsd.org> <1451774206.1369.109.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:38:22 -0000 --Apple-Mail=_81799234-ABAC-430F-ABDC-8FBB58FAD3BF Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 02 Jan 2016, at 23:36, Ian Lepore wrote: > > On Sat, 2016-01-02 at 22:31 +0000, Ian Lepore wrote: ... > > Bah. This is not what I intended to commit, I was going to reword that > comment block to better match what I found while testing. I was > editing the commit message when I decided to do that, so I hit ^C in > the shell that was waiting for me to finish editing in emacs, and to my > surprise it sent the commit instead of cancelling. What's the right > way to change your mind at this late stage of a commit? Ensure that the temporary file created by Subversion is either completely empty, or deleted. This will abort the commit. Alternatively, type a commit message at leisure before committing, save it in a file, and use: svn ci -F commit-message.txt This is what I do. I almost never let Subversion start an editor for me, that is. -Dimitry --Apple-Mail=_81799234-ABAC-430F-ABDC-8FBB58FAD3BF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlaJXNcACgkQsF6jCi4glqOQCQCgxPT9hVTLKZvjR0fCCIKsle+F EsUAnAo71dBKBiY6TNNSV7DunCI9AxgO =E9bg -----END PGP SIGNATURE----- --Apple-Mail=_81799234-ABAC-430F-ABDC-8FBB58FAD3BF-- From owner-svn-src-all@freebsd.org Sun Jan 3 17:40:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2598A60847; Sun, 3 Jan 2016 17:40:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A932D1A87; Sun, 3 Jan 2016 17:40:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::8c53:746d:a745:9178] (unknown [IPv6:2001:7b8:3a7:0:8c53:746d:a745:9178]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A2D991532A; Sun, 3 Jan 2016 18:40:16 +0100 (CET) Subject: Re: svn commit: r293068 - in head/etc: . mtree Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_9B8EE1A0-FFC2-456D-94D0-301835FEF65E"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: <201601030432.u034W6en043633@repo.freebsd.org> Date: Sun, 3 Jan 2016 18:41:33 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201601030432.u034W6en043633@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:40:19 -0000 --Apple-Mail=_9B8EE1A0-FFC2-456D-94D0-301835FEF65E Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 03 Jan 2016, at 05:32, Warner Losh wrote: > > Author: imp > Date: Sun Jan 3 04:32:05 2016 > New Revision: 293068 > URL: https://svnweb.freebsd.org/changeset/base/293068 > > Log: > Add libsoft to the tree, just like lib32. Hmm, are there going to be more of these "multilib" things? :) -Dimitry --Apple-Mail=_9B8EE1A0-FFC2-456D-94D0-301835FEF65E Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlaJXU0ACgkQsF6jCi4glqMM2gCeMocczNkWHua2Ul9qruXkxfhq MNUAniODwOwH5wEvzkLD+DfdfvW4VS4D =a2qY -----END PGP SIGNATURE----- --Apple-Mail=_9B8EE1A0-FFC2-456D-94D0-301835FEF65E-- From owner-svn-src-all@freebsd.org Sun Jan 3 17:58:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C21BA60119; Sun, 3 Jan 2016 17:58:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CD201F42; Sun, 3 Jan 2016 17:58:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03HwBlO088502; Sun, 3 Jan 2016 17:58:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03HwBuU088500; Sun, 3 Jan 2016 17:58:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201601031758.u03HwBuU088500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 Jan 2016 17:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293111 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:58:12 -0000 Author: adrian Date: Sun Jan 3 17:58:11 2016 New Revision: 293111 URL: https://svnweb.freebsd.org/changeset/base/293111 Log: [ath] remove the inline version of the register access macros. These are going to be much more efficient on low end embedded systems but unfortunately they make it .. less convenient to implement correct bus barriers and debugging. They also didn't implement the register serialisation workaround required for Owl (AR5416.) So, just remove them for now. Later on I'll just inline the routines from ah_osdep.c. Modified: head/sys/dev/ath/ah_osdep.c head/sys/dev/ath/ah_osdep.h Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Sun Jan 3 17:23:16 2016 (r293110) +++ head/sys/dev/ath/ah_osdep.c Sun Jan 3 17:58:11 2016 (r293111) @@ -270,12 +270,14 @@ ath_hal_reg_write(struct ath_hal *ah, u_ bus_space_tag_t tag = BUSTAG(ah); bus_space_handle_t h = ah->ah_sh; +#ifdef AH_DEBUG /* Debug - complain if we haven't fully waken things up */ if (! ath_hal_reg_whilst_asleep(ah, reg) && ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, val=0x%08x, pm=%d\n", __func__, reg, val, ah->ah_powerMode); } +#endif if (ath_hal_alq) { struct ale *ale = ath_hal_alq_get(ah); @@ -303,12 +305,14 @@ ath_hal_reg_read(struct ath_hal *ah, u_i bus_space_handle_t h = ah->ah_sh; u_int32_t val; +#ifdef AH_DEBUG /* Debug - complain if we haven't fully waken things up */ if (! ath_hal_reg_whilst_asleep(ah, reg) && ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, pm=%d\n", __func__, reg, ah->ah_powerMode); } +#endif if (ah->ah_config.ah_serialise_reg_war) mtx_lock_spin(&ah_regser_mtx); @@ -345,7 +349,8 @@ OS_MARK(struct ath_hal *ah, u_int id, u_ } } } -#elif defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) +#else /* AH_DEBUG_ALQ */ + /* * Memory-mapped device register read/write. These are here * as routines when debugging support is enabled and/or when @@ -363,12 +368,14 @@ ath_hal_reg_write(struct ath_hal *ah, u_ bus_space_tag_t tag = BUSTAG(ah); bus_space_handle_t h = ah->ah_sh; +#ifdef AH_DEBUG /* Debug - complain if we haven't fully waken things up */ if (! ath_hal_reg_whilst_asleep(ah, reg) && ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, val=0x%08x, pm=%d\n", __func__, reg, val, ah->ah_powerMode); } +#endif if (ah->ah_config.ah_serialise_reg_war) mtx_lock_spin(&ah_regser_mtx); @@ -385,12 +392,14 @@ ath_hal_reg_read(struct ath_hal *ah, u_i bus_space_handle_t h = ah->ah_sh; u_int32_t val; +#ifdef AH_DEBUG /* Debug - complain if we haven't fully waken things up */ if (! ath_hal_reg_whilst_asleep(ah, reg) && ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, pm=%d\n", __func__, reg, ah->ah_powerMode); } +#endif if (ah->ah_config.ah_serialise_reg_war) mtx_lock_spin(&ah_regser_mtx); @@ -400,7 +409,7 @@ ath_hal_reg_read(struct ath_hal *ah, u_i mtx_unlock_spin(&ah_regser_mtx); return val; } -#endif /* AH_DEBUG || AH_REGOPS_FUNC */ +#endif /* AH_DEBUG_ALQ */ #ifdef AH_ASSERT void Modified: head/sys/dev/ath/ah_osdep.h ============================================================================== --- head/sys/dev/ath/ah_osdep.h Sun Jan 3 17:23:16 2016 (r293110) +++ head/sys/dev/ath/ah_osdep.h Sun Jan 3 17:58:11 2016 (r293111) @@ -131,26 +131,14 @@ struct ath_hal; OS_BUS_BARRIER((_ah), (_reg), 4, (_t)) /* - * Register read/write operations are either handled through - * platform-dependent routines (or when debugging is enabled - * with AH_DEBUG); or they are inline expanded using the macros - * defined below. + * Register read/write operations are handled through + * platform-dependent routines. */ -#if defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) || defined(AH_DEBUG_ALQ) #define OS_REG_WRITE(_ah, _reg, _val) ath_hal_reg_write(_ah, _reg, _val) #define OS_REG_READ(_ah, _reg) ath_hal_reg_read(_ah, _reg) extern void ath_hal_reg_write(struct ath_hal *ah, u_int reg, u_int32_t val); extern u_int32_t ath_hal_reg_read(struct ath_hal *ah, u_int reg); -#else -/* XXX TODO: enforce barriers */ -#define OS_REG_WRITE(_ah, _reg, _val) \ - bus_space_write_4((bus_space_tag_t)(_ah)->ah_st, \ - (bus_space_handle_t)(_ah)->ah_sh, (_reg), (_val)) -#define OS_REG_READ(_ah, _reg) \ - bus_space_read_4((bus_space_tag_t)(_ah)->ah_st, \ - (bus_space_handle_t)(_ah)->ah_sh, (_reg)) -#endif #ifdef AH_DEBUG_ALQ extern void OS_MARK(struct ath_hal *, u_int id, u_int32_t value); From owner-svn-src-all@freebsd.org Sun Jan 3 18:09:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F168A60596; Sun, 3 Jan 2016 18:09:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E0501601; Sun, 3 Jan 2016 18:09:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03I9lBZ091472; Sun, 3 Jan 2016 18:09:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03I9lNJ091471; Sun, 3 Jan 2016 18:09:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601031809.u03I9lNJ091471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 18:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293112 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 18:09:48 -0000 Author: ngie Date: Sun Jan 3 18:09:46 2016 New Revision: 293112 URL: https://svnweb.freebsd.org/changeset/base/293112 Log: Fix ixl(4) compilation with PCI_IOV pre-r266974 stable/10 doesn't have the if_getdrvflags(9) KPI. Reference the field in the structure directly if the __FreeBSD_version is < 1100022, so the driver can be built with PCI_IOV support on stable/10, without backporting all of r266974 (which requires additional changes due to projects/ifnet, etc) Differential Revision: https://reviews.freebsd.org/D4759 Reviewed by: erj, sbruno Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Sun Jan 3 17:58:11 2016 (r293111) +++ head/sys/dev/ixl/if_ixl.c Sun Jan 3 18:09:46 2016 (r293112) @@ -6606,7 +6606,11 @@ ixl_iov_uninit(device_t dev) pf->veb_seid = 0; } +#if __FreeBSD_version > 1100022 if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) +#else + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) +#endif ixl_disable_intr(vsi); vfs = pf->vfs; From owner-svn-src-all@freebsd.org Sun Jan 3 19:18:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCBEAA5F9A5; Sun, 3 Jan 2016 19:18:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90F53193A; Sun, 3 Jan 2016 19:18:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03JImKS012183; Sun, 3 Jan 2016 19:18:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03JImBs012182; Sun, 3 Jan 2016 19:18:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601031918.u03JImBs012182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 19:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293115 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 19:18:49 -0000 Author: imp Date: Sun Jan 3 19:18:48 2016 New Revision: 293115 URL: https://svnweb.freebsd.org/changeset/base/293115 Log: Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked up and can cause issues on boot with the prompts. Fix the read-only root case with horrible kludge of mounting rw removing the files, then mounting ro. But since that's no more horrible than the kludge of using marker files in /. With this change, NanoBSD configs can safely use /firstboot + growfs to produce minimal images that grow to the size of the card. Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Sun Jan 3 19:06:17 2016 (r293114) +++ head/etc/rc Sun Jan 3 19:18:48 2016 (r293115) @@ -131,11 +131,14 @@ done # Remove the firstboot sentinel, and reboot if it was requested. if [ -e ${firstboot_sentinel} ]; then - rm ${firstboot_sentinel} + [ ${root_rw_mount} = "yes" ] || mount -uw / + /bin/rm ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then - rm ${firstboot_sentinel}-reboot + /bin/rm ${firstboot_sentinel}-reboot + [ ${root_rw_mount} = "yes" ] || mount -ur / kill -INT 1 fi + [ ${root_rw_mount} = "yes" ] || mount -ur / fi echo '' From owner-svn-src-all@freebsd.org Sun Jan 3 19:28:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AB0DA5FD83 for ; Sun, 3 Jan 2016 19:28:06 +0000 (UTC) (envelope-from bounces+73574-8822-svn-src-all=freebsd.org@sendgrid.net) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D41A51DCD for ; Sun, 3 Jan 2016 19:28:05 +0000 (UTC) (envelope-from bounces+73574-8822-svn-src-all=freebsd.org@sendgrid.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=subject:to:references:from:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=K/PKTfjtgrR/75ccGQ5VpfMFaHw=; b=C1foAMtWeyX5gkRFzS krjvHjnON0+VPPzZsOhvkeKvwsUslayYml8HIJNk1n2/Bmqbrx4O7SH5xlt4h4H6 SoJuYSY+nN55gKc+4zvx7Zs9lm4KsiMyGJ1FoCWOxd5+B5LElsENDEasemFoM8/L C6cDpsGLMfkE/0DGvkDvojvfM= Received: by filter0468p1mdw1.sendgrid.net with SMTP id filter0468p1mdw1.19232.5689763F3 2016-01-03 19:27:59.070509512 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id eLYfFgkeQv6rRO1jLSVq5A for ; Sun, 03 Jan 2016 19:27:57.898 +0000 (UTC) Received: (qmail 84904 invoked from network); 3 Jan 2016 19:25:44 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 3 Jan 2016 19:25:44 -0000 Received: (qmail 98101 invoked from network); 3 Jan 2016 19:27:30 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 3 Jan 2016 19:27:30 -0000 Subject: Re: svn commit: r293115 - head/etc To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601031918.u03JImBs012182@repo.freebsd.org> From: Colin Percival Message-ID: <56897621.6080505@freebsd.org> Date: Sun, 3 Jan 2016 11:27:29 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201601031918.u03JImBs012182@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SG-EID: A6W2xSVPHetogaU8rnzccWwgBYtN+QvIzXyjfe/10PHitGMBfC9ptb0j0BrWnwFRdLDDVnWNXpGHP8 G82ldmlEUvvcw1IHzxZjUmYiAAfPzitMUM2KIkgHHKfJtvuEA1lqCRhimm+soEaNAhyfBiMVNcUgjk JEbtLCT3JL4x2aVcJv3sakmcv3yszn9ymM3U5CAp4LJEKR3nLBzTf3CHLTGYvUt4u1ejUYvay6GGiv A= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 19:28:06 -0000 On 01/03/16 11:18, Warner Losh wrote: > Log: > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > up and can cause issues on boot with the prompts. Huh, I never realized that could be a problem. > Fix the read-only > root case with horrible kludge of mounting rw removing the files, then > mounting ro. The solution I intended when I introduced this (and used elsewhere) was to set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is precisely why it's a shell variable, in fact. Colin Percival > Modified: head/etc/rc > ============================================================================== > --- head/etc/rc Sun Jan 3 19:06:17 2016 (r293114) > +++ head/etc/rc Sun Jan 3 19:18:48 2016 (r293115) > @@ -131,11 +131,14 @@ done > > # Remove the firstboot sentinel, and reboot if it was requested. > if [ -e ${firstboot_sentinel} ]; then > - rm ${firstboot_sentinel} > + [ ${root_rw_mount} = "yes" ] || mount -uw / > + /bin/rm ${firstboot_sentinel} > if [ -e ${firstboot_sentinel}-reboot ]; then > - rm ${firstboot_sentinel}-reboot > + /bin/rm ${firstboot_sentinel}-reboot > + [ ${root_rw_mount} = "yes" ] || mount -ur / > kill -INT 1 > fi > + [ ${root_rw_mount} = "yes" ] || mount -ur / > fi > > echo '' -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Sun Jan 3 20:36:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76A5CA5F2B4; Sun, 3 Jan 2016 20:36:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C37D18F3; Sun, 3 Jan 2016 20:36:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03KalIi035660; Sun, 3 Jan 2016 20:36:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03Kal5m035656; Sun, 3 Jan 2016 20:36:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601032036.u03Kal5m035656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 3 Jan 2016 20:36:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293116 - in vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC: . AppleObjCRuntime X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 20:36:48 -0000 Author: emaste Date: Sun Jan 3 20:36:46 2016 New Revision: 293116 URL: https://svnweb.freebsd.org/changeset/base/293116 Log: Un-trim part of lldb trunk r256633 This was stripped in r292932 but is used in the regular configuration of LLDB. Obtained from: https://llvm.org/svn/llvm-project/lldb/trunk@256633 Added: vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/ vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h (contents, props changed) Added: vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp Sun Jan 3 20:36:46 2016 (r293116) @@ -0,0 +1,573 @@ +//===-- AppleObjCClassDescriptorV2.cpp -----------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "AppleObjCClassDescriptorV2.h" + +#include "lldb/Core/Log.h" +#include "lldb/Expression/FunctionCaller.h" + +using namespace lldb; +using namespace lldb_private; + +bool +ClassDescriptorV2::Read_objc_class (Process* process, std::unique_ptr &objc_class) const +{ + objc_class.reset(new objc_class_t); + + bool ret = objc_class->Read (process, m_objc_class_ptr); + + if (!ret) + objc_class.reset(); + + return ret; +} + +bool +ClassDescriptorV2::objc_class_t::Read(Process *process, lldb::addr_t addr) +{ + size_t ptr_size = process->GetAddressByteSize(); + + size_t objc_class_size = ptr_size // uintptr_t isa; + + ptr_size // Class superclass; + + ptr_size // void *cache; + + ptr_size // IMP *vtable; + + ptr_size; // uintptr_t data_NEVER_USE; + + DataBufferHeap objc_class_buf (objc_class_size, '\0'); + Error error; + + process->ReadMemory(addr, objc_class_buf.GetBytes(), objc_class_size, error); + if (error.Fail()) + { + return false; + } + + DataExtractor extractor(objc_class_buf.GetBytes(), objc_class_size, process->GetByteOrder(), process->GetAddressByteSize()); + + lldb::offset_t cursor = 0; + + m_isa = extractor.GetAddress_unchecked(&cursor); // uintptr_t isa; + m_superclass = extractor.GetAddress_unchecked(&cursor); // Class superclass; + m_cache_ptr = extractor.GetAddress_unchecked(&cursor); // void *cache; + m_vtable_ptr = extractor.GetAddress_unchecked(&cursor); // IMP *vtable; + lldb::addr_t data_NEVER_USE = extractor.GetAddress_unchecked(&cursor); // uintptr_t data_NEVER_USE; + + m_flags = (uint8_t)(data_NEVER_USE & (lldb::addr_t)3); + m_data_ptr = data_NEVER_USE & ~(lldb::addr_t)3; + + return true; +} + +bool +ClassDescriptorV2::class_rw_t::Read(Process *process, lldb::addr_t addr) +{ + size_t ptr_size = process->GetAddressByteSize(); + + size_t size = sizeof(uint32_t) // uint32_t flags; + + sizeof(uint32_t) // uint32_t version; + + ptr_size // const class_ro_t *ro; + + ptr_size // union { method_list_t **method_lists; method_list_t *method_list; }; + + ptr_size // struct chained_property_list *properties; + + ptr_size // const protocol_list_t **protocols; + + ptr_size // Class firstSubclass; + + ptr_size; // Class nextSiblingClass; + + DataBufferHeap buffer (size, '\0'); + Error error; + + process->ReadMemory(addr, buffer.GetBytes(), size, error); + if (error.Fail()) + { + return false; + } + + DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize()); + + lldb::offset_t cursor = 0; + + m_flags = extractor.GetU32_unchecked(&cursor); + m_version = extractor.GetU32_unchecked(&cursor); + m_ro_ptr = extractor.GetAddress_unchecked(&cursor); + m_method_list_ptr = extractor.GetAddress_unchecked(&cursor); + m_properties_ptr = extractor.GetAddress_unchecked(&cursor); + m_firstSubclass = extractor.GetAddress_unchecked(&cursor); + m_nextSiblingClass = extractor.GetAddress_unchecked(&cursor); + + return true; +} + +bool +ClassDescriptorV2::class_ro_t::Read(Process *process, lldb::addr_t addr) +{ + size_t ptr_size = process->GetAddressByteSize(); + + size_t size = sizeof(uint32_t) // uint32_t flags; + + sizeof(uint32_t) // uint32_t instanceStart; + + sizeof(uint32_t) // uint32_t instanceSize; + + (ptr_size == 8 ? sizeof(uint32_t) : 0) // uint32_t reserved; // __LP64__ only + + ptr_size // const uint8_t *ivarLayout; + + ptr_size // const char *name; + + ptr_size // const method_list_t *baseMethods; + + ptr_size // const protocol_list_t *baseProtocols; + + ptr_size // const ivar_list_t *ivars; + + ptr_size // const uint8_t *weakIvarLayout; + + ptr_size; // const property_list_t *baseProperties; + + DataBufferHeap buffer (size, '\0'); + Error error; + + process->ReadMemory(addr, buffer.GetBytes(), size, error); + if (error.Fail()) + { + return false; + } + + DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize()); + + lldb::offset_t cursor = 0; + + m_flags = extractor.GetU32_unchecked(&cursor); + m_instanceStart = extractor.GetU32_unchecked(&cursor); + m_instanceSize = extractor.GetU32_unchecked(&cursor); + if (ptr_size == 8) + m_reserved = extractor.GetU32_unchecked(&cursor); + else + m_reserved = 0; + m_ivarLayout_ptr = extractor.GetAddress_unchecked(&cursor); + m_name_ptr = extractor.GetAddress_unchecked(&cursor); + m_baseMethods_ptr = extractor.GetAddress_unchecked(&cursor); + m_baseProtocols_ptr = extractor.GetAddress_unchecked(&cursor); + m_ivars_ptr = extractor.GetAddress_unchecked(&cursor); + m_weakIvarLayout_ptr = extractor.GetAddress_unchecked(&cursor); + m_baseProperties_ptr = extractor.GetAddress_unchecked(&cursor); + + DataBufferHeap name_buf(1024, '\0'); + + process->ReadCStringFromMemory(m_name_ptr, (char*)name_buf.GetBytes(), name_buf.GetByteSize(), error); + + if (error.Fail()) + { + return false; + } + + m_name.assign((char*)name_buf.GetBytes()); + + return true; +} + +bool +ClassDescriptorV2::Read_class_row (Process* process, const objc_class_t &objc_class, std::unique_ptr &class_ro, std::unique_ptr &class_rw) const +{ + class_ro.reset(); + class_rw.reset(); + + Error error; + uint32_t class_row_t_flags = process->ReadUnsignedIntegerFromMemory(objc_class.m_data_ptr, sizeof(uint32_t), 0, error); + if (!error.Success()) + return false; + + if (class_row_t_flags & RW_REALIZED) + { + class_rw.reset(new class_rw_t); + + if (!class_rw->Read(process, objc_class.m_data_ptr)) + { + class_rw.reset(); + return false; + } + + class_ro.reset(new class_ro_t); + + if (!class_ro->Read(process, class_rw->m_ro_ptr)) + { + class_rw.reset(); + class_ro.reset(); + return false; + } + } + else + { + class_ro.reset(new class_ro_t); + + if (!class_ro->Read(process, objc_class.m_data_ptr)) + { + class_ro.reset(); + return false; + } + } + + return true; +} + +bool +ClassDescriptorV2::method_list_t::Read(Process *process, lldb::addr_t addr) +{ + size_t size = sizeof(uint32_t) // uint32_t entsize_NEVER_USE; + + sizeof(uint32_t); // uint32_t count; + + DataBufferHeap buffer (size, '\0'); + Error error; + + process->ReadMemory(addr, buffer.GetBytes(), size, error); + if (error.Fail()) + { + return false; + } + + DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize()); + + lldb::offset_t cursor = 0; + + m_entsize = extractor.GetU32_unchecked(&cursor) & ~(uint32_t)3; + m_count = extractor.GetU32_unchecked(&cursor); + m_first_ptr = addr + cursor; + + return true; +} + +bool +ClassDescriptorV2::method_t::Read(Process *process, lldb::addr_t addr) +{ + size_t size = GetSize(process); + + DataBufferHeap buffer (size, '\0'); + Error error; + + process->ReadMemory(addr, buffer.GetBytes(), size, error); + if (error.Fail()) + { + return false; + } + + DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize()); + + lldb::offset_t cursor = 0; + + m_name_ptr = extractor.GetAddress_unchecked(&cursor); + m_types_ptr = extractor.GetAddress_unchecked(&cursor); + m_imp_ptr = extractor.GetAddress_unchecked(&cursor); + + process->ReadCStringFromMemory(m_name_ptr, m_name, error); + if (error.Fail()) + { + return false; + } + + process->ReadCStringFromMemory(m_types_ptr, m_types, error); + if (error.Fail()) + { + return false; + } + + return true; +} + +bool +ClassDescriptorV2::ivar_list_t::Read(Process *process, lldb::addr_t addr) +{ + size_t size = sizeof(uint32_t) // uint32_t entsize; + + sizeof(uint32_t); // uint32_t count; + + DataBufferHeap buffer (size, '\0'); + Error error; + + process->ReadMemory(addr, buffer.GetBytes(), size, error); + if (error.Fail()) + { + return false; + } + + DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize()); + + lldb::offset_t cursor = 0; + + m_entsize = extractor.GetU32_unchecked(&cursor); + m_count = extractor.GetU32_unchecked(&cursor); + m_first_ptr = addr + cursor; + + return true; +} + +bool +ClassDescriptorV2::ivar_t::Read(Process *process, lldb::addr_t addr) +{ + size_t size = GetSize(process); + + DataBufferHeap buffer (size, '\0'); + Error error; + + process->ReadMemory(addr, buffer.GetBytes(), size, error); + if (error.Fail()) + { + return false; + } + + DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize()); + + lldb::offset_t cursor = 0; + + m_offset_ptr = extractor.GetAddress_unchecked(&cursor); + m_name_ptr = extractor.GetAddress_unchecked(&cursor); + m_type_ptr = extractor.GetAddress_unchecked(&cursor); + m_alignment = extractor.GetU32_unchecked(&cursor); + m_size = extractor.GetU32_unchecked(&cursor); + + process->ReadCStringFromMemory(m_name_ptr, m_name, error); + if (error.Fail()) + { + return false; + } + + process->ReadCStringFromMemory(m_type_ptr, m_type, error); + if (error.Fail()) + { + return false; + } + + return true; +} + +bool +ClassDescriptorV2::Describe (std::function const &superclass_func, + std::function const &instance_method_func, + std::function const &class_method_func, + std::function const &ivar_func) const +{ + lldb_private::Process *process = m_runtime.GetProcess(); + + std::unique_ptr objc_class; + std::unique_ptr class_ro; + std::unique_ptr class_rw; + + if (!Read_objc_class(process, objc_class)) + return 0; + if (!Read_class_row(process, *objc_class, class_ro, class_rw)) + return 0; + + static ConstString NSObject_name("NSObject"); + + if (m_name != NSObject_name && superclass_func) + superclass_func(objc_class->m_superclass); + + if (instance_method_func) + { + std::unique_ptr base_method_list; + + base_method_list.reset(new method_list_t); + if (!base_method_list->Read(process, class_ro->m_baseMethods_ptr)) + return false; + + if (base_method_list->m_entsize != method_t::GetSize(process)) + return false; + + std::unique_ptr method; + method.reset(new method_t); + + for (uint32_t i = 0, e = base_method_list->m_count; i < e; ++i) + { + method->Read(process, base_method_list->m_first_ptr + (i * base_method_list->m_entsize)); + + if (instance_method_func(method->m_name.c_str(), method->m_types.c_str())) + break; + } + } + + if (class_method_func) + { + AppleObjCRuntime::ClassDescriptorSP metaclass(GetMetaclass()); + + // We don't care about the metaclass's superclass, or its class methods. Its instance methods are + // our class methods. + + if (metaclass) { + metaclass->Describe(std::function (nullptr), + class_method_func, + std::function (nullptr), + std::function (nullptr)); + } + } + + if (ivar_func) + { + if (class_ro->m_ivars_ptr != 0) + { + ivar_list_t ivar_list; + if (!ivar_list.Read(process, class_ro->m_ivars_ptr)) + return false; + + if (ivar_list.m_entsize != ivar_t::GetSize(process)) + return false; + + ivar_t ivar; + + for (uint32_t i = 0, e = ivar_list.m_count; i < e; ++i) + { + ivar.Read(process, ivar_list.m_first_ptr + (i * ivar_list.m_entsize)); + + if (ivar_func(ivar.m_name.c_str(), ivar.m_type.c_str(), ivar.m_offset_ptr, ivar.m_size)) + break; + } + } + } + + return true; +} + +ConstString +ClassDescriptorV2::GetClassName () +{ + if (!m_name) + { + lldb_private::Process *process = m_runtime.GetProcess(); + + if (process) + { + std::unique_ptr objc_class; + std::unique_ptr class_ro; + std::unique_ptr class_rw; + + if (!Read_objc_class(process, objc_class)) + return m_name; + if (!Read_class_row(process, *objc_class, class_ro, class_rw)) + return m_name; + + m_name = ConstString(class_ro->m_name.c_str()); + } + } + return m_name; +} + +ObjCLanguageRuntime::ClassDescriptorSP +ClassDescriptorV2::GetSuperclass () +{ + lldb_private::Process *process = m_runtime.GetProcess(); + + if (!process) + return ObjCLanguageRuntime::ClassDescriptorSP(); + + std::unique_ptr objc_class; + + if (!Read_objc_class(process, objc_class)) + return ObjCLanguageRuntime::ClassDescriptorSP(); + + return m_runtime.ObjCLanguageRuntime::GetClassDescriptorFromISA(objc_class->m_superclass); +} + +ObjCLanguageRuntime::ClassDescriptorSP +ClassDescriptorV2::GetMetaclass () const +{ + lldb_private::Process *process = m_runtime.GetProcess(); + + if (!process) + return ObjCLanguageRuntime::ClassDescriptorSP(); + + std::unique_ptr objc_class; + + if (!Read_objc_class(process, objc_class)) + return ObjCLanguageRuntime::ClassDescriptorSP(); + + lldb::addr_t candidate_isa = m_runtime.GetPointerISA(objc_class->m_isa); + + return ObjCLanguageRuntime::ClassDescriptorSP(new ClassDescriptorV2(m_runtime, candidate_isa, nullptr)); +} + +uint64_t +ClassDescriptorV2::GetInstanceSize () +{ + lldb_private::Process *process = m_runtime.GetProcess(); + + if (process) + { + std::unique_ptr objc_class; + std::unique_ptr class_ro; + std::unique_ptr class_rw; + + if (!Read_objc_class(process, objc_class)) + return 0; + if (!Read_class_row(process, *objc_class, class_ro, class_rw)) + return 0; + + return class_ro->m_instanceSize; + } + + return 0; +} + +ClassDescriptorV2::iVarsStorage::iVarsStorage (): +m_filled(false), +m_ivars(), +m_mutex(Mutex::eMutexTypeRecursive) +{} + +size_t +ClassDescriptorV2::iVarsStorage::size () +{ + return m_ivars.size(); +} + +ClassDescriptorV2::iVarDescriptor& +ClassDescriptorV2::iVarsStorage::operator[] (size_t idx) +{ + return m_ivars[idx]; +} + +void +ClassDescriptorV2::iVarsStorage::fill (AppleObjCRuntimeV2& runtime, ClassDescriptorV2& descriptor) +{ + if (m_filled) + return; + Mutex::Locker lock(m_mutex); + Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES | LIBLLDB_LOG_VERBOSE)); + if (log) + log->Printf("[ClassDescriptorV2::iVarsStorage::fill] class_name = %s", descriptor.GetClassName().AsCString(" bool { + const bool for_expression = false; + const bool stop_loop = false; + if (log) + log->Printf("[ClassDescriptorV2::iVarsStorage::fill] name = %s, encoding = %s, offset_ptr = %" PRIx64 ", size = %" PRIu64, + name,type,offset_ptr,size); + CompilerType ivar_type = encoding_to_type_sp->RealizeType(type, for_expression); + if (ivar_type) + { + if (log) + log->Printf("[ClassDescriptorV2::iVarsStorage::fill] name = %s, encoding = %s, offset_ptr = %" PRIx64 ", size = %" PRIu64 " , type_size = %" PRIu64, + name,type,offset_ptr,size,ivar_type.GetByteSize(nullptr)); + Scalar offset_scalar; + Error error; + const int offset_ptr_size = 4; + const bool is_signed = false; + size_t read = process->ReadScalarIntegerFromMemory(offset_ptr, offset_ptr_size, is_signed, offset_scalar, error); + if (error.Success() && 4 == read) + { + if (log) + log->Printf("[ClassDescriptorV2::iVarsStorage::fill] offset_ptr = %" PRIx64 " --> %" PRIu32, + offset_ptr, offset_scalar.SInt()); + m_ivars.push_back({ ConstString(name), ivar_type, size, offset_scalar.SInt() }); + } + else if (log) + log->Printf("[ClassDescriptorV2::iVarsStorage::fill] offset_ptr = %" PRIx64 " --> read fail, read = %zu", + offset_ptr, read); + } + return stop_loop; + }); +} + +void +ClassDescriptorV2::GetIVarInformation () +{ + m_ivars_storage.fill(m_runtime, *this); +} Added: vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h Sun Jan 3 20:36:46 2016 (r293116) @@ -0,0 +1,411 @@ +//===-- AppleObjCClassDescriptorV2.h ----------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_AppleObjCClassDescriptorV2_h_ +#define liblldb_AppleObjCClassDescriptorV2_h_ + +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes +#include "lldb/lldb-private.h" +#include "lldb/Host/Mutex.h" +#include "lldb/Target/ObjCLanguageRuntime.h" +#include "AppleObjCRuntimeV2.h" + +namespace lldb_private { + +class ClassDescriptorV2 : public ObjCLanguageRuntime::ClassDescriptor +{ +public: + friend class lldb_private::AppleObjCRuntimeV2; + + ~ClassDescriptorV2() override = default; + + ConstString + GetClassName() override; + + ObjCLanguageRuntime::ClassDescriptorSP + GetSuperclass() override; + + ObjCLanguageRuntime::ClassDescriptorSP + GetMetaclass() const override; + + bool + IsValid() override + { + return true; // any Objective-C v2 runtime class descriptor we vend is valid + } + + // a custom descriptor is used for tagged pointers + bool + GetTaggedPointerInfo(uint64_t* info_bits = nullptr, + uint64_t* value_bits = nullptr, + uint64_t* payload = nullptr) override + { + return false; + } + + uint64_t + GetInstanceSize() override; + + ObjCLanguageRuntime::ObjCISA + GetISA() override + { + return m_objc_class_ptr; + } + + bool + Describe(std::function const &superclass_func, + std::function const &instance_method_func, + std::function const &class_method_func, + std::function const &ivar_func) const override; + + size_t + GetNumIVars() override + { + GetIVarInformation(); + return m_ivars_storage.size(); + } + + iVarDescriptor + GetIVarAtIndex(size_t idx) override + { + if (idx >= GetNumIVars()) + return iVarDescriptor(); + return m_ivars_storage[idx]; + } + +protected: + void + GetIVarInformation (); + +private: + static const uint32_t RW_REALIZED = (1 << 31); + + struct objc_class_t { + ObjCLanguageRuntime::ObjCISA m_isa; // The class's metaclass. + ObjCLanguageRuntime::ObjCISA m_superclass; + lldb::addr_t m_cache_ptr; + lldb::addr_t m_vtable_ptr; + lldb::addr_t m_data_ptr; + uint8_t m_flags; + + objc_class_t () : + m_isa (0), + m_superclass (0), + m_cache_ptr (0), + m_vtable_ptr (0), + m_data_ptr (0), + m_flags (0) + { + } + + void + Clear() + { + m_isa = 0; + m_superclass = 0; + m_cache_ptr = 0; + m_vtable_ptr = 0; + m_data_ptr = 0; + m_flags = 0; + } + + bool + Read(Process *process, lldb::addr_t addr); + }; + + struct class_ro_t { + uint32_t m_flags; + uint32_t m_instanceStart; + uint32_t m_instanceSize; + uint32_t m_reserved; + + lldb::addr_t m_ivarLayout_ptr; + lldb::addr_t m_name_ptr; + lldb::addr_t m_baseMethods_ptr; + lldb::addr_t m_baseProtocols_ptr; + lldb::addr_t m_ivars_ptr; + + lldb::addr_t m_weakIvarLayout_ptr; + lldb::addr_t m_baseProperties_ptr; + + std::string m_name; + + bool + Read(Process *process, lldb::addr_t addr); + }; + + struct class_rw_t { + uint32_t m_flags; + uint32_t m_version; + + lldb::addr_t m_ro_ptr; + union { + lldb::addr_t m_method_list_ptr; + lldb::addr_t m_method_lists_ptr; + }; + lldb::addr_t m_properties_ptr; + lldb::addr_t m_protocols_ptr; + + ObjCLanguageRuntime::ObjCISA m_firstSubclass; + ObjCLanguageRuntime::ObjCISA m_nextSiblingClass; + + bool + Read(Process *process, lldb::addr_t addr); + }; + + struct method_list_t + { + uint32_t m_entsize; + uint32_t m_count; + lldb::addr_t m_first_ptr; + + bool + Read(Process *process, lldb::addr_t addr); + }; + + struct method_t + { + lldb::addr_t m_name_ptr; + lldb::addr_t m_types_ptr; + lldb::addr_t m_imp_ptr; + + std::string m_name; + std::string m_types; + + static size_t GetSize(Process *process) + { + size_t ptr_size = process->GetAddressByteSize(); + + return ptr_size // SEL name; + + ptr_size // const char *types; + + ptr_size; // IMP imp; + } + + bool + Read(Process *process, lldb::addr_t addr); + }; + + struct ivar_list_t + { + uint32_t m_entsize; + uint32_t m_count; + lldb::addr_t m_first_ptr; + + bool Read(Process *process, lldb::addr_t addr); + }; + + struct ivar_t + { + lldb::addr_t m_offset_ptr; + lldb::addr_t m_name_ptr; + lldb::addr_t m_type_ptr; + uint32_t m_alignment; + uint32_t m_size; + + std::string m_name; + std::string m_type; + + static size_t GetSize(Process *process) + { + size_t ptr_size = process->GetAddressByteSize(); + + return ptr_size // uintptr_t *offset; + + ptr_size // const char *name; + + ptr_size // const char *type; + + sizeof(uint32_t) // uint32_t alignment; + + sizeof(uint32_t); // uint32_t size; + } + + bool + Read(Process *process, lldb::addr_t addr); + }; + + class iVarsStorage + { + public: + iVarsStorage (); + + size_t + size (); + + iVarDescriptor& + operator[] (size_t idx); + + void + fill (AppleObjCRuntimeV2& runtime, ClassDescriptorV2& descriptor); + + private: + bool m_filled; + std::vector m_ivars; + Mutex m_mutex; + }; + + // The constructor should only be invoked by the runtime as it builds its caches + // or populates them. A ClassDescriptorV2 should only ever exist in a cache. + ClassDescriptorV2(AppleObjCRuntimeV2 &runtime, ObjCLanguageRuntime::ObjCISA isa, const char *name) : + m_runtime (runtime), + m_objc_class_ptr (isa), + m_name (name), + m_ivars_storage() + { + } + + bool + Read_objc_class (Process* process, std::unique_ptr &objc_class) const; + + bool + Read_class_row (Process* process, const objc_class_t &objc_class, std::unique_ptr &class_ro, std::unique_ptr &class_rw) const; + + AppleObjCRuntimeV2 &m_runtime; // The runtime, so we can read information lazily. + lldb::addr_t m_objc_class_ptr; // The address of the objc_class_t. (I.e., objects of this class type have this as their ISA) + ConstString m_name; // May be NULL + iVarsStorage m_ivars_storage; +}; + +// tagged pointer descriptor +class ClassDescriptorV2Tagged : public ObjCLanguageRuntime::ClassDescriptor +{ +public: + ClassDescriptorV2Tagged (ConstString class_name, + uint64_t payload) + { + m_name = class_name; + if (!m_name) + { + m_valid = false; + return; + } + m_valid = true; + m_payload = payload; + m_info_bits = (m_payload & 0xF0ULL) >> 4; + m_value_bits = (m_payload & ~0x0000000000000000FFULL) >> 8; + } + + ClassDescriptorV2Tagged (ObjCLanguageRuntime::ClassDescriptorSP actual_class_sp, + uint64_t payload) + { + if (!actual_class_sp) + { + m_valid = false; + return; + } + m_name = actual_class_sp->GetClassName(); + if (!m_name) + { + m_valid = false; + return; + } + m_valid = true; + m_payload = payload; + m_info_bits = (m_payload & 0x0FULL); + m_value_bits = (m_payload & ~0x0FULL) >> 4; + } + + ~ClassDescriptorV2Tagged() override = default; + + ConstString + GetClassName() override + { + return m_name; + } + + ObjCLanguageRuntime::ClassDescriptorSP + GetSuperclass() override + { + // tagged pointers can represent a class that has a superclass, but since that information is not + // stored in the object itself, we would have to query the runtime to discover the hierarchy + // for the time being, we skip this step in the interest of static discovery + return ObjCLanguageRuntime::ClassDescriptorSP(); + } + + ObjCLanguageRuntime::ClassDescriptorSP + GetMetaclass() const override + { + return ObjCLanguageRuntime::ClassDescriptorSP(); + } + + bool + IsValid() override + { + return m_valid; + } + + bool + IsKVO() override + { + return false; // tagged pointers are not KVO'ed + } + + bool + IsCFType() override + { + return false; // tagged pointers are not CF objects + } + + bool + GetTaggedPointerInfo(uint64_t* info_bits = nullptr, + uint64_t* value_bits = nullptr, + uint64_t* payload = nullptr) override + { + if (info_bits) + *info_bits = GetInfoBits(); + if (value_bits) + *value_bits = GetValueBits(); + if (payload) + *payload = GetPayload(); + return true; + } + + uint64_t + GetInstanceSize() override + { + return (IsValid() ? m_pointer_size : 0); + } + + ObjCLanguageRuntime::ObjCISA + GetISA() override + { + return 0; // tagged pointers have no ISA + } + + // these calls are not part of any formal tagged pointers specification + virtual uint64_t + GetValueBits () + { + return (IsValid() ? m_value_bits : 0); + } + + virtual uint64_t + GetInfoBits () + { + return (IsValid() ? m_info_bits : 0); + } + + virtual uint64_t + GetPayload () + { + return (IsValid() ? m_payload : 0); + } + +private: + ConstString m_name; + uint8_t m_pointer_size; + bool m_valid; + uint64_t m_info_bits; + uint64_t m_value_bits; + uint64_t m_payload; +}; + +} // namespace lldb_private + +#endif // liblldb_AppleObjCClassDescriptorV2_h_ Added: vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp Sun Jan 3 20:36:46 2016 (r293116) @@ -0,0 +1,665 @@ +//===-- AppleObjCDeclVendor.cpp ---------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jan 3 20:41:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C24AEA5F4F2; Sun, 3 Jan 2016 20:41:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78A581DA1; Sun, 3 Jan 2016 20:41:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03KfZ7G038622; Sun, 3 Jan 2016 20:41:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03KfZ4Q038621; Sun, 3 Jan 2016 20:41:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601032041.u03KfZ4Q038621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 3 Jan 2016 20:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293117 - vendor/lldb/lldb-trunk-r256633/source/Plugins/LanguageRuntime/ObjC X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 20:41:36 -0000 Author: emaste Date: Sun Jan 3 20:41:35 2016 New Revision: 293117 URL: https://svnweb.freebsd.org/changeset/base/293117 Log: Tag addition to stripped lldb trunk r256633. Added: vendor/lldb/lldb-trunk-r256633/source/Plugins/LanguageRuntime/ObjC/ - copied from r293116, vendor/lldb/dist/source/Plugins/LanguageRuntime/ObjC/ Modified: Directory Properties: vendor/lldb/lldb-trunk-r256633/ (props changed) From owner-svn-src-all@freebsd.org Sun Jan 3 21:30:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48686A608B8; Sun, 3 Jan 2016 21:30:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF8A01DE9; Sun, 3 Jan 2016 21:30:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03LUNgX051104; Sun, 3 Jan 2016 21:30:23 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03LUMj9051102; Sun, 3 Jan 2016 21:30:22 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601032130.u03LUMj9051102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 3 Jan 2016 21:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293118 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 21:30:24 -0000 Author: jilles Date: Sun Jan 3 21:30:22 2016 New Revision: 293118 URL: https://svnweb.freebsd.org/changeset/base/293118 Log: sh: Reduce size of builtins table. Modified: head/bin/sh/exec.c head/bin/sh/mkbuiltins Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sun Jan 3 20:41:35 2016 (r293117) +++ head/bin/sh/exec.c Sun Jan 3 21:30:22 2016 (r293118) @@ -439,12 +439,14 @@ success: int find_builtin(const char *name, int *special) { - const struct builtincmd *bp; + const unsigned char *bp; + size_t len; - for (bp = builtincmd ; bp->name ; bp++) { - if (*bp->name == *name && equal(bp->name, name)) { - *special = bp->special; - return bp->code; + len = strlen(name); + for (bp = builtincmd ; *bp ; bp += 2 + bp[0]) { + if (bp[0] == len && memcmp(bp + 2, name, len) == 0) { + *special = (bp[1] & BUILTIN_SPECIAL) != 0; + return bp[1] & ~BUILTIN_SPECIAL; } } return -1; Modified: head/bin/sh/mkbuiltins ============================================================================== --- head/bin/sh/mkbuiltins Sun Jan 3 20:41:35 2016 (r293117) +++ head/bin/sh/mkbuiltins Sun Jan 3 21:30:22 2016 (r293118) @@ -62,17 +62,16 @@ echo 'int (*const builtinfunc[])(int, ch awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp echo '}; -const struct builtincmd builtincmd[] = {' +const unsigned char builtincmd[] = {' awk '{ for (i = 2 ; i <= NF ; i++) { if ($i == "-s") { spc = 1; } else { - printf "\t{ \"%s\", %d, %d },\n", $i, NR-1, spc + printf "\t\"\\%03o\\%03o%s\"\n", length($i), (spc ? 128 : 0) + NR-1, $i spc = 0; } }}' $temp -echo ' { NULL, 0, 0 } -};' +echo '};' exec > builtins.h cat <<\! @@ -85,14 +84,10 @@ cat <<\! tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ < $temp | awk '{ printf "#define %s %d\n", $1, NR-1}' echo ' -struct builtincmd { - const char *name; - int code; - int special; -}; +#define BUILTIN_SPECIAL 0x80 extern int (*const builtinfunc[])(int, char **); -extern const struct builtincmd builtincmd[]; +extern const unsigned char builtincmd[]; ' awk '{ printf "int %s(int, char **);\n", $1}' $temp rm -f $temp From owner-svn-src-all@freebsd.org Sun Jan 3 21:32:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1946CA60A30; Sun, 3 Jan 2016 21:32:49 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4BD911B7; Sun, 3 Jan 2016 21:32:48 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03LWlO3053659; Sun, 3 Jan 2016 21:32:47 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03LWlia053658; Sun, 3 Jan 2016 21:32:47 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601032132.u03LWlia053658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 3 Jan 2016 21:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293119 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 21:32:49 -0000 Author: avos Date: Sun Jan 3 21:32:47 2016 New Revision: 293119 URL: https://svnweb.freebsd.org/changeset/base/293119 Log: iwm: use m_collapse() to defragment a mbuf chain - Simplify defragmentation code. - Use proper number of dma segments for data. Approved by: adrian (mentor) Obtained from: DragonFlyBSD (mostly) Differential Revision: https://reviews.freebsd.org/D4754 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sun Jan 3 21:30:22 2016 (r293118) +++ head/sys/dev/iwm/if_iwm.c Sun Jan 3 21:32:47 2016 (r293119) @@ -956,7 +956,7 @@ iwm_alloc_tx_ring(struct iwm_softc *sc, error = bus_dma_tag_create(sc->sc_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, - IWM_MAX_SCATTER - 1, MCLBYTES, 0, NULL, NULL, &ring->data_dmat); + IWM_MAX_SCATTER - 2, MCLBYTES, 0, NULL, NULL, &ring->data_dmat); if (error != 0) { device_printf(sc->sc_dev, "could not create TX buf DMA tag\n"); goto fail; @@ -2778,23 +2778,15 @@ iwm_tx(struct iwm_softc *sc, struct mbuf return error; } /* Too many DMA segments, linearize mbuf. */ - MGETHDR(m1, M_NOWAIT, MT_DATA); + m1 = m_collapse(m, M_NOWAIT, IWM_MAX_SCATTER - 2); if (m1 == NULL) { + device_printf(sc->sc_dev, + "%s: could not defrag mbuf\n", __func__); m_freem(m); - return ENOBUFS; - } - if (m->m_pkthdr.len > MHLEN) { - MCLGET(m1, M_NOWAIT); - if (!(m1->m_flags & M_EXT)) { - m_freem(m); - m_freem(m1); - return ENOBUFS; - } + return (ENOBUFS); } - m_copydata(m, 0, m->m_pkthdr.len, mtod(m1, void *)); - m1->m_pkthdr.len = m1->m_len = m->m_pkthdr.len; - m_freem(m); m = m1; + error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, m, segs, &nsegs, BUS_DMA_NOWAIT); if (error != 0) { From owner-svn-src-all@freebsd.org Sun Jan 3 22:16:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E0BCA6084C; Sun, 3 Jan 2016 22:16:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B67A1630; Sun, 3 Jan 2016 22:16:28 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03MGSLP066223; Sun, 3 Jan 2016 22:16:28 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03MGSOL066222; Sun, 3 Jan 2016 22:16:28 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601032216.u03MGSOL066222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 3 Jan 2016 22:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293120 - head/bin/sh/tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 22:16:29 -0000 Author: jilles Date: Sun Jan 3 22:16:27 2016 New Revision: 293120 URL: https://svnweb.freebsd.org/changeset/base/293120 Log: sh: Link tests/builtins/getopts9.0 to the build. This was forgotten in r273700. Modified: head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sun Jan 3 21:32:47 2016 (r293119) +++ head/bin/sh/tests/builtins/Makefile Sun Jan 3 22:16:27 2016 (r293120) @@ -94,6 +94,7 @@ FILES+= getopts5.0 FILES+= getopts6.0 FILES+= getopts7.0 FILES+= getopts8.0 getopts8.0.stdout +FILES+= getopts9.0 getopts9.0.stdout FILES+= hash1.0 hash1.0.stdout FILES+= hash2.0 hash2.0.stdout FILES+= hash3.0 hash3.0.stdout From owner-svn-src-all@freebsd.org Sun Jan 3 22:50:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49203A610E7; Sun, 3 Jan 2016 22:50:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B6C913A0; Sun, 3 Jan 2016 22:50:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03MoJ4n075011; Sun, 3 Jan 2016 22:50:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03MoJbL075010; Sun, 3 Jan 2016 22:50:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601032250.u03MoJbL075010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 22:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293121 - stable/10/sys/cddl/compat/opensolaris/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 22:50:20 -0000 Author: ngie Date: Sun Jan 3 22:50:19 2016 New Revision: 293121 URL: https://svnweb.freebsd.org/changeset/base/293121 Log: MFC r279437,r284107: r279437 (by rstone): Allow Illumos code to co-exist with nv(9) r284107 (by avg): compat nvpair.h: make sure that the names are mangled only for kernel Currently there is no good reason to mangle the userland API. The change was introduced in eac1d566b46edef765754203bef22c75c1699966, r279437. Also see https://reviews.freebsd.org/D1881. I am still convinced that nv should not have introduced intentionally conflicting API. Added: stable/10/sys/cddl/compat/opensolaris/sys/nvpair.h - copied unchanged from r293093, user/ngie/stable-10-libnv/sys/cddl/compat/opensolaris/sys/nvpair.h Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/cddl/compat/opensolaris/sys/nvpair.h (from r293093, user/ngie/stable-10-libnv/sys/cddl/compat/opensolaris/sys/nvpair.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/cddl/compat/opensolaris/sys/nvpair.h Sun Jan 3 22:50:19 2016 (r293121, copy of r293093, user/ngie/stable-10-libnv/sys/cddl/compat/opensolaris/sys/nvpair.h) @@ -0,0 +1,263 @@ +/*- + * Copyright (c) 2014 Sandvine Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SYS_NVPAIR_H_ +#define _OPENSOLARIS_SYS_NVPAIR_H_ + +#ifdef _KERNEL + +/* + * Some of the symbols in the Illumos nvpair library conflict with symbols + * provided by nv(9), so we use this preprocessor hack to avoid the conflict. + * + * This list was generated by: + * cat nv.h nv_impl.h nvlist_* nvpair_impl.h | \ + * sed -nE 's/^[[:alnum:]_][[:alnum:]_ ]*[[:space:]]+[*]*([[:alnum:]_]+)\(.*$/#define \1 illumos_\1/p' | \ + * sort -u + */ +#define nvlist_add_binary illumos_nvlist_add_binary +#define nvlist_add_bool illumos_nvlist_add_bool +#define nvlist_add_descriptor illumos_nvlist_add_descriptor +#define nvlist_add_null illumos_nvlist_add_null +#define nvlist_add_number illumos_nvlist_add_number +#define nvlist_add_nvlist illumos_nvlist_add_nvlist +#define nvlist_add_nvpair illumos_nvlist_add_nvpair +#define nvlist_add_string illumos_nvlist_add_string +#define nvlist_add_stringf illumos_nvlist_add_stringf +#define nvlist_add_stringv illumos_nvlist_add_stringv +#define nvlist_addf_binary illumos_nvlist_addf_binary +#define nvlist_addf_bool illumos_nvlist_addf_bool +#define nvlist_addf_descriptor illumos_nvlist_addf_descriptor +#define nvlist_addf_null illumos_nvlist_addf_null +#define nvlist_addf_number illumos_nvlist_addf_number +#define nvlist_addf_nvlist illumos_nvlist_addf_nvlist +#define nvlist_addf_string illumos_nvlist_addf_string +#define nvlist_addv_binary illumos_nvlist_addv_binary +#define nvlist_addv_bool illumos_nvlist_addv_bool +#define nvlist_addv_descriptor illumos_nvlist_addv_descriptor +#define nvlist_addv_null illumos_nvlist_addv_null +#define nvlist_addv_number illumos_nvlist_addv_number +#define nvlist_addv_nvlist illumos_nvlist_addv_nvlist +#define nvlist_addv_string illumos_nvlist_addv_string +#define nvlist_check_header illumos_nvlist_check_header +#define nvlist_clone illumos_nvlist_clone +#define nvlist_create illumos_nvlist_create +#define nvlist_descriptors illumos_nvlist_descriptors +#define nvlist_destroy illumos_nvlist_destroy +#define nvlist_dump illumos_nvlist_dump +#define nvlist_empty illumos_nvlist_empty +#define nvlist_error illumos_nvlist_error +#define nvlist_exists illumos_nvlist_exists +#define nvlist_exists_binary illumos_nvlist_exists_binary +#define nvlist_exists_bool illumos_nvlist_exists_bool +#define nvlist_exists_descriptor illumos_nvlist_exists_descriptor +#define nvlist_exists_null illumos_nvlist_exists_null +#define nvlist_exists_number illumos_nvlist_exists_number +#define nvlist_exists_nvlist illumos_nvlist_exists_nvlist +#define nvlist_exists_string illumos_nvlist_exists_string +#define nvlist_exists_type illumos_nvlist_exists_type +#define nvlist_existsf illumos_nvlist_existsf +#define nvlist_existsf_binary illumos_nvlist_existsf_binary +#define nvlist_existsf_bool illumos_nvlist_existsf_bool +#define nvlist_existsf_descriptor illumos_nvlist_existsf_descriptor +#define nvlist_existsf_null illumos_nvlist_existsf_null +#define nvlist_existsf_number illumos_nvlist_existsf_number +#define nvlist_existsf_nvlist illumos_nvlist_existsf_nvlist +#define nvlist_existsf_string illumos_nvlist_existsf_string +#define nvlist_existsf_type illumos_nvlist_existsf_type +#define nvlist_existsv illumos_nvlist_existsv +#define nvlist_existsv_binary illumos_nvlist_existsv_binary +#define nvlist_existsv_bool illumos_nvlist_existsv_bool +#define nvlist_existsv_descriptor illumos_nvlist_existsv_descriptor +#define nvlist_existsv_null illumos_nvlist_existsv_null +#define nvlist_existsv_number illumos_nvlist_existsv_number +#define nvlist_existsv_nvlist illumos_nvlist_existsv_nvlist +#define nvlist_existsv_string illumos_nvlist_existsv_string +#define nvlist_existsv_type illumos_nvlist_existsv_type +#define nvlist_fdump illumos_nvlist_fdump +#define nvlist_first_nvpair illumos_nvlist_first_nvpair +#define nvlist_free illumos_nvlist_free +#define nvlist_free_binary illumos_nvlist_free_binary +#define nvlist_free_bool illumos_nvlist_free_bool +#define nvlist_free_descriptor illumos_nvlist_free_descriptor +#define nvlist_free_null illumos_nvlist_free_null +#define nvlist_free_number illumos_nvlist_free_number +#define nvlist_free_nvlist illumos_nvlist_free_nvlist +#define nvlist_free_nvpair illumos_nvlist_free_nvpair +#define nvlist_free_string illumos_nvlist_free_string +#define nvlist_free_type illumos_nvlist_free_type +#define nvlist_freef illumos_nvlist_freef +#define nvlist_freef_binary illumos_nvlist_freef_binary +#define nvlist_freef_bool illumos_nvlist_freef_bool +#define nvlist_freef_descriptor illumos_nvlist_freef_descriptor +#define nvlist_freef_null illumos_nvlist_freef_null +#define nvlist_freef_number illumos_nvlist_freef_number +#define nvlist_freef_nvlist illumos_nvlist_freef_nvlist +#define nvlist_freef_string illumos_nvlist_freef_string +#define nvlist_freef_type illumos_nvlist_freef_type +#define nvlist_freev illumos_nvlist_freev +#define nvlist_freev_binary illumos_nvlist_freev_binary +#define nvlist_freev_bool illumos_nvlist_freev_bool +#define nvlist_freev_descriptor illumos_nvlist_freev_descriptor +#define nvlist_freev_null illumos_nvlist_freev_null +#define nvlist_freev_number illumos_nvlist_freev_number +#define nvlist_freev_nvlist illumos_nvlist_freev_nvlist +#define nvlist_freev_string illumos_nvlist_freev_string +#define nvlist_freev_type illumos_nvlist_freev_type +#define nvlist_get_binary illumos_nvlist_get_binary +#define nvlist_get_bool illumos_nvlist_get_bool +#define nvlist_get_descriptor illumos_nvlist_get_descriptor +#define nvlist_get_number illumos_nvlist_get_number +#define nvlist_get_nvlist illumos_nvlist_get_nvlist +#define nvlist_get_nvpair illumos_nvlist_get_nvpair +#define nvlist_get_string illumos_nvlist_get_string +#define nvlist_getf_binary illumos_nvlist_getf_binary +#define nvlist_getf_bool illumos_nvlist_getf_bool +#define nvlist_getf_descriptor illumos_nvlist_getf_descriptor +#define nvlist_getf_number illumos_nvlist_getf_number +#define nvlist_getf_nvlist illumos_nvlist_getf_nvlist +#define nvlist_getf_string illumos_nvlist_getf_string +#define nvlist_getv_binary illumos_nvlist_getv_binary +#define nvlist_getv_bool illumos_nvlist_getv_bool +#define nvlist_getv_descriptor illumos_nvlist_getv_descriptor +#define nvlist_getv_number illumos_nvlist_getv_number +#define nvlist_getv_nvlist illumos_nvlist_getv_nvlist +#define nvlist_getv_string illumos_nvlist_getv_string +#define nvlist_move_binary illumos_nvlist_move_binary +#define nvlist_move_descriptor illumos_nvlist_move_descriptor +#define nvlist_move_nvlist illumos_nvlist_move_nvlist +#define nvlist_move_nvpair illumos_nvlist_move_nvpair +#define nvlist_move_string illumos_nvlist_move_string +#define nvlist_movef_binary illumos_nvlist_movef_binary +#define nvlist_movef_descriptor illumos_nvlist_movef_descriptor +#define nvlist_movef_nvlist illumos_nvlist_movef_nvlist +#define nvlist_movef_string illumos_nvlist_movef_string +#define nvlist_movev_binary illumos_nvlist_movev_binary +#define nvlist_movev_descriptor illumos_nvlist_movev_descriptor +#define nvlist_movev_nvlist illumos_nvlist_movev_nvlist +#define nvlist_movev_string illumos_nvlist_movev_string +#define nvlist_ndescriptors illumos_nvlist_ndescriptors +#define nvlist_next illumos_nvlist_next +#define nvlist_next_nvpair illumos_nvlist_next_nvpair +#define nvlist_pack illumos_nvlist_pack +#define nvlist_prev_nvpair illumos_nvlist_prev_nvpair +#define nvlist_recv illumos_nvlist_recv +#define nvlist_remove_nvpair illumos_nvlist_remove_nvpair +#define nvlist_report_missing illumos_nvlist_report_missing +#define nvlist_send illumos_nvlist_send +#define nvlist_set_error illumos_nvlist_set_error +#define nvlist_size illumos_nvlist_size +#define nvlist_take_binary illumos_nvlist_take_binary +#define nvlist_take_bool illumos_nvlist_take_bool +#define nvlist_take_descriptor illumos_nvlist_take_descriptor +#define nvlist_take_number illumos_nvlist_take_number +#define nvlist_take_nvlist illumos_nvlist_take_nvlist +#define nvlist_take_nvpair illumos_nvlist_take_nvpair +#define nvlist_take_string illumos_nvlist_take_string +#define nvlist_takef_binary illumos_nvlist_takef_binary +#define nvlist_takef_bool illumos_nvlist_takef_bool +#define nvlist_takef_descriptor illumos_nvlist_takef_descriptor +#define nvlist_takef_number illumos_nvlist_takef_number +#define nvlist_takef_nvlist illumos_nvlist_takef_nvlist +#define nvlist_takef_string illumos_nvlist_takef_string +#define nvlist_takev_binary illumos_nvlist_takev_binary +#define nvlist_takev_bool illumos_nvlist_takev_bool +#define nvlist_takev_descriptor illumos_nvlist_takev_descriptor +#define nvlist_takev_number illumos_nvlist_takev_number +#define nvlist_takev_nvlist illumos_nvlist_takev_nvlist +#define nvlist_takev_string illumos_nvlist_takev_string +#define nvlist_unpack illumos_nvlist_unpack +#define nvlist_xfer illumos_nvlist_xfer +#define nvlist_xpack illumos_nvlist_xpack +#define nvlist_xunpack illumos_nvlist_xunpack +#define nvpair_allocv illumos_nvpair_allocv +#define nvpair_assert illumos_nvpair_assert +#define nvpair_clone illumos_nvpair_clone +#define nvpair_create_binary illumos_nvpair_create_binary +#define nvpair_create_bool illumos_nvpair_create_bool +#define nvpair_create_descriptor illumos_nvpair_create_descriptor +#define nvpair_create_null illumos_nvpair_create_null +#define nvpair_create_number illumos_nvpair_create_number +#define nvpair_create_nvlist illumos_nvpair_create_nvlist +#define nvpair_create_string illumos_nvpair_create_string +#define nvpair_create_stringf illumos_nvpair_create_stringf +#define nvpair_create_stringv illumos_nvpair_create_stringv +#define nvpair_createf_binary illumos_nvpair_createf_binary +#define nvpair_createf_bool illumos_nvpair_createf_bool +#define nvpair_createf_descriptor illumos_nvpair_createf_descriptor +#define nvpair_createf_null illumos_nvpair_createf_null +#define nvpair_createf_number illumos_nvpair_createf_number +#define nvpair_createf_nvlist illumos_nvpair_createf_nvlist +#define nvpair_createf_string illumos_nvpair_createf_string +#define nvpair_createv_binary illumos_nvpair_createv_binary +#define nvpair_createv_bool illumos_nvpair_createv_bool +#define nvpair_createv_descriptor illumos_nvpair_createv_descriptor +#define nvpair_createv_null illumos_nvpair_createv_null +#define nvpair_createv_number illumos_nvpair_createv_number +#define nvpair_createv_nvlist illumos_nvpair_createv_nvlist +#define nvpair_createv_string illumos_nvpair_createv_string +#define nvpair_free illumos_nvpair_free +#define nvpair_free_structure illumos_nvpair_free_structure +#define nvpair_get_binary illumos_nvpair_get_binary +#define nvpair_get_bool illumos_nvpair_get_bool +#define nvpair_get_descriptor illumos_nvpair_get_descriptor +#define nvpair_get_number illumos_nvpair_get_number +#define nvpair_get_nvlist illumos_nvpair_get_nvlist +#define nvpair_get_string illumos_nvpair_get_string +#define nvpair_header_size illumos_nvpair_header_size +#define nvpair_insert illumos_nvpair_insert +#define nvpair_move_binary illumos_nvpair_move_binary +#define nvpair_move_descriptor illumos_nvpair_move_descriptor +#define nvpair_move_nvlist illumos_nvpair_move_nvlist +#define nvpair_move_string illumos_nvpair_move_string +#define nvpair_movef_binary illumos_nvpair_movef_binary +#define nvpair_movef_descriptor illumos_nvpair_movef_descriptor +#define nvpair_movef_nvlist illumos_nvpair_movef_nvlist +#define nvpair_movef_string illumos_nvpair_movef_string +#define nvpair_movev_binary illumos_nvpair_movev_binary +#define nvpair_movev_descriptor illumos_nvpair_movev_descriptor +#define nvpair_movev_nvlist illumos_nvpair_movev_nvlist +#define nvpair_movev_string illumos_nvpair_movev_string +#define nvpair_name illumos_nvpair_name +#define nvpair_next illumos_nvpair_next +#define nvpair_nvlist illumos_nvpair_nvlist +#define nvpair_pack illumos_nvpair_pack +#define nvpair_pack_descriptor illumos_nvpair_pack_descriptor +#define nvpair_prev illumos_nvpair_prev +#define nvpair_remove illumos_nvpair_remove +#define nvpair_size illumos_nvpair_size +#define nvpair_type illumos_nvpair_type +#define nvpair_type_string illumos_nvpair_type_string +#define nvpair_unpack illumos_nvpair_unpack +#define nvpair_unpack_descriptor illumos_nvpair_unpack_descriptor + +#endif /* _KERNEL */ + +#include_next + +#endif From owner-svn-src-all@freebsd.org Mon Jan 4 00:22:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82ABDA60AA9; Mon, 4 Jan 2016 00:22:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CA4C111D; Mon, 4 Jan 2016 00:22:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u040MZgh005316; Mon, 4 Jan 2016 00:22:35 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u040MYN0005304; Mon, 4 Jan 2016 00:22:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601040022.u040MYN0005304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 4 Jan 2016 00:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293125 - vendor/less/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 00:22:36 -0000 Author: delphij Date: Mon Jan 4 00:22:34 2016 New Revision: 293125 URL: https://svnweb.freebsd.org/changeset/base/293125 Log: Vendor import of less v481. Added: vendor/less/dist/compose.uni vendor/less/dist/mkutable (contents, props changed) vendor/less/dist/ubin.uni vendor/less/dist/wide.uni Modified: vendor/less/dist/LICENSE vendor/less/dist/Makefile.aut vendor/less/dist/Makefile.wnm vendor/less/dist/NEWS vendor/less/dist/README vendor/less/dist/brac.c vendor/less/dist/ch.c vendor/less/dist/charset.c vendor/less/dist/charset.h vendor/less/dist/cmd.h vendor/less/dist/cmdbuf.c vendor/less/dist/command.c vendor/less/dist/configure vendor/less/dist/cvt.c vendor/less/dist/decode.c vendor/less/dist/defines.ds vendor/less/dist/defines.h.in vendor/less/dist/defines.o2 vendor/less/dist/defines.o9 vendor/less/dist/defines.wn vendor/less/dist/edit.c vendor/less/dist/filename.c vendor/less/dist/forwback.c vendor/less/dist/funcs.h vendor/less/dist/help.c vendor/less/dist/ifile.c vendor/less/dist/input.c vendor/less/dist/jump.c vendor/less/dist/less.h vendor/less/dist/less.hlp vendor/less/dist/less.man vendor/less/dist/less.nro vendor/less/dist/lessecho.c vendor/less/dist/lessecho.man vendor/less/dist/lessecho.nro vendor/less/dist/lesskey.c vendor/less/dist/lesskey.h vendor/less/dist/lesskey.man vendor/less/dist/lesskey.nro vendor/less/dist/lglob.h vendor/less/dist/line.c vendor/less/dist/linenum.c vendor/less/dist/lsystem.c vendor/less/dist/main.c vendor/less/dist/mark.c vendor/less/dist/mkhelp.c vendor/less/dist/optfunc.c vendor/less/dist/option.c vendor/less/dist/option.h vendor/less/dist/opttbl.c vendor/less/dist/os.c vendor/less/dist/output.c vendor/less/dist/pattern.c vendor/less/dist/pattern.h vendor/less/dist/pckeys.h vendor/less/dist/position.c vendor/less/dist/position.h vendor/less/dist/prompt.c vendor/less/dist/regexp.c vendor/less/dist/screen.c vendor/less/dist/scrsize.c vendor/less/dist/search.c vendor/less/dist/signal.c vendor/less/dist/tags.c vendor/less/dist/ttyin.c vendor/less/dist/version.c Modified: vendor/less/dist/LICENSE ============================================================================== --- vendor/less/dist/LICENSE Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/LICENSE Mon Jan 4 00:22:34 2016 (r293125) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2012 Mark Nudelman +Copyright (C) 1984-2015 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: vendor/less/dist/Makefile.aut ============================================================================== --- vendor/less/dist/Makefile.aut Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/Makefile.aut Mon Jan 4 00:22:34 2016 (r293125) @@ -14,25 +14,29 @@ SRC = \ help.c ifile.c input.c jump.c line.c linenum.c \ lsystem.c mark.c optfunc.c option.c opttbl.c os.c \ output.c pattern.c position.c prompt.c search.c signal.c \ - tags.c ttyin.c version.c + tags.c ttyin.c version.c DISTFILES_W = \ defines.ds Makefile.dsb Makefile.dsg Makefile.dsu \ defines.o2 Makefile.o2e \ defines.o9 Makefile.o9c Makefile.o9u \ - defines.wn Makefile.wnm Makefile.wnb + defines.wn Makefile.wnm Makefile.wnb \ + configure +UNICODE_FILES = \ + compose.uni ubin.uni wide.uni DISTFILES = \ ${SRC} regexp.c regexp.h \ COPYING INSTALL LICENSE Makefile.in Makefile.aut NEWS README \ - configure configure.ac lesskey.c lessecho.c scrsize.c \ + configure.ac lesskey.c lessecho.c scrsize.c \ charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h \ pckeys.h pattern.h position.h \ install.sh defines.h.in mkinstalldirs \ less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \ less.hlp \ mkfuncs.awk mkhelp.c \ + mkutable $(UNICODE_FILES) \ ${DISTFILES_W} -all: help.c funcs.h ${srcdir}/configure +all: help.c funcs.h $(UNICODE_FILES) ${srcdir}/configure release: .FORCE ${MAKE} -f Makefile.aut tagall @@ -46,7 +50,7 @@ help.c: less.hlp mkhelp -mv -f ${srcdir}/help.c ${srcdir}/help.c.old rm -rf help.c ./mkhelp < less.hlp > help.c - if cmp -s help.c help.c.old; then mv help.c.old help.c; fi + if cmp -s help.c help.c.old; then mv -f help.c.old help.c; fi mkhelp: mkhelp.c ${CC} -o mkhelp mkhelp.c @@ -58,7 +62,7 @@ ${srcdir}/configure: ${srcdir}/configure funcs.h: ${SRC:%=${srcdir}/%} -mv -f ${srcdir}/funcs.h ${srcdir}/funcs.h.old awk -f ${srcdir}/mkfuncs.awk ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h - if cmp -s funcs.h funcs.h.old; then mv funcs.h.old funcs.h; fi + if cmp -s funcs.h funcs.h.old; then mv -f funcs.h.old funcs.h; fi lint: lint -I. ${CPPFLAGS} ${SRC} @@ -75,6 +79,7 @@ REPLACE_VERSION = \ @REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q ${srcdir}/version.c`; \ DT=`date '+%d %h %Y'`; \ echo "Stuffing version number $$REL into $@"; \ + rm -f $@; \ sed \ -e "s;@@VERSION@@;$$REL;" \ -e "s;@@DATE@@;$$DT;" \ @@ -101,6 +106,12 @@ ${srcdir}/lesskey.man: ${srcdir}/lesskey ${srcdir}/lessecho.man: ${srcdir}/lessecho.nro ${NROFF} ${srcdir}/lessecho.nro >${srcdir}/lessecho.man +compose.uni: unicode/UnicodeData.txt + ./mkutable -f2 Mn Me -- unicode/UnicodeData.txt > $@ +ubin.uni: unicode/UnicodeData.txt + ./mkutable -f2 Cc Cf Cs Co Zl Zp -- unicode/UnicodeData.txt > $@ +wide.uni: unicode/EastAsianWidth.txt + ./mkutable -f1 W -- unicode/EastAsianWidth.txt > $@ distfiles: ${DISTFILES} @@ -114,7 +125,7 @@ dist: ${DISTFILES} for file in ${DISTFILES}; do \ ./add_copyright $$file $$REL; \ done; \ - cd $$REL; chmod +w ${DISTFILES_W}; cd ..; \ + cd $$REL; chmod -w *; chmod +w ${DISTFILES_W}; chmod +x configure; cd ..; \ echo "Creating release/$$REL/$$REL.tar.gz"; \ tar -cf - $$REL | gzip -c >release/$$REL/$$REL.tar.gz; \ echo "Signing release/$$REL/$$REL.tar.gz"; \ Modified: vendor/less/dist/Makefile.wnm ============================================================================== --- vendor/less/dist/Makefile.wnm Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/Makefile.wnm Mon Jan 4 00:22:34 2016 (r293125) @@ -6,7 +6,7 @@ CC = cl # Normal flags -CFLAGS = /nologo /ML /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c +CFLAGS = /nologo /MD /W3 /EHsc /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386 # Debugging flags Modified: vendor/less/dist/NEWS ============================================================================== --- vendor/less/dist/NEWS Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/NEWS Mon Jan 4 00:22:34 2016 (r293125) @@ -7,7 +7,44 @@ http://www.greenwoodsoftware.com/less You can also download the latest version of less from there. - To report bugs, suggestions or comments, send email to bug-less@gnu.org. + To report bugs, suggestions or comments, send email to bug-less@gnu.org + +====================================================================== + + Major changes between "less" versions 458 and 481 + +* Don't overwrite history file; just append to it. + +* New command ESC-G goes to end of currently buffered data in a pipe. + +* Disable history feature when compiled with LESSHISTFILE set to "-". + +* In more-compatible mode, make the -p option apply to every file opened, + not just the first one. + +* In more-compatible mode, change the -e option to work like -E, not -EF. + +* Treat multiple CRs before LF are like one CR (all the CRs are hidden). + +* Allow "extra" string in lesskey file to append to a multi-char command + (like a search pattern), without executing the command. + +* Ignore -u/-U setting while viewing help file, so that + underline and bold chars are displayed correctly. + +* Improve detection of "binary" files in UTF-8 mode. + +* Fix bug with ++ commands. + +* Fix bug where prompt was sometimes not displayed with +G. + +* Fix possible memory corruption + +* Fix bugs and improve performance in ampersand filtering. + +* Automate construction of Unicode tables from Unicode database. + +* Allow %% escape sequence in LESSOPEN variable. ====================================================================== Modified: vendor/less/dist/README ============================================================================== --- vendor/less/dist/README Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/README Mon Jan 4 00:22:34 2016 (r293125) @@ -1,7 +1,7 @@ - Less, version 458 + Less, version 481 - This is the distribution of less, version 458, released 04 Apr 2013. + This is the distribution of less, version 481, released 31 Aug 2015. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -45,8 +45,9 @@ INSTALLATION (Unix systems only): Specifies the regular expression library used by less for pattern matching. The default is "auto", which means the configure program finds a regular expression library automatically. Other values are: - posix Use the POSIX-compatible regcomp. + gnu Use the GNU regex library. pcre Use the PCRE library. + posix Use the POSIX-compatible regcomp. regcmp Use the regcmp library. re_comp Use the re_comp library. regcomp Use the V8-compatible regcomp. Modified: vendor/less/dist/brac.c ============================================================================== --- vendor/less/dist/brac.c Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/brac.c Mon Jan 4 00:22:34 2016 (r293125) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/ch.c ============================================================================== --- vendor/less/dist/ch.c Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/ch.c Mon Jan 4 00:22:34 2016 (r293125) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -54,7 +54,7 @@ struct buf { * The file state is maintained in a filestate structure. * A pointer to the filestate is kept in the ifile structure. */ -#define BUFHASH_SIZE 64 +#define BUFHASH_SIZE 1024 struct filestate { struct bufnode buflist; struct bufnode hashtbl[BUFHASH_SIZE]; @@ -323,13 +323,16 @@ ch_get() #if HAVE_STAT_INO if (follow_mode == FOLLOW_NAME) { - /* See whether the file's i-number has changed. + /* See whether the file's i-number has changed, + * or the file has shrunk. * If so, force the file to be closed and * reopened. */ struct stat st; + POSITION curr_pos = ch_tell(); int r = stat(get_filename(curr_ifile), &st); if (r == 0 && (st.st_ino != curr_ino || - st.st_dev != curr_dev)) + st.st_dev != curr_dev || + (curr_pos != NULL_POSITION && st.st_size < curr_pos))) { /* screen_trashed=2 causes * make_display to reopen the file. */ @@ -536,6 +539,32 @@ ch_end_seek() } /* + * Seek to the last position in the file that is currently buffered. + */ + public int +ch_end_buffer_seek() +{ + register struct buf *bp; + register struct bufnode *bn; + POSITION buf_pos; + POSITION end_pos; + + if (thisfile == NULL || (ch_flags & CH_CANSEEK)) + return (ch_end_seek()); + + end_pos = 0; + FOR_BUFS(bn) + { + bp = bufnode_buf(bn); + buf_pos = (bp->block * LBUFSIZE) + bp->datasize; + if (buf_pos > end_pos) + end_pos = buf_pos; + } + + return (ch_seek(end_pos)); +} + +/* * Seek to the beginning of the file, or as close to it as we can get. * We may not be able to seek there if input is a pipe and the * beginning of the pipe is no longer buffered. Modified: vendor/less/dist/charset.c ============================================================================== --- vendor/less/dist/charset.c Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/charset.c Mon Jan 4 00:22:34 2016 (r293125) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -466,36 +466,15 @@ prutfchar(ch) else SNPRINTF1(buf, sizeof(buf), binfmt, (char) ch); } else if (is_ubin_char(ch)) + { SNPRINTF1(buf, sizeof(buf), utfbinfmt, ch); - else + } else { - int len; + char *p = buf; if (ch >= 0x80000000) - { - len = 3; - ch = 0xFFFD; - } else - { - len = (ch < 0x80) ? 1 - : (ch < 0x800) ? 2 - : (ch < 0x10000) ? 3 - : (ch < 0x200000) ? 4 - : (ch < 0x4000000) ? 5 - : 6; - } - buf[len] = '\0'; - if (len == 1) - *buf = (char) ch; - else - { - *buf = ((1 << len) - 1) << (8 - len); - while (--len > 0) - { - buf[len] = (char) (0x80 | (ch & 0x3F)); - ch >>= 6; - } - *buf |= ch; - } + ch = 0xFFFD; /* REPLACEMENT CHARACTER */ + put_wchar(&p, ch); + *p = '\0'; } return (buf); } @@ -524,11 +503,12 @@ utf_len(ch) } /* - * Is a UTF-8 character well-formed? + * Does the parameter point to the lead byte of a well-formed UTF-8 character? */ public int -is_utf8_well_formed(s) +is_utf8_well_formed(s, slen) unsigned char *s; + int slen; { int i; int len; @@ -537,6 +517,8 @@ is_utf8_well_formed(s) return (0); len = utf_len((char) s[0]); + if (len > slen) + return (0); if (len == 1) return (1); if (len == 2) @@ -558,6 +540,35 @@ is_utf8_well_formed(s) } /* + * Return number of invalid UTF-8 sequences found in a buffer. + */ + public int +utf_bin_count(data, len) + unsigned char *data; + int len; +{ + int bin_count = 0; + while (len > 0) + { + if (is_utf8_well_formed(data, len)) + { + int clen = utf_len(*data); + data += clen; + len -= clen; + } else + { + /* Skip to next lead byte. */ + bin_count++; + do { + ++data; + --len; + } while (len > 0 && !IS_UTF8_LEAD(*data)); + } + } + return (bin_count); +} + +/* * Get the value of a UTF-8 character. */ public LWCHAR @@ -706,411 +717,51 @@ step_char(pp, dir, limit) /* * Unicode characters data + * Actual data is in the generated *.uni files. */ -struct wchar_range { LWCHAR first, last; }; -/* - * Characters with general category values - * Mn: Mark, Nonspacing - * Me: Mark, Enclosing - * Last synched with - * - * dated 2005-11-30T00:58:48Z - */ -static struct wchar_range comp_table[] = { - { 0x0300, 0x036F} /* Mn */, { 0x0483, 0x0486} /* Mn */, - { 0x0488, 0x0489} /* Me */, - { 0x0591, 0x05BD} /* Mn */, { 0x05BF, 0x05BF} /* Mn */, - { 0x05C1, 0x05C2} /* Mn */, { 0x05C4, 0x05C5} /* Mn */, - { 0x05C7, 0x05C7} /* Mn */, { 0x0610, 0x0615} /* Mn */, - { 0x064B, 0x065E} /* Mn */, { 0x0670, 0x0670} /* Mn */, - { 0x06D6, 0x06DC} /* Mn */, - { 0x06DE, 0x06DE} /* Me */, - { 0x06DF, 0x06E4} /* Mn */, { 0x06E7, 0x06E8} /* Mn */, - { 0x06EA, 0x06ED} /* Mn */, { 0x0711, 0x0711} /* Mn */, - { 0x0730, 0x074A} /* Mn */, { 0x07A6, 0x07B0} /* Mn */, - { 0x07EB, 0x07F3} /* Mn */, { 0x0901, 0x0902} /* Mn */, - { 0x093C, 0x093C} /* Mn */, { 0x0941, 0x0948} /* Mn */, - { 0x094D, 0x094D} /* Mn */, { 0x0951, 0x0954} /* Mn */, - { 0x0962, 0x0963} /* Mn */, { 0x0981, 0x0981} /* Mn */, - { 0x09BC, 0x09BC} /* Mn */, { 0x09C1, 0x09C4} /* Mn */, - { 0x09CD, 0x09CD} /* Mn */, { 0x09E2, 0x09E3} /* Mn */, - { 0x0A01, 0x0A02} /* Mn */, { 0x0A3C, 0x0A3C} /* Mn */, - { 0x0A41, 0x0A42} /* Mn */, { 0x0A47, 0x0A48} /* Mn */, - { 0x0A4B, 0x0A4D} /* Mn */, { 0x0A70, 0x0A71} /* Mn */, - { 0x0A81, 0x0A82} /* Mn */, { 0x0ABC, 0x0ABC} /* Mn */, - { 0x0AC1, 0x0AC5} /* Mn */, { 0x0AC7, 0x0AC8} /* Mn */, - { 0x0ACD, 0x0ACD} /* Mn */, { 0x0AE2, 0x0AE3} /* Mn */, - { 0x0B01, 0x0B01} /* Mn */, { 0x0B3C, 0x0B3C} /* Mn */, - { 0x0B3F, 0x0B3F} /* Mn */, { 0x0B41, 0x0B43} /* Mn */, - { 0x0B4D, 0x0B4D} /* Mn */, { 0x0B56, 0x0B56} /* Mn */, - { 0x0B82, 0x0B82} /* Mn */, { 0x0BC0, 0x0BC0} /* Mn */, - { 0x0BCD, 0x0BCD} /* Mn */, { 0x0C3E, 0x0C40} /* Mn */, - { 0x0C46, 0x0C48} /* Mn */, { 0x0C4A, 0x0C4D} /* Mn */, - { 0x0C55, 0x0C56} /* Mn */, { 0x0CBC, 0x0CBC} /* Mn */, - { 0x0CBF, 0x0CBF} /* Mn */, { 0x0CC6, 0x0CC6} /* Mn */, - { 0x0CCC, 0x0CCD} /* Mn */, { 0x0CE2, 0x0CE3} /* Mn */, - { 0x0D41, 0x0D43} /* Mn */, { 0x0D4D, 0x0D4D} /* Mn */, - { 0x0DCA, 0x0DCA} /* Mn */, { 0x0DD2, 0x0DD4} /* Mn */, - { 0x0DD6, 0x0DD6} /* Mn */, { 0x0E31, 0x0E31} /* Mn */, - { 0x0E34, 0x0E3A} /* Mn */, { 0x0E47, 0x0E4E} /* Mn */, - { 0x0EB1, 0x0EB1} /* Mn */, { 0x0EB4, 0x0EB9} /* Mn */, - { 0x0EBB, 0x0EBC} /* Mn */, { 0x0EC8, 0x0ECD} /* Mn */, - { 0x0F18, 0x0F19} /* Mn */, { 0x0F35, 0x0F35} /* Mn */, - { 0x0F37, 0x0F37} /* Mn */, { 0x0F39, 0x0F39} /* Mn */, - { 0x0F71, 0x0F7E} /* Mn */, { 0x0F80, 0x0F84} /* Mn */, - { 0x0F86, 0x0F87} /* Mn */, { 0x0F90, 0x0F97} /* Mn */, - { 0x0F99, 0x0FBC} /* Mn */, { 0x0FC6, 0x0FC6} /* Mn */, - { 0x102D, 0x1030} /* Mn */, { 0x1032, 0x1032} /* Mn */, - { 0x1036, 0x1037} /* Mn */, { 0x1039, 0x1039} /* Mn */, - { 0x1058, 0x1059} /* Mn */, { 0x135F, 0x135F} /* Mn */, - { 0x1712, 0x1714} /* Mn */, { 0x1732, 0x1734} /* Mn */, - { 0x1752, 0x1753} /* Mn */, { 0x1772, 0x1773} /* Mn */, - { 0x17B7, 0x17BD} /* Mn */, { 0x17C6, 0x17C6} /* Mn */, - { 0x17C9, 0x17D3} /* Mn */, { 0x17DD, 0x17DD} /* Mn */, - { 0x180B, 0x180D} /* Mn */, { 0x18A9, 0x18A9} /* Mn */, - { 0x1920, 0x1922} /* Mn */, { 0x1927, 0x1928} /* Mn */, - { 0x1932, 0x1932} /* Mn */, { 0x1939, 0x193B} /* Mn */, - { 0x1A17, 0x1A18} /* Mn */, { 0x1B00, 0x1B03} /* Mn */, - { 0x1B34, 0x1B34} /* Mn */, { 0x1B36, 0x1B3A} /* Mn */, - { 0x1B3C, 0x1B3C} /* Mn */, { 0x1B42, 0x1B42} /* Mn */, - { 0x1B6B, 0x1B73} /* Mn */, { 0x1DC0, 0x1DCA} /* Mn */, - { 0x1DFE, 0x1DFF} /* Mn */, { 0x20D0, 0x20DC} /* Mn */, - { 0x20DD, 0x20E0} /* Me */, - { 0x20E1, 0x20E1} /* Mn */, - { 0x20E2, 0x20E4} /* Me */, - { 0x20E5, 0x20EF} /* Mn */, { 0x302A, 0x302F} /* Mn */, - { 0x3099, 0x309A} /* Mn */, { 0xA806, 0xA806} /* Mn */, - { 0xA80B, 0xA80B} /* Mn */, { 0xA825, 0xA826} /* Mn */, - { 0xFB1E, 0xFB1E} /* Mn */, { 0xFE00, 0xFE0F} /* Mn */, - { 0xFE20, 0xFE23} /* Mn */, { 0x10A01, 0x10A03} /* Mn */, - { 0x10A05, 0x10A06} /* Mn */, { 0x10A0C, 0x10A0F} /* Mn */, - { 0x10A38, 0x10A3A} /* Mn */, { 0x10A3F, 0x10A3F} /* Mn */, - { 0x1D167, 0x1D169} /* Mn */, { 0x1D17B, 0x1D182} /* Mn */, - { 0x1D185, 0x1D18B} /* Mn */, { 0x1D1AA, 0x1D1AD} /* Mn */, - { 0x1D242, 0x1D244} /* Mn */, { 0xE0100, 0xE01EF} /* Mn */, -}; +#define DECLARE_RANGE_TABLE_START(name) \ + static struct wchar_range name##_array[] = { +#define DECLARE_RANGE_TABLE_END(name) \ + }; struct wchar_range_table name##_table = { name##_array, sizeof(name##_array)/sizeof(*name##_array) }; -/* - * Special pairs, not ranges. - */ +DECLARE_RANGE_TABLE_START(compose) +#include "compose.uni" +DECLARE_RANGE_TABLE_END(compose) + +DECLARE_RANGE_TABLE_START(ubin) +#include "ubin.uni" +DECLARE_RANGE_TABLE_END(ubin) + +DECLARE_RANGE_TABLE_START(wide) +#include "wide.uni" +DECLARE_RANGE_TABLE_END(wide) + +/* comb_table is special pairs, not ranges. */ static struct wchar_range comb_table[] = { {0x0644,0x0622}, {0x0644,0x0623}, {0x0644,0x0625}, {0x0644,0x0627}, }; -/* - * Characters with general category values - * Cc: Other, Control - * Cf: Other, Format - * Cs: Other, Surrogate - * Co: Other, Private Use - * Cn: Other, Not Assigned - * Zl: Separator, Line - * Zp: Separator, Paragraph - * Last synched with - * - * dated 2005-11-30T00:58:48Z - */ -static struct wchar_range ubin_table[] = { - { 0x0000, 0x0007} /* Cc */, - { 0x000B, 0x000C} /* Cc */, - { 0x000E, 0x001A} /* Cc */, - { 0x001C, 0x001F} /* Cc */, - { 0x007F, 0x009F} /* Cc */, -#if 0 - { 0x00AD, 0x00AD} /* Cf */, -#endif - { 0x0370, 0x0373} /* Cn */, { 0x0376, 0x0379} /* Cn */, - { 0x037F, 0x0383} /* Cn */, { 0x038B, 0x038B} /* Cn */, - { 0x038D, 0x038D} /* Cn */, { 0x03A2, 0x03A2} /* Cn */, - { 0x03CF, 0x03CF} /* Cn */, { 0x0487, 0x0487} /* Cn */, - { 0x0514, 0x0530} /* Cn */, { 0x0557, 0x0558} /* Cn */, - { 0x0560, 0x0560} /* Cn */, { 0x0588, 0x0588} /* Cn */, - { 0x058B, 0x0590} /* Cn */, { 0x05C8, 0x05CF} /* Cn */, - { 0x05EB, 0x05EF} /* Cn */, { 0x05F5, 0x05FF} /* Cn */, -#if 0 - { 0x0600, 0x0603} /* Cf */, -#endif - { 0x0604, 0x060A} /* Cn */, { 0x0616, 0x061A} /* Cn */, - { 0x061C, 0x061D} /* Cn */, { 0x0620, 0x0620} /* Cn */, - { 0x063B, 0x063F} /* Cn */, { 0x065F, 0x065F} /* Cn */, -#if 0 - { 0x06DD, 0x06DD} /* Cf */, -#endif - { 0x070E, 0x070E} /* Cn */, -#if 0 - { 0x070F, 0x070F} /* Cf */, -#endif - { 0x074B, 0x074C} /* Cn */, { 0x076E, 0x077F} /* Cn */, - { 0x07B2, 0x07BF} /* Cn */, { 0x07FB, 0x0900} /* Cn */, - { 0x093A, 0x093B} /* Cn */, { 0x094E, 0x094F} /* Cn */, - { 0x0955, 0x0957} /* Cn */, { 0x0971, 0x097A} /* Cn */, - { 0x0980, 0x0980} /* Cn */, { 0x0984, 0x0984} /* Cn */, - { 0x098D, 0x098E} /* Cn */, { 0x0991, 0x0992} /* Cn */, - { 0x09A9, 0x09A9} /* Cn */, { 0x09B1, 0x09B1} /* Cn */, - { 0x09B3, 0x09B5} /* Cn */, { 0x09BA, 0x09BB} /* Cn */, - { 0x09C5, 0x09C6} /* Cn */, { 0x09C9, 0x09CA} /* Cn */, - { 0x09CF, 0x09D6} /* Cn */, { 0x09D8, 0x09DB} /* Cn */, - { 0x09DE, 0x09DE} /* Cn */, { 0x09E4, 0x09E5} /* Cn */, - { 0x09FB, 0x0A00} /* Cn */, { 0x0A04, 0x0A04} /* Cn */, - { 0x0A0B, 0x0A0E} /* Cn */, { 0x0A11, 0x0A12} /* Cn */, - { 0x0A29, 0x0A29} /* Cn */, { 0x0A31, 0x0A31} /* Cn */, - { 0x0A34, 0x0A34} /* Cn */, { 0x0A37, 0x0A37} /* Cn */, - { 0x0A3A, 0x0A3B} /* Cn */, { 0x0A3D, 0x0A3D} /* Cn */, - { 0x0A43, 0x0A46} /* Cn */, { 0x0A49, 0x0A4A} /* Cn */, - { 0x0A4E, 0x0A58} /* Cn */, { 0x0A5D, 0x0A5D} /* Cn */, - { 0x0A5F, 0x0A65} /* Cn */, { 0x0A75, 0x0A80} /* Cn */, - { 0x0A84, 0x0A84} /* Cn */, { 0x0A8E, 0x0A8E} /* Cn */, - { 0x0A92, 0x0A92} /* Cn */, { 0x0AA9, 0x0AA9} /* Cn */, - { 0x0AB1, 0x0AB1} /* Cn */, { 0x0AB4, 0x0AB4} /* Cn */, - { 0x0ABA, 0x0ABB} /* Cn */, { 0x0AC6, 0x0AC6} /* Cn */, - { 0x0ACA, 0x0ACA} /* Cn */, { 0x0ACE, 0x0ACF} /* Cn */, - { 0x0AD1, 0x0ADF} /* Cn */, { 0x0AE4, 0x0AE5} /* Cn */, - { 0x0AF0, 0x0AF0} /* Cn */, { 0x0AF2, 0x0B00} /* Cn */, - { 0x0B04, 0x0B04} /* Cn */, { 0x0B0D, 0x0B0E} /* Cn */, - { 0x0B11, 0x0B12} /* Cn */, { 0x0B29, 0x0B29} /* Cn */, - { 0x0B31, 0x0B31} /* Cn */, { 0x0B34, 0x0B34} /* Cn */, - { 0x0B3A, 0x0B3B} /* Cn */, { 0x0B44, 0x0B46} /* Cn */, - { 0x0B49, 0x0B4A} /* Cn */, { 0x0B4E, 0x0B55} /* Cn */, - { 0x0B58, 0x0B5B} /* Cn */, { 0x0B5E, 0x0B5E} /* Cn */, - { 0x0B62, 0x0B65} /* Cn */, { 0x0B72, 0x0B81} /* Cn */, - { 0x0B84, 0x0B84} /* Cn */, { 0x0B8B, 0x0B8D} /* Cn */, - { 0x0B91, 0x0B91} /* Cn */, { 0x0B96, 0x0B98} /* Cn */, - { 0x0B9B, 0x0B9B} /* Cn */, { 0x0B9D, 0x0B9D} /* Cn */, - { 0x0BA0, 0x0BA2} /* Cn */, { 0x0BA5, 0x0BA7} /* Cn */, - { 0x0BAB, 0x0BAD} /* Cn */, { 0x0BBA, 0x0BBD} /* Cn */, - { 0x0BC3, 0x0BC5} /* Cn */, { 0x0BC9, 0x0BC9} /* Cn */, - { 0x0BCE, 0x0BD6} /* Cn */, { 0x0BD8, 0x0BE5} /* Cn */, - { 0x0BFB, 0x0C00} /* Cn */, { 0x0C04, 0x0C04} /* Cn */, - { 0x0C0D, 0x0C0D} /* Cn */, { 0x0C11, 0x0C11} /* Cn */, - { 0x0C29, 0x0C29} /* Cn */, { 0x0C34, 0x0C34} /* Cn */, - { 0x0C3A, 0x0C3D} /* Cn */, { 0x0C45, 0x0C45} /* Cn */, - { 0x0C49, 0x0C49} /* Cn */, { 0x0C4E, 0x0C54} /* Cn */, - { 0x0C57, 0x0C5F} /* Cn */, { 0x0C62, 0x0C65} /* Cn */, - { 0x0C70, 0x0C81} /* Cn */, { 0x0C84, 0x0C84} /* Cn */, - { 0x0C8D, 0x0C8D} /* Cn */, { 0x0C91, 0x0C91} /* Cn */, - { 0x0CA9, 0x0CA9} /* Cn */, { 0x0CB4, 0x0CB4} /* Cn */, - { 0x0CBA, 0x0CBB} /* Cn */, { 0x0CC5, 0x0CC5} /* Cn */, - { 0x0CC9, 0x0CC9} /* Cn */, { 0x0CCE, 0x0CD4} /* Cn */, - { 0x0CD7, 0x0CDD} /* Cn */, { 0x0CDF, 0x0CDF} /* Cn */, - { 0x0CE4, 0x0CE5} /* Cn */, { 0x0CF0, 0x0CF0} /* Cn */, - { 0x0CF3, 0x0D01} /* Cn */, { 0x0D04, 0x0D04} /* Cn */, - { 0x0D0D, 0x0D0D} /* Cn */, { 0x0D11, 0x0D11} /* Cn */, - { 0x0D29, 0x0D29} /* Cn */, { 0x0D3A, 0x0D3D} /* Cn */, - { 0x0D44, 0x0D45} /* Cn */, { 0x0D49, 0x0D49} /* Cn */, - { 0x0D4E, 0x0D56} /* Cn */, { 0x0D58, 0x0D5F} /* Cn */, - { 0x0D62, 0x0D65} /* Cn */, { 0x0D70, 0x0D81} /* Cn */, - { 0x0D84, 0x0D84} /* Cn */, { 0x0D97, 0x0D99} /* Cn */, - { 0x0DB2, 0x0DB2} /* Cn */, { 0x0DBC, 0x0DBC} /* Cn */, - { 0x0DBE, 0x0DBF} /* Cn */, { 0x0DC7, 0x0DC9} /* Cn */, - { 0x0DCB, 0x0DCE} /* Cn */, { 0x0DD5, 0x0DD5} /* Cn */, - { 0x0DD7, 0x0DD7} /* Cn */, { 0x0DE0, 0x0DF1} /* Cn */, - { 0x0DF5, 0x0E00} /* Cn */, { 0x0E3B, 0x0E3E} /* Cn */, - { 0x0E5C, 0x0E80} /* Cn */, { 0x0E83, 0x0E83} /* Cn */, - { 0x0E85, 0x0E86} /* Cn */, { 0x0E89, 0x0E89} /* Cn */, - { 0x0E8B, 0x0E8C} /* Cn */, { 0x0E8E, 0x0E93} /* Cn */, - { 0x0E98, 0x0E98} /* Cn */, { 0x0EA0, 0x0EA0} /* Cn */, - { 0x0EA4, 0x0EA4} /* Cn */, { 0x0EA6, 0x0EA6} /* Cn */, - { 0x0EA8, 0x0EA9} /* Cn */, { 0x0EAC, 0x0EAC} /* Cn */, - { 0x0EBA, 0x0EBA} /* Cn */, { 0x0EBE, 0x0EBF} /* Cn */, - { 0x0EC5, 0x0EC5} /* Cn */, { 0x0EC7, 0x0EC7} /* Cn */, - { 0x0ECE, 0x0ECF} /* Cn */, { 0x0EDA, 0x0EDB} /* Cn */, - { 0x0EDE, 0x0EFF} /* Cn */, { 0x0F48, 0x0F48} /* Cn */, - { 0x0F6B, 0x0F70} /* Cn */, { 0x0F8C, 0x0F8F} /* Cn */, - { 0x0F98, 0x0F98} /* Cn */, { 0x0FBD, 0x0FBD} /* Cn */, - { 0x0FCD, 0x0FCE} /* Cn */, { 0x0FD2, 0x0FFF} /* Cn */, - { 0x1022, 0x1022} /* Cn */, { 0x1028, 0x1028} /* Cn */, - { 0x102B, 0x102B} /* Cn */, { 0x1033, 0x1035} /* Cn */, - { 0x103A, 0x103F} /* Cn */, { 0x105A, 0x109F} /* Cn */, - { 0x10C6, 0x10CF} /* Cn */, { 0x10FD, 0x10FF} /* Cn */, - { 0x115A, 0x115E} /* Cn */, { 0x11A3, 0x11A7} /* Cn */, - { 0x11FA, 0x11FF} /* Cn */, { 0x1249, 0x1249} /* Cn */, - { 0x124E, 0x124F} /* Cn */, { 0x1257, 0x1257} /* Cn */, - { 0x1259, 0x1259} /* Cn */, { 0x125E, 0x125F} /* Cn */, - { 0x1289, 0x1289} /* Cn */, { 0x128E, 0x128F} /* Cn */, - { 0x12B1, 0x12B1} /* Cn */, { 0x12B6, 0x12B7} /* Cn */, - { 0x12BF, 0x12BF} /* Cn */, { 0x12C1, 0x12C1} /* Cn */, - { 0x12C6, 0x12C7} /* Cn */, { 0x12D7, 0x12D7} /* Cn */, - { 0x1311, 0x1311} /* Cn */, { 0x1316, 0x1317} /* Cn */, - { 0x135B, 0x135E} /* Cn */, { 0x137D, 0x137F} /* Cn */, - { 0x139A, 0x139F} /* Cn */, { 0x13F5, 0x1400} /* Cn */, - { 0x1677, 0x167F} /* Cn */, { 0x169D, 0x169F} /* Cn */, - { 0x16F1, 0x16FF} /* Cn */, { 0x170D, 0x170D} /* Cn */, - { 0x1715, 0x171F} /* Cn */, { 0x1737, 0x173F} /* Cn */, - { 0x1754, 0x175F} /* Cn */, { 0x176D, 0x176D} /* Cn */, - { 0x1771, 0x1771} /* Cn */, { 0x1774, 0x177F} /* Cn */, -#if 0 - { 0x17B4, 0x17B5} /* Cf */, -#endif - { 0x17DE, 0x17DF} /* Cn */, { 0x17EA, 0x17EF} /* Cn */, - { 0x17FA, 0x17FF} /* Cn */, { 0x180F, 0x180F} /* Cn */, - { 0x181A, 0x181F} /* Cn */, { 0x1878, 0x187F} /* Cn */, - { 0x18AA, 0x18FF} /* Cn */, { 0x191D, 0x191F} /* Cn */, - { 0x192C, 0x192F} /* Cn */, { 0x193C, 0x193F} /* Cn */, - { 0x1941, 0x1943} /* Cn */, { 0x196E, 0x196F} /* Cn */, - { 0x1975, 0x197F} /* Cn */, { 0x19AA, 0x19AF} /* Cn */, - { 0x19CA, 0x19CF} /* Cn */, { 0x19DA, 0x19DD} /* Cn */, - { 0x1A1C, 0x1A1D} /* Cn */, { 0x1A20, 0x1AFF} /* Cn */, - { 0x1B4C, 0x1B4F} /* Cn */, { 0x1B7D, 0x1CFF} /* Cn */, - { 0x1DCB, 0x1DFD} /* Cn */, { 0x1E9C, 0x1E9F} /* Cn */, - { 0x1EFA, 0x1EFF} /* Cn */, { 0x1F16, 0x1F17} /* Cn */, - { 0x1F1E, 0x1F1F} /* Cn */, { 0x1F46, 0x1F47} /* Cn */, - { 0x1F4E, 0x1F4F} /* Cn */, { 0x1F58, 0x1F58} /* Cn */, - { 0x1F5A, 0x1F5A} /* Cn */, { 0x1F5C, 0x1F5C} /* Cn */, - { 0x1F5E, 0x1F5E} /* Cn */, { 0x1F7E, 0x1F7F} /* Cn */, - { 0x1FB5, 0x1FB5} /* Cn */, { 0x1FC5, 0x1FC5} /* Cn */, - { 0x1FD4, 0x1FD5} /* Cn */, { 0x1FDC, 0x1FDC} /* Cn */, - { 0x1FF0, 0x1FF1} /* Cn */, { 0x1FF5, 0x1FF5} /* Cn */, - { 0x1FFF, 0x1FFF} /* Cn */, - { 0x200B, 0x200F} /* Cf */, - { 0x2028, 0x2028} /* Zl */, - { 0x2029, 0x2029} /* Zp */, - { 0x202A, 0x202E} /* Cf */, - { 0x2060, 0x2063} /* Cf */, - { 0x2064, 0x2069} /* Cn */, - { 0x206A, 0x206F} /* Cf */, - { 0x2072, 0x2073} /* Cn */, { 0x208F, 0x208F} /* Cn */, - { 0x2095, 0x209F} /* Cn */, { 0x20B6, 0x20CF} /* Cn */, - { 0x20F0, 0x20FF} /* Cn */, { 0x214F, 0x2152} /* Cn */, - { 0x2185, 0x218F} /* Cn */, { 0x23E8, 0x23FF} /* Cn */, - { 0x2427, 0x243F} /* Cn */, { 0x244B, 0x245F} /* Cn */, - { 0x269D, 0x269F} /* Cn */, { 0x26B3, 0x2700} /* Cn */, - { 0x2705, 0x2705} /* Cn */, { 0x270A, 0x270B} /* Cn */, - { 0x2728, 0x2728} /* Cn */, { 0x274C, 0x274C} /* Cn */, - { 0x274E, 0x274E} /* Cn */, { 0x2753, 0x2755} /* Cn */, - { 0x2757, 0x2757} /* Cn */, { 0x275F, 0x2760} /* Cn */, - { 0x2795, 0x2797} /* Cn */, { 0x27B0, 0x27B0} /* Cn */, - { 0x27BF, 0x27BF} /* Cn */, { 0x27CB, 0x27CF} /* Cn */, - { 0x27EC, 0x27EF} /* Cn */, { 0x2B1B, 0x2B1F} /* Cn */, - { 0x2B24, 0x2BFF} /* Cn */, { 0x2C2F, 0x2C2F} /* Cn */, - { 0x2C5F, 0x2C5F} /* Cn */, { 0x2C6D, 0x2C73} /* Cn */, - { 0x2C78, 0x2C7F} /* Cn */, { 0x2CEB, 0x2CF8} /* Cn */, - { 0x2D26, 0x2D2F} /* Cn */, { 0x2D66, 0x2D6E} /* Cn */, - { 0x2D70, 0x2D7F} /* Cn */, { 0x2D97, 0x2D9F} /* Cn */, - { 0x2DA7, 0x2DA7} /* Cn */, { 0x2DAF, 0x2DAF} /* Cn */, - { 0x2DB7, 0x2DB7} /* Cn */, { 0x2DBF, 0x2DBF} /* Cn */, - { 0x2DC7, 0x2DC7} /* Cn */, { 0x2DCF, 0x2DCF} /* Cn */, - { 0x2DD7, 0x2DD7} /* Cn */, { 0x2DDF, 0x2DFF} /* Cn */, - { 0x2E18, 0x2E1B} /* Cn */, { 0x2E1E, 0x2E7F} /* Cn */, - { 0x2E9A, 0x2E9A} /* Cn */, { 0x2EF4, 0x2EFF} /* Cn */, - { 0x2FD6, 0x2FEF} /* Cn */, { 0x2FFC, 0x2FFF} /* Cn */, - { 0x3040, 0x3040} /* Cn */, { 0x3097, 0x3098} /* Cn */, - { 0x3100, 0x3104} /* Cn */, { 0x312D, 0x3130} /* Cn */, - { 0x318F, 0x318F} /* Cn */, { 0x31B8, 0x31BF} /* Cn */, - { 0x31D0, 0x31EF} /* Cn */, { 0x321F, 0x321F} /* Cn */, - { 0x3244, 0x324F} /* Cn */, { 0x32FF, 0x32FF} /* Cn */, - { 0x4DB6, 0x4DBF} /* Cn */, { 0x9FBC, 0x9FFF} /* Cn */, - { 0xA48D, 0xA48F} /* Cn */, { 0xA4C7, 0xA6FF} /* Cn */, - { 0xA71B, 0xA71F} /* Cn */, { 0xA722, 0xA7FF} /* Cn */, - { 0xA82C, 0xA83F} /* Cn */, { 0xA878, 0xABFF} /* Cn */, - { 0xD7A4, 0xD7FF} /* Cn */, - { 0xD800, 0xDFFF} /* Cs */, - { 0xE000, 0xF8FF} /* Co */, - { 0xFA2E, 0xFA2F} /* Cn */, { 0xFA6B, 0xFA6F} /* Cn */, - { 0xFADA, 0xFAFF} /* Cn */, { 0xFB07, 0xFB12} /* Cn */, - { 0xFB18, 0xFB1C} /* Cn */, { 0xFB37, 0xFB37} /* Cn */, - { 0xFB3D, 0xFB3D} /* Cn */, { 0xFB3F, 0xFB3F} /* Cn */, - { 0xFB42, 0xFB42} /* Cn */, { 0xFB45, 0xFB45} /* Cn */, - { 0xFBB2, 0xFBD2} /* Cn */, { 0xFD40, 0xFD4F} /* Cn */, - { 0xFD90, 0xFD91} /* Cn */, { 0xFDC8, 0xFDEF} /* Cn */, - { 0xFDFE, 0xFDFF} /* Cn */, { 0xFE1A, 0xFE1F} /* Cn */, - { 0xFE24, 0xFE2F} /* Cn */, { 0xFE53, 0xFE53} /* Cn */, - { 0xFE67, 0xFE67} /* Cn */, { 0xFE6C, 0xFE6F} /* Cn */, - { 0xFE75, 0xFE75} /* Cn */, { 0xFEFD, 0xFEFE} /* Cn */, - { 0xFEFF, 0xFEFF} /* Cf */, - { 0xFF00, 0xFF00} /* Cn */, { 0xFFBF, 0xFFC1} /* Cn */, - { 0xFFC8, 0xFFC9} /* Cn */, { 0xFFD0, 0xFFD1} /* Cn */, - { 0xFFD8, 0xFFD9} /* Cn */, { 0xFFDD, 0xFFDF} /* Cn */, - { 0xFFE7, 0xFFE7} /* Cn */, { 0xFFEF, 0xFFF8} /* Cn */, - { 0xFFF9, 0xFFFB} /* Cf */, - { 0xFFFE, 0xFFFF} /* Cn */, { 0x1000C, 0x1000C} /* Cn */, - { 0x10027, 0x10027} /* Cn */, { 0x1003B, 0x1003B} /* Cn */, - { 0x1003E, 0x1003E} /* Cn */, { 0x1004E, 0x1004F} /* Cn */, - { 0x1005E, 0x1007F} /* Cn */, { 0x100FB, 0x100FF} /* Cn */, - { 0x10103, 0x10106} /* Cn */, { 0x10134, 0x10136} /* Cn */, - { 0x1018B, 0x102FF} /* Cn */, { 0x1031F, 0x1031F} /* Cn */, - { 0x10324, 0x1032F} /* Cn */, { 0x1034B, 0x1037F} /* Cn */, - { 0x1039E, 0x1039E} /* Cn */, { 0x103C4, 0x103C7} /* Cn */, - { 0x103D6, 0x103FF} /* Cn */, - { 0x1049E, 0x1049F} /* Cn */, { 0x104AA, 0x107FF} /* Cn */, - { 0x10806, 0x10807} /* Cn */, { 0x10809, 0x10809} /* Cn */, - { 0x10836, 0x10836} /* Cn */, { 0x10839, 0x1083B} /* Cn */, - { 0x1083D, 0x1083E} /* Cn */, { 0x10840, 0x108FF} /* Cn */, - { 0x1091A, 0x1091E} /* Cn */, { 0x10920, 0x109FF} /* Cn */, - { 0x10A04, 0x10A04} /* Cn */, { 0x10A07, 0x10A0B} /* Cn */, - { 0x10A14, 0x10A14} /* Cn */, { 0x10A18, 0x10A18} /* Cn */, - { 0x10A34, 0x10A37} /* Cn */, { 0x10A3B, 0x10A3E} /* Cn */, - { 0x10A48, 0x10A4F} /* Cn */, { 0x10A59, 0x11FFF} /* Cn */, - { 0x1236F, 0x123FF} /* Cn */, { 0x12463, 0x1246F} /* Cn */, - { 0x12474, 0x1CFFF} /* Cn */, { 0x1D0F6, 0x1D0FF} /* Cn */, - { 0x1D127, 0x1D129} /* Cn */, - { 0x1D173, 0x1D17A} /* Cf */, - { 0x1D1DE, 0x1D1FF} /* Cn */, { 0x1D246, 0x1D2FF} /* Cn */, - { 0x1D357, 0x1D35F} /* Cn */, { 0x1D372, 0x1D3FF} /* Cn */, - { 0x1D455, 0x1D455} /* Cn */, { 0x1D49D, 0x1D49D} /* Cn */, - { 0x1D4A0, 0x1D4A1} /* Cn */, { 0x1D4A3, 0x1D4A4} /* Cn */, - { 0x1D4A7, 0x1D4A8} /* Cn */, { 0x1D4AD, 0x1D4AD} /* Cn */, - { 0x1D4BA, 0x1D4BA} /* Cn */, { 0x1D4BC, 0x1D4BC} /* Cn */, - { 0x1D4C4, 0x1D4C4} /* Cn */, { 0x1D506, 0x1D506} /* Cn */, - { 0x1D50B, 0x1D50C} /* Cn */, { 0x1D515, 0x1D515} /* Cn */, - { 0x1D51D, 0x1D51D} /* Cn */, { 0x1D53A, 0x1D53A} /* Cn */, - { 0x1D53F, 0x1D53F} /* Cn */, { 0x1D545, 0x1D545} /* Cn */, - { 0x1D547, 0x1D549} /* Cn */, { 0x1D551, 0x1D551} /* Cn */, - { 0x1D6A6, 0x1D6A7} /* Cn */, { 0x1D7CC, 0x1D7CD} /* Cn */, - { 0x1D800, 0x1FFFF} /* Cn */, { 0x2A6D7, 0x2F7FF} /* Cn */, - { 0x2FA1E, 0xE0000} /* Cn */, - { 0xE0001, 0xE0001} /* Cf */, - { 0xE0002, 0xE001F} /* Cn */, - { 0xE0020, 0xE007F} /* Cf */, - { 0xE0080, 0xE00FF} /* Cn */, { 0xE01F0, 0xEFFFF} /* Cn */, - { 0xF0000, 0xFFFFD} /* Co */, - { 0xFFFFE, 0xFFFFF} /* Cn */, - {0x100000,0x10FFFD} /* Co */, - {0x10FFFE,0x10FFFF} /* Cn */, - {0x110000,0x7FFFFFFF} /* ISO 10646?? */ -}; - -/* - * Double width characters - * W: East Asian Wide - * F: East Asian Full-width - * Unassigned code points may be included when they allow ranges to be merged. - * Last synched with - * - * dated 2005-11-08T01:32:56Z - */ -static struct wchar_range wide_table[] = { - { 0x1100, 0x115F} /* W */, { 0x2329, 0x232A} /* W */, - { 0x2E80, 0x2FFB} /* W */, - { 0x3000, 0x3000} /* F */, - { 0x3001, 0x303E} /* W */, { 0x3041, 0x4DB5} /* W */, - { 0x4E00, 0x9FBB} /* W */, { 0xA000, 0xA4C6} /* W */, - { 0xAC00, 0xD7A3} /* W */, { 0xF900, 0xFAD9} /* W */, - { 0xFE10, 0xFE19} /* W */, { 0xFE30, 0xFE6B} /* W */, - { 0xFF01, 0xFF60} /* F */, { 0xFFE0, 0xFFE6} /* F */, - { 0x20000, 0x2FFFD} /* W */, { 0x30000, 0x3FFFD} /* W */, -}; static int -is_in_table(ch, table, tsize) +is_in_table(ch, table) LWCHAR ch; - struct wchar_range table[]; - int tsize; + struct wchar_range_table *table; { int hi; int lo; /* Binary search in the table. */ - if (ch < table[0].first) + if (ch < table->table[0].first) return 0; lo = 0; - hi = tsize - 1; + hi = table->count - 1; while (lo <= hi) { int mid = (lo + hi) / 2; - if (ch > table[mid].last) + if (ch > table->table[mid].last) lo = mid + 1; - else if (ch < table[mid].first) + else if (ch < table->table[mid].first) hi = mid - 1; else return 1; @@ -1126,7 +777,7 @@ is_in_table(ch, table, tsize) is_composing_char(ch) LWCHAR ch; { - return is_in_table(ch, comp_table, (sizeof(comp_table) / sizeof(*comp_table))); + return is_in_table(ch, &compose_table); } /* @@ -1136,7 +787,7 @@ is_composing_char(ch) is_ubin_char(ch) LWCHAR ch; { - return is_in_table(ch, ubin_table, (sizeof(ubin_table) / sizeof(*ubin_table))); + return is_in_table(ch, &ubin_table); } /* @@ -1146,7 +797,7 @@ is_ubin_char(ch) is_wide_char(ch) LWCHAR ch; { - return is_in_table(ch, wide_table, (sizeof(wide_table) / sizeof(*wide_table))); + return is_in_table(ch, &wide_table); } /* Modified: vendor/less/dist/charset.h ============================================================================== --- vendor/less/dist/charset.h Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/charset.h Mon Jan 4 00:22:34 2016 (r293125) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/cmd.h ============================================================================== --- vendor/less/dist/cmd.h Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/cmd.h Mon Jan 4 00:22:34 2016 (r293125) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -66,6 +66,7 @@ #define A_PREV_TAG 54 #define A_FILTER 55 #define A_F_UNTIL_HILITE 56 +#define A_GOEND_BUF 57 #define A_INVALID 100 #define A_NOACTION 101 Modified: vendor/less/dist/cmdbuf.c ============================================================================== --- vendor/less/dist/cmdbuf.c Mon Jan 4 00:02:58 2016 (r293124) +++ vendor/less/dist/cmdbuf.c Mon Jan 4 00:22:34 2016 (r293125) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -203,7 +203,7 @@ cmd_step_common(p, ch, len, pwidth, bswi pr = prchar((int) ch); if (pwidth != NULL || bswidth != NULL) { - int len = strlen(pr); + int len = (int) strlen(pr); if (pwidth != NULL) *pwidth = len; if (bswidth != NULL) @@ -222,7 +222,7 @@ cmd_step_common(p, ch, len, pwidth, bswi *bswidth = 0; } else if (is_ubin_char(ch)) { - int len = strlen(pr); + int len = (int) strlen(pr); if (pwidth != NULL) *pwidth = len; if (bswidth != NULL) @@ -375,7 +375,7 @@ cmd_lshift() s = ns; } - cmd_offset = s - cmdbuf; + cmd_offset = (int) (s - cmdbuf); save_cp = cp; cmd_home(); cmd_repaint(save_cp); @@ -405,7 +405,7 @@ cmd_rshift() cols += width; } - cmd_offset = s - cmdbuf; + cmd_offset = (int) (s - cmdbuf); save_cp = cp; cmd_home(); cmd_repaint(save_cp); @@ -535,7 +535,7 @@ cmd_erase() */ s = cp; cmd_left(); - clen = s - cp; + clen = (int) (s - cp); /* * Remove the char from the buffer (shift the buffer left). @@ -701,7 +701,7 @@ cmd_updown(action) if (updown_match < 0) { - updown_match = cp - cmdbuf; + updown_match = (int) (cp - cmdbuf); } /* @@ -744,12 +744,13 @@ cmd_updown(action) #endif /* - * Add a string to a history list. + * Add a string to an mlist. */ public void -cmd_addhist(mlist, cmd) +cmd_addhist(mlist, cmd, modified) struct mlist *mlist; char *cmd; + int modified; { #if CMD_HISTORY struct mlist *ml; @@ -773,6 +774,7 @@ cmd_addhist(mlist, cmd) */ ml = (struct mlist *) ecalloc(1, sizeof(struct mlist)); ml->string = save(cmd); + ml->modified = modified; ml->next = mlist; ml->prev = mlist->prev; mlist->prev->next = ml; @@ -799,7 +801,7 @@ cmd_accept() */ if (curr_mlist == NULL) return; - cmd_addhist(curr_mlist, cmdbuf); + cmd_addhist(curr_mlist, cmdbuf, 1); curr_mlist->modified = 1; #endif } @@ -965,7 +967,7 @@ delimit_word() int delim_quoted = 0; int meta_quoted = 0; char *esc = get_meta_escape(); - int esclen = strlen(esc); + int esclen = (int) strlen(esc); #endif /* @@ -1262,7 +1264,7 @@ cmd_char(c) cmd_mbc_buf[cmd_mbc_buf_index++] = c; if (cmd_mbc_buf_index < cmd_mbc_buf_len) return (CC_OK); - if (!is_utf8_well_formed(cmd_mbc_buf)) + if (!is_utf8_well_formed(cmd_mbc_buf, cmd_mbc_buf_index)) { /* complete, but not well formed (non-shortest form), sequence */ cmd_mbc_buf_len = 0; @@ -1359,6 +1361,18 @@ cmd_lastpattern() #if CMD_HISTORY /* + */ + static int +mlist_size(ml) + struct mlist *ml; +{ + int size = 0; + for (ml = ml->next; ml->string != NULL; ml = ml->next) + ++size; + return size; +} + +/* * Get the name of the history file. */ static char * @@ -1378,6 +1392,10 @@ histfile_name() return (save(name)); } + /* See if history file is disabled in the build. */ + if (strcmp(LESSHISTFILE, "") == 0 || strcmp(LESSHISTFILE, "-") == 0) + return (NULL); + /* Otherwise, file is in $HOME. */ home = lgetenv("HOME"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 4 00:23:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34B3BA60AFA; Mon, 4 Jan 2016 00:23:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF40312C7; Mon, 4 Jan 2016 00:23:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u040NQgS005385; Mon, 4 Jan 2016 00:23:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u040NQl8005384; Mon, 4 Jan 2016 00:23:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601040023.u040NQl8005384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 4 Jan 2016 00:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293126 - vendor/less/v481 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 00:23:28 -0000 Author: delphij Date: Mon Jan 4 00:23:26 2016 New Revision: 293126 URL: https://svnweb.freebsd.org/changeset/base/293126 Log: Tag less v481. Added: vendor/less/v481/ - copied from r293125, vendor/less/dist/ From owner-svn-src-all@freebsd.org Mon Jan 4 01:33:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEFD4A61E38; Mon, 4 Jan 2016 01:33:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCDC51551; Mon, 4 Jan 2016 01:33:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u041X7Rd027570; Mon, 4 Jan 2016 01:33:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u041X7eM027569; Mon, 4 Jan 2016 01:33:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601040133.u041X7eM027569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 4 Jan 2016 01:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293128 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 01:33:09 -0000 Author: jhibbits Date: Mon Jan 4 01:33:07 2016 New Revision: 293128 URL: https://svnweb.freebsd.org/changeset/base/293128 Log: Set the cacheline size before calling powerpc_init() powerpc_init() initializes the mmu. Since this may clear pages via pmap_zero_page(), set the cacheline size before calling into it, so pmap_zero_page() has the right cacheline size. This isn't completely necessary now, but will be when 64-bit book-e is completed. Modified: head/sys/powerpc/booke/booke_machdep.c Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Mon Jan 4 01:16:32 2016 (r293127) +++ head/sys/powerpc/booke/booke_machdep.c Mon Jan 4 01:33:07 2016 (r293128) @@ -316,8 +316,6 @@ booke_init(uint32_t arg1, uint32_t arg2) else /* U-Boot */ mdp = NULL; - ret = powerpc_init(dtbp, 0, 0, mdp); - /* Default to 32 byte cache line size. */ switch ((mfpvr()) >> 16) { case FSL_E500mc: @@ -327,6 +325,8 @@ booke_init(uint32_t arg1, uint32_t arg2) break; } + ret = powerpc_init(dtbp, 0, 0, mdp); + /* Enable caches */ booke_enable_l1_cache(); booke_enable_l2_cache(); From owner-svn-src-all@freebsd.org Mon Jan 4 02:20:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25ADFA60AF7; Mon, 4 Jan 2016 02:20:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E93DC1A87; Mon, 4 Jan 2016 02:20:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u042KFqo042109; Mon, 4 Jan 2016 02:20:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u042KF56042108; Mon, 4 Jan 2016 02:20:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601040220.u042KF56042108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 4 Jan 2016 02:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293129 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 02:20:16 -0000 Author: jhibbits Date: Mon Jan 4 02:20:14 2016 New Revision: 293129 URL: https://svnweb.freebsd.org/changeset/base/293129 Log: Make arguments for booke_init() u_long, to match register width. On powerpc64, pointers are 64 bits, so casting from uint32_t changes the integer width. The alternative was to use register_t, but I didn't see register_t used as argument type for any other functions, though didn't look too closely. u_long was an acceptable alternative. On 64-bit it's 64 bits, on 32-bit it's 32 bits. Modified: head/sys/powerpc/booke/booke_machdep.c Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Mon Jan 4 01:33:07 2016 (r293128) +++ head/sys/powerpc/booke/booke_machdep.c Mon Jan 4 02:20:14 2016 (r293129) @@ -173,7 +173,7 @@ uint32_t *bootinfo; void print_kernel_section_addr(void); void print_kenv(void); -uintptr_t booke_init(uint32_t, uint32_t); +uintptr_t booke_init(u_long, u_long); void ivor_setup(void); extern void *interrupt_vector_base; @@ -268,7 +268,7 @@ booke_check_for_fdt(uint32_t arg1, vm_of } uintptr_t -booke_init(uint32_t arg1, uint32_t arg2) +booke_init(u_long arg1, u_long arg2) { uintptr_t ret; void *mdp; From owner-svn-src-all@freebsd.org Mon Jan 4 03:02:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 884A4A616C1; Mon, 4 Jan 2016 03:02:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C42E1D9A; Mon, 4 Jan 2016 03:02:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0432iip057407; Mon, 4 Jan 2016 03:02:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0432ifw057406; Mon, 4 Jan 2016 03:02:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040302.u0432ifw057406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 03:02:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293130 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:02:45 -0000 Author: ngie Date: Mon Jan 4 03:02:44 2016 New Revision: 293130 URL: https://svnweb.freebsd.org/changeset/base/293130 Log: Rename nitems and string variables to avoid collisions Rename the `nitems` variable to `num_items` to avoid collisions with the macro in sys/param.h for counting elements in an array Similarly, rename `string` to `string_arr` to avoid future collisions with potential keywords, as well as make it clear that `string_arr` isn't a char* value, but instead a char** value. Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libnv/tests/nv_array_tests.cc Modified: head/lib/libnv/tests/nv_array_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 02:20:14 2016 (r293129) +++ head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:02:44 2016 (r293130) @@ -50,7 +50,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__ba const bool *const_result; bool *result; nvlist_t *nvl; - size_t nitems; + size_t num_items; unsigned int i; const char *key; @@ -69,16 +69,16 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__ba ATF_REQUIRE(nvlist_exists_bool_array(nvl, key)); ATF_REQUIRE(nvlist_exists_bool_array(nvl, "nvl/bool")); - const_result = nvlist_get_bool_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, 16); + const_result = nvlist_get_bool_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, 16); ATF_REQUIRE(const_result != NULL); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(const_result[i], testbool[i]); - result = nvlist_take_bool_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, 16); + result = nvlist_take_bool_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, 16); ATF_REQUIRE(const_result != NULL); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(result[i], testbool[i]); ATF_REQUIRE(!nvlist_exists_bool_array(nvl, key)); @@ -95,10 +95,10 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ const char * const *const_result; char **result; nvlist_t *nvl; - size_t nitems; + size_t num_items; unsigned int i; const char *key; - const char *string[8] = { "a", "b", "kot", "foo", + const char *string_arr[8] = { "a", "b", "kot", "foo", "tests", "nice test", "", "abcdef" }; key = "nvl/string"; @@ -107,32 +107,33 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_string_array(nvl, key, string, 8); + nvlist_add_string_array(nvl, key, string_arr, 8); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); ATF_REQUIRE(nvlist_exists_string_array(nvl, "nvl/string")); - const_result = nvlist_get_string_array(nvl, key, &nitems); + const_result = nvlist_get_string_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(nitems == 8); - for (i = 0; i < nitems; i++) { - if (string[i] != NULL) { - ATF_REQUIRE(strcmp(const_result[i], string[i]) == 0); + ATF_REQUIRE(num_items == 8); + for (i = 0; i < num_items; i++) { + if (string_arr[i] != NULL) { + ATF_REQUIRE(strcmp(const_result[i], + string_arr[i]) == 0); } else { - ATF_REQUIRE(const_result[i] == string[i]); + ATF_REQUIRE(const_result[i] == string_arr[i]); } } - result = nvlist_take_string_array(nvl, key, &nitems); + result = nvlist_take_string_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) { - if (string[i] != NULL) { - ATF_REQUIRE_EQ(strcmp(result[i], string[i]), 0); + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { + if (string_arr[i] != NULL) { + ATF_REQUIRE_EQ(strcmp(result[i], string_arr[i]), 0); } else { - ATF_REQUIRE_EQ(result[i], string[i]); + ATF_REQUIRE_EQ(result[i], string_arr[i]); } } @@ -152,7 +153,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr int fd[32], *result; const int *const_result; nvlist_t *nvl; - size_t nitems; + size_t num_items; unsigned int i; const char *key; @@ -173,20 +174,20 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, "nvl/descriptor")); - const_result = nvlist_get_descriptor_array(nvl, key, &nitems); + const_result = nvlist_get_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(nitems == 32); - for (i = 0; i < nitems; i++) { + ATF_REQUIRE(num_items == 32); + for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid(const_result[i])); if (i > 0) ATF_REQUIRE(const_result[i] != const_result[i - 1]); } - result = nvlist_take_descriptor_array(nvl, key, &nitems); + result = nvlist_take_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(nitems, 32); - for (i = 0; i < nitems; i++) { + ATF_REQUIRE_EQ(num_items, 32); + for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid(result[i])); if (i > 0) ATF_REQUIRE(const_result[i] != const_result[i - 1]); @@ -196,7 +197,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); - for (i = 0; i < nitems; i++) { + for (i = 0; i < num_items; i++) { close(result[i]); close(fd[i]); } @@ -210,7 +211,7 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ const uint64_t *const_result; uint64_t *result; nvlist_t *nvl; - size_t nitems; + size_t num_items; unsigned int i; const char *key; const uint64_t number[8] = { 0, UINT_MAX, 7, 123, 90, @@ -228,17 +229,17 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ ATF_REQUIRE(nvlist_exists_number_array(nvl, key)); ATF_REQUIRE(nvlist_exists_number_array(nvl, "nvl/number")); - const_result = nvlist_get_number_array(nvl, key, &nitems); + const_result = nvlist_get_number_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(nitems == 8); - for (i = 0; i < nitems; i++) + ATF_REQUIRE(num_items == 8); + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(const_result[i], number[i]); - result = nvlist_take_number_array(nvl, key, &nitems); + result = nvlist_take_number_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(result[i], number[i]); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); @@ -256,7 +257,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ const nvlist_t * const *const_result; nvlist_t **result; nvlist_t *nvl; - size_t nitems; + size_t num_items; unsigned int i; const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" }; const char *key; @@ -282,14 +283,14 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, key)); ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, "nvl/nvlist")); - const_result = nvlist_get_nvlist_array(nvl, key, &nitems); + const_result = nvlist_get_nvlist_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(nitems == 8); + ATF_REQUIRE(num_items == 8); - for (i = 0; i < nitems; i++) { + for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0); - if (i < nitems - 1) { + if (i < num_items - 1) { ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == const_result[i + 1]); } else { @@ -304,10 +305,10 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ "nvl/string"), somestr[i]) == 0); } - result = nvlist_take_nvlist_array(nvl, key, &nitems); + result = nvlist_take_nvlist_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) { + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(result[i]), 0); ATF_REQUIRE(nvlist_get_array_next(result[i]) == NULL); ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == NULL); @@ -335,8 +336,8 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) const nvlist_t *nvl; bool testbool[16]; int testfd[16]; - size_t i, nitems; - const char *string[8] = { "a", "b", "kot", "foo", + size_t i, num_items; + const char *string_arr[8] = { "a", "b", "kot", "foo", "tests", "nice test", "", "abcdef" }; const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" }; const uint64_t number[8] = { 0, UINT_MAX, 7, 123, 90, @@ -363,7 +364,7 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_exists_bool_array(src, "nvl/bool")); ATF_REQUIRE(!nvlist_exists_string_array(src, "nvl/string")); - nvlist_add_string_array(src, "nvl/string", string, 8); + nvlist_add_string_array(src, "nvl/string", string_arr, 8); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_string_array(src, "nvl/string")); @@ -387,52 +388,52 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(dst != NULL); ATF_REQUIRE(nvlist_exists_bool_array(dst, "nvl/bool")); - (void) nvlist_get_bool_array(dst, "nvl/bool", &nitems); - ATF_REQUIRE_EQ(nitems, 16); - for (i = 0; i < nitems; i++) { + (void) nvlist_get_bool_array(dst, "nvl/bool", &num_items); + ATF_REQUIRE_EQ(num_items, 16); + for (i = 0; i < num_items; i++) { ATF_REQUIRE( - nvlist_get_bool_array(dst, "nvl/bool", &nitems)[i] == - nvlist_get_bool_array(src, "nvl/bool", &nitems)[i]); + nvlist_get_bool_array(dst, "nvl/bool", &num_items)[i] == + nvlist_get_bool_array(src, "nvl/bool", &num_items)[i]); } ATF_REQUIRE(nvlist_exists_string_array(dst, "nvl/string")); - (void) nvlist_get_string_array(dst, "nvl/string", &nitems); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) { + (void) nvlist_get_string_array(dst, "nvl/string", &num_items); + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { if (nvlist_get_string_array(dst, "nvl/string", - &nitems)[i] == NULL) { + &num_items)[i] == NULL) { ATF_REQUIRE(nvlist_get_string_array(dst, "nvl/string", - &nitems)[i] == nvlist_get_string_array(src, - "nvl/string", &nitems)[i]); + &num_items)[i] == nvlist_get_string_array(src, + "nvl/string", &num_items)[i]); } else { ATF_REQUIRE(strcmp(nvlist_get_string_array(dst, - "nvl/string", &nitems)[i], nvlist_get_string_array( - src, "nvl/string", &nitems)[i]) == 0); + "nvl/string", &num_items)[i], nvlist_get_string_array( + src, "nvl/string", &num_items)[i]) == 0); } } ATF_REQUIRE(nvlist_exists_descriptor_array(dst, "nvl/fd")); - (void) nvlist_get_descriptor_array(dst, "nvl/fd", &nitems); - ATF_REQUIRE_EQ(nitems, 16); - for (i = 0; i < nitems; i++) { + (void) nvlist_get_descriptor_array(dst, "nvl/fd", &num_items); + ATF_REQUIRE_EQ(num_items, 16); + for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid( - nvlist_get_descriptor_array(dst, "nvl/fd", &nitems)[i])); + nvlist_get_descriptor_array(dst, "nvl/fd", &num_items)[i])); } ATF_REQUIRE(nvlist_exists_number_array(dst, "nvl/number")); - (void) nvlist_get_number_array(dst, "nvl/number", &nitems); - ATF_REQUIRE_EQ(nitems, 8); + (void) nvlist_get_number_array(dst, "nvl/number", &num_items); + ATF_REQUIRE_EQ(num_items, 8); - for (i = 0; i < nitems; i++) { + for (i = 0; i < num_items; i++) { ATF_REQUIRE( - nvlist_get_number_array(dst, "nvl/number", &nitems)[i] == - nvlist_get_number_array(src, "nvl/number", &nitems)[i]); + nvlist_get_number_array(dst, "nvl/number", &num_items)[i] == + nvlist_get_number_array(src, "nvl/number", &num_items)[i]); } ATF_REQUIRE(nvlist_exists_nvlist_array(dst, "nvl/array")); - (void) nvlist_get_nvlist_array(dst, "nvl/array", &nitems); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) { - nvl = nvlist_get_nvlist_array(dst, "nvl/array", &nitems)[i]; + (void) nvlist_get_nvlist_array(dst, "nvl/array", &num_items); + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { + nvl = nvlist_get_nvlist_array(dst, "nvl/array", &num_items)[i]; ATF_REQUIRE(nvlist_exists_string(nvl, "nvl/nvl/teststr")); ATF_REQUIRE(strcmp(nvlist_get_string(nvl, "nvl/nvl/teststr"), somestr[i]) == 0); @@ -454,7 +455,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__mo bool *testbool; const bool *const_result; nvlist_t *nvl; - size_t nitems, count; + size_t num_items, count; unsigned int i; const char *key; @@ -475,11 +476,11 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__mo ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_bool_array(nvl, key)); - const_result = nvlist_get_bool_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, count); + const_result = nvlist_get_bool_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, count); ATF_REQUIRE(const_result != NULL); ATF_REQUIRE(const_result == testbool); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(const_result[i], (i % 2 == 0)); nvlist_destroy(nvl); @@ -491,7 +492,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ char **teststr; const char * const *const_result; nvlist_t *nvl; - size_t nitems, count; + size_t num_items, count; unsigned int i; const char *key; @@ -516,11 +517,11 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); - const_result = nvlist_get_string_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, count); + const_result = nvlist_get_string_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, count); ATF_REQUIRE(const_result != NULL); ATF_REQUIRE((intptr_t)const_result == (intptr_t)teststr); - for (i = 0; i < nitems; i++) { + for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(const_result[i][0], (char)('a' + i)); ATF_REQUIRE_EQ(const_result[i][1], '\0'); } @@ -534,7 +535,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ nvlist **testnv; const nvlist * const *const_result; nvlist_t *nvl; - size_t nitems, count; + size_t num_items, count; unsigned int i; const char *key; @@ -557,14 +558,14 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, key)); - const_result = nvlist_get_nvlist_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, count); + const_result = nvlist_get_nvlist_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, count); ATF_REQUIRE(const_result != NULL); ATF_REQUIRE((intptr_t)const_result == (intptr_t)testnv); - for (i = 0; i < nitems; i++) { + for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0); ATF_REQUIRE(nvlist_empty(const_result[i])); - if (i < nitems - 1) { + if (i < num_items - 1) { ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == const_result[i + 1]); } else { @@ -584,7 +585,7 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ uint64_t *testnumber; const uint64_t *const_result; nvlist_t *nvl; - size_t nitems, count; + size_t num_items, count; unsigned int i; const char *key; @@ -605,11 +606,11 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_number_array(nvl, key)); - const_result = nvlist_get_number_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, count); + const_result = nvlist_get_number_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, count); ATF_REQUIRE(const_result != NULL); ATF_REQUIRE(const_result == testnumber); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(const_result[i], i); nvlist_destroy(nvl); @@ -621,7 +622,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr int *testfd; const int *const_result; nvlist_t *nvl; - size_t nitems, count; + size_t num_items, count; unsigned int i; const char *key; @@ -644,11 +645,11 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); - const_result = nvlist_get_descriptor_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, count); + const_result = nvlist_get_descriptor_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, count); ATF_REQUIRE(const_result != NULL); ATF_REQUIRE(const_result == testfd); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) ATF_REQUIRE(fd_is_valid(const_result[i])); nvlist_destroy(nvl); @@ -988,7 +989,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr { nvlist_t *nvl; const char *key; - size_t nitems; + size_t num_items; unsigned int i; const int *const_result; int desc[32], fd, socks[2]; @@ -1021,7 +1022,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(nvlist_send(fd, nvl) >= 0); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) close(desc[i]); } else { /* Parent */ @@ -1034,10 +1035,10 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); - const_result = nvlist_get_descriptor_array(nvl, key, &nitems); + const_result = nvlist_get_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE_EQ(nitems, 32); - for (i = 0; i < nitems; i++) + ATF_REQUIRE_EQ(num_items, 32); + for (i = 0; i < num_items; i++) ATF_REQUIRE(fd_is_valid(const_result[i])); atf::utils::wait(pid, 0, "", ""); @@ -1096,7 +1097,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ const nvlist_t * const *const_result; nvlist_t **result; nvlist_t *nvl; - size_t nitems, packed_size; + size_t num_items, packed_size; unsigned int i; void *packed; const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" }; @@ -1130,12 +1131,12 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ ATF_REQUIRE_EQ(nvlist_error(unpacked), 0); ATF_REQUIRE(nvlist_exists_nvlist_array(unpacked, key)); - const_result = nvlist_get_nvlist_array(unpacked, key, &nitems); + const_result = nvlist_get_nvlist_array(unpacked, key, &num_items); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) { + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0); - if (i < nitems - 1) { + if (i < num_items - 1) { ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == const_result[i + 1]); } else { From owner-svn-src-all@freebsd.org Mon Jan 4 03:06:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55BC3A61762 for ; Mon, 4 Jan 2016 03:06:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 192431F32 for ; Mon, 4 Jan 2016 03:06:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x231.google.com with SMTP id 6so168119528qgy.1 for ; Sun, 03 Jan 2016 19:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=EPnTteQ+ExW22v9qgagVCGvQG+qaWDWKKXMKs4MZDQo=; b=sMwu0BsAGBiOk0nzUf76pjXjIzlM+PbmiRSAbBhDtG1wbTytfTyQkyZxCf4rsHKD/D d8DIYKBeTAgfQPScRqiB/cXUZ+wLqCmrvAtlMLh+08p3mF4gGmc+zHUGoMovseuNF1YC YDz5kDKJpnG96sA0qKZ4M8DNsxQbluVheicybrlmII7nxNX8mxJJ2Lxtdz97Pz+9NDbO HUWLN7w2fjx7L6j5C4Ulbvl/df0MIBhKdZbJBHx4HQoDuAYDy7KMOR5bDbjhuXBehwu7 qQiLlWIXvh6cOJ5xG0VdyNm32+/wfFNbMSIh5HTOGmsV0sLiMwWhtZGGptVn7ng5UIsr Dv0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=EPnTteQ+ExW22v9qgagVCGvQG+qaWDWKKXMKs4MZDQo=; b=Cp+MX0VDWolXTaD0766bl8cWEkjOZsPa/SYAbR7NTZ4IqSUdbd6H5OjEMOaSfhVptn /KrXHFtc/CK0hnJY0RaPU8nX3gv7XDz7FBayXwtfJrmr0zNC2MngfrnJBQ/keLzaju31 0vowA0a7Ub03duiZtz0JeAJdm+KjTPYGiGMNFxah+351+12LNx5796ddhGz4//FaLwT3 plEJI/LSkNlllANxJqvS9BiiaJNKnDV54nblzH9MvxVCQUwJVrB7DyQb7BfSEerPgaoq N0BKhBQKjtJotAMPen7/fDtn3AAH2OkY+pAnQRMrPssfMGhsc86LGTgYqm/VAadJFK9F S6Lw== X-Gm-Message-State: ALoCoQm0fRVPueZlduuKyOI2sswI9pRBAr55l8HaZRB0wOlvcrfRdv5sOTl3kgmM9gSnBdYj36BLnrsdfjBgaYHXlo71x7K76A== MIME-Version: 1.0 X-Received: by 10.140.93.77 with SMTP id c71mr77721866qge.46.1451876759928; Sun, 03 Jan 2016 19:05:59 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Sun, 3 Jan 2016 19:05:59 -0800 (PST) X-Originating-IP: [2607:fb90:190f:beae:0:4b:58f4:e301] Received: by 10.140.27.181 with HTTP; Sun, 3 Jan 2016 19:05:59 -0800 (PST) In-Reply-To: References: <201601030432.u034W6en043633@repo.freebsd.org> Date: Sun, 3 Jan 2016 20:05:59 -0700 X-Google-Sender-Auth: wvGz0yuNfV4IbOZb8fpGRzOuyic Message-ID: Subject: Re: svn commit: r293068 - in head/etc: . mtree From: Warner Losh To: Dimitry Andric Cc: src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Warner Losh Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:06:01 -0000 Perhaps. Do you have any advice? Warner On Jan 3, 2016 10:40 AM, "Dimitry Andric" wrote: > On 03 Jan 2016, at 05:32, Warner Losh wrote: > > > > Author: imp > > Date: Sun Jan 3 04:32:05 2016 > > New Revision: 293068 > > URL: https://svnweb.freebsd.org/changeset/base/293068 > > > > Log: > > Add libsoft to the tree, just like lib32. > > Hmm, are there going to be more of these "multilib" things? :) > > -Dimitry > > From owner-svn-src-all@freebsd.org Mon Jan 4 03:12:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB616A619A7; Mon, 4 Jan 2016 03:12:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC3FB1346; Mon, 4 Jan 2016 03:12:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u043CInQ004511; Mon, 4 Jan 2016 03:12:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u043CIW9004510; Mon, 4 Jan 2016 03:12:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040312.u043CIW9004510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 03:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293131 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:12:20 -0000 Author: ngie Date: Mon Jan 4 03:12:18 2016 New Revision: 293131 URL: https://svnweb.freebsd.org/changeset/base/293131 Log: Convert another `string` variable to `string_arr` missed in r293130 Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libnv/tests/nv_array_tests.cc Modified: head/lib/libnv/tests/nv_array_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:02:44 2016 (r293130) +++ head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:12:18 2016 (r293131) @@ -1057,7 +1057,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ void *packed; unsigned int i; const char * const *const_result; - const char *string[8] = { "a", "b", "kot", "foo", + const char *string_arr[8] = { "a", "b", "kot", "foo", "tests", "nice test", "", "abcdef" }; key = "nvl/string"; @@ -1066,7 +1066,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_string_array(nvl, key, string, 8); + nvlist_add_string_array(nvl, key, string_arr, 8); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); @@ -1082,7 +1082,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ const_result = nvlist_get_string_array(unpacked, key, &count); ATF_REQUIRE_EQ(count, 8); for (i = 0; i < count; i++) { - ATF_REQUIRE_EQ(strcmp(string[i], const_result[i]), 0); + ATF_REQUIRE_EQ(strcmp(string_arr[i], const_result[i]), 0); } nvlist_destroy(nvl); From owner-svn-src-all@freebsd.org Mon Jan 4 03:20:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B26FA61B16; Mon, 4 Jan 2016 03:20:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3433C181C; Mon, 4 Jan 2016 03:20:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u043KgSv004892; Mon, 4 Jan 2016 03:20:42 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u043Kglj004888; Mon, 4 Jan 2016 03:20:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601040320.u043Kglj004888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 4 Jan 2016 03:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293132 - in stable/10/usr.sbin/cron: cron crontab X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:20:43 -0000 Author: pfg Date: Mon Jan 4 03:20:41 2016 New Revision: 293132 URL: https://svnweb.freebsd.org/changeset/base/293132 Log: MFC r292605, r292606, r292607, r292608: cron: bring some fixes for Coverity reports and other issues. crontab: replace malloc + bzero with calloc crontab: properly free an entry cron: Check the return value of pipe(2) CID: 271773, 1009830, Modified: stable/10/usr.sbin/cron/cron/do_command.c stable/10/usr.sbin/cron/cron/popen.c stable/10/usr.sbin/cron/crontab/crontab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/cron/cron/do_command.c ============================================================================== --- stable/10/usr.sbin/cron/cron/do_command.c Mon Jan 4 03:12:18 2016 (r293131) +++ stable/10/usr.sbin/cron/cron/do_command.c Mon Jan 4 03:20:41 2016 (r293132) @@ -161,8 +161,10 @@ child_process(e, u) /* create some pipes to talk to our future child */ - pipe(stdin_pipe); /* child's stdin */ - pipe(stdout_pipe); /* child's stdout */ + if (pipe(stdin_pipe) != 0 || pipe(stdout_pipe) != 0) { + log_it("CRON", getpid(), "error", "can't pipe"); + exit(ERROR_EXIT); + } /* since we are a forked process, we can diddle the command string * we were passed -- nobody else is going to use it again, right? Modified: stable/10/usr.sbin/cron/cron/popen.c ============================================================================== --- stable/10/usr.sbin/cron/cron/popen.c Mon Jan 4 03:12:18 2016 (r293131) +++ stable/10/usr.sbin/cron/cron/popen.c Mon Jan 4 03:20:41 2016 (r293132) @@ -82,9 +82,8 @@ cron_popen(program, type, e) if (!pids) { if ((fds = getdtablesize()) <= 0) return(NULL); - if (!(pids = (PID_T *)malloc((u_int)(fds * sizeof(PID_T))))) + if (!(pids = calloc(fds, sizeof(PID_T)))) return(NULL); - bzero((char *)pids, fds * sizeof(PID_T)); } if (pipe(pdes) < 0) return(NULL); Modified: stable/10/usr.sbin/cron/crontab/crontab.c ============================================================================== --- stable/10/usr.sbin/cron/crontab/crontab.c Mon Jan 4 03:12:18 2016 (r293131) +++ stable/10/usr.sbin/cron/crontab/crontab.c Mon Jan 4 03:20:41 2016 (r293132) @@ -558,7 +558,7 @@ replace_cmd() { case FALSE: e = load_entry(tmp, check_error, pw, envp); if (e) - free(e); + free_entry(e); break; case TRUE: break; From owner-svn-src-all@freebsd.org Mon Jan 4 03:22:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 989F9A61C84; Mon, 4 Jan 2016 03:22:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19A2C1BF6; Mon, 4 Jan 2016 03:22:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u043M7Rv007544; Mon, 4 Jan 2016 03:22:07 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u043M7B5007541; Mon, 4 Jan 2016 03:22:07 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601040322.u043M7B5007541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 4 Jan 2016 03:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r293133 - in stable/9/usr.sbin/cron: cron crontab X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:22:08 -0000 Author: pfg Date: Mon Jan 4 03:22:06 2016 New Revision: 293133 URL: https://svnweb.freebsd.org/changeset/base/293133 Log: MFC r292605, r292606, r292607, r292608: cron: bring some fixes for Coverity reports and other issues. crontab: replace malloc + bzero with calloc crontab: properly free an entry cron: Check the return value of pipe(2) CID: 271773, 1009830, Modified: stable/9/usr.sbin/cron/cron/do_command.c stable/9/usr.sbin/cron/cron/popen.c stable/9/usr.sbin/cron/crontab/crontab.c Directory Properties: stable/9/usr.sbin/cron/ (props changed) stable/9/usr.sbin/cron/crontab/ (props changed) Modified: stable/9/usr.sbin/cron/cron/do_command.c ============================================================================== --- stable/9/usr.sbin/cron/cron/do_command.c Mon Jan 4 03:20:41 2016 (r293132) +++ stable/9/usr.sbin/cron/cron/do_command.c Mon Jan 4 03:22:06 2016 (r293133) @@ -161,8 +161,10 @@ child_process(e, u) /* create some pipes to talk to our future child */ - pipe(stdin_pipe); /* child's stdin */ - pipe(stdout_pipe); /* child's stdout */ + if (pipe(stdin_pipe) != 0 || pipe(stdout_pipe) != 0) { + log_it("CRON", getpid(), "error", "can't pipe"); + exit(ERROR_EXIT); + } /* since we are a forked process, we can diddle the command string * we were passed -- nobody else is going to use it again, right? Modified: stable/9/usr.sbin/cron/cron/popen.c ============================================================================== --- stable/9/usr.sbin/cron/cron/popen.c Mon Jan 4 03:20:41 2016 (r293132) +++ stable/9/usr.sbin/cron/cron/popen.c Mon Jan 4 03:22:06 2016 (r293133) @@ -82,9 +82,8 @@ cron_popen(program, type, e) if (!pids) { if ((fds = getdtablesize()) <= 0) return(NULL); - if (!(pids = (PID_T *)malloc((u_int)(fds * sizeof(PID_T))))) + if (!(pids = calloc(fds, sizeof(PID_T)))) return(NULL); - bzero((char *)pids, fds * sizeof(PID_T)); } if (pipe(pdes) < 0) return(NULL); Modified: stable/9/usr.sbin/cron/crontab/crontab.c ============================================================================== --- stable/9/usr.sbin/cron/crontab/crontab.c Mon Jan 4 03:20:41 2016 (r293132) +++ stable/9/usr.sbin/cron/crontab/crontab.c Mon Jan 4 03:22:06 2016 (r293133) @@ -558,7 +558,7 @@ replace_cmd() { case FALSE: e = load_entry(tmp, check_error, pw, envp); if (e) - free(e); + free_entry(e); break; case TRUE: break; From owner-svn-src-all@freebsd.org Mon Jan 4 03:26:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFCA4A61D78; Mon, 4 Jan 2016 03:26:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB3E41E04; Mon, 4 Jan 2016 03:26:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u043Qae5007718; Mon, 4 Jan 2016 03:26:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u043Qa46007717; Mon, 4 Jan 2016 03:26:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040326.u043Qa46007717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 03:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293134 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:26:38 -0000 Author: ngie Date: Mon Jan 4 03:26:36 2016 New Revision: 293134 URL: https://svnweb.freebsd.org/changeset/base/293134 Log: Use `nitems(x)` macro instead of using hardcoded numbers for indices into the nvlists Convert some of the variables from int to unsigned int to squelch -Wsign-compare warnings when converting hardcoded values to nitems(..) Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libnv/tests/nv_array_tests.cc Modified: head/lib/libnv/tests/nv_array_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:22:06 2016 (r293133) +++ head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:26:36 2016 (r293134) @@ -27,8 +27,9 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include +#include #include #include @@ -107,7 +108,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_string_array(nvl, key, string_arr, 8); + nvlist_add_string_array(nvl, key, string_arr, nitems(string_arr)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); @@ -116,7 +117,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ const_result = nvlist_get_string_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(num_items == 8); + ATF_REQUIRE(num_items == nitems(string_arr)); for (i = 0; i < num_items; i++) { if (string_arr[i] != NULL) { ATF_REQUIRE(strcmp(const_result[i], @@ -128,7 +129,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ result = nvlist_take_string_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(string_arr)); for (i = 0; i < num_items; i++) { if (string_arr[i] != NULL) { ATF_REQUIRE_EQ(strcmp(result[i], string_arr[i]), 0); @@ -141,7 +142,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); - for (i = 0; i < 8; i++) + for (i = 0; i < num_items; i++) free(result[i]); free(result); nvlist_destroy(nvl); @@ -157,7 +158,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr unsigned int i; const char *key; - for (i = 0; i < 32; i++) { + for (i = 0; i < nitems(fd); i++) { fd[i] = dup(STDERR_FILENO); ATF_REQUIRE(fd_is_valid(fd[i])); } @@ -168,7 +169,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_descriptor_array(nvl, key)); - nvlist_add_descriptor_array(nvl, key, fd, 32); + nvlist_add_descriptor_array(nvl, key, fd, nitems(fd)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); @@ -177,7 +178,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr const_result = nvlist_get_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(num_items == 32); + ATF_REQUIRE(num_items == nitems(fd)); for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid(const_result[i])); if (i > 0) @@ -186,7 +187,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr result = nvlist_take_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(num_items, 32); + ATF_REQUIRE_EQ(num_items, nitems(fd)); for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid(result[i])); if (i > 0) @@ -223,7 +224,7 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_number_array(nvl, key, number, 8); + nvlist_add_number_array(nvl, key, number, nitems(number)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_number_array(nvl, key)); @@ -232,13 +233,13 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ const_result = nvlist_get_number_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(num_items == 8); + ATF_REQUIRE(num_items == nitems(number)); for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(const_result[i], number[i]); result = nvlist_take_number_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(number)); for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(result[i], number[i]); @@ -286,7 +287,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ const_result = nvlist_get_nvlist_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(num_items == 8); + ATF_REQUIRE(num_items == nitems(testnvl)); for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0); @@ -343,12 +344,12 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) const uint64_t number[8] = { 0, UINT_MAX, 7, 123, 90, 100000, 8, 1 }; - for (i = 0; i < 16; i++) { + for (i = 0; i < nitems(testfd); i++) { testbool[i] = (i % 2 == 0); testfd[i] = dup(STDERR_FILENO); ATF_REQUIRE(fd_is_valid(testfd[i])); } - for (i = 0; i < 8; i++) { + for (i = 0; i < nitems(testnvl); i++) { testnvl[i] = nvlist_create(0); ATF_REQUIRE(nvlist_error(testnvl[i]) == 0); nvlist_add_string(testnvl[i], "nvl/nvl/teststr", somestr[i]); @@ -359,28 +360,30 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_error(src) == 0); ATF_REQUIRE(!nvlist_exists_bool_array(src, "nvl/bool")); - nvlist_add_bool_array(src, "nvl/bool", testbool, 16); + nvlist_add_bool_array(src, "nvl/bool", testbool, nitems(testbool)); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_bool_array(src, "nvl/bool")); ATF_REQUIRE(!nvlist_exists_string_array(src, "nvl/string")); - nvlist_add_string_array(src, "nvl/string", string_arr, 8); + nvlist_add_string_array(src, "nvl/string", string_arr, + nitems(string_arr)); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_string_array(src, "nvl/string")); ATF_REQUIRE(!nvlist_exists_descriptor_array(src, "nvl/fd")); - nvlist_add_descriptor_array(src, "nvl/fd", testfd, 16); + nvlist_add_descriptor_array(src, "nvl/fd", testfd, nitems(testfd)); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_descriptor_array(src, "nvl/fd")); ATF_REQUIRE(!nvlist_exists_number_array(src, "nvl/number")); - nvlist_add_number_array(src, "nvl/number", number, 8); + nvlist_add_number_array(src, "nvl/number", number, + nitems(number)); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_number_array(src, "nvl/number")); ATF_REQUIRE(!nvlist_exists_nvlist_array(src, "nvl/array")); nvlist_add_nvlist_array(src, "nvl/array", - (const nvlist_t * const *)testnvl, 8); + (const nvlist_t * const *)testnvl, nitems(testnvl)); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_nvlist_array(src, "nvl/array")); @@ -389,7 +392,7 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_exists_bool_array(dst, "nvl/bool")); (void) nvlist_get_bool_array(dst, "nvl/bool", &num_items); - ATF_REQUIRE_EQ(num_items, 16); + ATF_REQUIRE_EQ(num_items, nitems(testbool)); for (i = 0; i < num_items; i++) { ATF_REQUIRE( nvlist_get_bool_array(dst, "nvl/bool", &num_items)[i] == @@ -398,7 +401,7 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_exists_string_array(dst, "nvl/string")); (void) nvlist_get_string_array(dst, "nvl/string", &num_items); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(string_arr)); for (i = 0; i < num_items; i++) { if (nvlist_get_string_array(dst, "nvl/string", &num_items)[i] == NULL) { @@ -414,14 +417,14 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_exists_descriptor_array(dst, "nvl/fd")); (void) nvlist_get_descriptor_array(dst, "nvl/fd", &num_items); - ATF_REQUIRE_EQ(num_items, 16); + ATF_REQUIRE_EQ(num_items, nitems(testfd)); for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid( nvlist_get_descriptor_array(dst, "nvl/fd", &num_items)[i])); } ATF_REQUIRE(nvlist_exists_number_array(dst, "nvl/number")); (void) nvlist_get_number_array(dst, "nvl/number", &num_items); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(number)); for (i = 0; i < num_items; i++) { ATF_REQUIRE( @@ -431,7 +434,7 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_exists_nvlist_array(dst, "nvl/array")); (void) nvlist_get_nvlist_array(dst, "nvl/array", &num_items); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(testnvl)); for (i = 0; i < num_items; i++) { nvl = nvlist_get_nvlist_array(dst, "nvl/array", &num_items)[i]; ATF_REQUIRE(nvlist_exists_string(nvl, "nvl/nvl/teststr")); @@ -439,11 +442,11 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) somestr[i]) == 0); } - for (i = 0; i < 16; i++) { + for (i = 0; i < nitems(testfd); i++) { close(testfd[i]); - if (i < 8) { - nvlist_destroy(testnvl[i]); - } + } + for (i = 0; i < nitems(testnvl); i++) { + nvlist_destroy(testnvl[i]); } nvlist_destroy(src); nvlist_destroy(dst); @@ -765,11 +768,12 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ { nvlist_t *nvl, *test[5], *nasted; const nvlist_t *travel; - void *cookie; - int index, i, type; const char *name; + void *cookie; + int type; + unsigned int i, index; - for (i = 0; i < 5; i++) { + for (i = 0; i < nitems(test); i++) { test[i] = nvlist_create(0); ATF_REQUIRE(test[i] != NULL); nvlist_add_number(test[i], "nvl/number", i); @@ -777,11 +781,12 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ } nvl = nvlist_create(0); ATF_REQUIRE(nvl != NULL); - nvlist_add_nvlist_array(nvl, "nvl/nvlist_array", test, 5); + nvlist_add_nvlist_array(nvl, "nvl/nvlist_array", test, nitems(test)); ATF_REQUIRE(nvlist_error(nvl) == 0); nasted = nvlist_create(0); ATF_REQUIRE(nasted != NULL); - nvlist_add_nvlist_array(nasted, "nvl/nvl/nvlist_array", test, 5); + nvlist_add_nvlist_array(nasted, "nvl/nvl/nvlist_array", test, + nitems(test)); ATF_REQUIRE(nvlist_error(nasted) == 0); nvlist_move_nvlist(nvl, "nvl/nvl", nasted); ATF_REQUIRE(nvlist_error(nvl) == 0); @@ -795,15 +800,16 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ while ((name = nvlist_next(travel, &type, &cookie)) != NULL) { if (index == 0) { ATF_REQUIRE(type == NV_TYPE_NVLIST_ARRAY); - } else if (index >= 1 && index <= 5) { + } else if (index >= 1 && index <= nitems(test)) { ATF_REQUIRE(type == NV_TYPE_NUMBER); - } else if (index == 6) { + } else if (index == nitems(test) + 1) { ATF_REQUIRE(type == NV_TYPE_NVLIST); - } else if (index == 7) { + } else if (index == nitems(test) + 2) { ATF_REQUIRE(type == NV_TYPE_NVLIST_ARRAY); - } else if (index >= 8 && index <= 12) { + } else if (index >= nitems(test) + 3 && + index <= 2 * nitems(test) + 2) { ATF_REQUIRE(type == NV_TYPE_NUMBER); - } else if (index == 13) { + } else if (index == 2 * nitems(test) + 3) { ATF_REQUIRE(type == NV_TYPE_STRING); } @@ -819,7 +825,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ } } while ((travel = nvlist_get_pararr(travel, &cookie)) != NULL); - for (i = 0; i < 5; i++) + for (i = 0; i < nitems(test); i++) nvlist_destroy(test[i]); nvlist_destroy(nvl); @@ -909,7 +915,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__pa const bool *const_result; bool testbool[16]; - for (i = 0; i < 16; i++) + for (i = 0; i < nitems(testbool); i++) testbool[i] = (i % 2 == 0); key = "nvl/bool"; @@ -918,7 +924,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__pa ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_bool_array(nvl, key, testbool, 16); + nvlist_add_bool_array(nvl, key, testbool, nitems(testbool)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_bool_array(nvl, key)); @@ -932,7 +938,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__pa ATF_REQUIRE(nvlist_exists_bool_array(unpacked, key)); const_result = nvlist_get_bool_array(unpacked, key, &count); - ATF_REQUIRE_EQ(count, 16); + ATF_REQUIRE_EQ(count, nitems(testbool)); for (i = 0; i < count; i++) { ATF_REQUIRE_EQ(testbool[i], const_result[i]); } @@ -974,7 +980,7 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ ATF_REQUIRE(nvlist_exists_number_array(unpacked, key)); const_result = nvlist_get_number_array(unpacked, key, &count); - ATF_REQUIRE_EQ(count, 8); + ATF_REQUIRE_EQ(count, nitems(number)); for (i = 0; i < count; i++) { ATF_REQUIRE_EQ(number[i], const_result[i]); } @@ -1005,7 +1011,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr /* Child. */ fd = socks[0]; close(socks[1]); - for (i = 0; i < 32; i++) { + for (i = 0; i < nitems(desc); i++) { desc[i] = dup(STDERR_FILENO); ATF_REQUIRE(fd_is_valid(desc[i])); } @@ -1015,14 +1021,14 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_descriptor_array(nvl, key)); - nvlist_add_descriptor_array(nvl, key, desc, 32); + nvlist_add_descriptor_array(nvl, key, desc, nitems(desc)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); ATF_REQUIRE(nvlist_send(fd, nvl) >= 0); - for (i = 0; i < num_items; i++) + for (i = 0; i < nitems(desc); i++) close(desc[i]); } else { /* Parent */ @@ -1037,7 +1043,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr const_result = nvlist_get_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE_EQ(num_items, 32); + ATF_REQUIRE_EQ(num_items, nitems(desc)); for (i = 0; i < num_items; i++) ATF_REQUIRE(fd_is_valid(const_result[i])); @@ -1066,7 +1072,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_string_array(nvl, key, string_arr, 8); + nvlist_add_string_array(nvl, key, string_arr, nitems(string_arr)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); @@ -1080,7 +1086,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_exists_string_array(unpacked, key)); const_result = nvlist_get_string_array(unpacked, key, &count); - ATF_REQUIRE_EQ(count, 8); + ATF_REQUIRE_EQ(count, nitems(string_arr)); for (i = 0; i < count; i++) { ATF_REQUIRE_EQ(strcmp(string_arr[i], const_result[i]), 0); } @@ -1103,7 +1109,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" }; const char *key; - for (i = 0; i < 8; i++) { + for (i = 0; i < nitems(testnvl); i++) { testnvl[i] = nvlist_create(0); ATF_REQUIRE(testnvl[i] != NULL); ATF_REQUIRE_EQ(nvlist_error(testnvl[i]), 0); @@ -1133,7 +1139,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ const_result = nvlist_get_nvlist_array(unpacked, key, &num_items); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(testnvl)); for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0); if (i < num_items - 1) { @@ -1151,7 +1157,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ "nvl/string"), somestr[i]) == 0); } - for (i = 0; i < 8; i++) + for (i = 0; i < nitems(testnvl); i++) nvlist_destroy(testnvl[i]); free(result); nvlist_destroy(nvl); From owner-svn-src-all@freebsd.org Mon Jan 4 03:32:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D77B1A61F21; Mon, 4 Jan 2016 03:32:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9EA1122F; Mon, 4 Jan 2016 03:32:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id 65so149986246pff.3; Sun, 03 Jan 2016 19:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=QjaW5m4AQBreCUxzvRZwG8JHn5S4Evf/25Jq0rFnRK0=; b=CHXAifx2/EpSvcf9l6efZbtOdWHaR4ZVfT7J6g+Wh+TCEGxHqzjkGME6K3Yzoh6V7r KFAGzikMbpR61GxT0FummpwCg9tt4x/q6Dkkknz1t/q21KCoUY/ZTvaWW243mOW782Mz 7fUCR5IV8Mt12idsArUI+sHEvAiEq2ISwChcNewHA55MMABpEu7SleGohP2DRTRm+TJJ IC/Wh5EdAuHDYKi6r/8oL/7qoMM0jq/uC6kkjh57pNP6yaJ68dnBWUUspjdgdS2i1cu/ 1Vb3bfL1HzhnoMgYqUiJOF7ioD1mSIo1kxn1NspFcj5QnoKcXnwVXqQkmIG/0JbUZ4u8 iUkQ== X-Received: by 10.98.17.3 with SMTP id z3mr105927929pfi.166.1451878334344; Sun, 03 Jan 2016 19:32:14 -0800 (PST) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id fi16sm48690748pac.12.2016.01.03.19.32.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jan 2016 19:32:13 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293134 - head/lib/libnv/tests From: NGie Cooper In-Reply-To: <201601040326.u043Qa46007717@repo.freebsd.org> Date: Sun, 3 Jan 2016 19:32:11 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4C70AA03-F9C7-44A7-B9DE-5A6ABF108FC9@gmail.com> References: <201601040326.u043Qa46007717@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:32:14 -0000 > On Jan 3, 2016, at 19:26, Garrett Cooper wrote: >=20 > Author: ngie > Date: Mon Jan 4 03:26:36 2016 > New Revision: 293134 > URL: https://svnweb.freebsd.org/changeset/base/293134 >=20 > Log: > Use `nitems(x)` macro instead of using hardcoded numbers for indices = into > the nvlists >=20 > Convert some of the variables from int to unsigned int to squelch = -Wsign-compare > warnings when converting hardcoded values to nitems(..) >=20 > Differential Revision: https://reviews.freebsd.org/D4769 (part of = larger diff) > MFC after: 5 days > Reviewed by: oshogbo > Sponsored by: EMC / Isilon Storage Division ... > - for (i =3D 0; i < num_items; i++) > + for (i =3D 0; i < nitems(desc); i++) This portion of the change also fixed an out-of-bounds memory access on = stable/10 that oshogbo spent some time poring over why this testcase (in = particular) kept on crashing as num_items was never properly initialized = in this code path. Reported by: cppcheck Thanks! -NGie= From owner-svn-src-all@freebsd.org Mon Jan 4 03:34:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D80FFA60009; Mon, 4 Jan 2016 03:34:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB44715D7; Mon, 4 Jan 2016 03:34:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u043YMKg010675; Mon, 4 Jan 2016 03:34:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u043YM2p010674; Mon, 4 Jan 2016 03:34:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040334.u043YM2p010674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 03:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293135 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:34:23 -0000 Author: ngie Date: Mon Jan 4 03:34:22 2016 New Revision: 293135 URL: https://svnweb.freebsd.org/changeset/base/293135 Log: Remove free'ing of an uninitialized variable Just remove it completely from the test as it's initialized but unused apart from the free(3) call Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reported by: cppcheck Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libnv/tests/nv_array_tests.cc Modified: head/lib/libnv/tests/nv_array_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:26:36 2016 (r293134) +++ head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:34:22 2016 (r293135) @@ -1101,7 +1101,6 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ { nvlist_t *testnvl[8], *unpacked; const nvlist_t * const *const_result; - nvlist_t **result; nvlist_t *nvl; size_t num_items, packed_size; unsigned int i; @@ -1159,7 +1158,6 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ for (i = 0; i < nitems(testnvl); i++) nvlist_destroy(testnvl[i]); - free(result); nvlist_destroy(nvl); nvlist_destroy(unpacked); free(packed); From owner-svn-src-all@freebsd.org Mon Jan 4 06:57:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F27E0A5F862; Mon, 4 Jan 2016 06:57:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFDBE1132; Mon, 4 Jan 2016 06:57:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u046v6T9079357; Mon, 4 Jan 2016 06:57:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u046v6sQ079356; Mon, 4 Jan 2016 06:57:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040657.u046v6sQ079356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 06:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293138 - stable/10/tools/regression/mac/mac_bsdextended X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 06:57:08 -0000 Author: ngie Date: Mon Jan 4 06:57:06 2016 New Revision: 293138 URL: https://svnweb.freebsd.org/changeset/base/293138 Log: MFC r292531,r292532,r292533,r292545: r292531: Make test_matches.sh into a series of TAP testcases Use temporary filesystems / memory disks instead of a hardcoded path which doesn't exist on test systems r292532: Mark `subject matching jailid` testcase as an unexpected failure with TODO to ensure that the testcase isn't marked as a failure PR: 205481 r292533: Skip the testcases if mac_bsdextended(4) isn't detected on the system r292545: Redo the TAP integration so it works with Kyua Kyua needs numbers in the TAP results :/, but prove doesn't Modified: stable/10/tools/regression/mac/mac_bsdextended/test_matches.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/mac/mac_bsdextended/test_matches.sh ============================================================================== --- stable/10/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Jan 4 03:47:31 2016 (r293137) +++ stable/10/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Jan 4 06:57:06 2016 (r293138) @@ -10,158 +10,344 @@ uidoutrange="daemon" gidinrange="nobody" # We expect $uidinrange in this group gidoutrange="daemon" # We expect $uidinrange in this group -playground="/stuff/nobody/" # Must not be on root fs +test_num=1 +pass() +{ + echo "ok $test_num # $@" + : $(( test_num += 1 )) +} + +fail() +{ + echo "not ok $test_num # $@" + : $(( test_num += 1 )) +} # # Setup # -rm -f $playground/test* + +: ${TMPDIR=/tmp} +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP test must be run as root" + exit 0 +fi +if ! sysctl -N security.mac.bsdextended >/dev/null 2>&1; then + echo "1..0 # SKIP mac_bsdextended(4) support isn't available" + exit 0 +fi +if ! playground=$(mktemp -d $TMPDIR/tmp.XXXXXXX); then + echo "1..0 # SKIP failed to create temporary directory" + exit 0 +fi +trap "rmdir $playground" EXIT INT TERM +if ! mdmfs -s 25m md $playground; then + echo "1..0 # SKIP failed to mount md device" + exit 0 +fi +chmod a+rwx $playground +md_device=$(mount -p | grep "$playground" | awk '{ gsub(/^\/dev\//, "", $1); print $1 }') +trap "umount -f $playground; mdconfig -d -u $md_device; rmdir $playground" EXIT INT TERM +if [ -z "$md_device" ]; then + mount -p | grep $playground + echo "1..0 # SKIP md device not properly attached to the system" +fi + ugidfw remove 1 file1=$playground/test-$uidinrange file2=$playground/test-$uidoutrange -cat < $playground/test-script.pl -if (open(F, ">" . shift)) { exit 0; } else { exit 1; } +cat > $playground/test-script.sh <<'EOF' +#!/bin/sh +: > $1 EOF -command1="perl $playground/test-script.pl $file1" -command2="perl $playground/test-script.pl $file2" +if [ $? -ne 0 ]; then + echo "1..0 # SKIP failed to create test script" + exit 0 +fi +echo "1..30" + +command1="sh $playground/test-script.sh $file1" +command2="sh $playground/test-script.sh $file2" + +desc="$uidinrange file" +if su -m $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi -echo -n "$uidinrange file: " -su -m $uidinrange -c "$command1 && echo good" chown "$uidinrange":"$gidinrange" $file1 chmod a+w $file1 -echo -n "$uidoutrange file: " -$command2 && echo good +desc="$uidoutrange file" +if $command2; then + pass $desc +else + fail $desc +fi + chown "$uidoutrange":"$gidoutrange" $file2 chmod a+w $file2 # # No rules # -echo -n "no rules $uidinrange: " -su -fm $uidinrange -c "$command1 && echo good" -echo -n "no rules $uidoutrange: " -su -fm $uidoutrange -c "$command1 && echo good" +desc="no rules $uidinrange" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +desc="no rules $uidoutrange" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on uid # ugidfw set 1 subject uid $uidrange object mode rasx -echo -n "subject uid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "subject uid out range: " -su -fm $uidoutrange -c "$command1 && echo good" +desc="subject uid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="subject uid out range" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on gid # ugidfw set 1 subject gid $gidrange object mode rasx -echo -n "subject gid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "subject gid out range: " -su -fm $uidoutrange -c "$command1 && echo good" + +desc="subject gid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="subject gid out range" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on jail # -echo -n "subject matching jailid: " rm -f $playground/test-jail -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 3; touch $playground/test-jail) &"` + +desc="subject matching jailid" +jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` ugidfw set 1 subject jailid $jailid object mode rasx -sleep 6 -if [ ! -f $playground/test-jail ] ; then echo good ; fi +sleep 10 + +if [ -f $playground/test-jail ]; then + fail "TODO $desc: this testcase fails (see bug # 205481)" +else + pass $desc +fi -echo -n "subject nonmatching jailid: " rm -f $playground/test-jail -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 3; touch $playground/test-jail) &"` -sleep 6 -if [ -f $playground/test-jail ] ; then echo good ; fi +desc="subject nonmatching jailid" +jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` +sleep 10 +if [ -f $playground/test-jail ]; then + pass $desc +else + fail $desc +fi # # Object uid # ugidfw set 1 subject object uid $uidrange mode rasx -echo -n "object uid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "object uid out range: " -su -fm $uidinrange -c "$command2 && echo good" + +desc="object uid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object uid out range" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi ugidfw set 1 subject object uid $uidrange mode rasx -echo -n "object uid in range (differennt subject): " -su -fm $uidoutrange -c "$command1 || echo good" -echo -n "object uid out range (differennt subject): " -su -fm $uidoutrange -c "$command2 && echo good" + +desc="object uid in range (different subject)" +if su -fm $uidoutrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object uid out range (different subject)" +if su -fm $uidoutrange -c "$command2"; then + pass $desc +else + fail $desc +fi # # Object gid # ugidfw set 1 subject object gid $uidrange mode rasx -echo -n "object gid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "object gid out range: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object gid in range (differennt subject): " -su -fm $uidoutrange -c "$command1 || echo good" -echo -n "object gid out range (differennt subject): " -su -fm $uidoutrange -c "$command2 && echo good" + +desc="object gid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object gid out range" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi +desc="object gid in range (different subject)" +if su -fm $uidoutrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object gid out range (different subject)" +if su -fm $uidoutrange -c "$command2"; then + pass $desc +else + fail $desc +fi # # Object filesys # ugidfw set 1 subject uid $uidrange object filesys / mode rasx -echo -n "object out of filesys: " -su -fm $uidinrange -c "$command1 && echo good" +desc="object out of filesys" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + ugidfw set 1 subject uid $uidrange object filesys $playground mode rasx -echo -n "object in filesys: " -su -fm $uidinrange -c "$command1 || echo good" +desc="object in filesys" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object suid # ugidfw set 1 subject uid $uidrange object suid mode rasx -echo -n "object notsuid: " -su -fm $uidinrange -c "$command1 && echo good" +desc="object notsuid" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + chmod u+s $file1 -echo -n "object suid: " -su -fm $uidinrange -c "$command1 || echo good" +desc="object suid" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi chmod u-s $file1 # # Object sgid # ugidfw set 1 subject uid $uidrange object sgid mode rasx -echo -n "object notsgid: " -su -fm $uidinrange -c "$command1 && echo good" +desc="object notsgid" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + chmod g+s $file1 -echo -n "object sgid: " -su -fm $uidinrange -c "$command1 || echo good" +desc="object sgid" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi chmod g-s $file1 # # Object uid matches subject # ugidfw set 1 subject uid $uidrange object uid_of_subject mode rasx -echo -n "object uid notmatches subject: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object uid matches subject: " -su -fm $uidinrange -c "$command1 || echo good" + +desc="object uid notmatches subject" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +desc="object uid matches subject" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object gid matches subject # ugidfw set 1 subject uid $uidrange object gid_of_subject mode rasx -echo -n "object gid notmatches subject: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object gid matches subject: " -su -fm $uidinrange -c "$command1 || echo good" + +desc="object gid notmatches subject" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +desc="object gid matches subject" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object type # +desc="object not type" ugidfw set 1 subject uid $uidrange object type dbclsp mode rasx -echo -n "object not type: " -su -fm $uidinrange -c "$command1 && echo good" -ugidfw set 1 subject uid $uidrange object type r mode rasx -echo -n "object type: " -su -fm $uidinrange -c "$command1 || echo good" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi +desc="object type" +ugidfw set 1 subject uid $uidrange object type r mode rasx +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi From owner-svn-src-all@freebsd.org Mon Jan 4 06:58:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 252EEA5F90C; Mon, 4 Jan 2016 06:58:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAC3212FA; Mon, 4 Jan 2016 06:58:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u046wduT079477; Mon, 4 Jan 2016 06:58:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u046wdI4079476; Mon, 4 Jan 2016 06:58:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040658.u046wdI4079476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 06:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r293139 - stable/9/tools/regression/mac/mac_bsdextended X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 06:58:41 -0000 Author: ngie Date: Mon Jan 4 06:58:39 2016 New Revision: 293139 URL: https://svnweb.freebsd.org/changeset/base/293139 Log: MFstable/10 r293138: MFC r292531,r292532,r292533,r292545: r292531: Make test_matches.sh into a series of TAP testcases Use temporary filesystems / memory disks instead of a hardcoded path which doesn't exist on test systems r292532: Mark `subject matching jailid` testcase as an unexpected failure with TODO to ensure that the testcase isn't marked as a failure PR: 205481 r292533: Skip the testcases if mac_bsdextended(4) isn't detected on the system r292545: Redo the TAP integration so it works with Kyua Kyua needs numbers in the TAP results :/, but prove doesn't Modified: stable/9/tools/regression/mac/mac_bsdextended/test_matches.sh Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) Modified: stable/9/tools/regression/mac/mac_bsdextended/test_matches.sh ============================================================================== --- stable/9/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Jan 4 06:57:06 2016 (r293138) +++ stable/9/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Jan 4 06:58:39 2016 (r293139) @@ -10,158 +10,344 @@ uidoutrange="daemon" gidinrange="nobody" # We expect $uidinrange in this group gidoutrange="daemon" # We expect $uidinrange in this group -playground="/stuff/nobody/" # Must not be on root fs +test_num=1 +pass() +{ + echo "ok $test_num # $@" + : $(( test_num += 1 )) +} + +fail() +{ + echo "not ok $test_num # $@" + : $(( test_num += 1 )) +} # # Setup # -rm -f $playground/test* + +: ${TMPDIR=/tmp} +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP test must be run as root" + exit 0 +fi +if ! sysctl -N security.mac.bsdextended >/dev/null 2>&1; then + echo "1..0 # SKIP mac_bsdextended(4) support isn't available" + exit 0 +fi +if ! playground=$(mktemp -d $TMPDIR/tmp.XXXXXXX); then + echo "1..0 # SKIP failed to create temporary directory" + exit 0 +fi +trap "rmdir $playground" EXIT INT TERM +if ! mdmfs -s 25m md $playground; then + echo "1..0 # SKIP failed to mount md device" + exit 0 +fi +chmod a+rwx $playground +md_device=$(mount -p | grep "$playground" | awk '{ gsub(/^\/dev\//, "", $1); print $1 }') +trap "umount -f $playground; mdconfig -d -u $md_device; rmdir $playground" EXIT INT TERM +if [ -z "$md_device" ]; then + mount -p | grep $playground + echo "1..0 # SKIP md device not properly attached to the system" +fi + ugidfw remove 1 file1=$playground/test-$uidinrange file2=$playground/test-$uidoutrange -cat < $playground/test-script.pl -if (open(F, ">" . shift)) { exit 0; } else { exit 1; } +cat > $playground/test-script.sh <<'EOF' +#!/bin/sh +: > $1 EOF -command1="perl $playground/test-script.pl $file1" -command2="perl $playground/test-script.pl $file2" +if [ $? -ne 0 ]; then + echo "1..0 # SKIP failed to create test script" + exit 0 +fi +echo "1..30" + +command1="sh $playground/test-script.sh $file1" +command2="sh $playground/test-script.sh $file2" + +desc="$uidinrange file" +if su -m $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi -echo -n "$uidinrange file: " -su -m $uidinrange -c "$command1 && echo good" chown "$uidinrange":"$gidinrange" $file1 chmod a+w $file1 -echo -n "$uidoutrange file: " -$command2 && echo good +desc="$uidoutrange file" +if $command2; then + pass $desc +else + fail $desc +fi + chown "$uidoutrange":"$gidoutrange" $file2 chmod a+w $file2 # # No rules # -echo -n "no rules $uidinrange: " -su -fm $uidinrange -c "$command1 && echo good" -echo -n "no rules $uidoutrange: " -su -fm $uidoutrange -c "$command1 && echo good" +desc="no rules $uidinrange" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +desc="no rules $uidoutrange" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on uid # ugidfw set 1 subject uid $uidrange object mode rasx -echo -n "subject uid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "subject uid out range: " -su -fm $uidoutrange -c "$command1 && echo good" +desc="subject uid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="subject uid out range" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on gid # ugidfw set 1 subject gid $gidrange object mode rasx -echo -n "subject gid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "subject gid out range: " -su -fm $uidoutrange -c "$command1 && echo good" + +desc="subject gid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="subject gid out range" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on jail # -echo -n "subject matching jailid: " rm -f $playground/test-jail -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 3; touch $playground/test-jail) &"` + +desc="subject matching jailid" +jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` ugidfw set 1 subject jailid $jailid object mode rasx -sleep 6 -if [ ! -f $playground/test-jail ] ; then echo good ; fi +sleep 10 + +if [ -f $playground/test-jail ]; then + fail "TODO $desc: this testcase fails (see bug # 205481)" +else + pass $desc +fi -echo -n "subject nonmatching jailid: " rm -f $playground/test-jail -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 3; touch $playground/test-jail) &"` -sleep 6 -if [ -f $playground/test-jail ] ; then echo good ; fi +desc="subject nonmatching jailid" +jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` +sleep 10 +if [ -f $playground/test-jail ]; then + pass $desc +else + fail $desc +fi # # Object uid # ugidfw set 1 subject object uid $uidrange mode rasx -echo -n "object uid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "object uid out range: " -su -fm $uidinrange -c "$command2 && echo good" + +desc="object uid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object uid out range" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi ugidfw set 1 subject object uid $uidrange mode rasx -echo -n "object uid in range (differennt subject): " -su -fm $uidoutrange -c "$command1 || echo good" -echo -n "object uid out range (differennt subject): " -su -fm $uidoutrange -c "$command2 && echo good" + +desc="object uid in range (different subject)" +if su -fm $uidoutrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object uid out range (different subject)" +if su -fm $uidoutrange -c "$command2"; then + pass $desc +else + fail $desc +fi # # Object gid # ugidfw set 1 subject object gid $uidrange mode rasx -echo -n "object gid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "object gid out range: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object gid in range (differennt subject): " -su -fm $uidoutrange -c "$command1 || echo good" -echo -n "object gid out range (differennt subject): " -su -fm $uidoutrange -c "$command2 && echo good" + +desc="object gid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object gid out range" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi +desc="object gid in range (different subject)" +if su -fm $uidoutrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object gid out range (different subject)" +if su -fm $uidoutrange -c "$command2"; then + pass $desc +else + fail $desc +fi # # Object filesys # ugidfw set 1 subject uid $uidrange object filesys / mode rasx -echo -n "object out of filesys: " -su -fm $uidinrange -c "$command1 && echo good" +desc="object out of filesys" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + ugidfw set 1 subject uid $uidrange object filesys $playground mode rasx -echo -n "object in filesys: " -su -fm $uidinrange -c "$command1 || echo good" +desc="object in filesys" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object suid # ugidfw set 1 subject uid $uidrange object suid mode rasx -echo -n "object notsuid: " -su -fm $uidinrange -c "$command1 && echo good" +desc="object notsuid" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + chmod u+s $file1 -echo -n "object suid: " -su -fm $uidinrange -c "$command1 || echo good" +desc="object suid" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi chmod u-s $file1 # # Object sgid # ugidfw set 1 subject uid $uidrange object sgid mode rasx -echo -n "object notsgid: " -su -fm $uidinrange -c "$command1 && echo good" +desc="object notsgid" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + chmod g+s $file1 -echo -n "object sgid: " -su -fm $uidinrange -c "$command1 || echo good" +desc="object sgid" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi chmod g-s $file1 # # Object uid matches subject # ugidfw set 1 subject uid $uidrange object uid_of_subject mode rasx -echo -n "object uid notmatches subject: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object uid matches subject: " -su -fm $uidinrange -c "$command1 || echo good" + +desc="object uid notmatches subject" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +desc="object uid matches subject" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object gid matches subject # ugidfw set 1 subject uid $uidrange object gid_of_subject mode rasx -echo -n "object gid notmatches subject: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object gid matches subject: " -su -fm $uidinrange -c "$command1 || echo good" + +desc="object gid notmatches subject" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +desc="object gid matches subject" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object type # +desc="object not type" ugidfw set 1 subject uid $uidrange object type dbclsp mode rasx -echo -n "object not type: " -su -fm $uidinrange -c "$command1 && echo good" -ugidfw set 1 subject uid $uidrange object type r mode rasx -echo -n "object type: " -su -fm $uidinrange -c "$command1 || echo good" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi +desc="object type" +ugidfw set 1 subject uid $uidrange object type r mode rasx +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi From owner-svn-src-all@freebsd.org Mon Jan 4 07:02:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D174AA5FB5F; Mon, 4 Jan 2016 07:02:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A89971830; Mon, 4 Jan 2016 07:02:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0472m74082306; Mon, 4 Jan 2016 07:02:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0472mKv082304; Mon, 4 Jan 2016 07:02:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040702.u0472mKv082304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293140 - stable/10/tests/sys/aio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:02:49 -0000 Author: ngie Date: Mon Jan 4 07:02:48 2016 New Revision: 293140 URL: https://svnweb.freebsd.org/changeset/base/293140 Log: MFC r292816,r292818,r292819: r292816: Place cancel and error under #ifdef DEBUG to mute -Wunused-but-set-variable warnings reported by gcc 4.9 Remove some trailing whitespace as well Tested with and without -DDEBUG r292818: Fix style(9) a bit and ensure that error from initializing kqueue(2) is sane - Push the kqueue(2) initialization down so the errno will correspond with the failure instead of potentially being stomped on by functions called by `PLAIN_REQUIRE_KERNEL_MODULE` - Delete trailing whitespace - Add spaces between braces for conditional and control blocks (for/if) - Use err/errx instead of perror+printf+exit/printf+exit. - Remove braces for single-line conditionals Tested with and without -DDEBUG r292819: - Fix an improperly sized buffer for `pathname` [1] - Fix a -Wunused-but-set-variable warning [2] Modified: stable/10/tests/sys/aio/aio_kqueue_test.c stable/10/tests/sys/aio/lio_kqueue_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/aio/aio_kqueue_test.c ============================================================================== --- stable/10/tests/sys/aio/aio_kqueue_test.c Mon Jan 4 06:58:39 2016 (r293139) +++ stable/10/tests/sys/aio/aio_kqueue_test.c Mon Jan 4 07:02:48 2016 (r293140) @@ -62,7 +62,10 @@ main (int argc, char *argv[]) struct kevent ke, kq_returned; struct timespec ts; char buffer[32768]; - int cancel, error, failed = 0, fd, kq, pending, result, run; +#ifdef DEBUG + int cancel, error; +#endif + int failed = 0, fd, kq, pending, result, run; int tmp_file = 0; unsigned i, j; @@ -96,19 +99,19 @@ main (int argc, char *argv[]) if (iocb[i] == NULL) err(1, "calloc"); } - - pending = 0; + + pending = 0; for (i = 0; i < nitems(iocb); i++) { pending++; iocb[i]->aio_nbytes = sizeof(buffer); iocb[i]->aio_buf = buffer; iocb[i]->aio_fildes = fd; iocb[i]->aio_offset = iocb[i]->aio_nbytes * i * run; - + iocb[i]->aio_sigevent.sigev_notify_kqueue = kq; iocb[i]->aio_sigevent.sigev_value.sival_ptr = iocb[i]; iocb[i]->aio_sigevent.sigev_notify = SIGEV_KEVENT; - + result = aio_write(iocb[i]); if (result != 0) { perror("aio_write"); @@ -133,7 +136,9 @@ main (int argc, char *argv[]) } } } +#ifdef DEBUG cancel = nitems(iocb) - pending; +#endif i = 0; while (pending) { @@ -144,34 +149,36 @@ main (int argc, char *argv[]) bzero(&kq_returned, sizeof(ke)); ts.tv_sec = 0; ts.tv_nsec = 1; - result = kevent(kq, NULL, 0, + result = kevent(kq, NULL, 0, &kq_returned, 1, &ts); +#ifdef DEBUG error = errno; +#endif if (result < 0) perror("kevent error: "); kq_iocb = kq_returned.udata; #ifdef DEBUG printf("kevent %d %d errno %d return.ident %p " - "return.data %p return.udata %p %p\n", - i, result, error, - kq_returned.ident, kq_returned.data, - kq_returned.udata, + "return.data %p return.udata %p %p\n", + i, result, error, + kq_returned.ident, kq_returned.data, + kq_returned.udata, kq_iocb); #endif - + if (kq_iocb) break; #ifdef DEBUG printf("Try again left %d out of %d %d\n", pending, nitems(iocb), cancel); #endif - } - + } + for (j = 0; j < nitems(iocb) && iocb[j] != kq_iocb; j++) ; #ifdef DEBUG printf("kq_iocb %p\n", kq_iocb); - + printf("Error Result for %d is %d pending %d\n", j, result, pending); #endif @@ -192,7 +199,7 @@ main (int argc, char *argv[]) iocb[j] = NULL; pending--; i++; - } + } for (i = 0; i < nitems(iocb); i++) free(iocb[i]); Modified: stable/10/tests/sys/aio/lio_kqueue_test.c ============================================================================== --- stable/10/tests/sys/aio/lio_kqueue_test.c Mon Jan 4 06:58:39 2016 (r293139) +++ stable/10/tests/sys/aio/lio_kqueue_test.c Mon Jan 4 07:02:48 2016 (r293140) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -57,26 +58,26 @@ #define MAX_RUNS 300 int -main(int argc, char *argv[]){ +main(int argc, char *argv[]) +{ int fd; struct aiocb *iocb[MAX_IOCBS]; - struct aiocb **lio[LIO_MAX], **lio_element, **kq_lio; + struct aiocb **lio[LIO_MAX], **kq_lio; int i, result, run, error, j, k; char buffer[32768]; - int kq = kqueue(); + int kq; struct kevent ke, kq_returned; struct timespec ts; struct sigevent sig; time_t time1, time2; - char *file, pathname[sizeof(PATH_TEMPLATE)-1]; + char *file, pathname[sizeof(PATH_TEMPLATE)]; int tmp_file = 0, failed = 0; PLAIN_REQUIRE_KERNEL_MODULE("aio", 0); - if (kq < 0) { - perror("No kqeueue\n"); - exit(1); - } + kq = kqueue(); + if (kq < 0) + err(1, "kqeueue(2) failed"); if (argc == 1) { strcpy(pathname, PATH_TEMPLATE); @@ -87,34 +88,29 @@ main(int argc, char *argv[]){ file = argv[1]; fd = open(file, O_RDWR|O_CREAT, 0666); } - if (fd < 0){ - fprintf(stderr, "Can't open %s\n", argv[1]); - perror(""); - exit(1); - } + if (fd < 0) + err(1, "can't open %s", argv[1]); #ifdef DEBUG printf("Hello kq %d fd %d\n", kq, fd); #endif - for (run = 0; run < MAX_RUNS; run++){ + for (run = 0; run < MAX_RUNS; run++) { #ifdef DEBUG printf("Run %d\n", run); #endif for (j = 0; j < LIO_MAX; j++) { - lio[j] = (struct aiocb **) + lio[j] = malloc(sizeof(struct aiocb *) * MAX_IOCBS/LIO_MAX); - for(i = 0; i < MAX_IOCBS / LIO_MAX; i++) { + for (i = 0; i < MAX_IOCBS / LIO_MAX; i++) { k = (MAX_IOCBS / LIO_MAX * j) + i; - lio_element = lio[j]; - lio[j][i] = iocb[k] = (struct aiocb *) - malloc(sizeof(struct aiocb)); - bzero(iocb[k], sizeof(struct aiocb)); + lio[j][i] = iocb[k] = + calloc(1, sizeof(struct aiocb)); iocb[k]->aio_nbytes = sizeof(buffer); iocb[k]->aio_buf = buffer; iocb[k]->aio_fildes = fd; - iocb[k]->aio_offset - = iocb[k]->aio_nbytes * k * (run + 1); + iocb[k]->aio_offset + = iocb[k]->aio_nbytes * k * (run + 1); #ifdef DEBUG printf("hello iocb[k] %d\n", @@ -131,27 +127,26 @@ main(int argc, char *argv[]){ error = errno; time(&time2); #ifdef DEBUG - printf("Time %d %d %d result -> %d\n", + printf("Time %d %d %d result -> %d\n", time1, time2, time2-time1, result); #endif if (result != 0) { errno = error; - perror("list_listio"); - printf("FAIL: Result %d iteration %d\n",result, j); - exit(1); + err(1, "FAIL: Result %d iteration %d\n", + result, j); } #ifdef DEBUG printf("write %d is at %p\n", j, lio[j]); #endif } - for(i = 0; i < LIO_MAX; i++) { - for(j = LIO_MAX - 1; j >=0; j--) { + for (i = 0; i < LIO_MAX; i++) { + for (j = LIO_MAX - 1; j >=0; j--) { if (lio[j]) break; } - for(;;) { + for (;;) { bzero(&ke, sizeof(ke)); bzero(&kq_returned, sizeof(ke)); ts.tv_sec = 0; @@ -159,9 +154,9 @@ main(int argc, char *argv[]){ #ifdef DEBUG printf("FOO lio %d -> %p\n", j, lio[j]); #endif - EV_SET(&ke, (uintptr_t)lio[j], + EV_SET(&ke, (uintptr_t)lio[j], EVFILT_LIO, EV_ONESHOT, 0, 0, iocb[j]); - result = kevent(kq, NULL, 0, + result = kevent(kq, NULL, 0, &kq_returned, 1, &ts); error = errno; if (result < 0) { @@ -170,14 +165,14 @@ main(int argc, char *argv[]){ kq_lio = kq_returned.udata; #ifdef DEBUG printf("kevent %d %d errno %d return.ident %p " - "return.data %p return.udata %p %p\n", - i, result, error, - kq_returned.ident, kq_returned.data, - kq_returned.udata, + "return.data %p return.udata %p %p\n", + i, result, error, + kq_returned.ident, kq_returned.data, + kq_returned.udata, lio[j]); #endif - if(kq_lio) + if (kq_lio) break; #ifdef DEBUG printf("Try again\n"); @@ -189,25 +184,21 @@ main(int argc, char *argv[]){ #endif for (j = 0; j < LIO_MAX; j++) { - if (lio[j] == kq_lio) { + if (lio[j] == kq_lio) break; - } - } - if (j == LIO_MAX) { - printf("FAIL:\n"); - exit(1); } + if (j == LIO_MAX) + errx(1, "FAIL: "); #ifdef DEBUG printf("Error Result for %d is %d\n", j, result); #endif if (result < 0) { printf("FAIL: run %d, operation %d result %d \n", run, LIO_MAX - i -1, result); - failed = 1; - } else { + failed++; + } else printf("PASS: run %d, operation %d result %d \n", run, LIO_MAX - i -1, result); - } - for(k = 0; k < MAX_IOCBS / LIO_MAX; k++){ + for (k = 0; k < MAX_IOCBS / LIO_MAX; k++) { result = aio_return(kq_lio[k]); #ifdef DEBUG printf("Return Resulto for %d %d is %d\n", j, k, result); @@ -224,9 +215,8 @@ main(int argc, char *argv[]){ printf("\n"); #endif - for(k = 0; k < MAX_IOCBS / LIO_MAX; k++) { + for (k = 0; k < MAX_IOCBS / LIO_MAX; k++) free(lio[j][k]); - } free(lio[j]); lio[j] = NULL; } @@ -235,15 +225,12 @@ main(int argc, char *argv[]){ printf("Done\n"); #endif - if (tmp_file) { + if (tmp_file) unlink(pathname); - } - if (failed) { - printf("FAIL: Atleast one\n"); - exit(1); - } else { - printf("PASS: All\n"); - exit(0); - } + if (failed) + errx(1, "FAIL: %d testcases failed", failed); + else + errx(0, "PASS: All\n"); + } From owner-svn-src-all@freebsd.org Mon Jan 4 07:03:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B01D7A5FC47; Mon, 4 Jan 2016 07:03:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70C5F1AE2; Mon, 4 Jan 2016 07:03:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0473wp8082560; Mon, 4 Jan 2016 07:03:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0473ww1082558; Mon, 4 Jan 2016 07:03:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040703.u0473ww1082558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293141 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:03:59 -0000 Author: ngie Date: Mon Jan 4 07:03:58 2016 New Revision: 293141 URL: https://svnweb.freebsd.org/changeset/base/293141 Log: MFC r292815: Staticize several variables that are used exclusively in bsnmpd/main.c and bsnmpd/trap.c This fixes several -Wmissing-variable-declaration warnings noted by clang Modified: stable/10/contrib/bsnmp/snmpd/main.c stable/10/contrib/bsnmp/snmpd/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/main.c Mon Jan 4 07:02:48 2016 (r293140) +++ stable/10/contrib/bsnmp/snmpd/main.c Mon Jan 4 07:03:58 2016 (r293141) @@ -119,26 +119,30 @@ static struct lmodules modules_start = T struct community_list community_list = TAILQ_HEAD_INITIALIZER(community_list); /* list of all known USM users */ -struct usm_userlist usm_userlist = SLIST_HEAD_INITIALIZER(usm_userlist); +static struct usm_userlist usm_userlist = SLIST_HEAD_INITIALIZER(usm_userlist); /* A list of all VACM users configured, including v1, v2c and v3 */ -struct vacm_userlist vacm_userlist = SLIST_HEAD_INITIALIZER(vacm_userlist); +static struct vacm_userlist vacm_userlist = + SLIST_HEAD_INITIALIZER(vacm_userlist); /* A list of all VACM groups */ -struct vacm_grouplist vacm_grouplist = SLIST_HEAD_INITIALIZER(vacm_grouplist); +static struct vacm_grouplist vacm_grouplist = + SLIST_HEAD_INITIALIZER(vacm_grouplist); static struct vacm_group vacm_default_group = { .groupname = "", }; /* The list of configured access entries */ -struct vacm_accesslist vacm_accesslist = TAILQ_HEAD_INITIALIZER(vacm_accesslist); +static struct vacm_accesslist vacm_accesslist = + TAILQ_HEAD_INITIALIZER(vacm_accesslist); /* The list of configured views */ -struct vacm_viewlist vacm_viewlist = SLIST_HEAD_INITIALIZER(vacm_viewlist); +static struct vacm_viewlist vacm_viewlist = + SLIST_HEAD_INITIALIZER(vacm_viewlist); /* The list of configured contexts */ -struct vacm_contextlist vacm_contextlist = +static struct vacm_contextlist vacm_contextlist = SLIST_HEAD_INITIALIZER(vacm_contextlist); /* list of all installed object resources */ Modified: stable/10/contrib/bsnmp/snmpd/trap.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trap.c Mon Jan 4 07:02:48 2016 (r293140) +++ stable/10/contrib/bsnmp/snmpd/trap.c Mon Jan 4 07:03:58 2016 (r293141) @@ -60,15 +60,15 @@ struct trapsink_list trapsink_list = TAILQ_HEAD_INITIALIZER(trapsink_list); /* List of target addresses */ -struct target_addresslist target_addresslist = +static struct target_addresslist target_addresslist = SLIST_HEAD_INITIALIZER(target_addresslist); /* List of target parameters */ -struct target_paramlist target_paramlist = +static struct target_paramlist target_paramlist = SLIST_HEAD_INITIALIZER(target_paramlist); /* List of notification targets */ -struct target_notifylist target_notifylist = +static struct target_notifylist target_notifylist = SLIST_HEAD_INITIALIZER(target_notifylist); static const struct asn_oid oid_begemotTrapSinkTable = From owner-svn-src-all@freebsd.org Mon Jan 4 07:05:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B847A5FD36; Mon, 4 Jan 2016 07:05:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAACB1C90; Mon, 4 Jan 2016 07:04:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0474xN0082656; Mon, 4 Jan 2016 07:04:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0474wHO082654; Mon, 4 Jan 2016 07:04:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040704.u0474wHO082654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r293142 - stable/9/contrib/bsnmp/snmpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:05:00 -0000 Author: ngie Date: Mon Jan 4 07:04:58 2016 New Revision: 293142 URL: https://svnweb.freebsd.org/changeset/base/293142 Log: MFstable/10 r293141: MFC r292815: Staticize several variables that are used exclusively in bsnmpd/main.c and bsnmpd/trap.c This fixes several -Wmissing-variable-declaration warnings noted by clang Modified: stable/9/contrib/bsnmp/snmpd/main.c stable/9/contrib/bsnmp/snmpd/trap.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/bsnmp/ (props changed) Modified: stable/9/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/9/contrib/bsnmp/snmpd/main.c Mon Jan 4 07:03:58 2016 (r293141) +++ stable/9/contrib/bsnmp/snmpd/main.c Mon Jan 4 07:04:58 2016 (r293142) @@ -119,26 +119,30 @@ static struct lmodules modules_start = T struct community_list community_list = TAILQ_HEAD_INITIALIZER(community_list); /* list of all known USM users */ -struct usm_userlist usm_userlist = SLIST_HEAD_INITIALIZER(usm_userlist); +static struct usm_userlist usm_userlist = SLIST_HEAD_INITIALIZER(usm_userlist); /* A list of all VACM users configured, including v1, v2c and v3 */ -struct vacm_userlist vacm_userlist = SLIST_HEAD_INITIALIZER(vacm_userlist); +static struct vacm_userlist vacm_userlist = + SLIST_HEAD_INITIALIZER(vacm_userlist); /* A list of all VACM groups */ -struct vacm_grouplist vacm_grouplist = SLIST_HEAD_INITIALIZER(vacm_grouplist); +static struct vacm_grouplist vacm_grouplist = + SLIST_HEAD_INITIALIZER(vacm_grouplist); static struct vacm_group vacm_default_group = { .groupname = "", }; /* The list of configured access entries */ -struct vacm_accesslist vacm_accesslist = TAILQ_HEAD_INITIALIZER(vacm_accesslist); +static struct vacm_accesslist vacm_accesslist = + TAILQ_HEAD_INITIALIZER(vacm_accesslist); /* The list of configured views */ -struct vacm_viewlist vacm_viewlist = SLIST_HEAD_INITIALIZER(vacm_viewlist); +static struct vacm_viewlist vacm_viewlist = + SLIST_HEAD_INITIALIZER(vacm_viewlist); /* The list of configured contexts */ -struct vacm_contextlist vacm_contextlist = +static struct vacm_contextlist vacm_contextlist = SLIST_HEAD_INITIALIZER(vacm_contextlist); /* list of all installed object resources */ Modified: stable/9/contrib/bsnmp/snmpd/trap.c ============================================================================== --- stable/9/contrib/bsnmp/snmpd/trap.c Mon Jan 4 07:03:58 2016 (r293141) +++ stable/9/contrib/bsnmp/snmpd/trap.c Mon Jan 4 07:04:58 2016 (r293142) @@ -60,15 +60,15 @@ struct trapsink_list trapsink_list = TAILQ_HEAD_INITIALIZER(trapsink_list); /* List of target addresses */ -struct target_addresslist target_addresslist = +static struct target_addresslist target_addresslist = SLIST_HEAD_INITIALIZER(target_addresslist); /* List of target parameters */ -struct target_paramlist target_paramlist = +static struct target_paramlist target_paramlist = SLIST_HEAD_INITIALIZER(target_paramlist); /* List of notification targets */ -struct target_notifylist target_notifylist = +static struct target_notifylist target_notifylist = SLIST_HEAD_INITIALIZER(target_notifylist); static const struct asn_oid oid_begemotTrapSinkTable = From owner-svn-src-all@freebsd.org Mon Jan 4 07:06:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 175ABA5FDF8; Mon, 4 Jan 2016 07:06:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB6711DF2; Mon, 4 Jan 2016 07:06:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0476kUU082805; Mon, 4 Jan 2016 07:06:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0476k7j082804; Mon, 4 Jan 2016 07:06:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040706.u0476k7j082804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293143 - stable/10/tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:06:48 -0000 Author: ngie Date: Mon Jan 4 07:06:46 2016 New Revision: 293143 URL: https://svnweb.freebsd.org/changeset/base/293143 Log: MFC r292820: Clean trailing whitespace Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- stable/10/tests/sys/kern/unix_seqpacket_test.c Mon Jan 4 07:04:58 2016 (r293142) +++ stable/10/tests/sys/kern/unix_seqpacket_test.c Mon Jan 4 07:06:46 2016 (r293143) @@ -47,7 +47,7 @@ static void do_socketpair(int *sv) { int s; - + s = socketpair(PF_LOCAL, SOCK_SEQPACKET, 0, sv); ATF_REQUIRE_EQ(0, s); ATF_REQUIRE(sv[0] >= 0); @@ -59,7 +59,7 @@ static void do_socketpair_nonblocking(int *sv) { int s; - + s = socketpair(PF_LOCAL, SOCK_SEQPACKET, 0, sv); ATF_REQUIRE_EQ(0, s); ATF_REQUIRE(sv[0] >= 0); @@ -69,7 +69,7 @@ do_socketpair_nonblocking(int *sv) ATF_REQUIRE(-1 != fcntl(sv[1], F_SETFL, O_NONBLOCK)); } -/* +/* * Returns a pair of sockets made the hard way: bind, listen, connect & accept * @return const char* The path to the socket */ @@ -101,7 +101,7 @@ mk_pair_of_sockets(int *sv) perror("connect"); atf_tc_fail("connect(2) failed"); } - + /* Accept it */ s1 = accept(s, NULL, NULL); if (s1 == -1) { @@ -232,7 +232,7 @@ test_pipe_simulator(size_t sndbufsize, s memset(sndbuf, num_sent, pktsize); ssize = send(sv[0], sndbuf, pktsize, MSG_EOR); if (ssize < 0) { - /* + /* * XXX: This is bug-compatible with the kernel. * The kernel returns EMSGSIZE when it should * return EAGAIN @@ -268,7 +268,7 @@ test_pipe_simulator(size_t sndbufsize, s pktsize, rsize); memset(comparebuf, num_received, pktsize); ATF_CHECK_EQ_MSG(0, memcmp(comparebuf, rcvbuf, - pktsize), + pktsize), "Received data miscompare"); num_received++; } @@ -324,7 +324,7 @@ test_pipe_reader(void* args) "expected %zd=send(...) but got %zd", td->pktsize, rsize); d = memcmp(comparebuf, rcvbuf, td->pktsize); - ATF_CHECK_EQ_MSG(0, d, + ATF_CHECK_EQ_MSG(0, d, "Received data miscompare on packet %d", i); } return (0); @@ -360,7 +360,7 @@ test_pipe(size_t sndbufsize, size_t rcvb reader_data.so = sv[1]; ATF_REQUIRE_EQ(0, pthread_create(&writer, NULL, test_pipe_writer, (void*)&writer_data)); - /* + /* * Give the writer time to start writing, and hopefully block, before * starting the reader. This increases the likelihood of the test case * failing due to PR kern/185812 @@ -539,7 +539,7 @@ ATF_TC_BODY(resize_buffers, tc) ATF_CHECK_EQ(0, getsockopt(s, SOL_SOCKET, SO_SNDBUF, &xs, &sl)); ATF_CHECK_EQ(0, getsockopt(s, SOL_SOCKET, SO_RCVBUF, &xr, &sl)); printf("After changing SNDBUF | %7d | %7d |\n", xs, xr); - + if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)) != 0){ perror("setsockopt"); atf_tc_fail("setsockopt(SO_RCVBUF) failed"); @@ -676,7 +676,7 @@ ATF_TC_BODY(sendto_recvfrom, tc) } ATF_CHECK_EQ(datalen, rsize); - /* + /* * FreeBSD does not currently provide the source address for SEQ_PACKET * AF_UNIX sockets, and POSIX does not require it, so these two checks * are disabled. If FreeBSD gains that feature in the future, then @@ -686,7 +686,7 @@ ATF_TC_BODY(sendto_recvfrom, tc) /* ATF_CHECK_STREQ(path, ((struct sockaddr_un*)&from)->sun_path); */ } -/* +/* * send(2) and recv(2) a single short record with sockets created the * traditional way, involving bind, listen, connect, and accept */ @@ -782,7 +782,7 @@ ATF_TC_BODY(send_recv_nonblocking, tc) ATF_CHECK_EQ(datalen, rsize); } -/* +/* * We should get EMSGSIZE if we try to send a message larger than the socket * buffer, with blocking sockets */ @@ -809,7 +809,7 @@ ATF_TC_BODY(emsgsize, tc) ATF_CHECK_EQ(-1, ssize); } -/* +/* * We should get EMSGSIZE if we try to send a message larger than the socket * buffer, with nonblocking sockets */ @@ -837,7 +837,7 @@ ATF_TC_BODY(emsgsize_nonblocking, tc) } -/* +/* * We should get EAGAIN if we try to send a message larger than the socket * buffer, with nonblocking sockets. Test with several different sockbuf sizes */ @@ -863,7 +863,7 @@ ATF_TC_BODY(eagain_128k_128k, tc) } -/* +/* * nonblocking send(2) and recv(2) of several records, which should collectively * fill up the send buffer but not the receive buffer */ @@ -888,7 +888,7 @@ ATF_TC_BODY(rcvbuf_oversized, tc) ATF_REQUIRE_EQ(0, setsockopt(sv[1], SOL_SOCKET, SO_RCVBUF, &rcvbufsize, sizeof(rcvbufsize))); - /* + /* * Send and receive packets that are collectively greater than the send * buffer, but less than the receive buffer */ @@ -916,7 +916,7 @@ ATF_TC_BODY(rcvbuf_oversized, tc) "expected %zd=send(...) but got %zd", pktsize, rsize); /* Verify the contents */ - ATF_CHECK_EQ_MSG(0, memcmp(sndbuf, recv_buf, pktsize), + ATF_CHECK_EQ_MSG(0, memcmp(sndbuf, recv_buf, pktsize), "Received data miscompare"); } @@ -926,7 +926,7 @@ ATF_TC_BODY(rcvbuf_oversized, tc) ATF_CHECK_EQ(-1, rsize); } -/* +/* * Simulate the behavior of a blocking pipe. The sender will send until his * buffer fills up, then we'll simulate a scheduler switch that will allow the * receiver to read until his buffer empties. Repeat the process until the @@ -957,7 +957,7 @@ ATF_TC_BODY(pipe_simulator_128k_128k, tc test_pipe_simulator(131072, 131072); } -/* +/* * Test blocking I/O by passing data between two threads. The total amount of * data will be >> buffer size to force blocking. Repeat the test with multiple * send and receive buffer sizes From owner-svn-src-all@freebsd.org Mon Jan 4 07:09:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A1F2A5FF22; Mon, 4 Jan 2016 07:09:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE97B1F7B; Mon, 4 Jan 2016 07:09:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0479Uq8083001; Mon, 4 Jan 2016 07:09:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0479UlH083000; Mon, 4 Jan 2016 07:09:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040709.u0479UlH083000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293144 - stable/10/tests/sys/kern/pipe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:09:31 -0000 Author: ngie Date: Mon Jan 4 07:09:29 2016 New Revision: 293144 URL: https://svnweb.freebsd.org/changeset/base/293144 Log: MFC r292822: Remove retval to fix a -Wunused-but-set-variable warning from gcc 4.9 Modified: stable/10/tests/sys/kern/pipe/pipe_overcommit1_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/pipe/pipe_overcommit1_test.c ============================================================================== --- stable/10/tests/sys/kern/pipe/pipe_overcommit1_test.c Mon Jan 4 07:06:46 2016 (r293143) +++ stable/10/tests/sys/kern/pipe/pipe_overcommit1_test.c Mon Jan 4 07:09:29 2016 (r293144) @@ -40,12 +40,11 @@ int main(void) { - int pipes[10000], returnval; + int pipes[10000]; unsigned int i; - for (i = 0; i < nitems(pipes); i++) { - returnval = pipe(&pipes[i]); - } + for (i = 0; i < nitems(pipes); i++) + (void)pipe(&pipes[i]); printf("PASS\n"); exit(0); From owner-svn-src-all@freebsd.org Mon Jan 4 07:11:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3C9EA600F5; Mon, 4 Jan 2016 07:11:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 644DF129D; Mon, 4 Jan 2016 07:11:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u047BFAA085065; Mon, 4 Jan 2016 07:11:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u047BFV1085064; Mon, 4 Jan 2016 07:11:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040711.u047BFV1085064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293145 - stable/10/tools/regression/sockets/unix_passfd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:11:16 -0000 Author: ngie Date: Mon Jan 4 07:11:15 2016 New Revision: 293145 URL: https://svnweb.freebsd.org/changeset/base/293145 Log: MFC r292814: - Explicitly initialize ch to 0 - Delete some spurious whitespace - Use calloc instead of malloc in the last test to ensure that sendspace is properly zero'ed out Submitted by: markj Modified: stable/10/tools/regression/sockets/unix_passfd/unix_passfd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/sockets/unix_passfd/unix_passfd.c ============================================================================== --- stable/10/tools/regression/sockets/unix_passfd/unix_passfd.c Mon Jan 4 07:09:29 2016 (r293144) +++ stable/10/tools/regression/sockets/unix_passfd/unix_passfd.c Mon Jan 4 07:11:15 2016 (r293145) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2005 Robert N. M. Watson + * Copyright (c) 2015 Mark Johnston * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -146,7 +147,7 @@ sendfd_payload(const char *test, int soc static void sendfd(const char *test, int sockfd, int sendfd) { - char ch; + char ch = 0; return (sendfd_payload(test, sockfd, sendfd, &ch, sizeof(ch))); } @@ -199,7 +200,7 @@ recvfd_payload(const char *test, int soc static void recvfd(const char *test, int sockfd, int *recvfd) { - char ch; + char ch = 0; return (recvfd_payload(test, sockfd, recvfd, &ch, sizeof(ch))); } @@ -369,8 +370,8 @@ main(void) err(-1, "%s: sysctlbyname(net.local.stream.sendspace)", test); - if ((buf = malloc(sendspace)) == NULL) - err(-1, "%s: malloc", test); + if ((buf = calloc(1, sendspace)) == NULL) + err(-1, "%s: calloc", test); domainsocketpair(test, fd); if (setsockopt(fd[1], 0, LOCAL_CREDS, &on, sizeof(on)) < 0) @@ -384,6 +385,6 @@ main(void) } printf("%s passed\n", test); - + return (0); } From owner-svn-src-all@freebsd.org Mon Jan 4 07:27:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D473A60552; Mon, 4 Jan 2016 07:27:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DC851E38; Mon, 4 Jan 2016 07:27:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u047RwZi089368; Mon, 4 Jan 2016 07:27:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u047Rw78089367; Mon, 4 Jan 2016 07:27:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040727.u047Rw78089367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 07:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293146 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:27:59 -0000 Author: hselasky Date: Mon Jan 4 07:27:58 2016 New Revision: 293146 URL: https://svnweb.freebsd.org/changeset/base/293146 Log: MFC r291199: Fix compile warning about shifting signed negative constant. Modified: stable/10/sys/dev/usb/controller/uhci.h Modified: stable/10/sys/dev/usb/controller/uhci.h ============================================================================== --- stable/10/sys/dev/usb/controller/uhci.h Mon Jan 4 07:11:15 2016 (r293145) +++ stable/10/sys/dev/usb/controller/uhci.h Mon Jan 4 07:27:58 2016 (r293146) @@ -97,7 +97,7 @@ struct uhci_td { #define UHCI_TD_GET_ENDPT(s) (((s) >> 15) & 0xf) #define UHCI_TD_SET_DT(t) ((t) << 19) #define UHCI_TD_GET_DT(s) (((s) >> 19) & 1) -#define UHCI_TD_SET_MAXLEN(l) (((l)-1) << 21) +#define UHCI_TD_SET_MAXLEN(l) (((l)-1U) << 21) #define UHCI_TD_GET_MAXLEN(s) ((((s) >> 21) + 1) & 0x7ff) #define UHCI_TD_MAXLEN_MASK 0xffe00000 volatile uint32_t td_buffer; From owner-svn-src-all@freebsd.org Mon Jan 4 07:29:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0C09A605EE; Mon, 4 Jan 2016 07:29:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9072D1FAC; Mon, 4 Jan 2016 07:29:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u047TJow089472; Mon, 4 Jan 2016 07:29:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u047TJon089471; Mon, 4 Jan 2016 07:29:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040729.u047TJon089471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 07:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r293147 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:29:20 -0000 Author: hselasky Date: Mon Jan 4 07:29:19 2016 New Revision: 293147 URL: https://svnweb.freebsd.org/changeset/base/293147 Log: MFC r291199: Fix compile warning about shifting signed negative constant. Modified: stable/9/sys/dev/usb/controller/uhci.h Modified: stable/9/sys/dev/usb/controller/uhci.h ============================================================================== --- stable/9/sys/dev/usb/controller/uhci.h Mon Jan 4 07:27:58 2016 (r293146) +++ stable/9/sys/dev/usb/controller/uhci.h Mon Jan 4 07:29:19 2016 (r293147) @@ -97,7 +97,7 @@ struct uhci_td { #define UHCI_TD_GET_ENDPT(s) (((s) >> 15) & 0xf) #define UHCI_TD_SET_DT(t) ((t) << 19) #define UHCI_TD_GET_DT(s) (((s) >> 19) & 1) -#define UHCI_TD_SET_MAXLEN(l) (((l)-1) << 21) +#define UHCI_TD_SET_MAXLEN(l) (((l)-1U) << 21) #define UHCI_TD_GET_MAXLEN(s) ((((s) >> 21) + 1) & 0x7ff) #define UHCI_TD_MAXLEN_MASK 0xffe00000 volatile uint32_t td_buffer; From owner-svn-src-all@freebsd.org Mon Jan 4 07:30:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32FFA606BE; Mon, 4 Jan 2016 07:30:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A217A125E; Mon, 4 Jan 2016 07:30:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u047Ung8089585; Mon, 4 Jan 2016 07:30:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u047UnDS089584; Mon, 4 Jan 2016 07:30:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040730.u047UnDS089584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 07:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r293148 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:30:50 -0000 Author: hselasky Date: Mon Jan 4 07:30:49 2016 New Revision: 293148 URL: https://svnweb.freebsd.org/changeset/base/293148 Log: MFC r291199: Fix compile warning about shifting signed negative constant. Modified: stable/8/sys/dev/usb/controller/uhci.h Modified: stable/8/sys/dev/usb/controller/uhci.h ============================================================================== --- stable/8/sys/dev/usb/controller/uhci.h Mon Jan 4 07:29:19 2016 (r293147) +++ stable/8/sys/dev/usb/controller/uhci.h Mon Jan 4 07:30:49 2016 (r293148) @@ -97,7 +97,7 @@ struct uhci_td { #define UHCI_TD_GET_ENDPT(s) (((s) >> 15) & 0xf) #define UHCI_TD_SET_DT(t) ((t) << 19) #define UHCI_TD_GET_DT(s) (((s) >> 19) & 1) -#define UHCI_TD_SET_MAXLEN(l) (((l)-1) << 21) +#define UHCI_TD_SET_MAXLEN(l) (((l)-1U) << 21) #define UHCI_TD_GET_MAXLEN(s) ((((s) >> 21) + 1) & 0x7ff) #define UHCI_TD_MAXLEN_MASK 0xffe00000 volatile uint32_t td_buffer; From owner-svn-src-all@freebsd.org Mon Jan 4 08:39:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59241A6004A; Mon, 4 Jan 2016 08:39:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D0F81808; Mon, 4 Jan 2016 08:39:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u048dvT4009982; Mon, 4 Jan 2016 08:39:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u048dv5q009981; Mon, 4 Jan 2016 08:39:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040839.u048dv5q009981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 08:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r293149 - stable/9/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 08:39:58 -0000 Author: hselasky Date: Mon Jan 4 08:39:56 2016 New Revision: 293149 URL: https://svnweb.freebsd.org/changeset/base/293149 Log: Add missed mergeinfo. Modified: Directory Properties: stable/9/sys/ (props changed) From owner-svn-src-all@freebsd.org Mon Jan 4 08:41:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EA56A600E4; Mon, 4 Jan 2016 08:41:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43DA01A08; Mon, 4 Jan 2016 08:41:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u048fDga010094; Mon, 4 Jan 2016 08:41:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u048fDsg010093; Mon, 4 Jan 2016 08:41:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040841.u048fDsg010093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 08:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r293150 - stable/8/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 08:41:14 -0000 Author: hselasky Date: Mon Jan 4 08:41:13 2016 New Revision: 293150 URL: https://svnweb.freebsd.org/changeset/base/293150 Log: Add missed mergeinfo. Modified: Directory Properties: stable/8/sys/ (props changed) From owner-svn-src-all@freebsd.org Mon Jan 4 09:37:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88013A61B0E; Mon, 4 Jan 2016 09:37:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 509B119E7; Mon, 4 Jan 2016 09:37:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049b6Lt027115; Mon, 4 Jan 2016 09:37:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049b5hA027108; Mon, 4 Jan 2016 09:37:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040937.u049b5hA027108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293151 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:37:07 -0000 Author: hselasky Date: Mon Jan 4 09:37:05 2016 New Revision: 293151 URL: https://svnweb.freebsd.org/changeset/base/293151 Log: MFC r289563,r291481,r292537,r292538,r292542,r292543,r292544 and r292834: Update the LinuxKPI: - Add more functions and types. - Implement ACCESS_ONCE(), WRITE_ONCE() and READ_ONCE(). - Implement sleepable RCU mechanism using shared exclusive locks. - Minor workqueue cleanup: - Make some functions global instead of inline to ease debugging. - Fix some minor style issues. - In the zero delay case in queue_delayed_work() use the return value from taskqueue_enqueue() instead of reading "ta_pending" unlocked and also ensure the callout is stopped before proceeding. - Implement drain_workqueue() function. - Reduce memory consumption when allocating kobject strings in the LinuxKPI. Compute string length before allocating memory instead of using fixed size allocations. Make kobject_set_name_vargs() global instead of inline to save some bytes when compiling. Sponsored by: Mellanox Technologies Added: stable/10/sys/ofed/include/linux/srcu.h (contents, props changed) Modified: stable/10/sys/ofed/include/linux/compiler.h stable/10/sys/ofed/include/linux/file.h stable/10/sys/ofed/include/linux/kobject.h stable/10/sys/ofed/include/linux/linux_compat.c stable/10/sys/ofed/include/linux/types.h stable/10/sys/ofed/include/linux/workqueue.h Directory Properties: stable/10/ (props changed) stable/10/sys/gnu/dts/ (props changed) Modified: stable/10/sys/ofed/include/linux/compiler.h ============================================================================== --- stable/10/sys/ofed/include/linux/compiler.h Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/compiler.h Mon Jan 4 09:37:05 2016 (r293151) @@ -2,7 +2,8 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2015 François Tigeot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,5 +63,28 @@ #define typeof(x) __typeof(x) #define uninitialized_var(x) x = x +#define __read_mostly __attribute__((__section__(".data.read_mostly"))) +#define __always_unused __unused +#define __must_check __result_use_check + +#define __printf(a,b) __printflike(a,b) + +#define barrier() __asm__ __volatile__("": : :"memory") + +#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x)) + +#define WRITE_ONCE(x,v) do { \ + barrier(); \ + ACCESS_ONCE(x) = (v); \ + barrier(); \ +} while (0) + +#define READ_ONCE(x) ({ \ + __typeof(x) __var; \ + barrier(); \ + __var = ACCESS_ONCE(x); \ + barrier(); \ + __var; \ +}) #endif /* _LINUX_COMPILER_H_ */ Modified: stable/10/sys/ofed/include/linux/file.h ============================================================================== --- stable/10/sys/ofed/include/linux/file.h Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/file.h Mon Jan 4 09:37:05 2016 (r293151) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -119,6 +119,21 @@ get_unused_fd(void) return fd; } +static inline int +get_unused_fd_flags(int flags) +{ + struct file *file; + int error; + int fd; + + error = falloc(curthread, &file, &fd, flags); + if (error) + return -error; + /* drop the extra reference */ + fdrop(file, curthread); + return fd; +} + static inline struct linux_file * alloc_file(int mode, const struct file_operations *fops) { Modified: stable/10/sys/ofed/include/linux/kobject.h ============================================================================== --- stable/10/sys/ofed/include/linux/kobject.h Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/kobject.h Mon Jan 4 09:37:05 2016 (r293151) @@ -87,29 +87,7 @@ kobject_get(struct kobject *kobj) return kobj; } -static inline int -kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args) -{ - char *old; - char *name; - - old = kobj->name; - - if (old && !fmt) - return 0; - - name = kzalloc(MAXPATHLEN, GFP_KERNEL); - if (!name) - return -ENOMEM; - vsnprintf(name, MAXPATHLEN, fmt, args); - kobj->name = name; - kfree(old); - for (; *name != '\0'; name++) - if (*name == '/') - *name = '!'; - return (0); -} - +int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list); int kobject_add(struct kobject *kobj, struct kobject *parent, const char *fmt, ...); Modified: stable/10/sys/ofed/include/linux/linux_compat.c ============================================================================== --- stable/10/sys/ofed/include/linux/linux_compat.c Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/linux_compat.c Mon Jan 4 09:37:05 2016 (r293151) @@ -64,6 +64,8 @@ #include +#include + MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); #include @@ -90,7 +92,50 @@ panic_cmp(struct rb_node *one, struct rb } RB_GENERATE(linux_root, rb_node, __entry, panic_cmp); - + +int +kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args) +{ + va_list tmp_va; + int len; + char *old; + char *name; + char dummy; + + old = kobj->name; + + if (old && fmt == NULL) + return (0); + + /* compute length of string */ + va_copy(tmp_va, args); + len = vsnprintf(&dummy, 0, fmt, tmp_va); + va_end(tmp_va); + + /* account for zero termination */ + len++; + + /* check for error */ + if (len < 1) + return (-EINVAL); + + /* allocate memory for string */ + name = kzalloc(len, GFP_KERNEL); + if (name == NULL) + return (-ENOMEM); + vsnprintf(name, len, fmt, args); + kobj->name = name; + + /* free old string */ + kfree(old); + + /* filter new string */ + for (; *name != '\0'; name++) + if (*name == '/') + *name = '!'; + return (0); +} + int kobject_set_name(struct kobject *kobj, const char *fmt, ...) { @@ -882,6 +927,50 @@ linux_completion_done(struct completion return (isdone); } +void +linux_delayed_work_fn(void *arg) +{ + struct delayed_work *work; + + work = arg; + taskqueue_enqueue(work->work.taskqueue, &work->work.work_task); +} + +void +linux_work_fn(void *context, int pending) +{ + struct work_struct *work; + + work = context; + work->fn(work); +} + +void +linux_flush_fn(void *context, int pending) +{ +} + +struct workqueue_struct * +linux_create_workqueue_common(const char *name, int cpus) +{ + struct workqueue_struct *wq; + + wq = kmalloc(sizeof(*wq), M_WAITOK); + wq->taskqueue = taskqueue_create(name, M_WAITOK, + taskqueue_thread_enqueue, &wq->taskqueue); + atomic_set(&wq->draining, 0); + taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, "%s", name); + + return (wq); +} + +void +destroy_workqueue(struct workqueue_struct *wq) +{ + taskqueue_free(wq->taskqueue); + kfree(wq); +} + static void linux_compat_init(void *arg) { Added: stable/10/sys/ofed/include/linux/srcu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/ofed/include/linux/srcu.h Mon Jan 4 09:37:05 2016 (r293151) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2015 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _LINUX_SRCU_H_ +#define _LINUX_SRCU_H_ + +#include +#include +#include + +struct srcu_struct { + struct sx sx; +}; + +static inline int +init_srcu_struct(struct srcu_struct *srcu) +{ + sx_init(&srcu->sx, "SleepableRCU"); + return (0); +} + +static inline void +cleanup_srcu_struct(struct srcu_struct *srcu) +{ + sx_destroy(&srcu->sx); +} + +static inline int +srcu_read_lock(struct srcu_struct *srcu) +{ + sx_slock(&srcu->sx); + return (0); +} + +static inline void +srcu_read_unlock(struct srcu_struct *srcu, int key) +{ + sx_sunlock(&srcu->sx); +} + +static inline void +synchronize_srcu(struct srcu_struct *srcu) +{ + sx_xlock(&srcu->sx); + sx_xunlock(&srcu->sx); +} + +#endif /* _LINUX_SRCU_H_ */ Modified: stable/10/sys/ofed/include/linux/types.h ============================================================================== --- stable/10/sys/ofed/include/linux/types.h Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/types.h Mon Jan 4 09:37:05 2016 (r293151) @@ -36,8 +36,6 @@ #include #include -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) - #ifndef __bitwise__ #ifdef __CHECKER__ #define __bitwise__ __attribute__((bitwise)) Modified: stable/10/sys/ofed/include/linux/workqueue.h ============================================================================== --- stable/10/sys/ofed/include/linux/workqueue.h Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/workqueue.h Mon Jan 4 09:37:05 2016 (r293151) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,10 +34,13 @@ #include #include +#include + #include struct workqueue_struct { struct taskqueue *taskqueue; + atomic_t draining; }; struct work_struct { @@ -46,11 +49,19 @@ struct work_struct { void (*fn)(struct work_struct *); }; +typedef __typeof(((struct work_struct *)0)->fn) work_func_t; + struct delayed_work { struct work_struct work; struct callout timer; }; +extern void linux_work_fn(void *, int); +extern void linux_flush_fn(void *, int); +extern void linux_delayed_work_fn(void *); +extern struct workqueue_struct *linux_create_workqueue_common(const char *, int); +extern void destroy_workqueue(struct workqueue_struct *); + static inline struct delayed_work * to_delayed_work(struct work_struct *work) { @@ -58,21 +69,11 @@ to_delayed_work(struct work_struct *work return container_of(work, struct delayed_work, work); } - -static inline void -_work_fn(void *context, int pending) -{ - struct work_struct *work; - - work = context; - work->fn(work); -} - #define INIT_WORK(work, func) \ do { \ (work)->fn = (func); \ (work)->taskqueue = NULL; \ - TASK_INIT(&(work)->work_task, 0, _work_fn, (work)); \ + TASK_INIT(&(work)->work_task, 0, linux_work_fn, (work)); \ } while (0) #define INIT_DELAYED_WORK(_work, func) \ @@ -81,7 +82,7 @@ do { \ callout_init(&(_work)->timer, CALLOUT_MPSAFE); \ } while (0) -#define INIT_DEFERRABLE_WORK INIT_DELAYED_WORK +#define INIT_DEFERRABLE_WORK(...) INIT_DELAYED_WORK(__VA_ARGS__) #define schedule_work(work) \ do { \ @@ -91,20 +92,15 @@ do { \ #define flush_scheduled_work() flush_taskqueue(taskqueue_thread) -static inline int queue_work (struct workqueue_struct *q, struct work_struct *work) +static inline int +queue_work(struct workqueue_struct *wq, struct work_struct *work) { - (work)->taskqueue = (q)->taskqueue; - /* Return opposite val to align with Linux logic */ - return !taskqueue_enqueue((q)->taskqueue, &(work)->work_task); -} - -static inline void -_delayed_work_fn(void *arg) -{ - struct delayed_work *work; - - work = arg; - taskqueue_enqueue(work->work.taskqueue, &work->work.work_task); + work->taskqueue = wq->taskqueue; + /* Check for draining */ + if (atomic_read(&wq->draining) != 0) + return (!work->work_task.ta_pending); + /* Return opposite value to align with Linux logic */ + return (!taskqueue_enqueue(wq->taskqueue, &work->work_task)); } static inline int @@ -113,57 +109,44 @@ queue_delayed_work(struct workqueue_stru { int pending; - pending = work->work.work_task.ta_pending; work->work.taskqueue = wq->taskqueue; - if (delay != 0) - callout_reset(&work->timer, delay, _delayed_work_fn, work); - else - _delayed_work_fn((void *)work); - + if (atomic_read(&wq->draining) != 0) { + pending = work->work.work_task.ta_pending; + } else if (delay != 0) { + pending = work->work.work_task.ta_pending; + callout_reset(&work->timer, delay, linux_delayed_work_fn, work); + } else { + callout_stop(&work->timer); + pending = taskqueue_enqueue(work->work.taskqueue, + &work->work.work_task); + } return (!pending); } -static inline bool schedule_delayed_work(struct delayed_work *dwork, - unsigned long delay) -{ - struct workqueue_struct wq; - wq.taskqueue = taskqueue_thread; - return queue_delayed_work(&wq, dwork, delay); -} - -static inline struct workqueue_struct * -_create_workqueue_common(char *name, int cpus) +static inline bool +schedule_delayed_work(struct delayed_work *dwork, + unsigned long delay) { - struct workqueue_struct *wq; + struct workqueue_struct wq; - wq = kmalloc(sizeof(*wq), M_WAITOK); - wq->taskqueue = taskqueue_create((name), M_WAITOK, - taskqueue_thread_enqueue, &wq->taskqueue); - taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, "%s", name); - - return (wq); + wq.taskqueue = taskqueue_thread; + atomic_set(&wq.draining, 0); + return (queue_delayed_work(&wq, dwork, delay)); } - #define create_singlethread_workqueue(name) \ - _create_workqueue_common(name, 1) + linux_create_workqueue_common(name, 1) #define create_workqueue(name) \ - _create_workqueue_common(name, MAXCPU) + linux_create_workqueue_common(name, MAXCPU) -static inline void -destroy_workqueue(struct workqueue_struct *wq) -{ - taskqueue_free(wq->taskqueue); - kfree(wq); -} +#define alloc_ordered_workqueue(name, flags) \ + linux_create_workqueue_common(name, 1) -#define flush_workqueue(wq) flush_taskqueue((wq)->taskqueue) +#define alloc_workqueue(name, flags, max_active) \ + linux_create_workqueue_common(name, max_active) -static inline void -_flush_fn(void *context, int pending) -{ -} +#define flush_workqueue(wq) flush_taskqueue((wq)->taskqueue) static inline void flush_taskqueue(struct taskqueue *tq) @@ -171,12 +154,20 @@ flush_taskqueue(struct taskqueue *tq) struct task flushtask; PHOLD(curproc); - TASK_INIT(&flushtask, 0, _flush_fn, NULL); + TASK_INIT(&flushtask, 0, linux_flush_fn, NULL); taskqueue_enqueue(tq, &flushtask); taskqueue_drain(tq, &flushtask); PRELE(curproc); } +static inline void +drain_workqueue(struct workqueue_struct *wq) +{ + atomic_inc(&wq->draining); + flush_taskqueue(wq->taskqueue); + atomic_dec(&wq->draining); +} + static inline int cancel_work_sync(struct work_struct *work) { @@ -213,7 +204,7 @@ cancel_delayed_work_sync(struct delayed_ static inline bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork, - unsigned long delay) + unsigned long delay) { cancel_delayed_work(dwork); queue_delayed_work(wq, dwork, delay); From owner-svn-src-all@freebsd.org Mon Jan 4 09:38:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEA46A61BAC; Mon, 4 Jan 2016 09:38:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A73541B55; Mon, 4 Jan 2016 09:38:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049cXkR027210; Mon, 4 Jan 2016 09:38:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049cXws027209; Mon, 4 Jan 2016 09:38:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040938.u049cXws027209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293152 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:38:35 -0000 Author: hselasky Date: Mon Jan 4 09:38:33 2016 New Revision: 293152 URL: https://svnweb.freebsd.org/changeset/base/293152 Log: Add missed mergeinfo. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Mon Jan 4 09:47:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37193A61E33; Mon, 4 Jan 2016 09:47:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB00A1348; Mon, 4 Jan 2016 09:47:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049lKub030075; Mon, 4 Jan 2016 09:47:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049lKUk030074; Mon, 4 Jan 2016 09:47:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040947.u049lKUk030074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293153 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:47:22 -0000 Author: hselasky Date: Mon Jan 4 09:47:20 2016 New Revision: 293153 URL: https://svnweb.freebsd.org/changeset/base/293153 Log: MFC r292835: Make the eeprom dump function more readable and rename variables for better clarity. Submitted by: Daria Genzel Differential Revision: https://reviews.freebsd.org/D4551 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:38:33 2016 (r293152) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:47:20 2016 (r293153) @@ -319,34 +319,33 @@ mlx5e_get_eeprom(struct mlx5e_priv *priv static void mlx5e_print_eeprom(struct mlx5e_eeprom *eeprom) { - int i, j = 0; - int row = 0; + int row; + int index_in_row; + int byte_to_write = 0; + int line_length = 16; printf("\nOffset\t\tValues\n"); - printf("------\t\t------\n"); - while (row < eeprom->len) { - printf("0x%04x\t\t", row); - for (i = 0; i < 16; i++) { - printf("%02x ", ((u8 *)eeprom->data)[j]); - j++; - row++; + printf("------\t\t------"); + while (byte_to_write < eeprom->len) { + printf("\n0x%04X\t\t", byte_to_write); + for (index_in_row = 0; index_in_row < line_length; index_in_row++) { + printf("%02X ", ((u8 *)eeprom->data)[byte_to_write]); + byte_to_write++; } - printf("\n"); } if (eeprom->page_valid) { row = MLX5E_EEPROM_HIGH_PAGE_OFFSET; - printf("\nUpper Page 0x03\n"); + printf("\n\nUpper Page 0x03\n"); printf("\nOffset\t\tValues\n"); - printf("------\t\t------\n"); + printf("------\t\t------"); while (row < MLX5E_EEPROM_PAGE_LENGTH) { - printf("0x%04x\t\t", row); - for (i = 0; i < 16; i++) { - printf("%02x ", ((u8 *)eeprom->data)[j]); - j++; + printf("\n0x%04X\t\t", row); + for (index_in_row = 0; index_in_row < line_length; index_in_row++) { + printf("%02X ", ((u8 *)eeprom->data)[byte_to_write]); + byte_to_write++; row++; } - printf("\n"); } } } From owner-svn-src-all@freebsd.org Mon Jan 4 09:49:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 867B1A61ED8; Mon, 4 Jan 2016 09:49:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CAAC153F; Mon, 4 Jan 2016 09:49:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049nrNh030205; Mon, 4 Jan 2016 09:49:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049nrR9030204; Mon, 4 Jan 2016 09:49:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040949.u049nrR9030204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293154 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:49:54 -0000 Author: hselasky Date: Mon Jan 4 09:49:53 2016 New Revision: 293154 URL: https://svnweb.freebsd.org/changeset/base/293154 Log: MFC r292837: Add support for sysctl tunables to 10-stable and older. Pushed through head first to simplify driver maintenance. MFC after: 1 week Submitted by: Drew Gallatin Differential Revision: https://reviews.freebsd.org/D4552 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:47:20 2016 (r293153) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:49:53 2016 (r293154) @@ -58,13 +58,17 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG PRIV_LOCK(priv); value = priv->params_ethtool.arg[arg2]; - error = sysctl_handle_64(oidp, &value, 0, req); - if (error || req->newptr == NULL || - value == priv->params_ethtool.arg[arg2]) - goto done; + if (req != NULL) { + error = sysctl_handle_64(oidp, &value, 0, req); + if (error || req->newptr == NULL || + value == priv->params_ethtool.arg[arg2]) + goto done; - /* assign new value */ - priv->params_ethtool.arg[arg2] = value; + /* assign new value */ + priv->params_ethtool.arg[arg2] = value; + } else { + error = 0; + } /* check if device is gone */ if (priv->gone) { @@ -483,10 +487,30 @@ mlx5e_create_ethtool(struct mlx5e_priv * CTLFLAG_MPSAFE, priv, x, &mlx5e_ethtool_handler, "QU", mlx5e_params_desc[2 * x + 1]); } else { +#if (__FreeBSD_version < 1100000) + char path[64]; +#endif + /* + * NOTE: In FreeBSD-11 and newer the + * CTLFLAG_RWTUN flag will take care of + * loading default sysctl value from the + * kernel environment, if any: + */ SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, mlx5e_params_desc[2 * x], CTLTYPE_U64 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, priv, x, &mlx5e_ethtool_handler, "QU", mlx5e_params_desc[2 * x + 1]); + +#if (__FreeBSD_version < 1100000) + /* compute path for sysctl */ + snprintf(path, sizeof(path), "dev.mce.%d.conf.%s", + device_get_unit(priv->mdev->pdev->dev.bsddev), + mlx5e_params_desc[2 * x]); + + /* try to fetch tunable, if any */ + if (TUNABLE_QUAD_FETCH(path, &priv->params_ethtool.arg[x])) + mlx5e_ethtool_handler(NULL, priv, x, NULL); +#endif } } From owner-svn-src-all@freebsd.org Mon Jan 4 09:52:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 117A8A6004F; Mon, 4 Jan 2016 09:52:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA87519CA; Mon, 4 Jan 2016 09:52:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049qfpn032793; Mon, 4 Jan 2016 09:52:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049qe5Y032786; Mon, 4 Jan 2016 09:52:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040952.u049qe5Y032786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293155 - in stable/10/sys/dev/mlx5: . mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:52:42 -0000 Author: hselasky Date: Mon Jan 4 09:52:40 2016 New Revision: 293155 URL: https://svnweb.freebsd.org/changeset/base/293155 Log: MFC r292838: Add support for CQE zipping. CQE zipping reduces PCI overhead by coalescing and zipping multiple CQEs into a single merged CQE. The feature is enabled by default and can be disabled by a sysctl. Implementing this feature mlx5_cqwq_pop() has been separated from mlx5e_get_cqe(). Submitted by: Mark Bloch Differential Revision: https://reviews.freebsd.org/D4598 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/device.h stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/device.h ============================================================================== --- stable/10/sys/dev/mlx5/device.h Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/device.h Mon Jan 4 09:52:40 2016 (r293155) @@ -1042,6 +1042,7 @@ enum { MLX5_ESW_VPORT_ADMIN_STATE_UP = 0x1, MLX5_ESW_VPORT_ADMIN_STATE_AUTO = 0x2, }; + /* MLX5 DEV CAPs */ /* TODO: EAT.ME */ @@ -1219,4 +1220,36 @@ struct mlx5_ifc_mcia_reg_bits { }; #define MLX5_CMD_OP_QUERY_EEPROM 0x93c + +struct mlx5_mini_cqe8 { + union { + u32 rx_hash_result; + u32 checksum; + struct { + u16 wqe_counter; + u8 s_wqe_opcode; + u8 reserved; + } s_wqe_info; + }; + u32 byte_cnt; +}; + +enum { + MLX5_NO_INLINE_DATA, + MLX5_INLINE_DATA32_SEG, + MLX5_INLINE_DATA64_SEG, + MLX5_COMPRESSED, +}; + +enum mlx5_exp_cqe_zip_recv_type { + MLX5_CQE_FORMAT_HASH, + MLX5_CQE_FORMAT_CSUM, +}; + +#define MLX5E_CQE_FORMAT_MASK 0xc +static inline int mlx5_get_cqe_format(const struct mlx5_cqe64 *cqe) +{ + return (cqe->op_own & MLX5E_CQE_FORMAT_MASK) >> 2; +} + #endif /* MLX5_DEVICE_H */ Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:52:40 2016 (r293155) @@ -372,6 +372,7 @@ struct mlx5e_params { u16 tx_cq_moderation_pkts; u16 min_rx_wqes; bool hw_lro_en; + bool cqe_zipping_en; u32 lro_wqe_sz; u16 rx_hash_log_tbl_sz; }; @@ -392,7 +393,8 @@ struct mlx5e_params { m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ - m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") + m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ + m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:52:40 2016 (r293155) @@ -204,6 +204,18 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params.hw_lro_en = false; } + if (&priv->params_ethtool.arg[arg2] == + &priv->params_ethtool.cqe_zipping) { + if (priv->params_ethtool.cqe_zipping && + MLX5_CAP_GEN(priv->mdev, cqe_compression)) { + priv->params.cqe_zipping_en = true; + priv->params_ethtool.cqe_zipping = 1; + } else { + priv->params.cqe_zipping_en = false; + priv->params_ethtool.cqe_zipping = 0; + } + } + if (was_opened) mlx5e_open_locked(priv->ifp); done: @@ -472,6 +484,7 @@ mlx5e_create_ethtool(struct mlx5e_priv * priv->params_ethtool.tx_coalesce_usecs = priv->params.tx_cq_moderation_usec; priv->params_ethtool.tx_coalesce_pkts = priv->params.tx_cq_moderation_pkts; priv->params_ethtool.hw_lro = priv->params.hw_lro_en; + priv->params_ethtool.cqe_zipping = priv->params.cqe_zipping_en; /* create root node */ node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:52:40 2016 (r293155) @@ -1604,6 +1604,16 @@ mlx5e_build_rx_cq_param(struct mlx5e_pri { void *cqc = param->cqc; + + /* + * TODO The sysctl to control on/off is a bool value for now, which means + * we only support CSUM, once HASH is implemnted we'll need to address that. + */ + if (priv->params.cqe_zipping_en) { + MLX5_SET(cqc, cqc, mini_cqe_res_format, MLX5_CQE_FORMAT_CSUM); + MLX5_SET(cqc, cqc, cqe_compression_en, 1); + } + MLX5_SET(cqc, cqc, log_cq_size, priv->params.log_rq_size); MLX5_SET(cqc, cqc, cq_period, priv->params.rx_cq_moderation_usec); MLX5_SET(cqc, cqc, cq_max_count, priv->params.rx_cq_moderation_pkts); @@ -2571,6 +2581,8 @@ mlx5e_build_ifp_priv(struct mlx5_core_de priv->params.hw_lro_en = false; priv->params.lro_wqe_sz = MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ; + priv->params.cqe_zipping_en = !!MLX5_CAP_GEN(mdev, cqe_compression); + priv->mdev = mdev; priv->params.num_channels = num_comp_vectors; priv->order_base_2_num_channels = order_base_2(num_comp_vectors); Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Jan 4 09:52:40 2016 (r293155) @@ -248,6 +248,69 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *c } } +static inline void +mlx5e_read_cqe_slot(struct mlx5e_cq *cq, u32 cc, void *data) +{ + memcpy(data, mlx5_cqwq_get_wqe(&cq->wq, (cc & cq->wq.sz_m1)), + sizeof(struct mlx5_cqe64)); +} + +static inline void +mlx5e_write_cqe_slot(struct mlx5e_cq *cq, u32 cc, void *data) +{ + memcpy(mlx5_cqwq_get_wqe(&cq->wq, cc & cq->wq.sz_m1), + data, sizeof(struct mlx5_cqe64)); +} + +static inline void +mlx5e_decompress_cqe(struct mlx5e_cq *cq, struct mlx5_cqe64 *title, + struct mlx5_mini_cqe8 *mini, + u16 wqe_counter, int i) +{ + title->byte_cnt = mini->byte_cnt; + title->wqe_counter = cpu_to_be16((wqe_counter + i) & cq->wq.sz_m1); + title->check_sum = mini->checksum; + title->op_own = (title->op_own & 0xf0) | + (((cq->wq.cc + i) >> cq->wq.log_sz) & 1); +} + +#define MLX5E_MINI_ARRAY_SZ 8 +/* Make sure structs are not packet differently */ +CTASSERT(sizeof(struct mlx5_cqe64) == + sizeof(struct mlx5_mini_cqe8) * MLX5E_MINI_ARRAY_SZ); +static void +mlx5e_decompress_cqes(struct mlx5e_cq *cq) +{ + struct mlx5_mini_cqe8 mini_array[MLX5E_MINI_ARRAY_SZ]; + struct mlx5_cqe64 title; + u32 cqe_count; + u32 i = 0; + u16 title_wqe_counter; + + mlx5e_read_cqe_slot(cq, cq->wq.cc, &title); + title_wqe_counter = be16_to_cpu(title.wqe_counter); + cqe_count = be32_to_cpu(title.byte_cnt); + + /* Make sure we won't overflow */ + KASSERT(cqe_count <= cq->wq.sz_m1, + ("%s: cqe_count %u > cq->wq.sz_m1 %u", __func__, + cqe_count, cq->wq.sz_m1)); + + mlx5e_read_cqe_slot(cq, cq->wq.cc + 1, mini_array); + while (true) { + mlx5e_decompress_cqe(cq, &title, + &mini_array[i % MLX5E_MINI_ARRAY_SZ], + title_wqe_counter, i); + mlx5e_write_cqe_slot(cq, cq->wq.cc + i, &title); + i++; + + if (i == cqe_count) + break; + if (i % MLX5E_MINI_ARRAY_SZ == 0) + mlx5e_read_cqe_slot(cq, cq->wq.cc + i, mini_array); + } +} + static int mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) { @@ -268,6 +331,11 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, in if (!cqe) break; + if (mlx5_get_cqe_format(cqe) == MLX5_COMPRESSED) + mlx5e_decompress_cqes(&rq->cq); + + mlx5_cqwq_pop(&rq->cq.wq); + wqe_counter_be = cqe->wqe_counter; wqe_counter = be16_to_cpu(wqe_counter_be); wqe = mlx5_wq_ll_get_wqe(&rq->wq, wqe_counter); Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Jan 4 09:52:40 2016 (r293155) @@ -383,6 +383,8 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, in if (!cqe) break; + mlx5_cqwq_pop(&sq->cq.wq); + ci = sqcc & sq->wq.sz_m1; mb = sq->mbuf[ci].mbuf; sq->mbuf[ci].mbuf = NULL; /* Safety clear */ Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Mon Jan 4 09:52:40 2016 (r293155) @@ -37,8 +37,6 @@ mlx5e_get_cqe(struct mlx5e_cq *cq) if ((cqe->op_own ^ mlx5_cqwq_get_wrap_cnt(&cq->wq)) & MLX5_CQE_OWNER_MASK) return (NULL); - mlx5_cqwq_pop(&cq->wq); - /* ensure cqe content is read after cqe ownership bit */ rmb(); From owner-svn-src-all@freebsd.org Mon Jan 4 09:55:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8CF8A60181; Mon, 4 Jan 2016 09:55:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 869BF1C2A; Mon, 4 Jan 2016 09:55:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049tLv9033047; Mon, 4 Jan 2016 09:55:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049tLqx033045; Mon, 4 Jan 2016 09:55:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040955.u049tLqx033045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293156 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:55:22 -0000 Author: hselasky Date: Mon Jan 4 09:55:21 2016 New Revision: 293156 URL: https://svnweb.freebsd.org/changeset/base/293156 Log: MFC r292946: 10G ER/LR should present itself as LR. MFC after: 1 week Submitted by: Shahar Klein Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:52:40 2016 (r293155) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:55:21 2016 (r293156) @@ -700,7 +700,7 @@ enum mlx5e_link_mode { MLX5E_56GBASE_R4 = 8, MLX5E_10GBASE_CR = 12, MLX5E_10GBASE_SR = 13, - MLX5E_10GBASE_ER = 14, + MLX5E_10GBASE_LR = 14, MLX5E_40GBASE_SR4 = 15, MLX5E_40GBASE_LR4 = 16, MLX5E_100GBASE_CR4 = 20, Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:52:40 2016 (r293155) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:55:21 2016 (r293156) @@ -106,8 +106,8 @@ static const struct { .subtype = IFM_10G_SR, .baudrate = IF_Gbps(10ULL), }, - [MLX5E_10GBASE_ER] = { - .subtype = IFM_10G_ER, + [MLX5E_10GBASE_LR] = { + .subtype = IFM_10G_LR, .baudrate = IF_Gbps(10ULL), }, [MLX5E_40GBASE_SR4] = { From owner-svn-src-all@freebsd.org Mon Jan 4 09:56:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55345A60217; Mon, 4 Jan 2016 09:56:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C2B91D98; Mon, 4 Jan 2016 09:56:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049uwSd033146; Mon, 4 Jan 2016 09:56:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049uwwt033145; Mon, 4 Jan 2016 09:56:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040956.u049uwwt033145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293157 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:56:59 -0000 Author: hselasky Date: Mon Jan 4 09:56:57 2016 New Revision: 293157 URL: https://svnweb.freebsd.org/changeset/base/293157 Log: MFC r292948: Allow I2C to read address 0x51 as well as address 0x50. Submitted by: Shahar Klein Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:55:21 2016 (r293156) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:56:57 2016 (r293157) @@ -2298,6 +2298,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long co int size_read = 0; int module_num; int max_mtu; + uint8_t read_addr; priv = ifp->if_softc; @@ -2484,11 +2485,21 @@ out: } /* - * Note that we ignore i2c.addr here. The driver hardcodes - * the address to 0x50, while standard expects it to be 0xA0. + * Currently 0XA0 and 0xA2 are the only addresses permitted. + * The internal conversion is as follows: */ + if (i2c.dev_addr == 0xA0) + read_addr = MLX5E_I2C_ADDR_LOW; + else if (i2c.dev_addr == 0xA2) + read_addr = MLX5E_I2C_ADDR_HIGH; + else { + if_printf(ifp, "Query eeprom failed, " + "Invalid Address: %X\n", i2c.dev_addr); + error = EINVAL; + goto err_i2c; + } error = mlx5_query_eeprom(priv->mdev, - MLX5E_I2C_ADDR_LOW, MLX5E_EEPROM_LOW_PAGE, + read_addr, MLX5E_EEPROM_LOW_PAGE, (uint32_t)i2c.offset, (uint32_t)i2c.len, module_num, (uint32_t *)i2c.data, &size_read); if (error) { @@ -2499,7 +2510,7 @@ out: if (i2c.len > MLX5_EEPROM_MAX_BYTES) { error = mlx5_query_eeprom(priv->mdev, - MLX5E_I2C_ADDR_LOW, MLX5E_EEPROM_LOW_PAGE, + read_addr, MLX5E_EEPROM_LOW_PAGE, (uint32_t)(i2c.offset + size_read), (uint32_t)(i2c.len - size_read), module_num, (uint32_t *)(i2c.data + size_read), &size_read); From owner-svn-src-all@freebsd.org Mon Jan 4 09:58:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDA11A602C4; Mon, 4 Jan 2016 09:58:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F4031F2D; Mon, 4 Jan 2016 09:58:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049wG89033249; Mon, 4 Jan 2016 09:58:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049wGDq033246; Mon, 4 Jan 2016 09:58:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040958.u049wGDq033246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293158 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:58:17 -0000 Author: hselasky Date: Mon Jan 4 09:58:16 2016 New Revision: 293158 URL: https://svnweb.freebsd.org/changeset/base/293158 Log: MFC r292949: Add support for modifying coalescing parameters runtime. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:56:57 2016 (r293157) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:58:16 2016 (r293158) @@ -789,5 +789,6 @@ void mlx5e_create_stats(struct sysctl_ct struct sysctl_oid_list *, const char *, const char **, unsigned, u64 *); void mlx5e_send_nop(struct mlx5e_sq *, u32, bool); +int mlx5e_refresh_channel_params(struct mlx5e_priv *); #endif /* _MLX5_EN_H_ */ Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:56:57 2016 (r293157) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:58:16 2016 (r293158) @@ -69,12 +69,49 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG } else { error = 0; } - /* check if device is gone */ if (priv->gone) { error = ENXIO; goto done; } + /* import RX coal time */ + if (priv->params_ethtool.rx_coalesce_usecs < 1) + priv->params_ethtool.rx_coalesce_usecs = 0; + else if (priv->params_ethtool.rx_coalesce_usecs > + MLX5E_FLD_MAX(cqc, cq_period)) { + priv->params_ethtool.rx_coalesce_usecs = + MLX5E_FLD_MAX(cqc, cq_period); + } + priv->params.rx_cq_moderation_usec = priv->params_ethtool.rx_coalesce_usecs; + + /* import RX coal pkts */ + if (priv->params_ethtool.rx_coalesce_pkts < 1) + priv->params_ethtool.rx_coalesce_pkts = 0; + else if (priv->params_ethtool.rx_coalesce_pkts > + MLX5E_FLD_MAX(cqc, cq_max_count)) { + priv->params_ethtool.rx_coalesce_pkts = + MLX5E_FLD_MAX(cqc, cq_max_count); + } + priv->params.rx_cq_moderation_pkts = priv->params_ethtool.rx_coalesce_pkts; + + /* import TX coal time */ + if (priv->params_ethtool.tx_coalesce_usecs < 1) + priv->params_ethtool.tx_coalesce_usecs = 0; + else if (priv->params_ethtool.tx_coalesce_usecs > + MLX5E_FLD_MAX(cqc, cq_period)) { + priv->params_ethtool.tx_coalesce_usecs = + MLX5E_FLD_MAX(cqc, cq_period); + } + priv->params.tx_cq_moderation_usec = priv->params_ethtool.tx_coalesce_usecs; + + /* import TX coal pkts */ + if (priv->params_ethtool.tx_coalesce_pkts < 1) + priv->params_ethtool.tx_coalesce_pkts = 0; + else if (priv->params_ethtool.tx_coalesce_pkts > + MLX5E_FLD_MAX(cqc, cq_max_count)) { + priv->params_ethtool.tx_coalesce_pkts = MLX5E_FLD_MAX(cqc, cq_max_count); + } + priv->params.tx_cq_moderation_pkts = priv->params_ethtool.tx_coalesce_pkts; if (&priv->params_ethtool.arg[arg2] == &priv->params_ethtool.rx_pauseframe_control || &priv->params_ethtool.arg[arg2] == &priv->params_ethtool.tx_pauseframe_control) { @@ -92,9 +129,19 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG } was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); - if (was_opened) - mlx5e_close_locked(priv->ifp); + if (was_opened) { + u64 *xarg = priv->params_ethtool.arg + arg2; + if (xarg == &priv->params_ethtool.tx_coalesce_pkts || + xarg == &priv->params_ethtool.rx_coalesce_pkts || + xarg == &priv->params_ethtool.tx_coalesce_usecs || + xarg == &priv->params_ethtool.rx_coalesce_usecs) { + /* avoid downing and upping the network interface */ + error = mlx5e_refresh_channel_params(priv); + goto done; + } + mlx5e_close_locked(priv->ifp); + } /* import TX queue size */ if (priv->params_ethtool.tx_queue_size < (1 << MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)) { @@ -145,45 +192,6 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params_ethtool.tx_coalesce_mode = 1; priv->params.tx_cq_moderation_mode = priv->params_ethtool.tx_coalesce_mode; - /* import RX coal time */ - if (priv->params_ethtool.rx_coalesce_usecs < 1) - priv->params_ethtool.rx_coalesce_usecs = 0; - else if (priv->params_ethtool.rx_coalesce_usecs > - MLX5E_FLD_MAX(cqc, cq_period)) { - priv->params_ethtool.rx_coalesce_usecs = - MLX5E_FLD_MAX(cqc, cq_period); - } - priv->params.rx_cq_moderation_usec = priv->params_ethtool.rx_coalesce_usecs; - - /* import RX coal pkts */ - if (priv->params_ethtool.rx_coalesce_pkts < 1) - priv->params_ethtool.rx_coalesce_pkts = 0; - else if (priv->params_ethtool.rx_coalesce_pkts > - MLX5E_FLD_MAX(cqc, cq_max_count)) { - priv->params_ethtool.rx_coalesce_pkts = - MLX5E_FLD_MAX(cqc, cq_max_count); - } - priv->params.rx_cq_moderation_pkts = priv->params_ethtool.rx_coalesce_pkts; - - /* import TX coal time */ - if (priv->params_ethtool.tx_coalesce_usecs < 1) - priv->params_ethtool.tx_coalesce_usecs = 0; - else if (priv->params_ethtool.tx_coalesce_usecs > - MLX5E_FLD_MAX(cqc, cq_period)) { - priv->params_ethtool.tx_coalesce_usecs = - MLX5E_FLD_MAX(cqc, cq_period); - } - priv->params.tx_cq_moderation_usec = priv->params_ethtool.tx_coalesce_usecs; - - /* import TX coal pkts */ - if (priv->params_ethtool.tx_coalesce_pkts < 1) - priv->params_ethtool.tx_coalesce_pkts = 0; - else if (priv->params_ethtool.tx_coalesce_pkts > - MLX5E_FLD_MAX(cqc, cq_max_count)) { - priv->params_ethtool.tx_coalesce_pkts = MLX5E_FLD_MAX(cqc, cq_max_count); - } - priv->params.tx_cq_moderation_pkts = priv->params_ethtool.tx_coalesce_pkts; - /* we always agree to turn off HW LRO - but not always to turn on */ if (priv->params_ethtool.hw_lro) { if (priv->params_ethtool.hw_lro != 1) { Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:56:57 2016 (r293157) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:58:16 2016 (r293158) @@ -1712,6 +1712,62 @@ mlx5e_close_channels(struct mlx5e_priv * } static int +mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struct mlx5e_sq *sq) +{ + return (mlx5_core_modify_cq_moderation(priv->mdev, &sq->cq.mcq, + priv->params.tx_cq_moderation_usec, + priv->params.tx_cq_moderation_pkts)); +} + +static int +mlx5e_refresh_rq_params(struct mlx5e_priv *priv, struct mlx5e_rq *rq) +{ + return (mlx5_core_modify_cq_moderation(priv->mdev, &rq->cq.mcq, + priv->params.rx_cq_moderation_usec, + priv->params.rx_cq_moderation_pkts)); +} + +static int +mlx5e_refresh_channel_params_sub(struct mlx5e_priv *priv, struct mlx5e_channel *c) +{ + int err; + int i; + + if (c == NULL) + return (EINVAL); + + err = mlx5e_refresh_rq_params(priv, &c->rq); + if (err) + goto done; + + for (i = 0; i != c->num_tc; i++) { + err = mlx5e_refresh_sq_params(priv, &c->sq[i]); + if (err) + goto done; + } +done: + return (err); +} + +int +mlx5e_refresh_channel_params(struct mlx5e_priv *priv) +{ + int i; + + if (priv->channel == NULL) + return (EINVAL); + + for (i = 0; i < priv->params.num_channels; i++) { + int err; + + err = mlx5e_refresh_channel_params_sub(priv, priv->channel[i]); + if (err) + return (err); + } + return (0); +} + +static int mlx5e_open_tis(struct mlx5e_priv *priv, int tc) { struct mlx5_core_dev *mdev = priv->mdev; From owner-svn-src-all@freebsd.org Mon Jan 4 13:49:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51BF8A61AA0 for ; Mon, 4 Jan 2016 13:49:43 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18AA91CBD; Mon, 4 Jan 2016 13:49:42 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from [78.35.179.142] (helo=fabiankeil.de) by smtprelay01.ispgateway.de with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1aG5Vt-0005i9-O4; Mon, 04 Jan 2016 14:49:33 +0100 Date: Mon, 4 Jan 2016 14:48:16 +0100 From: Fabian Keil To: Ed Maste Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r292997 - head/sys/conf Message-ID: <20160104144816.6435453e@fabiankeil.de> In-Reply-To: <201512311925.tBVJPZAt019721@repo.freebsd.org> References: <201512311925.tBVJPZAt019721@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/=xkDMhVSZv/lwQznXiwA.aX"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 13:49:43 -0000 --Sig_/=xkDMhVSZv/lwQznXiwA.aX Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Ed Maste wrote: > Author: emaste > Date: Thu Dec 31 19:25:35 2015 > New Revision: 292997 > URL: https://svnweb.freebsd.org/changeset/base/292997 >=20 > Log: > newvers.sh: put variable assignments on separate lines > =20 > This makes it easier to grep for where they're set, and may simplify > future merging for FreeBSD derivatives that change these. Thanks. Fabian --Sig_/=xkDMhVSZv/lwQznXiwA.aX Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlaKeCAACgkQBYqIVf93VJ34XwCgsGa6TpZ2XS6sGHTnZjtnW9M+ zGEAn2BrsuiBek3qPqdMhGQxIqOzeK2f =R04z -----END PGP SIGNATURE----- --Sig_/=xkDMhVSZv/lwQznXiwA.aX-- From owner-svn-src-all@freebsd.org Mon Jan 4 13:49:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E32E5A61ACF for ; Mon, 4 Jan 2016 13:49:59 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9BBE1D01; Mon, 4 Jan 2016 13:49:59 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from [78.35.179.142] (helo=fabiankeil.de) by smtprelay01.ispgateway.de with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1aG5Vq-0005i9-E0; Mon, 04 Jan 2016 14:49:30 +0100 Date: Mon, 4 Jan 2016 14:48:04 +0100 From: Fabian Keil To: Adrian Chadd Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r293009 - head/sys/contrib/dev/rtwn Message-ID: <20160104144804.5dc0a83a@fabiankeil.de> In-Reply-To: <201512312231.tBVMVh8K075724@repo.freebsd.org> References: <201512312231.tBVMVh8K075724@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/qdAe7Vp8N9/4o.bB_Qh1nbB"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 13:50:00 -0000 --Sig_/qdAe7Vp8N9/4o.bB_Qh1nbB Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Adrian Chadd wrote: > Author: adrian > Date: Thu Dec 31 22:31:43 2015 > New Revision: 293009 > URL: https://svnweb.freebsd.org/changeset/base/293009 >=20 > Log: > [rtwn] add rtwn firmware. When adding proprietary software to the kernel, please make sure that the relevant WITHOUT_SOURCELESS_* variable is respected: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205874 See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204748 and (not your department): https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204747 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204749 > Added: head/sys/contrib/dev/rtwn/LICENSE > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/contrib/dev/rtwn/LICENSE Thu Dec 31 22:31:43 2015 (r293009) > @@ -0,0 +1,39 @@ > +Copyright (c) 2010, Realtek Semiconductor Corporation=20 > +All rights reserved. [...] > +Limited patent license. Realtek Semiconductor Corporation grants a world= -wide,=20 > +royalty-free, non-exclusive license under patents it now or hereafter=20 > +owns or controls to make, have made, use, import, offer to sell and=20 > +sell ("Utilize") this software, but solely to the extent that any=20 > +such patent is necessary to Utilize the software alone, or in=20 > +combination with an operating system licensed under an approved Open=20 > +Source license as listed by the Open Source Initiative at=20 > +http://opensource.org/licenses. The patent license shall not apply to=20 > +any other combinations which include this software. No hardware per=20 > +se is licensed hereunder. Unfortunately FreeBSD is no "operating system licensed under an approved Open Source license as listed by the Open Source Initiative at http://opensource.org/licenses" ... I'm aware that this is not the first ineffective patent license in the tree, though. Fabian --Sig_/qdAe7Vp8N9/4o.bB_Qh1nbB Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlaKeBUACgkQBYqIVf93VJ3ItQCghj3qNCh+udq2Pewn/3Y6UpI1 2zMAn3rSg9nIffkAK/lbrkpWqaQJd78j =IQ54 -----END PGP SIGNATURE----- --Sig_/qdAe7Vp8N9/4o.bB_Qh1nbB-- From owner-svn-src-all@freebsd.org Mon Jan 4 14:47:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2362A600A2 for ; Mon, 4 Jan 2016 14:47:43 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: from vfemail.net (onethreetwo.vfemail.net [199.16.11.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 726411E57 for ; Mon, 4 Jan 2016 14:47:43 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: (qmail 67939 invoked by uid 89); 4 Jan 2016 14:46:12 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 4 Jan 2016 14:46:09 -0000 Received: (qmail 75283 invoked by uid 89); 4 Jan 2016 08:44:58 -0000 Received: by simscan 1.3.1 ppid: 75275, pid: 75280, t: 0.0037s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 4 Jan 2016 08:44:57 -0000 Received: (qmail 28155 invoked by uid 89); 4 Jan 2016 08:44:57 -0000 Received: by simscan 1.4.0 ppid: 28140, pid: 28152, t: 0.4530s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by mail.vfemail.net with ESMTPA; 4 Jan 2016 08:44:57 -0000 From: Jan Beich To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293115 - head/etc References: <201601031918.u03JImBs012182@repo.freebsd.org> Date: Mon, 04 Jan 2016 09:44:28 +0100 In-Reply-To: <201601031918.u03JImBs012182@repo.freebsd.org> (Warner Losh's message of "Sun, 3 Jan 2016 19:18:48 +0000 (UTC)") Message-ID: <7fjp-lonn-wny@vfemail.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 14:47:43 -0000 --=-=-= Content-Type: text/plain Warner Losh writes: > Author: imp > Date: Sun Jan 3 19:18:48 2016 > New Revision: 293115 > URL: https://svnweb.freebsd.org/changeset/base/293115 > > Log: > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > up and can cause issues on boot with the prompts. Why do you have ~/.profile stuff leaking into rc* boot sequence? And maybe use |command| instead. $ alias rm=foo /bin/rm=foo $ rm sh: foo: not found $ /bin/rm sh: foo: not found $ command rm usage: rm [-f | -i] [-dIPRrvWx] file ... unlink file ~/.profile may also contain syntax allowed by bash e.g., $ rm() { bar; }; /bin/rm() { bar; } $ rm bash: bar: command not found $ /bin/rm bash: bar: command not found $ command rm rm: missing operand Try 'rm --help' for more information. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJWijDtXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bB20IAJgh8Lp7nqvutDUmojFxjY9+ 6VQQAUbsWTGllsT0yMAst6Q3xZEVq9t5nSmSsdlrcYNRPb9jdASprK3Iwtx623O4 d2MBFKPQD+El0Rb1KTPXKpkJeI/fh4U+/bgtvsBzqs3qyccX2MaqfYZhkKwijgul gMGORHtjrfj0hhsVI0AyXYwBKjOMwOZ+LeeRrjiXyWNhDZXrBNTJ2gISScoww3TH NHoktzBfGPJWz25OJeqbMylECq3rdNjGiKXAS3f2pzRukVaTCO1/qnRssm/AsBed ulDKdMJqiFYRRwPazhcjsMXDSFhdP2FXBbNC/APTG2d0SMA0xgiesp01XO91E+w= =vGlv -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-all@freebsd.org Mon Jan 4 14:56:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 061B6A606C0; Mon, 4 Jan 2016 14:56:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB22C13DF; Mon, 4 Jan 2016 14:56:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 61A49B979; Mon, 4 Jan 2016 09:56:54 -0500 (EST) From: John Baldwin To: Garrett Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293112 - head/sys/dev/ixl Date: Sun, 03 Jan 2016 14:23:05 -0800 Message-ID: <1740114.0GzEsp8E6P@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201601031809.u03I9lNJ091471@repo.freebsd.org> References: <201601031809.u03I9lNJ091471@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Jan 2016 09:56:54 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 14:56:56 -0000 On Sunday, January 03, 2016 06:09:47 PM Garrett Cooper wrote: > Author: ngie > Date: Sun Jan 3 18:09:46 2016 > New Revision: 293112 > URL: https://svnweb.freebsd.org/changeset/base/293112 > > Log: > Fix ixl(4) compilation with PCI_IOV pre-r266974 > > stable/10 doesn't have the if_getdrvflags(9) KPI. Reference the field in the > structure directly if the __FreeBSD_version is < 1100022, so the driver can > be built with PCI_IOV support on stable/10, without backporting all of > r266974 (which requires additional changes due to projects/ifnet, etc) > > Differential Revision: https://reviews.freebsd.org/D4759 > Reviewed by: erj, sbruno > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/dev/ixl/if_ixl.c > > Modified: head/sys/dev/ixl/if_ixl.c > ============================================================================== > --- head/sys/dev/ixl/if_ixl.c Sun Jan 3 17:58:11 2016 (r293111) > +++ head/sys/dev/ixl/if_ixl.c Sun Jan 3 18:09:46 2016 (r293112) > @@ -6606,7 +6606,11 @@ ixl_iov_uninit(device_t dev) > pf->veb_seid = 0; > } > > +#if __FreeBSD_version > 1100022 > if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) > +#else > + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > +#endif > ixl_disable_intr(vsi); FWIW, it is probably simpler to do something like this in an ixl header instead: #if __FreeBSD_version <= 1100022 #define if_getdrvflags(ifp) (ifp)->if_drv_flags #endif In the past when the Intel drivers have used compat shims they have preferred this method (defining compat macros for "new" APIs on old OS versions) instead of using #ifdef's in the code itself. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jan 4 15:03:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCA0EA60BC6; Mon, 4 Jan 2016 15:03:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87E261B0F; Mon, 4 Jan 2016 15:03:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04F3LxS031320; Mon, 4 Jan 2016 15:03:21 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04F3Lps031314; Mon, 4 Jan 2016 15:03:21 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601041503.u04F3Lps031314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 Jan 2016 15:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293159 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 15:03:22 -0000 Author: melifaro Date: Mon Jan 4 15:03:20 2016 New Revision: 293159 URL: https://svnweb.freebsd.org/changeset/base/293159 Log: Add rib_lookup_info() to provide API for retrieving individual route entries data in unified format. There are control plane functions that require information other than just next-hop data (e.g. individual rtentry fields like flags or prefix/mask). Given that the goal is to avoid rte reference/refcounting, re-use rt_addrinfo structure to store most rte fields. If caller wants to retrieve key/mask or gateway (which are sockaddrs and are allocated separately), it needs to provide sufficient-sized sockaddrs structures w/ ther pointers saved in passed rt_addrinfo. Convert: * lltable new records checks (in_lltable_rtcheck(), nd6_is_new_addr_neighbor(). * rtsock pre-add/change route check. * IPv6 NS ND-proxy check (RADIX_MPATH code was eliminated because 1) we don't support RTF_ANNOUNCE ND-proxy for networks and there should not be multiple host routes for such hosts 2) if we have multiple routes we should inspect them (which is not done). 3) the entire idea of abusing KRT as storage for ND proxy seems odd. Userland programs should be used for that purpose). Modified: head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/netinet/in.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/net/route.c Mon Jan 4 15:03:20 2016 (r293159) @@ -147,6 +147,8 @@ static void rt_notifydelete(struct rtent static struct radix_node *rt_mpath_unlink(struct radix_node_head *rnh, struct rt_addrinfo *info, struct rtentry *rto, int *perror); #endif +static int rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, + int flags); struct if_mtuinfo { @@ -832,6 +834,147 @@ rtrequest_fib(int req, /* + * Copy most of @rt data into @info. + * + * If @flags contains NHR_COPY, copies dst,netmask and gw to the + * pointers specified by @info structure. Assume such pointers + * are zeroed sockaddr-like structures with sa_len field initialized + * to reflect size of the provided buffer. if no NHR_COPY is specified, + * point dst,netmask and gw @info fields to appropriate @rt values. + * + * if @flags contains NHR_REF, do refcouting on rt_ifp. + * + * Returns 0 on success. + */ +int +rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, int flags) +{ + struct rt_metrics *rmx; + struct sockaddr *src, *dst; + int sa_len; + + if (flags & NHR_COPY) { + /* Copy destination if dst is non-zero */ + src = rt_key(rt); + dst = info->rti_info[RTAX_DST]; + sa_len = src->sa_len; + if (src != NULL && dst != NULL) { + if (src->sa_len > dst->sa_len) + return (ENOMEM); + memcpy(dst, src, src->sa_len); + info->rti_addrs |= RTA_DST; + } + + /* Copy mask if set && dst is non-zero */ + src = rt_mask(rt); + dst = info->rti_info[RTAX_NETMASK]; + if (src != NULL && dst != NULL) { + + /* + * Radix stores different value in sa_len, + * assume rt_mask() to have the same length + * as rt_key() + */ + if (sa_len > dst->sa_len) + return (ENOMEM); + memcpy(dst, src, src->sa_len); + info->rti_addrs |= RTA_NETMASK; + } + + /* Copy gateway is set && dst is non-zero */ + src = rt->rt_gateway; + dst = info->rti_info[RTAX_GATEWAY]; + if ((rt->rt_flags & RTF_GATEWAY) && src != NULL && dst != NULL){ + if (src->sa_len > dst->sa_len) + return (ENOMEM); + memcpy(dst, src, src->sa_len); + info->rti_addrs |= RTA_GATEWAY; + } + } else { + info->rti_info[RTAX_DST] = rt_key(rt); + info->rti_addrs |= RTA_DST; + if (rt_mask(rt) != NULL) { + info->rti_info[RTAX_NETMASK] = rt_mask(rt); + info->rti_addrs |= RTA_NETMASK; + } + if (rt->rt_flags & RTF_GATEWAY) { + info->rti_info[RTAX_GATEWAY] = rt->rt_gateway; + info->rti_addrs |= RTA_GATEWAY; + } + } + + rmx = info->rti_rmx; + if (rmx != NULL) { + info->rti_mflags |= RTV_MTU; + rmx->rmx_mtu = rt->rt_mtu; + } + + info->rti_flags = rt->rt_flags; + info->rti_ifp = rt->rt_ifp; + info->rti_ifa = rt->rt_ifa; + + if (flags & NHR_REF) { + /* Do 'traditional' refcouting */ + if_ref(info->rti_ifp); + } + + return (0); +} + +/* + * Lookups up route entry for @dst in RIB database for fib @fibnum. + * Exports entry data to @info using rt_exportinfo(). + * + * if @flags contains NHR_REF, refcouting is performed on rt_ifp. + * All references can be released later by calling rib_free_info() + * + * Returns 0 on success. + * Returns ENOENT for lookup failure, ENOMEM for export failure. + */ +int +rib_lookup_info(uint32_t fibnum, const struct sockaddr *dst, uint32_t flags, + uint32_t flowid, struct rt_addrinfo *info) +{ + struct radix_node_head *rh; + struct radix_node *rn; + struct rtentry *rt; + int error; + + KASSERT((fibnum < rt_numfibs), ("rib_lookup_rte: bad fibnum")); + rh = rt_tables_get_rnh(fibnum, dst->sa_family); + if (rh == NULL) + return (ENOENT); + + RADIX_NODE_HEAD_RLOCK(rh); + rn = rh->rnh_matchaddr(__DECONST(void *, dst), rh); + if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { + rt = RNTORT(rn); + /* Ensure route & ifp is UP */ + if (RT_LINK_IS_UP(rt->rt_ifp)) { + flags = (flags & NHR_REF) | NHR_COPY; + error = rt_exportinfo(rt, info, flags); + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (error); + } + } + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (ENOENT); +} + +/* + * Releases all references acquired by rib_lookup_info() when + * called with NHR_REF flags. + */ +void +rib_free_info(struct rt_addrinfo *info) +{ + + if_rele(info->rti_ifp); +} + +/* * Iterates over all existing fibs in system calling * @setwa_f function prior to traversing each fib. * Calls @wa_f function for each element in current fib. Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/net/route.h Mon Jan 4 15:03:20 2016 (r293159) @@ -197,6 +197,9 @@ struct rtentry { #define NHR_IFAIF 0x01 /* Return ifa_ifp interface */ #define NHR_REF 0x02 /* For future use */ +/* Control plane route request flags */ +#define NHR_COPY 0x100 /* Copy rte data */ + /* rte<>nhop translation */ static inline uint16_t fib_rte_to_nh_flags(int rt_flags) @@ -460,6 +463,9 @@ void rtredirect_fib(struct sockaddr *, int rtrequest_fib(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int); +int rib_lookup_info(uint32_t, const struct sockaddr *, uint32_t, uint32_t, + struct rt_addrinfo *); +void rib_free_info(struct rt_addrinfo *info); #include typedef void (*rtevent_redirect_fn)(void *, struct rtentry *, struct rtentry *, struct sockaddr *); Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/net/rtsock.c Mon Jan 4 15:03:20 2016 (r293159) @@ -614,11 +614,16 @@ route_output(struct mbuf *m, struct sock */ if (info.rti_info[RTAX_GATEWAY] != NULL && info.rti_info[RTAX_GATEWAY]->sa_family != AF_LINK) { - struct route gw_ro; + struct rt_addrinfo ginfo; + struct sockaddr *gdst; + + bzero(&ginfo, sizeof(ginfo)); + bzero(&ss, sizeof(ss)); + ss.ss_len = sizeof(ss); + + ginfo.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&ss; + gdst = info.rti_info[RTAX_GATEWAY]; - bzero(&gw_ro, sizeof(gw_ro)); - gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY]; - rtalloc_ign_fib(&gw_ro, 0, fibnum); /* * A host route through the loopback interface is * installed for each interface adddress. In pre 8.0 @@ -629,14 +634,14 @@ route_output(struct mbuf *m, struct sock * AF_LINK sa_family type of the rt_gateway, and the * rt_ifp has the IFF_LOOPBACK flag set. */ - if (gw_ro.ro_rt != NULL && - gw_ro.ro_rt->rt_gateway->sa_family == AF_LINK && - gw_ro.ro_rt->rt_ifp->if_flags & IFF_LOOPBACK) { - info.rti_flags &= ~RTF_GATEWAY; - info.rti_flags |= RTF_GWFLAG_COMPAT; + if (rib_lookup_info(fibnum, gdst, NHR_REF, 0, &ginfo) == 0) { + if (ss.ss_family == AF_LINK && + ginfo.rti_ifp->if_flags & IFF_LOOPBACK) { + info.rti_flags &= ~RTF_GATEWAY; + info.rti_flags |= RTF_GWFLAG_COMPAT; + } + rib_free_info(&ginfo); } - if (gw_ro.ro_rt != NULL) - RTFREE(gw_ro.ro_rt); } switch (rtm->rtm_type) { Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/netinet/in.c Mon Jan 4 15:03:20 2016 (r293159) @@ -1106,34 +1106,48 @@ in_lltable_free_entry(struct lltable *ll static int in_lltable_rtcheck(struct ifnet *ifp, u_int flags, const struct sockaddr *l3addr) { - struct rtentry *rt; + struct rt_addrinfo info; + struct sockaddr_in rt_key, rt_mask; + struct sockaddr rt_gateway; + int rt_flags; KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - /* XXX rtalloc1_fib should take a const param */ - rt = rtalloc1_fib(__DECONST(struct sockaddr *, l3addr), 0, 0, - ifp->if_fib); + bzero(&rt_key, sizeof(rt_key)); + rt_key.sin_len = sizeof(rt_key); + bzero(&rt_mask, sizeof(rt_mask)); + rt_mask.sin_len = sizeof(rt_mask); + bzero(&rt_gateway, sizeof(rt_gateway)); + rt_gateway.sa_len = sizeof(rt_gateway); + + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = (struct sockaddr *)&rt_key; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&rt_mask; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&rt_gateway; - if (rt == NULL) + if (rib_lookup_info(ifp->if_fib, l3addr, NHR_REF, 0, &info) != 0) return (EINVAL); + rt_flags = info.rti_flags; + /* * If the gateway for an existing host route matches the target L3 * address, which is a special route inserted by some implementation * such as MANET, and the interface is of the correct type, then * allow for ARP to proceed. */ - if (rt->rt_flags & RTF_GATEWAY) { - if (!(rt->rt_flags & RTF_HOST) || !rt->rt_ifp || - rt->rt_ifp->if_type != IFT_ETHER || - (rt->rt_ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) != 0 || - memcmp(rt->rt_gateway->sa_data, l3addr->sa_data, + if (rt_flags & RTF_GATEWAY) { + if (!(rt_flags & RTF_HOST) || !info.rti_ifp || + info.rti_ifp->if_type != IFT_ETHER || + (info.rti_ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) != 0 || + memcmp(rt_gateway.sa_data, l3addr->sa_data, sizeof(in_addr_t)) != 0) { - RTFREE_LOCKED(rt); + rib_free_info(&info); return (EINVAL); } } + rib_free_info(&info); /* * Make sure that at least the destination address is covered @@ -1142,21 +1156,19 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ * on one interface and the corresponding outgoing packet leaves * another interface. */ - if (!(rt->rt_flags & RTF_HOST) && rt->rt_ifp != ifp) { + if (!(rt_flags & RTF_HOST) && info.rti_ifp != ifp) { const char *sa, *mask, *addr, *lim; int len; - mask = (const char *)rt_mask(rt); + mask = (const char *)&rt_mask; /* * Just being extra cautious to avoid some custom * code getting into trouble. */ - if (mask == NULL) { - RTFREE_LOCKED(rt); + if ((info.rti_addrs & RTA_NETMASK) == 0) return (EINVAL); - } - sa = (const char *)rt_key(rt); + sa = (const char *)&rt_key; addr = (const char *)l3addr; len = ((const struct sockaddr_in *)l3addr)->sin_len; lim = addr + len; @@ -1167,13 +1179,11 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); #endif - RTFREE_LOCKED(rt); return (EINVAL); } } } - RTFREE_LOCKED(rt); return (0); } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/netinet6/nd6.c Mon Jan 4 15:03:20 2016 (r293159) @@ -1210,6 +1210,10 @@ nd6_is_new_addr_neighbor(const struct so { struct nd_prefix *pr; struct ifaddr *dstaddr; + struct rt_addrinfo info; + struct sockaddr_in6 rt_key; + struct sockaddr *dst6; + int fibnum; /* * A link-local address is always a neighbor. @@ -1234,6 +1238,13 @@ nd6_is_new_addr_neighbor(const struct so return (0); } + bzero(&rt_key, sizeof(rt_key)); + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = (struct sockaddr *)&rt_key; + + /* Always use the default FIB here. XXME - why? */ + fibnum = RT_DEFAULT_FIB; + /* * If the address matches one of our addresses, * it should be a neighbor. @@ -1245,12 +1256,13 @@ nd6_is_new_addr_neighbor(const struct so continue; if (!(pr->ndpr_stateflags & NDPRF_ONLINK)) { - struct rtentry *rt; /* Always use the default FIB here. */ - rt = in6_rtalloc1((struct sockaddr *)&pr->ndpr_prefix, - 0, 0, RT_DEFAULT_FIB); - if (rt == NULL) + dst6 = (struct sockaddr *)&pr->ndpr_prefix; + + /* Restore length field before retrying lookup */ + rt_key.sin6_len = sizeof(rt_key); + if (rib_lookup_info(fibnum, dst6, 0, 0, &info) != 0) continue; /* * This is the case where multiple interfaces @@ -1263,11 +1275,8 @@ nd6_is_new_addr_neighbor(const struct so * differ. */ if (!IN6_ARE_ADDR_EQUAL(&pr->ndpr_prefix.sin6_addr, - &((struct sockaddr_in6 *)rt_key(rt))->sin6_addr)) { - RTFREE_LOCKED(rt); + &rt_key.sin6_addr)) continue; - } - RTFREE_LOCKED(rt); } if (IN6_ARE_MASKED_ADDR_EQUAL(&pr->ndpr_prefix.sin6_addr, Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/netinet6/nd6_nbr.c Mon Jan 4 15:03:20 2016 (r293159) @@ -248,37 +248,35 @@ nd6_ns_input(struct mbuf *m, int off, in /* (2) check. */ if (ifa == NULL) { - struct route_in6 ro; - int need_proxy; - - bzero(&ro, sizeof(ro)); - ro.ro_dst.sin6_len = sizeof(struct sockaddr_in6); - ro.ro_dst.sin6_family = AF_INET6; - ro.ro_dst.sin6_addr = taddr6; + struct sockaddr_dl rt_gateway; + struct rt_addrinfo info; + struct sockaddr_in6 dst6; + + bzero(&dst6, sizeof(dst6)); + dst6.sin6_len = sizeof(struct sockaddr_in6); + dst6.sin6_family = AF_INET6; + dst6.sin6_addr = taddr6; + + bzero(&rt_gateway, sizeof(rt_gateway)); + rt_gateway.sdl_len = sizeof(rt_gateway); + bzero(&info, sizeof(info)); + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&rt_gateway; /* Always use the default FIB. */ -#ifdef RADIX_MPATH - rtalloc_mpath_fib((struct route *)&ro, ntohl(taddr6.s6_addr32[3]), - RT_DEFAULT_FIB); -#else - in6_rtalloc(&ro, RT_DEFAULT_FIB); -#endif - need_proxy = (ro.ro_rt && - (ro.ro_rt->rt_flags & RTF_ANNOUNCE) != 0 && - ro.ro_rt->rt_gateway->sa_family == AF_LINK); - if (ro.ro_rt != NULL) { - if (need_proxy) - proxydl = *SDL(ro.ro_rt->rt_gateway); - RTFREE(ro.ro_rt); - } - if (need_proxy) { - /* - * proxy NDP for single entry - */ - ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp, - IN6_IFF_NOTREADY|IN6_IFF_ANYCAST); - if (ifa) - proxy = 1; + if (rib_lookup_info(RT_DEFAULT_FIB, (struct sockaddr *)&dst6, + 0, 0, &info) == 0) { + if ((info.rti_flags & RTF_ANNOUNCE) != 0 && + rt_gateway.sdl_family == AF_LINK) { + + /* + * proxy NDP for single entry + */ + proxydl = *SDL(&rt_gateway); + ifa = (struct ifaddr *)in6ifa_ifpforlinklocal( + ifp, IN6_IFF_NOTREADY|IN6_IFF_ANYCAST); + if (ifa) + proxy = 1; + } } } if (ifa == NULL) { From owner-svn-src-all@freebsd.org Mon Jan 4 15:47:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C582EA61062; Mon, 4 Jan 2016 15:47:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A48D91BD6; Mon, 4 Jan 2016 15:47:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A548FB91E; Mon, 4 Jan 2016 10:47:43 -0500 (EST) From: John Baldwin To: Adrian Chadd Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r293022 - head/sys/net80211 Date: Mon, 04 Jan 2016 07:47:39 -0800 Message-ID: <2558363.cYPdmfTgJ4@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201601010021.u010L7sW006625@repo.freebsd.org> <5919271.R3YaC4QkYh@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Jan 2016 10:47:43 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 15:47:44 -0000 On Friday, January 01, 2016 07:41:42 PM Adrian Chadd wrote: > yup. all of this is ... terrible atm. > > I do need to be able to give a bounds though. :( The _sbt variants let you specify a bounds for the "fuzzy". You give the deadline time as one value ('sbt') and an upper bound on how long to delay extra as the second ('pr'). The wait will timeout sometime between 'sbt' and 'sbt + pr'. Alternatively, you can leave 'pr' as 0 and encode the precision via the C_PREL() flags instead as described in callout(9). (I think how to use sbintime_t should probably be broken out into a separate sbintime(9) manpage that callout(9) and other consumers reference rather than being buried in callout(9) to make it easier to figure out how to use these. The same manpage can also talk about the SBT_* constants and how to generate sbintime_t values from known reference times.) -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jan 4 16:21:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B1C7A61D1C; Mon, 4 Jan 2016 16:21:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BA6D109B; Mon, 4 Jan 2016 16:21:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x242.google.com with SMTP id k127so28699848iok.1; Mon, 04 Jan 2016 08:21:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=zzjDfCW2KPHNA7MrwlZxv+vgcu/0laClQEC6qa9yl+I=; b=yuQcrBIC7FY9vR8eI24vUVmTnoZtSGyZuy26ZQNy0ykHkRrsoyfxo3GyQQxJxhtkox wvxbLo80+XaHjxuPCcOqFy7GpOSNoVwd7JoT1Ybj3mW+J1kq/p801dwv3UhocATMrWKZ tM+AAybxR7TChH7OiQKaieRDI0VmLxjqgOVCVoe5DSGY0UTfK0TlvflvwzhK09Eeg6Iy UmkqKff6HNVFDK471WvlbWQ6CBgOZLZEFIeXAiKxV7oIUKTd4SzK+Gn4XC1CjC8u+hsb 8pbFYCRRZMmpIOb85bO9C0bXTCI2RSyqR3PUz4NEIIIBX6y3pxipRyKXkLWjverVoO/j yYqw== MIME-Version: 1.0 X-Received: by 10.107.10.217 with SMTP id 86mr68702036iok.75.1451924518361; Mon, 04 Jan 2016 08:21:58 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.121.202 with HTTP; Mon, 4 Jan 2016 08:21:58 -0800 (PST) In-Reply-To: <2558363.cYPdmfTgJ4@ralph.baldwin.cx> References: <201601010021.u010L7sW006625@repo.freebsd.org> <5919271.R3YaC4QkYh@ralph.baldwin.cx> <2558363.cYPdmfTgJ4@ralph.baldwin.cx> Date: Mon, 4 Jan 2016 08:21:58 -0800 X-Google-Sender-Auth: D-jnHT0MsfaS5VbI12agitnnwLw Message-ID: Subject: Re: svn commit: r293022 - head/sys/net80211 From: Adrian Chadd To: John Baldwin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:21:59 -0000 On 4 January 2016 at 07:47, John Baldwin wrote: > On Friday, January 01, 2016 07:41:42 PM Adrian Chadd wrote: >> yup. all of this is ... terrible atm. >> >> I do need to be able to give a bounds though. :( > > The _sbt variants let you specify a bounds for the "fuzzy". You > give the deadline time as one value ('sbt') and an upper bound on > how long to delay extra as the second ('pr'). The wait will > timeout sometime between 'sbt' and 'sbt + pr'. > > Alternatively, you can leave 'pr' as 0 and encode the precision > via the C_PREL() flags instead as described in callout(9). (I > think how to use sbintime_t should probably be broken out into > a separate sbintime(9) manpage that callout(9) and other consumers > reference rather than being buried in callout(9) to make it easier > to figure out how to use these. The same manpage can also talk > about the SBT_* constants and how to generate sbintime_t values > from known reference times.) I dug into it a few months ago and found it was .. not quite as bounded fuzzy :( -a From owner-svn-src-all@freebsd.org Mon Jan 4 16:32:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1896A62234; Mon, 4 Jan 2016 16:32:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDCBA1999; Mon, 4 Jan 2016 16:32:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04GWRqa060043; Mon, 4 Jan 2016 16:32:27 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04GWLwB059976; Mon, 4 Jan 2016 16:32:21 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601041632.u04GWLwB059976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 4 Jan 2016 16:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293161 - in stable/10: contrib/openbsm contrib/openbsm/bin contrib/openbsm/bin/audit contrib/openbsm/bin/auditd contrib/openbsm/bin/auditdistd contrib/openbsm/bin/auditfilterd contrib/... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:32:29 -0000 Author: brueffer Date: Mon Jan 4 16:32:21 2016 New Revision: 293161 URL: https://svnweb.freebsd.org/changeset/base/293161 Log: MFH: 292432,r292433,r292434 - Merge OpenBSM 1.2 alpha 4. - Regenerate config.h for OpenBSM 1.2 alpha 4. - Add au_notify.2 and MLINKs (added in OpenBSM 1.2 alpha 4). Relnotes: yes Added: stable/10/contrib/openbsm/.travis.yml - copied unchanged from r292434, head/contrib/openbsm/.travis.yml stable/10/contrib/openbsm/libbsm/au_notify.3 - copied unchanged from r292434, head/contrib/openbsm/libbsm/au_notify.3 Modified: stable/10/contrib/openbsm/INSTALL stable/10/contrib/openbsm/LICENSE stable/10/contrib/openbsm/Makefile.am stable/10/contrib/openbsm/Makefile.in stable/10/contrib/openbsm/NEWS stable/10/contrib/openbsm/README stable/10/contrib/openbsm/TODO stable/10/contrib/openbsm/VERSION stable/10/contrib/openbsm/autogen.sh stable/10/contrib/openbsm/bin/Makefile.am stable/10/contrib/openbsm/bin/audit/Makefile.am stable/10/contrib/openbsm/bin/audit/audit.8 stable/10/contrib/openbsm/bin/audit/audit.c stable/10/contrib/openbsm/bin/auditd/Makefile.am stable/10/contrib/openbsm/bin/auditd/audit_triggers.defs stable/10/contrib/openbsm/bin/auditd/audit_warn.c stable/10/contrib/openbsm/bin/auditd/auditd.8 stable/10/contrib/openbsm/bin/auditd/auditd.c stable/10/contrib/openbsm/bin/auditd/auditd.h stable/10/contrib/openbsm/bin/auditd/auditd_control.defs stable/10/contrib/openbsm/bin/auditd/auditd_darwin.c stable/10/contrib/openbsm/bin/auditd/auditd_fbsd.c stable/10/contrib/openbsm/bin/auditdistd/Makefile.am stable/10/contrib/openbsm/bin/auditdistd/auditdistd.8 stable/10/contrib/openbsm/bin/auditdistd/auditdistd.c stable/10/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 stable/10/contrib/openbsm/bin/auditdistd/auditdistd.h stable/10/contrib/openbsm/bin/auditdistd/faccessat.h stable/10/contrib/openbsm/bin/auditdistd/fstatat.h stable/10/contrib/openbsm/bin/auditdistd/openat.h stable/10/contrib/openbsm/bin/auditdistd/parse.y stable/10/contrib/openbsm/bin/auditdistd/pjdlog.c stable/10/contrib/openbsm/bin/auditdistd/pjdlog.h stable/10/contrib/openbsm/bin/auditdistd/proto.c stable/10/contrib/openbsm/bin/auditdistd/proto.h stable/10/contrib/openbsm/bin/auditdistd/proto_common.c stable/10/contrib/openbsm/bin/auditdistd/proto_impl.h stable/10/contrib/openbsm/bin/auditdistd/proto_socketpair.c stable/10/contrib/openbsm/bin/auditdistd/proto_tcp.c stable/10/contrib/openbsm/bin/auditdistd/proto_tls.c stable/10/contrib/openbsm/bin/auditdistd/proto_uds.c stable/10/contrib/openbsm/bin/auditdistd/receiver.c stable/10/contrib/openbsm/bin/auditdistd/renameat.h stable/10/contrib/openbsm/bin/auditdistd/sandbox.c stable/10/contrib/openbsm/bin/auditdistd/sandbox.h stable/10/contrib/openbsm/bin/auditdistd/sender.c stable/10/contrib/openbsm/bin/auditdistd/sigtimedwait.h stable/10/contrib/openbsm/bin/auditdistd/strndup.h stable/10/contrib/openbsm/bin/auditdistd/subr.c stable/10/contrib/openbsm/bin/auditdistd/subr.h stable/10/contrib/openbsm/bin/auditdistd/synch.h stable/10/contrib/openbsm/bin/auditdistd/token.l stable/10/contrib/openbsm/bin/auditdistd/trail.c stable/10/contrib/openbsm/bin/auditdistd/trail.h stable/10/contrib/openbsm/bin/auditdistd/unlinkat.h stable/10/contrib/openbsm/bin/auditfilterd/Makefile.am stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.8 stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.c stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.h stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd_conf.c stable/10/contrib/openbsm/bin/auditreduce/Makefile.am stable/10/contrib/openbsm/bin/auditreduce/auditreduce.1 stable/10/contrib/openbsm/bin/auditreduce/auditreduce.c stable/10/contrib/openbsm/bin/auditreduce/auditreduce.h stable/10/contrib/openbsm/bin/praudit/Makefile.am stable/10/contrib/openbsm/bin/praudit/praudit.1 stable/10/contrib/openbsm/bin/praudit/praudit.c stable/10/contrib/openbsm/bsm/Makefile.am stable/10/contrib/openbsm/bsm/audit_filter.h stable/10/contrib/openbsm/bsm/audit_uevents.h stable/10/contrib/openbsm/bsm/auditd_lib.h stable/10/contrib/openbsm/bsm/libbsm.h stable/10/contrib/openbsm/compat/clock_gettime.h stable/10/contrib/openbsm/compat/closefrom.h stable/10/contrib/openbsm/compat/compat.h stable/10/contrib/openbsm/compat/endian.h stable/10/contrib/openbsm/compat/endian_enc.h stable/10/contrib/openbsm/compat/flopen.h stable/10/contrib/openbsm/compat/pidfile.h stable/10/contrib/openbsm/compat/queue.h stable/10/contrib/openbsm/compat/strlcat.h stable/10/contrib/openbsm/compat/strlcpy.h stable/10/contrib/openbsm/config/config.h stable/10/contrib/openbsm/configure stable/10/contrib/openbsm/configure.ac stable/10/contrib/openbsm/etc/audit_class stable/10/contrib/openbsm/etc/audit_control stable/10/contrib/openbsm/etc/audit_event stable/10/contrib/openbsm/etc/audit_filter stable/10/contrib/openbsm/etc/audit_user stable/10/contrib/openbsm/etc/audit_warn stable/10/contrib/openbsm/libauditd/Makefile.am stable/10/contrib/openbsm/libauditd/auditd_lib.c stable/10/contrib/openbsm/libauditd/libauditd.3 stable/10/contrib/openbsm/libbsm/Makefile.am stable/10/contrib/openbsm/libbsm/Makefile.in stable/10/contrib/openbsm/libbsm/au_class.3 stable/10/contrib/openbsm/libbsm/au_control.3 stable/10/contrib/openbsm/libbsm/au_domain.3 stable/10/contrib/openbsm/libbsm/au_errno.3 stable/10/contrib/openbsm/libbsm/au_event.3 stable/10/contrib/openbsm/libbsm/au_fcntl_cmd.3 stable/10/contrib/openbsm/libbsm/au_free_token.3 stable/10/contrib/openbsm/libbsm/au_io.3 stable/10/contrib/openbsm/libbsm/au_mask.3 stable/10/contrib/openbsm/libbsm/au_open.3 stable/10/contrib/openbsm/libbsm/au_socket_type.3 stable/10/contrib/openbsm/libbsm/au_token.3 stable/10/contrib/openbsm/libbsm/au_user.3 stable/10/contrib/openbsm/libbsm/audit_submit.3 stable/10/contrib/openbsm/libbsm/bsm_audit.c stable/10/contrib/openbsm/libbsm/bsm_class.c stable/10/contrib/openbsm/libbsm/bsm_control.c stable/10/contrib/openbsm/libbsm/bsm_domain.c stable/10/contrib/openbsm/libbsm/bsm_errno.c stable/10/contrib/openbsm/libbsm/bsm_event.c stable/10/contrib/openbsm/libbsm/bsm_fcntl.c stable/10/contrib/openbsm/libbsm/bsm_flags.c stable/10/contrib/openbsm/libbsm/bsm_io.c stable/10/contrib/openbsm/libbsm/bsm_mask.c stable/10/contrib/openbsm/libbsm/bsm_notify.c stable/10/contrib/openbsm/libbsm/bsm_socket_type.c stable/10/contrib/openbsm/libbsm/bsm_token.c stable/10/contrib/openbsm/libbsm/bsm_user.c stable/10/contrib/openbsm/libbsm/bsm_wrappers.c stable/10/contrib/openbsm/libbsm/libbsm.3 stable/10/contrib/openbsm/man/Makefile.am stable/10/contrib/openbsm/man/Makefile.in stable/10/contrib/openbsm/man/audit.2 stable/10/contrib/openbsm/man/audit.log.5 stable/10/contrib/openbsm/man/audit_class.5 stable/10/contrib/openbsm/man/audit_control.5 stable/10/contrib/openbsm/man/audit_event.5 stable/10/contrib/openbsm/man/audit_user.5 stable/10/contrib/openbsm/man/audit_warn.5 stable/10/contrib/openbsm/man/auditctl.2 stable/10/contrib/openbsm/man/auditon.2 stable/10/contrib/openbsm/man/getaudit.2 stable/10/contrib/openbsm/man/getauid.2 stable/10/contrib/openbsm/man/setaudit.2 stable/10/contrib/openbsm/man/setauid.2 stable/10/contrib/openbsm/modules/Makefile.am stable/10/contrib/openbsm/modules/auditfilter_noop/Makefile.am stable/10/contrib/openbsm/modules/auditfilter_noop/auditfilter_noop.c stable/10/contrib/openbsm/sys/Makefile.am stable/10/contrib/openbsm/sys/bsm/Makefile.am stable/10/contrib/openbsm/sys/bsm/audit.h stable/10/contrib/openbsm/sys/bsm/audit_domain.h stable/10/contrib/openbsm/sys/bsm/audit_errno.h stable/10/contrib/openbsm/sys/bsm/audit_fcntl.h stable/10/contrib/openbsm/sys/bsm/audit_internal.h stable/10/contrib/openbsm/sys/bsm/audit_kevents.h stable/10/contrib/openbsm/sys/bsm/audit_record.h stable/10/contrib/openbsm/sys/bsm/audit_socket_type.h stable/10/contrib/openbsm/test/Makefile.am stable/10/contrib/openbsm/test/bsm/Makefile.am stable/10/contrib/openbsm/test/bsm/generate.c stable/10/contrib/openbsm/tools/Makefile.am stable/10/contrib/openbsm/tools/audump.c stable/10/lib/libbsm/Makefile Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/openbsm/.travis.yml (from r292434, head/contrib/openbsm/.travis.yml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/openbsm/.travis.yml Mon Jan 4 16:32:21 2016 (r293161, copy of r292434, head/contrib/openbsm/.travis.yml) @@ -0,0 +1,18 @@ +language: c + +compiler: + - clang + - gcc + +os: + - linux + - osx + +before_install: + - if [ $TRAVIS_OS_NAME == "linux" ]; then + sudo apt-get -qq update; + sudo apt-get -qq install byacc flex; + elif [ $TRAVIS_OS_NAME == "osx" ]; then + brew update; + brew install byacc flex; + fi Modified: stable/10/contrib/openbsm/INSTALL ============================================================================== --- stable/10/contrib/openbsm/INSTALL Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/INSTALL Mon Jan 4 16:32:21 2016 (r293161) @@ -3,7 +3,7 @@ OpenBSM Build and Installation Instructi OpenBSM is currently built using autoconf and automake, which should allow for building on a range of operating systems, including FreeBSD, Mac OS X, and Linux. Some components are built only if appropriate kernel audit -suppport is found. Typical builds will be performed using: +support is found. Typical builds will be performed using: ./configure make @@ -31,7 +31,7 @@ not configurable. You may wish to specify that the OpenBSM components not be installed in the base system, rather in a specific directory. This may be done using the --prefix argument to configure. If installing to a specific directory, -remember to update your library path so that running tools from that +remember to update your library path so that when running tools from that directory the correct libbsm is used: ./configure --prefix=/home/rwatson/openbsm Modified: stable/10/contrib/openbsm/LICENSE ============================================================================== --- stable/10/contrib/openbsm/LICENSE Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/LICENSE Mon Jan 4 16:32:21 2016 (r293161) @@ -34,5 +34,3 @@ as a whole: The TrustedBSD Project would appreciate the contribution of fixes and enhancements under an identical license in order to avoid potentially confusing license proliferation. - -$P4: //depot/projects/trustedbsd/openbsm/LICENSE#6 $ Modified: stable/10/contrib/openbsm/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/Makefile.am#5 $ -## - SUBDIRS = \ bsm Modified: stable/10/contrib/openbsm/Makefile.in ============================================================================== --- stable/10/contrib/openbsm/Makefile.in Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/Makefile.in Mon Jan 4 16:32:21 2016 (r293161) @@ -59,9 +59,9 @@ DIST_COMMON = README $(am__configure_dep $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing $(top_srcdir)/configure INSTALL \ - NEWS TODO config/config.guess config/config.sub config/depcomp \ - config/install-sh config/ltmain.sh config/missing \ - config/ylwrap + NEWS TODO config/compile config/config.guess config/config.sub \ + config/depcomp config/install-sh config/ltmain.sh \ + config/missing config/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ Modified: stable/10/contrib/openbsm/NEWS ============================================================================== --- stable/10/contrib/openbsm/NEWS Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/NEWS Mon Jan 4 16:32:21 2016 (r293161) @@ -1,5 +1,16 @@ OpenBSM Version History +OpenBSM 1.2 alpha 4 + +- Fix praudit to emit correct XML. +- Fix auditdistd bugs related to IPv6 support, locking, and a kqueue-related + descriptor leak. +- Add audit event definitions for Capsicum-related syscalls, as well as + AUE_BINDAT and AUE_CONNECTAT. +- Manpage symlinks for all libbsm functions are installed again after the + move to autotools in OpenBSM 1.0 Alpha 5. +- A variety of minor documentation cleanups. + OpenBSM 1.2 alpha 3 - Various minor tweaks to the auditdistd build to make it fit the FreeBSD @@ -494,5 +505,3 @@ OpenBSM 1.0 alpha 1 - auditd(8), audit(8) added to the OpenBSM distribution. auditd extended to support reloading of kernel event table. - Allow comments in /etc/security configuration files. - -$P4: //depot/projects/trustedbsd/openbsm/NEWS#55 $ Modified: stable/10/contrib/openbsm/README ============================================================================== --- stable/10/contrib/openbsm/README Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/README Mon Jan 4 16:32:21 2016 (r293161) @@ -1,4 +1,4 @@ -OpenBSM 1.2a2 +OpenBSM Introduction @@ -10,7 +10,7 @@ of several organizations. OpenBSM includes several command line tools, including auditreduce(8) and praudit(8) for reducing and printing audit trails, as well as the libbsm(3) library to manage configuration files, generate audit records, and parse and -print audit trils. +print audit trails. Coupled with a kernel audit implementation, OpenBSM can be used to maintain system audit streams, and is a foundation for a full audit-enabled system. @@ -64,5 +64,3 @@ Information on OpenBSM may be found on t Information on TrustedBSD may be found on the TrustedBSD home page: http://www.TrustedBSD.org/ - -$P4: //depot/projects/trustedbsd/openbsm/README#41 $ Modified: stable/10/contrib/openbsm/TODO ============================================================================== --- stable/10/contrib/openbsm/TODO Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/TODO Mon Jan 4 16:32:21 2016 (r293161) @@ -7,8 +7,6 @@ OpenBSM TODO - Document contents of libbsm "public" data structures in libbsm man pages. - The audit.log.5 man page is incomplete, as it does not describe all token types. -- With the move to autoconf/automake, man page symlinks are no longer - installed. This needs to be fixed. - It might be desirable to be able to provide EOPNOTSUPP system call stubs on systems that don't have the necessary audit system calls; that would allow the full libbsm and tool set to build, just not run. @@ -23,5 +21,3 @@ OpenBSM TODO not available on the local OS platform. - Support for client certificates in auditdistd, to include certificate chain validation. - -$P4: //depot/projects/trustedbsd/openbsm/TODO#14 $ Modified: stable/10/contrib/openbsm/VERSION ============================================================================== --- stable/10/contrib/openbsm/VERSION Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/VERSION Mon Jan 4 16:32:21 2016 (r293161) @@ -1 +1 @@ -OPENBSM_1_2_alpha3 +OPENBSM_1_2_alpha4 Modified: stable/10/contrib/openbsm/autogen.sh ============================================================================== --- stable/10/contrib/openbsm/autogen.sh Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/autogen.sh Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,4 @@ #!/bin/sh -# -# $P4: //depot/projects/trustedbsd/openbsm/autogen.sh#2 $ -# libtoolize --copy --force aclocal Modified: stable/10/contrib/openbsm/bin/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/bin/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/Makefile.am#4 $ -## - SUBDIRS = \ auditdistd \ auditfilterd \ Modified: stable/10/contrib/openbsm/bin/audit/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/bin/audit/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/audit/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/audit/Makefile.am#7 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: stable/10/contrib/openbsm/bin/audit/audit.8 ============================================================================== --- stable/10/contrib/openbsm/bin/audit/audit.8 Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/audit/audit.8 Mon Jan 4 16:32:21 2016 (r293161) @@ -25,9 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/audit/audit.8#16 $ -.\" -.Dd January 29, 2009 +.Dd July 25, 2015 .Dt AUDIT 8 .Os .Sh NAME @@ -88,7 +86,7 @@ Audit policy file used to configure the .Xr audit 4 , .Xr audit_control 5 , .Xr auditd 8 , -.Xr launchd 8 +.Xr launchd 8 (Mac OS X) .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. Modified: stable/10/contrib/openbsm/bin/audit/audit.c ============================================================================== --- stable/10/contrib/openbsm/bin/audit/audit.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/audit/audit.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/audit/audit.c#15 $ */ /* * Program to trigger the audit daemon with a message that is either: Modified: stable/10/contrib/openbsm/bin/auditd/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/Makefile.am#6 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: stable/10/contrib/openbsm/bin/auditd/audit_triggers.defs ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/audit_triggers.defs Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/audit_triggers.defs Mon Jan 4 16:32:21 2016 (r293161) @@ -1,5 +1 @@ -/* - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_triggers.defs#1 $ - */ - #include Modified: stable/10/contrib/openbsm/bin/auditd/audit_warn.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/audit_warn.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/audit_warn.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_warn.c#11 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditd/auditd.8 ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd.8 Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd.8 Mon Jan 4 16:32:21 2016 (r293161) @@ -25,9 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#19 $ -.\" -.Dd December 11, 2008 +.Dd July 25, 2015 .Dt AUDITD 8 .Os .Sh NAME @@ -123,7 +121,7 @@ and are no longer available as arguments .Xr audit_warn 5 , .Xr audit 8 , .Xr auditdistd 8 , -.Xr launchd 8 +.Xr launchd 8 (Mac OS X) .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. Modified: stable/10/contrib/openbsm/bin/auditd/auditd.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#50 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditd/auditd.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.h#13 $ */ #ifndef _AUDITD_H_ Modified: stable/10/contrib/openbsm/bin/auditd/auditd_control.defs ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd_control.defs Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd_control.defs Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_control.defs#2 $ */ /* Modified: stable/10/contrib/openbsm/bin/auditd/auditd_darwin.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd_darwin.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd_darwin.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#5 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditd/auditd_fbsd.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd_fbsd.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd_fbsd.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#4 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/Makefile.am#1 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: stable/10/contrib/openbsm/bin/auditdistd/auditdistd.8 ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/auditdistd.8 Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/auditdistd.8 Mon Jan 4 16:32:21 2016 (r293161) @@ -41,7 +41,7 @@ .Sh DESCRIPTION The .Nm -daemon is responsible for distributing audit trail files over TCP/IP network in +daemon is responsible for distributing audit trail files over a TCP/IP network in a secure and reliable way. .Pp The @@ -49,7 +49,7 @@ The daemon can be started with the following command line arguments: .Bl -tag -width ".Fl P Ar pidfile" .It Fl c Ar config -Specify alternative location of the configuration file. +Specify an alternative location of the configuration file. The default location is .Pa /etc/security/auditdistd.conf . Note: the configuration file may contain passwords. @@ -74,7 +74,7 @@ usage message. Start in a launchd-friendly mode, ie. do not use .Xr daemon 3 . .It Fl P Ar pidfile -Specify alternative location of a file where main process PID will be +Specify an alternative location of a file where main process PID will be stored. The default location is .Pa /var/run/auditdistd.pid . Modified: stable/10/contrib/openbsm/bin/auditdistd/auditdistd.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/auditdistd.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/auditdistd.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Mon Jan 4 16:32:21 2016 (r293161) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2011 +.Dd July 1, 2015 .Dt AUDITDISTD.CONF 5 .Os .Sh NAME @@ -37,19 +37,21 @@ daemon. .Sh DESCRIPTION Note: the configuration file may contain passwords. -Care should be taken to configure proper permissions on this file -.Li ( eg. 0600 ) . +Care should be taken to configure proper permissions for this file +.Li ( e.g., 0600 ) . .Pp -Every line starting with # is treated as comment and ignored. +Every line starting with +.Li # +gets treated as a comment and is ignored. .Sh CONFIGURATION FILE SYNTAX -General syntax of the +The general syntax of the .Nm -file is following: -.Bd -literal -offset +file is as follows: +.Bd -literal ## Global section. # Our name. -# The default is first part of the hostname. +# The default is the first part of the hostname. name "" # Connection timeout. @@ -71,11 +73,11 @@ sender { # The default is /var/audit/dist. directory "" .\" -.\" # Checksum algorithm for data send over the wire. +.\" # Checksum algorithm for data sent over the wire. .\" # The default is none. .\" checksum "" .\" -.\" # Compression algorithm for data send over the wire. +.\" # Compression algorithm for data sent over the wire. .\" # The default is none. .\" compression "" @@ -86,7 +88,7 @@ sender { # Optional. source "" - # Address of auditdistd receiver. + # Address of the auditdistd receiver. # No default. Obligatory. remote "" @@ -95,7 +97,7 @@ sender { directory "" # Fingerprint of the receiver's public key when using TLS - # for connection. + # for connections. # Example fingerprint: # SHA256=8F:0A:FC:8A:3D:09:80:AF:D9:AA:38:CC:8A:86:53:E6:8F:B6:1C:55:30:14:D7:F9:AA:8B:3E:73:CD:F5:76:2B fingerprint "" @@ -103,37 +105,37 @@ sender { # Password used to authenticate in front of the receiver. password "" .\" -.\" # Checksum algorithm for data send over the wire. +.\" # Checksum algorithm for data sent over the wire. .\" # The default is none. .\" checksum "" .\" -.\" # Compression algorithm for data send over the wire. +.\" # Compression algorithm for data sent over the wire. .\" # The default is none. .\" compression "" } - # Currently local audit trail files can be send only to one remote + # Currently local audit trail files can be sent only to one remote # auditdistd receiver, but this can change in the future. } receiver { ## Receiver section. - # Address to listen on. Multiple listen addresses might be specified. + # Address to listen on. Multiple listen addresses may be specified. # The defaults are "tcp4://0.0.0.0:7878" and "tcp6://[::]:7878". listen "" # Base directory. - # If directory in host section is no absolute, it will be concatenated - # with this base directory. + # If the directory in the host section is not absolute, it will be + # concatenated with this base directory. # The default is "/var/audit/remote". directory "" - # Path to receiver's certificate file. + # Path to the receiver's certificate file. # The default is "/etc/security/auditdistd.cert.pem". certfile "" - # Path to receiver's private key file. + # Path to the receiver's private key file. # The default is "/etc/security/auditdistd.key.pem". keyfile "" @@ -158,7 +160,7 @@ receiver { .Ed .Pp Most of the various available configuration parameters are optional. -If parameter is not defined in the particular section, it will be +If a parameter is not defined in the particular section, it will be inherited from the parent section if possible. For example, if the .Ic source @@ -172,14 +174,14 @@ In case the section does not define the .Ic source parameter at all, the default value will be used. -.Sh CONFIGURATION FILE DESCRIPTION +.Sh CONFIGURATION OPTION DESCRIPTION The following statements are available: .Bl -tag -width ".Ic xxxx" .It Ic name Aq name .Pp This host's name. -It is send to the receiver, so it can properly recognize us if there are -more than one sender coming from the same IP address. +It is sent to the receiver, so it can properly recognize us if there are +multiple senders coming from the same IP address. .It Ic timeout Aq seconds .Pp Connection timeout in seconds. @@ -198,17 +200,17 @@ The default value is Local address to bind to before connecting to the remote .Nm auditdistd daemon. -Format is the same as for the +The format is the same as for the .Ic listen statement. .It Ic directory Aq path .Pp -Directory where to look for audit trail files in case of sender mode or -directory where to store received audit trail files. +The directory where to look for audit trail files in case of sender mode, or +the directory where to store received audit trail files. The provided path has to be an absolute path. -The only exception is when directory is provided in the +The only exception is when the directory is provided in the .Ic receiver -section, then path provided in the +section; then the path provided in the .Ic host subsections can be relative to the directory in the .Ic receiver @@ -229,13 +231,13 @@ subsections in the .Ic receiver section where .Aq name -is host's name. +is the host's name. .\".It Ic checksum Aq algorithm .\".Pp .\"Checksum algorithm should be one of the following: .\".Bl -tag -width ".Ic sha256" .\".It Ic none -.\"No checksum will be calculated for the data being send over the network. +.\"No checksum will be calculated for the data being sent over the network. .\"This is the default setting. .\".It Ic crc32 .\"CRC32 checksum will be calculated. @@ -247,30 +249,30 @@ is host's name. .\"Compression algorithm should be one of the following: .\".Bl -tag -width ".Ic none" .\".It Ic none -.\"Data send over the network will not be compressed. +.\"Data sent over the network will not be compressed. .\"This is the default setting. .\".It Ic lzf .\"The .\".Nm LZF .\"algorithm by .\".An Marc Alexander Lehmann -.\"will be used to compress the data send over the network. +.\"will be used to compress the data sent over the network. .\".Nm LZF -.\"is very fast, general purpose compression algorithm. +.\"is a very fast, general purpose compression algorithm. .\".El .It Ic remote Aq addr .Pp Address of the remote .Nm auditdistd daemon. -Format is the same as for the +The format is the same as for the .Ic listen statement. -When operating in the +When operating in .Ic sender mode this address will be used to connect to the .Ic receiver . -When operating in the +When operating in .Ic receiver mode only connections from this address will be accepted. .It Ic listen Aq addr @@ -296,21 +298,22 @@ By default listens on .Pa tcp4://0.0.0.0:7878 and -.Pa tcp6://[::]:7878 -if kernel supports IPv4 and IPv6 respectively. +.Pa tcp6://[::]:7878 , +if the kernel supports IPv4 and IPv6 respectively. .It Ic keyfile Aq path .Pp -Path to a file that contains private key for TLS communication. +Path to a file that contains the private key for TLS communication. .It Ic certfile Aq path .Pp -Path to a file that contains certificate for TLS communication. +Path to a file that contains the certificate for TLS communication. .It Ic fingerprint Aq algo=hash .Pp -Finger print of the receiver's public key. -Currently only SHA256 algorithm is supported. -Certificate public key's fingerprint ready to be pasted into auditdistd +Fingerprint of the receiver's public key. +Currently only the SHA256 algorithm is supported. +The certificate public key's fingerprint ready to be pasted into the +.Nm auditdistd configuration file can be obtained by running: -.Bd -literal -offset +.Bd -literal # openssl x509 -in /etc/security/auditdistd.cert.pem -noout -fingerprint -sha256 | awk -F '[ =]' '{printf("%s=%s\\n", $1, $3)}' .Ed .It Ic password Aq password @@ -352,10 +355,10 @@ receiver { .Ed .Sh SEE ALSO .Xr audit 4 , -.Xr auditdistd 8 . +.Xr auditdistd 8 .Sh AUTHORS The .Nm auditdistd -was developed by +daemon was developed by .An Pawel Jakub Dawidek Aq pawel@dawidek.net under sponsorship of the FreeBSD Foundation. Modified: stable/10/contrib/openbsm/bin/auditdistd/auditdistd.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/auditdistd.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/auditdistd.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.h#2 $ */ #ifndef _AUDITDISTD_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/faccessat.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/faccessat.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/faccessat.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/faccessat.h#1 $ */ #ifndef _FACCESSAT_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/fstatat.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/fstatat.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/fstatat.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/fstatat.h#1 $ */ #ifndef _FSTATAT_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/openat.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/openat.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/openat.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/openat.h#1 $ */ #ifndef _OPENAT_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/parse.y ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/parse.y Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/parse.y Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/parse.y#5 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/pjdlog.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/pjdlog.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/pjdlog.c Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/pjdlog.c#1 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/pjdlog.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/pjdlog.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/pjdlog.h Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/pjdlog.h#1 $ */ #ifndef _PJDLOG_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/proto.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto.c#1 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/proto.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto.h#1 $ */ #ifndef _PROTO_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_common.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_common.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_common.c Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_common.c#1 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_impl.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_impl.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_impl.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_impl.h#1 $ */ #ifndef _PROTO_IMPL_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_socketpair.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_socketpair.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_socketpair.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_socketpair.c#1 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_tcp.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_tcp.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_tcp.c Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tcp.c#2 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_tls.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_tls.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_tls.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tls.c#2 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_uds.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_uds.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_uds.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_uds.c#2 $ */ /* UDS - UNIX Domain Socket */ Modified: stable/10/contrib/openbsm/bin/auditdistd/receiver.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/receiver.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/receiver.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/receiver.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/renameat.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/renameat.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/renameat.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/renameat.h#1 $ */ #ifndef _RENAMEAT_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/sandbox.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/sandbox.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/sandbox.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/sandbox.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/sandbox.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/sandbox.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.h#1 $ */ #ifndef _SANDBOX_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/sender.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/sender.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/sender.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sender.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/sigtimedwait.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/sigtimedwait.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/sigtimedwait.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sigtimedwait.h#2 $ */ #ifndef _SIGTIMEDWAIT_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/strndup.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/strndup.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/strndup.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/strndup.h#1 $ */ #ifndef _STRNDUP_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/subr.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/subr.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/subr.c Mon Jan 4 16:32:21 2016 (r293161) @@ -22,8 +22,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/subr.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/subr.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/subr.h Mon Jan 4 16:32:21 2016 (r293161) @@ -22,8 +22,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.h#1 $ */ #ifndef _AUDITDISTD_SUBR_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/synch.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/synch.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/synch.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/synch.h#3 $ */ #ifndef _SYNCH_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/token.l ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/token.l Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/token.l Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#2 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/trail.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/trail.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/trail.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/trail.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/trail.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/trail.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.h#1 $ */ #ifndef _AUDITDISTD_TRAIL_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/unlinkat.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/unlinkat.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/unlinkat.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/unlinkat.h#1 $ */ #ifndef _UNLINKAT_H_ Modified: stable/10/contrib/openbsm/bin/auditfilterd/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/bin/auditfilterd/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditfilterd/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/Makefile.am#4 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.8 ============================================================================== --- stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.8 Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.8 Mon Jan 4 16:32:21 2016 (r293161) @@ -23,8 +23,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/auditfilterd.8#6 $ -.\" .Dd October 3, 2006 .Dt AUDITFILTERD 8 .Os Modified: stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.c Mon Jan 4 16:32:21 2016 (r293161) @@ -24,8 +24,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/auditfilterd.c#13 $ */ /* @@ -131,7 +129,7 @@ present_rawrecord(struct timespec *ts, u } /* - * Parse the BSM into a set of tokens, which will be pased to registered + * Parse the BSM into a set of tokens, which will be passed to registered * and interested filters. */ #define MAX_TOKENS 128 /* Maximum tokens we handle per record. */ Modified: stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.h Mon Jan 4 16:32:21 2016 (r293161) @@ -24,8 +24,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/auditfilterd.h#5 $ */ #define AUDITFILTERD_CONFFILE "/etc/security/audit_filter" Modified: stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd_conf.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd_conf.c Mon Jan 4 15:50:10 2016 (r293160) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 4 16:33:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DA45A622D0; Mon, 4 Jan 2016 16:33:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AFFC1B2A; Mon, 4 Jan 2016 16:33:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04GXsfI060195; Mon, 4 Jan 2016 16:33:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04GXsU3060194; Mon, 4 Jan 2016 16:33:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601041633.u04GXsU3060194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Jan 2016 16:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293162 - stable/10/sys/boot/amd64/efi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:33:55 -0000 Author: emaste Date: Mon Jan 4 16:33:54 2016 New Revision: 293162 URL: https://svnweb.freebsd.org/changeset/base/293162 Log: MFC r280351: Stop calling x86_efi_copyin and x86_efi_getdev directly In HEAD this is to help port loader.efi to both 32 and 64-bit ARM where we can use this file with minimal changes. Merged to stable/10 to simplify MFCs of later EFI commits. Modified: stable/10/sys/boot/amd64/efi/bootinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/amd64/efi/bootinfo.c ============================================================================== --- stable/10/sys/boot/amd64/efi/bootinfo.c Mon Jan 4 16:32:21 2016 (r293161) +++ stable/10/sys/boot/amd64/efi/bootinfo.c Mon Jan 4 16:33:54 2016 (r293162) @@ -114,24 +114,24 @@ bi_copyenv(vm_offset_t start) /* Traverse the environment. */ for (ep = environ; ep != NULL; ep = ep->ev_next) { len = strlen(ep->ev_name); - if (x86_efi_copyin(ep->ev_name, addr, len) != len) + if (archsw.arch_copyin(ep->ev_name, addr, len) != len) break; addr += len; - if (x86_efi_copyin("=", addr, 1) != 1) + if (archsw.arch_copyin("=", addr, 1) != 1) break; addr++; if (ep->ev_value != NULL) { len = strlen(ep->ev_value); - if (x86_efi_copyin(ep->ev_value, addr, len) != len) + if (archsw.arch_copyin(ep->ev_value, addr, len) != len) break; addr += len; } - if (x86_efi_copyin("", addr, 1) != 1) + if (archsw.arch_copyin("", addr, 1) != 1) break; last = ++addr; } - if (x86_efi_copyin("", last++, 1) != 1) + if (archsw.arch_copyin("", last++, 1) != 1) last = start; return(last); } @@ -155,7 +155,7 @@ bi_copyenv(vm_offset_t start) #define COPY32(v, a, c) { \ uint32_t x = (v); \ if (c) \ - x86_efi_copyin(&x, a, sizeof(x)); \ + archsw.arch_copyin(&x, a, sizeof(x)); \ a += sizeof(x); \ } @@ -163,8 +163,8 @@ bi_copyenv(vm_offset_t start) COPY32(t, a, c); \ COPY32(strlen(s) + 1, a, c); \ if (c) \ - x86_efi_copyin(s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(uint64_t)); \ + archsw.arch_copyin(s, a, strlen(s) + 1); \ + a += roundup(strlen(s) + 1, sizeof(u_long)); \ } #define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) @@ -175,8 +175,8 @@ bi_copyenv(vm_offset_t start) COPY32(t, a, c); \ COPY32(sizeof(s), a, c); \ if (c) \ - x86_efi_copyin(&s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(uint64_t)); \ + archsw.arch_copyin(&s, a, sizeof(s)); \ + a += roundup(sizeof(s), sizeof(u_long)); \ } #define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) @@ -186,8 +186,8 @@ bi_copyenv(vm_offset_t start) COPY32(MODINFO_METADATA | mm->md_type, a, c); \ COPY32(mm->md_size, a, c); \ if (c) \ - x86_efi_copyin(mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(uint64_t)); \ + archsw.arch_copyin(mm->md_data, a, mm->md_size); \ + a += roundup(mm->md_size, sizeof(u_long)); \ } #define MOD_END(a, c) { \ @@ -315,7 +315,7 @@ bi_load(char *args, vm_offset_t *modulep * tested/set by MI code before launching the kernel. */ rootdevname = getenv("rootdev"); - x86_efi_getdev((void**)(&rootdev), rootdevname, NULL); + archsw.arch_getdev((void**)(&rootdev), rootdevname, NULL); if (rootdev == NULL) { printf("Can't determine root device.\n"); return(EINVAL); From owner-svn-src-all@freebsd.org Mon Jan 4 16:50:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68D6DA627D9 for ; Mon, 4 Jan 2016 16:50:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-x231.google.com (mail-qk0-x231.google.com [IPv6:2607:f8b0:400d:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C9DF14E0 for ; Mon, 4 Jan 2016 16:50:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk0-x231.google.com with SMTP id q19so75407446qke.3 for ; Mon, 04 Jan 2016 08:50:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mRlt2BfieutsqXFfcyQxhEShUC+QC+wprHluuS0L3KI=; b=SsMf7LNkYXsIxFSSGi2PT4qAUc+cN4M+cr6s1jFyttXRW/KV0rL25VkQk66rAP5I20 f4f1h6swO1vhaxGQQ3OHedYGAw7be+l8lWZTRcc7T8Ey6RGznMvhYxJNz7s4Y3EYG9Vn h9ZxLUNJm3rbyUIFzBfsUR3+krWw3Ejdq+yjUM4D8Kpa3WWd4nK5oHw+DQGQPlfTMI3+ sIKzvhnubK/H08kxcCQSkX/hMIZKMPCLSnwYYzt8A9mOhDcw7wxqttPkyPR524/EwRYT VoXqcXOU18eMLlBJabQ78cUu4RrygD+o1HuxZfVSONR3Twf06hJbgOgmoMxrWNM+3On4 rWXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mRlt2BfieutsqXFfcyQxhEShUC+QC+wprHluuS0L3KI=; b=JIkSL3YIh58bDIR/9TjzafI3k9KOVXAGT4GzG88Fk3Z/vZqA/9AvLUfreoyUTbQ6o6 ulLJcBBTxDdQ7HX8Ist6nJ+rVNrnX4Ma6CiRLTdPXTEOok/mA020NsA7Rl9X9vwscwSe qBx/i8skwv8fPWF7fFa2nUToI3Z06+IqT2dcJZaFE3LFV9frnh8du33yhA7rS2LVJKb8 /y8Na48U7uM4R+540N5jIMjJ7RsjdMx0RbHOPe2ZgzK2Qh/5+9gw0pRYJ7rEtCflcSfB HEGnEFNqWPJlryt6goIN5aFv6QSai0g5tzQW7LdvHxst4HajmvUwQAtC+GsxtjMyjUgb Jtrg== X-Gm-Message-State: ALoCoQnHOhnXinLBcbqQYN1ElCPE4mtL1sZLIz6ZjlWUisHS8rLINmJDbNyPLL4DRKCK0a7W2Breol7AfFiYiO4NoeGf2eXGMA== MIME-Version: 1.0 X-Received: by 10.55.81.87 with SMTP id f84mr15319800qkb.10.1451926200908; Mon, 04 Jan 2016 08:50:00 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 08:50:00 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <7fjp-lonn-wny@vfemail.net> References: <201601031918.u03JImBs012182@repo.freebsd.org> <7fjp-lonn-wny@vfemail.net> Date: Mon, 4 Jan 2016 09:50:00 -0700 X-Google-Sender-Auth: EjZrYL9EiV2XcbVCoy1XDE4i3G8 Message-ID: Subject: Re: svn commit: r293115 - head/etc From: Warner Losh To: Jan Beich Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:50:02 -0000 On Mon, Jan 4, 2016 at 1:44 AM, Jan Beich wrote: > Warner Losh writes: > > > Author: imp > > Date: Sun Jan 3 19:18:48 2016 > > New Revision: 293115 > > URL: https://svnweb.freebsd.org/changeset/base/293115 > > > > Log: > > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > > up and can cause issues on boot with the prompts. > > Why do you have ~/.profile stuff leaking into rc* boot sequence? > Because I though they were in /root/.profile. I was going to quote them here. Also, all other instances of rm in the rc files I noticed with a quick grep has /bin/rm. Turns out it is simply rm's default behavior w/o -f to prompt, I think. Warner From owner-svn-src-all@freebsd.org Mon Jan 4 16:51:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E575A62956; Mon, 4 Jan 2016 16:51:59 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1D521A2D; Mon, 4 Jan 2016 16:51:58 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04GpvZu066101; Mon, 4 Jan 2016 16:51:57 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04Gpuc5066087; Mon, 4 Jan 2016 16:51:56 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601041651.u04Gpuc5066087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 4 Jan 2016 16:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293163 - in stable/10/sys: bsm security/audit X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:51:59 -0000 Author: brueffer Date: Mon Jan 4 16:51:56 2016 New Revision: 293163 URL: https://svnweb.freebsd.org/changeset/base/293163 Log: MFH: r292522 Merge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM 1.2 alpha 4: - remove $P4$ - fix a comment Modified: stable/10/sys/bsm/audit.h stable/10/sys/bsm/audit_domain.h stable/10/sys/bsm/audit_errno.h stable/10/sys/bsm/audit_fcntl.h stable/10/sys/bsm/audit_internal.h stable/10/sys/bsm/audit_kevents.h stable/10/sys/bsm/audit_record.h stable/10/sys/bsm/audit_socket_type.h stable/10/sys/security/audit/bsm_domain.c stable/10/sys/security/audit/bsm_errno.c stable/10/sys/security/audit/bsm_fcntl.c stable/10/sys/security/audit/bsm_socket_type.c stable/10/sys/security/audit/bsm_token.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/bsm/audit.h ============================================================================== --- stable/10/sys/bsm/audit.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit.h#10 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_domain.h ============================================================================== --- stable/10/sys/bsm/audit_domain.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_domain.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_domain.h#2 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_errno.h ============================================================================== --- stable/10/sys/bsm/audit_errno.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_errno.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#7 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_fcntl.h ============================================================================== --- stable/10/sys/bsm/audit_fcntl.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_fcntl.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_fcntl.h#2 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_internal.h ============================================================================== --- stable/10/sys/bsm/audit_internal.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_internal.h Mon Jan 4 16:51:56 2016 (r293163) @@ -30,7 +30,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#6 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_kevents.h ============================================================================== --- stable/10/sys/bsm/audit_kevents.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_kevents.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#7 * $FreeBSD$ */ @@ -34,7 +33,7 @@ #define _BSM_AUDIT_KEVENTS_H_ /* - * The reserved event numbers for kernel events are 1...2047 and 43001..44900. + * The reserved event numbers for kernel events are 1...2047 and 43001..44999. */ #define AUE_IS_A_KEVENT(e) (((e) > 0 && (e) < 2048) || \ ((e) > 43000 && (e) < 45000)) Modified: stable/10/sys/bsm/audit_record.h ============================================================================== --- stable/10/sys/bsm/audit_record.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_record.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#10 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_socket_type.h ============================================================================== --- stable/10/sys/bsm/audit_socket_type.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_socket_type.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_socket_type.h#1 * $FreeBSD$ */ Modified: stable/10/sys/security/audit/bsm_domain.c ============================================================================== --- stable/10/sys/security/audit/bsm_domain.c Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/security/audit/bsm_domain.c Mon Jan 4 16:51:56 2016 (r293163) @@ -25,8 +25,6 @@ * 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. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_domain.c#3 */ #include Modified: stable/10/sys/security/audit/bsm_errno.c ============================================================================== --- stable/10/sys/security/audit/bsm_errno.c Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/security/audit/bsm_errno.c Mon Jan 4 16:51:56 2016 (r293163) @@ -25,8 +25,6 @@ * 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. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#22 */ #include Modified: stable/10/sys/security/audit/bsm_fcntl.c ============================================================================== --- stable/10/sys/security/audit/bsm_fcntl.c Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/security/audit/bsm_fcntl.c Mon Jan 4 16:51:56 2016 (r293163) @@ -25,8 +25,6 @@ * 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. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_fcntl.c#2 */ #include Modified: stable/10/sys/security/audit/bsm_socket_type.c ============================================================================== --- stable/10/sys/security/audit/bsm_socket_type.c Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/security/audit/bsm_socket_type.c Mon Jan 4 16:51:56 2016 (r293163) @@ -25,8 +25,6 @@ * 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. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_socket_type.c#1 */ #include Modified: stable/10/sys/security/audit/bsm_token.c ============================================================================== --- stable/10/sys/security/audit/bsm_token.c Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/security/audit/bsm_token.c Mon Jan 4 16:51:56 2016 (r293163) @@ -29,8 +29,6 @@ * 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. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#99 */ #include From owner-svn-src-all@freebsd.org Mon Jan 4 16:53:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4702A629E0; Mon, 4 Jan 2016 16:53:03 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 94C931BFB; Mon, 4 Jan 2016 16:53:03 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id A6D4BD87C; Mon, 4 Jan 2016 16:52:57 +0000 (UTC) Subject: Re: svn commit: r293115 - head/etc To: Warner Losh , Jan Beich References: <201601031918.u03JImBs012182@repo.freebsd.org> <7fjp-lonn-wny@vfemail.net> Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <568AA373.3060004@freebsd.org> Date: Mon, 4 Jan 2016 11:53:07 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NMpxjmCoHAUh12H45JLx05HD1O1Rul5G0" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:53:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NMpxjmCoHAUh12H45JLx05HD1O1Rul5G0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-01-04 11:50, Warner Losh wrote: >=20 >=20 > On Mon, Jan 4, 2016 at 1:44 AM, Jan Beich > wrote: >=20 > Warner Losh writes: >=20 > > Author: imp > > Date: Sun Jan 3 19:18:48 2016 > > New Revision: 293115 > > URL: https://svnweb.freebsd.org/changeset/base/293115 > > > > Log: > > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is pic= ked > > up and can cause issues on boot with the prompts. >=20 > Why do you have ~/.profile stuff leaking into rc* boot sequence? >=20 >=20 > Because I though they were in /root/.profile. I was going to quote > them here. Also, all other instances of rm in the rc files I noticed > with a quick grep has /bin/rm. >=20 > Turns out it is simply rm's default behavior w/o -f to prompt, I think.= >=20 > Warner Prompting is not the default behaviour, but also check /etc/profile --=20 Allan Jude --NMpxjmCoHAUh12H45JLx05HD1O1Rul5G0 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.22 (MingW32) iQIcBAEBAgAGBQJWiqN2AAoJEBmVNT4SmAt+TU0QAJkVN7KvoNLE2k+d5PABfOaH RhgObJe9T+ujt0YrHNxd66tCR4Bl1SuYK2uZ0DgHHVqx8UL9nv5Tdwg9bYSAZuKi KPEONGaqpsCrJwF6h/Xb+fCSs2fwpB4C4dFGmMhsQSahJQEoZ9XJ5BoOfgu6+ENq wnK8eijX12IpnXMV1mYuT9wCoyTU/UXCkWQ0a5SFcjibyCWrmcpeH0qySYIMgROu e3O12uJxcb7nNJzlZU0q69YDG+oB5N6AooovbHaXj/eA9y2ghb6etc2ZjmLvCtdy NOCg0dw08bq2DTExmGQ+coPjAsqbLHAGVxNHUHf8omk1+MB+j7ZJZZ0tPOv3HXXQ T51hzsCqZWxisSVvOuO2+4Bb/9lCYc2aqTE1n3oaaFfbG6hIcQ5A4hweZSCLDXS4 KXobV66WlZeUrJqR5S+HOD6sTIiifU1mzwuDtkJbbCVM0j5LEKQJBg/uhKiiGy+D +3yvFsvscTNzGK1dkF5zFJwMcWLSJIdYw1CBKR3Y/v5O9PGBfdJGZ2d3iL8aq9qh 0eEOrL6a1j7B8FSYt3SKIxuVb91mU7jc48BODKh3x0Srme5Bl5zqRAb6VPMtNqXN I+D6SMtTjQ1V8DyM96NK/NVg7G1v7cLQ4NC3Iq7CWBLUnwkmcuG0fp7tfHZFMuPT uTeGC6Ngi5A5+LXTCLy3 =M84s -----END PGP SIGNATURE----- --NMpxjmCoHAUh12H45JLx05HD1O1Rul5G0-- From owner-svn-src-all@freebsd.org Mon Jan 4 16:56:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 170D0A62B12 for ; Mon, 4 Jan 2016 16:56:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22f.google.com (mail-qg0-x22f.google.com [IPv6:2607:f8b0:400d:c04::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C18431DEC for ; Mon, 4 Jan 2016 16:56:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22f.google.com with SMTP id e32so167869434qgf.3 for ; Mon, 04 Jan 2016 08:56:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=YacNuTbVOKiZJUaGS20btzTEc0YTf5GKZgd1f7SpJSg=; b=vEo+lghVtwCtPkHDgoiypS/L04sbp5oRP70T1b92j6kPrv6Yw5N8ow/L17GkkSBodA yVq3BK1uovbJ4VQaSlrrYQSRml3oego2bH2x7d2+GxY8rZui3S83AAtTYuogomgqQIGX HSGB+P9YnuL/PfdknxDdp8t/6sHxmah/C6BmD+Z5xcCGAMsrThQRX+1o6WLMlyLEJoON C1uSizDskjQNy6Z5cxYnM8OHKlu8lV5075TJtlHLEqCdoELYtkzhA/fOftzGKE3pdC3O z1txtbqWvzK7IWOz4/HWCJ+IfavKuNb+ryFeBs9C2AhR3IaPVwFi/JmpEvHisNjc+OVM +9HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YacNuTbVOKiZJUaGS20btzTEc0YTf5GKZgd1f7SpJSg=; b=XOBvuR/n6a4TV8gHZRVu6xk0zC0Bkeib++hx+6xymmXNWAb0KyTTsdxAGWXInpXfCb 69rzqnRdFpR8wvTS0mUus2dcm/lzN0rn2/tPQstD2IpBWf1BR4YYmv7H1+WjCQ9P6tIn RNcfU1xl0FABN7IwIFPu349shohO8hVkFXesqXuPOpNVxoH12MijklTveXyW7PeFEqqB A3H1Gv3LVTze3mE+xZHG3STifZBr4Bte0IhGzOG15PUQ9AgJP2VAxEvgvkbKN6C/OAvB HcmkdUQNTj2cArm1AyvMpa0DXwKzmjQCJm48Ha4hc2+pFESDgzRtE2zyxeXMwDGsRcO1 z/yw== X-Gm-Message-State: ALoCoQmy3Wz2cwBvoApdpi/ZFb0FqLAnwZyzA5hIBnH8nU5dF1g7OUScYqW4MVOGOsoofDSurPXXE57l6cm19DLldgwVe/I5Ug== MIME-Version: 1.0 X-Received: by 10.140.30.197 with SMTP id d63mr116300544qgd.81.1451926589731; Mon, 04 Jan 2016 08:56:29 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 08:56:29 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <568AA373.3060004@freebsd.org> References: <201601031918.u03JImBs012182@repo.freebsd.org> <7fjp-lonn-wny@vfemail.net> <568AA373.3060004@freebsd.org> Date: Mon, 4 Jan 2016 09:56:29 -0700 X-Google-Sender-Auth: jGMc290xKDXFHtOLw0aGIrjR_Gk Message-ID: Subject: Re: svn commit: r293115 - head/etc From: Warner Losh To: Allan Jude Cc: Jan Beich , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:56:31 -0000 On Mon, Jan 4, 2016 at 9:53 AM, Allan Jude wrote: > On 2016-01-04 11:50, Warner Losh wrote: > > > > > > On Mon, Jan 4, 2016 at 1:44 AM, Jan Beich > > wrote: > > > > Warner Losh writes: > > > > > Author: imp > > > Date: Sun Jan 3 19:18:48 2016 > > > New Revision: 293115 > > > URL: https://svnweb.freebsd.org/changeset/base/293115 > > > > > > Log: > > > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is > picked > > > up and can cause issues on boot with the prompts. > > > > Why do you have ~/.profile stuff leaking into rc* boot sequence? > > > > > > Because I though they were in /root/.profile. I was going to quote > > them here. Also, all other instances of rm in the rc files I noticed > > with a quick grep has /bin/rm. > > > > Turns out it is simply rm's default behavior w/o -f to prompt, I think. > > > > Warner > > Prompting is not the default behaviour, but also check /etc/profile > I specifically did before sending. There's nothing in /etc/profile on the affected system. Nor in /root/.profile. However, the files were on a read-only filesystem which is why rm's default behavior of prompting for files it can't delete kicked in. I though there was a stray alias rm rm -i floating around, but was bad and didn't actually look to confirm until a few minutes ago. Warner From owner-svn-src-all@freebsd.org Mon Jan 4 17:00:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A78DA62D37 for ; Mon, 4 Jan 2016 17:00:42 +0000 (UTC) (envelope-from 000001520d954f60-58991ba7-6f57-4b0d-a600-bdd78572695b-000000@amazonses.com) Received: from a9-121.smtp-out.amazonses.com (a9-121.smtp-out.amazonses.com [54.240.9.121]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0287D1238 for ; Mon, 4 Jan 2016 17:00:41 +0000 (UTC) (envelope-from 000001520d954f60-58991ba7-6f57-4b0d-a600-bdd78572695b-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1451926835; h=From:Subject:To:References:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=GSV3k0QuTaj1YWAchXOmcjDljyx0EUQMZ+hOy7aX6BY=; b=WnkckdDeZLxIwFtylNE37ObmcbcFo7eBubEq4x69SqXU+moQvdzaRJV1aud0EfYh RaeiiTmjZODuPsEp0Ppn4iYw1wFp8Dy/vruVl/tWkvMuJHxljy6I+cL+bTmbgQnW+vm e7nl722LFE0PxAmmQzkU0ARTdSRz/GgB4B/01/GA= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1451926835; h=From:Subject:To:References:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=GSV3k0QuTaj1YWAchXOmcjDljyx0EUQMZ+hOy7aX6BY=; b=rz1F9ks4C1Uh1KYWxqgQ3Z9CazRbP+9KXj6hZ1rQixb0K4oSG0m9st3PIbZy0c01 oIKQ3+sM9goB1mzafI0WZiE5M1e+xAvGL640gnlcYgQY6JI6EvG1KZVX6LxKos6xwpj zosBfAbBLzOOyQxxTi2gfJ4D85fhKIcVJAwjCB0c= From: Colin Percival Subject: Re: svn commit: r293115 - head/etc To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601031918.u03JImBs012182@repo.freebsd.org> Message-ID: <000001520d954f60-58991ba7-6f57-4b0d-a600-bdd78572695b-000000@email.amazonses.com> Date: Mon, 4 Jan 2016 17:00:35 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201601031918.u03JImBs012182@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2016.01.04-54.240.9.121 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:00:42 -0000 On 01/03/16 11:18, Warner Losh wrote: > Log: > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > up and can cause issues on boot with the prompts. Huh, I never realized that could be a problem. > Fix the read-only > root case with horrible kludge of mounting rw removing the files, then > mounting ro. The solution I intended when I introduced this (and used elsewhere) was to set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is precisely why it's a shell variable, in fact. Colin Percival > Modified: head/etc/rc > ============================================================================== > --- head/etc/rc Sun Jan 3 19:06:17 2016 (r293114) > +++ head/etc/rc Sun Jan 3 19:18:48 2016 (r293115) > @@ -131,11 +131,14 @@ done > > # Remove the firstboot sentinel, and reboot if it was requested. > if [ -e ${firstboot_sentinel} ]; then > - rm ${firstboot_sentinel} > + [ ${root_rw_mount} = "yes" ] || mount -uw / > + /bin/rm ${firstboot_sentinel} > if [ -e ${firstboot_sentinel}-reboot ]; then > - rm ${firstboot_sentinel}-reboot > + /bin/rm ${firstboot_sentinel}-reboot > + [ ${root_rw_mount} = "yes" ] || mount -ur / > kill -INT 1 > fi > + [ ${root_rw_mount} = "yes" ] || mount -ur / > fi > > echo '' -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Mon Jan 4 17:09:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CFA9A61044 for ; Mon, 4 Jan 2016 17:09:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22d.google.com (mail-qg0-x22d.google.com [IPv6:2607:f8b0:400d:c04::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 568F91C0B for ; Mon, 4 Jan 2016 17:09:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22d.google.com with SMTP id e32so168178090qgf.3 for ; Mon, 04 Jan 2016 09:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=/fGWm9Dquj4lxDdkOIIHqJTCMVWiZay2DsVlt61cwuQ=; b=XwFvNp2Lk7tZWxJBdiU1JezjPY/8HfVjMMa+70nJpm1jJfclvPzT/sZq9eCEX6fx/x P0oWuQPDHrl7dsGves18hMJxnOm8DXtvLVt3zQAgcsIbSo5BfjuS55nSoGL9JK+CJ9tA qCNaRSGtv5Kjo4AfucvlFA34Brb9dZmHCwOpuJ1ofaKE/QfuoKNQqggBxS/GHYI83QVk qsMZrbJEdYSnrdzsFLWmNGEdH7Gr6v9U48xyK2g790nX2OZ4hdJZwHUV4xLHsbDlspkH e3nEpIZSWYJhaeUWd/h4FxynSHrZ3yiNRa/TJWQ4zBLgbiQ8hI9hUBM+4bPSwtx3ez/g uJDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=/fGWm9Dquj4lxDdkOIIHqJTCMVWiZay2DsVlt61cwuQ=; b=bSzBhC57ybY1utYe+IhuVNWeW11SSdJjpu7bCX/k69x60mn5sIxHZZNTryYfl+uEhI 0ps1M8Uc+2cbcBJWeI6/gv6pqUk5fpwiuRQS0g86iepaoPz+MXOBnKzWR0xGuFiJ1sRT vmToXTKJJyZqtr+KjCz0WRjMm9ZRNWxFZrMeD3Ccul7nEaukm6jGoeqMBBgXqW6QjyRP 7dp4/g41HyeQOATrJX4ZZqnDH//gFcDmVbDwc/ULRJmmVPJjB5S+Po1o6ljEO0O0wo14 3LA3b2p/yNsAEfPjJBRZY6jsRrYU0LoAr3IYxGqeLPm8aw/S/2j6kOqoxqB9v/8QYnEe RYxw== X-Gm-Message-State: ALoCoQmomduWkGHGV1anhaJOPWyCY62nhgLPhI/gKlRQF2KA3Gn/v4VjmI+PRQar7c8KtYHwG1pcNvG7WrrUZgXpUuBhSLrUpw== MIME-Version: 1.0 X-Received: by 10.140.141.138 with SMTP id 132mr14429013qhn.74.1451927340411; Mon, 04 Jan 2016 09:09:00 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 09:09:00 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <000001520d9553a7-b3ef495a-89d6-44ec-91c1-c4f9afc2c55b-000000@email.amazonses.com> References: <201601031918.u03JImBs012182@repo.freebsd.org> <000001520d9553a7-b3ef495a-89d6-44ec-91c1-c4f9afc2c55b-000000@email.amazonses.com> Date: Mon, 4 Jan 2016 10:09:00 -0700 X-Google-Sender-Auth: HW5l5CK01HQTVlpQkVDodX2-Or8 Message-ID: Subject: Re: svn commit: r293115 - head/etc From: Warner Losh To: Colin Percival Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:09:01 -0000 On Mon, Jan 4, 2016 at 10:00 AM, Colin Percival wrote: > On 01/03/16 11:18, Warner Losh wrote: > > Log: > > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > > up and can cause issues on boot with the prompts. > > Huh, I never realized that could be a problem. It can, but it was a false positive here. /bin/sh always sources them, so if you'd added an alias, it would be hit here. > > > Fix the read-only > > root case with horrible kludge of mounting rw removing the files, then > > mounting ro. > > The solution I intended when I introduced this (and used elsewhere) was to > set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is > precisely > why it's a shell variable, in fact. Except that's not exactly useful. NanoBSD boots with no filesystems writable that are permanent. So I could set it to /var/firstboot or something like that, and the error would go away. However, that wouldn't solve the problem because /var is repopulated from base seed files every boot with NanoBSD so we'd get firstboot behavior on every single boot. Or, we could remount / rw and remove the file and remount it ro when a read-only root was requested. I wondered to myself why we didn't use the same mechanism as nextboot for this feature. Do you know? Warner From owner-svn-src-all@freebsd.org Mon Jan 4 17:17:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56963A613EA; Mon, 4 Jan 2016 17:17:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2414810F9; Mon, 4 Jan 2016 17:17:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04HH7f9074529; Mon, 4 Jan 2016 17:17:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04HH7Mi074528; Mon, 4 Jan 2016 17:17:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201601041717.u04HH7Mi074528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 4 Jan 2016 17:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293164 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:17:08 -0000 Author: adrian Date: Mon Jan 4 17:17:06 2016 New Revision: 293164 URL: https://svnweb.freebsd.org/changeset/base/293164 Log: [net80211] fix duration field; it's unsigned, but not long. Submitted by: Imre Vadasz Obtained from: DragonflyBSD Modified: head/sys/net80211/ieee80211_scan_sw.c Modified: head/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sw.c Mon Jan 4 16:51:56 2016 (r293163) +++ head/sys/net80211/ieee80211_scan_sw.c Mon Jan 4 17:17:06 2016 (r293164) @@ -359,7 +359,7 @@ ieee80211_swscan_bg_scan(const struct ie duration = IEEE80211_SCAN_OFFCHANNEL; IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, - "%s: %s scan, ticks %u duration %lu\n", __func__, + "%s: %s scan, ticks %u duration %u\n", __func__, ss->ss_flags & IEEE80211_SCAN_ACTIVE ? "active" : "passive", ticks, duration); From owner-svn-src-all@freebsd.org Mon Jan 4 17:22:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81D6BA61697; Mon, 4 Jan 2016 17:22:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E377162D; Mon, 4 Jan 2016 17:22:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04HM61H078252; Mon, 4 Jan 2016 17:22:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04HM6oA078251; Mon, 4 Jan 2016 17:22:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601041722.u04HM6oA078251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Jan 2016 17:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293165 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:22:07 -0000 Author: emaste Date: Mon Jan 4 17:22:06 2016 New Revision: 293165 URL: https://svnweb.freebsd.org/changeset/base/293165 Log: loader.efi: support non-contiguous console modes Submitted by: Toomas Soome MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4760 Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Mon Jan 4 17:17:06 2016 (r293164) +++ head/sys/boot/efi/loader/main.c Mon Jan 4 17:22:06 2016 (r293165) @@ -359,10 +359,11 @@ command_mode(int argc, char *argv[]) return (CMD_OK); } - for (i = 0; ; i++) { + printf("Current mode: %d\n", conout->Mode->Mode); + for (i = 0; i <= conout->Mode->MaxMode; i++) { status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) - break; + continue; printf("Mode %d: %u columns, %u rows\n", i, (unsigned)cols, (unsigned)rows); } From owner-svn-src-all@freebsd.org Mon Jan 4 17:23:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A952FA61713; Mon, 4 Jan 2016 17:23:11 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7704B18EB; Mon, 4 Jan 2016 17:23:11 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04HNAqR078940; Mon, 4 Jan 2016 17:23:10 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04HNAxG078939; Mon, 4 Jan 2016 17:23:10 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601041723.u04HNAxG078939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 Jan 2016 17:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293166 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:23:11 -0000 Author: melifaro Date: Mon Jan 4 17:23:10 2016 New Revision: 293166 URL: https://svnweb.freebsd.org/changeset/base/293166 Log: Maintain consistent behavior: make fib4_lookup_nh_ext() return rt_ifp pointer by default, as done by other fib lookup functions. Modified: head/sys/netinet/in_fib.c Modified: head/sys/netinet/in_fib.c ============================================================================== --- head/sys/netinet/in_fib.c Mon Jan 4 17:22:06 2016 (r293165) +++ head/sys/netinet/in_fib.c Mon Jan 4 17:23:10 2016 (r293166) @@ -97,7 +97,10 @@ fib4_rte_to_nh_extended(struct rtentry * struct sockaddr_in *gw; struct in_ifaddr *ia; - pnh4->nh_ifp = rte->rt_ifa->ifa_ifp; + if ((flags & NHR_IFAIF) != 0) + pnh4->nh_ifp = rte->rt_ifa->ifa_ifp; + else + pnh4->nh_ifp = rte->rt_ifp; pnh4->nh_mtu = min(rte->rt_mtu, rte->rt_ifp->if_mtu); if (rte->rt_flags & RTF_GATEWAY) { gw = (struct sockaddr_in *)rte->rt_gateway; From owner-svn-src-all@freebsd.org Mon Jan 4 17:25:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74DAAA61869; Mon, 4 Jan 2016 17:25:33 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4767B1BC2; Mon, 4 Jan 2016 17:25:33 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04HPWhj079170; Mon, 4 Jan 2016 17:25:32 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04HPWV4079169; Mon, 4 Jan 2016 17:25:32 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601041725.u04HPWV4079169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 Jan 2016 17:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293167 - head/sys/netgraph/netflow X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:25:33 -0000 Author: melifaro Date: Mon Jan 4 17:25:32 2016 New Revision: 293167 URL: https://svnweb.freebsd.org/changeset/base/293167 Log: Fix route lookup condition: do IPv6 route lookup for source based on NG_NETFLOW_CONF_NOSRCLOOKUP instead of NG_NETFLOW_CONF_NODSTLOOKUP. Modified: head/sys/netgraph/netflow/netflow.c Modified: head/sys/netgraph/netflow/netflow.c ============================================================================== --- head/sys/netgraph/netflow/netflow.c Mon Jan 4 17:23:10 2016 (r293166) +++ head/sys/netgraph/netflow/netflow.c Mon Jan 4 17:25:32 2016 (r293167) @@ -451,7 +451,7 @@ hash6_insert(priv_p priv, struct flow_ha } } - if ((flags & NG_NETFLOW_CONF_NODSTLOOKUP) == 0) { + if ((flags & NG_NETFLOW_CONF_NOSRCLOOKUP) == 0) { /* Do route lookup on source address, to fill in src_mask. */ bzero(&rin6, sizeof(struct route_in6)); src = (struct sockaddr_in6 *)&rin6.ro_dst; From owner-svn-src-all@freebsd.org Mon Jan 4 17:42:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8F72A61E26; Mon, 4 Jan 2016 17:42:13 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5121623; Mon, 4 Jan 2016 17:42:13 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04HgC8U085262; Mon, 4 Jan 2016 17:42:12 GMT (envelope-from dfr@FreeBSD.org) Received: (from dfr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04HgCZ7085261; Mon, 4 Jan 2016 17:42:12 GMT (envelope-from dfr@FreeBSD.org) Message-Id: <201601041742.u04HgCZ7085261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dfr set sender to dfr@FreeBSD.org using -f From: Doug Rabson Date: Mon, 4 Jan 2016 17:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293168 - head/lib/libgssapi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:42:13 -0000 Author: dfr Date: Mon Jan 4 17:42:12 2016 New Revision: 293168 URL: https://svnweb.freebsd.org/changeset/base/293168 Log: Fix a memory leak in gss_release_oid_set Modified: head/lib/libgssapi/gss_release_oid_set.c Modified: head/lib/libgssapi/gss_release_oid_set.c ============================================================================== --- head/lib/libgssapi/gss_release_oid_set.c Mon Jan 4 17:25:32 2016 (r293167) +++ head/lib/libgssapi/gss_release_oid_set.c Mon Jan 4 17:42:12 2016 (r293168) @@ -32,15 +32,25 @@ OM_uint32 gss_release_oid_set(OM_uint32 *minor_status, - gss_OID_set *set) + gss_OID_set *setp) { + gss_OID_set set; + gss_OID o; + size_t i; *minor_status = 0; - if (set && *set) { - if ((*set)->elements) - free((*set)->elements); - free(*set); - *set = GSS_C_NO_OID_SET; + if (setp) { + set = *setp; + if (set) { + for (i = 0; i < set->count; i++) { + o = &set->elements[i]; + if (o->elements) + free(o->elements); + } + free(set->elements); + free(set); + *setp = GSS_C_NO_OID_SET; + } } return (GSS_S_COMPLETE); } From owner-svn-src-all@freebsd.org Mon Jan 4 17:55:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8189A62342; Mon, 4 Jan 2016 17:55:32 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8538B1DA8; Mon, 4 Jan 2016 17:55:32 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C34B9B8090; Mon, 4 Jan 2016 18:55:29 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id AD5E028494; Mon, 4 Jan 2016 18:55:29 +0100 (CET) Date: Mon, 4 Jan 2016 18:55:29 +0100 From: Jilles Tjoelker To: Warner Losh Cc: Colin Percival , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r293115 - head/etc Message-ID: <20160104175529.GA10000@stack.nl> References: <201601031918.u03JImBs012182@repo.freebsd.org> <000001520d9553a7-b3ef495a-89d6-44ec-91c1-c4f9afc2c55b-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:55:32 -0000 On Mon, Jan 04, 2016 at 10:09:00AM -0700, Warner Losh wrote: > On Mon, Jan 4, 2016 at 10:00 AM, Colin Percival > wrote: > > On 01/03/16 11:18, Warner Losh wrote: > > > Log: > > > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > > > up and can cause issues on boot with the prompts. > > Huh, I never realized that could be a problem. > It can, but it was a false positive here. /bin/sh always sources them, > so if you'd added an alias, it would be hit here. A non-interactive non-login sh does not source any startup files. Login shells source /etc/profile and ~/.profile and interactive shells source the file whose name is in the ENV environment variable. The prompt comes from trying to remove an existing file which is not writable. It can be suppressed by using rm -f instead of rm. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Mon Jan 4 17:58:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49F62A623F0 for ; Mon, 4 Jan 2016 17:58:36 +0000 (UTC) (envelope-from 000001520dbaa813-9130e194-040b-43fb-bca8-ea6d92054d7f-000000@amazonses.com) Received: from a9-40.smtp-out.amazonses.com (a9-40.smtp-out.amazonses.com [54.240.9.40]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11A101FA4 for ; Mon, 4 Jan 2016 17:58:35 +0000 (UTC) (envelope-from 000001520dbaa813-9130e194-040b-43fb-bca8-ea6d92054d7f-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1451929282; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=A0OpwxBHpxI3McOcuL0s1rPa14kh/Z0XACCtwEgZVGE=; b=j1WJm2foSU5QhVe64CAJBbXpCGfn+xS4cED5lwx1lXJi5E9jc7Ey9MPBjAf0cfyb BzwDr/vEzcVzf1uONU2dp5PrKwmQqWOpHa2dpHq2xblmBRnZLUX+B9sVWQjYYCx52YU 7r3ySg4uSM4q2K2zx0g/76QJr0v+oOy39WWwYJxk= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1451929282; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=A0OpwxBHpxI3McOcuL0s1rPa14kh/Z0XACCtwEgZVGE=; b=b7SeTQzF5VQ7XFzD5intkpQg8d9VIh1u7HtrIXBb7AQul+0/R69B/Csd6E6KV008 7BD+9n/2u1Dv+RLPZ08P6KaqrfQ1Q7giaLxpkpLHvKXPPVKtIEWknLZGS2U/e5acS73 CW1Ws4P8OMRcOj5JzgW0/wUZx4Bo5R1hLzwyWSFU= Subject: Re: svn commit: r293115 - head/etc To: Warner Losh References: <201601031918.u03JImBs012182@repo.freebsd.org> <000001520d9553a7-b3ef495a-89d6-44ec-91c1-c4f9afc2c55b-000000@email.amazonses.com> Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Colin Percival Message-ID: <000001520dbaa813-9130e194-040b-43fb-bca8-ea6d92054d7f-000000@email.amazonses.com> Date: Mon, 4 Jan 2016 17:41:22 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2016.01.04-54.240.9.40 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:58:36 -0000 On 01/04/16 09:09, Warner Losh wrote: > On Mon, Jan 4, 2016 at 10:00 AM, Colin Percival > wrote: > On 01/03/16 11:18, Warner Losh wrote: > > Fix the read-only > > root case with horrible kludge of mounting rw removing the files, then > > mounting ro. > > The solution I intended when I introduced this (and used elsewhere) was to > set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is precisely > why it's a shell variable, in fact. > > Except that's not exactly useful. NanoBSD boots with no filesystems writable > that are permanent. So I could set it to /var/firstboot or something like that, > and the error would go away. However, that wouldn't solve the problem > because /var is repopulated from base seed files every boot with NanoBSD > so we'd get firstboot behavior on every single boot. Or, we could remount > / rw and remove the file and remount it ro when a read-only root was > requested. Huh, ok. I assumed that you had a /conf/ or something like that for storing persistent configuration data. > I wondered to myself why we didn't use the same mechanism as nextboot > for this feature. Do you know? Doesn't that still write to the filesystem? -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Mon Jan 4 18:32:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F5C2A60245; Mon, 4 Jan 2016 18:32:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2625D1852; Mon, 4 Jan 2016 18:32:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04IWOlh001032; Mon, 4 Jan 2016 18:32:24 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04IWOSQ001031; Mon, 4 Jan 2016 18:32:24 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601041832.u04IWOSQ001031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 Jan 2016 18:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293169 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 18:32:25 -0000 Author: melifaro Date: Mon Jan 4 18:32:24 2016 New Revision: 293169 URL: https://svnweb.freebsd.org/changeset/base/293169 Log: Finish r293098: make ip6_getpmtu() and ip6_getpmtu_ctl() use new routing API Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Jan 4 17:42:12 2016 (r293168) +++ head/sys/netinet6/ip6_output.c Mon Jan 4 18:32:24 2016 (r293169) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1225,27 +1226,24 @@ ip6_insertfraghdr(struct mbuf *m0, struc static int ip6_getpmtu_ctl(u_int fibnum, struct in6_addr *dst, u_long *mtup) { - struct route_in6 ro_pmtu; + struct nhop6_extended nh6; + struct in6_addr kdst; + uint32_t scopeid; struct ifnet *ifp; - struct sockaddr_in6 *sa6_dst; u_long mtu; + int error; - sa6_dst = (struct sockaddr_in6 *)&ro_pmtu.ro_dst; - bzero(sa6_dst, sizeof(*sa6_dst)); - sa6_dst->sin6_family = AF_INET6; - sa6_dst->sin6_len = sizeof(struct sockaddr_in6); - sa6_dst->sin6_addr = *dst; - - in6_rtalloc(&ro_pmtu, fibnum); - - if (ro_pmtu.ro_rt == NULL) + in6_splitscope(dst, &kdst, &scopeid); + if (fib6_lookup_nh_ext(fibnum, &kdst, scopeid, NHR_REF, 0, &nh6) != 0) return (EHOSTUNREACH); - ifp = ro_pmtu.ro_rt->rt_ifp; - mtu = ro_pmtu.ro_rt->rt_mtu; - RO_RTFREE(&ro_pmtu); + ifp = nh6.nh_ifp; + mtu = nh6.nh_mtu; - return (ip6_calcmtu(ifp, dst, mtu, mtup, NULL)); + error = ip6_calcmtu(ifp, dst, mtu, mtup, NULL); + fib6_free_nh_ext(fibnum, &nh6); + + return (error); } /* @@ -1263,6 +1261,9 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, i struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, int *alwaysfragp, u_int fibnum) { + struct nhop6_basic nh6; + struct in6_addr kdst; + uint32_t scopeid; struct sockaddr_in6 *sa6_dst; u_long mtu; @@ -1284,12 +1285,13 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, i sa6_dst->sin6_len = sizeof(struct sockaddr_in6); sa6_dst->sin6_addr = *dst; - in6_rtalloc(ro_pmtu, fibnum); - if (ro_pmtu->ro_rt) { - mtu = ro_pmtu->ro_rt->rt_mtu; - RO_RTFREE(ro_pmtu); - } + in6_splitscope(dst, &kdst, &scopeid); + if (fib6_lookup_nh_basic(fibnum, &kdst, scopeid, 0, 0, + &nh6) == 0) + ro_pmtu->ro_mtu = nh6.nh_mtu; } + + mtu = ro_pmtu->ro_mtu; } if (ro_pmtu->ro_rt) From owner-svn-src-all@freebsd.org Mon Jan 4 18:34:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92F3EA603A9; Mon, 4 Jan 2016 18:34:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63C6B1B1B; Mon, 4 Jan 2016 18:34:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04IYR3T001154; Mon, 4 Jan 2016 18:34:27 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04IYRQY001153; Mon, 4 Jan 2016 18:34:27 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601041834.u04IYRQY001153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 4 Jan 2016 18:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293170 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 18:34:28 -0000 Author: brueffer Date: Mon Jan 4 18:34:27 2016 New Revision: 293170 URL: https://svnweb.freebsd.org/changeset/base/293170 Log: Add rtwn(4) to the hardware list. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Jan 4 18:32:24 2016 (r293169) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Jan 4 18:34:27 2016 (r293170) @@ -1017,6 +1017,9 @@ &hwlist.rsu; + Realtek RTL8188CE based PCIe IEEE 802.11b/g/n wireless network + adapters (&man.rtwn.4; driver) + &hwlist.rum; &hwlist.run; From owner-svn-src-all@freebsd.org Mon Jan 4 19:04:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DF00A60CCB; Mon, 4 Jan 2016 19:04:34 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A69418FE; Mon, 4 Jan 2016 19:04:33 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04J4X1w009996; Mon, 4 Jan 2016 19:04:33 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04J4XZa009995; Mon, 4 Jan 2016 19:04:33 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601041904.u04J4XZa009995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 4 Jan 2016 19:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293171 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 19:04:34 -0000 Author: brueffer Date: Mon Jan 4 19:04:33 2016 New Revision: 293171 URL: https://svnweb.freebsd.org/changeset/base/293171 Log: Don't build rtwnfw if building without binary blobs. rtwnfw got added in r293009 and depends on source-less and non-free microcode in sys/contrib/dev/rtwn. PR: 205874 Submitted by: Fabian Keil Obtained from: ElectroBSD Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jan 4 18:34:27 2016 (r293170) +++ head/sys/modules/Makefile Mon Jan 4 19:04:33 2016 (r293171) @@ -312,7 +312,7 @@ SUBDIR= \ reiserfs \ rl \ rtwn \ - rtwnfw \ + ${_rtwnfw} \ ${_s3} \ ${_safe} \ ${_sbni} \ @@ -484,6 +484,7 @@ _fxp= fxp _ispfw= ispfw _mwlfw= mwlfw _ralfw= ralfw +_rtwnfw= rtwnfw _sf= sf _ti= ti _txp= txp From owner-svn-src-all@freebsd.org Mon Jan 4 19:38:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 185BBA618AD; Mon, 4 Jan 2016 19:38:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC6191A3F; Mon, 4 Jan 2016 19:38:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04JcieV018898; Mon, 4 Jan 2016 19:38:44 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04JciwF018897; Mon, 4 Jan 2016 19:38:44 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601041938.u04JciwF018897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 4 Jan 2016 19:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293173 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 19:38:46 -0000 Author: gjb Date: Mon Jan 4 19:38:44 2016 New Revision: 293173 URL: https://svnweb.freebsd.org/changeset/base/293173 Log: Fix path to include .OBJDIR to avoid polluting the source tree during 'make release'. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Jan 4 19:19:48 2016 (r293172) +++ head/release/Makefile Mon Jan 4 19:38:44 2016 (r293173) @@ -281,7 +281,7 @@ ftp: packagesystem cp *.txz MANIFEST ftp release: real-release vm-release cloudware-release - touch ${.TARGET} + touch ${.OBJDIR}/${.TARGET} real-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj From owner-svn-src-all@freebsd.org Mon Jan 4 20:05:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AE89A6215A; Mon, 4 Jan 2016 20:05:42 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE8191B27; Mon, 4 Jan 2016 20:05:41 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04K5eHd027378; Mon, 4 Jan 2016 20:05:40 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04K5evA027370; Mon, 4 Jan 2016 20:05:40 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201601042005.u04K5evA027370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 4 Jan 2016 20:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293174 - in stable/10: contrib/bmake contrib/bmake/mk usr.bin/bmake X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 20:05:42 -0000 Author: sjg Date: Mon Jan 4 20:05:40 2016 New Revision: 293174 URL: https://svnweb.freebsd.org/changeset/base/293174 Log: bmake 20151220 Modified: stable/10/contrib/bmake/ChangeLog stable/10/contrib/bmake/Makefile stable/10/contrib/bmake/mk/ChangeLog stable/10/contrib/bmake/mk/auto.obj.mk stable/10/contrib/bmake/mk/install-mk stable/10/contrib/bmake/os.sh stable/10/contrib/bmake/suff.c stable/10/usr.bin/bmake/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bmake/ChangeLog ============================================================================== --- stable/10/contrib/bmake/ChangeLog Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/ChangeLog Mon Jan 4 20:05:40 2016 (r293174) @@ -1,3 +1,9 @@ +2015-12-20 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151220 + Merge with NetBSD make, pick up + o suff.c: re-initialize suffNull when clearing suffixes. + 2015-12-01 Simon J. Gerraty * Makefile (MAKE_VERSION): 20151201 Modified: stable/10/contrib/bmake/Makefile ============================================================================== --- stable/10/contrib/bmake/Makefile Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/Makefile Mon Jan 4 20:05:40 2016 (r293174) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ +# $Id: Makefile,v 1.49 2015/12/20 22:54:40 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151201 +MAKE_VERSION= 20151220 PROG= bmake Modified: stable/10/contrib/bmake/mk/ChangeLog ============================================================================== --- stable/10/contrib/bmake/mk/ChangeLog Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/mk/ChangeLog Mon Jan 4 20:05:40 2016 (r293174) @@ -1,3 +1,9 @@ +2015-12-12 Simon J. Gerraty + + * install-mk (MK_VERSION): 20151212 + * auto.obj.mk: do not require MAKEOBJDIRPREFIX to exist. + only apply :tA to __objdir when comparing to .OBJDIR + 2015-11-14 Simon J. Gerraty * install-mk (MK_VERSION): 20151111 Modified: stable/10/contrib/bmake/mk/auto.obj.mk ============================================================================== --- stable/10/contrib/bmake/mk/auto.obj.mk Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/mk/auto.obj.mk Mon Jan 4 20:05:40 2016 (r293174) @@ -1,4 +1,4 @@ -# $Id: auto.obj.mk,v 1.11 2015/06/16 06:28:21 sjg Exp $ +# $Id: auto.obj.mk,v 1.12 2015/12/16 01:57:06 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -40,12 +40,12 @@ MKOBJDIRS= auto .if !defined(NOOBJ) && !defined(NO_OBJ) && ${MKOBJDIRS:Uno} == auto # Use __objdir here so it is easier to tweak without impacting # the logic. -.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}) +.if !empty(MAKEOBJDIRPREFIX) __objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR} .endif __objdir?= ${MAKEOBJDIR:Uobj} -__objdir:= ${__objdir:tA} -.if ${.OBJDIR} != ${__objdir} +__objdir:= ${__objdir} +.if ${.OBJDIR:tA} != ${__objdir:tA} # We need to chdir, make the directory if needed .if !exists(${__objdir}/) && \ (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "") @@ -53,11 +53,10 @@ __objdir:= ${__objdir:tA} __objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \ ${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \ ${Mkdirs}; Mkdirs ${__objdir} -__objdir:= ${__objdir:tA} .endif # This causes make to use the specified directory as .OBJDIR .OBJDIR: ${__objdir} -.if ${.OBJDIR} != ${__objdir} && ${__objdir_made:Uno:M${__objdir}/*} != "" +.if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != "" .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif .endif Modified: stable/10/contrib/bmake/mk/install-mk ============================================================================== --- stable/10/contrib/bmake/mk/install-mk Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/mk/install-mk Mon Jan 4 20:05:40 2016 (r293174) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.117 2015/11/14 18:09:57 sjg Exp $ +# $Id: install-mk,v 1.118 2015/12/16 01:57:06 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20151111 +MK_VERSION=20151212 OWNER= GROUP= MODE=444 Modified: stable/10/contrib/bmake/os.sh ============================================================================== --- stable/10/contrib/bmake/os.sh Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/os.sh Mon Jan 4 20:05:40 2016 (r293174) @@ -17,7 +17,7 @@ # Simon J. Gerraty # RCSid: -# $Id: os.sh,v 1.49 2015/10/25 00:05:40 sjg Exp $ +# $Id: os.sh,v 1.50 2015/12/17 17:06:29 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -56,10 +56,10 @@ Which() { case "$1" in /*) test $t $1 && echo $1;; *) - # some shells cannot correctly handle `IFS` - # in conjunction with the for loop. - _dirs=`IFS=:; echo ${2:-$PATH}` - for d in $_dirs + # some shells cannot correctly handle `IFS` + # in conjunction with the for loop. + _dirs=`IFS=:; echo ${2:-$PATH}` + for d in $_dirs do test $t $d/$1 && { echo $d/$1; break; } done @@ -70,11 +70,11 @@ Which() { # tr is insanely non-portable wrt char classes, so we need to # spell out the alphabet. sed y/// would work too. toUpper() { - ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ + ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ } toLower() { - ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz + ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz } K= @@ -91,7 +91,7 @@ SunOS) export CHOWN # Great! Solaris keeps moving arch(1) - # should just bite the bullet and use uname -p + # should just bite the bullet and use uname -p arch=`Which arch /usr/bin:/usr/ucb` MAILER=/usr/ucb/Mail @@ -105,8 +105,8 @@ SunOS) MACHINE=$MACHINE_ARCH ;; 4*) - MACHINE_ARCH=`arch` - ;; + MACHINE_ARCH=`arch` + ;; 5*) K=-k LOCAL_FS=ufs @@ -116,8 +116,8 @@ SunOS) # overwriting an existing file!!!!! We want one that works! test -x /usr/xpg4/bin/ln && LN=${LN:-/usr/xpg4/bin/ln} # wonderful, 5.8's tr again require's []'s - # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set! - # use toUpper/toLower instead. + # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set! + # use toUpper/toLower instead. ;; esac case "$OS/$MACHINE_ARCH" in @@ -142,9 +142,9 @@ SunOS) SHARE_ARCH=$OS/$HOST ;; OpenBSD) - arch=`Which arch /usr/bin:/usr/ucb:$PATH` - MACHINE_ARCH=`$arch -s` - ;; + arch=`Which arch /usr/bin:/usr/ucb:$PATH` + MACHINE_ARCH=`$arch -s` + ;; esac NAWK=awk export NAWK @@ -218,17 +218,25 @@ export HOST_TARGET case `echo -n .` in -n*) N=; C="\c";; *) N=-n; C=;; esac -export HOSTNAME HOST +Echo() { + case "$1" in + -n) _n=$N _c=$C; shift;; + *) _n= _c=;; + esac + echo $_n "$@" $_c +} + +export HOSTNAME HOST export OS MACHINE MACHINE_ARCH OSREL OSMAJOR LOCAL_FS TMP_DIRS MAILER N C K PS_AXC export LN SHARE_ARCH TR case /$0 in */os.sh) - for v in $* + for v in $* do - eval vv=\$$v - echo "$v='$vv'" + eval vv=\$$v + echo "$v='$vv'" done - ;; + ;; esac Modified: stable/10/contrib/bmake/suff.c ============================================================================== --- stable/10/contrib/bmake/suff.c Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/suff.c Mon Jan 4 20:05:40 2016 (r293174) @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -553,7 +553,20 @@ Suff_ClearSuffixes(void) #endif sufflist = Lst_Init(FALSE); sNum = 0; - suffNull = emptySuff; + if (suffNull) + SuffFree(suffNull); + emptySuff = suffNull = bmake_malloc(sizeof(Suff)); + + suffNull->name = bmake_strdup(""); + suffNull->nameLen = 0; + suffNull->searchPath = Lst_Init(FALSE); + Dir_Concat(suffNull->searchPath, dirSearchPath); + suffNull->children = Lst_Init(FALSE); + suffNull->parents = Lst_Init(FALSE); + suffNull->ref = Lst_Init(FALSE); + suffNull->sNum = sNum++; + suffNull->flags = SUFF_NULL; + suffNull->refCount = 1; } /*- @@ -2524,32 +2537,18 @@ Suff_SetNull(char *name) void Suff_Init(void) { - sufflist = Lst_Init(FALSE); #ifdef CLEANUP suffClean = Lst_Init(FALSE); #endif srclist = Lst_Init(FALSE); transforms = Lst_Init(FALSE); - sNum = 0; /* * Create null suffix for single-suffix rules (POSIX). The thing doesn't * actually go on the suffix list or everyone will think that's its * suffix. */ - emptySuff = suffNull = bmake_malloc(sizeof(Suff)); - - suffNull->name = bmake_strdup(""); - suffNull->nameLen = 0; - suffNull->searchPath = Lst_Init(FALSE); - Dir_Concat(suffNull->searchPath, dirSearchPath); - suffNull->children = Lst_Init(FALSE); - suffNull->parents = Lst_Init(FALSE); - suffNull->ref = Lst_Init(FALSE); - suffNull->sNum = sNum++; - suffNull->flags = SUFF_NULL; - suffNull->refCount = 1; - + Suff_ClearSuffixes(); } Modified: stable/10/usr.bin/bmake/Makefile ============================================================================== --- stable/10/usr.bin/bmake/Makefile Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/usr.bin/bmake/Makefile Mon Jan 4 20:05:40 2016 (r293174) @@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR} CLEANDIRS+= FreeBSD CLEANFILES+= bootstrap -# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ +# $Id: Makefile,v 1.49 2015/12/20 22:54:40 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151201 +MAKE_VERSION= 20151220 PROG?= ${.CURDIR:T} From owner-svn-src-all@freebsd.org Mon Jan 4 20:21:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22576A62756 for ; Mon, 4 Jan 2016 20:21:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC22515C5 for ; Mon, 4 Jan 2016 20:21:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk0-x22b.google.com with SMTP id p187so252755639qkd.1 for ; Mon, 04 Jan 2016 12:21:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Fpvihg7NHki7Op/1ikS3zqRl5S+BCzOPSSvkwCPfxqI=; b=ebsSWTqwHrgDPwNDXTIum3h6hSwE/LYg+BEUhQEEGOeErE+ae3ze/4TG9EeyR4Qw2Z tIud8sjtCF0vH9oT7EZiUGG/cY+zosyxnmtvqfbl3EEzQHDA1itGJaMJ2T06PsF0ab9g 7d9wylJsIwrt8Z4u/snU+wdEZSKersSN6yrXgRYfhCl/X746tRayQz7IerIt4pvHvAPC 7LZ4v91Oun52WQOUBOYA25ZwGbjgdm3KrUUZj6SAelyy+lOLEnNCqShajH2zEu3m0UFT TIqxmWlJ1L35ozW7tGIQn3Wup0hS0J5ipEW8kNkshsP1i1o4Gjb/tRIM93xi4/IdjHxk WniA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Fpvihg7NHki7Op/1ikS3zqRl5S+BCzOPSSvkwCPfxqI=; b=P0kJE9DTrdQ1KBin0TpR1wcnD1selI92gjhYChPAfBrOzb9uIrQ0kLNTV8PEwyLDPZ QBfFbQ/+1V7H/qoaUGIIjTItvR2SQNHJqK+UTzNQE0u6gDgtf6Jqpb+5zud/ku32TxWR h8lTfvMIsDYTOD/XtN3cCIejzQH5UUrjvN83RbzydQbaKgMDHN5KnpPI/FG4OanOW2ap pJgpkkqsNTCNgBUy7lCfo86p016i9ZEXTKtEWEYuQafcPbEMkNqYy8S3DPjyS+AThDpX g+P+WflHpjC/qtqsRvGkTNp71UKPtxJa+UX//tHWpJona8dL7P92sZ7piUmy9wNU+G6e L9+A== X-Gm-Message-State: ALoCoQmnUyK8q60pGiFNhsICqWyxVv60cl9XvSnGDv3RF0UCnUq1udVqryufgGzNCk527fu1EoM1BJEl/94+8rq7Vl31kc817Q== MIME-Version: 1.0 X-Received: by 10.55.81.87 with SMTP id f84mr16660872qkb.10.1451938876824; Mon, 04 Jan 2016 12:21:16 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 12:21:16 -0800 (PST) X-Originating-IP: [2601:280:4900:3700:a51c:df79:65a:a353] In-Reply-To: <000001520dbaad1a-55cdc7aa-a009-4672-a226-cb140785c55c-000000@email.amazonses.com> References: <201601031918.u03JImBs012182@repo.freebsd.org> <000001520d9553a7-b3ef495a-89d6-44ec-91c1-c4f9afc2c55b-000000@email.amazonses.com> <000001520dbaad1a-55cdc7aa-a009-4672-a226-cb140785c55c-000000@email.amazonses.com> Date: Mon, 4 Jan 2016 13:21:16 -0700 X-Google-Sender-Auth: YyJgoVTOtpfT-mXb2YFEUHB5xr0 Message-ID: Subject: Re: svn commit: r293115 - head/etc From: Warner Losh To: Colin Percival Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 20:21:18 -0000 On Mon, Jan 4, 2016 at 10:41 AM, Colin Percival wrote: > On 01/04/16 09:09, Warner Losh wrote: > > On Mon, Jan 4, 2016 at 10:00 AM, Colin Percival > > wrote: > > On 01/03/16 11:18, Warner Losh wrote: > > > Fix the read-only > > > root case with horrible kludge of mounting rw removing the > files, then > > > mounting ro. > > > > The solution I intended when I introduced this (and used elsewhere) > was to > > set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is > precisely > > why it's a shell variable, in fact. > > > > Except that's not exactly useful. NanoBSD boots with no filesystems > writable > > that are permanent. So I could set it to /var/firstboot or something > like that, > > and the error would go away. However, that wouldn't solve the problem > > because /var is repopulated from base seed files every boot with NanoBSD > > so we'd get firstboot behavior on every single boot. Or, we could remount > > / rw and remove the file and remount it ro when a read-only root was > > requested. > > Huh, ok. I assumed that you had a /conf/ or something like that for > storing > persistent configuration data. > It does. But all that's mirrored in a MFS and it takes an explicit command to write it all back. This is poorly matched with where the firstboot files are actually removed. > > I wondered to myself why we didn't use the same mechanism as nextboot > > for this feature. Do you know? > > Doesn't that still write to the filesystem? > So it does. I thought it mucked about with flags and such. Warner From owner-svn-src-all@freebsd.org Mon Jan 4 20:34:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0FDCA62CB2; Mon, 4 Jan 2016 20:34:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FA9E17F7; Mon, 4 Jan 2016 20:34:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04KYeIg036177; Mon, 4 Jan 2016 20:34:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04KYenm036176; Mon, 4 Jan 2016 20:34:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601042034.u04KYenm036176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 4 Jan 2016 20:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293176 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 20:34:41 -0000 Author: tuexen Date: Mon Jan 4 20:34:40 2016 New Revision: 293176 URL: https://svnweb.freebsd.org/changeset/base/293176 Log: Get struct sctp_net_route in sync with struct route again. Modified: head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Mon Jan 4 20:31:09 2016 (r293175) +++ head/sys/netinet/sctp_structs.h Mon Jan 4 20:34:40 2016 (r293176) @@ -189,9 +189,11 @@ struct iterator_control { struct sctp_net_route { sctp_rtentry_t *ro_rt; - void *ro_lle; - void *ro_ia; - int ro_flags; + char *ro_prepend; + uint16_t ro_plen; + uint16_t ro_flags; + uint16_t ro_mtu; + uint16_t spare; union sctp_sockstore _l_addr; /* remote peer addr */ struct sctp_ifa *_s_addr; /* our selected src addr */ }; From owner-svn-src-all@freebsd.org Mon Jan 4 21:03:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97179A6188D; Mon, 4 Jan 2016 21:03:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55A821A41; Mon, 4 Jan 2016 21:03:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04L31xa044850; Mon, 4 Jan 2016 21:03:01 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04L31iS044848; Mon, 4 Jan 2016 21:03:01 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601042103.u04L31iS044848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 4 Jan 2016 21:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293177 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:03:02 -0000 Author: avos Date: Mon Jan 4 21:03:01 2016 New Revision: 293177 URL: https://svnweb.freebsd.org/changeset/base/293177 Log: iwm: store pointer for 'struct firmware' instead of 'size_t' and 'void *' pair. Approved by: adrian (mentor) Obtained from: DragonFlyBSD Differential Revision: https://reviews.freebsd.org/D4765 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Jan 4 20:34:40 2016 (r293176) +++ head/sys/dev/iwm/if_iwm.c Mon Jan 4 21:03:01 2016 (r293177) @@ -423,9 +423,8 @@ iwm_set_default_calib(struct iwm_softc * static void iwm_fw_info_free(struct iwm_fw_info *fw) { - firmware_put(fw->fw_rawdata, FIRMWARE_UNLOAD); - fw->fw_rawdata = NULL; - fw->fw_rawsize = 0; + firmware_put(fw->fw_fp, FIRMWARE_UNLOAD); + fw->fw_fp = NULL; /* don't touch fw->fw_status */ memset(fw->fw_sects, 0, sizeof(fw->fw_sects)); } @@ -450,32 +449,30 @@ iwm_read_firmware(struct iwm_softc *sc, msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfwp", 0); fw->fw_status = IWM_FW_STATUS_INPROGRESS; - if (fw->fw_rawdata != NULL) + if (fw->fw_fp != NULL) iwm_fw_info_free(fw); /* * Load firmware into driver memory. - * fw_rawdata and fw_rawsize will be set. + * fw_fp will be set. */ IWM_UNLOCK(sc); fwp = firmware_get(sc->sc_fwname); + IWM_LOCK(sc); if (fwp == NULL) { device_printf(sc->sc_dev, "could not read firmware %s (error %d)\n", sc->sc_fwname, error); - IWM_LOCK(sc); goto out; } - IWM_LOCK(sc); - fw->fw_rawdata = fwp->data; - fw->fw_rawsize = fwp->datasize; + fw->fw_fp = fwp; /* * Parse firmware contents */ - uhdr = (const void *)fw->fw_rawdata; - if (*(const uint32_t *)fw->fw_rawdata != 0 + uhdr = (const void *)fw->fw_fp->data; + if (*(const uint32_t *)fw->fw_fp->data != 0 || le32toh(uhdr->magic) != IWM_TLV_UCODE_MAGIC) { device_printf(sc->sc_dev, "invalid firmware %s\n", sc->sc_fwname); @@ -485,7 +482,7 @@ iwm_read_firmware(struct iwm_softc *sc, sc->sc_fwver = le32toh(uhdr->ver); data = uhdr->data; - len = fw->fw_rawsize - sizeof(*uhdr); + len = fw->fw_fp->datasize - sizeof(*uhdr); while (len >= sizeof(tlv)) { size_t tlv_len; @@ -684,7 +681,7 @@ iwm_read_firmware(struct iwm_softc *sc, out: if (error) { fw->fw_status = IWM_FW_STATUS_NONE; - if (fw->fw_rawdata != NULL) + if (fw->fw_fp != NULL) iwm_fw_info_free(fw); } else fw->fw_status = IWM_FW_STATUS_DONE; @@ -4957,7 +4954,7 @@ iwm_detach_local(struct iwm_softc *sc, i iwm_free_tx_ring(sc, &sc->txq[i]); /* Free firmware */ - if (fw->fw_rawdata != NULL) + if (fw->fw_fp != NULL) iwm_fw_info_free(fw); /* free scheduler */ Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Mon Jan 4 20:34:40 2016 (r293176) +++ head/sys/dev/iwm/if_iwmvar.h Mon Jan 4 21:03:01 2016 (r293177) @@ -159,8 +159,7 @@ enum iwm_ucode_type { }; struct iwm_fw_info { - const void *fw_rawdata; - size_t fw_rawsize; + const struct firmware *fw_fp; int fw_status; struct iwm_fw_sects { From owner-svn-src-all@freebsd.org Mon Jan 4 21:07:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 144F4A61A3E; Mon, 4 Jan 2016 21:07:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D94E41D73; Mon, 4 Jan 2016 21:07:09 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04L79GR045158; Mon, 4 Jan 2016 21:07:09 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04L78vS045157; Mon, 4 Jan 2016 21:07:08 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601042107.u04L78vS045157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 4 Jan 2016 21:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293178 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:07:10 -0000 Author: avos Date: Mon Jan 4 21:07:08 2016 New Revision: 293178 URL: https://svnweb.freebsd.org/changeset/base/293178 Log: iwm: free firmware related resources after uploading it to the hardware iwn(4) / wpi(4) works in the same way (read_firmware() -> hw_init() -> firmware_put()) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4766 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Jan 4 21:03:01 2016 (r293177) +++ head/sys/dev/iwm/if_iwm.c Mon Jan 4 21:07:08 2016 (r293178) @@ -2041,6 +2041,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm sc->sc_uc_current = ucode_type; error = iwm_start_fw(sc, ucode_type); + iwm_fw_info_free(&sc->sc_fw); if (error) { sc->sc_uc_current = old_type; return error; @@ -4936,7 +4937,6 @@ iwm_suspend(device_t dev) static int iwm_detach_local(struct iwm_softc *sc, int do_net80211) { - struct iwm_fw_info *fw = &sc->sc_fw; device_t dev = sc->sc_dev; int i; @@ -4953,11 +4953,7 @@ iwm_detach_local(struct iwm_softc *sc, i for (i = 0; i < nitems(sc->txq); i++) iwm_free_tx_ring(sc, &sc->txq[i]); - /* Free firmware */ - if (fw->fw_fp != NULL) - iwm_fw_info_free(fw); - - /* free scheduler */ + /* Free scheduler */ iwm_free_sched(sc); if (sc->ict_dma.vaddr != NULL) iwm_free_ict(sc); From owner-svn-src-all@freebsd.org Mon Jan 4 21:11:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41B49A61E28; Mon, 4 Jan 2016 21:11:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB0EC1270; Mon, 4 Jan 2016 21:11:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04LBS4b045498; Mon, 4 Jan 2016 21:11:28 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04LBScr045497; Mon, 4 Jan 2016 21:11:28 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601042111.u04LBScr045497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 4 Jan 2016 21:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293179 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:11:29 -0000 Author: avos Date: Mon Jan 4 21:11:27 2016 New Revision: 293179 URL: https://svnweb.freebsd.org/changeset/base/293179 Log: iwn: reduce code duplication in iwn_read_firmware() - Separate 'firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); sc->fw_fp = NULL;' into iwn_unload_firmware(). - Move error handling to the end of iwn_read_firmware(). No functional changes. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4768 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Jan 4 21:07:08 2016 (r293178) +++ head/sys/dev/iwn/if_iwn.c Mon Jan 4 21:11:27 2016 (r293179) @@ -318,6 +318,7 @@ static int iwn_read_firmware_leg(struct static int iwn_read_firmware_tlv(struct iwn_softc *, struct iwn_fw_info *, uint16_t); static int iwn_read_firmware(struct iwn_softc *); +static void iwn_unload_firmware(struct iwn_softc *); static int iwn_clock_wait(struct iwn_softc *); static int iwn_apm_init(struct iwn_softc *); static void iwn_apm_stop_master(struct iwn_softc *); @@ -8200,9 +8201,8 @@ iwn_read_firmware(struct iwn_softc *sc) if (fw->size < sizeof (uint32_t)) { device_printf(sc->sc_dev, "%s: firmware too short: %zu bytes\n", __func__, fw->size); - firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); - sc->fw_fp = NULL; - return EINVAL; + error = EINVAL; + goto fail; } /* Retrieve text and data sections. */ @@ -8214,9 +8214,7 @@ iwn_read_firmware(struct iwn_softc *sc) device_printf(sc->sc_dev, "%s: could not read firmware sections, error %d\n", __func__, error); - firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); - sc->fw_fp = NULL; - return error; + goto fail; } device_printf(sc->sc_dev, "%s: ucode rev=0x%08x\n", __func__, sc->ucode_rev); @@ -8230,13 +8228,22 @@ iwn_read_firmware(struct iwn_softc *sc) (fw->boot.textsz & 3) != 0) { device_printf(sc->sc_dev, "%s: firmware sections too large\n", __func__); - firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); - sc->fw_fp = NULL; - return EINVAL; + error = EINVAL; + goto fail; } /* We can proceed with loading the firmware. */ return 0; + +fail: iwn_unload_firmware(sc); + return error; +} + +static void +iwn_unload_firmware(struct iwn_softc *sc) +{ + firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); + sc->fw_fp = NULL; } static int @@ -8724,8 +8731,7 @@ iwn_init_locked(struct iwn_softc *sc) /* Initialize hardware and upload firmware. */ error = iwn_hw_init(sc); - firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); - sc->fw_fp = NULL; + iwn_unload_firmware(sc); if (error != 0) { device_printf(sc->sc_dev, "%s: could not initialize hardware, error %d\n", __func__, From owner-svn-src-all@freebsd.org Mon Jan 4 21:16:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66C10A61F3B; Mon, 4 Jan 2016 21:16:51 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16A7018AD; Mon, 4 Jan 2016 21:16:51 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04LGo35048244; Mon, 4 Jan 2016 21:16:50 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04LGotR048242; Mon, 4 Jan 2016 21:16:50 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601042116.u04LGotR048242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 4 Jan 2016 21:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293180 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:16:51 -0000 Author: avos Date: Mon Jan 4 21:16:49 2016 New Revision: 293180 URL: https://svnweb.freebsd.org/changeset/base/293180 Log: urtwn: add bits for R92C_HWSEQ_CTRL and R92C_TXPAUSE registers Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4770 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Mon Jan 4 21:11:27 2016 (r293179) +++ head/sys/dev/usb/wlan/if_urtwn.c Mon Jan 4 21:16:49 2016 (r293180) @@ -2277,7 +2277,7 @@ urtwn_newstate(struct ieee80211vap *vap, case IEEE80211_S_SCAN: /* Pause AC Tx queues. */ urtwn_write_1(sc, R92C_TXPAUSE, - urtwn_read_1(sc, R92C_TXPAUSE) | 0x0f); + urtwn_read_1(sc, R92C_TXPAUSE) | R92C_TX_QUEUE_AC); break; case IEEE80211_S_AUTH: urtwn_set_chan(sc, ic->ic_curchan, NULL); @@ -4425,7 +4425,7 @@ urtwn_lc_calib(struct urtwn_softc *sc) } } else { /* Block all Tx queues. */ - urtwn_write_1(sc, R92C_TXPAUSE, 0xff); + urtwn_write_1(sc, R92C_TXPAUSE, R92C_TX_QUEUE_ALL); } /* Start calibration. */ urtwn_rf_write(sc, 0, R92C_RF_CHNLBW, @@ -4640,7 +4640,7 @@ urtwn_init(struct urtwn_softc *sc) ieee80211_runtask(ic, &sc->cmdq_task); /* Enable hardware sequence numbering. */ - urtwn_write_1(sc, R92C_HWSEQ_CTRL, 0xff); + urtwn_write_1(sc, R92C_HWSEQ_CTRL, R92C_TX_QUEUE_ALL); /* Enable per-packet TX report. */ if (sc->chip & URTWN_CHIP_88E) { Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Mon Jan 4 21:11:27 2016 (r293179) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Mon Jan 4 21:16:49 2016 (r293180) @@ -496,6 +496,24 @@ #define R92C_EDCA_PARAM_TXOP_M 0xffff0000 #define R92C_EDCA_PARAM_TXOP_S 16 +/* Bits for R92C_HWSEQ_CTRL / R92C_TXPAUSE. */ +#define R92C_TX_QUEUE_VO 0x01 +#define R92C_TX_QUEUE_VI 0x02 +#define R92C_TX_QUEUE_BE 0x04 +#define R92C_TX_QUEUE_BK 0x08 +#define R92C_TX_QUEUE_MGT 0x10 +#define R92C_TX_QUEUE_HIGH 0x20 +#define R92C_TX_QUEUE_BCN 0x40 + +/* Shortcuts. */ +#define R92C_TX_QUEUE_AC \ + (R92C_TX_QUEUE_VO | R92C_TX_QUEUE_VI | \ + R92C_TX_QUEUE_BE | R92C_TX_QUEUE_BK) + +#define R92C_TX_QUEUE_ALL \ + (R92C_TX_QUEUE_AC | R92C_TX_QUEUE_MGT | \ + R92C_TX_QUEUE_HIGH | R92C_TX_QUEUE_BCN | 0x80) /* XXX */ + /* Bits for R92C_BCN_CTRL. */ #define R92C_BCN_CTRL_EN_MBSSID 0x02 #define R92C_BCN_CTRL_TXBCN_RPT 0x04 From owner-svn-src-all@freebsd.org Mon Jan 4 21:30:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 386BEA622C4; Mon, 4 Jan 2016 21:30:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA0561E4E; Mon, 4 Jan 2016 21:30:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04LUtbh051954; Mon, 4 Jan 2016 21:30:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04LUs6q051948; Mon, 4 Jan 2016 21:30:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601042130.u04LUs6q051948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Jan 2016 21:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293181 - vendor/llvm-libunwind/dist/src X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:30:56 -0000 Author: emaste Date: Mon Jan 4 21:30:54 2016 New Revision: 293181 URL: https://svnweb.freebsd.org/changeset/base/293181 Log: Import LLVM libunwind snapshot revision 256779 From https://llvm.org/svn/llvm-project/libunwind/trunk/ Modified: vendor/llvm-libunwind/dist/src/AddressSpace.hpp vendor/llvm-libunwind/dist/src/DwarfParser.hpp vendor/llvm-libunwind/dist/src/UnwindCursor.hpp vendor/llvm-libunwind/dist/src/UnwindRegistersSave.S vendor/llvm-libunwind/dist/src/config.h vendor/llvm-libunwind/dist/src/libunwind.cpp Modified: vendor/llvm-libunwind/dist/src/AddressSpace.hpp ============================================================================== --- vendor/llvm-libunwind/dist/src/AddressSpace.hpp Mon Jan 4 21:16:49 2016 (r293180) +++ vendor/llvm-libunwind/dist/src/AddressSpace.hpp Mon Jan 4 21:30:54 2016 (r293181) @@ -35,7 +35,11 @@ namespace libunwind { #include "Registers.hpp" #if _LIBUNWIND_ARM_EHABI -#ifdef __linux__ +#if defined(__FreeBSD__) + +typedef void *_Unwind_Ptr; + +#elif defined(__linux__) typedef long unsigned int *_Unwind_Ptr; extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr addr, int *len); Modified: vendor/llvm-libunwind/dist/src/DwarfParser.hpp ============================================================================== --- vendor/llvm-libunwind/dist/src/DwarfParser.hpp Mon Jan 4 21:16:49 2016 (r293180) +++ vendor/llvm-libunwind/dist/src/DwarfParser.hpp Mon Jan 4 21:30:54 2016 (r293181) @@ -380,7 +380,9 @@ bool CFI_Parser::parseInstructions(A uint64_t length; uint8_t opcode = addressSpace.get8(p); uint8_t operand; +#if !defined(_LIBUNWIND_NO_HEAP) PrologInfoStackEntry *entry; +#endif ++p; switch (opcode) { case DW_CFA_nop: @@ -492,6 +494,7 @@ bool CFI_Parser::parseInstructions(A fprintf(stderr, "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64 ")\n", reg, reg2); break; +#if !defined(_LIBUNWIND_NO_HEAP) case DW_CFA_remember_state: // avoid operator new, because that would be an upward dependency entry = (PrologInfoStackEntry *)malloc(sizeof(PrologInfoStackEntry)); @@ -517,6 +520,7 @@ bool CFI_Parser::parseInstructions(A if (logDwarf) fprintf(stderr, "DW_CFA_restore_state\n"); break; +#endif case DW_CFA_def_cfa: reg = addressSpace.getULEB128(p, instructionsEnd); offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd); Modified: vendor/llvm-libunwind/dist/src/UnwindCursor.hpp ============================================================================== --- vendor/llvm-libunwind/dist/src/UnwindCursor.hpp Mon Jan 4 21:16:49 2016 (r293180) +++ vendor/llvm-libunwind/dist/src/UnwindCursor.hpp Mon Jan 4 21:30:54 2016 (r293181) @@ -114,6 +114,7 @@ typename A::pint_t DwarfFDECache::fin template void DwarfFDECache::add(pint_t mh, pint_t ip_start, pint_t ip_end, pint_t fde) { +#if !defined(_LIBUNWIND_NO_HEAP) _LIBUNWIND_LOG_NON_ZERO(::pthread_rwlock_wrlock(&_lock)); if (_bufferUsed >= _bufferEnd) { size_t oldSize = (size_t)(_bufferEnd - _buffer); @@ -139,6 +140,7 @@ void DwarfFDECache::add(pint_t mh, pi } #endif _LIBUNWIND_LOG_NON_ZERO(::pthread_rwlock_unlock(&_lock)); +#endif } template Modified: vendor/llvm-libunwind/dist/src/UnwindRegistersSave.S ============================================================================== --- vendor/llvm-libunwind/dist/src/UnwindRegistersSave.S Mon Jan 4 21:16:49 2016 (r293180) +++ vendor/llvm-libunwind/dist/src/UnwindRegistersSave.S Mon Jan 4 21:30:54 2016 (r293181) @@ -87,6 +87,15 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext xorl %eax, %eax # return UNW_ESUCCESS ret +# elif defined(__mips__) + +# +# extern int unw_getcontext(unw_context_t* thread_state) +# +# Just trap for the time being. +DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) + teq $0, $0 + #elif defined(__ppc__) ; Modified: vendor/llvm-libunwind/dist/src/config.h ============================================================================== --- vendor/llvm-libunwind/dist/src/config.h Mon Jan 4 21:16:49 2016 (r293180) +++ vendor/llvm-libunwind/dist/src/config.h Mon Jan 4 21:30:54 2016 (r293181) @@ -41,7 +41,8 @@ #define _LIBUNWIND_BUILD_ZERO_COST_APIS (defined(__i386__) || \ defined(__x86_64__) || \ - defined(__arm64__)) + defined(__arm64__) || \ + defined(__mips__)) #define _LIBUNWIND_BUILD_SJLJ_APIS defined(__arm__) #define _LIBUNWIND_SUPPORT_FRAME_APIS (defined(__i386__) || \ defined(__x86_64__)) Modified: vendor/llvm-libunwind/dist/src/libunwind.cpp ============================================================================== --- vendor/llvm-libunwind/dist/src/libunwind.cpp Mon Jan 4 21:16:49 2016 (r293180) +++ vendor/llvm-libunwind/dist/src/libunwind.cpp Mon Jan 4 21:30:54 2016 (r293181) @@ -64,6 +64,8 @@ _LIBUNWIND_EXPORT int unw_init_local(unw #elif defined(__or1k__) new ((void *)cursor) UnwindCursor( context, LocalAddressSpace::sThisAddressSpace); +#elif defined(__mips__) +#warning The MIPS architecture is not supported. #else #error Architecture not supported #endif From owner-svn-src-all@freebsd.org Mon Jan 4 21:32:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65AC2A623D4; Mon, 4 Jan 2016 21:32:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CDA61135; Mon, 4 Jan 2016 21:32:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04LVxPC053963; Mon, 4 Jan 2016 21:31:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04LVxSY053962; Mon, 4 Jan 2016 21:31:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601042131.u04LVxSY053962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Jan 2016 21:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293182 - vendor/llvm-libunwind/libunwind-r256779 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:32:00 -0000 Author: emaste Date: Mon Jan 4 21:31:59 2016 New Revision: 293182 URL: https://svnweb.freebsd.org/changeset/base/293182 Log: Tag LLVM libunwind r256779 Added: vendor/llvm-libunwind/libunwind-r256779/ - copied from r293181, vendor/llvm-libunwind/dist/ From owner-svn-src-all@freebsd.org Mon Jan 4 21:41:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51B23A626A7; Mon, 4 Jan 2016 21:41:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EC7F1606; Mon, 4 Jan 2016 21:41:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04Lf3rN056301; Mon, 4 Jan 2016 21:41:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04Lf2hx056294; Mon, 4 Jan 2016 21:41:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601042141.u04Lf2hx056294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Jan 2016 21:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293183 - head/contrib/llvm/projects/libunwind/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:41:04 -0000 Author: emaste Date: Mon Jan 4 21:41:02 2016 New Revision: 293183 URL: https://svnweb.freebsd.org/changeset/base/293183 Log: Merge LLVM libunwind revision 256779 Modified: head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp head/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S head/contrib/llvm/projects/libunwind/src/config.h head/contrib/llvm/projects/libunwind/src/libunwind.cpp Modified: head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Mon Jan 4 21:41:02 2016 (r293183) @@ -35,7 +35,11 @@ namespace libunwind { #include "Registers.hpp" #if _LIBUNWIND_ARM_EHABI -#ifdef __linux__ +#if defined(__FreeBSD__) + +typedef void *_Unwind_Ptr; + +#elif defined(__linux__) typedef long unsigned int *_Unwind_Ptr; extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr addr, int *len); Modified: head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp Mon Jan 4 21:41:02 2016 (r293183) @@ -380,7 +380,9 @@ bool CFI_Parser::parseInstructions(A uint64_t length; uint8_t opcode = addressSpace.get8(p); uint8_t operand; +#if !defined(_LIBUNWIND_NO_HEAP) PrologInfoStackEntry *entry; +#endif ++p; switch (opcode) { case DW_CFA_nop: @@ -492,6 +494,7 @@ bool CFI_Parser::parseInstructions(A fprintf(stderr, "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64 ")\n", reg, reg2); break; +#if !defined(_LIBUNWIND_NO_HEAP) case DW_CFA_remember_state: // avoid operator new, because that would be an upward dependency entry = (PrologInfoStackEntry *)malloc(sizeof(PrologInfoStackEntry)); @@ -517,6 +520,7 @@ bool CFI_Parser::parseInstructions(A if (logDwarf) fprintf(stderr, "DW_CFA_restore_state\n"); break; +#endif case DW_CFA_def_cfa: reg = addressSpace.getULEB128(p, instructionsEnd); offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd); Modified: head/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp Mon Jan 4 21:41:02 2016 (r293183) @@ -114,6 +114,7 @@ typename A::pint_t DwarfFDECache::fin template void DwarfFDECache::add(pint_t mh, pint_t ip_start, pint_t ip_end, pint_t fde) { +#if !defined(_LIBUNWIND_NO_HEAP) _LIBUNWIND_LOG_NON_ZERO(::pthread_rwlock_wrlock(&_lock)); if (_bufferUsed >= _bufferEnd) { size_t oldSize = (size_t)(_bufferEnd - _buffer); @@ -139,6 +140,7 @@ void DwarfFDECache::add(pint_t mh, pi } #endif _LIBUNWIND_LOG_NON_ZERO(::pthread_rwlock_unlock(&_lock)); +#endif } template Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Mon Jan 4 21:41:02 2016 (r293183) @@ -87,6 +87,15 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext xorl %eax, %eax # return UNW_ESUCCESS ret +# elif defined(__mips__) + +# +# extern int unw_getcontext(unw_context_t* thread_state) +# +# Just trap for the time being. +DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) + teq $0, $0 + #elif defined(__ppc__) ; Modified: head/contrib/llvm/projects/libunwind/src/config.h ============================================================================== --- head/contrib/llvm/projects/libunwind/src/config.h Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/config.h Mon Jan 4 21:41:02 2016 (r293183) @@ -41,7 +41,8 @@ #define _LIBUNWIND_BUILD_ZERO_COST_APIS (defined(__i386__) || \ defined(__x86_64__) || \ - defined(__arm64__)) + defined(__arm64__) || \ + defined(__mips__)) #define _LIBUNWIND_BUILD_SJLJ_APIS defined(__arm__) #define _LIBUNWIND_SUPPORT_FRAME_APIS (defined(__i386__) || \ defined(__x86_64__)) Modified: head/contrib/llvm/projects/libunwind/src/libunwind.cpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/libunwind.cpp Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/libunwind.cpp Mon Jan 4 21:41:02 2016 (r293183) @@ -64,6 +64,8 @@ _LIBUNWIND_EXPORT int unw_init_local(unw #elif defined(__or1k__) new ((void *)cursor) UnwindCursor( context, LocalAddressSpace::sThisAddressSpace); +#elif defined(__mips__) +#warning The MIPS architecture is not supported. #else #error Architecture not supported #endif From owner-svn-src-all@freebsd.org Mon Jan 4 22:45:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71150A61ABB; Mon, 4 Jan 2016 22:45:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x241.google.com (mail-lb0-x241.google.com [IPv6:2a00:1450:4010:c04::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9DA51811; Mon, 4 Jan 2016 22:45:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x241.google.com with SMTP id bc4so10017277lbc.0; Mon, 04 Jan 2016 14:45:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MVMc3TkZz0Ls/AnfSP4cLaaPBGvW07/3q8qeSA8oUB0=; b=vHW4cJcvk8LvkxtZMO4gVc2OWDbPv//VKv+scGCk2x8d4iA9lcwN6EQM8Mbc9dPXi5 hV/NeCwMm9v53ndT+/1H9u95JNEnsGPOLwnZs09+3fvK1uduCGuxQeXMAxRelGPa0NW6 SzCgbuIZatgrsGw5fBnfNT77liNvv/WLoLrud5IClXL7ZXrA2noySJ2uQvb94owTlHpK l/BTAN181UjbCpW86ovqeIgi5LA3XF3I4RmIaWt3E3cKR0Hq29FiSM/yX83y6eUCdtC/ Mt65Bw66owurzjKfYaPPqIfD3yMhL2u9dIwonZYGGCXreG7ga8FuqhEk05cccHn9C6xl 1YYA== MIME-Version: 1.0 X-Received: by 10.112.97.176 with SMTP id eb16mr32893730lbb.138.1451947549052; Mon, 04 Jan 2016 14:45:49 -0800 (PST) Received: by 10.112.160.133 with HTTP; Mon, 4 Jan 2016 14:45:49 -0800 (PST) In-Reply-To: <1740114.0GzEsp8E6P@ralph.baldwin.cx> References: <201601031809.u03I9lNJ091471@repo.freebsd.org> <1740114.0GzEsp8E6P@ralph.baldwin.cx> Date: Mon, 4 Jan 2016 14:45:49 -0800 Message-ID: Subject: Re: svn commit: r293112 - head/sys/dev/ixl From: NGie Cooper To: John Baldwin Cc: Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 22:45:51 -0000 On Sun, Jan 3, 2016 at 2:23 PM, John Baldwin wrote: ... > FWIW, it is probably simpler to do something like this in an ixl header instead: > > #if __FreeBSD_version <= 1100022 > #define if_getdrvflags(ifp) (ifp)->if_drv_flags > #endif > > In the past when the Intel drivers have used compat shims they have preferred this > method (defining compat macros for "new" APIs on old OS versions) instead of using > #ifdef's in the code itself. You're right. What I did was incredibly ugly and only fixes one potential instance (of which more might appear later).. I'll send out a CR moving the definition to a header file and commit the change. Thanks! -NGie From owner-svn-src-all@freebsd.org Mon Jan 4 23:36:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53712A62A8F for ; Mon, 4 Jan 2016 23:36:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22e.google.com (mail-qg0-x22e.google.com [IPv6:2607:f8b0:400d:c04::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8291F6A for ; Mon, 4 Jan 2016 23:36:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22e.google.com with SMTP id b35so136795787qge.0 for ; Mon, 04 Jan 2016 15:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=dr7JrpOzA8jLNFQd2f1cGOT/uhElsv6CWf0JRMKgBY0=; b=JBu+9ZKinE3Q4f2ImC/zJDHYsM3+E7Czrla/8RCb/FhdrFz4Dffz6nj2yZnhRtblHK FpgVLaSD13YvzSg+UqFVCY5weFhN0O2od4IcQvadGbybRc2z9ycR9URQ9yWYzyqGzCaf mRC8v0wFLlQ/UhiEnnwns72E3lIsINsT3g5j+lGPPUKM2FHU0s4ZUOiHqRboWdPVKa6R BlAhe7n0qWjeWkrIncZ9to5Vnf6dw9QZW6zlUXCD/kPJlTFYcZqg5egYeH91xVji4fUu kUaepEAxfCT42nMrsTWn/476U7g4Gt5LT5bCpzqFtifrUPWHZNz1zdpNsgyL8Juqtu50 e9CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=dr7JrpOzA8jLNFQd2f1cGOT/uhElsv6CWf0JRMKgBY0=; b=bbtInCo5mpyjN0MZeBzALYqkBL0YHMDjdWHTO89id8aD37X15ZFvtX5VzkU2JA4Ae2 LLuxM7Z305OW2TKhG6YqrI3IjAKHRDUUdklFxiMHIYMDA1dWMgbjQA91yIKIV9sTAvw1 FSeISMo5lj+nbld3H0DvGDQRJh8aWWm1Bn7U1lThzp0jOD07H1CtFyCtTc5Kjh2JKLpa 4iSJwjuhVadQx3i8l2QUq3m9nCZ//55RuX/KAt98c8T7R9bmZwp2WB67XHEyqHpMq0GA xTGfhkgvZgCQkDHYHL3rR6h00AvbvQoZsSqISFeLM6U3i4mEeWPX85rwIFOLDdJKgS0N r8Xw== X-Gm-Message-State: ALoCoQnlzwmRf3Z01nz3O1GEUCr+meNVAdNqUSGOIr1ciRQ+B3mtDbhVVQD8tnQMxUa27ex253UtoddaLSA6ypqOyUYfRu5XJQ== MIME-Version: 1.0 X-Received: by 10.140.250.70 with SMTP id v67mr127292793qhc.43.1451950571943; Mon, 04 Jan 2016 15:36:11 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 15:36:11 -0800 (PST) X-Originating-IP: [2601:280:4900:3700:a51c:df79:65a:a353] In-Reply-To: <1451429489.1369.35.camel@freebsd.org> References: <201512272304.tBRN4C5D034464@repo.freebsd.org> <41508412.yspAtSoPCD@ralph.baldwin.cx> <2345870.SHMMVrpc1D@ralph.baldwin.cx> <1451429489.1369.35.camel@freebsd.org> Date: Mon, 4 Jan 2016 16:36:11 -0700 X-Google-Sender-Auth: xICLtk_G3QOMjn6Sk6XKvmpTm_Y Message-ID: Subject: Re: svn commit: r292809 - head/lib/libc/stdio From: Warner Losh To: Ian Lepore Cc: John Baldwin , src-committers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Warner Losh Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 23:36:13 -0000 Be my guest to implement these things. I don't think it matters much, and adds a lot of complexity to avoid a single roundup call. And if we have more-strict alignment for glue than ALIGNBYTES, we're already doomed. We don't do that today. Warner On Tue, Dec 29, 2015 at 3:51 PM, Ian Lepore wrote: > On Tue, 2015-12-29 at 11:37 -0800, John Baldwin wrote: > > On Monday, December 28, 2015 01:01:26 PM Warner Losh wrote: > > > I'll look at that, but I don't think posix_memalign is the right > > > way to go. > > > The alignment of FILE is more strict than posix_memalign will > > > return. Ian's > > > idea of __alignof__ is the way to go. We allocate them in one block > > > on > > > purpose for performance, and posix_memalign would be a one at a > > > time affair. > > > > posix_memalign gives you whatever alignment you ask for. Using > > __alignof__ > > to determine the alignment instead of hardcoding sizeof(int64_t) > > would > > certainly be an improvement. If you move the glue after the FILE > > objects > > then you can use posix_memalign() directly as so: > > > > void *mem; > > int error; > > > > error = posix_memalign(&mem, MAX(ALIGNBYTES, > > __alignof__(mbstate_t)), > > n * sizeof(FILE) + sizeof(*g)); > > if (error) > > return (NULL); > > p = (FILE *)mem; > > g = (struct glue *)(p + n); > > g->next = NULL; > > g->niobs = n; > > g->iobs = p; > > ... > > > > (This presumes that the requested alignment of 'struct glue' is less > > than > > the alignment needed by FILE which should be true.) > > > > If there's going to be an assumption that __alignof__(glue) <= > __alignof__(FILE), it might be nice to have a static_assert() of that > to prevent a future time bomb similar to the one that exploded on arm > when it turned out the opposite assumption was wrong. > > -- Ian > > From owner-svn-src-all@freebsd.org Mon Jan 4 23:49:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92245A62E09 for ; Mon, 4 Jan 2016 23:49:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47F221583 for ; Mon, 4 Jan 2016 23:49:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x234.google.com with SMTP id 6so188608602qgy.1 for ; Mon, 04 Jan 2016 15:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=IlOSlfinkiemEf2IasfuFXgbT4P5YC0pF1GSOIuTUMM=; b=HwpuXVxtjcjhuwZwOR//Ipzykg/CmOSbJnwE28JIRmTW2Xoi6Ed7uXB0G/eRoO/TW6 +a6IL6ezGBiQqbxXxzO79ESGq73QUs2bsJImRBCb/wiIHW8nPYIiDZRfPBLf10rl4cK7 CL8iXghOeGObycHJWF/ArN5qeYhzBIf5UOLUSskglWYmF1LPdeY+7DruY/MNoC+fzbNx sxMaBF0Ok0uQf2F+XmLEAzm1v8Jf0VJWjk/j5lNsmLltJvxX3ZpUyCEAoAsPSTfibfHe GCSqbJTTXWsglNUBBk1wEIGdGsX8AjoZ8d1yQpay1SOU3qiFVz+DkTVRv4qV7UO+YPo8 jpIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=IlOSlfinkiemEf2IasfuFXgbT4P5YC0pF1GSOIuTUMM=; b=ERSaxik5WQ/SeXcUDBxyfjqeX9B9VBfRcDP6UpbDZBInvLoJwOazVhVkVt+tY41+YE 4xw/KeTDcO87KZLwfnopPUiwbPwyvV7zDAU2thh1fiWRAxDs776z99cHo5McbDZKOhNL CozzHcKDx/zjO/wts/U9JUyerMFK9OIS/x5zlHUL6o3dzl4BiwM7iPRz71dt/SDi9PaA QPOyj0hU5grL5crHL+N8bywuTqloHsg8QetGWP6foPgijjBglBjsdMU+jM2BeYuRGp0r T3gF9nDBke6rm+D1ffsnHak/oe2e9qAedK+EyJwQ/M22u1ZNRBXgoPjwzdNczQ/kvDFd FfkQ== X-Gm-Message-State: ALoCoQlWpcOt4jbn1yNUhE7MqZwcfMZ3P0Ezzog0w69Z+5DDydrjQtudB5a1hwXYOLv1AP8npHukufV+lIfpzc8c1GVCJkahOg== MIME-Version: 1.0 X-Received: by 10.140.29.131 with SMTP id b3mr117291688qgb.50.1451951359360; Mon, 04 Jan 2016 15:49:19 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 15:49:19 -0800 (PST) X-Originating-IP: [2601:280:4900:3700:a51c:df79:65a:a353] In-Reply-To: <1777356.pH0Cpe84Od@ralph.baldwin.cx> References: <201512191901.tBJJ1hEP013786@repo.freebsd.org> <1777356.pH0Cpe84Od@ralph.baldwin.cx> Date: Mon, 4 Jan 2016 16:49:19 -0700 X-Google-Sender-Auth: 89I1P63UPnRdn7SxxwrVH5obVKY Message-ID: Subject: Re: svn commit: r292472 - in head/sys: amd64/amd64 sys From: Warner Losh To: John Baldwin Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 23:49:20 -0000 On Mon, Dec 21, 2015 at 1:38 PM, John Baldwin wrote: > On Saturday, December 19, 2015 07:01:43 PM Warner Losh wrote: > > Author: imp > > Date: Sat Dec 19 19:01:43 2015 > > New Revision: 292472 > > URL: https://svnweb.freebsd.org/changeset/base/292472 > > > > Log: > > Save the physical address passed into the kernel of the UEFI system > > table. > > > > Modified: > > head/sys/amd64/amd64/machdep.c > > head/sys/sys/efi.h > > > > Modified: head/sys/amd64/amd64/machdep.c > > > ============================================================================== > > --- head/sys/amd64/amd64/machdep.c Sat Dec 19 19:01:42 2015 > (r292471) > > +++ head/sys/amd64/amd64/machdep.c Sat Dec 19 19:01:43 2015 > (r292472) > > @@ -1615,6 +1622,8 @@ hammer_time(u_int64_t modulep, u_int64_t > > /* > > * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) > > * transition). > > + * Once bootblocks have updated, we can test directly for > > + * efi_systbl != NULL here... > > */ > > if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) > > != NULL) > > This part doesn't seem worth changing since the EFI map is always going to > be > there and works for both old and new loaders? > Just a simpler test. This code suffers from too much complexity, but maybe compat will keep us from doing this for a long time. Warner From owner-svn-src-all@freebsd.org Tue Jan 5 00:05:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37E2AA616EB for ; Tue, 5 Jan 2016 00:05:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5D7A1F3A for ; Tue, 5 Jan 2016 00:05:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x234.google.com with SMTP id o11so267146129qge.2 for ; Mon, 04 Jan 2016 16:05:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kFw5no4yElKFsgkb4J0kIidb0S1eS6xl5dBTyMYPcLA=; b=1D7g65y94JQyVniU33N7rWYTolbUoD7cNJty4m1N7o2htyd9Td5WGQ4u0wFyW4yERN ZP4bV9KdbiOYjGN1siHhcl8J/VFt97GpciulB5C1NV7KFjDClnyXi3+F9KO5BGvzS/tS 0Ct7PNVg8sC6vpGNFbT/AtvYYffy89Ms1J0j7B6gJZPSkIV2iVSkN3tRcmlCSrz7WoCV F4+K8Nq6J1Cc9hu2HuedtNbFOjCYNCZSHC+CWZxYajeKVzu18JS5cvm/wCoVzmBkC8tP afJ+9ADw/booR+wXQD6+hwmb7v4W8GJqA+ZtI5zNamR72R9e7WxA123MZNG106epH42n RFrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=kFw5no4yElKFsgkb4J0kIidb0S1eS6xl5dBTyMYPcLA=; b=FO3wIpWURcZ3LToi+6xqI0sKySxKEu9xk49Nug5bIxoz/0N8lI0Zo0xIjK+xsTXV+T pwTRkFRfhE9Rb1qtVsbjzHQw1O+FmKpIa+bcxwatS47eINk8yrgOQw+vSbMLvMVx2l6b mAp5wL/98aKuVQ7pqUdiwQ5jCeMYjVe5KxgNt53/QSH2ZsYak1lQWghkkVxEvoP7Dd6G /A756VGQX59CgRXz1vLe9vpkkUzriKui4XGyBJuNU3U3CdT4TpAV+SJv8sFXlkM0q/iD McJp+TN4BoKALLOoA/UPJqBcPXBZ5WA0/hplgwOULFRcvXdFbmM6NrDm81qEOvfXFrjs qyUg== X-Gm-Message-State: ALoCoQmp3weNEw0yM95fd39Iho4aaZr8vhMLETuRCi2OUjcbqx9AkNFzjAlXkoIw+HLTceG2e3gMb9nONv0ee89+7cfcDeHuHw== MIME-Version: 1.0 X-Received: by 10.140.93.77 with SMTP id c71mr84261207qge.46.1451952336006; Mon, 04 Jan 2016 16:05:36 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 16:05:35 -0800 (PST) X-Originating-IP: [2601:280:4900:3700:a51c:df79:65a:a353] In-Reply-To: <1450903312.25138.212.camel@freebsd.org> References: <201512230649.tBN6nJsJ023270@repo.freebsd.org> <1450903312.25138.212.camel@freebsd.org> Date: Mon, 4 Jan 2016 17:05:35 -0700 X-Google-Sender-Auth: RLalXls_HtbT6W_hVUg5TE4PRdg Message-ID: Subject: Re: svn commit: r292644 - head/tools/tools/nanobsd/embedded From: Warner Losh To: Ian Lepore Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 00:05:37 -0000 Thanks Ian. I'll adjust. The dtb files don't hurt anything, and it would be extra config to have some platforms do it and not others (something I'm trying to avoid). I'll document it for later. However, if there's no point to the uenv file, that's easy to just remove. Warner On Wed, Dec 23, 2015 at 1:41 PM, Ian Lepore wrote: > On Wed, 2015-12-23 at 06:49 +0000, Warner Losh wrote: > > Author: imp > > Date: Wed Dec 23 06:49:18 2015 > > New Revision: 292644 > > URL: https://svnweb.freebsd.org/changeset/base/292644 > > > > Log: > > Copy all the dtb files that we build as part of the kernel build > > from > > boot/dtb to the fat partition. They seem to be needed. > > Create an empty uEnv.txt file > > Of all the arm platforms we support, only RPi and RPi2 require the dtb > files to be in the fat partition. > > The only advantage to an empty uEnv.txt file is that it will suppress a > warning about not being able to read it. There's no way to suppress a > similar warning about a bad saved-environment checksum that u-boot > emits if you've never changed anything and done a saveenv. > > -- Ian > > From owner-svn-src-all@freebsd.org Tue Jan 5 01:32:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A72FA61058; Tue, 5 Jan 2016 01:32:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C0941199; Tue, 5 Jan 2016 01:32:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u051WeCL022721; Tue, 5 Jan 2016 01:32:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u051Wequ022720; Tue, 5 Jan 2016 01:32:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201601050132.u051Wequ022720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 5 Jan 2016 01:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293185 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 01:32:41 -0000 Author: np Date: Tue Jan 5 01:32:40 2016 New Revision: 293185 URL: https://svnweb.freebsd.org/changeset/base/293185 Log: iw_cxgbe: Shut down the socket but do not close the fd in case of error. The fd is closed later in this case. This fixes a "SS_NOFDREF on enter" panic. Submitted by: Krishnamraju Eraparaju @ Chelsio Reviewed by: Steve Wise @ Open Grid Computing Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Jan 4 22:32:37 2016 (r293184) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Jan 5 01:32:40 2016 (r293185) @@ -474,7 +474,7 @@ process_conn_error(struct c4iw_ep *ep) if (state != ABORTING) { CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); - close_socket(&ep->com, 1); + close_socket(&ep->com, 0); state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); } From owner-svn-src-all@freebsd.org Tue Jan 5 01:58:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13A9DA6172C; Tue, 5 Jan 2016 01:58:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D94FC1DF0; Tue, 5 Jan 2016 01:58:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u051wUTr029073; Tue, 5 Jan 2016 01:58:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u051wULh029072; Tue, 5 Jan 2016 01:58:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201601050158.u051wULh029072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 5 Jan 2016 01:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293186 - head/sys/contrib/rdma/krping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 01:58:32 -0000 Author: np Date: Tue Jan 5 01:58:30 2016 New Revision: 293186 URL: https://svnweb.freebsd.org/changeset/base/293186 Log: Have krping use IB_ACCESS_LOCAL_WRITE because it's required for remote write or remote atomic operations. Submitted by: Krishnamraju Eraparaju @ Chelsio Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Tue Jan 5 01:32:40 2016 (r293185) +++ head/sys/contrib/rdma/krping/krping.c Tue Jan 5 01:58:30 2016 (r293186) @@ -640,6 +640,7 @@ static int krping_setup_buffers(struct k buf.size = cb->size; iovbase = cb->rdma_dma_addr; cb->rdma_mr = ib_reg_phys_mr(cb->pd, &buf, 1, + IB_ACCESS_LOCAL_WRITE| IB_ACCESS_REMOTE_READ| IB_ACCESS_REMOTE_WRITE, &iovbase); @@ -675,8 +676,10 @@ static int krping_setup_buffers(struct k if (cb->mem == MR || cb->mem == MW) { unsigned flags = IB_ACCESS_REMOTE_READ; - if (cb->wlat || cb->rlat || cb->bw) - flags |= IB_ACCESS_REMOTE_WRITE; + if (cb->wlat || cb->rlat || cb->bw) { + flags |= IB_ACCESS_LOCAL_WRITE | + IB_ACCESS_REMOTE_WRITE; + } buf.addr = cb->start_dma_addr; buf.size = cb->size; From owner-svn-src-all@freebsd.org Tue Jan 5 02:21:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3E34A61F22; Tue, 5 Jan 2016 02:21:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8599C1A65; Tue, 5 Jan 2016 02:21:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u052LvXk037608; Tue, 5 Jan 2016 02:21:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u052LvpV037607; Tue, 5 Jan 2016 02:21:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601050221.u052LvpV037607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 5 Jan 2016 02:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293187 - head/libexec/rtld-elf/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 02:21:58 -0000 Author: emaste Date: Tue Jan 5 02:21:57 2016 New Revision: 293187 URL: https://svnweb.freebsd.org/changeset/base/293187 Log: rtld: wrap a comment to 80 columns Modified: head/libexec/rtld-elf/amd64/reloc.c Modified: head/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- head/libexec/rtld-elf/amd64/reloc.c Tue Jan 5 01:58:30 2016 (r293186) +++ head/libexec/rtld-elf/amd64/reloc.c Tue Jan 5 02:21:57 2016 (r293187) @@ -228,8 +228,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry /* * These are deferred until all other relocations have * been done. All we do here is make sure that the COPY - * relocation is not in a shared library. They are allowed - * only in executable files. + * relocation is not in a shared library. They are + * allowed only in executable files. */ if (!obj->mainprog) { _rtld_error("%s: Unexpected R_X86_64_COPY " From owner-svn-src-all@freebsd.org Tue Jan 5 03:20:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80499A62E94; Tue, 5 Jan 2016 03:20:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A0EA12B9; Tue, 5 Jan 2016 03:20:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u053Kkmk052596; Tue, 5 Jan 2016 03:20:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u053KkrA052592; Tue, 5 Jan 2016 03:20:46 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601050320.u053KkrA052592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 Jan 2016 03:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293188 - in head/release: amd64 arm64 i386 powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 03:20:47 -0000 Author: gjb Date: Tue Jan 5 03:20:45 2016 New Revision: 293188 URL: https://svnweb.freebsd.org/changeset/base/293188 Log: Prevent memstick installation medium from attempting to mount the root filesystem read-write. This causes problems booting the memstick installation medium from write-protected USB flash drives. Submitted by: A.J. Kehoe IV [1], Oliver Jones [2] PR: 187161 [1], 205886 [2] MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/release/amd64/make-memstick.sh head/release/arm64/make-memstick.sh head/release/i386/make-memstick.sh head/release/powerpc/make-memstick.sh Modified: head/release/amd64/make-memstick.sh ============================================================================== --- head/release/amd64/make-memstick.sh Tue Jan 5 02:21:57 2016 (r293187) +++ head/release/amd64/make-memstick.sh Tue Jan 5 03:20:45 2016 (r293188) @@ -29,12 +29,14 @@ if [ -e ${2} ]; then fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab +echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local makefs -B little -o label=FreeBSD_Install ${2}.part ${1} if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi rm ${1}/etc/fstab +rm ${1}/etc/rc.conf.local mkimg -s gpt -b ${1}/boot/pmbr -p efi:=${1}/boot/boot1.efifat -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} rm ${2}.part Modified: head/release/arm64/make-memstick.sh ============================================================================== --- head/release/arm64/make-memstick.sh Tue Jan 5 02:21:57 2016 (r293187) +++ head/release/arm64/make-memstick.sh Tue Jan 5 03:20:45 2016 (r293188) @@ -29,12 +29,14 @@ if [ -e ${2} ]; then fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab +echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local makefs -B little -o label=FreeBSD_Install ${2}.part ${1} if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi rm ${1}/etc/fstab +rm ${1}/etc/rc.conf.local mkimg -s mbr -p efi:=${1}/boot/boot1.efifat -p freebsd:=${2}.part -o ${2} rm ${2}.part Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Tue Jan 5 02:21:57 2016 (r293187) +++ head/release/i386/make-memstick.sh Tue Jan 5 03:20:45 2016 (r293188) @@ -29,12 +29,14 @@ if [ -e ${2} ]; then fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab +echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local makefs -B little -o label=FreeBSD_Install ${2}.part ${1} if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi rm ${1}/etc/fstab +rm ${1}/etc/rc.conf.local mkimg -s gpt -b ${1}/boot/pmbr -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} rm ${2}.part Modified: head/release/powerpc/make-memstick.sh ============================================================================== --- head/release/powerpc/make-memstick.sh Tue Jan 5 02:21:57 2016 (r293187) +++ head/release/powerpc/make-memstick.sh Tue Jan 5 03:20:45 2016 (r293188) @@ -33,6 +33,7 @@ if [ -e ${2} ]; then fi echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fstab +echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local rm -f ${tempfile} makefs -B big ${tempfile} ${1} if [ $? -ne 0 ]; then @@ -40,6 +41,7 @@ if [ $? -ne 0 ]; then exit 1 fi rm ${1}/etc/fstab +rm ${1}/etc/rc.conf.local mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2} From owner-svn-src-all@freebsd.org Tue Jan 5 03:22:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CA40A6107E; Tue, 5 Jan 2016 03:22:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BA321723; Tue, 5 Jan 2016 03:22:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u053MAGd055282; Tue, 5 Jan 2016 03:22:10 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u053MAO2055281; Tue, 5 Jan 2016 03:22:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601050322.u053MAO2055281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 5 Jan 2016 03:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293189 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 03:22:11 -0000 Author: glebius Date: Tue Jan 5 03:22:10 2016 New Revision: 293189 URL: https://svnweb.freebsd.org/changeset/base/293189 Log: Merge from head r287357-287358,287400: Not only build with buildworld, but also install with installworld all alternative kernels. Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Jan 5 03:20:45 2016 (r293188) +++ stable/10/Makefile.inc1 Tue Jan 5 03:22:10 2016 (r293189) @@ -1102,6 +1102,16 @@ reinstallkernel reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} +.if ${BUILDKERNELS:[#]} > 1 +.for _kernel in ${BUILDKERNELS:[2..-1]} + @echo "--------------------------------------------------------------" + @echo ">>> Installing kernel ${_kernel}" + @echo "--------------------------------------------------------------" + cd ${KRNLOBJDIR}/${_kernel}; \ + ${CROSSENV} PATH=${TMPPATH} \ + ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} +.endfor +.endif distributekernel distributekernel.debug: .if empty(INSTALLKERNEL) @@ -1121,7 +1131,8 @@ distributekernel distributekernel.debug: sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ ${DESTDIR}/${DISTDIR}/kernel.meta .endif -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.if ${BUILDKERNELS:[#]} > 1 +.for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta .endif @@ -1137,27 +1148,32 @@ distributekernel distributekernel.debug: ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta .endif .endfor +.endif packagekernel: .if defined(NO_ROOT) cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.if ${BUILDKERNELS:[#]} > 1 +.for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .endfor +.endif .else cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.if ${BUILDKERNELS:[#]} > 1 +.for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .endfor .endif +.endif # # doxygen From owner-svn-src-all@freebsd.org Tue Jan 5 05:25:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92DD6A61CF4; Tue, 5 Jan 2016 05:25:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C6D91E92; Tue, 5 Jan 2016 05:25:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u055PHRh090294; Tue, 5 Jan 2016 05:25:17 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u055PGY8090283; Tue, 5 Jan 2016 05:25:16 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601050525.u055PGY8090283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 5 Jan 2016 05:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293190 - in head: contrib/less usr.bin/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 05:25:18 -0000 Author: delphij Date: Tue Jan 5 05:25:16 2016 New Revision: 293190 URL: https://svnweb.freebsd.org/changeset/base/293190 Log: MFV r293125: less v481. MFC after: 1 month Relnotes: yes Added: head/contrib/less/compose.uni - copied unchanged from r293126, vendor/less/dist/compose.uni head/contrib/less/mkutable - copied unchanged from r293126, vendor/less/dist/mkutable head/contrib/less/ubin.uni - copied unchanged from r293126, vendor/less/dist/ubin.uni head/contrib/less/wide.uni - copied unchanged from r293126, vendor/less/dist/wide.uni Modified: head/contrib/less/LICENSE head/contrib/less/NEWS head/contrib/less/README head/contrib/less/brac.c head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/charset.h head/contrib/less/cmd.h head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/cvt.c head/contrib/less/decode.c head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/forwback.c head/contrib/less/funcs.h head/contrib/less/help.c head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/less.hlp head/contrib/less/less.nro head/contrib/less/lessecho.c head/contrib/less/lessecho.nro head/contrib/less/lesskey.c head/contrib/less/lesskey.h head/contrib/less/lesskey.nro head/contrib/less/lglob.h head/contrib/less/line.c head/contrib/less/linenum.c head/contrib/less/lsystem.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkhelp.c head/contrib/less/optfunc.c head/contrib/less/option.c head/contrib/less/option.h head/contrib/less/opttbl.c head/contrib/less/os.c head/contrib/less/output.c head/contrib/less/pattern.c head/contrib/less/pattern.h head/contrib/less/pckeys.h head/contrib/less/position.c head/contrib/less/position.h head/contrib/less/prompt.c head/contrib/less/regexp.c head/contrib/less/screen.c head/contrib/less/scrsize.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ttyin.c head/contrib/less/version.c head/usr.bin/less/defines.h Directory Properties: head/contrib/less/ (props changed) Modified: head/contrib/less/LICENSE ============================================================================== --- head/contrib/less/LICENSE Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/LICENSE Tue Jan 5 05:25:16 2016 (r293190) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2012 Mark Nudelman +Copyright (C) 1984-2015 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: head/contrib/less/NEWS ============================================================================== --- head/contrib/less/NEWS Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/NEWS Tue Jan 5 05:25:16 2016 (r293190) @@ -7,7 +7,44 @@ http://www.greenwoodsoftware.com/less You can also download the latest version of less from there. - To report bugs, suggestions or comments, send email to bug-less@gnu.org. + To report bugs, suggestions or comments, send email to bug-less@gnu.org + +====================================================================== + + Major changes between "less" versions 458 and 481 + +* Don't overwrite history file; just append to it. + +* New command ESC-G goes to end of currently buffered data in a pipe. + +* Disable history feature when compiled with LESSHISTFILE set to "-". + +* In more-compatible mode, make the -p option apply to every file opened, + not just the first one. + +* In more-compatible mode, change the -e option to work like -E, not -EF. + +* Treat multiple CRs before LF are like one CR (all the CRs are hidden). + +* Allow "extra" string in lesskey file to append to a multi-char command + (like a search pattern), without executing the command. + +* Ignore -u/-U setting while viewing help file, so that + underline and bold chars are displayed correctly. + +* Improve detection of "binary" files in UTF-8 mode. + +* Fix bug with ++ commands. + +* Fix bug where prompt was sometimes not displayed with +G. + +* Fix possible memory corruption + +* Fix bugs and improve performance in ampersand filtering. + +* Automate construction of Unicode tables from Unicode database. + +* Allow %% escape sequence in LESSOPEN variable. ====================================================================== Modified: head/contrib/less/README ============================================================================== --- head/contrib/less/README Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/README Tue Jan 5 05:25:16 2016 (r293190) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 458 + Less, version 481 - This is the distribution of less, version 458, released 04 Apr 2013. + This is the distribution of less, version 481, released 31 Aug 2015. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -53,8 +53,9 @@ INSTALLATION (Unix systems only): Specifies the regular expression library used by less for pattern matching. The default is "auto", which means the configure program finds a regular expression library automatically. Other values are: - posix Use the POSIX-compatible regcomp. + gnu Use the GNU regex library. pcre Use the PCRE library. + posix Use the POSIX-compatible regcomp. regcmp Use the regcmp library. re_comp Use the re_comp library. regcomp Use the V8-compatible regcomp. Modified: head/contrib/less/brac.c ============================================================================== --- head/contrib/less/brac.c Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/brac.c Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/ch.c ============================================================================== --- head/contrib/less/ch.c Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/ch.c Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -54,7 +54,7 @@ struct buf { * The file state is maintained in a filestate structure. * A pointer to the filestate is kept in the ifile structure. */ -#define BUFHASH_SIZE 64 +#define BUFHASH_SIZE 1024 struct filestate { struct bufnode buflist; struct bufnode hashtbl[BUFHASH_SIZE]; @@ -323,13 +323,16 @@ ch_get() #if HAVE_STAT_INO if (follow_mode == FOLLOW_NAME) { - /* See whether the file's i-number has changed. + /* See whether the file's i-number has changed, + * or the file has shrunk. * If so, force the file to be closed and * reopened. */ struct stat st; + POSITION curr_pos = ch_tell(); int r = stat(get_filename(curr_ifile), &st); if (r == 0 && (st.st_ino != curr_ino || - st.st_dev != curr_dev)) + st.st_dev != curr_dev || + (curr_pos != NULL_POSITION && st.st_size < curr_pos))) { /* screen_trashed=2 causes * make_display to reopen the file. */ @@ -536,6 +539,32 @@ ch_end_seek() } /* + * Seek to the last position in the file that is currently buffered. + */ + public int +ch_end_buffer_seek() +{ + register struct buf *bp; + register struct bufnode *bn; + POSITION buf_pos; + POSITION end_pos; + + if (thisfile == NULL || (ch_flags & CH_CANSEEK)) + return (ch_end_seek()); + + end_pos = 0; + FOR_BUFS(bn) + { + bp = bufnode_buf(bn); + buf_pos = (bp->block * LBUFSIZE) + bp->datasize; + if (buf_pos > end_pos) + end_pos = buf_pos; + } + + return (ch_seek(end_pos)); +} + +/* * Seek to the beginning of the file, or as close to it as we can get. * We may not be able to seek there if input is a pipe and the * beginning of the pipe is no longer buffered. Modified: head/contrib/less/charset.c ============================================================================== --- head/contrib/less/charset.c Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/charset.c Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -466,36 +466,15 @@ prutfchar(ch) else SNPRINTF1(buf, sizeof(buf), binfmt, (char) ch); } else if (is_ubin_char(ch)) + { SNPRINTF1(buf, sizeof(buf), utfbinfmt, ch); - else + } else { - int len; + char *p = buf; if (ch >= 0x80000000) - { - len = 3; - ch = 0xFFFD; - } else - { - len = (ch < 0x80) ? 1 - : (ch < 0x800) ? 2 - : (ch < 0x10000) ? 3 - : (ch < 0x200000) ? 4 - : (ch < 0x4000000) ? 5 - : 6; - } - buf[len] = '\0'; - if (len == 1) - *buf = (char) ch; - else - { - *buf = ((1 << len) - 1) << (8 - len); - while (--len > 0) - { - buf[len] = (char) (0x80 | (ch & 0x3F)); - ch >>= 6; - } - *buf |= ch; - } + ch = 0xFFFD; /* REPLACEMENT CHARACTER */ + put_wchar(&p, ch); + *p = '\0'; } return (buf); } @@ -524,11 +503,12 @@ utf_len(ch) } /* - * Is a UTF-8 character well-formed? + * Does the parameter point to the lead byte of a well-formed UTF-8 character? */ public int -is_utf8_well_formed(s) +is_utf8_well_formed(s, slen) unsigned char *s; + int slen; { int i; int len; @@ -537,6 +517,8 @@ is_utf8_well_formed(s) return (0); len = utf_len((char) s[0]); + if (len > slen) + return (0); if (len == 1) return (1); if (len == 2) @@ -558,6 +540,35 @@ is_utf8_well_formed(s) } /* + * Return number of invalid UTF-8 sequences found in a buffer. + */ + public int +utf_bin_count(data, len) + unsigned char *data; + int len; +{ + int bin_count = 0; + while (len > 0) + { + if (is_utf8_well_formed(data, len)) + { + int clen = utf_len(*data); + data += clen; + len -= clen; + } else + { + /* Skip to next lead byte. */ + bin_count++; + do { + ++data; + --len; + } while (len > 0 && !IS_UTF8_LEAD(*data)); + } + } + return (bin_count); +} + +/* * Get the value of a UTF-8 character. */ public LWCHAR @@ -706,411 +717,51 @@ step_char(pp, dir, limit) /* * Unicode characters data + * Actual data is in the generated *.uni files. */ -struct wchar_range { LWCHAR first, last; }; -/* - * Characters with general category values - * Mn: Mark, Nonspacing - * Me: Mark, Enclosing - * Last synched with - * - * dated 2005-11-30T00:58:48Z - */ -static struct wchar_range comp_table[] = { - { 0x0300, 0x036F} /* Mn */, { 0x0483, 0x0486} /* Mn */, - { 0x0488, 0x0489} /* Me */, - { 0x0591, 0x05BD} /* Mn */, { 0x05BF, 0x05BF} /* Mn */, - { 0x05C1, 0x05C2} /* Mn */, { 0x05C4, 0x05C5} /* Mn */, - { 0x05C7, 0x05C7} /* Mn */, { 0x0610, 0x0615} /* Mn */, - { 0x064B, 0x065E} /* Mn */, { 0x0670, 0x0670} /* Mn */, - { 0x06D6, 0x06DC} /* Mn */, - { 0x06DE, 0x06DE} /* Me */, - { 0x06DF, 0x06E4} /* Mn */, { 0x06E7, 0x06E8} /* Mn */, - { 0x06EA, 0x06ED} /* Mn */, { 0x0711, 0x0711} /* Mn */, - { 0x0730, 0x074A} /* Mn */, { 0x07A6, 0x07B0} /* Mn */, - { 0x07EB, 0x07F3} /* Mn */, { 0x0901, 0x0902} /* Mn */, - { 0x093C, 0x093C} /* Mn */, { 0x0941, 0x0948} /* Mn */, - { 0x094D, 0x094D} /* Mn */, { 0x0951, 0x0954} /* Mn */, - { 0x0962, 0x0963} /* Mn */, { 0x0981, 0x0981} /* Mn */, - { 0x09BC, 0x09BC} /* Mn */, { 0x09C1, 0x09C4} /* Mn */, - { 0x09CD, 0x09CD} /* Mn */, { 0x09E2, 0x09E3} /* Mn */, - { 0x0A01, 0x0A02} /* Mn */, { 0x0A3C, 0x0A3C} /* Mn */, - { 0x0A41, 0x0A42} /* Mn */, { 0x0A47, 0x0A48} /* Mn */, - { 0x0A4B, 0x0A4D} /* Mn */, { 0x0A70, 0x0A71} /* Mn */, - { 0x0A81, 0x0A82} /* Mn */, { 0x0ABC, 0x0ABC} /* Mn */, - { 0x0AC1, 0x0AC5} /* Mn */, { 0x0AC7, 0x0AC8} /* Mn */, - { 0x0ACD, 0x0ACD} /* Mn */, { 0x0AE2, 0x0AE3} /* Mn */, - { 0x0B01, 0x0B01} /* Mn */, { 0x0B3C, 0x0B3C} /* Mn */, - { 0x0B3F, 0x0B3F} /* Mn */, { 0x0B41, 0x0B43} /* Mn */, - { 0x0B4D, 0x0B4D} /* Mn */, { 0x0B56, 0x0B56} /* Mn */, - { 0x0B82, 0x0B82} /* Mn */, { 0x0BC0, 0x0BC0} /* Mn */, - { 0x0BCD, 0x0BCD} /* Mn */, { 0x0C3E, 0x0C40} /* Mn */, - { 0x0C46, 0x0C48} /* Mn */, { 0x0C4A, 0x0C4D} /* Mn */, - { 0x0C55, 0x0C56} /* Mn */, { 0x0CBC, 0x0CBC} /* Mn */, - { 0x0CBF, 0x0CBF} /* Mn */, { 0x0CC6, 0x0CC6} /* Mn */, - { 0x0CCC, 0x0CCD} /* Mn */, { 0x0CE2, 0x0CE3} /* Mn */, - { 0x0D41, 0x0D43} /* Mn */, { 0x0D4D, 0x0D4D} /* Mn */, - { 0x0DCA, 0x0DCA} /* Mn */, { 0x0DD2, 0x0DD4} /* Mn */, - { 0x0DD6, 0x0DD6} /* Mn */, { 0x0E31, 0x0E31} /* Mn */, - { 0x0E34, 0x0E3A} /* Mn */, { 0x0E47, 0x0E4E} /* Mn */, - { 0x0EB1, 0x0EB1} /* Mn */, { 0x0EB4, 0x0EB9} /* Mn */, - { 0x0EBB, 0x0EBC} /* Mn */, { 0x0EC8, 0x0ECD} /* Mn */, - { 0x0F18, 0x0F19} /* Mn */, { 0x0F35, 0x0F35} /* Mn */, - { 0x0F37, 0x0F37} /* Mn */, { 0x0F39, 0x0F39} /* Mn */, - { 0x0F71, 0x0F7E} /* Mn */, { 0x0F80, 0x0F84} /* Mn */, - { 0x0F86, 0x0F87} /* Mn */, { 0x0F90, 0x0F97} /* Mn */, - { 0x0F99, 0x0FBC} /* Mn */, { 0x0FC6, 0x0FC6} /* Mn */, - { 0x102D, 0x1030} /* Mn */, { 0x1032, 0x1032} /* Mn */, - { 0x1036, 0x1037} /* Mn */, { 0x1039, 0x1039} /* Mn */, - { 0x1058, 0x1059} /* Mn */, { 0x135F, 0x135F} /* Mn */, - { 0x1712, 0x1714} /* Mn */, { 0x1732, 0x1734} /* Mn */, - { 0x1752, 0x1753} /* Mn */, { 0x1772, 0x1773} /* Mn */, - { 0x17B7, 0x17BD} /* Mn */, { 0x17C6, 0x17C6} /* Mn */, - { 0x17C9, 0x17D3} /* Mn */, { 0x17DD, 0x17DD} /* Mn */, - { 0x180B, 0x180D} /* Mn */, { 0x18A9, 0x18A9} /* Mn */, - { 0x1920, 0x1922} /* Mn */, { 0x1927, 0x1928} /* Mn */, - { 0x1932, 0x1932} /* Mn */, { 0x1939, 0x193B} /* Mn */, - { 0x1A17, 0x1A18} /* Mn */, { 0x1B00, 0x1B03} /* Mn */, - { 0x1B34, 0x1B34} /* Mn */, { 0x1B36, 0x1B3A} /* Mn */, - { 0x1B3C, 0x1B3C} /* Mn */, { 0x1B42, 0x1B42} /* Mn */, - { 0x1B6B, 0x1B73} /* Mn */, { 0x1DC0, 0x1DCA} /* Mn */, - { 0x1DFE, 0x1DFF} /* Mn */, { 0x20D0, 0x20DC} /* Mn */, - { 0x20DD, 0x20E0} /* Me */, - { 0x20E1, 0x20E1} /* Mn */, - { 0x20E2, 0x20E4} /* Me */, - { 0x20E5, 0x20EF} /* Mn */, { 0x302A, 0x302F} /* Mn */, - { 0x3099, 0x309A} /* Mn */, { 0xA806, 0xA806} /* Mn */, - { 0xA80B, 0xA80B} /* Mn */, { 0xA825, 0xA826} /* Mn */, - { 0xFB1E, 0xFB1E} /* Mn */, { 0xFE00, 0xFE0F} /* Mn */, - { 0xFE20, 0xFE23} /* Mn */, { 0x10A01, 0x10A03} /* Mn */, - { 0x10A05, 0x10A06} /* Mn */, { 0x10A0C, 0x10A0F} /* Mn */, - { 0x10A38, 0x10A3A} /* Mn */, { 0x10A3F, 0x10A3F} /* Mn */, - { 0x1D167, 0x1D169} /* Mn */, { 0x1D17B, 0x1D182} /* Mn */, - { 0x1D185, 0x1D18B} /* Mn */, { 0x1D1AA, 0x1D1AD} /* Mn */, - { 0x1D242, 0x1D244} /* Mn */, { 0xE0100, 0xE01EF} /* Mn */, -}; +#define DECLARE_RANGE_TABLE_START(name) \ + static struct wchar_range name##_array[] = { +#define DECLARE_RANGE_TABLE_END(name) \ + }; struct wchar_range_table name##_table = { name##_array, sizeof(name##_array)/sizeof(*name##_array) }; -/* - * Special pairs, not ranges. - */ +DECLARE_RANGE_TABLE_START(compose) +#include "compose.uni" +DECLARE_RANGE_TABLE_END(compose) + +DECLARE_RANGE_TABLE_START(ubin) +#include "ubin.uni" +DECLARE_RANGE_TABLE_END(ubin) + +DECLARE_RANGE_TABLE_START(wide) +#include "wide.uni" +DECLARE_RANGE_TABLE_END(wide) + +/* comb_table is special pairs, not ranges. */ static struct wchar_range comb_table[] = { {0x0644,0x0622}, {0x0644,0x0623}, {0x0644,0x0625}, {0x0644,0x0627}, }; -/* - * Characters with general category values - * Cc: Other, Control - * Cf: Other, Format - * Cs: Other, Surrogate - * Co: Other, Private Use - * Cn: Other, Not Assigned - * Zl: Separator, Line - * Zp: Separator, Paragraph - * Last synched with - * - * dated 2005-11-30T00:58:48Z - */ -static struct wchar_range ubin_table[] = { - { 0x0000, 0x0007} /* Cc */, - { 0x000B, 0x000C} /* Cc */, - { 0x000E, 0x001A} /* Cc */, - { 0x001C, 0x001F} /* Cc */, - { 0x007F, 0x009F} /* Cc */, -#if 0 - { 0x00AD, 0x00AD} /* Cf */, -#endif - { 0x0370, 0x0373} /* Cn */, { 0x0376, 0x0379} /* Cn */, - { 0x037F, 0x0383} /* Cn */, { 0x038B, 0x038B} /* Cn */, - { 0x038D, 0x038D} /* Cn */, { 0x03A2, 0x03A2} /* Cn */, - { 0x03CF, 0x03CF} /* Cn */, { 0x0487, 0x0487} /* Cn */, - { 0x0514, 0x0530} /* Cn */, { 0x0557, 0x0558} /* Cn */, - { 0x0560, 0x0560} /* Cn */, { 0x0588, 0x0588} /* Cn */, - { 0x058B, 0x0590} /* Cn */, { 0x05C8, 0x05CF} /* Cn */, - { 0x05EB, 0x05EF} /* Cn */, { 0x05F5, 0x05FF} /* Cn */, -#if 0 - { 0x0600, 0x0603} /* Cf */, -#endif - { 0x0604, 0x060A} /* Cn */, { 0x0616, 0x061A} /* Cn */, - { 0x061C, 0x061D} /* Cn */, { 0x0620, 0x0620} /* Cn */, - { 0x063B, 0x063F} /* Cn */, { 0x065F, 0x065F} /* Cn */, -#if 0 - { 0x06DD, 0x06DD} /* Cf */, -#endif - { 0x070E, 0x070E} /* Cn */, -#if 0 - { 0x070F, 0x070F} /* Cf */, -#endif - { 0x074B, 0x074C} /* Cn */, { 0x076E, 0x077F} /* Cn */, - { 0x07B2, 0x07BF} /* Cn */, { 0x07FB, 0x0900} /* Cn */, - { 0x093A, 0x093B} /* Cn */, { 0x094E, 0x094F} /* Cn */, - { 0x0955, 0x0957} /* Cn */, { 0x0971, 0x097A} /* Cn */, - { 0x0980, 0x0980} /* Cn */, { 0x0984, 0x0984} /* Cn */, - { 0x098D, 0x098E} /* Cn */, { 0x0991, 0x0992} /* Cn */, - { 0x09A9, 0x09A9} /* Cn */, { 0x09B1, 0x09B1} /* Cn */, - { 0x09B3, 0x09B5} /* Cn */, { 0x09BA, 0x09BB} /* Cn */, - { 0x09C5, 0x09C6} /* Cn */, { 0x09C9, 0x09CA} /* Cn */, - { 0x09CF, 0x09D6} /* Cn */, { 0x09D8, 0x09DB} /* Cn */, - { 0x09DE, 0x09DE} /* Cn */, { 0x09E4, 0x09E5} /* Cn */, - { 0x09FB, 0x0A00} /* Cn */, { 0x0A04, 0x0A04} /* Cn */, - { 0x0A0B, 0x0A0E} /* Cn */, { 0x0A11, 0x0A12} /* Cn */, - { 0x0A29, 0x0A29} /* Cn */, { 0x0A31, 0x0A31} /* Cn */, - { 0x0A34, 0x0A34} /* Cn */, { 0x0A37, 0x0A37} /* Cn */, - { 0x0A3A, 0x0A3B} /* Cn */, { 0x0A3D, 0x0A3D} /* Cn */, - { 0x0A43, 0x0A46} /* Cn */, { 0x0A49, 0x0A4A} /* Cn */, - { 0x0A4E, 0x0A58} /* Cn */, { 0x0A5D, 0x0A5D} /* Cn */, - { 0x0A5F, 0x0A65} /* Cn */, { 0x0A75, 0x0A80} /* Cn */, - { 0x0A84, 0x0A84} /* Cn */, { 0x0A8E, 0x0A8E} /* Cn */, - { 0x0A92, 0x0A92} /* Cn */, { 0x0AA9, 0x0AA9} /* Cn */, - { 0x0AB1, 0x0AB1} /* Cn */, { 0x0AB4, 0x0AB4} /* Cn */, - { 0x0ABA, 0x0ABB} /* Cn */, { 0x0AC6, 0x0AC6} /* Cn */, - { 0x0ACA, 0x0ACA} /* Cn */, { 0x0ACE, 0x0ACF} /* Cn */, - { 0x0AD1, 0x0ADF} /* Cn */, { 0x0AE4, 0x0AE5} /* Cn */, - { 0x0AF0, 0x0AF0} /* Cn */, { 0x0AF2, 0x0B00} /* Cn */, - { 0x0B04, 0x0B04} /* Cn */, { 0x0B0D, 0x0B0E} /* Cn */, - { 0x0B11, 0x0B12} /* Cn */, { 0x0B29, 0x0B29} /* Cn */, - { 0x0B31, 0x0B31} /* Cn */, { 0x0B34, 0x0B34} /* Cn */, - { 0x0B3A, 0x0B3B} /* Cn */, { 0x0B44, 0x0B46} /* Cn */, - { 0x0B49, 0x0B4A} /* Cn */, { 0x0B4E, 0x0B55} /* Cn */, - { 0x0B58, 0x0B5B} /* Cn */, { 0x0B5E, 0x0B5E} /* Cn */, - { 0x0B62, 0x0B65} /* Cn */, { 0x0B72, 0x0B81} /* Cn */, - { 0x0B84, 0x0B84} /* Cn */, { 0x0B8B, 0x0B8D} /* Cn */, - { 0x0B91, 0x0B91} /* Cn */, { 0x0B96, 0x0B98} /* Cn */, - { 0x0B9B, 0x0B9B} /* Cn */, { 0x0B9D, 0x0B9D} /* Cn */, - { 0x0BA0, 0x0BA2} /* Cn */, { 0x0BA5, 0x0BA7} /* Cn */, - { 0x0BAB, 0x0BAD} /* Cn */, { 0x0BBA, 0x0BBD} /* Cn */, - { 0x0BC3, 0x0BC5} /* Cn */, { 0x0BC9, 0x0BC9} /* Cn */, - { 0x0BCE, 0x0BD6} /* Cn */, { 0x0BD8, 0x0BE5} /* Cn */, - { 0x0BFB, 0x0C00} /* Cn */, { 0x0C04, 0x0C04} /* Cn */, - { 0x0C0D, 0x0C0D} /* Cn */, { 0x0C11, 0x0C11} /* Cn */, - { 0x0C29, 0x0C29} /* Cn */, { 0x0C34, 0x0C34} /* Cn */, - { 0x0C3A, 0x0C3D} /* Cn */, { 0x0C45, 0x0C45} /* Cn */, - { 0x0C49, 0x0C49} /* Cn */, { 0x0C4E, 0x0C54} /* Cn */, - { 0x0C57, 0x0C5F} /* Cn */, { 0x0C62, 0x0C65} /* Cn */, - { 0x0C70, 0x0C81} /* Cn */, { 0x0C84, 0x0C84} /* Cn */, - { 0x0C8D, 0x0C8D} /* Cn */, { 0x0C91, 0x0C91} /* Cn */, - { 0x0CA9, 0x0CA9} /* Cn */, { 0x0CB4, 0x0CB4} /* Cn */, - { 0x0CBA, 0x0CBB} /* Cn */, { 0x0CC5, 0x0CC5} /* Cn */, - { 0x0CC9, 0x0CC9} /* Cn */, { 0x0CCE, 0x0CD4} /* Cn */, - { 0x0CD7, 0x0CDD} /* Cn */, { 0x0CDF, 0x0CDF} /* Cn */, - { 0x0CE4, 0x0CE5} /* Cn */, { 0x0CF0, 0x0CF0} /* Cn */, - { 0x0CF3, 0x0D01} /* Cn */, { 0x0D04, 0x0D04} /* Cn */, - { 0x0D0D, 0x0D0D} /* Cn */, { 0x0D11, 0x0D11} /* Cn */, - { 0x0D29, 0x0D29} /* Cn */, { 0x0D3A, 0x0D3D} /* Cn */, - { 0x0D44, 0x0D45} /* Cn */, { 0x0D49, 0x0D49} /* Cn */, - { 0x0D4E, 0x0D56} /* Cn */, { 0x0D58, 0x0D5F} /* Cn */, - { 0x0D62, 0x0D65} /* Cn */, { 0x0D70, 0x0D81} /* Cn */, - { 0x0D84, 0x0D84} /* Cn */, { 0x0D97, 0x0D99} /* Cn */, - { 0x0DB2, 0x0DB2} /* Cn */, { 0x0DBC, 0x0DBC} /* Cn */, - { 0x0DBE, 0x0DBF} /* Cn */, { 0x0DC7, 0x0DC9} /* Cn */, - { 0x0DCB, 0x0DCE} /* Cn */, { 0x0DD5, 0x0DD5} /* Cn */, - { 0x0DD7, 0x0DD7} /* Cn */, { 0x0DE0, 0x0DF1} /* Cn */, - { 0x0DF5, 0x0E00} /* Cn */, { 0x0E3B, 0x0E3E} /* Cn */, - { 0x0E5C, 0x0E80} /* Cn */, { 0x0E83, 0x0E83} /* Cn */, - { 0x0E85, 0x0E86} /* Cn */, { 0x0E89, 0x0E89} /* Cn */, - { 0x0E8B, 0x0E8C} /* Cn */, { 0x0E8E, 0x0E93} /* Cn */, - { 0x0E98, 0x0E98} /* Cn */, { 0x0EA0, 0x0EA0} /* Cn */, - { 0x0EA4, 0x0EA4} /* Cn */, { 0x0EA6, 0x0EA6} /* Cn */, - { 0x0EA8, 0x0EA9} /* Cn */, { 0x0EAC, 0x0EAC} /* Cn */, - { 0x0EBA, 0x0EBA} /* Cn */, { 0x0EBE, 0x0EBF} /* Cn */, - { 0x0EC5, 0x0EC5} /* Cn */, { 0x0EC7, 0x0EC7} /* Cn */, - { 0x0ECE, 0x0ECF} /* Cn */, { 0x0EDA, 0x0EDB} /* Cn */, - { 0x0EDE, 0x0EFF} /* Cn */, { 0x0F48, 0x0F48} /* Cn */, - { 0x0F6B, 0x0F70} /* Cn */, { 0x0F8C, 0x0F8F} /* Cn */, - { 0x0F98, 0x0F98} /* Cn */, { 0x0FBD, 0x0FBD} /* Cn */, - { 0x0FCD, 0x0FCE} /* Cn */, { 0x0FD2, 0x0FFF} /* Cn */, - { 0x1022, 0x1022} /* Cn */, { 0x1028, 0x1028} /* Cn */, - { 0x102B, 0x102B} /* Cn */, { 0x1033, 0x1035} /* Cn */, - { 0x103A, 0x103F} /* Cn */, { 0x105A, 0x109F} /* Cn */, - { 0x10C6, 0x10CF} /* Cn */, { 0x10FD, 0x10FF} /* Cn */, - { 0x115A, 0x115E} /* Cn */, { 0x11A3, 0x11A7} /* Cn */, - { 0x11FA, 0x11FF} /* Cn */, { 0x1249, 0x1249} /* Cn */, - { 0x124E, 0x124F} /* Cn */, { 0x1257, 0x1257} /* Cn */, - { 0x1259, 0x1259} /* Cn */, { 0x125E, 0x125F} /* Cn */, - { 0x1289, 0x1289} /* Cn */, { 0x128E, 0x128F} /* Cn */, - { 0x12B1, 0x12B1} /* Cn */, { 0x12B6, 0x12B7} /* Cn */, - { 0x12BF, 0x12BF} /* Cn */, { 0x12C1, 0x12C1} /* Cn */, - { 0x12C6, 0x12C7} /* Cn */, { 0x12D7, 0x12D7} /* Cn */, - { 0x1311, 0x1311} /* Cn */, { 0x1316, 0x1317} /* Cn */, - { 0x135B, 0x135E} /* Cn */, { 0x137D, 0x137F} /* Cn */, - { 0x139A, 0x139F} /* Cn */, { 0x13F5, 0x1400} /* Cn */, - { 0x1677, 0x167F} /* Cn */, { 0x169D, 0x169F} /* Cn */, - { 0x16F1, 0x16FF} /* Cn */, { 0x170D, 0x170D} /* Cn */, - { 0x1715, 0x171F} /* Cn */, { 0x1737, 0x173F} /* Cn */, - { 0x1754, 0x175F} /* Cn */, { 0x176D, 0x176D} /* Cn */, - { 0x1771, 0x1771} /* Cn */, { 0x1774, 0x177F} /* Cn */, -#if 0 - { 0x17B4, 0x17B5} /* Cf */, -#endif - { 0x17DE, 0x17DF} /* Cn */, { 0x17EA, 0x17EF} /* Cn */, - { 0x17FA, 0x17FF} /* Cn */, { 0x180F, 0x180F} /* Cn */, - { 0x181A, 0x181F} /* Cn */, { 0x1878, 0x187F} /* Cn */, - { 0x18AA, 0x18FF} /* Cn */, { 0x191D, 0x191F} /* Cn */, - { 0x192C, 0x192F} /* Cn */, { 0x193C, 0x193F} /* Cn */, - { 0x1941, 0x1943} /* Cn */, { 0x196E, 0x196F} /* Cn */, - { 0x1975, 0x197F} /* Cn */, { 0x19AA, 0x19AF} /* Cn */, - { 0x19CA, 0x19CF} /* Cn */, { 0x19DA, 0x19DD} /* Cn */, - { 0x1A1C, 0x1A1D} /* Cn */, { 0x1A20, 0x1AFF} /* Cn */, - { 0x1B4C, 0x1B4F} /* Cn */, { 0x1B7D, 0x1CFF} /* Cn */, - { 0x1DCB, 0x1DFD} /* Cn */, { 0x1E9C, 0x1E9F} /* Cn */, - { 0x1EFA, 0x1EFF} /* Cn */, { 0x1F16, 0x1F17} /* Cn */, - { 0x1F1E, 0x1F1F} /* Cn */, { 0x1F46, 0x1F47} /* Cn */, - { 0x1F4E, 0x1F4F} /* Cn */, { 0x1F58, 0x1F58} /* Cn */, - { 0x1F5A, 0x1F5A} /* Cn */, { 0x1F5C, 0x1F5C} /* Cn */, - { 0x1F5E, 0x1F5E} /* Cn */, { 0x1F7E, 0x1F7F} /* Cn */, - { 0x1FB5, 0x1FB5} /* Cn */, { 0x1FC5, 0x1FC5} /* Cn */, - { 0x1FD4, 0x1FD5} /* Cn */, { 0x1FDC, 0x1FDC} /* Cn */, - { 0x1FF0, 0x1FF1} /* Cn */, { 0x1FF5, 0x1FF5} /* Cn */, - { 0x1FFF, 0x1FFF} /* Cn */, - { 0x200B, 0x200F} /* Cf */, - { 0x2028, 0x2028} /* Zl */, - { 0x2029, 0x2029} /* Zp */, - { 0x202A, 0x202E} /* Cf */, - { 0x2060, 0x2063} /* Cf */, - { 0x2064, 0x2069} /* Cn */, - { 0x206A, 0x206F} /* Cf */, - { 0x2072, 0x2073} /* Cn */, { 0x208F, 0x208F} /* Cn */, - { 0x2095, 0x209F} /* Cn */, { 0x20B6, 0x20CF} /* Cn */, - { 0x20F0, 0x20FF} /* Cn */, { 0x214F, 0x2152} /* Cn */, - { 0x2185, 0x218F} /* Cn */, { 0x23E8, 0x23FF} /* Cn */, - { 0x2427, 0x243F} /* Cn */, { 0x244B, 0x245F} /* Cn */, - { 0x269D, 0x269F} /* Cn */, { 0x26B3, 0x2700} /* Cn */, - { 0x2705, 0x2705} /* Cn */, { 0x270A, 0x270B} /* Cn */, - { 0x2728, 0x2728} /* Cn */, { 0x274C, 0x274C} /* Cn */, - { 0x274E, 0x274E} /* Cn */, { 0x2753, 0x2755} /* Cn */, - { 0x2757, 0x2757} /* Cn */, { 0x275F, 0x2760} /* Cn */, - { 0x2795, 0x2797} /* Cn */, { 0x27B0, 0x27B0} /* Cn */, - { 0x27BF, 0x27BF} /* Cn */, { 0x27CB, 0x27CF} /* Cn */, - { 0x27EC, 0x27EF} /* Cn */, { 0x2B1B, 0x2B1F} /* Cn */, - { 0x2B24, 0x2BFF} /* Cn */, { 0x2C2F, 0x2C2F} /* Cn */, - { 0x2C5F, 0x2C5F} /* Cn */, { 0x2C6D, 0x2C73} /* Cn */, - { 0x2C78, 0x2C7F} /* Cn */, { 0x2CEB, 0x2CF8} /* Cn */, - { 0x2D26, 0x2D2F} /* Cn */, { 0x2D66, 0x2D6E} /* Cn */, - { 0x2D70, 0x2D7F} /* Cn */, { 0x2D97, 0x2D9F} /* Cn */, - { 0x2DA7, 0x2DA7} /* Cn */, { 0x2DAF, 0x2DAF} /* Cn */, - { 0x2DB7, 0x2DB7} /* Cn */, { 0x2DBF, 0x2DBF} /* Cn */, - { 0x2DC7, 0x2DC7} /* Cn */, { 0x2DCF, 0x2DCF} /* Cn */, - { 0x2DD7, 0x2DD7} /* Cn */, { 0x2DDF, 0x2DFF} /* Cn */, - { 0x2E18, 0x2E1B} /* Cn */, { 0x2E1E, 0x2E7F} /* Cn */, - { 0x2E9A, 0x2E9A} /* Cn */, { 0x2EF4, 0x2EFF} /* Cn */, - { 0x2FD6, 0x2FEF} /* Cn */, { 0x2FFC, 0x2FFF} /* Cn */, - { 0x3040, 0x3040} /* Cn */, { 0x3097, 0x3098} /* Cn */, - { 0x3100, 0x3104} /* Cn */, { 0x312D, 0x3130} /* Cn */, - { 0x318F, 0x318F} /* Cn */, { 0x31B8, 0x31BF} /* Cn */, - { 0x31D0, 0x31EF} /* Cn */, { 0x321F, 0x321F} /* Cn */, - { 0x3244, 0x324F} /* Cn */, { 0x32FF, 0x32FF} /* Cn */, - { 0x4DB6, 0x4DBF} /* Cn */, { 0x9FBC, 0x9FFF} /* Cn */, - { 0xA48D, 0xA48F} /* Cn */, { 0xA4C7, 0xA6FF} /* Cn */, - { 0xA71B, 0xA71F} /* Cn */, { 0xA722, 0xA7FF} /* Cn */, - { 0xA82C, 0xA83F} /* Cn */, { 0xA878, 0xABFF} /* Cn */, - { 0xD7A4, 0xD7FF} /* Cn */, - { 0xD800, 0xDFFF} /* Cs */, - { 0xE000, 0xF8FF} /* Co */, - { 0xFA2E, 0xFA2F} /* Cn */, { 0xFA6B, 0xFA6F} /* Cn */, - { 0xFADA, 0xFAFF} /* Cn */, { 0xFB07, 0xFB12} /* Cn */, - { 0xFB18, 0xFB1C} /* Cn */, { 0xFB37, 0xFB37} /* Cn */, - { 0xFB3D, 0xFB3D} /* Cn */, { 0xFB3F, 0xFB3F} /* Cn */, - { 0xFB42, 0xFB42} /* Cn */, { 0xFB45, 0xFB45} /* Cn */, - { 0xFBB2, 0xFBD2} /* Cn */, { 0xFD40, 0xFD4F} /* Cn */, - { 0xFD90, 0xFD91} /* Cn */, { 0xFDC8, 0xFDEF} /* Cn */, - { 0xFDFE, 0xFDFF} /* Cn */, { 0xFE1A, 0xFE1F} /* Cn */, - { 0xFE24, 0xFE2F} /* Cn */, { 0xFE53, 0xFE53} /* Cn */, - { 0xFE67, 0xFE67} /* Cn */, { 0xFE6C, 0xFE6F} /* Cn */, - { 0xFE75, 0xFE75} /* Cn */, { 0xFEFD, 0xFEFE} /* Cn */, - { 0xFEFF, 0xFEFF} /* Cf */, - { 0xFF00, 0xFF00} /* Cn */, { 0xFFBF, 0xFFC1} /* Cn */, - { 0xFFC8, 0xFFC9} /* Cn */, { 0xFFD0, 0xFFD1} /* Cn */, - { 0xFFD8, 0xFFD9} /* Cn */, { 0xFFDD, 0xFFDF} /* Cn */, - { 0xFFE7, 0xFFE7} /* Cn */, { 0xFFEF, 0xFFF8} /* Cn */, - { 0xFFF9, 0xFFFB} /* Cf */, - { 0xFFFE, 0xFFFF} /* Cn */, { 0x1000C, 0x1000C} /* Cn */, - { 0x10027, 0x10027} /* Cn */, { 0x1003B, 0x1003B} /* Cn */, - { 0x1003E, 0x1003E} /* Cn */, { 0x1004E, 0x1004F} /* Cn */, - { 0x1005E, 0x1007F} /* Cn */, { 0x100FB, 0x100FF} /* Cn */, - { 0x10103, 0x10106} /* Cn */, { 0x10134, 0x10136} /* Cn */, - { 0x1018B, 0x102FF} /* Cn */, { 0x1031F, 0x1031F} /* Cn */, - { 0x10324, 0x1032F} /* Cn */, { 0x1034B, 0x1037F} /* Cn */, - { 0x1039E, 0x1039E} /* Cn */, { 0x103C4, 0x103C7} /* Cn */, - { 0x103D6, 0x103FF} /* Cn */, - { 0x1049E, 0x1049F} /* Cn */, { 0x104AA, 0x107FF} /* Cn */, - { 0x10806, 0x10807} /* Cn */, { 0x10809, 0x10809} /* Cn */, - { 0x10836, 0x10836} /* Cn */, { 0x10839, 0x1083B} /* Cn */, - { 0x1083D, 0x1083E} /* Cn */, { 0x10840, 0x108FF} /* Cn */, - { 0x1091A, 0x1091E} /* Cn */, { 0x10920, 0x109FF} /* Cn */, - { 0x10A04, 0x10A04} /* Cn */, { 0x10A07, 0x10A0B} /* Cn */, - { 0x10A14, 0x10A14} /* Cn */, { 0x10A18, 0x10A18} /* Cn */, - { 0x10A34, 0x10A37} /* Cn */, { 0x10A3B, 0x10A3E} /* Cn */, - { 0x10A48, 0x10A4F} /* Cn */, { 0x10A59, 0x11FFF} /* Cn */, - { 0x1236F, 0x123FF} /* Cn */, { 0x12463, 0x1246F} /* Cn */, - { 0x12474, 0x1CFFF} /* Cn */, { 0x1D0F6, 0x1D0FF} /* Cn */, - { 0x1D127, 0x1D129} /* Cn */, - { 0x1D173, 0x1D17A} /* Cf */, - { 0x1D1DE, 0x1D1FF} /* Cn */, { 0x1D246, 0x1D2FF} /* Cn */, - { 0x1D357, 0x1D35F} /* Cn */, { 0x1D372, 0x1D3FF} /* Cn */, - { 0x1D455, 0x1D455} /* Cn */, { 0x1D49D, 0x1D49D} /* Cn */, - { 0x1D4A0, 0x1D4A1} /* Cn */, { 0x1D4A3, 0x1D4A4} /* Cn */, - { 0x1D4A7, 0x1D4A8} /* Cn */, { 0x1D4AD, 0x1D4AD} /* Cn */, - { 0x1D4BA, 0x1D4BA} /* Cn */, { 0x1D4BC, 0x1D4BC} /* Cn */, - { 0x1D4C4, 0x1D4C4} /* Cn */, { 0x1D506, 0x1D506} /* Cn */, - { 0x1D50B, 0x1D50C} /* Cn */, { 0x1D515, 0x1D515} /* Cn */, - { 0x1D51D, 0x1D51D} /* Cn */, { 0x1D53A, 0x1D53A} /* Cn */, - { 0x1D53F, 0x1D53F} /* Cn */, { 0x1D545, 0x1D545} /* Cn */, - { 0x1D547, 0x1D549} /* Cn */, { 0x1D551, 0x1D551} /* Cn */, - { 0x1D6A6, 0x1D6A7} /* Cn */, { 0x1D7CC, 0x1D7CD} /* Cn */, - { 0x1D800, 0x1FFFF} /* Cn */, { 0x2A6D7, 0x2F7FF} /* Cn */, - { 0x2FA1E, 0xE0000} /* Cn */, - { 0xE0001, 0xE0001} /* Cf */, - { 0xE0002, 0xE001F} /* Cn */, - { 0xE0020, 0xE007F} /* Cf */, - { 0xE0080, 0xE00FF} /* Cn */, { 0xE01F0, 0xEFFFF} /* Cn */, - { 0xF0000, 0xFFFFD} /* Co */, - { 0xFFFFE, 0xFFFFF} /* Cn */, - {0x100000,0x10FFFD} /* Co */, - {0x10FFFE,0x10FFFF} /* Cn */, - {0x110000,0x7FFFFFFF} /* ISO 10646?? */ -}; - -/* - * Double width characters - * W: East Asian Wide - * F: East Asian Full-width - * Unassigned code points may be included when they allow ranges to be merged. - * Last synched with - * - * dated 2005-11-08T01:32:56Z - */ -static struct wchar_range wide_table[] = { - { 0x1100, 0x115F} /* W */, { 0x2329, 0x232A} /* W */, - { 0x2E80, 0x2FFB} /* W */, - { 0x3000, 0x3000} /* F */, - { 0x3001, 0x303E} /* W */, { 0x3041, 0x4DB5} /* W */, - { 0x4E00, 0x9FBB} /* W */, { 0xA000, 0xA4C6} /* W */, - { 0xAC00, 0xD7A3} /* W */, { 0xF900, 0xFAD9} /* W */, - { 0xFE10, 0xFE19} /* W */, { 0xFE30, 0xFE6B} /* W */, - { 0xFF01, 0xFF60} /* F */, { 0xFFE0, 0xFFE6} /* F */, - { 0x20000, 0x2FFFD} /* W */, { 0x30000, 0x3FFFD} /* W */, -}; static int -is_in_table(ch, table, tsize) +is_in_table(ch, table) LWCHAR ch; - struct wchar_range table[]; - int tsize; + struct wchar_range_table *table; { int hi; int lo; /* Binary search in the table. */ - if (ch < table[0].first) + if (ch < table->table[0].first) return 0; lo = 0; - hi = tsize - 1; + hi = table->count - 1; while (lo <= hi) { int mid = (lo + hi) / 2; - if (ch > table[mid].last) + if (ch > table->table[mid].last) lo = mid + 1; - else if (ch < table[mid].first) + else if (ch < table->table[mid].first) hi = mid - 1; else return 1; @@ -1126,7 +777,7 @@ is_in_table(ch, table, tsize) is_composing_char(ch) LWCHAR ch; { - return is_in_table(ch, comp_table, (sizeof(comp_table) / sizeof(*comp_table))); + return is_in_table(ch, &compose_table); } /* @@ -1136,7 +787,7 @@ is_composing_char(ch) is_ubin_char(ch) LWCHAR ch; { - return is_in_table(ch, ubin_table, (sizeof(ubin_table) / sizeof(*ubin_table))); + return is_in_table(ch, &ubin_table); } /* @@ -1146,7 +797,7 @@ is_ubin_char(ch) is_wide_char(ch) LWCHAR ch; { - return is_in_table(ch, wide_table, (sizeof(wide_table) / sizeof(*wide_table))); + return is_in_table(ch, &wide_table); } /* Modified: head/contrib/less/charset.h ============================================================================== --- head/contrib/less/charset.h Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/charset.h Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/cmd.h ============================================================================== --- head/contrib/less/cmd.h Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/cmd.h Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -66,6 +66,7 @@ #define A_PREV_TAG 54 #define A_FILTER 55 #define A_F_UNTIL_HILITE 56 +#define A_GOEND_BUF 57 #define A_INVALID 100 #define A_NOACTION 101 Modified: head/contrib/less/cmdbuf.c ============================================================================== --- head/contrib/less/cmdbuf.c Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/cmdbuf.c Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -203,7 +203,7 @@ cmd_step_common(p, ch, len, pwidth, bswi pr = prchar((int) ch); if (pwidth != NULL || bswidth != NULL) { - int len = strlen(pr); + int len = (int) strlen(pr); if (pwidth != NULL) *pwidth = len; if (bswidth != NULL) @@ -222,7 +222,7 @@ cmd_step_common(p, ch, len, pwidth, bswi *bswidth = 0; } else if (is_ubin_char(ch)) { - int len = strlen(pr); + int len = (int) strlen(pr); if (pwidth != NULL) *pwidth = len; if (bswidth != NULL) @@ -375,7 +375,7 @@ cmd_lshift() s = ns; } - cmd_offset = s - cmdbuf; + cmd_offset = (int) (s - cmdbuf); save_cp = cp; cmd_home(); cmd_repaint(save_cp); @@ -405,7 +405,7 @@ cmd_rshift() cols += width; } - cmd_offset = s - cmdbuf; + cmd_offset = (int) (s - cmdbuf); save_cp = cp; cmd_home(); cmd_repaint(save_cp); @@ -535,7 +535,7 @@ cmd_erase() */ s = cp; cmd_left(); - clen = s - cp; + clen = (int) (s - cp); /* * Remove the char from the buffer (shift the buffer left). @@ -701,7 +701,7 @@ cmd_updown(action) if (updown_match < 0) { - updown_match = cp - cmdbuf; + updown_match = (int) (cp - cmdbuf); } /* @@ -744,12 +744,13 @@ cmd_updown(action) #endif /* - * Add a string to a history list. + * Add a string to an mlist. */ public void -cmd_addhist(mlist, cmd) +cmd_addhist(mlist, cmd, modified) struct mlist *mlist; char *cmd; + int modified; { #if CMD_HISTORY struct mlist *ml; @@ -773,6 +774,7 @@ cmd_addhist(mlist, cmd) */ ml = (struct mlist *) ecalloc(1, sizeof(struct mlist)); ml->string = save(cmd); + ml->modified = modified; ml->next = mlist; ml->prev = mlist->prev; mlist->prev->next = ml; @@ -799,7 +801,7 @@ cmd_accept() */ if (curr_mlist == NULL) return; - cmd_addhist(curr_mlist, cmdbuf); + cmd_addhist(curr_mlist, cmdbuf, 1); curr_mlist->modified = 1; #endif } @@ -965,7 +967,7 @@ delimit_word() int delim_quoted = 0; int meta_quoted = 0; char *esc = get_meta_escape(); - int esclen = strlen(esc); + int esclen = (int) strlen(esc); #endif /* @@ -1262,7 +1264,7 @@ cmd_char(c) cmd_mbc_buf[cmd_mbc_buf_index++] = c; if (cmd_mbc_buf_index < cmd_mbc_buf_len) return (CC_OK); - if (!is_utf8_well_formed(cmd_mbc_buf)) + if (!is_utf8_well_formed(cmd_mbc_buf, cmd_mbc_buf_index)) { /* complete, but not well formed (non-shortest form), sequence */ cmd_mbc_buf_len = 0; @@ -1359,6 +1361,18 @@ cmd_lastpattern() #if CMD_HISTORY /* + */ + static int +mlist_size(ml) + struct mlist *ml; +{ + int size = 0; + for (ml = ml->next; ml->string != NULL; ml = ml->next) + ++size; + return size; +} + +/* * Get the name of the history file. */ static char * @@ -1378,6 +1392,10 @@ histfile_name() return (save(name)); } + /* See if history file is disabled in the build. */ + if (strcmp(LESSHISTFILE, "") == 0 || strcmp(LESSHISTFILE, "-") == 0) + return (NULL); + /* Otherwise, file is in $HOME. */ home = lgetenv("HOME"); if (home == NULL || *home == '\0') @@ -1388,25 +1406,28 @@ histfile_name() #endif return (NULL); } - len = strlen(home) + strlen(LESSHISTFILE) + 2; + len = (int) (strlen(home) + strlen(LESSHISTFILE) + 2); name = (char *) ecalloc(len, sizeof(char)); SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE); return (name); } -#endif /* CMD_HISTORY */ /* - * Initialize history from a .lesshist file. + * Read a .lesshst file and call a callback for each line in the file. */ - public void -init_cmdhist() + static void +read_cmdhist2(action, uparam, skip_search, skip_shell) + void (*action)(void*,struct mlist*,char*); + void *uparam; + int skip_search; + int skip_shell; { -#if CMD_HISTORY struct mlist *ml = NULL; char line[CMDBUF_SIZE]; char *filename; FILE *f; char *p; + int *skip = NULL; filename = histfile_name(); if (filename == NULL) @@ -1432,84 +1453,170 @@ init_cmdhist() } } if (strcmp(line, HISTFILE_SEARCH_SECTION) == 0) + { ml = &mlist_search; - else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0) + skip = &skip_search; + } else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0) { #if SHELL_ESCAPE || PIPEC ml = &mlist_shell; + skip = &skip_shell; #else ml = NULL; + skip = NULL; #endif } else if (*line == '"') { if (ml != NULL) - cmd_addhist(ml, line+1); + { + if (skip != NULL && *skip > 0) + --(*skip); + else + (*action)(uparam, ml, line+1); + } } } fclose(f); +} + + static void +read_cmdhist(action, uparam, skip_search, skip_shell) + void (*action)(void*,struct mlist*,char*); + void *uparam; + int skip_search; + int skip_shell; +{ + read_cmdhist2(action, uparam, skip_search, skip_shell); + (*action)(uparam, NULL, NULL); /* signal end of file */ +} + + static void +addhist_init(void *uparam, struct mlist *ml, char *string) +{ + if (ml == NULL || string == NULL) + return; + cmd_addhist(ml, string, 0); +} +#endif /* CMD_HISTORY */ + +/* + * Initialize history from a .lesshist file. + */ + public void +init_cmdhist() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 5 05:38:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4678A62093; Tue, 5 Jan 2016 05:38:07 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8358E1343; Tue, 5 Jan 2016 05:38:07 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-ig0-x235.google.com with SMTP id to18so6246401igc.0; Mon, 04 Jan 2016 21:38:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kFmyVvfpOutgLSO/u4gGnEDGz22QhbLtWhs7Yy/yUPs=; b=H254qbUeqWFvlVZGuHJhPmKca3NEZwA5K/mcuqelnInll8n042E2SPoF1HemivKASv fGxziZB5tcnHYxw+D+7V4raU/xMzmzxCHThNVhieQ/5bZKDZHzkFepsKvIbJlPEFUFaf 8e//6QFojZHUVPT5dhN4nd5QX1dPadvn1VMybLc71jCpensD4HrMThQFB0hyldPjk2KU CB/1R1qz+YVxvBCcG88QsoZDkdV8tAdu8Hp8279+WjfKieMjaOWeezjycddbk1Y5nWnd xBqWFzm7ojt0gOTD9O1ibnrRPCAHMrnxMd6SZjjIZjZu/KZcL7L0RAdEJKZFh1JQJJFX y7jg== MIME-Version: 1.0 X-Received: by 10.50.36.74 with SMTP id o10mr1892793igj.73.1451972286918; Mon, 04 Jan 2016 21:38:06 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.50.152.69 with HTTP; Mon, 4 Jan 2016 21:38:06 -0800 (PST) In-Reply-To: <201501202339.t0KNd9J6007337@svn.freebsd.org> References: <201501202339.t0KNd9J6007337@svn.freebsd.org> Date: Tue, 5 Jan 2016 00:38:06 -0500 X-Google-Sender-Auth: U8v-uhDkSawXo1m0Wn6MUxgE_X8 Message-ID: Subject: Re: svn commit: r277457 - in stable/10: . etc etc/mtree tools/build/mk From: Craig Rodrigues To: Garrett Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 05:38:07 -0000 On Tue, Jan 20, 2015 at 6:39 PM, Garrett Cooper wrote: > Author: ngie > Date: Tue Jan 20 23:39:08 2015 > New Revision: 277457 > URL: https://svnweb.freebsd.org/changeset/base/277457 > > Log: > MFC r275907: > > r275907 (by ngie): > > Fix building/installing tests when TESTSBASE != /usr/tests > > This merge is botched. Can you fix this? mtree is now creating these directories under /usr/tests/sys which is wrong, and causing "installworld" to fail if src.conf contains WITH_TESTS="yes" usr/tests/sys/usr.sbin usr/tests/sys/usr.sbin/sa usr/tests/sys/usr.sbin/pw usr/tests/sys/usr.sbin/fstyp usr/tests/sys/usr.sbin/nmtree usr/tests/sys/usr.sbin/newsyslog usr/tests/sys/usr.sbin/etcupdate usr/tests/sys/usr.sbin/makefs usr/tests/sys/usr.bin usr/tests/sys/usr.bin/tar usr/tests/sys/usr.bin/cut usr/tests/sys/usr.bin/comm usr/tests/sys/usr.bin/col usr/tests/sys/usr.bin/cpio usr/tests/sys/usr.bin/file2c usr/tests/sys/usr.bin/uudecode usr/tests/sys/usr.bin/truncate usr/tests/sys/usr.bin/cmp usr/tests/sys/usr.bin/m4 usr/tests/sys/usr.bin/grep usr/tests/sys/usr.bin/timeout usr/tests/sys/usr.bin/lastcomm usr/tests/sys/usr.bin/ncal usr/tests/sys/usr.bin/yacc usr/tests/sys/usr.bin/yacc/yacc usr/tests/sys/usr.bin/join usr/tests/sys/usr.bin/bmake usr/tests/sys/usr.bin/bmake/basic usr/tests/sys/usr.bin/bmake/basic/t3 usr/tests/sys/usr.bin/bmake/basic/t0 usr/tests/sys/usr.bin/bmake/basic/t2 usr/tests/sys/usr.bin/bmake/basic/t1 usr/tests/sys/usr.bin/bmake/shell usr/tests/sys/usr.bin/bmake/shell/select usr/tests/sys/usr.bin/bmake/shell/meta usr/tests/sys/usr.bin/bmake/shell/path usr/tests/sys/usr.bin/bmake/shell/path_select usr/tests/sys/usr.bin/bmake/shell/builtin usr/tests/sys/usr.bin/bmake/shell/replace usr/tests/sys/usr.bin/bmake/sysmk usr/tests/sys/usr.bin/bmake/sysmk/t1 usr/tests/sys/usr.bin/bmake/sysmk/t1/2 usr/tests/sys/usr.bin/bmake/sysmk/t1/2/1 usr/tests/sys/usr.bin/bmake/sysmk/t1/mk usr/tests/sys/usr.bin/bmake/sysmk/t2 usr/tests/sys/usr.bin/bmake/sysmk/t2/mk usr/tests/sys/usr.bin/bmake/sysmk/t2/2 usr/tests/sys/usr.bin/bmake/sysmk/t2/2/1 usr/tests/sys/usr.bin/bmake/sysmk/t0 usr/tests/sys/usr.bin/bmake/sysmk/t0/mk usr/tests/sys/usr.bin/bmake/sysmk/t0/2 usr/tests/sys/usr.bin/bmake/sysmk/t0/2/1 usr/tests/sys/usr.bin/bmake/variables usr/tests/sys/usr.bin/bmake/variables/modifier_t usr/tests/sys/usr.bin/bmake/variables/opt_V usr/tests/sys/usr.bin/bmake/variables/t0 usr/tests/sys/usr.bin/bmake/variables/modifier_M usr/tests/sys/usr.bin/bmake/archives usr/tests/sys/usr.bin/bmake/archives/fmt_oldbsd usr/tests/sys/usr.bin/bmake/archives/fmt_44bsd_mod usr/tests/sys/usr.bin/bmake/archives/fmt_44bsd usr/tests/sys/usr.bin/bmake/suffixes usr/tests/sys/usr.bin/bmake/suffixes/basic usr/tests/sys/usr.bin/bmake/suffixes/src_wild2 usr/tests/sys/usr.bin/bmake/suffixes/src_wild1 usr/tests/sys/usr.bin/bmake/execution usr/tests/sys/usr.bin/bmake/execution/plus usr/tests/sys/usr.bin/bmake/execution/ellipsis usr/tests/sys/usr.bin/bmake/execution/joberr usr/tests/sys/usr.bin/bmake/execution/empty usr/tests/sys/usr.bin/bmake/syntax usr/tests/sys/usr.bin/bmake/syntax/enl usr/tests/sys/usr.bin/bmake/syntax/funny-targets usr/tests/sys/usr.bin/bmake/syntax/directive-t0 usr/tests/sys/usr.bin/bmake/syntax/semi usr/tests/sys/usr.bin/sed usr/tests/sys/usr.bin/sed/regress.multitest.out usr/tests/sys/usr.bin/apply usr/tests/sys/usr.bin/opensm usr/tests/sys/usr.bin/calendar usr/tests/sys/usr.bin/limits usr/tests/sys/usr.bin/jot usr/tests/sys/usr.bin/tr usr/tests/sys/usr.bin/printf usr/tests/sys/usr.bin/dirname usr/tests/sys/usr.bin/xargs usr/tests/sys/usr.bin/uuencode usr/tests/sys/usr.bin/gzip usr/tests/sys/usr.bin/basename -- Craig From owner-svn-src-all@freebsd.org Tue Jan 5 08:10:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49AFDA61A9D; Tue, 5 Jan 2016 08:10:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1831B15FC; Tue, 5 Jan 2016 08:10:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u058A7qb038758; Tue, 5 Jan 2016 08:10:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u058A7gb038757; Tue, 5 Jan 2016 08:10:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601050810.u058A7gb038757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 5 Jan 2016 08:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293191 - stable/10/etc/mtree X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 08:10:08 -0000 Author: ngie Date: Tue Jan 5 08:10:06 2016 New Revision: 293191 URL: https://svnweb.freebsd.org/changeset/base/293191 Log: Add `..` after sys/kern/pipe entry accidentally missed in r291183 This is a direct commit to stable/10 Pointyhat to: ngie Reported by: rodrigc Sponsored by: EMC / Isilon Storage Division Modified: stable/10/etc/mtree/BSD.tests.dist Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Jan 5 05:25:16 2016 (r293190) +++ stable/10/etc/mtree/BSD.tests.dist Tue Jan 5 08:10:06 2016 (r293191) @@ -210,6 +210,7 @@ execve .. pipe + .. .. kqueue .. From owner-svn-src-all@freebsd.org Tue Jan 5 08:11:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45AE2A61B1D; Tue, 5 Jan 2016 08:11:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ob0-x243.google.com (mail-ob0-x243.google.com [IPv6:2607:f8b0:4003:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE4619BD; Tue, 5 Jan 2016 08:11:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ob0-x243.google.com with SMTP id q2so23123215obl.1; Tue, 05 Jan 2016 00:11:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=n4SnSQ/FmpM7bEjEChQAw0OXsd4sSW5+AVLkCpSo5qo=; b=TRsUUztDRMavGDdRXvdsWBUSoBN/RDDCDTFOcCIEF2vNIudTmHlGx5MnwmT1dsMKMh +1hWLt9q2QXr32ogbDP62p5VtlH62xtEPwpbezfcgMF75VWJqWnTs3NXmi1b9B5hRnHr heh8rFJ+ZA1Ocg1UpKkeZGui7uZZEq+bGA6ba3FugFZFYg8j5ck3A1UVMmPzgVpOUTJD iE8jNECb0BhPOHS0Kb0sNY+L1pf0CxqsvZm0BxuavCK67xxLHzlSq19xWEAypfieE952 OVYGSf0fu4aFCSyimH/HiSjw/8+DGwBLMMOcegO07ZRiJwf3CiCdx8qhoSajkPTTT7rf vLWQ== X-Received: by 10.60.51.70 with SMTP id i6mr65963524oeo.3.1451981487400; Tue, 05 Jan 2016 00:11:27 -0800 (PST) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id r84sm33364965oig.0.2016.01.05.00.11.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jan 2016 00:11:25 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r277457 - in stable/10: . etc etc/mtree tools/build/mk From: NGie Cooper In-Reply-To: Date: Tue, 5 Jan 2016 00:11:23 -0800 Cc: Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <76274015-66CE-40EA-A07B-084552119C21@gmail.com> References: <201501202339.t0KNd9J6007337@svn.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 08:11:28 -0000 > On Jan 4, 2016, at 21:38, Craig Rodrigues wrote: >=20 > On Tue, Jan 20, 2015 at 6:39 PM, Garrett Cooper = wrote: > Author: ngie > Date: Tue Jan 20 23:39:08 2015 > New Revision: 277457 > URL: https://svnweb.freebsd.org/changeset/base/277457 >=20 > Log: > MFC r275907: >=20 > r275907 (by ngie): >=20 > Fix building/installing tests when TESTSBASE !=3D /usr/tests >=20 >=20 >=20 > This merge is botched. Can you fix this? >=20 > mtree is now creating these directories under /usr/tests/sys which is = wrong, and causing "installworld" to fail if > src.conf contains WITH_TESTS=3D"yes" It wasn=E2=80=99t the merge that created the problem=E2=80=A6 = the real problem was committed in r291183. I=E2=80=99ve fixed it in = r293191. Thanks for the report (and sorry for the mistake :(=E2=80=A6). -NGie= From owner-svn-src-all@freebsd.org Tue Jan 5 09:18:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69201A5F639; Tue, 5 Jan 2016 09:18:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 195911CC4; Tue, 5 Jan 2016 09:18:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u059IiSv058931; Tue, 5 Jan 2016 09:18:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u059IiBY058930; Tue, 5 Jan 2016 09:18:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601050918.u059IiBY058930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jan 2016 09:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293192 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 09:18:45 -0000 Author: hselasky Date: Tue Jan 5 09:18:43 2016 New Revision: 293192 URL: https://svnweb.freebsd.org/changeset/base/293192 Log: Fix for directly connected FULL or LOW speed USB devices. Found by: Sebastian Huber MFC after: 1 week Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Tue Jan 5 08:10:06 2016 (r293191) +++ head/sys/dev/usb/controller/dwc_otg.c Tue Jan 5 09:18:43 2016 (r293192) @@ -456,6 +456,18 @@ dwc_otg_init_fifo(struct dwc_otg_softc * return (0); } +static uint8_t +dwc_otg_uses_split(struct usb_device *udev) +{ + /* + * When a LOW or FULL speed device is connected directly to + * the USB port we don't use split transactions: + */ + return (udev->speed != USB_SPEED_HIGH && + udev->parent_hs_hub != NULL && + udev->parent_hs_hub->parent_hub != NULL); +} + static void dwc_otg_update_host_frame_interval(struct dwc_otg_softc *sc) { @@ -3329,16 +3341,16 @@ dwc_otg_setup_standard_chain(struct usb_ else hcchar |= (td->ep_type << HCCHAR_EPTYPE_SHIFT); - if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_LOW) - hcchar |= HCCHAR_LSPDDEV; if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) hcchar |= HCCHAR_EPDIR_IN; switch (xfer->xroot->udev->speed) { - case USB_SPEED_FULL: case USB_SPEED_LOW: + hcchar |= HCCHAR_LSPDDEV; + /* FALLTHROUGH */ + case USB_SPEED_FULL: /* check if root HUB port is running High Speed */ - if (xfer->xroot->udev->parent_hs_hub != NULL) { + if (dwc_otg_uses_split(xfer->xroot->udev)) { hcsplt = HCSPLT_SPLTENA | (xfer->xroot->udev->hs_port_no << HCSPLT_PRTADDR_SHIFT) | @@ -4160,7 +4172,10 @@ dwc_otg_device_isoc_start(struct usb_xfe framenum = DSTS_SOFFN_GET(temp); } - if (xfer->xroot->udev->parent_hs_hub != NULL) + /* + * Check if port is doing 8000 or 1000 frames per second: + */ + if (sc->sc_flags.status_high_speed) framenum /= 8; framenum &= DWC_OTG_FRAME_MASK; @@ -4837,7 +4852,7 @@ dwc_otg_xfer_setup(struct usb_setup_para td = USB_ADD_BYTES(parm->buf, parm->size[0]); /* compute shared bandwidth resource index for TT */ - if (parm->udev->parent_hs_hub != NULL && parm->udev->speed != USB_SPEED_HIGH) { + if (dwc_otg_uses_split(parm->udev)) { if (parm->udev->parent_hs_hub->ddesc.bDeviceProtocol == UDPROTO_HSHUBMTT) td->tt_index = parm->udev->device_index; else From owner-svn-src-all@freebsd.org Tue Jan 5 10:25:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D978A60F7F; Tue, 5 Jan 2016 10:25:24 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E23DE1B25; Tue, 5 Jan 2016 10:25:23 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05APMls079492; Tue, 5 Jan 2016 10:25:22 GMT (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05APMcf079491; Tue, 5 Jan 2016 10:25:22 GMT (envelope-from uqs@FreeBSD.org) Message-Id: <201601051025.u05APMcf079491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: uqs set sender to uqs@FreeBSD.org using -f From: Ulrich Spoerlein Date: Tue, 5 Jan 2016 10:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293193 - head/sys/dev/asmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 10:25:24 -0000 Author: uqs Date: Tue Jan 5 10:25:22 2016 New Revision: 293193 URL: https://svnweb.freebsd.org/changeset/base/293193 Log: Fix undefined behavior when using asmc_fan_getstring() It was returning a pointer to stack-allocated memory, so make the allocation at the caller instead. Found by: clang static analyzer Coverity: CID 1245774 Reviewed by: ed, rpaulo Review URL: https://reviews.freebsd.org/D4740 Modified: head/sys/dev/asmc/asmc.c Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Tue Jan 5 09:18:43 2016 (r293192) +++ head/sys/dev/asmc/asmc.c Tue Jan 5 10:25:22 2016 (r293193) @@ -963,14 +963,13 @@ asmc_fan_getvalue(device_t dev, const ch } static char* -asmc_fan_getstring(device_t dev, const char *key, int fan) +asmc_fan_getstring(device_t dev, const char *key, int fan, uint8_t *buf, uint8_t buflen) { - uint8_t buf[16]; char fankey[5]; char* desc; snprintf(fankey, sizeof(fankey), key, fan); - if (asmc_key_read(dev, fankey, buf, sizeof buf) < 0) + if (asmc_key_read(dev, fankey, buf, buflen) < 0) return (NULL); desc = buf+4; @@ -1012,12 +1011,13 @@ asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_A static int asmc_mb_sysctl_fanid(SYSCTL_HANDLER_ARGS) { + uint8_t buf[16]; device_t dev = (device_t) arg1; int fan = arg2; int error = true; char* desc; - desc = asmc_fan_getstring(dev, ASMC_KEY_FANID, fan); + desc = asmc_fan_getstring(dev, ASMC_KEY_FANID, fan, buf, sizeof(buf)); if (desc != NULL) error = sysctl_handle_string(oidp, desc, 0, req); From owner-svn-src-all@freebsd.org Tue Jan 5 12:22:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4170A6343E; Tue, 5 Jan 2016 12:22:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84A251A3E; Tue, 5 Jan 2016 12:22:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05CMjEg014847; Tue, 5 Jan 2016 12:22:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05CMjq5014845; Tue, 5 Jan 2016 12:22:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601051222.u05CMjq5014845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jan 2016 12:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293194 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 12:22:46 -0000 Author: hselasky Date: Tue Jan 5 12:22:45 2016 New Revision: 293194 URL: https://svnweb.freebsd.org/changeset/base/293194 Log: Implement RCU mechanism using shared exclusive locks. MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h (contents, props changed) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Added: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Tue Jan 5 12:22:45 2016 (r293194) @@ -0,0 +1,76 @@ +/*- + * Copyright (c) 2016 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _LINUX_RCUPDATE_H_ +#define _LINUX_RCUPDATE_H_ + +#include +#include +#include + +extern struct sx linux_global_rcu_lock; + +struct rcu_head { +}; + +typedef void (*rcu_callback_t)(struct rcu_head *); + +static inline void +call_rcu(struct rcu_head *ptr, rcu_callback_t func) +{ + sx_xlock(&linux_global_rcu_lock); + func(ptr); + sx_xunlock(&linux_global_rcu_lock); +} + +static inline void +rcu_read_lock(void) +{ + sx_slock(&linux_global_rcu_lock); +} + +static inline void +rcu_read_unlock(void) +{ + sx_sunlock(&linux_global_rcu_lock); +} + +static inline void +rcu_barrier(void) +{ + sx_xlock(&linux_global_rcu_lock); + sx_xunlock(&linux_global_rcu_lock); +} + +static inline void +synchronize_rcu(void) +{ + sx_xlock(&linux_global_rcu_lock); + sx_xunlock(&linux_global_rcu_lock); +} + +#endif /* _LINUX_RCUPDATE_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Tue Jan 5 10:25:22 2016 (r293193) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Tue Jan 5 12:22:45 2016 (r293194) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -84,6 +85,7 @@ struct list_head pci_drivers; struct list_head pci_devices; struct net init_net; spinlock_t pci_lock; +struct sx linux_global_rcu_lock; unsigned long linux_timer_hz_mask; @@ -1142,6 +1144,8 @@ linux_compat_init(void *arg) struct sysctl_oid *rootoid; int i; + sx_init(&linux_global_rcu_lock, "LinuxGlobalRCU"); + rootoid = SYSCTL_ADD_ROOT_NODE(NULL, OID_AUTO, "sys", CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, "sys"); kobject_init(&linux_class_root, &linux_class_ktype); @@ -1171,6 +1175,9 @@ linux_compat_uninit(void *arg) linux_kobject_kfree_name(&linux_class_root); linux_kobject_kfree_name(&linux_root_device.kobj); linux_kobject_kfree_name(&linux_class_misc.kobj); + + synchronize_rcu(); + sx_destroy(&linux_global_rcu_lock); } SYSUNINIT(linux_compat, SI_SUB_DRIVERS, SI_ORDER_SECOND, linux_compat_uninit, NULL); From owner-svn-src-all@freebsd.org Tue Jan 5 13:05:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53846A6234C; Tue, 5 Jan 2016 13:05:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2139E1250; Tue, 5 Jan 2016 13:05:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05D5dZX027732; Tue, 5 Jan 2016 13:05:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05D5dWV027730; Tue, 5 Jan 2016 13:05:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601051305.u05D5dWV027730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 5 Jan 2016 13:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293195 - in stable/10/sys/x86: include x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 13:05:40 -0000 Author: kib Date: Tue Jan 5 13:05:38 2016 New Revision: 293195 URL: https://svnweb.freebsd.org/changeset/base/293195 Log: MFC r292890: Add standard extended feature bit 6 from the Intel SDM rev. 57. Modified: stable/10/sys/x86/include/specialreg.h stable/10/sys/x86/x86/identcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/include/specialreg.h ============================================================================== --- stable/10/sys/x86/include/specialreg.h Tue Jan 5 12:22:45 2016 (r293194) +++ stable/10/sys/x86/include/specialreg.h Tue Jan 5 13:05:38 2016 (r293195) @@ -334,6 +334,7 @@ #define CPUID_STDEXT_BMI1 0x00000008 #define CPUID_STDEXT_HLE 0x00000010 #define CPUID_STDEXT_AVX2 0x00000020 +#define CPUID_STDEXT_FDP_EXC 0x00000040 #define CPUID_STDEXT_SMEP 0x00000080 #define CPUID_STDEXT_BMI2 0x00000100 #define CPUID_STDEXT_ERMS 0x00000200 Modified: stable/10/sys/x86/x86/identcpu.c ============================================================================== --- stable/10/sys/x86/x86/identcpu.c Tue Jan 5 12:22:45 2016 (r293194) +++ stable/10/sys/x86/x86/identcpu.c Tue Jan 5 13:05:38 2016 (r293195) @@ -894,6 +894,8 @@ printcpuinfo(void) "\005HLE" /* Advanced Vector Instructions 2 */ "\006AVX2" + /* FDP_EXCPTN_ONLY */ + "\007FDPEXC" /* Supervisor Mode Execution Prot. */ "\010SMEP" /* Bit Manipulation Instructions */ From owner-svn-src-all@freebsd.org Tue Jan 5 14:48:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14679A63102; Tue, 5 Jan 2016 14:48:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7D7015F1; Tue, 5 Jan 2016 14:48:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05EmeT8057407; Tue, 5 Jan 2016 14:48:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05Eme83057405; Tue, 5 Jan 2016 14:48:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601051448.u05Eme83057405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 5 Jan 2016 14:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293197 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 14:48:42 -0000 Author: kib Date: Tue Jan 5 14:48:40 2016 New Revision: 293197 URL: https://svnweb.freebsd.org/changeset/base/293197 Log: Two fixes for excessive iterations after r292326. Advance the logical block number to the lblkno of the found block plus one, instead of incrementing the block number which was used for lookup. This change skips sparcely populated buffer ranges, similar to r292325, instead of doing useless lookups. Do not restart the bnoreuselist() from the start of the range if buffer lock cannot be obtained without sleep. Only retry lookup and lock for the same queue and same logical block number. Reported by: benno Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Tue Jan 5 14:21:02 2016 (r293196) +++ head/sys/kern/vfs_default.c Tue Jan 5 14:48:40 2016 (r293197) @@ -1080,15 +1080,9 @@ vop_stdadvise(struct vop_advise_args *ap bsize = vp->v_bufobj.bo_bsize; startn = ap->a_start / bsize; endn = ap->a_end / bsize; - for (;;) { - error = bnoreuselist(&bo->bo_clean, bo, startn, endn); - if (error == EAGAIN) - continue; + error = bnoreuselist(&bo->bo_clean, bo, startn, endn); + if (error == 0) error = bnoreuselist(&bo->bo_dirty, bo, startn, endn); - if (error == EAGAIN) - continue; - break; - } BO_RUNLOCK(bo); VOP_UNLOCK(vp, 0); break; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 5 14:21:02 2016 (r293196) +++ head/sys/kern/vfs_subr.c Tue Jan 5 14:48:40 2016 (r293197) @@ -1669,7 +1669,8 @@ bnoreuselist(struct bufv *bufv, struct b ASSERT_BO_LOCKED(bo); - for (lblkno = startn;; lblkno++) { + for (lblkno = startn;;) { +again: bp = BUF_PCTRIE_LOOKUP_GE(&bufv->bv_root, lblkno); if (bp == NULL || bp->b_lblkno >= endn) break; @@ -1677,11 +1678,14 @@ bnoreuselist(struct bufv *bufv, struct b LK_INTERLOCK, BO_LOCKPTR(bo), "brlsfl", 0, 0); if (error != 0) { BO_RLOCK(bo); - return (error != ENOLCK ? error : EAGAIN); + if (error == ENOLCK) + goto again; + return (error); } KASSERT(bp->b_bufobj == bo, ("bp %p wrong b_bufobj %p should be %p", bp, bp->b_bufobj, bo)); + lblkno = bp->b_lblkno + 1; if ((bp->b_flags & B_MANAGED) == 0) bremfree(bp); bp->b_flags |= B_RELBUF; From owner-svn-src-all@freebsd.org Tue Jan 5 15:52:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 247D4A6241A; Tue, 5 Jan 2016 15:52:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E47841A26; Tue, 5 Jan 2016 15:52:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05FqHhT078075; Tue, 5 Jan 2016 15:52:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05FqHhe078074; Tue, 5 Jan 2016 15:52:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601051552.u05FqHhe078074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 5 Jan 2016 15:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293201 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 15:52:18 -0000 Author: emaste Date: Tue Jan 5 15:52:16 2016 New Revision: 293201 URL: https://svnweb.freebsd.org/changeset/base/293201 Log: rtld: populate DT_DEBUG iff DYNAMIC segment is writable MIPS has/had a read-only DYNAMIC segment, and uses an extra level of indirection (through MIPS_RLD_MAP) to locate the debugger rendezvous data. Some linkers (e.g. LLVM's lld) may produce MIPS binaries with a writable DYNAMIC segment, which would allow us to eventually drop a special case. Therefore, instead of hardcoding knowledge that DYNAMIC is not writable on MIPS just check the permissions on the segment. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4791 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jan 5 15:50:50 2016 (r293200) +++ head/libexec/rtld-elf/rtld.c Tue Jan 5 15:52:16 2016 (r293201) @@ -1144,13 +1144,13 @@ digest_dynamic1(Obj_Entry *obj, int earl * is mapped read-only. DT_MIPS_RLD_MAP is used instead. */ -#ifndef __mips__ case DT_DEBUG: + if (!obj->writable_dynamic) + break; if (!early) dbg("Filling in DT_DEBUG entry"); ((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug; break; -#endif case DT_FLAGS: if (dynp->d_un.d_val & DF_ORIGIN) @@ -1331,6 +1331,8 @@ digest_phdr(const Elf_Phdr *phdr, int ph break; case PT_DYNAMIC: + if (ph->p_flags & PROT_WRITE) + obj->writable_dynamic = true; obj->dynamic = (const Elf_Dyn *)(ph->p_vaddr + obj->relocbase); break; From owner-svn-src-all@freebsd.org Tue Jan 5 15:55:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87A12A62540; Tue, 5 Jan 2016 15:55:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54C401C3F; Tue, 5 Jan 2016 15:55:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05FtjHO078234; Tue, 5 Jan 2016 15:55:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05FtjDY078233; Tue, 5 Jan 2016 15:55:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601051555.u05FtjDY078233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 5 Jan 2016 15:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293202 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 15:55:46 -0000 Author: emaste Date: Tue Jan 5 15:55:45 2016 New Revision: 293202 URL: https://svnweb.freebsd.org/changeset/base/293202 Log: rtld: populate DT_DEBUG iff DYNAMIC segment is writable rtld.h was accidentally missed in r293201 Modified: head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Tue Jan 5 15:52:16 2016 (r293201) +++ head/libexec/rtld-elf/rtld.h Tue Jan 5 15:55:45 2016 (r293202) @@ -264,6 +264,7 @@ typedef struct Struct_Obj_Entry { bool valid_hash_sysv : 1; /* A valid System V hash hash tag is available */ bool valid_hash_gnu : 1; /* A valid GNU hash tag is available */ bool dlopened : 1; /* dlopen()-ed (vs. load statically) */ + bool writable_dynamic : 1; /* PT_DYNAMIC is writable */ struct link_map linkmap; /* For GDB and dlinfo() */ Objlist dldags; /* Object belongs to these dlopened DAGs (%) */ From owner-svn-src-all@freebsd.org Tue Jan 5 16:21:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 255D8A62E6A; Tue, 5 Jan 2016 16:21:22 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0253E1CCC; Tue, 5 Jan 2016 16:21:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05GLLgA084753; Tue, 5 Jan 2016 16:21:21 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05GLKUf084749; Tue, 5 Jan 2016 16:21:20 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601051621.u05GLKUf084749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 5 Jan 2016 16:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293204 - in head: include lib/libc/gen usr.sbin/cron/crontab X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 16:21:22 -0000 Author: jilles Date: Tue Jan 5 16:21:20 2016 New Revision: 293204 URL: https://svnweb.freebsd.org/changeset/base/293204 Log: Add sbin and /usr/local directories to _PATH_DEFPATH. Set _PATH_DEFPATH to /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the path in the default class in the default /etc/login.conf, excluding ~/bin which would not be expanded properly in a string constant. For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf, ~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and by cron. Especially the latter is a common trap (most recently in PR 204813). PR: 204813 Reviewed by: secteam (delphij), alfred Modified: head/include/paths.h head/lib/libc/gen/exec.3 head/lib/libc/gen/posix_spawn.3 head/usr.sbin/cron/crontab/crontab.5 Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Tue Jan 5 16:08:26 2016 (r293203) +++ head/include/paths.h Tue Jan 5 16:21:20 2016 (r293204) @@ -36,7 +36,7 @@ #include /* Default search path. */ -#define _PATH_DEFPATH "/usr/bin:/bin" +#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" /* All standard utilities path. */ #define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" /* Locate system binaries. */ @@ -108,7 +108,7 @@ __END_DECLS #ifdef RESCUE #undef _PATH_DEFPATH -#define _PATH_DEFPATH "/rescue:/usr/bin:/bin" +#define _PATH_DEFPATH "/rescue:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" #undef _PATH_STDPATH #define _PATH_STDPATH "/rescue:/usr/bin:/bin:/usr/sbin:/sbin" #undef _PATH_SYSPATH Modified: head/lib/libc/gen/exec.3 ============================================================================== --- head/lib/libc/gen/exec.3 Tue Jan 5 16:08:26 2016 (r293203) +++ head/lib/libc/gen/exec.3 Tue Jan 5 16:21:20 2016 (r293204) @@ -28,7 +28,7 @@ .\" @(#)exec.3 8.3 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd December 12, 2015 +.Dd January 5, 2016 .Dt EXEC 3 .Os .Sh NAME @@ -161,7 +161,7 @@ the default path is set according to the definition in .In paths.h , which is set to -.Dq Ev /usr/bin:/bin . +.Dq Ev /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin . For .Fn execvP , the search path is specified as an argument to the function. Modified: head/lib/libc/gen/posix_spawn.3 ============================================================================== --- head/lib/libc/gen/posix_spawn.3 Tue Jan 5 16:08:26 2016 (r293203) +++ head/lib/libc/gen/posix_spawn.3 Tue Jan 5 16:21:20 2016 (r293204) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 17, 2011 +.Dd January 5, 2016 .Dt POSIX_SPAWN 3 .Os .Sh NAME @@ -126,7 +126,7 @@ the default path is set according to the definition in .In paths.h , which is set to -.Dq Ev /usr/bin:/bin . +.Dq Ev /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin . .Pp If .Fa file_actions Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Tue Jan 5 16:08:26 2016 (r293203) +++ head/usr.sbin/cron/crontab/crontab.5 Tue Jan 5 16:21:20 2016 (r293204) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 28, 2012 +.Dd January 5, 2016 .Dt CRONTAB 5 .Os .Sh NAME @@ -74,7 +74,7 @@ is set to .Pa /bin/sh , .Ev PATH is set to -.Pa /usr/bin:/bin , +.Pa /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin , and .Ev LOGNAME and From owner-svn-src-all@freebsd.org Tue Jan 5 16:58:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34F43A63C5D; Tue, 5 Jan 2016 16:58:09 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 057CD1778; Tue, 5 Jan 2016 16:58:08 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05Gw8kX096726; Tue, 5 Jan 2016 16:58:08 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05Gw8pl096725; Tue, 5 Jan 2016 16:58:08 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201601051658.u05Gw8pl096725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 5 Jan 2016 16:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293208 - stable/10/sbin/route X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 16:58:09 -0000 Author: rstone Date: Tue Jan 5 16:58:07 2016 New Revision: 293208 URL: https://svnweb.freebsd.org/changeset/base/293208 Log: MFC r287920: Fix /sbin/route to never look up (invalid) interface names through DNS /sbin/route has a bug where if it is passed an interface name that does not exist, it falls through and winds up interpreting it as a hostname. It fails out eventually, but on a system where DNS lookup is broken you can end up waiting for up to 60 seconds waiting for the DNS lookup to timeout. I'm not quite sure what happens if the DNS lookup somehow succeeds but I doubt that can end well. Reviewed by: markj, cem MFC after: 2 weeks Sponsored by: EMC/Isilon Storage Division Modified: stable/10/sbin/route/route.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/route/route.c ============================================================================== --- stable/10/sbin/route/route.c Tue Jan 5 16:49:27 2016 (r293207) +++ stable/10/sbin/route/route.c Tue Jan 5 16:58:07 2016 (r293208) @@ -1239,6 +1239,9 @@ getaddr(int idx, char *str, struct hoste freeifaddrs(ifap); if (sdl != NULL) return(1); + else + errx(EX_DATAERR, + "interface '%s' does not exist", str); } break; case RTAX_IFP: From owner-svn-src-all@freebsd.org Tue Jan 5 17:11:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1D39A63F74; Tue, 5 Jan 2016 17:11:47 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEB441E5B; Tue, 5 Jan 2016 17:11:47 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-ig0-x233.google.com with SMTP id to18so16069594igc.0; Tue, 05 Jan 2016 09:11:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=DGjJ7kJNh2CAFSJon7Mf+ZZQMnG2gXhLYwXgH/1maNA=; b=ne2dMaMqqZyp2vH6508xBLJJBIIAE2UJybxeGlGdlLjf/b7ksdBkfVGucUp8+FoQ5v gIFoPl6xT50GdzlKT+UdUN0T0DtuxW9IYXPwviCu2sIkBEM8tqB0ZXjqVOnkxvExHmnw mCZRgdgVAquVObUVu7Tm7TYE82LfpvjZ9ZBPd/xdv3AtwkESiRiqzrepN/ugJqR46gV6 lVtmyK22WpT0MoAPgyehFwqg7ykRnvPVtb90jHTJrBWorVfZvz4x4BD8ch8i0DqmVHgo wwDz5/spEwi6sZfYJyr0Obv6VHMX0e8curxLoEbd/NEEO47RWoMWDVCI5XVkMWU/N4Bm p+PA== MIME-Version: 1.0 X-Received: by 10.50.147.73 with SMTP id ti9mr4513924igb.36.1452013907063; Tue, 05 Jan 2016 09:11:47 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.50.152.69 with HTTP; Tue, 5 Jan 2016 09:11:47 -0800 (PST) In-Reply-To: <201601050810.u058A7gb038757@repo.freebsd.org> References: <201601050810.u058A7gb038757@repo.freebsd.org> Date: Tue, 5 Jan 2016 12:11:47 -0500 X-Google-Sender-Auth: UrQK_pqkcnLMdGgwBxeGf5v9zTQ Message-ID: Subject: Re: svn commit: r293191 - stable/10/etc/mtree From: Craig Rodrigues To: Garrett Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 17:11:48 -0000 On Tue, Jan 5, 2016 at 3:10 AM, Garrett Cooper wrote: > Author: ngie > Date: Tue Jan 5 08:10:06 2016 > New Revision: 293191 > URL: https://svnweb.freebsd.org/changeset/base/293191 > > Log: > Add `..` after sys/kern/pipe entry accidentally missed in r291183 > > This is a direct commit to stable/10 > > Pointyhat to: ngie > Reported by: rodrigc > Sponsored by: EMC / Isilon Storage Division > > Thanks, that fixed it for me. From owner-svn-src-all@freebsd.org Tue Jan 5 17:12:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94659A620FD; Tue, 5 Jan 2016 17:12:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66038122D; Tue, 5 Jan 2016 17:12:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05HCXOK003063; Tue, 5 Jan 2016 17:12:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05HCXKr003062; Tue, 5 Jan 2016 17:12:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601051712.u05HCXKr003062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 5 Jan 2016 17:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293209 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 17:12:34 -0000 Author: ian Date: Tue Jan 5 17:12:33 2016 New Revision: 293209 URL: https://svnweb.freebsd.org/changeset/base/293209 Log: MFC 292366: Flag the first port on a Sheevaplug ftdi serial device as jtag. Modified: stable/10/sys/dev/usb/serial/uftdi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/10/sys/dev/usb/serial/uftdi.c Tue Jan 5 16:58:07 2016 (r293208) +++ stable/10/sys/dev/usb/serial/uftdi.c Tue Jan 5 17:12:33 2016 (r293209) @@ -568,7 +568,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(KOBIL, CONV_B1, 0), UFTDI_DEV(KOBIL, CONV_KAAN, 0), UFTDI_DEV(LARSENBRUSGAARD, ALTITRACK, 0), - UFTDI_DEV(MARVELL, SHEEVAPLUG, 0), + UFTDI_DEV(MARVELL, SHEEVAPLUG, UFTDI_JTAG_IFACE(0)), UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0100, 0), UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0101, 0), UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0102, 0), From owner-svn-src-all@freebsd.org Tue Jan 5 20:09:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DFE6A6326C; Tue, 5 Jan 2016 20:09:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1D7117CB; Tue, 5 Jan 2016 20:09:27 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05K9QHS053909; Tue, 5 Jan 2016 20:09:27 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05K9QxK053908; Tue, 5 Jan 2016 20:09:26 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601052009.u05K9QxK053908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 5 Jan 2016 20:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293219 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 20:09:28 -0000 Author: avos Date: Tue Jan 5 20:09:26 2016 New Revision: 293219 URL: https://svnweb.freebsd.org/changeset/base/293219 Log: iwm: revert r293178 This optimization is not proper (and causes kernel panic), since driver checks fw_status to optimize away parsing stage if it was already done. Reported by: dchagin Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Tue Jan 5 19:52:16 2016 (r293218) +++ head/sys/dev/iwm/if_iwm.c Tue Jan 5 20:09:26 2016 (r293219) @@ -2041,7 +2041,6 @@ iwm_mvm_load_ucode_wait_alive(struct iwm sc->sc_uc_current = ucode_type; error = iwm_start_fw(sc, ucode_type); - iwm_fw_info_free(&sc->sc_fw); if (error) { sc->sc_uc_current = old_type; return error; @@ -4937,6 +4936,7 @@ iwm_suspend(device_t dev) static int iwm_detach_local(struct iwm_softc *sc, int do_net80211) { + struct iwm_fw_info *fw = &sc->sc_fw; device_t dev = sc->sc_dev; int i; @@ -4953,6 +4953,10 @@ iwm_detach_local(struct iwm_softc *sc, i for (i = 0; i < nitems(sc->txq); i++) iwm_free_tx_ring(sc, &sc->txq[i]); + /* Free firmware */ + if (fw->fw_fp != NULL) + iwm_fw_info_free(fw); + /* Free scheduler */ iwm_free_sched(sc); if (sc->ict_dma.vaddr != NULL) From owner-svn-src-all@freebsd.org Tue Jan 5 20:42:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36F94A63C3F; Tue, 5 Jan 2016 20:42:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E10811B9E; Tue, 5 Jan 2016 20:42:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05KgJ59065245; Tue, 5 Jan 2016 20:42:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05KgJmr065241; Tue, 5 Jan 2016 20:42:19 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201601052042.u05KgJmr065241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 5 Jan 2016 20:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293221 - in head: share/man/man4 sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 20:42:21 -0000 Author: cem Date: Tue Jan 5 20:42:19 2016 New Revision: 293221 URL: https://svnweb.freebsd.org/changeset/base/293221 Log: ioat(4): Add ioat_get_max_io_size() KPI Consumers need to know the permitted IO size to send maximally sized chunks to the hardware. Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/ioat.4 head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h Modified: head/share/man/man4/ioat.4 ============================================================================== --- head/share/man/man4/ioat.4 Tue Jan 5 20:37:36 2016 (r293220) +++ head/share/man/man4/ioat.4 Tue Jan 5 20:42:19 2016 (r293221) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 17, 2015 +.Dd January 5, 2016 .Dt IOAT 4 .Os .Sh NAME @@ -65,6 +65,8 @@ In .Fn ioat_put_dmaengine "bus_dmaengine_t dmaengine" .Ft int .Fn ioat_get_hwversion "bus_dmaengine_t dmaengine" +.Ft size_t +.Fn ioat_get_max_io_size "bus_dmaengine_t dmaengine" .Ft int .Fn ioat_set_interrupt_coalesce "bus_dmaengine_t dmaengine" "uint16_t delay" .Ft uint16_t Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Tue Jan 5 20:37:36 2016 (r293220) +++ head/sys/dev/ioat/ioat.c Tue Jan 5 20:42:19 2016 (r293221) @@ -744,6 +744,15 @@ ioat_get_hwversion(bus_dmaengine_t dmaen return (ioat->version); } +size_t +ioat_get_max_io_size(bus_dmaengine_t dmaengine) +{ + struct ioat_softc *ioat; + + ioat = to_ioat_softc(dmaengine); + return (ioat->max_xfer_size); +} + int ioat_set_interrupt_coalesce(bus_dmaengine_t dmaengine, uint16_t delay) { Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Tue Jan 5 20:37:36 2016 (r293220) +++ head/sys/dev/ioat/ioat.h Tue Jan 5 20:42:19 2016 (r293221) @@ -70,6 +70,7 @@ void ioat_put_dmaengine(bus_dmaengine_t /* Check the DMA engine's HW version */ int ioat_get_hwversion(bus_dmaengine_t dmaengine); +size_t ioat_get_max_io_size(bus_dmaengine_t dmaengine); /* * Set interrupt coalescing on a DMA channel. From owner-svn-src-all@freebsd.org Tue Jan 5 21:05:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 392BEA62514; Tue, 5 Jan 2016 21:05:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AE4D19DE; Tue, 5 Jan 2016 21:05:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05L5Icf071602; Tue, 5 Jan 2016 21:05:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05L5HLi071593; Tue, 5 Jan 2016 21:05:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601052105.u05L5HLi071593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 Jan 2016 21:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 21:05:19 -0000 Author: gjb Date: Tue Jan 5 21:05:17 2016 New Revision: 293223 URL: https://svnweb.freebsd.org/changeset/base/293223 Log: Merge ^/projects/release-install-debug: - Rework MANIFEST generation and parsing via bsdinstall(8). - Allow selecting debugging distribution sets during install. - Rework bsdinstall(8) to fetch remote debug distribution sets when they are not available on the local install medium. - Allow selecting additional non-GENERIC kernels during install. At present, GENERIC is still required, and installed by default. Tested with: head@r293203 Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 head/release/Makefile head/release/amd64/mkisoimages.sh head/release/i386/mkisoimages.sh head/release/pc98/mkisoimages.sh head/release/powerpc/mkisoimages.sh head/release/scripts/make-manifest.sh head/release/sparc64/mkisoimages.sh head/usr.sbin/bsdinstall/scripts/auto Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jan 5 20:53:59 2016 (r293222) +++ head/Makefile.inc1 Tue Jan 5 21:05:17 2016 (r293223) @@ -1284,27 +1284,43 @@ packagekernel: .if defined(NO_ROOT) .if !defined(NO_INSTALLKERNEL) cd ${DESTDIR}/${DISTDIR}/kernel; \ - tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ + tar cvf - --exclude '*.debug' \ + @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif + cd ${DESTDIR}/${DISTDIR}/kernel; \ + tar cvf - --include '*/*/*.debug' \ + @${DESTDIR}/${DISTDIR}/kernel.meta | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz .if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ - tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ + tar cvf - --exclude '*.debug' \ + @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz + cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ + tar cvf - --include '*/*/*.debug' \ + @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz .endfor .endif .else .if !defined(NO_INSTALLKERNEL) cd ${DESTDIR}/${DISTDIR}/kernel; \ - tar cvf - . | \ + tar cvf - --exclude '*.debug' . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif + cd ${DESTDIR}/${DISTDIR}/kernel; \ + tar cvf - --include '*/*/*.debug' $$(eval find .) | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz .if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ - tar cvf - . | \ + tar cvf - --exclude '*.debug' . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz + cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ + tar cvf - --include '*/*/*.debug' $$(eval find .) | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz .endfor .endif .endif Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/Makefile Tue Jan 5 21:05:17 2016 (r293223) @@ -176,7 +176,7 @@ disc1: packagesystem MK_DEBUG_FILES=no # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist - for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \ + for dist in MANIFEST $$(ls *.txz | grep -vE -- '(base|lib32)-dbg'); \ do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated @@ -225,7 +225,7 @@ dvd: packagesystem MK_TESTS=no MK_DEBUG_FILES=no # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist - for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \ + for dist in MANIFEST $$(ls *.txz | grep -v -- '(base|lib32)-dbg'); \ do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/amd64/mkisoimages.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -56,5 +56,5 @@ NAME="$1"; shift publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab" makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" -rm "$1/etc/fstab" +rm -f "$1/etc/fstab" rm -f efiboot.img Modified: head/release/i386/mkisoimages.sh ============================================================================== --- head/release/i386/mkisoimages.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/i386/mkisoimages.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -42,4 +42,4 @@ NAME="$1"; shift publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab" makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" -rm "$1/etc/fstab" +rm -f "$1/etc/fstab" Modified: head/release/pc98/mkisoimages.sh ============================================================================== --- head/release/pc98/mkisoimages.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/pc98/mkisoimages.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -42,4 +42,4 @@ NAME="$1"; shift publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab" makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" -rm "$1/etc/fstab" +rm -f "$1/etc/fstab" Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/powerpc/mkisoimages.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -64,6 +64,6 @@ NAME="$1"; shift publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab" makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" -rm "$1/etc/fstab" -rm /tmp/hfs-boot-block +rm -f "$1/etc/fstab" +rm -f /tmp/hfs-boot-block rm -rf "$1/ppc" Modified: head/release/scripts/make-manifest.sh ============================================================================== --- head/release/scripts/make-manifest.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/scripts/make-manifest.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -9,18 +9,64 @@ # # $FreeBSD$ -desc_base="Base system (MANDATORY)" -desc_kernel="Kernel (MANDATORY)" -desc_doc="Additional documentation" -doc_default=off -desc_lib32="32-bit compatibility libraries" -desc_ports="Ports tree" -desc_src="System source code" -desc_tests="Test suite" -src_default=off -tests_default=off +base="Base system" +doc="Additional Documentation" +kernel="Kernel" +ports="Ports tree" +src="System source tree" +lib32="32-bit compatibility libraries" +tests="Test suite" -for i in $*; do - echo "`basename $i` `sha256 -q $i` `tar tvf $i | wc -l | tr -d ' '` `basename $i .txz` \"`eval echo \\\$desc_$(basename $i .txz)`\" `eval echo \\\${$(basename $i .txz)_default:-on}`" +desc_base="${base} (MANDATORY)" +desc_base_dbg="${base} (Debugging)" +desc_doc="${doc}" +desc_kernel="${kernel} (MANDATORY)" +desc_kernel_dbg="${kernel} (Debugging)" +desc_kernel_alt="Alternate ${kernel}" +desc_kernel_alt_dbg="Alternate ${kernel} (Debugging)" +desc_lib32="${lib32}" +desc_lib32_dbg="${lib32} (Debugging)" +desc_ports="${ports}" +desc_src="${src}" +desc_tests="${tests}" + +default_doc=off +default_src=off +default_tests=off +default_base_dbg=off +default_lib32_dbg=off +default_kernel_alt=off +default_kernel_dbg=on +default_kernel_alt_dbg=off + +for i in ${*}; do + dist="${i}" + distname="${i%%.txz}" + distname="$(echo ${distname} | tr '-' '_')" + distname="$(echo ${distname} | tr 'kernel.' 'kernel_')" + hash="$(sha256 -q ${i})" + nfiles="$(tar tvf ${i} | wc -l | tr -d ' ')" + default="$(eval echo \${default_${distname}:-on})" + desc="$(eval echo \"\${desc_${distname}}\")" + + case ${i} in + kernel-dbg.txz) + desc="${desc_kernel_dbg}" + ;; + kernel.*-dbg.txz) + desc="$(eval echo \"${desc_kernel_alt_dbg}\")" + desc="${desc}: $(eval echo ${i%%-dbg.txz} | cut -f 2 -d '.')" + default="$(eval echo \"${default_kernel_alt_dbg}\")" + ;; + kernel.*.txz) + desc="$(eval echo \"${desc_kernel_alt}\")" + desc="${desc}: $(eval echo ${i%%.txz} | cut -f 2 -d '.')" + default="$(eval echo \"${default_kernel_alt}\")" + ;; + *) + ;; + esac + + printf "${dist}\t${hash}\t${nfiles}\t${distname}\t\"${desc}\"\t${default}\n" done Modified: head/release/sparc64/mkisoimages.sh ============================================================================== --- head/release/sparc64/mkisoimages.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/sparc64/mkisoimages.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -38,7 +38,7 @@ BASEBITSDIR="$1" publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBITSDIR/etc/fstab" makefs -t cd9660 -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME.tmp" "$@" -rm "$BASEBITSDIR/etc/fstab" +rm -f "$BASEBITSDIR/etc/fstab" if [ "x$BOPT" != "x-b" ]; then mv "$NAME.tmp" "$NAME" Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Tue Jan 5 20:53:59 2016 (r293222) +++ head/usr.sbin/bsdinstall/scripts/auto Tue Jan 5 21:05:17 2016 (r293223) @@ -115,7 +115,8 @@ bsdinstall hostname || error "Set hostna export DISTRIBUTIONS="base.txz kernel.txz" if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then - DISTMENU=`awk -F'\t' '!/^(kernel|base)/{print $4,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST` + DISTMENU=`awk -F'\t' '!/^(kernel\.txz|base\.txz)/{print $1,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST` + DISTMENU="$(echo ${DISTMENU} | sed -E 's/\.txz//g')" exec 3>&1 EXTRA_DISTS=$( eval dialog \ @@ -129,16 +130,20 @@ if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; done fi +LOCAL_DISTRIBUTIONS="MANIFEST" FETCH_DISTRIBUTIONS="" for dist in $DISTRIBUTIONS; do if [ ! -f $BSDINSTALL_DISTDIR/$dist ]; then FETCH_DISTRIBUTIONS="$FETCH_DISTRIBUTIONS $dist" + else + LOCAL_DISTRIBUTIONS="$LOCAL_DISTRIBUTIONS $dist" fi done +LOCAL_DISTRIBUTIONS=`echo $LOCAL_DISTRIBUTIONS` # Trim white space FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" ]; then - dialog --backtitle "FreeBSD Installer" --title "Network Installation" --msgbox "No installation files were found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 + dialog --backtitle "FreeBSD Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 bsdinstall netconfig || error NETCONFIG_DONE=yes fi @@ -299,6 +304,7 @@ esac if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then ALL_DISTRIBUTIONS="$DISTRIBUTIONS" + WANT_DEBUG= # Download to a directory in the new system as scratch space BSDINSTALL_FETCHDEST="$BSDINSTALL_CHROOT/usr/freebsd-dist" @@ -310,15 +316,65 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then DISTDIR_IS_UNIONFS=1 mount_nullfs -o union "$BSDINSTALL_FETCHDEST" "$BSDINSTALL_DISTDIR" else - export DISTRIBUTIONS="$ALL_DISTRIBUTIONS" + export DISTRIBUTIONS="$FETCH_DISTRIBUTIONS" export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST" fi export FTP_PASSIVE_MODE=YES - bsdinstall distfetch || error "Failed to fetch distribution" + # Iterate through the distribution list and set a flag if debugging + # distributions have been selected. + for _DISTRIBUTION in $DISTRIBUTIONS; do + case $_DISTRIBUTION in + *-dbg.*) + [ -e $BSDINSTALL_DISTDIR/$_DISTRIBUTION ] \ + && continue + WANT_DEBUG=1 + DEBUG_LIST="\n$DEBUG_LIST\n$_DISTRIBUTION" + ;; + *) + ;; + esac + done + + # Fetch the distributions. + bsdinstall distfetch + rc=$? + + if [ $rc -ne 0 ]; then + # If unable to fetch the remote distributions, recommend + # deselecting the debugging distributions, and retrying the + # installation, since failure to fetch *-dbg.txz should not + # be considered a fatal installation error. + msg="Failed to fetch remote distribution" + if [ ! -z "$WANT_DEBUG" ]; then + # Trim leading and trailing newlines. + DEBUG_LIST="${DEBUG_LIST%%\n}" + DEBUG_LIST="${DEBUG_LIST##\n}" + msg="$msg\n\nPlease deselect the following distributions" + msg="$msg and retry the installation:" + msg="$msg\n$DEBUG_LIST" + fi + error "$msg" + fi export DISTRIBUTIONS="$ALL_DISTRIBUTIONS" fi +if [ ! -z "$LOCAL_DISTRIBUTIONS" ]; then + # Download to a directory in the new system as scratch space + BSDINSTALL_FETCHDEST="$BSDINSTALL_CHROOT/usr/freebsd-dist" + mkdir -p "$BSDINSTALL_FETCHDEST" || error "Could not create directory $BSDINSTALL_FETCHDEST" + # Try to use any existing distfiles + if [ -d $BSDINSTALL_DISTDIR ]; then + DISTDIR_IS_UNIONFS=1 + mount_nullfs -o union "$BSDINSTALL_FETCHDEST" "$BSDINSTALL_DISTDIR" + export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST" + fi + env DISTRIBUTIONS="$LOCAL_DISTRIBUTIONS" \ + BSDINSTALL_DISTSITE="file:///usr/freebsd-dist" \ + bsdinstall distfetch || \ + error "Failed to fetch distribution from local media" +fi + bsdinstall checksum || error "Distribution checksum failed" bsdinstall distextract || error "Distribution extract failed" bsdinstall rootpass || error "Could not set root password" From owner-svn-src-all@freebsd.org Tue Jan 5 21:20:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0120A62A53; Tue, 5 Jan 2016 21:20:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D3351275; Tue, 5 Jan 2016 21:20:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05LKkrj074875; Tue, 5 Jan 2016 21:20:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05LKkvv074874; Tue, 5 Jan 2016 21:20:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601052120.u05LKkvv074874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 5 Jan 2016 21:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293226 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 21:20:47 -0000 Author: imp Date: Tue Jan 5 21:20:46 2016 New Revision: 293226 URL: https://svnweb.freebsd.org/changeset/base/293226 Log: Disable abi variant hook until strangeness with packages can be sorted out. Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jan 5 21:12:49 2016 (r293225) +++ head/libexec/rtld-elf/rtld.c Tue Jan 5 21:20:46 2016 (r293226) @@ -435,7 +435,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ trust = !issetugid(); - md_abi_variant_hook(aux_info); +/* md_abi_variant_hook(aux_info); */ ld_bind_now = getenv(_LD("BIND_NOW")); /* From owner-svn-src-all@freebsd.org Tue Jan 5 21:20:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EDBFA62A5B; Tue, 5 Jan 2016 21:20:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 623671278; Tue, 5 Jan 2016 21:20:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05LKlTF074920; Tue, 5 Jan 2016 21:20:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05LKlQw074919; Tue, 5 Jan 2016 21:20:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601052120.u05LKlQw074919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 5 Jan 2016 21:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293227 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 21:20:48 -0000 Author: imp Date: Tue Jan 5 21:20:47 2016 New Revision: 293227 URL: https://svnweb.freebsd.org/changeset/base/293227 Log: Use the more proper -f. Leave /bin/rm in place since that's what other rc scripts have, though it isn't strictly necessary. Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) @@ -132,9 +132,9 @@ done # Remove the firstboot sentinel, and reboot if it was requested. if [ -e ${firstboot_sentinel} ]; then [ ${root_rw_mount} = "yes" ] || mount -uw / - /bin/rm ${firstboot_sentinel} + /bin/rm -f ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then - /bin/rm ${firstboot_sentinel}-reboot + /bin/rm -f ${firstboot_sentinel}-reboot [ ${root_rw_mount} = "yes" ] || mount -ur / kill -INT 1 fi From owner-svn-src-all@freebsd.org Wed Jan 6 00:00:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A83FA63C6C for ; Wed, 6 Jan 2016 00:00:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DC5D10B2 for ; Wed, 6 Jan 2016 00:00:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 6 Jan 2016 00:00:39 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id u06004SN002360; Tue, 5 Jan 2016 17:00:04 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452038404.1320.46.camel@freebsd.org> Subject: Re: svn commit: r293227 - head/etc From: Ian Lepore To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 05 Jan 2016 17:00:04 -0700 In-Reply-To: <201601052120.u05LKlQw074919@repo.freebsd.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:00:08 -0000 On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: > Author: imp > Date: Tue Jan 5 21:20:47 2016 > New Revision: 293227 > URL: https://svnweb.freebsd.org/changeset/base/293227 > > Log: > Use the more proper -f. Leave /bin/rm in place since that's what > other rc scripts have, though it isn't strictly necessary. > > Modified: > head/etc/rc > > Modified: head/etc/rc > ===================================================================== > ========= > --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) > +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) > @@ -132,9 +132,9 @@ done > # Remove the firstboot sentinel, and reboot if it was requested. > if [ -e ${firstboot_sentinel} ]; then > [ ${root_rw_mount} = "yes" ] || mount -uw / > - /bin/rm ${firstboot_sentinel} > + /bin/rm -f ${firstboot_sentinel} > if [ -e ${firstboot_sentinel}-reboot ]; then > - /bin/rm ${firstboot_sentinel}-reboot > + /bin/rm -f ${firstboot_sentinel}-reboot > [ ${root_rw_mount} = "yes" ] || mount -ur / > kill -INT 1 > fi > Using rm -f to suppress an error message seems like a bad idea here -- if the sentinel file can't be removed that implies it's going to do firstboot behavior every time it boots, and that's the sort of error that should be in-your-face. Especially on the reboot one because you're going to be stuck in a reboot loop with no error message. -- Ian From owner-svn-src-all@freebsd.org Wed Jan 6 00:00:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2682AA63C9A; Wed, 6 Jan 2016 00:00:13 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5CAA110A; Wed, 6 Jan 2016 00:00:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0600Ba4021623; Wed, 6 Jan 2016 00:00:11 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0600Bat021616; Wed, 6 Jan 2016 00:00:11 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601060000.u0600Bat021616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 6 Jan 2016 00:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293229 - in head: etc/mtree usr.sbin/rpcbind usr.sbin/rpcbind/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:00:13 -0000 Author: asomers Date: Wed Jan 6 00:00:11 2016 New Revision: 293229 URL: https://svnweb.freebsd.org/changeset/base/293229 Log: "source routing" in rpcbind Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on two separate subnets, and a client on the first subnet contacted rpcbind at the address on the second subnet, rpcbind would advertise addresses on the first subnet. This is a bug, because it should prefer to advertise the address where it was contacted. The requested service might be firewalled off from the address on the first subnet, for example. usr.sbin/rpcbind/check_bound.c If the address on which a request was received is known, pass that to addrmerge as the clnt_uaddr parameter. That is what addrmerge's comment indicates the parameter is supposed to mean. The previous behavior is that clnt_uaddr would contain the address from which the client sent the request. usr.sbin/rpcbind/util.c Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr, if one is found. Refactor the relevant portion of the function for clarity, and to reduce the number of ifdefs. etc/mtree/BSD.tests.dist usr.sbin/rpcbind/tests/Makefile usr.sbin/rpcbind/tests/addrmerge_test.c Add unit tests for usr.sbin/rpcbind/util.c:addrmerge. usr.sbin/rpcbind/check_bound.c usr.sbin/rpcbind/rpcbind.h usr.sbin/rpcbind/util.c Constify some function arguments Reviewed by: imp MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4690 Added: head/usr.sbin/rpcbind/tests/ head/usr.sbin/rpcbind/tests/Makefile (contents, props changed) head/usr.sbin/rpcbind/tests/addrmerge_test.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.sbin/rpcbind/Makefile head/usr.sbin/rpcbind/check_bound.c head/usr.sbin/rpcbind/rpcbind.h head/usr.sbin/rpcbind/util.c Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Jan 5 22:27:34 2016 (r293228) +++ head/etc/mtree/BSD.tests.dist Wed Jan 6 00:00:11 2016 (r293229) @@ -622,6 +622,8 @@ .. pw .. + rpcbind + .. sa .. .. Modified: head/usr.sbin/rpcbind/Makefile ============================================================================== --- head/usr.sbin/rpcbind/Makefile Tue Jan 5 22:27:34 2016 (r293228) +++ head/usr.sbin/rpcbind/Makefile Wed Jan 6 00:00:11 2016 (r293229) @@ -14,6 +14,10 @@ CFLAGS+= -DPORTMAP -DLIBWRAP CFLAGS+= -DINET6 .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + WARNS?= 1 LIBADD= wrap Modified: head/usr.sbin/rpcbind/check_bound.c ============================================================================== --- head/usr.sbin/rpcbind/check_bound.c Tue Jan 5 22:27:34 2016 (r293228) +++ head/usr.sbin/rpcbind/check_bound.c Wed Jan 6 00:00:11 2016 (r293229) @@ -50,6 +50,7 @@ static char sccsid[] = "@(#)check_bound. #include #include #include +#include #include #include #include @@ -159,6 +160,7 @@ char * mergeaddr(SVCXPRT *xprt, char *netid, char *uaddr, char *saddr) { struct fdlist *fdl; + struct svc_dg_data *dg_data; char *c_uaddr, *s_uaddr, *m_uaddr, *allocated_uaddr = NULL; for (fdl = fdhead; fdl; fdl = fdl->next) @@ -170,11 +172,20 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch /* that server died */ return (nullstring); /* + * Try to determine the local address on which the client contacted us, + * so we can send a reply from the same address. If it's unknown, then + * try to determine which address the client used, and pick a nearby + * local address. + * * If saddr is not NULL, the remote client may have included the * address by which it contacted us. Use that for the "client" uaddr, * otherwise use the info from the SVCXPRT. */ - if (saddr != NULL) { + dg_data = (struct svc_dg_data*)xprt->xp_p2; + if (dg_data != NULL && dg_data->su_srcaddr.buf != NULL) { + c_uaddr = taddr2uaddr(fdl->nconf, &dg_data->su_srcaddr); + } + else if (saddr != NULL) { c_uaddr = saddr; } else { c_uaddr = taddr2uaddr(fdl->nconf, svc_getrpccaller(xprt)); @@ -217,7 +228,7 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch * structure should not be freed. */ struct netconfig * -rpcbind_get_conf(char *netid) +rpcbind_get_conf(const char *netid) { struct fdlist *fdl; Modified: head/usr.sbin/rpcbind/rpcbind.h ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.h Tue Jan 5 22:27:34 2016 (r293228) +++ head/usr.sbin/rpcbind/rpcbind.h Wed Jan 6 00:00:11 2016 (r293229) @@ -85,7 +85,7 @@ extern char *tcp_uaddr; /* Universal TC int add_bndlist(struct netconfig *, struct netbuf *); bool_t is_bound(char *, char *); char *mergeaddr(SVCXPRT *, char *, char *, char *); -struct netconfig *rpcbind_get_conf(char *); +struct netconfig *rpcbind_get_conf(const char *); void rpcbs_init(void); void rpcbs_procinfo(rpcvers_t, rpcproc_t); @@ -134,8 +134,8 @@ extern void pmap_service(struct svc_req void write_warmstart(void); void read_warmstart(void); -char *addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr, - char *netid); +char *addrmerge(struct netbuf *caller, const char *serv_uaddr, + const char *clnt_uaddr, char const *netid); int listen_addr(const struct sockaddr *sa); void network_init(void); struct sockaddr *local_sa(int); Added: head/usr.sbin/rpcbind/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rpcbind/tests/Makefile Wed Jan 6 00:00:11 2016 (r293229) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +.include + +.PATH: ${.CURDIR}/.. + +ATF_TESTS_C= addrmerge_test +CFLAGS+= -I${.CURDIR}/.. -Wno-cast-qual +SRCS.addrmerge_test= addrmerge_test.c util.c + +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DINET6 +.endif + +WARNS?= 3 + +.include Added: head/usr.sbin/rpcbind/tests/addrmerge_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rpcbind/tests/addrmerge_test.c Wed Jan 6 00:00:11 2016 (r293229) @@ -0,0 +1,849 @@ +/*- + * Copyright (c) 2014 Spectra Logic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#include "rpcbind.h" + +#define MAX_IFADDRS 16 + +int debugging = false; + +/* Data for mocking getifaddrs */ +struct ifaddr_storage { + struct ifaddrs ifaddr; + struct sockaddr_storage addr; + struct sockaddr_storage mask; + struct sockaddr_storage bcast; +} mock_ifaddr_storage[MAX_IFADDRS]; +struct ifaddrs *mock_ifaddrs = NULL; +int ifaddr_count = 0; + +/* Data for mocking listen_addr */ +int bind_address_count = 0; +struct sockaddr* bind_addresses[MAX_IFADDRS]; + +/* Stub library functions */ +void +freeifaddrs(struct ifaddrs *ifp __unused) +{ + return ; +} + +int +getifaddrs(struct ifaddrs **ifap) +{ + *ifap = mock_ifaddrs; + return (0); +} + +static void +mock_ifaddr4(const char* name, const char* addr, const char* mask, + const char* bcast, unsigned int flags, bool bind) +{ + struct ifaddrs *ifaddr = &mock_ifaddr_storage[ifaddr_count].ifaddr; + struct sockaddr_in *in = (struct sockaddr_in*) + &mock_ifaddr_storage[ifaddr_count].addr; + struct sockaddr_in *mask_in = (struct sockaddr_in*) + &mock_ifaddr_storage[ifaddr_count].mask; + struct sockaddr_in *bcast_in = (struct sockaddr_in*) + &mock_ifaddr_storage[ifaddr_count].bcast; + + in->sin_family = AF_INET; + in->sin_port = 0; + in->sin_len = sizeof(in); + in->sin_addr.s_addr = inet_addr(addr); + mask_in->sin_family = AF_INET; + mask_in->sin_port = 0; + mask_in->sin_len = sizeof(mask_in); + mask_in->sin_addr.s_addr = inet_addr(mask); + bcast_in->sin_family = AF_INET; + bcast_in->sin_port = 0; + bcast_in->sin_len = sizeof(bcast_in); + bcast_in->sin_addr.s_addr = inet_addr(bcast); + *ifaddr = (struct ifaddrs) { + .ifa_next = NULL, + .ifa_name = (char*) name, + .ifa_flags = flags, + .ifa_addr = (struct sockaddr*) in, + .ifa_netmask = (struct sockaddr*) mask_in, + .ifa_broadaddr = (struct sockaddr*) bcast_in, + .ifa_data = NULL, /* addrmerge doesn't care*/ + }; + + if (ifaddr_count > 0) + mock_ifaddr_storage[ifaddr_count - 1].ifaddr.ifa_next = ifaddr; + ifaddr_count++; + mock_ifaddrs = &mock_ifaddr_storage[0].ifaddr; + + /* Optionally simulate binding an ip ala "rpcbind -h foo" */ + if (bind) { + bind_addresses[bind_address_count] = (struct sockaddr*)in; + bind_address_count++; + } +} + +#ifdef INET6 +static void +mock_ifaddr6(const char* name, const char* addr, const char* mask, + const char* bcast, unsigned int flags, uint32_t scope_id, bool bind) +{ + struct ifaddrs *ifaddr = &mock_ifaddr_storage[ifaddr_count].ifaddr; + struct sockaddr_in6 *in6 = (struct sockaddr_in6*) + &mock_ifaddr_storage[ifaddr_count].addr; + struct sockaddr_in6 *mask_in6 = (struct sockaddr_in6*) + &mock_ifaddr_storage[ifaddr_count].mask; + struct sockaddr_in6 *bcast_in6 = (struct sockaddr_in6*) + &mock_ifaddr_storage[ifaddr_count].bcast; + + in6->sin6_family = AF_INET6; + in6->sin6_port = 0; + in6->sin6_len = sizeof(*in6); + in6->sin6_scope_id = scope_id; + ATF_REQUIRE_EQ(1, inet_pton(AF_INET6, addr, (void*)&in6->sin6_addr)); + mask_in6->sin6_family = AF_INET6; + mask_in6->sin6_port = 0; + mask_in6->sin6_len = sizeof(*mask_in6); + mask_in6->sin6_scope_id = scope_id; + ATF_REQUIRE_EQ(1, inet_pton(AF_INET6, mask, + (void*)&mask_in6->sin6_addr)); + bcast_in6->sin6_family = AF_INET6; + bcast_in6->sin6_port = 0; + bcast_in6->sin6_len = sizeof(*bcast_in6); + bcast_in6->sin6_scope_id = scope_id; + ATF_REQUIRE_EQ(1, inet_pton(AF_INET6, bcast, + (void*)&bcast_in6->sin6_addr)); + *ifaddr = (struct ifaddrs) { + .ifa_next = NULL, + .ifa_name = (char*) name, + .ifa_flags = flags, + .ifa_addr = (struct sockaddr*) in6, + .ifa_netmask = (struct sockaddr*) mask_in6, + .ifa_broadaddr = (struct sockaddr*) bcast_in6, + .ifa_data = NULL, /* addrmerge doesn't care*/ + }; + + if (ifaddr_count > 0) + mock_ifaddr_storage[ifaddr_count - 1].ifaddr.ifa_next = ifaddr; + ifaddr_count++; + mock_ifaddrs = &mock_ifaddr_storage[0].ifaddr; + + /* Optionally simulate binding an ip ala "rpcbind -h foo" */ + if (bind) { + bind_addresses[bind_address_count] = (struct sockaddr*)in6; + bind_address_count++; + } +} +#else +static void +mock_ifaddr6(const char* name __unused, const char* addr __unused, + const char* mask __unused, const char* bcast __unused, + unsigned int flags __unused, uint32_t scope_id __unused, bool bind __unused) +{ +} +#endif /*INET6 */ + +static void +mock_lo0(void) +{ + /* + * This broadcast address looks wrong, but it's what getifaddrs(2) + * actually returns. It's invalid because IFF_BROADCAST is not set + */ + mock_ifaddr4("lo0", "127.0.0.1", "255.0.0.0", "127.0.0.1", + IFF_LOOPBACK | IFF_UP | IFF_RUNNING | IFF_MULTICAST, false); + mock_ifaddr6("lo0", "::1", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", + "::1", + IFF_LOOPBACK | IFF_UP | IFF_RUNNING | IFF_MULTICAST, 0, false); +} + +static void +mock_igb0(void) +{ + mock_ifaddr4("igb0", "192.0.2.2", "255.255.255.128", "192.0.2.127", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + false); + mock_ifaddr6("igb0", "2001:db8::2", "ffff:ffff:ffff:ffff::", + "2001:db8::ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 0, false); + /* Link local address */ + mock_ifaddr6("igb0", "fe80::2", "ffff:ffff:ffff:ffff::", + "fe80::ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 2, false); +} + +/* On the same subnet as igb0 */ +static void +mock_igb1(bool bind) +{ + mock_ifaddr4("igb1", "192.0.2.3", "255.255.255.128", "192.0.2.127", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + bind); + mock_ifaddr6("igb1", "2001:db8::3", "ffff:ffff:ffff:ffff::", + "2001:db8::ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 0, bind); + /* Link local address */ + mock_ifaddr6("igb1", "fe80::3", "ffff:ffff:ffff:ffff::", + "fe80::ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 3, bind); +} + +/* igb2 is on a different subnet than igb0 */ +static void +mock_igb2(void) +{ + mock_ifaddr4("igb2", "192.0.2.130", "255.255.255.128", "192.0.2.255", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + false); + mock_ifaddr6("igb2", "2001:db8:1::2", "ffff:ffff:ffff:ffff::", + "2001:db8:1:0:ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 0, false); +} + +/* tun0 is a P2P interface */ +static void +mock_tun0(void) +{ + mock_ifaddr4("tun0", "192.0.2.5", "255.255.255.255", "192.0.2.6", + IFF_UP | IFF_RUNNING | IFF_POINTOPOINT | IFF_MULTICAST, false); + mock_ifaddr6("tun0", "2001:db8::5", + "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", + "2001:db8::6", + IFF_UP | IFF_RUNNING | IFF_POINTOPOINT | IFF_MULTICAST, 0, false); +} + + +/* Stub rpcbind functions */ +int +listen_addr(const struct sockaddr *sa) +{ + int i; + + if (bind_address_count == 0) + return (1); + + for (i = 0; i < bind_address_count; i++) { + if (bind_addresses[i]->sa_family != sa->sa_family) + continue; + + if (0 == memcmp(bind_addresses[i]->sa_data, sa->sa_data, + sa->sa_len)) + return (1); + } + return (0); +} + +struct netconfig* +rpcbind_get_conf(const char* netid __unused) +{ + /* Use static variables so we can return pointers to them */ + static char* lookups = NULL; + static struct netconfig nconf_udp; +#ifdef INET6 + static struct netconfig nconf_udp6; +#endif /* INET6 */ + + nconf_udp.nc_netid = "udp"; //netid_storage; + nconf_udp.nc_semantics = NC_TPI_CLTS; + nconf_udp.nc_flag = NC_VISIBLE; + nconf_udp.nc_protofmly = (char*)"inet"; + nconf_udp.nc_proto = (char*)"udp"; + nconf_udp.nc_device = (char*)"-"; + nconf_udp.nc_nlookups = 0; + nconf_udp.nc_lookups = &lookups; + +#ifdef INET6 + nconf_udp6.nc_netid = "udp6"; //netid_storage; + nconf_udp6.nc_semantics = NC_TPI_CLTS; + nconf_udp6.nc_flag = NC_VISIBLE; + nconf_udp6.nc_protofmly = (char*)"inet6"; + nconf_udp6.nc_proto = (char*)"udp6"; + nconf_udp6.nc_device = (char*)"-"; + nconf_udp6.nc_nlookups = 0; + nconf_udp6.nc_lookups = &lookups; +#endif /* INET6 */ + + if (0 == strncmp("udp", netid, sizeof("udp"))) + return (&nconf_udp); +#ifdef INET6 + else if (0 == strncmp("udp6", netid, sizeof("udp6"))) + return (&nconf_udp6); +#endif /* INET6 */ + else + return (NULL); +} + +/* + * Helper function used by most test cases + * param recvdstaddr If non-null, the uaddr on which the request was received + */ +static char* +do_addrmerge4(const char* recvdstaddr) +{ + struct netbuf caller; + struct sockaddr_in caller_in; + const char *serv_uaddr, *clnt_uaddr, *netid; + + /* caller contains the client's IP address */ + caller.maxlen = sizeof(struct sockaddr_storage); + caller.len = sizeof(caller_in); + caller_in.sin_family = AF_INET; + caller_in.sin_len = sizeof(caller_in); + caller_in.sin_port = 1234; + caller_in.sin_addr.s_addr = inet_addr("192.0.2.1"); + caller.buf = (void*)&caller_in; + if (recvdstaddr != NULL) + clnt_uaddr = recvdstaddr; + else + clnt_uaddr = "192.0.2.1.3.46"; + + /* assume server is bound in INADDR_ANY port 814 */ + serv_uaddr = "0.0.0.0.3.46"; + + netid = "udp"; + return (addrmerge(&caller, serv_uaddr, clnt_uaddr, netid)); +} + +#ifdef INET6 +/* + * Variant of do_addrmerge4 where the caller has an IPv6 address + * param recvdstaddr If non-null, the uaddr on which the request was received + */ +static char* +do_addrmerge6(const char* recvdstaddr) +{ + struct netbuf caller; + struct sockaddr_in6 caller_in6; + const char *serv_uaddr, *clnt_uaddr, *netid; + + /* caller contains the client's IP address */ + caller.maxlen = sizeof(struct sockaddr_storage); + caller.len = sizeof(caller_in6); + caller_in6.sin6_family = AF_INET6; + caller_in6.sin6_len = sizeof(caller_in6); + caller_in6.sin6_port = 1234; + ATF_REQUIRE_EQ(1, inet_pton(AF_INET6, "2001:db8::1", + (void*)&caller_in6.sin6_addr)); + caller.buf = (void*)&caller_in6; + if (recvdstaddr != NULL) + clnt_uaddr = recvdstaddr; + else + clnt_uaddr = "2001:db8::1.3.46"; + + /* assume server is bound in INADDR_ANY port 814 */ + serv_uaddr = "::1.3.46"; + + netid = "udp6"; + return (addrmerge(&caller, serv_uaddr, clnt_uaddr, netid)); +} + +/* Variant of do_addrmerge6 where the caller uses a link local address */ +static char* +do_addrmerge6_ll(void) +{ + struct netbuf caller; + struct sockaddr_in6 caller_in6; + const char *serv_uaddr, *clnt_uaddr, *netid; + + /* caller contains the client's IP address */ + caller.maxlen = sizeof(struct sockaddr_storage); + caller.len = sizeof(caller_in6); + caller_in6.sin6_family = AF_INET6; + caller_in6.sin6_len = sizeof(caller_in6); + caller_in6.sin6_port = 1234; + caller_in6.sin6_scope_id = 2; /* same as igb0 */ + ATF_REQUIRE_EQ(1, inet_pton(AF_INET6, "fe80::beef", + (void*)&caller_in6.sin6_addr)); + caller.buf = (void*)&caller_in6; + clnt_uaddr = "fe80::beef.3.46"; + + /* assume server is bound in INADDR_ANY port 814 */ + serv_uaddr = "::1.3.46"; + + netid = "udp6"; + return (addrmerge(&caller, serv_uaddr, clnt_uaddr, netid)); +} +#endif /* INET6 */ + +ATF_TC_WITHOUT_HEAD(addrmerge_noifaddrs); +ATF_TC_BODY(addrmerge_noifaddrs, tc) +{ + char* maddr; + + maddr = do_addrmerge4(NULL); + + /* Since getifaddrs returns null, addrmerge must too */ + ATF_CHECK_EQ(NULL, maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_localhost_only); +ATF_TC_BODY(addrmerge_localhost_only, tc) +{ + char *maddr; + + /* getifaddrs will return localhost only */ + mock_lo0(); + + maddr = do_addrmerge4(NULL); + + /* We must return localhost if there is nothing better */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("127.0.0.1.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_singlehomed); +ATF_TC_BODY(addrmerge_singlehomed, tc) +{ + char *maddr; + + /* getifaddrs will return one public address */ + mock_lo0(); + mock_igb0(); + + maddr = do_addrmerge4(NULL); + + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet); +ATF_TC_BODY(addrmerge_one_addr_on_each_subnet, tc) +{ + char *maddr; + + mock_lo0(); + mock_igb0(); + mock_igb2(); + + maddr = do_addrmerge4(NULL); + + /* We must return the address on the caller's subnet */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); +} + + +/* + * Like addrmerge_one_addr_on_each_subnet, but getifaddrs returns a different + * order + */ +ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet_rev); +ATF_TC_BODY(addrmerge_one_addr_on_each_subnet_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_igb2(); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge4(NULL); + + /* We must return the address on the caller's subnet */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_point2point); +ATF_TC_BODY(addrmerge_point2point, tc) +{ + char *maddr; + + /* getifaddrs will return one normal and one p2p address */ + mock_lo0(); + mock_igb2(); + mock_tun0(); + + maddr = do_addrmerge4(NULL); + + /* addrmerge should disprefer P2P interfaces */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.130.3.46", maddr); +} + +/* Like addrerge_point2point, but getifaddrs returns a different order */ +ATF_TC_WITHOUT_HEAD(addrmerge_point2point_rev); +ATF_TC_BODY(addrmerge_point2point_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one normal and one p2p address */ + mock_tun0(); + mock_igb2(); + mock_lo0(); + + maddr = do_addrmerge4(NULL); + + /* addrmerge should disprefer P2P interfaces */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.130.3.46", maddr); +} + +/* + * Simulate using rpcbind -h to select just one ip when the subnet has + * multiple + */ +ATF_TC_WITHOUT_HEAD(addrmerge_bindip); +ATF_TC_BODY(addrmerge_bindip, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_lo0(); + mock_igb0(); + mock_igb1(true); + + maddr = do_addrmerge4(NULL); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.3.3.46", maddr); +} + +/* Like addrmerge_bindip, but getifaddrs returns a different order */ +ATF_TC_WITHOUT_HEAD(addrmerge_bindip_rev); +ATF_TC_BODY(addrmerge_bindip_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_igb1(true); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge4(NULL); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.3.3.46", maddr); +} + +/* + * The address on which the request was received is known, and is provided as + * the hint. + */ +ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr); +ATF_TC_BODY(addrmerge_recvdstaddr, tc) +{ + char *maddr; + + mock_lo0(); + mock_igb0(); + mock_igb1(false); + + maddr = do_addrmerge4("192.0.2.2.3.46"); + + /* We must return the address on which the request was received */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr_rev); +ATF_TC_BODY(addrmerge_recvdstaddr_rev, tc) +{ + char *maddr; + + mock_igb1(false); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge4("192.0.2.2.3.46"); + + /* We must return the address on which the request was received */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); +} + +#ifdef INET6 +ATF_TC_WITHOUT_HEAD(addrmerge_localhost_only6); +ATF_TC_BODY(addrmerge_localhost_only6, tc) +{ + char *maddr; + + /* getifaddrs will return localhost only */ + mock_lo0(); + + maddr = do_addrmerge6(NULL); + + /* We must return localhost if there is nothing better */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("::1.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_singlehomed6); +ATF_TC_BODY(addrmerge_singlehomed6, tc) +{ + char *maddr; + + /* getifaddrs will return one public address */ + mock_lo0(); + mock_igb0(); + + maddr = do_addrmerge6(NULL); + + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet6); +ATF_TC_BODY(addrmerge_one_addr_on_each_subnet6, tc) +{ + char *maddr; + + mock_lo0(); + mock_igb0(); + mock_igb2(); + + maddr = do_addrmerge6(NULL); + + /* We must return the address on the caller's subnet */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); +} + + +/* + * Like addrmerge_one_addr_on_each_subnet6, but getifaddrs returns a different + * order + */ +ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet6_rev); +ATF_TC_BODY(addrmerge_one_addr_on_each_subnet6_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_igb2(); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge6(NULL); + + /* We must return the address on the caller's subnet */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_point2point6); +ATF_TC_BODY(addrmerge_point2point6, tc) +{ + char *maddr; + + /* getifaddrs will return one normal and one p2p address */ + mock_lo0(); + mock_igb2(); + mock_tun0(); + + maddr = do_addrmerge6(NULL); + + /* addrmerge should disprefer P2P interfaces */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8:1::2.3.46", maddr); +} + +/* Like addrerge_point2point, but getifaddrs returns a different order */ +ATF_TC_WITHOUT_HEAD(addrmerge_point2point6_rev); +ATF_TC_BODY(addrmerge_point2point6_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one normal and one p2p address */ + mock_tun0(); + mock_igb2(); + mock_lo0(); + + maddr = do_addrmerge6(NULL); + + /* addrmerge should disprefer P2P interfaces */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8:1::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_bindip6); +ATF_TC_BODY(addrmerge_bindip6, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_lo0(); + mock_igb0(); + mock_igb1(true); + + maddr = do_addrmerge6(NULL); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::3.3.46", maddr); +} + +/* Like addrerge_bindip, but getifaddrs returns a different order */ +ATF_TC_WITHOUT_HEAD(addrmerge_bindip6_rev); +ATF_TC_BODY(addrmerge_bindip6_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_igb1(true); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge6(NULL); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::3.3.46", maddr); +} + +/* + * IPv6 Link Local addresses with the same scope id as the caller, if the caller + * is also a link local address, should be preferred + */ +ATF_TC_WITHOUT_HEAD(addrmerge_ipv6_linklocal); +ATF_TC_BODY(addrmerge_ipv6_linklocal, tc) +{ + char *maddr; + + /* + * getifaddrs will return two link local addresses with the same netmask + * and prefix but different scope IDs + */ + mock_igb1(false); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge6_ll(); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("fe80::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_ipv6_linklocal_rev); +ATF_TC_BODY(addrmerge_ipv6_linklocal_rev, tc) +{ + char *maddr; + + /* + * getifaddrs will return two link local addresses with the same netmask + * and prefix but different scope IDs + */ + mock_lo0(); + mock_igb0(); + mock_igb1(false); + + maddr = do_addrmerge6_ll(); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("fe80::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr6); +ATF_TC_BODY(addrmerge_recvdstaddr6, tc) +{ + char *maddr; + + mock_lo0(); + mock_igb0(); + mock_igb1(false); + + maddr = do_addrmerge6("2001:db8::2.3.46"); + + /* We must return the address on which the request was received */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr6_rev); +ATF_TC_BODY(addrmerge_recvdstaddr6_rev, tc) +{ + char *maddr; + + mock_igb1(false); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge6("2001:db8::2.3.46"); + + /* We must return the address on which the request was received */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); +} +#endif /* INET6 */ + + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, addrmerge_noifaddrs); + ATF_TP_ADD_TC(tp, addrmerge_localhost_only); + ATF_TP_ADD_TC(tp, addrmerge_singlehomed); + ATF_TP_ADD_TC(tp, addrmerge_one_addr_on_each_subnet); + ATF_TP_ADD_TC(tp, addrmerge_one_addr_on_each_subnet_rev); + ATF_TP_ADD_TC(tp, addrmerge_point2point); + ATF_TP_ADD_TC(tp, addrmerge_point2point_rev); + ATF_TP_ADD_TC(tp, addrmerge_bindip); + ATF_TP_ADD_TC(tp, addrmerge_bindip_rev); + ATF_TP_ADD_TC(tp, addrmerge_recvdstaddr); + ATF_TP_ADD_TC(tp, addrmerge_recvdstaddr_rev); +#ifdef INET6 + ATF_TP_ADD_TC(tp, addrmerge_localhost_only6); + ATF_TP_ADD_TC(tp, addrmerge_singlehomed6); + ATF_TP_ADD_TC(tp, addrmerge_one_addr_on_each_subnet6); + ATF_TP_ADD_TC(tp, addrmerge_one_addr_on_each_subnet6_rev); + ATF_TP_ADD_TC(tp, addrmerge_point2point6); + ATF_TP_ADD_TC(tp, addrmerge_point2point6_rev); + ATF_TP_ADD_TC(tp, addrmerge_bindip6); + ATF_TP_ADD_TC(tp, addrmerge_bindip6_rev); + ATF_TP_ADD_TC(tp, addrmerge_ipv6_linklocal); + ATF_TP_ADD_TC(tp, addrmerge_ipv6_linklocal_rev); + ATF_TP_ADD_TC(tp, addrmerge_recvdstaddr6); + ATF_TP_ADD_TC(tp, addrmerge_recvdstaddr6_rev); +#endif + + return (atf_no_error()); +} Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Tue Jan 5 22:27:34 2016 (r293228) +++ head/usr.sbin/rpcbind/util.c Wed Jan 6 00:00:11 2016 (r293229) @@ -56,7 +56,7 @@ static struct sockaddr_in *local_in4; static struct sockaddr_in6 *local_in6; #endif -static int bitmaskcmp(void *, void *, void *, int); +static int bitmaskcmp(struct sockaddr *, struct sockaddr *, struct sockaddr *); /* * For all bits set in "mask", compare the corresponding bits in @@ -64,10 +64,34 @@ static int bitmaskcmp(void *, void *, vo * match. */ static int -bitmaskcmp(void *dst, void *src, void *mask, int bytelen) +bitmaskcmp(struct sockaddr *dst, struct sockaddr *src, struct sockaddr *mask) { int i; - u_int8_t *p1 = dst, *p2 = src, *netmask = mask; + u_int8_t *p1, *p2, *netmask; + int bytelen; + + if (dst->sa_family != src->sa_family || + dst->sa_family != mask->sa_family) + return (1); + + switch (dst->sa_family) { + case AF_INET: + p1 = (uint8_t*) &SA2SINADDR(dst); + p2 = (uint8_t*) &SA2SINADDR(src); + netmask = (uint8_t*) &SA2SINADDR(mask); + bytelen = sizeof(struct in_addr); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 6 00:16:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97F40A6331B; Wed, 6 Jan 2016 00:16:54 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 897951C4A; Wed, 6 Jan 2016 00:16:54 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:63311 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aGTT9-000LYO-6w; Tue, 05 Jan 2016 07:24:19 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293227 - head/etc From: Devin Teske In-Reply-To: <1452038404.1320.46.camel@freebsd.org> Date: Tue, 5 Jan 2016 16:16:49 -0800 Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Content-Transfer-Encoding: 7bit Message-Id: <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:16:54 -0000 > On Jan 5, 2016, at 4:00 PM, Ian Lepore wrote: > > On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: >> Author: imp >> Date: Tue Jan 5 21:20:47 2016 >> New Revision: 293227 >> URL: https://svnweb.freebsd.org/changeset/base/293227 >> >> Log: >> Use the more proper -f. Leave /bin/rm in place since that's what >> other rc scripts have, though it isn't strictly necessary. >> >> Modified: >> head/etc/rc >> >> Modified: head/etc/rc >> ===================================================================== >> ========= >> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) >> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) >> @@ -132,9 +132,9 @@ done >> # Remove the firstboot sentinel, and reboot if it was requested. >> if [ -e ${firstboot_sentinel} ]; then >> [ ${root_rw_mount} = "yes" ] || mount -uw / >> - /bin/rm ${firstboot_sentinel} >> + /bin/rm -f ${firstboot_sentinel} >> if [ -e ${firstboot_sentinel}-reboot ]; then >> - /bin/rm ${firstboot_sentinel}-reboot >> + /bin/rm -f ${firstboot_sentinel}-reboot >> [ ${root_rw_mount} = "yes" ] || mount -ur / >> kill -INT 1 >> fi >> > > Using rm -f to suppress an error message seems like a bad idea here -- > if the sentinel file can't be removed that implies it's going to do > firstboot behavior every time it boots, and that's the sort of error > that should be in-your-face. Especially on the reboot one because > you're going to be stuck in a reboot loop with no error message. > Leaving off -f so that the user gets prompted isn't quite as helpful as, say, using -f but then testing to make sure the file is really gone (if it still exists after a silent "rm -f", put up an informative warning instead of asking the user if they would like to delete it). The end-result of having something thrown in your face seems desirable. Having a prompt that asks you if you'd like to delete it (even if there is an error immediately above it explaining it could not be deleted) seems nonsensical. -- Devin From owner-svn-src-all@freebsd.org Wed Jan 6 00:18:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD681A633AC; Wed, 6 Jan 2016 00:18:22 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 8FF811DDF; Wed, 6 Jan 2016 00:18:22 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.1] (unknown [192.168.1.1]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 9ADAADCEE; Wed, 6 Jan 2016 00:18:21 +0000 (UTC) Subject: Re: svn commit: r293227 - head/etc To: Devin Teske , Ian Lepore References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <568C5D49.9090502@freebsd.org> Date: Tue, 5 Jan 2016 19:18:17 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:18:22 -0000 On 2016-01-05 19:16, Devin Teske wrote: > >> On Jan 5, 2016, at 4:00 PM, Ian Lepore wrote: >> >> On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: >>> Author: imp >>> Date: Tue Jan 5 21:20:47 2016 >>> New Revision: 293227 >>> URL: https://svnweb.freebsd.org/changeset/base/293227 >>> >>> Log: >>> Use the more proper -f. Leave /bin/rm in place since that's what >>> other rc scripts have, though it isn't strictly necessary. >>> >>> Modified: >>> head/etc/rc >>> >>> Modified: head/etc/rc >>> ===================================================================== >>> ========= >>> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) >>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) >>> @@ -132,9 +132,9 @@ done >>> # Remove the firstboot sentinel, and reboot if it was requested. >>> if [ -e ${firstboot_sentinel} ]; then >>> [ ${root_rw_mount} = "yes" ] || mount -uw / >>> - /bin/rm ${firstboot_sentinel} >>> + /bin/rm -f ${firstboot_sentinel} >>> if [ -e ${firstboot_sentinel}-reboot ]; then >>> - /bin/rm ${firstboot_sentinel}-reboot >>> + /bin/rm -f ${firstboot_sentinel}-reboot >>> [ ${root_rw_mount} = "yes" ] || mount -ur / >>> kill -INT 1 >>> fi >>> >> >> Using rm -f to suppress an error message seems like a bad idea here -- >> if the sentinel file can't be removed that implies it's going to do >> firstboot behavior every time it boots, and that's the sort of error >> that should be in-your-face. Especially on the reboot one because >> you're going to be stuck in a reboot loop with no error message. >> > > Leaving off -f so that the user gets prompted isn't quite as helpful > as, say, using -f but then testing to make sure the file is really gone > (if it still exists after a silent "rm -f", put up an informative warning > instead of asking the user if they would like to delete it). > > The end-result of having something thrown in your face seems > desirable. Having a prompt that asks you if you'd like to delete it > (even if there is an error immediately above it explaining it could > not be deleted) seems nonsensical. > More specifically, firstboot is most likely run in situations where no one will be at the console, so an interactive prompt stopping the system from coming up is bad. -- Allan Jude From owner-svn-src-all@freebsd.org Wed Jan 6 00:27:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A861A6369C for ; Wed, 6 Jan 2016 00:27:56 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CC6F12D5 for ; Wed, 6 Jan 2016 00:27:55 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 6 Jan 2016 00:28:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id u060RqLP002403; Tue, 5 Jan 2016 17:27:53 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452040072.1320.49.camel@freebsd.org> Subject: Re: svn commit: r293227 - head/etc From: Ian Lepore To: Allan Jude , Devin Teske Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 05 Jan 2016 17:27:52 -0700 In-Reply-To: <568C5D49.9090502@freebsd.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> <568C5D49.9090502@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:27:56 -0000 On Tue, 2016-01-05 at 19:18 -0500, Allan Jude wrote: > On 2016-01-05 19:16, Devin Teske wrote: > > > > > On Jan 5, 2016, at 4:00 PM, Ian Lepore wrote: > > > > > > On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: > > > > Author: imp > > > > Date: Tue Jan 5 21:20:47 2016 > > > > New Revision: 293227 > > > > URL: https://svnweb.freebsd.org/changeset/base/293227 > > > > > > > > Log: > > > > Use the more proper -f. Leave /bin/rm in place since that's > > > > what > > > > other rc scripts have, though it isn't strictly necessary. > > > > > > > > Modified: > > > > head/etc/rc > > > > > > > > Modified: head/etc/rc > > > > =============================================================== > > > > ====== > > > > ========= > > > > --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226 > > > > ) > > > > +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227 > > > > ) > > > > @@ -132,9 +132,9 @@ done > > > > # Remove the firstboot sentinel, and reboot if it was > > > > requested. > > > > if [ -e ${firstboot_sentinel} ]; then > > > > [ ${root_rw_mount} = "yes" ] || mount -uw / > > > > - /bin/rm ${firstboot_sentinel} > > > > + /bin/rm -f ${firstboot_sentinel} > > > > if [ -e ${firstboot_sentinel}-reboot ]; then > > > > - /bin/rm ${firstboot_sentinel}-reboot > > > > + /bin/rm -f ${firstboot_sentinel}-reboot > > > > [ ${root_rw_mount} = "yes" ] || mount -ur / > > > > kill -INT 1 > > > > fi > > > > > > > > > > Using rm -f to suppress an error message seems like a bad idea > > > here -- > > > if the sentinel file can't be removed that implies it's going to > > > do > > > firstboot behavior every time it boots, and that's the sort of > > > error > > > that should be in-your-face. Especially on the reboot one > > > because > > > you're going to be stuck in a reboot loop with no error message. > > > > > > > Leaving off -f so that the user gets prompted isn't quite as > > helpful > > as, say, using -f but then testing to make sure the file is really > > gone > > (if it still exists after a silent "rm -f", put up an informative > > warning > > instead of asking the user if they would like to delete it). > > > > The end-result of having something thrown in your face seems > > desirable. Having a prompt that asks you if you'd like to delete it > > (even if there is an error immediately above it explaining it could > > not be deleted) seems nonsensical. > > > > More specifically, firstboot is most likely run in situations where > no > one will be at the console, so an interactive prompt stopping the > system > from coming up is bad. > I couldn't possibly disagree more. If you're not paying attention to what happens the first time you boot a freshly installed system, you deserve whatever happens to you. On the other hand it's about the worst to have everything silently seem to work right, and the actual error is going to happen *next* time you boot (which is when it's really likely you're not paying attention because everything seemed to be okay the first time). -- Ian From owner-svn-src-all@freebsd.org Wed Jan 6 00:35:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31838A63989; Wed, 6 Jan 2016 00:35:53 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BE951839; Wed, 6 Jan 2016 00:35:53 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:63646 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aGTlb-000M9T-5E; Tue, 05 Jan 2016 07:43:23 -0800 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293227 - head/etc From: Devin Teske In-Reply-To: <1452040072.1320.49.camel@freebsd.org> Date: Tue, 5 Jan 2016 16:35:53 -0800 Cc: Allan Jude , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Message-Id: <19DAF4A2-00E8-41D5-9DB5-65854DF5D58A@freebsd.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> <568C5D49.9090502@freebsd.org> <1452040072.1320.49.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:35:53 -0000 > On Jan 5, 2016, at 4:27 PM, Ian Lepore wrote: > > On Tue, 2016-01-05 at 19:18 -0500, Allan Jude wrote: >> On 2016-01-05 19:16, Devin Teske wrote: >>> >>>> On Jan 5, 2016, at 4:00 PM, Ian Lepore wrote: >>>> >>>> On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: >>>>> Author: imp >>>>> Date: Tue Jan 5 21:20:47 2016 >>>>> New Revision: 293227 >>>>> URL: https://svnweb.freebsd.org/changeset/base/293227 >>>>> >>>>> Log: >>>>> Use the more proper -f. Leave /bin/rm in place since that's >>>>> what >>>>> other rc scripts have, though it isn't strictly necessary. >>>>> >>>>> Modified: >>>>> head/etc/rc >>>>> >>>>> Modified: head/etc/rc >>>>> =============================================================== >>>>> ====== >>>>> ========= >>>>> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226 >>>>> ) >>>>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227 >>>>> ) >>>>> @@ -132,9 +132,9 @@ done >>>>> # Remove the firstboot sentinel, and reboot if it was >>>>> requested. >>>>> if [ -e ${firstboot_sentinel} ]; then >>>>> [ ${root_rw_mount} = "yes" ] || mount -uw / >>>>> - /bin/rm ${firstboot_sentinel} >>>>> + /bin/rm -f ${firstboot_sentinel} >>>>> if [ -e ${firstboot_sentinel}-reboot ]; then >>>>> - /bin/rm ${firstboot_sentinel}-reboot >>>>> + /bin/rm -f ${firstboot_sentinel}-reboot >>>>> [ ${root_rw_mount} = "yes" ] || mount -ur / >>>>> kill -INT 1 >>>>> fi >>>>> >>>> >>>> Using rm -f to suppress an error message seems like a bad idea >>>> here -- >>>> if the sentinel file can't be removed that implies it's going to >>>> do >>>> firstboot behavior every time it boots, and that's the sort of >>>> error >>>> that should be in-your-face. Especially on the reboot one >>>> because >>>> you're going to be stuck in a reboot loop with no error message. >>>> >>> >>> Leaving off -f so that the user gets prompted isn't quite as >>> helpful >>> as, say, using -f but then testing to make sure the file is really >>> gone >>> (if it still exists after a silent "rm -f", put up an informative >>> warning >>> instead of asking the user if they would like to delete it). >>> >>> The end-result of having something thrown in your face seems >>> desirable. Having a prompt that asks you if you'd like to delete it >>> (even if there is an error immediately above it explaining it could >>> not be deleted) seems nonsensical. >>> >> >> More specifically, firstboot is most likely run in situations where >> no >> one will be at the console, so an interactive prompt stopping the >> system >> from coming up is bad. >> > > I couldn't possibly disagree more. If you're not paying attention to > what happens the first time you boot a freshly installed system, you > deserve whatever happens to you. What if you are in New York and the server is alone in Siberia? ... Got SSH? (not if your boot stopped, you don't) -- Devin From owner-svn-src-all@freebsd.org Wed Jan 6 01:18:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7197A6376C for ; Wed, 6 Jan 2016 01:18:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3C481D4D for ; Wed, 6 Jan 2016 01:18:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 6 Jan 2016 01:19:01 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id u061IQnG002478; Tue, 5 Jan 2016 18:18:26 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452043106.1320.52.camel@freebsd.org> Subject: Re: svn commit: r293227 - head/etc From: Ian Lepore To: Devin Teske Cc: Allan Jude , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 05 Jan 2016 18:18:26 -0700 In-Reply-To: <19DAF4A2-00E8-41D5-9DB5-65854DF5D58A@freebsd.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> <568C5D49.9090502@freebsd.org> <1452040072.1320.49.camel@freebsd.org> <19DAF4A2-00E8-41D5-9DB5-65854DF5D58A@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 01:18:30 -0000 On Tue, 2016-01-05 at 16:35 -0800, Devin Teske wrote: > > On Jan 5, 2016, at 4:27 PM, Ian Lepore wrote: > > > > On Tue, 2016-01-05 at 19:18 -0500, Allan Jude wrote: > > > On 2016-01-05 19:16, Devin Teske wrote: > > > > > > > > > On Jan 5, 2016, at 4:00 PM, Ian Lepore > > > > > wrote: > > > > > > > > > > On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: > > > > > > Author: imp > > > > > > Date: Tue Jan 5 21:20:47 2016 > > > > > > New Revision: 293227 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/293227 > > > > > > > > > > > > Log: > > > > > > Use the more proper -f. Leave /bin/rm in place since > > > > > > that's > > > > > > what > > > > > > other rc scripts have, though it isn't strictly necessary. > > > > > > > > > > > > Modified: > > > > > > head/etc/rc > > > > > > > > > > > > Modified: head/etc/rc > > > > > > =========================================================== > > > > > > ==== > > > > > > ====== > > > > > > ========= > > > > > > --- head/etc/rc Tue Jan 5 21:20:46 2016 (r29 > > > > > > 3226 > > > > > > ) > > > > > > +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r29 > > > > > > 3227 > > > > > > ) > > > > > > @@ -132,9 +132,9 @@ done > > > > > > # Remove the firstboot sentinel, and reboot if it was > > > > > > requested. > > > > > > if [ -e ${firstboot_sentinel} ]; then > > > > > > [ ${root_rw_mount} = "yes" ] || mount -uw / > > > > > > - /bin/rm ${firstboot_sentinel} > > > > > > + /bin/rm -f ${firstboot_sentinel} > > > > > > if [ -e ${firstboot_sentinel}-reboot ]; then > > > > > > - /bin/rm ${firstboot_sentinel}-reboot > > > > > > + /bin/rm -f ${firstboot_sentinel}-reboot > > > > > > [ ${root_rw_mount} = "yes" ] || mount -ur / > > > > > > kill -INT 1 > > > > > > fi > > > > > > > > > > > > > > > > Using rm -f to suppress an error message seems like a bad > > > > > idea > > > > > here -- > > > > > if the sentinel file can't be removed that implies it's going > > > > > to > > > > > do > > > > > firstboot behavior every time it boots, and that's the sort > > > > > of > > > > > error > > > > > that should be in-your-face. Especially on the reboot one > > > > > because > > > > > you're going to be stuck in a reboot loop with no error > > > > > message. > > > > > > > > > > > > > Leaving off -f so that the user gets prompted isn't quite as > > > > helpful > > > > as, say, using -f but then testing to make sure the file is > > > > really > > > > gone > > > > (if it still exists after a silent "rm -f", put up an > > > > informative > > > > warning > > > > instead of asking the user if they would like to delete it). > > > > > > > > The end-result of having something thrown in your face seems > > > > desirable. Having a prompt that asks you if you'd like to > > > > delete it > > > > (even if there is an error immediately above it explaining it > > > > could > > > > not be deleted) seems nonsensical. > > > > > > > > > > More specifically, firstboot is most likely run in situations > > > where > > > no > > > one will be at the console, so an interactive prompt stopping the > > > system > > > from coming up is bad. > > > > > > > I couldn't possibly disagree more. If you're not paying attention > > to > > what happens the first time you boot a freshly installed system, > > you > > deserve whatever happens to you. > > What if you are in New York and the server is alone in Siberia? > > ... Got SSH? (not if your boot stopped, you don't) Unh huh. And what are you going to do when the server goes unresponsive because it silently failed to delete firstboot-reboot and now it's just in an endless reboot loop? Silent failure is only a viable option for expected errors you can recover from without intervention. -- Ian From owner-svn-src-all@freebsd.org Wed Jan 6 01:48:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8666AA631A9; Wed, 6 Jan 2016 01:48:57 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 741821D68; Wed, 6 Jan 2016 01:48:57 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:53910 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aGUuJ-000OUS-1n; Tue, 05 Jan 2016 08:56:27 -0800 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293227 - head/etc From: Devin Teske In-Reply-To: <1452043106.1320.52.camel@freebsd.org> Date: Tue, 5 Jan 2016 17:48:55 -0800 Cc: Allan Jude , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Message-Id: References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> <568C5D49.9090502@freebsd.org> <1452040072.1320.49.camel@freebsd.org> <19DAF4A2-00E8-41D5-9DB5-65854DF5D58A@freebsd.org> <1452043106.1320.52.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 01:48:57 -0000 > On Jan 5, 2016, at 5:18 PM, Ian Lepore wrote: >=20 > On Tue, 2016-01-05 at 16:35 -0800, Devin Teske wrote: >>> On Jan 5, 2016, at 4:27 PM, Ian Lepore wrote: >>>=20 >>> On Tue, 2016-01-05 at 19:18 -0500, Allan Jude wrote: >>>> On 2016-01-05 19:16, Devin Teske wrote: >>>>>=20 >>>>>> On Jan 5, 2016, at 4:00 PM, Ian Lepore >>>>>> wrote: >>>>>>=20 >>>>>> On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: >>>>>>> Author: imp >>>>>>> Date: Tue Jan 5 21:20:47 2016 >>>>>>> New Revision: 293227 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/293227 >>>>>>>=20 >>>>>>> Log: >>>>>>> Use the more proper -f. Leave /bin/rm in place since >>>>>>> that's >>>>>>> what >>>>>>> other rc scripts have, though it isn't strictly necessary. >>>>>>>=20 >>>>>>> Modified: >>>>>>> head/etc/rc >>>>>>>=20 >>>>>>> Modified: head/etc/rc >>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=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/etc/rc Tue Jan 5 21:20:46 2016 (r29 >>>>>>> 3226 >>>>>>> ) >>>>>>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r29 >>>>>>> 3227 >>>>>>> ) >>>>>>> @@ -132,9 +132,9 @@ done >>>>>>> # Remove the firstboot sentinel, and reboot if it was >>>>>>> requested. >>>>>>> if [ -e ${firstboot_sentinel} ]; then >>>>>>> [ ${root_rw_mount} =3D "yes" ] || mount -uw / >>>>>>> - /bin/rm ${firstboot_sentinel} >>>>>>> + /bin/rm -f ${firstboot_sentinel} >>>>>>> if [ -e ${firstboot_sentinel}-reboot ]; then >>>>>>> - /bin/rm ${firstboot_sentinel}-reboot >>>>>>> + /bin/rm -f ${firstboot_sentinel}-reboot >>>>>>> [ ${root_rw_mount} =3D "yes" ] || mount -ur / >>>>>>> kill -INT 1 >>>>>>> fi >>>>>>>=20 >>>>>>=20 >>>>>> Using rm -f to suppress an error message seems like a bad >>>>>> idea >>>>>> here -- >>>>>> if the sentinel file can't be removed that implies it's going >>>>>> to >>>>>> do >>>>>> firstboot behavior every time it boots, and that's the sort >>>>>> of >>>>>> error >>>>>> that should be in-your-face. Especially on the reboot one >>>>>> because >>>>>> you're going to be stuck in a reboot loop with no error >>>>>> message. >>>>>>=20 >>>>>=20 >>>>> Leaving off -f so that the user gets prompted isn't quite as >>>>> helpful >>>>> as, say, using -f but then testing to make sure the file is >>>>> really >>>>> gone >>>>> (if it still exists after a silent "rm -f", put up an >>>>> informative >>>>> warning >>>>> instead of asking the user if they would like to delete it). >>>>>=20 >>>>> The end-result of having something thrown in your face seems >>>>> desirable. Having a prompt that asks you if you'd like to >>>>> delete it >>>>> (even if there is an error immediately above it explaining it >>>>> could >>>>> not be deleted) seems nonsensical. >>>>>=20 >>>>=20 >>>> More specifically, firstboot is most likely run in situations >>>> where >>>> no=20 >>>> one will be at the console, so an interactive prompt stopping the >>>> system=20 >>>> from coming up is bad. >>>>=20 >>>=20 >>> I couldn't possibly disagree more. If you're not paying attention >>> to >>> what happens the first time you boot a freshly installed system, >>> you >>> deserve whatever happens to you. >>=20 >> What if you are in New York and the server is alone in Siberia? >>=20 >> ... Got SSH? (not if your boot stopped, you don't) >=20 > Unh huh. And what are you going to do when the server goes > unresponsive because it silently failed to delete firstboot-reboot and > now it's just in an endless reboot loop? >=20 > Silent failure is only a viable option for expected errors you can > recover from without intervention. >=20 Your point is valid. However, I think it unwise to rely on this: dteske@porridge wwwww $ rm foo override rw-rw-r-- dteske/dteske schg,uarch for foo? y rm: foo: Operation not permitted As you can see above, the prompt put forth by rm really has nothing to = do with "failure" but rather it has performed a cursory check and is = asking you if it is OK to proceed. The condition in which rm puts forth the prompt is _NOT_ the condition = in which you want to halt the boot process. You're absolutely right that we ought to prevent an infinite = reboot-cycle. Relying on rm to do it by not using "-f" is the wrong approach. This is the right approach: rm -f "${firstboot_sentinel}-reboot" if [ -e "${firstboot_sentinel}-reboot" ]; then read -p "Ruh roh; I smell an infinite reboot in your = future!" IGNORED fi (if lovable Scooby Doo had coded it) Funny error message aside, I earnestly think that's the approach we = should take. ... Quick note, should the code be updated to handle this: $ mkdir $firstboot_sentinel $ mkdir !$-reboot $ reboot This too: $ touch $firstboot_sentinel $ chflags schg !$ $ touch !$-reboot $ chflags schg !$ $ reboot Both of which would lead to infinite reboot cycle. --=20 Devin= From owner-svn-src-all@freebsd.org Wed Jan 6 02:48:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59677A6352A; Wed, 6 Jan 2016 02:48:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 237D91B81; Wed, 6 Jan 2016 02:48:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id CE3D11A3008; Wed, 6 Jan 2016 13:48:37 +1100 (AEDT) Date: Wed, 6 Jan 2016 13:48:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293227 - head/etc In-Reply-To: <1452038404.1320.46.camel@freebsd.org> Message-ID: <20160106125617.E968@besplex.bde.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=F8TLbMH91mOxZ-GJiaoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 02:48:46 -0000 On Tue, 5 Jan 2016, Ian Lepore wrote: >> Log: >> Use the more proper -f. Leave /bin/rm in place since that's what >> other rc scripts have, though it isn't strictly necessary. "proper -f" is hard to parse. I think you mean: Use 'rm -f' to turn off -i in case rm is broken and is an alias which has -i (and perhaps actually even something resembling rm) in it. More precisely, use 'rm -f /usr/bin' to partly defend against the same bug in /bin/rm (where it would be larger). Keep using /usr/rm instead of restoring the use of plain rm since that is what other rc scripts have. The previous change to use /bin/rm instead of plain rm was neither necessary nor sufficient for fixing the bug. Neither is this one, but it gets closer. It is a little-known bug in aliases that even absolute pathnames can be aliased. So /bin/rm might be aliased to 'rm -ri /'. Appending -f would accidentally help for that too, by turning it into a syntax error, instead of accidentally making it more forceful by turning -ri into -rf. Hopefully this is all FUD. Non-interactive scripts shouldn't source any files that are not mentioned in the script. /etc/rc depends on a secure environment being set up by init and probably gets it since init doesn't set up much. sh(1) documents closing the security hole of sourcing the script in $ENV for non-interactive shells, but was never a problem for /etc/rc since init must be trusted to not put security holes in $ENV. But users could put security holes in a sourced config file like /etc/rc.conf.local. >> Modified: head/etc/rc >> ===================================================================== >> ========= >> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) >> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) >> @@ -132,9 +132,9 @@ done >> # Remove the firstboot sentinel, and reboot if it was requested. >> if [ -e ${firstboot_sentinel} ]; then >> [ ${root_rw_mount} = "yes" ] || mount -uw / >> - /bin/rm ${firstboot_sentinel} >> + /bin/rm -f ${firstboot_sentinel} >> if [ -e ${firstboot_sentinel}-reboot ]; then >> - /bin/rm ${firstboot_sentinel}-reboot >> + /bin/rm -f ${firstboot_sentinel}-reboot >> [ ${root_rw_mount} = "yes" ] || mount -ur / >> kill -INT 1 >> fi > > Using rm -f to suppress an error message seems like a bad idea here -- > if the sentinel file can't be removed that implies it's going to do > firstboot behavior every time it boots, and that's the sort of error > that should be in-your-face. Especially on the reboot one because > you're going to be stuck in a reboot loop with no error message. Er, -f on rm only turns off -i and supresses the warning message for failing to remove nonexistent files. But we just tested that the file exists, and in the impossible even of a race making it not exist by the time that it runs, we have more problems than the failure of rm since we use the file's existence as a control for other things. So the only effect of this -f is to turn off -i, which can only be set if the FUD was justified. The correct fix seems to be 'unalias -a'. Bruce From owner-svn-src-all@freebsd.org Wed Jan 6 03:19:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C74DFA63EAE; Wed, 6 Jan 2016 03:19:12 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9C4F1EB8; Wed, 6 Jan 2016 03:19:12 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:54795 helo=[172.16.10.54]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aGWJe-0001Ma-0d; Tue, 05 Jan 2016 10:26:42 -0800 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable From: Devin Teske Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r293227 - head/etc Date: Tue, 5 Jan 2016 19:16:32 -0800 Message-Id: <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> Cc: Ian Lepore , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske In-Reply-To: <20160106125617.E968@besplex.bde.org> To: Bruce Evans X-Mailer: iPhone Mail (13C75) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 03:19:13 -0000 This e-mail is extremely hard to parse and I think you are mistaken. The -f flag is more than just a counter to a possible -i Try to rm a file that has schg You will get a prompt without -i Adding -f will abate the prompt to attempt override of schg flag. There are more conditions in rm that lead to a prompt than simply those cond= itions involving -i and adding -f abates them all. --=20 Devin > On Jan 5, 2016, at 6:48 PM, Bruce Evans wrote: >=20 > On Tue, 5 Jan 2016, Ian Lepore wrote: >=20 >>> Log: >>> Use the more proper -f. Leave /bin/rm in place since that's what >>> other rc scripts have, though it isn't strictly necessary. >=20 > "proper -f" is hard to parse. I think you mean: >=20 > Use 'rm -f' to turn off -i in case rm is broken and is an alias which > has -i (and perhaps actually even something resembling rm) in it. More > precisely, use 'rm -f /usr/bin' to partly defend against the same bug > in /bin/rm (where it would be larger). Keep using /usr/rm instead of > restoring the use of plain rm since that is what other rc scripts have. > The previous change to use /bin/rm instead of plain rm was neither > necessary nor sufficient for fixing the bug. Neither is this one, but > it gets closer. It is a little-known bug in aliases that even absolute > pathnames can be aliased. So /bin/rm might be aliased to 'rm -ri /'. > Appending -f would accidentally help for that too, by turning it into > a syntax error, instead of accidentally making it more forceful by > turning -ri into -rf. >=20 > Hopefully this is all FUD. Non-interactive scripts shouldn't source any > files that are not mentioned in the script. /etc/rc depends on a secure > environment being set up by init and probably gets it since init doesn't > set up much. sh(1) documents closing the security hole of sourcing the > script in $ENV for non-interactive shells, but was never a problem for > /etc/rc since init must be trusted to not put security holes in $ENV. > But users could put security holes in a sourced config file like > /etc/rc.conf.local. >=20 >>> Modified: head/etc/rc >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/etc/rc Tue Jan 5 21:20:46 2016 (r293226) >>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) >>> @@ -132,9 +132,9 @@ done >>> # Remove the firstboot sentinel, and reboot if it was requested. >>> if [ -e ${firstboot_sentinel} ]; then >>> [ ${root_rw_mount} =3D "yes" ] || mount -uw / >>> - /bin/rm ${firstboot_sentinel} >>> + /bin/rm -f ${firstboot_sentinel} >>> if [ -e ${firstboot_sentinel}-reboot ]; then >>> - /bin/rm ${firstboot_sentinel}-reboot >>> + /bin/rm -f ${firstboot_sentinel}-reboot >>> [ ${root_rw_mount} =3D "yes" ] || mount -ur / >>> kill -INT 1 >>> fi >>=20 >> Using rm -f to suppress an error message seems like a bad idea here -- >> if the sentinel file can't be removed that implies it's going to do >> firstboot behavior every time it boots, and that's the sort of error >> that should be in-your-face. Especially on the reboot one because >> you're going to be stuck in a reboot loop with no error message. >=20 > Er, -f on rm only turns off -i and supresses the warning message for > failing to remove nonexistent files. But we just tested that the file > exists, and in the impossible even of a race making it not exist by > the time that it runs, we have more problems than the failure of rm > since we use the file's existence as a control for other things. >=20 > So the only effect of this -f is to turn off -i, which can only be set > if the FUD was justified. >=20 > The correct fix seems to be 'unalias -a'. >=20 > Bruce >=20 From owner-svn-src-all@freebsd.org Wed Jan 6 03:21:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 450B5A63F56; Wed, 6 Jan 2016 03:21:38 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 22B2E11BE; Wed, 6 Jan 2016 03:21:37 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 23C1CD082; Wed, 6 Jan 2016 03:21:36 +0000 (UTC) Subject: Re: svn commit: r293227 - head/etc To: Devin Teske , Bruce Evans References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> Cc: Ian Lepore , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske From: Allan Jude Message-ID: <568C883C.5050006@freebsd.org> Date: Tue, 5 Jan 2016 22:21:32 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m5L3ieEH5FU8s8RU5N9QKFcgohTotomt9" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 03:21:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m5L3ieEH5FU8s8RU5N9QKFcgohTotomt9 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-01-05 22:16, Devin Teske wrote: > This e-mail is extremely hard to parse and I think you are mistaken. >=20 > The -f flag is more than just a counter to a possible -i >=20 > Try to rm a file that has schg > You will get a prompt without -i > Adding -f will abate the prompt to attempt override of schg flag. >=20 > There are more conditions in rm that lead to a prompt than simply those= conditions involving -i and adding -f abates them all. >=20 I think this is kind of a poor UI design of rm(1) honestly. It seems like what we need is a 'never be interactive' flag, that won't surpress the error message about the schg'd file, or read-only file system, but won't try to prompt for it. Although adding a new flag to rm(1) at this point probably doesn't make sense. --=20 Allan Jude --m5L3ieEH5FU8s8RU5N9QKFcgohTotomt9 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.22 (MingW32) iQIcBAEBAgAGBQJWjIg/AAoJEBmVNT4SmAt+9wgP/0ZK2iSoqxqII/vzDgKGGaMN +T6CAyTfQBv35krGOUh/0yOEzbkSalBrc2lWYgnc2VEtTyGs860bELynEXz2viMq pqyKK1wnC+QJEbJd/rfZYpVIvtXQISNLEyWXxHlaXlrLdNTJCFGQS5jievuXZrnf CnpCQ7djEGxu6xFrgUtyF0nJ/VeUHIfi8ab91mWg6bOWtV57YMAsWTC9AFGjLT4/ swV9YFEtu5eHbhiM5nqbPuT8NcUPBuWE8ad9US19kM2me0gYQPTTwsjZ1OJf4/2r zQBj9wcn8R3z/8GSoBEDbuW3NCpHrAIw5deB6LoUxP03AYA6Ozynv9ghu0JRr05s A7wrsA98VPCyIzEf/Nhu5YWNc2y91gE8bMJK/N90MDRAOxj0Fx8nsBK+sXoJ5T4c Q++XYRwTUiI3+7e9cBDiSEjJKVmbtLv7aTVS5VyVNWmNkUV5lwuHUst0+0dwhxzN zxqwmC2epxTNZ2SUjlvWZfp/npLk5yJtyL2TZR0441TKmaC8YYRTimMr0LcVzCRD TpxylF7Hx0Jis547EGUOEsgy6HwnTn3E3mBh56m+KVSrX8S3/3FGuf2qUnE8makG gMnPHgv90pva6PiT+juFmb0IeXhleS5N8yMM9dPkh8HIFHK8BwTeGhaovMuMR1Nl BqGu26uz5pk7u1kyyW84 =kgWr -----END PGP SIGNATURE----- --m5L3ieEH5FU8s8RU5N9QKFcgohTotomt9-- From owner-svn-src-all@freebsd.org Wed Jan 6 04:09:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F5FDA6497A for ; Wed, 6 Jan 2016 04:09:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22c.google.com (mail-qg0-x22c.google.com [IPv6:2607:f8b0:400d:c04::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1CCE185B for ; Wed, 6 Jan 2016 04:09:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22c.google.com with SMTP id 6so216546873qgy.1 for ; Tue, 05 Jan 2016 20:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=n/rDpO9XPbLTcNBXluthFTzsTTCCquKp1WjQgDl6hWM=; b=glOhL0uMtamtW3aTwSh3E20z/mFf/XXZM3nD8HRub76G/IkjfGTEu9I9FgK90MHb8P ZN5nrVbbJ8Q005O4L2rv0PSGnR4NlHT2V295MCi8IVWrb+ER4hL6LvTjZkYDIY3uI9zf GASJPzFHzKxZeZUnEZbY3Gu3AMnyNaekaPGnEip8FiFt8OzvKQkHutsYM+dNuSoSYf06 mvfcHXcS6Ex7pBVKZWAo39EyZnOLYBvueM3KMWAtthd6zq3Rk7jFywmV81cXpz/iwwtB /7Hu9B7dhCkMTnTwfNb5dpeTyq6WI+zRKVETId0TapMDjIOU7Pr9WSm4erznXMZ2ek3K An3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=n/rDpO9XPbLTcNBXluthFTzsTTCCquKp1WjQgDl6hWM=; b=LqpWN62b1GqY2D1yz0XX944/nkXbKpsrT92xBPeHTFt3y1BBivUWK6OJ6AVYsWflop AwYbyTOjtyK6ZPh0qaATbX6Ru9u+IWJCKQBn2PVRLMupPVDvMJH+U/C4mQlyOjYg7FTc Od1V2mu4GD9njccXZImEED6ap2QFlH2gfkB/PEaYaUCdoU8dxcpR4NxvzAnufizgC80L 7FVlrQNkW6dj6Zw+5ZeyjXaxvu55jP+OyvocFUnaMFTHI9jG5WcwqdE16flaWCN8ReLJ Y7qp1gGJ9zbei2L1BsqEtMNgwH7dagTZrExr2NIJYEVwzwXKJDRsAT2yzrDwdFTAi/RD ySyw== X-Gm-Message-State: ALoCoQmjK3izoKQEudwJSkNonScywEYA2bwf7WEIk7IHcqynrgw4pcnKeMFgoMjcqeKXjzdsVAbymjEOvccoZe1PQKR+UueOSg== MIME-Version: 1.0 X-Received: by 10.140.109.247 with SMTP id l110mr70660799qgf.52.1452053351666; Tue, 05 Jan 2016 20:09:11 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Tue, 5 Jan 2016 20:09:11 -0800 (PST) X-Originating-IP: [2601:280:4900:3700:e564:ecab:50db:6e5f] In-Reply-To: <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> Date: Tue, 5 Jan 2016 21:09:11 -0700 X-Google-Sender-Auth: OHf0O02Uwt76UJBZzBKHXa5DDVY Message-ID: Subject: Re: svn commit: r293227 - head/etc From: Warner Losh To: Devin Teske Cc: Bruce Evans , Ian Lepore , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Devin Teske Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 04:09:13 -0000 The correct fix is chflags -R 0 firstboot rm -rf firstboot If you still can't remove it, too bad. Checking to make sure it worked really isn't the unix way. Sometimes when you do stupid things, stupid results happen. Warner On Tue, Jan 5, 2016 at 8:16 PM, Devin Teske wrote: > This e-mail is extremely hard to parse and I think you are mistaken. > > The -f flag is more than just a counter to a possible -i > > Try to rm a file that has schg > You will get a prompt without -i > Adding -f will abate the prompt to attempt override of schg flag. > > There are more conditions in rm that lead to a prompt than simply those > conditions involving -i and adding -f abates them all. > > -- > Devin > > > On Jan 5, 2016, at 6:48 PM, Bruce Evans wrote: > > > > On Tue, 5 Jan 2016, Ian Lepore wrote: > > > >>> Log: > >>> Use the more proper -f. Leave /bin/rm in place since that's what > >>> other rc scripts have, though it isn't strictly necessary. > > > > "proper -f" is hard to parse. I think you mean: > > > > Use 'rm -f' to turn off -i in case rm is broken and is an alias which > > has -i (and perhaps actually even something resembling rm) in it. More > > precisely, use 'rm -f /usr/bin' to partly defend against the same bug > > in /bin/rm (where it would be larger). Keep using /usr/rm instead of > > restoring the use of plain rm since that is what other rc scripts have. > > The previous change to use /bin/rm instead of plain rm was neither > > necessary nor sufficient for fixing the bug. Neither is this one, but > > it gets closer. It is a little-known bug in aliases that even absolute > > pathnames can be aliased. So /bin/rm might be aliased to 'rm -ri /'. > > Appending -f would accidentally help for that too, by turning it into > > a syntax error, instead of accidentally making it more forceful by > > turning -ri into -rf. > > > > Hopefully this is all FUD. Non-interactive scripts shouldn't source any > > files that are not mentioned in the script. /etc/rc depends on a secure > > environment being set up by init and probably gets it since init doesn't > > set up much. sh(1) documents closing the security hole of sourcing the > > script in $ENV for non-interactive shells, but was never a problem for > > /etc/rc since init must be trusted to not put security holes in $ENV. > > But users could put security holes in a sourced config file like > > /etc/rc.conf.local. > > > >>> Modified: head/etc/rc > >>> ===================================================================== > >>> ========= > >>> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) > >>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) > >>> @@ -132,9 +132,9 @@ done > >>> # Remove the firstboot sentinel, and reboot if it was requested. > >>> if [ -e ${firstboot_sentinel} ]; then > >>> [ ${root_rw_mount} = "yes" ] || mount -uw / > >>> - /bin/rm ${firstboot_sentinel} > >>> + /bin/rm -f ${firstboot_sentinel} > >>> if [ -e ${firstboot_sentinel}-reboot ]; then > >>> - /bin/rm ${firstboot_sentinel}-reboot > >>> + /bin/rm -f ${firstboot_sentinel}-reboot > >>> [ ${root_rw_mount} = "yes" ] || mount -ur / > >>> kill -INT 1 > >>> fi > >> > >> Using rm -f to suppress an error message seems like a bad idea here -- > >> if the sentinel file can't be removed that implies it's going to do > >> firstboot behavior every time it boots, and that's the sort of error > >> that should be in-your-face. Especially on the reboot one because > >> you're going to be stuck in a reboot loop with no error message. > > > > Er, -f on rm only turns off -i and supresses the warning message for > > failing to remove nonexistent files. But we just tested that the file > > exists, and in the impossible even of a race making it not exist by > > the time that it runs, we have more problems than the failure of rm > > since we use the file's existence as a control for other things. > > > > So the only effect of this -f is to turn off -i, which can only be set > > if the FUD was justified. > > > > The correct fix seems to be 'unalias -a'. > > > > Bruce > > > From owner-svn-src-all@freebsd.org Wed Jan 6 05:12:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C6EDA638AB; Wed, 6 Jan 2016 05:12:43 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 892801158; Wed, 6 Jan 2016 05:12:43 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=54947 helo=[10.0.0.108]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aGY5U-0004u8-UY; Tue, 05 Jan 2016 12:20:13 -0800 From: Devin Teske Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r293227 - head/etc Date: Tue, 5 Jan 2016 21:10:52 -0800 Message-Id: References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> Cc: Bruce Evans , Ian Lepore , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Devin Teske In-Reply-To: To: Warner Losh X-Mailer: iPhone Mail (13C75) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 05:12:43 -0000 > On Jan 5, 2016, at 8:09 PM, Warner Losh wrote: >=20 > The correct fix is >=20 > > chflags -R 0 firstboot > rm -rf firstboot > >=20 > If you still can't remove it, too bad. Checking to make sure it worked rea= lly isn't > the unix way. Sometimes when you do stupid things, stupid results happen. >=20 You forgot to drop the mic and walk out. Looks good to me. --=20 Devin > Warner >=20 >> On Tue, Jan 5, 2016 at 8:16 PM, Devin Teske wrote: >> This e-mail is extremely hard to parse and I think you are mistaken. >>=20 >> The -f flag is more than just a counter to a possible -i >>=20 >> Try to rm a file that has schg >> You will get a prompt without -i >> Adding -f will abate the prompt to attempt override of schg flag. >>=20 >> There are more conditions in rm that lead to a prompt than simply those c= onditions involving -i and adding -f abates them all. >>=20 >> -- >> Devin >>=20 >> > On Jan 5, 2016, at 6:48 PM, Bruce Evans wrote: >> > >> > On Tue, 5 Jan 2016, Ian Lepore wrote: >> > >> >>> Log: >> >>> Use the more proper -f. Leave /bin/rm in place since that's what >> >>> other rc scripts have, though it isn't strictly necessary. >> > >> > "proper -f" is hard to parse. I think you mean: >> > >> > Use 'rm -f' to turn off -i in case rm is broken and is an alias which >> > has -i (and perhaps actually even something resembling rm) in it. More= >> > precisely, use 'rm -f /usr/bin' to partly defend against the same bug >> > in /bin/rm (where it would be larger). Keep using /usr/rm instead of >> > restoring the use of plain rm since that is what other rc scripts have.= >> > The previous change to use /bin/rm instead of plain rm was neither >> > necessary nor sufficient for fixing the bug. Neither is this one, but >> > it gets closer. It is a little-known bug in aliases that even absolute= >> > pathnames can be aliased. So /bin/rm might be aliased to 'rm -ri /'. >> > Appending -f would accidentally help for that too, by turning it into >> > a syntax error, instead of accidentally making it more forceful by >> > turning -ri into -rf. >> > >> > Hopefully this is all FUD. Non-interactive scripts shouldn't source an= y >> > files that are not mentioned in the script. /etc/rc depends on a secur= e >> > environment being set up by init and probably gets it since init doesn'= t >> > set up much. sh(1) documents closing the security hole of sourcing the= >> > script in $ENV for non-interactive shells, but was never a problem for >> > /etc/rc since init must be trusted to not put security holes in $ENV. >> > But users could put security holes in a sourced config file like >> > /etc/rc.conf.local. >> > >> >>> Modified: head/etc/rc >> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/rc Tue Jan 5 21:20:46 2016 (r293226) >> >>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) >> >>> @@ -132,9 +132,9 @@ done >> >>> # Remove the firstboot sentinel, and reboot if it was requested. >> >>> if [ -e ${firstboot_sentinel} ]; then >> >>> [ ${root_rw_mount} =3D "yes" ] || mount -uw / >> >>> - /bin/rm ${firstboot_sentinel} >> >>> + /bin/rm -f ${firstboot_sentinel} >> >>> if [ -e ${firstboot_sentinel}-reboot ]; then >> >>> - /bin/rm ${firstboot_sentinel}-reboot >> >>> + /bin/rm -f ${firstboot_sentinel}-reboot >> >>> [ ${root_rw_mount} =3D "yes" ] || mount -ur / >> >>> kill -INT 1 >> >>> fi >> >> >> >> Using rm -f to suppress an error message seems like a bad idea here --= >> >> if the sentinel file can't be removed that implies it's going to do >> >> firstboot behavior every time it boots, and that's the sort of error >> >> that should be in-your-face. Especially on the reboot one because >> >> you're going to be stuck in a reboot loop with no error message. >> > >> > Er, -f on rm only turns off -i and supresses the warning message for >> > failing to remove nonexistent files. But we just tested that the file >> > exists, and in the impossible even of a race making it not exist by >> > the time that it runs, we have more problems than the failure of rm >> > since we use the file's existence as a control for other things. >> > >> > So the only effect of this -f is to turn off -i, which can only be set >> > if the FUD was justified. >> > >> > The correct fix seems to be 'unalias -a'. >> > >> > Bruce >> > >=20 From owner-svn-src-all@freebsd.org Wed Jan 6 05:23:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88E71A64B49; Wed, 6 Jan 2016 05:23:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 583F21C43; Wed, 6 Jan 2016 05:23:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u065NPFY021089; Wed, 6 Jan 2016 05:23:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u065NPLQ021088; Wed, 6 Jan 2016 05:23:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601060523.u065NPLQ021088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 6 Jan 2016 05:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293231 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 05:23:26 -0000 Author: gjb Date: Wed Jan 6 05:23:25 2016 New Revision: 293231 URL: https://svnweb.freebsd.org/changeset/base/293231 Log: Add a new target to touch the ${.OBJDIR}/release file, which indicates the 'release' target has run (in order to prevent subsequent invocations that may clobber original build output). As is, the 'release' target is a dummy target that does nothing more than depend on subsequent targets. Unless 'make obj' is invoked prior to 'make release', .OBJDIR and .CURDIR will always be '/usr/src/release' (or wherever /usr/src is located). When 'make release' invokes 'make real-release' (and subsequent targets), .OBJDIR is not updated, which still leads to src/ tree pollution. While arguably a hack, 'make release' will invoke the original dummy targets as originally intended, but instead of touching an empty file (or returing @true), will call a 'release-done' target that will trigger the behavior that was intended to prevent a subsequent invocation. Discussed with: hrs MFC after: 3 days X-MFC-With: r293173 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Wed Jan 6 00:52:55 2016 (r293230) +++ head/release/Makefile Wed Jan 6 05:23:25 2016 (r293231) @@ -281,7 +281,11 @@ ftp: packagesystem cp *.txz MANIFEST ftp release: real-release vm-release cloudware-release - touch ${.OBJDIR}/${.TARGET} + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} release-done + true + +release-done: + touch release real-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj From owner-svn-src-all@freebsd.org Wed Jan 6 07:03:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BEF3A6418C; Wed, 6 Jan 2016 07:03:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 606A219E3; Wed, 6 Jan 2016 07:03:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 991BE784CAF; Wed, 6 Jan 2016 17:40:17 +1100 (AEDT) Date: Wed, 6 Jan 2016 17:40:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Allan Jude cc: Devin Teske , Bruce Evans , Ian Lepore , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Subject: Re: svn commit: r293227 - head/etc In-Reply-To: <568C883C.5050006@freebsd.org> Message-ID: <20160106163237.L1563@besplex.bde.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> <568C883C.5050006@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=_9Kpg5vkrs-okR2GLKYA:9 a=-uQxRxpSkNZysZvc:21 a=Gk-SUihwnLnGPLte:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 07:03:18 -0000 On Tue, 5 Jan 2016, Allan Jude wrote: > On 2016-01-05 22:16, Devin Teske wrote: >> This e-mail is extremely hard to parse and I think you are mistaken. >> >> The -f flag is more than just a counter to a possible -i >> >> Try to rm a file that has schg >> You will get a prompt without -i >> Adding -f will abate the prompt to attempt override of schg flag. I forgot about the permissions check. Normally root has permission to write anything, but some file flags change this. The schg flag is handled bogusly: rm prompts without -f, but schg prevents removal if you answer 'y'. The uchg flag is handled better. rm has special undocumented code to handle it, mainly so that rm -rf blows it away. Without -f, rm prompts but the the special code removes uchg so that removal is possible. The permissions check only applies to the file. Removal doesn't depend on the file's permissions. It only depends on the file's flags and the directory's permissions and flags. rm agrees with its man page and doesn't prompt if the file is writable but the directory is unwritable. The directory permissions don't stop root either, but immutable directories do. Since there is no prompt, -f has no effect on anyone in this case. >> There are more conditions in rm that lead to a prompt than simply those conditions involving -i and adding -f abates them all. It isn't clear what these are. POSIX only says that there is a prompt without -i for files which don't have write permission (to themselves). FreeBSD's man page should say more about how this extended for file flags, but actually says nothing for file flags and is less clear than POSIX for ordinary permissions. > I think this is kind of a poor UI design of rm(1) honestly. It seems > like what we need is a 'never be interactive' flag, that won't surpress > the error message about the schg'd file, or read-only file system, but > won't try to prompt for it. > > Although adding a new flag to rm(1) at this point probably doesn't make > sense. It already has this flag, namely -f. This is what I started out to say. -f never suppresses errors except ENOENT for a non-existent file. What it suppresses is prompts. Since the uchg hack involves a prompt, -f also changes the semantics for removing user-immutable files. The file flags hack includes uappnd together with uchg, but not the newfangled uunlnk. That has only been available for annoying sysadmins since 1997. Apparently its name is to confusing for it to be used. Bruce From owner-svn-src-all@freebsd.org Wed Jan 6 09:56:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2186BA6514C; Wed, 6 Jan 2016 09:56:08 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D55B710D3; Wed, 6 Jan 2016 09:56:07 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u069u64N000755; Wed, 6 Jan 2016 09:56:06 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u069u6Yw000753; Wed, 6 Jan 2016 09:56:06 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601060956.u069u6Yw000753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 6 Jan 2016 09:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293232 - stable/10/sbin/reboot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 09:56:08 -0000 Author: smh Date: Wed Jan 6 09:56:06 2016 New Revision: 293232 URL: https://svnweb.freebsd.org/changeset/base/293232 Log: MFC: r292266 & r292947 Add flag to disable inital reboot(8) userland sync Sponsored by: Multiplay Modified: stable/10/sbin/reboot/reboot.8 stable/10/sbin/reboot/reboot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/reboot/reboot.8 ============================================================================== --- stable/10/sbin/reboot/reboot.8 Wed Jan 6 05:23:25 2016 (r293231) +++ stable/10/sbin/reboot/reboot.8 Wed Jan 6 09:56:06 2016 (r293232) @@ -29,6 +29,7 @@ .\" $FreeBSD$ .\" .Dd October 11, 2010 +.Dd Jan 06, 2016 .Dt REBOOT 8 .Os .Sh NAME @@ -39,16 +40,16 @@ .Nd stopping and restarting the system .Sh SYNOPSIS .Nm halt -.Op Fl lnpq +.Op Fl lNnpq .Op Fl k Ar kernel .Nm -.Op Fl dlnpq +.Op Fl dlNnpq .Op Fl k Ar kernel .Nm fasthalt -.Op Fl lnpq +.Op Fl lNnpq .Op Fl k Ar kernel .Nm fastboot -.Op Fl dlnpq +.Op Fl dlNnpq .Op Fl k Ar kernel .Sh DESCRIPTION The @@ -94,6 +95,16 @@ that call or .Nm halt and log this themselves. +.It Fl N +The file system cache is not flushed during the initial process clean-up, +however the kernel level +.Xr reboot 2 +is still processed with a sync. +This option can be useful for performing a +.Dq best-effort +reboot when devices might be unavailable. +This can happen when devices have been disconnected, such as with +.Xr iscsi 4 . .It Fl n The file system cache is not flushed. This option should probably not be used. Modified: stable/10/sbin/reboot/reboot.c ============================================================================== --- stable/10/sbin/reboot/reboot.c Wed Jan 6 05:23:25 2016 (r293231) +++ stable/10/sbin/reboot/reboot.c Wed Jan 6 09:56:06 2016 (r293232) @@ -67,7 +67,7 @@ main(int argc, char *argv[]) { struct utmpx utx; const struct passwd *pw; - int ch, howto, i, fd, lflag, nflag, qflag, sverrno; + int ch, howto, i, fd, lflag, nflag, qflag, sverrno, Nflag; u_int pageins; const char *user, *kernel = NULL; @@ -76,8 +76,8 @@ main(int argc, char *argv[]) howto = RB_HALT; } else howto = 0; - lflag = nflag = qflag = 0; - while ((ch = getopt(argc, argv, "dk:lnpq")) != -1) + lflag = nflag = qflag = Nflag = 0; + while ((ch = getopt(argc, argv, "dk:lNnpq")) != -1) switch(ch) { case 'd': howto |= RB_DUMP; @@ -92,6 +92,10 @@ main(int argc, char *argv[]) nflag = 1; howto |= RB_NOSYNC; break; + case 'N': + nflag = 1; + Nflag = 1; + break; case 'p': howto |= RB_POWEROFF; break; @@ -107,6 +111,8 @@ main(int argc, char *argv[]) if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); + if (Nflag && (howto & RB_NOSYNC) != 0) + errx(1, "-N cannot be used with -n"); if (geteuid()) { errno = EPERM; err(1, NULL); From owner-svn-src-all@freebsd.org Wed Jan 6 11:52:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5FD1A65242; Wed, 6 Jan 2016 11:52:41 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66FFA12A3; Wed, 6 Jan 2016 11:52:41 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aGmdi-000Adi-M2; Wed, 06 Jan 2016 14:52:30 +0300 Date: Wed, 6 Jan 2016 14:52:30 +0300 From: Slawa Olhovchenkov To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106115230.GJ70867@zxy.spb.ru> References: <201601052105.u05L5HLi071593@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601052105.u05L5HLi071593@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 11:52:41 -0000 On Tue, Jan 05, 2016 at 09:05:17PM +0000, Glen Barber wrote: > Author: gjb > Date: Tue Jan 5 21:05:17 2016 > New Revision: 293223 > URL: https://svnweb.freebsd.org/changeset/base/293223 > > Log: > Merge ^/projects/release-install-debug: > > - Rework MANIFEST generation and parsing via bsdinstall(8). > - Allow selecting debugging distribution sets during install. > - Rework bsdinstall(8) to fetch remote debug distribution sets > when they are not available on the local install medium. > - Allow selecting additional non-GENERIC kernels during install. > At present, GENERIC is still required, and installed by default. > > Tested with: head@r293203 > Sponsored by: The FreeBSD Foundation MFC planed? > Modified: > head/Makefile.inc1 > head/release/Makefile > head/release/amd64/mkisoimages.sh > head/release/i386/mkisoimages.sh > head/release/pc98/mkisoimages.sh > head/release/powerpc/mkisoimages.sh > head/release/scripts/make-manifest.sh > head/release/sparc64/mkisoimages.sh > head/usr.sbin/bsdinstall/scripts/auto > From owner-svn-src-all@freebsd.org Wed Jan 6 12:34:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D925A644C6; Wed, 6 Jan 2016 12:34:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA671770; Wed, 6 Jan 2016 12:34:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id D66471616; Wed, 6 Jan 2016 12:34:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 6 Jan 2016 12:34:29 +0000 From: Glen Barber To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106123429.GA26378@FreeBSD.org> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline In-Reply-To: <20160106115230.GJ70867@zxy.spb.ru> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 12:34:32 -0000 --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 06, 2016 at 02:52:30PM +0300, Slawa Olhovchenkov wrote: > On Tue, Jan 05, 2016 at 09:05:17PM +0000, Glen Barber wrote: >=20 > > Author: gjb > > Date: Tue Jan 5 21:05:17 2016 > > New Revision: 293223 > > URL: https://svnweb.freebsd.org/changeset/base/293223 > >=20 > > Log: > > Merge ^/projects/release-install-debug: > > =20 > > - Rework MANIFEST generation and parsing via bsdinstall(8). > > - Allow selecting debugging distribution sets during install. > > - Rework bsdinstall(8) to fetch remote debug distribution sets > > when they are not available on the local install medium. > > - Allow selecting additional non-GENERIC kernels during install. > > At present, GENERIC is still required, and installed by default. > > =20 > > Tested with: head@r293203 > > Sponsored by: The FreeBSD Foundation >=20 > MFC planed? >=20 Not before 10.3-RELEASE, no. Perhaps after that. Glen --envbJBWh7q8WU6mo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWjQnVAAoJEAMUWKVHj+KTEsMQAIHd1FWPeQPah+WkHt1NAWKY FzF5Cl8gXtVZu+kx/n/bzNj2M1DWFB+YlKXc0nf6Gghf8gehcrexr/EQCqBS7y4o Q1mnEJZdr0Ar+DNIpukofVbR6zB6uPNi4CD07pItnX040yh3xBxSqQxCgSUMhrMV cBDQV3HzKroMz2pQLGFs+68xdCDJoOM0whO8cI7vHgiRj8DFtN+svJvk/qRkwEhP /HnfqB9KaK7WEt9UfC7yQdgHi8R7Zj3QObGulyefwDTyy0bmIZ58baO1/5O9v8vL VDxddWy3mFkDC4dJnile2pB9gHCOY4z9RYTsl2D9L5RjkSO00JC2RAmp80A3/mIj hzkNAZktHVRHmn1UdpTa6x1m1ac5w5Q+VDt6MEEeB6uNh6jKyoT/ECpzb8Hp3AT8 fbjmElwjhyBcC7XTcOLVlyexNl4WXku+LrM6Ugoyj7GnPxAMtG0VhjGj4VphTD0+ GVTgvDHc5/jDwIgQNtll5XBpl7JPPetTJk3cxS9iukbhul7BnmTs1AtVuxCeZLyV K2EU5zrAg7mT/1KFBffn3BkHYxwLbXkltkMV/OwbfzwWJRxSi4TZPAKqV32wJjKE DQR1NJ0RpahhLw0aZLm5H3ep0x/Y25sks8xwgsudNH6BHGRZcaYA2eWDvssMglma 3Xbj3oZxaSLhIkqVE8h5 =MWO4 -----END PGP SIGNATURE----- --envbJBWh7q8WU6mo-- From owner-svn-src-all@freebsd.org Wed Jan 6 13:02:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3719A64F1D; Wed, 6 Jan 2016 13:02:18 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A356A17EB; Wed, 6 Jan 2016 13:02:18 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aGnjB-000C39-Pz; Wed, 06 Jan 2016 16:02:13 +0300 Date: Wed, 6 Jan 2016 16:02:13 +0300 From: Slawa Olhovchenkov To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106130213.GI4535@zxy.spb.ru> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> <20160106123429.GA26378@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160106123429.GA26378@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 13:02:19 -0000 On Wed, Jan 06, 2016 at 12:34:29PM +0000, Glen Barber wrote: > On Wed, Jan 06, 2016 at 02:52:30PM +0300, Slawa Olhovchenkov wrote: > > On Tue, Jan 05, 2016 at 09:05:17PM +0000, Glen Barber wrote: > > > > > Author: gjb > > > Date: Tue Jan 5 21:05:17 2016 > > > New Revision: 293223 > > > URL: https://svnweb.freebsd.org/changeset/base/293223 > > > > > > Log: > > > Merge ^/projects/release-install-debug: > > > > > > - Rework MANIFEST generation and parsing via bsdinstall(8). > > > - Allow selecting debugging distribution sets during install. > > > - Rework bsdinstall(8) to fetch remote debug distribution sets > > > when they are not available on the local install medium. > > > - Allow selecting additional non-GENERIC kernels during install. > > > At present, GENERIC is still required, and installed by default. > > > > > > Tested with: head@r293203 > > > Sponsored by: The FreeBSD Foundation > > > > MFC planed? > > > > Not before 10.3-RELEASE, no. Perhaps after that. Somehow not done? Can I use this as patch for custom intallation images? From owner-svn-src-all@freebsd.org Wed Jan 6 13:26:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A8F4A635F0; Wed, 6 Jan 2016 13:26:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 5A98A10C6; Wed, 6 Jan 2016 13:26:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id B36781213; Wed, 6 Jan 2016 13:26:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 6 Jan 2016 13:26:53 +0000 From: Glen Barber To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106132653.GC26378@FreeBSD.org> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> <20160106123429.GA26378@FreeBSD.org> <20160106130213.GI4535@zxy.spb.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sHrvAb52M6C8blB9" Content-Disposition: inline In-Reply-To: <20160106130213.GI4535@zxy.spb.ru> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 13:26:55 -0000 --sHrvAb52M6C8blB9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 06, 2016 at 04:02:13PM +0300, Slawa Olhovchenkov wrote: > On Wed, Jan 06, 2016 at 12:34:29PM +0000, Glen Barber wrote: >=20 > > On Wed, Jan 06, 2016 at 02:52:30PM +0300, Slawa Olhovchenkov wrote: > > > On Tue, Jan 05, 2016 at 09:05:17PM +0000, Glen Barber wrote: > > >=20 > > > > Author: gjb > > > > Date: Tue Jan 5 21:05:17 2016 > > > > New Revision: 293223 > > > > URL: https://svnweb.freebsd.org/changeset/base/293223 > > > >=20 > > > > Log: > > > > Merge ^/projects/release-install-debug: > > > > =20 > > > > - Rework MANIFEST generation and parsing via bsdinstall(8). > > > > - Allow selecting debugging distribution sets during install. > > > > - Rework bsdinstall(8) to fetch remote debug distribution sets > > > > when they are not available on the local install medium. > > > > - Allow selecting additional non-GENERIC kernels during install. > > > > At present, GENERIC is still required, and installed by default. > > > > =20 > > > > Tested with: head@r293203 > > > > Sponsored by: The FreeBSD Foundation > > >=20 > > > MFC planed? > > >=20 > >=20 > > Not before 10.3-RELEASE, no. Perhaps after that. >=20 > Somehow not done? I'm sorry, I do not understand what you mean. > Can I use this as patch for custom intallation images? >=20 It should mostly apply, yes. There are likely sharp edges, though, which is why I will not merge it before 10.3-RELEASE. Glen --sHrvAb52M6C8blB9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWjRYdAAoJEAMUWKVHj+KTmacP/je33EgpjZtpJ1gGE2k69j6S c1UMo582YGH063s7jFKGZhZEB/UCykQpN5JwDBWxvm6CZ7puaDNLwgfKRY0iwEAO yw3SJxYItQyUnNXnJYZDNWjUOWn6Dl/tlDjUq9YmJBtKoTfw3GmbcBRK7OgM2l9E 2f+ieimvbPMxMjSRnoDP/NvZT9Ex/lrbPF/NoI4OuYLYz4eV8rLCjoqP/hSKDnE8 kDS1TjX9nEbLBTGxzgmuxNszrdg9pzFKv0p2cHaTQJ8c4b1B45EAcRLlpuCGZxw0 bLrS45uVRc3jom619Dm1PfNDvi0KYr0N6y0N6GkUmuLx+f4DB+gixQUA0SQwOFWM iG7RAyxCJ6VDw+XsPl9yav6jNqN4LkDMYHQPvITFRkWDl9abkHlokGOqxljq0+0x jsVirl7+k2YdWxl08z7qt5FVOTgW2vTf9Pma8PxlrNbavx0DYgD68YswnY4TfCYO Q3ICn9R9nQtcksE4/kmYlkvYrDNgK7/r9qLG8hzi4SYGKFMRvYagBrl8ZWP6f4gI c5xxnx+LYmwQhOh1oI92fjVRxAsiRdB2E73WipY2KbJZX0OzBF65Qe82tl+mud30 IeRvPUfWvb5dAoH9fmbWIV2Xxp0R7bZqK/aef0+mmFHLPewABKPKwnG6DxOYdrHD 7VJo/WkBdwECMQHKPuh5 =R0Bl -----END PGP SIGNATURE----- --sHrvAb52M6C8blB9-- From owner-svn-src-all@freebsd.org Wed Jan 6 13:39:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89BD6A63C4C; Wed, 6 Jan 2016 13:39:42 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4841219D7; Wed, 6 Jan 2016 13:39:42 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aGoJQ-000D0E-8R; Wed, 06 Jan 2016 16:39:40 +0300 Date: Wed, 6 Jan 2016 16:39:40 +0300 From: Slawa Olhovchenkov To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106133940.GJ4535@zxy.spb.ru> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> <20160106123429.GA26378@FreeBSD.org> <20160106130213.GI4535@zxy.spb.ru> <20160106132653.GC26378@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160106132653.GC26378@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 13:39:42 -0000 On Wed, Jan 06, 2016 at 01:26:53PM +0000, Glen Barber wrote: > On Wed, Jan 06, 2016 at 04:02:13PM +0300, Slawa Olhovchenkov wrote: > > On Wed, Jan 06, 2016 at 12:34:29PM +0000, Glen Barber wrote: > > > > > On Wed, Jan 06, 2016 at 02:52:30PM +0300, Slawa Olhovchenkov wrote: > > > > On Tue, Jan 05, 2016 at 09:05:17PM +0000, Glen Barber wrote: > > > > > > > > > Author: gjb > > > > > Date: Tue Jan 5 21:05:17 2016 > > > > > New Revision: 293223 > > > > > URL: https://svnweb.freebsd.org/changeset/base/293223 > > > > > > > > > > Log: > > > > > Merge ^/projects/release-install-debug: > > > > > > > > > > - Rework MANIFEST generation and parsing via bsdinstall(8). > > > > > - Allow selecting debugging distribution sets during install. > > > > > - Rework bsdinstall(8) to fetch remote debug distribution sets > > > > > when they are not available on the local install medium. > > > > > - Allow selecting additional non-GENERIC kernels during install. > > > > > At present, GENERIC is still required, and installed by default. > > > > > > > > > > Tested with: head@r293203 > > > > > Sponsored by: The FreeBSD Foundation > > > > > > > > MFC planed? > > > > > > > > > > Not before 10.3-RELEASE, no. Perhaps after that. > > > > Somehow not done? > > I'm sorry, I do not understand what you mean. Sorry for my english. Do you planed for some commit to head before MFC planed? > > Can I use this as patch for custom intallation images? > > > > It should mostly apply, yes. There are likely sharp edges, though, > which is why I will not merge it before 10.3-RELEASE. > > Glen > From owner-svn-src-all@freebsd.org Wed Jan 6 13:42:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83AA4A63ECB; Wed, 6 Jan 2016 13:42:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 734FB1E80; Wed, 6 Jan 2016 13:42:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id C880D17A6; Wed, 6 Jan 2016 13:42:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 6 Jan 2016 13:42:00 +0000 From: Glen Barber To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106134200.GG26378@FreeBSD.org> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> <20160106123429.GA26378@FreeBSD.org> <20160106130213.GI4535@zxy.spb.ru> <20160106132653.GC26378@FreeBSD.org> <20160106133940.GJ4535@zxy.spb.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+1TulI7fc0PCHNy3" Content-Disposition: inline In-Reply-To: <20160106133940.GJ4535@zxy.spb.ru> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 13:42:02 -0000 --+1TulI7fc0PCHNy3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 06, 2016 at 04:39:40PM +0300, Slawa Olhovchenkov wrote: > On Wed, Jan 06, 2016 at 01:26:53PM +0000, Glen Barber wrote: > > On Wed, Jan 06, 2016 at 04:02:13PM +0300, Slawa Olhovchenkov wrote: > > > Somehow not done? > >=20 > > I'm sorry, I do not understand what you mean. >=20 > Sorry for my english. Your english is fine. :) I was not sure if you meant this particular commit, or something else. > Do you planed for some commit to head before MFC planed? >=20 Bug fixes, mainly. I am sure I have missed something, regardless of how much testing was done. Glen --+1TulI7fc0PCHNy3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWjRmoAAoJEAMUWKVHj+KTsjcP/AvZNEhNrHmjweglYOsNDK4g xWEXffQLgxZ48VGnfgBvRYWe33uxScCeRqUWW95CN5rdhuenMhSrJXs3J3s7ZDVD CiCI5pBYjFQzPF94DQpnyB1BKF/vFb5QH4UVm3oVLaVamkM3DIo4uQK36xgA2eUG XSG0ZdAGwb5RI0CNOQXp98TAqJcChtQtUjjllcGaSoHtdepJvPeCQ3ryFo/nHi05 zMM34FyO9vHcUJKFikyO0eGDmrLK+1Fb7ak3VLYHDExWX30G/9Z8XawsInmqI9Rf QSZ0F9L0J4BA8ZuooXaeoXIKeCSSOPrxpoVt7+sRTkUmAwYnkcEO18HMTeL2Q+uf 30Oketic6gzQ8HieScrgf9NdDqb9PQXEZGWDuZxFgPiNv/vPJgtg2RgdJmDJ61xb C7thWSDIFQTZfql0nmbJk6s6ZlkGQNA8aa/CTpHWXplsl/C37SszlokwmQ3YLLgR 7smKcbbM954uoTewFp7yJxjYPm7c+NOX6tAQsu7SWqRGJFgoT/FMwj7rvh3Pevml /ViwR6JYA5PeHZ3V5Y953t/kB3M9q93/4wgi61Jj12O4u5m4VkDpcfjcHH5cXacg hF9fjFYNc/hSc9FuVsYDOwNkSKRzO9cWDq4KcBbtLz3U0sYo5/xGMnBqcMS+L6IS c/8dieg1EDLynFicfC4J =EX8+ -----END PGP SIGNATURE----- --+1TulI7fc0PCHNy3-- From owner-svn-src-all@freebsd.org Wed Jan 6 13:49:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA63CA650C1; Wed, 6 Jan 2016 13:49:00 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 781C511CD; Wed, 6 Jan 2016 13:49:00 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aGoSQ-000DCp-GW; Wed, 06 Jan 2016 16:48:58 +0300 Date: Wed, 6 Jan 2016 16:48:58 +0300 From: Slawa Olhovchenkov To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106134858.GK4535@zxy.spb.ru> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> <20160106123429.GA26378@FreeBSD.org> <20160106130213.GI4535@zxy.spb.ru> <20160106132653.GC26378@FreeBSD.org> <20160106133940.GJ4535@zxy.spb.ru> <20160106134200.GG26378@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160106134200.GG26378@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 13:49:00 -0000 On Wed, Jan 06, 2016 at 01:42:00PM +0000, Glen Barber wrote: > On Wed, Jan 06, 2016 at 04:39:40PM +0300, Slawa Olhovchenkov wrote: > > On Wed, Jan 06, 2016 at 01:26:53PM +0000, Glen Barber wrote: > > > On Wed, Jan 06, 2016 at 04:02:13PM +0300, Slawa Olhovchenkov wrote: > > > > Somehow not done? > > > > > > I'm sorry, I do not understand what you mean. > > > > Sorry for my english. > > Your english is fine. :) > > I was not sure if you meant this particular commit, or something else. > > > Do you planed for some commit to head before MFC planed? > > > > Bug fixes, mainly. I am sure I have missed something, regardless of how > much testing was done. Thanks, I will try. From owner-svn-src-all@freebsd.org Wed Jan 6 15:38:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDC9EA4E612; Wed, 6 Jan 2016 15:38:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0C5114A0; Wed, 6 Jan 2016 15:38:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06FcdSZ001010; Wed, 6 Jan 2016 15:38:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06FcdOe001006; Wed, 6 Jan 2016 15:38:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061538.u06FcdOe001006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 15:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293233 - in head/sys/boot: efi/libefi efi/loader ficl/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 15:38:41 -0000 Author: emaste Date: Wed Jan 6 15:38:39 2016 New Revision: 293233 URL: https://svnweb.freebsd.org/changeset/base/293233 Log: loader.efi: add terminal emulation support This is based on the vidconsole implementation. Submitted by: Toomas Soome Reviewed by: adrian MFC after: 2 weeks Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D4797 Modified: head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/libefi/efi_console.c head/sys/boot/efi/loader/main.c head/sys/boot/ficl/amd64/sysdep.c Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Wed Jan 6 09:56:06 2016 (r293232) +++ head/sys/boot/efi/libefi/Makefile Wed Jan 6 15:38:39 2016 (r293233) @@ -21,5 +21,6 @@ CFLAGS+= -I${.CURDIR}/../../common # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} +CFLAGS+= -DTERM_EMU .include Modified: head/sys/boot/efi/libefi/efi_console.c ============================================================================== --- head/sys/boot/efi/libefi/efi_console.c Wed Jan 6 09:56:06 2016 (r293232) +++ head/sys/boot/efi/libefi/efi_console.c Wed Jan 6 15:38:39 2016 (r293233) @@ -35,6 +35,69 @@ __FBSDID("$FreeBSD$"); static SIMPLE_TEXT_OUTPUT_INTERFACE *conout; static SIMPLE_INPUT_INTERFACE *conin; +#ifdef TERM_EMU +#define DEFAULT_FGCOLOR EFI_LIGHTGRAY +#define DEFAULT_BGCOLOR EFI_BLACK + +#define MAXARGS 8 +static int args[MAXARGS], argc; +static int fg_c, bg_c, curx, cury; +static int esc; + +void get_pos(int *x, int *y); +void curs_move(int *_x, int *_y, int x, int y); +static void CL(int); +#endif + +static void efi_cons_probe(struct console *); +static int efi_cons_init(int); +void efi_cons_putchar(int); +int efi_cons_getchar(void); +void efi_cons_efiputchar(int); +int efi_cons_poll(void); + +struct console efi_console = { + "efi", + "EFI console", + 0, + efi_cons_probe, + efi_cons_init, + efi_cons_putchar, + efi_cons_getchar, + efi_cons_poll +}; + +#ifdef TERM_EMU + +/* Get cursor position. */ +void +get_pos(int *x, int *y) +{ + *x = conout->Mode->CursorColumn; + *y = conout->Mode->CursorRow; +} + +/* Move cursor to x rows and y cols (0-based). */ +void +curs_move(int *_x, int *_y, int x, int y) +{ + conout->SetCursorPosition(conout, x, y); + if (_x != NULL) + *_x = conout->Mode->CursorColumn; + if (_y != NULL) + *_y = conout->Mode->CursorRow; +} + +/* Clear internal state of the terminal emulation code. */ +void +end_term(void) +{ + esc = 0; + argc = -1; +} + +#endif + static void efi_cons_probe(struct console *cp) { @@ -46,22 +109,314 @@ efi_cons_probe(struct console *cp) static int efi_cons_init(int arg) { - conout->SetAttribute(conout, EFI_TEXT_ATTR(EFI_LIGHTGRAY, EFI_BLACK)); + conout->SetAttribute(conout, EFI_TEXT_ATTR(DEFAULT_FGCOLOR, + DEFAULT_BGCOLOR)); +#ifdef TERM_EMU + end_term(); + get_pos(&curx, &cury); + curs_move(&curx, &cury, curx, cury); + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; +#endif + conout->EnableCursor(conout, TRUE); return 0; } +static void +efi_cons_rawputchar(int c) +{ + int i; + UINTN x, y; + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + + if (c == '\t') + /* XXX lame tab expansion */ + for (i = 0; i < 8; i++) + efi_cons_rawputchar(' '); + else { +#ifndef TERM_EMU + if (c == '\n') + efi_cons_efiputchar('\r'); + else + efi_cons_efiputchar(c); +#else + switch (c) { + case '\r': + curx = 0; + curs_move(&curx, &cury, curx, cury); + return; + case '\n': + cury++; + if (cury >= y) { + efi_cons_efiputchar('\n'); + cury--; + } else + curs_move(&curx, &cury, curx, cury); + return; + case '\b': + if (curx > 0) { + curx--; + curs_move(&curx, &cury, curx, cury); + } + return; + default: + efi_cons_efiputchar(c); + curx++; + if (curx > x-1) { + curx = 0; + cury++; + } + if (cury > y-1) { + curx = 0; + cury--; + } + } + curs_move(&curx, &cury, curx, cury); +#endif + } +} + +/* Gracefully exit ESC-sequence processing in case of misunderstanding. */ +static void +bail_out(int c) +{ + char buf[16], *ch; + int i; + + if (esc) { + efi_cons_rawputchar('\033'); + if (esc != '\033') + efi_cons_rawputchar(esc); + for (i = 0; i <= argc; ++i) { + sprintf(buf, "%d", args[i]); + ch = buf; + while (*ch) + efi_cons_rawputchar(*ch++); + } + } + efi_cons_rawputchar(c); + end_term(); +} + +/* Clear display from current position to end of screen. */ +static void +CD(void) { + int i; + UINTN x, y; + + get_pos(&curx, &cury); + if (curx == 0 && cury == 0) { + conout->ClearScreen(conout); + end_term(); + return; + } + + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + CL(0); /* clear current line from cursor to end */ + for (i = cury + 1; i < y-1; i++) { + curs_move(NULL, NULL, 0, i); + CL(0); + } + curs_move(NULL, NULL, curx, cury); + end_term(); +} + +/* + * Absolute cursor move to args[0] rows and args[1] columns + * (the coordinates are 1-based). + */ +static void +CM(void) +{ + if (args[0] > 0) + args[0]--; + if (args[1] > 0) + args[1]--; + curs_move(&curx, &cury, args[1], args[0]); + end_term(); +} + +/* Home cursor (left top corner), also called from mode command. */ void -efi_cons_putchar(int c) +HO(void) { - CHAR16 buf[2]; + argc = 1; + args[0] = args[1] = 1; + CM(); +} - if (c == '\n') - efi_cons_putchar('\r'); +/* Clear line from current position to end of line */ +static void +CL(int direction) +{ + int i, len; + UINTN x, y; + CHAR16 *line; - buf[0] = c; - buf[1] = 0; + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + switch (direction) { + case 0: /* from cursor to end */ + len = x - curx + 1; + break; + case 1: /* from beginning to cursor */ + len = curx; + break; + case 2: /* entire line */ + len = x; + break; + } - conout->OutputString(conout, buf); + if (cury == y - 1) + len--; + + line = malloc(len * sizeof (CHAR16)); + if (line == NULL) { + printf("out of memory\n"); + return; + } + for (i = 0; i < len; i++) + line[i] = ' '; + line[len-1] = 0; + + if (direction != 0) + curs_move(NULL, NULL, 0, cury); + + conout->OutputString(conout, line); + /* restore cursor position */ + curs_move(NULL, NULL, curx, cury); + free(line); + end_term(); +} + +static void +get_arg(int c) +{ + if (argc < 0) + argc = 0; + args[argc] *= 10; + args[argc] += c - '0'; +} + +/* Emulate basic capabilities of cons25 terminal */ +static void +efi_term_emu(int c) +{ + static int ansi_col[] = { + 0, 4, 2, 6, 1, 5, 3, 7 + }; + int t, i; + + switch (esc) { + case 0: + switch (c) { + case '\033': + esc = c; + break; + default: + efi_cons_rawputchar(c); + break; + } + break; + case '\033': + switch (c) { + case '[': + esc = c; + args[0] = 0; + argc = -1; + break; + default: + bail_out(c); + break; + } + break; + case '[': + switch (c) { + case ';': + if (argc < 0) + argc = 0; + else if (argc + 1 >= MAXARGS) + bail_out(c); + else + args[++argc] = 0; + break; + case 'H': /* ho = \E[H */ + if (argc < 0) + HO(); + else if (argc == 1) + CM(); + else + bail_out(c); + break; + case 'J': /* cd = \E[J */ + if (argc < 0) + CD(); + else + bail_out(c); + break; + case 'm': + if (argc < 0) { + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; + } + for (i = 0; i <= argc; ++i) { + switch (args[i]) { + case 0: /* back to normal */ + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; + break; + case 1: /* bold */ + fg_c |= 0x8; + break; + case 4: /* underline */ + case 5: /* blink */ + bg_c |= 0x8; + break; + case 7: /* reverse */ + t = fg_c; + fg_c = bg_c; + bg_c = t; + break; + case 30: case 31: case 32: case 33: + case 34: case 35: case 36: case 37: + fg_c = ansi_col[args[i] - 30]; + break; + case 39: /* normal */ + fg_c = DEFAULT_FGCOLOR; + break; + case 40: case 41: case 42: case 43: + case 44: case 45: case 46: case 47: + bg_c = ansi_col[args[i] - 40]; + break; + case 49: /* normal */ + bg_c = DEFAULT_BGCOLOR; + break; + } + } + conout->SetAttribute(conout, EFI_TEXT_ATTR(fg_c, bg_c)); + end_term(); + break; + default: + if (isdigit(c)) + get_arg(c); + else + bail_out(c); + break; + } + break; + default: + bail_out(c); + break; + } +} + +void +efi_cons_putchar(int c) +{ +#ifdef TERM_EMU + efi_term_emu(c); +#else + efi_cons_rawputchar(c); +#endif } int @@ -77,6 +432,12 @@ efi_cons_getchar() BS->WaitForEvent(1, &conin->WaitForKey, &junk); status = conin->ReadKeyStroke(conin, &key); } + switch (key.ScanCode) { + case 0x17: /* ESC */ + return (0x1b); /* esc */ + } + + /* this can return */ return (key.UnicodeChar); } @@ -87,13 +448,36 @@ efi_cons_poll() return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS); } -struct console efi_console = { - "efi", - "EFI console", - 0, - efi_cons_probe, - efi_cons_init, - efi_cons_putchar, - efi_cons_getchar, - efi_cons_poll -}; +/* Plain direct access to EFI OutputString(). */ +void +efi_cons_efiputchar(int c) +{ + CHAR16 buf[2]; + + /* + * translate box chars to unicode + */ + switch (c) { + /* single frame */ + case 0xb3: buf[0] = BOXDRAW_VERTICAL; break; + case 0xbf: buf[0] = BOXDRAW_DOWN_LEFT; break; + case 0xc0: buf[0] = BOXDRAW_UP_RIGHT; break; + case 0xc4: buf[0] = BOXDRAW_HORIZONTAL; break; + case 0xda: buf[0] = BOXDRAW_DOWN_RIGHT; break; + case 0xd9: buf[0] = BOXDRAW_UP_LEFT; break; + + /* double frame */ + case 0xba: buf[0] = BOXDRAW_DOUBLE_VERTICAL; break; + case 0xbb: buf[0] = BOXDRAW_DOUBLE_DOWN_LEFT; break; + case 0xbc: buf[0] = BOXDRAW_DOUBLE_UP_LEFT; break; + case 0xc8: buf[0] = BOXDRAW_DOUBLE_UP_RIGHT; break; + case 0xc9: buf[0] = BOXDRAW_DOUBLE_DOWN_RIGHT; break; + case 0xcd: buf[0] = BOXDRAW_DOUBLE_HORIZONTAL; break; + + default: + buf[0] = c; + } + buf[1] = 0; /* terminate string */ + + conout->OutputString(conout, buf); +} Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Wed Jan 6 09:56:06 2016 (r293232) +++ head/sys/boot/efi/loader/main.c Wed Jan 6 15:38:39 2016 (r293233) @@ -334,6 +334,7 @@ command_mode(int argc, char *argv[]) char rowenv[8]; EFI_STATUS status; SIMPLE_TEXT_OUTPUT_INTERFACE *conout; + extern void HO(void); conout = ST->ConOut; @@ -355,7 +356,7 @@ command_mode(int argc, char *argv[]) } sprintf(rowenv, "%u", (unsigned)rows); setenv("LINES", rowenv, 1); - + HO(); /* set cursor */ return (CMD_OK); } Modified: head/sys/boot/ficl/amd64/sysdep.c ============================================================================== --- head/sys/boot/ficl/amd64/sysdep.c Wed Jan 6 09:56:06 2016 (r293232) +++ head/sys/boot/ficl/amd64/sysdep.c Wed Jan 6 15:38:39 2016 (r293233) @@ -55,7 +55,7 @@ void ficlTextOut(FICL_VM *pVM, char *ms IGNORE(pVM); while(*msg != 0) - putchar(*(msg++)); + putchar((unsigned char)*(msg++)); if (fNewline) putchar('\n'); From owner-svn-src-all@freebsd.org Wed Jan 6 15:50:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79F56A4EAB8; Wed, 6 Jan 2016 15:50:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3081C24; Wed, 6 Jan 2016 15:50:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06FoMMf004023; Wed, 6 Jan 2016 15:50:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06FoMGa004020; Wed, 6 Jan 2016 15:50:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061550.u06FoMGa004020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 15:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293234 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 15:50:23 -0000 Author: emaste Date: Wed Jan 6 15:50:21 2016 New Revision: 293234 URL: https://svnweb.freebsd.org/changeset/base/293234 Log: Enable the beastie menu for the UEFI console As of r293233 the UEFI console includes basic terminal emulator support. MFC after: 2 weeks Relnotes: Yes Modified: head/sys/boot/forth/beastie.4th head/sys/boot/forth/beastie.4th.8 head/sys/boot/forth/loader.conf.5 Modified: head/sys/boot/forth/beastie.4th ============================================================================== --- head/sys/boot/forth/beastie.4th Wed Jan 6 15:38:39 2016 (r293233) +++ head/sys/boot/forth/beastie.4th Wed Jan 6 15:50:21 2016 (r293234) @@ -85,11 +85,6 @@ variable logoY also support-functions : beastie-start ( -- ) \ starts the menu - s" console" getenv dup -1 <> if - s" efi" 2swap contains? if - s" set beastie_disable=YES" evaluate - then - else drop then s" beastie_disable" getenv dup -1 <> if s" YES" compare-insensitive 0= if any_conf_read? if Modified: head/sys/boot/forth/beastie.4th.8 ============================================================================== --- head/sys/boot/forth/beastie.4th.8 Wed Jan 6 15:38:39 2016 (r293233) +++ head/sys/boot/forth/beastie.4th.8 Wed Jan 6 15:50:21 2016 (r293234) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2014 +.Dd January 6, 2016 .Dt BEASTIE.4TH 8 .Os .Sh NAME @@ -119,8 +119,7 @@ Sets the desired row position of the log If set to .Dq YES , the beastie boot menu will be skipped. -The beastie boot menu is always skipped if booting UEFI or running non-x86 -hardware. +The beastie boot menu is always skipped if running non-x86 hardware. .It Va loader_delay If set to a number higher than zero, introduces a delay before starting the beastie boot menu. During the delay the user can press either Ctrl-C to skip Modified: head/sys/boot/forth/loader.conf.5 ============================================================================== --- head/sys/boot/forth/loader.conf.5 Wed Jan 6 15:38:39 2016 (r293233) +++ head/sys/boot/forth/loader.conf.5 Wed Jan 6 15:50:21 2016 (r293234) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 27, 2014 +.Dd January 6, 2016 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -236,8 +236,7 @@ be displayed. If set to .Dq YES , the beastie boot menu will be skipped. -The beastie boot menu is always skipped if booting UEFI or running non-x86 -hardware. +The beastie boot menu is always skipped if running non-x86 hardware. .It Va loader_logo Pq Dq Li orbbw Selects a desired logo in the beastie boot menu. Possible values are: From owner-svn-src-all@freebsd.org Wed Jan 6 16:02:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D72A4EE6C; Wed, 6 Jan 2016 16:02:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37F0B15DB; Wed, 6 Jan 2016 16:02:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06G2MUP010567; Wed, 6 Jan 2016 16:02:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06G2MbF010566; Wed, 6 Jan 2016 16:02:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601061602.u06G2MbF010566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 6 Jan 2016 16:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293235 - stable/10/sys/fs/nullfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 16:02:23 -0000 Author: kib Date: Wed Jan 6 16:02:22 2016 New Revision: 293235 URL: https://svnweb.freebsd.org/changeset/base/293235 Log: MFC r292961: Force nullfs vnode reclaim after unlinking, to potentially unlink lower vnode. Modified: stable/10/sys/fs/nullfs/null_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nullfs/null_vnops.c ============================================================================== --- stable/10/sys/fs/nullfs/null_vnops.c Wed Jan 6 15:50:21 2016 (r293234) +++ stable/10/sys/fs/nullfs/null_vnops.c Wed Jan 6 16:02:22 2016 (r293235) @@ -568,14 +568,16 @@ static int null_remove(struct vop_remove_args *ap) { int retval, vreleit; - struct vnode *lvp; + struct vnode *lvp, *vp; - if (vrefcnt(ap->a_vp) > 1) { - lvp = NULLVPTOLOWERVP(ap->a_vp); + vp = ap->a_vp; + if (vrefcnt(vp) > 1) { + lvp = NULLVPTOLOWERVP(vp); VREF(lvp); vreleit = 1; } else vreleit = 0; + VTONULL(vp)->null_flags |= NULLV_DROP; retval = null_bypass(&ap->a_gen); if (vreleit != 0) vrele(lvp); From owner-svn-src-all@freebsd.org Wed Jan 6 16:10:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D80A3A6238D; Wed, 6 Jan 2016 16:10:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 568901C06; Wed, 6 Jan 2016 16:10:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u06GAkiV018633 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 6 Jan 2016 18:10:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u06GAkiV018633 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u06GAkhf018632; Wed, 6 Jan 2016 18:10:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 6 Jan 2016 18:10:46 +0200 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293226 - head/libexec/rtld-elf Message-ID: <20160106161046.GP3625@kib.kiev.ua> References: <201601052120.u05LKkvv074874@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601052120.u05LKkvv074874@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 16:10:57 -0000 On Tue, Jan 05, 2016 at 09:20:46PM +0000, Warner Losh wrote: > Author: imp > Date: Tue Jan 5 21:20:46 2016 > New Revision: 293226 > URL: https://svnweb.freebsd.org/changeset/base/293226 > > Log: > Disable abi variant hook until strangeness with packages can be sorted > out. > > Modified: > head/libexec/rtld-elf/rtld.c > > Modified: head/libexec/rtld-elf/rtld.c > ============================================================================== > --- head/libexec/rtld-elf/rtld.c Tue Jan 5 21:12:49 2016 (r293225) > +++ head/libexec/rtld-elf/rtld.c Tue Jan 5 21:20:46 2016 (r293226) > @@ -435,7 +435,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ > > trust = !issetugid(); > > - md_abi_variant_hook(aux_info); > +/* md_abi_variant_hook(aux_info); */ > > ld_bind_now = getenv(_LD("BIND_NOW")); > /* The ARM hook resets the default paths to the libsoft variants. It cannot work while /lib, /usr/lib and /usr/local/lib are populated with soft-fp libraries. I thought that you are going to switch the default target_arch to armv6hf immediately after the commit to rtld. And then, looking into the issue, IMO the way forward is to leave softfp libraries where they are, but install v6hf somewhere in /lib/armv6hf etc. From owner-svn-src-all@freebsd.org Wed Jan 6 16:25:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09D17A62934; Wed, 6 Jan 2016 16:25:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CABA51730; Wed, 6 Jan 2016 16:25:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06GP0rg017723; Wed, 6 Jan 2016 16:25:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06GP0x1017722; Wed, 6 Jan 2016 16:25:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601061625.u06GP0x1017722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 6 Jan 2016 16:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293236 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 16:25:02 -0000 Author: pfg Date: Wed Jan 6 16:25:00 2016 New Revision: 293236 URL: https://svnweb.freebsd.org/changeset/base/293236 Log: MFC r292872: ext2: recognize ext4 INCOMPAT_RECOVER flag This is a flag specific for journalling in ext4. Add it to the list of ext4 features we ignore for read-only purposes. PR: 205668 Modified: stable/10/sys/fs/ext2fs/ext2fs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2fs.h Wed Jan 6 16:02:22 2016 (r293235) +++ stable/10/sys/fs/ext2fs/ext2fs.h Wed Jan 6 16:25:00 2016 (r293236) @@ -187,6 +187,7 @@ struct csum { #define EXT2F_INCOMPAT_COMP 0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 +#define EXT2F_INCOMPAT_RECOVER 0x0004 #define EXT2F_INCOMPAT_META_BG 0x0010 #define EXT2F_INCOMPAT_EXTENTS 0x0040 #define EXT2F_INCOMPAT_64BIT 0x0080 @@ -208,6 +209,7 @@ struct csum { * * We do not support these EXT4 features but they are irrelevant * for read-only support: + * - EXT2F_INCOMPAT_RECOVER * - EXT2F_INCOMPAT_FLEX_BG * - EXT2F_INCOMPAT_META_BG */ @@ -216,6 +218,7 @@ struct csum { EXT2F_ROCOMPAT_EXTRA_ISIZE) #define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE #define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ + EXT2F_INCOMPAT_RECOVER | \ EXT2F_INCOMPAT_FLEX_BG | \ EXT2F_INCOMPAT_META_BG ) From owner-svn-src-all@freebsd.org Wed Jan 6 16:27:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22381A62A64; Wed, 6 Jan 2016 16:27:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6D6D1999; Wed, 6 Jan 2016 16:27:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06GRItU017857; Wed, 6 Jan 2016 16:27:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06GRIUV017856; Wed, 6 Jan 2016 16:27:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601061627.u06GRIUV017856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 6 Jan 2016 16:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r293237 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 16:27:19 -0000 Author: pfg Date: Wed Jan 6 16:27:17 2016 New Revision: 293237 URL: https://svnweb.freebsd.org/changeset/base/293237 Log: MFC r292872: ext2: recognize ext4 INCOMPAT_RECOVER flag This is a flag specific for journalling in ext4. Add it to the list of ext4 features we ignore for read-only purposes. PR: 205668 Modified: stable/9/sys/fs/ext2fs/ext2fs.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2fs.h Wed Jan 6 16:25:00 2016 (r293236) +++ stable/9/sys/fs/ext2fs/ext2fs.h Wed Jan 6 16:27:17 2016 (r293237) @@ -187,6 +187,7 @@ struct csum { #define EXT2F_INCOMPAT_COMP 0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 +#define EXT2F_INCOMPAT_RECOVER 0x0004 #define EXT2F_INCOMPAT_META_BG 0x0010 #define EXT2F_INCOMPAT_EXTENTS 0x0040 #define EXT2F_INCOMPAT_64BIT 0x0080 @@ -208,6 +209,7 @@ struct csum { * * We do not support these EXT4 features but they are irrelevant * for read-only support: + * - EXT2F_INCOMPAT_RECOVER * - EXT2F_INCOMPAT_FLEX_BG * - EXT2F_INCOMPAT_META_BG */ @@ -216,6 +218,7 @@ struct csum { EXT2F_ROCOMPAT_EXTRA_ISIZE) #define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE #define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ + EXT2F_INCOMPAT_RECOVER | \ EXT2F_INCOMPAT_FLEX_BG | \ EXT2F_INCOMPAT_META_BG ) From owner-svn-src-all@freebsd.org Wed Jan 6 16:32:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D480A62CEA; Wed, 6 Jan 2016 16:32:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3EAC1DDD; Wed, 6 Jan 2016 16:32:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06GWeFH020532; Wed, 6 Jan 2016 16:32:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06GWe19020531; Wed, 6 Jan 2016 16:32:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601061632.u06GWe19020531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 6 Jan 2016 16:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293238 - stable/10/bin/pax X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 16:32:41 -0000 Author: pfg Date: Wed Jan 6 16:32:39 2016 New Revision: 293238 URL: https://svnweb.freebsd.org/changeset/base/293238 Log: MFC r292877: pax: prevent possible buffer overflow Or at least quiet down some static analyzers about it. CID: 978835 Obtained from: OpenBSD Modified: stable/10/bin/pax/pat_rep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/pax/pat_rep.c ============================================================================== --- stable/10/bin/pax/pat_rep.c Wed Jan 6 16:27:17 2016 (r293237) +++ stable/10/bin/pax/pat_rep.c Wed Jan 6 16:32:39 2016 (r293238) @@ -878,7 +878,7 @@ rep_name(char *name, int *nlen, int prnt * (the user already saw that substitution go by) */ pt = rephead; - (void)strcpy(buf1, name); + (void)strlcpy(buf1, name, sizeof(buf1)); inpt = buf1; outpt = nname; endpt = outpt + PAXPATHLEN; From owner-svn-src-all@freebsd.org Wed Jan 6 16:35:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D703A62DC5; Wed, 6 Jan 2016 16:35:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E06E1F83; Wed, 6 Jan 2016 16:35:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06GZUHh020693; Wed, 6 Jan 2016 16:35:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06GZUqF020692; Wed, 6 Jan 2016 16:35:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601061635.u06GZUqF020692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 6 Jan 2016 16:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r293239 - stable/9/bin/pax X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 16:35:31 -0000 Author: pfg Date: Wed Jan 6 16:35:30 2016 New Revision: 293239 URL: https://svnweb.freebsd.org/changeset/base/293239 Log: MFC r292877: pax: prevent possible buffer overflow Or at least quiet down some static analyzers about it. CID: 978835 Obtained from: OpenBSD Modified: stable/9/bin/pax/pat_rep.c Modified: stable/9/bin/pax/pat_rep.c ============================================================================== --- stable/9/bin/pax/pat_rep.c Wed Jan 6 16:32:39 2016 (r293238) +++ stable/9/bin/pax/pat_rep.c Wed Jan 6 16:35:30 2016 (r293239) @@ -880,7 +880,7 @@ rep_name(char *name, int *nlen, int prnt * (the user already saw that substitution go by) */ pt = rephead; - (void)strcpy(buf1, name); + (void)strlcpy(buf1, name, sizeof(buf1)); inpt = buf1; outpt = nname; endpt = outpt + PAXPATHLEN; From owner-svn-src-all@freebsd.org Wed Jan 6 17:01:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C389A65744 for ; Wed, 6 Jan 2016 17:01:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3D29124B for ; Wed, 6 Jan 2016 17:01:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x234.google.com with SMTP id e32so216901906qgf.3 for ; Wed, 06 Jan 2016 09:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=70h4flNR7FPnQpv1DVV34yLgEdkxF75tFHz9TiMCU6c=; b=mMAxLNcvllloKBK/uhuAQA0Z/Fs4ZaV4H10/iNmkyF7ZB+4eKCdkVMUInZUl+rTIi9 bLBzYS9ZFIRnMPTM7Mj+7JDX0OPEQj2nG6iJNC0dWbTwZniksox9duro+DG7Hmk/fL1J xXmvTgei0GGVmXnHvYxilD+UBNSsX+bqWAXTZtDrXx/AGbgNky+K7bjawNsmPrldQuKj phJZ+HvE5+tvC4FRNGtxa4KVFiumPkj85t7kQByHx2/WgtUnCliFcb2y5LoaLwbnd15r zHLzaUWSZ3jysVBJE6wtwMtu+aUQcwMP2MzxXli1P1nnkr1aQozWN3kGbbA069y89CwH h21w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=70h4flNR7FPnQpv1DVV34yLgEdkxF75tFHz9TiMCU6c=; b=JVaB7ZwwpVURxZaQx9tyg/8vbqnn43IuCcj+9+ghcGNerfBOm39ql6kquOR49twB/4 S6vO596sLRDxRBtIoANpKROm4kgTtPDFkbAIDN+xGJbk1cxY+ZjJd5rLaaoKdDrkEcO9 fjA7oeiNGNFV2FQUC5Q9tGHvjXc1mbfIBeyKA9sOC5vHHHiaSJc4goUokcRQ6adG9c8m l/hTpBqPo1eEy+aP1cP4G4l/sRaeRKESEKHZO11HNSvYjDOG57ycWdv8YXvuo8ICJn4l lHufNDkBgl/jdXzve5PKljSCjPFa6ccInT3KoXjHy50wQs4Z7Psd5oq4/diXx7B1d8+L K2sA== X-Gm-Message-State: ALoCoQnas4segGdF/Wf/CY/sLGYnNMphqaI8U9oNrvWrV21i6tf1XObmojzU35bzJ6887NJ7vkpKwRrN/5JzQ/bFxcC/fXxwrw== MIME-Version: 1.0 X-Received: by 10.140.141.138 with SMTP id 132mr29597798qhn.74.1452099686455; Wed, 06 Jan 2016 09:01:26 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Wed, 6 Jan 2016 09:01:26 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160106161046.GP3625@kib.kiev.ua> References: <201601052120.u05LKkvv074874@repo.freebsd.org> <20160106161046.GP3625@kib.kiev.ua> Date: Wed, 6 Jan 2016 10:01:26 -0700 X-Google-Sender-Auth: KVUoYdMIKnz6vNAtD8ZJWDiI0p0 Message-ID: Subject: Re: svn commit: r293226 - head/libexec/rtld-elf From: Warner Losh To: Konstantin Belousov Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:01:28 -0000 On Wed, Jan 6, 2016 at 9:10 AM, Konstantin Belousov wrote: > On Tue, Jan 05, 2016 at 09:20:46PM +0000, Warner Losh wrote: > > Author: imp > > Date: Tue Jan 5 21:20:46 2016 > > New Revision: 293226 > > URL: https://svnweb.freebsd.org/changeset/base/293226 > > > > Log: > > Disable abi variant hook until strangeness with packages can be sorted > > out. > > > > Modified: > > head/libexec/rtld-elf/rtld.c > > > > Modified: head/libexec/rtld-elf/rtld.c > > > ============================================================================== > > --- head/libexec/rtld-elf/rtld.c Tue Jan 5 21:12:49 2016 > (r293225) > > +++ head/libexec/rtld-elf/rtld.c Tue Jan 5 21:20:46 2016 > (r293226) > > @@ -435,7 +435,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ > > > > trust = !issetugid(); > > > > - md_abi_variant_hook(aux_info); > > +/* md_abi_variant_hook(aux_info); */ > > > > ld_bind_now = getenv(_LD("BIND_NOW")); > > /* > The ARM hook resets the default paths to the libsoft variants. It cannot > work while /lib, /usr/lib and /usr/local/lib are populated with soft-fp > libraries. I thought that you are going to switch the default target_arch > to armv6hf immediately after the commit to rtld. > That analysis isn't quite right. I'll throw the replacement switch very soon. The problem is that it highlighted was things were incomplete, not that I'd left soft float libraries where I did for a short period of time. > And then, looking into the issue, IMO the way forward is to leave softfp > libraries where they are, but install v6hf somewhere in /lib/armv6hf etc. > No. That's even worse. We're not doing that. Warner From owner-svn-src-all@freebsd.org Wed Jan 6 17:13:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70466A65C07; Wed, 6 Jan 2016 17:13:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F8221C87; Wed, 6 Jan 2016 17:13:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06HDeMM032984; Wed, 6 Jan 2016 17:13:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06HDeTS032983; Wed, 6 Jan 2016 17:13:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601061713.u06HDeTS032983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 6 Jan 2016 17:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293240 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:13:41 -0000 Author: imp Date: Wed Jan 6 17:13:40 2016 New Revision: 293240 URL: https://svnweb.freebsd.org/changeset/base/293240 Log: Try a little harder to remove firstboot and firstboot-reboot files in case they accidentally get created as directories or with flags that prevent their removal. While I wouldn't normally go the extra mile here and let the normal unix rules prevail, the effects of failure are large enough that extra care is warranted. Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Wed Jan 6 16:35:30 2016 (r293239) +++ head/etc/rc Wed Jan 6 17:13:40 2016 (r293240) @@ -130,11 +130,17 @@ for _rc_elem in ${files}; do done # Remove the firstboot sentinel, and reboot if it was requested. +# Be a bit paranoid about removing it to handle the common failure +# modes since the consequence of failure can be big. +# Note: this assumes firstboot_sentinel is on / when we have +# a read-only /, or that it is on media that's writable. if [ -e ${firstboot_sentinel} ]; then [ ${root_rw_mount} = "yes" ] || mount -uw / - /bin/rm -f ${firstboot_sentinel} + chflags -R 0 ${firstboot_sentinel} + rm -rf ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then - /bin/rm -f ${firstboot_sentinel}-reboot + chflags -R 0 ${firstboot_sentinel}-reboot + rm -rf ${firstboot_sentinel}-reboot [ ${root_rw_mount} = "yes" ] || mount -ur / kill -INT 1 fi From owner-svn-src-all@freebsd.org Wed Jan 6 17:33:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E822A64256; Wed, 6 Jan 2016 17:33:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F68D182C; Wed, 6 Jan 2016 17:33:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06HXX09038934; Wed, 6 Jan 2016 17:33:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06HXXAW038933; Wed, 6 Jan 2016 17:33:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061733.u06HXXAW038933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 17:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293241 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:33:34 -0000 Author: emaste Date: Wed Jan 6 17:33:32 2016 New Revision: 293241 URL: https://svnweb.freebsd.org/changeset/base/293241 Log: Add fls() to libstand Although we don't use it in tree yet libstand is installed as user- facing /usr/liblibstand.a, and some work in progress makes use of it. Instead of conflicting with ongoing libstand Makefile deduplication, just add it now. Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Wed Jan 6 17:13:40 2016 (r293240) +++ head/lib/libstand/Makefile Wed Jan 6 17:33:32 2016 (r293241) @@ -38,8 +38,9 @@ SRCS+= ntoh.c # string functions from libc .PATH: ${LIBC_SRC}/string -SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ - memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ +SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ + memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ + qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .if ${MACHINE_CPUARCH} == "arm" From owner-svn-src-all@freebsd.org Wed Jan 6 17:48:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E332CA64774; Wed, 6 Jan 2016 17:48:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBC7010CA; Wed, 6 Jan 2016 17:48:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06HmZTT042379; Wed, 6 Jan 2016 17:48:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06HmZMQ042377; Wed, 6 Jan 2016 17:48:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601061748.u06HmZMQ042377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 6 Jan 2016 17:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293242 - stable/10/usr.sbin/mailwrapper X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:48:37 -0000 Author: bdrewery Date: Wed Jan 6 17:48:35 2016 New Revision: 293242 URL: https://svnweb.freebsd.org/changeset/base/293242 Log: MFC r270675: Allow mailwrapper to use mailer.conf from localbase (respecting LOCALBASE env var if set) PR: 205965 Modified: stable/10/usr.sbin/mailwrapper/mailwrapper.8 stable/10/usr.sbin/mailwrapper/mailwrapper.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mailwrapper/mailwrapper.8 ============================================================================== --- stable/10/usr.sbin/mailwrapper/mailwrapper.8 Wed Jan 6 17:33:32 2016 (r293241) +++ stable/10/usr.sbin/mailwrapper/mailwrapper.8 Wed Jan 6 17:48:35 2016 (r293242) @@ -31,7 +31,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 7, 2006 +.Dd August 27, 2014 .Dt MAILWRAPPER 8 .Os .Sh NAME @@ -109,6 +109,8 @@ utility is designed to replace and to invoke an appropriate MTA instead of .Xr sendmail 8 based on configuration information placed in +.Pa ${LOCALBASE}/etc/mail/mailer.conf +falling back on .Pa /etc/mail/mailer.conf . This permits the administrator to configure which MTA is to be invoked on the system at run time. @@ -126,6 +128,8 @@ should be turned off in Configuration for .Nm is kept in +.Pa ${LOCALBASE}/etc/mail/mailer.conf +or .Pa /etc/mail/mailer.conf . .Pa /usr/sbin/sendmail is typically set up as a symbolic link to Modified: stable/10/usr.sbin/mailwrapper/mailwrapper.c ============================================================================== --- stable/10/usr.sbin/mailwrapper/mailwrapper.c Wed Jan 6 17:33:32 2016 (r293241) +++ stable/10/usr.sbin/mailwrapper/mailwrapper.c Wed Jan 6 17:48:35 2016 (r293242) @@ -35,6 +35,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -87,6 +89,8 @@ main(int argc, char *argv[], char *envp[ FILE *config; char *line, *cp, *from, *to, *ap; const char *progname; + char localmailerconf[MAXPATHLEN]; + const char *mailerconf; size_t len, lineno = 0; int i; struct arglist al; @@ -98,11 +102,18 @@ main(int argc, char *argv[], char *envp[ initarg(&al); addarg(&al, argv[0]); - if ((config = fopen(_PATH_MAILERCONF, "r")) == NULL) { + snprintf(localmailerconf, MAXPATHLEN, "%s/etc/mail/mailer.conf", + getenv("LOCALBASE") ? getenv("LOCALBASE") : "/usr/local"); + + mailerconf = localmailerconf; + if ((config = fopen(localmailerconf, "r")) == NULL) + mailerconf = _PATH_MAILERCONF; + + if (config == NULL && ((config = fopen(mailerconf, "r")) == NULL)) { addarg(&al, NULL); openlog(getprogname(), LOG_PID, LOG_MAIL); syslog(LOG_INFO, "cannot open %s, using %s as default MTA", - _PATH_MAILERCONF, _PATH_DEFAULTMTA); + mailerconf, _PATH_DEFAULTMTA); closelog(); execve(_PATH_DEFAULTMTA, al.argv, envp); err(EX_OSERR, "cannot exec %s", _PATH_DEFAULTMTA); @@ -112,7 +123,7 @@ main(int argc, char *argv[], char *envp[ for (;;) { if ((line = fparseln(config, &len, &lineno, NULL, 0)) == NULL) { if (feof(config)) - errx(EX_CONFIG, "no mapping in %s", _PATH_MAILERCONF); + errx(EX_CONFIG, "no mapping in %s", mailerconf); err(EX_CONFIG, "cannot parse line %lu", (u_long)lineno); } @@ -157,6 +168,6 @@ main(int argc, char *argv[], char *envp[ /*NOTREACHED*/ parse_error: errx(EX_CONFIG, "parse error in %s at line %lu", - _PATH_MAILERCONF, (u_long)lineno); + mailerconf, (u_long)lineno); /*NOTREACHED*/ } From owner-svn-src-all@freebsd.org Wed Jan 6 17:49:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAA6FA647FE; Wed, 6 Jan 2016 17:49:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id BB84A126B; Wed, 6 Jan 2016 17:49:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id B27BA1CEE; Wed, 6 Jan 2016 17:49:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 7E25E12A4D; Wed, 6 Jan 2016 17:49:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ExI012ihM4T2; Wed, 6 Jan 2016 17:49:20 +0000 (UTC) Subject: Re: svn commit: r293242 - stable/10/usr.sbin/mailwrapper DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com EE88F12A47 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201601061748.u06HmZMQ042377@repo.freebsd.org> Cc: Glen Barber From: Bryan Drewery Organization: FreeBSD Message-ID: <568D539D.1080804@FreeBSD.org> Date: Wed, 6 Jan 2016 09:49:17 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201601061748.u06HmZMQ042377@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:49:22 -0000 On 1/6/16 9:48 AM, Bryan Drewery wrote: > Author: bdrewery > Date: Wed Jan 6 17:48:35 2016 > New Revision: 293242 > URL: https://svnweb.freebsd.org/changeset/base/293242 > > Log: > MFC r270675: > > Allow mailwrapper to use mailer.conf from localbase (respecting LOCALBASE env > var if set) > > PR: 205965 > Relnotes: yes -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Wed Jan 6 17:49:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3601FA64891 for ; Wed, 6 Jan 2016 17:49:58 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA54813BB for ; Wed, 6 Jan 2016 17:49:57 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22e.google.com with SMTP id f206so68373541wmf.0 for ; Wed, 06 Jan 2016 09:49:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=ztei9KdAD5zl7g4bpo2MHk8Brt7qDXTJsRHyWDys148=; b=dDlXuveaalLtQpWpM+4f3wg4EDinsObJhlhqxtCRY/+ICS5/JWVi/qoMDx+W3/1sFy n3eLSR305Chujj0P4Hd1crDB5cETQ5NrK3ut7n9qm+6d538PBAgPBctckMvNiBdW0xgQ 21FVxJsSzYyBVtgwATjlzDwpuk+Bf8xpdaV97IPbrNX9Kxk3FH0/NXuW/Ujl/Y/FEhOo /8B9DQiq3uLOlvpbk2tBUpUDti44//FAdT01s1RbmcK38SJfU4BvaZW/p1Th0/N0vA4x 3dElvcdC/u39Vzwgji9KLuFYRSSbGjNQnyWZfQvZrBaRx8X9uej0ofr3httkavBd9tXA 1y4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=ztei9KdAD5zl7g4bpo2MHk8Brt7qDXTJsRHyWDys148=; b=aabGPf8sEQcyCtE2BmSZL0st+BLPuBGC/cxLGZzo8RoNo9eaqHjTUqWFMoHVLRAota UIkcMiRAp7QL76BZZM64LvxKeAZDpcHaScHYRqgd2C//Q9VC0ddINd9J1kQtJkyVz1WG cByPibdUBdnWTeoV2afW9Y2DQgky3u04D/eTRBRVXbb+i5IgS3uSbwDQnLnC6z+YdRk4 Gxt52UMODJ6JJFoZ7bQQ6+4IJov+enx4TOJ6tyUWrTO6eu9ypEdY77NGG7fv9Qd7XdAD 09QuLINmyCiMrg899cdn+gOAjntdZcgmAR7iXV09kuUUKKpKOzKQk4DaW1fkclpgjcca e84Q== X-Gm-Message-State: ALoCoQl169gFD7pge9OIcQbCJkOJwxtyo38ifZk0hueHAiqRJgyur+rZ646m3PlP2RlQSnyoYsIprNSkcufBUozNVvAkkiSSiA== X-Received: by 10.194.80.65 with SMTP id p1mr81365678wjx.152.1452102595888; Wed, 06 Jan 2016 09:49:55 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id p9sm41704389wjy.41.2016.01.06.09.49.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jan 2016 09:49:54 -0800 (PST) Subject: Re: svn commit: r293234 - head/sys/boot/forth To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601061550.u06FoMGa004020@repo.freebsd.org> From: Steven Hartland Message-ID: <568D53CC.8000600@multiplay.co.uk> Date: Wed, 6 Jan 2016 17:50:04 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201601061550.u06FoMGa004020@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:49:58 -0000 Awesome work, just back ported this to our internal 10.2 build along size the ZFS EFI and I'm pleased to report all is working as expected :) Regards Steve On 06/01/2016 15:50, Ed Maste wrote: > Author: emaste > Date: Wed Jan 6 15:50:21 2016 > New Revision: 293234 > URL: https://svnweb.freebsd.org/changeset/base/293234 > > Log: > Enable the beastie menu for the UEFI console > > As of r293233 the UEFI console includes basic terminal emulator support. > > MFC after: 2 weeks > Relnotes: Yes > > Modified: > head/sys/boot/forth/beastie.4th > head/sys/boot/forth/beastie.4th.8 > head/sys/boot/forth/loader.conf.5 > > Modified: head/sys/boot/forth/beastie.4th > ============================================================================== > --- head/sys/boot/forth/beastie.4th Wed Jan 6 15:38:39 2016 (r293233) > +++ head/sys/boot/forth/beastie.4th Wed Jan 6 15:50:21 2016 (r293234) > @@ -85,11 +85,6 @@ variable logoY > also support-functions > > : beastie-start ( -- ) \ starts the menu > - s" console" getenv dup -1 <> if > - s" efi" 2swap contains? if > - s" set beastie_disable=YES" evaluate > - then > - else drop then > s" beastie_disable" getenv dup -1 <> if > s" YES" compare-insensitive 0= if > any_conf_read? if > > Modified: head/sys/boot/forth/beastie.4th.8 > ============================================================================== > --- head/sys/boot/forth/beastie.4th.8 Wed Jan 6 15:38:39 2016 (r293233) > +++ head/sys/boot/forth/beastie.4th.8 Wed Jan 6 15:50:21 2016 (r293234) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd April 27, 2014 > +.Dd January 6, 2016 > .Dt BEASTIE.4TH 8 > .Os > .Sh NAME > @@ -119,8 +119,7 @@ Sets the desired row position of the log > If set to > .Dq YES , > the beastie boot menu will be skipped. > -The beastie boot menu is always skipped if booting UEFI or running non-x86 > -hardware. > +The beastie boot menu is always skipped if running non-x86 hardware. > .It Va loader_delay > If set to a number higher than zero, introduces a delay before starting the > beastie boot menu. During the delay the user can press either Ctrl-C to skip > > Modified: head/sys/boot/forth/loader.conf.5 > ============================================================================== > --- head/sys/boot/forth/loader.conf.5 Wed Jan 6 15:38:39 2016 (r293233) > +++ head/sys/boot/forth/loader.conf.5 Wed Jan 6 15:50:21 2016 (r293234) > @@ -23,7 +23,7 @@ > .\" SUCH DAMAGE. > .\" > .\" $FreeBSD$ > -.Dd April 27, 2014 > +.Dd January 6, 2016 > .Dt LOADER.CONF 5 > .Os > .Sh NAME > @@ -236,8 +236,7 @@ be displayed. > If set to > .Dq YES , > the beastie boot menu will be skipped. > -The beastie boot menu is always skipped if booting UEFI or running non-x86 > -hardware. > +The beastie boot menu is always skipped if running non-x86 hardware. > .It Va loader_logo Pq Dq Li orbbw > Selects a desired logo in the beastie boot menu. > Possible values are: > From owner-svn-src-all@freebsd.org Wed Jan 6 17:53:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CAF0A64B75; Wed, 6 Jan 2016 17:53:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 445731967; Wed, 6 Jan 2016 17:53:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06HrpOx045065; Wed, 6 Jan 2016 17:53:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06HrpS9045063; Wed, 6 Jan 2016 17:53:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601061753.u06HrpS9045063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 6 Jan 2016 17:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r293243 - stable/9/usr.sbin/mailwrapper X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:53:52 -0000 Author: bdrewery Date: Wed Jan 6 17:53:51 2016 New Revision: 293243 URL: https://svnweb.freebsd.org/changeset/base/293243 Log: MFC r270675: Allow mailwrapper to use mailer.conf from localbase (respecting LOCALBASE env var if set) PR: 205965 Relnotes: yes Modified: stable/9/usr.sbin/mailwrapper/mailwrapper.8 stable/9/usr.sbin/mailwrapper/mailwrapper.c Directory Properties: stable/9/usr.sbin/mailwrapper/ (props changed) Modified: stable/9/usr.sbin/mailwrapper/mailwrapper.8 ============================================================================== --- stable/9/usr.sbin/mailwrapper/mailwrapper.8 Wed Jan 6 17:48:35 2016 (r293242) +++ stable/9/usr.sbin/mailwrapper/mailwrapper.8 Wed Jan 6 17:53:51 2016 (r293243) @@ -31,7 +31,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 7, 2006 +.Dd August 27, 2014 .Dt MAILWRAPPER 8 .Os .Sh NAME @@ -109,6 +109,8 @@ utility is designed to replace and to invoke an appropriate MTA instead of .Xr sendmail 8 based on configuration information placed in +.Pa ${LOCALBASE}/etc/mail/mailer.conf +falling back on .Pa /etc/mail/mailer.conf . This permits the administrator to configure which MTA is to be invoked on the system at run time. @@ -126,6 +128,8 @@ should be turned off in Configuration for .Nm is kept in +.Pa ${LOCALBASE}/etc/mail/mailer.conf +or .Pa /etc/mail/mailer.conf . .Pa /usr/sbin/sendmail is typically set up as a symbolic link to Modified: stable/9/usr.sbin/mailwrapper/mailwrapper.c ============================================================================== --- stable/9/usr.sbin/mailwrapper/mailwrapper.c Wed Jan 6 17:48:35 2016 (r293242) +++ stable/9/usr.sbin/mailwrapper/mailwrapper.c Wed Jan 6 17:53:51 2016 (r293243) @@ -35,6 +35,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -87,6 +89,8 @@ main(int argc, char *argv[], char *envp[ FILE *config; char *line, *cp, *from, *to, *ap; const char *progname; + char localmailerconf[MAXPATHLEN]; + const char *mailerconf; size_t len, lineno = 0; int i; struct arglist al; @@ -98,11 +102,18 @@ main(int argc, char *argv[], char *envp[ initarg(&al); addarg(&al, argv[0]); - if ((config = fopen(_PATH_MAILERCONF, "r")) == NULL) { + snprintf(localmailerconf, MAXPATHLEN, "%s/etc/mail/mailer.conf", + getenv("LOCALBASE") ? getenv("LOCALBASE") : "/usr/local"); + + mailerconf = localmailerconf; + if ((config = fopen(localmailerconf, "r")) == NULL) + mailerconf = _PATH_MAILERCONF; + + if (config == NULL && ((config = fopen(mailerconf, "r")) == NULL)) { addarg(&al, NULL); openlog(getprogname(), LOG_PID, LOG_MAIL); syslog(LOG_INFO, "cannot open %s, using %s as default MTA", - _PATH_MAILERCONF, _PATH_DEFAULTMTA); + mailerconf, _PATH_DEFAULTMTA); closelog(); execve(_PATH_DEFAULTMTA, al.argv, envp); err(EX_OSERR, "cannot exec %s", _PATH_DEFAULTMTA); @@ -112,7 +123,7 @@ main(int argc, char *argv[], char *envp[ for (;;) { if ((line = fparseln(config, &len, &lineno, NULL, 0)) == NULL) { if (feof(config)) - errx(EX_CONFIG, "no mapping in %s", _PATH_MAILERCONF); + errx(EX_CONFIG, "no mapping in %s", mailerconf); err(EX_CONFIG, "cannot parse line %lu", (u_long)lineno); } @@ -157,6 +168,6 @@ main(int argc, char *argv[], char *envp[ /*NOTREACHED*/ parse_error: errx(EX_CONFIG, "parse error in %s at line %lu", - _PATH_MAILERCONF, (u_long)lineno); + mailerconf, (u_long)lineno); /*NOTREACHED*/ } From owner-svn-src-all@freebsd.org Wed Jan 6 19:15:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0024A655F2; Wed, 6 Jan 2016 19:15:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 823161CB3; Wed, 6 Jan 2016 19:15:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06JFGEU069386; Wed, 6 Jan 2016 19:15:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06JFGBs069380; Wed, 6 Jan 2016 19:15:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061915.u06JFGBs069380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 19:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293244 - in head/sys/boot/efi: boot1 include loader loader/arch/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 19:15:17 -0000 Author: emaste Date: Wed Jan 6 19:15:16 2016 New Revision: 293244 URL: https://svnweb.freebsd.org/changeset/base/293244 Log: Introduce and use new EFI_ERROR_CODE macro for EFI errors Submitted by: smh MFC after: 1 week Modified: head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/include/efierr.h head/sys/boot/efi/loader/arch/amd64/framebuffer.c head/sys/boot/efi/loader/bootinfo.c head/sys/boot/efi/loader/copy.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Wed Jan 6 17:53:51 2016 (r293243) +++ head/sys/boot/efi/boot1/boot1.c Wed Jan 6 19:15:16 2016 (r293244) @@ -331,20 +331,20 @@ load(const char *fname) buffer, bufsize, &loaderhandle); if (EFI_ERROR(status)) printf("LoadImage failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); status = systab->BootServices->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image); if (EFI_ERROR(status)) printf("HandleProtocol failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); loaded_image->DeviceHandle = bootdevhandle; status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); if (EFI_ERROR(status)) printf("StartImage failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); } static void Modified: head/sys/boot/efi/include/efierr.h ============================================================================== --- head/sys/boot/efi/include/efierr.h Wed Jan 6 17:53:51 2016 (r293243) +++ head/sys/boot/efi/include/efierr.h Wed Jan 6 19:15:16 2016 (r293244) @@ -30,7 +30,8 @@ Revision History #define EFIWARN(a) (a) -#define EFI_ERROR(a) (((INTN) a) < 0) +#define EFI_ERROR(a) (((INTN) a) < 0) +#define EFI_ERROR_CODE(a) (a & ~EFI_ERROR_MASK) #define EFI_SUCCESS 0 Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Wed Jan 6 17:53:51 2016 (r293243) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Wed Jan 6 19:15:16 2016 (r293244) @@ -178,7 +178,7 @@ efifb_uga_find_pixel(EFI_UGA_DRAW_PROTOC printf("No change detected in frame buffer"); fail: - printf(" -- error %lu\n", status & ~EFI_ERROR_MASK); + printf(" -- error %lu\n", EFI_ERROR_CODE(status)); free(data1); return (-1); } @@ -473,7 +473,7 @@ command_gop(int argc, char *argv[]) status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop); if (EFI_ERROR(status)) { sprintf(command_errbuf, "%s: Graphics Output Protocol not " - "present (error=%lu)", argv[0], status & ~EFI_ERROR_MASK); + "present (error=%lu)", argv[0], EFI_ERROR_CODE(status)); return (CMD_ERROR); } @@ -494,7 +494,7 @@ command_gop(int argc, char *argv[]) if (EFI_ERROR(status)) { sprintf(command_errbuf, "%s: Unable to set mode to " "%u (error=%lu)", argv[0], mode, - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); return (CMD_ERROR); } } else if (!strcmp(argv[1], "get")) { @@ -541,7 +541,7 @@ command_uga(int argc, char *argv[]) status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); if (EFI_ERROR(status)) { sprintf(command_errbuf, "%s: UGA Protocol not present " - "(error=%lu)", argv[0], status & ~EFI_ERROR_MASK); + "(error=%lu)", argv[0], EFI_ERROR_CODE(status)); return (CMD_ERROR); } Modified: head/sys/boot/efi/loader/bootinfo.c ============================================================================== --- head/sys/boot/efi/loader/bootinfo.c Wed Jan 6 17:53:51 2016 (r293243) +++ head/sys/boot/efi/loader/bootinfo.c Wed Jan 6 19:15:16 2016 (r293244) @@ -290,7 +290,7 @@ bi_load_efi_data(struct preloaded_file * pages, &addr); if (EFI_ERROR(status)) { printf("%s: AllocatePages error %lu\n", __func__, - (unsigned long)(status & ~EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (ENOMEM); } @@ -306,7 +306,7 @@ bi_load_efi_data(struct preloaded_file * status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); if (EFI_ERROR(status)) { printf("%s: GetMemoryMap error %lu\n", __func__, - (unsigned long)(status & ~EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (EINVAL); } status = BS->ExitBootServices(IH, efi_mapkey); @@ -320,8 +320,7 @@ bi_load_efi_data(struct preloaded_file * } BS->FreePages(addr, pages); } - printf("ExitBootServices error %lu\n", - (unsigned long)(status & ~EFI_ERROR_MASK)); + printf("ExitBootServices error %lu\n", EFI_ERROR_CODE(status)); return (EINVAL); } Modified: head/sys/boot/efi/loader/copy.c ============================================================================== --- head/sys/boot/efi/loader/copy.c Wed Jan 6 17:53:51 2016 (r293243) +++ head/sys/boot/efi/loader/copy.c Wed Jan 6 19:15:16 2016 (r293244) @@ -56,7 +56,7 @@ efi_copy_init(void) STAGE_PAGES, &staging); if (EFI_ERROR(status)) { printf("failed to allocate staging area: %lu\n", - (unsigned long)(status & EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (status); } staging_end = staging + STAGE_PAGES * EFI_PAGE_SIZE; From owner-svn-src-all@freebsd.org Wed Jan 6 19:18:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE88DA6575C; Wed, 6 Jan 2016 19:18:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9DCA1EFE; Wed, 6 Jan 2016 19:18:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06JIhHl069536; Wed, 6 Jan 2016 19:18:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06JIhft069535; Wed, 6 Jan 2016 19:18:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061918.u06JIhft069535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 19:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293245 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 19:18:45 -0000 Author: emaste Date: Wed Jan 6 19:18:43 2016 New Revision: 293245 URL: https://svnweb.freebsd.org/changeset/base/293245 Log: loader.efi style(9) cleanup Submitted by: smh Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Wed Jan 6 19:15:16 2016 (r293244) +++ head/sys/boot/efi/loader/main.c Wed Jan 6 19:18:43 2016 (r293245) @@ -227,50 +227,47 @@ command_memmap(int argc, char *argv[]) status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver); if (status != EFI_BUFFER_TOO_SMALL) { printf("Can't determine memory map size\n"); - return CMD_ERROR; + return (CMD_ERROR); } map = malloc(sz); status = BS->GetMemoryMap(&sz, map, &key, &dsz, &dver); if (EFI_ERROR(status)) { printf("Can't read memory map\n"); - return CMD_ERROR; + return (CMD_ERROR); } ndesc = sz / dsz; printf("%23s %12s %12s %8s %4s\n", - "Type", "Physical", "Virtual", "#Pages", "Attr"); + "Type", "Physical", "Virtual", "#Pages", "Attr"); for (i = 0, p = map; i < ndesc; i++, p = NextMemoryDescriptor(p, dsz)) { - printf("%23s %012lx %012lx %08lx ", - types[p->Type], - p->PhysicalStart, - p->VirtualStart, - p->NumberOfPages); - if (p->Attribute & EFI_MEMORY_UC) - printf("UC "); - if (p->Attribute & EFI_MEMORY_WC) - printf("WC "); - if (p->Attribute & EFI_MEMORY_WT) - printf("WT "); - if (p->Attribute & EFI_MEMORY_WB) - printf("WB "); - if (p->Attribute & EFI_MEMORY_UCE) - printf("UCE "); - if (p->Attribute & EFI_MEMORY_WP) - printf("WP "); - if (p->Attribute & EFI_MEMORY_RP) - printf("RP "); - if (p->Attribute & EFI_MEMORY_XP) - printf("XP "); - printf("\n"); + printf("%23s %012lx %012lx %08lx ", types[p->Type], + p->PhysicalStart, p->VirtualStart, p->NumberOfPages); + if (p->Attribute & EFI_MEMORY_UC) + printf("UC "); + if (p->Attribute & EFI_MEMORY_WC) + printf("WC "); + if (p->Attribute & EFI_MEMORY_WT) + printf("WT "); + if (p->Attribute & EFI_MEMORY_WB) + printf("WB "); + if (p->Attribute & EFI_MEMORY_UCE) + printf("UCE "); + if (p->Attribute & EFI_MEMORY_WP) + printf("WP "); + if (p->Attribute & EFI_MEMORY_RP) + printf("RP "); + if (p->Attribute & EFI_MEMORY_XP) + printf("XP "); + printf("\n"); } - return CMD_OK; + return (CMD_OK); } -COMMAND_SET(configuration, "configuration", - "print configuration tables", command_configuration); +COMMAND_SET(configuration, "configuration", "print configuration tables", + command_configuration); static const char * guid_to_string(EFI_GUID *guid) @@ -318,7 +315,7 @@ command_configuration(int argc, char *ar printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); } - return CMD_OK; + return (CMD_OK); } @@ -395,20 +392,17 @@ command_nvram(int argc, char *argv[]) status = RS->GetNextVariableName(&varsz, NULL, NULL); for (; status != EFI_NOT_FOUND; ) { - status = RS->GetNextVariableName(&varsz, var, - &varguid); + status = RS->GetNextVariableName(&varsz, var, &varguid); //if (EFI_ERROR(status)) //break; conout->OutputString(conout, var); printf("="); datasz = 0; - status = RS->GetVariable(var, &varguid, NULL, &datasz, - NULL); + status = RS->GetVariable(var, &varguid, NULL, &datasz, NULL); /* XXX: check status */ data = malloc(datasz); - status = RS->GetVariable(var, &varguid, NULL, &datasz, - data); + status = RS->GetVariable(var, &varguid, NULL, &datasz, data); if (EFI_ERROR(status)) printf(""); else { From owner-svn-src-all@freebsd.org Wed Jan 6 19:40:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11B81A65EFA; Wed, 6 Jan 2016 19:40:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCD711AB1; Wed, 6 Jan 2016 19:40:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06Jeb0r075475; Wed, 6 Jan 2016 19:40:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06JebFW075474; Wed, 6 Jan 2016 19:40:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601061940.u06JebFW075474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 19:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293246 - stable/10/tools/regression/mac/mac_bsdextended X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 19:40:39 -0000 Author: ngie Date: Wed Jan 6 19:40:37 2016 New Revision: 293246 URL: https://svnweb.freebsd.org/changeset/base/293246 Log: MFC r292530,r292546: r292530: - Use 1 for an exit code instead of -1 with err, errx, and exit - Add unistd.h for getuid(3) - Sort #includes r292546: - Convert testcase to TAP format - Use nitems(x) instead of handrolled sizeof(x) / sizeof(*x) macro - Do not mark count != 0 case with bsde_get_rule_count as a failure; this generates false positives on systems with ugidfw rules set on it Modified: stable/10/tools/regression/mac/mac_bsdextended/test_ugidfw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/mac/mac_bsdextended/test_ugidfw.c ============================================================================== --- stable/10/tools/regression/mac/mac_bsdextended/test_ugidfw.c Wed Jan 6 19:18:43 2016 (r293245) +++ stable/10/tools/regression/mac/mac_bsdextended/test_ugidfw.c Wed Jan 6 19:40:37 2016 (r293246) @@ -33,24 +33,19 @@ #include #include +#include #include #include -#include #include #include #include +#include +#include /* * Starting point for a regression test for mac_bsdextended(4) and the * supporting libugidfw(3). */ -void -usage(void) -{ - - fprintf(stderr, "test_ugidfw\n"); - exit(-1); -} /* * This section of the regression test passes some test cases through the @@ -68,7 +63,6 @@ static const char *test_users[] = { "operator", "bin", }; -static const int test_users_len = sizeof(test_users) / sizeof(char *); static const char *test_groups[] = { "wheel", @@ -76,7 +70,8 @@ static const char *test_groups[] = { "operator", "bin", }; -static const int test_groups_len = sizeof(test_groups) / sizeof(char *); + +int test_num; /* * List of test strings that must go in (and come out) of libugidfw intact. @@ -147,7 +142,6 @@ static const char *test_strings[] = { "object ! uid root:daemon gid daemon filesys / suid sgid uid_of_subject gid_of_subject ! type r " "mode rsx", }; -static const int test_strings_len = sizeof(test_strings) / sizeof(char *); static void test_libugidfw_strings(void) @@ -155,52 +149,68 @@ test_libugidfw_strings(void) struct mac_bsdextended_rule rule; char errorstr[256]; char rulestr[256]; - int i, error; + int error, i; - for (i = 0; i < test_users_len; i++) { + for (i = 0; i < nitems(test_users); i++, test_num++) { if (getpwnam(test_users[i]) == NULL) - err(-1, "test_libugidfw_strings: getpwnam: %s", - test_users[i]); + printf("not ok %d # test_libugidfw_strings: getpwnam(%s) " + "failed: %s\n", test_num, test_users[i], strerror(errno)); + else + printf("ok %d\n", test_num); } - for (i = 0; i < test_groups_len; i++) { + for (i = 0; i < nitems(test_groups); i++, test_num++) { if (getgrnam(test_groups[i]) == NULL) - err(-1, "test_libugidfw_strings: getgrnam: %s", - test_groups[i]); + printf("not ok %d # test_libugidfw_strings: getgrnam(%s) " + "failed: %s\n", test_num, test_groups[i], strerror(errno)); + else + printf("ok %d\n", test_num); } - for (i = 0; i < test_strings_len; i++) { + for (i = 0; i < nitems(test_strings); i++) { error = bsde_parse_rule_string(test_strings[i], &rule, sizeof(errorstr), errorstr); if (error == -1) - errx(-1, "bsde_parse_rule_string: '%s' (%d): %s", - test_strings[i], i, errorstr); + printf("not ok %d # bsde_parse_rule_string: '%s' (%d) " + "failed: %s\n", test_num, test_strings[i], i, errorstr); + else + printf("ok %d\n", test_num); + test_num++; + error = bsde_rule_to_string(&rule, rulestr, sizeof(rulestr)); if (error < 0) - errx(-1, "bsde_rule_to_string: rule for '%s' " - "returned %d", test_strings[i], error); + printf("not ok %d # bsde_rule_to_string: rule for '%s' " + "returned %d\n", test_num, test_strings[i], error); + else + printf("ok %d\n", test_num); + test_num++; if (strcmp(test_strings[i], rulestr) != 0) - errx(-1, "test_libugidfw: '%s' in, '%s' out", - test_strings[i], rulestr); + printf("not ok %d # test_libugidfw: '%s' in, '%s' " + "out\n", test_num, test_strings[i], rulestr); + else + printf("ok %d\n", test_num); + test_num++; } } int -main(int argc, char *argv[]) +main(void) { char errorstr[256]; int count, slots; - if (argc != 1) - usage(); + test_num = 1; /* Print an error if a non-root user attemps to run the tests. */ if (getuid() != 0) { - fprintf(stderr, "Error! Only root may run this utility\n"); - return (EXIT_FAILURE); + printf("1..0 # SKIP you must be root\n"); + return (0); } + printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + + 3 * nitems(test_strings) + 2); + /* * We can test some parts of the library without the MAC Framework * and policy loaded, so run those tests before calling @@ -210,12 +220,15 @@ main(int argc, char *argv[]) switch (mac_is_present("bsdextended")) { case -1: - err(-1, "mac_is_present"); + printf("1..0 # SKIP mac_is_present failed: %s\n", + strerror(errno)); + return (0); case 1: break; case 0: default: - errx(-1, "mac_bsdextended not loaded"); + printf("1..0 # SKIP mac_bsdextended not loaded\n"); + return (0); } /* @@ -226,13 +239,19 @@ main(int argc, char *argv[]) */ count = bsde_get_rule_count(sizeof(errorstr), errorstr); if (count == -1) - errx(-1, "bsde_get_rule_count: %s", errorstr); - if (count != 0) - errx(-1, "bsde_get_rule_count: %d rules", count); + printf("not ok %d # bsde_get_rule_count: %s\n", test_num, + errorstr); + else + printf("ok %d\n", test_num); + + test_num++; slots = bsde_get_rule_slots(sizeof(errorstr), errorstr); if (slots == -1) - errx(-1, "bsde_get_rule_slots: %s", errorstr); + printf("not ok %d # bsde_get_rule_slots: %s\n", test_num, + errorstr); + else + printf("ok %d\n", test_num); return (0); } From owner-svn-src-all@freebsd.org Wed Jan 6 19:41:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3107BA65F4B; Wed, 6 Jan 2016 19:41:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3F601C44; Wed, 6 Jan 2016 19:41:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06Jf73R078108; Wed, 6 Jan 2016 19:41:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06Jf7np078107; Wed, 6 Jan 2016 19:41:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061941.u06Jf7np078107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 19:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293247 - head/contrib/llvm/projects/libunwind/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 19:41:08 -0000 Author: emaste Date: Wed Jan 6 19:41:06 2016 New Revision: 293247 URL: https://svnweb.freebsd.org/changeset/base/293247 Log: libunwind: Include header for dl_unwind_find_exidx for ARM EHABI Modified: head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Modified: head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Wed Jan 6 19:40:37 2016 (r293246) +++ head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Wed Jan 6 19:41:06 2016 (r293247) @@ -37,6 +37,7 @@ namespace libunwind { #if _LIBUNWIND_ARM_EHABI #if defined(__FreeBSD__) +#include typedef void *_Unwind_Ptr; #elif defined(__linux__) From owner-svn-src-all@freebsd.org Wed Jan 6 20:01:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E80E7A65641; Wed, 6 Jan 2016 20:01:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85330185E; Wed, 6 Jan 2016 20:01:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K14IK082080; Wed, 6 Jan 2016 20:01:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K13xg082064; Wed, 6 Jan 2016 20:01:03 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601062001.u06K13xg082064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 Jan 2016 20:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293248 - in vendor/llvm/dist: docs include/llvm/Analysis include/llvm/CodeGen include/llvm/IR include/llvm/MC include/llvm/ProfileData include/llvm/Support include/llvm/TableGen includ... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:01:06 -0000 Author: dim Date: Wed Jan 6 20:01:02 2016 New Revision: 293248 URL: https://svnweb.freebsd.org/changeset/base/293248 Log: Vendor import of llvm trunk r256945: https://llvm.org/svn/llvm-project/llvm/trunk@256945 Added: vendor/llvm/dist/lib/Fuzzer/test/ThreadedTest.cpp (contents, props changed) vendor/llvm/dist/lib/Fuzzer/test/fuzzer-threaded.test vendor/llvm/dist/lib/Target/Hexagon/HexagonSystemInst.td vendor/llvm/dist/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp (contents, props changed) vendor/llvm/dist/lib/Target/X86/X86ShuffleDecodeConstantPool.h (contents, props changed) vendor/llvm/dist/test/Analysis/GlobalsModRef/inaccessiblememonly.ll vendor/llvm/dist/test/Analysis/ValueTracking/known-power-of-two.ll vendor/llvm/dist/test/CodeGen/AMDGPU/spill-alloc-sgpr-init-bug.ll vendor/llvm/dist/test/CodeGen/X86/copy-eflags.ll vendor/llvm/dist/test/CodeGen/X86/insertelement-zero.ll vendor/llvm/dist/test/CodeGen/X86/insertps-combine.ll vendor/llvm/dist/test/CodeGen/X86/materialize-one.ll vendor/llvm/dist/test/CodeGen/X86/pku.ll vendor/llvm/dist/test/CodeGen/X86/x86-64-flags-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/x86-flags-intrinsics.ll vendor/llvm/dist/test/Transforms/LICM/funclet.ll vendor/llvm/dist/test/Transforms/MemCpyOpt/fca2memcpy.ll vendor/llvm/dist/test/Transforms/PlaceSafepoints/leaf-function.ll vendor/llvm/dist/test/Transforms/Reassociate/factorize-again.ll vendor/llvm/dist/test/Transforms/SimplifyCFG/empty-catchpad.ll Deleted: vendor/llvm/dist/test/Analysis/GlobalsModRef/argmemonly-escape.ll vendor/llvm/dist/test/CodeGen/X86/materialize.ll Modified: vendor/llvm/dist/docs/CMake.rst vendor/llvm/dist/docs/CoverageMappingFormat.rst vendor/llvm/dist/docs/GettingStarted.rst vendor/llvm/dist/docs/MCJITDesignAndImplementation.rst vendor/llvm/dist/include/llvm/Analysis/MemoryBuiltins.h vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBuilder.h vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBundle.h vendor/llvm/dist/include/llvm/CodeGen/WinEHFuncInfo.h vendor/llvm/dist/include/llvm/IR/CallSite.h vendor/llvm/dist/include/llvm/IR/IRBuilder.h vendor/llvm/dist/include/llvm/IR/Instructions.h vendor/llvm/dist/include/llvm/IR/IntrinsicsX86.td vendor/llvm/dist/include/llvm/IR/Metadata.h vendor/llvm/dist/include/llvm/IR/Statepoint.h vendor/llvm/dist/include/llvm/MC/SubtargetFeature.h vendor/llvm/dist/include/llvm/ProfileData/InstrProf.h vendor/llvm/dist/include/llvm/ProfileData/InstrProfData.inc vendor/llvm/dist/include/llvm/Support/ARMTargetParser.def vendor/llvm/dist/include/llvm/Support/Program.h vendor/llvm/dist/include/llvm/Support/YAMLParser.h vendor/llvm/dist/include/llvm/TableGen/Record.h vendor/llvm/dist/include/llvm/Target/Target.td vendor/llvm/dist/include/llvm/Target/TargetLowering.h vendor/llvm/dist/include/llvm/Transforms/Utils/BypassSlowDivision.h vendor/llvm/dist/include/llvm/Transforms/Utils/LoopUtils.h vendor/llvm/dist/lib/Analysis/BasicAliasAnalysis.cpp vendor/llvm/dist/lib/Analysis/GlobalsModRef.cpp vendor/llvm/dist/lib/Analysis/MemoryBuiltins.cpp vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/TargetLibraryInfo.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/Bitcode/Reader/BitcodeReader.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/WinException.cpp vendor/llvm/dist/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm/dist/lib/CodeGen/MachineCSE.cpp vendor/llvm/dist/lib/CodeGen/MachineInstr.cpp vendor/llvm/dist/lib/CodeGen/MachineInstrBundle.cpp vendor/llvm/dist/lib/CodeGen/RegisterPressure.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/StatepointLowering.cpp vendor/llvm/dist/lib/CodeGen/TargetSchedule.cpp vendor/llvm/dist/lib/CodeGen/WinEHPrepare.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerDriver.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerFlags.def vendor/llvm/dist/lib/Fuzzer/FuzzerInternal.h vendor/llvm/dist/lib/Fuzzer/FuzzerLoop.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerMutate.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerTraceState.cpp vendor/llvm/dist/lib/Fuzzer/test/CMakeLists.txt vendor/llvm/dist/lib/Fuzzer/test/fuzzer.test vendor/llvm/dist/lib/IR/AsmWriter.cpp vendor/llvm/dist/lib/IR/Attributes.cpp vendor/llvm/dist/lib/IR/Instruction.cpp vendor/llvm/dist/lib/IR/Instructions.cpp vendor/llvm/dist/lib/IR/Metadata.cpp vendor/llvm/dist/lib/IR/Statepoint.cpp vendor/llvm/dist/lib/IR/Verifier.cpp vendor/llvm/dist/lib/Linker/IRMover.cpp vendor/llvm/dist/lib/MC/MCDwarf.cpp vendor/llvm/dist/lib/MC/MCObjectFileInfo.cpp vendor/llvm/dist/lib/MC/MCSubtargetInfo.cpp vendor/llvm/dist/lib/MC/SubtargetFeature.cpp vendor/llvm/dist/lib/ProfileData/CoverageMappingReader.cpp vendor/llvm/dist/lib/ProfileData/InstrProf.cpp vendor/llvm/dist/lib/Support/Unix/Program.inc vendor/llvm/dist/lib/Support/Windows/Program.inc vendor/llvm/dist/lib/Support/Windows/WindowsSupport.h vendor/llvm/dist/lib/Support/raw_ostream.cpp vendor/llvm/dist/lib/TableGen/Record.cpp vendor/llvm/dist/lib/TableGen/TGParser.cpp vendor/llvm/dist/lib/TableGen/TGParser.h vendor/llvm/dist/lib/Target/AArch64/AArch64.td vendor/llvm/dist/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.h vendor/llvm/dist/lib/Target/AArch64/Utils/AArch64BaseInfo.cpp vendor/llvm/dist/lib/Target/AArch64/Utils/AArch64BaseInfo.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h vendor/llvm/dist/lib/Target/AMDGPU/CIInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIFrameLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.td vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/VIInstructions.td vendor/llvm/dist/lib/Target/ARM/ARM.td vendor/llvm/dist/lib/Target/ARM/ARMConstantIslandPass.cpp vendor/llvm/dist/lib/Target/ARM/ARMLoadStoreOptimizer.cpp vendor/llvm/dist/lib/Target/ARM/ARMSubtarget.h vendor/llvm/dist/lib/Target/Hexagon/Hexagon.td vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfo.td vendor/llvm/dist/lib/Target/WebAssembly/known_gcc_test_failures.txt vendor/llvm/dist/lib/Target/X86/CMakeLists.txt vendor/llvm/dist/lib/Target/X86/InstPrinter/X86InstComments.cpp vendor/llvm/dist/lib/Target/X86/Utils/X86ShuffleDecode.cpp vendor/llvm/dist/lib/Target/X86/Utils/X86ShuffleDecode.h vendor/llvm/dist/lib/Target/X86/X86FastISel.cpp vendor/llvm/dist/lib/Target/X86/X86FrameLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.h vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td vendor/llvm/dist/lib/Target/X86/X86InstrCompiler.td vendor/llvm/dist/lib/Target/X86/X86InstrInfo.cpp vendor/llvm/dist/lib/Target/X86/X86InstrInfo.h vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td vendor/llvm/dist/lib/Target/X86/X86InstrMMX.td vendor/llvm/dist/lib/Target/X86/X86InstrMPX.td vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Target/X86/X86InstrSystem.td vendor/llvm/dist/lib/Target/X86/X86IntrinsicsInfo.h vendor/llvm/dist/lib/Target/X86/X86MCInstLower.cpp vendor/llvm/dist/lib/Transforms/IPO/InferFunctionAttrs.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCasts.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineInternal.h vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineVectorOps.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/InstrProfiling.cpp vendor/llvm/dist/lib/Transforms/Scalar/LICM.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopIdiomRecognize.cpp vendor/llvm/dist/lib/Transforms/Scalar/MemCpyOptimizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/Reassociate.cpp vendor/llvm/dist/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp vendor/llvm/dist/lib/Transforms/Utils/BypassSlowDivision.cpp vendor/llvm/dist/lib/Transforms/Utils/Local.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyLibCalls.cpp vendor/llvm/dist/lib/Transforms/Utils/ValueMapper.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/test/Analysis/BasicAA/memset_pattern.ll vendor/llvm/dist/test/Analysis/GlobalsModRef/modreftest.ll vendor/llvm/dist/test/Bitcode/compatibility.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-vector-ext.ll vendor/llvm/dist/test/CodeGen/AArch64/cpus.ll vendor/llvm/dist/test/CodeGen/AArch64/remat.ll vendor/llvm/dist/test/CodeGen/AArch64/tbz-tbnz.ll vendor/llvm/dist/test/CodeGen/AMDGPU/flat-scratch-reg.ll vendor/llvm/dist/test/CodeGen/AMDGPU/large-alloca-compute.ll vendor/llvm/dist/test/CodeGen/AMDGPU/large-alloca-graphics.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load.ll vendor/llvm/dist/test/CodeGen/AMDGPU/salu-to-valu.ll vendor/llvm/dist/test/CodeGen/ARM/build-attributes.ll vendor/llvm/dist/test/CodeGen/ARM/debugtrap.ll vendor/llvm/dist/test/CodeGen/WebAssembly/offset.ll vendor/llvm/dist/test/CodeGen/WinEH/wineh-cloning.ll vendor/llvm/dist/test/CodeGen/X86/2009-06-03-Win64SpillXMM.ll vendor/llvm/dist/test/CodeGen/X86/2011-11-30-or.ll vendor/llvm/dist/test/CodeGen/X86/avx-cast.ll vendor/llvm/dist/test/CodeGen/X86/avx512-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512bw-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512bwvl-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512cd-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512vl-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/cmpxchg-clobber-flags.ll vendor/llvm/dist/test/CodeGen/X86/divrem8_ext.ll vendor/llvm/dist/test/CodeGen/X86/fold-load-unops.ll vendor/llvm/dist/test/CodeGen/X86/fpcmp-soft-fp.ll vendor/llvm/dist/test/CodeGen/X86/inline-sse.ll vendor/llvm/dist/test/CodeGen/X86/peephole-na-phys-copy-folding.ll vendor/llvm/dist/test/CodeGen/X86/powi.ll vendor/llvm/dist/test/CodeGen/X86/pr11415.ll vendor/llvm/dist/test/CodeGen/X86/pr21792.ll vendor/llvm/dist/test/CodeGen/X86/pr24139.ll vendor/llvm/dist/test/CodeGen/X86/sse3-avx-addsub.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-far-call.ll vendor/llvm/dist/test/CodeGen/X86/system-intrinsics-64-xsave.ll vendor/llvm/dist/test/CodeGen/X86/system-intrinsics-64-xsavec.ll vendor/llvm/dist/test/CodeGen/X86/system-intrinsics-64-xsaveopt.ll vendor/llvm/dist/test/CodeGen/X86/system-intrinsics-64-xsaves.ll vendor/llvm/dist/test/CodeGen/X86/system-intrinsics-xsave.ll vendor/llvm/dist/test/CodeGen/X86/system-intrinsics-xsavec.ll vendor/llvm/dist/test/CodeGen/X86/system-intrinsics-xsaveopt.ll vendor/llvm/dist/test/CodeGen/X86/system-intrinsics-xsaves.ll vendor/llvm/dist/test/CodeGen/X86/vec_insert-7.ll vendor/llvm/dist/test/CodeGen/X86/vec_partial.ll vendor/llvm/dist/test/CodeGen/X86/vec_reassociate.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-128-v4.ll vendor/llvm/dist/test/CodeGen/X86/win64_frame.ll vendor/llvm/dist/test/CodeGen/X86/wineh-coreclr.ll vendor/llvm/dist/test/CodeGen/X86/x86-32-intrcc.ll vendor/llvm/dist/test/CodeGen/X86/x86-64-intrcc.ll vendor/llvm/dist/test/CodeGen/X86/x86-win64-shrink-wrapping.ll vendor/llvm/dist/test/DebugInfo/COFF/asm.ll vendor/llvm/dist/test/DebugInfo/debugmacinfo.test vendor/llvm/dist/test/JitListener/multiple.ll vendor/llvm/dist/test/JitListener/simple.ll vendor/llvm/dist/test/MC/ARM/gas-compl-copr-reg.s vendor/llvm/dist/test/Transforms/EarlyCSE/AArch64/ldstN.ll vendor/llvm/dist/test/Transforms/InferFunctionAttrs/annotate.ll vendor/llvm/dist/test/Transforms/InstCombine/double-float-shrink-1.ll vendor/llvm/dist/test/Transforms/InstCombine/fast-math.ll vendor/llvm/dist/test/Transforms/InstCombine/insert-extract-shuffle.ll vendor/llvm/dist/test/Transforms/InstCombine/token.ll vendor/llvm/dist/test/Transforms/InstSimplify/call.ll vendor/llvm/dist/test/Transforms/LICM/sinking.ll vendor/llvm/dist/test/Transforms/PlaceSafepoints/statepoint-coreclr.ll vendor/llvm/dist/test/Transforms/Reassociate/secondary.ll vendor/llvm/dist/test/Transforms/SimplifyCFG/wineh-unreachable.ll vendor/llvm/dist/test/Verifier/invalid-eh.ll vendor/llvm/dist/test/tools/llvm-pdbdump/class-layout.test vendor/llvm/dist/test/tools/llvm-pdbdump/enum-layout.test vendor/llvm/dist/test/tools/llvm-pdbdump/load-address.test vendor/llvm/dist/test/tools/llvm-symbolizer/pdb/lit.local.cfg vendor/llvm/dist/unittests/IR/IRBuilderTest.cpp vendor/llvm/dist/unittests/IR/MetadataTest.cpp vendor/llvm/dist/unittests/IR/TypesTest.cpp vendor/llvm/dist/unittests/ProfileData/InstrProfTest.cpp vendor/llvm/dist/unittests/Support/YAMLParserTest.cpp vendor/llvm/dist/utils/TableGen/AsmMatcherEmitter.cpp vendor/llvm/dist/utils/TableGen/SubtargetEmitter.cpp vendor/llvm/dist/utils/TableGen/TableGen.cpp Modified: vendor/llvm/dist/docs/CMake.rst ============================================================================== --- vendor/llvm/dist/docs/CMake.rst Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/docs/CMake.rst Wed Jan 6 20:01:02 2016 (r293248) @@ -26,7 +26,10 @@ Quick start We use here the command-line, non-interactive CMake interface. #. `Download `_ and install - CMake. Version 2.8.8 is the minimum required. + CMake. Version 2.8.8 is the minimum required, but if you're using the Ninja + backend, CMake v3.2 or newer is required to `get interactive output + `_ + when running :doc:`Lit `. #. Open a shell. Your development tools must be reachable from this shell through the PATH environment variable. Modified: vendor/llvm/dist/docs/CoverageMappingFormat.rst ============================================================================== --- vendor/llvm/dist/docs/CoverageMappingFormat.rst Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/docs/CoverageMappingFormat.rst Wed Jan 6 20:01:02 2016 (r293248) @@ -241,15 +241,25 @@ For example, let’s consider a C file a return 13; } -The coverage mapping variable generated by Clang is: +The coverage mapping variable generated by Clang has 3 fields: + +* Coverage mapping header. + +* An array of function records. + +* Coverage mapping data which is an array of bytes. Zero paddings are added at the end to force 8 byte alignment. .. code-block:: llvm - @__llvm_coverage_mapping = internal constant { i32, i32, i32, i32, [2 x { i8*, i32, i32 }], [40 x i8] } - { i32 2, ; The number of function records - i32 20, ; The length of the string that contains the encoded translation unit filenames - i32 20, ; The length of the string that contains the encoded coverage mapping data - i32 0, ; Coverage mapping format version + @__llvm_coverage_mapping = internal constant { { i32, i32, i32, i32 }, [2 x { i8*, i32, i32 }], [40 x i8] } + { + { i32, i32, i32, i32 } ; Coverage map header + { + i32 2, ; The number of function records + i32 20, ; The length of the string that contains the encoded translation unit filenames + i32 20, ; The length of the string that contains the encoded coverage mapping data + i32 0, ; Coverage mapping format version + }, [2 x { i8*, i32, i32 }] [ ; Function records { i8*, i32, i32 } { i8* getelementptr inbounds ([3 x i8]* @__llvm_profile_name_foo, i32 0, i32 0), ; Function's name i32 3, ; Function's name length @@ -262,12 +272,18 @@ The coverage mapping variable generated [40 x i8] c"..." ; Encoded data (dissected later) }, section "__llvm_covmap", align 8 -Version: --------- +Coverage Mapping Header: +------------------------ + +The coverage mapping header has the following fields: + +* The number of function records. + +* The length of the string in the third field of *__llvm_coverage_mapping* that contains the encoded translation unit filenames. -The coverage mapping version number can have the following values: +* The length of the string in the third field of *__llvm_coverage_mapping* that contains the encoded coverage mapping data. -* 0 — The first (current) version of the coverage mapping format. +* The format version. 0 is the first (current) version of the coverage mapping format. .. _function records: @@ -331,7 +347,7 @@ IR for the `coverage mapping sample`_ th * The length of the substring that contains the encoded coverage mapping data for the first function is the value of the third field in the first structure in an array of `function records`_ stored in the - fifth field of the *__llvm_coverage_mapping* structure, which is the 9. + third field of the *__llvm_coverage_mapping* structure, which is the 9. Therefore, the coverage mapping for the first function record is encoded in this string: @@ -351,7 +367,7 @@ IR for the `coverage mapping sample`_ th | ``0x01`` | The number of mapping regions that are stored in an array for the function's file id #0. | +----------+-------------------------------------------------------------------------------------------------------------------------+ | ``0x01`` | The coverage mapping counter for the first region in this function. The value of 1 tells us that it's a coverage | - | | mapping counter that is a reference ot the profile instrumentation counter with an index of 0. | + | | mapping counter that is a reference to the profile instrumentation counter with an index of 0. | +----------+-------------------------------------------------------------------------------------------------------------------------+ | ``0x01`` | The starting line of the first mapping region in this function. | +----------+-------------------------------------------------------------------------------------------------------------------------+ Modified: vendor/llvm/dist/docs/GettingStarted.rst ============================================================================== --- vendor/llvm/dist/docs/GettingStarted.rst Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/docs/GettingStarted.rst Wed Jan 6 20:01:02 2016 (r293248) @@ -78,6 +78,8 @@ Here's the short story for getting up an The usual build uses `CMake `_. If you would rather use autotools, see `Building LLVM with autotools `_. + Although the build is known to work with CMake >= 2.8.8, we recommend CMake + >= v3.2, especially if you're generating Ninja build files. * ``cd where you want to build llvm`` * ``mkdir build`` Modified: vendor/llvm/dist/docs/MCJITDesignAndImplementation.rst ============================================================================== --- vendor/llvm/dist/docs/MCJITDesignAndImplementation.rst Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/docs/MCJITDesignAndImplementation.rst Wed Jan 6 20:01:02 2016 (r293248) @@ -1,180 +1,180 @@ -=============================== -MCJIT Design and Implementation -=============================== - -Introduction -============ - -This document describes the internal workings of the MCJIT execution -engine and the RuntimeDyld component. It is intended as a high level -overview of the implementation, showing the flow and interactions of -objects throughout the code generation and dynamic loading process. - -Engine Creation -=============== - -In most cases, an EngineBuilder object is used to create an instance of -the MCJIT execution engine. The EngineBuilder takes an llvm::Module -object as an argument to its constructor. The client may then set various -options that we control the later be passed along to the MCJIT engine, -including the selection of MCJIT as the engine type to be created. -Of particular interest is the EngineBuilder::setMCJITMemoryManager -function. If the client does not explicitly create a memory manager at -this time, a default memory manager (specifically SectionMemoryManager) -will be created when the MCJIT engine is instantiated. - -Once the options have been set, a client calls EngineBuilder::create to -create an instance of the MCJIT engine. If the client does not use the -form of this function that takes a TargetMachine as a parameter, a new -TargetMachine will be created based on the target triple associated with -the Module that was used to create the EngineBuilder. - -.. image:: MCJIT-engine-builder.png - -EngineBuilder::create will call the static MCJIT::createJIT function, -passing in its pointers to the module, memory manager and target machine -objects, all of which will subsequently be owned by the MCJIT object. - -The MCJIT class has a member variable, Dyld, which contains an instance of -the RuntimeDyld wrapper class. This member will be used for -communications between MCJIT and the actual RuntimeDyldImpl object that -gets created when an object is loaded. - -.. image:: MCJIT-creation.png - -Upon creation, MCJIT holds a pointer to the Module object that it received -from EngineBuilder but it does not immediately generate code for this -module. Code generation is deferred until either the -MCJIT::finalizeObject method is called explicitly or a function such as -MCJIT::getPointerToFunction is called which requires the code to have been -generated. - -Code Generation -=============== - -When code generation is triggered, as described above, MCJIT will first -attempt to retrieve an object image from its ObjectCache member, if one -has been set. If a cached object image cannot be retrieved, MCJIT will -call its emitObject method. MCJIT::emitObject uses a local PassManager -instance and creates a new ObjectBufferStream instance, both of which it -passes to TargetMachine::addPassesToEmitMC before calling PassManager::run -on the Module with which it was created. - -.. image:: MCJIT-load.png - -The PassManager::run call causes the MC code generation mechanisms to emit -a complete relocatable binary object image (either in either ELF or MachO -format, depending on the target) into the ObjectBufferStream object, which -is flushed to complete the process. If an ObjectCache is being used, the -image will be passed to the ObjectCache here. - -At this point, the ObjectBufferStream contains the raw object image. -Before the code can be executed, the code and data sections from this -image must be loaded into suitable memory, relocations must be applied and -memory permission and code cache invalidation (if required) must be completed. - -Object Loading -============== - -Once an object image has been obtained, either through code generation or -having been retrieved from an ObjectCache, it is passed to RuntimeDyld to -be loaded. The RuntimeDyld wrapper class examines the object to determine -its file format and creates an instance of either RuntimeDyldELF or -RuntimeDyldMachO (both of which derive from the RuntimeDyldImpl base -class) and calls the RuntimeDyldImpl::loadObject method to perform that -actual loading. - -.. image:: MCJIT-dyld-load.png - -RuntimeDyldImpl::loadObject begins by creating an ObjectImage instance -from the ObjectBuffer it received. ObjectImage, which wraps the -ObjectFile class, is a helper class which parses the binary object image -and provides access to the information contained in the format-specific -headers, including section, symbol and relocation information. - -RuntimeDyldImpl::loadObject then iterates through the symbols in the -image. Information about common symbols is collected for later use. For -each function or data symbol, the associated section is loaded into memory -and the symbol is stored in a symbol table map data structure. When the -iteration is complete, a section is emitted for the common symbols. - -Next, RuntimeDyldImpl::loadObject iterates through the sections in the -object image and for each section iterates through the relocations for -that sections. For each relocation, it calls the format-specific -processRelocationRef method, which will examine the relocation and store -it in one of two data structures, a section-based relocation list map and -an external symbol relocation map. - -.. image:: MCJIT-load-object.png - -When RuntimeDyldImpl::loadObject returns, all of the code and data -sections for the object will have been loaded into memory allocated by the -memory manager and relocation information will have been prepared, but the -relocations have not yet been applied and the generated code is still not -ready to be executed. - -[Currently (as of August 2013) the MCJIT engine will immediately apply -relocations when loadObject completes. However, this shouldn't be -happening. Because the code may have been generated for a remote target, -the client should be given a chance to re-map the section addresses before -relocations are applied. It is possible to apply relocations multiple -times, but in the case where addresses are to be re-mapped, this first -application is wasted effort.] - -Address Remapping -================= - -At any time after initial code has been generated and before -finalizeObject is called, the client can remap the address of sections in -the object. Typically this is done because the code was generated for an -external process and is being mapped into that process' address space. -The client remaps the section address by calling MCJIT::mapSectionAddress. -This should happen before the section memory is copied to its new -location. - -When MCJIT::mapSectionAddress is called, MCJIT passes the call on to -RuntimeDyldImpl (via its Dyld member). RuntimeDyldImpl stores the new -address in an internal data structure but does not update the code at this -time, since other sections are likely to change. - -When the client is finished remapping section addresses, it will call -MCJIT::finalizeObject to complete the remapping process. - -Final Preparations -================== - -When MCJIT::finalizeObject is called, MCJIT calls -RuntimeDyld::resolveRelocations. This function will attempt to locate any -external symbols and then apply all relocations for the object. - -External symbols are resolved by calling the memory manager's -getPointerToNamedFunction method. The memory manager will return the -address of the requested symbol in the target address space. (Note, this -may not be a valid pointer in the host process.) RuntimeDyld will then -iterate through the list of relocations it has stored which are associated -with this symbol and invoke the resolveRelocation method which, through an -format-specific implementation, will apply the relocation to the loaded -section memory. - -Next, RuntimeDyld::resolveRelocations iterates through the list of -sections and for each section iterates through a list of relocations that -have been saved which reference that symbol and call resolveRelocation for -each entry in this list. The relocation list here is a list of -relocations for which the symbol associated with the relocation is located -in the section associated with the list. Each of these locations will -have a target location at which the relocation will be applied that is -likely located in a different section. - -.. image:: MCJIT-resolve-relocations.png - -Once relocations have been applied as described above, MCJIT calls -RuntimeDyld::getEHFrameSection, and if a non-zero result is returned -passes the section data to the memory manager's registerEHFrames method. -This allows the memory manager to call any desired target-specific -functions, such as registering the EH frame information with a debugger. - -Finally, MCJIT calls the memory manager's finalizeMemory method. In this -method, the memory manager will invalidate the target code cache, if -necessary, and apply final permissions to the memory pages it has -allocated for code and data memory. - +=============================== +MCJIT Design and Implementation +=============================== + +Introduction +============ + +This document describes the internal workings of the MCJIT execution +engine and the RuntimeDyld component. It is intended as a high level +overview of the implementation, showing the flow and interactions of +objects throughout the code generation and dynamic loading process. + +Engine Creation +=============== + +In most cases, an EngineBuilder object is used to create an instance of +the MCJIT execution engine. The EngineBuilder takes an llvm::Module +object as an argument to its constructor. The client may then set various +options that we control the later be passed along to the MCJIT engine, +including the selection of MCJIT as the engine type to be created. +Of particular interest is the EngineBuilder::setMCJITMemoryManager +function. If the client does not explicitly create a memory manager at +this time, a default memory manager (specifically SectionMemoryManager) +will be created when the MCJIT engine is instantiated. + +Once the options have been set, a client calls EngineBuilder::create to +create an instance of the MCJIT engine. If the client does not use the +form of this function that takes a TargetMachine as a parameter, a new +TargetMachine will be created based on the target triple associated with +the Module that was used to create the EngineBuilder. + +.. image:: MCJIT-engine-builder.png + +EngineBuilder::create will call the static MCJIT::createJIT function, +passing in its pointers to the module, memory manager and target machine +objects, all of which will subsequently be owned by the MCJIT object. + +The MCJIT class has a member variable, Dyld, which contains an instance of +the RuntimeDyld wrapper class. This member will be used for +communications between MCJIT and the actual RuntimeDyldImpl object that +gets created when an object is loaded. + +.. image:: MCJIT-creation.png + +Upon creation, MCJIT holds a pointer to the Module object that it received +from EngineBuilder but it does not immediately generate code for this +module. Code generation is deferred until either the +MCJIT::finalizeObject method is called explicitly or a function such as +MCJIT::getPointerToFunction is called which requires the code to have been +generated. + +Code Generation +=============== + +When code generation is triggered, as described above, MCJIT will first +attempt to retrieve an object image from its ObjectCache member, if one +has been set. If a cached object image cannot be retrieved, MCJIT will +call its emitObject method. MCJIT::emitObject uses a local PassManager +instance and creates a new ObjectBufferStream instance, both of which it +passes to TargetMachine::addPassesToEmitMC before calling PassManager::run +on the Module with which it was created. + +.. image:: MCJIT-load.png + +The PassManager::run call causes the MC code generation mechanisms to emit +a complete relocatable binary object image (either in either ELF or MachO +format, depending on the target) into the ObjectBufferStream object, which +is flushed to complete the process. If an ObjectCache is being used, the +image will be passed to the ObjectCache here. + +At this point, the ObjectBufferStream contains the raw object image. +Before the code can be executed, the code and data sections from this +image must be loaded into suitable memory, relocations must be applied and +memory permission and code cache invalidation (if required) must be completed. + +Object Loading +============== + +Once an object image has been obtained, either through code generation or +having been retrieved from an ObjectCache, it is passed to RuntimeDyld to +be loaded. The RuntimeDyld wrapper class examines the object to determine +its file format and creates an instance of either RuntimeDyldELF or +RuntimeDyldMachO (both of which derive from the RuntimeDyldImpl base +class) and calls the RuntimeDyldImpl::loadObject method to perform that +actual loading. + +.. image:: MCJIT-dyld-load.png + +RuntimeDyldImpl::loadObject begins by creating an ObjectImage instance +from the ObjectBuffer it received. ObjectImage, which wraps the +ObjectFile class, is a helper class which parses the binary object image +and provides access to the information contained in the format-specific +headers, including section, symbol and relocation information. + +RuntimeDyldImpl::loadObject then iterates through the symbols in the +image. Information about common symbols is collected for later use. For +each function or data symbol, the associated section is loaded into memory +and the symbol is stored in a symbol table map data structure. When the +iteration is complete, a section is emitted for the common symbols. + +Next, RuntimeDyldImpl::loadObject iterates through the sections in the +object image and for each section iterates through the relocations for +that sections. For each relocation, it calls the format-specific +processRelocationRef method, which will examine the relocation and store +it in one of two data structures, a section-based relocation list map and +an external symbol relocation map. + +.. image:: MCJIT-load-object.png + +When RuntimeDyldImpl::loadObject returns, all of the code and data +sections for the object will have been loaded into memory allocated by the +memory manager and relocation information will have been prepared, but the +relocations have not yet been applied and the generated code is still not +ready to be executed. + +[Currently (as of August 2013) the MCJIT engine will immediately apply +relocations when loadObject completes. However, this shouldn't be +happening. Because the code may have been generated for a remote target, +the client should be given a chance to re-map the section addresses before +relocations are applied. It is possible to apply relocations multiple +times, but in the case where addresses are to be re-mapped, this first +application is wasted effort.] + +Address Remapping +================= + +At any time after initial code has been generated and before +finalizeObject is called, the client can remap the address of sections in +the object. Typically this is done because the code was generated for an +external process and is being mapped into that process' address space. +The client remaps the section address by calling MCJIT::mapSectionAddress. +This should happen before the section memory is copied to its new +location. + +When MCJIT::mapSectionAddress is called, MCJIT passes the call on to +RuntimeDyldImpl (via its Dyld member). RuntimeDyldImpl stores the new +address in an internal data structure but does not update the code at this +time, since other sections are likely to change. + +When the client is finished remapping section addresses, it will call +MCJIT::finalizeObject to complete the remapping process. + +Final Preparations +================== + +When MCJIT::finalizeObject is called, MCJIT calls +RuntimeDyld::resolveRelocations. This function will attempt to locate any +external symbols and then apply all relocations for the object. + +External symbols are resolved by calling the memory manager's +getPointerToNamedFunction method. The memory manager will return the +address of the requested symbol in the target address space. (Note, this +may not be a valid pointer in the host process.) RuntimeDyld will then +iterate through the list of relocations it has stored which are associated +with this symbol and invoke the resolveRelocation method which, through an +format-specific implementation, will apply the relocation to the loaded +section memory. + +Next, RuntimeDyld::resolveRelocations iterates through the list of +sections and for each section iterates through a list of relocations that +have been saved which reference that symbol and call resolveRelocation for +each entry in this list. The relocation list here is a list of +relocations for which the symbol associated with the relocation is located +in the section associated with the list. Each of these locations will +have a target location at which the relocation will be applied that is +likely located in a different section. + +.. image:: MCJIT-resolve-relocations.png + +Once relocations have been applied as described above, MCJIT calls +RuntimeDyld::getEHFrameSection, and if a non-zero result is returned +passes the section data to the memory manager's registerEHFrames method. +This allows the memory manager to call any desired target-specific +functions, such as registering the EH frame information with a debugger. + +Finally, MCJIT calls the memory manager's finalizeMemory method. In this +method, the memory manager will invalidate the target code cache, if +necessary, and apply final permissions to the memory pages it has +allocated for code and data memory. + Modified: vendor/llvm/dist/include/llvm/Analysis/MemoryBuiltins.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/MemoryBuiltins.h Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/Analysis/MemoryBuiltins.h Wed Jan 6 20:01:02 2016 (r293248) @@ -59,11 +59,6 @@ bool isCallocLikeFn(const Value *V, cons bool isAllocLikeFn(const Value *V, const TargetLibraryInfo *TLI, bool LookThroughBitCast = false); -/// \brief Tests if a value is a call or invoke to a library function that -/// allocates memory and never returns null (such as operator new). -bool isOperatorNewLikeFn(const Value *V, const TargetLibraryInfo *TLI, - bool LookThroughBitCast = false); - //===----------------------------------------------------------------------===// // malloc Call Utility Functions. // Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h Wed Jan 6 20:01:02 2016 (r293248) @@ -97,7 +97,7 @@ private: // of memory operands required to be precise exceeds the maximum value of // NumMemRefs - currently 256 - we remove the operands entirely. Note also // that this is a non-owning reference to a shared copy on write buffer owned - // by the MachineFunction and created via MF.allocateMemRefsArray. + // by the MachineFunction and created via MF.allocateMemRefsArray. mmo_iterator MemRefs; DebugLoc debugLoc; // Source line information. @@ -354,7 +354,7 @@ public: mmo_iterator memoperands_end() const { return MemRefs + NumMemRefs; } /// Return true if we don't have any memory operands which described the the /// memory access done by this instruction. If this is true, calling code - /// must be conservative. + /// must be conservative. bool memoperands_empty() const { return NumMemRefs == 0; } iterator_range memoperands() { @@ -774,7 +774,7 @@ public: bool isKill() const { return getOpcode() == TargetOpcode::KILL; } bool isImplicitDef() const { return getOpcode()==TargetOpcode::IMPLICIT_DEF; } bool isInlineAsm() const { return getOpcode() == TargetOpcode::INLINEASM; } - bool isMSInlineAsm() const { + bool isMSInlineAsm() const { return getOpcode() == TargetOpcode::INLINEASM && getInlineAsmDialect(); } bool isStackAligningInlineAsm() const; @@ -1180,11 +1180,26 @@ public: /// Assign this MachineInstr's memory reference descriptor list. /// This does not transfer ownership. void setMemRefs(mmo_iterator NewMemRefs, mmo_iterator NewMemRefsEnd) { - MemRefs = NewMemRefs; - NumMemRefs = uint8_t(NewMemRefsEnd - NewMemRefs); - assert(NumMemRefs == NewMemRefsEnd - NewMemRefs && "Too many memrefs"); + setMemRefs(std::make_pair(NewMemRefs, NewMemRefsEnd-NewMemRefs)); } + /// Assign this MachineInstr's memory reference descriptor list. First + /// element in the pair is the begin iterator/pointer to the array; the + /// second is the number of MemoryOperands. This does not transfer ownership + /// of the underlying memory. + void setMemRefs(std::pair NewMemRefs) { + MemRefs = NewMemRefs.first; + NumMemRefs = uint8_t(NewMemRefs.second); + assert(NumMemRefs == NewMemRefs.second && + "Too many memrefs - must drop memory operands"); + } + + /// Return a set of memrefs (begin iterator, size) which conservatively + /// describe the memory behavior of both MachineInstrs. This is appropriate + /// for use when merging two MachineInstrs into one. This routine does not + /// modify the memrefs of the this MachineInstr. + std::pair mergeMemRefsWith(const MachineInstr& Other); + /// Clear this MachineInstr's memory reference descriptor list. This resets /// the memrefs to their most conservative state. This should be used only /// as a last resort since it greatly pessimizes our knowledge of the memory Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBuilder.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBuilder.h Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBuilder.h Wed Jan 6 20:01:02 2016 (r293248) @@ -162,6 +162,11 @@ public: return *this; } + const MachineInstrBuilder &setMemRefs(std::pair MemOperandsRef) const { + MI->setMemRefs(MemOperandsRef); + return *this; + } const MachineInstrBuilder &addOperand(const MachineOperand &MO) const { MI->addOperand(*MF, MO); Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBundle.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBundle.h Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBundle.h Wed Jan 6 20:01:02 2016 (r293248) @@ -178,7 +178,7 @@ public: /// register. bool FullyDefined; - /// Reg or ont of its aliases is read. The register may only be read + /// Reg or one of its aliases is read. The register may only be read /// partially. bool Read; /// Reg or a super-register is read. The full register is read. Modified: vendor/llvm/dist/include/llvm/CodeGen/WinEHFuncInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/WinEHFuncInfo.h Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/CodeGen/WinEHFuncInfo.h Wed Jan 6 20:01:02 2016 (r293248) @@ -83,7 +83,9 @@ enum class ClrHandlerType { Catch, Final struct ClrEHUnwindMapEntry { MBBOrBasicBlock Handler; uint32_t TypeToken; - int Parent; + int HandlerParentState; ///< Outer handler enclosing this entry's handler + int TryParentState; ///< Outer try region enclosing this entry's try region, + ///< treating later catches on same try as "outer" ClrHandlerType HandlerType; }; Modified: vendor/llvm/dist/include/llvm/IR/CallSite.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/CallSite.h Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/IR/CallSite.h Wed Jan 6 20:01:02 2016 (r293248) @@ -310,6 +310,11 @@ public: CALLSITE_DELEGATE_GETTER(hasFnAttr(A)); } + /// \brief Return true if this function has the given attribute. + bool hasFnAttr(StringRef A) const { + CALLSITE_DELEGATE_GETTER(hasFnAttr(A)); + } + /// \brief Return true if the call or the callee has the given attribute. bool paramHasAttr(unsigned i, Attribute::AttrKind A) const { CALLSITE_DELEGATE_GETTER(paramHasAttr(i, A)); Modified: vendor/llvm/dist/include/llvm/IR/IRBuilder.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/IRBuilder.h Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/IR/IRBuilder.h Wed Jan 6 20:01:02 2016 (r293248) @@ -61,9 +61,13 @@ protected: MDNode *DefaultFPMathTag; FastMathFlags FMF; + ArrayRef DefaultOperandBundles; + public: - IRBuilderBase(LLVMContext &context, MDNode *FPMathTag = nullptr) - : Context(context), DefaultFPMathTag(FPMathTag), FMF() { + IRBuilderBase(LLVMContext &context, MDNode *FPMathTag = nullptr, + ArrayRef OpBundles = None) + : Context(context), DefaultFPMathTag(FPMathTag), FMF(), + DefaultOperandBundles(OpBundles) { ClearInsertionPoint(); } @@ -538,37 +542,44 @@ class IRBuilder : public IRBuilderBase, public: IRBuilder(LLVMContext &C, const T &F, Inserter I = Inserter(), - MDNode *FPMathTag = nullptr) - : IRBuilderBase(C, FPMathTag), Inserter(std::move(I)), Folder(F) {} - - explicit IRBuilder(LLVMContext &C, MDNode *FPMathTag = nullptr) - : IRBuilderBase(C, FPMathTag), Folder() { - } - - explicit IRBuilder(BasicBlock *TheBB, const T &F, MDNode *FPMathTag = nullptr) - : IRBuilderBase(TheBB->getContext(), FPMathTag), Folder(F) { + MDNode *FPMathTag = nullptr, + ArrayRef OpBundles = None) + : IRBuilderBase(C, FPMathTag, OpBundles), Inserter(std::move(I)), + Folder(F) {} + + explicit IRBuilder(LLVMContext &C, MDNode *FPMathTag = nullptr, + ArrayRef OpBundles = None) + : IRBuilderBase(C, FPMathTag, OpBundles), Folder() {} + + explicit IRBuilder(BasicBlock *TheBB, const T &F, MDNode *FPMathTag = nullptr, + ArrayRef OpBundles = None) + : IRBuilderBase(TheBB->getContext(), FPMathTag, OpBundles), Folder(F) { SetInsertPoint(TheBB); } - explicit IRBuilder(BasicBlock *TheBB, MDNode *FPMathTag = nullptr) - : IRBuilderBase(TheBB->getContext(), FPMathTag), Folder() { + explicit IRBuilder(BasicBlock *TheBB, MDNode *FPMathTag = nullptr, + ArrayRef OpBundles = None) + : IRBuilderBase(TheBB->getContext(), FPMathTag, OpBundles), Folder() { SetInsertPoint(TheBB); } - explicit IRBuilder(Instruction *IP, MDNode *FPMathTag = nullptr) - : IRBuilderBase(IP->getContext(), FPMathTag), Folder() { + explicit IRBuilder(Instruction *IP, MDNode *FPMathTag = nullptr, + ArrayRef OpBundles = None) + : IRBuilderBase(IP->getContext(), FPMathTag, OpBundles), Folder() { SetInsertPoint(IP); } - IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP, const T& F, - MDNode *FPMathTag = nullptr) - : IRBuilderBase(TheBB->getContext(), FPMathTag), Folder(F) { + IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP, const T &F, + MDNode *FPMathTag = nullptr, + ArrayRef OpBundles = None) + : IRBuilderBase(TheBB->getContext(), FPMathTag, OpBundles), Folder(F) { SetInsertPoint(TheBB, IP); } IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP, - MDNode *FPMathTag = nullptr) - : IRBuilderBase(TheBB->getContext(), FPMathTag), Folder() { + MDNode *FPMathTag = nullptr, + ArrayRef OpBundles = None) + : IRBuilderBase(TheBB->getContext(), FPMathTag, OpBundles), Folder() { SetInsertPoint(TheBB, IP); } @@ -1529,8 +1540,11 @@ public: CallInst *CreateCall(Value *Callee, ArrayRef Args = None, ArrayRef OpBundles = None, - const Twine &Name = "") { - return Insert(CallInst::Create(Callee, Args, OpBundles), Name); + const Twine &Name = "", MDNode *FPMathTag = nullptr) { + CallInst *CI = CallInst::Create(Callee, Args, OpBundles); + if (isa(CI)) + CI = cast(AddFPMathAttributes(CI, FPMathTag, FMF)); + return Insert(CI, Name); } CallInst *CreateCall(Value *Callee, ArrayRef Args, @@ -1543,7 +1557,7 @@ public: CallInst *CreateCall(llvm::FunctionType *FTy, Value *Callee, ArrayRef Args, const Twine &Name = "", MDNode *FPMathTag = nullptr) { - CallInst *CI = CallInst::Create(FTy, Callee, Args); + CallInst *CI = CallInst::Create(FTy, Callee, Args, DefaultOperandBundles); if (isa(CI)) CI = cast(AddFPMathAttributes(CI, FPMathTag, FMF)); return Insert(CI, Name); Modified: vendor/llvm/dist/include/llvm/IR/Instructions.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/Instructions.h Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/IR/Instructions.h Wed Jan 6 20:01:02 2016 (r293248) @@ -3550,6 +3550,11 @@ public: return hasFnAttrImpl(A); } + /// \brief Determine whether this call has the given attribute. + bool hasFnAttr(StringRef A) const { + return hasFnAttrImpl(A); + } + /// \brief Determine whether the call or the callee has the given attributes. bool paramHasAttr(unsigned i, Attribute::AttrKind A) const; @@ -3734,7 +3739,19 @@ private: unsigned getNumSuccessorsV() const override; void setSuccessorV(unsigned idx, BasicBlock *B) override; - bool hasFnAttrImpl(Attribute::AttrKind A) const; + template bool hasFnAttrImpl(AttrKind A) const { + if (AttributeList.hasAttribute(AttributeSet::FunctionIndex, A)) + return true; + + // Operand bundles override attributes on the called function, but don't + // override attributes directly present on the invoke instruction. + if (isFnAttrDisallowedByOpBundle(A)) + return false; + + if (const Function *F = getCalledFunction()) + return F->getAttributes().hasAttribute(AttributeSet::FunctionIndex, A); + return false; + } // Shadow Instruction::setInstructionSubclassData with a private forwarding // method so that subclasses cannot accidentally use it. @@ -3966,6 +3983,8 @@ public: /// point to the added handler. void addHandler(BasicBlock *Dest); + void removeHandler(handler_iterator HI); + unsigned getNumSuccessors() const { return getNumOperands() - 1; } BasicBlock *getSuccessor(unsigned Idx) const { assert(Idx < getNumSuccessors() && Modified: vendor/llvm/dist/include/llvm/IR/IntrinsicsX86.td ============================================================================== --- vendor/llvm/dist/include/llvm/IR/IntrinsicsX86.td Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/IR/IntrinsicsX86.td Wed Jan 6 20:01:02 2016 (r293248) @@ -33,6 +33,19 @@ let TargetPrefix = "x86" in { } //===----------------------------------------------------------------------===// +// FLAGS. +let TargetPrefix = "x86" in { + def int_x86_flags_read_u32 : GCCBuiltin<"__builtin_ia32_readeflags_u32">, + Intrinsic<[llvm_i32_ty], [], []>; + def int_x86_flags_read_u64 : GCCBuiltin<"__builtin_ia32_readeflags_u64">, + Intrinsic<[llvm_i64_ty], [], []>; + def int_x86_flags_write_u32 : GCCBuiltin<"__builtin_ia32_writeeflags_u32">, + Intrinsic<[], [llvm_i32_ty], []>; + def int_x86_flags_write_u64 : GCCBuiltin<"__builtin_ia32_writeeflags_u64">, + Intrinsic<[], [llvm_i64_ty], []>; +} + +//===----------------------------------------------------------------------===// // Read Time Stamp Counter. let TargetPrefix = "x86" in { def int_x86_rdtsc : GCCBuiltin<"__builtin_ia32_rdtsc">, @@ -2211,6 +2224,25 @@ let TargetPrefix = "x86" in { // All in Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_i8_ty, llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_w_128 : GCCBuiltin<"__builtin_ia32_psraw128_mask">, + Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, + llvm_v8i16_ty, llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_w_256 : GCCBuiltin<"__builtin_ia32_psraw256_mask">, + Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, + llvm_v8i16_ty, llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_w_512 : GCCBuiltin<"__builtin_ia32_psraw512_mask">, + Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, + llvm_v8i16_ty, llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_wi_128 : GCCBuiltin<"__builtin_ia32_psrawi128_mask">, + Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, + llvm_i8_ty, llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_wi_256 : GCCBuiltin<"__builtin_ia32_psrawi256_mask">, + Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, + llvm_i8_ty, llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_wi_512 : GCCBuiltin<"__builtin_ia32_psrawi512_mask">, + Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, + llvm_i8_ty, llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psll_d : GCCBuiltin<"__builtin_ia32_pslld512_mask">, Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v4i32_ty, llvm_v16i32_ty, llvm_i16_ty], [IntrNoMem]>; @@ -2229,6 +2261,69 @@ let TargetPrefix = "x86" in { // All in def int_x86_avx512_mask_psra_q : GCCBuiltin<"__builtin_ia32_psraq512_mask">, Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v2i64_ty, llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>; + + def int_x86_avx512_mask_psra_d_128 : GCCBuiltin<"__builtin_ia32_psrad128_mask">, + Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, + llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_d_256 : GCCBuiltin<"__builtin_ia32_psrad256_mask">, + Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, + llvm_v4i32_ty, llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_di_128 : GCCBuiltin<"__builtin_ia32_psradi128_mask">, + Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, + llvm_i8_ty, llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_di_256 : GCCBuiltin<"__builtin_ia32_psradi256_mask">, + Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, + llvm_i8_ty, llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_di_512 : GCCBuiltin<"__builtin_ia32_psradi512_mask">, + Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, + llvm_i8_ty, llvm_v16i32_ty, llvm_i16_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_q_128 : GCCBuiltin<"__builtin_ia32_psraq128_mask">, + Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, + llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_q_256 : GCCBuiltin<"__builtin_ia32_psraq256_mask">, + Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, + llvm_v2i64_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_qi_128 : GCCBuiltin<"__builtin_ia32_psraqi128_mask">, + Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, + llvm_i8_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_qi_256 : GCCBuiltin<"__builtin_ia32_psraqi256_mask">, + Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, + llvm_i8_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psra_qi_512 : GCCBuiltin<"__builtin_ia32_psraqi512_mask">, + Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, + llvm_i8_ty, llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>; + + def int_x86_avx512_mask_psrl_d_128: GCCBuiltin<"__builtin_ia32_psrld128_mask">, + Intrinsic<[llvm_v4i32_ty], [ llvm_v4i32_ty, + llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty ], [IntrNoMem]>; + def int_x86_avx512_mask_psrl_d_256: GCCBuiltin<"__builtin_ia32_psrld256_mask">, + Intrinsic<[llvm_v8i32_ty], [ llvm_v8i32_ty, + llvm_v4i32_ty, llvm_v8i32_ty, llvm_i8_ty ], [IntrNoMem]>; + def int_x86_avx512_mask_psrl_di_128: GCCBuiltin<"__builtin_ia32_psrldi128_mask">, + Intrinsic<[llvm_v4i32_ty], [ llvm_v4i32_ty, + llvm_i8_ty, llvm_v4i32_ty, llvm_i8_ty ], [IntrNoMem]>; + def int_x86_avx512_mask_psrl_di_256: GCCBuiltin<"__builtin_ia32_psrldi256_mask">, + Intrinsic<[llvm_v8i32_ty], [ llvm_v8i32_ty, + llvm_i8_ty, llvm_v8i32_ty, llvm_i8_ty ], [IntrNoMem]>; + def int_x86_avx512_mask_psrl_di_512: GCCBuiltin<"__builtin_ia32_psrldi512_mask">, + Intrinsic<[llvm_v16i32_ty], [ llvm_v16i32_ty, + llvm_i8_ty, llvm_v16i32_ty, llvm_i16_ty ], [IntrNoMem]>; + + def int_x86_avx512_mask_psrl_q_128: GCCBuiltin<"__builtin_ia32_psrlq128_mask">, + Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, + llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psrl_q_256: GCCBuiltin<"__builtin_ia32_psrlq256_mask">, + Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, + llvm_v2i64_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psrl_qi_128: GCCBuiltin<"__builtin_ia32_psrlqi128_mask">, + Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, + llvm_i8_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psrl_qi_256: GCCBuiltin<"__builtin_ia32_psrlqi256_mask">, + Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, + llvm_i8_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psrl_qi_512: GCCBuiltin<"__builtin_ia32_psrlqi512_mask">, + Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, + llvm_i8_ty, llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>; } // Pack ops. @@ -2696,6 +2791,59 @@ let TargetPrefix = "x86" in { // All in def int_x86_avx512_psrl_dq_512 : GCCBuiltin<"__builtin_ia32_psrldq512">, Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_i32_ty], [IntrNoMem]>; + + def int_x86_avx512_mask_psll_d_128 : GCCBuiltin<"__builtin_ia32_pslld128_mask">, + Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, + llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psll_d_256 : GCCBuiltin<"__builtin_ia32_pslld256_mask">, + Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, + llvm_v4i32_ty, llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psll_di_128 : GCCBuiltin<"__builtin_ia32_pslldi128_mask">, + Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, + llvm_i8_ty, llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psll_di_256 : GCCBuiltin<"__builtin_ia32_pslldi256_mask">, + Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, + llvm_i8_ty, llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psll_di_512 : GCCBuiltin<"__builtin_ia32_pslldi512_mask">, + Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, + llvm_i8_ty, llvm_v16i32_ty, llvm_i16_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psll_q_128 : GCCBuiltin<"__builtin_ia32_psllq128_mask">, + Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, + llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psll_q_256 : GCCBuiltin<"__builtin_ia32_psllq256_mask">, + Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, + llvm_v2i64_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psll_qi_128 : GCCBuiltin<"__builtin_ia32_psllqi128_mask">, + Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, + llvm_i8_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psll_qi_256 : GCCBuiltin<"__builtin_ia32_psllqi256_mask">, + Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, + llvm_i8_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psll_qi_512 : GCCBuiltin<"__builtin_ia32_psllqi512_mask">, + Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, + llvm_i8_ty, llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>; + + def int_x86_avx512_mask_psrlv16_hi : GCCBuiltin<"__builtin_ia32_psrlv16hi_mask">, + Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, + llvm_v16i16_ty, llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psrlv2_di : GCCBuiltin<"__builtin_ia32_psrlv2di_mask">, + Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, + llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psrlv32hi : GCCBuiltin<"__builtin_ia32_psrlv32hi_mask">, + Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, + llvm_v32i16_ty, llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psrlv4_di : GCCBuiltin<"__builtin_ia32_psrlv4di_mask">, + Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, + llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psrlv4_si : GCCBuiltin<"__builtin_ia32_psrlv4si_mask">, + Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, + llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psrlv8_hi : GCCBuiltin<"__builtin_ia32_psrlv8hi_mask">, + Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, + llvm_v8i16_ty, llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx512_mask_psrlv8_si : GCCBuiltin<"__builtin_ia32_psrlv8si_mask">, + Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, + llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>; } // Gather ops @@ -3919,9 +4067,9 @@ let TargetPrefix = "x86" in { // All in // Support protection key let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_rdpkru : GCCBuiltin <"__builtin_ia32_rdpkru">, - Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>; + Intrinsic<[llvm_i32_ty], [], []>; def int_x86_wrpkru : GCCBuiltin<"__builtin_ia32_wrpkru">, - Intrinsic<[], [llvm_i32_ty], [IntrNoMem]>; + Intrinsic<[], [llvm_i32_ty], []>; } //===----------------------------------------------------------------------===// // Half float conversion Modified: vendor/llvm/dist/include/llvm/IR/Metadata.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/Metadata.h Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/IR/Metadata.h Wed Jan 6 20:01:02 2016 (r293248) @@ -283,14 +283,20 @@ private: LLVMContext &Context; uint64_t NextIndex; SmallDenseMap, 4> UseMap; + /// Flag that can be set to false if this metadata should not be + /// RAUW'ed, e.g. if it is used as the key of a map. + bool CanReplace; public: ReplaceableMetadataImpl(LLVMContext &Context) - : Context(Context), NextIndex(0) {} + : Context(Context), NextIndex(0), CanReplace(true) {} ~ReplaceableMetadataImpl() { assert(UseMap.empty() && "Cannot destroy in-use replaceable metadata"); } + /// Set the CanReplace flag to the given value. + void setCanReplace(bool Replaceable) { CanReplace = Replaceable; } + LLVMContext &getContext() const { return Context; } /// \brief Replace all uses of this with MD. @@ -901,14 +907,19 @@ public: Context.getReplaceableUses()->replaceAllUsesWith(MD); } + /// Set the CanReplace flag to the given value. + void setCanReplace(bool Replaceable) { + Context.getReplaceableUses()->setCanReplace(Replaceable); + } + /// \brief Resolve cycles. /// /// Once all forward declarations have been resolved, force cycles to be - /// resolved. If \p MDMaterialized is true, then any temporary metadata + /// resolved. If \p AllowTemps is true, then any temporary metadata /// is ignored, otherwise it asserts when encountering temporary metadata. /// /// \pre No operands (or operands' operands, etc.) have \a isTemporary(). - void resolveCycles(bool MDMaterialized = true); + void resolveCycles(bool AllowTemps = false); /// \brief Replace a temporary node with a permanent one. /// Modified: vendor/llvm/dist/include/llvm/IR/Statepoint.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/Statepoint.h Wed Jan 6 19:41:06 2016 (r293247) +++ vendor/llvm/dist/include/llvm/IR/Statepoint.h Wed Jan 6 20:01:02 2016 (r293248) @@ -22,6 +22,7 @@ #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/Instructions.h" +#include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Intrinsics.h" #include "llvm/Support/Compiler.h" @@ -36,14 +37,13 @@ enum class StatepointFlags { MaskAll = GCTransition ///< A bitmask that includes all valid flags. }; -class GCRelocateOperands; +class GCRelocateInst; class ImmutableStatepoint; bool isStatepoint(const ImmutableCallSite &CS); bool isStatepoint(const Value *V); bool isStatepoint(const Value &V); -bool isGCRelocate(const Value *V); bool isGCRelocate(const ImmutableCallSite &CS); bool isGCResult(const Value *V); @@ -247,7 +247,7 @@ public: /// May contain several relocations for the same base/derived pair. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 6 20:01:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79090A656B0; Wed, 6 Jan 2016 20:01:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 321A91A1F; Wed, 6 Jan 2016 20:01:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K1XFa082139; Wed, 6 Jan 2016 20:01:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K1XCc082138; Wed, 6 Jan 2016 20:01:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601062001.u06K1XCc082138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 Jan 2016 20:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293249 - vendor/llvm/llvm-trunk-r256945 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:01:34 -0000 Author: dim Date: Wed Jan 6 20:01:33 2016 New Revision: 293249 URL: https://svnweb.freebsd.org/changeset/base/293249 Log: Tag llvm trunk r256945. Added: vendor/llvm/llvm-trunk-r256945/ - copied from r293248, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Wed Jan 6 20:02:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F73CA65818; Wed, 6 Jan 2016 20:02:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B274A1C6E; Wed, 6 Jan 2016 20:02:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K2RgG084177; Wed, 6 Jan 2016 20:02:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K2QpX084165; Wed, 6 Jan 2016 20:02:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601062002.u06K2QpX084165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 Jan 2016 20:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293250 - in vendor/clang/dist: . cmake/caches include/clang/AST include/clang/Basic include/clang/Driver include/clang/Frontend include/clang/Sema lib/AST lib/Basic lib/CodeGen lib/Dri... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:02:29 -0000 Author: dim Date: Wed Jan 6 20:02:26 2016 New Revision: 293250 URL: https://svnweb.freebsd.org/changeset/base/293250 Log: Vendor import of clang trunk r256945: https://llvm.org/svn/llvm-project/cfe/trunk@256945 Added: vendor/clang/dist/cmake/caches/PGO-stage2-instrumented.cmake vendor/clang/dist/cmake/caches/PGO-stage2.cmake vendor/clang/dist/cmake/caches/PGO.cmake vendor/clang/dist/lib/Headers/pkuintrin.h (contents, props changed) vendor/clang/dist/test/Analysis/Inputs/qt-simulator.h (contents, props changed) vendor/clang/dist/test/Analysis/qt_malloc.cpp (contents, props changed) vendor/clang/dist/test/CodeGen/pku.c (contents, props changed) vendor/clang/dist/test/CodeGenCXX/optnone-and-attributes.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCXX/optnone-class-members.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCXX/optnone-templates.cpp (contents, props changed) vendor/clang/dist/test/Driver/ps4-analyzer-defaults.cpp (contents, props changed) vendor/clang/dist/test/Modules/tag-injection.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/schedule_codegen.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_codegen_registration.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/target_codegen_registration_naming.cpp (contents, props changed) Deleted: vendor/clang/dist/test/Profile/c-attributes.c Modified: vendor/clang/dist/CMakeLists.txt vendor/clang/dist/include/clang/AST/DeclarationName.h vendor/clang/dist/include/clang/AST/Expr.h vendor/clang/dist/include/clang/AST/ExprCXX.h vendor/clang/dist/include/clang/AST/ExprObjC.h vendor/clang/dist/include/clang/AST/Mangle.h vendor/clang/dist/include/clang/AST/OpenMPClause.h vendor/clang/dist/include/clang/Basic/Builtins.h vendor/clang/dist/include/clang/Basic/BuiltinsX86.def vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/LangOptions.def vendor/clang/dist/include/clang/Basic/LangOptions.h vendor/clang/dist/include/clang/Basic/OpenMPKinds.def vendor/clang/dist/include/clang/Driver/CC1Options.td vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Frontend/CodeGenOptions.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Sema/TemplateDeduction.h vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/Expr.cpp vendor/clang/dist/lib/AST/ExprCXX.cpp vendor/clang/dist/lib/AST/ExprObjC.cpp vendor/clang/dist/lib/AST/MicrosoftMangle.cpp vendor/clang/dist/lib/AST/OpenMPClause.cpp vendor/clang/dist/lib/Basic/Builtins.cpp vendor/clang/dist/lib/Basic/LangOptions.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/BackendUtil.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGObjCMac.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.h vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/CodeGen/CGVTables.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.h vendor/clang/dist/lib/CodeGen/CodeGenPGO.cpp vendor/clang/dist/lib/CodeGen/CoverageMappingGen.cpp vendor/clang/dist/lib/Driver/Driver.cpp vendor/clang/dist/lib/Driver/ToolChains.cpp vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Driver/Tools.h vendor/clang/dist/lib/Format/ContinuationIndenter.cpp vendor/clang/dist/lib/Format/FormatToken.cpp vendor/clang/dist/lib/Format/FormatToken.h vendor/clang/dist/lib/Format/TokenAnnotator.cpp vendor/clang/dist/lib/Frontend/CodeGenOptions.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Headers/CMakeLists.txt vendor/clang/dist/lib/Headers/ia32intrin.h vendor/clang/dist/lib/Headers/immintrin.h vendor/clang/dist/lib/Parse/ParseExpr.cpp vendor/clang/dist/lib/Parse/ParseStmtAsm.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExprObjC.cpp vendor/clang/dist/lib/Sema/SemaOpenMP.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaStmtAsm.cpp vendor/clang/dist/lib/Sema/SemaTemplateDeduction.cpp vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTReaderStmt.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/MallocChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp vendor/clang/dist/test/Analysis/Inputs/system-header-simulator-cxx.h vendor/clang/dist/test/Analysis/inlining/stl.cpp vendor/clang/dist/test/Analysis/null-deref-ps.c vendor/clang/dist/test/Analysis/nullptr.cpp vendor/clang/dist/test/CXX/drs/dr5xx.cpp vendor/clang/dist/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp vendor/clang/dist/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp vendor/clang/dist/test/CodeGen/2007-04-14-FNoBuiltin.c vendor/clang/dist/test/CodeGen/aarch64-v8.1a-neon-intrinsics.c vendor/clang/dist/test/CodeGen/arm-target-features.c vendor/clang/dist/test/CodeGen/arm-v8.1a-neon-intrinsics.c vendor/clang/dist/test/CodeGen/libcalls-complex.c vendor/clang/dist/test/CodeGen/libcalls-fno-builtin.c vendor/clang/dist/test/CodeGen/nobuiltin.c vendor/clang/dist/test/CodeGenCXX/ms-inline-asm-fields.cpp vendor/clang/dist/test/CodeGenCXX/optnone-def-decl.cpp vendor/clang/dist/test/CoverageMapping/ir.c vendor/clang/dist/test/Driver/aarch64-cpus.c vendor/clang/dist/test/Driver/arm-cortex-cpus.c vendor/clang/dist/test/Driver/arm-no-movt.c vendor/clang/dist/test/Driver/debug-options.c vendor/clang/dist/test/Driver/fortran.f95 vendor/clang/dist/test/Driver/instrprof-ld.c vendor/clang/dist/test/Index/cindex-test-inclusions.c vendor/clang/dist/test/Modules/ModuleDebugInfo.cpp vendor/clang/dist/test/OpenMP/for_simd_ast_print.cpp vendor/clang/dist/test/OpenMP/for_simd_codegen.cpp vendor/clang/dist/test/OpenMP/for_simd_loop_messages.cpp vendor/clang/dist/test/OpenMP/nesting_of_regions.cpp vendor/clang/dist/test/OpenMP/ordered_codegen.cpp vendor/clang/dist/test/OpenMP/parallel_for_simd_ast_print.cpp vendor/clang/dist/test/OpenMP/parallel_for_simd_codegen.cpp vendor/clang/dist/test/OpenMP/parallel_for_simd_loop_messages.cpp vendor/clang/dist/test/OpenMP/parallel_for_simd_messages.cpp vendor/clang/dist/test/OpenMP/target_codegen.cpp vendor/clang/dist/test/OpenMP/target_codegen_global_capture.cpp vendor/clang/dist/test/OpenMP/target_map_codegen.cpp vendor/clang/dist/test/OpenMP/target_messages.cpp vendor/clang/dist/test/Preprocessor/aarch64-target-features.c vendor/clang/dist/test/Profile/func-entry.c vendor/clang/dist/test/Sema/attr-ownership.c vendor/clang/dist/test/Sema/implicit-builtin-freestanding.c vendor/clang/dist/test/Sema/warn-documentation-crlf.c vendor/clang/dist/test/SemaCXX/attr-no-sanitize-address.cpp vendor/clang/dist/test/SemaCXX/attr-no-sanitize-memory.cpp vendor/clang/dist/test/SemaCXX/attr-no-sanitize-thread.cpp vendor/clang/dist/test/SemaCXX/dllexport.cpp vendor/clang/dist/test/SemaCXX/warn-literal-conversion.cpp vendor/clang/dist/test/SemaOpenCL/cond.cl vendor/clang/dist/test/SemaOpenCL/func_ptr.cl vendor/clang/dist/test/SemaTemplate/deduction.cpp vendor/clang/dist/tools/c-index-test/c-index-test.c vendor/clang/dist/tools/libclang/CIndexInclusionStack.cpp vendor/clang/dist/unittests/Format/FormatTest.cpp vendor/clang/dist/unittests/Format/FormatTestJS.cpp vendor/clang/dist/unittests/Format/FormatTestProto.cpp vendor/clang/dist/utils/TableGen/TableGen.cpp Modified: vendor/clang/dist/CMakeLists.txt ============================================================================== --- vendor/clang/dist/CMakeLists.txt Wed Jan 6 20:01:33 2016 (r293249) +++ vendor/clang/dist/CMakeLists.txt Wed Jan 6 20:02:26 2016 (r293250) @@ -631,11 +631,19 @@ if (CLANG_ENABLE_BOOTSTRAP) string(REGEX MATCH "stage([0-9]*)" MATCHED_STAGE "${CLANG_STAGE}") if(MATCHED_STAGE) - math(EXPR STAGE_NUM "${MATCHED_STAGE} + 1") - set(NEXT_CLANG_STAGE stage${STAGE_NUM}) + if(NOT LLVM_BUILD_INSTRUMENTED) + math(EXPR STAGE_NUM "${CMAKE_MATCH_1} + 1") + set(NEXT_CLANG_STAGE stage${STAGE_NUM}) + else() + set(NEXT_CLANG_STAGE stage${CMAKE_MATCH_1}) + endif() else() set(NEXT_CLANG_STAGE bootstrap) endif() + + if(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED) + set(NEXT_CLANG_STAGE ${NEXT_CLANG_STAGE}-instrumented) + endif() message(STATUS "Setting next clang stage to: ${NEXT_CLANG_STAGE}") @@ -681,6 +689,26 @@ if (CLANG_ENABLE_BOOTSTRAP) set(RUNTIME_DEP compiler-rt) endif() + set(COMPILER_OPTIONS + -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++ + -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang + -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) + + if(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED) + set(PGO_DEP llvm-profdata) + set(PGO_OPT -DLLVM_PROFDATA=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-profdata) + endif() + + if(LLVM_BUILD_INSTRUMENTED) + set(PGO_DEP generate-profdata) + set(PGO_OPT -DLLVM_PROFDATA_FILE=${CMAKE_CURRENT_BINARY_DIR}/utils/perf-training/clang.profdata) + set(COMPILER_OPTIONS + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_ASM_COMPILER=${CMAKE_ASM_COMPILER}) + set(RUNTIME_DEP) # Don't set runtime dependencies + endif() + # Find all variables that start with BOOTSTRAP_ and populate a variable with # them. get_cmake_property(variableNames VARIABLES) @@ -703,7 +731,7 @@ if (CLANG_ENABLE_BOOTSTRAP) endforeach() ExternalProject_Add(${NEXT_CLANG_STAGE} - DEPENDS clang ${LTO_DEP} ${RUNTIME_DEP} + DEPENDS clang ${LTO_DEP} ${RUNTIME_DEP} ${PGO_DEP} PREFIX ${NEXT_CLANG_STAGE} SOURCE_DIR ${CMAKE_SOURCE_DIR} STAMP_DIR ${STAMP_DIR} @@ -715,11 +743,9 @@ if (CLANG_ENABLE_BOOTSTRAP) -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ${CLANG_BOOTSTRAP_CMAKE_ARGS} ${PASSTHROUGH_VARIABLES} - -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++ - -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang - -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang - -DCLANG_STAGE=${NEXT_CLANG_STAGE} - ${LTO_LIBRARY} ${LTO_AR} ${LTO_RANLIB} ${verbose} + -DCLANG_STAGE=${NEXT_CLANG_STAGE} + ${COMPILER_OPTIONS} + ${LTO_LIBRARY} ${LTO_AR} ${LTO_RANLIB} ${verbose} ${PGO_OPT} INSTALL_COMMAND "" STEP_TARGETS configure build ${cmake_3_4_USES_TERMINAL_OPTIONS} Added: vendor/clang/dist/cmake/caches/PGO-stage2-instrumented.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/cmake/caches/PGO-stage2-instrumented.cmake Wed Jan 6 20:02:26 2016 (r293250) @@ -0,0 +1,9 @@ +set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "") +set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") +set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "") + +set(CLANG_BOOTSTRAP_TARGETS check-all check-llvm check-clang test-suite CACHE STRING "") + +set(CLANG_BOOTSTRAP_CMAKE_ARGS + -C ${CMAKE_CURRENT_LIST_DIR}/PGO-stage2.cmake + CACHE STRING "") Added: vendor/clang/dist/cmake/caches/PGO-stage2.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/cmake/caches/PGO-stage2.cmake Wed Jan 6 20:02:26 2016 (r293250) @@ -0,0 +1,2 @@ +set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "") +set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "") Added: vendor/clang/dist/cmake/caches/PGO.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/cmake/caches/PGO.cmake Wed Jan 6 20:02:26 2016 (r293250) @@ -0,0 +1,17 @@ +set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "") +set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") +set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "") + +set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "") +set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "") +set(CLANG_BOOTSTRAP_TARGETS + generate-profdata + stage2 + stage2-check-all + stage2-check-llvm + stage2-check-clang + stage2-test-suite CACHE STRING "") + +set(CLANG_BOOTSTRAP_CMAKE_ARGS + -C ${CMAKE_CURRENT_LIST_DIR}/PGO-stage2-instrumented.cmake + CACHE STRING "") Modified: vendor/clang/dist/include/clang/AST/DeclarationName.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclarationName.h Wed Jan 6 20:01:33 2016 (r293249) +++ vendor/clang/dist/include/clang/AST/DeclarationName.h Wed Jan 6 20:02:26 2016 (r293250) @@ -395,7 +395,7 @@ struct DeclarationNameLoc { // Locations (if any) for the tilde (destructor) or operator keyword // (conversion) are stored elsewhere. struct NT { - TypeSourceInfo* TInfo; + TypeSourceInfo *TInfo; }; // The location (if any) of the operator keyword is stored elsewhere. Modified: vendor/clang/dist/include/clang/AST/Expr.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Expr.h Wed Jan 6 20:01:33 2016 (r293249) +++ vendor/clang/dist/include/clang/AST/Expr.h Wed Jan 6 20:02:26 2016 (r293250) @@ -2190,7 +2190,8 @@ public: return reinterpret_cast(SubExprs+getNumPreArgs()+PREARGS_START); } const Expr *const *getArgs() const { - return const_cast(this)->getArgs(); + return reinterpret_cast(SubExprs + getNumPreArgs() + + PREARGS_START); } /// getArg - Return the specified argument. @@ -3926,7 +3927,9 @@ public: /// which covers @c [2].y=1.0. This DesignatedInitExpr will have two /// designators, one array designator for @c [2] followed by one field /// designator for @c .y. The initialization expression will be 1.0. -class DesignatedInitExpr : public Expr { +class DesignatedInitExpr final + : public Expr, + private llvm::TrailingObjects { public: /// \brief Forward declaration of the Designator class. class Designator; @@ -4206,12 +4209,12 @@ public: Expr *getSubExpr(unsigned Idx) const { assert(Idx < NumSubExprs && "Subscript out of range"); - return cast(reinterpret_cast(this + 1)[Idx]); + return cast(getTrailingObjects()[Idx]); } void setSubExpr(unsigned Idx, Expr *E) { assert(Idx < NumSubExprs && "Subscript out of range"); - reinterpret_cast(this + 1)[Idx] = E; + getTrailingObjects()[Idx] = E; } /// \brief Replaces the designator at index @p Idx with the series @@ -4230,9 +4233,11 @@ public: // Iterators child_range children() { - Stmt **begin = reinterpret_cast(this + 1); + Stmt **begin = getTrailingObjects(); return child_range(begin, begin + NumSubExprs); } + + friend TrailingObjects; }; /// \brief Represents a place-holder for an object not to be initialized by @@ -4683,7 +4688,9 @@ public: /// equivalent to a particular message send, and this is very much /// part of the user model. The name of this class encourages this /// modelling design. -class PseudoObjectExpr : public Expr { +class PseudoObjectExpr final + : public Expr, + private llvm::TrailingObjects { // PseudoObjectExprBits.NumSubExprs - The number of sub-expressions. // Always at least two, because the first sub-expression is the // syntactic form. @@ -4695,13 +4702,11 @@ class PseudoObjectExpr : public Expr { // in to Create, which is an index within the semantic forms. // Note also that ASTStmtWriter assumes this encoding. - Expr **getSubExprsBuffer() { return reinterpret_cast(this + 1); } + Expr **getSubExprsBuffer() { return getTrailingObjects(); } const Expr * const *getSubExprsBuffer() const { - return reinterpret_cast(this + 1); + return getTrailingObjects(); } - friend class ASTStmtReader; - PseudoObjectExpr(QualType type, ExprValueKind VK, Expr *syntactic, ArrayRef semantic, unsigned resultIndex); @@ -4798,6 +4803,9 @@ public: static bool classof(const Stmt *T) { return T->getStmtClass() == PseudoObjectExprClass; } + + friend TrailingObjects; + friend class ASTStmtReader; }; /// AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, Modified: vendor/clang/dist/include/clang/AST/ExprCXX.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ExprCXX.h Wed Jan 6 20:01:33 2016 (r293249) +++ vendor/clang/dist/include/clang/AST/ExprCXX.h Wed Jan 6 20:02:26 2016 (r293250) @@ -951,7 +951,9 @@ public: /// This wraps up a function call argument that was created from the /// corresponding parameter's default argument, when the call did not /// explicitly supply arguments for all of the parameters. -class CXXDefaultArgExpr : public Expr { +class CXXDefaultArgExpr final + : public Expr, + private llvm::TrailingObjects { /// \brief The parameter whose default is being used. /// /// When the bit is set, the subexpression is stored after the @@ -977,7 +979,7 @@ class CXXDefaultArgExpr : public Expr { SubExpr->getValueKind(), SubExpr->getObjectKind(), false, false, false, false), Param(param, true), Loc(Loc) { - *reinterpret_cast(this + 1) = SubExpr; + *getTrailingObjects() = SubExpr; } public: @@ -1002,12 +1004,12 @@ public: // Retrieve the actual argument to the function call. const Expr *getExpr() const { if (Param.getInt()) - return *reinterpret_cast (this + 1); + return *getTrailingObjects(); return getParam()->getDefaultArg(); } Expr *getExpr() { if (Param.getInt()) - return *reinterpret_cast (this + 1); + return *getTrailingObjects(); return getParam()->getDefaultArg(); } @@ -1031,6 +1033,7 @@ public: return child_range(child_iterator(), child_iterator()); } + friend TrailingObjects; friend class ASTStmtReader; friend class ASTStmtWriter; }; @@ -1441,7 +1444,9 @@ public: /// C++1y introduces a new form of "capture" called an init-capture that /// includes an initializing expression (rather than capturing a variable), /// and which can never occur implicitly. -class LambdaExpr : public Expr { +class LambdaExpr final + : public Expr, + private llvm::TrailingObjects { /// \brief The source range that covers the lambda introducer ([...]). SourceRange IntroducerRange; @@ -1476,23 +1481,21 @@ class LambdaExpr : public Expr { /// module file just to determine the source range. SourceLocation ClosingBrace; - // Note: The capture initializers are stored directly after the lambda - // expression, along with the index variables used to initialize by-copy - // array captures. + size_t numTrailingObjects(OverloadToken) const { + return NumCaptures + 1; + } - typedef LambdaCapture Capture; + size_t numTrailingObjects(OverloadToken) const { + return HasArrayIndexVars ? NumCaptures + 1 : 0; + } /// \brief Construct a lambda expression. LambdaExpr(QualType T, SourceRange IntroducerRange, LambdaCaptureDefault CaptureDefault, - SourceLocation CaptureDefaultLoc, - ArrayRef Captures, - bool ExplicitParams, - bool ExplicitResultType, - ArrayRef CaptureInits, - ArrayRef ArrayIndexVars, - ArrayRef ArrayIndexStarts, - SourceLocation ClosingBrace, + SourceLocation CaptureDefaultLoc, ArrayRef Captures, + bool ExplicitParams, bool ExplicitResultType, + ArrayRef CaptureInits, ArrayRef ArrayIndexVars, + ArrayRef ArrayIndexStarts, SourceLocation ClosingBrace, bool ContainsUnexpandedParameterPack); /// \brief Construct an empty lambda expression. @@ -1503,53 +1506,35 @@ class LambdaExpr : public Expr { getStoredStmts()[NumCaptures] = nullptr; } - Stmt **getStoredStmts() { return reinterpret_cast(this + 1); } + Stmt **getStoredStmts() { return getTrailingObjects(); } - Stmt *const *getStoredStmts() const { - return reinterpret_cast(this + 1); - } + Stmt *const *getStoredStmts() const { return getTrailingObjects(); } /// \brief Retrieve the mapping from captures to the first array index /// variable. - unsigned *getArrayIndexStarts() { - return reinterpret_cast(getStoredStmts() + NumCaptures + 1); - } + unsigned *getArrayIndexStarts() { return getTrailingObjects(); } const unsigned *getArrayIndexStarts() const { - return reinterpret_cast(getStoredStmts() + NumCaptures + - 1); + return getTrailingObjects(); } /// \brief Retrieve the complete set of array-index variables. - VarDecl **getArrayIndexVars() { - unsigned ArrayIndexSize = llvm::RoundUpToAlignment( - sizeof(unsigned) * (NumCaptures + 1), llvm::alignOf()); - return reinterpret_cast( - reinterpret_cast(getArrayIndexStarts()) + ArrayIndexSize); - } + VarDecl **getArrayIndexVars() { return getTrailingObjects(); } VarDecl *const *getArrayIndexVars() const { - unsigned ArrayIndexSize = llvm::RoundUpToAlignment( - sizeof(unsigned) * (NumCaptures + 1), llvm::alignOf()); - return reinterpret_cast( - reinterpret_cast(getArrayIndexStarts()) + ArrayIndexSize); + return getTrailingObjects(); } public: /// \brief Construct a new lambda expression. - static LambdaExpr *Create(const ASTContext &C, - CXXRecordDecl *Class, - SourceRange IntroducerRange, - LambdaCaptureDefault CaptureDefault, - SourceLocation CaptureDefaultLoc, - ArrayRef Captures, - bool ExplicitParams, - bool ExplicitResultType, - ArrayRef CaptureInits, - ArrayRef ArrayIndexVars, - ArrayRef ArrayIndexStarts, - SourceLocation ClosingBrace, - bool ContainsUnexpandedParameterPack); + static LambdaExpr * + Create(const ASTContext &C, CXXRecordDecl *Class, SourceRange IntroducerRange, + LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc, + ArrayRef Captures, bool ExplicitParams, + bool ExplicitResultType, ArrayRef CaptureInits, + ArrayRef ArrayIndexVars, + ArrayRef ArrayIndexStarts, SourceLocation ClosingBrace, + bool ContainsUnexpandedParameterPack); /// \brief Construct a new lambda expression that will be deserialized from /// an external source. @@ -1572,7 +1557,7 @@ public: /// \brief An iterator that walks over the captures of the lambda, /// both implicit and explicit. - typedef const Capture *capture_iterator; + typedef const LambdaCapture *capture_iterator; /// \brief An iterator over a range of lambda captures. typedef llvm::iterator_range capture_range; @@ -1709,9 +1694,11 @@ public: SourceLocation getLocEnd() const LLVM_READONLY { return ClosingBrace; } child_range children() { + // Includes initialization exprs plus body stmt return child_range(getStoredStmts(), getStoredStmts() + NumCaptures + 1); } + friend TrailingObjects; friend class ASTStmtReader; friend class ASTStmtWriter; }; @@ -2226,7 +2213,9 @@ public: /// __is_enum(std::string) == false /// __is_trivially_constructible(vector, int*, int*) /// \endcode -class TypeTraitExpr : public Expr { +class TypeTraitExpr final + : public Expr, + private llvm::TrailingObjects { /// \brief The location of the type trait keyword. SourceLocation Loc; @@ -2243,16 +2232,10 @@ class TypeTraitExpr : public Expr { TypeTraitExpr(EmptyShell Empty) : Expr(TypeTraitExprClass, Empty) { } - /// \brief Retrieve the argument types. - TypeSourceInfo **getTypeSourceInfos() { - return reinterpret_cast(this+1); - } - - /// \brief Retrieve the argument types. - TypeSourceInfo * const *getTypeSourceInfos() const { - return reinterpret_cast(this+1); + size_t numTrailingObjects(OverloadToken) const { + return getNumArgs(); } - + public: /// \brief Create a new type trait expression. static TypeTraitExpr *Create(const ASTContext &C, QualType T, @@ -2284,22 +2267,9 @@ public: } /// \brief Retrieve the argument types. - ArrayRef getArgs() const { - return llvm::makeArrayRef(getTypeSourceInfos(), getNumArgs()); - } - - typedef TypeSourceInfo **arg_iterator; - arg_iterator arg_begin() { - return getTypeSourceInfos(); - } - arg_iterator arg_end() { - return getTypeSourceInfos() + getNumArgs(); - } - - typedef TypeSourceInfo const * const *arg_const_iterator; - arg_const_iterator arg_begin() const { return getTypeSourceInfos(); } - arg_const_iterator arg_end() const { - return getTypeSourceInfos() + getNumArgs(); + ArrayRef getArgs() const { + return llvm::makeArrayRef(getTrailingObjects(), + getNumArgs()); } SourceLocation getLocStart() const LLVM_READONLY { return Loc; } @@ -2314,9 +2284,9 @@ public: return child_range(child_iterator(), child_iterator()); } + friend TrailingObjects; friend class ASTStmtReader; friend class ASTStmtWriter; - }; /// \brief An Embarcadero array type trait, as used in the implementation of @@ -2899,7 +2869,9 @@ public: /// This expression also tracks whether the sub-expression contains a /// potentially-evaluated block literal. The lifetime of a block /// literal is the extent of the enclosing scope. -class ExprWithCleanups : public Expr { +class ExprWithCleanups final + : public Expr, + private llvm::TrailingObjects { public: /// The type of objects that are kept in the cleanup. /// It's useful to remember the set of blocks; we could also @@ -2913,12 +2885,7 @@ private: ExprWithCleanups(EmptyShell, unsigned NumObjects); ExprWithCleanups(Expr *SubExpr, ArrayRef Objects); - CleanupObject *getObjectsBuffer() { - return reinterpret_cast(this + 1); - } - const CleanupObject *getObjectsBuffer() const { - return reinterpret_cast(this + 1); - } + friend TrailingObjects; friend class ASTStmtReader; public: @@ -2929,7 +2896,8 @@ public: ArrayRef objects); ArrayRef getObjects() const { - return llvm::makeArrayRef(getObjectsBuffer(), getNumObjects()); + return llvm::makeArrayRef(getTrailingObjects(), + getNumObjects()); } unsigned getNumObjects() const { return ExprWithCleanupsBits.NumObjects; } @@ -2981,7 +2949,9 @@ public: /// When the returned expression is instantiated, it may resolve to a /// constructor call, conversion function call, or some kind of type /// conversion. -class CXXUnresolvedConstructExpr : public Expr { +class CXXUnresolvedConstructExpr final + : public Expr, + private llvm::TrailingObjects { /// \brief The type being constructed. TypeSourceInfo *Type; @@ -3002,6 +2972,7 @@ class CXXUnresolvedConstructExpr : publi CXXUnresolvedConstructExpr(EmptyShell Empty, unsigned NumArgs) : Expr(CXXUnresolvedConstructExprClass, Empty), Type(), NumArgs(NumArgs) { } + friend TrailingObjects; friend class ASTStmtReader; public: @@ -3036,13 +3007,11 @@ public: unsigned arg_size() const { return NumArgs; } typedef Expr** arg_iterator; - arg_iterator arg_begin() { return reinterpret_cast(this + 1); } + arg_iterator arg_begin() { return getTrailingObjects(); } arg_iterator arg_end() { return arg_begin() + NumArgs; } typedef const Expr* const * const_arg_iterator; - const_arg_iterator arg_begin() const { - return reinterpret_cast(this + 1); - } + const_arg_iterator arg_begin() const { return getTrailingObjects(); } const_arg_iterator arg_end() const { return arg_begin() + NumArgs; } @@ -3075,7 +3044,7 @@ public: // Iterators child_range children() { - Stmt **begin = reinterpret_cast(this+1); + Stmt **begin = reinterpret_cast(arg_begin()); return child_range(begin, begin + NumArgs); } }; @@ -3608,7 +3577,9 @@ public: /// static const unsigned value = sizeof...(Types); /// }; /// \endcode -class SizeOfPackExpr : public Expr { +class SizeOfPackExpr final + : public Expr, + private llvm::TrailingObjects { /// \brief The location of the \c sizeof keyword. SourceLocation OperatorLoc; @@ -3633,6 +3604,7 @@ class SizeOfPackExpr : public Expr { /// \brief The parameter pack. NamedDecl *Pack; + friend TrailingObjects; friend class ASTStmtReader; friend class ASTStmtWriter; @@ -3649,7 +3621,7 @@ class SizeOfPackExpr : public Expr { Length(Length ? *Length : PartialArgs.size()), Pack(Pack) { assert((!Length || PartialArgs.empty()) && "have partial args for non-dependent sizeof... expression"); - TemplateArgument *Args = reinterpret_cast(this + 1); + TemplateArgument *Args = getTrailingObjects(); std::uninitialized_copy(PartialArgs.begin(), PartialArgs.end(), Args); } @@ -3700,8 +3672,7 @@ public: /// \brief Get ArrayRef getPartialArguments() const { assert(isPartiallySubstituted()); - const TemplateArgument *Args = - reinterpret_cast(this + 1); + const TemplateArgument *Args = getTrailingObjects(); return llvm::makeArrayRef(Args, Args + Length); } @@ -3837,7 +3808,9 @@ public: /// }; /// template struct S; /// \endcode -class FunctionParmPackExpr : public Expr { +class FunctionParmPackExpr final + : public Expr, + private llvm::TrailingObjects { /// \brief The function parameter pack which was referenced. ParmVarDecl *ParamPack; @@ -3851,6 +3824,7 @@ class FunctionParmPackExpr : public Expr SourceLocation NameLoc, unsigned NumParams, ParmVarDecl *const *Params); + friend TrailingObjects; friend class ASTReader; friend class ASTStmtReader; @@ -3871,7 +3845,7 @@ public: /// \brief Iterators over the parameters which the parameter pack expanded /// into. typedef ParmVarDecl * const *iterator; - iterator begin() const { return reinterpret_cast(this+1); } + iterator begin() const { return getTrailingObjects(); } iterator end() const { return begin() + NumParameters; } /// \brief Get the number of parameters in this parameter pack. Modified: vendor/clang/dist/include/clang/AST/ExprObjC.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ExprObjC.h Wed Jan 6 20:01:33 2016 (r293249) +++ vendor/clang/dist/include/clang/AST/ExprObjC.h Wed Jan 6 20:02:26 2016 (r293250) @@ -141,15 +141,17 @@ public: /// ObjCArrayLiteral - used for objective-c array containers; as in: /// @[@"Hello", NSApp, [NSNumber numberWithInt:42]]; -class ObjCArrayLiteral : public Expr { +class ObjCArrayLiteral final + : public Expr, + private llvm::TrailingObjects { unsigned NumElements; SourceRange Range; ObjCMethodDecl *ArrayWithObjectsMethod; - + ObjCArrayLiteral(ArrayRef Elements, QualType T, ObjCMethodDecl * Method, SourceRange SR); - + explicit ObjCArrayLiteral(EmptyShell Empty, unsigned NumElements) : Expr(ObjCArrayLiteralClass, Empty), NumElements(NumElements) {} @@ -171,11 +173,11 @@ public: } /// \brief Retrieve elements of array of literals. - Expr **getElements() { return reinterpret_cast(this + 1); } + Expr **getElements() { return getTrailingObjects(); } /// \brief Retrieve elements of array of literals. - const Expr * const *getElements() const { - return reinterpret_cast(this + 1); + const Expr * const *getElements() const { + return getTrailingObjects(); } /// getNumElements - Return number of elements of objective-c array literal. @@ -196,11 +198,12 @@ public: } // Iterators - child_range children() { - return child_range((Stmt **)getElements(), - (Stmt **)getElements() + NumElements); + child_range children() { + return child_range(reinterpret_cast(getElements()), + reinterpret_cast(getElements()) + NumElements); } - + + friend TrailingObjects; friend class ASTStmtReader; }; @@ -230,32 +233,35 @@ template <> struct isPodLike { /// \brief The number of elements in this dictionary literal. unsigned NumElements : 31; - + /// \brief Determine whether this dictionary literal has any pack expansions. /// /// If the dictionary literal has pack expansions, then there will @@ -264,10 +270,17 @@ class ObjCDictionaryLiteral : public Exp /// any) and number of elements in the expansion (if known). If /// there are no pack expansions, we optimize away this storage. unsigned HasPackExpansions : 1; - + SourceRange Range; ObjCMethodDecl *DictWithObjectsMethod; - + + typedef ObjCDictionaryLiteral_KeyValuePair KeyValuePair; + typedef ObjCDictionaryLiteral_ExpansionData ExpansionData; + + size_t numTrailingObjects(OverloadToken) const { + return NumElements; + } + ObjCDictionaryLiteral(ArrayRef VK, bool HasPackExpansions, QualType T, ObjCMethodDecl *method, @@ -278,28 +291,6 @@ class ObjCDictionaryLiteral : public Exp : Expr(ObjCDictionaryLiteralClass, Empty), NumElements(NumElements), HasPackExpansions(HasPackExpansions) {} - KeyValuePair *getKeyValues() { - return reinterpret_cast(this + 1); - } - - const KeyValuePair *getKeyValues() const { - return reinterpret_cast(this + 1); - } - - ExpansionData *getExpansionData() { - if (!HasPackExpansions) - return nullptr; - - return reinterpret_cast(getKeyValues() + NumElements); - } - - const ExpansionData *getExpansionData() const { - if (!HasPackExpansions) - return nullptr; - - return reinterpret_cast(getKeyValues()+NumElements); - } - public: static ObjCDictionaryLiteral *Create(const ASTContext &C, ArrayRef VK, @@ -317,10 +308,11 @@ public: ObjCDictionaryElement getKeyValueElement(unsigned Index) const { assert((Index < NumElements) && "Arg access out of range!"); - const KeyValuePair &KV = getKeyValues()[Index]; + const KeyValuePair &KV = getTrailingObjects()[Index]; ObjCDictionaryElement Result = { KV.Key, KV.Value, SourceLocation(), None }; if (HasPackExpansions) { - const ExpansionData &Expansion = getExpansionData()[Index]; + const ExpansionData &Expansion = + getTrailingObjects()[Index]; Result.EllipsisLoc = Expansion.EllipsisLoc; if (Expansion.NumExpansionsPlusOne > 0) Result.NumExpansions = Expansion.NumExpansionsPlusOne - 1; @@ -340,17 +332,20 @@ public: } // Iterators - child_range children() { + child_range children() { // Note: we're taking advantage of the layout of the KeyValuePair struct // here. If that struct changes, this code will need to change as well. static_assert(sizeof(KeyValuePair) == sizeof(Stmt *) * 2, "KeyValuePair is expected size"); - return child_range(reinterpret_cast(this + 1), - reinterpret_cast(this + 1) + NumElements * 2); + return child_range( + reinterpret_cast(getTrailingObjects()), + reinterpret_cast(getTrailingObjects()) + + NumElements * 2); } friend class ASTStmtReader; friend class ASTStmtWriter; + friend TrailingObjects; }; @@ -797,13 +792,6 @@ public: explicit ObjCSubscriptRefExpr(EmptyShell Empty) : Expr(ObjCSubscriptRefExprClass, Empty) {} - static ObjCSubscriptRefExpr *Create(const ASTContext &C, - Expr *base, - Expr *key, QualType T, - ObjCMethodDecl *getMethod, - ObjCMethodDecl *setMethod, - SourceLocation RB); - SourceLocation getRBracket() const { return RBracket; } void setRBracket(SourceLocation RB) { RBracket = RB; } @@ -865,7 +853,13 @@ private: /// All four kinds of message sends are modeled by the ObjCMessageExpr /// class, and can be distinguished via \c getReceiverKind(). Example: /// -class ObjCMessageExpr : public Expr { +/// The "void *" trailing objects are actually ONE void * (the +/// receiver pointer), and NumArgs Expr *. But due to the +/// implementation of children(), these must be together contiguously. + +class ObjCMessageExpr final + : public Expr, + private llvm::TrailingObjects { /// \brief Stores either the selector that this message is sending /// to (when \c HasMethod is zero) or an \c ObjCMethodDecl pointer /// referring to the method that we type-checked against. @@ -877,11 +871,6 @@ class ObjCMessageExpr : public Expr { /// including the receiver. unsigned NumArgs : NumArgsBitWidth; - void setNumArgs(unsigned Num) { - assert((Num >> NumArgsBitWidth) == 0 && "Num of args is out of range!"); - NumArgs = Num; - } - /// \brief The kind of message send this is, which is one of the /// ReceiverKind values. /// @@ -915,6 +904,13 @@ class ObjCMessageExpr : public Expr { /// brackets ('[' and ']', respectively). SourceLocation LBracLoc, RBracLoc; + size_t numTrailingObjects(OverloadToken) const { return NumArgs + 1; } + + void setNumArgs(unsigned Num) { + assert((Num >> NumArgsBitWidth) == 0 && "Num of args is out of range!"); + NumArgs = Num; + } + ObjCMessageExpr(EmptyShell Empty, unsigned NumArgs) : Expr(ObjCMessageExprClass, Empty), SelectorOrMethod(0), Kind(0), HasMethod(0), IsDelegateInitCall(0), IsImplicit(0), SelLocsKind(0) { @@ -959,14 +955,11 @@ class ObjCMessageExpr : public Expr { SelectorLocationsKind SelLocsK); /// \brief Retrieve the pointer value of the message receiver. - void *getReceiverPointer() const { - return *const_cast( - reinterpret_cast(this + 1)); - } + void *getReceiverPointer() const { return *getTrailingObjects(); } /// \brief Set the pointer value of the message receiver. void setReceiverPointer(void *Value) { - *reinterpret_cast(this + 1) = Value; + *getTrailingObjects() = Value; } SelectorLocationsKind getSelLocsKind() const { @@ -979,10 +972,10 @@ class ObjCMessageExpr : public Expr { /// \brief Get a pointer to the stored selector identifiers locations array. /// No locations will be stored if HasStandardSelLocs is true. SourceLocation *getStoredSelLocs() { - return reinterpret_cast(getArgs() + getNumArgs()); + return getTrailingObjects(); } const SourceLocation *getStoredSelLocs() const { - return reinterpret_cast(getArgs() + getNumArgs()); + return getTrailingObjects(); } /// \brief Get the number of stored selector identifiers locations. @@ -1286,20 +1279,21 @@ public: /// \brief Retrieve the arguments to this message, not including the /// receiver. Expr **getArgs() { - return reinterpret_cast(this + 1) + 1; + return reinterpret_cast(getTrailingObjects() + 1); } const Expr * const *getArgs() const { - return reinterpret_cast(this + 1) + 1; + return reinterpret_cast(getTrailingObjects() + + 1); } /// getArg - Return the specified argument. Expr *getArg(unsigned Arg) { assert(Arg < NumArgs && "Arg access out of range!"); - return cast(getArgs()[Arg]); + return getArgs()[Arg]; } const Expr *getArg(unsigned Arg) const { assert(Arg < NumArgs && "Arg access out of range!"); - return cast(getArgs()[Arg]); + return getArgs()[Arg]; } /// setArg - Set the specified argument. void setArg(unsigned Arg, Expr *ArgExpr) { @@ -1379,6 +1373,7 @@ public: return reinterpret_cast(getArgs() + NumArgs); } + friend TrailingObjects; friend class ASTStmtReader; friend class ASTStmtWriter; }; Modified: vendor/clang/dist/include/clang/AST/Mangle.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Mangle.h Wed Jan 6 20:01:33 2016 (r293249) +++ vendor/clang/dist/include/clang/AST/Mangle.h Wed Jan 6 20:02:26 2016 (r293250) @@ -216,9 +216,6 @@ public: uint32_t NVOffset, int32_t VBPtrOffset, uint32_t VBIndex, raw_ostream &Out) = 0; - virtual void mangleCXXCatchHandlerType(QualType T, uint32_t Flags, - raw_ostream &Out) = 0; - virtual void mangleCXXRTTIBaseClassDescriptor( const CXXRecordDecl *Derived, uint32_t NVOffset, int32_t VBPtrOffset, uint32_t VBTableOffset, uint32_t Flags, raw_ostream &Out) = 0; Modified: vendor/clang/dist/include/clang/AST/OpenMPClause.h ============================================================================== --- vendor/clang/dist/include/clang/AST/OpenMPClause.h Wed Jan 6 20:01:33 2016 (r293249) +++ vendor/clang/dist/include/clang/AST/OpenMPClause.h Wed Jan 6 20:02:26 2016 (r293250) @@ -84,21 +84,15 @@ protected: /// \brief Fetches list of variables associated with this clause. MutableArrayRef getVarRefs() { return MutableArrayRef( - reinterpret_cast( - reinterpret_cast(this) + - llvm::RoundUpToAlignment(sizeof(T), llvm::alignOf())), - NumVars); + static_cast(this)->template getTrailingObjects(), NumVars); } /// \brief Sets the list of variables for this clause. void setVarRefs(ArrayRef VL) { assert(VL.size() == NumVars && "Number of variables is not the same as the preallocated buffer"); - std::copy( - VL.begin(), VL.end(), - reinterpret_cast( - reinterpret_cast(this) + - llvm::RoundUpToAlignment(sizeof(T), llvm::alignOf()))); + std::copy(VL.begin(), VL.end(), + static_cast(this)->template getTrailingObjects()); } /// \brief Build a clause with \a N variables @@ -142,9 +136,7 @@ public: /// \brief Fetches list of all variables in the clause. ArrayRef getVarRefs() const { return llvm::makeArrayRef( - reinterpret_cast( - reinterpret_cast(this) + - llvm::RoundUpToAlignment(sizeof(T), llvm::alignOf())), + static_cast(this)->template getTrailingObjects(), NumVars); } }; @@ -1160,7 +1152,11 @@ public: /// In this example directive '#pragma omp parallel' has clause 'private' /// with the variables 'a' and 'b'. /// -class OMPPrivateClause : public OMPVarListClause { +class OMPPrivateClause final + : public OMPVarListClause, + private llvm::TrailingObjects { + friend TrailingObjects; + friend OMPVarListClause; friend class OMPClauseReader; /// \brief Build clause with number of variables \a N. /// @@ -1252,7 +1248,11 @@ public: /// In this example directive '#pragma omp parallel' has clause 'firstprivate' /// with the variables 'a' and 'b'. /// -class OMPFirstprivateClause : public OMPVarListClause { +class OMPFirstprivateClause final + : public OMPVarListClause, + private llvm::TrailingObjects { + friend TrailingObjects; + friend OMPVarListClause; friend class OMPClauseReader; /// \brief Build clause with number of variables \a N. @@ -1372,7 +1372,9 @@ public: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 6 20:02:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99C3CA65881; Wed, 6 Jan 2016 20:02:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52AB31E46; Wed, 6 Jan 2016 20:02:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K2nQR084238; Wed, 6 Jan 2016 20:02:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K2nmN084235; Wed, 6 Jan 2016 20:02:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601062002.u06K2nmN084235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 20:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293251 - in stable/10: etc/mtree tests/sys tests/sys/mac tests/sys/mac/bsdextended X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:02:50 -0000 Author: ngie Date: Wed Jan 6 20:02:49 2016 New Revision: 293251 URL: https://svnweb.freebsd.org/changeset/base/293251 Log: MFC r292570: Integrate tools/regression/mac/mac_bsdextended and tools/regression/mac/mac_portacl into the FreeBSD test suite as tests/sys/mac/bsdextended and tests/sys/mac/portacl, respectively Added: stable/10/tests/sys/mac/ - copied from r292570, head/tests/sys/mac/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/tests/sys/Makefile stable/10/tests/sys/mac/bsdextended/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Wed Jan 6 20:02:26 2016 (r293250) +++ stable/10/etc/mtree/BSD.tests.dist Wed Jan 6 20:02:49 2016 (r293251) @@ -214,6 +214,12 @@ .. kqueue .. + mac + bsdextended + .. + portacl + .. + .. mqueue .. netinet Modified: stable/10/tests/sys/Makefile ============================================================================== --- stable/10/tests/sys/Makefile Wed Jan 6 20:02:26 2016 (r293250) +++ stable/10/tests/sys/Makefile Wed Jan 6 20:02:49 2016 (r293251) @@ -10,6 +10,7 @@ TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= kqueue +TESTS_SUBDIRS+= mac TESTS_SUBDIRS+= mqueue TESTS_SUBDIRS+= netinet TESTS_SUBDIRS+= posixshm Modified: stable/10/tests/sys/mac/bsdextended/Makefile ============================================================================== --- head/tests/sys/mac/bsdextended/Makefile Mon Dec 21 21:24:03 2015 (r292570) +++ stable/10/tests/sys/mac/bsdextended/Makefile Wed Jan 6 20:02:49 2016 (r293251) @@ -5,7 +5,8 @@ TESTSDIR= ${TESTSBASE}/sys/mac/bsdextend TAP_TESTS_C+= ugidfw_test TAP_TESTS_SH+= matches_test -LIBADD.ugidfw_test+= ugidfw +DPADD.ugidfw_test+= ${LIBUGIDFW} +LDADD.ugidfw_test+= -lugidfw TEST_METADATA.matches_test+= required_user="root" TEST_METADATA.ugidfw_test+= required_user="root" From owner-svn-src-all@freebsd.org Wed Jan 6 20:02:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09073A658E7; Wed, 6 Jan 2016 20:02:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B23DC1EB3; Wed, 6 Jan 2016 20:02:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K2sXd084287; Wed, 6 Jan 2016 20:02:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K2sNK084286; Wed, 6 Jan 2016 20:02:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601062002.u06K2sNK084286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 Jan 2016 20:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293252 - vendor/clang/clang-trunk-r256945 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:02:56 -0000 Author: dim Date: Wed Jan 6 20:02:54 2016 New Revision: 293252 URL: https://svnweb.freebsd.org/changeset/base/293252 Log: Tag clang trunk r256945. Added: vendor/clang/clang-trunk-r256945/ - copied from r293250, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Wed Jan 6 20:03:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34D5FA659A9; Wed, 6 Jan 2016 20:03:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F417B1171; Wed, 6 Jan 2016 20:03:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K3Njw084370; Wed, 6 Jan 2016 20:03:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K3Lx9084354; Wed, 6 Jan 2016 20:03:21 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601062003.u06K3Lx9084354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 Jan 2016 20:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293253 - in vendor/compiler-rt/dist: cmake include/sanitizer lib/asan lib/profile lib/sanitizer_common test/asan/TestCases X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:03:24 -0000 Author: dim Date: Wed Jan 6 20:03:21 2016 New Revision: 293253 URL: https://svnweb.freebsd.org/changeset/base/293253 Log: Vendor import of compiler-rt trunk r256945: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256945 Added: vendor/compiler-rt/dist/lib/profile/WindowsMMap.c (contents, props changed) vendor/compiler-rt/dist/lib/profile/WindowsMMap.h (contents, props changed) vendor/compiler-rt/dist/test/asan/TestCases/coverage-pc-buffer.cc (contents, props changed) Modified: vendor/compiler-rt/dist/cmake/config-ix.cmake vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h vendor/compiler-rt/dist/lib/asan/asan_win_dll_thunk.cc vendor/compiler-rt/dist/lib/profile/CMakeLists.txt vendor/compiler-rt/dist/lib/profile/GCDAProfiling.c vendor/compiler-rt/dist/lib/profile/InstrProfData.inc vendor/compiler-rt/dist/lib/profile/InstrProfilingFile.c vendor/compiler-rt/dist/lib/profile/InstrProfilingPort.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Modified: vendor/compiler-rt/dist/cmake/config-ix.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/config-ix.cmake Wed Jan 6 20:02:54 2016 (r293252) +++ vendor/compiler-rt/dist/cmake/config-ix.cmake Wed Jan 6 20:03:21 2016 (r293253) @@ -559,7 +559,7 @@ else() endif() if (PROFILE_SUPPORTED_ARCH AND - OS_NAME MATCHES "Darwin|Linux|FreeBSD") + OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows") set(COMPILER_RT_HAS_PROFILE TRUE) else() set(COMPILER_RT_HAS_PROFILE FALSE) Modified: vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h Wed Jan 6 20:02:54 2016 (r293252) +++ vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h Wed Jan 6 20:03:21 2016 (r293253) @@ -41,6 +41,13 @@ extern "C" { // Some of the entries in *data will be zero. uintptr_t __sanitizer_get_coverage_guards(uintptr_t **data); + // Set *data to the growing buffer with covered PCs and return the size + // of the buffer. The entries are never zero. + // When only unique pcs are collected, the size is equal to + // __sanitizer_get_total_unique_coverage. + // WARNING: EXPERIMENTAL API. + uintptr_t __sanitizer_get_coverage_pc_buffer(uintptr_t **data); + // The coverage instrumentation may optionally provide imprecise counters. // Rather than exposing the counter values to the user we instead map // the counters to a bitset. Modified: vendor/compiler-rt/dist/lib/asan/asan_win_dll_thunk.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_win_dll_thunk.cc Wed Jan 6 20:02:54 2016 (r293252) +++ vendor/compiler-rt/dist/lib/asan/asan_win_dll_thunk.cc Wed Jan 6 20:03:21 2016 (r293253) @@ -315,6 +315,7 @@ INTERFACE_FUNCTION(__sanitizer_cov_trace INTERFACE_FUNCTION(__sanitizer_cov_with_check) INTERFACE_FUNCTION(__sanitizer_get_allocated_size) INTERFACE_FUNCTION(__sanitizer_get_coverage_guards) +INTERFACE_FUNCTION(__sanitizer_get_coverage_pc_buffer) INTERFACE_FUNCTION(__sanitizer_get_current_allocated_bytes) INTERFACE_FUNCTION(__sanitizer_get_estimated_allocated_size) INTERFACE_FUNCTION(__sanitizer_get_free_bytes) Modified: vendor/compiler-rt/dist/lib/profile/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/profile/CMakeLists.txt Wed Jan 6 20:02:54 2016 (r293252) +++ vendor/compiler-rt/dist/lib/profile/CMakeLists.txt Wed Jan 6 20:03:21 2016 (r293253) @@ -35,7 +35,8 @@ set(PROFILE_SOURCES InstrProfilingPlatformLinux.c InstrProfilingPlatformOther.c InstrProfilingRuntime.cc - InstrProfilingUtil.c) + InstrProfilingUtil.c + WindowsMMap.c) if(UNIX) set(EXTRA_FLAGS Modified: vendor/compiler-rt/dist/lib/profile/GCDAProfiling.c ============================================================================== --- vendor/compiler-rt/dist/lib/profile/GCDAProfiling.c Wed Jan 6 20:02:54 2016 (r293252) +++ vendor/compiler-rt/dist/lib/profile/GCDAProfiling.c Wed Jan 6 20:03:21 2016 (r293253) @@ -27,8 +27,13 @@ #include #include #include + +#if defined(_WIN32) +#include "WindowsMMap.h" +#else #include #include +#endif #define I386_FREEBSD (defined(__FreeBSD__) && defined(__i386__)) @@ -37,6 +42,7 @@ #endif #if defined(_MSC_VER) +typedef unsigned char uint8_t; typedef unsigned int uint32_t; typedef unsigned long long uint64_t; #elif I386_FREEBSD Modified: vendor/compiler-rt/dist/lib/profile/InstrProfData.inc ============================================================================== --- vendor/compiler-rt/dist/lib/profile/InstrProfData.inc Wed Jan 6 20:02:54 2016 (r293252) +++ vendor/compiler-rt/dist/lib/profile/InstrProfData.inc Wed Jan 6 20:03:21 2016 (r293253) @@ -1,4 +1,4 @@ -/*===-- InstrProfData.inc - instr profiling runtime structures -----------=== *\ +/*===-- InstrProfData.inc - instr profiling runtime structures -*- C++ -*-=== *\ |* |* The LLVM Compiler Infrastructure |* @@ -167,6 +167,25 @@ COVMAP_FUNC_RECORD(const uint64_t, llvm: #undef COVMAP_FUNC_RECORD /* COVMAP_FUNC_RECORD end. */ +/* COVMAP_HEADER start */ +/* Definition of member fields of coverage map header. + */ +#ifndef COVMAP_HEADER +#define COVMAP_HEADER(Type, LLVMType, Name, Initializer) +#else +#define INSTR_PROF_DATA_DEFINED +#endif +COVMAP_HEADER(uint32_t, Int32Ty, NRecords, \ + llvm::ConstantInt::get(Int32Ty, FunctionRecords.size())) +COVMAP_HEADER(uint32_t, Int32Ty, FilenamesSize, \ + llvm::ConstantInt::get(Int32Ty, FilenamesSize)) +COVMAP_HEADER(uint32_t, Int32Ty, CoverageSize, \ + llvm::ConstantInt::get(Int32Ty, CoverageMappingSize)) +COVMAP_HEADER(uint32_t, Int32Ty, Version, \ + llvm::ConstantInt::get(Int32Ty, CoverageMappingVersion1)) +#undef COVMAP_HEADER +/* COVMAP_HEADER end. */ + #ifdef INSTR_PROF_VALUE_PROF_DATA #define INSTR_PROF_DATA_DEFINED Modified: vendor/compiler-rt/dist/lib/profile/InstrProfilingFile.c ============================================================================== --- vendor/compiler-rt/dist/lib/profile/InstrProfilingFile.c Wed Jan 6 20:02:54 2016 (r293252) +++ vendor/compiler-rt/dist/lib/profile/InstrProfilingFile.c Wed Jan 6 20:03:21 2016 (r293253) @@ -17,6 +17,10 @@ #define UNCONST(ptr) ((void *)(uintptr_t)(ptr)) +#ifdef _MSC_VER +#define snprintf _snprintf +#endif + /* Return 1 if there is an error, otherwise return 0. */ static uint32_t fileWriter(ProfDataIOVec *IOVecs, uint32_t NumIOVecs, void **WriterCtx) { Modified: vendor/compiler-rt/dist/lib/profile/InstrProfilingPort.h ============================================================================== --- vendor/compiler-rt/dist/lib/profile/InstrProfilingPort.h Wed Jan 6 20:02:54 2016 (r293252) +++ vendor/compiler-rt/dist/lib/profile/InstrProfilingPort.h Wed Jan 6 20:03:21 2016 (r293253) @@ -47,26 +47,12 @@ if (GetEnvHook && GetEnvHook("LLVM_PROFILE_VERBOSE_ERRORS")) \ fprintf(stderr, Format, __VA_ARGS__); -#if defined(__FreeBSD__) && defined(__i386__) +#if defined(__FreeBSD__) -/* System headers define 'size_t' incorrectly on x64 FreeBSD (prior to - * FreeBSD 10, r232261) when compiled in 32-bit mode. - */ -#define PRIu64 "llu" -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; -typedef uint32_t uintptr_t; -#elif defined(__FreeBSD__) && defined(__x86_64__) -#define PRIu64 "lu" -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; -typedef unsigned long int uintptr_t; +#include +#include -#else /* defined(__FreeBSD__) && defined(__i386__) */ +#else /* defined(__FreeBSD__) */ #include #include Added: vendor/compiler-rt/dist/lib/profile/WindowsMMap.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/profile/WindowsMMap.c Wed Jan 6 20:03:21 2016 (r293253) @@ -0,0 +1,128 @@ +/* + * This code is derived from uClibc (original license follows). + * https://git.uclibc.org/uClibc/tree/utils/mmap-windows.c + */ + /* mmap() replacement for Windows + * + * Author: Mike Frysinger + * Placed into the public domain + */ + +/* References: + * CreateFileMapping: http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx + * CloseHandle: http://msdn.microsoft.com/en-us/library/ms724211(VS.85).aspx + * MapViewOfFile: http://msdn.microsoft.com/en-us/library/aa366761(VS.85).aspx + * UnmapViewOfFile: http://msdn.microsoft.com/en-us/library/aa366882(VS.85).aspx + */ + +#if defined(_WIN32) + +#include "WindowsMMap.h" +#include "InstrProfiling.h" + +#ifdef __USE_FILE_OFFSET64 +# define DWORD_HI(x) (x >> 32) +# define DWORD_LO(x) ((x) & 0xffffffff) +#else +# define DWORD_HI(x) (0) +# define DWORD_LO(x) (x) +#endif + +COMPILER_RT_VISIBILITY +void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) +{ + if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) + return MAP_FAILED; + if (fd == -1) { + if (!(flags & MAP_ANON) || offset) + return MAP_FAILED; + } else if (flags & MAP_ANON) + return MAP_FAILED; + + DWORD flProtect; + if (prot & PROT_WRITE) { + if (prot & PROT_EXEC) + flProtect = PAGE_EXECUTE_READWRITE; + else + flProtect = PAGE_READWRITE; + } else if (prot & PROT_EXEC) { + if (prot & PROT_READ) + flProtect = PAGE_EXECUTE_READ; + else if (prot & PROT_EXEC) + flProtect = PAGE_EXECUTE; + } else + flProtect = PAGE_READONLY; + + off_t end = length + offset; + HANDLE mmap_fd, h; + if (fd == -1) + mmap_fd = INVALID_HANDLE_VALUE; + else + mmap_fd = (HANDLE)_get_osfhandle(fd); + h = CreateFileMapping(mmap_fd, NULL, flProtect, DWORD_HI(end), DWORD_LO(end), NULL); + if (h == NULL) + return MAP_FAILED; + + DWORD dwDesiredAccess; + if (prot & PROT_WRITE) + dwDesiredAccess = FILE_MAP_WRITE; + else + dwDesiredAccess = FILE_MAP_READ; + if (prot & PROT_EXEC) + dwDesiredAccess |= FILE_MAP_EXECUTE; + if (flags & MAP_PRIVATE) + dwDesiredAccess |= FILE_MAP_COPY; + void *ret = MapViewOfFile(h, dwDesiredAccess, DWORD_HI(offset), DWORD_LO(offset), length); + if (ret == NULL) { + CloseHandle(h); + ret = MAP_FAILED; + } + return ret; +} + +COMPILER_RT_VISIBILITY +void munmap(void *addr, size_t length) +{ + UnmapViewOfFile(addr); + /* ruh-ro, we leaked handle from CreateFileMapping() ... */ +} + +COMPILER_RT_VISIBILITY +int msync(void *addr, size_t length, int flags) +{ + if (flags & MS_INVALIDATE) + return -1; /* Not supported. */ + + /* Exactly one of MS_ASYNC or MS_SYNC must be specified. */ + switch (flags & (MS_ASYNC | MS_SYNC)) { + case MS_SYNC: + case MS_ASYNC: + break; + default: + return -1; + } + + if (!FlushViewOfFile(addr, length)) + return -1; + + if (flags & MS_SYNC) { + /* FIXME: No longer have access to handle from CreateFileMapping(). */ + /* + * if (!FlushFileBuffers(h)) + * return -1; + */ + } + + return 0; +} + +COMPILER_RT_VISIBILITY +int flock(int fd, int operation) +{ + return -1; /* Not supported. */ +} + +#undef DWORD_HI +#undef DWORD_LO + +#endif /* _WIN32 */ Added: vendor/compiler-rt/dist/lib/profile/WindowsMMap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/profile/WindowsMMap.h Wed Jan 6 20:03:21 2016 (r293253) @@ -0,0 +1,65 @@ +/*===- WindowsMMap.h - Support library for PGO instrumentation ------------===*\ +|* +|* The LLVM Compiler Infrastructure +|* +|* This file is distributed under the University of Illinois Open Source +|* License. See LICENSE.TXT for details. +|* +\*===----------------------------------------------------------------------===*/ + +#ifndef PROFILE_INSTRPROFILING_WINDOWS_MMAP_H +#define PROFILE_INSTRPROFILING_WINDOWS_MMAP_H + +#if defined(_WIN32) + +#include +#include +#include + +/* + * mmap() flags + */ +#define PROT_READ 0x1 +#define PROT_WRITE 0x2 +/* This flag is only available in WinXP+ */ +#ifdef FILE_MAP_EXECUTE +#define PROT_EXEC 0x4 +#else +#define PROT_EXEC 0x0 +#define FILE_MAP_EXECUTE 0 +#endif + +#define MAP_FILE 0x00 +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_ANONYMOUS 0x20 +#define MAP_ANON MAP_ANONYMOUS +#define MAP_FAILED ((void *) -1) + +/* + * msync() flags + */ +#define MS_ASYNC 0x0001 /* return immediately */ +#define MS_INVALIDATE 0x0002 /* invalidate all cached data */ +#define MS_SYNC 0x0010 /* msync synchronously */ + +/* + * flock() operations + */ +#define LOCK_SH 1 /* shared lock */ +#define LOCK_EX 2 /* exclusive lock */ +#define LOCK_NB 4 /* don't block when locking */ +#define LOCK_UN 8 /* unlock */ + +void *mmap(void *start, size_t length, int prot, int flags, int fd, + off_t offset); + +void munmap(void *addr, size_t length); + +int msync(void *addr, size_t length, int flags); + +int flock(int fd, int operation); + +#endif /* _WIN32 */ + +#endif /* PROFILE_INSTRPROFILING_WINDOWS_MMAP_H */ Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc Wed Jan 6 20:02:54 2016 (r293252) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc Wed Jan 6 20:03:21 2016 (r293253) @@ -108,6 +108,7 @@ class CoverageData { uptr *data(); uptr size(); + uptr *buffer() const { return pc_buffer; } private: void DirectOpen(); @@ -133,6 +134,8 @@ class CoverageData { // Descriptor of the file mapped pc array. fd_t pc_fd; + uptr *pc_buffer; + // Vector of coverage guard arrays, protected by mu. InternalMmapVectorNoCtor guard_array_vec; @@ -209,6 +212,11 @@ void CoverageData::Enable() { atomic_store(&pc_array_size, kPcArrayMaxSize, memory_order_relaxed); } + pc_buffer = nullptr; + if (common_flags()->coverage_pc_buffer) + pc_buffer = reinterpret_cast(MmapNoReserveOrDie( + sizeof(uptr) * kPcArrayMaxSize, "CovInit::pc_buffer")); + cc_array = reinterpret_cast(MmapNoReserveOrDie( sizeof(uptr *) * kCcArrayMaxSize, "CovInit::cc_array")); atomic_store(&cc_array_size, kCcArrayMaxSize, memory_order_relaxed); @@ -246,6 +254,10 @@ void CoverageData::Disable() { UnmapOrDie(cc_array, sizeof(uptr *) * kCcArrayMaxSize); cc_array = nullptr; } + if (pc_buffer) { + UnmapOrDie(pc_buffer, sizeof(uptr) * kPcArrayMaxSize); + pc_buffer = nullptr; + } if (tr_event_array) { UnmapOrDie(tr_event_array, sizeof(tr_event_array[0]) * kTrEventArrayMaxSize + @@ -414,6 +426,7 @@ void CoverageData::Add(uptr pc, u32 *gua atomic_load(&pc_array_size, memory_order_acquire)); uptr counter = atomic_fetch_add(&coverage_counter, 1, memory_order_relaxed); pc_array[idx] = BundlePcAndCounter(pc, counter); + if (pc_buffer) pc_buffer[counter] = pc; } // Registers a pair caller=>callee. @@ -944,6 +957,12 @@ uptr __sanitizer_get_coverage_guards(upt } SANITIZER_INTERFACE_ATTRIBUTE +uptr __sanitizer_get_coverage_pc_buffer(uptr **data) { + *data = coverage_data.buffer(); + return __sanitizer_get_total_unique_coverage(); +} + +SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_number_of_counters() { return coverage_data.GetNumberOf8bitCounters(); } Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Wed Jan 6 20:02:54 2016 (r293252) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Wed Jan 6 20:03:21 2016 (r293253) @@ -144,6 +144,9 @@ COMMON_FLAG(bool, coverage_direct, SANIT COMMON_FLAG(const char *, coverage_dir, ".", "Target directory for coverage dumps. Defaults to the current " "directory.") +COMMON_FLAG(bool, coverage_pc_buffer, true, + "If set (and if 'coverage' is set too), the pcs would be collected " + "in a buffer.") COMMON_FLAG(bool, full_address_space, false, "Sanitize complete address space; " "by default kernel area on 32-bit platforms will not be sanitized") Added: vendor/compiler-rt/dist/test/asan/TestCases/coverage-pc-buffer.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/asan/TestCases/coverage-pc-buffer.cc Wed Jan 6 20:03:21 2016 (r293253) @@ -0,0 +1,48 @@ +// Test __sanitizer_coverage_pc_buffer(). + +// RUN: %clangxx_asan -fsanitize-coverage=edge %s -o %t && %run %t + +// UNSUPPORTED: android + +#include +#include +#include + +static volatile int sink; +__attribute__((noinline)) void bar() { sink = 2; } +__attribute__((noinline)) void foo() { sink = 1; } + +void assertNotZeroPcs(uintptr_t *buf, uintptr_t size) { + assert(buf); + for (uintptr_t i = 0; i < size; ++i) + assert(buf[i]); +} + +int main() { + uintptr_t *buf = NULL; + uintptr_t sz = __sanitizer_get_coverage_pc_buffer(&buf); + assertNotZeroPcs(buf, sz); + assert(sz); + + foo(); + bar(); + uintptr_t *buf1 = NULL; + uintptr_t sz1 = __sanitizer_get_coverage_pc_buffer(&buf1); + assertNotZeroPcs(buf1, sz1); + assert(buf1 == buf); + assert(sz1 > sz); + + bar(); + uintptr_t *buf2 = NULL; + uintptr_t sz2 = __sanitizer_get_coverage_pc_buffer(&buf2); + assertNotZeroPcs(buf2, sz2); + assert(buf2 == buf); + assert(sz2 > sz1); + + __sanitizer_reset_coverage(); + uintptr_t *buf3 = NULL; + uintptr_t sz3 = __sanitizer_get_coverage_pc_buffer(&buf3); + assertNotZeroPcs(buf3, sz3); + assert(buf3 == buf); + assert(sz3 < sz2); +} From owner-svn-src-all@freebsd.org Wed Jan 6 20:03:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D15AEA65A03; Wed, 6 Jan 2016 20:03:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8729E12F9; Wed, 6 Jan 2016 20:03:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K3vqZ084452; Wed, 6 Jan 2016 20:03:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K3vST084451; Wed, 6 Jan 2016 20:03:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601062003.u06K3vST084451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 Jan 2016 20:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293254 - vendor/compiler-rt/compiler-rt-trunk-r256945 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:03:58 -0000 Author: dim Date: Wed Jan 6 20:03:57 2016 New Revision: 293254 URL: https://svnweb.freebsd.org/changeset/base/293254 Log: Tag compiler-rt trunk r256945. Added: vendor/compiler-rt/compiler-rt-trunk-r256945/ - copied from r293253, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Wed Jan 6 20:05:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BBEDA65BA8; Wed, 6 Jan 2016 20:05:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7A4215D8; Wed, 6 Jan 2016 20:05:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K5LoP084552; Wed, 6 Jan 2016 20:05:21 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K5KVK084545; Wed, 6 Jan 2016 20:05:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601062005.u06K5KVK084545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 Jan 2016 20:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293255 - in vendor/libc++/dist: include include/ext test/libcxx/test test/std/containers/associative/map/map.modifiers test/std/containers/associative/multimap/multimap.modifiers test/... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:05:22 -0000 Author: dim Date: Wed Jan 6 20:05:20 2016 New Revision: 293255 URL: https://svnweb.freebsd.org/changeset/base/293255 Log: Vendor import of libc++ trunk r256945: https://llvm.org/svn/llvm-project/libcxx/trunk@256945 Modified: vendor/libc++/dist/include/__config vendor/libc++/dist/include/__hash_table vendor/libc++/dist/include/__tree vendor/libc++/dist/include/ext/hash_map vendor/libc++/dist/include/forward_list vendor/libc++/dist/include/list vendor/libc++/dist/include/map vendor/libc++/dist/include/unordered_map vendor/libc++/dist/test/libcxx/test/config.py vendor/libc++/dist/test/libcxx/test/target_info.py vendor/libc++/dist/test/std/containers/associative/map/map.modifiers/insert_iter_rv.pass.cpp vendor/libc++/dist/test/std/containers/associative/map/map.modifiers/insert_rv.pass.cpp vendor/libc++/dist/test/std/containers/associative/multimap/multimap.modifiers/insert_iter_rv.pass.cpp vendor/libc++/dist/test/std/containers/associative/multimap/multimap.modifiers/insert_rv.pass.cpp vendor/libc++/dist/test/support/MoveOnly.h Modified: vendor/libc++/dist/include/__config ============================================================================== --- vendor/libc++/dist/include/__config Wed Jan 6 20:03:57 2016 (r293254) +++ vendor/libc++/dist/include/__config Wed Jan 6 20:05:20 2016 (r293255) @@ -39,6 +39,8 @@ #define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT // Fix deque iterator type in order to support incomplete types. #define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE +// Fix undefined behavior in how std::list stores it's linked nodes. +#define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB #endif #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y Modified: vendor/libc++/dist/include/__hash_table ============================================================================== --- vendor/libc++/dist/include/__hash_table Wed Jan 6 20:03:57 2016 (r293254) +++ vendor/libc++/dist/include/__hash_table Wed Jan 6 20:05:20 2016 (r293255) @@ -46,12 +46,7 @@ template struct __hash_node : public __hash_node_base < - typename pointer_traits<_VoidPtr>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__hash_node<_Tp, _VoidPtr> > -#else - rebind<__hash_node<_Tp, _VoidPtr> >::other -#endif + typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type > { typedef _Tp value_type; @@ -98,13 +93,7 @@ public: typedef typename pointer_traits<__node_pointer>::element_type::value_type value_type; typedef typename pointer_traits<__node_pointer>::difference_type difference_type; typedef value_type& reference; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - pointer; + typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer; _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT #if _LIBCPP_STD_VER > 11 @@ -229,20 +218,8 @@ public: typedef typename __node::value_type value_type; typedef typename pointer_traits<__node_pointer>::difference_type difference_type; typedef const value_type& reference; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - pointer; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__node> -#else - rebind<__node>::other -#endif - __non_const_node_pointer; + typedef typename __rebind_pointer<__node_pointer, const value_type>::type pointer; + typedef typename __rebind_pointer<__node_pointer, __node>::type __non_const_node_pointer; typedef __hash_iterator<__non_const_node_pointer> __non_const_iterator; _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT @@ -376,13 +353,7 @@ public: typedef typename __pointer_traits::element_type::value_type value_type; typedef typename __pointer_traits::difference_type difference_type; typedef value_type& reference; - typedef typename __pointer_traits::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - pointer; + typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer; _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT { @@ -514,13 +485,9 @@ class _LIBCPP_TYPE_VIS_ONLY __hash_const typedef pointer_traits<__node_pointer> __pointer_traits; typedef typename __pointer_traits::element_type __node; typedef typename remove_const<__node>::type __non_const_node; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__non_const_node> -#else - rebind<__non_const_node>::other -#endif - __non_const_node_pointer; + typedef typename __rebind_pointer<__node_pointer, __non_const_node>::type + __non_const_node_pointer; + typedef __hash_local_iterator<__non_const_node_pointer> __non_const_iterator; public: @@ -530,13 +497,9 @@ public: >::type value_type; typedef typename __pointer_traits::difference_type difference_type; typedef const value_type& reference; - typedef typename __pointer_traits::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - pointer; + typedef typename __rebind_pointer<__node_pointer, const value_type>::type + pointer; + _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT { @@ -780,13 +743,8 @@ public: typedef typename __node_traits::pointer __node_pointer; typedef typename __node_traits::pointer __node_const_pointer; typedef __hash_node_base<__node_pointer> __first_node; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__first_node> -#else - rebind<__first_node>::other -#endif - __node_base_pointer; + typedef typename __rebind_pointer<__node_pointer, __first_node>::type + __node_base_pointer; private: Modified: vendor/libc++/dist/include/__tree ============================================================================== --- vendor/libc++/dist/include/__tree Wed Jan 6 20:03:57 2016 (r293254) +++ vendor/libc++/dist/include/__tree Wed Jan 6 20:05:20 2016 (r293255) @@ -548,31 +548,15 @@ template class __tree_node_base : public __tree_end_node < - typename pointer_traits<_VoidPtr>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__tree_node_base<_VoidPtr> > -#else - rebind<__tree_node_base<_VoidPtr> >::other -#endif + typename __rebind_pointer<_VoidPtr, __tree_node_base<_VoidPtr> >::type > { __tree_node_base(const __tree_node_base&); __tree_node_base& operator=(const __tree_node_base&); public: - typedef typename pointer_traits<_VoidPtr>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__tree_node_base> -#else - rebind<__tree_node_base>::other -#endif - pointer; - typedef typename pointer_traits<_VoidPtr>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - const_pointer; + typedef typename __rebind_pointer<_VoidPtr, __tree_node_base>::type pointer; + typedef typename __rebind_pointer<_VoidPtr, const __tree_node_base>::type const_pointer; + typedef __tree_end_node base; pointer __right_; @@ -623,13 +607,7 @@ public: typedef _Tp value_type; typedef _DiffType difference_type; typedef value_type& reference; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - pointer; + typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer; _LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT #if _LIBCPP_STD_VER > 11 @@ -694,13 +672,7 @@ public: typedef _Tp value_type; typedef _DiffType difference_type; typedef const value_type& reference; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - pointer; + typedef typename __rebind_pointer<__node_pointer, const value_type>::type pointer; _LIBCPP_INLINE_VISIBILITY __tree_const_iterator() _NOEXCEPT #if _LIBCPP_STD_VER > 11 @@ -710,13 +682,8 @@ public: private: typedef typename remove_const<__node>::type __non_const_node; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__non_const_node> -#else - rebind<__non_const_node>::other -#endif - __non_const_node_pointer; + typedef typename __rebind_pointer<__node_pointer, __non_const_node>::type + __non_const_node_pointer; typedef __tree_iterator __non_const_iterator; public: @@ -730,14 +697,8 @@ public: _LIBCPP_INLINE_VISIBILITY __tree_const_iterator& operator++() { - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - __node_base_pointer; - + typedef typename __rebind_pointer<__node_pointer, typename __node::base>::type + __node_base_pointer; __ptr_ = static_cast<__node_pointer>( __tree_next(static_cast<__node_base_pointer>(__ptr_))); return *this; @@ -749,14 +710,8 @@ public: _LIBCPP_INLINE_VISIBILITY __tree_const_iterator& operator--() { - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - __node_base_pointer; - + typedef typename __rebind_pointer<__node_pointer, typename __node::base>::type + __node_base_pointer; __ptr_ = static_cast<__node_pointer>( __tree_prev(static_cast<__node_base_pointer>(__ptr_))); return *this; @@ -810,20 +765,9 @@ public: typedef typename __node_base::pointer __node_base_const_pointer; private: typedef typename __node_base::base __end_node_t; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__end_node_t> -#else - rebind<__end_node_t>::other -#endif - __end_node_ptr; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__end_node_t> -#else - rebind<__end_node_t>::other -#endif - __end_node_const_ptr; + typedef typename __rebind_pointer<__node_pointer, __end_node_t>::type + __end_node_ptr; + typedef __end_node_ptr __end_node_const_ptr; __node_pointer __begin_node_; __compressed_pair<__end_node_t, __node_allocator> __pair1_; @@ -965,6 +909,13 @@ public: iterator __insert_multi(const value_type& __v); iterator __insert_multi(const_iterator __p, const value_type& __v); +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + pair __insert_unique( value_type&& __v); + iterator __insert_unique(const_iterator __p, value_type&& __v); + iterator __insert_multi( value_type&& __v); + iterator __insert_multi(const_iterator __p, value_type&& __v); +#endif + pair __node_insert_unique(__node_pointer __nd); iterator __node_insert_unique(const_iterator __p, __node_pointer __nd); @@ -1786,6 +1737,28 @@ __tree<_Tp, _Compare, _Allocator>::__emp #endif // _LIBCPP_HAS_NO_VARIADICS template +pair::iterator, bool> +__tree<_Tp, _Compare, _Allocator>::__insert_unique(value_type&& __v) +{ + __node_holder __h = __construct_node(_VSTD::forward(__v)); + pair __r = __node_insert_unique(__h.get()); + if (__r.second) + __h.release(); + return __r; +} + +template +typename __tree<_Tp, _Compare, _Allocator>::iterator +__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, value_type&& __v) +{ + __node_holder __h = __construct_node(_VSTD::forward(__v)); + iterator __r = __node_insert_unique(__p, __h.get()); + if (__r.__ptr_ == __h.get()) + __h.release(); + return __r; +} + +template template pair::iterator, bool> __tree<_Tp, _Compare, _Allocator>::__insert_unique(_Vp&& __v) @@ -1810,6 +1783,28 @@ __tree<_Tp, _Compare, _Allocator>::__ins } template +typename __tree<_Tp, _Compare, _Allocator>::iterator +__tree<_Tp, _Compare, _Allocator>::__insert_multi(value_type&& __v) +{ + __node_base_pointer __parent; + __node_base_pointer& __child = __find_leaf_high(__parent, __v); + __node_holder __h = __construct_node(_VSTD::forward(__v)); + __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); + return iterator(__h.release()); +} + +template +typename __tree<_Tp, _Compare, _Allocator>::iterator +__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, value_type&& __v) +{ + __node_base_pointer __parent; + __node_base_pointer& __child = __find_leaf(__p, __parent, __v); + __node_holder __h = __construct_node(_VSTD::forward(__v)); + __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); + return iterator(__h.release()); +} + +template template typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__insert_multi(_Vp&& __v) Modified: vendor/libc++/dist/include/ext/hash_map ============================================================================== --- vendor/libc++/dist/include/ext/hash_map Wed Jan 6 20:03:57 2016 (r293254) +++ vendor/libc++/dist/include/ext/hash_map Wed Jan 6 20:05:20 2016 (r293255) @@ -368,7 +368,6 @@ class _LIBCPP_TYPE_VIS_ONLY __hash_map_i { _HashIterator __i_; - typedef pointer_traits __pointer_traits; typedef const typename _HashIterator::value_type::first_type key_type; typedef typename _HashIterator::value_type::second_type mapped_type; public: @@ -376,13 +375,8 @@ public: typedef pair value_type; typedef typename _HashIterator::difference_type difference_type; typedef value_type& reference; - typedef typename __pointer_traits::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - pointer; + typedef typename __rebind_pointer::type + pointer; _LIBCPP_INLINE_VISIBILITY __hash_map_iterator() {} @@ -419,7 +413,6 @@ class _LIBCPP_TYPE_VIS_ONLY __hash_map_c { _HashIterator __i_; - typedef pointer_traits __pointer_traits; typedef const typename _HashIterator::value_type::first_type key_type; typedef typename _HashIterator::value_type::second_type mapped_type; public: @@ -427,13 +420,8 @@ public: typedef pair value_type; typedef typename _HashIterator::difference_type difference_type; typedef const value_type& reference; - typedef typename __pointer_traits::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - pointer; + typedef typename __rebind_pointer::type + pointer; _LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {} Modified: vendor/libc++/dist/include/forward_list ============================================================================== --- vendor/libc++/dist/include/forward_list Wed Jan 6 20:03:57 2016 (r293254) +++ vendor/libc++/dist/include/forward_list Wed Jan 6 20:05:20 2016 (r293255) @@ -197,15 +197,9 @@ struct __forward_begin_node template struct _LIBCPP_HIDDEN __begin_node_of { - typedef __forward_begin_node - < - typename pointer_traits<_VoidPtr>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__forward_list_node<_Tp, _VoidPtr> > -#else - rebind<__forward_list_node<_Tp, _VoidPtr> >::other -#endif - > type; + typedef __forward_begin_node< + typename __rebind_pointer<_VoidPtr, __forward_list_node<_Tp, _VoidPtr> >::type + > type; }; template @@ -240,13 +234,7 @@ public: typedef value_type& reference; typedef typename pointer_traits<__node_pointer>::difference_type difference_type; - typedef typename pointer_traits<__node_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - pointer; + typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer; _LIBCPP_INLINE_VISIBILITY __forward_list_iterator() _NOEXCEPT : __ptr_(nullptr) {} @@ -295,13 +283,7 @@ class _LIBCPP_TYPE_VIS_ONLY __forward_li < typename pointer_traits<__node_const_pointer>::element_type >::type __node; - typedef typename pointer_traits<__node_const_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind<__node> -#else - rebind<__node>::other -#endif - __node_pointer; + typedef typename __rebind_pointer<__node_const_pointer, __node>::type __node_pointer; template friend class forward_list; @@ -311,13 +293,7 @@ public: typedef const value_type& reference; typedef typename pointer_traits<__node_const_pointer>::difference_type difference_type; - typedef typename pointer_traits<__node_const_pointer>::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind -#else - rebind::other -#endif - pointer; + typedef typename __rebind_pointer<__node_const_pointer, const value_type>::type pointer; _LIBCPP_INLINE_VISIBILITY __forward_list_const_iterator() _NOEXCEPT : __ptr_(nullptr) {} Modified: vendor/libc++/dist/include/list ============================================================================== --- vendor/libc++/dist/include/list Wed Jan 6 20:03:57 2016 (r293254) +++ vendor/libc++/dist/include/list Wed Jan 6 20:05:20 2016 (r293255) @@ -175,6 +175,7 @@ template #include #include #include +#include #include <__undef_min_max> @@ -187,25 +188,66 @@ template _LIBCPP_BEGIN_NAMESPACE_STD template struct __list_node; +template struct __list_node_base; + +template +struct __list_node_pointer_traits { + typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type + __node_pointer; + typedef typename __rebind_pointer<_VoidPtr, __list_node_base<_Tp, _VoidPtr> >::type + __base_pointer; + +#if defined(_LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB) + typedef __base_pointer __link_pointer; +#else + typedef typename conditional< + is_pointer<_VoidPtr>::value, + __base_pointer, + __node_pointer + >::type __link_pointer; +#endif + + typedef typename conditional< + is_same<__link_pointer, __node_pointer>::value, + __base_pointer, + __node_pointer + >::type __non_link_pointer; + + static _LIBCPP_INLINE_VISIBILITY + __link_pointer __unsafe_link_pointer_cast(__link_pointer __p) { + return __p; + } + + static _LIBCPP_INLINE_VISIBILITY + __link_pointer __unsafe_link_pointer_cast(__non_link_pointer __p) { + return static_cast<__link_pointer>(static_cast<_VoidPtr>(__p)); + } + +}; template struct __list_node_base { - typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type - pointer; - typedef typename __rebind_pointer<_VoidPtr, __list_node_base>::type - __base_pointer; + typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits; + typedef typename _NodeTraits::__node_pointer __node_pointer; + typedef typename _NodeTraits::__base_pointer __base_pointer; + typedef typename _NodeTraits::__link_pointer __link_pointer; - pointer __prev_; - pointer __next_; + __link_pointer __prev_; + __link_pointer __next_; _LIBCPP_INLINE_VISIBILITY - __list_node_base() : __prev_(__self()), __next_(__self()) {} + __list_node_base() : __prev_(_NodeTraits::__unsafe_link_pointer_cast(__self())), + __next_(_NodeTraits::__unsafe_link_pointer_cast(__self())) {} _LIBCPP_INLINE_VISIBILITY - pointer __self() - { - return static_cast(pointer_traits<__base_pointer>::pointer_to(*this)); + __base_pointer __self() { + return pointer_traits<__base_pointer>::pointer_to(*this); + } + + _LIBCPP_INLINE_VISIBILITY + __node_pointer __as_node() { + return static_cast<__node_pointer>(__self()); } }; @@ -214,6 +256,14 @@ struct __list_node : public __list_node_base<_Tp, _VoidPtr> { _Tp __value_; + + typedef __list_node_base<_Tp, _VoidPtr> __base; + typedef typename __base::__link_pointer __link_pointer; + + _LIBCPP_INLINE_VISIBILITY + __link_pointer __as_link() { + return static_cast<__link_pointer>(__base::__self()); + } }; template > class _LIBCPP_TYPE_VIS_ONLY list; @@ -223,21 +273,21 @@ template cla template class _LIBCPP_TYPE_VIS_ONLY __list_iterator { - typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type - __node_pointer; + typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits; + typedef typename _NodeTraits::__link_pointer __link_pointer; - __node_pointer __ptr_; + __link_pointer __ptr_; #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_INLINE_VISIBILITY - explicit __list_iterator(__node_pointer __p, const void* __c) _NOEXCEPT + explicit __list_iterator(__link_pointer __p, const void* __c) _NOEXCEPT : __ptr_(__p) { __get_db()->__insert_ic(this, __c); } #else _LIBCPP_INLINE_VISIBILITY - explicit __list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {} + explicit __list_iterator(__link_pointer __p) _NOEXCEPT : __ptr_(__p) {} #endif @@ -295,7 +345,7 @@ public: _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), "Attempted to dereference a non-dereferenceable list::iterator"); #endif - return __ptr_->__value_; + return __ptr_->__as_node()->__value_; } _LIBCPP_INLINE_VISIBILITY pointer operator->() const @@ -304,7 +354,7 @@ public: _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), "Attempted to dereference a non-dereferenceable list::iterator"); #endif - return pointer_traits::pointer_to(__ptr_->__value_); + return pointer_traits::pointer_to(__ptr_->__as_node()->__value_); } _LIBCPP_INLINE_VISIBILITY @@ -346,21 +396,21 @@ public: template class _LIBCPP_TYPE_VIS_ONLY __list_const_iterator { - typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type - __node_pointer; + typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits; + typedef typename _NodeTraits::__link_pointer __link_pointer; - __node_pointer __ptr_; + __link_pointer __ptr_; #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_INLINE_VISIBILITY - explicit __list_const_iterator(__node_pointer __p, const void* __c) _NOEXCEPT + explicit __list_const_iterator(__link_pointer __p, const void* __c) _NOEXCEPT : __ptr_(__p) { __get_db()->__insert_ic(this, __c); } #else _LIBCPP_INLINE_VISIBILITY - explicit __list_const_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {} + explicit __list_const_iterator(__link_pointer __p) _NOEXCEPT : __ptr_(__p) {} #endif template friend class list; @@ -422,7 +472,7 @@ public: _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), "Attempted to dereference a non-dereferenceable list::const_iterator"); #endif - return __ptr_->__value_; + return __ptr_->__as_node()->__value_; } _LIBCPP_INLINE_VISIBILITY pointer operator->() const @@ -431,7 +481,7 @@ public: _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), "Attempted to dereference a non-dereferenceable list::iterator"); #endif - return pointer_traits::pointer_to(__ptr_->__value_); + return pointer_traits::pointer_to(__ptr_->__as_node()->__value_); } _LIBCPP_INLINE_VISIBILITY @@ -489,6 +539,9 @@ protected: typedef allocator_traits<__node_allocator> __node_alloc_traits; typedef typename __node_alloc_traits::pointer __node_pointer; typedef typename __node_alloc_traits::pointer __node_const_pointer; + typedef __list_node_pointer_traits __node_pointer_traits; + typedef typename __node_pointer_traits::__link_pointer __link_pointer; + typedef __link_pointer __link_const_pointer; typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::const_pointer const_pointer; typedef typename __alloc_traits::difference_type difference_type; @@ -500,6 +553,12 @@ protected: __compressed_pair __size_alloc_; _LIBCPP_INLINE_VISIBILITY + __link_pointer __end_as_link() const _NOEXCEPT { + return __node_pointer_traits::__unsafe_link_pointer_cast( + const_cast<__node_base&>(__end_).__self()); + } + + _LIBCPP_INLINE_VISIBILITY size_type& __sz() _NOEXCEPT {return __size_alloc_.first();} _LIBCPP_INLINE_VISIBILITY const size_type& __sz() const _NOEXCEPT @@ -511,7 +570,7 @@ protected: const __node_allocator& __node_alloc() const _NOEXCEPT {return __size_alloc_.second();} - static void __unlink_nodes(__node_pointer __f, __node_pointer __l) _NOEXCEPT; + static void __unlink_nodes(__link_pointer __f, __link_pointer __l) _NOEXCEPT; __list_imp() _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value); @@ -543,22 +602,18 @@ protected: iterator end() _NOEXCEPT { #if _LIBCPP_DEBUG_LEVEL >= 2 - return iterator(static_cast<__node_pointer>( - pointer_traits<__node_base_pointer>::pointer_to(__end_)), this); + return iterator(__end_as_link(), this); #else - return iterator(static_cast<__node_pointer>( - pointer_traits<__node_base_pointer>::pointer_to(__end_))); + return iterator(__end_as_link()); #endif } _LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT { #if _LIBCPP_DEBUG_LEVEL >= 2 - return const_iterator(static_cast<__node_const_pointer>( - pointer_traits<__node_base_pointer>::pointer_to(const_cast<__node_base&>(__end_))), this); + return const_iterator(__end_as_link(), this); #else - return const_iterator(static_cast<__node_const_pointer>( - pointer_traits<__node_base_pointer>::pointer_to(const_cast<__node_base&>(__end_)))); + return const_iterator(__end_as_link()); #endif } @@ -613,7 +668,7 @@ private: template inline _LIBCPP_INLINE_VISIBILITY void -__list_imp<_Tp, _Alloc>::__unlink_nodes(__node_pointer __f, __node_pointer __l) +__list_imp<_Tp, _Alloc>::__unlink_nodes(__link_pointer __f, __link_pointer __l) _NOEXCEPT { __f->__prev_->__next_ = __l->__next_; @@ -651,17 +706,16 @@ __list_imp<_Tp, _Alloc>::clear() _NOEXCE if (!empty()) { __node_allocator& __na = __node_alloc(); - __node_pointer __f = __end_.__next_; - __node_pointer __l = static_cast<__node_pointer>( - pointer_traits<__node_base_pointer>::pointer_to(__end_)); + __link_pointer __f = __end_.__next_; + __link_pointer __l = __end_as_link(); __unlink_nodes(__f, __l->__prev_); __sz() = 0; while (__f != __l) { - __node_pointer __n = __f; + __node_pointer __np = __f->__as_node(); __f = __f->__next_; - __node_alloc_traits::destroy(__na, _VSTD::addressof(__n->__value_)); - __node_alloc_traits::deallocate(__na, __n, 1); + __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_)); + __node_alloc_traits::deallocate(__na, __np, 1); } #if _LIBCPP_DEBUG_LEVEL >= 2 __c_node* __c = __get_db()->__find_c_and_lock(this); @@ -700,13 +754,13 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp swap(__sz(), __c.__sz()); swap(__end_, __c.__end_); if (__sz() == 0) - __end_.__next_ = __end_.__prev_ = __end_.__self(); + __end_.__next_ = __end_.__prev_ = __end_as_link(); else - __end_.__prev_->__next_ = __end_.__next_->__prev_ = __end_.__self(); + __end_.__prev_->__next_ = __end_.__next_->__prev_ = __end_as_link(); if (__c.__sz() == 0) - __c.__end_.__next_ = __c.__end_.__prev_ = __c.__end_.__self(); + __c.__end_.__next_ = __c.__end_.__prev_ = __c.__end_as_link(); else - __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_.__self(); + __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link(); #if _LIBCPP_DEBUG_LEVEL >= 2 __libcpp_db* __db = __get_db(); @@ -719,8 +773,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp { --__p; const_iterator* __i = static_cast((*__p)->__i_); - if (__i->__ptr_ == static_cast<__node_pointer>( - pointer_traits<__node_base_pointer>::pointer_to(__c.__end_))) + if (__i->__ptr_ == __c.__end_as_link()) { __cn2->__add(*__p); if (--__cn1->end_ != __p) @@ -733,8 +786,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp { --__p; const_iterator* __i = static_cast((*__p)->__i_); - if (__i->__ptr_ == static_cast<__node_pointer>( - pointer_traits<__node_base_pointer>::pointer_to(__end_))) + if (__i->__ptr_ == __end_as_link()) { __cn1->__add(*__p); if (--__cn2->end_ != __p) @@ -758,6 +810,7 @@ class _LIBCPP_TYPE_VIS_ONLY list typedef typename base::__node_alloc_traits __node_alloc_traits; typedef typename base::__node_base __node_base; typedef typename base::__node_base_pointer __node_base_pointer; + typedef typename base::__link_pointer __link_pointer; public: typedef _Tp value_type; @@ -881,25 +934,25 @@ public: reference front() { _LIBCPP_ASSERT(!empty(), "list::front called on empty list"); - return base::__end_.__next_->__value_; + return base::__end_.__next_->__as_node()->__value_; } _LIBCPP_INLINE_VISIBILITY const_reference front() const { _LIBCPP_ASSERT(!empty(), "list::front called on empty list"); - return base::__end_.__next_->__value_; + return base::__end_.__next_->__as_node()->__value_; } _LIBCPP_INLINE_VISIBILITY reference back() { _LIBCPP_ASSERT(!empty(), "list::back called on empty list"); - return base::__end_.__prev_->__value_; + return base::__end_.__prev_->__as_node()->__value_; } _LIBCPP_INLINE_VISIBILITY const_reference back() const { _LIBCPP_ASSERT(!empty(), "list::back called on empty list"); - return base::__end_.__prev_->__value_; + return base::__end_.__prev_->__as_node()->__value_; } #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -1004,9 +1057,9 @@ public: #endif // _LIBCPP_DEBUG_LEVEL >= 2 private: - static void __link_nodes (__node_pointer __p, __node_pointer __f, __node_pointer __l); - void __link_nodes_at_front(__node_pointer __f, __node_pointer __l); - void __link_nodes_at_back (__node_pointer __f, __node_pointer __l); + static void __link_nodes (__link_pointer __p, __link_pointer __f, __link_pointer __l); + void __link_nodes_at_front(__link_pointer __f, __link_pointer __l); + void __link_nodes_at_back (__link_pointer __f, __link_pointer __l); iterator __iterator(size_type __n); template static iterator __sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp); @@ -1020,7 +1073,7 @@ private: template inline _LIBCPP_INLINE_VISIBILITY void -list<_Tp, _Alloc>::__link_nodes(__node_pointer __p, __node_pointer __f, __node_pointer __l) +list<_Tp, _Alloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l) { __p->__prev_->__next_ = __f; __f->__prev_ = __p->__prev_; @@ -1032,9 +1085,9 @@ list<_Tp, _Alloc>::__link_nodes(__node_p template inline _LIBCPP_INLINE_VISIBILITY void -list<_Tp, _Alloc>::__link_nodes_at_front(__node_pointer __f, __node_pointer __l) +list<_Tp, _Alloc>::__link_nodes_at_front(__link_pointer __f, __link_pointer __l) { - __f->__prev_ = base::__end_.__self(); + __f->__prev_ = base::__end_as_link(); __l->__next_ = base::__end_.__next_; __l->__next_->__prev_ = __l; base::__end_.__next_ = __f; @@ -1044,9 +1097,9 @@ list<_Tp, _Alloc>::__link_nodes_at_front template inline _LIBCPP_INLINE_VISIBILITY void -list<_Tp, _Alloc>::__link_nodes_at_back(__node_pointer __f, __node_pointer __l) +list<_Tp, _Alloc>::__link_nodes_at_back(__link_pointer __f, __link_pointer __l) { - __l->__next_ = base::__end_.__self(); + __l->__next_ = base::__end_as_link(); __f->__prev_ = base::__end_.__prev_; __f->__prev_->__next_ = __f; base::__end_.__prev_ = __l; @@ -1323,12 +1376,12 @@ list<_Tp, _Alloc>::insert(const_iterator unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __hold->__prev_ = 0; __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - __link_nodes(__p.__ptr_, __hold.get(), __hold.get()); + __link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link()); ++base::__sz(); #if _LIBCPP_DEBUG_LEVEL >= 2 - return iterator(__hold.release(), this); + return iterator(__hold.release()->__as_link(), this); #else - return iterator(__hold.release()); + return iterator(__hold.release()->__as_link()); #endif } @@ -1354,9 +1407,9 @@ list<_Tp, _Alloc>::insert(const_iterator __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); ++__ds; #if _LIBCPP_DEBUG_LEVEL >= 2 - __r = iterator(__hold.get(), this); + __r = iterator(__hold->__as_link(), this); #else - __r = iterator(__hold.get()); + __r = iterator(__hold->__as_link()); #endif __hold.release(); iterator __e = __r; @@ -1368,7 +1421,7 @@ list<_Tp, _Alloc>::insert(const_iterator { __hold.reset(__node_alloc_traits::allocate(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - __e.__ptr_->__next_ = __hold.get(); + __e.__ptr_->__next_ = __hold->__as_link(); __hold->__prev_ = __e.__ptr_; __hold.release(); } @@ -1379,8 +1432,8 @@ list<_Tp, _Alloc>::insert(const_iterator while (true) { __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e)); - __node_pointer __prev = __e.__ptr_->__prev_; - __node_alloc_traits::deallocate(__na, __e.__ptr_, 1); + __link_pointer __prev = __e.__ptr_->__prev_; + __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1); if (__prev == 0) break; #if _LIBCPP_DEBUG_LEVEL >= 2 @@ -1422,9 +1475,9 @@ list<_Tp, _Alloc>::insert(const_iterator __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f); ++__ds; #if _LIBCPP_DEBUG_LEVEL >= 2 - __r = iterator(__hold.get(), this); + __r = iterator(__hold.get()->__as_link(), this); #else - __r = iterator(__hold.get()); + __r = iterator(__hold.get()->__as_link()); #endif __hold.release(); iterator __e = __r; @@ -1436,7 +1489,7 @@ list<_Tp, _Alloc>::insert(const_iterator { __hold.reset(__node_alloc_traits::allocate(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f); - __e.__ptr_->__next_ = __hold.get(); + __e.__ptr_->__next_ = __hold.get()->__as_link(); __hold->__prev_ = __e.__ptr_; __hold.release(); } @@ -1447,8 +1500,8 @@ list<_Tp, _Alloc>::insert(const_iterator while (true) { __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e)); - __node_pointer __prev = __e.__ptr_->__prev_; - __node_alloc_traits::deallocate(__na, __e.__ptr_, 1); + __link_pointer __prev = __e.__ptr_->__prev_; + __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1); if (__prev == 0) break; #if _LIBCPP_DEBUG_LEVEL >= 2 @@ -1474,7 +1527,8 @@ list<_Tp, _Alloc>::push_front(const valu typedef __allocator_destructor<__node_allocator> _Dp; unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - __link_nodes_at_front(__hold.get(), __hold.get()); + __link_pointer __nl = __hold->__as_link(); + __link_nodes_at_front(__nl, __nl); ++base::__sz(); __hold.release(); } @@ -1487,7 +1541,7 @@ list<_Tp, _Alloc>::push_back(const value typedef __allocator_destructor<__node_allocator> _Dp; unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x); - __link_nodes_at_back(__hold.get(), __hold.get()); + __link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link()); ++base::__sz(); __hold.release(); } @@ -1502,7 +1556,7 @@ list<_Tp, _Alloc>::push_front(value_type typedef __allocator_destructor<__node_allocator> _Dp; unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); - __link_nodes_at_front(__hold.get(), __hold.get()); + __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link()); ++base::__sz(); __hold.release(); } @@ -1515,7 +1569,7 @@ list<_Tp, _Alloc>::push_back(value_type& typedef __allocator_destructor<__node_allocator> _Dp; unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x)); - __link_nodes_at_back(__hold.get(), __hold.get()); + __link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link()); ++base::__sz(); __hold.release(); } @@ -1531,7 +1585,7 @@ list<_Tp, _Alloc>::emplace_front(_Args&& typedef __allocator_destructor<__node_allocator> _Dp; unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); - __link_nodes_at_front(__hold.get(), __hold.get()); + __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link()); ++base::__sz(); __hold.release(); } @@ -1545,7 +1599,8 @@ list<_Tp, _Alloc>::emplace_back(_Args&&. typedef __allocator_destructor<__node_allocator> _Dp; unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1)); __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); - __link_nodes_at_back(__hold.get(), __hold.get()); + __link_pointer __nl = __hold->__as_link(); + __link_nodes_at_back(__nl, __nl); ++base::__sz(); __hold.release(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 6 20:06:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10578A65C1D; Wed, 6 Jan 2016 20:06:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B97D6181F; Wed, 6 Jan 2016 20:06:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K6EaV084626; Wed, 6 Jan 2016 20:06:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K6Ebp084624; Wed, 6 Jan 2016 20:06:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601062006.u06K6Ebp084624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 Jan 2016 20:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293256 - vendor/libc++/r256945 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:06:16 -0000 Author: dim Date: Wed Jan 6 20:06:14 2016 New Revision: 293256 URL: https://svnweb.freebsd.org/changeset/base/293256 Log: Tag libc++ trunk r256945. Added: vendor/libc++/r256945/ - copied from r293255, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Wed Jan 6 20:06:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12E9DA65C22; Wed, 6 Jan 2016 20:06:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF2651820; Wed, 6 Jan 2016 20:06:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K6F9M084670; Wed, 6 Jan 2016 20:06:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K6F2k084669; Wed, 6 Jan 2016 20:06:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601062006.u06K6F2k084669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 20:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293257 - stable/10/tests/sys/mac/bsdextended X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:06:17 -0000 Author: ngie Date: Wed Jan 6 20:06:15 2016 New Revision: 293257 URL: https://svnweb.freebsd.org/changeset/base/293257 Log: MFC r292650,r292651: r292650: Move mac_bsdextended check up before running the test_libugidfw_strings testcases I realize that these tests could be run before mac_bsdextended is loaded, but it would overcomplicate things to special case handle the testcases before doing the mac_bsdextended(4) feature check The testcases will be split up so they can be run separately in the near future r292651: Delete the comment about running `test_libugidfw_strings` before testing `mac_is_present` so it doesn't accidentally confuse people Modified: stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/mac/bsdextended/ugidfw_test.c ============================================================================== --- stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Wed Jan 6 20:06:14 2016 (r293256) +++ stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Wed Jan 6 20:06:15 2016 (r293257) @@ -208,16 +208,6 @@ main(void) return (0); } - printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + - 3 * nitems(test_strings) + 2); - - /* - * We can test some parts of the library without the MAC Framework - * and policy loaded, so run those tests before calling - * mac_is_present(). - */ - test_libugidfw_strings(); - switch (mac_is_present("bsdextended")) { case -1: printf("1..0 # SKIP mac_is_present failed: %s\n", @@ -231,6 +221,11 @@ main(void) return (0); } + printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + + 3 * nitems(test_strings) + 2); + + test_libugidfw_strings(); + /* * Some simple up-front checks to see if we're able to query the * policy for basic state. We want the rule count to be 0 before From owner-svn-src-all@freebsd.org Wed Jan 6 20:07:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC9A3A65CBF; Wed, 6 Jan 2016 20:07:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D7AF1AFA; Wed, 6 Jan 2016 20:07:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K7Feh084761; Wed, 6 Jan 2016 20:07:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K7EWq084741; Wed, 6 Jan 2016 20:07:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601062007.u06K7EWq084741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 Jan 2016 20:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r293258 - in vendor/lld/dist: ELF lib/ReaderWriter/MachO test/ELF test/mach-o X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:07:17 -0000 Author: dim Date: Wed Jan 6 20:07:13 2016 New Revision: 293258 URL: https://svnweb.freebsd.org/changeset/base/293258 Log: Vendor import of lld trunk r256945: https://llvm.org/svn/llvm-project/lld/trunk@256945 Added: vendor/lld/dist/test/ELF/dt_tags.s (contents, props changed) vendor/lld/dist/test/mach-o/arm64-section-order.yaml Modified: vendor/lld/dist/ELF/Config.h vendor/lld/dist/ELF/Driver.cpp vendor/lld/dist/ELF/Driver.h vendor/lld/dist/ELF/InputFiles.cpp vendor/lld/dist/ELF/InputFiles.h vendor/lld/dist/ELF/InputSection.h vendor/lld/dist/ELF/MarkLive.cpp vendor/lld/dist/ELF/OutputSections.cpp vendor/lld/dist/ELF/SymbolTable.cpp vendor/lld/dist/ELF/SymbolTable.h vendor/lld/dist/ELF/Symbols.cpp vendor/lld/dist/ELF/Symbols.h vendor/lld/dist/ELF/Target.cpp vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp vendor/lld/dist/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp vendor/lld/dist/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp vendor/lld/dist/test/ELF/dynamic-reloc.s vendor/lld/dist/test/ELF/got.s vendor/lld/dist/test/ELF/local-got.s vendor/lld/dist/test/ELF/relocation-i686.s vendor/lld/dist/test/ELF/relocation.s vendor/lld/dist/test/ELF/relro.s vendor/lld/dist/test/ELF/shared-be.s vendor/lld/dist/test/ELF/shared.s vendor/lld/dist/test/ELF/tls-got.s vendor/lld/dist/test/ELF/tls-opt-gdie.s vendor/lld/dist/test/ELF/tls-opt-gdiele-i686.s vendor/lld/dist/test/ELF/tls-opt-iele-i686-nopic.s vendor/lld/dist/test/mach-o/arm64-reloc-negDelta32-fixup.yaml vendor/lld/dist/test/mach-o/parse-data-relocs-x86_64.yaml Modified: vendor/lld/dist/ELF/Config.h ============================================================================== --- vendor/lld/dist/ELF/Config.h Wed Jan 6 20:06:15 2016 (r293257) +++ vendor/lld/dist/ELF/Config.h Wed Jan 6 20:07:13 2016 (r293258) @@ -30,6 +30,10 @@ enum ELFKind { ELF64BEKind }; +// This struct contains the global configuration for the linker. +// Most fields are direct mapping from the command line options +// and such fields have the same name as the corresponding options. +// Most fields are initialized by the driver. struct Configuration { SymbolBody *EntrySym = nullptr; SymbolBody *MipsGpDisp = nullptr; @@ -76,6 +80,7 @@ struct Configuration { unsigned Optimize = 0; }; +// The only instance of Configuration struct. extern Configuration *Config; } // namespace elf2 Modified: vendor/lld/dist/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist/ELF/Driver.cpp Wed Jan 6 20:06:15 2016 (r293257) +++ vendor/lld/dist/ELF/Driver.cpp Wed Jan 6 20:07:13 2016 (r293258) @@ -57,6 +57,24 @@ static std::pair pars error("Unknown emulation: " + S); } +// Returns slices of MB by parsing MB as an archive file. +// Each slice consists of a member file in the archive. +static std::vector getArchiveMembers(MemoryBufferRef MB) { + ErrorOr> FileOrErr = Archive::create(MB); + error(FileOrErr, "Failed to parse archive"); + std::unique_ptr File = std::move(*FileOrErr); + + std::vector V; + for (const ErrorOr &C : File->children()) { + error(C, "Could not get the child of the archive " + File->getFileName()); + ErrorOr MbOrErr = C->getMemoryBufferRef(); + error(MbOrErr, "Could not get the buffer for a child of the archive " + + File->getFileName()); + V.push_back(*MbOrErr); + } + return V; +} + // Opens and parses a file. Path has to be resolved already. // Newly created memory buffers are owned by this driver. void LinkerDriver::addFile(StringRef Path) { @@ -75,19 +93,17 @@ void LinkerDriver::addFile(StringRef Pat return; case file_magic::archive: if (WholeArchive) { - auto File = make_unique(MBRef); - for (MemoryBufferRef &MB : File->getMembers()) - Files.push_back(createELFFile(MB)); - OwningArchives.emplace_back(std::move(File)); + for (MemoryBufferRef MB : getArchiveMembers(MBRef)) + Files.push_back(createObjectFile(MB)); return; } Files.push_back(make_unique(MBRef)); return; case file_magic::elf_shared_object: - Files.push_back(createELFFile(MBRef)); + Files.push_back(createSharedFile(MBRef)); return; default: - Files.push_back(createELFFile(MBRef)); + Files.push_back(createObjectFile(MBRef)); } } Modified: vendor/lld/dist/ELF/Driver.h ============================================================================== --- vendor/lld/dist/ELF/Driver.h Wed Jan 6 20:06:15 2016 (r293257) +++ vendor/lld/dist/ELF/Driver.h Wed Jan 6 20:07:13 2016 (r293258) @@ -38,7 +38,6 @@ private: llvm::BumpPtrAllocator Alloc; bool WholeArchive = false; std::vector> Files; - std::vector> OwningArchives; std::vector> OwningMBs; }; Modified: vendor/lld/dist/ELF/InputFiles.cpp ============================================================================== --- vendor/lld/dist/ELF/InputFiles.cpp Wed Jan 6 20:06:15 2016 (r293257) +++ vendor/lld/dist/ELF/InputFiles.cpp Wed Jan 6 20:07:13 2016 (r293258) @@ -37,10 +37,9 @@ ELFFileBase::ELFFileBase(Kind K, M template ELFKind ELFFileBase::getELFKind() { - using llvm::support::little; - if (ELFT::Is64Bits) - return ELFT::TargetEndianness == little ? ELF64LEKind : ELF64BEKind; - return ELFT::TargetEndianness == little ? ELF32LEKind : ELF32BEKind; + if (ELFT::TargetEndianness == support::little) + return ELFT::Is64Bits ? ELF64LEKind : ELF32LEKind; + return ELFT::Is64Bits ? ELF64BEKind : ELF32BEKind; } template @@ -63,8 +62,7 @@ template uint32_t ELFFileBase::getSectionIndex(const Elf_Sym &Sym) const { uint32_t I = Sym.st_shndx; if (I == ELF::SHN_XINDEX) - return this->ELFObj.getExtendedSymbolTableIndex(&Sym, this->Symtab, - SymtabSHNDX); + return ELFObj.getExtendedSymbolTableIndex(&Sym, Symtab, SymtabSHNDX); if (I >= ELF::SHN_LORESERVE || I == ELF::SHN_ABS) return 0; return I; @@ -74,7 +72,7 @@ template void ELFFileBase StringTableOrErr = ELFObj.getStringTableForSymtab(*Symtab); - error(StringTableOrErr.getError()); + error(StringTableOrErr); StringTable = *StringTableOrErr; } @@ -108,9 +106,9 @@ ObjectFile::getLocalSymbol(uintX_t } template -void elf2::ObjectFile::parse(DenseSet &Comdats) { +void ObjectFile::parse(DenseSet &ComdatGroups) { // Read section and symbol tables. - initializeSections(Comdats); + initializeSections(ComdatGroups); initializeSymbols(); } @@ -139,7 +137,7 @@ ObjectFile::getShtGroupEntries(con const ELFFile &Obj = this->ELFObj; ErrorOr> EntriesOrErr = Obj.template getSectionContentsAsArray(&Sec); - error(EntriesOrErr.getError()); + error(EntriesOrErr); ArrayRef Entries = *EntriesOrErr; if (Entries.empty() || Entries[0] != GRP_COMDAT) error("Unsupported SHT_GROUP format"); @@ -174,7 +172,7 @@ static bool shouldMerge(const typename E } template -void elf2::ObjectFile::initializeSections(DenseSet &Comdats) { +void ObjectFile::initializeSections(DenseSet &ComdatGroups) { uint64_t Size = this->ELFObj.getNumSections(); Sections.resize(Size); unsigned I = -1; @@ -187,7 +185,7 @@ void elf2::ObjectFile::initializeS switch (Sec.sh_type) { case SHT_GROUP: Sections[I] = &InputSection::Discarded; - if (Comdats.insert(getShtGroupSignature(Sec)).second) + if (ComdatGroups.insert(getShtGroupSignature(Sec)).second) continue; for (GroupEntryType E : getShtGroupEntries(Sec)) { uint32_t SecIndex = E; @@ -235,7 +233,7 @@ void elf2::ObjectFile::initializeS } template InputSectionBase * -elf2::ObjectFile::createInputSection(const Elf_Shdr &Sec) { +ObjectFile::createInputSection(const Elf_Shdr &Sec) { ErrorOr NameOrErr = this->ELFObj.getSectionName(&Sec); error(NameOrErr); StringRef Name = *NameOrErr; @@ -250,29 +248,29 @@ elf2::ObjectFile::createInputSecti // A MIPS object file has a special section that contains register // usage info, which needs to be handled by the linker specially. if (Config->EMachine == EM_MIPS && Name == ".reginfo") { - MipsReginfo = new (this->Alloc) MipsReginfoInputSection(this, &Sec); + MipsReginfo = new (Alloc) MipsReginfoInputSection(this, &Sec); return MipsReginfo; } if (Name == ".eh_frame") - return new (this->EHAlloc.Allocate()) EHInputSection(this, &Sec); + return new (EHAlloc.Allocate()) EHInputSection(this, &Sec); if (shouldMerge(Sec)) - return new (this->MAlloc.Allocate()) MergeInputSection(this, &Sec); - return new (this->Alloc) InputSection(this, &Sec); + return new (MAlloc.Allocate()) MergeInputSection(this, &Sec); + return new (Alloc) InputSection(this, &Sec); } -template void elf2::ObjectFile::initializeSymbols() { +template void ObjectFile::initializeSymbols() { this->initStringTable(); Elf_Sym_Range Syms = this->getNonLocalSymbols(); uint32_t NumSymbols = std::distance(Syms.begin(), Syms.end()); - this->SymbolBodies.reserve(NumSymbols); + SymbolBodies.reserve(NumSymbols); for (const Elf_Sym &Sym : Syms) - this->SymbolBodies.push_back(createSymbolBody(this->StringTable, &Sym)); + SymbolBodies.push_back(createSymbolBody(this->StringTable, &Sym)); } template InputSectionBase * -elf2::ObjectFile::getSection(const Elf_Sym &Sym) const { +ObjectFile::getSection(const Elf_Sym &Sym) const { uint32_t Index = this->getSectionIndex(Sym); if (Index == 0) return nullptr; @@ -282,19 +280,19 @@ elf2::ObjectFile::getSection(const } template -SymbolBody *elf2::ObjectFile::createSymbolBody(StringRef StringTable, +SymbolBody *ObjectFile::createSymbolBody(StringRef StringTable, const Elf_Sym *Sym) { ErrorOr NameOrErr = Sym->getName(StringTable); - error(NameOrErr.getError()); + error(NameOrErr); StringRef Name = *NameOrErr; switch (Sym->st_shndx) { case SHN_UNDEF: - return new (this->Alloc) UndefinedElf(Name, *Sym); + return new (Alloc) UndefinedElf(Name, *Sym); case SHN_COMMON: - return new (this->Alloc) DefinedCommon( - Name, Sym->st_size, Sym->st_value, - Sym->getBinding() == llvm::ELF::STB_WEAK, Sym->getVisibility()); + return new (Alloc) DefinedCommon(Name, Sym->st_size, Sym->st_value, + Sym->getBinding() == llvm::ELF::STB_WEAK, + Sym->getVisibility()); } switch (Sym->getBinding()) { @@ -305,20 +303,16 @@ SymbolBody *elf2::ObjectFile::crea case STB_GNU_UNIQUE: { InputSectionBase *Sec = getSection(*Sym); if (Sec == &InputSection::Discarded) - return new (this->Alloc) UndefinedElf(Name, *Sym); - return new (this->Alloc) DefinedRegular(Name, *Sym, Sec); + return new (Alloc) UndefinedElf(Name, *Sym); + return new (Alloc) DefinedRegular(Name, *Sym, Sec); } } } -static std::unique_ptr openArchive(MemoryBufferRef MB) { - ErrorOr> ArchiveOrErr = Archive::create(MB); - error(ArchiveOrErr, "Failed to parse archive"); - return std::move(*ArchiveOrErr); -} - void ArchiveFile::parse() { - File = openArchive(MB); + ErrorOr> FileOrErr = Archive::create(MB); + error(FileOrErr, "Failed to parse archive"); + File = std::move(*FileOrErr); // Allocate a buffer for Lazy objects. size_t NumSyms = File->getNumberOfSymbols(); @@ -345,28 +339,9 @@ MemoryBufferRef ArchiveFile::getMember(c return *RefOrErr; } -std::vector ArchiveFile::getMembers() { - File = openArchive(MB); - - std::vector Result; - for (auto &ChildOrErr : File->children()) { - error(ChildOrErr, - "Could not get the child of the archive " + File->getFileName()); - const Archive::Child Child(*ChildOrErr); - ErrorOr MbOrErr = Child.getMemoryBufferRef(); - if (!MbOrErr) - error(MbOrErr, "Could not get the buffer for a child of the archive " + - File->getFileName()); - Result.push_back(MbOrErr.get()); - } - return Result; -} - template SharedFile::SharedFile(MemoryBufferRef M) - : ELFFileBase(Base::SharedKind, M) { - AsNeeded = Config->AsNeeded; -} + : ELFFileBase(Base::SharedKind, M), AsNeeded(Config->AsNeeded) {} template const typename ELFFile::Elf_Shdr * @@ -379,6 +354,8 @@ SharedFile::getSection(const Elf_S return *Ret; } +// Partially parse the shared object file so that we can call +// getSoName on this object. template void SharedFile::parseSoName() { typedef typename ELFFile::Elf_Dyn Elf_Dyn; typedef typename ELFFile::uintX_t uintX_t; @@ -405,7 +382,7 @@ template void SharedFileinitStringTable(); - this->SoName = this->getName(); + SoName = this->getName(); if (!DynamicSec) return; @@ -418,13 +395,14 @@ template void SharedFile= this->StringTable.size()) error("Invalid DT_SONAME entry"); - this->SoName = StringRef(this->StringTable.data() + Val); + SoName = StringRef(this->StringTable.data() + Val); return; } } } -template void SharedFile::parse() { +// Fully parse the shared object file. This must be called after parseSoName(). +template void SharedFile::parseRest() { Elf_Sym_Range Syms = this->getNonLocalSymbols(); uint32_t NumSymbols = std::distance(Syms.begin(), Syms.end()); SymbolBodies.reserve(NumSymbols); @@ -456,7 +434,7 @@ static std::unique_ptr create } template