From owner-svn-src-stable-7@FreeBSD.ORG Sun May 17 11:45:38 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DA1410656C3; Sun, 17 May 2009 11:45:38 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE5A98FC12; Sun, 17 May 2009 11:45:37 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4HBjbDX026988; Sun, 17 May 2009 11:45:37 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4HBjbQC026986; Sun, 17 May 2009 11:45:37 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200905171145.n4HBjbQC026986@svn.freebsd.org> From: Fabien Thomas Date: Sun, 17 May 2009 11:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192248 - stable/7/lib/libpmc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2009 11:45:39 -0000 Author: fabient Date: Sun May 17 11:45:37 2009 New Revision: 192248 URL: http://svn.freebsd.org/changeset/base/192248 Log: MFC 190395: Allow compile from c++ for libpmc Reviewed by: jkoshy (mentor) Modified: stable/7/lib/libpmc/ (props changed) stable/7/lib/libpmc/pmc.h stable/7/lib/libpmc/pmclog.h Modified: stable/7/lib/libpmc/pmc.h ============================================================================== --- stable/7/lib/libpmc/pmc.h Sun May 17 10:58:50 2009 (r192247) +++ stable/7/lib/libpmc/pmc.h Sun May 17 11:45:37 2009 (r192248) @@ -29,6 +29,7 @@ #ifndef _PMC_H_ #define _PMC_H_ +#include #include /* @@ -68,6 +69,7 @@ struct pmc_pmcinfo { * Prototypes */ +__BEGIN_DECLS int pmc_allocate(const char *_ctrspec, enum pmc_mode _mode, uint32_t _flags, int _cpu, pmc_id_t *_pmcid); int pmc_attach(pmc_id_t _pmcid, pid_t _pid); @@ -105,5 +107,6 @@ const char *pmc_name_of_state(enum pmc_s int pmc_event_names_of_class(enum pmc_class _cl, const char ***_eventnames, int *_nevents); +__END_DECLS #endif Modified: stable/7/lib/libpmc/pmclog.h ============================================================================== --- stable/7/lib/libpmc/pmclog.h Sun May 17 10:58:50 2009 (r192247) +++ stable/7/lib/libpmc/pmclog.h Sun May 17 11:45:37 2009 (r192248) @@ -29,6 +29,7 @@ #ifndef _PMCLOG_H_ #define _PMCLOG_H_ +#include #include enum pmclog_state { @@ -145,10 +146,12 @@ struct pmclog_ev { #define PMCLOG_FD_NONE (-1) +__BEGIN_DECLS void *pmclog_open(int _fd); int pmclog_feed(void *_cookie, char *_data, int _len); int pmclog_read(void *_cookie, struct pmclog_ev *_ev); void pmclog_close(void *_cookie); +__END_DECLS #endif From owner-svn-src-stable-7@FreeBSD.ORG Sun May 17 15:42:41 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D82A9106567D; Sun, 17 May 2009 15:42:41 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6C038FC1C; Sun, 17 May 2009 15:42:41 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4HFgfDh031721; Sun, 17 May 2009 15:42:41 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4HFgfqj031720; Sun, 17 May 2009 15:42:41 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200905171542.n4HFgfqj031720@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 17 May 2009 15:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192251 - stable/7/lib/libc/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2009 15:42:42 -0000 Author: bms Date: Sun May 17 15:42:41 2009 New Revision: 192251 URL: http://svn.freebsd.org/changeset/base/192251 Log: MFC rev 191654: Fix an obvious bug in getsourcefilter()'s use of struct __msfilterreq; the kernel will return in msfr_nsrcs the number of source filters in-mode for a given multicast group. However, the filters themselves were never copied out, as the libc function clobbers this field with zero, causing the kernel to assume the provided vector of struct sockaddr_storage has zero length. This bug would only affect users of SSM multicast, which is shimmed in 7.x. Picked up during mtest(8) refactoring. Modified: stable/7/lib/libc/net/sourcefilter.c Modified: stable/7/lib/libc/net/sourcefilter.c ============================================================================== --- stable/7/lib/libc/net/sourcefilter.c Sun May 17 12:30:25 2009 (r192250) +++ stable/7/lib/libc/net/sourcefilter.c Sun May 17 15:42:41 2009 (r192251) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2007 Bruce M. Simpson. - * All rights reserved + * Copyright (c) 2007-2009 Bruce Simpson. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,21 +10,18 @@ * 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. - * 4. Neither the name of Bruce M. Simpson nor the names of other - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY BRUCE M. SIMPSON AND AFFILIATES - * ``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 BRUCE M. SIMPSON OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include @@ -340,7 +337,7 @@ getsourcefilter(int s, uint32_t interfac { struct __msfilterreq msfr; sockunion_t *psu; - int err, level, optlen, optname; + int err, level, nsrcs, optlen, optname; if (interface == 0 || group == NULL || numsrc == NULL || fmode == NULL) { @@ -348,6 +345,7 @@ getsourcefilter(int s, uint32_t interfac return (-1); } + nsrcs = *numsrc; *numsrc = 0; *fmode = 0; @@ -385,7 +383,7 @@ getsourcefilter(int s, uint32_t interfac memset(&msfr, 0, optlen); msfr.msfr_ifindex = interface; msfr.msfr_fmode = 0; - msfr.msfr_nsrcs = *numsrc; + msfr.msfr_nsrcs = nsrcs; memcpy(&msfr.msfr_group, &psu->ss, psu->ss.ss_len); /* From owner-svn-src-stable-7@FreeBSD.ORG Sun May 17 16:16:05 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 645A5106564A; Sun, 17 May 2009 16:16:05 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 359768FC1E; Sun, 17 May 2009 16:16:05 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 4E7E9345B7D; Sun, 17 May 2009 11:58:36 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 17 May 2009 11:58:36 -0400 X-Sasl-enc: cXgUpJa6EpgwY1qlCsE42nS2hv7SozI1+kh3mmkJcmL7 1242575915 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id C8B3A2A7FE; Sun, 17 May 2009 11:58:34 -0400 (EDT) Message-ID: <4A103429.8040906@incunabulum.net> Date: Sun, 17 May 2009 16:58:33 +0100 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Alexander Motin References: <200905130255.n4D2tMQZ040010@svn.freebsd.org> <4A0CF9EA.6080403@FreeBSD.org> <4A0D7B50.4090602@FreeBSD.org> In-Reply-To: <4A0D7B50.4090602@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Simpson Subject: Re: svn commit: r192033 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2009 16:16:05 -0000 Alexander Motin wrote: > Bruce Simpson wrote: >> Could this commit have broken boot on my amd64 system with an ULi >> SATA controller? > > This commit could change driver used for controller and so expose some > other bug in ALI driver. As I can see, there is present > vendor-specific driver for this chip, but without pciconf output I > can't say if AHCI driver is also able to attach it. ... isab0@pci0:0:30:0: class=0x060100 card=0x81561043 chip=0x157310b9 rev=0x31 hdr=0x00 vendor = 'Acer Labs Incorporated (ALi/ULi)' device = 'ALI M1573 South Bridge with Hypertransport Support' class = bridge subclass = PCI-ISA none0@pci0:0:30:1: class=0x068000 card=0x81561043 chip=0x710110b9 rev=0x00 hdr=0x00 vendor = 'Acer Labs Incorporated (ALi/ULi)' device = 'ALI M7101 Power Management Controller' class = bridge atapci0@pci0:0:31:0: class=0x01018a card=0x81561043 chip=0x522910b9 rev=0xc7 hdr=0x00 vendor = 'Acer Labs Incorporated (ALi/ULi)' device = 'M5229 Southbridge EIDE Controller' class = mass storage subclass = ATA atapci1@pci0:0:31:1: class=0x010400 card=0x81561043 chip=0x528710b9 rev=0x02 hdr=0x00 vendor = 'Acer Labs Incorporated (ALi/ULi)' device = '52871849 ALI SATA controller' class = mass storage subclass = RAID ... FreeBSD boots from ad4. anglepoise:~ % devinfo nexus0 apic0 ram0 acpi0 cpu0 acpi_throttle0 cpufreq0 pcib0 pci0 hostb0 pcib1 pci1 vgapci0 vgapci1 pcib2 pci2 mskc0 msk0 miibus0 e1000phy0 pcib3 pci3 hostb1 hostb2 hostb3 hostb4 pcib4 pci4 ohci0 usb0 uhub0 ohci1 usb1 uhub1 uhub4 ums0 ohci2 usb2 uhub2 ehci0 usb3 uhub3 hdac0 pcm0 pcm1 pcm2 isab0 isa0 sc0 vga0 orm0 atapci0 ata0 ad0 subdisk0 ata1 acd0 atapci1 ata2 ad4 subdisk4 ata3 ata4 ata5 atpic0 atdma0 attimer0 attimer1 fpupnp0 fdc0 fd0 ppc0 ppbus0 acpi_sysresource0 atkbdc0 atkbd0 acpi_sysresource1 sio0 acpi_sysresource2 acpi_sysresource3 acpi_sysresource4 acpi_button0 pci_link0 pci_link1 pci_link2 pci_link3 pci_link4 pci_link5 pci_link6 pci_link7 pci_link8 acpi_timer0 > >> I have not fully bisected (and to be honest, who really has time to >> do this for production machines, unless >> >> The panic I get with RELENG_7 sources as of yesterday after this >> commit is 'resource list busy'. If you need any more information let >> me know, I have transcribed the backtrace and posted it to stable@. > > Which revision was working for you before this? If, as you have said, > reverting rev 192033 does not helped, then there should be something > different. May be not in ATA, as there was very few merges into > 7-STABLE ATA last months. anglepoise:~ % uname -a FreeBSD anglepoise.lon.incunabulum.net 7.2-PRERELEASE FreeBSD 7.2-PRERELEASE #1: Tue Apr 21 07:41:58 BST 2009 root@anglepoise.lon.incunabulum.net:/home/obj/usr/src/sys/ANGLEPOISE amd64 anglepoise:~ % ident /boot/kernel/kernel | grep ata $FreeBSD: src/sys/cam/cam_queue.c,v 1.9 2005/07/01 15:21:29 avatar Exp $ $FreeBSD: src/sys/dev/ata/ata-all.c,v 1.280.2.8 2009/03/03 08:14:43 mav Exp $ $FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.202.2.19 2009/03/25 14:26:38 mav Exp $ $FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.204.2.3 2008/04/08 10:48:21 phk Exp $ $FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.147.2.2 2008/01/09 08:54:47 delphij Exp $ $FreeBSD: src/sys/dev/ata/ata-isa.c,v 1.31 2007/02/21 19:07:18 sos Exp $ $FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.79.2.1 2008/01/09 08:54:48 delphij Exp $ $FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.121.2.2 2007/11/21 21:15:00 sos Exp $ $FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.69.2.1 2009/03/03 08:14:43 mav Exp $ $FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.124.2.1 2009/03/01 16:50:46 scottl Exp $ $FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.193.2.3 2009/03/17 19:38:40 marcel Exp $ $FreeBSD: src/sys/dev/puc/pucdata.c,v 1.59.2.6 2009/03/19 15:35:33 jhb Exp $ Let me know if you need any more info... cheers BMS From owner-svn-src-stable-7@FreeBSD.ORG Sun May 17 22:57:43 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4768106564A; Sun, 17 May 2009 22:57:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 3C64A8FC13; Sun, 17 May 2009 22:57:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 243024068; Mon, 18 May 2009 01:57:41 +0300 Message-ID: <4A109662.9060909@FreeBSD.org> Date: Mon, 18 May 2009 01:57:38 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.21 (X11/20090405) MIME-Version: 1.0 To: Bruce Simpson References: <200905130255.n4D2tMQZ040010@svn.freebsd.org> <4A0CF9EA.6080403@FreeBSD.org> <4A0D7B50.4090602@FreeBSD.org> <4A103429.8040906@incunabulum.net> In-Reply-To: <4A103429.8040906@incunabulum.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Simpson Subject: Re: svn commit: r192033 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2009 22:57:44 -0000 Bruce Simpson wrote: > Alexander Motin wrote: >> Bruce Simpson wrote: >>> Could this commit have broken boot on my amd64 system with an ULi >>> SATA controller? >> >> This commit could change driver used for controller and so expose some >> other bug in ALI driver. As I can see, there is present >> vendor-specific driver for this chip, but without pciconf output I >> can't say if AHCI driver is also able to attach it. > > atapci1@pci0:0:31:1: class=0x010400 card=0x81561043 chip=0x528710b9 > rev=0x02 hdr=0x00 > vendor = 'Acer Labs Incorporated (ALi/ULi)' > device = '52871849 ALI SATA controller' > class = mass storage > subclass = RAID This change is not anyhow related to your system. Looks like the real reason found by jhb@ on stable@. Probably something become more strict in system resource management last time and this driver violates now. -- Alexander Motin From owner-svn-src-stable-7@FreeBSD.ORG Sun May 17 23:52:07 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B15F01065674; Sun, 17 May 2009 23:52:07 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 7CE988FC18; Sun, 17 May 2009 23:52:06 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 662CF341650; Sun, 17 May 2009 19:52:06 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 17 May 2009 19:52:06 -0400 X-Sasl-enc: 1i+avM4zBhLc/x9wJQjkB28pFCXAQek//0Z/WLgxkQbg 1242604326 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 569EA22952; Sun, 17 May 2009 19:52:05 -0400 (EDT) Message-ID: <4A10A324.5040501@incunabulum.net> Date: Mon, 18 May 2009 00:52:04 +0100 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Alexander Motin References: <200905130255.n4D2tMQZ040010@svn.freebsd.org> <4A0CF9EA.6080403@FreeBSD.org> <4A0D7B50.4090602@FreeBSD.org> <4A103429.8040906@incunabulum.net> <4A109662.9060909@FreeBSD.org> In-Reply-To: <4A109662.9060909@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Simpson Subject: Re: svn commit: r192033 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2009 23:52:08 -0000 Alexander Motin wrote: > ... > This change is not anyhow related to your system. Looks like the real > reason found by jhb@ on stable@. Probably something become more strict > in system resource management last time and this driver violates now. > Thanks... I reckon John is probably on the money with this but have not looked closely. Hopefully the fix is backportable... I will try to find time to test HEAD, I need to do some HEAD testing on this box anyway, using a USB key is possible for this with NanoBSD now :-) cheers, BMS From owner-svn-src-stable-7@FreeBSD.ORG Mon May 18 07:24:07 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 093CB1065677; Mon, 18 May 2009 07:24:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2BD08FC1F; Mon, 18 May 2009 07:24:06 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4I7O6ka053642; Mon, 18 May 2009 07:24:06 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4I7O6MO053640; Mon, 18 May 2009 07:24:06 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200905180724.n4I7O6MO053640@svn.freebsd.org> From: Alan Cox Date: Mon, 18 May 2009 07:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192300 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern vm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2009 07:24:07 -0000 Author: alc Date: Mon May 18 07:24:06 2009 New Revision: 192300 URL: http://svn.freebsd.org/changeset/base/192300 Log: MFC r180308 Enable the creation of a kmem map larger than 4GB. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_malloc.c stable/7/sys/vm/vm_kern.h Modified: stable/7/sys/kern/kern_malloc.c ============================================================================== --- stable/7/sys/kern/kern_malloc.c Mon May 18 07:13:42 2009 (r192299) +++ stable/7/sys/kern/kern_malloc.c Mon May 18 07:24:06 2009 (r192300) @@ -181,19 +181,19 @@ struct { */ static uma_zone_t mt_zone; -u_int vm_kmem_size; -SYSCTL_UINT(_vm, OID_AUTO, kmem_size, CTLFLAG_RD, &vm_kmem_size, 0, +u_long vm_kmem_size; +SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RD, &vm_kmem_size, 0, "Size of kernel memory"); -u_int vm_kmem_size_min; -SYSCTL_UINT(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RD, &vm_kmem_size_min, 0, +static u_long vm_kmem_size_min; +SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RD, &vm_kmem_size_min, 0, "Minimum size of kernel memory"); -u_int vm_kmem_size_max; -SYSCTL_UINT(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RD, &vm_kmem_size_max, 0, +static u_long vm_kmem_size_max; +SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RD, &vm_kmem_size_max, 0, "Maximum size of kernel memory"); -u_int vm_kmem_size_scale; +static u_int vm_kmem_size_scale; SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RD, &vm_kmem_size_scale, 0, "Scale factor for kernel memory size"); @@ -589,7 +589,7 @@ kmeminit(void *dummy) #if defined(VM_KMEM_SIZE_MIN) vm_kmem_size_min = VM_KMEM_SIZE_MIN; #endif - TUNABLE_INT_FETCH("vm.kmem_size_min", &vm_kmem_size_min); + TUNABLE_ULONG_FETCH("vm.kmem_size_min", &vm_kmem_size_min); if (vm_kmem_size_min > 0 && vm_kmem_size < vm_kmem_size_min) { vm_kmem_size = vm_kmem_size_min; } @@ -597,16 +597,16 @@ kmeminit(void *dummy) #if defined(VM_KMEM_SIZE_MAX) vm_kmem_size_max = VM_KMEM_SIZE_MAX; #endif - TUNABLE_INT_FETCH("vm.kmem_size_max", &vm_kmem_size_max); + TUNABLE_ULONG_FETCH("vm.kmem_size_max", &vm_kmem_size_max); if (vm_kmem_size_max > 0 && vm_kmem_size >= vm_kmem_size_max) vm_kmem_size = vm_kmem_size_max; /* Allow final override from the kernel environment */ #ifndef BURN_BRIDGES - if (TUNABLE_INT_FETCH("kern.vm.kmem.size", &vm_kmem_size) != 0) + if (TUNABLE_ULONG_FETCH("kern.vm.kmem.size", &vm_kmem_size) != 0) printf("kern.vm.kmem.size is now called vm.kmem_size!\n"); #endif - TUNABLE_INT_FETCH("vm.kmem_size", &vm_kmem_size); + TUNABLE_ULONG_FETCH("vm.kmem_size", &vm_kmem_size); /* * Limit kmem virtual size to twice the physical memory. Modified: stable/7/sys/vm/vm_kern.h ============================================================================== --- stable/7/sys/vm/vm_kern.h Mon May 18 07:13:42 2009 (r192299) +++ stable/7/sys/vm/vm_kern.h Mon May 18 07:24:06 2009 (r192300) @@ -69,6 +69,6 @@ extern vm_map_t kernel_map; extern vm_map_t kmem_map; extern vm_map_t exec_map; extern vm_map_t pipe_map; -extern u_int vm_kmem_size; +extern u_long vm_kmem_size; #endif /* _VM_VM_KERN_H_ */ From owner-svn-src-stable-7@FreeBSD.ORG Mon May 18 08:42:00 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B404106564A; Mon, 18 May 2009 08:42:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47EE78FC13; Mon, 18 May 2009 08:42:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4I8g0Ql055225; Mon, 18 May 2009 08:42:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4I8g0hF055224; Mon, 18 May 2009 08:42:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200905180842.n4I8g0hF055224@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 18 May 2009 08:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192301 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/devfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2009 08:42:01 -0000 Author: kib Date: Mon May 18 08:41:59 2009 New Revision: 192301 URL: http://svn.freebsd.org/changeset/base/192301 Log: MFC r192151: Initialize f_vnode before calling d_fdopen() cdevsw method. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/devfs/devfs_vnops.c Modified: stable/7/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/7/sys/fs/devfs/devfs_vnops.c Mon May 18 07:24:06 2009 (r192300) +++ stable/7/sys/fs/devfs/devfs_vnops.c Mon May 18 08:41:59 2009 (r192301) @@ -890,6 +890,7 @@ devfs_open(struct vop_open_args *ap) if (fp != NULL) { FILE_LOCK(fp); fp->f_data = dev; + fp->f_vnode = vp; FILE_UNLOCK(fp); } fpop = td->td_fpop; From owner-svn-src-stable-7@FreeBSD.ORG Mon May 18 17:14:23 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF86F106564A; Mon, 18 May 2009 17:14:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D97C88FC1D; Mon, 18 May 2009 17:14:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4IHENR2068430; Mon, 18 May 2009 17:14:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4IHEN1o068422; Mon, 18 May 2009 17:14:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905181714.n4IHEN1o068422@svn.freebsd.org> From: John Baldwin Date: Mon, 18 May 2009 17:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192311 - in stable/7/sys: . amd64/amd64 arm/arm contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 ia64/ia64 kern powerpc/powerpc sparc64/sparc64 sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2009 17:14:25 -0000 Author: jhb Date: Mon May 18 17:14:23 2009 New Revision: 192311 URL: http://svn.freebsd.org/changeset/base/192311 Log: MFC: Simplify the interrupt code a bit by always including the ie_disable and ie_eoi methods and collapsing down to a single intr_event_create() routine. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/intr_machdep.c stable/7/sys/arm/arm/intr.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/i386/intr_machdep.c stable/7/sys/ia64/ia64/interrupt.c stable/7/sys/kern/kern_intr.c stable/7/sys/powerpc/powerpc/intr_machdep.c stable/7/sys/sparc64/sparc64/intr_machdep.c stable/7/sys/sys/interrupt.h Modified: stable/7/sys/amd64/amd64/intr_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/intr_machdep.c Mon May 18 17:10:26 2009 (r192310) +++ stable/7/sys/amd64/amd64/intr_machdep.c Mon May 18 17:14:23 2009 (r192311) @@ -77,12 +77,6 @@ static struct sx intr_table_lock; static struct mtx intrcnt_lock; static STAILQ_HEAD(, pic) pics; -#ifdef INTR_FILTER -static void intr_eoi_src(void *arg); -static void intr_disab_eoi_src(void *arg); -static void intr_event_stray(void *cookie); -#endif - #ifdef SMP static int assign_cpu; @@ -90,6 +84,10 @@ static void intr_assign_next_cpu(struct #endif static int intr_assign_cpu(void *arg, u_char cpu); +static void intr_disable_src(void *arg); +#ifdef INTR_FILTER +static void intr_event_stray(void *cookie); +#endif static void intr_init(void *__dummy); static int intr_pic_registered(struct pic *pic); static void intrcnt_setname(const char *name, int index); @@ -144,16 +142,10 @@ intr_register_source(struct intsrc *isrc vector = isrc->is_pic->pic_vector(isrc); if (interrupt_sources[vector] != NULL) return (EEXIST); -#ifdef INTR_FILTER - error = intr_event_create(&isrc->is_event, isrc, 0, - (mask_fn)isrc->is_pic->pic_enable_source, - intr_eoi_src, intr_disab_eoi_src, intr_assign_cpu, "irq%d:", - vector); -#else error = intr_event_create(&isrc->is_event, isrc, 0, - (mask_fn)isrc->is_pic->pic_enable_source, intr_assign_cpu, "irq%d:", + intr_disable_src, (mask_fn)isrc->is_pic->pic_enable_source, + (mask_fn)isrc->is_pic->pic_eoi_source, intr_assign_cpu, "irq%d:", vector); -#endif if (error) return (error); sx_xlock(&intr_table_lock); @@ -237,6 +229,15 @@ intr_config_intr(int vector, enum intr_t return (isrc->is_pic->pic_config_intr(isrc, trig, pol)); } +static void +intr_disable_src(void *arg) +{ + struct intsrc *isrc; + + isrc = arg; + isrc->is_pic->pic_disable_source(isrc, PIC_EOI); +} + #ifdef INTR_FILTER void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) @@ -289,24 +290,6 @@ intr_event_stray(void *cookie) "too many stray irq %d's: not logging anymore\n", isrc->is_pic->pic_vector(isrc)); } - -static void -intr_eoi_src(void *arg) -{ - struct intsrc *isrc; - - isrc = arg; - isrc->is_pic->pic_eoi_source(isrc); -} - -static void -intr_disab_eoi_src(void *arg) -{ - struct intsrc *isrc; - - isrc = arg; - isrc->is_pic->pic_disable_source(isrc, PIC_EOI); -} #else void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) Modified: stable/7/sys/arm/arm/intr.c ============================================================================== --- stable/7/sys/arm/arm/intr.c Mon May 18 17:10:26 2009 (r192310) +++ stable/7/sys/arm/arm/intr.c Mon May 18 17:14:23 2009 (r192311) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include +typedef void (*mask_fn)(void *); + static struct intr_event *intr_events[NIRQ]; static int intrcnt_tab[NIRQ]; static int intrcnt_index = 0; @@ -57,27 +59,6 @@ static int last_printed = 0; void arm_handler_execute(struct trapframe *, int); -#ifdef INTR_FILTER -static void -intr_disab_eoi_src(void *arg) -{ - uintptr_t nb; - - nb = (uintptr_t)arg; - arm_mask_irq(nb); -} - -static void -intr_eoi_src(void *arg) -{ - uintptr_t nb; - - nb = (uintptr_t)arg; - arm_unmask_irq(nb); -} - -#endif - void arm_setup_irqhandler(const char *name, driver_filter_t *filt, void (*hand)(void*), void *arg, int irq, int flags, void **cookiep) @@ -89,14 +70,9 @@ arm_setup_irqhandler(const char *name, d return; event = intr_events[irq]; if (event == NULL) { -#ifdef INTR_FILTER - error = intr_event_create(&event, (void *)irq, 0, - (void (*)(void *))arm_unmask_irq, intr_eoi_src, - intr_disab_eoi_src, NULL, "intr%d:", irq); -#else error = intr_event_create(&event, (void *)irq, 0, - (void (*)(void *))arm_unmask_irq, NULL, "intr%d:", irq); -#endif + (mask_fn)arm_mask_irq, (mask_fn)arm_unmask_irq, + (mask_fn)arm_unmask_irq, NULL, "intr%d:", irq); if (error) return; intr_events[irq] = event; Modified: stable/7/sys/i386/i386/intr_machdep.c ============================================================================== --- stable/7/sys/i386/i386/intr_machdep.c Mon May 18 17:10:26 2009 (r192310) +++ stable/7/sys/i386/i386/intr_machdep.c Mon May 18 17:14:23 2009 (r192311) @@ -68,12 +68,6 @@ static struct sx intr_table_lock; static struct mtx intrcnt_lock; static STAILQ_HEAD(, pic) pics; -#ifdef INTR_FILTER -static void intr_eoi_src(void *arg); -static void intr_disab_eoi_src(void *arg); -static void intr_event_stray(void *cookie); -#endif - #ifdef SMP static int assign_cpu; @@ -81,6 +75,10 @@ static void intr_assign_next_cpu(struct #endif static int intr_assign_cpu(void *arg, u_char cpu); +static void intr_disable_src(void *arg); +#ifdef INTR_FILTER +static void intr_event_stray(void *cookie); +#endif static void intr_init(void *__dummy); static int intr_pic_registered(struct pic *pic); static void intrcnt_setname(const char *name, int index); @@ -135,16 +133,10 @@ intr_register_source(struct intsrc *isrc vector = isrc->is_pic->pic_vector(isrc); if (interrupt_sources[vector] != NULL) return (EEXIST); -#ifdef INTR_FILTER - error = intr_event_create(&isrc->is_event, isrc, 0, - (mask_fn)isrc->is_pic->pic_enable_source, - intr_eoi_src, intr_disab_eoi_src, intr_assign_cpu, "irq%d:", - vector); -#else error = intr_event_create(&isrc->is_event, isrc, 0, - (mask_fn)isrc->is_pic->pic_enable_source, intr_assign_cpu, "irq%d:", + intr_disable_src, (mask_fn)isrc->is_pic->pic_enable_source, + (mask_fn)isrc->is_pic->pic_eoi_source, intr_assign_cpu, "irq%d:", vector); -#endif if (error) return (error); sx_xlock(&intr_table_lock); @@ -228,6 +220,15 @@ intr_config_intr(int vector, enum intr_t return (isrc->is_pic->pic_config_intr(isrc, trig, pol)); } +static void +intr_disable_src(void *arg) +{ + struct intsrc *isrc; + + isrc = arg; + isrc->is_pic->pic_disable_source(isrc, PIC_EOI); +} + #ifdef INTR_FILTER void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) @@ -280,24 +281,6 @@ intr_event_stray(void *cookie) "too many stray irq %d's: not logging anymore\n", isrc->is_pic->pic_vector(isrc)); } - -static void -intr_eoi_src(void *arg) -{ - struct intsrc *isrc; - - isrc = arg; - isrc->is_pic->pic_eoi_source(isrc); -} - -static void -intr_disab_eoi_src(void *arg) -{ - struct intsrc *isrc; - - isrc = arg; - isrc->is_pic->pic_disable_source(isrc, PIC_EOI); -} #else void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) Modified: stable/7/sys/ia64/ia64/interrupt.c ============================================================================== --- stable/7/sys/ia64/ia64/interrupt.c Mon May 18 17:10:26 2009 (r192310) +++ stable/7/sys/ia64/ia64/interrupt.c Mon May 18 17:14:23 2009 (r192311) @@ -340,10 +340,7 @@ ia64_setup_intr(const char *name, int ir return (ENOMEM); error = intr_event_create(&i->event, (void *)(uintptr_t)vector, - 0, ia64_intr_unmask, -#ifdef INTR_FILTER - ia64_intr_eoi, ia64_intr_mask, -#endif + 0, ia64_intr_mask, ia64_intr_unmask, ia64_intr_eoi, NULL, "irq%u:", irq); if (error) { free(i, M_DEVBUF); Modified: stable/7/sys/kern/kern_intr.c ============================================================================== --- stable/7/sys/kern/kern_intr.c Mon May 18 17:10:26 2009 (r192310) +++ stable/7/sys/kern/kern_intr.c Mon May 18 17:14:23 2009 (r192311) @@ -238,43 +238,9 @@ intr_event_update(struct intr_event *ie) CTR2(KTR_INTR, "%s: updated %s", __func__, ie->ie_fullname); } -#ifndef INTR_FILTER -int -intr_event_create(struct intr_event **event, void *source, int flags, - void (*enable)(void *), int (*assign_cpu)(void *, u_char), const char *fmt, - ...) -{ - struct intr_event *ie; - va_list ap; - - /* The only valid flag during creation is IE_SOFT. */ - if ((flags & ~IE_SOFT) != 0) - return (EINVAL); - ie = malloc(sizeof(struct intr_event), M_ITHREAD, M_WAITOK | M_ZERO); - ie->ie_source = source; - ie->ie_enable = enable; - ie->ie_assign_cpu = assign_cpu; - ie->ie_flags = flags; - ie->ie_cpu = NOCPU; - TAILQ_INIT(&ie->ie_handlers); - mtx_init(&ie->ie_lock, "intr event", NULL, MTX_DEF); - - va_start(ap, fmt); - vsnprintf(ie->ie_name, sizeof(ie->ie_name), fmt, ap); - va_end(ap); - strlcpy(ie->ie_fullname, ie->ie_name, sizeof(ie->ie_fullname)); - mtx_pool_lock(mtxpool_sleep, &event_list); - TAILQ_INSERT_TAIL(&event_list, ie, ie_list); - mtx_pool_unlock(mtxpool_sleep, &event_list); - if (event != NULL) - *event = ie; - CTR2(KTR_INTR, "%s: created %s", __func__, ie->ie_name); - return (0); -} -#else int -intr_event_create(struct intr_event **event, void *source, int flags, - void (*enable)(void *), void (*eoi)(void *), void (*disab)(void *), +intr_event_create(struct intr_event **event, void *source,int flags, + void (*disable)(void *), void (*enable)(void *), void (*eoi)(void *), int (*assign_cpu)(void *, u_char), const char *fmt, ...) { struct intr_event *ie; @@ -285,10 +251,10 @@ intr_event_create(struct intr_event **ev return (EINVAL); ie = malloc(sizeof(struct intr_event), M_ITHREAD, M_WAITOK | M_ZERO); ie->ie_source = source; + ie->ie_disable = disable; ie->ie_enable = enable; - ie->ie_assign_cpu = assign_cpu; ie->ie_eoi = eoi; - ie->ie_disab = disab; + ie->ie_assign_cpu = assign_cpu; ie->ie_flags = flags; ie->ie_cpu = NOCPU; TAILQ_INIT(&ie->ie_handlers); @@ -306,7 +272,6 @@ intr_event_create(struct intr_event **ev CTR2(KTR_INTR, "%s: created %s", __func__, ie->ie_name); return (0); } -#endif /* * Bind an interrupt event to the specified CPU. Note that not all @@ -945,13 +910,8 @@ swi_add(struct intr_event **eventp, cons if (!(ie->ie_flags & IE_SOFT)) return (EINVAL); } else { -#ifdef INTR_FILTER error = intr_event_create(&ie, NULL, IE_SOFT, NULL, NULL, NULL, NULL, "swi%d:", pri); -#else - error = intr_event_create(&ie, NULL, IE_SOFT, - NULL, NULL, "swi%d:", pri); -#endif if (error) return (error); if (eventp != NULL) @@ -1408,8 +1368,8 @@ intr_event_handle(struct intr_event *ie, if (ie->ie_eoi != NULL) ie->ie_eoi(ie->ie_source); } else { - if (ie->ie_disab != NULL) - ie->ie_disab(ie->ie_source); + if (ie->ie_disable != NULL) + ie->ie_disable(ie->ie_source); } critical_exit(); Modified: stable/7/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- stable/7/sys/powerpc/powerpc/intr_machdep.c Mon May 18 17:10:26 2009 (r192310) +++ stable/7/sys/powerpc/powerpc/intr_machdep.c Mon May 18 17:14:23 2009 (r192311) @@ -105,7 +105,6 @@ intrcnt_setname(const char *name, int in MAXCOMLEN, name); } -#ifdef INTR_FILTER static void powerpc_intr_eoi(void *arg) { @@ -121,7 +120,6 @@ powerpc_intr_mask(void *arg) PIC_MASK(pic, irq); } -#endif static void powerpc_intr_unmask(void *arg) @@ -187,10 +185,7 @@ powerpc_setup_intr(const char *name, u_i return (ENOMEM); } error = intr_event_create(&i->event, (void *)irq, 0, - powerpc_intr_unmask, -#ifdef INTR_FILTER - powerpc_intr_eoi, powerpc_intr_mask, -#endif + powerpc_intr_mask, powerpc_intr_unmask, powerpc_intr_eoi, NULL, "irq%u:", irq); if (error) { /* XXX unlock */ Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Mon May 18 17:10:26 2009 (r192310) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Mon May 18 17:14:23 2009 (r192311) @@ -345,12 +345,8 @@ intr_controller_register(int vec, const sx_xunlock(&intr_table_lock); if (ie != NULL) return (EEXIST); - error = intr_event_create(&ie, iv, 0, ic->ic_clear, -#ifdef INTR_FILTER - ic->ic_clear, NULL, intr_assign_cpu, "vec%d:", vec); -#else - intr_assign_cpu, "vec%d:", vec); -#endif + error = intr_event_create(&ie, iv, 0, NULL, ic->ic_clear, + ic->ic_clear, intr_assign_cpu, "vec%d:", vec); if (error != 0) return (error); sx_xlock(&intr_table_lock); Modified: stable/7/sys/sys/interrupt.h ============================================================================== --- stable/7/sys/sys/interrupt.h Mon May 18 17:10:26 2009 (r192310) +++ stable/7/sys/sys/interrupt.h Mon May 18 17:14:23 2009 (r192311) @@ -72,12 +72,10 @@ struct intr_event { struct mtx ie_lock; void *ie_source; /* Cookie used by MD code. */ struct intr_thread *ie_thread; /* Thread we are connected to. */ + void (*ie_disable)(void *); void (*ie_enable)(void *); - int (*ie_assign_cpu)(void *, u_char); -#ifdef INTR_FILTER void (*ie_eoi)(void *); - void (*ie_disab)(void *); -#endif + int (*ie_assign_cpu)(void *, u_char); int ie_flags; int ie_count; /* Loop counter. */ int ie_warncnt; /* Rate-check interrupt storm warns. */ @@ -130,18 +128,11 @@ int intr_event_add_handler(struct intr_e driver_filter_t filter, driver_intr_t handler, void *arg, u_char pri, enum intr_type flags, void **cookiep); int intr_event_bind(struct intr_event *ie, u_char cpu); -#ifndef INTR_FILTER -int intr_event_create(struct intr_event **event, void *source, - int flags, void (*enable)(void *), - int (*assign_cpu)(void *, u_char), const char *fmt, ...) - __printflike(6, 7); -#else int intr_event_create(struct intr_event **event, void *source, - int flags, void (*enable)(void *), void (*eoi)(void *), - void (*disab)(void *), int (*assign_cpu)(void *, u_char), + int flags, void (*disable)(void *), void (*enable)(void *), + void (*eoi)(void *), int (*assign_cpu)(void *, u_char), const char *fmt, ...) __printflike(8, 9); -#endif int intr_event_destroy(struct intr_event *ie); int intr_event_remove_handler(void *cookie); #ifndef INTR_FILTER From owner-svn-src-stable-7@FreeBSD.ORG Mon May 18 17:39:12 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C42A010656D7; Mon, 18 May 2009 17:39:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B13208FC16; Mon, 18 May 2009 17:39:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4IHdCjQ069700; Mon, 18 May 2009 17:39:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4IHdCui069699; Mon, 18 May 2009 17:39:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905181739.n4IHdCui069699@svn.freebsd.org> From: John Baldwin Date: Mon, 18 May 2009 17:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192316 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2009 17:39:13 -0000 Author: jhb Date: Mon May 18 17:39:12 2009 New Revision: 192316 URL: http://svn.freebsd.org/changeset/base/192316 Log: MFC: Use __null for NULL for GNU C++ 4.x and use the same value for NULL in the kernel as in userland. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sys/_null.h Modified: stable/7/sys/sys/_null.h ============================================================================== --- stable/7/sys/sys/_null.h Mon May 18 17:37:27 2009 (r192315) +++ stable/7/sys/sys/_null.h Mon May 18 17:39:12 2009 (r192316) @@ -28,14 +28,18 @@ #ifndef NULL -#if defined(_KERNEL) || !defined(__cplusplus) +#if !defined(__cplusplus) #define NULL ((void *)0) #else +#if defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4 +#define NULL __null +#else #if defined(__LP64__) #define NULL (0L) #else #define NULL 0 #endif /* __LP64__ */ -#endif /* _KERNEL || !__cplusplus */ +#endif /* __GNUG__ */ +#endif /* !__cplusplus */ #endif From owner-svn-src-stable-7@FreeBSD.ORG Mon May 18 20:23:17 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F37F3106566B; Mon, 18 May 2009 20:23:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E081E8FC08; Mon, 18 May 2009 20:23:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4IKNGC7073805; Mon, 18 May 2009 20:23:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4IKNGZ2073804; Mon, 18 May 2009 20:23:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905182023.n4IKNGZ2073804@svn.freebsd.org> From: John Baldwin Date: Mon, 18 May 2009 20:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192336 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2009 20:23:17 -0000 Author: jhb Date: Mon May 18 20:23:16 2009 New Revision: 192336 URL: http://svn.freebsd.org/changeset/base/192336 Log: MFC: Convert IPFW_DEFAULT_TO_ACCEPT into a loader tunable. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/ip_fw2.c Modified: stable/7/sys/netinet/ip_fw2.c ============================================================================== --- stable/7/sys/netinet/ip_fw2.c Mon May 18 19:56:06 2009 (r192335) +++ stable/7/sys/netinet/ip_fw2.c Mon May 18 20:23:16 2009 (r192336) @@ -111,6 +111,11 @@ static int fw_verbose; static struct callout ipfw_timeout; static int verbose_limit; +#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT +static int default_to_accept = 1; +#else +static int default_to_accept; +#endif static uma_zone_t ipfw_dyn_rule_zone; /* @@ -170,6 +175,9 @@ SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, d NULL, IPFW_DEFAULT_RULE, "The default/max possible rule number."); SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, tables_max, CTLFLAG_RD, NULL, IPFW_TABLES_MAX, "The maximum number of tables."); +SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, default_to_accept, CTLFLAG_RDTUN, + &default_to_accept, 0, "Make the default rule accept all packets."); +TUNABLE_INT("net.inet.ip.fw.default_to_accept", &default_to_accept); #endif /* SYSCTL_NODE */ /* @@ -4514,11 +4522,7 @@ ipfw_init(void) default_rule.set = RESVD_SET; default_rule.cmd[0].len = 1; - default_rule.cmd[0].opcode = -#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT - 1 ? O_ACCEPT : -#endif - O_DENY; + default_rule.cmd[0].opcode = default_to_accept ? O_ACCEPT : O_DENY; error = add_rule(&layer3_chain, &default_rule); if (error != 0) { From owner-svn-src-stable-7@FreeBSD.ORG Mon May 18 21:44:33 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC0CF1065672; Mon, 18 May 2009 21:44:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9ABE8FC15; Mon, 18 May 2009 21:44:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4ILiXT3075593; Mon, 18 May 2009 21:44:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4ILiXeh075592; Mon, 18 May 2009 21:44:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905182144.n4ILiXeh075592@svn.freebsd.org> From: John Baldwin Date: Mon, 18 May 2009 21:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192340 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2009 21:44:34 -0000 Author: jhb Date: Mon May 18 21:44:33 2009 New Revision: 192340 URL: http://svn.freebsd.org/changeset/base/192340 Log: MFC: Remove dependency of vlan.ko on miibus.ko. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/net/if_vlan.c Modified: stable/7/sys/net/if_vlan.c ============================================================================== --- stable/7/sys/net/if_vlan.c Mon May 18 21:36:17 2009 (r192339) +++ stable/7/sys/net/if_vlan.c Mon May 18 21:44:33 2009 (r192340) @@ -567,7 +567,6 @@ static moduledata_t vlan_mod = { DECLARE_MODULE(if_vlan, vlan_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); MODULE_VERSION(if_vlan, 3); -MODULE_DEPEND(if_vlan, miibus, 1, 1, 1); static struct ifnet * vlan_clone_match_ethertag(struct if_clone *ifc, const char *name, int *tag) From owner-svn-src-stable-7@FreeBSD.ORG Mon May 18 22:45:10 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4548A106564A; Mon, 18 May 2009 22:45:10 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17E818FC14; Mon, 18 May 2009 22:45:10 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4IMj90p077355; Mon, 18 May 2009 22:45:09 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4IMj9WM077354; Mon, 18 May 2009 22:45:09 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200905182245.n4IMj9WM077354@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 18 May 2009 22:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192352 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/uart X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2009 22:45:10 -0000 Author: marcel Date: Mon May 18 22:45:09 2009 New Revision: 192352 URL: http://svn.freebsd.org/changeset/base/192352 Log: MFC r190834: Fix hangs caused by hardware that signals receive errors (framing, parity, etc), but does not indicate characters being received. Since no chracters have been received, ignore the line errors. PR: 131006 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/uart/uart_dev_ns8250.c Modified: stable/7/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/7/sys/dev/uart/uart_dev_ns8250.c Mon May 18 22:34:44 2009 (r192351) +++ stable/7/sys/dev/uart/uart_dev_ns8250.c Mon May 18 22:45:09 2009 (r192352) @@ -50,14 +50,16 @@ __FBSDID("$FreeBSD$"); static void ns8250_clrint(struct uart_bas *bas) { - uint8_t iir; + uint8_t iir, lsr; iir = uart_getreg(bas, REG_IIR); while ((iir & IIR_NOPEND) == 0) { iir &= IIR_IMASK; - if (iir == IIR_RLS) - (void)uart_getreg(bas, REG_LSR); - else if (iir == IIR_RXRDY || iir == IIR_RXTOUT) + if (iir == IIR_RLS) { + lsr = uart_getreg(bas, REG_LSR); + if (lsr & (LSR_BI|LSR_FE|LSR_PE)) + (void)uart_getreg(bas, REG_DATA); + } else if (iir == IIR_RXRDY || iir == IIR_RXTOUT) (void)uart_getreg(bas, REG_DATA); else if (iir == IIR_MLSC) (void)uart_getreg(bas, REG_MSR); @@ -563,7 +565,6 @@ ns8250_bus_ipend(struct uart_softc *sc) ipend = 0; if (iir & IIR_RXRDY) { lsr = uart_getreg(bas, REG_LSR); - uart_unlock(sc->sc_hwmtx); if (lsr & LSR_OE) ipend |= SER_INT_OVERRUN; if (lsr & LSR_BI) @@ -571,12 +572,14 @@ ns8250_bus_ipend(struct uart_softc *sc) if (lsr & LSR_RXRDY) ipend |= SER_INT_RXREADY; } else { - uart_unlock(sc->sc_hwmtx); if (iir & IIR_TXRDY) ipend |= SER_INT_TXIDLE; else ipend |= SER_INT_SIGCHG; } + if (ipend == 0) + ns8250_clrint(bas); + uart_unlock(sc->sc_hwmtx); return ((sc->sc_leaving) ? 0 : ipend); } From owner-svn-src-stable-7@FreeBSD.ORG Tue May 19 14:01:58 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 253C8106566C; Tue, 19 May 2009 14:01:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11FA78FC14; Tue, 19 May 2009 14:01:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4JE1vnC099603; Tue, 19 May 2009 14:01:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4JE1vtR099601; Tue, 19 May 2009 14:01:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905191401.n4JE1vtR099601@svn.freebsd.org> From: John Baldwin Date: Tue, 19 May 2009 14:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192378 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2009 14:01:58 -0000 Author: jhb Date: Tue May 19 14:01:57 2009 New Revision: 192378 URL: http://svn.freebsd.org/changeset/base/192378 Log: MFC: Add more PCI-express capability registers and display additional details about PCI-express devices. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/pci/pcireg.h stable/7/usr.sbin/pciconf/ (props changed) stable/7/usr.sbin/pciconf/cap.c Modified: stable/7/sys/dev/pci/pcireg.h ============================================================================== --- stable/7/sys/dev/pci/pcireg.h Tue May 19 12:42:01 2009 (r192377) +++ stable/7/sys/dev/pci/pcireg.h Tue May 19 14:01:57 2009 (r192378) @@ -594,8 +594,36 @@ #define PCIM_EXP_TYPE_UPSTREAM_PORT 0x0050 #define PCIM_EXP_TYPE_DOWNSTREAM_PORT 0x0060 #define PCIM_EXP_TYPE_PCI_BRIDGE 0x0070 +#define PCIM_EXP_TYPE_PCIE_BRIDGE 0x0080 +#define PCIM_EXP_TYPE_ROOT_INT_EP 0x0090 +#define PCIM_EXP_TYPE_ROOT_EC 0x00a0 #define PCIM_EXP_FLAGS_SLOT 0x0100 #define PCIM_EXP_FLAGS_IRQ 0x3e00 +#define PCIR_EXPRESS_DEVICE_CAP 0x4 +#define PCIM_EXP_CAP_MAX_PAYLOAD 0x0007 +#define PCIR_EXPRESS_DEVICE_CTL 0x8 +#define PCIM_EXP_CTL_MAX_PAYLOAD 0x00e0 +#define PCIM_EXP_CTL_MAX_READ_REQUEST 0x7000 +#define PCIR_EXPRESS_DEVICE_STA 0xa +#define PCIR_EXPRESS_LINK_CAP 0xc +#define PCIM_LINK_CAP_MAX_SPEED 0x0000000f +#define PCIM_LINK_CAP_MAX_WIDTH 0x000003f0 +#define PCIM_LINK_CAP_ASPM 0x00000c00 +#define PCIM_LINK_CAP_L0S_EXIT 0x00007000 +#define PCIM_LINK_CAP_L1_EXIT 0x00038000 +#define PCIM_LINK_CAP_PORT 0xff000000 +#define PCIR_EXPRESS_LINK_CTL 0x10 +#define PCIR_EXPRESS_LINK_STA 0x12 +#define PCIM_LINK_STA_SPEED 0x000f +#define PCIM_LINK_STA_WIDTH 0x03f0 +#define PCIM_LINK_STA_TRAINING_ERROR 0x0400 +#define PCIM_LINK_STA_TRAINING 0x0800 +#define PCIM_LINK_STA_SLOT_CLOCK 0x1000 +#define PCIR_EXPRESS_SLOT_CAP 0x14 +#define PCIR_EXPRESS_SLOT_CTL 0x18 +#define PCIR_EXPRESS_SLOT_STA 0x1a +#define PCIR_EXPRESS_ROOT_CTL 0x1c +#define PCIR_EXPRESS_ROOT_STA 0x20 /* MSI-X definitions */ #define PCIR_MSIX_CTRL 0x2 Modified: stable/7/usr.sbin/pciconf/cap.c ============================================================================== --- stable/7/usr.sbin/pciconf/cap.c Tue May 19 12:42:01 2009 (r192377) +++ stable/7/usr.sbin/pciconf/cap.c Tue May 19 14:01:57 2009 (r192378) @@ -151,7 +151,9 @@ cap_pcix(int fd, struct pci_conf *p, uin printf("64-bit "); if ((p->pc_hdr & PCIM_HDRTYPE) == 1) printf("bridge "); - printf("supports"); + if ((p->pc_hdr & PCIM_HDRTYPE) != 1 || (status & (PCIXM_STATUS_133CAP | + PCIXM_STATUS_266CAP | PCIXM_STATUS_533CAP)) != 0) + printf("supports"); comma = 0; if (status & PCIXM_STATUS_133CAP) { printf("%s 133MHz", comma ? "," : ""); @@ -357,9 +359,12 @@ cap_subvendor(int fd, struct pci_conf *p printf("PCI Bridge card=0x%08x", id); } +#define MAX_PAYLOAD(field) (128 << (field)) + static void cap_express(int fd, struct pci_conf *p, uint8_t ptr) { + uint32_t val; uint16_t flags; flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_FLAGS, 2); @@ -383,12 +388,30 @@ cap_express(int fd, struct pci_conf *p, case PCIM_EXP_TYPE_PCI_BRIDGE: printf("PCI bridge"); break; + case PCIM_EXP_TYPE_PCIE_BRIDGE: + printf("PCI to PCIe bridge"); + break; + case PCIM_EXP_TYPE_ROOT_INT_EP: + printf("root endpoint"); + break; + case PCIM_EXP_TYPE_ROOT_EC: + printf("event collector"); + break; default: - printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 8); + printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 4); break; } if (flags & PCIM_EXP_FLAGS_IRQ) - printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 17); + printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 8); + val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CTL, 2); + printf(" max data %d(%d)", + MAX_PAYLOAD((flags & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5), + MAX_PAYLOAD(val & PCIM_EXP_CAP_MAX_PAYLOAD)); + val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_LINK_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr+ PCIR_EXPRESS_LINK_STA, 2); + printf(" link x%d(x%d)", (flags & PCIM_LINK_STA_WIDTH) >> 4, + (val & PCIM_LINK_CAP_MAX_WIDTH) >> 4); } static void From owner-svn-src-stable-7@FreeBSD.ORG Tue May 19 15:33:41 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C13F01065670; Tue, 19 May 2009 15:33:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93DCD8FC0C; Tue, 19 May 2009 15:33:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4JFXf0B001937; Tue, 19 May 2009 15:33:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4JFXf2e001935; Tue, 19 May 2009 15:33:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905191533.n4JFXf2e001935@svn.freebsd.org> From: John Baldwin Date: Tue, 19 May 2009 15:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192386 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2009 15:33:42 -0000 Author: jhb Date: Tue May 19 15:33:41 2009 New Revision: 192386 URL: http://svn.freebsd.org/changeset/base/192386 Log: MFC: Add SATA and PCI Advanced Features capabilities reporting. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/pci/pcireg.h stable/7/usr.sbin/pciconf/ (props changed) stable/7/usr.sbin/pciconf/cap.c Modified: stable/7/sys/dev/pci/pcireg.h ============================================================================== --- stable/7/sys/dev/pci/pcireg.h Tue May 19 14:51:48 2009 (r192385) +++ stable/7/sys/dev/pci/pcireg.h Tue May 19 15:33:41 2009 (r192386) @@ -113,6 +113,8 @@ #define PCIY_SECDEV 0x0f /* Secure Device */ #define PCIY_EXPRESS 0x10 /* PCI Express */ #define PCIY_MSIX 0x11 /* MSI-X */ +#define PCIY_SATA 0x12 /* SATA */ +#define PCIY_PCIAF 0x13 /* PCI Advanced Features */ /* config registers for header type 0 devices */ @@ -640,3 +642,12 @@ #define PCIM_MSIX_BIR_BAR_20 4 #define PCIM_MSIX_BIR_BAR_24 5 #define PCIM_MSIX_VCTRL_MASK 0x1 + +/* PCI Advanced Features definitions */ +#define PCIR_PCIAF_CAP 0x3 +#define PCIM_PCIAFCAP_TP 0x01 +#define PCIM_PCIAFCAP_FLR 0x02 +#define PCIR_PCIAF_CTRL 0x4 +#define PCIR_PCIAFCTRL_FLR 0x01 +#define PCIR_PCIAF_STATUS 0x5 +#define PCIR_PCIAFSTATUS_TP 0x01 Modified: stable/7/usr.sbin/pciconf/cap.c ============================================================================== --- stable/7/usr.sbin/pciconf/cap.c Tue May 19 14:51:48 2009 (r192385) +++ stable/7/usr.sbin/pciconf/cap.c Tue May 19 15:33:41 2009 (r192386) @@ -437,6 +437,24 @@ cap_msix(int fd, struct pci_conf *p, uin printf(" enabled"); } +static void +cap_sata(int fd, struct pci_conf *p, uint8_t ptr) +{ + + printf("SATA Index-Data Pair"); +} + +static void +cap_pciaf(int fd, struct pci_conf *p, uint8_t ptr) +{ + uint8_t cap; + + cap = read_config(fd, &p->pc_sel, ptr + PCIR_PCIAF_CAP, 1); + printf("PCI Advanced Features:%s%s", + cap & PCIM_PCIAFCAP_FLR ? " FLR" : "", + cap & PCIM_PCIAFCAP_TP ? " TP" : ""); +} + void list_caps(int fd, struct pci_conf *p) { @@ -499,6 +517,12 @@ list_caps(int fd, struct pci_conf *p) case PCIY_MSIX: cap_msix(fd, p, ptr); break; + case PCIY_SATA: + cap_sata(fd, p, ptr); + break; + case PCIY_PCIAF: + cap_pciaf(fd, p, ptr); + break; default: printf("unknown"); break; From owner-svn-src-stable-7@FreeBSD.ORG Tue May 19 15:47:42 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99D4E106566C; Tue, 19 May 2009 15:47:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 872438FC18; Tue, 19 May 2009 15:47:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4JFlgqI002276; Tue, 19 May 2009 15:47:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4JFlgcT002274; Tue, 19 May 2009 15:47:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905191547.n4JFlgcT002274@svn.freebsd.org> From: John Baldwin Date: Tue, 19 May 2009 15:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192387 - in stable/7/sys: . contrib/pf dev/ata dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2009 15:47:43 -0000 Author: jhb Date: Tue May 19 15:47:42 2009 New Revision: 192387 URL: http://svn.freebsd.org/changeset/base/192387 Log: MFC: - Add a void pointer to the ata-pci controller softc to allow chipset-specific code to attach chipset-specific data. - Use chipset-specific data in the acard and promise chipsets rather than changing the ivars of ATA PCI devices. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ata/ata-chipset.c stable/7/sys/dev/ata/ata-pci.h stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/7/sys/dev/ata/ata-chipset.c Tue May 19 15:33:41 2009 (r192386) +++ stable/7/sys/dev/ata/ata-chipset.c Tue May 19 15:47:42 2009 (r192387) @@ -50,6 +50,12 @@ __FBSDID("$FreeBSD$"); #include #include +struct ata_serialize { + struct mtx locked_mtx; + int locked_ch; + int restart_ch; +}; + /* local prototypes */ /* ata-chipset.c */ static int ata_generic_chipinit(device_t dev); @@ -186,6 +192,7 @@ static struct ata_chip_id *ata_match_chi static struct ata_chip_id *ata_find_chip(device_t dev, struct ata_chip_id *index, int slot); static int ata_setup_interrupt(device_t dev); static int ata_serialize(device_t dev, int flags); +static void ata_serialize_init(struct ata_serialize *serial); static void ata_print_cable(device_t dev, u_int8_t *who); static int ata_atapi(device_t dev); static int ata_check_80pin(device_t dev, int mode); @@ -919,6 +926,7 @@ static int ata_acard_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_serialize *serial; if (ata_setup_interrupt(dev)) return ENXIO; @@ -927,6 +935,10 @@ ata_acard_chipinit(device_t dev) if (ctlr->chip->cfg1 == ATPOLD) { ctlr->setmode = ata_acard_850_setmode; ctlr->locking = ata_serialize; + serial = malloc(sizeof(struct ata_serialize), + M_TEMP, M_WAITOK | M_ZERO); + ata_serialize_init(serial); + ctlr->chipset_data = serial; } else ctlr->setmode = ata_acard_86X_setmode; @@ -3461,7 +3473,7 @@ ata_promise_chipinit(device_t dev) mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF); TAILQ_INIT(&hpkt->queue); hpkt->busy = 0; - device_set_ivars(dev, hpkt); + ctlr->chipset_data = hpkt; ctlr->allocate = ata_promise_mio_allocate; ctlr->reset = ata_promise_mio_reset; ctlr->dmainit = ata_promise_mio_dmainit; @@ -3908,7 +3920,7 @@ ata_promise_mio_reset(device_t dev) case PRSX4X: /* softreset channel ATA module */ - hpktp = device_get_ivars(ctlr->dev); + hpktp = ctlr->chipset_data; ATA_OUTL(ctlr->r_res2, 0xc0260 + (ch->unit << 7), ch->unit + 1); ata_udelay(1000); ATA_OUTL(ctlr->r_res2, 0xc0260 + (ch->unit << 7), @@ -4247,7 +4259,7 @@ ata_promise_apkt(u_int8_t *bytep, struct static void ata_promise_queue_hpkt(struct ata_pci_controller *ctlr, u_int32_t hpkt) { - struct ata_promise_sx4 *hpktp = device_get_ivars(ctlr->dev); + struct ata_promise_sx4 *hpktp = ctlr->chipset_data; mtx_lock(&hpktp->mtx); if (hpktp->busy) { @@ -4266,7 +4278,7 @@ ata_promise_queue_hpkt(struct ata_pci_co static void ata_promise_next_hpkt(struct ata_pci_controller *ctlr) { - struct ata_promise_sx4 *hpktp = device_get_ivars(ctlr->dev); + struct ata_promise_sx4 *hpktp = ctlr->chipset_data; struct host_packet *hp; mtx_lock(&hpktp->mtx); @@ -5841,11 +5853,14 @@ ata_setup_interrupt(device_t dev) return 0; } -struct ata_serialize { - struct mtx locked_mtx; - int locked_ch; - int restart_ch; -}; +static void +ata_serialize_init(struct ata_serialize *serial) +{ + + mtx_init(&serial->locked_mtx, "ATA serialize lock", NULL, MTX_DEF); + serial->locked_ch = -1; + serial->restart_ch = -1; +} static int ata_serialize(device_t dev, int flags) @@ -5853,20 +5868,9 @@ ata_serialize(device_t dev, int flags) struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); struct ata_serialize *serial; - static int inited = 0; int res; - if (!inited) { - serial = malloc(sizeof(struct ata_serialize), - M_TEMP, M_NOWAIT | M_ZERO); - mtx_init(&serial->locked_mtx, "ATA serialize lock", NULL, MTX_DEF); - serial->locked_ch = -1; - serial->restart_ch = -1; - device_set_ivars(ctlr->dev, serial); - inited = 1; - } - else - serial = device_get_ivars(ctlr->dev); + serial = ctlr->chipset_data; mtx_lock(&serial->locked_mtx); switch (flags) { Modified: stable/7/sys/dev/ata/ata-pci.h ============================================================================== --- stable/7/sys/dev/ata/ata-pci.h Tue May 19 15:33:41 2009 (r192386) +++ stable/7/sys/dev/ata/ata-pci.h Tue May 19 15:47:42 2009 (r192387) @@ -59,6 +59,7 @@ struct ata_pci_controller { void (*function)(void *); void *argument; } interrupt[8]; /* XXX SOS max ch# for now */ + void *chipset_data; }; /* structure for SATA connection update hotplug/hotswap support */ From owner-svn-src-stable-7@FreeBSD.ORG Tue May 19 18:14:05 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43EBB106566C; Tue, 19 May 2009 18:14:05 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30C098FC0A; Tue, 19 May 2009 18:14:05 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4JIE5e1006058; Tue, 19 May 2009 18:14:05 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4JIE5LO006057; Tue, 19 May 2009 18:14:05 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200905191814.n4JIE5LO006057@svn.freebsd.org> From: Scott Long Date: Tue, 19 May 2009 18:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192402 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/ciss dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2009 18:14:06 -0000 Author: scottl Date: Tue May 19 18:14:04 2009 New Revision: 192402 URL: http://svn.freebsd.org/changeset/base/192402 Log: Merge PCI ID additions from vendor Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/ciss/ciss.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/ciss/ciss.c ============================================================================== --- stable/7/sys/dev/ciss/ciss.c Tue May 19 17:54:32 2009 (r192401) +++ stable/7/sys/dev/ciss/ciss.c Tue May 19 18:14:04 2009 (r192402) @@ -292,17 +292,20 @@ static struct { 0x103C, 0x3234, CISS_BOARD_SA5, "HP Smart Array P400" }, { 0x103C, 0x3235, CISS_BOARD_SA5, "HP Smart Array P400i" }, { 0x103C, 0x3236, CISS_BOARD_SA5, "HP Smart Array" }, - { 0x103C, 0x3237, CISS_BOARD_SA5, "HP Smart Array" }, + { 0x103C, 0x3237, CISS_BOARD_SA5, "HP Smart Array E500" }, { 0x103C, 0x3238, CISS_BOARD_SA5, "HP Smart Array" }, { 0x103C, 0x3239, CISS_BOARD_SA5, "HP Smart Array" }, { 0x103C, 0x323A, CISS_BOARD_SA5, "HP Smart Array" }, { 0x103C, 0x323B, CISS_BOARD_SA5, "HP Smart Array" }, { 0x103C, 0x323C, CISS_BOARD_SA5, "HP Smart Array" }, + { 0x103C, 0x323D, CISS_BOARD_SA5, "HP Smart Array P700m" }, { 0x103C, 0x3241, CISS_BOARD_SA5, "HP Smart Array P212" }, { 0x103C, 0x3243, CISS_BOARD_SA5, "HP Smart Array P410" }, { 0x103C, 0x3245, CISS_BOARD_SA5, "HP Smart Array P410i" }, { 0x103C, 0x3247, CISS_BOARD_SA5, "HP Smart Array P411" }, { 0x103C, 0x3249, CISS_BOARD_SA5, "HP Smart Array P812" }, + { 0x103C, 0x324A, CISS_BOARD_SA5, "HP Smart Array P712m" }, + { 0x103C, 0x324B, CISS_BOARD_SA5, "HP Smart Array" }, { 0, 0, 0, NULL } }; From owner-svn-src-stable-7@FreeBSD.ORG Tue May 19 19:45:37 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F70B1065705; Tue, 19 May 2009 19:45:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89DB48FC22; Tue, 19 May 2009 19:45:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4JJjbtj008120; Tue, 19 May 2009 19:45:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4JJjb0Q008111; Tue, 19 May 2009 19:45:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905191945.n4JJjb0Q008111@svn.freebsd.org> From: John Baldwin Date: Tue, 19 May 2009 19:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192406 - in stable/7/sys: . amd64/amd64 arm/arm contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 ia64/ia64 kern powerpc/powerpc sparc64/sparc64 sun4v/sun4v sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2009 19:45:38 -0000 Author: jhb Date: Tue May 19 19:45:36 2009 New Revision: 192406 URL: http://svn.freebsd.org/changeset/base/192406 Log: MFC: Add a MI intr_event_handle() routine for the non-INTR_FILTER case. This allows all the INTR_FILTER #ifdef's to be removed from the MD interrupt code. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/intr_machdep.c stable/7/sys/arm/arm/intr.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/i386/intr_machdep.c stable/7/sys/ia64/ia64/interrupt.c stable/7/sys/kern/kern_intr.c stable/7/sys/powerpc/powerpc/intr_machdep.c stable/7/sys/sparc64/sparc64/intr_machdep.c stable/7/sys/sun4v/sun4v/intr_machdep.c stable/7/sys/sys/interrupt.h Modified: stable/7/sys/amd64/amd64/intr_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/intr_machdep.c Tue May 19 19:27:07 2009 (r192405) +++ stable/7/sys/amd64/amd64/intr_machdep.c Tue May 19 19:45:36 2009 (r192406) @@ -85,9 +85,6 @@ static void intr_assign_next_cpu(struct static int intr_assign_cpu(void *arg, u_char cpu); static void intr_disable_src(void *arg); -#ifdef INTR_FILTER -static void intr_event_stray(void *cookie); -#endif static void intr_init(void *__dummy); static int intr_pic_registered(struct pic *pic); static void intrcnt_setname(const char *name, int index); @@ -238,66 +235,12 @@ intr_disable_src(void *arg) isrc->is_pic->pic_disable_source(isrc, PIC_EOI); } -#ifdef INTR_FILTER void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) { - struct thread *td; struct intr_event *ie; - int vector; - - td = curthread; - - /* - * We count software interrupts when we process them. The - * code here follows previous practice, but there's an - * argument for counting hardware interrupts when they're - * processed too. - */ - (*isrc->is_count)++; - PCPU_INC(cnt.v_intr); - - ie = isrc->is_event; - - /* - * XXX: We assume that IRQ 0 is only used for the ISA timer - * device (clk). - */ - vector = isrc->is_pic->pic_vector(isrc); - if (vector == 0) - clkintr_pending = 1; - - if (intr_event_handle(ie, frame) != 0) - intr_event_stray(isrc); -} - -static void -intr_event_stray(void *cookie) -{ - struct intsrc *isrc; - - isrc = cookie; - /* - * For stray interrupts, mask and EOI the source, bump the - * stray count, and log the condition. - */ - isrc->is_pic->pic_disable_source(isrc, PIC_EOI); - (*isrc->is_straycount)++; - if (*isrc->is_straycount < MAX_STRAY_LOG) - log(LOG_ERR, "stray irq%d\n", isrc->is_pic->pic_vector(isrc)); - else if (*isrc->is_straycount == MAX_STRAY_LOG) - log(LOG_CRIT, - "too many stray irq %d's: not logging anymore\n", - isrc->is_pic->pic_vector(isrc)); -} -#else -void -intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) -{ struct thread *td; - struct intr_event *ie; - struct intr_handler *ih; - int error, vector, thread, ret; + int vector; td = curthread; @@ -324,7 +267,7 @@ intr_execute_handlers(struct intsrc *isr * For stray interrupts, mask and EOI the source, bump the * stray count, and log the condition. */ - if (ie == NULL || TAILQ_EMPTY(&ie->ie_handlers)) { + if (intr_event_handle(ie, frame) != 0) { isrc->is_pic->pic_disable_source(isrc, PIC_EOI); (*isrc->is_straycount)++; if (*isrc->is_straycount < MAX_STRAY_LOG) @@ -333,60 +276,8 @@ intr_execute_handlers(struct intsrc *isr log(LOG_CRIT, "too many stray irq %d's: not logging anymore\n", vector); - return; } - - /* - * Execute fast interrupt handlers directly. - * To support clock handlers, if a handler registers - * with a NULL argument, then we pass it a pointer to - * a trapframe as its argument. - */ - td->td_intr_nesting_level++; - ret = 0; - thread = 0; - critical_enter(); - TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (ih->ih_filter == NULL) { - thread = 1; - continue; - } - CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, - ih->ih_filter, ih->ih_argument == NULL ? frame : - ih->ih_argument, ih->ih_name); - if (ih->ih_argument == NULL) - ret = ih->ih_filter(frame); - else - ret = ih->ih_filter(ih->ih_argument); - /* - * Wrapper handler special case: see - * i386/intr_machdep.c::intr_execute_handlers() - */ - if (!thread) { - if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; - } - } - - /* - * If there are any threaded handlers that need to run, - * mask the source as well as sending it an EOI. Otherwise, - * just send it an EOI but leave it unmasked. - */ - if (thread) - isrc->is_pic->pic_disable_source(isrc, PIC_EOI); - else - isrc->is_pic->pic_eoi_source(isrc); - - /* Schedule the ithread if needed. */ - if (thread) { - error = intr_event_schedule_thread(ie); - KASSERT(error == 0, ("bad stray interrupt")); - } - critical_exit(); - td->td_intr_nesting_level--; } -#endif void intr_resume(void) Modified: stable/7/sys/arm/arm/intr.c ============================================================================== --- stable/7/sys/arm/arm/intr.c Tue May 19 19:27:07 2009 (r192405) +++ stable/7/sys/arm/arm/intr.c Tue May 19 19:45:36 2009 (r192406) @@ -72,7 +72,7 @@ arm_setup_irqhandler(const char *name, d if (event == NULL) { error = intr_event_create(&event, (void *)irq, 0, (mask_fn)arm_mask_irq, (mask_fn)arm_unmask_irq, - (mask_fn)arm_unmask_irq, NULL, "intr%d:", irq); + NULL, NULL, "intr%d:", irq); if (error) return; intr_events[irq] = event; @@ -106,57 +106,17 @@ arm_handler_execute(struct trapframe *fr { struct intr_event *event; struct thread *td = curthread; -#ifdef INTR_FILTER int i; -#else - int i, thread, ret; - struct intr_handler *ih; -#endif PCPU_INC(cnt.v_intr); td->td_intr_nesting_level++; while ((i = arm_get_next_irq()) != -1) { -#ifndef INTR_FILTER - arm_mask_irq(i); -#endif intrcnt[intrcnt_tab[i]]++; event = intr_events[i]; - if (!event || TAILQ_EMPTY(&event->ie_handlers)) { -#ifdef INTR_FILTER + if (intr_event_handle(event, frame) != 0) { + /* XXX: Log stray IRQs */ arm_mask_irq(i); -#endif - continue; } - -#ifdef INTR_FILTER - intr_event_handle(event, frame); - /* XXX: Log stray IRQs */ -#else - /* Execute fast handlers. */ - ret = 0; - thread = 0; - TAILQ_FOREACH(ih, &event->ie_handlers, ih_next) { - if (ih->ih_filter == NULL) - thread = 1; - else - ret = ih->ih_filter(ih->ih_argument ? - ih->ih_argument : frame); - /* - * Wrapper handler special case: see - * i386/intr_machdep.c::intr_execute_handlers() - */ - if (!thread) { - if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; - } - } - - /* Schedule thread if needed. */ - if (thread) - intr_event_schedule_thread(event); - else - arm_unmask_irq(i); -#endif } td->td_intr_nesting_level--; } Modified: stable/7/sys/i386/i386/intr_machdep.c ============================================================================== --- stable/7/sys/i386/i386/intr_machdep.c Tue May 19 19:27:07 2009 (r192405) +++ stable/7/sys/i386/i386/intr_machdep.c Tue May 19 19:45:36 2009 (r192406) @@ -76,9 +76,6 @@ static void intr_assign_next_cpu(struct static int intr_assign_cpu(void *arg, u_char cpu); static void intr_disable_src(void *arg); -#ifdef INTR_FILTER -static void intr_event_stray(void *cookie); -#endif static void intr_init(void *__dummy); static int intr_pic_registered(struct pic *pic); static void intrcnt_setname(const char *name, int index); @@ -229,66 +226,12 @@ intr_disable_src(void *arg) isrc->is_pic->pic_disable_source(isrc, PIC_EOI); } -#ifdef INTR_FILTER void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) { - struct thread *td; struct intr_event *ie; - int vector; - - td = curthread; - - /* - * We count software interrupts when we process them. The - * code here follows previous practice, but there's an - * argument for counting hardware interrupts when they're - * processed too. - */ - (*isrc->is_count)++; - PCPU_INC(cnt.v_intr); - - ie = isrc->is_event; - - /* - * XXX: We assume that IRQ 0 is only used for the ISA timer - * device (clk). - */ - vector = isrc->is_pic->pic_vector(isrc); - if (vector == 0) - clkintr_pending = 1; - - if (intr_event_handle(ie, frame) != 0) - intr_event_stray(isrc); -} - -static void -intr_event_stray(void *cookie) -{ - struct intsrc *isrc; - - isrc = cookie; - /* - * For stray interrupts, mask and EOI the source, bump the - * stray count, and log the condition. - */ - isrc->is_pic->pic_disable_source(isrc, PIC_EOI); - (*isrc->is_straycount)++; - if (*isrc->is_straycount < MAX_STRAY_LOG) - log(LOG_ERR, "stray irq%d\n", isrc->is_pic->pic_vector(isrc)); - else if (*isrc->is_straycount == MAX_STRAY_LOG) - log(LOG_CRIT, - "too many stray irq %d's: not logging anymore\n", - isrc->is_pic->pic_vector(isrc)); -} -#else -void -intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) -{ struct thread *td; - struct intr_event *ie; - struct intr_handler *ih; - int error, vector, thread, ret; + int vector; td = curthread; @@ -315,7 +258,7 @@ intr_execute_handlers(struct intsrc *isr * For stray interrupts, mask and EOI the source, bump the * stray count, and log the condition. */ - if (ie == NULL || TAILQ_EMPTY(&ie->ie_handlers)) { + if (intr_event_handle(ie, frame) != 0) { isrc->is_pic->pic_disable_source(isrc, PIC_EOI); (*isrc->is_straycount)++; if (*isrc->is_straycount < MAX_STRAY_LOG) @@ -324,70 +267,8 @@ intr_execute_handlers(struct intsrc *isr log(LOG_CRIT, "too many stray irq %d's: not logging anymore\n", vector); - return; } - - /* - * Execute fast interrupt handlers directly. - * To support clock handlers, if a handler registers - * with a NULL argument, then we pass it a pointer to - * a trapframe as its argument. - */ - td->td_intr_nesting_level++; - ret = 0; - thread = 0; - critical_enter(); - TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (ih->ih_filter == NULL) { - thread = 1; - continue; - } - CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, - ih->ih_filter, ih->ih_argument == NULL ? frame : - ih->ih_argument, ih->ih_name); - if (ih->ih_argument == NULL) - ret = ih->ih_filter(frame); - else - ret = ih->ih_filter(ih->ih_argument); - /* - * Wrapper handler special handling: - * - * in some particular cases (like pccard and pccbb), - * the _real_ device handler is wrapped in a couple of - * functions - a filter wrapper and an ithread wrapper. - * In this case (and just in this case), the filter wrapper - * could ask the system to schedule the ithread and mask - * the interrupt source if the wrapped handler is composed - * of just an ithread handler. - * - * TODO: write a generic wrapper to avoid people rolling - * their own - */ - if (!thread) { - if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; - } - } - - /* - * If there are any threaded handlers that need to run, - * mask the source as well as sending it an EOI. Otherwise, - * just send it an EOI but leave it unmasked. - */ - if (thread) - isrc->is_pic->pic_disable_source(isrc, PIC_EOI); - else - isrc->is_pic->pic_eoi_source(isrc); - - /* Schedule the ithread if needed. */ - if (thread) { - error = intr_event_schedule_thread(ie); - KASSERT(error == 0, ("bad stray interrupt")); - } - critical_exit(); - td->td_intr_nesting_level--; } -#endif void intr_resume(void) Modified: stable/7/sys/ia64/ia64/interrupt.c ============================================================================== --- stable/7/sys/ia64/ia64/interrupt.c Tue May 19 19:27:07 2009 (r192405) +++ stable/7/sys/ia64/ia64/interrupt.c Tue May 19 19:45:36 2009 (r192406) @@ -385,10 +385,6 @@ ia64_dispatch_intr(void *frame, u_int ve { struct ia64_intr *i; struct intr_event *ie; /* our interrupt event */ -#ifndef INTR_FILTER - struct intr_handler *ih; - int error, thread, ret; -#endif /* * Find the interrupt thread for this vector. @@ -401,52 +397,14 @@ ia64_dispatch_intr(void *frame, u_int ve ie = i->event; KASSERT(ie != NULL, ("%s: interrupt without event", __func__)); -#ifdef INTR_FILTER if (intr_event_handle(ie, frame) != 0) { - ia64_intr_mask((void *)(uintptr_t)vector); - log(LOG_ERR, "stray irq%u\n", i->irq); - } -#else - /* - * As an optimization, if an event has no handlers, don't - * schedule it to run. - */ - if (TAILQ_EMPTY(&ie->ie_handlers)) - return; - - /* - * Execute all fast interrupt handlers directly without Giant. Note - * that this means that any fast interrupt handler must be MP safe. - */ - ret = 0; - thread = 0; - critical_enter(); - TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (ih->ih_filter == NULL) { - thread = 1; - continue; - } - CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, - ih->ih_filter, ih->ih_argument, ih->ih_name); - ret = ih->ih_filter(ih->ih_argument); /* - * Wrapper handler special case: see - * i386/intr_machdep.c::intr_execute_handlers() + * XXX: The pre-INTR_FILTER code didn't mask stray + * interrupts. */ - if (!thread) { - if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; - } - } - - if (thread) { ia64_intr_mask((void *)(uintptr_t)vector); - error = intr_event_schedule_thread(ie); - KASSERT(error == 0, ("%s: impossible stray", __func__)); - } else - ia64_intr_eoi((void *)(uintptr_t)vector); - critical_exit(); -#endif + log(LOG_ERR, "stray irq%u\n", i->irq); + } } #ifdef DDB Modified: stable/7/sys/kern/kern_intr.c ============================================================================== --- stable/7/sys/kern/kern_intr.c Tue May 19 19:27:07 2009 (r192405) +++ stable/7/sys/kern/kern_intr.c Tue May 19 19:45:36 2009 (r192406) @@ -94,9 +94,14 @@ static TAILQ_HEAD(, intr_event) event_li static void intr_event_update(struct intr_event *ie); #ifdef INTR_FILTER +static int intr_event_schedule_thread(struct intr_event *ie, + struct intr_thread *ithd); +static int intr_filter_loop(struct intr_event *ie, + struct trapframe *frame, struct intr_thread **ithd); static struct intr_thread *ithread_create(const char *name, struct intr_handler *ih); #else +static int intr_event_schedule_thread(struct intr_event *ie); static struct intr_thread *ithread_create(const char *name); #endif static void ithread_destroy(struct intr_thread *ithread); @@ -240,8 +245,9 @@ intr_event_update(struct intr_event *ie) int intr_event_create(struct intr_event **event, void *source,int flags, - void (*disable)(void *), void (*enable)(void *), void (*eoi)(void *), - int (*assign_cpu)(void *, u_char), const char *fmt, ...) + void (*pre_ithread)(void *), void (*post_ithread)(void *), + void (*post_filter)(void *), int (*assign_cpu)(void *, u_char), + const char *fmt, ...) { struct intr_event *ie; va_list ap; @@ -251,9 +257,9 @@ intr_event_create(struct intr_event **ev return (EINVAL); ie = malloc(sizeof(struct intr_event), M_ITHREAD, M_WAITOK | M_ZERO); ie->ie_source = source; - ie->ie_disable = disable; - ie->ie_enable = enable; - ie->ie_eoi = eoi; + ie->ie_pre_ithread = pre_ithread; + ie->ie_post_ithread = post_ithread; + ie->ie_post_filter = post_filter; ie->ie_assign_cpu = assign_cpu; ie->ie_flags = flags; ie->ie_cpu = NOCPU; @@ -678,7 +684,7 @@ ok: return (0); } -int +static int intr_event_schedule_thread(struct intr_event *ie) { struct intr_entropy entropy; @@ -835,7 +841,7 @@ ok: return (0); } -int +static int intr_event_schedule_thread(struct intr_event *ie, struct intr_thread *it) { struct intr_entropy entropy; @@ -1078,8 +1084,8 @@ ithread_execute_handlers(struct proc *p, * Now that all the handlers have had a chance to run, reenable * the interrupt source. */ - if (ie->ie_enable != NULL) - ie->ie_enable(ie->ie_source); + if (ie->ie_post_ithread != NULL) + ie->ie_post_ithread(ie->ie_source); } #ifndef INTR_FILTER @@ -1166,6 +1172,90 @@ ithread_loop(void *arg) thread_unlock(td); } } + +/* + * Main interrupt handling body. + * + * Input: + * o ie: the event connected to this interrupt. + * o frame: some archs (i.e. i386) pass a frame to some. + * handlers as their main argument. + * Return value: + * o 0: everything ok. + * o EINVAL: stray interrupt. + */ +int +intr_event_handle(struct intr_event *ie, struct trapframe *frame) +{ + struct intr_handler *ih; + struct thread *td; + int error, ret, thread; + + td = curthread; + + /* An interrupt with no event or handlers is a stray interrupt. */ + if (ie == NULL || TAILQ_EMPTY(&ie->ie_handlers)) + return (EINVAL); + + /* + * Execute fast interrupt handlers directly. + * To support clock handlers, if a handler registers + * with a NULL argument, then we pass it a pointer to + * a trapframe as its argument. + */ + td->td_intr_nesting_level++; + thread = 0; + ret = 0; + critical_enter(); + TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { + if (ih->ih_filter == NULL) { + thread = 1; + continue; + } + CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, + ih->ih_filter, ih->ih_argument == NULL ? frame : + ih->ih_argument, ih->ih_name); + if (ih->ih_argument == NULL) + ret = ih->ih_filter(frame); + else + ret = ih->ih_filter(ih->ih_argument); + /* + * Wrapper handler special handling: + * + * in some particular cases (like pccard and pccbb), + * the _real_ device handler is wrapped in a couple of + * functions - a filter wrapper and an ithread wrapper. + * In this case (and just in this case), the filter wrapper + * could ask the system to schedule the ithread and mask + * the interrupt source if the wrapped handler is composed + * of just an ithread handler. + * + * TODO: write a generic wrapper to avoid people rolling + * their own + */ + if (!thread) { + if (ret == FILTER_SCHEDULE_THREAD) + thread = 1; + } + } + + if (thread) { + if (ie->ie_pre_ithread != NULL) + ie->ie_pre_ithread(ie->ie_source); + } else { + if (ie->ie_post_filter != NULL) + ie->ie_post_filter(ie->ie_source); + } + + /* Schedule the ithread if needed. */ + if (thread) { + error = intr_event_schedule_thread(ie); + KASSERT(error == 0, ("bad stray interrupt")); + } + critical_exit(); + td->td_intr_nesting_level--; + return (0); +} #else /* * This is the main code for interrupt threads. @@ -1281,7 +1371,7 @@ ithread_loop(void *arg) * scheduled. */ -int +static int intr_filter_loop(struct intr_event *ie, struct trapframe *frame, struct intr_thread **ithd) { @@ -1357,19 +1447,13 @@ intr_event_handle(struct intr_event *ie, td->td_intr_nesting_level++; thread = 0; critical_enter(); - thread = intr_filter_loop(ie, frame, &ithd); - - /* - * If the interrupt was fully served, send it an EOI but leave - * it unmasked. Otherwise, mask the source as well as sending - * it an EOI. - */ + thread = intr_filter_loop(ie, frame, &ithd); if (thread & FILTER_HANDLED) { - if (ie->ie_eoi != NULL) - ie->ie_eoi(ie->ie_source); + if (ie->ie_post_filter != NULL) + ie->ie_post_filter(ie->ie_source); } else { - if (ie->ie_disable != NULL) - ie->ie_disable(ie->ie_source); + if (ie->ie_pre_ithread != NULL) + ie->ie_pre_ithread(ie->ie_source); } critical_exit(); Modified: stable/7/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- stable/7/sys/powerpc/powerpc/intr_machdep.c Tue May 19 19:27:07 2009 (r192405) +++ stable/7/sys/powerpc/powerpc/intr_machdep.c Tue May 19 19:45:36 2009 (r192406) @@ -228,10 +228,6 @@ powerpc_dispatch_intr(u_int vector, stru { struct powerpc_intr *i; struct intr_event *ie; -#ifndef INTR_FILTER - struct intr_handler *ih; - int error, sched, ret; -#endif i = powerpc_intrs[vector]; if (i == NULL) @@ -242,55 +238,15 @@ powerpc_dispatch_intr(u_int vector, stru ie = i->event; KASSERT(ie != NULL, ("%s: interrupt without an event", __func__)); -#ifdef INTR_FILTER if (intr_event_handle(ie, tf) != 0) { - PIC_MASK(pic, i->irq); - log(LOG_ERR, "stray irq%u\n", i->irq); - } -#else - if (TAILQ_EMPTY(&ie->ie_handlers)) goto stray; - - /* - * Execute all fast interrupt handlers directly without Giant. Note - * that this means that any fast interrupt handler must be MP safe. - */ - ret = 0; - sched = 0; - critical_enter(); - TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (ih->ih_filter == NULL) { - sched = 1; - continue; - } - CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, - ih->ih_filter, ih->ih_argument, ih->ih_name); - ret = ih->ih_filter(ih->ih_argument); - /* - * Wrapper handler special case: see - * i386/intr_machdep.c::intr_execute_handlers() - */ - if (!sched) { - if (ret == FILTER_SCHEDULE_THREAD) - sched = 1; - } } - - if (sched) { - PIC_MASK(pic, i->irq); - error = intr_event_schedule_thread(ie); - KASSERT(error == 0, ("%s: impossible stray interrupt", - __func__)); - } else - PIC_EOI(pic, i->irq); - critical_exit(); -#endif return; stray: stray_count++; if (stray_count <= MAX_STRAY_LOG) { - printf("stray irq %d\n", i->irq); + printf("stray irq %d\n", i ? i->irq : -1); if (stray_count >= MAX_STRAY_LOG) { printf("got %d stray interrupts, not logging anymore\n", MAX_STRAY_LOG); Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Tue May 19 19:27:07 2009 (r192405) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Tue May 19 19:45:36 2009 (r192406) @@ -275,57 +275,9 @@ static void intr_execute_handlers(void *cookie) { struct intr_vector *iv; -#ifndef INTR_FILTER - struct intr_event *ie; - struct intr_handler *ih; - int error, thread, ret; -#endif iv = cookie; -#ifndef INTR_FILTER - ie = iv->iv_event; - if (iv->iv_ic == NULL || ie == NULL) { - intr_stray_vector(iv); - return; - } - - /* Execute fast interrupt handlers directly. */ - ret = 0; - thread = 0; - critical_enter(); - TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (ih->ih_filter == NULL) { - thread = 1; - continue; - } - MPASS(ih->ih_filter != NULL && ih->ih_argument != NULL); - CTR3(KTR_INTR, "%s: executing handler %p(%p)", __func__, - ih->ih_filter, ih->ih_argument); - ret = ih->ih_filter(ih->ih_argument); - /* - * Wrapper handler special case: see - * i386/intr_machdep.c::intr_execute_handlers() - */ - if (!thread) { - if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; - } - } - if (!thread) - iv->iv_ic->ic_clear(iv); - - /* Schedule a heavyweight interrupt process. */ - if (thread) - error = intr_event_schedule_thread(ie); - else if (TAILQ_EMPTY(&ie->ie_handlers)) - error = EINVAL; - else - error = 0; - critical_exit(); - if (error == EINVAL) -#else if (iv->iv_ic == NULL || intr_event_handle(iv->iv_event, NULL) != 0) -#endif intr_stray_vector(iv); } Modified: stable/7/sys/sun4v/sun4v/intr_machdep.c ============================================================================== --- stable/7/sys/sun4v/sun4v/intr_machdep.c Tue May 19 19:27:07 2009 (r192405) +++ stable/7/sys/sun4v/sun4v/intr_machdep.c Tue May 19 19:45:36 2009 (r192406) @@ -101,12 +101,6 @@ struct intr_vector intr_vectors[IV_MAX]; uint16_t intr_countp[IV_MAX]; static u_long intr_stray_count[IV_MAX]; -struct ithread_vector_handler { - iv_func_t *ivh_handler; - void *ivh_arg; - u_int ivh_vec; -}; - static char *pil_names[] = { "stray", "low", /* PIL_LOW */ @@ -276,63 +270,23 @@ intr_init(void) } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); +static void +intr_enable(void *cookie) +{ + int vec; + + vec = (uintptr_t)cookie; + hv_intr_setstate(vec, HV_INTR_IDLE_STATE); +} static void intr_execute_handlers(void *cookie) { struct intr_vector *iv; - struct intr_event *ie; - struct intr_handler *ih; - int fast, thread, ret; iv = cookie; - ie = iv->iv_event; - if (ie == NULL) { - intr_stray_vector(iv); - return; - } - - ret = 0; - fast = thread = 0; - TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (ih->ih_filter == NULL) { - thread = 1; - continue; - } - MPASS(ih->ih_filter != NULL && ih->ih_argument != NULL); - CTR3(KTR_INTR, "%s: executing handler %p(%p)", __func__, - ih->ih_filter, ih->ih_argument); - ret = ih->ih_filter(ih->ih_argument); - fast = 1; - /* - * Wrapper handler special case: see - * i386/intr_machdep.c::intr_execute_handlers() - */ - if (!thread) { - if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; - } - } - - /* Schedule a heavyweight interrupt process. */ - if (thread) - intr_event_schedule_thread(ie); - else if (TAILQ_EMPTY(&ie->ie_handlers)) + if (intr_event_handle(iv->iv_event, NULL) != 0) intr_stray_vector(iv); - - if (fast) - hv_intr_setstate(iv->iv_vec, HV_INTR_IDLE_STATE); - -} - -static void -ithread_wrapper(void *arg) -{ - struct ithread_vector_handler *ivh = (struct ithread_vector_handler *)arg; - - ivh->ivh_handler(ivh->ivh_arg); - /* re-enable interrupt */ - hv_intr_setstate(ivh->ivh_vec, HV_INTR_IDLE_STATE); } int @@ -342,13 +296,8 @@ inthand_add(const char *name, int vec, d struct intr_vector *iv; struct intr_event *ie; /* descriptor for the IRQ */ struct intr_event *orphan; - struct ithread_vector_handler *ivh; int errcode, pil; - if (filt != NULL && handler != NULL) { - printf("both filt and handler set is not valid\n"); - return (EINVAL); - } /* * Work around a race where more than one CPU may be registering * handlers on the same IRQ at the same time. @@ -359,7 +308,7 @@ inthand_add(const char *name, int vec, d mtx_unlock_spin(&intr_table_lock); if (ie == NULL) { errcode = intr_event_create(&ie, (void *)(intptr_t)vec, 0, NULL, - NULL, "vec%d:", vec); + intr_enable, intr_enable, NULL, "vec%d:", vec); if (errcode) return (errcode); mtx_lock_spin(&intr_table_lock); @@ -374,26 +323,12 @@ inthand_add(const char *name, int vec, d } } - if (filt == NULL) { - ivh = (struct ithread_vector_handler *) - malloc(sizeof(struct ithread_vector_handler), M_DEVBUF, M_WAITOK); - ivh->ivh_handler = (driver_intr_t *)handler; - ivh->ivh_arg = arg; - ivh->ivh_vec = vec; - errcode = intr_event_add_handler(ie, name, NULL, ithread_wrapper, ivh, - intr_priority(flags), flags, cookiep); - } else { - ivh = NULL; - errcode = intr_event_add_handler(ie, name, filt, NULL, arg, - intr_priority(flags), flags, - cookiep); - } + errcode = intr_event_add_handler(ie, name, filt, handler, arg, + intr_priority(flags), flags, cookiep); - if (errcode) { - if (ivh) - free(ivh, M_DEVBUF); + if (errcode) return (errcode); - } + pil = (filt != NULL) ? PIL_FAST : PIL_ITHREAD; intr_setup(pil, intr_fast, vec, intr_execute_handlers, iv); Modified: stable/7/sys/sys/interrupt.h ============================================================================== --- stable/7/sys/sys/interrupt.h Tue May 19 19:27:07 2009 (r192405) +++ stable/7/sys/sys/interrupt.h Tue May 19 19:45:36 2009 (r192406) @@ -63,6 +63,33 @@ struct intr_handler { /* * Describe an interrupt event. An event holds a list of handlers. + * The 'pre_ithread', 'post_ithread', 'post_filter', and 'assign_cpu' + * hooks are used to invoke MD code for certain operations. + * + * The 'pre_ithread' hook is called when an interrupt thread for + * handlers without filters is scheduled. It is responsible for + * ensuring that 1) the system won't be swamped with an interrupt + * storm from the associated source while the ithread runs and 2) the + * current CPU is able to receive interrupts from other interrupt + * sources. The first is usually accomplished by disabling + * level-triggered interrupts until the ithread completes. The second + * is accomplished on some platforms by acknowledging the interrupt + * via an EOI. + * + * The 'post_ithread' hook is invoked when an ithread finishes. It is + * responsible for ensuring that the associated interrupt source will + * trigger an interrupt when it is asserted in the future. Usually + * this is implemented by enabling a level-triggered interrupt that + * was previously disabled via the 'pre_ithread' hook. + * + * The 'post_filter' hook is invoked when a filter handles an + * interrupt. It is responsible for ensuring that the current CPU is + * able to receive interrupts again. On some platforms this is done + * by acknowledging the interrupts via an EOI. + * + * The 'assign_cpu' hook is used to bind an interrupt source to a + * specific CPU. If the interrupt cannot be bound, this function may + * return an error. */ struct intr_event { TAILQ_ENTRY(intr_event) ie_list; @@ -72,9 +99,9 @@ struct intr_event { struct mtx ie_lock; void *ie_source; /* Cookie used by MD code. */ struct intr_thread *ie_thread; /* Thread we are connected to. */ - void (*ie_disable)(void *); - void (*ie_enable)(void *); - void (*ie_eoi)(void *); + void (*ie_pre_ithread)(void *); + void (*ie_post_ithread)(void *); + void (*ie_post_filter)(void *); int (*ie_assign_cpu)(void *, u_char); int ie_flags; int ie_count; /* Loop counter. */ @@ -118,29 +145,19 @@ extern char intrnames[]; /* string tabl #ifdef DDB void db_dump_intr_event(struct intr_event *ie, int handlers); #endif -#ifdef INTR_FILTER -int intr_filter_loop(struct intr_event *ie, struct trapframe *frame, - struct intr_thread **ithd); -int intr_event_handle(struct intr_event *ie, struct trapframe *frame); -#endif u_char intr_priority(enum intr_type flags); int intr_event_add_handler(struct intr_event *ie, const char *name, driver_filter_t filter, driver_intr_t handler, void *arg, u_char pri, enum intr_type flags, void **cookiep); int intr_event_bind(struct intr_event *ie, u_char cpu); int intr_event_create(struct intr_event **event, void *source, - int flags, void (*disable)(void *), void (*enable)(void *), - void (*eoi)(void *), int (*assign_cpu)(void *, u_char), - const char *fmt, ...) + int flags, void (*pre_ithread)(void *), + void (*post_ithread)(void *), void (*post_filter)(void *), + int (*assign_cpu)(void *, u_char), const char *fmt, ...) __printflike(8, 9); int intr_event_destroy(struct intr_event *ie); +int intr_event_handle(struct intr_event *ie, struct trapframe *frame); int intr_event_remove_handler(void *cookie); -#ifndef INTR_FILTER -int intr_event_schedule_thread(struct intr_event *ie); -#else -int intr_event_schedule_thread(struct intr_event *ie, - struct intr_thread *ithd); -#endif void *intr_handler_source(void *cookie); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Tue May 19 22:07:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81F0E1065686; Tue, 19 May 2009 22:07:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8E68FC0A; Tue, 19 May 2009 22:07:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4JM7twC011251; Tue, 19 May 2009 22:07:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4JM7spY011238; Tue, 19 May 2009 22:07:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905192207.n4JM7spY011238@svn.freebsd.org> From: John Baldwin Date: Tue, 19 May 2009 22:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192409 - in stable/7: sys sys/amd64/amd64 sys/arm/arm sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/i386/i386 sys/ia64/ia64 sys/kern sys/powerpc/powerpc sys/sparc64/sparc64 sys/s... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2009 22:07:56 -0000 Author: jhb Date: Tue May 19 22:07:54 2009 New Revision: 192409 URL: http://svn.freebsd.org/changeset/base/192409 Log: MFC: - Add the interrupt vector number to intr_event_create so MI code can lookup hard interrupt events by number. - Add support to cpuset for binding hardware interrupts. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/intr_machdep.c stable/7/sys/arm/arm/intr.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/i386/intr_machdep.c stable/7/sys/ia64/ia64/interrupt.c stable/7/sys/kern/kern_cpuset.c stable/7/sys/kern/kern_intr.c stable/7/sys/powerpc/powerpc/intr_machdep.c stable/7/sys/sparc64/sparc64/intr_machdep.c stable/7/sys/sun4v/sun4v/intr_machdep.c stable/7/sys/sys/cpuset.h stable/7/sys/sys/interrupt.h stable/7/usr.bin/cpuset/ (props changed) stable/7/usr.bin/cpuset/cpuset.1 stable/7/usr.bin/cpuset/cpuset.c Modified: stable/7/sys/amd64/amd64/intr_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/intr_machdep.c Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/amd64/amd64/intr_machdep.c Tue May 19 22:07:54 2009 (r192409) @@ -139,7 +139,7 @@ intr_register_source(struct intsrc *isrc vector = isrc->is_pic->pic_vector(isrc); if (interrupt_sources[vector] != NULL) return (EEXIST); - error = intr_event_create(&isrc->is_event, isrc, 0, + error = intr_event_create(&isrc->is_event, isrc, 0, vector, intr_disable_src, (mask_fn)isrc->is_pic->pic_enable_source, (mask_fn)isrc->is_pic->pic_eoi_source, intr_assign_cpu, "irq%d:", vector); Modified: stable/7/sys/arm/arm/intr.c ============================================================================== --- stable/7/sys/arm/arm/intr.c Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/arm/arm/intr.c Tue May 19 22:07:54 2009 (r192409) @@ -70,7 +70,7 @@ arm_setup_irqhandler(const char *name, d return; event = intr_events[irq]; if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, + error = intr_event_create(&event, (void *)irq, 0, irq, (mask_fn)arm_mask_irq, (mask_fn)arm_unmask_irq, NULL, NULL, "intr%d:", irq); if (error) Modified: stable/7/sys/i386/i386/intr_machdep.c ============================================================================== --- stable/7/sys/i386/i386/intr_machdep.c Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/i386/i386/intr_machdep.c Tue May 19 22:07:54 2009 (r192409) @@ -130,7 +130,7 @@ intr_register_source(struct intsrc *isrc vector = isrc->is_pic->pic_vector(isrc); if (interrupt_sources[vector] != NULL) return (EEXIST); - error = intr_event_create(&isrc->is_event, isrc, 0, + error = intr_event_create(&isrc->is_event, isrc, 0, vector, intr_disable_src, (mask_fn)isrc->is_pic->pic_enable_source, (mask_fn)isrc->is_pic->pic_eoi_source, intr_assign_cpu, "irq%d:", vector); Modified: stable/7/sys/ia64/ia64/interrupt.c ============================================================================== --- stable/7/sys/ia64/ia64/interrupt.c Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/ia64/ia64/interrupt.c Tue May 19 22:07:54 2009 (r192409) @@ -340,7 +340,7 @@ ia64_setup_intr(const char *name, int ir return (ENOMEM); error = intr_event_create(&i->event, (void *)(uintptr_t)vector, - 0, ia64_intr_mask, ia64_intr_unmask, ia64_intr_eoi, + 0, irq, ia64_intr_mask, ia64_intr_unmask, ia64_intr_eoi, NULL, "irq%u:", irq); if (error) { free(i, M_DEVBUF); Modified: stable/7/sys/kern/kern_cpuset.c ============================================================================== --- stable/7/sys/kern/kern_cpuset.c Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/kern/kern_cpuset.c Tue May 19 22:07:54 2009 (r192409) @@ -469,6 +469,8 @@ cpuset_which(cpuwhich_t which, id_t id, } return (ESRCH); } + case CPU_WHICH_IRQ: + return (0); default: return (EINVAL); } @@ -875,6 +877,8 @@ cpuset_getid(struct thread *td, struct c case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: break; + case CPU_WHICH_IRQ: + return (EINVAL); } switch (uap->level) { case CPU_LEVEL_ROOT: @@ -936,6 +940,9 @@ cpuset_getaffinity(struct thread *td, st case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: break; + case CPU_WHICH_IRQ: + error = EINVAL; + goto out; } if (uap->level == CPU_LEVEL_ROOT) nset = cpuset_refroot(set); @@ -964,6 +971,9 @@ cpuset_getaffinity(struct thread *td, st case CPU_WHICH_JAIL: CPU_COPY(&set->cs_mask, mask); break; + case CPU_WHICH_IRQ: + error = intr_getaffinity(uap->id, mask); + break; } break; default: @@ -1041,6 +1051,9 @@ cpuset_setaffinity(struct thread *td, st case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: break; + case CPU_WHICH_IRQ: + error = EINVAL; + goto out; } if (uap->level == CPU_LEVEL_ROOT) nset = cpuset_refroot(set); @@ -1067,6 +1080,9 @@ cpuset_setaffinity(struct thread *td, st cpuset_rel(set); } break; + case CPU_WHICH_IRQ: + error = intr_setaffinity(uap->id, mask); + break; default: error = EINVAL; break; Modified: stable/7/sys/kern/kern_intr.c ============================================================================== --- stable/7/sys/kern/kern_intr.c Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/kern/kern_intr.c Tue May 19 22:07:54 2009 (r192409) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -91,6 +92,8 @@ SYSCTL_INT(_hw, OID_AUTO, intr_storm_thr "Number of consecutive interrupts before storm protection is enabled"); static TAILQ_HEAD(, intr_event) event_list = TAILQ_HEAD_INITIALIZER(event_list); +static struct mtx event_lock; +MTX_SYSINIT(intr_event_list, &event_lock, "intr event list", MTX_DEF); static void intr_event_update(struct intr_event *ie); #ifdef INTR_FILTER @@ -244,7 +247,7 @@ intr_event_update(struct intr_event *ie) } int -intr_event_create(struct intr_event **event, void *source,int flags, +intr_event_create(struct intr_event **event, void *source, int flags, int irq, void (*pre_ithread)(void *), void (*post_ithread)(void *), void (*post_filter)(void *), int (*assign_cpu)(void *, u_char), const char *fmt, ...) @@ -262,6 +265,7 @@ intr_event_create(struct intr_event **ev ie->ie_post_filter = post_filter; ie->ie_assign_cpu = assign_cpu; ie->ie_flags = flags; + ie->ie_irq = irq; ie->ie_cpu = NOCPU; TAILQ_INIT(&ie->ie_handlers); mtx_init(&ie->ie_lock, "intr event", NULL, MTX_DEF); @@ -270,9 +274,9 @@ intr_event_create(struct intr_event **ev vsnprintf(ie->ie_name, sizeof(ie->ie_name), fmt, ap); va_end(ap); strlcpy(ie->ie_fullname, ie->ie_name, sizeof(ie->ie_fullname)); - mtx_pool_lock(mtxpool_sleep, &event_list); + mtx_lock(&event_lock); TAILQ_INSERT_TAIL(&event_list, ie, ie_list); - mtx_pool_unlock(mtxpool_sleep, &event_list); + mtx_unlock(&event_lock); if (event != NULL) *event = ie; CTR2(KTR_INTR, "%s: created %s", __func__, ie->ie_name); @@ -290,7 +294,8 @@ intr_event_create(struct intr_event **ev int intr_event_bind(struct intr_event *ie, u_char cpu) { - struct thread *td; + cpuset_t mask; + lwpid_t id; int error; /* Need a CPU to bind to. */ @@ -299,28 +304,95 @@ intr_event_bind(struct intr_event *ie, u if (ie->ie_assign_cpu == NULL) return (EOPNOTSUPP); - - /* Don't allow a bind request if the interrupt is already bound. */ + /* + * If we have any ithreads try to set their mask first since this + * can fail. + */ mtx_lock(&ie->ie_lock); - if (ie->ie_cpu != NOCPU && cpu != NOCPU) { + if (ie->ie_thread != NULL) { + CPU_ZERO(&mask); + if (cpu == NOCPU) + CPU_COPY(cpuset_root, &mask); + else + CPU_SET(cpu, &mask); + id = ie->ie_thread->it_thread->td_tid; + mtx_unlock(&ie->ie_lock); + error = cpuset_setthread(id, &mask); + if (error) + return (error); + } else mtx_unlock(&ie->ie_lock); - return (EBUSY); - } - mtx_unlock(&ie->ie_lock); - error = ie->ie_assign_cpu(ie->ie_source, cpu); if (error) return (error); mtx_lock(&ie->ie_lock); - if (ie->ie_thread != NULL) - td = ie->ie_thread->it_thread; - else - td = NULL; - if (td != NULL) - thread_lock(td); ie->ie_cpu = cpu; - if (td != NULL) - thread_unlock(td); + mtx_unlock(&ie->ie_lock); + + return (error); +} + +static struct intr_event * +intr_lookup(int irq) +{ + struct intr_event *ie; + + mtx_lock(&event_lock); + TAILQ_FOREACH(ie, &event_list, ie_list) + if (ie->ie_irq == irq && + (ie->ie_flags & IE_SOFT) == 0 && + TAILQ_FIRST(&ie->ie_handlers) != NULL) + break; + mtx_unlock(&event_lock); + return (ie); +} + +int +intr_setaffinity(int irq, void *m) +{ + struct intr_event *ie; + cpuset_t *mask; + u_char cpu; + int n; + + mask = m; + cpu = NOCPU; + /* + * If we're setting all cpus we can unbind. Otherwise make sure + * only one cpu is in the set. + */ + if (CPU_CMP(cpuset_root, mask)) { + for (n = 0; n < CPU_SETSIZE; n++) { + if (!CPU_ISSET(n, mask)) + continue; + if (cpu != NOCPU) + return (EINVAL); + cpu = (u_char)n; + } + } + ie = intr_lookup(irq); + if (ie == NULL) + return (ESRCH); + intr_event_bind(ie, cpu); + return (0); +} + +int +intr_getaffinity(int irq, void *m) +{ + struct intr_event *ie; + cpuset_t *mask; + + mask = m; + ie = intr_lookup(irq); + if (ie == NULL) + return (ESRCH); + CPU_ZERO(mask); + mtx_lock(&ie->ie_lock); + if (ie->ie_cpu == NOCPU) + CPU_COPY(cpuset_root, mask); + else + CPU_SET(ie->ie_cpu, mask); mtx_unlock(&ie->ie_lock); return (0); } @@ -329,14 +401,14 @@ int intr_event_destroy(struct intr_event *ie) { + mtx_lock(&event_lock); mtx_lock(&ie->ie_lock); if (!TAILQ_EMPTY(&ie->ie_handlers)) { mtx_unlock(&ie->ie_lock); + mtx_unlock(&event_lock); return (EBUSY); } - mtx_pool_lock(mtxpool_sleep, &event_list); TAILQ_REMOVE(&event_list, ie, ie_list); - mtx_pool_unlock(mtxpool_sleep, &event_list); #ifndef notyet if (ie->ie_thread != NULL) { ithread_destroy(ie->ie_thread); @@ -344,6 +416,7 @@ intr_event_destroy(struct intr_event *ie } #endif mtx_unlock(&ie->ie_lock); + mtx_unlock(&event_lock); mtx_destroy(&ie->ie_lock); free(ie, M_ITHREAD); return (0); @@ -916,7 +989,7 @@ swi_add(struct intr_event **eventp, cons if (!(ie->ie_flags & IE_SOFT)) return (EINVAL); } else { - error = intr_event_create(&ie, NULL, IE_SOFT, + error = intr_event_create(&ie, NULL, IE_SOFT, 0, NULL, NULL, NULL, NULL, "swi%d:", pri); if (error) return (error); @@ -1099,7 +1172,6 @@ ithread_loop(void *arg) struct intr_event *ie; struct thread *td; struct proc *p; - u_char cpu; td = curthread; p = td->td_proc; @@ -1108,7 +1180,6 @@ ithread_loop(void *arg) ("%s: ithread and proc linkage out of sync", __func__)); ie = ithd->it_event; ie->ie_count = 0; - cpu = NOCPU; /* * As long as we have interrupts outstanding, go through the @@ -1154,21 +1225,6 @@ ithread_loop(void *arg) ie->ie_count = 0; mi_switch(SW_VOL, NULL); } - -#ifdef SMP - /* - * Ensure we are bound to the correct CPU. We can't - * move ithreads until SMP is running however, so just - * leave interrupts on the boor CPU during boot. - */ - if (ie->ie_cpu != cpu && smp_started) { - cpu = ie->ie_cpu; - if (cpu == NOCPU) - sched_unbind(td); - else - sched_bind(td, cpu); - } -#endif thread_unlock(td); } } @@ -1269,7 +1325,6 @@ ithread_loop(void *arg) struct thread *td; struct proc *p; int priv; - u_char cpu; td = curthread; p = td->td_proc; @@ -1280,7 +1335,6 @@ ithread_loop(void *arg) ("%s: ithread and proc linkage out of sync", __func__)); ie = ithd->it_event; ie->ie_count = 0; - cpu = NOCPU; /* * As long as we have interrupts outstanding, go through the @@ -1329,21 +1383,6 @@ ithread_loop(void *arg) ie->ie_count = 0; mi_switch(SW_VOL, NULL); } - -#ifdef SMP - /* - * Ensure we are bound to the correct CPU. We can't - * move ithreads until SMP is running however, so just - * leave interrupts on the boor CPU during boot. - */ - if (!priv && ie->ie_cpu != cpu && smp_started) { - cpu = ie->ie_cpu; - if (cpu == NOCPU) - sched_unbind(td); - else - sched_bind(td, cpu); - } -#endif thread_unlock(td); } } @@ -1573,8 +1612,6 @@ db_dump_intr_event(struct intr_event *ie db_printf("(pid %d)", it->it_thread->td_proc->p_pid); else db_printf("(no thread)"); - if (ie->ie_cpu != NOCPU) - db_printf(" (CPU %d)", ie->ie_cpu); if ((ie->ie_flags & (IE_SOFT | IE_ENTROPY | IE_ADDING_THREAD)) != 0 || (it != NULL && it->it_need)) { db_printf(" {"); Modified: stable/7/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- stable/7/sys/powerpc/powerpc/intr_machdep.c Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/powerpc/powerpc/intr_machdep.c Tue May 19 22:07:54 2009 (r192409) @@ -184,7 +184,7 @@ powerpc_setup_intr(const char *name, u_i /* XXX unlock */ return (ENOMEM); } - error = intr_event_create(&i->event, (void *)irq, 0, + error = intr_event_create(&i->event, (void *)irq, 0, irq, powerpc_intr_mask, powerpc_intr_unmask, powerpc_intr_eoi, NULL, "irq%u:", irq); if (error) { Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Tue May 19 22:07:54 2009 (r192409) @@ -297,7 +297,7 @@ intr_controller_register(int vec, const sx_xunlock(&intr_table_lock); if (ie != NULL) return (EEXIST); - error = intr_event_create(&ie, iv, 0, NULL, ic->ic_clear, + error = intr_event_create(&ie, iv, 0, vec, NULL, ic->ic_clear, ic->ic_clear, intr_assign_cpu, "vec%d:", vec); if (error != 0) return (error); Modified: stable/7/sys/sun4v/sun4v/intr_machdep.c ============================================================================== --- stable/7/sys/sun4v/sun4v/intr_machdep.c Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/sun4v/sun4v/intr_machdep.c Tue May 19 22:07:54 2009 (r192409) @@ -307,8 +307,8 @@ inthand_add(const char *name, int vec, d ie = iv->iv_event; mtx_unlock_spin(&intr_table_lock); if (ie == NULL) { - errcode = intr_event_create(&ie, (void *)(intptr_t)vec, 0, NULL, - intr_enable, intr_enable, NULL, "vec%d:", vec); + errcode = intr_event_create(&ie, (void *)(intptr_t)vec, 0, vec, + NULL, intr_enable, intr_enable, NULL, "vec%d:", vec); if (errcode) return (errcode); mtx_lock_spin(&intr_table_lock); Modified: stable/7/sys/sys/cpuset.h ============================================================================== --- stable/7/sys/sys/cpuset.h Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/sys/cpuset.h Tue May 19 22:07:54 2009 (r192409) @@ -131,7 +131,7 @@ typedef struct _cpuset { #define CPU_WHICH_TID 1 /* Specifies a thread id. */ #define CPU_WHICH_PID 2 /* Specifies a process id. */ #define CPU_WHICH_CPUSET 3 /* Specifies a set id. */ -/* CPU_WHICH_IRQ */ +#define CPU_WHICH_IRQ 4 /* Specifies an irq #. */ #define CPU_WHICH_JAIL 5 /* Specifies a jail id. */ /* Modified: stable/7/sys/sys/interrupt.h ============================================================================== --- stable/7/sys/sys/interrupt.h Tue May 19 20:23:32 2009 (r192408) +++ stable/7/sys/sys/interrupt.h Tue May 19 22:07:54 2009 (r192409) @@ -107,6 +107,7 @@ struct intr_event { int ie_count; /* Loop counter. */ int ie_warncnt; /* Rate-check interrupt storm warns. */ struct timeval ie_warntm; + int ie_irq; /* Physical irq number if !SOFT. */ u_char ie_cpu; /* CPU this event is bound to. */ }; @@ -151,14 +152,16 @@ int intr_event_add_handler(struct intr_e u_char pri, enum intr_type flags, void **cookiep); int intr_event_bind(struct intr_event *ie, u_char cpu); int intr_event_create(struct intr_event **event, void *source, - int flags, void (*pre_ithread)(void *), + int flags, int irq, void (*pre_ithread)(void *), void (*post_ithread)(void *), void (*post_filter)(void *), int (*assign_cpu)(void *, u_char), const char *fmt, ...) - __printflike(8, 9); + __printflike(9, 10); int intr_event_destroy(struct intr_event *ie); int intr_event_handle(struct intr_event *ie, struct trapframe *frame); int intr_event_remove_handler(void *cookie); +int intr_getaffinity(int irq, void *mask); void *intr_handler_source(void *cookie); +int intr_setaffinity(int irq, void *mask); int swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler, void *arg, int pri, enum intr_type flags, void **cookiep); Modified: stable/7/usr.bin/cpuset/cpuset.1 ============================================================================== --- stable/7/usr.bin/cpuset/cpuset.1 Tue May 19 20:23:32 2009 (r192408) +++ stable/7/usr.bin/cpuset/cpuset.1 Tue May 19 22:07:54 2009 (r192409) @@ -35,7 +35,7 @@ .Nm .Op Fl l Ar cpu-list .Op Fl s Ar setid -.Ar cmd +.Ar cmd ... .Nm .Op Fl l Ar cpu-list .Op Fl s Ar setid @@ -43,10 +43,10 @@ .Nm .Op Fl cr .Op Fl l Ar cpu-list -.Op Fl j Ar jailid | Fl p Ar pid | Fl r Ar tid | Fl s Ar setid | Fl x Ar irq +.Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq .Nm .Op Fl cgir -.Op Fl j Ar jailid | Fl p Ar pid | Fl r Ar tid | Fl s Ar setid | Fl x Ar irq +.Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq .Sh DESCRIPTION The .Nm @@ -104,7 +104,7 @@ target specifier. .It Fl g Causes .Nm -to print either a list of valid CPUs or, using +to print either a list of valid CPUs or, using .Fl i , the id of the target. .It Fl i @@ -116,17 +116,17 @@ Specifies a jail id as the target of the .It Fl l Ar cpu-list Specifies a list of CPUs to apply to a target. Specification may include -numbers seperated by '-' for ranges and commas separating individual numbers. +numbers separated by '-' for ranges and commas separating individual numbers. .It Fl p Ar pid Specifies a pid as the target of the operation. -.It Fl s Ar setid +.It Fl s Ar setid Specifies a set id as the target of the operation. .It Fl r The requested operation should reference the root set available via the target specifier. .It Fl t Ar tid Specifies a thread id as the target of the operation. -.It Fl x Ar irq +.It Fl x Ar irq Specifies an irq as the target of the operation. .El .Sh EXIT STATUS Modified: stable/7/usr.bin/cpuset/cpuset.c ============================================================================== --- stable/7/usr.bin/cpuset/cpuset.c Tue May 19 20:23:32 2009 (r192408) +++ stable/7/usr.bin/cpuset/cpuset.c Tue May 19 22:07:54 2009 (r192409) @@ -2,6 +2,9 @@ * Copyright (c) 2007, 2008 Jeffrey Roberson * All rights reserved. * + * Copyright (c) 2008 Nokia 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: @@ -52,6 +55,7 @@ int pflag; int rflag; int sflag; int tflag; +int xflag; id_t id; cpulevel_t level; cpuwhich_t which; @@ -150,7 +154,7 @@ printset(cpuset_t *mask) printf("\n"); } -const char *whichnames[] = { NULL, "tid", "pid", "cpuset", "N/A", "jail" }; +const char *whichnames[] = { NULL, "tid", "pid", "cpuset", "irq", "jail" }; const char *levelnames[] = { NULL, " root", " cpuset", "" }; static void @@ -195,7 +199,7 @@ main(int argc, char *argv[]) level = CPU_LEVEL_WHICH; which = CPU_WHICH_PID; id = pid = tid = setid = -1; - while ((ch = getopt(argc, argv, "cgij:l:p:rs:t:")) != -1) { + while ((ch = getopt(argc, argv, "cgij:l:p:rs:t:x:")) != -1) { switch (ch) { case 'c': if (rflag) @@ -239,6 +243,11 @@ main(int argc, char *argv[]) which = CPU_WHICH_TID; id = tid = atoi(optarg); break; + case 'x': + xflag = 1; + which = CPU_WHICH_IRQ; + id = atoi(optarg); + break; default: usage(); } @@ -249,7 +258,7 @@ main(int argc, char *argv[]) if (argc || lflag) usage(); /* Only one identity specifier. */ - if (jflag + sflag + pflag + tflag > 1) + if (jflag + xflag + sflag + pflag + tflag > 1) usage(); if (iflag) printsetid(); @@ -263,7 +272,7 @@ main(int argc, char *argv[]) * The user wants to run a command with a set and possibly cpumask. */ if (argc) { - if (pflag | rflag | tflag | jflag) + if (pflag | rflag | tflag | xflag | jflag) usage(); if (sflag) { if (cpuset_setid(CPU_WHICH_PID, -1, setid)) @@ -289,7 +298,10 @@ main(int argc, char *argv[]) if (!lflag && !sflag) usage(); /* You can only set a mask on a thread. */ - if (tflag && (sflag | pflag | jflag)) + if (tflag && (sflag | pflag | xflag | jflag)) + usage(); + /* You can only set a mask on an irq. */ + if (xflag && (jflag | pflag | sflag | tflag)) usage(); if (pflag && sflag) { if (cpuset_setid(CPU_WHICH_PID, pid, setid)) @@ -319,8 +331,8 @@ usage(void) fprintf(stderr, " cpuset [-l cpu-list] [-s setid] -p pid\n"); fprintf(stderr, - " cpuset [-cr] [-l cpu-list] [-j jailid | -p pid | -t tid | -s setid]\n"); + " cpuset [-cr] [-l cpu-list] [-j jailid | -p pid | -t tid | -s setid | -x irq]\n"); fprintf(stderr, - " cpuset [-cgir] [-j jailid | -p pid | -t tid | -s setid]\n"); + " cpuset [-cgir] [-j jailid | -p pid | -t tid | -s setid | -x irq]\n"); exit(1); } From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 00:55:28 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CAA61065673; Wed, 20 May 2009 00:55:28 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E4BB8FC0A; Wed, 20 May 2009 00:55:26 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4K0tQVq014329; Wed, 20 May 2009 00:55:26 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4K0tQBK014328; Wed, 20 May 2009 00:55:26 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200905200055.n4K0tQBK014328@svn.freebsd.org> From: Hiroki Sato Date: Wed, 20 May 2009 00:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192411 - stable/7/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 00:55:29 -0000 Author: hrs Date: Wed May 20 00:55:26 2009 New Revision: 192411 URL: http://svn.freebsd.org/changeset/base/192411 Log: Document fxp(4) TSO issue on 7.2R. Submitted by: delphij Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Tue May 19 22:28:33 2009 (r192410) +++ stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml Wed May 20 00:55:26 2009 (r192411) @@ -183,6 +183,15 @@ Errata Notice to fix this problem is planned after the release. + [20090507] A bug was found in the &man.fxp.4; driver. This + would cause poor TCP performance when TSO is enabled, and the + receiver has a smaller MSS than the interface MTU setting. To + workaround this issue, one can disable TSO by using + &man.ifconfig.8; parameter (per interface + basis) or setting net.inet.tcp.tso to + 0 (globally on the system). An Errata Notice + to fix this problem is planned after the release. + Late-Breaking News and Corrections @@ -190,5 +199,10 @@ &man.malloc.3; implementation and threading library has been committed to the RELENG_7 branch for public testing. + + [20090507] A patch to solve the bug in the &man.fxp.4; + driver that caused poor TCP performance has been committed to + the RELENG_7 branch for public + testing. From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 02:13:02 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CD48106566B; Wed, 20 May 2009 02:13:02 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 390FC8FC0A; Wed, 20 May 2009 02:13:02 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4K2D2L0015874; Wed, 20 May 2009 02:13:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4K2D2V1015873; Wed, 20 May 2009 02:13:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200905200213.n4K2D2V1015873@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 20 May 2009 02:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192412 - in stable/7/sys: . contrib/pf dev/age dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 02:13:02 -0000 Author: yongari Date: Wed May 20 02:13:01 2009 New Revision: 192412 URL: http://svn.freebsd.org/changeset/base/192412 Log: MFC r190303: Fix inversed logic. pci_find_extcap() returns 0 when it finds specified capability. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/age/if_age.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Wed May 20 00:55:26 2009 (r192411) +++ stable/7/sys/dev/age/if_age.c Wed May 20 02:13:01 2009 (r192412) @@ -1369,7 +1369,7 @@ age_setwol(struct age_softc *sc) AGE_LOCK_ASSERT(sc); - if (pci_find_extcap(sc->age_dev, PCIY_PMG, &pmc) == 0) { + if (pci_find_extcap(sc->age_dev, PCIY_PMG, &pmc) != 0) { CSR_WRITE_4(sc, AGE_WOL_CFG, 0); /* * No PME capability, PHY power down. From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 02:18:27 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB149106564A; Wed, 20 May 2009 02:18:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5F588FC0C; Wed, 20 May 2009 02:18:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4K2IQFK016010; Wed, 20 May 2009 02:18:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4K2IQZ3016008; Wed, 20 May 2009 02:18:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200905200218.n4K2IQZ3016008@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 20 May 2009 02:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192413 - in stable/7/sys: . contrib/pf dev/age dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 02:18:28 -0000 Author: yongari Date: Wed May 20 02:18:26 2009 New Revision: 192413 URL: http://svn.freebsd.org/changeset/base/192413 Log: MFC r190499: o Don't access VPD even if hardware advertised the capability. It seems that some revision of controller hang while accessing the VPD. Because VPD access routine are unused, nuke it. o Let TWSI reload EEPROM if VPD capability is detected. Reloading EEPROM will also set ethernet address so age(4) now reads AGE_PAR0 and AGE_PAR1 register to get ethernet address. This removes a lot of hack and enhance readability a lot. o Double PHY reset timeout as it takes more time to take PHY out of power-saving state. o Explicitly check power-saving state by checking undocumented PHY registers. If link is not up, poke undocumented registers to take PHY out of power-saving state. This is the same way what Linux does. On resume, make sure to wake up PHY. o Don't rely on auto-clearing feature of master reset bit, just wait 1ms and check idle status of MAC. o Add PCI device revision information in bootverbose mode. This should fix occasional controller hang in device attach phase. Reported by: barbara < barbara.xxx1975 at libero DOT it > Tested by: barbara < barbara.xxx1975 at libero DOT it > Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/age/if_age.c stable/7/sys/dev/age/if_agereg.h stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Wed May 20 02:13:01 2009 (r192412) +++ stable/7/sys/dev/age/if_age.c Wed May 20 02:18:26 2009 (r192413) @@ -106,8 +106,6 @@ static int age_miibus_writereg(device_t, static void age_miibus_statchg(device_t); static void age_mediastatus(struct ifnet *, struct ifmediareq *); static int age_mediachange(struct ifnet *); -static int age_read_vpd_word(struct age_softc *, uint32_t, uint32_t, - uint32_t *); static int age_probe(device_t); static void age_get_macaddr(struct age_softc *); static void age_phy_reset(struct age_softc *); @@ -321,29 +319,6 @@ age_mediachange(struct ifnet *ifp) } static int -age_read_vpd_word(struct age_softc *sc, uint32_t vpdc, uint32_t offset, - uint32_t *word) -{ - int i; - - pci_write_config(sc->age_dev, vpdc + PCIR_VPD_ADDR, offset, 2); - for (i = AGE_TIMEOUT; i > 0; i--) { - DELAY(10); - if ((pci_read_config(sc->age_dev, vpdc + PCIR_VPD_ADDR, 2) & - 0x8000) == 0x8000) - break; - } - if (i == 0) { - device_printf(sc->age_dev, "VPD read timeout!\n"); - *word = 0; - return (ETIMEDOUT); - } - - *word = pci_read_config(sc->age_dev, vpdc + PCIR_VPD_DATA, 4); - return (0); -} - -static int age_probe(device_t dev) { struct age_dev *sp; @@ -368,8 +343,8 @@ age_probe(device_t dev) static void age_get_macaddr(struct age_softc *sc) { - uint32_t ea[2], off, reg, word; - int vpd_error, match, vpdc; + uint32_t ea[2], reg; + int i, vpdc; reg = CSR_READ_4(sc, AGE_SPI_CTRL); if ((reg & SPI_VPD_ENB) != 0) { @@ -378,123 +353,114 @@ age_get_macaddr(struct age_softc *sc) CSR_WRITE_4(sc, AGE_SPI_CTRL, reg); } - vpd_error = 0; - ea[0] = ea[1] = 0; - if ((vpd_error = pci_find_extcap(sc->age_dev, PCIY_VPD, &vpdc)) == 0) { + if (pci_find_extcap(sc->age_dev, PCIY_VPD, &vpdc) == 0) { /* - * PCI VPD capability exists, but it seems that it's - * not in the standard form as stated in PCI VPD - * specification such that driver could not use - * pci_get_vpd_readonly(9) with keyword 'NA'. - * Search VPD data starting at address 0x0100. The data - * should be used as initializers to set AGE_PAR0, - * AGE_PAR1 register including other PCI configuration - * registers. + * PCI VPD capability found, let TWSI reload EEPROM. + * This will set ethernet address of controller. */ - word = 0; - match = 0; - reg = 0; - for (off = AGE_VPD_REG_CONF_START; off < AGE_VPD_REG_CONF_END; - off += sizeof(uint32_t)) { - vpd_error = age_read_vpd_word(sc, vpdc, off, &word); - if (vpd_error != 0) - break; - if (match != 0) { - switch (reg) { - case AGE_PAR0: - ea[0] = word; - break; - case AGE_PAR1: - ea[1] = word; - break; - default: - break; - } - match = 0; - } else if ((word & 0xFF) == AGE_VPD_REG_CONF_SIG) { - match = 1; - reg = word >> 16; - } else + CSR_WRITE_4(sc, AGE_TWSI_CTRL, CSR_READ_4(sc, AGE_TWSI_CTRL) | + TWSI_CTRL_SW_LD_START); + for (i = 100; i > 0; i--) { + DELAY(1000); + reg = CSR_READ_4(sc, AGE_TWSI_CTRL); + if ((reg & TWSI_CTRL_SW_LD_START) == 0) break; } - if (off >= AGE_VPD_REG_CONF_END) - vpd_error = ENOENT; - if (vpd_error == 0) { - /* - * Don't blindly trust ethernet address obtained - * from VPD. Check whether ethernet address is - * valid one. Otherwise fall-back to reading - * PAR register. - */ - ea[1] &= 0xFFFF; - if ((ea[0] == 0 && ea[1] == 0) || - (ea[0] == 0xFFFFFFFF && ea[1] == 0xFFFF)) { - if (bootverbose) - device_printf(sc->age_dev, - "invalid ethernet address " - "returned from VPD.\n"); - vpd_error = EINVAL; - } - } - if (vpd_error != 0 && (bootverbose)) - device_printf(sc->age_dev, "VPD access failure!\n"); + if (i == 0) + device_printf(sc->age_dev, + "reloading EEPROM timeout!\n"); } else { if (bootverbose) device_printf(sc->age_dev, "PCI VPD capability not found!\n"); } - /* - * It seems that L1 also provides a way to extract ethernet - * address via SPI flash interface. Because SPI flash memory - * device of different vendors vary in their instruction - * codes for read ID instruction, it's very hard to get - * instructions codes without detailed information for the - * flash memory device used on ethernet controller. To simplify - * code, just read AGE_PAR0/AGE_PAR1 register to get ethernet - * address which is supposed to be set by hardware during - * power on reset. - */ - if (vpd_error != 0) { - /* - * VPD is mapped to SPI flash memory or BIOS set it. - */ - ea[0] = CSR_READ_4(sc, AGE_PAR0); - ea[1] = CSR_READ_4(sc, AGE_PAR1); - } - - ea[1] &= 0xFFFF; - if ((ea[0] == 0 && ea[1] == 0) || - (ea[0] == 0xFFFFFFFF && ea[1] == 0xFFFF)) { - device_printf(sc->age_dev, - "generating fake ethernet address.\n"); - ea[0] = arc4random(); - /* Set OUI to ASUSTek COMPUTER INC. */ - sc->age_eaddr[0] = 0x00; - sc->age_eaddr[1] = 0x1B; - sc->age_eaddr[2] = 0xFC; - sc->age_eaddr[3] = (ea[0] >> 16) & 0xFF; - sc->age_eaddr[4] = (ea[0] >> 8) & 0xFF; - sc->age_eaddr[5] = (ea[0] >> 0) & 0xFF; - } else { - sc->age_eaddr[0] = (ea[1] >> 8) & 0xFF; - sc->age_eaddr[1] = (ea[1] >> 0) & 0xFF; - sc->age_eaddr[2] = (ea[0] >> 24) & 0xFF; - sc->age_eaddr[3] = (ea[0] >> 16) & 0xFF; - sc->age_eaddr[4] = (ea[0] >> 8) & 0xFF; - sc->age_eaddr[5] = (ea[0] >> 0) & 0xFF; - } + ea[0] = CSR_READ_4(sc, AGE_PAR0); + ea[1] = CSR_READ_4(sc, AGE_PAR1); + sc->age_eaddr[0] = (ea[1] >> 8) & 0xFF; + sc->age_eaddr[1] = (ea[1] >> 0) & 0xFF; + sc->age_eaddr[2] = (ea[0] >> 24) & 0xFF; + sc->age_eaddr[3] = (ea[0] >> 16) & 0xFF; + sc->age_eaddr[4] = (ea[0] >> 8) & 0xFF; + sc->age_eaddr[5] = (ea[0] >> 0) & 0xFF; } static void age_phy_reset(struct age_softc *sc) { + uint16_t reg, pn; + int i, linkup; /* Reset PHY. */ CSR_WRITE_4(sc, AGE_GPHY_CTRL, GPHY_CTRL_RST); - DELAY(1000); + DELAY(2000); CSR_WRITE_4(sc, AGE_GPHY_CTRL, GPHY_CTRL_CLR); - DELAY(1000); + DELAY(2000); + +#define ATPHY_DBG_ADDR 0x1D +#define ATPHY_DBG_DATA 0x1E +#define ATPHY_CDTC 0x16 +#define PHY_CDTC_ENB 0x0001 +#define PHY_CDTC_POFF 8 +#define ATPHY_CDTS 0x1C +#define PHY_CDTS_STAT_OK 0x0000 +#define PHY_CDTS_STAT_SHORT 0x0100 +#define PHY_CDTS_STAT_OPEN 0x0200 +#define PHY_CDTS_STAT_INVAL 0x0300 +#define PHY_CDTS_STAT_MASK 0x0300 + + /* Check power saving mode. Magic from Linux. */ + age_miibus_writereg(sc->age_dev, sc->age_phyaddr, MII_BMCR, BMCR_RESET); + for (linkup = 0, pn = 0; pn < 4; pn++) { + age_miibus_writereg(sc->age_dev, sc->age_phyaddr, ATPHY_CDTC, + (pn << PHY_CDTC_POFF) | PHY_CDTC_ENB); + for (i = 200; i > 0; i--) { + DELAY(1000); + reg = age_miibus_readreg(sc->age_dev, sc->age_phyaddr, + ATPHY_CDTC); + if ((reg & PHY_CDTC_ENB) == 0) + break; + } + DELAY(1000); + reg = age_miibus_readreg(sc->age_dev, sc->age_phyaddr, + ATPHY_CDTS); + if ((reg & PHY_CDTS_STAT_MASK) != PHY_CDTS_STAT_OPEN) { + linkup++; + break; + } + } + age_miibus_writereg(sc->age_dev, sc->age_phyaddr, MII_BMCR, + BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); + if (linkup == 0) { + age_miibus_writereg(sc->age_dev, sc->age_phyaddr, + ATPHY_DBG_ADDR, 0); + age_miibus_writereg(sc->age_dev, sc->age_phyaddr, + ATPHY_DBG_DATA, 0x124E); + age_miibus_writereg(sc->age_dev, sc->age_phyaddr, + ATPHY_DBG_ADDR, 1); + reg = age_miibus_readreg(sc->age_dev, sc->age_phyaddr, + ATPHY_DBG_DATA); + age_miibus_writereg(sc->age_dev, sc->age_phyaddr, + ATPHY_DBG_DATA, reg | 0x03); + /* XXX */ + DELAY(1500 * 1000); + age_miibus_writereg(sc->age_dev, sc->age_phyaddr, + ATPHY_DBG_ADDR, 0); + age_miibus_writereg(sc->age_dev, sc->age_phyaddr, + ATPHY_DBG_DATA, 0x024E); + } + +#undef ATPHY_DBG_ADDR +#undef ATPHY_DBG_DATA +#undef ATPHY_CDTC +#undef PHY_CDTC_ENB +#undef PHY_CDTC_POFF +#undef ATPHY_CDTS +#undef PHY_CDTS_STAT_OK +#undef PHY_CDTS_STAT_SHORT +#undef PHY_CDTS_STAT_OPEN +#undef PHY_CDTS_STAT_INVAL +#undef PHY_CDTS_STAT_MASK } static int @@ -539,7 +505,8 @@ age_attach(device_t dev) sc->age_chip_rev = CSR_READ_4(sc, AGE_MASTER_CFG) >> MASTER_CHIP_REV_SHIFT; if (bootverbose) { - device_printf(dev, "PCI device revision : 0x%04x\n", sc->age_rev); + device_printf(dev, "PCI device revision : 0x%04x\n", + sc->age_rev); device_printf(dev, "Chip id/revision : 0x%04x\n", sc->age_chip_rev); } @@ -1524,6 +1491,9 @@ age_resume(device_t dev) cmd &= ~0x0400; pci_write_config(sc->age_dev, PCIR_COMMAND, cmd, 2); } + AGE_UNLOCK(sc); + age_phy_reset(sc); + AGE_LOCK(sc); ifp = sc->age_ifp; if ((ifp->if_flags & IFF_UP) != 0) age_init_locked(sc); @@ -2544,14 +2514,8 @@ age_reset(struct age_softc *sc) int i; CSR_WRITE_4(sc, AGE_MASTER_CFG, MASTER_RESET); - for (i = AGE_RESET_TIMEOUT; i > 0; i--) { - DELAY(1); - if ((CSR_READ_4(sc, AGE_MASTER_CFG) & MASTER_RESET) == 0) - break; - } - if (i == 0) - device_printf(sc->age_dev, "master reset timeout!\n"); - + CSR_READ_4(sc, AGE_MASTER_CFG); + DELAY(1000); for (i = AGE_RESET_TIMEOUT; i > 0; i--) { if ((reg = CSR_READ_4(sc, AGE_IDLE_STATUS)) == 0) break; Modified: stable/7/sys/dev/age/if_agereg.h ============================================================================== --- stable/7/sys/dev/age/if_agereg.h Wed May 20 02:13:01 2009 (r192412) +++ stable/7/sys/dev/age/if_agereg.h Wed May 20 02:18:26 2009 (r192413) @@ -91,6 +91,9 @@ #define AGE_SPI_OP_READ 0x217 /* 8bits */ #define AGE_TWSI_CTRL 0x218 +#define TWSI_CTRL_SW_LD_START 0x00000800 +#define TWSI_CTRL_HW_LD_START 0x00001000 +#define TWSI_CTRL_LD_EXIST 0x00400000 #define AGE_DEV_MISC_CTRL 0x21C From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 02:24:10 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 077BF106566C; Wed, 20 May 2009 02:24:10 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E71818FC16; Wed, 20 May 2009 02:24:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4K2O9nM016224; Wed, 20 May 2009 02:24:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4K2O9LQ016223; Wed, 20 May 2009 02:24:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200905200224.n4K2O9LQ016223@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 20 May 2009 02:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192414 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sk X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 02:24:10 -0000 Author: yongari Date: Wed May 20 02:24:09 2009 New Revision: 192414 URL: http://svn.freebsd.org/changeset/base/192414 Log: MFC r191716: Separate multicast filtering of SysKonnect GENESIS and Marvell Yukon from common multicast handling code. Yukon uses hash-based multicast filtering(big endian form) but GENESIS uses perfect multicast filtering as well as hash-based one(little endian form). Due to the differences of multicast filtering there is no much sense to have a common code. o Remove sk_setmulti() and introduce sk_rxfilter_yukon(), sk_rxfilter_yukon() that handles multicast filtering setup. o Have sk_rxfilter_{yukon, genesis} handle promiscuous mode and nuke sk_setpromisc(). This simplifies ioctl handler as well as giving a chance to check validity of Rx control register of Yukon. o Don't reinitialize controller when IFF_ALLMULTI flags is changed. o Nuke sk_gmchash(), it's not needed anymore. o Always reconfigure Rx control register whenever a new multicast filtering condition is changed. This fixes multicast filtering setup on Yukon. PR: kern/134051 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sk/if_sk.c Modified: stable/7/sys/dev/sk/if_sk.c ============================================================================== --- stable/7/sys/dev/sk/if_sk.c Wed May 20 02:18:26 2009 (r192413) +++ stable/7/sys/dev/sk/if_sk.c Wed May 20 02:24:09 2009 (r192414) @@ -255,10 +255,10 @@ static int sk_marv_miibus_writereg(struc static void sk_marv_miibus_statchg(struct sk_if_softc *); static uint32_t sk_xmchash(const uint8_t *); -static uint32_t sk_gmchash(const uint8_t *); static void sk_setfilt(struct sk_if_softc *, u_int16_t *, int); -static void sk_setmulti(struct sk_if_softc *); -static void sk_setpromisc(struct sk_if_softc *); +static void sk_rxfilter(struct sk_if_softc *); +static void sk_rxfilter_genesis(struct sk_if_softc *); +static void sk_rxfilter_yukon(struct sk_if_softc *); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high); static int sysctl_hw_sk_int_mod(SYSCTL_HANDLER_ARGS); @@ -697,19 +697,6 @@ sk_xmchash(addr) return (~crc & ((1 << HASH_BITS) - 1)); } -/* gmchash is just a big endian crc */ -static u_int32_t -sk_gmchash(addr) - const uint8_t *addr; -{ - uint32_t crc; - - /* Compute CRC for the address value. */ - crc = ether_crc32_be(addr, ETHER_ADDR_LEN); - - return (crc & ((1 << HASH_BITS) - 1)); -} - static void sk_setfilt(sc_if, addr, slot) struct sk_if_softc *sc_if; @@ -728,12 +715,26 @@ sk_setfilt(sc_if, addr, slot) } static void -sk_setmulti(sc_if) +sk_rxfilter(sc_if) + struct sk_if_softc *sc_if; +{ + struct sk_softc *sc; + + SK_IF_LOCK_ASSERT(sc_if); + + sc = sc_if->sk_softc; + if (sc->sk_type == SK_GENESIS) + sk_rxfilter_genesis(sc_if); + else + sk_rxfilter_yukon(sc_if); +} + +static void +sk_rxfilter_genesis(sc_if) struct sk_if_softc *sc_if; { - struct sk_softc *sc = sc_if->sk_softc; struct ifnet *ifp = sc_if->sk_ifp; - u_int32_t hashes[2] = { 0, 0 }; + u_int32_t hashes[2] = { 0, 0 }, mode; int h = 0, i; struct ifmultiaddr *ifma; u_int16_t dummy[] = { 0, 0, 0 }; @@ -741,124 +742,96 @@ sk_setmulti(sc_if) SK_IF_LOCK_ASSERT(sc_if); - /* First, zot all the existing filters. */ - switch(sc->sk_type) { - case SK_GENESIS: - for (i = 1; i < XM_RXFILT_MAX; i++) - sk_setfilt(sc_if, dummy, i); - - SK_XM_WRITE_4(sc_if, XM_MAR0, 0); - SK_XM_WRITE_4(sc_if, XM_MAR2, 0); - break; - case SK_YUKON: - case SK_YUKON_LITE: - case SK_YUKON_LP: - SK_YU_WRITE_2(sc_if, YUKON_MCAH1, 0); - SK_YU_WRITE_2(sc_if, YUKON_MCAH2, 0); - SK_YU_WRITE_2(sc_if, YUKON_MCAH3, 0); - SK_YU_WRITE_2(sc_if, YUKON_MCAH4, 0); - break; - } + mode = SK_XM_READ_4(sc_if, XM_MODE); + mode &= ~(XM_MODE_RX_PROMISC | XM_MODE_RX_USE_HASH | + XM_MODE_RX_USE_PERFECT); + /* First, zot all the existing perfect filters. */ + for (i = 1; i < XM_RXFILT_MAX; i++) + sk_setfilt(sc_if, dummy, i); /* Now program new ones. */ if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { + if (ifp->if_flags & IFF_ALLMULTI) + mode |= XM_MODE_RX_USE_HASH; + if (ifp->if_flags & IFF_PROMISC) + mode |= XM_MODE_RX_PROMISC; hashes[0] = 0xFFFFFFFF; hashes[1] = 0xFFFFFFFF; } else { i = 1; IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) { + TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, + ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; /* * Program the first XM_RXFILT_MAX multicast groups - * into the perfect filter. For all others, - * use the hash table. + * into the perfect filter. */ - if (sc->sk_type == SK_GENESIS && i < XM_RXFILT_MAX) { - bcopy(LLADDR( - (struct sockaddr_dl *)ifma->ifma_addr), - maddr, ETHER_ADDR_LEN); + bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), + maddr, ETHER_ADDR_LEN); + if (i < XM_RXFILT_MAX) { sk_setfilt(sc_if, maddr, i); + mode |= XM_MODE_RX_USE_PERFECT; i++; continue; } - - switch(sc->sk_type) { - case SK_GENESIS: - bcopy(LLADDR( - (struct sockaddr_dl *)ifma->ifma_addr), - maddr, ETHER_ADDR_LEN); - h = sk_xmchash((const uint8_t *)maddr); - break; - case SK_YUKON: - case SK_YUKON_LITE: - case SK_YUKON_LP: - bcopy(LLADDR( - (struct sockaddr_dl *)ifma->ifma_addr), - maddr, ETHER_ADDR_LEN); - h = sk_gmchash((const uint8_t *)maddr); - break; - } + h = sk_xmchash((const uint8_t *)maddr); if (h < 32) hashes[0] |= (1 << h); else hashes[1] |= (1 << (h - 32)); + mode |= XM_MODE_RX_USE_HASH; } IF_ADDR_UNLOCK(ifp); } - switch(sc->sk_type) { - case SK_GENESIS: - SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_USE_HASH| - XM_MODE_RX_USE_PERFECT); - SK_XM_WRITE_4(sc_if, XM_MAR0, hashes[0]); - SK_XM_WRITE_4(sc_if, XM_MAR2, hashes[1]); - break; - case SK_YUKON: - case SK_YUKON_LITE: - case SK_YUKON_LP: - SK_YU_WRITE_2(sc_if, YUKON_MCAH1, hashes[0] & 0xffff); - SK_YU_WRITE_2(sc_if, YUKON_MCAH2, (hashes[0] >> 16) & 0xffff); - SK_YU_WRITE_2(sc_if, YUKON_MCAH3, hashes[1] & 0xffff); - SK_YU_WRITE_2(sc_if, YUKON_MCAH4, (hashes[1] >> 16) & 0xffff); - break; - } - - return; + SK_XM_WRITE_4(sc_if, XM_MODE, mode); + SK_XM_WRITE_4(sc_if, XM_MAR0, hashes[0]); + SK_XM_WRITE_4(sc_if, XM_MAR2, hashes[1]); } static void -sk_setpromisc(sc_if) +sk_rxfilter_yukon(sc_if) struct sk_if_softc *sc_if; { - struct sk_softc *sc = sc_if->sk_softc; - struct ifnet *ifp = sc_if->sk_ifp; + struct ifnet *ifp; + u_int32_t crc, hashes[2] = { 0, 0 }, mode; + struct ifmultiaddr *ifma; SK_IF_LOCK_ASSERT(sc_if); - switch(sc->sk_type) { - case SK_GENESIS: - if (ifp->if_flags & IFF_PROMISC) { - SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_PROMISC); - } else { - SK_XM_CLRBIT_4(sc_if, XM_MODE, XM_MODE_RX_PROMISC); - } - break; - case SK_YUKON: - case SK_YUKON_LITE: - case SK_YUKON_LP: - if (ifp->if_flags & IFF_PROMISC) { - SK_YU_CLRBIT_2(sc_if, YUKON_RCR, - YU_RCR_UFLEN | YU_RCR_MUFLEN); - } else { - SK_YU_SETBIT_2(sc_if, YUKON_RCR, - YU_RCR_UFLEN | YU_RCR_MUFLEN); + ifp = sc_if->sk_ifp; + mode = SK_YU_READ_2(sc_if, YUKON_RCR); + if (ifp->if_flags & IFF_PROMISC) + mode &= ~(YU_RCR_UFLEN | YU_RCR_MUFLEN); + else if (ifp->if_flags & IFF_ALLMULTI) { + mode |= YU_RCR_UFLEN | YU_RCR_MUFLEN; + hashes[0] = 0xFFFFFFFF; + hashes[1] = 0xFFFFFFFF; + } else { + mode |= YU_RCR_UFLEN; + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN); + /* Just want the 6 least significant bits. */ + crc &= 0x3f; + /* Set the corresponding bit in the hash table. */ + hashes[crc >> 5] |= 1 << (crc & 0x1f); } - break; + IF_ADDR_UNLOCK(ifp); + if (hashes[0] != 0 || hashes[1] != 0) + mode |= YU_RCR_MUFLEN; } - return; + SK_YU_WRITE_2(sc_if, YUKON_MCAH1, hashes[0] & 0xffff); + SK_YU_WRITE_2(sc_if, YUKON_MCAH2, (hashes[0] >> 16) & 0xffff); + SK_YU_WRITE_2(sc_if, YUKON_MCAH3, hashes[1] & 0xffff); + SK_YU_WRITE_2(sc_if, YUKON_MCAH4, (hashes[1] >> 16) & 0xffff); + SK_YU_WRITE_2(sc_if, YUKON_RCR, mode); } static int @@ -1166,10 +1139,8 @@ sk_ioctl(ifp, command, data) if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if ((ifp->if_flags ^ sc_if->sk_if_flags) - & IFF_PROMISC) { - sk_setpromisc(sc_if); - sk_setmulti(sc_if); - } + & (IFF_PROMISC | IFF_ALLMULTI)) + sk_rxfilter(sc_if); } else sk_init_locked(sc_if); } else { @@ -1183,7 +1154,7 @@ sk_ioctl(ifp, command, data) case SIOCDELMULTI: SK_IF_LOCK(sc_if); if (ifp->if_drv_flags & IFF_DRV_RUNNING) - sk_setmulti(sc_if); + sk_rxfilter(sc_if); SK_IF_UNLOCK(sc_if); break; case SIOCGIFMEDIA: @@ -3302,11 +3273,8 @@ sk_init_xmac(sc_if) */ SK_XM_WRITE_2(sc_if, XM_TX_REQTHRESH, SK_XM_TX_FIFOTHRESH); - /* Set promiscuous mode */ - sk_setpromisc(sc_if); - - /* Set multicast filter */ - sk_setmulti(sc_if); + /* Set Rx filter */ + sk_rxfilter_genesis(sc_if); /* Clear and enable interrupts */ SK_XM_READ_2(sc_if, XM_ISR); @@ -3447,11 +3415,8 @@ sk_init_yukon(sc_if) SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, reg); } - /* Set promiscuous mode */ - sk_setpromisc(sc_if); - - /* Set multicast filter */ - sk_setmulti(sc_if); + /* Set Rx filter */ + sk_rxfilter_yukon(sc_if); /* enable interrupt mask for counter overflows */ SK_YU_WRITE_2(sc_if, YUKON_TIMR, 0); From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 02:48:54 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9119106566C; Wed, 20 May 2009 02:48:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5A048FC1A; Wed, 20 May 2009 02:48:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4K2mr48016737; Wed, 20 May 2009 02:48:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4K2mrKF016736; Wed, 20 May 2009 02:48:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200905200248.n4K2mrKF016736@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 May 2009 02:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192415 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netgraph/netflow X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 02:48:54 -0000 Author: mav Date: Wed May 20 02:48:53 2009 New Revision: 192415 URL: http://svn.freebsd.org/changeset/base/192415 Log: MFC rev. 192032 Fix copy-paste bug in NGM_NETFLOW_SETCONFIG argument size verification. PR: kern/134220 Submitted by: Eugene Mychlo Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netgraph/netflow/ng_netflow.c Modified: stable/7/sys/netgraph/netflow/ng_netflow.c ============================================================================== --- stable/7/sys/netgraph/netflow/ng_netflow.c Wed May 20 02:24:09 2009 (r192414) +++ stable/7/sys/netgraph/netflow/ng_netflow.c Wed May 20 02:48:53 2009 (r192415) @@ -422,7 +422,7 @@ ng_netflow_rcvmsg (node_p node, item_p i { struct ng_netflow_setconfig *set; - if (msg->header.arglen != sizeof(struct ng_netflow_settimeouts)) + if (msg->header.arglen != sizeof(struct ng_netflow_setconfig)) ERROUT(EINVAL); set = (struct ng_netflow_setconfig *)msg->data; From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 03:28:35 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC4E1106566B; Wed, 20 May 2009 03:28:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8CCF8FC0A; Wed, 20 May 2009 03:28:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4K3SZHV017809; Wed, 20 May 2009 03:28:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4K3SZRF017808; Wed, 20 May 2009 03:28:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200905200328.n4K3SZRF017808@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 20 May 2009 03:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192417 - in stable/7/sys: . contrib/pf dev/ale dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 03:28:36 -0000 Author: yongari Date: Wed May 20 03:28:35 2009 New Revision: 192417 URL: http://svn.freebsd.org/changeset/base/192417 Log: MFC r189379: Now pci(4) handles PCIM_CMD_INTxDIS so there is no need to poke this bit in driver. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ale/if_ale.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/ale/if_ale.c ============================================================================== --- stable/7/sys/dev/ale/if_ale.c Wed May 20 02:51:48 2009 (r192416) +++ stable/7/sys/dev/ale/if_ale.c Wed May 20 03:28:35 2009 (r192417) @@ -1543,20 +1543,11 @@ ale_resume(device_t dev) struct ale_softc *sc; struct ifnet *ifp; int pmc; - uint16_t cmd, pmstat; + uint16_t pmstat; sc = device_get_softc(dev); ALE_LOCK(sc); - /* - * Clear INTx emulation disable for hardwares that - * is set in resume event. From Linux. - */ - cmd = pci_read_config(sc->ale_dev, PCIR_COMMAND, 2); - if ((cmd & 0x0400) != 0) { - cmd &= ~0x0400; - pci_write_config(sc->ale_dev, PCIR_COMMAND, cmd, 2); - } if (pci_find_extcap(sc->ale_dev, PCIY_PMG, &pmc) == 0) { /* Disable PME and clear PME status. */ pmstat = pci_read_config(sc->ale_dev, From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 10:04:19 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E9B0106566B; Wed, 20 May 2009 10:04:19 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5040A8FC14; Wed, 20 May 2009 10:04:19 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KA4HqK026601; Wed, 20 May 2009 10:04:17 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KA4HZu026600; Wed, 20 May 2009 10:04:17 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200905201004.n4KA4HZu026600@svn.freebsd.org> From: Christian Brueffer Date: Wed, 20 May 2009 10:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192434 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 10:04:20 -0000 Author: brueffer Date: Wed May 20 10:04:17 2009 New Revision: 192434 URL: http://svn.freebsd.org/changeset/base/192434 Log: MFC: r192220 Sync up to rev. 1.25 from OpenBSD: 1.19: nop 1.20: nop 1.21: nop 1.22: typo fixed 1.23: license clauses 3 and 4 nuked 1.24: nop 1.25: Sun Crypto Accelerator 1000 has a 5821 chip on it Obtained from: OpenBSD Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/igb.4 (props changed) stable/7/share/man/man4/ubsec.4 Modified: stable/7/share/man/man4/ubsec.4 ============================================================================== --- stable/7/share/man/man4/ubsec.4 Wed May 20 09:44:32 2009 (r192433) +++ stable/7/share/man/man4/ubsec.4 Wed May 20 10:04:17 2009 (r192434) @@ -1,4 +1,4 @@ -.\" $OpenBSD: ubsec.4,v 1.18 2002/09/26 07:55:41 miod Exp $ +.\" $OpenBSD: ubsec.4,v 1.25 2003/08/12 19:42:46 jason Exp $ .\" .\" Copyright (c) 2000 Jason L. Wright (jason@thought.net) .\" All rights reserved. @@ -11,11 +11,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Jason L. Wright -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -31,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2006 +.Dd May 16, 2009 .Dt UBSEC 4 .Os .Sh NAME @@ -84,7 +79,7 @@ driver supports cards containing any of .It Bluesteel 5501 The original chipset, no longer made. This extremely rare unit -was not very fast, lacked a RNG, and had a number of other bugs. +was not very fast, lacked an RNG, and had a number of other bugs. .It Bluesteel 5601 A faster and fixed version of the original, with a random number unit and large number engine added. @@ -98,6 +93,7 @@ Faster version of Bluesteel 5601. 64 bit version of the chip, and significantly more advanced. .It Broadcom BCM5821 Faster version of the BCM5820. +This is the chip found on the Sun Crypto Accelerator 1000. .It Broadcom BCM5822 Faster version of the BCM5820. .It Broadcom BCM5823 From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 10:05:45 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30D7F1065676; Wed, 20 May 2009 10:05:45 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CAE08FC29; Wed, 20 May 2009 10:05:45 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KA5jFV026691; Wed, 20 May 2009 10:05:45 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KA5jQm026690; Wed, 20 May 2009 10:05:45 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200905201005.n4KA5jQm026690@svn.freebsd.org> From: Christian Brueffer Date: Wed, 20 May 2009 10:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192435 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 10:05:46 -0000 Author: brueffer Date: Wed May 20 10:05:44 2009 New Revision: 192435 URL: http://svn.freebsd.org/changeset/base/192435 Log: MFC: r192228 Drop clause 3 of the license as per rev. 1.35 from OpenBSD. Obtained from: OpenBSD Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/hifn.4 stable/7/share/man/man4/igb.4 (props changed) Modified: stable/7/share/man/man4/hifn.4 ============================================================================== --- stable/7/share/man/man4/hifn.4 Wed May 20 10:04:17 2009 (r192434) +++ stable/7/share/man/man4/hifn.4 Wed May 20 10:05:44 2009 (r192435) @@ -11,8 +11,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 10:07:20 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3241065670; Wed, 20 May 2009 10:07:20 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A65588FC13; Wed, 20 May 2009 10:07:20 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KA7K7i026769; Wed, 20 May 2009 10:07:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KA7KiJ026768; Wed, 20 May 2009 10:07:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200905201007.n4KA7KiJ026768@svn.freebsd.org> From: Christian Brueffer Date: Wed, 20 May 2009 10:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192436 - stable/7/share/man/man9 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 10:07:21 -0000 Author: brueffer Date: Wed May 20 10:07:20 2009 New Revision: 192436 URL: http://svn.freebsd.org/changeset/base/192436 Log: MFC: r192265 Document sbuf_new_auto(). While here, add a missing `-' in phk's name. Modified: stable/7/share/man/man9/ (props changed) stable/7/share/man/man9/sbuf.9 Modified: stable/7/share/man/man9/sbuf.9 ============================================================================== --- stable/7/share/man/man9/sbuf.9 Wed May 20 10:05:44 2009 (r192435) +++ stable/7/share/man/man9/sbuf.9 Wed May 20 10:07:20 2009 (r192436) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000 Poul Henning Kamp and Dag-Erling Coïdan Smørgrav +.\" Copyright (c) 2000 Poul-Henning Kamp and Dag-Erling Coïdan Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,12 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2004 +.Dd May 17, 2009 .Dt SBUF 9 .Os .Sh NAME .Nm sbuf , .Nm sbuf_new , +.Nm sbuf_new_auto , .Nm sbuf_clear , .Nm sbuf_setpos , .Nm sbuf_bcat , @@ -55,6 +56,8 @@ .In sys/sbuf.h .Ft struct sbuf * .Fn sbuf_new "struct sbuf *s" "char *buf" "int length" "int flags" +.Ft struct sbuf * +.Fn sbuf_new_auto .Ft void .Fn sbuf_clear "struct sbuf *s" .Ft int @@ -148,6 +151,19 @@ The result of accessing that array direc sbuf is undefined. .Pp The +.Fn sbuf_new_auto +function is a shortcut for creating a completely dynamic +.Nm . +It is the equivalent of calling +.Fn sbuf_new +with values +.Dv NULL , +.Dv NULL , +.Dv 0 , +and +.Dv SBUF_AUTOEXTEND . +.Pp +The .Fn sbuf_delete function clears the .Fa sbuf From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 20:02:41 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5202C106566B; Wed, 20 May 2009 20:02:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F5848FC15; Wed, 20 May 2009 20:02:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KK2fus042178; Wed, 20 May 2009 20:02:41 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KK2fQE042177; Wed, 20 May 2009 20:02:41 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202002.n4KK2fQE042177@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 20:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192469 - stable/7/sys/amd64/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 20:02:42 -0000 Author: kmacy Date: Wed May 20 20:02:40 2009 New Revision: 192469 URL: http://svn.freebsd.org/changeset/base/192469 Log: increase kmem map to 512GB discussed with: alc Modified: stable/7/sys/amd64/include/vmparam.h Modified: stable/7/sys/amd64/include/vmparam.h ============================================================================== --- stable/7/sys/amd64/include/vmparam.h Wed May 20 20:00:40 2009 (r192468) +++ stable/7/sys/amd64/include/vmparam.h Wed May 20 20:02:40 2009 (r192469) @@ -154,8 +154,7 @@ * 0xffff800000000000 - 0xffff804020100fff recursive page table (512GB slot) * 0xffff804020101000 - 0xfffffeffffffffff unused * 0xffffff0000000000 - 0xffffff7fffffffff 512GB direct map mappings - * 0xffffff8000000000 - 0xfffffffe7fffffff unused (506GB) - * 0xfffffffe80000000 - 0xffffffffffffffff 6GB kernel map + * 0xffffff8000000000 - 0xffffffffffffffff 512GB kernel map * * Within the kernel map: * @@ -163,7 +162,7 @@ */ #define VM_MAX_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-1, NPDEPG-1, NPTEPG-1) -#define VM_MIN_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-6, 0, 0) +#define VM_MIN_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-512, 0, 0) #define DMAP_MIN_ADDRESS KVADDR(DMPML4I, 0, 0, 0) #define DMAP_MAX_ADDRESS KVADDR(DMPML4I+1, 0, 0, 0) From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 20:08:51 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 903D8106566B; Wed, 20 May 2009 20:08:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 643588FC0A; Wed, 20 May 2009 20:08:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KK8p1u042357; Wed, 20 May 2009 20:08:51 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KK8p2E042355; Wed, 20 May 2009 20:08:51 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202008.n4KK8p2E042355@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 20:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192471 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 20:08:52 -0000 Author: kmacy Date: Wed May 20 20:08:51 2009 New Revision: 192471 URL: http://svn.freebsd.org/changeset/base/192471 Log: MFC NDINIT macros without changing the size of nameidata Modified: stable/7/sys/sys/fcntl.h stable/7/sys/sys/namei.h Modified: stable/7/sys/sys/fcntl.h ============================================================================== --- stable/7/sys/sys/fcntl.h Wed May 20 20:05:56 2009 (r192470) +++ stable/7/sys/sys/fcntl.h Wed May 20 20:08:51 2009 (r192471) @@ -105,6 +105,12 @@ typedef __pid_t pid_t; #ifdef _KERNEL #define FHASLOCK 0x4000 /* descriptor holds advisory lock */ #endif +/* + * Magic value that specify the use of the current working directory + * to determine the target of relative file paths in the openat() and + * similar syscalls. + */ +#define AT_FDCWD -100 /* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */ #define O_NOCTTY 0x8000 /* don't assign controlling terminal */ Modified: stable/7/sys/sys/namei.h ============================================================================== --- stable/7/sys/sys/namei.h Wed May 20 20:05:56 2009 (r192470) +++ stable/7/sys/sys/namei.h Wed May 20 20:08:51 2009 (r192471) @@ -86,6 +86,9 @@ struct nameidata { * through the VOP interface. */ struct componentname ni_cnd; +#ifdef notyet + int ni_dirfd; /* starting directory for *at functions */ +#endif }; #ifdef _KERNEL @@ -148,20 +151,31 @@ struct nameidata { /* * Initialization of a nameidata structure. */ -static void NDINIT(struct nameidata *, u_long, u_long, enum uio_seg, - const char *, struct thread *); +#define NDINIT(ndp, op, flags, segflg, namep, td) \ + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, td) +#define NDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td) \ + NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, td) +#define NDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td) \ + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, td) + static __inline void -NDINIT(struct nameidata *ndp, +NDINIT_ALL(struct nameidata *ndp, u_long op, u_long flags, enum uio_seg segflg, const char *namep, + int dirfd, + struct vnode *startdir, struct thread *td) { ndp->ni_cnd.cn_nameiop = op; ndp->ni_cnd.cn_flags = flags; ndp->ni_segflg = segflg; ndp->ni_dirp = namep; + ndp->ni_startdir = startdir; ndp->ni_cnd.cn_thread = td; +#ifdef notyet + ndp->ni_dirfd = dirfd; +#endif } #define NDF_NO_DVP_RELE 0x00000001 From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 20:57:40 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98F8E10656AD; Wed, 20 May 2009 20:57:40 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CC1B8FC19; Wed, 20 May 2009 20:57:40 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KKveCX043467; Wed, 20 May 2009 20:57:40 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KKvex0043466; Wed, 20 May 2009 20:57:40 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202057.n4KKvex0043466@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 20:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192474 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 20:57:41 -0000 Author: kmacy Date: Wed May 20 20:57:40 2009 New Revision: 192474 URL: http://svn.freebsd.org/changeset/base/192474 Log: include fcntl.h to define AT_FDCWD Modified: stable/7/sys/sys/namei.h Modified: stable/7/sys/sys/namei.h ============================================================================== --- stable/7/sys/sys/namei.h Wed May 20 20:18:01 2009 (r192473) +++ stable/7/sys/sys/namei.h Wed May 20 20:57:40 2009 (r192474) @@ -92,6 +92,8 @@ struct nameidata { }; #ifdef _KERNEL +#include + /* * namei operations */ From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 21:04:42 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9C9B1065676; Wed, 20 May 2009 21:04:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1CCE8FC13; Wed, 20 May 2009 21:04:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KL4fBl043662; Wed, 20 May 2009 21:04:41 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KL4fOc043655; Wed, 20 May 2009 21:04:41 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202104.n4KL4fOc043655@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 21:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192475 - in stable/7/sys: conf kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 21:04:42 -0000 Author: kmacy Date: Wed May 20 21:04:41 2009 New Revision: 192475 URL: http://svn.freebsd.org/changeset/base/192475 Log: - MFC "object specific data" support with rmlocks replaced with rwlocks - ZFS MFC dependency Added: stable/7/sys/kern/kern_osd.c (contents, props changed) stable/7/sys/sys/osd.h (contents, props changed) Modified: stable/7/sys/conf/files stable/7/sys/kern/kern_proc.c stable/7/sys/kern/kern_thread.c stable/7/sys/sys/jail.h stable/7/sys/sys/proc.h Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Wed May 20 20:57:40 2009 (r192474) +++ stable/7/sys/conf/files Wed May 20 21:04:41 2009 (r192475) @@ -1620,6 +1620,7 @@ kern/kern_module.c standard kern/kern_mtxpool.c standard kern/kern_mutex.c standard kern/kern_ntptime.c standard +kern/kern_osd.c standard kern/kern_physio.c standard kern/kern_pmc.c standard kern/kern_poll.c optional device_polling Added: stable/7/sys/kern/kern_osd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/kern/kern_osd.c Wed May 20 21:04:41 2009 (r192475) @@ -0,0 +1,406 @@ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* OSD (Object Specific Data) */ + +static MALLOC_DEFINE(M_OSD, "osd", "Object Specific Data"); + +static int osd_debug = 0; +TUNABLE_INT("debug.osd", &osd_debug); +SYSCTL_INT(_debug, OID_AUTO, osd, CTLFLAG_RW, &osd_debug, 0, "OSD debug level"); + +#define OSD_DEBUG(...) do { \ + if (osd_debug) { \ + printf("OSD (%s:%u): ", __func__, __LINE__); \ + printf(__VA_ARGS__); \ + printf("\n"); \ + } \ +} while (0) + +static void do_osd_del(u_int type, struct osd *osd, u_int slot); +static void do_osd_del_locked(u_int type, struct osd *osd, u_int slot); + +/* + * Lists of objects with OSD. + * + * Lock key: + * (m) osd_module_lock + * (o) osd_object_lock + * (l) osd_list_lock + */ +static LIST_HEAD(, osd) osd_list[OSD_LAST + 1]; /* (m) */ +static osd_method_t *osd_methods[OSD_LAST + 1]; /* (m) */ +static u_int osd_nslots[OSD_LAST + 1]; /* (m) */ +static osd_destructor_t *osd_destructors[OSD_LAST + 1]; /* (o) */ +static const u_int osd_nmethods[OSD_LAST + 1] = { + [OSD_JAIL] = PR_MAXMETHOD, +}; + +static struct sx osd_module_lock[OSD_LAST + 1]; +static struct rwlock osd_object_lock[OSD_LAST + 1]; +static struct mtx osd_list_lock[OSD_LAST + 1]; + +static void +osd_default_destructor(void *value __unused) +{ + /* Do nothing. */ +} + +int +osd_register(u_int type, osd_destructor_t destructor, osd_method_t *methods) +{ + void *newptr; + u_int i, m; + + KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); + + /* + * If no destructor is given, use default one. We need to use some + * destructor, because NULL destructor means unused slot. + */ + if (destructor == NULL) + destructor = osd_default_destructor; + + sx_xlock(&osd_module_lock[type]); + /* + * First, we try to find unused slot. + */ + for (i = 0; i < osd_nslots[type]; i++) { + if (osd_destructors[type][i] == NULL) { + OSD_DEBUG("Unused slot found (type=%u, slot=%u).", + type, i); + break; + } + } + /* + * If no unused slot was found, allocate one. + */ + if (i == osd_nslots[type]) { + osd_nslots[type]++; + if (osd_nmethods[type] != 0) + osd_methods[type] = realloc(osd_methods[type], + sizeof(osd_method_t) * osd_nslots[type] * + osd_nmethods[type], M_OSD, M_WAITOK); + newptr = malloc(sizeof(osd_destructor_t) * osd_nslots[type], + M_OSD, M_WAITOK); + rw_wlock(&osd_object_lock[type]); + bcopy(osd_destructors[type], newptr, + sizeof(osd_destructor_t) * i); + free(osd_destructors[type], M_OSD); + osd_destructors[type] = newptr; + rw_wunlock(&osd_object_lock[type]); + OSD_DEBUG("New slot allocated (type=%u, slot=%u).", + type, i + 1); + } + + osd_destructors[type][i] = destructor; + if (osd_nmethods[type] != 0) { + for (m = 0; m < osd_nmethods[type]; m++) + osd_methods[type][i * osd_nmethods[type] + m] = + methods != NULL ? methods[m] : NULL; + } + sx_xunlock(&osd_module_lock[type]); + return (i + 1); +} + +void +osd_deregister(u_int type, u_int slot) +{ + struct osd *osd, *tosd; + + KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); + KASSERT(slot > 0, ("Invalid slot.")); + KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); + + sx_xlock(&osd_module_lock[type]); + rw_wlock(&osd_object_lock[type]); + /* + * Free all OSD for the given slot. + */ + mtx_lock(&osd_list_lock[type]); + LIST_FOREACH_SAFE(osd, &osd_list[type], osd_next, tosd) + do_osd_del_locked(type, osd, slot); + mtx_unlock(&osd_list_lock[type]); + /* + * Set destructor to NULL to free the slot. + */ + osd_destructors[type][slot - 1] = NULL; + if (slot == osd_nslots[type]) { + osd_nslots[type]--; + osd_destructors[type] = realloc(osd_destructors[type], + sizeof(osd_destructor_t) * osd_nslots[type], M_OSD, + M_NOWAIT | M_ZERO); + if (osd_nmethods[type] != 0) + osd_methods[type] = realloc(osd_methods[type], + sizeof(osd_method_t) * osd_nslots[type] * + osd_nmethods[type], M_OSD, M_NOWAIT | M_ZERO); + /* + * We always reallocate to smaller size, so we assume it will + * always succeed. + */ + KASSERT(osd_destructors[type] != NULL && + (osd_nmethods[type] == 0 || osd_methods[type] != NULL), + ("realloc() failed")); + OSD_DEBUG("Deregistration of the last slot (type=%u, slot=%u).", + type, slot); + } else { + OSD_DEBUG("Slot deregistration (type=%u, slot=%u).", + type, slot); + } + rw_wunlock(&osd_object_lock[type]); + sx_xunlock(&osd_module_lock[type]); +} + +int +osd_set(u_int type, struct osd *osd, u_int slot, void *value) +{ + + KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); + KASSERT(slot > 0, ("Invalid slot.")); + KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); + + rw_rlock(&osd_object_lock[type]); + if (slot > osd->osd_nslots) { + if (value == NULL) { + OSD_DEBUG( + "Not allocating null slot (type=%u, slot=%u).", + type, slot); + rw_runlock(&osd_object_lock[type]); + return (0); + } else if (osd->osd_nslots == 0) { + /* + * First OSD for this object, so we need to allocate + * space and put it onto the list. + */ + osd->osd_slots = malloc(sizeof(void *) * slot, M_OSD, + M_NOWAIT | M_ZERO); + if (osd->osd_slots == NULL) { + rw_runlock(&osd_object_lock[type]); + return (ENOMEM); + } + osd->osd_nslots = slot; + mtx_lock(&osd_list_lock[type]); + LIST_INSERT_HEAD(&osd_list[type], osd, osd_next); + mtx_unlock(&osd_list_lock[type]); + OSD_DEBUG("Setting first slot (type=%u).", type); + } else { + void *newptr; + + /* + * Too few slots allocated here, needs to extend + * the array. + */ + newptr = realloc(osd->osd_slots, sizeof(void *) * slot, + M_OSD, M_NOWAIT | M_ZERO); + if (newptr == NULL) { + rw_runlock(&osd_object_lock[type]); + return (ENOMEM); + } + osd->osd_slots = newptr; + osd->osd_nslots = slot; + OSD_DEBUG("Growing slots array (type=%u).", type); + } + } + OSD_DEBUG("Setting slot value (type=%u, slot=%u, value=%p).", type, + slot, value); + osd->osd_slots[slot - 1] = value; + rw_runlock(&osd_object_lock[type]); + return (0); +} + +void * +osd_get(u_int type, struct osd *osd, u_int slot) +{ + void *value; + + KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); + KASSERT(slot > 0, ("Invalid slot.")); + KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); + + rw_rlock(&osd_object_lock[type]); + if (slot > osd->osd_nslots) { + value = NULL; + OSD_DEBUG("Slot doesn't exist (type=%u, slot=%u).", type, slot); + } else { + value = osd->osd_slots[slot - 1]; + OSD_DEBUG("Returning slot value (type=%u, slot=%u, value=%p).", + type, slot, value); + } + rw_runlock(&osd_object_lock[type]); + return (value); +} + +static void +do_osd_del_locked(u_int type, struct osd *osd, u_int slot) +{ + int i; + + KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); + KASSERT(slot > 0, ("Invalid slot.")); + KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); + mtx_assert(&osd_list_lock[type], MA_OWNED); + + OSD_DEBUG("Deleting slot (type=%u, slot=%u).", type, slot); + + if (slot > osd->osd_nslots) { + OSD_DEBUG("Slot doesn't exist (type=%u, slot=%u).", type, slot); + return; + } + if (osd->osd_slots[slot - 1] != NULL) { + osd_destructors[type][slot - 1](osd->osd_slots[slot - 1]); + osd->osd_slots[slot - 1] = NULL; + } + for (i = osd->osd_nslots - 1; i >= 0; i--) { + if (osd->osd_slots[i] != NULL) { + OSD_DEBUG("Slot still has a value (type=%u, slot=%u).", + type, i + 1); + break; + } + } + if (i == -1) { + /* No values left for this object. */ + OSD_DEBUG("No more slots left (type=%u).", type); + LIST_REMOVE(osd, osd_next); + free(osd->osd_slots, M_OSD); + osd->osd_slots = NULL; + osd->osd_nslots = 0; + } else if (slot == osd->osd_nslots) { + /* This was the last slot. */ + osd->osd_slots = realloc(osd->osd_slots, + sizeof(void *) * (i + 1), M_OSD, M_NOWAIT | M_ZERO); + /* + * We always reallocate to smaller size, so we assume it will + * always succeed. + */ + KASSERT(osd->osd_slots != NULL, ("realloc() failed")); + osd->osd_nslots = i + 1; + OSD_DEBUG("Reducing slots array to %u (type=%u).", + osd->osd_nslots, type); + } +} + +static void +do_osd_del(u_int type, struct osd *osd, u_int slot) +{ + mtx_lock(&osd_list_lock[type]); + do_osd_del_locked(type, osd, slot); + mtx_unlock(&osd_list_lock[type]); +} + +void +osd_del(u_int type, struct osd *osd, u_int slot) +{ + + rw_rlock(&osd_object_lock[type]); + do_osd_del(type, osd, slot); + rw_runlock(&osd_object_lock[type]); +} + + + +int +osd_call(u_int type, u_int method, void *obj, void *data) +{ + osd_method_t methodfun; + int error, i; + + KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); + KASSERT(method < osd_nmethods[type], ("Invalid method.")); + + /* + * Call this method for every slot that defines it, stopping if an + * error is encountered. + */ + error = 0; + sx_slock(&osd_module_lock[type]); + for (i = 0; i < osd_nslots[type]; i++) { + methodfun = + osd_methods[type][i * osd_nmethods[type] + method]; + if (methodfun != NULL && (error = methodfun(obj, data)) != 0) + break; + } + sx_sunlock(&osd_module_lock[type]); + return (error); +} + +void +osd_exit(u_int type, struct osd *osd) +{ + u_int i; + + KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); + + if (osd->osd_nslots == 0) { + KASSERT(osd->osd_slots == NULL, ("Non-null osd_slots.")); + /* No OSD attached, just leave. */ + return; + } + + rw_rlock(&osd_object_lock[type]); + for (i = 1; i <= osd->osd_nslots; i++) { + if (osd_destructors[type][i - 1] != NULL) + do_osd_del(type, osd, i); + else + OSD_DEBUG("Unused slot (type=%u, slot=%u).", type, i); + } + rw_runlock(&osd_object_lock[type]); + OSD_DEBUG("Object exit (type=%u).", type); +} + +static void +osd_init(void *arg __unused) +{ + u_int i; + + for (i = OSD_FIRST; i <= OSD_LAST; i++) { + osd_nslots[i] = 0; + LIST_INIT(&osd_list[i]); + sx_init(&osd_module_lock[i], "osd_module"); + rw_init(&osd_object_lock[i], "osd_object"); + mtx_init(&osd_list_lock[i], "osd_list", NULL, MTX_DEF); + osd_destructors[i] = NULL; + osd_methods[i] = NULL; + } +} +SYSINIT(osd, SI_SUB_LOCK, SI_ORDER_ANY, osd_init, NULL); Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Wed May 20 20:57:40 2009 (r192474) +++ stable/7/sys/kern/kern_proc.c Wed May 20 21:04:41 2009 (r192475) @@ -200,6 +200,8 @@ proc_dtor(void *mem, int size, void *arg ("bad number of threads in exiting process")); KASSERT(STAILQ_EMPTY(&p->p_ktr), ("proc_dtor: non-empty p_ktr")); #endif + /* Free all OSD associated to this thread. */ + osd_thread_exit(td); /* Dispose of an alternate kstack, if it exists. * XXX What if there are more than one thread in the proc? Modified: stable/7/sys/kern/kern_thread.c ============================================================================== --- stable/7/sys/kern/kern_thread.c Wed May 20 20:57:40 2009 (r192474) +++ stable/7/sys/kern/kern_thread.c Wed May 20 21:04:41 2009 (r192475) @@ -133,6 +133,9 @@ thread_ctor(void *mem, int size, void *a #ifdef AUDIT audit_thread_alloc(td); #endif + /* Free all OSD associated to this thread. */ + osd_thread_exit(td); + umtx_thread_alloc(td); return (0); } Modified: stable/7/sys/sys/jail.h ============================================================================== --- stable/7/sys/sys/jail.h Wed May 20 20:57:40 2009 (r192474) +++ stable/7/sys/sys/jail.h Wed May 20 21:04:41 2009 (r192475) @@ -14,6 +14,8 @@ #define _SYS_JAIL_H_ #ifdef _KERNEL +#include + struct jail_v0 { u_int32_t version; char *path; @@ -136,11 +138,28 @@ struct prison { struct in_addr *pr_ip4; /* (c) v4 IPs of jail */ int pr_ip6s; /* (c) number of v6 IPs */ struct in6_addr *pr_ip6; /* (c) v6 IPs of jail */ + struct osd pr_osd; }; #endif /* _KERNEL || _WANT_PRISON */ #ifdef _KERNEL /* + * Flag bits set via options or internally + */ +#define PR_PERSIST 0x00000001 /* Can exist without processes */ +#define PR_REMOVE 0x01000000 /* In process of being removed */ + +/* + * OSD methods + */ +#define PR_METHOD_CREATE 0 +#define PR_METHOD_GET 1 +#define PR_METHOD_SET 2 +#define PR_METHOD_CHECK 3 +#define PR_METHOD_ATTACH 4 +#define PR_MAXMETHOD 5 + +/* * Sysctl-set variables that determine global jail policy * * XXX MIB entries will need to be protected by a mutex. Added: stable/7/sys/sys/osd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sys/osd.h Wed May 20 21:04:41 2009 (r192475) @@ -0,0 +1,101 @@ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * 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 _SYS_OSD_H_ +#define _SYS_OSD_H_ + +#include + +/* + * Lock key: + * (c) container lock (e.g. jail's pr_mtx) and/or osd_object_lock + * (l) osd_list_lock + */ +struct osd { + u_int osd_nslots; /* (c) */ + void **osd_slots; /* (c) */ + LIST_ENTRY(osd) osd_next; /* (l) */ +}; + +#ifdef _KERNEL + +#define OSD_THREAD 0 +#define OSD_JAIL 1 + +#define OSD_FIRST OSD_THREAD +#define OSD_LAST OSD_JAIL + +typedef void (*osd_destructor_t)(void *value); +typedef int (*osd_method_t)(void *obj, void *data); + +int osd_register(u_int type, osd_destructor_t destructor, + osd_method_t *methods); +void osd_deregister(u_int type, u_int slot); + +int osd_set(u_int type, struct osd *osd, u_int slot, void *value); +void *osd_get(u_int type, struct osd *osd, u_int slot); +void osd_del(u_int type, struct osd *osd, u_int slot); +int osd_call(u_int type, u_int method, void *obj, void *data); + +void osd_exit(u_int type, struct osd *osd); + +#define osd_thread_register(destructor) \ + osd_register(OSD_THREAD, (destructor), NULL) +#define osd_thread_deregister(slot) \ + osd_deregister(OSD_THREAD, (slot)) +#define osd_thread_set(td, slot, value) \ + osd_set(OSD_THREAD, &(td)->td_osd, (slot), (value)) +#define osd_thread_get(td, slot) \ + osd_get(OSD_THREAD, &(td)->td_osd, (slot)) +#define osd_thread_del(td, slot) do { \ + KASSERT((td) == curthread, ("Not curthread.")); \ + osd_del(OSD_THREAD, &(td)->td_osd, (slot)); \ +} while (0) +#define osd_thread_call(td, method, data) \ + osd_call(OSD_THREAD, (method), (td), (data)) +#define osd_thread_exit(td) \ + osd_exit(OSD_THREAD, &(td)->td_osd) + +#define osd_jail_register(destructor, methods) \ + osd_register(OSD_JAIL, (destructor), (methods)) +#define osd_jail_deregister(slot) \ + osd_deregister(OSD_JAIL, (slot)) +#define osd_jail_set(pr, slot, value) \ + osd_set(OSD_JAIL, &(pr)->pr_osd, (slot), (value)) +#define osd_jail_get(pr, slot) \ + osd_get(OSD_JAIL, &(pr)->pr_osd, (slot)) +#define osd_jail_del(pr, slot) \ + osd_del(OSD_JAIL, &(pr)->pr_osd, (slot)) +#define osd_jail_call(pr, method, data) \ + osd_call(OSD_JAIL, (method), (pr), (data)) +#define osd_jail_exit(pr) \ + osd_exit(OSD_JAIL, &(pr)->pr_osd) + +#endif /* _KERNEL */ + +#endif /* !_SYS_OSD_H_ */ Modified: stable/7/sys/sys/proc.h ============================================================================== --- stable/7/sys/sys/proc.h Wed May 20 20:57:40 2009 (r192474) +++ stable/7/sys/sys/proc.h Wed May 20 21:04:41 2009 (r192475) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include /* XXX. */ #include @@ -305,6 +306,7 @@ struct thread { struct file *td_fpop; /* (k) file referencing cdev under op */ struct kdtrace_thread *td_dtrace; /* (*) DTrace-specific data. */ int td_errno; /* Error returned by last syscall. */ + struct osd td_osd; /* (k) Object specific data. */ }; struct mtx *thread_lock_block(struct thread *); From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 21:13:50 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 110971065670; Wed, 20 May 2009 21:13:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D88FA8FC19; Wed, 20 May 2009 21:13:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KLDnJb043960; Wed, 20 May 2009 21:13:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KLDnBT043958; Wed, 20 May 2009 21:13:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200905202113.n4KLDnBT043958@svn.freebsd.org> From: Xin LI Date: Wed, 20 May 2009 21:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192477 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bce dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 21:13:50 -0000 Author: delphij Date: Wed May 20 21:13:49 2009 New Revision: 192477 URL: http://svn.freebsd.org/changeset/base/192477 Log: MFC r191923 (davidch): - Fixed incorrect packet length problem caused be earlier change to support ZERO_COPY_SOCKETS. - Created #define for context initialization retry count. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/bce/if_bcereg.h stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Wed May 20 21:07:15 2009 (r192476) +++ stable/7/sys/dev/bce/if_bce.c Wed May 20 21:13:49 2009 (r192477) @@ -4204,8 +4204,7 @@ bce_init_ctx(struct bce_softc *sc) if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { - /* DRC: Replace this constant value with a #define. */ - int i, retry_cnt = 10; + int i, retry_cnt = CTX_INIT_RETRY_COUNT; u32 val; DBPRINT(sc, BCE_INFO_CTX, "Initializing 5709 context.\n"); @@ -5895,6 +5894,9 @@ bce_rx_intr(struct bce_softc *sc) /* Set the total packet length. */ m0->m_pkthdr.len = m0->m_len = pkt_len; } +#else + /* Set the total packet length. */ + m0->m_pkthdr.len = m0->m_len = pkt_len; #endif /* Remove the trailing Ethernet FCS. */ Modified: stable/7/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/7/sys/dev/bce/if_bcereg.h Wed May 20 21:07:15 2009 (r192476) +++ stable/7/sys/dev/bce/if_bcereg.h Wed May 20 21:13:49 2009 (r192477) @@ -6229,6 +6229,8 @@ struct l2_fhdr { #endif /* ZERO_COPY_SOCKETS */ +#define CTX_INIT_RETRY_COUNT 10 + /* Context size. */ #define CTX_SHIFT 7 #define CTX_SIZE (1 << CTX_SHIFT) From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 21:17:10 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE22D1065680; Wed, 20 May 2009 21:17:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC6478FC22; Wed, 20 May 2009 21:17:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KLHAl8044081; Wed, 20 May 2009 21:17:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KLHA2o044080; Wed, 20 May 2009 21:17:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200905202117.n4KLHA2o044080@svn.freebsd.org> From: Xin LI Date: Wed, 20 May 2009 21:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192478 - in stable/7/sys: . dev/bge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 21:17:11 -0000 Author: delphij Date: Wed May 20 21:17:10 2009 New Revision: 192478 URL: http://svn.freebsd.org/changeset/base/192478 Log: MFC r192127: Try to workaround a race where bge_stop() may sneak in when bge_rxeof() drops and re-grabs the softc mutex in the middle, resulting in kernel trap 12. This may happen when a lot of traffic is being hammered on one bge(4) interface while the system is shutting down. Reported by: Alexander Sack PR: kern/134548 Modified: stable/7/sys/ (props changed) stable/7/sys/dev/bge/if_bge.c Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Wed May 20 21:13:49 2009 (r192477) +++ stable/7/sys/dev/bge/if_bge.c Wed May 20 21:17:10 2009 (r192478) @@ -3193,6 +3193,9 @@ bge_rxeof(struct bge_softc *sc) BGE_UNLOCK(sc); (*ifp->if_input)(ifp, m); BGE_LOCK(sc); + + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + return; } if (stdcnt > 0) @@ -3301,6 +3304,10 @@ bge_poll(struct ifnet *ifp, enum poll_cm sc->rxcycles = count; bge_rxeof(sc); + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + BGE_UNLOCK(sc); + return; + } bge_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); @@ -3370,7 +3377,9 @@ bge_intr(void *xsc) if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check RX return ring producer/consumer. */ bge_rxeof(sc); + } + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check TX ring producer/consumer. */ bge_txeof(sc); } From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 22:09:50 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00043106566B; Wed, 20 May 2009 22:09:49 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2EBD8FC08; Wed, 20 May 2009 22:09:49 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KM9nF6045425; Wed, 20 May 2009 22:09:49 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KM9nVq045424; Wed, 20 May 2009 22:09:49 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202209.n4KM9nVq045424@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 22:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192483 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 22:09:50 -0000 Author: kmacy Date: Wed May 20 22:09:49 2009 New Revision: 192483 URL: http://svn.freebsd.org/changeset/base/192483 Log: - make vfsoptlist globally visible - ZFS MFC dependency Modified: stable/7/sys/sys/mount.h Modified: stable/7/sys/sys/mount.h ============================================================================== --- stable/7/sys/sys/mount.h Wed May 20 22:01:43 2009 (r192482) +++ stable/7/sys/sys/mount.h Wed May 20 22:09:49 2009 (r192483) @@ -131,8 +131,16 @@ struct ostatfs { TAILQ_HEAD(vnodelst, vnode); -struct vfsoptlist; -struct vfsopt; +/* Mount options list */ +TAILQ_HEAD(vfsoptlist, vfsopt); +struct vfsopt { + TAILQ_ENTRY(vfsopt) link; + char *name; + void *value; + int len; + int pos; + int seen; +}; /* * Structure per mounted filesystem. Each mounted filesystem has an From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 22:10:34 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DC1C1065674; Wed, 20 May 2009 22:10:34 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6E58FC14; Wed, 20 May 2009 22:10:34 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KMAYiG045543; Wed, 20 May 2009 22:10:34 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KMAYOt045541; Wed, 20 May 2009 22:10:34 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202210.n4KMAYOt045541@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 22:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192484 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 22:10:35 -0000 Author: kmacy Date: Wed May 20 22:10:34 2009 New Revision: 192484 URL: http://svn.freebsd.org/changeset/base/192484 Log: MFC accmode_t ZFS MFC dependency Modified: stable/7/sys/sys/_types.h stable/7/sys/sys/types.h Modified: stable/7/sys/sys/_types.h ============================================================================== --- stable/7/sys/sys/_types.h Wed May 20 22:09:49 2009 (r192483) +++ stable/7/sys/sys/_types.h Wed May 20 22:10:34 2009 (r192484) @@ -47,6 +47,7 @@ typedef __uint32_t __ino_t; /* inode num typedef long __key_t; /* IPC key (for Sys V IPC) */ typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) */ typedef __uint16_t __mode_t; /* permissions */ +typedef int __accmode_t; /* access permissions */ typedef int __nl_item; typedef __uint16_t __nlink_t; /* link count */ typedef __int64_t __off_t; /* file offset */ Modified: stable/7/sys/sys/types.h ============================================================================== --- stable/7/sys/sys/types.h Wed May 20 22:09:49 2009 (r192483) +++ stable/7/sys/sys/types.h Wed May 20 22:10:34 2009 (r192484) @@ -210,6 +210,11 @@ typedef __nlink_t nlink_t; /* link count #define _NLINK_T_DECLARED #endif +#ifndef _ACCMODE_T_DECLARED +typedef __accmode_t accmode_t; /* access permissions */ +#define _ACCMODE_T_DECLARED +#endif + #ifndef _OFF_T_DECLARED typedef __off_t off_t; /* file offset */ #define _OFF_T_DECLARED From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 22:13:21 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 916591065673; Wed, 20 May 2009 22:13:21 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 780748FC1F; Wed, 20 May 2009 22:13:21 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KMDLaH045653; Wed, 20 May 2009 22:13:21 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KMDLcm045650; Wed, 20 May 2009 22:13:21 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202213.n4KMDLcm045650@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 22:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192485 - in stable/7/sys: conf libkern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 22:13:22 -0000 Author: kmacy Date: Wed May 20 22:13:21 2009 New Revision: 192485 URL: http://svn.freebsd.org/changeset/base/192485 Log: MFC memmove support ZFS MFC dependency Added: stable/7/sys/libkern/memmove.c (contents, props changed) Modified: stable/7/sys/conf/files stable/7/sys/sys/systm.h Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Wed May 20 22:10:34 2009 (r192484) +++ stable/7/sys/conf/files Wed May 20 22:13:21 2009 (r192485) @@ -1755,6 +1755,7 @@ libkern/iconv_xlat16.c optional libicon libkern/index.c standard libkern/inet_ntoa.c standard libkern/mcount.c optional profiling-routine +libkern/memmove.c standard libkern/qsort.c standard libkern/qsort_r.c standard libkern/random.c standard Added: stable/7/sys/libkern/memmove.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/libkern/memmove.c Wed May 20 22:13:21 2009 (r192485) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2009 Roman Divacky + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. +*/ + +#include +__FBSDID("$FreeBSD$"); + +#include + +void * +memmove(void *dest, const void *src, size_t n) +{ + + bcopy(src, dest, n); + return (dest); +} Modified: stable/7/sys/sys/systm.h ============================================================================== --- stable/7/sys/sys/systm.h Wed May 20 22:10:34 2009 (r192484) +++ stable/7/sys/sys/systm.h Wed May 20 22:13:21 2009 (r192485) @@ -191,6 +191,7 @@ void bcopy(const void *from, void *to, s void bzero(void *buf, size_t len) __nonnull(1); void *memcpy(void *to, const void *from, size_t len) __nonnull(1) __nonnull(2); +void *memmove(void *dest, const void *src, size_t len) __nonnull(1) __nonnull(2); int copystr(const void * __restrict kfaddr, void * __restrict kdaddr, size_t len, size_t * __restrict lencopied) From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 22:19:49 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42468106566C; Wed, 20 May 2009 22:19:49 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 315DE8FC18; Wed, 20 May 2009 22:19:49 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KMJnFD045845; Wed, 20 May 2009 22:19:49 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KMJn6Y045844; Wed, 20 May 2009 22:19:49 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202219.n4KMJn6Y045844@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 22:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192487 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 22:19:50 -0000 Author: kmacy Date: Wed May 20 22:19:48 2009 New Revision: 192487 URL: http://svn.freebsd.org/changeset/base/192487 Log: add UID_NOBODY Modified: stable/7/sys/sys/conf.h Modified: stable/7/sys/sys/conf.h ============================================================================== --- stable/7/sys/sys/conf.h Wed May 20 22:19:22 2009 (r192486) +++ stable/7/sys/sys/conf.h Wed May 20 22:19:48 2009 (r192487) @@ -290,6 +290,7 @@ void devfs_fpdrop(struct file *fp); /* X #define UID_ROOT 0 #define UID_BIN 3 #define UID_UUCP 66 +#define UID_NOBODY 65534 #define GID_WHEEL 0 #define GID_KMEM 2 From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 22:24:31 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C2BF1065674; Wed, 20 May 2009 22:24:31 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B3288FC1F; Wed, 20 May 2009 22:24:31 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KMOVXo046006; Wed, 20 May 2009 22:24:31 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KMOVSv046005; Wed, 20 May 2009 22:24:31 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202224.n4KMOVSv046005@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 22:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192488 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 22:24:32 -0000 Author: kmacy Date: Wed May 20 22:24:31 2009 New Revision: 192488 URL: http://svn.freebsd.org/changeset/base/192488 Log: make vfsopt globally visible for ZFS Modified: stable/7/sys/kern/vfs_mount.c Modified: stable/7/sys/kern/vfs_mount.c ============================================================================== --- stable/7/sys/kern/vfs_mount.c Wed May 20 22:19:48 2009 (r192487) +++ stable/7/sys/kern/vfs_mount.c Wed May 20 22:24:31 2009 (r192488) @@ -100,14 +100,6 @@ struct mntlist mountlist = TAILQ_HEAD_IN struct mtx mountlist_mtx; MTX_SYSINIT(mountlist, &mountlist_mtx, "mountlist", MTX_DEF); -TAILQ_HEAD(vfsoptlist, vfsopt); -struct vfsopt { - TAILQ_ENTRY(vfsopt) link; - char *name; - void *value; - int len; -}; - /* * The vnode of the system's root (/ in the filesystem, without chroot * active.) From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 22:26:03 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7FC9106566B; Wed, 20 May 2009 22:26:03 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C735D8FC0C; Wed, 20 May 2009 22:26:03 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KMQ3Gk046085; Wed, 20 May 2009 22:26:03 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KMQ3CG046084; Wed, 20 May 2009 22:26:03 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202226.n4KMQ3CG046084@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 22:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192489 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 22:26:04 -0000 Author: kmacy Date: Wed May 20 22:26:03 2009 New Revision: 192489 URL: http://svn.freebsd.org/changeset/base/192489 Log: make vdestroy globally visible for ZFS Modified: stable/7/sys/kern/vfs_subr.c Modified: stable/7/sys/kern/vfs_subr.c ============================================================================== --- stable/7/sys/kern/vfs_subr.c Wed May 20 22:24:31 2009 (r192488) +++ stable/7/sys/kern/vfs_subr.c Wed May 20 22:26:03 2009 (r192489) @@ -104,7 +104,6 @@ static void v_decr_useonly(struct vnode static void v_upgrade_usecount(struct vnode *); static void vfree(struct vnode *); static void vnlru_free(int); -static void vdestroy(struct vnode *); static void vgonel(struct vnode *); static void vfs_knllock(void *arg); static void vfs_knlunlock(void *arg); @@ -777,7 +776,7 @@ SYSINIT(vnlru, SI_SUB_KTHREAD_UPDATE, SI * Routines having to do with the management of the vnode table. */ -static void +void vdestroy(struct vnode *vp) { struct bufobj *bo; From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 22:27:18 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD96B1065670; Wed, 20 May 2009 22:27:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC6A08FC1B; Wed, 20 May 2009 22:27:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KMRILc046144; Wed, 20 May 2009 22:27:18 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KMRIjW046143; Wed, 20 May 2009 22:27:18 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202227.n4KMRIjW046143@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 22:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192490 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 22:27:19 -0000 Author: kmacy Date: Wed May 20 22:27:18 2009 New Revision: 192490 URL: http://svn.freebsd.org/changeset/base/192490 Log: add vdestroy declaration now that it is no longer static - needed by ZFS Modified: stable/7/sys/sys/vnode.h Modified: stable/7/sys/sys/vnode.h ============================================================================== --- stable/7/sys/sys/vnode.h Wed May 20 22:26:03 2009 (r192489) +++ stable/7/sys/sys/vnode.h Wed May 20 22:27:18 2009 (r192490) @@ -717,6 +717,7 @@ void vrele(struct vnode *vp); void vref(struct vnode *vp); int vrefcnt(struct vnode *vp); void v_addpollinfo(struct vnode *vp); +void vdestroy(struct vnode *vp); int vnode_create_vobject(struct vnode *vp, off_t size, struct thread *td); void vnode_destroy_vobject(struct vnode *vp); From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 22:28:39 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD9E31065670; Wed, 20 May 2009 22:28:39 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B20888FC0A; Wed, 20 May 2009 22:28:39 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KMSd69046215; Wed, 20 May 2009 22:28:39 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KMSdsE046212; Wed, 20 May 2009 22:28:39 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202228.n4KMSdsE046212@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 22:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192491 - in stable/7/sys: kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 22:28:40 -0000 Author: kmacy Date: Wed May 20 22:28:39 2009 New Revision: 192491 URL: http://svn.freebsd.org/changeset/base/192491 Log: MFC quad tunables and sysctls for setting ZFS arc cache size Modified: stable/7/sys/kern/kern_environment.c stable/7/sys/sys/kernel.h stable/7/sys/sys/sysctl.h Modified: stable/7/sys/kern/kern_environment.c ============================================================================== --- stable/7/sys/kern/kern_environment.c Wed May 20 22:27:18 2009 (r192490) +++ stable/7/sys/kern/kern_environment.c Wed May 20 22:28:39 2009 (r192491) @@ -553,6 +553,14 @@ tunable_ulong_init(void *data) } void +tunable_quad_init(void *data) +{ + struct tunable_quad *d = (struct tunable_quad *)data; + + TUNABLE_QUAD_FETCH(d->path, d->var); +} + +void tunable_str_init(void *data) { struct tunable_str *d = (struct tunable_str *)data; Modified: stable/7/sys/sys/kernel.h ============================================================================== --- stable/7/sys/sys/kernel.h Wed May 20 22:27:18 2009 (r192490) +++ stable/7/sys/sys/kernel.h Wed May 20 22:28:39 2009 (r192491) @@ -329,6 +329,25 @@ struct tunable_ulong { #define TUNABLE_ULONG_FETCH(path, var) getenv_ulong((path), (var)) +/* + * quad + */ +extern void tunable_quad_init(void *); +struct tunable_quad { + const char *path; + quad_t *var; +}; +#define TUNABLE_QUAD(path, var) \ + static struct tunable_quad __CONCAT(__tunable_quad_, __LINE__) = { \ + (path), \ + (var), \ + }; \ + SYSINIT(__CONCAT(__Tunable_init_, __LINE__), \ + SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_quad_init, \ + &__CONCAT(__tunable_quad_, __LINE__)) + +#define TUNABLE_QUAD_FETCH(path, var) getenv_quad((path), (var)) + extern void tunable_str_init(void *); struct tunable_str { const char *path; Modified: stable/7/sys/sys/sysctl.h ============================================================================== --- stable/7/sys/sys/sysctl.h Wed May 20 22:27:18 2009 (r192490) +++ stable/7/sys/sys/sysctl.h Wed May 20 22:28:39 2009 (r192491) @@ -295,6 +295,15 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \ ptr, 0, sysctl_handle_long, "LX", __DESCR(descr)) +/* Oid for a quad. The pointer must be non NULL. */ +#define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \ + SYSCTL_OID(parent, nbr, name, CTLTYPE_QUAD|CTLFLAG_MPSAFE|(access), \ + ptr, val, sysctl_handle_quad, "Q", __DESCR(descr)) + +#define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr) \ + sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_QUAD|CTLFLAG_MPSAFE|(access), \ + ptr, 0, sysctl_handle_quad, "Q", __DESCR(descr)) + /* Oid for an opaque object. Specified by a pointer and a length. */ #define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \ From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 22:30:58 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 652E6106564A; Wed, 20 May 2009 22:30:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39CC88FC14; Wed, 20 May 2009 22:30:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KMUwlo046347; Wed, 20 May 2009 22:30:58 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KMUwhg046344; Wed, 20 May 2009 22:30:58 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202230.n4KMUwhg046344@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 22:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192493 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 22:30:59 -0000 Author: kmacy Date: Wed May 20 22:30:57 2009 New Revision: 192493 URL: http://svn.freebsd.org/changeset/base/192493 Log: td_osd is at the end of struct thread to avoid breaking the ABI as a side effect it is outside of the td_startzero-td_endzero range, requiring it to be separately zeroed Modified: stable/7/sys/kern/kern_fork.c stable/7/sys/kern/kern_kse.c stable/7/sys/kern/kern_thr.c Modified: stable/7/sys/kern/kern_fork.c ============================================================================== --- stable/7/sys/kern/kern_fork.c Wed May 20 22:28:55 2009 (r192492) +++ stable/7/sys/kern/kern_fork.c Wed May 20 22:30:57 2009 (r192493) @@ -507,6 +507,7 @@ again: bcopy(&td->td_startcopy, &td2->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); + bzero(&td2->td_osd, sizeof(struct osd)); td2->td_sigstk = td->td_sigstk; td2->td_sigmask = td->td_sigmask; Modified: stable/7/sys/kern/kern_kse.c ============================================================================== --- stable/7/sys/kern/kern_kse.c Wed May 20 22:28:55 2009 (r192492) +++ stable/7/sys/kern/kern_kse.c Wed May 20 22:30:57 2009 (r192493) @@ -1014,6 +1014,7 @@ thread_alloc_spare(struct thread *td) td->td_standin = spare; bzero(&spare->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); + bzero(&spare->td_osd, sizeof(struct osd)); spare->td_proc = td->td_proc; spare->td_ucred = crhold(td->td_ucred); spare->td_flags = TDF_INMEM; Modified: stable/7/sys/kern/kern_thr.c ============================================================================== --- stable/7/sys/kern/kern_thr.c Wed May 20 22:28:55 2009 (r192492) +++ stable/7/sys/kern/kern_thr.c Wed May 20 22:30:57 2009 (r192493) @@ -199,6 +199,7 @@ create_thread(struct thread *td, mcontex __rangeof(struct thread, td_startzero, td_endzero)); bcopy(&td->td_startcopy, &newtd->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); + bzero(&newtd->td_osd, sizeof(struct osd)); newtd->td_proc = td->td_proc; newtd->td_ucred = crhold(td->td_ucred); From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 22:32:25 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC7E11065670; Wed, 20 May 2009 22:32:25 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA6A8FC1F; Wed, 20 May 2009 22:32:25 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KMWPjK046416; Wed, 20 May 2009 22:32:25 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KMWPJU046415; Wed, 20 May 2009 22:32:25 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202232.n4KMWPJU046415@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 22:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192494 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 22:32:26 -0000 Author: kmacy Date: Wed May 20 22:32:25 2009 New Revision: 192494 URL: http://svn.freebsd.org/changeset/base/192494 Log: MFC minimal zfs lock ordering for WITNESS (dnode -> dirty record -> dbuf) Modified: stable/7/sys/kern/subr_witness.c Modified: stable/7/sys/kern/subr_witness.c ============================================================================== --- stable/7/sys/kern/subr_witness.c Wed May 20 22:30:57 2009 (r192493) +++ stable/7/sys/kern/subr_witness.c Wed May 20 22:32:25 2009 (r192494) @@ -397,6 +397,13 @@ static struct witness_order_list_entry o { "vnode interlock", &lock_class_mtx_sleep }, { NULL, NULL }, /* + * ZFS locking + */ + { "dn->dn_mtx", &lock_class_sx }, + { "dr->dt.di.dr_mtx", &lock_class_sx }, + { "db->db_mtx", &lock_class_sx }, + { NULL, NULL }, + /* * spin locks */ #ifdef SMP From owner-svn-src-stable-7@FreeBSD.ORG Wed May 20 23:35:00 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF285106564A; Wed, 20 May 2009 23:35:00 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B89D38FC14; Wed, 20 May 2009 23:35:00 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KNZ0BL047801; Wed, 20 May 2009 23:35:00 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KNZ0ng047789; Wed, 20 May 2009 23:35:00 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202335.n4KNZ0ng047789@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 23:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192498 - in stable/7: . cddl cddl/compat/opensolaris/include cddl/compat/opensolaris/misc cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 23:35:01 -0000 Author: kmacy Date: Wed May 20 23:34:59 2009 New Revision: 192498 URL: http://svn.freebsd.org/changeset/base/192498 Log: MFC ZFS version 13. This includes the changes by pjd (see original message below) as well as the following: - the recurring deadlock was fixed by deferring vinactive to a dedicated thread - zfs boot for all pool types now works Submitted by: dfr - kmem now goes up to 512GB so arc is now limited by physmem - the arc now experiences backpressure from the vm (which can be too much - but this allows ZFS to work without any tunables on amd64) - frequently recurring LOR in the ARC fixed - zfs send coredump fix - fixes for various PRs Supported by: Barrett Lyon, BitGravity Revision 185029 - (view) (annotate) - [select for diffs] Modified Mon Nov 17 20:49:29 2008 UTC (6 months ago) by pjd File length: 38244 byte(s) Diff to previous 177698 Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes. This bring huge amount of changes, I'll enumerate only user-visible changes: - Delegated Administration Allows regular users to perform ZFS operations, like file system creation, snapshot creation, etc. - L2ARC Level 2 cache for ZFS - allows to use additional disks for cache. Huge performance improvements mostly for random read of mostly static content. - slog Allow to use additional disks for ZFS Intent Log to speed up operations like fsync(2). - vfs.zfs.super_owner Allows regular users to perform privileged operations on files stored on ZFS file systems owned by him. Very careful with this one. - chflags(2) Not all the flags are supported. This still needs work. - ZFSBoot Support to boot off of ZFS pool. Not finished, AFAIK. Submitted by: dfr - Snapshot properties - New failure modes Before if write requested failed, system paniced. Now one can select from one of three failure modes: Before if write requested failed, system paniced. Now one can select from one of three failure modes: - panic - panic on write error - wait - wait for disk to reappear - continue - serve read requests if possible, block write requests - Refquota, refreservation properties Just quota and reservation properties, but don't count space consumed by children file systems, clones and snapshots. - Sparse volumes ZVOLs that don't reserve space in the pool. - External attributes Compatible with extattr(2). - NFSv4-ACLs Not sure about the status, might not be complete yet. Submitted by: trasz - Creation-time properties - Regression tests for zpool(8) command. Obtained from: OpenSolaris Added: stable/7/cddl/compat/opensolaris/include/libshare.h (contents, props changed) stable/7/cddl/contrib/opensolaris/cmd/zinject/ stable/7/cddl/contrib/opensolaris/cmd/zinject/translate.c stable/7/cddl/contrib/opensolaris/cmd/zinject/zinject.c stable/7/cddl/contrib/opensolaris/cmd/zinject/zinject.h stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/7/cddl/usr.bin/zinject/ stable/7/cddl/usr.bin/zinject/Makefile (contents, props changed) stable/7/sys/boot/i386/zfsboot/ stable/7/sys/boot/i386/zfsboot/zfsboot.c (contents, props changed) stable/7/sys/boot/zfs/ stable/7/sys/boot/zfs/zfsimpl.c (contents, props changed) stable/7/sys/cddl/boot/ stable/7/sys/cddl/boot/zfs/ stable/7/sys/cddl/boot/zfs/README (contents, props changed) stable/7/sys/cddl/boot/zfs/fletcher.c (contents, props changed) stable/7/sys/cddl/boot/zfs/lzjb.c (contents, props changed) stable/7/sys/cddl/boot/zfs/sha256.c (contents, props changed) stable/7/sys/cddl/boot/zfs/zfsimpl.h (contents, props changed) stable/7/sys/cddl/boot/zfs/zfssubr.c (contents, props changed) stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/file.h (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/kidmap.h (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/pathname.h (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/refstr.h (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/sid.h (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/sig.h (contents, props changed) stable/7/sys/cddl/contrib/opensolaris/common/atomic/amd64/opensolaris_atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/sparc64/opensolaris_atomic.S stable/7/sys/cddl/contrib/opensolaris/common/unicode/ stable/7/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.h stable/7/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg2.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub2.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_boot.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_fuid.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid2.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_array.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_mem.c stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/acl_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/extdirent.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/idmap.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/ stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/u8_textprep.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/u8_textprep_data.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/zmod/opensolaris_crc32.c Deleted: stable/7/sys/cddl/compat/opensolaris/sys/acl.h stable/7/sys/cddl/contrib/opensolaris/common/atomic/amd64/atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/i386/atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/ia64/atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/sparc64/atomic.S stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_array.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_mem.c stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vfs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/zmod/crc32.c Modified: stable/7/UPDATING stable/7/cddl/Makefile.inc stable/7/cddl/compat/opensolaris/include/mnttab.h stable/7/cddl/compat/opensolaris/misc/deviceid.c stable/7/cddl/compat/opensolaris/misc/mnttab.c stable/7/cddl/compat/opensolaris/misc/zmount.c stable/7/cddl/compat/opensolaris/misc/zone.c stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c stable/7/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/7/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c stable/7/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h stable/7/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool_iter.c stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool_util.c stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool_util.h stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c stable/7/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/7/cddl/contrib/opensolaris/head/assert.h stable/7/cddl/contrib/opensolaris/head/libintl.h stable/7/cddl/contrib/opensolaris/head/synch.h stable/7/cddl/contrib/opensolaris/head/thread.h stable/7/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c stable/7/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.h stable/7/cddl/contrib/opensolaris/lib/libuutil/common/libuutil.h stable/7/cddl/contrib/opensolaris/lib/libuutil/common/libuutil_common.h stable/7/cddl/contrib/opensolaris/lib/libuutil/common/uu_alloc.c stable/7/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c stable/7/cddl/contrib/opensolaris/lib/libuutil/common/uu_dprintf.c stable/7/cddl/contrib/opensolaris/lib/libuutil/common/uu_list.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_graph.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/7/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/7/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/7/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c stable/7/cddl/contrib/opensolaris/lib/libzpool/common/util.c stable/7/cddl/lib/Makefile stable/7/cddl/lib/libnvpair/Makefile stable/7/cddl/lib/libzfs/Makefile stable/7/cddl/lib/libzpool/Makefile stable/7/cddl/sbin/zpool/Makefile stable/7/cddl/usr.bin/Makefile stable/7/cddl/usr.bin/ztest/Makefile stable/7/cddl/usr.sbin/Makefile stable/7/cddl/usr.sbin/zdb/Makefile stable/7/sys/cddl/compat/opensolaris/kern/opensolaris.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_zone.c stable/7/sys/cddl/compat/opensolaris/rpc/xdr.h stable/7/sys/cddl/compat/opensolaris/sys/atomic.h stable/7/sys/cddl/compat/opensolaris/sys/cpuvar.h stable/7/sys/cddl/compat/opensolaris/sys/cred.h stable/7/sys/cddl/compat/opensolaris/sys/dnlc.h stable/7/sys/cddl/compat/opensolaris/sys/kmem.h stable/7/sys/cddl/compat/opensolaris/sys/lock.h stable/7/sys/cddl/compat/opensolaris/sys/misc.h stable/7/sys/cddl/compat/opensolaris/sys/mntent.h stable/7/sys/cddl/compat/opensolaris/sys/mutex.h stable/7/sys/cddl/compat/opensolaris/sys/param.h stable/7/sys/cddl/compat/opensolaris/sys/policy.h stable/7/sys/cddl/compat/opensolaris/sys/proc.h stable/7/sys/cddl/compat/opensolaris/sys/rwlock.h stable/7/sys/cddl/compat/opensolaris/sys/sunddi.h stable/7/sys/cddl/compat/opensolaris/sys/sysmacros.h stable/7/sys/cddl/compat/opensolaris/sys/time.h stable/7/sys/cddl/compat/opensolaris/sys/types.h stable/7/sys/cddl/compat/opensolaris/sys/uio.h stable/7/sys/cddl/compat/opensolaris/sys/vfs.h stable/7/sys/cddl/compat/opensolaris/sys/vnode.h stable/7/sys/cddl/compat/opensolaris/sys/zone.h stable/7/sys/cddl/contrib/opensolaris/common/acl/acl_common.c stable/7/sys/cddl/contrib/opensolaris/common/acl/acl_common.h stable/7/sys/cddl/contrib/opensolaris/common/avl/avl.c stable/7/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.h stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.h stable/7/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bplist.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bplist.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_prop.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_synctask.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_dir.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/7/sys/cddl/contrib/opensolaris/uts/common/os/callb.c stable/7/sys/cddl/contrib/opensolaris/uts/common/os/list.c stable/7/sys/cddl/contrib/opensolaris/uts/common/os/taskq.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/byteorder.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/callb.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/cred.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dkio.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dklabel.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fm/protocol.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fm/util.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/list.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/processor.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/synch.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h stable/7/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod.c stable/7/sys/compat/linprocfs/linprocfs.c stable/7/sys/compat/pecoff/imgact_pecoff.c stable/7/sys/fs/coda/coda_vfsops.c stable/7/sys/fs/msdosfs/msdosfs_vfsops.c stable/7/sys/fs/nullfs/null_vfsops.c stable/7/sys/fs/unionfs/union_vfsops.c stable/7/sys/modules/opensolaris/Makefile stable/7/sys/modules/zfs/Makefile stable/7/sys/ufs/ffs/ffs_snapshot.c stable/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Wed May 20 23:33:40 2009 (r192497) +++ stable/7/UPDATING Wed May 20 23:34:59 2009 (r192498) @@ -7,7 +7,12 @@ done items, please see the COMMON ITEMS: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. - +20090520 + Update ZFS to version 13. ZFS users will need to re-build + kernel and world. Existing pools will continue to work + without upgrade. If a pool is upgraded it will no longer be + usable by older kernel revs. ZFS send / recv between + pool version 6 and pool version 13 is not supported. 20090504: FreeBSD 7.2-RELEASE Modified: stable/7/cddl/Makefile.inc ============================================================================== --- stable/7/cddl/Makefile.inc Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/Makefile.inc Wed May 20 23:34:59 2009 (r192498) @@ -6,3 +6,5 @@ OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../. IGNORE_PRAGMA= YES CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +CSTD?= gnu89 Added: stable/7/cddl/compat/opensolaris/include/libshare.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/cddl/compat/opensolaris/include/libshare.h Wed May 20 23:34:59 2009 (r192498) @@ -0,0 +1,144 @@ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * 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_LIBSHARE_H_ +#define _OPENSOLARIS_LIBSHARE_H_ + +#define SA_OK 0 + +#define SA_INIT_CONTROL_API 0 + +#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * 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_LIBSHARE_H_ +#define _OPENSOLARIS_LIBSHARE_H_ + +#define SA_OK 0 + +#define SA_INIT_CONTROL_API 0 + +#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * 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_LIBSHARE_H_ +#define _OPENSOLARIS_LIBSHARE_H_ + +#define SA_OK 0 + +#define SA_INIT_CONTROL_API 0 + +#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * 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_LIBSHARE_H_ +#define _OPENSOLARIS_LIBSHARE_H_ + +#define SA_OK 0 + +#define SA_INIT_CONTROL_API 0 + +#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ Modified: stable/7/cddl/compat/opensolaris/include/mnttab.h ============================================================================== --- stable/7/cddl/compat/opensolaris/include/mnttab.h Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/compat/opensolaris/include/mnttab.h Wed May 20 23:34:59 2009 (r192498) @@ -9,6 +9,8 @@ #define MNTTAB _PATH_DEVNULL #define MNT_LINE_MAX 1024 +#define umount2(p, f) unmount(p, f) + struct mnttab { char *mnt_special; char *mnt_mountp; Modified: stable/7/cddl/compat/opensolaris/misc/deviceid.c ============================================================================== --- stable/7/cddl/compat/opensolaris/misc/deviceid.c Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/compat/opensolaris/misc/deviceid.c Wed May 20 23:34:59 2009 (r192498) @@ -94,11 +94,7 @@ int devid_get(int fd, ddi_devid_t *retdevid) { - if (ioctl(fd, DIOCGIDENT, retdevid->devid) == -1) - return (errno); - if (retdevid->devid[0] == '\0') - return (ENOENT); - return (0); + return (ENOENT); } int Modified: stable/7/cddl/compat/opensolaris/misc/mnttab.c ============================================================================== --- stable/7/cddl/compat/opensolaris/misc/mnttab.c Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/compat/opensolaris/misc/mnttab.c Wed May 20 23:34:59 2009 (r192498) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include static char * mntopt(char **p) Modified: stable/7/cddl/compat/opensolaris/misc/zmount.c ============================================================================== --- stable/7/cddl/compat/opensolaris/misc/zmount.c Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/compat/opensolaris/misc/zmount.c Wed May 20 23:34:59 2009 (r192498) @@ -35,9 +35,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include +#include static void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, @@ -86,7 +87,7 @@ zmount(const char *spec, const char *dir assert(optlen > 0); optstr = strdup(optptr); - assert(optptr != NULL); + assert(optstr != NULL); iov = NULL; iovlen = 0; Modified: stable/7/cddl/compat/opensolaris/misc/zone.c ============================================================================== --- stable/7/cddl/compat/opensolaris/misc/zone.c Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/compat/opensolaris/misc/zone.c Wed May 20 23:34:59 2009 (r192498) @@ -32,7 +32,7 @@ #include #include -int +zoneid_t getzoneid(void) { size_t size; @@ -42,5 +42,5 @@ getzoneid(void) size = sizeof(jailid); if (sysctlbyname("security.jail.jailed", &jailid, &size, NULL, 0) == -1) assert(!"No security.jail.jailed sysctl!"); - return (jailid); + return ((zoneid_t)jailid); } Modified: stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Wed May 20 23:34:59 2009 (r192498) @@ -28,13 +28,18 @@ zdb \- ZFS debugger .fi .SH DESCRIPTION +.sp .LP The \fBzdb\fR command is used by support engineers to diagnose failures and gather statistics. Since the \fBZFS\fR file system is always consistent on disk and is self-repairing, \fBzdb\fR should only be run under the direction by a support engineer. +.sp .LP If no arguments are specified, \fBzdb\fR, performs basic consistency checks on the pool and associated datasets, and report any problems detected. +.sp .LP Any options supported by this command are internal to Sun and subject to change at any time. .SH EXIT STATUS + +.sp .LP The following exit values are returned: .sp @@ -71,6 +76,9 @@ Invalid command line options were specif .RE .SH ATTRIBUTES + +.sp + .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -89,5 +97,6 @@ Interface StabilityUnstable .TE .SH SEE ALSO +.sp .LP \fBzfs\fR(1M), \fBzpool\fR(1M), \fBattributes\fR(5) Modified: stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed May 20 23:34:59 2009 (r192498) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -51,6 +49,10 @@ #include #include #include +#include +#undef ZFS_MAXNAMELEN +#undef verify +#include const char cmdname[] = "zdb"; uint8_t dump_opt[256]; @@ -62,6 +64,9 @@ uint64_t *zopt_object = NULL; int zopt_objects = 0; int zdb_advance = ADVANCE_PRE; zbookmark_t zdb_noread = { 0, 0, ZB_NO_LEVEL, 0 }; +libzfs_handle_t *g_zfs; +boolean_t zdb_sig_user_data = B_TRUE; +int zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256; /* * These libumem hooks provide a reasonable set of defaults for the allocator's @@ -83,12 +88,15 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-udibcsvLU] [-O order] [-B os:obj:level:blkid] " + "Usage: %s [-udibcsvL] [-U cachefile_path] [-O order] " + "[-B os:obj:level:blkid] [-S user:cksumalg] " "dataset [object...]\n" " %s -C [pool]\n" " %s -l dev\n" - " %s -R vdev:offset:size:flags\n", - cmdname, cmdname, cmdname, cmdname); + " %s -R pool:vdev:offset:size:flags\n" + " %s [-p path_to_vdev_dir]\n" + " %s -e pool | GUID | devid ...\n", + cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); (void) fprintf(stderr, " -u uberblock\n"); (void) fprintf(stderr, " -d datasets\n"); @@ -97,16 +105,22 @@ usage(void) (void) fprintf(stderr, " -b block statistics\n"); (void) fprintf(stderr, " -c checksum all data blocks\n"); (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); + (void) fprintf(stderr, " -S : -- " + "dump blkptr signatures\n"); (void) fprintf(stderr, " -v verbose (applies to all others)\n"); (void) fprintf(stderr, " -l dump label contents\n"); (void) fprintf(stderr, " -L live pool (allows some errors)\n"); (void) fprintf(stderr, " -O [!] " "visitation order\n"); - (void) fprintf(stderr, " -U use zpool.cache in /tmp\n"); + (void) fprintf(stderr, " -U cachefile_path -- use alternate " + "cachefile\n"); (void) fprintf(stderr, " -B objset:object:level:blkid -- " "simulate bad block\n"); - (void) fprintf(stderr, " -R read and display block from a" + (void) fprintf(stderr, " -R read and display block from a " "device\n"); + (void) fprintf(stderr, " -e Pool is exported/destroyed/" + "has altroot\n"); + (void) fprintf(stderr, " -p (use with -e)\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -367,6 +381,44 @@ dump_zap(objset_t *os, uint64_t object, zap_cursor_fini(&zc); } +/*ARGSUSED*/ +static void +dump_zpldir(objset_t *os, uint64_t object, void *data, size_t size) +{ + zap_cursor_t zc; + zap_attribute_t attr; + const char *typenames[] = { + /* 0 */ "not specified", + /* 1 */ "FIFO", + /* 2 */ "Character Device", + /* 3 */ "3 (invalid)", + /* 4 */ "Directory", + /* 5 */ "5 (invalid)", + /* 6 */ "Block Device", + /* 7 */ "7 (invalid)", + /* 8 */ "Regular File", + /* 9 */ "9 (invalid)", + /* 10 */ "Symbolic Link", + /* 11 */ "11 (invalid)", + /* 12 */ "Socket", + /* 13 */ "Door", + /* 14 */ "Event Port", + /* 15 */ "15 (invalid)", + }; + + dump_zap_stats(os, object); + (void) printf("\n"); + + for (zap_cursor_init(&zc, os, object); + zap_cursor_retrieve(&zc, &attr) == 0; + zap_cursor_advance(&zc)) { + (void) printf("\t\t%s = %lld (type: %s)\n", + attr.za_name, ZFS_DIRENT_OBJ(attr.za_first_integer), + typenames[ZFS_DIRENT_TYPE(attr.za_first_integer)]); + } + zap_cursor_fini(&zc); +} + static void dump_spacemap(objset_t *os, space_map_obj_t *smo, space_map_t *sm) { @@ -456,10 +508,7 @@ dump_metaslabs(spa_t *spa) for (c = 0; c < rvd->vdev_children; c++) { vd = rvd->vdev_child[c]; - spa_config_enter(spa, RW_READER, FTAG); - (void) printf("\n vdev %llu = %s\n\n", - (u_longlong_t)vd->vdev_id, vdev_description(vd)); - spa_config_exit(spa, FTAG); + (void) printf("\n vdev %llu\n\n", (u_longlong_t)vd->vdev_id); if (dump_opt['d'] <= 5) { (void) printf("\t%10s %10s %5s\n", @@ -477,7 +526,6 @@ static void dump_dtl(vdev_t *vd, int indent) { avl_tree_t *t = &vd->vdev_dtl_map.sm_root; - spa_t *spa = vd->vdev_spa; space_seg_t *ss; vdev_t *pvd; int c; @@ -485,9 +533,10 @@ dump_dtl(vdev_t *vd, int indent) if (indent == 0) (void) printf("\nDirty time logs:\n\n"); - spa_config_enter(spa, RW_READER, FTAG); - (void) printf("\t%*s%s\n", indent, "", vdev_description(vd)); - spa_config_exit(spa, FTAG); + (void) printf("\t%*s%s\n", indent, "", + vd->vdev_path ? vd->vdev_path : + vd->vdev_parent ? vd->vdev_ops->vdev_op_type : + spa_name(vd->vdev_spa)); for (ss = avl_first(t); ss; ss = AVL_NEXT(t, ss)) { /* @@ -670,36 +719,49 @@ dump_dsl_dir(objset_t *os, uint64_t obje { dsl_dir_phys_t *dd = data; time_t crtime; - char used[6], compressed[6], uncompressed[6], quota[6], resv[6]; + char nice[6]; if (dd == NULL) return; - ASSERT(size == sizeof (*dd)); + ASSERT3U(size, >=, sizeof (dsl_dir_phys_t)); crtime = dd->dd_creation_time; - nicenum(dd->dd_used_bytes, used); - nicenum(dd->dd_compressed_bytes, compressed); - nicenum(dd->dd_uncompressed_bytes, uncompressed); - nicenum(dd->dd_quota, quota); - nicenum(dd->dd_reserved, resv); - (void) printf("\t\tcreation_time = %s", ctime(&crtime)); (void) printf("\t\thead_dataset_obj = %llu\n", (u_longlong_t)dd->dd_head_dataset_obj); (void) printf("\t\tparent_dir_obj = %llu\n", (u_longlong_t)dd->dd_parent_obj); - (void) printf("\t\tclone_parent_obj = %llu\n", - (u_longlong_t)dd->dd_clone_parent_obj); + (void) printf("\t\torigin_obj = %llu\n", + (u_longlong_t)dd->dd_origin_obj); (void) printf("\t\tchild_dir_zapobj = %llu\n", (u_longlong_t)dd->dd_child_dir_zapobj); - (void) printf("\t\tused_bytes = %s\n", used); - (void) printf("\t\tcompressed_bytes = %s\n", compressed); - (void) printf("\t\tuncompressed_bytes = %s\n", uncompressed); - (void) printf("\t\tquota = %s\n", quota); - (void) printf("\t\treserved = %s\n", resv); + nicenum(dd->dd_used_bytes, nice); + (void) printf("\t\tused_bytes = %s\n", nice); + nicenum(dd->dd_compressed_bytes, nice); + (void) printf("\t\tcompressed_bytes = %s\n", nice); + nicenum(dd->dd_uncompressed_bytes, nice); + (void) printf("\t\tuncompressed_bytes = %s\n", nice); + nicenum(dd->dd_quota, nice); + (void) printf("\t\tquota = %s\n", nice); + nicenum(dd->dd_reserved, nice); + (void) printf("\t\treserved = %s\n", nice); (void) printf("\t\tprops_zapobj = %llu\n", (u_longlong_t)dd->dd_props_zapobj); + (void) printf("\t\tdeleg_zapobj = %llu\n", + (u_longlong_t)dd->dd_deleg_zapobj); + (void) printf("\t\tflags = %llx\n", + (u_longlong_t)dd->dd_flags); + +#define DO(which) \ + nicenum(dd->dd_used_breakdown[DD_USED_ ## which], nice); \ + (void) printf("\t\tused_breakdown[" #which "] = %s\n", nice) + DO(HEAD); + DO(SNAP); + DO(CHILD); + DO(CHILD_RSRV); + DO(REFRSRV); +#undef DO } /*ARGSUSED*/ @@ -722,7 +784,7 @@ dump_dsl_dataset(objset_t *os, uint64_t nicenum(ds->ds_unique_bytes, unique); sprintf_blkptr(blkbuf, BP_SPRINTF_LEN, &ds->ds_bp); - (void) printf("\t\tdataset_obj = %llu\n", + (void) printf("\t\tdir_obj = %llu\n", (u_longlong_t)ds->ds_dir_obj); (void) printf("\t\tprev_snap_obj = %llu\n", (u_longlong_t)ds->ds_prev_snap_obj); @@ -749,6 +811,10 @@ dump_dsl_dataset(objset_t *os, uint64_t (u_longlong_t)ds->ds_guid); (void) printf("\t\tflags = %llx\n", (u_longlong_t)ds->ds_flags); + (void) printf("\t\tnext_clones_obj = %llu\n", + (u_longlong_t)ds->ds_next_clones_obj); + (void) printf("\t\tprops_obj = %llu\n", + (u_longlong_t)ds->ds_props_obj); (void) printf("\t\tbp = %s\n", blkbuf); } @@ -765,9 +831,11 @@ dump_bplist(objset_t *mos, uint64_t obje if (dump_opt['d'] < 3) return; + mutex_init(&bpl.bpl_lock, NULL, MUTEX_DEFAULT, NULL); VERIFY(0 == bplist_open(&bpl, mos, object)); if (bplist_empty(&bpl)) { bplist_close(&bpl); + mutex_destroy(&bpl.bpl_lock); return; } @@ -785,6 +853,7 @@ dump_bplist(objset_t *mos, uint64_t obje if (dump_opt['d'] < 5) { bplist_close(&bpl); + mutex_destroy(&bpl.bpl_lock); return; } @@ -800,6 +869,65 @@ dump_bplist(objset_t *mos, uint64_t obje } bplist_close(&bpl); + mutex_destroy(&bpl.bpl_lock); +} + +static avl_tree_t idx_tree; +static avl_tree_t domain_tree; +static boolean_t fuid_table_loaded; + +static void +fuid_table_destroy() +{ + if (fuid_table_loaded) { + zfs_fuid_table_destroy(&idx_tree, &domain_tree); + fuid_table_loaded = B_FALSE; + } +} + +/* + * print uid or gid information. + * For normal POSIX id just the id is printed in decimal format. + * For CIFS files with FUID the fuid is printed in hex followed by + * the doman-rid string. + */ +static void +print_idstr(uint64_t id, const char *id_type) +{ + if (FUID_INDEX(id)) { + char *domain; + + domain = zfs_fuid_idx_domain(&idx_tree, FUID_INDEX(id)); + (void) printf("\t%s %llx [%s-%d]\n", id_type, + (u_longlong_t)id, domain, (int)FUID_RID(id)); + } else { + (void) printf("\t%s %llu\n", id_type, (u_longlong_t)id); + } + +} + +static void +dump_uidgid(objset_t *os, znode_phys_t *zp) +{ + uint32_t uid_idx, gid_idx; + + uid_idx = FUID_INDEX(zp->zp_uid); + gid_idx = FUID_INDEX(zp->zp_gid); + + /* Load domain table, if not already loaded */ + if (!fuid_table_loaded && (uid_idx || gid_idx)) { + uint64_t fuid_obj; + + /* first find the fuid object. It lives in the master node */ + VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZFS_FUID_TABLES, + 8, 1, &fuid_obj) == 0); + (void) zfs_fuid_table_load(os, fuid_obj, + &idx_tree, &domain_tree); + fuid_table_loaded = B_TRUE; + } + + print_idstr(zp->zp_uid, "uid"); + print_idstr(zp->zp_gid, "gid"); } /*ARGSUSED*/ @@ -830,6 +958,7 @@ dump_znode(objset_t *os, uint64_t object z_ctime = (time_t)zp->zp_ctime[0]; (void) printf("\tpath %s\n", path); + dump_uidgid(os, zp); (void) printf("\tatime %s", ctime(&z_atime)); (void) printf("\tmtime %s", ctime(&z_mtime)); (void) printf("\tctime %s", ctime(&z_ctime)); @@ -874,9 +1003,9 @@ static object_viewer_t *object_viewer[DM dump_zap, /* DSL props */ dump_dsl_dataset, /* DSL dataset */ dump_znode, /* ZFS znode */ - dump_acl, /* ZFS ACL */ + dump_acl, /* ZFS V0 ACL */ dump_uint8, /* ZFS plain file */ - dump_zap, /* ZFS directory */ + dump_zpldir, /* ZFS directory */ dump_zap, /* ZFS master node */ dump_zap, /* ZFS delete queue */ dump_uint8, /* zvol object */ @@ -888,6 +1017,13 @@ static object_viewer_t *object_viewer[DM dump_uint8, /* SPA history */ dump_uint64, /* SPA history offsets */ dump_zap, /* Pool properties */ + dump_zap, /* DSL permissions */ + dump_acl, /* ZFS ACL */ + dump_uint8, /* ZFS SYSACL */ + dump_none, /* FUID nvlist */ + dump_packed_nvlist, /* FUID nvlist size */ + dump_zap, /* DSL dataset next clones */ + dump_zap, /* DSL scrub queue */ }; static void @@ -930,13 +1066,15 @@ dump_object(objset_t *os, uint64_t objec aux[0] = '\0'; - if (doi.doi_checksum != ZIO_CHECKSUM_INHERIT || verbosity >= 6) + if (doi.doi_checksum != ZIO_CHECKSUM_INHERIT || verbosity >= 6) { (void) snprintf(aux + strlen(aux), sizeof (aux), " (K=%s)", zio_checksum_table[doi.doi_checksum].ci_name); + } - if (doi.doi_compress != ZIO_COMPRESS_INHERIT || verbosity >= 6) + if (doi.doi_compress != ZIO_COMPRESS_INHERIT || verbosity >= 6) { (void) snprintf(aux + strlen(aux), sizeof (aux), " (Z=%s)", zio_compress_table[doi.doi_compress].ci_name); + } (void) printf("%10lld %3u %5s %5s %5s %5s %s%s\n", (u_longlong_t)object, doi.doi_indirection, iblk, dblk, lsize, @@ -972,13 +1110,13 @@ dump_object(objset_t *os, uint64_t objec } for (;;) { - error = dnode_next_offset(dn, B_FALSE, &start, minlvl, - blkfill, 0); + error = dnode_next_offset(dn, + 0, &start, minlvl, blkfill, 0); if (error) break; end = start; - error = dnode_next_offset(dn, B_TRUE, &end, minlvl, - blkfill, 0); + error = dnode_next_offset(dn, + DNODE_FIND_HOLE, &end, minlvl, blkfill, 0); nicenum(end - start, segsize); (void) printf("\t\tsegment [%016llx, %016llx)" " size %5s\n", (u_longlong_t)start, @@ -996,7 +1134,6 @@ dump_object(objset_t *os, uint64_t objec static char *objset_types[DMU_OST_NUMTYPES] = { "NONE", "META", "ZPL", "ZVOL", "OTHER", "ANY" }; -/*ARGSUSED*/ static void dump_dir(objset_t *os) { @@ -1019,8 +1156,8 @@ dump_dir(objset_t *os) if (dds.dds_type == DMU_OST_META) { dds.dds_creation_txg = TXG_INITIAL; usedobjs = os->os->os_rootbp->blk_fill; - refdbytes = - os->os->os_spa->spa_dsl_pool->dp_mos_dir->dd_used_bytes; + refdbytes = os->os->os_spa->spa_dsl_pool-> + dp_mos_dir->dd_phys->dd_used_bytes; } else { dmu_objset_space(os, &refdbytes, &scratch, &usedobjs, &scratch); } @@ -1054,6 +1191,9 @@ dump_dir(objset_t *os) if (verbosity < 2) return; + if (os->os->os_rootbp->blk_birth == 0) + return; + if (zopt_objects != 0) { for (i = 0; i < zopt_objects; i++) dump_object(os, zopt_object[i], verbosity, @@ -1115,6 +1255,52 @@ dump_config(const char *pool) } static void +dump_cachefile(const char *cachefile) +{ + int fd; + struct stat64 statbuf; + char *buf; + nvlist_t *config; + + if ((fd = open64(cachefile, O_RDONLY)) < 0) { + (void) printf("cannot open '%s': %s\n", cachefile, + strerror(errno)); + exit(1); + } + + if (fstat64(fd, &statbuf) != 0) { + (void) printf("failed to stat '%s': %s\n", cachefile, + strerror(errno)); + exit(1); + } + + if ((buf = malloc(statbuf.st_size)) == NULL) { + (void) fprintf(stderr, "failed to allocate %llu bytes\n", + (u_longlong_t)statbuf.st_size); + exit(1); + } + + if (read(fd, buf, statbuf.st_size) != statbuf.st_size) { + (void) fprintf(stderr, "failed to read %llu bytes\n", + (u_longlong_t)statbuf.st_size); + exit(1); + } + + (void) close(fd); + + if (nvlist_unpack(buf, statbuf.st_size, &config, 0) != 0) { + (void) fprintf(stderr, "failed to unpack nvlist\n"); + exit(1); + } + + free(buf); + + dump_nvlist(config, 0); + + nvlist_free(config); +} + +static void dump_label(const char *dev) { int fd; @@ -1178,170 +1364,84 @@ dump_one_dir(char *dsname, void *arg) objset_t *os; error = dmu_objset_open(dsname, DMU_OST_ANY, - DS_MODE_STANDARD | DS_MODE_READONLY, &os); + DS_MODE_USER | DS_MODE_READONLY, &os); if (error) { (void) printf("Could not open %s\n", dsname); return (0); } dump_dir(os); dmu_objset_close(os); + fuid_table_destroy(); return (0); } static void -zdb_space_map_load(spa_t *spa) +zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) { - vdev_t *rvd = spa->spa_root_vdev; - vdev_t *vd; - int c, m, error; + vdev_t *vd = sm->sm_ppd; - for (c = 0; c < rvd->vdev_children; c++) { - vd = rvd->vdev_child[c]; - for (m = 0; m < vd->vdev_ms_count; m++) { - metaslab_t *msp = vd->vdev_ms[m]; - mutex_enter(&msp->ms_lock); - error = space_map_load(&msp->ms_allocmap[0], NULL, - SM_ALLOC, &msp->ms_smo, spa->spa_meta_objset); - mutex_exit(&msp->ms_lock); - if (error) - fatal("%s bad space map #%d, error %d", - spa->spa_name, c, error); - } - } + (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", + (u_longlong_t)vd->vdev_id, (u_longlong_t)start, (u_longlong_t)size); } -static int -zdb_space_map_claim(spa_t *spa, blkptr_t *bp, zbookmark_t *zb) +/* ARGSUSED */ +static void +zdb_space_map_load(space_map_t *sm) { - dva_t *dva = bp->blk_dva; - vdev_t *vd; - metaslab_t *msp; - space_map_t *allocmap, *freemap; - int error; - int d; - blkptr_t blk = *bp; - - for (d = 0; d < BP_GET_NDVAS(bp); d++) { - uint64_t vdev = DVA_GET_VDEV(&dva[d]); - uint64_t offset = DVA_GET_OFFSET(&dva[d]); - uint64_t size = DVA_GET_ASIZE(&dva[d]); - - if ((vd = vdev_lookup_top(spa, vdev)) == NULL) - return (ENXIO); - - if ((offset >> vd->vdev_ms_shift) >= vd->vdev_ms_count) - return (ENXIO); - - msp = vd->vdev_ms[offset >> vd->vdev_ms_shift]; - allocmap = &msp->ms_allocmap[0]; - freemap = &msp->ms_freemap[0]; - - /* Prepare our copy of the bp in case we need to read GBHs */ - if (DVA_GET_GANG(&dva[d])) { - size = vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE); - DVA_SET_ASIZE(&blk.blk_dva[d], size); - DVA_SET_GANG(&blk.blk_dva[d], 0); - } - - mutex_enter(&msp->ms_lock); - if (space_map_contains(freemap, offset, size)) { - mutex_exit(&msp->ms_lock); - return (EAGAIN); /* allocated more than once */ - } - - if (!space_map_contains(allocmap, offset, size)) { - mutex_exit(&msp->ms_lock); - return (ESTALE); /* not allocated at all */ - } - - space_map_remove(allocmap, offset, size); - space_map_add(freemap, offset, size); - - mutex_exit(&msp->ms_lock); - } - - if (BP_IS_GANG(bp)) { - zio_gbh_phys_t gbh; - int g; - - /* LINTED - compile time assert */ - ASSERT(sizeof (zio_gbh_phys_t) == SPA_GANGBLOCKSIZE); - - BP_SET_CHECKSUM(&blk, ZIO_CHECKSUM_GANG_HEADER); - BP_SET_PSIZE(&blk, SPA_GANGBLOCKSIZE); - BP_SET_LSIZE(&blk, SPA_GANGBLOCKSIZE); - BP_SET_COMPRESS(&blk, ZIO_COMPRESS_OFF); - error = zio_wait(zio_read(NULL, spa, &blk, &gbh, - SPA_GANGBLOCKSIZE, NULL, NULL, ZIO_PRIORITY_SYNC_READ, - ZIO_FLAG_CANFAIL | ZIO_FLAG_CONFIG_HELD, zb)); - if (error) - return (error); - if (BP_SHOULD_BYTESWAP(&blk)) - byteswap_uint64_array(&gbh, SPA_GANGBLOCKSIZE); - for (g = 0; g < SPA_GBH_NBLKPTRS; g++) { - if (BP_IS_HOLE(&gbh.zg_blkptr[g])) - break; - error = zdb_space_map_claim(spa, &gbh.zg_blkptr[g], zb); - if (error) - return (error); - } - } - - return (0); } static void -zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) +zdb_space_map_unload(space_map_t *sm) { - metaslab_t *msp; - - /* LINTED */ - msp = (metaslab_t *)((char *)sm - offsetof(metaslab_t, ms_allocmap[0])); + space_map_vacate(sm, zdb_leak, sm); +} - (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", - (u_longlong_t)msp->ms_group->mg_vd->vdev_id, - (u_longlong_t)start, - (u_longlong_t)size); +/* ARGSUSED */ +static void +zdb_space_map_claim(space_map_t *sm, uint64_t start, uint64_t size) +{ } +static space_map_ops_t zdb_space_map_ops = { + zdb_space_map_load, + zdb_space_map_unload, + NULL, /* alloc */ + zdb_space_map_claim, + NULL /* free */ +}; + static void -zdb_space_map_unload(spa_t *spa) +zdb_leak_init(spa_t *spa) { vdev_t *rvd = spa->spa_root_vdev; - vdev_t *vd; - int c, m; - for (c = 0; c < rvd->vdev_children; c++) { - vd = rvd->vdev_child[c]; - for (m = 0; m < vd->vdev_ms_count; m++) { + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *vd = rvd->vdev_child[c]; + for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_vacate(&msp->ms_allocmap[0], zdb_leak, - &msp->ms_allocmap[0]); - space_map_unload(&msp->ms_allocmap[0]); - space_map_vacate(&msp->ms_freemap[0], NULL, NULL); + VERIFY(space_map_load(&msp->ms_map, &zdb_space_map_ops, + SM_ALLOC, &msp->ms_smo, spa->spa_meta_objset) == 0); + msp->ms_map.sm_ppd = vd; mutex_exit(&msp->ms_lock); } } } static void -zdb_refresh_ubsync(spa_t *spa) +zdb_leak_fini(spa_t *spa) { - uberblock_t ub = { 0 }; vdev_t *rvd = spa->spa_root_vdev; - zio_t *zio; - - /* - * Reload the uberblock. - */ - zio = zio_root(spa, NULL, NULL, - ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE); - vdev_uberblock_load(zio, rvd, &ub); - (void) zio_wait(zio); - if (ub.ub_txg != 0) - spa->spa_ubsync = ub; + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *vd = rvd->vdev_child[c]; + for (int m = 0; m < vd->vdev_ms_count; m++) { + metaslab_t *msp = vd->vdev_ms[m]; + mutex_enter(&msp->ms_lock); + space_map_unload(&msp->ms_map); + mutex_exit(&msp->ms_lock); + } + } } /* @@ -1371,9 +1471,7 @@ typedef struct zdb_cb { static void zdb_count_block(spa_t *spa, zdb_cb_t *zcb, blkptr_t *bp, int type) { - int i, error; - - for (i = 0; i < 4; i++) { + for (int i = 0; i < 4; i++) { int l = (i < 2) ? BP_GET_LEVEL(bp) : ZB_TOTAL; int t = (i & 1) ? type : DMU_OT_TOTAL; zdb_blkstats_t *zb = &zcb->zcb_type[l][t]; @@ -1384,21 +1482,34 @@ zdb_count_block(spa_t *spa, zdb_cb_t *zc zb->zb_count++; } - if (dump_opt['L']) - return; + if (dump_opt['S']) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Thu May 21 02:18:11 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 667F6106566B; Thu, 21 May 2009 02:18:11 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54BC58FC0A; Thu, 21 May 2009 02:18:11 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4L2IBbD051335; Thu, 21 May 2009 02:18:11 GMT (envelope-from brd@svn.freebsd.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4L2IB3V051334; Thu, 21 May 2009 02:18:11 GMT (envelope-from brd@svn.freebsd.org) Message-Id: <200905210218.n4L2IB3V051334@svn.freebsd.org> From: Brad Davis Date: Thu, 21 May 2009 02:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192507 - stable/7 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 02:18:12 -0000 Author: brd (doc committer) Date: Thu May 21 02:18:10 2009 New Revision: 192507 URL: http://svn.freebsd.org/changeset/base/192507 Log: Add some missing blank lines. Approved by: kmacy@ Modified: stable/7/UPDATING Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Thu May 21 02:12:10 2009 (r192506) +++ stable/7/UPDATING Thu May 21 02:18:10 2009 (r192507) @@ -7,12 +7,14 @@ done items, please see the COMMON ITEMS: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. + 20090520 Update ZFS to version 13. ZFS users will need to re-build kernel and world. Existing pools will continue to work without upgrade. If a pool is upgraded it will no longer be usable by older kernel revs. ZFS send / recv between pool version 6 and pool version 13 is not supported. + 20090504: FreeBSD 7.2-RELEASE From owner-svn-src-stable-7@FreeBSD.ORG Thu May 21 04:49:03 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424C4106566B; Thu, 21 May 2009 04:49:03 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FBF28FC08; Thu, 21 May 2009 04:49:03 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4L4n36i055005; Thu, 21 May 2009 04:49:03 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4L4n3O8055004; Thu, 21 May 2009 04:49:03 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200905210449.n4L4n3O8055004@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 21 May 2009 04:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192521 - stable/7/usr.bin/ncal X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 04:49:03 -0000 Author: ru Date: Thu May 21 04:49:02 2009 New Revision: 192521 URL: http://svn.freebsd.org/changeset/base/192521 Log: Fixed multi-byte character support to actually work. Modified: stable/7/usr.bin/ncal/ (props changed) stable/7/usr.bin/ncal/ncal.c Modified: stable/7/usr.bin/ncal/ncal.c ============================================================================== --- stable/7/usr.bin/ncal/ncal.c Thu May 21 04:44:21 2009 (r192520) +++ stable/7/usr.bin/ncal/ncal.c Thu May 21 04:49:02 2009 (r192521) @@ -423,7 +423,7 @@ printmonth(int y, int m, int jd_flag) mkweekdays(&wds); printf(" %ls %d\n", month.name, y); for (i = 0; i != 7; i++) - printf("%.2ls%s\n", wds.names[i], month.lines[i]); + wprintf(L"%.2ls%s\n", wds.names[i], month.lines[i]); if (flag_weeks) printf(" %s\n", month.weeks); } @@ -479,17 +479,17 @@ printyear(int y, int jd_flag) printf("%s\n", center(t, s, mpl * mw)); for (j = 0; j != 12; j += mpl) { - printf(" %-*ls%-*ls", + wprintf(L" %-*ls%-*ls", mw, year[j].name, mw, year[j + 1].name); if (mpl == 3) printf("%ls\n", year[j + 2].name); else - printf("%-*ls%ls\n", + wprintf(L"%-*ls%ls\n", mw, year[j + 2].name, year[j + 3].name); for (i = 0; i != 7; i++) { - printf("%.2ls%-*s%-*s", + wprintf(L"%.2ls%-*s%-*s", wds.names[i], mw, year[j].lines[i], mw, year[j + 1].lines[i]); @@ -537,11 +537,11 @@ printyearb(int y, int jd_flag) printf("%s\n\n", center(t, s, mw * mpl + mpl)); for (j = 0; j != 12; j += mpl) { - printf("%-*ls ", mw, wcenter(ws, year[j].name, mw)); + wprintf(L"%-*ls ", mw, wcenter(ws, year[j].name, mw)); if (mpl == 2) printf("%ls\n", wcenter(ws, year[j + 1].name, mw)); else - printf("%-*ls %ls\n", mw, + wprintf(L"%-*ls %ls\n", mw, wcenter(ws, year[j + 1].name, mw), wcenter(wt, year[j + 2].name, mw)); From owner-svn-src-stable-7@FreeBSD.ORG Thu May 21 05:38:51 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E2A106564A; Thu, 21 May 2009 05:38:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D7DF8FC13; Thu, 21 May 2009 05:38:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4L5co3A056075; Thu, 21 May 2009 05:38:50 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4L5coeY056074; Thu, 21 May 2009 05:38:50 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905210538.n4L5coeY056074@svn.freebsd.org> From: Kip Macy Date: Thu, 21 May 2009 05:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192522 - stable/7/cddl/compat/opensolaris/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 05:38:52 -0000 Author: kmacy Date: Thu May 21 05:38:50 2009 New Revision: 192522 URL: http://svn.freebsd.org/changeset/base/192522 Log: remove duplicate patching Modified: stable/7/cddl/compat/opensolaris/include/libshare.h Modified: stable/7/cddl/compat/opensolaris/include/libshare.h ============================================================================== --- stable/7/cddl/compat/opensolaris/include/libshare.h Thu May 21 04:49:02 2009 (r192521) +++ stable/7/cddl/compat/opensolaris/include/libshare.h Thu May 21 05:38:50 2009 (r192522) @@ -34,111 +34,3 @@ #define SA_INIT_CONTROL_API 0 #endif /* !_OPENSOLARIS_LIBSHARE_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_LIBSHARE_H_ -#define _OPENSOLARIS_LIBSHARE_H_ - -#define SA_OK 0 - -#define SA_INIT_CONTROL_API 0 - -#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_LIBSHARE_H_ -#define _OPENSOLARIS_LIBSHARE_H_ - -#define SA_OK 0 - -#define SA_INIT_CONTROL_API 0 - -#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_LIBSHARE_H_ -#define _OPENSOLARIS_LIBSHARE_H_ - -#define SA_OK 0 - -#define SA_INIT_CONTROL_API 0 - -#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ From owner-svn-src-stable-7@FreeBSD.ORG Thu May 21 05:58:30 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5318D106564A; Thu, 21 May 2009 05:58:30 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E7E88FC1A; Thu, 21 May 2009 05:58:30 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4L5wUIG056552; Thu, 21 May 2009 05:58:30 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4L5wU09056549; Thu, 21 May 2009 05:58:30 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905210558.n4L5wU09056549@svn.freebsd.org> From: Kip Macy Date: Thu, 21 May 2009 05:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192523 - stable/7/sys/cddl/compat/opensolaris/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 05:58:30 -0000 Author: kmacy Date: Thu May 21 05:58:29 2009 New Revision: 192523 URL: http://svn.freebsd.org/changeset/base/192523 Log: remove duplicated file contents Reported by: pluknet@gmail.com Modified: stable/7/sys/cddl/compat/opensolaris/sys/file.h stable/7/sys/cddl/compat/opensolaris/sys/kidmap.h stable/7/sys/cddl/compat/opensolaris/sys/pathname.h Modified: stable/7/sys/cddl/compat/opensolaris/sys/file.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/file.h Thu May 21 05:38:50 2009 (r192522) +++ stable/7/sys/cddl/compat/opensolaris/sys/file.h Thu May 21 05:58:29 2009 (r192523) @@ -55,174 +55,3 @@ releasef(file_t *fp) #endif /* _KERNEL */ #endif /* !_OPENSOLARIS_SYS_FILE_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_FILE_H_ -#define _OPENSOLARIS_SYS_FILE_H_ - -#include_next - -#ifdef _KERNEL -typedef struct file file_t; - -static __inline file_t * -getf(int fd, int write) -{ - struct file *fp; - - if (write && fget_write(curthread, fd, &fp) == 0) - return (fp); - else if (!write && fget_read(curthread, fd, &fp) == 0) - return (fp); - return (NULL); -} - -static __inline void -releasef(file_t *fp) -{ - - fdrop(fp, curthread); -} -#endif /* _KERNEL */ - -#endif /* !_OPENSOLARIS_SYS_FILE_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_FILE_H_ -#define _OPENSOLARIS_SYS_FILE_H_ - -#include_next - -#ifdef _KERNEL -typedef struct file file_t; - -static __inline file_t * -getf(int fd, int write) -{ - struct file *fp; - - if (write && fget_write(curthread, fd, &fp) == 0) - return (fp); - else if (!write && fget_read(curthread, fd, &fp) == 0) - return (fp); - return (NULL); -} - -static __inline void -releasef(file_t *fp) -{ - - fdrop(fp, curthread); -} -#endif /* _KERNEL */ - -#endif /* !_OPENSOLARIS_SYS_FILE_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_FILE_H_ -#define _OPENSOLARIS_SYS_FILE_H_ - -#include_next - -#ifdef _KERNEL -typedef struct file file_t; - -static __inline file_t * -getf(int fd, int write) -{ - struct file *fp; - - if (write && fget_write(curthread, fd, &fp) == 0) - return (fp); - else if (!write && fget_read(curthread, fd, &fp) == 0) - return (fp); - return (NULL); -} - -static __inline void -releasef(file_t *fp) -{ - - fdrop(fp, curthread); -} -#endif /* _KERNEL */ - -#endif /* !_OPENSOLARIS_SYS_FILE_H_ */ Modified: stable/7/sys/cddl/compat/opensolaris/sys/kidmap.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/kidmap.h Thu May 21 05:38:50 2009 (r192522) +++ stable/7/sys/cddl/compat/opensolaris/sys/kidmap.h Thu May 21 05:58:29 2009 (r192523) @@ -39,126 +39,3 @@ typedef void idmap_get_handle_t; #define kidmap_get_mappings(hdl) (NULL) #endif /* _OPENSOLARIS_SYS_KIDMAP_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_KIDMAP_H_ -#define _OPENSOLARIS_SYS_KIDMAP_H_ - -#include - -typedef int32_t idmap_stat; -typedef void idmap_get_handle_t; - -#define kidmap_get_create() (NULL) -#define kidmap_get_destroy(hdl) do { } while (0) -#define kidmap_get_mappings(hdl) (NULL) - -#endif /* _OPENSOLARIS_SYS_KIDMAP_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_KIDMAP_H_ -#define _OPENSOLARIS_SYS_KIDMAP_H_ - -#include - -typedef int32_t idmap_stat; -typedef void idmap_get_handle_t; - -#define kidmap_get_create() (NULL) -#define kidmap_get_destroy(hdl) do { } while (0) -#define kidmap_get_mappings(hdl) (NULL) - -#endif /* _OPENSOLARIS_SYS_KIDMAP_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_KIDMAP_H_ -#define _OPENSOLARIS_SYS_KIDMAP_H_ - -#include - -typedef int32_t idmap_stat; -typedef void idmap_get_handle_t; - -#define kidmap_get_create() (NULL) -#define kidmap_get_destroy(hdl) do { } while (0) -#define kidmap_get_mappings(hdl) (NULL) - -#endif /* _OPENSOLARIS_SYS_KIDMAP_H_ */ Modified: stable/7/sys/cddl/compat/opensolaris/sys/pathname.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/pathname.h Thu May 21 05:38:50 2009 (r192522) +++ stable/7/sys/cddl/compat/opensolaris/sys/pathname.h Thu May 21 05:58:29 2009 (r192523) @@ -52,165 +52,3 @@ int traverse(vnode_t **, int); #endif /* _KERNEL */ #endif /* _OPENSOLARIS_SYS_PATHNAME_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_PATHNAME_H_ -#define _OPENSOLARIS_SYS_PATHNAME_H_ - -#ifdef _KERNEL - -#include -#include - -typedef struct pathname { - char *pn_buf; /* underlying storage */ - char *pn_path; /* remaining pathname */ - size_t pn_pathlen; /* remaining length */ - size_t pn_bufsize; /* total size of pn_buf */ -} pathname_t; - -#define pn_alloc(pnp) panic("pn_alloc() called") -#define pn_free(pnp) panic("pn_free() called") - -int lookupname(char *, enum uio_seg, enum symfollow, vnode_t **, vnode_t **); -int lookupnameat(char *, enum uio_seg, enum symfollow, vnode_t **, vnode_t **, - vnode_t *); -int traverse(vnode_t **, int); - -#endif /* _KERNEL */ - -#endif /* _OPENSOLARIS_SYS_PATHNAME_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_PATHNAME_H_ -#define _OPENSOLARIS_SYS_PATHNAME_H_ - -#ifdef _KERNEL - -#include -#include - -typedef struct pathname { - char *pn_buf; /* underlying storage */ - char *pn_path; /* remaining pathname */ - size_t pn_pathlen; /* remaining length */ - size_t pn_bufsize; /* total size of pn_buf */ -} pathname_t; - -#define pn_alloc(pnp) panic("pn_alloc() called") -#define pn_free(pnp) panic("pn_free() called") - -int lookupname(char *, enum uio_seg, enum symfollow, vnode_t **, vnode_t **); -int lookupnameat(char *, enum uio_seg, enum symfollow, vnode_t **, vnode_t **, - vnode_t *); -int traverse(vnode_t **, int); - -#endif /* _KERNEL */ - -#endif /* _OPENSOLARIS_SYS_PATHNAME_H_ */ -/*- - * Copyright (c) 2007 Pawel Jakub Dawidek - * 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_PATHNAME_H_ -#define _OPENSOLARIS_SYS_PATHNAME_H_ - -#ifdef _KERNEL - -#include -#include - -typedef struct pathname { - char *pn_buf; /* underlying storage */ - char *pn_path; /* remaining pathname */ - size_t pn_pathlen; /* remaining length */ - size_t pn_bufsize; /* total size of pn_buf */ -} pathname_t; - -#define pn_alloc(pnp) panic("pn_alloc() called") -#define pn_free(pnp) panic("pn_free() called") - -int lookupname(char *, enum uio_seg, enum symfollow, vnode_t **, vnode_t **); -int lookupnameat(char *, enum uio_seg, enum symfollow, vnode_t **, vnode_t **, - vnode_t *); -int traverse(vnode_t **, int); - -#endif /* _KERNEL */ - -#endif /* _OPENSOLARIS_SYS_PATHNAME_H_ */ From owner-svn-src-stable-7@FreeBSD.ORG Thu May 21 10:03:50 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA5F7106566C; Thu, 21 May 2009 10:03:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8B468FC08; Thu, 21 May 2009 10:03:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4LA3oJe061680; Thu, 21 May 2009 10:03:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4LA3olo061679; Thu, 21 May 2009 10:03:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200905211003.n4LA3olo061679@svn.freebsd.org> From: Ed Schouten Date: Thu, 21 May 2009 10:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192529 - stable/7 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 10:03:51 -0000 Author: ed Date: Thu May 21 10:03:50 2009 New Revision: 192529 URL: http://svn.freebsd.org/changeset/base/192529 Log: Add missing colon. Modified: stable/7/UPDATING Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Thu May 21 09:45:47 2009 (r192528) +++ stable/7/UPDATING Thu May 21 10:03:50 2009 (r192529) @@ -8,7 +8,7 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. -20090520 +20090520: Update ZFS to version 13. ZFS users will need to re-build kernel and world. Existing pools will continue to work without upgrade. If a pool is upgraded it will no longer be From owner-svn-src-stable-7@FreeBSD.ORG Thu May 21 14:51:32 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EF001065677; Thu, 21 May 2009 14:51:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30CEB8FC17; Thu, 21 May 2009 14:51:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4LEpWDD069828; Thu, 21 May 2009 14:51:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4LEpWDu069827; Thu, 21 May 2009 14:51:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905211451.n4LEpWDu069827@svn.freebsd.org> From: John Baldwin Date: Thu, 21 May 2009 14:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192538 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 14:51:33 -0000 Author: jhb Date: Thu May 21 14:51:31 2009 New Revision: 192538 URL: http://svn.freebsd.org/changeset/base/192538 Log: MFC: Use a separate sx lock to try to limit wiring too much user memory for userland sysctl requests. "Small" userland requests can now run concurrently. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_sysctl.c Modified: stable/7/sys/kern/kern_sysctl.c ============================================================================== --- stable/7/sys/kern/kern_sysctl.c Thu May 21 14:43:12 2009 (r192537) +++ stable/7/sys/kern/kern_sysctl.c Thu May 21 14:51:31 2009 (r192538) @@ -76,11 +76,12 @@ static MALLOC_DEFINE(M_SYSCTLTMP, "sysct * API rather than using the dynamic API. Use of the dynamic API is * strongly encouraged for most code. * - * This lock is also used to serialize userland sysctl requests. Some - * sysctls wire user memory, and serializing the requests limits the - * amount of wired user memory in use. + * The sysctlmemlock is used to limit the amount of user memory wired for + * sysctl requests. This is implemented by serializing any userland + * sysctl requests larger than a single page via an exclusive lock. */ static struct sx sysctllock; +static struct sx sysctlmemlock; #define SYSCTL_SLOCK() sx_slock(&sysctllock) #define SYSCTL_SUNLOCK() sx_sunlock(&sysctllock) @@ -542,6 +543,7 @@ sysctl_register_all(void *arg) { struct sysctl_oid **oidp; + sx_init(&sysctlmemlock, "sysctl mem"); SYSCTL_INIT(); SYSCTL_XLOCK(); SET_FOREACH(oidp, sysctl_set) @@ -1466,7 +1468,7 @@ userland_sysctl(struct thread *td, int * size_t *oldlenp, int inkernel, void *new, size_t newlen, size_t *retval, int flags) { - int error = 0; + int error = 0, memlocked; struct sysctl_req req; bzero(&req, sizeof req); @@ -1506,13 +1508,19 @@ userland_sysctl(struct thread *td, int * if (KTRPOINT(curthread, KTR_SYSCTL)) ktrsysctl(name, namelen); #endif - - SYSCTL_XLOCK(); + + if (req.oldlen > PAGE_SIZE) { + memlocked = 1; + sx_xlock(&sysctlmemlock); + } else + memlocked = 0; for (;;) { req.oldidx = 0; req.newidx = 0; + SYSCTL_SLOCK(); error = sysctl_root(0, name, namelen, &req); + SYSCTL_SUNLOCK(); if (error != EAGAIN) break; uio_yield(); @@ -1521,7 +1529,8 @@ userland_sysctl(struct thread *td, int * if (req.lock == REQ_WIRED && req.validlen > 0) vsunlock(req.oldptr, req.validlen); - SYSCTL_XUNLOCK(); + if (memlocked) + sx_xunlock(&sysctlmemlock); if (error && error != ENOMEM) return (error); From owner-svn-src-stable-7@FreeBSD.ORG Thu May 21 17:09:24 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55FA5106564A; Thu, 21 May 2009 17:09:24 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 412998FC19; Thu, 21 May 2009 17:09:24 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4LH9Ok4073007; Thu, 21 May 2009 17:09:24 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4LH9O6G073003; Thu, 21 May 2009 17:09:24 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200905211709.n4LH9O6G073003@svn.freebsd.org> From: Rui Paulo Date: Thu, 21 May 2009 17:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192548 - in stable/7/sys: . conf contrib/pf dev/amdtemp dev/ath/ath_hal dev/cxgb dev/k8temp modules modules/amdtemp modules/k8temp X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 17:09:25 -0000 Author: rpaulo Date: Thu May 21 17:09:23 2009 New Revision: 192548 URL: http://svn.freebsd.org/changeset/base/192548 Log: MFC 189748, 189768, 189769, 189774: Rename k8temp to amdtemp and add support for the 10h and 11h families. Added: stable/7/sys/dev/amdtemp/ - copied from r189768, head/sys/dev/amdtemp/ stable/7/sys/modules/amdtemp/ - copied from r189768, head/sys/modules/amdtemp/ Deleted: stable/7/sys/dev/k8temp/ stable/7/sys/modules/k8temp/ Modified: stable/7/sys/ (props changed) stable/7/sys/conf/files.amd64 stable/7/sys/conf/files.i386 stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/amdtemp/amdtemp.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/modules/Makefile Modified: stable/7/sys/conf/files.amd64 ============================================================================== --- stable/7/sys/conf/files.amd64 Thu May 21 17:01:38 2009 (r192547) +++ stable/7/sys/conf/files.amd64 Thu May 21 17:09:23 2009 (r192548) @@ -131,6 +131,7 @@ amd64/pci/pci_cfgreg.c optional pci crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/acpica/acpi_if.m standard +dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/atkbdc/atkbd.c optional atkbd atkbdc dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc @@ -178,7 +179,6 @@ dev/hptrr/hptrr_config.c optional hptrr dev/hwpmc/hwpmc_amd.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc -dev/k8temp/k8temp.c optional k8temp dev/kbd/kbd.c optional atkbd | sc | ukbd dev/mem/memutil.c optional mem dev/nfe/if_nfe.c optional nfe pci Modified: stable/7/sys/conf/files.i386 ============================================================================== --- stable/7/sys/conf/files.i386 Thu May 21 17:01:38 2009 (r192547) +++ stable/7/sys/conf/files.i386 Thu May 21 17:09:23 2009 (r192548) @@ -132,6 +132,7 @@ crypto/via/padlock_cipher.c optional pad crypto/via/padlock_hash.c optional padlock dev/advansys/adv_isa.c optional adv isa dev/aic/aic_isa.c optional aic isa +dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/ar/if_ar.c optional ar dev/ar/if_ar_isa.c optional ar isa Modified: stable/7/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Fri Mar 13 16:08:08 2009 (r189768) +++ stable/7/sys/dev/amdtemp/amdtemp.c Thu May 21 17:09:23 2009 (r192548) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2008 Rui Paulo + * Copyright (c) 2008, 2009 Rui Paulo + * Copyright (c) 2009 Norikatsu Shigemura * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,8 +26,8 @@ */ /* - * Driver for the AMD K8 thermal sensors. Based on a Linux driver by the - * same name. + * Driver for the AMD K8/K10/K11 thermal sensors. Initially based on the + * k8temp Linux driver. */ #include @@ -48,77 +49,92 @@ __FBSDID("$FreeBSD$"); #include #include -struct k8temp_softc { +typedef enum { + SENSOR0_CORE0, + SENSOR0_CORE1, + SENSOR1_CORE0, + SENSOR1_CORE1, + CORE0, + CORE1 +} amdsensor_t; + +struct amdtemp_softc { device_t sc_dev; int sc_temps[4]; int sc_ntemps; struct sysctl_oid *sc_oid; struct sysctl_oid *sc_sysctl_cpu[2]; struct intr_config_hook sc_ich; + int32_t (*sc_gettemp)(device_t, amdsensor_t); }; #define VENDORID_AMD 0x1022 -#define DEVICEID_AMD_MISC 0x1103 - -static struct k8temp_product { - uint16_t k8temp_vendorid; - uint16_t k8temp_deviceid; -} k8temp_products[] = { - { VENDORID_AMD, DEVICEID_AMD_MISC }, +#define DEVICEID_AMD_MISC0F 0x1103 +#define DEVICEID_AMD_MISC10 0x1203 +#define DEVICEID_AMD_MISC11 0x1303 + +static struct amdtemp_product { + uint16_t amdtemp_vendorid; + uint16_t amdtemp_deviceid; +} amdtemp_products[] = { + { VENDORID_AMD, DEVICEID_AMD_MISC0F }, + { VENDORID_AMD, DEVICEID_AMD_MISC10 }, + { VENDORID_AMD, DEVICEID_AMD_MISC11 }, { 0, 0 } }; /* - * Register control + * Register control (K8 family) */ -#define K8TEMP_REG 0xe4 -#define K8TEMP_REG_SELSENSOR 0x40 -#define K8TEMP_REG_SELCORE 0x04 +#define AMDTEMP_REG0F 0xe4 +#define AMDTEMP_REG_SELSENSOR 0x40 +#define AMDTEMP_REG_SELCORE 0x04 -#define K8TEMP_MINTEMP 49 /* -49 C is the mininum temperature */ +/* + * Register control (K10 & K11) family + */ +#define AMDTEMP_REG 0xa4 -typedef enum { - SENSOR0_CORE0, - SENSOR0_CORE1, - SENSOR1_CORE0, - SENSOR1_CORE1, - CORE0, - CORE1 -} k8sensor_t; +#define TZ_ZEROC 2732 + + /* -49 C is the mininum temperature */ +#define AMDTEMP_OFFSET0F (TZ_ZEROC-490) +#define AMDTEMP_OFFSET (TZ_ZEROC) /* * Device methods. */ -static void k8temp_identify(driver_t *driver, device_t parent); -static int k8temp_probe(device_t dev); -static int k8temp_attach(device_t dev); -static void k8temp_intrhook(void *arg); -static int k8temp_detach(device_t dev); -static int k8temp_match(device_t dev); -static int32_t k8temp_gettemp(device_t dev, k8sensor_t sensor); -static int k8temp_sysctl(SYSCTL_HANDLER_ARGS); +static void amdtemp_identify(driver_t *driver, device_t parent); +static int amdtemp_probe(device_t dev); +static int amdtemp_attach(device_t dev); +static void amdtemp_intrhook(void *arg); +static int amdtemp_detach(device_t dev); +static int amdtemp_match(device_t dev); +static int32_t amdtemp_gettemp0f(device_t dev, amdsensor_t sensor); +static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor); +static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); -static device_method_t k8temp_methods[] = { +static device_method_t amdtemp_methods[] = { /* Device interface */ - DEVMETHOD(device_identify, k8temp_identify), - DEVMETHOD(device_probe, k8temp_probe), - DEVMETHOD(device_attach, k8temp_attach), - DEVMETHOD(device_detach, k8temp_detach), + DEVMETHOD(device_identify, amdtemp_identify), + DEVMETHOD(device_probe, amdtemp_probe), + DEVMETHOD(device_attach, amdtemp_attach), + DEVMETHOD(device_detach, amdtemp_detach), {0, 0} }; -static driver_t k8temp_driver = { - "k8temp", - k8temp_methods, - sizeof(struct k8temp_softc), +static driver_t amdtemp_driver = { + "amdtemp", + amdtemp_methods, + sizeof(struct amdtemp_softc), }; -static devclass_t k8temp_devclass; -DRIVER_MODULE(k8temp, hostb, k8temp_driver, k8temp_devclass, NULL, NULL); +static devclass_t amdtemp_devclass; +DRIVER_MODULE(amdtemp, hostb, amdtemp_driver, amdtemp_devclass, NULL, NULL); static int -k8temp_match(device_t dev) +amdtemp_match(device_t dev) { int i; uint16_t vendor, devid; @@ -126,9 +142,9 @@ k8temp_match(device_t dev) vendor = pci_get_vendor(dev); devid = pci_get_device(dev); - for (i = 0; k8temp_products[i].k8temp_vendorid != 0; i++) { - if (vendor == k8temp_products[i].k8temp_vendorid && - devid == k8temp_products[i].k8temp_deviceid) + for (i = 0; amdtemp_products[i].amdtemp_vendorid != 0; i++) { + if (vendor == amdtemp_products[i].amdtemp_vendorid && + devid == amdtemp_products[i].amdtemp_deviceid) return (1); } @@ -136,28 +152,28 @@ k8temp_match(device_t dev) } static void -k8temp_identify(driver_t *driver, device_t parent) +amdtemp_identify(driver_t *driver, device_t parent) { device_t child; /* Make sure we're not being doubly invoked. */ - if (device_find_child(parent, "k8temp", -1) != NULL) + if (device_find_child(parent, "amdtemp", -1) != NULL) return; - if (k8temp_match(parent)) { - child = device_add_child(parent, "k8temp", -1); + if (amdtemp_match(parent)) { + child = device_add_child(parent, "amdtemp", -1); if (child == NULL) - device_printf(parent, "add k8temp child failed\n"); + device_printf(parent, "add amdtemp child failed\n"); } } static int -k8temp_probe(device_t dev) +amdtemp_probe(device_t dev) { uint32_t regs[4]; - if (resource_disabled("k8temp", 0)) + if (resource_disabled("amdtemp", 0)) return (ENXIO); do_cpuid(1, regs); @@ -173,9 +189,9 @@ k8temp_probe(device_t dev) } static int -k8temp_attach(device_t dev) +amdtemp_attach(device_t dev) { - struct k8temp_softc *sc = device_get_softc(dev); + struct amdtemp_softc *sc = device_get_softc(dev); struct sysctl_ctx_list *sysctlctx; struct sysctl_oid *sysctlnode; @@ -185,7 +201,7 @@ k8temp_attach(device_t dev) * needed because the cpu driver may be loaded late on boot, after * us. */ - sc->sc_ich.ich_func = k8temp_intrhook; + sc->sc_ich.ich_func = amdtemp_intrhook; sc->sc_ich.ich_arg = dev; if (config_intrhook_establish(&sc->sc_ich) != 0) { device_printf(dev, "config_intrhook_establish " @@ -193,8 +209,15 @@ k8temp_attach(device_t dev) return (ENXIO); } + if (pci_get_device(dev) == DEVICEID_AMD_MISC0F) + sc->sc_gettemp = amdtemp_gettemp0f; + else { + sc->sc_gettemp = amdtemp_gettemp; + return (0); + } + /* - * dev.k8temp.N tree. + * dev.amdtemp.N tree. */ sysctlctx = device_get_sysctl_ctx(dev); sysctlnode = SYSCTL_ADD_NODE(sysctlctx, @@ -204,13 +227,13 @@ k8temp_attach(device_t dev) SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "core0", CTLTYPE_INT | CTLFLAG_RD, - dev, SENSOR0_CORE0, k8temp_sysctl, "I", + dev, SENSOR0_CORE0, amdtemp_sysctl, "IK", "Sensor 0 / Core 0 temperature"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "core1", CTLTYPE_INT | CTLFLAG_RD, - dev, SENSOR0_CORE1, k8temp_sysctl, "I", + dev, SENSOR0_CORE1, amdtemp_sysctl, "IK", "Sensor 0 / Core 1 temperature"); sysctlnode = SYSCTL_ADD_NODE(sysctlctx, @@ -220,25 +243,25 @@ k8temp_attach(device_t dev) SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "core0", CTLTYPE_INT | CTLFLAG_RD, - dev, SENSOR1_CORE0, k8temp_sysctl, "I", + dev, SENSOR1_CORE0, amdtemp_sysctl, "IK", "Sensor 1 / Core 0 temperature"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "core1", CTLTYPE_INT | CTLFLAG_RD, - dev, SENSOR1_CORE1, k8temp_sysctl, "I", + dev, SENSOR1_CORE1, amdtemp_sysctl, "IK", "Sensor 1 / Core 1 temperature"); return (0); } void -k8temp_intrhook(void *arg) +amdtemp_intrhook(void *arg) { int i; device_t nexus, acpi, cpu; device_t dev = (device_t) arg; - struct k8temp_softc *sc; + struct amdtemp_softc *sc; struct sysctl_ctx_list *sysctlctx; sc = device_get_softc(dev); @@ -258,7 +281,7 @@ k8temp_intrhook(void *arg) sc->sc_sysctl_cpu[i] = SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(device_get_sysctl_tree(cpu)), OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, - dev, CORE0, k8temp_sysctl, "I", + dev, CORE0, amdtemp_sysctl, "IK", "Max of sensor 0 / 1"); } } @@ -266,41 +289,42 @@ k8temp_intrhook(void *arg) } int -k8temp_detach(device_t dev) +amdtemp_detach(device_t dev) { int i; - struct k8temp_softc *sc = device_get_softc(dev); + struct amdtemp_softc *sc = device_get_softc(dev); for (i = 0; i < 2; i++) { if (sc->sc_sysctl_cpu[i]) sysctl_remove_oid(sc->sc_sysctl_cpu[i], 1, 0); } - /* NewBus removes the dev.k8temp.N tree by itself. */ + /* NewBus removes the dev.amdtemp.N tree by itself. */ return (0); } static int -k8temp_sysctl(SYSCTL_HANDLER_ARGS) +amdtemp_sysctl(SYSCTL_HANDLER_ARGS) { device_t dev = (device_t) arg1; + struct amdtemp_softc *sc = device_get_softc(dev); int error; int32_t temp, auxtemp[2]; switch (arg2) { case CORE0: - auxtemp[0] = k8temp_gettemp(dev, SENSOR0_CORE0); - auxtemp[1] = k8temp_gettemp(dev, SENSOR1_CORE0); + auxtemp[0] = sc->sc_gettemp(dev, SENSOR0_CORE0); + auxtemp[1] = sc->sc_gettemp(dev, SENSOR1_CORE0); temp = imax(auxtemp[0], auxtemp[1]); break; case CORE1: - auxtemp[0] = k8temp_gettemp(dev, SENSOR0_CORE1); - auxtemp[1] = k8temp_gettemp(dev, SENSOR1_CORE1); + auxtemp[0] = sc->sc_gettemp(dev, SENSOR0_CORE1); + auxtemp[1] = sc->sc_gettemp(dev, SENSOR1_CORE1); temp = imax(auxtemp[0], auxtemp[1]); break; default: - temp = k8temp_gettemp(dev, arg2); + temp = sc->sc_gettemp(dev, arg2); break; } error = sysctl_handle_int(oidp, &temp, 0, req); @@ -309,34 +333,45 @@ k8temp_sysctl(SYSCTL_HANDLER_ARGS) } static int32_t -k8temp_gettemp(device_t dev, k8sensor_t sensor) +amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) { uint8_t cfg; uint32_t temp; - cfg = pci_read_config(dev, K8TEMP_REG, 1); + cfg = pci_read_config(dev, AMDTEMP_REG0F, 1); switch (sensor) { case SENSOR0_CORE0: - cfg &= ~(K8TEMP_REG_SELSENSOR | K8TEMP_REG_SELCORE); + cfg &= ~(AMDTEMP_REG_SELSENSOR | AMDTEMP_REG_SELCORE); break; case SENSOR0_CORE1: - cfg &= ~K8TEMP_REG_SELSENSOR; - cfg |= K8TEMP_REG_SELCORE; + cfg &= ~AMDTEMP_REG_SELSENSOR; + cfg |= AMDTEMP_REG_SELCORE; break; case SENSOR1_CORE0: - cfg &= ~K8TEMP_REG_SELCORE; - cfg |= K8TEMP_REG_SELSENSOR; + cfg &= ~AMDTEMP_REG_SELCORE; + cfg |= AMDTEMP_REG_SELSENSOR; break; case SENSOR1_CORE1: - cfg |= (K8TEMP_REG_SELSENSOR | K8TEMP_REG_SELCORE); + cfg |= (AMDTEMP_REG_SELSENSOR | AMDTEMP_REG_SELCORE); break; default: cfg = 0; break; } - pci_write_config(dev, K8TEMP_REG, cfg, 1); - temp = pci_read_config(dev, K8TEMP_REG, 4); - temp = ((temp >> 16) & 0xff) - K8TEMP_MINTEMP; + pci_write_config(dev, AMDTEMP_REG0F, cfg, 1); + temp = pci_read_config(dev, AMDTEMP_REG0F, 4); + temp = ((temp >> 16) & 0xff) * 10 + AMDTEMP_OFFSET0F; return (temp); } + +static int32_t +amdtemp_gettemp(device_t dev, amdsensor_t sensor) +{ + uint32_t temp; + + temp = pci_read_config(dev, AMDTEMP_REG, 4); + temp = ((temp >> 21) & 0x3ff) * 10 / 8 + AMDTEMP_OFFSET; + + return (temp); +} Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Thu May 21 17:01:38 2009 (r192547) +++ stable/7/sys/modules/Makefile Thu May 21 17:09:23 2009 (r192548) @@ -17,6 +17,7 @@ SUBDIR= ${_3dfx} \ aic7xxx \ aio \ ${_amd} \ + ${_amdtemp} \ ale \ amr \ ${_an} \ @@ -143,7 +144,6 @@ SUBDIR= ${_3dfx} \ ${_ixgb} \ jme \ joy \ - ${_k8temp} \ kbdmux \ krpc \ kue \ @@ -455,6 +455,7 @@ _zfs= zfs _aac= aac _acpi= acpi _ahb= ahb +_amdtemp= amdtemp _arcmsr= arcmsr _arl= arl _asr= asr @@ -479,7 +480,7 @@ _ipw= ipw _ipwfw= ipwfw _iwi= iwi _iwifw= iwifw -_ixgb= ixgb +_ixgb= ixgb _mly= mly _nfe= nfe _nve= nve @@ -508,6 +509,7 @@ _aac= aac _acpi= acpi _agp= agp _an= an +_amdtemp= amdtemp _arcmsr= arcmsr _cardbus= cardbus _cbb= cbb @@ -544,7 +546,6 @@ _ips= ips _ipw= ipw _ipwfw= ipwfw _ixgb= ixgb -_k8temp= k8temp _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux From owner-svn-src-stable-7@FreeBSD.ORG Thu May 21 17:12:13 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3BA5106564A; Thu, 21 May 2009 17:12:13 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91E048FC14; Thu, 21 May 2009 17:12:13 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4LHCDOu073126; Thu, 21 May 2009 17:12:13 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4LHCDE6073125; Thu, 21 May 2009 17:12:13 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200905211712.n4LHCDE6073125@svn.freebsd.org> From: Rui Paulo Date: Thu, 21 May 2009 17:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192549 - stable/7 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 17:12:14 -0000 Author: rpaulo Date: Thu May 21 17:12:13 2009 New Revision: 192549 URL: http://svn.freebsd.org/changeset/base/192549 Log: Mention k8temp -> amdtemp rename. Modified: stable/7/UPDATING Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Thu May 21 17:09:23 2009 (r192548) +++ stable/7/UPDATING Thu May 21 17:12:13 2009 (r192549) @@ -8,6 +8,10 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090521: + The k8temp(4) driver has been renamed to amdtemp(4) since + support for K10 and K11 CPU families was added. + 20090520: Update ZFS to version 13. ZFS users will need to re-build kernel and world. Existing pools will continue to work From owner-svn-src-stable-7@FreeBSD.ORG Thu May 21 18:24:15 2009 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B88DC106566C; Thu, 21 May 2009 18:24:15 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 155248FC41; Thu, 21 May 2009 18:24:15 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 1215F5C025; Fri, 22 May 2009 02:24:14 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 35F1255CDA6D; Fri, 22 May 2009 02:24:13 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id v+Au98gcnB+g; Fri, 22 May 2009 02:23:06 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id DFD3A55CDA5F; Fri, 22 May 2009 02:22:58 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=gvteYrf4r3VaZuKYcXbpD9nGaj20X0x8m3A/MqrW+T91q3OVbGKkUJGw2OEjaucj6 tNBaKRqZf0RNvoCsbqO7g== Message-ID: <4A159BF0.8010001@delphij.net> Date: Thu, 21 May 2009 11:22:40 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.21 (X11/20090408) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <200905140135.n4E1ZhQG072751@svn.freebsd.org> <86y6sq1g5j.fsf@ds4.des.no> In-Reply-To: <86y6sq1g5j.fsf@ds4.des.no> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-stable-7@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r192068 - in stable/7: etc etc/mtree etc/rc.d gnu/usr.bin/man gnu/usr.bin/man/man X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 18:24:17 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dag-Erling Smørgrav wrote: > Dag-Erling Smorgrav writes: >> Log: >> MFC r183696, r183698: enable UTF-8 for man pages. > > If you use a UTF-8 locale and dashes in man pages (e.g. in command-line > options) look weird after this commit, merge r192561 from head into your > tree. I will MFC it in a week or so. Oh I was wondering this long ago but did not went into depth about it, thanks for fixing it! Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkoVm/AACgkQi+vbBBjt66CyWQCdFclhzDfRGIV2PCUFYSMSahv2 D4UAn1LIF80gOeDjo+AOO6gfJxvRjxrc =+OC0 -----END PGP SIGNATURE----- From owner-svn-src-stable-7@FreeBSD.ORG Thu May 21 18:32:43 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6287E10656A3; Thu, 21 May 2009 18:32:43 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 210568FC18; Thu, 21 May 2009 18:32:42 +0000 (UTC) (envelope-from des@des.no) X-Greylist: delayed 503 seconds by postgrey-1.32 at tim.des.no; Thu, 21 May 2009 20:16:46 CEST Received: from ds4.des.no (cm-84.215.252.34.getinternet.no [84.215.252.34]) by smtp.des.no (Postfix) with ESMTP id C603B6D41D; Thu, 21 May 2009 20:16:46 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 66A53844A4; Thu, 21 May 2009 20:10:00 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: src-committers@freebsd.org References: <200905140135.n4E1ZhQG072751@svn.freebsd.org> Date: Thu, 21 May 2009 20:10:00 +0200 In-Reply-To: <200905140135.n4E1ZhQG072751@svn.freebsd.org> (Dag-Erling Smorgrav's message of "Thu, 14 May 2009 01:35:43 +0000 (UTC)") Message-ID: <86y6sq1g5j.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r192068 - in stable/7: etc etc/mtree etc/rc.d gnu/usr.bin/man gnu/usr.bin/man/man X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 18:32:44 -0000 Dag-Erling Smorgrav writes: > Log: > MFC r183696, r183698: enable UTF-8 for man pages. If you use a UTF-8 locale and dashes in man pages (e.g. in command-line options) look weird after this commit, merge r192561 from head into your tree. I will MFC it in a week or so. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-stable-7@FreeBSD.ORG Fri May 22 16:11:01 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D8731065672; Fri, 22 May 2009 16:11:01 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F301A8FC17; Fri, 22 May 2009 16:11:00 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4MGB0fC011624; Fri, 22 May 2009 16:11:00 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4MGB0oI011620; Fri, 22 May 2009 16:11:00 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200905221611.n4MGB0oI011620@svn.freebsd.org> From: Antoine Brodin Date: Fri, 22 May 2009 16:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192587 - in stable/7: share/man/man4 sys sys/conf sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 16:11:01 -0000 Author: antoine Date: Fri May 22 16:11:00 2009 New Revision: 192587 URL: http://svn.freebsd.org/changeset/base/192587 Log: MFC r191318 to stable/7: vlan(4) no longer depends on miibus(4). Reviewed by: jhb@ MFC after: 1 month Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/igb.4 (props changed) stable/7/share/man/man4/vlan.4 stable/7/sys/ (props changed) stable/7/sys/conf/NOTES stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/share/man/man4/vlan.4 ============================================================================== --- stable/7/share/man/man4/vlan.4 Fri May 22 15:56:43 2009 (r192586) +++ stable/7/share/man/man4/vlan.4 Fri May 22 16:11:00 2009 (r192587) @@ -36,7 +36,6 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device miibus" .Cd "device vlan" .Ed .Pp @@ -193,18 +192,7 @@ The MTU setting on .Nm can be corrected manually if used in conjunction with such a parent interface. .Sh SEE ALSO -.Xr kqueue 2 , -.Xr miibus 4 , .Xr ifconfig 8 , .Xr sysctl 8 .Sh BUGS No 802.1Q features except VLAN tagging are implemented. -.Pp -.Dv EVFILT_NETDEV -events on a -.Nm -interface will be sent through -.Xr kqueue 2 -only if the parent interface uses -.Xr miibus 4 -for link state notification. Modified: stable/7/sys/conf/NOTES ============================================================================== --- stable/7/sys/conf/NOTES Fri May 22 15:56:43 2009 (r192586) +++ stable/7/sys/conf/NOTES Fri May 22 16:11:00 2009 (r192587) @@ -710,7 +710,7 @@ device mn # Munich32x/Falc54 Nx64kbit/s # Ethernets; it is MANDATORY when an Ethernet device driver is # configured or token-ring is enabled. # The `vlan' device implements the VLAN tagging of Ethernet frames -# according to IEEE 802.1Q. It requires `device miibus'. +# according to IEEE 802.1Q. # The `wlan' device provides generic code to support 802.11 # drivers, including host AP mode; it is MANDATORY for the wi, # ath, and awi drivers and will eventually be required by all 802.11 drivers. From owner-svn-src-stable-7@FreeBSD.ORG Fri May 22 17:54:03 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 430281065689; Fri, 22 May 2009 17:54:03 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FC9C8FC18; Fri, 22 May 2009 17:54:03 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4MHs30o014005; Fri, 22 May 2009 17:54:03 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4MHs3cr014003; Fri, 22 May 2009 17:54:03 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905221754.n4MHs3cr014003@svn.freebsd.org> From: Kip Macy Date: Fri, 22 May 2009 17:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192590 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 17:54:03 -0000 Author: kmacy Date: Fri May 22 17:54:02 2009 New Revision: 192590 URL: http://svn.freebsd.org/changeset/base/192590 Log: some ports erroneously use the existence of AT_FDCWD to check for the availability of the *at system calls so s/AT_FDCWD/AT_FDCWD_notyet/g Reported by: Dimitry Andric Modified: stable/7/sys/sys/fcntl.h stable/7/sys/sys/namei.h Modified: stable/7/sys/sys/fcntl.h ============================================================================== --- stable/7/sys/sys/fcntl.h Fri May 22 16:46:01 2009 (r192589) +++ stable/7/sys/sys/fcntl.h Fri May 22 17:54:02 2009 (r192590) @@ -110,7 +110,7 @@ typedef __pid_t pid_t; * to determine the target of relative file paths in the openat() and * similar syscalls. */ -#define AT_FDCWD -100 +#define AT_FDCWD_notyet -100 /* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */ #define O_NOCTTY 0x8000 /* don't assign controlling terminal */ Modified: stable/7/sys/sys/namei.h ============================================================================== --- stable/7/sys/sys/namei.h Fri May 22 16:46:01 2009 (r192589) +++ stable/7/sys/sys/namei.h Fri May 22 17:54:02 2009 (r192590) @@ -154,11 +154,11 @@ struct nameidata { * Initialization of a nameidata structure. */ #define NDINIT(ndp, op, flags, segflg, namep, td) \ - NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, td) + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD_notyet, NULL, td) #define NDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td) \ NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, td) #define NDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td) \ - NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, td) + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD_notyet, vp, td) static __inline void NDINIT_ALL(struct nameidata *ndp, From owner-svn-src-stable-7@FreeBSD.ORG Fri May 22 19:13:01 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68FE8106566B; Fri, 22 May 2009 19:13:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 38EA28FC1C; Fri, 22 May 2009 19:13:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id CCFB246B6C; Fri, 22 May 2009 15:13:00 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id A32A98A025; Fri, 22 May 2009 15:12:59 -0400 (EDT) From: John Baldwin To: Kip Macy Date: Fri, 22 May 2009 15:07:39 -0400 User-Agent: KMail/1.9.7 References: <200905221754.n4MHs3cr014003@svn.freebsd.org> In-Reply-To: <200905221754.n4MHs3cr014003@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905221507.39476.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 22 May 2009 15:12:59 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r192590 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 19:13:02 -0000 On Friday 22 May 2009 1:54:03 pm Kip Macy wrote: > Author: kmacy > Date: Fri May 22 17:54:02 2009 > New Revision: 192590 > URL: http://svn.freebsd.org/changeset/base/192590 > > Log: > some ports erroneously use the existence of AT_FDCWD to check for > the availability of the *at system calls so s/AT_FDCWD/AT_FDCWD_notyet/g > > Reported by: Dimitry Andric I wonder if it wouldn't be appropriate to just remove the dirfd bits entirely from 7.x for now. I.e. remove NDINIT_AT(), AT_FDCWD_notyet, the 'dirfd' member from the structure, the 'dirfd' parameter from NDINIT_ALL(), etc. ZFS only really needed NDINIT_ATVP(), yes? > Modified: > stable/7/sys/sys/fcntl.h > stable/7/sys/sys/namei.h > > Modified: stable/7/sys/sys/fcntl.h > ============================================================================== > --- stable/7/sys/sys/fcntl.h Fri May 22 16:46:01 2009 (r192589) > +++ stable/7/sys/sys/fcntl.h Fri May 22 17:54:02 2009 (r192590) > @@ -110,7 +110,7 @@ typedef __pid_t pid_t; > * to determine the target of relative file paths in the openat() and > * similar syscalls. > */ > -#define AT_FDCWD -100 > +#define AT_FDCWD_notyet -100 > > /* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */ > #define O_NOCTTY 0x8000 /* don't assign controlling terminal */ > > Modified: stable/7/sys/sys/namei.h > ============================================================================== > --- stable/7/sys/sys/namei.h Fri May 22 16:46:01 2009 (r192589) > +++ stable/7/sys/sys/namei.h Fri May 22 17:54:02 2009 (r192590) > @@ -154,11 +154,11 @@ struct nameidata { > * Initialization of a nameidata structure. > */ > #define NDINIT(ndp, op, flags, segflg, namep, td) \ > - NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, td) > + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD_notyet, NULL, td) > #define NDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td) \ > NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, td) > #define NDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td) \ > - NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, td) > + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD_notyet, vp, td) > > static __inline void > NDINIT_ALL(struct nameidata *ndp, > -- John Baldwin From owner-svn-src-stable-7@FreeBSD.ORG Fri May 22 20:08:34 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AA6410656C7; Fri, 22 May 2009 20:08:34 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id DE2438FC08; Fri, 22 May 2009 20:08:33 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from [IPv6:2001:7b8:3a7:0:3c4c:95a1:9cd7:9f22] (unknown [IPv6:2001:7b8:3a7:0:3c4c:95a1:9cd7:9f22]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 179A25C42; Fri, 22 May 2009 22:08:33 +0200 (CEST) Message-ID: <4A17063F.60303@andric.com> Date: Fri, 22 May 2009 22:08:31 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1b5pre) Gecko/20090520 Shredder/3.0b3pre MIME-Version: 1.0 To: John Baldwin References: <200905221754.n4MHs3cr014003@svn.freebsd.org> <200905221507.39476.jhb@freebsd.org> In-Reply-To: <200905221507.39476.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, Kip Macy Subject: Re: svn commit: r192590 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 20:08:35 -0000 On 2009-05-22 21:07, John Baldwin wrote: >> Log: >> some ports erroneously use the existence of AT_FDCWD to check for >> the availability of the *at system calls so s/AT_FDCWD/AT_FDCWD_notyet/g >> >> Reported by: Dimitry Andric > > I wonder if it wouldn't be appropriate to just remove the dirfd bits entirely > from 7.x for now. I.e. remove NDINIT_AT(), AT_FDCWD_notyet, the 'dirfd' > member from the structure, the 'dirfd' parameter from NDINIT_ALL(), etc. ZFS > only really needed NDINIT_ATVP(), yes? Are there any plans to MFC the *at() calls? (I'd guess not, since it looks like they change the ABI...) From owner-svn-src-stable-7@FreeBSD.ORG Fri May 22 20:21:23 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 185731065740; Fri, 22 May 2009 20:21:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id DC8C08FC21; Fri, 22 May 2009 20:21:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 7363746B06; Fri, 22 May 2009 16:21:22 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E7E928A025; Fri, 22 May 2009 16:21:20 -0400 (EDT) From: John Baldwin To: Dimitry Andric Date: Fri, 22 May 2009 16:21:14 -0400 User-Agent: KMail/1.9.7 References: <200905221754.n4MHs3cr014003@svn.freebsd.org> <200905221507.39476.jhb@freebsd.org> <4A17063F.60303@andric.com> In-Reply-To: <4A17063F.60303@andric.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905221621.15507.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 22 May 2009 16:21:20 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, Kip Macy Subject: Re: svn commit: r192590 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 20:21:23 -0000 On Friday 22 May 2009 4:08:31 pm Dimitry Andric wrote: > On 2009-05-22 21:07, John Baldwin wrote: > >> Log: > >> some ports erroneously use the existence of AT_FDCWD to check for > >> the availability of the *at system calls so s/AT_FDCWD/AT_FDCWD_notyet/g > >> > >> Reported by: Dimitry Andric > > > > I wonder if it wouldn't be appropriate to just remove the dirfd bits entirely > > from 7.x for now. I.e. remove NDINIT_AT(), AT_FDCWD_notyet, the 'dirfd' > > member from the structure, the 'dirfd' parameter from NDINIT_ALL(), etc. ZFS > > only really needed NDINIT_ATVP(), yes? > > Are there any plans to MFC the *at() calls? (I'd guess not, since it > looks like they change the ABI...) I don't think there are due to the ABI change, and if they were ever MFC'd, the NDINIT, etc. bits could be restored as part of that merge. -- John Baldwin From owner-svn-src-stable-7@FreeBSD.ORG Fri May 22 20:33:54 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A10731065673; Fri, 22 May 2009 20:33:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 387CD8FC1C; Fri, 22 May 2009 20:33:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1M7bR9-000Mlg-Gc; Fri, 22 May 2009 23:33:52 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n4MKXmUC037412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 22 May 2009 23:33:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n4MKXlX2088945; Fri, 22 May 2009 23:33:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n4MKXlhD088944; Fri, 22 May 2009 23:33:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 22 May 2009 23:33:47 +0300 From: Kostik Belousov To: John Baldwin Message-ID: <20090522203347.GE1927@deviant.kiev.zoral.com.ua> References: <200905221754.n4MHs3cr014003@svn.freebsd.org> <200905221507.39476.jhb@freebsd.org> <4A17063F.60303@andric.com> <200905221621.15507.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="67nA0I2t09EExhkH" Content-Disposition: inline In-Reply-To: <200905221621.15507.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.1 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1M7bR9-000Mlg-Gc a6d44d6cac42326f0a6dad56b79b1c65 X-Terabit: YES Cc: src-committers@freebsd.org, Kip Macy , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-7@freebsd.org, rwatson@freebsd.org, Dimitry Andric Subject: Re: svn commit: r192590 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 20:33:55 -0000 --67nA0I2t09EExhkH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 22, 2009 at 04:21:14PM -0400, John Baldwin wrote: > On Friday 22 May 2009 4:08:31 pm Dimitry Andric wrote: > > On 2009-05-22 21:07, John Baldwin wrote: > > >> Log: > > >> some ports erroneously use the existence of AT_FDCWD to check for > > >> the availability of the *at system calls so s/AT_FDCWD/AT_FDCWD_no= tyet/g > > >> =20 > > >> Reported by: Dimitry Andric > > >=20 > > > I wonder if it wouldn't be appropriate to just remove the dirfd bits = entirely=20 > > > from 7.x for now. I.e. remove NDINIT_AT(), AT_FDCWD_notyet, the 'dir= fd'=20 > > > member from the structure, the 'dirfd' parameter from NDINIT_ALL(), e= tc. ZFS=20 > > > only really needed NDINIT_ATVP(), yes? > >=20 > > Are there any plans to MFC the *at() calls? (I'd guess not, since it > > looks like they change the ABI...)=20 >=20 > I don't think there are due to the ABI change, and if they were ever MFC'= d, > the NDINIT, etc. bits could be restored as part of that merge. No, the MFC is posponed not due to KBI change. As I said, I already have a permission from re@ to change nameidata. Robert (Cc:ed) hold the MFC because the new fd argument of the at syscalls is not audited. --67nA0I2t09EExhkH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkoXDCsACgkQC3+MBN1Mb4iemQCgnKiBcPEO9Ejqk0Nsi6RqbPBJ 3wkAoJbE3I9Njsi+XJ1s82uAXM5n2r7s =O2pJ -----END PGP SIGNATURE----- --67nA0I2t09EExhkH-- From owner-svn-src-stable-7@FreeBSD.ORG Fri May 22 21:26:35 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 324ED1065674; Fri, 22 May 2009 21:26:35 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EC558FC0C; Fri, 22 May 2009 21:26:35 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4MLQZSO019315; Fri, 22 May 2009 21:26:35 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4MLQZNG019314; Fri, 22 May 2009 21:26:35 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200905222126.n4MLQZNG019314@svn.freebsd.org> From: Colin Percival Date: Fri, 22 May 2009 21:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192602 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 21:26:35 -0000 Author: cperciva Date: Fri May 22 21:26:34 2009 New Revision: 192602 URL: http://svn.freebsd.org/changeset/base/192602 Log: MFC r192130: Allow a comma-separated list of network interfaces to be specified via the netDev option in install.cfg. Modified: stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/sysinstall/tcpip.c Modified: stable/7/usr.sbin/sysinstall/tcpip.c ============================================================================== --- stable/7/usr.sbin/sysinstall/tcpip.c Fri May 22 20:55:29 2009 (r192601) +++ stable/7/usr.sbin/sysinstall/tcpip.c Fri May 22 21:26:34 2009 (r192602) @@ -651,11 +651,26 @@ tcpDeviceSelect(void) { DMenu *menu; Device **devs, *rval; + char *dev, *network_dev; int cnt; + rval = NULL; + + if (variable_get(VAR_NONINTERACTIVE) && variable_get(VAR_NETWORK_DEVICE)) { + network_dev = variable_get(VAR_NETWORK_DEVICE); + + while ((dev = strsep(&network_dev, ",")) != NULL) { + devs = deviceFind(dev, DEVICE_TYPE_NETWORK); + cnt = deviceCount(devs); + if (cnt) { + if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS)) + return(devs[0]); + } + } + } + devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK); cnt = deviceCount(devs); - rval = NULL; if (!cnt) { msgConfirm("No network devices available!"); @@ -669,14 +684,6 @@ tcpDeviceSelect(void) if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS)) rval = devs[0]; } - else if (variable_get(VAR_NONINTERACTIVE) && variable_get(VAR_NETWORK_DEVICE)) { - devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK); - cnt = deviceCount(devs); - if (cnt) { - if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS)) - rval = devs[0]; - } - } else { int status; From owner-svn-src-stable-7@FreeBSD.ORG Fri May 22 22:57:06 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E4EA1065676; Fri, 22 May 2009 22:57:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ACD48FC0C; Fri, 22 May 2009 22:57:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4MMv5gw021536; Fri, 22 May 2009 22:57:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4MMv5uB021535; Fri, 22 May 2009 22:57:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200905222257.n4MMv5uB021535@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 22 May 2009 22:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192611 - in stable/7: contrib/csup sys/contrib/rdma sys/contrib/rdma/krping X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 22:57:07 -0000 Author: des Date: Fri May 22 22:57:05 2009 New Revision: 192611 URL: http://svn.freebsd.org/changeset/base/192611 Log: Expand $FreeBSD$ Modified: stable/7/contrib/csup/rcstokenizer.l (props changed) stable/7/sys/contrib/rdma/core_priv.h (props changed) stable/7/sys/contrib/rdma/ib_addr.h (props changed) stable/7/sys/contrib/rdma/ib_cache.h (props changed) stable/7/sys/contrib/rdma/ib_cm.h (props changed) stable/7/sys/contrib/rdma/ib_fmr_pool.h (props changed) stable/7/sys/contrib/rdma/ib_mad.h (props changed) stable/7/sys/contrib/rdma/ib_marshall.h (props changed) stable/7/sys/contrib/rdma/ib_pack.h (props changed) stable/7/sys/contrib/rdma/ib_sa.h (props changed) stable/7/sys/contrib/rdma/ib_smi.h (props changed) stable/7/sys/contrib/rdma/ib_umem.h (props changed) stable/7/sys/contrib/rdma/ib_user_cm.h (props changed) stable/7/sys/contrib/rdma/ib_user_mad.h (props changed) stable/7/sys/contrib/rdma/ib_user_sa.h (props changed) stable/7/sys/contrib/rdma/ib_user_verbs.h (props changed) stable/7/sys/contrib/rdma/ib_verbs.h (props changed) stable/7/sys/contrib/rdma/iw_cm.h (props changed) stable/7/sys/contrib/rdma/krping/getopt.c (props changed) stable/7/sys/contrib/rdma/krping/getopt.h (props changed) stable/7/sys/contrib/rdma/krping/krping.c (props changed) stable/7/sys/contrib/rdma/krping/krping.h (props changed) stable/7/sys/contrib/rdma/krping/krping_dev.c (props changed) stable/7/sys/contrib/rdma/rdma_addr.c (props changed) stable/7/sys/contrib/rdma/rdma_cache.c (props changed) stable/7/sys/contrib/rdma/rdma_cm.h (props changed) stable/7/sys/contrib/rdma/rdma_cm_ib.h (props changed) stable/7/sys/contrib/rdma/rdma_cma.c (props changed) stable/7/sys/contrib/rdma/rdma_device.c (props changed) stable/7/sys/contrib/rdma/rdma_iwcm.c (props changed) stable/7/sys/contrib/rdma/rdma_user_cm.h (props changed) stable/7/sys/contrib/rdma/rdma_verbs.c (props changed) stable/7/sys/contrib/rdma/types.h (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Fri May 22 23:29:06 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A082106564A; Fri, 22 May 2009 23:29:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D10268FC16; Fri, 22 May 2009 23:29:05 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4MNT5nl022360; Fri, 22 May 2009 23:29:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4MNT5A4022359; Fri, 22 May 2009 23:29:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200905222329.n4MNT5A4022359@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 22 May 2009 23:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192614 - in stable/7/sys/cddl/contrib/opensolaris: common/atomic/ia64 uts/common/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 23:29:06 -0000 Author: des Date: Fri May 22 23:29:05 2009 New Revision: 192614 URL: http://svn.freebsd.org/changeset/base/192614 Log: Expand $FreeBSD$ Modified: stable/7/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S (props changed) stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Sat May 23 10:35:27 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C97B6106566B; Sat, 23 May 2009 10:35:27 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6FFB8FC18; Sat, 23 May 2009 10:35:27 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4NAZR0E053372; Sat, 23 May 2009 10:35:27 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4NAZRfr053371; Sat, 23 May 2009 10:35:27 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200905231035.n4NAZRfr053371@svn.freebsd.org> From: Christian Brueffer Date: Sat, 23 May 2009 10:35:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192632 - in stable/7/lib/libc: . posix1e string X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2009 10:35:28 -0000 Author: brueffer Date: Sat May 23 10:35:27 2009 New Revision: 192632 URL: http://svn.freebsd.org/changeset/base/192632 Log: MFC: r192410 Since audit(4) isn't based on posix1e, remove the commented out audit.h header, xref libbsm(3). Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/posix1e/posix1e.3 stable/7/lib/libc/string/ffsll.c (props changed) stable/7/lib/libc/string/flsll.c (props changed) Modified: stable/7/lib/libc/posix1e/posix1e.3 ============================================================================== --- stable/7/lib/libc/posix1e/posix1e.3 Sat May 23 09:24:07 2009 (r192631) +++ stable/7/lib/libc/posix1e/posix1e.3 Sat May 23 10:35:27 2009 (r192632) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2000 +.Dd May 20, 2009 .Dt POSIX1E 3 .Os .Sh NAME @@ -36,7 +36,6 @@ .Sh SYNOPSIS .In sys/types.h .In sys/acl.h -.\" .In sys/audit.h .\" .In sys/capability.h .In sys/mac.h .Sh DESCRIPTION @@ -104,6 +103,7 @@ structure. .Sh SEE ALSO .Xr extattr 2 , .Xr acl 3 , +.Xr libbsm 3 , .Xr mac 3 , .Xr acl 9 , .Xr extattr 9 , From owner-svn-src-stable-7@FreeBSD.ORG Sat May 23 17:17:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4011F1065673; Sat, 23 May 2009 17:17:55 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C31F8FC19; Sat, 23 May 2009 17:17:55 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4NHHt59061905; Sat, 23 May 2009 17:17:55 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4NHHtpd061903; Sat, 23 May 2009 17:17:55 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200905231717.n4NHHtpd061903@svn.freebsd.org> From: Antoine Brodin Date: Sat, 23 May 2009 17:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192654 - in stable/7/sys: . amd64/conf boot/forth contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2009 17:17:55 -0000 Author: antoine Date: Sat May 23 17:17:54 2009 New Revision: 192654 URL: http://svn.freebsd.org/changeset/base/192654 Log: MFC r189872 to stable/7: Chase the k8temp->amdtemp rename in NOTES and loader.conf. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/conf/NOTES stable/7/sys/boot/forth/loader.conf stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/amd64/conf/NOTES ============================================================================== --- stable/7/sys/amd64/conf/NOTES Sat May 23 17:13:35 2009 (r192653) +++ stable/7/sys/amd64/conf/NOTES Sat May 23 17:17:54 2009 (r192654) @@ -456,10 +456,10 @@ device ichwd # Temperature sensors: # # coretemp: on-die sensor on Intel Core and newer CPUs -# k8temp: on-die sensor on AMD K8 CPUs +# amdtemp: on-die sensor on AMD K8/K10/K11 CPUs # device coretemp -device k8temp +device amdtemp #--------------------------------------------------------------------------- # ISDN4BSD Modified: stable/7/sys/boot/forth/loader.conf ============================================================================== --- stable/7/sys/boot/forth/loader.conf Sat May 23 17:13:35 2009 (r192653) +++ stable/7/sys/boot/forth/loader.conf Sat May 23 17:17:54 2009 (r192654) @@ -388,7 +388,7 @@ accf_http_load="NO" # Wait for full HTT random_load="NO" # Random device speaker_load="NO" # AT speaker module coretemp_load="NO" # Intel Core CPU temperature monitor -k8temp_load="NO" # AMD K8 temperature monitor +amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor ############################################################## ### ACPI settings ########################################## From owner-svn-src-stable-7@FreeBSD.ORG Sat May 23 19:54:21 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50600106566C; Sat, 23 May 2009 19:54:19 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B36A8FC08; Sat, 23 May 2009 19:54:19 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4NJsJkB066446; Sat, 23 May 2009 19:54:19 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4NJsIKj066434; Sat, 23 May 2009 19:54:18 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905231954.n4NJsIKj066434@svn.freebsd.org> From: Kip Macy Date: Sat, 23 May 2009 19:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192665 - in stable/7/sys/boot: . common i386 i386/libi386 i386/loader i386/zfsboot zfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2009 19:54:22 -0000 Author: kmacy Date: Sat May 23 19:54:18 2009 New Revision: 192665 URL: http://svn.freebsd.org/changeset/base/192665 Log: Import ZFS loader support missed in the initial MFC set LOADER_ZFS_SUPPORT=Y in make.conf to enable Added: stable/7/sys/boot/i386/zfsboot/Makefile (contents, props changed) stable/7/sys/boot/i386/zfsboot/zfsldr.S (contents, props changed) stable/7/sys/boot/zfs/Makefile (contents, props changed) stable/7/sys/boot/zfs/zfs.c (contents, props changed) Modified: stable/7/sys/boot/Makefile stable/7/sys/boot/common/bootstrap.h stable/7/sys/boot/i386/Makefile stable/7/sys/boot/i386/libi386/bootinfo32.c stable/7/sys/boot/i386/libi386/devicename.c stable/7/sys/boot/i386/loader/Makefile stable/7/sys/boot/i386/loader/conf.c stable/7/sys/boot/i386/loader/main.c Modified: stable/7/sys/boot/Makefile ============================================================================== --- stable/7/sys/boot/Makefile Sat May 23 19:42:23 2009 (r192664) +++ stable/7/sys/boot/Makefile Sat May 23 19:54:18 2009 (r192665) @@ -17,6 +17,10 @@ SUBDIR+= efi SUBDIR+= ofw .endif +.if defined(LOADER_ZFS_SUPPORT) +SUBDIR+= zfs +.endif + # Pick the machine-dependent subdir based on the target architecture. SUBDIR+= ${MACHINE:S/amd64/i386/:S/sun4v/sparc64/} Modified: stable/7/sys/boot/common/bootstrap.h ============================================================================== --- stable/7/sys/boot/common/bootstrap.h Sat May 23 19:42:23 2009 (r192664) +++ stable/7/sys/boot/common/bootstrap.h Sat May 23 19:54:18 2009 (r192665) @@ -43,6 +43,7 @@ struct devdesc #define DEVT_DISK 1 #define DEVT_NET 2 #define DEVT_CD 3 +#define DEVT_ZFS 4 int d_unit; }; Modified: stable/7/sys/boot/i386/Makefile ============================================================================== --- stable/7/sys/boot/i386/Makefile Sat May 23 19:42:23 2009 (r192664) +++ stable/7/sys/boot/i386/Makefile Sat May 23 19:54:18 2009 (r192665) @@ -1,7 +1,7 @@ # $FreeBSD$ -SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot kgzldr \ - libi386 libfirewire loader +SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot zfsboot \ + kgzldr libi386 libfirewire loader # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr Modified: stable/7/sys/boot/i386/libi386/bootinfo32.c ============================================================================== --- stable/7/sys/boot/i386/libi386/bootinfo32.c Sat May 23 19:42:23 2009 (r192664) +++ stable/7/sys/boot/i386/libi386/bootinfo32.c Sat May 23 19:54:18 2009 (r192665) @@ -183,6 +183,7 @@ bi_load32(char *args, int *howtop, int * break; case DEVT_NET: + case DEVT_ZFS: break; default: Modified: stable/7/sys/boot/i386/libi386/devicename.c ============================================================================== --- stable/7/sys/boot/i386/libi386/devicename.c Sat May 23 19:42:23 2009 (r192664) +++ stable/7/sys/boot/i386/libi386/devicename.c Sat May 23 19:54:18 2009 (r192665) @@ -171,6 +171,7 @@ i386_parsedev(struct i386_devdesc **dev, case DEVT_CD: case DEVT_NET: + case DEVT_ZFS: unit = 0; if (*np && (*np != ':')) { @@ -246,6 +247,7 @@ i386_fmtdev(void *vdev) break; case DEVT_NET: + case DEVT_ZFS: sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); break; } Modified: stable/7/sys/boot/i386/loader/Makefile ============================================================================== --- stable/7/sys/boot/i386/loader/Makefile Sat May 23 19:42:23 2009 (r192664) +++ stable/7/sys/boot/i386/loader/Makefile Sat May 23 19:54:18 2009 (r192665) @@ -15,6 +15,12 @@ CFLAGS+= -DLOADER_FIREWIRE_SUPPORT LIBFIREWIRE= ${.OBJDIR}/../libfirewire/libfirewire.a .endif +# Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support +.if defined(LOADER_ZFS_SUPPORT) +CFLAGS+= -DLOADER_ZFS_SUPPORT +LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a +.endif + # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) CFLAGS+= -DLOADER_TFTP_SUPPORT @@ -99,8 +105,8 @@ FILES+= loader.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBI386} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBI386} -lstand +DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} -lstand .include Modified: stable/7/sys/boot/i386/loader/conf.c ============================================================================== --- stable/7/sys/boot/i386/loader/conf.c Sat May 23 19:42:23 2009 (r192664) +++ stable/7/sys/boot/i386/loader/conf.c Sat May 23 19:54:18 2009 (r192665) @@ -50,6 +50,10 @@ __FBSDID("$FreeBSD$"); extern struct devsw fwohci; #endif +#if defined(LOADER_ZFS_SUPPORT) +extern struct devsw zfs_dev; +#endif + /* Exported for libstand */ struct devsw *devsw[] = { &bioscd, @@ -60,15 +64,25 @@ struct devsw *devsw[] = { #if defined(LOADER_FIREWIRE_SUPPORT) &fwohci, #endif +#if defined(LOADER_ZFS_SUPPORT) + &zfs_dev, +#endif NULL }; +#if defined(LOADER_ZFS_SUPPORT) +extern struct fs_ops zfs_fsops; +#endif + struct fs_ops *file_system[] = { &ufs_fsops, &ext2fs_fsops, &dosfs_fsops, &cd9660_fsops, &splitfs_fsops, +#if defined(LOADER_ZFS_SUPPORT) + &zfs_fsops, +#endif #ifdef LOADER_GZIP_SUPPORT &gzipfs_fsops, #endif Modified: stable/7/sys/boot/i386/loader/main.c ============================================================================== --- stable/7/sys/boot/i386/loader/main.c Sat May 23 19:42:23 2009 (r192664) +++ stable/7/sys/boot/i386/loader/main.c Sat May 23 19:54:18 2009 (r192665) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #define KARGS_FLAGS_CD 0x1 #define KARGS_FLAGS_PXE 0x2 +#define KARGS_FLAGS_ZFS 0x4 /* Arguments passed in from the boot1/boot2 loader */ static struct @@ -51,8 +52,13 @@ static struct u_int32_t howto; u_int32_t bootdev; u_int32_t bootflags; - u_int32_t pxeinfo; - u_int32_t res2; + union { + struct { + u_int32_t pxeinfo; + u_int32_t res2; + }; + uint64_t zfspool; + }; u_int32_t bootinfo; } *kargs; @@ -96,7 +102,7 @@ main(void) */ bios_getmem(); -#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || defined(LOADER_GPT_SUPPORT) +#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) heap_top = PTOV(memtop_copyin); memtop_copyin -= 0x300000; heap_bottom = PTOV(memtop_copyin); @@ -145,6 +151,14 @@ main(void) bc_add(initial_bootdev); } + archsw.arch_autoload = i386_autoload; + archsw.arch_getdev = i386_getdev; + archsw.arch_copyin = i386_copyin; + archsw.arch_copyout = i386_copyout; + archsw.arch_readin = i386_readin; + archsw.arch_isainb = isa_inb; + archsw.arch_isaoutb = isa_outb; + /* * March through the device switch probing for things. */ @@ -172,14 +186,6 @@ main(void) bios_getsmap(); - archsw.arch_autoload = i386_autoload; - archsw.arch_getdev = i386_getdev; - archsw.arch_copyin = i386_copyin; - archsw.arch_copyout = i386_copyout; - archsw.arch_readin = i386_readin; - archsw.arch_isainb = isa_inb; - archsw.arch_isaoutb = isa_outb; - interact(); /* doesn't return */ /* if we ever get here, it is an error */ @@ -252,6 +258,29 @@ extract_currdev(void) i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, env_nounset); + +#ifdef LOADER_ZFS_SUPPORT + /* + * If we were started from a ZFS-aware boot2, we can work out + * which ZFS pool we are booting from. + */ + if (kargs->bootflags & KARGS_FLAGS_ZFS) { + /* + * Dig out the pool guid and convert it to a 'unit number' + */ + uint64_t guid; + int unit; + char devname[32]; + extern int zfs_guid_to_unit(uint64_t); + + guid = kargs->zfspool; + unit = zfs_guid_to_unit(guid); + if (unit >= 0) { + sprintf(devname, "zfs%d", unit); + setenv("currdev", devname, 1); + } + } +#endif } COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); Added: stable/7/sys/boot/i386/zfsboot/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/i386/zfsboot/Makefile Sat May 23 19:54:18 2009 (r192665) @@ -0,0 +1,108 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../boot2 + +FILES= zfsboot + +NM?= nm + +# A value of 0x80 enables LBA support. +BOOT_BOOT1_FLAGS?= 0x80 + +BOOT_COMCONSOLE_PORT?= 0x3f8 +BOOT_COMCONSOLE_SPEED?= 9600 +B2SIOFMT?= 0x3 + +REL1= 0x700 +ORG1= 0x7c00 +ORG2= 0x2000 + +CFLAGS= -Os -g \ + -fno-guess-branch-probability \ + -fomit-frame-pointer \ + -fno-unit-at-a-time \ + -mno-align-long-strings \ + -mrtd \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ + -DBOOT2 \ + -DFLAGS=${BOOT_BOOT1_FLAGS} \ + -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ + -DSIOFMT=${B2SIOFMT} \ + -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ + -I${.CURDIR}/../../zfs \ + -I${.CURDIR}/../../../cddl/boot/zfs \ + -I${.CURDIR}/../btx/lib -I. \ + -I${.CURDIR}/../boot2 \ + -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ + -Winline --param max-inline-insns-single=100 + +LDFLAGS=-static -N --gc-sections + +# Pick up ../Makefile.inc early. +.include + +CLEANFILES= zfsboot + +zfsboot: zfsboot1 zfsboot2 + cat zfsboot1 zfsboot2 > zfsboot + +CLEANFILES+= zfsboot1 zfsldr.out zfsldr.o + +zfsboot1: zfsldr.out + objcopy -S -O binary zfsldr.out ${.TARGET} + +zfsldr.out: zfsldr.o + ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o + +CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ + zfsboot.o zfsboot.s zfsboot.s.tmp zfsboot.h sio.o + +# We currently allow 32768 bytes for zfsboot - in practice it could be +# any size up to 3.5Mb but keeping it fixed size simplifies zfsldr. +# +BOOT2SIZE= 32768 + +zfsboot2: zfsboot.ld + @set -- `ls -l zfsboot.ld`; x=$$((${BOOT2SIZE}-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 + dd if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync + +zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN} + btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \ + -o ${.TARGET} -P 1 zfsboot.bin + +zfsboot.ldr: + cp /dev/null ${.TARGET} + +zfsboot.bin: zfsboot.out + objcopy -S -O binary zfsboot.out ${.TARGET} + +zfsboot.out: ${BTXCRT} zfsboot.o sio.o + ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} + +zfsboot.o: zfsboot.s + +SRCS= zfsboot.c zfsboot.h + +zfsboot.s: zfsboot.c zfsboot.h ${.CURDIR}/../../zfs/zfsimpl.c + ${CC} ${CFLAGS} -S -o zfsboot.s.tmp ${.CURDIR}/zfsboot.c + sed -e '/align/d' -e '/nop/d' < zfsboot.s.tmp > zfsboot.s + rm -f zfsboot.s.tmp + +zfsboot.h: zfsldr.out + ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \ + { x = $$1 - ORG1; \ + printf("#define XREADORG %#x\n", REL1 + x) }' \ + ORG1=`printf "%d" ${ORG1}` \ + REL1=`printf "%d" ${REL1}` > ${.TARGET} + +.if ${MACHINE_ARCH} == "amd64" +beforedepend zfsboot.s: machine +CLEANFILES+= machine +machine: + ln -sf ${.CURDIR}/../../../i386/include machine +.endif + +.include Added: stable/7/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/i386/zfsboot/zfsldr.S Sat May 23 19:54:18 2009 (r192665) @@ -0,0 +1,402 @@ +/* + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD$ + */ + +/* Memory Locations */ + .set MEM_REL,0x700 # Relocation address + .set MEM_ARG,0x900 # Arguments + .set MEM_ORG,0x7c00 # Origin + .set MEM_BUF,0x8000 # Load area + .set MEM_BTX,0x9000 # BTX start + .set MEM_JMP,0x9010 # BTX entry point + .set MEM_USR,0xa000 # Client start + .set BDA_BOOT,0x472 # Boot howto flag + +/* Partition Constants */ + .set PRT_OFF,0x1be # Partition offset + .set PRT_NUM,0x4 # Partitions + .set PRT_BSD,0xa5 # Partition type + +/* Flag Bits */ + .set FL_PACKET,0x80 # Packet mode + +/* Misc. Constants */ + .set SIZ_PAG,0x1000 # Page size + .set SIZ_SEC,0x200 # Sector size + + .set NSECT,0x40 + .globl start + .globl xread + .code16 + +start: jmp main # Start recognizably + +/* + * This is the start of a standard BIOS Parameter Block (BPB). Most bootable + * FAT disks have this at the start of their MBR. While normal BIOS's will + * work fine without this section, IBM's El Torito emulation "fixes" up the + * BPB by writing into the memory copy of the MBR. Rather than have data + * written into our xread routine, we'll define a BPB to work around it. + * The data marked with (T) indicates a field required for a ThinkPad to + * recognize the disk and (W) indicates fields written from IBM BIOS code. + * The use of the BPB is based on what OpenBSD and NetBSD implemented in + * their boot code but the required fields were determined by trial and error. + * + * Note: If additional space is needed in boot1, one solution would be to + * move the "prompt" message data (below) to replace the OEM ID. + */ + .org 0x03, 0x00 +oemid: .space 0x08, 0x00 # OEM ID + + .org 0x0b, 0x00 +bpb: .word 512 # sector size (T) + .byte 0 # sectors/clustor + .word 0 # reserved sectors + .byte 0 # number of FATs + .word 0 # root entries + .word 0 # small sectors + .byte 0 # media type (W) + .word 0 # sectors/fat + .word 18 # sectors per track (T) + .word 2 # number of heads (T) + .long 0 # hidden sectors (W) + .long 0 # large sectors + + .org 0x24, 0x00 +ebpb: .byte 0 # BIOS physical drive number (W) + + .org 0x25,0x90 +/* + * Trampoline used by boot2 to call read to read data from the disk via + * the BIOS. Call with: + * + * %cx:%ax - long - LBA to read in + * %es:(%bx) - caddr_t - buffer to read data into + * %dl - byte - drive to read from + * %dh - byte - num sectors to read + */ + +xread: push %ss # Address + pop %ds # data +/* + * Setup an EDD disk packet and pass it to read + */ +xread.1: # Starting + pushl $0x0 # absolute + push %cx # block + push %ax # number + push %es # Address of + push %bx # transfer buffer + xor %ax,%ax # Number of + movb %dh,%al # blocks to + push %ax # transfer + push $0x10 # Size of packet + mov %sp,%bp # Packet pointer + callw read # Read from disk + lea 0x10(%bp),%sp # Clear stack + lret # To far caller +/* + * Load the rest of boot2 and BTX up, copy the parts to the right locations, + * and start it all up. + */ + +/* + * Setup the segment registers to flat addressing (segment 0) and setup the + * stack to end just below the start of our code. + */ +main: cld # String ops inc + xor %cx,%cx # Zero + mov %cx,%es # Address + mov %cx,%ds # data + mov %cx,%ss # Set up + mov $start,%sp # stack +/* + * Relocate ourself to MEM_REL. Since %cx == 0, the inc %ch sets + * %cx == 0x100. + */ + mov %sp,%si # Source + mov $MEM_REL,%di # Destination + incb %ch # Word count + rep # Copy + movsw # code +/* + * If we are on a hard drive, then load the MBR and look for the first + * FreeBSD slice. We use the fake partition entry below that points to + * the MBR when we call nread. The first pass looks for the first active + * FreeBSD slice. The second pass looks for the first non-active FreeBSD + * slice if the first one fails. + */ + mov $part4,%si # Partition + cmpb $0x80,%dl # Hard drive? + jb main.4 # No + movb $0x1,%dh # Block count + callw nread # Read MBR + mov $0x1,%cx # Two passes +main.1: mov $MEM_BUF+PRT_OFF,%si # Partition table + movb $0x1,%dh # Partition +main.2: cmpb $PRT_BSD,0x4(%si) # Our partition type? + jne main.3 # No + jcxz main.5 # If second pass + testb $0x80,(%si) # Active? + jnz main.5 # Yes +main.3: add $0x10,%si # Next entry + incb %dh # Partition + cmpb $0x1+PRT_NUM,%dh # In table? + jb main.2 # Yes + dec %cx # Do two + jcxz main.1 # passes +/* + * If we get here, we didn't find any FreeBSD slices at all, so print an + * error message and die. + */ + mov $msg_part,%si # Message + jmp error # Error +/* + * Floppies use partition 0 of drive 0. + */ +main.4: xor %dx,%dx # Partition:drive + +/* + * Ok, we have a slice and drive in %dx now, so use that to locate and + * load boot2. %si references the start of the slice we are looking + * for, so go ahead and load up the 64 sectors starting at sector 1024 + * (i.e. after the two vdev labels). We don't have do anything fancy + * here to allow for an extra copy of boot1 and a partition table + * (compare to this section of the UFS bootstrap) so we just load it + * all at 0x8000. The first part of boot2 is BTX, which wants to run + * at 0x9000. The boot2.bin binary starts right after the end of BTX, + * so we have to figure out where the start of it is and then move the + * binary to 0xc000. After we have moved the client, we relocate BTX + * itself to 0x9000 - doing it in this order means that none of the + * memcpy regions overlap which would corrupt the copy. Normally, BTX + * clients start at MEM_USR, or 0xa000, but when we use btxld to + * create boot2, we use an entry point of 0x2000. That entry point is + * relative to MEM_USR; thus boot2.bin starts at 0xc000. + * + * The load area and the target area for the client overlap so we have + * to use a decrementing string move. We also play segment register + * games with the destination address for the move so that the client + * can be larger than 16k (which would overflow the zero segment since + * the client starts at 0xc000). Relocating BTX is easy since the load + * area and target area do not overlap. + */ +main.5: mov %dx,MEM_ARG # Save args + movb $NSECT,%dh # Sector count + movw $1024,%ax # Offset to boot2 + callw nread.1 # Read disk +main.6: mov $MEM_BUF,%si # BTX (before reloc) + mov 0xa(%si),%bx # Get BTX length and set + mov $NSECT*SIZ_SEC-1,%di # Size of load area (less one) + mov %di,%si # End of load + add $MEM_BUF,%si # area + sub %bx,%di # End of client, 0xc000 rel + mov %di,%cx # Size of + inc %cx # client + mov $(MEM_USR+2*SIZ_PAG)>>4,%dx # Segment + mov %dx,%es # addressing 0xc000 + std # Move with decrement + rep # Relocate + movsb # client + mov %ds,%dx # Back to + mov %dx,%es # zero segment + mov $MEM_BUF,%si # BTX (before reloc) + mov $MEM_BTX,%di # BTX + mov %bx,%cx # Get BTX length + cld # Increment this time + rep # Relocate + movsb # BTX + +/* + * Enable A20 so we can access memory above 1 meg. + * Use the zero-valued %cx as a timeout for embedded hardware which do not + * have a keyboard controller. + */ +seta20: cli # Disable interrupts +seta20.1: dec %cx # Timeout? + jz seta20.3 # Yes + inb $0x64,%al # Get status + testb $0x2,%al # Busy? + jnz seta20.1 # Yes + movb $0xd1,%al # Command: Write + outb %al,$0x64 # output port +seta20.2: inb $0x64,%al # Get status + testb $0x2,%al # Busy? + jnz seta20.2 # Yes + movb $0xdf,%al # Enable + outb %al,$0x60 # A20 +seta20.3: sti # Enable interrupts + + jmp start+MEM_JMP-MEM_ORG # Start BTX + + +/* + * Trampoline used to call read from within boot1. + */ +nread: xor %ax,%ax # Sector offset in partition +nread.1: mov $MEM_BUF,%bx # Transfer buffer + add 0x8(%si),%ax # Get + mov 0xa(%si),%cx # LBA + push %cs # Read from + callw xread.1 # disk + jnc return # If success, return + mov $msg_read,%si # Otherwise, set the error + # message and fall through to + # the error routine +/* + * Print out the error message pointed to by %ds:(%si) followed + * by a prompt, wait for a keypress, and then reboot the machine. + */ +error: callw putstr # Display message + mov $prompt,%si # Display + callw putstr # prompt + xorb %ah,%ah # BIOS: Get + int $0x16 # keypress + movw $0x1234, BDA_BOOT # Do a warm boot + ljmp $0xffff,$0x0 # reboot the machine +/* + * Display a null-terminated string using the BIOS output. + */ +putstr.0: mov $0x7,%bx # Page:attribute + movb $0xe,%ah # BIOS: Display + int $0x10 # character +putstr: lodsb # Get char + testb %al,%al # End of string? + jne putstr.0 # No + +/* + * Overused return code. ereturn is used to return an error from the + * read function. Since we assume putstr succeeds, we (ab)use the + * same code when we return from putstr. + */ +ereturn: movb $0x1,%ah # Invalid + stc # argument +return: retw # To caller +/* + * Reads sectors from the disk. If EDD is enabled, then check if it is + * installed and use it if it is. If it is not installed or not enabled, then + * fall back to using CHS. Since we use a LBA, if we are using CHS, we have to + * fetch the drive parameters from the BIOS and divide it out ourselves. + * Call with: + * + * %dl - byte - drive number + * stack - 10 bytes - EDD Packet + */ +read: testb $FL_PACKET,%cs:MEM_REL+flags-start # LBA support enabled? + jz read.1 # No, use CHS + cmpb $0x80,%dl # Hard drive? + jb read.1 # No, use CHS + mov $0x55aa,%bx # Magic + push %dx # Save + movb $0x41,%ah # BIOS: Check + int $0x13 # extensions present + pop %dx # Restore + jc read.1 # If error, use CHS + cmp $0xaa55,%bx # Magic? + jne read.1 # No, so use CHS + testb $0x1,%cl # Packet interface? + jz read.1 # No, so use CHS + mov %bp,%si # Disk packet + movb $0x42,%ah # BIOS: Extended + int $0x13 # read + retw # To caller +#if 0 +read.1: push %dx # Save + movb $0x8,%ah # BIOS: Get drive + int $0x13 # parameters + movb %dh,%ch # Max head number + pop %dx # Restore + jc return # If error + andb $0x3f,%cl # Sectors per track + jz ereturn # If zero + cli # Disable interrupts + mov 0x8(%bp),%eax # Get LBA + push %dx # Save + movzbl %cl,%ebx # Divide by + xor %edx,%edx # sectors + div %ebx # per track + movb %ch,%bl # Max head number + movb %dl,%ch # Sector number + inc %bx # Divide by + xorb %dl,%dl # number + div %ebx # of heads + movb %dl,%bh # Head number + pop %dx # Restore + cmpl $0x3ff,%eax # Cylinder number supportable? + sti # Enable interrupts + ja ereturn # No, return an error + xchgb %al,%ah # Set up cylinder + rorb $0x2,%al # number + orb %ch,%al # Merge + inc %ax # sector + xchg %ax,%cx # number + movb %bh,%dh # Head number + subb %ah,%al # Sectors this track + mov 0x2(%bp),%ah # Blocks to read + cmpb %ah,%al # To read + jb read.2 # this +#ifdef TRACK_AT_A_TIME + movb %ah,%al # track +#else + movb $1,%al # one sector +#endif +read.2: mov $0x5,%di # Try count +read.3: les 0x4(%bp),%bx # Transfer buffer + push %ax # Save + movb $0x2,%ah # BIOS: Read + int $0x13 # from disk + pop %bx # Restore + jnc read.4 # If success + dec %di # Retry? + jz read.6 # No + xorb %ah,%ah # BIOS: Reset + int $0x13 # disk system + xchg %bx,%ax # Block count + jmp read.3 # Continue +read.4: movzbw %bl,%ax # Sectors read + add %ax,0x8(%bp) # Adjust + jnc read.5 # LBA, + incw 0xa(%bp) # transfer +read.5: shlb %bl # buffer + add %bl,0x5(%bp) # pointer, + sub %al,0x2(%bp) # block count + ja read.1 # If not done +read.6: retw # To caller +#else +read.1: mov $msg_chs,%si + jmp error +msg_chs: .asciz "CHS not supported" +#endif + +/* Messages */ + +msg_read: .asciz "Read" +msg_part: .asciz "Boot" + +prompt: .asciz " error\r\n" + +flags: .byte FLAGS # Flags + + .org PRT_OFF,0x90 + +/* Partition table */ + + .fill 0x30,0x1,0x0 +part4: .byte 0x80, 0x00, 0x01, 0x00 + .byte 0xa5, 0xfe, 0xff, 0xff + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x50, 0xc3, 0x00, 0x00 # 50000 sectors long, bleh + + .word 0xaa55 # Magic number Added: stable/7/sys/boot/zfs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/zfs/Makefile Sat May 23 19:54:18 2009 (r192665) @@ -0,0 +1,39 @@ +# $FreeBSD$ + +LIB= zfsboot +INTERNALLIB= + +SRCS+= zfs.c + +CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. +CFLAGS+= -I${.CURDIR}/../../../lib/libstand +CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs + +CFLAGS+= -ffreestanding +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +CFLAGS+= -mpreferred-stack-boundary=2 +CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 +.endif +.if ${MACHINE_ARCH} == "i386" +CFLAGS+= -mno-sse3 +.endif +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "arm" +CFLAGS+= -msoft-float +.endif +.if ${MACHINE_ARCH} == "amd64" +CFLAGS+= -m32 -march=i386 +.endif + +CFLAGS+= -Wformat -Wall + +.if ${MACHINE_ARCH} == "amd64" +CLEANFILES+= machine +machine: + ln -sf ${.CURDIR}/../../i386/include machine +.endif + +.include + +.if ${MACHINE_ARCH} == "amd64" +beforedepend ${OBJS}: machine +.endif Added: stable/7/sys/boot/zfs/zfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/boot/zfs/zfs.c Sat May 23 19:54:18 2009 (r192665) @@ -0,0 +1,518 @@ +/*- + * Copyright (c) 2007 Doug Rabson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Stand-alone file reading package. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "zfsimpl.c" + +static int zfs_open(const char *path, struct open_file *f); +static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); +static int zfs_close(struct open_file *f); +static int zfs_read(struct open_file *f, void *buf, size_t size, size_t *resid); +static off_t zfs_seek(struct open_file *f, off_t offset, int where); +static int zfs_stat(struct open_file *f, struct stat *sb); +static int zfs_readdir(struct open_file *f, struct dirent *d); + +struct devsw zfs_dev; + +struct fs_ops zfs_fsops = { + "zfs", + zfs_open, + zfs_close, + zfs_read, + zfs_write, + zfs_seek, + zfs_stat, + zfs_readdir +}; + +/* + * In-core open file. + */ +struct file { + off_t f_seekp; /* seek pointer */ + dnode_phys_t f_dnode; + uint64_t f_zap_type; /* zap type for readdir */ + uint64_t f_num_leafs; /* number of fzap leaf blocks */ + zap_leaf_phys_t *f_zap_leaf; /* zap leaf buffer */ +}; + +/* + * Open a file. + */ +static int +zfs_open(const char *upath, struct open_file *f) +{ + spa_t *spa = (spa_t *) f->f_devdata; + struct file *fp; + int rc; + + if (f->f_dev != &zfs_dev) + return (EINVAL); + + rc = zfs_mount_pool(spa); + if (rc) + return (rc); + + /* allocate file system specific data structure */ + fp = malloc(sizeof(struct file)); + bzero(fp, sizeof(struct file)); + f->f_fsdata = (void *)fp; + + if (spa->spa_root_objset.os_type != DMU_OST_ZFS) { + printf("Unexpected object set type %lld\n", + spa->spa_root_objset.os_type); + rc = EIO; + goto out; + } + + rc = zfs_lookup(spa, upath, &fp->f_dnode); + if (rc) + goto out; + + fp->f_seekp = 0; +out: + if (rc) { + f->f_fsdata = NULL; + free(fp); + } + return (rc); +} + +static int +zfs_close(struct open_file *f) +{ + struct file *fp = (struct file *)f->f_fsdata; + + dnode_cache_obj = 0; + f->f_fsdata = (void *)0; + if (fp == (struct file *)0) + return (0); + + free(fp); + return (0); +} + +/* + * Copy a portion of a file into kernel memory. + * Cross block boundaries when necessary. + */ +static int +zfs_read(struct open_file *f, void *start, size_t size, size_t *resid /* out */) +{ + spa_t *spa = (spa_t *) f->f_devdata; + struct file *fp = (struct file *)f->f_fsdata; + const znode_phys_t *zp = (const znode_phys_t *) fp->f_dnode.dn_bonus; + size_t n; + int rc; + + n = size; + if (fp->f_seekp + n > zp->zp_size) + n = zp->zp_size - fp->f_seekp; + + rc = dnode_read(spa, &fp->f_dnode, fp->f_seekp, start, n); + if (rc) + return (rc); + + if (0) { + int i; + for (i = 0; i < n; i++) + putchar(((char*) start)[i]); + } + fp->f_seekp += n; + if (resid) + *resid = size - n; + + return (0); +} + +/* + * Don't be silly - the bootstrap has no business writing anything. + */ +static int +zfs_write(struct open_file *f, void *start, size_t size, size_t *resid /* out */) +{ + + return (EROFS); +} + +static off_t +zfs_seek(struct open_file *f, off_t offset, int where) +{ + struct file *fp = (struct file *)f->f_fsdata; + znode_phys_t *zp = (znode_phys_t *) fp->f_dnode.dn_bonus; + + switch (where) { + case SEEK_SET: + fp->f_seekp = offset; + break; + case SEEK_CUR: + fp->f_seekp += offset; + break; + case SEEK_END: + fp->f_seekp = zp->zp_size - offset; + break; + default: + errno = EINVAL; + return (-1); + } + return (fp->f_seekp); +} + +static int +zfs_stat(struct open_file *f, struct stat *sb) +{ + struct file *fp = (struct file *)f->f_fsdata; + znode_phys_t *zp = (znode_phys_t *) fp->f_dnode.dn_bonus; + + /* only important stuff */ + sb->st_mode = zp->zp_mode; + sb->st_uid = zp->zp_uid; + sb->st_gid = zp->zp_gid; + sb->st_size = zp->zp_size; + + return (0); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***