From owner-svn-src-head@FreeBSD.ORG Sun May 23 05:18:57 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CA9F1065672; Sun, 23 May 2010 05:18:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB1A8FC16; Sun, 23 May 2010 05:18:56 +0000 (UTC) Received: from c122-107-114-249.carlnfd1.nsw.optusnet.com.au (c122-107-114-249.carlnfd1.nsw.optusnet.com.au [122.107.114.249]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o4N5Iqf9031410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 May 2010 15:18:53 +1000 Date: Sun, 23 May 2010 15:18:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Konstantin Belousov In-Reply-To: <201005211036.o4LAaUXV090349@svn.freebsd.org> Message-ID: <20100523145531.M13483@delplex.bde.org> References: <201005211036.o4LAaUXV090349@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208374 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 05:18:57 -0000 On Fri, 21 May 2010, Konstantin Belousov wrote: > Log: > Remove PIOLLHUP from the flags used to test for to set exceptfsd > fd_set bits in select(2). It seems that historical behaviour is to not > reporting exception on EOF, and several applications are broken. > > Reported by: Yoshihiko Sarumaru > Discussed with: bde Er, the discussion pointed out that this change has no effect (except possibly for bugs). > Modified: head/sys/kern/sys_generic.c > ============================================================================== > --- head/sys/kern/sys_generic.c Fri May 21 09:52:49 2010 (r208373) > +++ head/sys/kern/sys_generic.c Fri May 21 10:36:29 2010 (r208374) > @@ -996,7 +996,7 @@ done: > static int select_flags[3] = { > POLLRDNORM | POLLHUP | POLLERR, > POLLWRNORM | POLLHUP | POLLERR, > - POLLRDBAND | POLLHUP | POLLERR > + POLLRDBAND | POLLERR > }; > > /* > POLLHUP and POLLHUP are output-only, so their use as input flags here is nonsense on all 3 lines. This nonsense has no effect as far as I can see, since nonsensical input flags are ignored. POLLHUP is still set unconditionally (if hangup actually occurs) for all 3 channels, and this conflicts with the historical misbehaviour for the exceptfds channel. POLLHUP can be suppressed by POLLINIGNEOF. Using POLLINIGNEOF on the 3rd channel onnel seems to work right here, although POLLINIGNEOF's name indicates that it should not -- as its name suggests, POLLINIGNEOF was intended to only cause EOF to be ignored for the input channel, and it may have actually done that, but it now applies to all channels. This doesn't matter for select() since there is a separate poll at the lowest level each channel, but for poll() there is normally only 1 poll at the lowest level, and in any case userland cannot influence the misapplication of POLLINIGNEOF to a non-input event, and anyway^2 poll()'s semantics require it to set POLLHUP even if there the input mask of events is empty, so poll()'s channels are inseparable for POLLHUP. The style bugs (4-char primary indentation) remain. Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 23 06:39:03 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABC441065670; Sun, 23 May 2010 06:39:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6AD468FC13; Sun, 23 May 2010 06:39:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o4N6ZQh7089588; Sun, 23 May 2010 00:35:26 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 23 May 2010 00:35:26 -0600 (MDT) Message-Id: <20100523.003526.1142818667088610804.imp@bsdimp.com> To: mav@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <201005170351.o4H3pvuG006399@svn.freebsd.org> References: <201005170351.o4H3pvuG006399@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208183 - in head/sys: conf modules/mvs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 06:39:03 -0000 In message: <201005170351.o4H3pvuG006399@svn.freebsd.org> Alexander Motin writes: : Author: mav : Date: Mon May 17 03:51:57 2010 : New Revision: 208183 : URL: http://svn.freebsd.org/changeset/base/208183 : : Log: : Make mvs_if.c to not be always linked statically into the kernel. : Link it same way as mvs.c. A consequence of this will be that if you kldload modules that use the mvs_if.m services, but don't have the mvs.ko module, then you'll have problems. I ran into this with pccard/pcic/pccbb/cardbus/*pccard.c drivers so I compiled pccard_if.m into the kernel statically. I don't know if that's a big deal for you, but it is why things like this are usually linked in statically. Warner : Modified: : head/sys/conf/files : head/sys/modules/mvs/Makefile : : Modified: head/sys/conf/files : ============================================================================== : --- head/sys/conf/files Mon May 17 02:44:51 2010 (r208182) : +++ head/sys/conf/files Mon May 17 03:51:57 2010 (r208183) : @@ -1294,7 +1294,7 @@ dev/mpt/mpt_raid.c optional mpt : dev/mpt/mpt_user.c optional mpt : dev/msk/if_msk.c optional msk inet : dev/mvs/mvs.c optional mvs : -dev/mvs/mvs_if.m standard : +dev/mvs/mvs_if.m optional mvs : dev/mvs/mvs_pci.c optional mvs pci : dev/mwl/if_mwl.c optional mwl : dev/mwl/if_mwl_pci.c optional mwl pci : : Modified: head/sys/modules/mvs/Makefile : ============================================================================== : --- head/sys/modules/mvs/Makefile Mon May 17 02:44:51 2010 (r208182) : +++ head/sys/modules/mvs/Makefile Mon May 17 03:51:57 2010 (r208183) : @@ -3,7 +3,7 @@ : .PATH: ${.CURDIR}/../../dev/mvs : : KMOD= mvs : -SRCS= mvs.c mvs_pci.c mvs.h mvs_if.h device_if.h bus_if.h pci_if.h opt_cam.h : +SRCS= mvs.c mvs_pci.c mvs.h mvs_if.c mvs_if.h device_if.h bus_if.h pci_if.h opt_cam.h : : MFILES= kern/bus_if.m kern/device_if.m dev/pci/pci_if.m dev/mvs/mvs_if.m : : From owner-svn-src-head@FreeBSD.ORG Sun May 23 06:54:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC2761065679; Sun, 23 May 2010 06:54:13 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id F05138FC19; Sun, 23 May 2010 06:54:12 +0000 (UTC) Received: by fxm4 with SMTP id 4so2403212fxm.13 for ; Sat, 22 May 2010 23:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=/SENTo6uLFc0eCLRfbhvv79gVD0h95tp4DJaeSPVaIA=; b=mROl9r2j9r2wsHxYooMkHqtOGe4fGlABgAurKWLbcqll0TYDU6FyjCysebmX7nTlQH XLhU5PHeAe4OYaaK3NTWJxgRL77kURZEgwC9fM2ZPe1hpFai8/5Ncvcxole5w0TBfhgq DopmB07IC4IbqLjrxrmlgSt9D0qzGoKPbjkbQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=hAQ82bOYDgflNGOyKAzhC9x1U0uj9T57Hs2CmeZEi1EnefeNKvKsbqWsEUFhzdN6My Nw0tOZlBG38ra5mlHCKUfyLk5e5pDU5nbFIpMKRKaTaYB4lEXi6d61OIdlrDJFL9OgnA eihxYSUK5eMlwhxNK/Xzfix+/3Amy4iVCYeP8= Received: by 10.223.56.206 with SMTP id z14mr3265329fag.97.1274597651593; Sat, 22 May 2010 23:54:11 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id r25sm13169546fai.23.2010.05.22.23.54.10 (version=SSLv3 cipher=RC4-MD5); Sat, 22 May 2010 23:54:10 -0700 (PDT) Sender: Alexander Motin Message-ID: <4BF8D0FE.4060700@FreeBSD.org> Date: Sun, 23 May 2010 09:53:50 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: "M. Warner Losh" References: <201005170351.o4H3pvuG006399@svn.freebsd.org> <20100523.003526.1142818667088610804.imp@bsdimp.com> In-Reply-To: <20100523.003526.1142818667088610804.imp@bsdimp.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208183 - in head/sys: conf modules/mvs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 06:54:13 -0000 M. Warner Losh wrote: > In message: <201005170351.o4H3pvuG006399@svn.freebsd.org> > Alexander Motin writes: > : Author: mav > : Date: Mon May 17 03:51:57 2010 > : New Revision: 208183 > : URL: http://svn.freebsd.org/changeset/base/208183 > : > : Log: > : Make mvs_if.c to not be always linked statically into the kernel. > : Link it same way as mvs.c. > > A consequence of this will be that if you kldload modules that use the > mvs_if.m services, but don't have the mvs.ko module, then you'll have > problems. I ran into this with pccard/pcic/pccbb/cardbus/*pccard.c > drivers so I compiled pccard_if.m into the kernel statically. > > I don't know if that's a big deal for you, but it is why things like > this are usually linked in statically. Not a big deal for now, until mvs_if.m used only inside mvs.ko itself for PCI devices or statically linked kernel for PCI/SoC. Controller driver is useless without channel driver, so probably it could be declared as dependency, if sometimes needed. I just thought it is a bit dirty to have it in a kernel when all code loaded as module. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun May 23 07:23:26 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 108A1106566B; Sun, 23 May 2010 07:23:26 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id C41998FC0A; Sun, 23 May 2010 07:23:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o4N7I4fP089837; Sun, 23 May 2010 01:18:04 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 23 May 2010 01:18:04 -0600 (MDT) Message-Id: <20100523.011804.94843338771569716.imp@bsdimp.com> To: mav@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <4BF8D0FE.4060700@FreeBSD.org> References: <201005170351.o4H3pvuG006399@svn.freebsd.org> <20100523.003526.1142818667088610804.imp@bsdimp.com> <4BF8D0FE.4060700@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208183 - in head/sys: conf modules/mvs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 07:23:26 -0000 In message: <4BF8D0FE.4060700@FreeBSD.org> Alexander Motin writes: : M. Warner Losh wrote: : > In message: <201005170351.o4H3pvuG006399@svn.freebsd.org> : > Alexander Motin writes: : > : Author: mav : > : Date: Mon May 17 03:51:57 2010 : > : New Revision: 208183 : > : URL: http://svn.freebsd.org/changeset/base/208183 : > : : > : Log: : > : Make mvs_if.c to not be always linked statically into the kernel. : > : Link it same way as mvs.c. : > : > A consequence of this will be that if you kldload modules that use the : > mvs_if.m services, but don't have the mvs.ko module, then you'll have : > problems. I ran into this with pccard/pcic/pccbb/cardbus/*pccard.c : > drivers so I compiled pccard_if.m into the kernel statically. : > : > I don't know if that's a big deal for you, but it is why things like : > this are usually linked in statically. : : Not a big deal for now, until mvs_if.m used only inside mvs.ko itself : for PCI devices or statically linked kernel for PCI/SoC. Controller : driver is useless without channel driver, so probably it could be : declared as dependency, if sometimes needed. : : I just thought it is a bit dirty to have it in a kernel when all code : loaded as module. In that case, that should be fine. Just wanted to warn about the potential problem... Warner From owner-svn-src-head@FreeBSD.ORG Sun May 23 07:53:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF5C3106566C; Sun, 23 May 2010 07:53:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDDF98FC0A; Sun, 23 May 2010 07:53:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4N7rMEG012116; Sun, 23 May 2010 07:53:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4N7rMrL012112; Sun, 23 May 2010 07:53:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201005230753.o4N7rMrL012112@svn.freebsd.org> From: Alexander Motin Date: Sun, 23 May 2010 07:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208436 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 07:53:23 -0000 Author: mav Date: Sun May 23 07:53:22 2010 New Revision: 208436 URL: http://svn.freebsd.org/changeset/base/208436 Log: Make table-based HPET identification more clever. Before creating fake device, make sure we have no real HPET device entry with same ID. As side effect, it potentially allows several HPETs to be attached. Use first of them for timecounting, rest (if ever present) could later be used as event sources. Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sun May 23 07:21:50 2010 (r208435) +++ head/sys/dev/acpica/acpi.c Sun May 23 07:53:22 2010 (r208436) @@ -145,7 +145,6 @@ static void acpi_probe_children(device_t static void acpi_probe_order(ACPI_HANDLE handle, int *order); static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status); -static BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid); static void acpi_sleep_enable(void *arg); static ACPI_STATUS acpi_sleep_disable(struct acpi_softc *sc); static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state); @@ -1944,7 +1943,7 @@ acpi_BatteryIsPresent(device_t dev) /* * Match a HID string against a handle */ -static BOOLEAN +BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid) { ACPI_DEVICE_INFO *devinfo; Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Sun May 23 07:21:50 2010 (r208435) +++ head/sys/dev/acpica/acpi_hpet.c Sun May 23 07:53:22 2010 (r208436) @@ -101,41 +101,60 @@ hpet_disable(struct acpi_hpet_softc *sc) bus_write_4(sc->mem_res, HPET_CONFIG, val); } +static ACPI_STATUS +acpi_hpet_find(ACPI_HANDLE handle, UINT32 level, void *context, + void **status) +{ + char **ids; + uint32_t id = (uint32_t)(uintptr_t)context; + uint32_t adr = 0; + + for (ids = hpet_ids; *ids != NULL; ids++) { + if (acpi_MatchHid(handle, *ids)) + break; + } + if (*ids == NULL) + return (AE_OK); + if (ACPI_FAILURE(acpi_GetInteger(handle, "_ADR", &adr))) + adr = 0; + if (id == adr) + *((int *)status) = 1; + return (AE_OK); +} + /* Discover the HPET via the ACPI table of the same name. */ static void acpi_hpet_identify(driver_t *driver, device_t parent) { ACPI_TABLE_HPET *hpet; - ACPI_TABLE_HEADER *hdr; ACPI_STATUS status; device_t child; + int i, found; /* Only one HPET device can be added. */ if (devclass_get_device(acpi_hpet_devclass, 0)) return; - - /* Currently, ID and minimum clock tick info is unused. */ - - status = AcpiGetTable(ACPI_SIG_HPET, 1, (ACPI_TABLE_HEADER **)&hdr); - if (ACPI_FAILURE(status)) - return; - - /* - * The unit number could be derived from hdr->Sequence but we only - * support one HPET device. - */ - hpet = (ACPI_TABLE_HPET *)hdr; - if (hpet->Sequence != 0) - printf("ACPI HPET table warning: Sequence is non-zero (%d)\n", - hpet->Sequence); - child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "acpi_hpet", 0); - if (child == NULL) { - printf("%s: can't add child\n", __func__); - return; + for (i = 1; ; i++) { + /* Search for HPET table. */ + status = AcpiGetTable(ACPI_SIG_HPET, i, (ACPI_TABLE_HEADER **)&hpet); + if (ACPI_FAILURE(status)) + return; + /* Search for HPET device with same ID. */ + found = 0; + AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + 100, acpi_hpet_find, NULL, (void *)(uintptr_t)hpet->Sequence, (void *)&found); + /* If found - let it be probed in normal way. */ + if (found) + continue; + /* If not - create it from table info. */ + child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "acpi_hpet", 0); + if (child == NULL) { + printf("%s: can't add child\n", __func__); + continue; + } + bus_set_resource(child, SYS_RES_MEMORY, 0, hpet->Address.Address, + HPET_MEM_WIDTH); } - - bus_set_resource(child, SYS_RES_MEMORY, 0, hpet->Address.Address, - HPET_MEM_WIDTH); } static int @@ -146,8 +165,7 @@ acpi_hpet_probe(device_t dev) if (acpi_disabled("hpet")) return (ENXIO); if (acpi_get_handle(dev) != NULL && - (ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids) == NULL || - device_get_unit(dev) != 0)) + ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids) == NULL) return (ENXIO); device_set_desc(dev, "High Precision Event Timer"); @@ -233,11 +251,12 @@ acpi_hpet_attach(device_t dev) bus_free_resource(dev, SYS_RES_MEMORY, sc->mem_res); return (ENXIO); } - - hpet_timecounter.tc_frequency = freq; - hpet_timecounter.tc_priv = sc; - tc_init(&hpet_timecounter); - + /* Announce first HPET as timecounter. */ + if (device_get_unit(dev) == 0) { + hpet_timecounter.tc_frequency = freq; + hpet_timecounter.tc_priv = sc; + tc_init(&hpet_timecounter); + } return (0); } Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Sun May 23 07:21:50 2010 (r208435) +++ head/sys/dev/acpica/acpivar.h Sun May 23 07:53:22 2010 (r208436) @@ -342,6 +342,7 @@ int acpi_bus_alloc_gas(device_t dev, in u_int flags); void acpi_walk_subtables(void *first, void *end, acpi_subtable_handler *handler, void *arg); +BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid); struct acpi_parse_resource_set { void (*set_init)(device_t dev, void *arg, void **context); From owner-svn-src-head@FreeBSD.ORG Sun May 23 08:12:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0C51106564A; Sun, 23 May 2010 08:12:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FAC98FC1E; Sun, 23 May 2010 08:12:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4N8CaUu016422; Sun, 23 May 2010 08:12:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4N8CaR3016419; Sun, 23 May 2010 08:12:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201005230812.o4N8CaR3016419@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 23 May 2010 08:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208437 - head/lib/libc/posix1e X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 08:12:36 -0000 Author: trasz Date: Sun May 23 08:12:36 2010 New Revision: 208437 URL: http://svn.freebsd.org/changeset/base/208437 Log: Make acl_get_perm_np(3) work with NFSv4 ACLs. Reviewed by: kientzle@ MFC after: 1 week Modified: head/lib/libc/posix1e/acl_get.c head/lib/libc/posix1e/acl_perm.c Modified: head/lib/libc/posix1e/acl_get.c ============================================================================== --- head/lib/libc/posix1e/acl_get.c Sun May 23 07:53:22 2010 (r208436) +++ head/lib/libc/posix1e/acl_get.c Sun May 23 08:12:36 2010 (r208437) @@ -132,30 +132,6 @@ acl_get_fd_np(int fd, acl_type_t type) return (aclp); } -int -acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm) -{ - - if (permset_d == NULL) { - errno = EINVAL; - return (-1); - } - - switch(perm) { - case ACL_READ: - case ACL_WRITE: - case ACL_EXECUTE: - if (*permset_d & perm) - return (1); - break; - default: - errno = EINVAL; - return (-1); - } - - return (0); -} - /* * acl_get_permset() (23.4.17): return via permset_p a descriptor to * the permission set in the ACL entry entry_d. Modified: head/lib/libc/posix1e/acl_perm.c ============================================================================== --- head/lib/libc/posix1e/acl_perm.c Sun May 23 07:53:22 2010 (r208436) +++ head/lib/libc/posix1e/acl_perm.c Sun May 23 08:12:36 2010 (r208437) @@ -108,3 +108,21 @@ acl_delete_perm(acl_permset_t permset_d, return (0); } + +int +acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm) +{ + + if (permset_d == NULL) { + errno = EINVAL; + return (-1); + } + + if (_perm_is_invalid(perm)) + return (-1); + + if (*permset_d & perm) + return (1); + + return (0); +} From owner-svn-src-head@FreeBSD.ORG Sun May 23 08:31:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A81A1065673; Sun, 23 May 2010 08:31:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49C6D8FC16; Sun, 23 May 2010 08:31:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4N8VFo7020572; Sun, 23 May 2010 08:31:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4N8VFoJ020570; Sun, 23 May 2010 08:31:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201005230831.o4N8VFoJ020570@svn.freebsd.org> From: Alexander Motin Date: Sun, 23 May 2010 08:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208438 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 08:31:15 -0000 Author: mav Date: Sun May 23 08:31:15 2010 New Revision: 208438 URL: http://svn.freebsd.org/changeset/base/208438 Log: Oops, HPET ID optionally stored in _UID, not in _ADR. Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Sun May 23 08:12:36 2010 (r208437) +++ head/sys/dev/acpica/acpi_hpet.c Sun May 23 08:31:15 2010 (r208438) @@ -107,7 +107,7 @@ acpi_hpet_find(ACPI_HANDLE handle, UINT3 { char **ids; uint32_t id = (uint32_t)(uintptr_t)context; - uint32_t adr = 0; + uint32_t uid = 0; for (ids = hpet_ids; *ids != NULL; ids++) { if (acpi_MatchHid(handle, *ids)) @@ -115,9 +115,9 @@ acpi_hpet_find(ACPI_HANDLE handle, UINT3 } if (*ids == NULL) return (AE_OK); - if (ACPI_FAILURE(acpi_GetInteger(handle, "_ADR", &adr))) - adr = 0; - if (id == adr) + if (ACPI_FAILURE(acpi_GetInteger(handle, "_UID", &uid))) + uid = 0; + if (id == uid) *((int *)status) = 1; return (AE_OK); } From owner-svn-src-head@FreeBSD.ORG Sun May 23 08:34:19 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A2E41065672; Sun, 23 May 2010 08:34:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 2278F8FC1A; Sun, 23 May 2010 08:34:18 +0000 (UTC) Received: from c122-107-114-249.carlnfd1.nsw.optusnet.com.au (c122-107-114-249.carlnfd1.nsw.optusnet.com.au [122.107.114.249]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o4N8XjKY026196 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 May 2010 18:34:16 +1000 Date: Sun, 23 May 2010 18:33:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Poul-Henning Kamp In-Reply-To: <201005200616.o4K6GDN8010282@svn.freebsd.org> Message-ID: <20100523174020.X13588@delplex.bde.org> References: <201005200616.o4K6GDN8010282@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208331 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 08:34:19 -0000 On Thu, 20 May 2010, Poul-Henning Kamp wrote: > Log: > Fix some way-past-brucification complaints from FlexeLint. Its complaint switch needs work ;-). > Modified: head/sys/sys/endian.h > ============================================================================== > --- head/sys/sys/endian.h Thu May 20 06:05:40 2010 (r208330) > +++ head/sys/sys/endian.h Thu May 20 06:16:13 2010 (r208331) > ... > static __inline uint16_t > be16dec(const void *pp) > { > - unsigned char const *p = (unsigned char const *)pp; > + uint8_t const *p = (uint8_t const *)pp; All functions in this file still fail header engineering 101. The valid application code #define p you lose #include fails messily. At least the i386 in at least old versions is careful about this, and is not included by any other header, so the problem is smaller than it would be for . > ... > @@ -102,15 +107,15 @@ be16dec(const void *pp) > static __inline uint32_t > be32dec(const void *pp) > { > - unsigned char const *p = (unsigned char const *)pp; > + uint8_t const *p = (uint8_t const *)pp; > > - return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); > + return (((unsigned)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); > } This cast is ugly but is not ugly enough to be sufficient. It assumes >= 32-bit unsigneds. Due to the STDC "value-preserving" extension botch, there are the following problems: - p[3] extends to a signed int. No problem since uint8_t is guaranteed to fit in a signed int. - p[2] extends to a signed int. Then p[2] << 8 overflows if ints are 16 bits and the top bit of p[2] is set. The above works if ints have > 16 bits. - similarly, p[1] << 16 can overflow in more cases than p[2] << 16, but the above works if ints have > 24 bits. - similarly, p[0] << 24 can overflow if ints have <= 32 bits, which is the case on all supported machines, but the above fixes this if unsigned's have >= 32 bits, which is the case on all supported machines. The behaviour on overflow is explicitly undefined in C99. In C90, the specification is too fuzzy to say what happens on overflow, and may even be too fuzzy to specify what happens on non-overflow of a shift of a signed type even for left shifting. So careful code would cast everything to a sufficiently wide _unsigned_ type before shifting. E.g., return (((uint32_t)p[0] << 24) | ((uint24_t)/* sic */p[1] << 16) | ((uint16_t)p[2] << 8) | p[3]); However, this is ugly, and since the undefined behaviour is benign on all supported machines, we may as well depend on it and omit all the casts instead of depending on int being >= 24 bits and unsigned being >= 32 bits on all supported machines. FlexeLint complaining about the implementation depending on impleentation details is a bug. > static __inline uint64_t > le64dec(const void *pp) > { > - unsigned char const *p = (unsigned char const *)pp; > + uint8_t const *p = (uint8_t const *)pp; > > return (((uint64_t)le32dec(p + 4) << 32) | le32dec(p)); > } Similarly in all the `dec' functions, except casts to uint64_t like the above are necessary on all supported machines, so they were already done. > @@ -162,16 +167,16 @@ be32enc(void *pp, uint32_t u) > static __inline void > be64enc(void *pp, uint64_t u) > { > - unsigned char *p = (unsigned char *)pp; > + uint8_t *p = (uint8_t *)pp; > > - be32enc(p, u >> 32); > - be32enc(p + 4, u & 0xffffffff); > + be32enc(p, (uint32_t)(u >> 32)); This cast has no effect, since the prototype already does it. If you want to need such casts, use a K&R compiler. > + be32enc(p + 4, (uint32_t)(u & 0xffffffffU)); This cast has no effect, as above. Casting u would make more sense (it would manually optimize for compilers that don't reduce to a 32-bit and operation automatically). The explicit unsigned constant is another type of (bogus) cast. It has no effect, except on machines with < 32-bit unsigned it should cause a warning that the constant is too larged for its type. > } > > static __inline void > le16enc(void *pp, uint16_t u) > { > - unsigned char *p = (unsigned char *)pp; > + uint8_t *p = (uint8_t *)pp; > > p[0] = u & 0xff; > p[1] = (u >> 8) & 0xff; To be bogon for bogon compatible with the above, this should cast down u and spell 0xff as 0xffU or (uint8_t)u. These cast are equally (not) needed. > ... > #endif /* _SYS_ENDIAN_H_ */ > Style bugs: (1) tab instead of space between #endif and comment (2) backwards comment on #endif. Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 23 09:01:44 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA3C1106567F; Sun, 23 May 2010 09:01:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 6149A8FC19; Sun, 23 May 2010 09:01:43 +0000 (UTC) Received: from c122-107-114-249.carlnfd1.nsw.optusnet.com.au (c122-107-114-249.carlnfd1.nsw.optusnet.com.au [122.107.114.249]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o4N91f7A010101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 May 2010 19:01:42 +1000 Date: Sun, 23 May 2010 19:01:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Poul-Henning Kamp In-Reply-To: <201005200618.o4K6I3G3010713@svn.freebsd.org> Message-ID: <20100523183502.C13588@delplex.bde.org> References: <201005200618.o4K6I3G3010713@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208332 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 09:01:45 -0000 On Thu, 20 May 2010, Poul-Henning Kamp wrote: > Log: > Rename an argument from "exp" to "expect" since the former makes FlexeLint > uneasy, in case anybody think it might be exp(3) in libm. Bug in FlexeLint. exp(3) is supposed to be in libc, so conflicts with it are more possible than with a function in a pure independent library, but even then exp is only reserved at certain scopes that don't apply here, and this reservation actually reduces the problem (since exp is reserved as a macro iff is included, applications cannot #define it then and shouldn't #define it otherwise). should be kernel-only. > This also makes it consistent with other archs. Bug in the other arches. > Modified: head/sys/amd64/include/atomic.h > ============================================================================== > --- head/sys/amd64/include/atomic.h Thu May 20 06:16:13 2010 (r208331) > +++ head/sys/amd64/include/atomic.h Thu May 20 06:18:03 2010 (r208332) > @@ -76,8 +76,8 @@ > void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \ > void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v) > > -int atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src); > -int atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src); > +int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src); > +int atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src); > u_int atomic_fetchadd_int(volatile u_int *p, u_int v); > u_long atomic_fetchadd_long(volatile u_long *p, u_long v); > Function parameters are in thir own namespace, so they cannot conflict with the extern function `exp', and one named `exp' is less likely to conflict with anything than one name `p' for example. > @@ -124,13 +124,13 @@ struct __hack > /* > * Atomic compare and set, used by the mutex functions > * > - * if (*dst == exp) *dst = src (all 32 bit words) > + * if (*dst == expect) *dst = src (all 32 bit words) > * > * Returns 0 on failure, non-zero on success > */ > > static __inline int > -atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src) > +atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src) This API not only should be kernel-only; it obviously is kernel-only (despite abuses in libc and hopefully nowhere else), since like most kernel-only headers it takes no care with namespaces -- here it uses the popular identifiers dst and src. Style bug: all the parameters had short names of the same length. Now `expect' is odd. The atomic API is also kernel-only in its man page, and its man page uses quite different parameter names to the above, so no change to the man page is needed to be compatible with this commit, but either the code or the man page should be changed to be compatible with each other. In the man page, the parameter names for the above function are (dst, old, new); the man page has no reference to either `exp' or `expect'. Both sets are especially incompletely descriptive for the old/expect parameter because the semantics of this parameter are especially complicated so they cannot be described in 1 word. Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 23 09:44:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB0BD106566B; Sun, 23 May 2010 09:44:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B0AA8FC1C; Sun, 23 May 2010 09:44:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4N9imfp036857; Sun, 23 May 2010 09:44:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4N9imO9036855; Sun, 23 May 2010 09:44:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201005230944.o4N9imO9036855@svn.freebsd.org> From: Alexander Motin Date: Sun, 23 May 2010 09:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208441 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 09:44:48 -0000 Author: mav Date: Sun May 23 09:44:48 2010 New Revision: 208441 URL: http://svn.freebsd.org/changeset/base/208441 Log: Report relative card address to NewBus as location string. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Sun May 23 09:28:55 2010 (r208440) +++ head/sys/dev/mmc/mmc.c Sun May 23 09:44:48 2010 (r208441) @@ -1500,6 +1500,15 @@ mmc_delayed_attach(void *xsc) config_intrhook_disestablish(&sc->config_intrhook); } +static int +mmc_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + + snprintf(buf, buflen, "rca=0x%04x", mmc_get_rca(child)); + return (0); +} + static device_method_t mmc_methods[] = { /* device_if */ DEVMETHOD(device_probe, mmc_probe), @@ -1511,6 +1520,7 @@ static device_method_t mmc_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, mmc_read_ivar), DEVMETHOD(bus_write_ivar, mmc_write_ivar), + DEVMETHOD(bus_child_location_str, mmc_child_location_str), /* MMC Bus interface */ DEVMETHOD(mmcbus_wait_for_request, mmc_wait_for_request), From owner-svn-src-head@FreeBSD.ORG Sun May 23 10:08:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 725C21065674; Sun, 23 May 2010 10:08:05 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61EF68FC0C; Sun, 23 May 2010 10:08:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NA85r8042161; Sun, 23 May 2010 10:08:05 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NA85Eu042159; Sun, 23 May 2010 10:08:05 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201005231008.o4NA85Eu042159@svn.freebsd.org> From: Martin Matuska Date: Sun, 23 May 2010 10:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208442 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 10:08:05 -0000 Author: mm Date: Sun May 23 10:08:05 2010 New Revision: 208442 URL: http://svn.freebsd.org/changeset/base/208442 Log: Fix mutex_exit misorder that can cause a kernel panic. OpenSolaris onnv revision: 8667:5c308a17eb7c Approved by: delphij (mentor) Obtained from: OpenSolaris (Bug ID 6795440) MFC after: 1 day Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun May 23 09:44:48 2010 (r208441) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun May 23 10:08:05 2010 (r208442) @@ -2082,10 +2082,10 @@ spa_create(const char *pool, nvlist_t *n if (version >= SPA_VERSION_ZPOOL_HISTORY && history_str != NULL) (void) spa_history_log(spa, history_str, LOG_CMD_POOL_CREATE); - mutex_exit(&spa_namespace_lock); - spa->spa_minref = refcount_count(&spa->spa_refcount); + mutex_exit(&spa_namespace_lock); + return (0); } From owner-svn-src-head@FreeBSD.ORG Sun May 23 10:13:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6508106566B; Sun, 23 May 2010 10:13:11 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5DB58FC16; Sun, 23 May 2010 10:13:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NADBY6044653; Sun, 23 May 2010 10:13:11 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NADBVE044632; Sun, 23 May 2010 10:13:11 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201005231013.o4NADBVE044632@svn.freebsd.org> From: Martin Matuska Date: Sun, 23 May 2010 10:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208443 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 10:13:12 -0000 Author: mm Date: Sun May 23 10:13:11 2010 New Revision: 208443 URL: http://svn.freebsd.org/changeset/base/208443 Log: Fix kernel panic when calling spa_tryimport() on a corrupted pool. OpenSolaris onnv revision: 8680:005fe27123ba Approved by: delphij (mentor) Obtained from: OpenSolaris (Bug ID 6786321) MFC after: 1 day Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun May 23 10:08:05 2010 (r208442) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun May 23 10:13:11 2010 (r208443) @@ -2478,6 +2478,7 @@ spa_tryimport(nvlist_t *tryconfig) char *poolname; spa_t *spa; uint64_t state; + int error; if (nvlist_lookup_string(tryconfig, ZPOOL_CONFIG_POOL_NAME, &poolname)) return (NULL); @@ -2497,7 +2498,7 @@ spa_tryimport(nvlist_t *tryconfig) * Pass TRUE for mosconfig because the user-supplied config * is actually the one to trust when doing an import. */ - (void) spa_load(spa, tryconfig, SPA_LOAD_TRYIMPORT, B_TRUE); + error = spa_load(spa, tryconfig, SPA_LOAD_TRYIMPORT, B_TRUE); /* * If 'tryconfig' was at least parsable, return the current config. @@ -2516,7 +2517,7 @@ spa_tryimport(nvlist_t *tryconfig) * copy it out so that external consumers can tell which * pools are bootable. */ - if (spa->spa_bootfs) { + if ((!error || error == EEXIST) && spa->spa_bootfs) { char *tmpname = kmem_alloc(MAXPATHLEN, KM_SLEEP); /* From owner-svn-src-head@FreeBSD.ORG Sun May 23 12:36:19 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 220631065674; Sun, 23 May 2010 12:36:19 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id D31F18FC08; Sun, 23 May 2010 12:36:18 +0000 (UTC) Received: from critter.freebsd.dk (critter-phk.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 72543900AD; Sun, 23 May 2010 12:36:16 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id o4NCaFIa011070; Sun, 23 May 2010 12:36:16 GMT (envelope-from phk@critter.freebsd.dk) To: Bruce Evans From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 23 May 2010 19:01:41 +1000." <20100523183502.C13588@delplex.bde.org> Date: Sun, 23 May 2010 12:36:15 +0000 Message-ID: <11069.1274618175@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208332 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 12:36:19 -0000 In message <20100523183502.C13588@delplex.bde.org>, Bruce Evans writes: >On Thu, 20 May 2010, Poul-Henning Kamp wrote: > should be kernel-only. No, it absolutely should not, if anything, it should be pushed as international standards (with , and ). Atomic operations and write barriers are necessary when multiple threads or processes cooperate using shared memory. and if anything the bug is that POSIX has not updated pthreads to have these and other necessary primitives. (pthread_mutex_assert_held() for instance). I agree that FlexeLint is a bit hysterical at times, but when the issue can be avioded at a "cost" of increased clarity of intention, I don't see any reason to not do so. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Sun May 23 12:42:15 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68E8E106566C; Sun, 23 May 2010 12:42:15 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 2AFD78FC15; Sun, 23 May 2010 12:42:14 +0000 (UTC) Received: from critter.freebsd.dk (critter-phk.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id F0C89900AD; Sun, 23 May 2010 12:42:13 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id o4NCgDgj011086; Sun, 23 May 2010 12:42:13 GMT (envelope-from phk@critter.freebsd.dk) To: Bruce Evans From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 23 May 2010 18:33:45 +1000." <20100523174020.X13588@delplex.bde.org> Date: Sun, 23 May 2010 12:42:13 +0000 Message-ID: <11085.1274618533@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208331 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 12:42:15 -0000 In message <20100523174020.X13588@delplex.bde.org>, Bruce Evans writes: >On Thu, 20 May 2010, Poul-Henning Kamp wrote: >> Log: >> Fix some way-past-brucification complaints from FlexeLint. > >Its complaint switch needs work ;-). Gimpel Software has been pretty receptive to my input, but I have not, and will not, suggest the -bde option to them. :-) > It assumes >>= 32-bit unsigneds. I think we all do these days :-) >FlexeLint complaining about the implementation depending on impleentation >details is a bug. No, that is configurable. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Sun May 23 13:15:16 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D744106566C; Sun, 23 May 2010 13:15:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id BD8B98FC12; Sun, 23 May 2010 13:15:15 +0000 (UTC) Received: from c122-107-114-249.carlnfd1.nsw.optusnet.com.au (c122-107-114-249.carlnfd1.nsw.optusnet.com.au [122.107.114.249]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o4NDF9Mh024179 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 May 2010 23:15:13 +1000 Date: Sun, 23 May 2010 23:15:09 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Poul-Henning Kamp In-Reply-To: <11069.1274618175@critter.freebsd.dk> Message-ID: <20100523230410.K17698@delplex.bde.org> References: <11069.1274618175@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r208332 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 13:15:16 -0000 On Sun, 23 May 2010, Poul-Henning Kamp wrote: > In message <20100523183502.C13588@delplex.bde.org>, Bruce Evans writes: >> On Thu, 20 May 2010, Poul-Henning Kamp wrote: > >> should be kernel-only. > > No, it absolutely should not, if anything, it should be pushed as > international standards (with , and ). > > Atomic operations and write barriers are necessary when multiple > threads or processes cooperate using shared memory. and if anything > the bug is that POSIX has not updated pthreads to have these and > other necessary primitives. (pthread_mutex_assert_held() for instance). Pehraps, but was only designed, implemented and documented for use in the kernel. And of course any standardized version won't look like the FreeBSD kernel one. The kernel one is too bloated for me, but a general-purpose one should be even more bloated so as to support all types and more than atomic ops. Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 23 14:11:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF64A106564A; Sun, 23 May 2010 14:11:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 951D38FC15; Sun, 23 May 2010 14:11:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NEBSak098376; Sun, 23 May 2010 14:11:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NEBS4b098375; Sun, 23 May 2010 14:11:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201005231411.o4NEBS4b098375@svn.freebsd.org> From: Alexander Motin Date: Sun, 23 May 2010 14:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208449 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 14:11:28 -0000 Author: mav Date: Sun May 23 14:11:27 2010 New Revision: 208449 URL: http://svn.freebsd.org/changeset/base/208449 Log: mvs(4) will first appear in FreeBSD 8.1. Modified: head/share/man/man4/mvs.4 Modified: head/share/man/man4/mvs.4 ============================================================================== --- head/share/man/man4/mvs.4 Sun May 23 11:29:34 2010 (r208448) +++ head/share/man/man4/mvs.4 Sun May 23 14:11:27 2010 (r208449) @@ -171,6 +171,6 @@ for each port. The .Nm driver first appeared in -.Fx 9.0 . +.Fx 8.1 . .Sh AUTHORS .An Alexander Motin Aq mav@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Sun May 23 17:45:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46651106566C; Sun, 23 May 2010 17:45:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340668FC14; Sun, 23 May 2010 17:45:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NHj25d045491; Sun, 23 May 2010 17:45:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NHj2wF045486; Sun, 23 May 2010 17:45:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201005231745.o4NHj2wF045486@svn.freebsd.org> From: Alexander Motin Date: Sun, 23 May 2010 17:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208452 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 17:45:02 -0000 Author: mav Date: Sun May 23 17:45:01 2010 New Revision: 208452 URL: http://svn.freebsd.org/changeset/base/208452 Log: Unify local_apic.c for x86 archs, Added: head/sys/x86/x86/ head/sys/x86/x86/local_apic.c - copied, changed from r208451, head/sys/i386/i386/local_apic.c Deleted: head/sys/amd64/amd64/local_apic.c head/sys/i386/i386/local_apic.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun May 23 16:16:33 2010 (r208451) +++ head/sys/conf/files.amd64 Sun May 23 17:45:01 2010 (r208452) @@ -107,7 +107,7 @@ amd64/amd64/intr_machdep.c standard amd64/amd64/io.c optional io amd64/amd64/io_apic.c standard amd64/amd64/legacy.c standard -amd64/amd64/local_apic.c standard +x86/x86/local_apic.c standard amd64/amd64/locore.S standard no-obj amd64/amd64/machdep.c standard amd64/amd64/mca.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun May 23 16:16:33 2010 (r208451) +++ head/sys/conf/files.i386 Sun May 23 17:45:01 2010 (r208452) @@ -272,7 +272,7 @@ i386/i386/io.c optional io i386/i386/io_apic.c optional apic i386/i386/k6_mem.c optional mem i386/i386/legacy.c optional native -i386/i386/local_apic.c optional apic +x86/x86/local_apic.c optional apic i386/i386/locore.s optional native no-obj i386/xen/locore.s optional xen no-obj i386/i386/longrun.c optional cpu_enable_longrun Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Sun May 23 16:16:33 2010 (r208451) +++ head/sys/conf/files.pc98 Sun May 23 17:45:01 2010 (r208452) @@ -151,7 +151,7 @@ i386/i386/io.c optional io i386/i386/io_apic.c optional apic i386/i386/k6_mem.c optional mem i386/i386/legacy.c standard -i386/i386/local_apic.c optional apic +x86/x86/local_apic.c optional apic i386/i386/locore.s standard no-obj i386/i386/mca.c standard i386/i386/mem.c optional mem Copied and modified: head/sys/x86/x86/local_apic.c (from r208451, head/sys/i386/i386/local_apic.c) ============================================================================== --- head/sys/i386/i386/local_apic.c Sun May 23 16:16:33 2010 (r208451, copy source) +++ head/sys/x86/x86/local_apic.c Sun May 23 17:45:01 2010 (r208452) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_atpic.h" #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" @@ -69,6 +68,16 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef __amd64__ +#define SDT_APIC SDT_SYSIGT +#define SDT_APICT SDT_SYSIGT +#define GSEL_APIC 0 +#else +#define SDT_APIC SDT_SYS386IGT +#define SDT_APICT SDT_SYS386TGT +#define GSEL_APIC GSEL(GCODE_SEL, SEL_KPL) +#endif + #ifdef KDTRACE_HOOKS #include cyclic_clock_func_t cyclic_clock_func[MAXCPU]; @@ -213,8 +222,8 @@ lapic_init(vm_paddr_t addr) ("local APIC not aligned on a page boundary")); lapic = pmap_mapdev(addr, sizeof(lapic_t)); lapic_paddr = addr; - setidt(APIC_SPURIOUS_INT, IDTVEC(spuriousint), SDT_SYS386IGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(APIC_SPURIOUS_INT, IDTVEC(spuriousint), SDT_APIC, SEL_KPL, + GSEL_APIC); /* Perform basic initialization of the BSP's local APIC. */ lapic_enable(); @@ -223,12 +232,10 @@ lapic_init(vm_paddr_t addr) PCPU_SET(apic_id, lapic_id()); /* Local APIC timer interrupt. */ - setidt(APIC_TIMER_INT, IDTVEC(timerint), SDT_SYS386IGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(APIC_TIMER_INT, IDTVEC(timerint), SDT_APIC, SEL_KPL, GSEL_APIC); /* Local APIC error interrupt. */ - setidt(APIC_ERROR_INT, IDTVEC(errorint), SDT_SYS386IGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(APIC_ERROR_INT, IDTVEC(errorint), SDT_APIC, SEL_KPL, GSEL_APIC); /* XXX: Thermal interrupt */ } @@ -982,8 +989,8 @@ apic_enable_vector(u_int apic_id, u_int KASSERT(vector != IDT_SYSCALL, ("Attempt to overwrite syscall entry")); KASSERT(ioint_handlers[vector / 32] != NULL, ("No ISR handler for vector %u", vector)); - setidt(vector, ioint_handlers[vector / 32], SDT_SYS386IGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(vector, ioint_handlers[vector / 32], SDT_APIC, SEL_KPL, + GSEL_APIC); } void @@ -998,8 +1005,7 @@ apic_disable_vector(u_int apic_id, u_int * We can not currently clear the idt entry because other cpus * may have a valid vector at this offset. */ - setidt(vector, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(vector, &IDTVEC(rsvd), SDT_APICT, SEL_KPL, GSEL_APIC); #endif } @@ -1196,7 +1202,9 @@ static void apic_init(void *dummy __unused) { struct apic_enumerator *enumerator; +#ifndef __amd64__ uint64_t apic_base; +#endif int retval, best; /* We only support built in local APICs. */ @@ -1229,6 +1237,7 @@ apic_init(void *dummy __unused) printf("APIC: Using the %s enumerator.\n", best_enum->apic_name); +#ifndef __amd64__ /* * To work around an errata, we disable the local APIC on some * CPUs during early startup. We need to turn the local APIC back @@ -1240,6 +1249,7 @@ apic_init(void *dummy __unused) apic_base |= APICBASE_ENABLED; wrmsr(MSR_APICBASE, apic_base); } +#endif /* Second, probe the CPU's in the system. */ retval = best_enum->apic_probe_cpus(); @@ -1290,7 +1300,7 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O #ifdef SMP /* * Inter Processor Interrupt functions. The lapic_ipi_*() functions are - * private to the sys/i386 code. The public interface for the rest of the + * private to the MD code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ int From owner-svn-src-head@FreeBSD.ORG Sun May 23 18:32:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B28FF1065673; Sun, 23 May 2010 18:32:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D6A08FC13; Sun, 23 May 2010 18:32:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NIW2d5055872; Sun, 23 May 2010 18:32:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NIW2jw055853; Sun, 23 May 2010 18:32:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005231832.o4NIW2jw055853@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 23 May 2010 18:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208453 - in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/linux32 arm/arm cddl/dev/systrace compat/ia32 compat/svr4 conf i386/i386 i386/ibcs2 i386/include i386/linux ia64/ia32 i... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 18:32:02 -0000 Author: kib Date: Sun May 23 18:32:02 2010 New Revision: 208453 URL: http://svn.freebsd.org/changeset/base/208453 Log: Reorganize syscall entry and leave handling. Extend struct sysvec with three new elements: sv_fetch_syscall_args - the method to fetch syscall arguments from usermode into struct syscall_args. The structure is machine-depended (this might be reconsidered after all architectures are converted). sv_set_syscall_retval - the method to set a return value for usermode from the syscall. It is a generalization of cpu_set_syscall_retval(9) to allow ABIs to override the way to set a return value. sv_syscallnames - the table of syscall names. Use sv_set_syscall_retval in kern_sigsuspend() instead of hardcoding the call to cpu_set_syscall_retval(). The new functions syscallenter(9) and syscallret(9) are provided that use sv_*syscall* pointers and contain the common repeated code from the syscall() implementations for the architecture-specific syscall trap handlers. Syscallenter() fetches arguments, calls syscall implementation from ABI sysent table, and set up return frame. The end of syscall bookkeeping is done by syscallret(). Take advantage of single place for MI syscall handling code and implement ptrace_lwpinfo pl_flags PL_FLAG_SCE, PL_FLAG_SCX and PL_FLAG_EXEC. The SCE and SCX flags notify the debugger that the thread is stopped at syscall entry or return point respectively. The EXEC flag augments SCX and notifies debugger that the process address space was changed by one of exec(2)-family syscalls. The i386, amd64, sparc64, sun4v, powerpc and ia64 syscall()s are changed to use syscallenter()/syscallret(). MIPS and arm are not converted and use the mostly unchanged syscall() implementation. Reviewed by: jhb, marcel, marius, nwhitehorn, stas Tested by: marcel (ia64), marius (sparc64), nwhitehorn (powerpc), stas (mips) MFC after: 1 month Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/ia32/ia32_syscall.c head/sys/amd64/include/proc.h head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/elf_machdep.c head/sys/arm/arm/trap.c head/sys/cddl/dev/systrace/systrace.c head/sys/compat/ia32/ia32_sysvec.c head/sys/compat/ia32/ia32_util.h head/sys/compat/svr4/svr4_sysvec.c head/sys/conf/files head/sys/i386/i386/elf_machdep.c head/sys/i386/i386/trap.c head/sys/i386/ibcs2/ibcs2_sysvec.c head/sys/i386/include/proc.h head/sys/i386/linux/linux_sysvec.c head/sys/ia64/ia32/ia32_trap.c head/sys/ia64/ia64/elf_machdep.c head/sys/ia64/ia64/trap.c head/sys/ia64/include/proc.h head/sys/kern/imgact_aout.c head/sys/kern/init_main.c head/sys/kern/kern_exec.c head/sys/kern/kern_sig.c head/sys/kern/subr_trap.c head/sys/kern/sys_process.c head/sys/mips/mips/elf64_machdep.c head/sys/mips/mips/elf_machdep.c head/sys/mips/mips/trap.c head/sys/powerpc/aim/trap.c head/sys/powerpc/booke/trap.c head/sys/powerpc/include/proc.h head/sys/powerpc/powerpc/elf_machdep.c head/sys/sparc64/include/proc.h head/sys/sparc64/sparc64/elf_machdep.c head/sys/sparc64/sparc64/trap.c head/sys/sun4v/include/proc.h head/sys/sun4v/sun4v/trap.c head/sys/sys/proc.h head/sys/sys/ptrace.h head/sys/sys/sysent.h Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/amd64/amd64/elf_machdep.c Sun May 23 18:32:02 2010 (r208453) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -74,7 +75,10 @@ struct sysentvec elf64_freebsd_sysvec = .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_LP64 + .sv_flags = SV_ABI_FREEBSD | SV_LP64, + .sv_set_syscall_retval = cpu_set_syscall_retval, + .sv_fetch_syscall_args = cpu_fetch_syscall_args, + .sv_syscallnames = syscallnames, }; static Elf64_Brandinfo freebsd_brand_info = { Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/amd64/amd64/trap.c Sun May 23 18:32:02 2010 (r208453) @@ -76,7 +76,6 @@ __FBSDID("$FreeBSD$"); #ifdef HWPMC_HOOKS #include #endif -#include #include #include @@ -170,8 +169,6 @@ static int prot_fault_translation = 0; SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW, &prot_fault_translation, 0, "Select signal to deliver on protection fault"); -extern char *syscallnames[]; - /* * Exception, fault, and trap interface to the FreeBSD kernel. * This common code is called from assembly language IDT gate entry @@ -805,19 +802,12 @@ dblfault_handler(struct trapframe *frame panic("double fault"); } -struct syscall_args { - u_int code; - struct sysent *callp; - register_t args[8]; - register_t *argp; - int narg; -}; - -static int -fetch_syscall_args(struct thread *td, struct syscall_args *sa) +int +cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) { struct proc *p; struct trapframe *frame; + register_t *argp; caddr_t params; int reg, regcnt, error; @@ -829,15 +819,10 @@ fetch_syscall_args(struct thread *td, st params = (caddr_t)frame->tf_rsp + sizeof(register_t); sa->code = frame->tf_rax; - if (p->p_sysent->sv_prepsyscall) { - (*p->p_sysent->sv_prepsyscall)(frame, (int *)sa->args, - &sa->code, ¶ms); - } else { - if (sa->code == SYS_syscall || sa->code == SYS___syscall) { - sa->code = frame->tf_rdi; - reg++; - regcnt--; - } + if (sa->code == SYS_syscall || sa->code == SYS___syscall) { + sa->code = frame->tf_rdi; + reg++; + regcnt--; } if (p->p_sysent->sv_mask) sa->code &= p->p_sysent->sv_mask; @@ -851,24 +836,20 @@ fetch_syscall_args(struct thread *td, st KASSERT(sa->narg <= sizeof(sa->args) / sizeof(sa->args[0]), ("Too many syscall arguments!")); error = 0; - sa->argp = &frame->tf_rdi; - sa->argp += reg; - bcopy(sa->argp, sa->args, sizeof(sa->args[0]) * regcnt); + argp = &frame->tf_rdi; + argp += reg; + bcopy(argp, sa->args, sizeof(sa->args[0]) * regcnt); if (sa->narg > regcnt) { KASSERT(params != NULL, ("copyin args with no params!")); error = copyin(params, &sa->args[regcnt], (sa->narg - regcnt) * sizeof(sa->args[0])); } - sa->argp = &sa->args[0]; - /* - * This may result in two records if debugger modified - * registers or memory during sleep at stop/ptrace point. - */ -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->argp); -#endif + if (error == 0) { + td->td_retval[0] = 0; + td->td_retval[1] = frame->tf_rdx; + } + return (error); } @@ -881,87 +862,22 @@ void syscall(struct trapframe *frame) { struct thread *td; - struct proc *p; struct syscall_args sa; register_t orig_tf_rflags; int error; ksiginfo_t ksi; - PCPU_INC(cnt.v_syscall); - td = curthread; - p = td->td_proc; - td->td_syscalls++; - #ifdef DIAGNOSTIC if (ISPL(frame->tf_cs) != SEL_UPL) { panic("syscall"); /* NOT REACHED */ } #endif - - td->td_pticks = 0; - td->td_frame = frame; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); orig_tf_rflags = frame->tf_rflags; - if (p->p_flag & P_TRACED) { - PROC_LOCK(p); - td->td_dbgflags &= ~TDB_USERWR; - PROC_UNLOCK(p); - } - error = fetch_syscall_args(td, &sa); - - CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, sa.code); - - if (error == 0) { - td->td_retval[0] = 0; - td->td_retval[1] = frame->tf_rdx; - - STOPEVENT(p, S_SCE, sa.narg); - PTRACESTOP_SC(p, td, S_PT_SCE); - if (td->td_dbgflags & TDB_USERWR) { - /* - * Reread syscall number and arguments if - * debugger modified registers or memory. - */ - error = fetch_syscall_args(td, &sa); - if (error != 0) - goto retval; - td->td_retval[1] = frame->tf_rdx; - } - -#ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'entry', process the probe. - */ - if (systrace_probe_func != NULL && sa.callp->sy_entry != 0) - (*systrace_probe_func)(sa.callp->sy_entry, sa.code, - sa.callp, sa.args); -#endif - - AUDIT_SYSCALL_ENTER(sa.code, td); - error = (*sa.callp->sy_call)(td, sa.argp); - AUDIT_SYSCALL_EXIT(error, td); - - /* Save the latest error return value. */ - td->td_errno = error; + td = curthread; + td->td_frame = frame; -#ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'return', process the probe. - */ - if (systrace_probe_func != NULL && sa.callp->sy_return != 0) - (*systrace_probe_func)(sa.callp->sy_return, sa.code, - sa.callp, sa.args); -#endif - } - retval: - cpu_set_syscall_retval(td, error); + error = syscallenter(td, &sa); /* * Traced syscall. @@ -975,40 +891,5 @@ syscall(struct trapframe *frame) trapsignal(td, &ksi); } - /* - * Check for misbehavior. - */ - WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? - syscallnames[sa.code] : "???"); - KASSERT(td->td_critnest == 0, - ("System call %s returning in a critical section", - (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? - syscallnames[sa.code] : "???")); - KASSERT(td->td_locks == 0, - ("System call %s returning with %d locks held", - (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? - syscallnames[sa.code] : "???", td->td_locks)); - - /* - * Handle reschedule and other end-of-syscall issues - */ - userret(td, frame); - - CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, sa.code); - -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(sa.code, error, td->td_retval[0]); -#endif - - /* - * This works because errno is findable through the - * register set. If we ever support an emulation where this - * is not the case, this code will need to be revisited. - */ - STOPEVENT(p, S_SCX, sa.code); - - PTRACESTOP_SC(p, td, S_PT_SCX); + syscallret(td, error, &sa); } Modified: head/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- head/sys/amd64/ia32/ia32_syscall.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/amd64/ia32/ia32_syscall.c Sun May 23 18:32:02 2010 (r208453) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -81,62 +82,54 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #define IDTVEC(name) __CONCAT(X,name) extern inthand_t IDTVEC(int0x80_syscall), IDTVEC(rsvd); -extern const char *freebsd32_syscallnames[]; void ia32_syscall(struct trapframe *frame); /* Called from asm code */ -struct ia32_syscall_args { - u_int code; - caddr_t params; - struct sysent *callp; - u_int64_t args64[8]; - int narg; -}; +void +ia32_set_syscall_retval(struct thread *td, int error) +{ -static int -fetch_ia32_syscall_args(struct thread *td, struct ia32_syscall_args *sa) + cpu_set_syscall_retval(td, error); +} + +int +ia32_fetch_syscall_args(struct thread *td, struct syscall_args *sa) { struct proc *p; struct trapframe *frame; + caddr_t params; u_int32_t args[8]; int error, i; p = td->td_proc; frame = td->td_frame; - sa->params = (caddr_t)frame->tf_rsp + sizeof(u_int32_t); + params = (caddr_t)frame->tf_rsp + sizeof(u_int32_t); sa->code = frame->tf_rax; - if (p->p_sysent->sv_prepsyscall) { + /* + * Need to check if this is a 32 bit or 64 bit syscall. + */ + if (sa->code == SYS_syscall) { /* - * The prep code is MP aware. + * Code is first argument, followed by actual args. */ - (*p->p_sysent->sv_prepsyscall)(frame, args, &sa->code, - &sa->params); - } else { + sa->code = fuword32(params); + params += sizeof(int); + } else if (sa->code == SYS___syscall) { /* - * Need to check if this is a 32 bit or 64 bit syscall. - * fuword is MP aware. + * Like syscall, but code is a quad, so as to maintain + * quad alignment for the rest of the arguments. + * We use a 32-bit fetch in case params is not + * aligned. */ - if (sa->code == SYS_syscall) { - /* - * Code is first argument, followed by actual args. - */ - sa->code = fuword32(sa->params); - sa->params += sizeof(int); - } else if (sa->code == SYS___syscall) { - /* - * Like syscall, but code is a quad, so as to maintain - * quad alignment for the rest of the arguments. - * We use a 32-bit fetch in case params is not - * aligned. - */ - sa->code = fuword32(sa->params); - sa->params += sizeof(quad_t); - } + sa->code = fuword32(params); + params += sizeof(quad_t); } if (p->p_sysent->sv_mask) sa->code &= p->p_sysent->sv_mask; @@ -146,19 +139,19 @@ fetch_ia32_syscall_args(struct thread *t sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; - if (sa->params != NULL && sa->narg != 0) - error = copyin(sa->params, (caddr_t)args, + if (params != NULL && sa->narg != 0) + error = copyin(params, (caddr_t)args, (u_int)(sa->narg * sizeof(int))); else error = 0; for (i = 0; i < sa->narg; i++) - sa->args64[i] = args[i]; + sa->args[i] = args[i]; -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->args64); -#endif + if (error == 0) { + td->td_retval[0] = 0; + td->td_retval[1] = frame->tf_rdx; + } return (error); } @@ -167,58 +160,16 @@ void ia32_syscall(struct trapframe *frame) { struct thread *td; - struct proc *p; - struct ia32_syscall_args sa; + struct syscall_args sa; register_t orig_tf_rflags; int error; ksiginfo_t ksi; - PCPU_INC(cnt.v_syscall); + orig_tf_rflags = frame->tf_rflags; td = curthread; - p = td->td_proc; - td->td_syscalls++; - - td->td_pticks = 0; td->td_frame = frame; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); - orig_tf_rflags = frame->tf_rflags; - if (p->p_flag & P_TRACED) { - PROC_LOCK(p); - td->td_dbgflags &= ~TDB_USERWR; - PROC_UNLOCK(p); - } - error = fetch_ia32_syscall_args(td, &sa); - - CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, sa.code); - - if (error == 0) { - td->td_retval[0] = 0; - td->td_retval[1] = frame->tf_rdx; - STOPEVENT(p, S_SCE, sa.narg); - PTRACESTOP_SC(p, td, S_PT_SCE); - if (td->td_dbgflags & TDB_USERWR) { - /* - * Reread syscall number and arguments if - * debugger modified registers or memory. - */ - error = fetch_ia32_syscall_args(td, &sa); - if (error != 0) - goto retval; - td->td_retval[1] = frame->tf_rdx; - } - - AUDIT_SYSCALL_ENTER(sa.code, td); - error = (*sa.callp->sy_call)(td, sa.args64); - AUDIT_SYSCALL_EXIT(error, td); - - /* Save the latest error return value. */ - td->td_errno = error; - } - retval: - cpu_set_syscall_retval(td, error); + error = syscallenter(td, &sa); /* * Traced syscall. @@ -232,44 +183,9 @@ ia32_syscall(struct trapframe *frame) trapsignal(td, &ksi); } - /* - * Check for misbehavior. - */ - WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? - freebsd32_syscallnames[sa.code] : "???"); - KASSERT(td->td_critnest == 0, - ("System call %s returning in a critical section", - (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? - freebsd32_syscallnames[sa.code] : "???")); - KASSERT(td->td_locks == 0, - ("System call %s returning with %d locks held", - (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? - freebsd32_syscallnames[sa.code] : "???", td->td_locks)); - - /* - * Handle reschedule and other end-of-syscall issues - */ - userret(td, frame); - - CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_proc->p_comm, sa.code); -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(sa.code, error, td->td_retval[0]); -#endif - - /* - * This works because errno is findable through the - * register set. If we ever support an emulation where this - * is not the case, this code will need to be revisited. - */ - STOPEVENT(p, S_SCX, sa.code); - - PTRACESTOP_SC(p, td, S_PT_SCX); + syscallret(td, error, &sa); } - static void ia32_syscall_enable(void *dummy) { Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Sun May 23 17:45:01 2010 (r208452) +++ head/sys/amd64/include/proc.h Sun May 23 18:32:02 2010 (r208453) @@ -79,6 +79,14 @@ int amd64_set_ldt_data(struct thread *td extern struct mtx dt_lock; extern int max_ldt_segment; +struct syscall_args { + u_int code; + struct sysent *callp; + register_t args[8]; + int narg; +}; +#define HAVE_SYSCALL_ARGS_DEF 1 + #endif /* _KERNEL */ #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/amd64/linux32/linux32_sysvec.c Sun May 23 18:32:02 2010 (r208453) @@ -121,8 +121,6 @@ SET_DECLARE(linux_device_handler_set, st static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); static register_t *linux_copyout_strings(struct image_params *imgp); -static void linux_prepsyscall(struct trapframe *tf, int *args, u_int *code, - caddr_t *params); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); @@ -764,19 +762,33 @@ linux_rt_sigreturn(struct thread *td, st return (EJUSTRETURN); } -/* - * MPSAFE - */ -static void -linux_prepsyscall(struct trapframe *tf, int *args, u_int *code, caddr_t *params) +static int +linux32_fetch_syscall_args(struct thread *td, struct syscall_args *sa) { - args[0] = tf->tf_rbx; - args[1] = tf->tf_rcx; - args[2] = tf->tf_rdx; - args[3] = tf->tf_rsi; - args[4] = tf->tf_rdi; - args[5] = tf->tf_rbp; /* Unconfirmed */ - *params = NULL; /* no copyin */ + struct proc *p; + struct trapframe *frame; + + p = td->td_proc; + frame = td->td_frame; + + sa->args[0] = frame->tf_rbx; + sa->args[1] = frame->tf_rcx; + sa->args[2] = frame->tf_rdx; + sa->args[3] = frame->tf_rsi; + sa->args[4] = frame->tf_rdi; + sa->args[5] = frame->tf_rbp; /* Unconfirmed */ + sa->code = frame->tf_rax; + + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; + else + sa->callp = &p->p_sysent->sv_table[sa->code]; + sa->narg = sa->callp->sy_narg; + + td->td_retval[0] = 0; + td->td_retval[1] = frame->tf_rdx; + + return (0); } /* @@ -1039,7 +1051,7 @@ struct sysentvec elf_linux_sysvec = { .sv_sendsig = linux_sendsig, .sv_sigcode = linux_sigcode, .sv_szsigcode = &linux_szsigcode, - .sv_prepsyscall = linux_prepsyscall, + .sv_prepsyscall = NULL, .sv_name = "Linux ELF32", .sv_coredump = elf32_coredump, .sv_imgact_try = exec_linux_imgact_try, @@ -1054,7 +1066,10 @@ struct sysentvec elf_linux_sysvec = { .sv_setregs = exec_linux_setregs, .sv_fixlimit = linux32_fixlimit, .sv_maxssiz = &linux32_maxssiz, - .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32 + .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32, + .sv_set_syscall_retval = cpu_set_syscall_retval, + .sv_fetch_syscall_args = linux32_fetch_syscall_args, + .sv_syscallnames = NULL, }; static char GNU_ABI_VENDOR[] = "GNU"; Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/arm/arm/elf_machdep.c Sun May 23 18:32:02 2010 (r208453) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -73,7 +74,10 @@ struct sysentvec elf32_freebsd_sysvec = .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_ILP32 + .sv_flags = SV_ABI_FREEBSD | SV_ILP32, + .sv_set_syscall_retval = cpu_set_syscall_retval, + .sv_fetch_syscall_args = NULL, /* XXXKIB */ + .sv_syscallnames = syscallnames, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/arm/arm/trap.c Sun May 23 18:32:02 2010 (r208453) @@ -130,7 +130,6 @@ void undefinedinstruction(trapframe_t *) #include extern char fusubailout[]; -extern char *syscallnames[]; #ifdef DEBUG int last_fault_code; /* For the benefit of pmap_fault_fixup() */ Modified: head/sys/cddl/dev/systrace/systrace.c ============================================================================== --- head/sys/cddl/dev/systrace/systrace.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/cddl/dev/systrace/systrace.c Sun May 23 18:32:02 2010 (r208453) @@ -77,7 +77,6 @@ extern struct sysent linux_sysent[]; */ #include #include -extern const char *syscallnames[]; #define DEVNAME "dtrace/systrace" #define PROVNAME "syscall" #define MAXSYSCALL SYS_MAXSYSCALL Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/compat/ia32/ia32_sysvec.c Sun May 23 18:32:02 2010 (r208453) @@ -93,6 +93,8 @@ CTASSERT(sizeof(struct ia32_ucontext4) = CTASSERT(sizeof(struct ia32_sigframe4) == 408); #endif +extern const char *freebsd32_syscallnames[]; + static void ia32_fixlimit(struct rlimit *rl, int which); SYSCTL_NODE(_compat, OID_AUTO, ia32, CTLFLAG_RW, 0, "ia32 mode"); @@ -135,7 +137,10 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_setregs = ia32_setregs, .sv_fixlimit = ia32_fixlimit, .sv_maxssiz = &ia32_maxssiz, - .sv_flags = SV_ABI_FREEBSD | SV_IA32 | SV_ILP32 + .sv_flags = SV_ABI_FREEBSD | SV_IA32 | SV_ILP32, + .sv_set_syscall_retval = ia32_set_syscall_retval, + .sv_fetch_syscall_args = ia32_fetch_syscall_args, + .sv_syscallnames = freebsd32_syscallnames, }; Modified: head/sys/compat/ia32/ia32_util.h ============================================================================== --- head/sys/compat/ia32/ia32_util.h Sun May 23 17:45:01 2010 (r208452) +++ head/sys/compat/ia32/ia32_util.h Sun May 23 18:32:02 2010 (r208453) @@ -47,3 +47,7 @@ #define IA32_MAXDSIZ (512*1024*1024) /* 512MB */ #define IA32_MAXSSIZ (64*1024*1024) /* 64MB */ #define IA32_MAXVMEM 0 /* Unlimited */ + +struct syscall_args; +int ia32_fetch_syscall_args(struct thread *td, struct syscall_args *sa); +void ia32_set_syscall_retval(struct thread *, int); Modified: head/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- head/sys/compat/svr4/svr4_sysvec.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/compat/svr4/svr4_sysvec.c Sun May 23 18:32:02 2010 (r208453) @@ -191,7 +191,10 @@ struct sysentvec svr4_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_UNDEF | SV_IA32 | SV_ILP32 + .sv_flags = SV_ABI_UNDEF | SV_IA32 | SV_ILP32, + .sv_set_syscall_retval = cpu_set_syscall_retval, + .sv_fetch_syscall_args = cpu_fetch_syscall_args, + .sv_syscallnames = NULL, }; const char svr4_emul_path[] = "/compat/svr4"; Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 23 17:45:01 2010 (r208452) +++ head/sys/conf/files Sun May 23 18:32:02 2010 (r208453) @@ -2166,7 +2166,7 @@ kern/sys_generic.c standard kern/sys_pipe.c standard kern/sys_process.c standard kern/sys_socket.c standard -kern/syscalls.c optional witness | invariants | kdtrace_hooks +kern/syscalls.c standard kern/sysv_ipc.c standard kern/sysv_msg.c optional sysvmsg kern/sysv_sem.c optional sysvsem Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/i386/i386/elf_machdep.c Sun May 23 18:32:02 2010 (r208453) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -73,7 +74,10 @@ struct sysentvec elf32_freebsd_sysvec = .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_IA32 | SV_ILP32 + .sv_flags = SV_ABI_FREEBSD | SV_IA32 | SV_ILP32, + .sv_set_syscall_retval = cpu_set_syscall_retval, + .sv_fetch_syscall_args = cpu_fetch_syscall_args, + .sv_syscallnames = syscallnames, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/i386/i386/trap.c Sun May 23 18:32:02 2010 (r208453) @@ -184,8 +184,6 @@ static int prot_fault_translation = 0; SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW, &prot_fault_translation, 0, "Select signal to deliver on protection fault"); -extern char *syscallnames[]; - /* * Exception, fault, and trap interface to the FreeBSD kernel. * This common code is called from assembly language IDT gate entry @@ -973,16 +971,8 @@ dblfault_handler() panic("double fault"); } -struct syscall_args { - u_int code; - struct sysent *callp; - int args[8]; - register_t *argp; - int narg; -}; - -static int -fetch_syscall_args(struct thread *td, struct syscall_args *sa) +int +cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) { struct proc *p; struct trapframe *frame; @@ -995,27 +985,22 @@ fetch_syscall_args(struct thread *td, st params = (caddr_t)frame->tf_esp + sizeof(int); sa->code = frame->tf_eax; - if (p->p_sysent->sv_prepsyscall) { - (*p->p_sysent->sv_prepsyscall)(frame, sa->args, &sa->code, - ¶ms); - } else { + /* + * Need to check if this is a 32 bit or 64 bit syscall. + */ + if (sa->code == SYS_syscall) { /* - * Need to check if this is a 32 bit or 64 bit syscall. + * Code is first argument, followed by actual args. */ - if (sa->code == SYS_syscall) { - /* - * Code is first argument, followed by actual args. - */ - sa->code = fuword(params); - params += sizeof(int); - } else if (sa->code == SYS___syscall) { - /* - * Like syscall, but code is a quad, so as to maintain - * quad alignment for the rest of the arguments. - */ - sa->code = fuword(params); - params += sizeof(quad_t); - } + sa->code = fuword(params); + params += sizeof(int); + } else if (sa->code == SYS___syscall) { + /* + * Like syscall, but code is a quad, so as to maintain + * quad alignment for the rest of the arguments. + */ + sa->code = fuword(params); + params += sizeof(quad_t); } if (p->p_sysent->sv_mask) @@ -1031,11 +1016,12 @@ fetch_syscall_args(struct thread *td, st (u_int)(sa->narg * sizeof(int))); else error = 0; + + if (error == 0) { + td->td_retval[0] = 0; + td->td_retval[1] = frame->tf_edx; + } -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->args); -#endif return (error); } @@ -1048,87 +1034,23 @@ void syscall(struct trapframe *frame) { struct thread *td; - struct proc *p; struct syscall_args sa; register_t orig_tf_eflags; int error; ksiginfo_t ksi; - PCPU_INC(cnt.v_syscall); - td = curthread; - p = td->td_proc; - td->td_syscalls++; - #ifdef DIAGNOSTIC if (ISPL(frame->tf_cs) != SEL_UPL) { panic("syscall"); /* NOT REACHED */ } #endif - - td->td_pticks = 0; - td->td_frame = frame; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); orig_tf_eflags = frame->tf_eflags; - if (p->p_flag & P_TRACED) { - PROC_LOCK(p); - td->td_dbgflags &= ~TDB_USERWR; - PROC_UNLOCK(p); - } - error = fetch_syscall_args(td, &sa); - - CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, sa.code); - - if (error == 0) { - td->td_retval[0] = 0; - td->td_retval[1] = frame->tf_edx; - - STOPEVENT(p, S_SCE, sa.narg); - PTRACESTOP_SC(p, td, S_PT_SCE); - if (td->td_dbgflags & TDB_USERWR) { - /* - * Reread syscall number and arguments if - * debugger modified registers or memory. - */ - error = fetch_syscall_args(td, &sa); - if (error != 0) - goto retval; - td->td_retval[1] = frame->tf_edx; - } - -#ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'entry', process the probe. - */ - if (systrace_probe_func != NULL && sa.callp->sy_entry != 0) - (*systrace_probe_func)(sa.callp->sy_entry, sa.code, - sa.callp, sa.args); -#endif - AUDIT_SYSCALL_ENTER(sa.code, td); - error = (*sa.callp->sy_call)(td, sa.args); - AUDIT_SYSCALL_EXIT(error, td); + td = curthread; + td->td_frame = frame; - /* Save the latest error return value. */ - td->td_errno = error; - -#ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'return', process the probe. - */ - if (systrace_probe_func != NULL && sa.callp->sy_return != 0) - (*systrace_probe_func)(sa.callp->sy_return, sa.code, - sa.callp, sa.args); -#endif - } - retval: - cpu_set_syscall_retval(td, error); + error = syscallenter(td, &sa); /* * Traced syscall. @@ -1142,41 +1064,5 @@ syscall(struct trapframe *frame) trapsignal(td, &ksi); } - /* - * Check for misbehavior. - */ - WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? - syscallnames[sa.code] : "???"); - KASSERT(td->td_critnest == 0, - ("System call %s returning in a critical section", - (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? - syscallnames[sa.code] : "???")); - KASSERT(td->td_locks == 0, - ("System call %s returning with %d locks held", - (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? - syscallnames[sa.code] : "???", td->td_locks)); - - /* - * Handle reschedule and other end-of-syscall issues - */ - userret(td, frame); - - CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, sa.code); - -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(sa.code, error, td->td_retval[0]); -#endif - - /* - * This works because errno is findable through the - * register set. If we ever support an emulation where this - * is not the case, this code will need to be revisited. - */ - STOPEVENT(p, S_SCX, sa.code); - - PTRACESTOP_SC(p, td, S_PT_SCX); + syscallret(td, error, &sa); } - Modified: head/sys/i386/ibcs2/ibcs2_sysvec.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_sysvec.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/i386/ibcs2/ibcs2_sysvec.c Sun May 23 18:32:02 2010 (r208453) @@ -86,7 +86,10 @@ struct sysentvec ibcs2_svr3_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_UNDEF | SV_IA32 | SV_ILP32 + .sv_flags = SV_ABI_UNDEF | SV_IA32 | SV_ILP32, + .sv_set_syscall_retval = cpu_set_syscall_retval, + .sv_fetch_syscall_args = cpu_fetch_syscall_args, + .sv_syscallnames = NULL, }; static int Modified: head/sys/i386/include/proc.h ============================================================================== --- head/sys/i386/include/proc.h Sun May 23 17:45:01 2010 (r208452) +++ head/sys/i386/include/proc.h Sun May 23 18:32:02 2010 (r208453) @@ -77,6 +77,14 @@ void user_ldt_deref(struct proc_ldt *pld extern struct mtx dt_lock; +struct syscall_args { + u_int code; + struct sysent *callp; + register_t args[8]; + int narg; +}; +#define HAVE_SYSCALL_ARGS_DEF 1 + #endif /* _KERNEL */ #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sun May 23 17:45:01 2010 (r208452) +++ head/sys/i386/linux/linux_sysvec.c Sun May 23 18:32:02 2010 (r208453) @@ -102,8 +102,6 @@ static int linux_fixup(register_t **stac struct image_params *iparams); static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); -static void linux_prepsyscall(struct trapframe *tf, int *args, u_int *code, - caddr_t *params); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); @@ -864,19 +862,33 @@ linux_rt_sigreturn(struct thread *td, st return (EJUSTRETURN); } -/* - * MPSAFE - */ -static void -linux_prepsyscall(struct trapframe *tf, int *args, u_int *code, caddr_t *params) +static int +linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa) { - args[0] = tf->tf_ebx; - args[1] = tf->tf_ecx; - args[2] = tf->tf_edx; - args[3] = tf->tf_esi; - args[4] = tf->tf_edi; - args[5] = tf->tf_ebp; /* Unconfirmed */ - *params = NULL; /* no copyin */ + struct proc *p; + struct trapframe *frame; + + p = td->td_proc; + frame = td->td_frame; + + sa->code = frame->tf_eax; + sa->args[0] = frame->tf_ebx; + sa->args[1] = frame->tf_ecx; + sa->args[2] = frame->tf_edx; + sa->args[3] = frame->tf_esi; + sa->args[4] = frame->tf_edi; + sa->args[5] = frame->tf_ebp; /* Unconfirmed */ + + if (sa->code >= p->p_sysent->sv_size) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun May 23 18:42:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC1CB1065677; Sun, 23 May 2010 18:42:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB1998FC12; Sun, 23 May 2010 18:42:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NIgXr6058188; Sun, 23 May 2010 18:42:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NIgXYq058186; Sun, 23 May 2010 18:42:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201005231842.o4NIgXYq058186@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 23 May 2010 18:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208454 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 18:42:34 -0000 Author: pjd Date: Sun May 23 18:42:33 2010 New Revision: 208454 URL: http://svn.freebsd.org/changeset/base/208454 Log: Remove ZIO_USE_UMA from arc.c as well. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun May 23 18:32:02 2010 (r208453) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun May 23 18:42:33 2010 (r208454) @@ -195,11 +195,6 @@ SYSCTL_QUAD(_vfs_zfs, OID_AUTO, arc_min, SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RDTUN, &zfs_mdcomp_disable, 0, "Disable metadata compression"); -#ifdef ZIO_USE_UMA -extern kmem_cache_t *zio_buf_cache[]; -extern kmem_cache_t *zio_data_buf_cache[]; -#endif - /* * Note that buffers can be in one of 6 states: * ARC_anon - anonymous (discussed below) @@ -620,11 +615,6 @@ static buf_hash_table_t buf_hash_table; uint64_t zfs_crc64_table[256]; -#ifdef ZIO_USE_UMA -extern kmem_cache_t *zio_buf_cache[]; -extern kmem_cache_t *zio_data_buf_cache[]; -#endif - /* * Level 2 ARC */ @@ -2192,14 +2182,15 @@ arc_reclaim_needed(void) return (0); } +extern kmem_cache_t *zio_buf_cache[]; +extern kmem_cache_t *zio_data_buf_cache[]; + static void arc_kmem_reap_now(arc_reclaim_strategy_t strat) { -#ifdef ZIO_USE_UMA size_t i; kmem_cache_t *prev_cache = NULL; kmem_cache_t *prev_data_cache = NULL; -#endif #ifdef _KERNEL if (arc_meta_used >= arc_meta_limit) { @@ -2224,7 +2215,6 @@ arc_kmem_reap_now(arc_reclaim_strategy_t if (strat == ARC_RECLAIM_AGGR) arc_shrink(); -#ifdef ZIO_USE_UMA for (i = 0; i < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT; i++) { if (zio_buf_cache[i] != prev_cache) { prev_cache = zio_buf_cache[i]; @@ -2235,7 +2225,6 @@ arc_kmem_reap_now(arc_reclaim_strategy_t kmem_cache_reap_now(zio_data_buf_cache[i]); } } -#endif kmem_cache_reap_now(buf_cache); kmem_cache_reap_now(hdr_cache); } From owner-svn-src-head@FreeBSD.ORG Sun May 23 18:43:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06FCF106566C; Sun, 23 May 2010 18:43:07 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAB968FC17; Sun, 23 May 2010 18:43:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NIh6GS058355; Sun, 23 May 2010 18:43:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NIh6aP058353; Sun, 23 May 2010 18:43:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201005231843.o4NIh6aP058353@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 23 May 2010 18:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208455 - head/sys/modules/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 18:43:07 -0000 Author: pjd Date: Sun May 23 18:43:06 2010 New Revision: 208455 URL: http://svn.freebsd.org/changeset/base/208455 Log: ZIO_USE_UMA is no longer used. MFC after: 3 days Modified: head/sys/modules/zfs/Makefile Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Sun May 23 18:42:33 2010 (r208454) +++ head/sys/modules/zfs/Makefile Sun May 23 18:43:06 2010 (r208455) @@ -63,9 +63,6 @@ ZFS_SRCS= ${ZFS_OBJS:C/.o$/.c/} SRCS+= ${ZFS_SRCS} SRCS+= vdev_geom.c -# Use UMA for ZIO allocation. -#CFLAGS+=-DZIO_USE_UMA - # Use FreeBSD's namecache. CFLAGS+=-DFREEBSD_NAMECACHE From owner-svn-src-head@FreeBSD.ORG Sun May 23 19:10:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DED8106566B; Sun, 23 May 2010 19:10:06 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CF978FC08; Sun, 23 May 2010 19:10:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NJA6WQ064379; Sun, 23 May 2010 19:10:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NJA6KX064377; Sun, 23 May 2010 19:10:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201005231910.o4NJA6KX064377@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 23 May 2010 19:10:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208458 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 19:10:06 -0000 Author: pjd Date: Sun May 23 19:10:06 2010 New Revision: 208458 URL: http://svn.freebsd.org/changeset/base/208458 Log: Create UMA zones unconditionally. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun May 23 18:49:15 2010 (r208457) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun May 23 19:10:06 2010 (r208458) @@ -101,9 +101,6 @@ zio_init(void) zio_cache = kmem_cache_create("zio_cache", sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0); - if (!zio_use_uma) - goto end; - /* * For small buffers, we want a cache for each multiple of * SPA_MINBLOCKSIZE. For medium-size buffers, we want a cache @@ -147,7 +144,7 @@ zio_init(void) if (zio_data_buf_cache[c - 1] == NULL) zio_data_buf_cache[c - 1] = zio_data_buf_cache[c]; } -end: + zio_inject_init(); } From owner-svn-src-head@FreeBSD.ORG Sun May 23 19:46:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57D4D1065670; Sun, 23 May 2010 19:46:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46B1C8FC17; Sun, 23 May 2010 19:46:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NJkJLx072304; Sun, 23 May 2010 19:46:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NJkJLL072302; Sun, 23 May 2010 19:46:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005231946.o4NJkJLL072302@svn.freebsd.org> From: Marius Strobl Date: Sun, 23 May 2010 19:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208459 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 19:46:20 -0000 Author: marius Date: Sun May 23 19:46:19 2010 New Revision: 208459 URL: http://svn.freebsd.org/changeset/base/208459 Log: Update the sparc64 hardware list regarding machines that will be supported beginning with 8.1-RELEASE as well as correct some existing entries and add previously missed ones. Approved by: blackend MFC after: 3 days Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun May 23 19:10:06 2010 (r208458) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun May 23 19:46:19 2010 (r208459) @@ -36,6 +36,7 @@ &tm-attrib.freebsd; &tm-attrib.amd; + &tm-attrib.fujitsu; &tm-attrib.ibm; &tm-attrib.intel; &tm-attrib.sparc; @@ -367,7 +368,8 @@ sparc64 This section describes the systems currently known to be - supported by &os; on the &ultrasparc; platform. For + supported by &os; on the &fujitsu; &sparc64; and &sun; &ultrasparc; + platforms. For background information on the various hardware designs see the Sun System Handbook. @@ -392,6 +394,10 @@ + Naturetech GENIALstation 777S + + + &sun.blade; 100 @@ -400,7 +406,7 @@ - &sun.enterprise; 100 + &sun.enterprise; 150 @@ -420,6 +426,11 @@ + &sun.fire; B100s (support for the on-board NICs first + appeared in 8.1-RELEASE) + + + &sun.fire; V100 @@ -428,51 +439,55 @@ - &netra; t1 105 + &sun; &netra; t1 100/105 + + + + &sun; &netra; T1 AC200/DC200 - &netra; T1 AC200/DC200 + &sun; &netra; t 1100 - &netra; t 1100 + &sun; &netra; t 1120 - &netra; t 1120 + &sun; &netra; t 1125 - &netra; t 1125 + &sun; &netra; t 1400/1405 - &netra; t 1400/1405 + &sun; &netra; 120 - &netra; 120 + &sun; &netra; X1 - &netra; X1 + &sun; &sparcengine; Ultra AX1105 - &sparcengine; Ultra AX1105 + &sun; &sparcengine; Ultra AXe - &sparcengine; Ultra AXe + &sun; &sparcengine; Ultra AXi - &sparcengine; Ultra AXi + &sun; &sparcengine; Ultra AXmp - &sparcengine; Ultra AXmp + &sun; &sparcengine; CP1500 @@ -528,7 +543,7 @@ - Starting with 7.2-RELEASE, &arch.sparc64; systems based on + Starting with 7.2-RELEASE, &arch.sparc64; systems based on &sun; &ultrasparc; III and beyond are also supported by &os;, which includes the following known working systems: @@ -580,11 +595,16 @@ + &sun.fire; V890 (support first appeared in 8.1-RELEASE, + non-mixed &ultrasparc; IV/IV+ CPU-configurations only) + + + &netra; 20/&netra; T4 - The following &ultrasparc; IIIi systems are not tested but + The following &sun; &ultrasparc; systems are not tested but believed to be also supported by &os;: @@ -599,7 +619,40 @@ &sun.fire; V245 (support first appeared in 7.3-RELEASE) + + + &sun.fire; V490 (support first appeared in 8.1-RELEASE, + non-mixed &ultrasparc; IV/IV+ CPU-configurations only) + + + Starting with 8.1-RELEASE, &arch.sparc64; systems based on + &fujitsu; &sparc64; V are also supported by &os;, which + includes the following known working systems: + + + + &fujitsu; &primepower; 250 + + + + The following &fujitsu; &primepower; systems are not tested but + believed to be also supported by &os;: + + + + &fujitsu; &primepower; 450 + + + + &fujitsu; &primepower; 650 + + + + &fujitsu; &primepower; 850 + + + From owner-svn-src-head@FreeBSD.ORG Sun May 23 19:48:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85B19106566C; Sun, 23 May 2010 19:48:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75A388FC08; Sun, 23 May 2010 19:48:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NJmsMF072899; Sun, 23 May 2010 19:48:54 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NJmsEV072897; Sun, 23 May 2010 19:48:54 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201005231948.o4NJmsEV072897@svn.freebsd.org> From: Sean Bruno Date: Sun, 23 May 2010 19:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208460 - head/usr.sbin/iostat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 19:48:54 -0000 Author: sbruno Date: Sun May 23 19:48:54 2010 New Revision: 208460 URL: http://svn.freebsd.org/changeset/base/208460 Log: Explain how the new sub-second interval from changeset:208389 works. Approved by: scottl(mentor) Obtained from: Yahoo Inc. MFC after: 2 weeks Modified: head/usr.sbin/iostat/iostat.8 Modified: head/usr.sbin/iostat/iostat.8 ============================================================================== --- head/usr.sbin/iostat/iostat.8 Sun May 23 19:46:19 2010 (r208459) +++ head/usr.sbin/iostat/iostat.8 Sun May 23 19:48:54 2010 (r208460) @@ -241,7 +241,14 @@ If no repeat is specified, the default is infinity. The .Nm -command will accept and honor a non-integer number of seconds. +command will accept and honor a non-integer number of seconds. Note that +the interval only has millisecond granularity. Smaller values will be +truncated. +.Pp +e.g. -w1.0001 becomes -w1.000 +.Pp +The interval will also suffer from modifications to hz so your mileage +may vary. .It Fl x Show extended disk statistics. Each disk is displayed on a line of its own with all available statistics. From owner-svn-src-head@FreeBSD.ORG Sun May 23 20:00:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE135106566B; Sun, 23 May 2010 20:00:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD48E8FC1C; Sun, 23 May 2010 20:00:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NK0CCE075454; Sun, 23 May 2010 20:00:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NK0CAv075452; Sun, 23 May 2010 20:00:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201005232000.o4NK0CAv075452@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 23 May 2010 20:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208461 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 20:00:12 -0000 Author: nwhitehorn Date: Sun May 23 20:00:12 2010 New Revision: 208461 URL: http://svn.freebsd.org/changeset/base/208461 Log: Revise PowerPC hardware notes to reflect status for 8.1. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun May 23 19:48:54 2010 (r208460) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun May 23 20:00:12 2010 (r208461) @@ -327,12 +327,18 @@ All systems listed below are fully supported, with the exception that software fan control is currently missing on - the Power Macintosh G5. SMP is supported on all systems with - more than 1 processor. + some Power Macintosh G5 models. SMP is supported on all systems + with more than 1 processor. - Apple iMac + Apple iMac G3 + + + Apple iMac G4 + + + Apple iMac G5 Apple Power Macintosh G3 (Blue & White) @@ -341,10 +347,16 @@ Apple Power Macintosh G4 - Apple Power Macintosh G5 (non-970MP models) + Apple Power Macintosh G5 + + + Apple iBook G3 + + + Apple iBook G4 - Apple iBook + Apple PowerBook G3 (Lombard and Pismo) Apple PowerBook G4 From owner-svn-src-head@FreeBSD.ORG Sun May 23 20:08:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A433A1065757; Sun, 23 May 2010 20:08:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93F888FC1E; Sun, 23 May 2010 20:08:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NK8fZR077342; Sun, 23 May 2010 20:08:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NK8fFD077340; Sun, 23 May 2010 20:08:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005232008.o4NK8fFD077340@svn.freebsd.org> From: Marius Strobl Date: Sun, 23 May 2010 20:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208462 - head/sys/modules/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 20:08:41 -0000 Author: marius Date: Sun May 23 20:08:41 2010 New Revision: 208462 URL: http://svn.freebsd.org/changeset/base/208462 Log: Correct the path to the MD source so r206569 actually works as intended. Modified: head/sys/modules/uart/Makefile Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Sun May 23 20:00:12 2010 (r208461) +++ head/sys/modules/uart/Makefile Sun May 23 20:08:41 2010 (r208462) @@ -16,7 +16,7 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} u uart_if.c uart_if.h uart_subr.c uart_tty.c .if ${MACHINE} == "sun4v" SRCS+= uart_cpu_sparc64.c -.elif exists(${CURDIR}/uart_cpu_${MACHINE}.c) +.elif exists(${.CURDIR}/../../dev/uart/uart_cpu_${MACHINE}.c) SRCS+= uart_cpu_${MACHINE}.c .endif SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \ From owner-svn-src-head@FreeBSD.ORG Sun May 23 20:24:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90F651065673; Sun, 23 May 2010 20:24:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 807738FC25; Sun, 23 May 2010 20:24:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NKO3kR081062; Sun, 23 May 2010 20:24:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NKO3Wd081059; Sun, 23 May 2010 20:24:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005232024.o4NKO3Wd081059@svn.freebsd.org> From: Marius Strobl Date: Sun, 23 May 2010 20:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208468 - in head/sys/modules: ata/atadisk cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 20:24:03 -0000 Author: marius Date: Sun May 23 20:24:03 2010 New Revision: 208468 URL: http://svn.freebsd.org/changeset/base/208468 Log: At least on sparc64 these modules require ata_machdep.c. MFC after: 3 days Modified: head/sys/modules/ata/atadisk/Makefile head/sys/modules/cam/Makefile Modified: head/sys/modules/ata/atadisk/Makefile ============================================================================== --- head/sys/modules/ata/atadisk/Makefile Sun May 23 20:23:34 2010 (r208467) +++ head/sys/modules/ata/atadisk/Makefile Sun May 23 20:24:03 2010 (r208468) @@ -1,9 +1,13 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../dev/ata +.PATH: ${.CURDIR}/../../../dev/ata ${.CURDIR}/../../../${MACHINE}/${MACHINE} KMOD= atadisk -SRCS= ata-disk.c +SRCS= ata-disk.c ${ata_machdep} SRCS+= opt_ata.h ata_if.h device_if.h bus_if.h pci_if.h +.if exists(${.CURDIR}/../../../${MACHINE}/${MACHINE}/ata_machdep.c) +ata_machdep= ata_machdep.c +.endif + .include Modified: head/sys/modules/cam/Makefile ============================================================================== --- head/sys/modules/cam/Makefile Sun May 23 20:23:34 2010 (r208467) +++ head/sys/modules/cam/Makefile Sun May 23 20:24:03 2010 (r208468) @@ -2,7 +2,7 @@ S= ${.CURDIR}/../.. -.PATH: $S/cam $S/cam/scsi $S/cam/ata +.PATH: $S/cam $S/cam/scsi $S/cam/ata $S/${MACHINE}/${MACHINE} KMOD= cam @@ -28,6 +28,9 @@ SRCS+= scsi_xpt.c SRCS+= ata_all.c SRCS+= ata_xpt.c SRCS+= ata_da.c +.if exists($S/${MACHINE}/${MACHINE}/ata_machdep.c) +SRCS+= ata_machdep.c +.endif SRCS+= ata_pmp.c EXPORT_SYMS= YES # XXX evaluate From owner-svn-src-head@FreeBSD.ORG Sun May 23 21:02:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D6621065672; Sun, 23 May 2010 21:02:44 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BB568FC18; Sun, 23 May 2010 21:02:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NL2i57089773; Sun, 23 May 2010 21:02:44 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NL2iVl089770; Sun, 23 May 2010 21:02:44 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201005232102.o4NL2iVl089770@svn.freebsd.org> From: Martin Matuska Date: Sun, 23 May 2010 21:02:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208472 - in head: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 21:02:44 -0000 Author: mm Date: Sun May 23 21:02:43 2010 New Revision: 208472 URL: http://svn.freebsd.org/changeset/base/208472 Log: Fix zfs receive temporarily changing unchanged stream properties. Fix possible panic with zfs_enable_datasets. OpenSolaris onnv revision: 8536:33bd5de3260e Approved by: pjd, delphij (mentor) Obtained from: OpenSolaris (Bug ID 6748561, 6757075) MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Sun May 23 20:28:06 2010 (r208471) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Sun May 23 21:02:43 2010 (r208472) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1209,10 +1209,12 @@ zpool_enable_datasets(zpool_handle_t *zh /* * And mount all the datasets, keeping track of which ones - * succeeded or failed. By using zfs_alloc(), the good pointer - * will always be non-NULL. + * succeeded or failed. */ - good = zfs_alloc(zhp->zpool_hdl, cb.cb_used * sizeof (int)); + if ((good = zfs_alloc(zhp->zpool_hdl, + cb.cb_used * sizeof (int))) == NULL) + goto out; + ret = 0; for (i = 0; i < cb.cb_used; i++) { if (zfs_mount(cb.cb_datasets[i], mntopts, flags) != 0) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun May 23 20:28:06 2010 (r208471) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun May 23 21:02:43 2010 (r208472) @@ -92,7 +92,7 @@ typedef struct zfs_ioc_vec { boolean_t zvec_his_log; } zfs_ioc_vec_t; -static void clear_props(char *dataset, nvlist_t *props); +static void clear_props(char *dataset, nvlist_t *props, nvlist_t *newprops); static int zfs_fill_zplprops_root(uint64_t, nvlist_t *, nvlist_t *, boolean_t *); int zfs_set_prop_nvlist(const char *, nvlist_t *); @@ -1645,7 +1645,7 @@ zfs_ioc_set_prop(zfs_cmd_t *zc) if (dmu_objset_open(zc->zc_name, DMU_OST_ANY, DS_MODE_USER | DS_MODE_READONLY, &os) == 0) { if (dsl_prop_get_all(os, &origprops, TRUE) == 0) { - clear_props(zc->zc_name, origprops); + clear_props(zc->zc_name, origprops, nvl); nvlist_free(origprops); } dmu_objset_close(os); @@ -2425,7 +2425,7 @@ zfs_ioc_rename(zfs_cmd_t *zc) } static void -clear_props(char *dataset, nvlist_t *props) +clear_props(char *dataset, nvlist_t *props, nvlist_t *newprops) { zfs_cmd_t *zc; nvpair_t *prop; @@ -2436,6 +2436,9 @@ clear_props(char *dataset, nvlist_t *pro (void) strcpy(zc->zc_name, dataset); for (prop = nvlist_next_nvpair(props, NULL); prop; prop = nvlist_next_nvpair(props, prop)) { + if (newprops != NULL && + nvlist_exists(newprops, nvpair_name(prop))) + continue; (void) strcpy(zc->zc_value, nvpair_name(prop)); if (zfs_secpolicy_inherit(zc, CRED()) == 0) (void) zfs_ioc_inherit_prop(zc); @@ -2543,7 +2546,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) * so that the properties are applied to the new data. */ if (props) { - clear_props(tofs, origprops); + clear_props(tofs, origprops, props); /* * XXX - Note, this is all-or-nothing; should be best-effort. */ @@ -2582,7 +2585,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) * On error, restore the original props. */ if (error && props) { - clear_props(tofs, props); + clear_props(tofs, props, NULL); (void) zfs_set_prop_nvlist(tofs, origprops); } out: From owner-svn-src-head@FreeBSD.ORG Sun May 23 21:16:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F230D1065672; Sun, 23 May 2010 21:16:34 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1F418FC17; Sun, 23 May 2010 21:16:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NLGYSE092840; Sun, 23 May 2010 21:16:34 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NLGYAE092838; Sun, 23 May 2010 21:16:34 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201005232116.o4NLGYAE092838@svn.freebsd.org> From: Martin Matuska Date: Sun, 23 May 2010 21:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208474 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 21:16:35 -0000 Author: mm Date: Sun May 23 21:16:34 2010 New Revision: 208474 URL: http://svn.freebsd.org/changeset/base/208474 Log: Remove kstat.zfs.arcstats.l2_write_bytes_written The arcstats.l2_write_bytes_written kstat counter introduced in r205231 was duplicite with vendor's arcstats.l2_write_bytes counter imported in r208373 (OpenSolaris revision 8582:df9361868dbe) Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun May 23 21:15:36 2010 (r208473) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun May 23 21:16:34 2010 (r208474) @@ -325,7 +325,6 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_write_full; kstat_named_t arcstat_l2_write_buffer_iter; kstat_named_t arcstat_l2_write_pios; - kstat_named_t arcstat_l2_write_bytes_written; kstat_named_t arcstat_l2_write_buffer_bytes_scanned; kstat_named_t arcstat_l2_write_buffer_list_iter; kstat_named_t arcstat_l2_write_buffer_list_null_iter; @@ -396,7 +395,6 @@ static arc_stats_t arc_stats = { { "l2_write_full", KSTAT_DATA_UINT64 }, { "l2_write_buffer_iter", KSTAT_DATA_UINT64 }, { "l2_write_pios", KSTAT_DATA_UINT64 }, - { "l2_write_bytes_written", KSTAT_DATA_UINT64 }, { "l2_write_buffer_bytes_scanned", KSTAT_DATA_UINT64 }, { "l2_write_buffer_list_iter", KSTAT_DATA_UINT64 }, { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 } @@ -4692,7 +4690,6 @@ l2arc_write_buffers(spa_t *spa, l2arc_de ARCSTAT_BUMP(arcstat_l2_write_pios); } - ARCSTAT_INCR(arcstat_l2_write_bytes_written, ab->b_size); /* * Create and add a new L2ARC header. */ From owner-svn-src-head@FreeBSD.ORG Sun May 23 22:10:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64EB3106564A; Sun, 23 May 2010 22:10:20 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 546ED8FC08; Sun, 23 May 2010 22:10:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4NMAKXa004719; Sun, 23 May 2010 22:10:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4NMAK1v004716; Sun, 23 May 2010 22:10:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005232210.o4NMAK1v004716@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 23 May 2010 22:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208476 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 22:10:20 -0000 Author: jilles Date: Sun May 23 22:10:20 2010 New Revision: 208476 URL: http://svn.freebsd.org/changeset/base/208476 Log: sh: Add some simplistic tests for the wait builtin. Added: head/tools/regression/bin/sh/builtins/wait1.0 (contents, props changed) head/tools/regression/bin/sh/builtins/wait2.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/wait1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/wait1.0 Sun May 23 22:10:20 2010 (r208476) @@ -0,0 +1,23 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +exit 4 & p4=$! +exit 8 & p8=$! +wait $p4 +[ $? = 4 ] || failure $LINENO +wait $p8 +[ $? = 8 ] || failure $LINENO + +exit 3 & p3=$! +exit 7 & p7=$! +wait $p7 +[ $? = 7 ] || failure $LINENO +wait $p3 +[ $? = 3 ] || failure $LINENO + +test -z "$failures" Added: head/tools/regression/bin/sh/builtins/wait2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/wait2.0 Sun May 23 22:10:20 2010 (r208476) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +for i in 1 2 3 4 5 6 7 8 9 10; do + exit $i & +done +wait || failure $LINENO +wait || failure $LINENO + +test -z "$failures" From owner-svn-src-head@FreeBSD.ORG Mon May 24 01:49:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1BC4106566B; Mon, 24 May 2010 01:49:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0B498FC14; Mon, 24 May 2010 01:49:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4O1n0Zn052521; Mon, 24 May 2010 01:49:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4O1n094052519; Mon, 24 May 2010 01:49:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201005240149.o4O1n094052519@svn.freebsd.org> From: Alexander Motin Date: Mon, 24 May 2010 01:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208479 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 01:49:00 -0000 Author: mav Date: Mon May 24 01:49:00 2010 New Revision: 208479 URL: http://svn.freebsd.org/changeset/base/208479 Log: Restore different APIC init orders for i386 and amd64 unified in r208452. Seems noone of them contents both arch for different reasons. Submitted by: kib@ Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon May 24 01:46:06 2010 (r208478) +++ head/sys/x86/x86/local_apic.c Mon May 24 01:49:00 2010 (r208479) @@ -1195,8 +1195,9 @@ apic_register_enumerator(struct apic_enu } /* - * Probe the APIC enumerators, enumerate CPUs, and initialize the - * local APIC. + * We have to look for CPU's very, very early because certain subsystems + * want to know how many CPU's we have extremely early on in the boot + * process. */ static void apic_init(void *dummy __unused) @@ -1257,13 +1258,34 @@ apic_init(void *dummy __unused) printf("%s: Failed to probe CPUs: returned %d\n", best_enum->apic_name, retval); +#ifdef __amd64__ +} +SYSINIT(apic_init, SI_SUB_TUNABLES - 1, SI_ORDER_SECOND, apic_init, NULL); + +/* + * Setup the local APIC. We have to do this prior to starting up the APs + * in the SMP case. + */ +static void +apic_setup_local(void *dummy __unused) +{ + int retval; + + if (best_enum == NULL) + return; +#endif /* Third, initialize the local APIC. */ retval = best_enum->apic_setup_local(); if (retval != 0) printf("%s: Failed to setup the local APIC: returned %d\n", best_enum->apic_name, retval); } +#ifdef __amd64__ +SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_SECOND, apic_setup_local, + NULL); +#else SYSINIT(apic_init, SI_SUB_CPU, SI_ORDER_SECOND, apic_init, NULL); +#endif /* * Setup the I/O APICs. From owner-svn-src-head@FreeBSD.ORG Mon May 24 06:01:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6E09106566B; Mon, 24 May 2010 06:01:37 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9500B8FC12; Mon, 24 May 2010 06:01:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4O61baZ008201; Mon, 24 May 2010 06:01:37 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4O61bm9008200; Mon, 24 May 2010 06:01:37 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201005240601.o4O61bm9008200@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 24 May 2010 06:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208480 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 06:01:37 -0000 Author: jchandra Date: Mon May 24 06:01:37 2010 New Revision: 208480 URL: http://svn.freebsd.org/changeset/base/208480 Log: Remove unused code in sys/mips/rmi : - ehcireg.h,ehcivar.h : USB related files from old merge - pcibus.c : was merged into xlr_pci.c earlier - xlr_boot1_console.c : obsolete console code using bootloader hooks - sys/mips/rmi/perfmon* : obsolete custom performance monitoring code Approved by: rrs (mentor) Deleted: head/sys/mips/rmi/ehcireg.h head/sys/mips/rmi/ehcivar.h head/sys/mips/rmi/pcibus.c head/sys/mips/rmi/perfmon.h head/sys/mips/rmi/perfmon_kern.c head/sys/mips/rmi/perfmon_percpu.c head/sys/mips/rmi/perfmon_utils.h head/sys/mips/rmi/perfmon_xlrconfig.h head/sys/mips/rmi/xlr_boot1_console.c From owner-svn-src-head@FreeBSD.ORG Mon May 24 06:26:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C1C7106566B; Mon, 24 May 2010 06:26:39 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 074568FC0A; Mon, 24 May 2010 06:26:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4O6QdTf013795; Mon, 24 May 2010 06:26:39 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4O6QcCH013777; Mon, 24 May 2010 06:26:38 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005240626.o4O6QcCH013777@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 24 May 2010 06:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208483 - in head/contrib: bsnmp/gensnmpdef bsnmp/gensnmptree bsnmp/lib bsnmp/snmp_mibII bsnmp/snmpd ngatm/man ngatm/snmp_atm ngatm/sscop X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 06:26:39 -0000 Author: uqs Date: Mon May 24 06:26:38 2010 New Revision: 208483 URL: http://svn.freebsd.org/changeset/base/208483 Log: mdoc: consistently spell our email addresses Reviewed by: ru Approved by: harti Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.1 head/contrib/bsnmp/gensnmptree/gensnmptree.1 head/contrib/bsnmp/lib/asn1.3 head/contrib/bsnmp/lib/bsnmpagent.3 head/contrib/bsnmp/lib/bsnmpclient.3 head/contrib/bsnmp/lib/bsnmplib.3 head/contrib/bsnmp/snmp_mibII/snmp_mibII.3 head/contrib/bsnmp/snmpd/bsnmpd.1 head/contrib/bsnmp/snmpd/snmpmod.3 head/contrib/ngatm/man/libngatm.3 head/contrib/ngatm/man/uniaddr.3 head/contrib/ngatm/man/unifunc.3 head/contrib/ngatm/man/unimsg.3 head/contrib/ngatm/man/unisap.3 head/contrib/ngatm/man/unistruct.3 head/contrib/ngatm/snmp_atm/snmp_atm.3 head/contrib/ngatm/sscop/sscop.1 Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.1 ============================================================================== --- head/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Mon May 24 06:26:38 2010 (r208483) @@ -3,7 +3,7 @@ .\" Hartmut Brandt. .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -78,7 +78,7 @@ file by hand. .Sh SEE ALSO .Xr snmpd 1 .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org .Sh BUGS The utility is by no means bullet-proof and may fail for complex or non-standard MIBs. Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.1 ============================================================================== --- head/contrib/bsnmp/gensnmptree/gensnmptree.1 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/bsnmp/gensnmptree/gensnmptree.1 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Hartmut Brandt .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -243,4 +243,4 @@ typedef AdminStatus ENUM ( .Sh SEE ALSO .Xr bsnmpd 1 .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/bsnmp/lib/asn1.3 ============================================================================== --- head/contrib/bsnmp/lib/asn1.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/bsnmp/lib/asn1.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -489,4 +489,4 @@ followed by the error message and an opt This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/bsnmp/lib/bsnmpagent.3 ============================================================================== --- head/contrib/bsnmp/lib/bsnmpagent.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/bsnmp/lib/bsnmpagent.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -441,4 +441,4 @@ Additionally the functions may call snmp This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/bsnmp/lib/bsnmpclient.3 ============================================================================== --- head/contrib/bsnmp/lib/bsnmpclient.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/bsnmp/lib/bsnmpclient.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -654,5 +654,5 @@ filed of This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org .An Kendy Kutzner Aq kutzner@fokus.gmd.de Modified: head/contrib/bsnmp/lib/bsnmplib.3 ============================================================================== --- head/contrib/bsnmp/lib/bsnmplib.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/bsnmp/lib/bsnmplib.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -302,4 +302,4 @@ Encoding failed. This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/bsnmp/snmp_mibII/snmp_mibII.3 ============================================================================== --- head/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -363,4 +363,4 @@ The various internet MIBs. .Sh STANDARDS This implementation conforms to the applicable IETF RFCs. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- head/contrib/bsnmp/snmpd/bsnmpd.1 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/bsnmp/snmpd/bsnmpd.1 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -271,6 +271,6 @@ The .Nm conforms to the applicable IETF RFCs. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org .Sh BUGS Sure. Modified: head/contrib/bsnmp/snmpd/snmpmod.3 ============================================================================== --- head/contrib/bsnmp/snmpd/snmpmod.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/bsnmp/snmpd/snmpmod.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -926,4 +926,4 @@ beginning at position This implementation conforms to the applicable IETF RFCs and ITU-T recommendations. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/ngatm/man/libngatm.3 ============================================================================== --- head/contrib/ngatm/man/libngatm.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/ngatm/man/libngatm.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Hartmut Brandt +.\" Author: Hartmut Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -72,4 +72,4 @@ describes address structures and handlin This implementation conforms to the applicable ITU-T recommendations and ATM Forum standards. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/ngatm/man/uniaddr.3 ============================================================================== --- head/contrib/ngatm/man/uniaddr.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/ngatm/man/uniaddr.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Hartmut Brandt +.\" Author: Hartmut Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -126,4 +126,4 @@ embedded E.164 NSAP or one of the additi .Sh SEE ALSO .Xr libngatm 3 .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/ngatm/man/unifunc.3 ============================================================================== --- head/contrib/ngatm/man/unifunc.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/ngatm/man/unifunc.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Hartmut Brandt +.\" Author: Hartmut Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -252,4 +252,4 @@ This implementation conforms to the appl recommendations and ATM Forum standards with the exception of some limitations (see the Configuration section). .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/ngatm/man/unimsg.3 ============================================================================== --- head/contrib/ngatm/man/unimsg.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/ngatm/man/unimsg.3 Mon May 24 06:26:38 2010 (r208483) @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" Author: Hartmut Brandt +.\" Author: Hartmut Brandt .\" .\" $Begemot: libunimsg/man/unimsg.3,v 1.4 2005/06/15 11:37:10 brandt_h Exp $ .\" @@ -246,4 +246,4 @@ All three functions do not check that th .Xr libunimsg 3 , .Xr mbuf 9 .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/ngatm/man/unisap.3 ============================================================================== --- head/contrib/ngatm/man/unisap.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/ngatm/man/unisap.3 Mon May 24 06:26:38 2010 (r208483) @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" Author: Hartmut Brandt +.\" Author: Hartmut Brandt .\" .\" $Begemot: libunimsg/man/unisap.3,v 1.5 2005/06/15 11:37:11 brandt_h Exp $ .\" @@ -262,4 +262,4 @@ It returns 1 if they match and 0 otherwi .Sh SEE ALSO .Xr libunimsg 3 .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/ngatm/man/unistruct.3 ============================================================================== --- head/contrib/ngatm/man/unistruct.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/ngatm/man/unistruct.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Hartmut Brandt +.\" Author: Hartmut Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -320,4 +320,4 @@ This implementation conforms to the appl recommendations and ATM Forum standards with the exception of some limitations (see the Configuration section). .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/ngatm/snmp_atm/snmp_atm.3 ============================================================================== --- head/contrib/ngatm/snmp_atm/snmp_atm.3 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/ngatm/snmp_atm/snmp_atm.3 Mon May 24 06:26:38 2010 (r208483) @@ -6,7 +6,7 @@ .\" Hartmut Brandt. .\" All rights reserved. .\" -.\" Author: Hartmut Brandt +.\" Author: Hartmut Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -215,4 +215,4 @@ This is the MIB that is implemented by t .Xr snmpmod 3 , .Xr snmp_netgraph 3 .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org Modified: head/contrib/ngatm/sscop/sscop.1 ============================================================================== --- head/contrib/ngatm/sscop/sscop.1 Mon May 24 06:11:33 2010 (r208482) +++ head/contrib/ngatm/sscop/sscop.1 Mon May 24 06:26:38 2010 (r208483) @@ -3,7 +3,7 @@ .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" -.\" Author: Harti Brandt +.\" Author: Harti Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -166,4 +166,4 @@ cat Makefile | sscop -reF | sscop -weF .Sh STANDARDS The implemented protocol conforms to ITU-T recommendation Q.2110. .Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org +.An Hartmut Brandt Aq harti@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Mon May 24 06:33:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7656F106566C; Mon, 24 May 2010 06:33:15 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64E3E8FC08; Mon, 24 May 2010 06:33:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4O6XFmY015260; Mon, 24 May 2010 06:33:15 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4O6XFjV015258; Mon, 24 May 2010 06:33:15 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005240633.o4O6XFjV015258@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 24 May 2010 06:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208484 - head/bin/pax X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 06:33:15 -0000 Author: uqs Date: Mon May 24 06:33:14 2010 New Revision: 208484 URL: http://svn.freebsd.org/changeset/base/208484 Log: Fix back references in substitute command for pax(1) pax(1) was trying to copy the back-referenced data from the match pattern, not the matched data. PR: bin/118132 Obtained from: Debian bug #451361 Reviewed by: jilles MFC after: 3 weeks Modified: head/bin/pax/pat_rep.c Modified: head/bin/pax/pat_rep.c ============================================================================== --- head/bin/pax/pat_rep.c Mon May 24 06:26:38 2010 (r208483) +++ head/bin/pax/pat_rep.c Mon May 24 06:33:14 2010 (r208484) @@ -76,7 +76,7 @@ static char * range_match(char *, int); #ifdef NET2_REGEX static int resub(regexp *, char *, char *, char *); #else -static int resub(regex_t *, regmatch_t *, char *, char *, char *); +static int resub(regex_t *, regmatch_t *, char *, char *, char *, char *); #endif /* @@ -929,7 +929,7 @@ rep_name(char *name, int *nlen, int prnt # ifdef NET2_REGEX if ((res = resub(pt->rcmp,pt->nstr,outpt,endpt)) < 0) { # else - if ((res = resub(&(pt->rcmp),pm,pt->nstr,outpt,endpt)) + if ((res = resub(&(pt->rcmp),pm,inpt,pt->nstr,outpt,endpt)) < 0) { # endif if (prnt) @@ -1071,7 +1071,7 @@ resub(regexp *prog, char *src, char *des */ static int -resub(regex_t *rp, regmatch_t *pm, char *src, char *dest, +resub(regex_t *rp, regmatch_t *pm, char *orig, char *src, char *dest, char *destend) { char *spt; @@ -1121,7 +1121,7 @@ resub(regex_t *rp, regmatch_t *pm, char */ if (len > (destend - dpt)) len = destend - dpt; - if (l_strncpy(dpt, src + pmpt->rm_so, len) != len) + if (l_strncpy(dpt, orig + pmpt->rm_so, len) != len) return(-1); dpt += len; } From owner-svn-src-head@FreeBSD.ORG Mon May 24 07:04:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F5121065676; Mon, 24 May 2010 07:04:01 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E734D8FC12; Mon, 24 May 2010 07:04:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4O740Kr022067; Mon, 24 May 2010 07:04:00 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4O740t4022062; Mon, 24 May 2010 07:04:00 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201005240704.o4O740t4022062@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Mon, 24 May 2010 07:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208486 - in head/sys: compat/linux modules/linux sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 07:04:01 -0000 Author: wkoszek Date: Mon May 24 07:04:00 2010 New Revision: 208486 URL: http://svn.freebsd.org/changeset/base/208486 Log: Bring USB fixes for linux(4). Intention of this commit is to let us take a full advantage of libusb(8) ported to Linux. This decreases a possibility of getting any collisions within ioctl() "command" space, especially with relation to LINUX_SNDCTL_SEQ... stuff. Basically, we provide commands, that will be mapped in the kernel to correct ones and forward those to the USB layer. Port enabling functionality brought with this patch is here: http://www.freebsd.org/cgi/query-pr.cgi?pr=146895 Bump __FreeBSD_version to catch, since which version installing a port makes sense. This patch should bring no regressions. So far, only i386 is tested. Tested by: thompsa@ Reviewed by: thompsa@ OKed by: netchild@ Modified: head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ioctl.h head/sys/modules/linux/Makefile head/sys/sys/param.h Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon May 24 06:41:57 2010 (r208485) +++ head/sys/compat/linux/linux_ioctl.c Mon May 24 07:04:00 2010 (r208486) @@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #ifdef COMPAT_LINUX32 #include #include @@ -123,7 +125,7 @@ static struct linux_ioctl_handler sg_han static struct linux_ioctl_handler video_handler = { linux_ioctl_v4l, LINUX_IOCTL_VIDEO_MIN, LINUX_IOCTL_VIDEO_MAX }; static struct linux_ioctl_handler fbsd_usb = -{ linux_ioctl_fbsd_usb, LINUX_FBSD_USB_MIN, LINUX_FBSD_USB_MAX }; +{ linux_ioctl_fbsd_usb, FBSD_LUSB_MIN, FBSD_LUSB_MAX }; DATA_SET(linux_ioctl_handler_set, cdrom_handler); DATA_SET(linux_ioctl_handler_set, vfat_handler); @@ -2983,21 +2985,119 @@ linux_ioctl_special(struct thread *td, s } /* - * Support for mounting our devfs under /compat/linux/dev and using - * our libusb(3) compiled on Linux to access it from within Linuxolator - * environment. + * Support for emulators/linux-libusb. This port uses FBSD_LUSB* macros + * instead of USB* ones. This lets us to provide correct values for cmd. + * 0xffffffe0 -- 0xffffffff range seemed to be the least collision-prone. */ static int linux_ioctl_fbsd_usb(struct thread *td, struct linux_ioctl_args *args) { + int error; - /* - * Because on GNU/Linux we build our libusb(3) with our header - * files and ioccom.h macros, ioctl() will contain our native - * command value. This means that we can basically redirect this - * call further. - */ - return (ioctl(td, (struct ioctl_args *)args)); + error = 0; + switch (args->cmd) { + case FBSD_LUSB_DEVICEENUMERATE: + args->cmd = USB_DEVICEENUMERATE; + break; + case FBSD_LUSB_DEV_QUIRK_ADD: + args->cmd = USB_DEV_QUIRK_ADD; + break; + case FBSD_LUSB_DEV_QUIRK_GET: + args->cmd = USB_DEV_QUIRK_GET; + break; + case FBSD_LUSB_DEV_QUIRK_REMOVE: + args->cmd = USB_DEV_QUIRK_REMOVE; + break; + case FBSD_LUSB_DO_REQUEST: + args->cmd = USB_DO_REQUEST; + break; + case FBSD_LUSB_FS_CLEAR_STALL_SYNC: + args->cmd = USB_FS_CLEAR_STALL_SYNC; + break; + case FBSD_LUSB_FS_CLOSE: + args->cmd = USB_FS_CLOSE; + break; + case FBSD_LUSB_FS_COMPLETE: + args->cmd = USB_FS_COMPLETE; + break; + case FBSD_LUSB_FS_INIT: + args->cmd = USB_FS_INIT; + break; + case FBSD_LUSB_FS_OPEN: + args->cmd = USB_FS_OPEN; + break; + case FBSD_LUSB_FS_START: + args->cmd = USB_FS_START; + break; + case FBSD_LUSB_FS_STOP: + args->cmd = USB_FS_STOP; + break; + case FBSD_LUSB_FS_UNINIT: + args->cmd = USB_FS_UNINIT; + break; + case FBSD_LUSB_GET_CONFIG: + args->cmd = USB_GET_CONFIG; + break; + case FBSD_LUSB_GET_DEVICEINFO: + args->cmd = USB_GET_DEVICEINFO; + break; + case FBSD_LUSB_GET_DEVICE_DESC: + args->cmd = USB_GET_DEVICE_DESC; + break; + case FBSD_LUSB_GET_FULL_DESC: + args->cmd = USB_GET_FULL_DESC; + break; + case FBSD_LUSB_GET_IFACE_DRIVER: + args->cmd = USB_GET_IFACE_DRIVER; + break; + case FBSD_LUSB_GET_PLUGTIME: + args->cmd = USB_GET_PLUGTIME; + break; + case FBSD_LUSB_GET_POWER_MODE: + args->cmd = USB_GET_POWER_MODE; + break; + case FBSD_LUSB_GET_REPORT_DESC: + args->cmd = USB_GET_REPORT_DESC; + break; + case FBSD_LUSB_GET_REPORT_ID: + args->cmd = USB_GET_REPORT_ID; + break; + case FBSD_LUSB_GET_TEMPLATE: + args->cmd = USB_GET_TEMPLATE; + break; + case FBSD_LUSB_IFACE_DRIVER_ACTIVE: + args->cmd = USB_IFACE_DRIVER_ACTIVE; + break; + case FBSD_LUSB_IFACE_DRIVER_DETACH: + args->cmd = USB_IFACE_DRIVER_DETACH; + break; + case FBSD_LUSB_QUIRK_NAME_GET: + args->cmd = USB_QUIRK_NAME_GET; + break; + case FBSD_LUSB_READ_DIR: + args->cmd = USB_READ_DIR; + break; + case FBSD_LUSB_SET_ALTINTERFACE: + args->cmd = USB_SET_ALTINTERFACE; + break; + case FBSD_LUSB_SET_CONFIG: + args->cmd = USB_SET_CONFIG; + break; + case FBSD_LUSB_SET_IMMED: + args->cmd = USB_SET_IMMED; + break; + case FBSD_LUSB_SET_POWER_MODE: + args->cmd = USB_SET_POWER_MODE; + break; + case FBSD_LUSB_SET_TEMPLATE: + args->cmd = USB_SET_TEMPLATE; + break; + default: + error = ENOIOCTL; + } + if (error != ENOIOCTL) + error = ioctl(td, (struct ioctl_args *)args); + return (error); } /* Modified: head/sys/compat/linux/linux_ioctl.h ============================================================================== --- head/sys/compat/linux/linux_ioctl.h Mon May 24 06:41:57 2010 (r208485) +++ head/sys/compat/linux/linux_ioctl.h Mon May 24 07:04:00 2010 (r208486) @@ -612,9 +612,42 @@ int linux_ifname(struct ifnet *, char #define LINUX_IOCTL_VIDEO_MAX LINUX_VIDIOCSVBIFMT /* - * Keep in sync with our include/dev/usb/usb_ioctl.h. + * Our libusb(8) calls emulated within linux(4). */ -#define LINUX_FBSD_USB_MIN 0x5100 -#define LINUX_FBSD_USB_MAX 0x55c7 +#define FBSD_LUSB_DEVICEENUMERATE 0xffff +#define FBSD_LUSB_DEV_QUIRK_ADD 0xfffe +#define FBSD_LUSB_DEV_QUIRK_GET 0xfffd +#define FBSD_LUSB_DEV_QUIRK_REMOVE 0xfffc +#define FBSD_LUSB_DO_REQUEST 0xfffb +#define FBSD_LUSB_FS_CLEAR_STALL_SYNC 0xfffa +#define FBSD_LUSB_FS_CLOSE 0xfff9 +#define FBSD_LUSB_FS_COMPLETE 0xfff8 +#define FBSD_LUSB_FS_INIT 0xfff7 +#define FBSD_LUSB_FS_OPEN 0xfff6 +#define FBSD_LUSB_FS_START 0xfff5 +#define FBSD_LUSB_FS_STOP 0xfff4 +#define FBSD_LUSB_FS_UNINIT 0xfff3 +#define FBSD_LUSB_GET_CONFIG 0xfff2 +#define FBSD_LUSB_GET_DEVICEINFO 0xfff1 +#define FBSD_LUSB_GET_DEVICE_DESC 0xfff0 +#define FBSD_LUSB_GET_FULL_DESC 0xffef +#define FBSD_LUSB_GET_IFACE_DRIVER 0xffee +#define FBSD_LUSB_GET_PLUGTIME 0xffed +#define FBSD_LUSB_GET_POWER_MODE 0xffec +#define FBSD_LUSB_GET_REPORT_DESC 0xffeb +#define FBSD_LUSB_GET_REPORT_ID 0xffea +#define FBSD_LUSB_GET_TEMPLATE 0xffe9 +#define FBSD_LUSB_IFACE_DRIVER_ACTIVE 0xffe8 +#define FBSD_LUSB_IFACE_DRIVER_DETACH 0xffe7 +#define FBSD_LUSB_QUIRK_NAME_GET 0xffe6 +#define FBSD_LUSB_READ_DIR 0xffe5 +#define FBSD_LUSB_SET_ALTINTERFACE 0xffe4 +#define FBSD_LUSB_SET_CONFIG 0xffe3 +#define FBSD_LUSB_SET_IMMED 0xffe2 +#define FBSD_LUSB_SET_POWER_MODE 0xffe1 +#define FBSD_LUSB_SET_TEMPLATE 0xffe0 + +#define FBSD_LUSB_MAX 0xffff +#define FBSD_LUSB_MIN 0xffe0 #endif /* !_LINUX_IOCTL_H_ */ Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Mon May 24 06:41:57 2010 (r208485) +++ head/sys/modules/linux/Makefile Mon May 24 07:04:00 2010 (r208486) @@ -13,7 +13,7 @@ SRCS= linux${SFX}_dummy.c linux_emul.c l linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ - opt_inet6.h opt_compat.h opt_posix.h vnode_if.h \ + opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ device_if.h bus_if.h assym.s # XXX: for assym.s Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon May 24 06:41:57 2010 (r208485) +++ head/sys/sys/param.h Mon May 24 07:04:00 2010 (r208486) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900012 /* Master, propagated to newvers */ +#define __FreeBSD_version 900013 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Mon May 24 10:23:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D695106566C; Mon, 24 May 2010 10:23:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 254628FC1A; Mon, 24 May 2010 10:23:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OANoT1071294; Mon, 24 May 2010 10:23:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OANnF8071290; Mon, 24 May 2010 10:23:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005241023.o4OANnF8071290@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 24 May 2010 10:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208488 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 10:23:50 -0000 Author: kib Date: Mon May 24 10:23:49 2010 New Revision: 208488 URL: http://svn.freebsd.org/changeset/base/208488 Log: Fix the double counting of the last process thread td_incruntime on exit, that is done once in thread_exit() and the second time in proc_reap(), by clearing td_incruntime. Use the opportunity to revert to the pre-RUSAGE_THREAD exporting of ruxagg() instead of ruxagg_locked() and use it from thread_exit(). Diagnosed and tested by: neel MFC after: 3 days Modified: head/sys/kern/kern_resource.c head/sys/kern/kern_thread.c head/sys/sys/resourcevar.h Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Mon May 24 10:09:36 2010 (r208487) +++ head/sys/kern/kern_resource.c Mon May 24 10:23:49 2010 (r208488) @@ -76,7 +76,7 @@ static void calcru1(struct proc *p, stru struct timeval *up, struct timeval *sp); static int donice(struct thread *td, struct proc *chgp, int n); static struct uidinfo *uilookup(uid_t uid); -static void ruxagg(struct proc *p, struct thread *td); +static void ruxagg_locked(struct rusage_ext *rux, struct thread *td); /* * Resource controls and accounting. @@ -1010,7 +1010,7 @@ ruadd(struct rusage *ru, struct rusage_e /* * Aggregate tick counts into the proc's rusage_ext. */ -void +static void ruxagg_locked(struct rusage_ext *rux, struct thread *td) { @@ -1022,7 +1022,7 @@ ruxagg_locked(struct rusage_ext *rux, st rux->rux_iticks += td->td_iticks; } -static void +void ruxagg(struct proc *p, struct thread *td) { Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon May 24 10:09:36 2010 (r208487) +++ head/sys/kern/kern_thread.c Mon May 24 10:23:49 2010 (r208488) @@ -430,8 +430,8 @@ thread_exit(void) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif PROC_UNLOCK(p); + ruxagg(p, td); thread_lock(td); - ruxagg_locked(&p->p_rux, td); PROC_SUNLOCK(p); td->td_state = TDS_INACTIVE; #ifdef WITNESS Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Mon May 24 10:09:36 2010 (r208487) +++ head/sys/sys/resourcevar.h Mon May 24 10:23:49 2010 (r208488) @@ -131,7 +131,7 @@ void rucollect(struct rusage *ru, struc void rufetch(struct proc *p, struct rusage *ru); void rufetchcalc(struct proc *p, struct rusage *ru, struct timeval *up, struct timeval *sp); -void ruxagg_locked(struct rusage_ext *rux, struct thread *td); +void ruxagg(struct proc *p, struct thread *td); int suswintr(void *base, int word); struct uidinfo *uifind(uid_t uid); From owner-svn-src-head@FreeBSD.ORG Mon May 24 10:35:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 210D11065676; Mon, 24 May 2010 10:35:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1292A8FC1D; Mon, 24 May 2010 10:35:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OAZvJ6074063; Mon, 24 May 2010 10:35:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OAZvfF074061; Mon, 24 May 2010 10:35:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005241035.o4OAZvfF074061@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 24 May 2010 10:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208489 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 10:35:58 -0000 Author: jilles Date: Mon May 24 10:35:57 2010 New Revision: 208489 URL: http://svn.freebsd.org/changeset/base/208489 Log: sh: Reap any zombies before forking for a background command. This prevents accumulating huge amounts of zombies if a script executes many background commands but no external commands or subshells. Note that zombies will not be reaped during long calculations (within the shell process) or read builtins, but those actions do not create more zombies. The terminated background commands will also still be remembered by the shell. PR: bin/55346 Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Mon May 24 10:23:49 2010 (r208488) +++ head/bin/sh/jobs.c Mon May 24 10:35:57 2010 (r208489) @@ -91,6 +91,7 @@ STATIC void freejob(struct job *); STATIC struct job *getjob(char *); STATIC pid_t dowait(int, struct job *); STATIC pid_t waitproc(int, int *); +STATIC void checkzombies(void); STATIC void cmdtxt(union node *); STATIC void cmdputs(const char *); #if JOBS @@ -400,7 +401,7 @@ showjobs(int change, int mode) struct job *jp; TRACE(("showjobs(%d) called\n", change)); - while (dowait(0, (struct job *)NULL) > 0); + checkzombies(); for (jobno = 1, jp = jobtab ; jobno <= njobs ; jobno++, jp++) { if (! jp->used) continue; @@ -742,6 +743,8 @@ forkshell(struct job *jp, union node *n, TRACE(("forkshell(%%%d, %p, %d) called\n", jp - jobtab, (void *)n, mode)); INTOFF; + if (mode == FORK_BG) + checkzombies(); flushall(); pid = fork(); if (pid == -1) { @@ -1056,6 +1059,15 @@ stoppedjobs(void) return (0); } + +STATIC void +checkzombies(void) +{ + while (njobs > 0 && dowait(0, NULL) > 0) + ; +} + + /* * Return a string identifying a command (to be printed by the * jobs command. From owner-svn-src-head@FreeBSD.ORG Mon May 24 11:14:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B04E1106566C; Mon, 24 May 2010 11:14:40 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A122D8FC21; Mon, 24 May 2010 11:14:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OBEesD082730; Mon, 24 May 2010 11:14:40 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OBEe7w082726; Mon, 24 May 2010 11:14:40 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005241114.o4OBEe7w082726@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 24 May 2010 11:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208493 - in head: lib/libc/compat-43 share/man/man4 share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 11:14:40 -0000 Author: uqs Date: Mon May 24 11:14:40 2010 New Revision: 208493 URL: http://svn.freebsd.org/changeset/base/208493 Log: These features will first appear in 8.1, soon to be released MFC after: 3 days Modified: head/lib/libc/compat-43/sigpause.2 head/share/man/man4/lindev.4 head/share/man/man9/BUS_DESCRIBE_INTR.9 Modified: head/lib/libc/compat-43/sigpause.2 ============================================================================== --- head/lib/libc/compat-43/sigpause.2 Mon May 24 11:01:56 2010 (r208492) +++ head/lib/libc/compat-43/sigpause.2 Mon May 24 11:14:40 2010 (r208493) @@ -238,5 +238,5 @@ function appeared in .Bx 4.2 and has been deprecated. All other functions appeared in -.Fx 9.0 +.Fx 8.1 and were deprecated before being implemented. Modified: head/share/man/man4/lindev.4 ============================================================================== --- head/share/man/man4/lindev.4 Mon May 24 11:01:56 2010 (r208492) +++ head/share/man/man4/lindev.4 Mon May 24 11:14:40 2010 (r208493) @@ -70,4 +70,4 @@ For reads it emulates The .Nm module first appeared in -.Fx 9.0 . +.Fx 8.1 . Modified: head/share/man/man9/BUS_DESCRIBE_INTR.9 ============================================================================== --- head/share/man/man9/BUS_DESCRIBE_INTR.9 Mon May 24 11:01:56 2010 (r208492) +++ head/share/man/man9/BUS_DESCRIBE_INTR.9 Mon May 24 11:14:40 2010 (r208493) @@ -98,7 +98,7 @@ The method and .Fn bus_describe_intr functions first appeared in -.Fx 9.0 . +.Fx 8.1 . .Sh BUGS It is not currently possible to remove a description from an active interrupt handler. From owner-svn-src-head@FreeBSD.ORG Mon May 24 11:39:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F06106566B; Mon, 24 May 2010 11:39:43 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from mx.nitro.dk (unknown [77.75.165.90]) by mx1.freebsd.org (Postfix) with ESMTP id 2B2198FC15; Mon, 24 May 2010 11:39:43 +0000 (UTC) Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3]) by mx.nitro.dk (Postfix) with ESMTP id 6B28A2D4D7F; Mon, 24 May 2010 11:39:42 +0000 (UTC) Received: by arthur.nitro.dk (Postfix, from userid 1000) id 509D35C19; Mon, 24 May 2010 13:39:42 +0200 (CEST) Date: Mon, 24 May 2010 13:39:42 +0200 From: "Simon L. Nielsen" To: Marius Strobl Message-ID: <20100524113941.GA1396@arthur.nitro.dk> References: <201005231946.o4NJkJLL072302@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201005231946.o4NJkJLL072302@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208459 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 11:39:43 -0000 On 2010.05.23 19:46:19 +0000, Marius Strobl wrote: > New Revision: 208459 > > Log: > Update the sparc64 hardware list regarding machines that will be supported > beginning with 8.1-RELEASE as well as correct some existing entries and > add previously missed ones. > > - &netra; t1 105 > + &sun; &netra; t1 100/105 If the product is called Netra and you just added the Sun part to identify the company it should just be Sun, and not &sun; as you are refering to Sun the company and not as part of a trademark. (It's a bit since I looked at it, but I'm rather sure above ist still the case.) > + Starting with 8.1-RELEASE, &arch.sparc64; systems based on > + &fujitsu; &sparc64; V are also supported by &os;, which > + includes the following known working systems: Same here, if you are refering to Fujitsu the company it should not include a trademark symbol. And yes, it's not entirely simple... -- Simon L. Nielsen From owner-svn-src-head@FreeBSD.ORG Mon May 24 11:40:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68672106566C; Mon, 24 May 2010 11:40:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 575F48FC13; Mon, 24 May 2010 11:40:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OBeoAS088519; Mon, 24 May 2010 11:40:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OBeova088506; Mon, 24 May 2010 11:40:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201005241140.o4OBeova088506@svn.freebsd.org> From: Alexander Motin Date: Mon, 24 May 2010 11:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208494 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 11:40:50 -0000 Author: mav Date: Mon May 24 11:40:49 2010 New Revision: 208494 URL: http://svn.freebsd.org/changeset/base/208494 Log: - Implement MI helper functions, dividing one or two timer interrupts with arbitrary frequencies into hardclock(), statclock() and profclock() calls. Same code with minor variations duplicated several times over the tree for different timer drivers and architectures. - Switch all x86 archs to new functions, simplifying the code and removing extra logic from timer drivers. Other archs are also welcome. Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/apicvar.h head/sys/amd64/include/clock.h head/sys/i386/i386/mp_machdep.c head/sys/i386/include/apicvar.h head/sys/i386/include/clock.h head/sys/kern/kern_clock.c head/sys/pc98/cbus/clock.c head/sys/sys/kernel.h head/sys/sys/systm.h head/sys/x86/isa/clock.c head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon May 24 11:14:40 2010 (r208493) +++ head/sys/amd64/amd64/mp_machdep.c Mon May 24 11:40:49 2010 (r208494) @@ -1112,9 +1112,6 @@ ipi_bitmap_handler(struct trapframe fram if (ipi_bitmap & (1 << IPI_STATCLOCK)) statclockintr(&frame); - - if (ipi_bitmap & (1 << IPI_PROFCLOCK)) - profclockintr(&frame); } /* Modified: head/sys/amd64/include/apicvar.h ============================================================================== --- head/sys/amd64/include/apicvar.h Mon May 24 11:14:40 2010 (r208493) +++ head/sys/amd64/include/apicvar.h Mon May 24 11:40:49 2010 (r208494) @@ -123,8 +123,7 @@ #define IPI_PREEMPT 1 #define IPI_HARDCLOCK 2 #define IPI_STATCLOCK 3 -#define IPI_PROFCLOCK 4 -#define IPI_BITMAP_LAST IPI_PROFCLOCK +#define IPI_BITMAP_LAST IPI_STATCLOCK #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ Modified: head/sys/amd64/include/clock.h ============================================================================== --- head/sys/amd64/include/clock.h Mon May 24 11:14:40 2010 (r208493) +++ head/sys/amd64/include/clock.h Mon May 24 11:40:49 2010 (r208494) @@ -27,7 +27,6 @@ struct trapframe; int hardclockintr(struct trapframe *frame); int statclockintr(struct trapframe *frame); -int profclockintr(struct trapframe *frame); /* * Driver to clock driver interface. Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon May 24 11:14:40 2010 (r208493) +++ head/sys/i386/i386/mp_machdep.c Mon May 24 11:40:49 2010 (r208494) @@ -1279,9 +1279,6 @@ ipi_bitmap_handler(struct trapframe fram if (ipi_bitmap & (1 << IPI_STATCLOCK)) statclockintr(&frame); - - if (ipi_bitmap & (1 << IPI_PROFCLOCK)) - profclockintr(&frame); } /* Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Mon May 24 11:14:40 2010 (r208493) +++ head/sys/i386/include/apicvar.h Mon May 24 11:40:49 2010 (r208494) @@ -124,8 +124,7 @@ #define IPI_PREEMPT 1 #define IPI_HARDCLOCK 2 #define IPI_STATCLOCK 3 -#define IPI_PROFCLOCK 4 -#define IPI_BITMAP_LAST IPI_PROFCLOCK +#define IPI_BITMAP_LAST IPI_STATCLOCK #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ @@ -152,8 +151,7 @@ #define IPI_PREEMPT 1 #define IPI_HARDCLOCK 2 #define IPI_STATCLOCK 3 -#define IPI_PROFCLOCK 4 -#define IPI_BITMAP_LAST IPI_PROFCLOCK +#define IPI_BITMAP_LAST IPI_STATCLOCK #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ Modified: head/sys/i386/include/clock.h ============================================================================== --- head/sys/i386/include/clock.h Mon May 24 11:14:40 2010 (r208493) +++ head/sys/i386/include/clock.h Mon May 24 11:40:49 2010 (r208494) @@ -27,7 +27,6 @@ struct trapframe; int hardclockintr(struct trapframe *frame); int statclockintr(struct trapframe *frame); -int profclockintr(struct trapframe *frame); /* * Driver to clock driver interface. Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Mon May 24 11:14:40 2010 (r208493) +++ head/sys/kern/kern_clock.c Mon May 24 11:40:49 2010 (r208494) @@ -374,6 +374,12 @@ int profprocs; int ticks; int psratio; +int timer1hz; +int timer2hz; +static DPCPU_DEFINE(u_int, hard_cnt); +static DPCPU_DEFINE(u_int, stat_cnt); +static DPCPU_DEFINE(u_int, prof_cnt); + /* * Initialize clock frequencies and start both clocks running. */ @@ -403,6 +409,52 @@ initclocks(dummy) #endif } +void +timer1clock(int usermode, uintfptr_t pc) +{ + u_int *cnt; + + cnt = DPCPU_PTR(hard_cnt); + *cnt += hz; + if (*cnt >= timer1hz) { + *cnt -= timer1hz; + if (*cnt >= timer1hz) + *cnt = 0; + if (PCPU_GET(cpuid) == 0) + hardclock(usermode, pc); + else + hardclock_cpu(usermode); + } + if (timer2hz == 0) + timer2clock(usermode, pc); +} + +void +timer2clock(int usermode, uintfptr_t pc) +{ + u_int *cnt; + int t2hz = timer2hz ? timer2hz : timer1hz; + + cnt = DPCPU_PTR(stat_cnt); + *cnt += stathz; + if (*cnt >= t2hz) { + *cnt -= t2hz; + if (*cnt >= t2hz) + *cnt = 0; + statclock(usermode); + } + if (profprocs == 0) + return; + cnt = DPCPU_PTR(prof_cnt); + *cnt += profhz; + if (*cnt >= t2hz) { + *cnt -= t2hz; + if (*cnt >= t2hz) + *cnt = 0; + profclock(usermode, pc); + } +} + /* * Each time the real-time timer fires, this function is called on all CPUs. * Note that hardclock() calls hardclock_cpu() for the boot CPU, so only Modified: head/sys/pc98/cbus/clock.c ============================================================================== --- head/sys/pc98/cbus/clock.c Mon May 24 11:14:40 2010 (r208493) +++ head/sys/pc98/cbus/clock.c Mon May 24 11:40:49 2010 (r208494) @@ -129,10 +129,7 @@ int hardclockintr(struct trapframe *frame) { - if (PCPU_GET(cpuid) == 0) - hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); - else - hardclock_cpu(TRAPF_USERMODE(frame)); + timer1clock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); return (FILTER_HANDLED); } @@ -143,13 +140,6 @@ statclockintr(struct trapframe *frame) return (FILTER_HANDLED); } -int -profclockintr(struct trapframe *frame) -{ - - return (FILTER_HANDLED); -} - static int clkintr(struct trapframe *frame) { @@ -448,6 +438,7 @@ cpu_initclocks() * timecounter to user a simpler algorithm. */ if (using_lapic_timer == LAPIC_CLOCK_NONE) { + timer1hz = hz; intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); @@ -460,6 +451,14 @@ cpu_initclocks() i8254_timecounter.tc_counter_mask = 0xffff; set_i8254_freq(i8254_freq, hz); } + if (using_lapic_timer != LAPIC_CLOCK_ALL) { + profhz = hz; + if (hz < 128) + stathz = hz; + else + stathz = hz / (hz / 128); + } + timer2hz = 0; init_TSC_tc(); } Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Mon May 24 11:14:40 2010 (r208493) +++ head/sys/sys/kernel.h Mon May 24 11:40:49 2010 (r208494) @@ -64,6 +64,8 @@ extern int stathz; /* statistics clock extern int profhz; /* profiling clock's frequency */ extern int profprocs; /* number of process's profiling */ extern int ticks; +extern int timer1hz; /* timer 1 frequency */ +extern int timer2hz; /* timer 2 frequency */ #endif /* _KERNEL */ Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Mon May 24 11:14:40 2010 (r208493) +++ head/sys/sys/systm.h Mon May 24 11:40:49 2010 (r208494) @@ -240,6 +240,8 @@ void hardclock_cpu(int usermode); void softclock(void *); void statclock(int usermode); void profclock(int usermode, uintfptr_t pc); +void timer1clock(int usermode, uintfptr_t pc); +void timer2clock(int usermode, uintfptr_t pc); void startprofclock(struct proc *); void stopprofclock(struct proc *); Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Mon May 24 11:14:40 2010 (r208493) +++ head/sys/x86/isa/clock.c Mon May 24 11:40:49 2010 (r208494) @@ -87,8 +87,6 @@ __FBSDID("$FreeBSD$"); #define TIMER_DIV(x) ((i8254_freq + (x) / 2) / (x)) int clkintr_pending; -static int pscnt = 1; -static int psdiv = 1; #ifndef TIMER_FREQ #define TIMER_FREQ 1193182 #endif @@ -134,10 +132,7 @@ int hardclockintr(struct trapframe *frame) { - if (PCPU_GET(cpuid) == 0) - hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); - else - hardclock_cpu(TRAPF_USERMODE(frame)); + timer1clock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); return (FILTER_HANDLED); } @@ -145,19 +140,7 @@ int statclockintr(struct trapframe *frame) { - profclockintr(frame); - statclock(TRAPF_USERMODE(frame)); - return (FILTER_HANDLED); -} - -int -profclockintr(struct trapframe *frame) -{ - - if (!using_atrtc_timer) - hardclockintr(frame); - if (profprocs != 0) - profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + timer2clock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); return (FILTER_HANDLED); } @@ -190,28 +173,11 @@ clkintr(struct trapframe *frame) (*cyclic_clock_func[cpu])(frame); #endif - if (using_atrtc_timer) { -#ifdef SMP - if (smp_started) - ipi_all_but_self(IPI_HARDCLOCK); -#endif - hardclockintr(frame); - } else { - if (--pscnt <= 0) { - pscnt = psratio; #ifdef SMP - if (smp_started) - ipi_all_but_self(IPI_STATCLOCK); + if (smp_started) + ipi_all_but_self(IPI_HARDCLOCK); #endif - statclockintr(frame); - } else { -#ifdef SMP - if (smp_started) - ipi_all_but_self(IPI_PROFCLOCK); -#endif - profclockintr(frame); - } - } + hardclockintr(frame); #ifdef DEV_MCA /* Reset clock interrupt by asserting bit 7 of port 0x61 */ @@ -295,20 +261,11 @@ rtcintr(struct trapframe *frame) while (rtcin(RTC_INTR) & RTCIR_PERIOD) { flag = 1; - if (--pscnt <= 0) { - pscnt = psdiv; #ifdef SMP - if (smp_started) - ipi_all_but_self(IPI_STATCLOCK); -#endif - statclockintr(frame); - } else { -#ifdef SMP - if (smp_started) - ipi_all_but_self(IPI_PROFCLOCK); + if (smp_started) + ipi_all_but_self(IPI_STATCLOCK); #endif - profclockintr(frame); - } + statclockintr(frame); } return(flag ? FILTER_HANDLED : FILTER_STRAY); } @@ -555,6 +512,7 @@ cpu_initclocks() * timecounter to user a simpler algorithm. */ if (using_lapic_timer == LAPIC_CLOCK_NONE) { + timer1hz = hz; intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); @@ -577,6 +535,7 @@ cpu_initclocks() if (using_lapic_timer != LAPIC_CLOCK_ALL) { using_atrtc_timer = tasc; if (using_atrtc_timer) { + timer2hz = RTC_NOPROFRATE; /* Enable periodic interrupts from the RTC. */ intr_add_handler("rtc", 8, (driver_filter_t *)rtcintr, NULL, NULL, @@ -588,6 +547,7 @@ cpu_initclocks() stathz = hz; else stathz = hz / (hz / 128); + timer2hz = 0; } } @@ -601,7 +561,7 @@ cpu_startprofclock(void) if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) return; atrtc_rate(RTCSA_PROF); - psdiv = pscnt = psratio; + timer2hz = RTC_PROFRATE; } void @@ -611,7 +571,7 @@ cpu_stopprofclock(void) if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) return; atrtc_rate(RTCSA_NOPROF); - psdiv = pscnt = 1; + timer2hz = RTC_NOPROFRATE; } static int Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon May 24 11:14:40 2010 (r208493) +++ head/sys/x86/x86/local_apic.c Mon May 24 11:40:49 2010 (r208494) @@ -118,9 +118,6 @@ struct lapic { u_int la_cluster_id:2; u_int la_present:1; u_long *la_timer_count; - u_long la_hard_ticks; - u_long la_stat_ticks; - u_long la_prof_ticks; /* Include IDT_SYSCALL to make indexing easier. */ int la_ioint_irqs[APIC_NUM_IOINTS + 1]; } static lapics[MAX_APIC_ID + 1]; @@ -493,12 +490,14 @@ lapic_setup_clock(enum lapic_clock srcsd } else lapic_timer_hz = hz; lapic_timer_period = value / lapic_timer_hz; + timer1hz = lapic_timer_hz; if (srcsdes == LAPIC_CLOCK_ALL) { if (lapic_timer_hz < 128) stathz = lapic_timer_hz; else stathz = lapic_timer_hz / (lapic_timer_hz / 128); profhz = lapic_timer_hz; + timer2hz = 0; } /* @@ -790,33 +789,7 @@ lapic_handle_timer(struct trapframe *fra (*cyclic_clock_func[cpu])(frame); #endif - /* Fire hardclock at hz. */ - la->la_hard_ticks += hz; - if (la->la_hard_ticks >= lapic_timer_hz) { - la->la_hard_ticks -= lapic_timer_hz; - if (PCPU_GET(cpuid) == 0) - hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); - else - hardclock_cpu(TRAPF_USERMODE(frame)); - } - if (clockcoverage == LAPIC_CLOCK_ALL) { - - /* Fire statclock at stathz. */ - la->la_stat_ticks += stathz; - if (la->la_stat_ticks >= lapic_timer_hz) { - la->la_stat_ticks -= lapic_timer_hz; - statclock(TRAPF_USERMODE(frame)); - } - - /* Fire profclock at profhz, but only when needed. */ - la->la_prof_ticks += profhz; - if (la->la_prof_ticks >= lapic_timer_hz) { - la->la_prof_ticks -= lapic_timer_hz; - if (profprocs != 0) - profclock(TRAPF_USERMODE(frame), - TRAPF_PC(frame)); - } - } + timer1clock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); critical_exit(); } From owner-svn-src-head@FreeBSD.ORG Mon May 24 12:23:47 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03FD51065679; Mon, 24 May 2010 12:23:47 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 650858FC0A; Mon, 24 May 2010 12:23:46 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id o4OCNjAF013649; Mon, 24 May 2010 14:23:45 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id o4OCNjZP013648; Mon, 24 May 2010 14:23:45 +0200 (CEST) (envelope-from marius) Date: Mon, 24 May 2010 14:23:45 +0200 From: Marius Strobl To: "Simon L. Nielsen" Message-ID: <20100524122345.GI68288@alchemy.franken.de> References: <201005231946.o4NJkJLL072302@svn.freebsd.org> <20100524113941.GA1396@arthur.nitro.dk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5/uDoXvLw7AC5HRs" Content-Disposition: inline In-Reply-To: <20100524113941.GA1396@arthur.nitro.dk> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208459 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 12:23:47 -0000 --5/uDoXvLw7AC5HRs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, May 24, 2010 at 01:39:42PM +0200, Simon L. Nielsen wrote: > On 2010.05.23 19:46:19 +0000, Marius Strobl wrote: > > > New Revision: 208459 > > > > Log: > > Update the sparc64 hardware list regarding machines that will be supported > > beginning with 8.1-RELEASE as well as correct some existing entries and > > add previously missed ones. > > > > > - &netra; t1 105 > > + &sun; &netra; t1 100/105 > > If the product is called Netra and you just added the Sun part to > identify the company it should just be Sun, and not &sun; as you are > refering to Sun the company and not as part of a trademark. > > (It's a bit since I looked at it, but I'm rather sure above ist still > the case.) > > > + Starting with 8.1-RELEASE, &arch.sparc64; systems based on > > + &fujitsu; &sparc64; V are also supported by &os;, which > > + includes the following known working systems: > > Same here, if you are refering to Fujitsu the company it should not > include a trademark symbol. > It's kind of hard to think of a case where one would use the name of a company in a way that doesn't refer to the company but rather to a trademark when even using "company product" doesn't mean to refer to it as part of a trademark :) I.e. when would one have to use the company trademark? In any case, do the attached patches look correct to you? Marius --5/uDoXvLw7AC5HRs Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="article.sgml.diff" Index: article.sgml =================================================================== --- article.sgml (revision 208494) +++ article.sgml (working copy) @@ -380,7 +380,7 @@ sparc64 This section describes the systems currently known to be - supported by &os; on the &fujitsu; &sparc64; and &sun; &ultrasparc; + supported by &os; on the Fujitsu &sparc64; and Sun &ultrasparc; platforms. For background information on the various hardware designs see the Sun System @@ -391,8 +391,8 @@ When using the GENERIC kernel, &os;/&arch.sparc64; systems not equipped with a framebuffer - supported by the &man.creator.4; (&sun; Creator, &sun; Creator3D - and &sun; Elite3D) or &man.machfb.4; (&sun; PGX and &sun; PGX64 + supported by the &man.creator.4; (Sun Creator, Sun Creator3D + and Sun Elite3D) or &man.machfb.4; (Sun PGX and Sun PGX64 as well as the ATI Mach64 chips found onboard in for example &sun.blade; 100, &sun.blade; 150, &sun.ultra; 5 and &sun.ultra; 10) driver must use the serial console. @@ -451,55 +451,55 @@ - &sun; &netra; t1 100/105 + Sun &netra; t1 100/105 - &sun; &netra; T1 AC200/DC200 + Sun &netra; T1 AC200/DC200 - &sun; &netra; t 1100 + Sun &netra; t 1100 - &sun; &netra; t 1120 + Sun &netra; t 1120 - &sun; &netra; t 1125 + Sun &netra; t 1125 - &sun; &netra; t 1400/1405 + Sun &netra; t 1400/1405 - &sun; &netra; 120 + Sun &netra; 120 - &sun; &netra; X1 + Sun &netra; X1 - &sun; &sparcengine; Ultra AX1105 + Sun &sparcengine; Ultra AX1105 - &sun; &sparcengine; Ultra AXe + Sun &sparcengine; Ultra AXe - &sun; &sparcengine; Ultra AXi + Sun &sparcengine; Ultra AXi - &sun; &sparcengine; Ultra AXmp + Sun &sparcengine; Ultra AXmp - &sun; &sparcengine; CP1500 + Sun &sparcengine; CP1500 @@ -542,8 +542,8 @@ The following systems are partially supported by &os;. In particular the fibre channel controllers in SBus-based systems are not supported. However, it is possible to use these with a SCSI controller - supported by the &man.esp.4 driver (&sun; ESP SCSI, &sun; FAS Fast-SCSI - and &sun; FAS366 Fast-Wide SCSI controllers). + supported by the &man.esp.4 driver (Sun ESP SCSI, Sun FAS Fast-SCSI + and Sun FAS366 Fast-Wide SCSI controllers). @@ -555,7 +555,7 @@ - Starting with 7.2-RELEASE, &arch.sparc64; systems based on &sun; + Starting with 7.2-RELEASE, &arch.sparc64; systems based on Sun &ultrasparc; III and beyond are also supported by &os;, which includes the following known working systems: @@ -616,7 +616,7 @@ - The following &sun; &ultrasparc; systems are not tested but + The following Sun &ultrasparc; systems are not tested but believed to be also supported by &os;: @@ -639,29 +639,29 @@ Starting with 8.1-RELEASE, &arch.sparc64; systems based on - &fujitsu; &sparc64; V are also supported by &os;, which + Fujitsu &sparc64; V are also supported by &os;, which includes the following known working systems: - &fujitsu; &primepower; 250 + Fujitsu &primepower; 250 - The following &fujitsu; &primepower; systems are not tested but + The following Fujitsu &primepower; systems are not tested but believed to be also supported by &os;: - &fujitsu; &primepower; 450 + Fujitsu &primepower; 450 - &fujitsu; &primepower; 650 + Fujitsu &primepower; 650 - &fujitsu; &primepower; 850 + Fujitsu &primepower; 850 --5/uDoXvLw7AC5HRs Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sparc.sgml.diff" Index: sparc.sgml =================================================================== RCS file: /home/dcvs/www/en/platforms/sparc.sgml,v retrieving revision 1.35 diff -u -r1.35 sparc.sgml --- sparc.sgml 23 May 2010 19:59:12 -0000 1.35 +++ sparc.sgml 24 May 2010 12:08:30 -0000 @@ -12,7 +12,7 @@

Introduction

-

This page contains information about the FreeBSD port to Fujitsu®'s +

This page contains information about the FreeBSD port to Fujitsu's SPARC64® and Sun Microsystem's UltraSPARC® architectures. Discussion of this port takes place on the --5/uDoXvLw7AC5HRs-- From owner-svn-src-head@FreeBSD.ORG Mon May 24 13:21:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BBFB1065672; Mon, 24 May 2010 13:21:30 +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 D0D7F8FC1E; Mon, 24 May 2010 13:21:29 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6F45A46B39; Mon, 24 May 2010 09:21:29 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id AD30D8A021; Mon, 24 May 2010 09:21:28 -0400 (EDT) From: John Baldwin To: Alexander Motin Date: Mon, 24 May 2010 09:19:16 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201005231745.o4NHj2wF045486@svn.freebsd.org> In-Reply-To: <201005231745.o4NHj2wF045486@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201005240919.16796.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 24 May 2010 09:21:28 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208452 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 13:21:30 -0000 On Sunday 23 May 2010 1:45:02 pm Alexander Motin wrote: > Author: mav > Date: Sun May 23 17:45:01 2010 > New Revision: 208452 > URL: http://svn.freebsd.org/changeset/base/208452 > > Log: > Unify local_apic.c for x86 archs, Aiee! I have local changes here you just hosed! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon May 24 13:28:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B4C2106564A; Mon, 24 May 2010 13:28:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A87D8FC1D; Mon, 24 May 2010 13:28:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4ODSCkL012571; Mon, 24 May 2010 13:28:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4ODSCEH012569; Mon, 24 May 2010 13:28:12 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005241328.o4ODSCEH012569@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 24 May 2010 13:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208501 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 13:28:13 -0000 Author: jilles Date: Mon May 24 13:28:12 2010 New Revision: 208501 URL: http://svn.freebsd.org/changeset/base/208501 Log: sh(1): Improve wording of 'Special Parameters' section. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Mon May 24 13:01:07 2010 (r208500) +++ head/bin/sh/sh.1 Mon May 24 13:28:12 2010 (r208501) @@ -1040,13 +1040,9 @@ The .Ic set built-in command can also be used to set or reset them. .Ss Special Parameters -A special parameter is a parameter denoted by a special one-character -name. -The special parameters recognized by the -.Nm -shell of -.Fx -are shown in the following list, exactly as they would appear in input +Special parameters are parameters denoted by a single special character +or the digit zero. +They are shown in the following list, exactly as they would appear in input typed by the user or in the source of a shell script. .Bl -hang .It Li $* From owner-svn-src-head@FreeBSD.ORG Mon May 24 13:34:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76957106564A; Mon, 24 May 2010 13:34:05 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 700388FC0C; Mon, 24 May 2010 13:34:04 +0000 (UTC) Received: by fxm4 with SMTP id 4so3248896fxm.13 for ; Mon, 24 May 2010 06:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=9yuol2/INnPlkHtnyPYEqZAH2XysUkJ81aCNNt4ALdk=; b=l7P7I8MwDzDtBwIPban1QVNxUBgVEhsOMwEWuQbfFSmdicf7ms3rtEWcuTzbWVAC9p MyF8d9hwNnAQCqV/Qp006qVfJBWEXCzZ2fOtF4t3nC0PNhCvk0+XXTiTLCF6HENCU8s2 Afw8DWDBFJEqOcFsbLLDrLekCrbP10vSNr4MI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=XpSoBJL+EkF46wcO5BdYIlmQvYp4gCUEes8udh19FOynrOZtpN/6WiRKHohFny05nV c5kvp9DWDN57BbwB6zRDnErfnOUgdPcaHnw0zKjnYbCtwPtjasDxFK6osKOsgtPorEt2 iFknpV1arj7Cadgll8QDCMtfwQBp+YzAkQtMU= Received: by 10.223.26.130 with SMTP id e2mr4897842fac.101.1274708043220; Mon, 24 May 2010 06:34:03 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 15sm19585999fad.10.2010.05.24.06.34.01 (version=SSLv3 cipher=RC4-MD5); Mon, 24 May 2010 06:34:02 -0700 (PDT) Sender: Alexander Motin Message-ID: <4BFA8037.50108@FreeBSD.org> Date: Mon, 24 May 2010 16:33:43 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: John Baldwin References: <201005231745.o4NHj2wF045486@svn.freebsd.org> <201005240919.16796.jhb@freebsd.org> In-Reply-To: <201005240919.16796.jhb@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208452 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 13:34:05 -0000 John Baldwin wrote: > On Sunday 23 May 2010 1:45:02 pm Alexander Motin wrote: >> Author: mav >> Date: Sun May 23 17:45:01 2010 >> New Revision: 208452 >> URL: http://svn.freebsd.org/changeset/base/208452 >> >> Log: >> Unify local_apic.c for x86 archs, > > Aiee! I have local changes here you just hosed! Sorry, but I didn't want to do same work twice. Is there some problems for you to just patch different file? Or it is specific for only one platform? -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon May 24 13:43:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 581A1106567E; Mon, 24 May 2010 13:43:11 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 472258FC12; Mon, 24 May 2010 13:43:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4ODhBN5015862; Mon, 24 May 2010 13:43:11 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4ODhBFT015851; Mon, 24 May 2010 13:43:11 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <201005241343.o4ODhBFT015851@svn.freebsd.org> From: Daniel Eischen Date: Mon, 24 May 2010 13:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208502 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 13:43:11 -0000 Author: deischen Date: Mon May 24 13:43:11 2010 New Revision: 208502 URL: http://svn.freebsd.org/changeset/base/208502 Log: Coalesce a couple of broken lines since they can fit within 80 characters. Little nit found while looking at a bug report. Modified: head/lib/libthr/thread/thr_condattr.c Modified: head/lib/libthr/thread/thr_condattr.c ============================================================================== --- head/lib/libthr/thread/thr_condattr.c Mon May 24 13:28:12 2010 (r208501) +++ head/lib/libthr/thread/thr_condattr.c Mon May 24 13:43:11 2010 (r208502) @@ -79,8 +79,7 @@ _pthread_condattr_destroy(pthread_condat } int -_pthread_condattr_getclock(const pthread_condattr_t *attr, - clockid_t *clock_id) +_pthread_condattr_getclock(const pthread_condattr_t *attr, clockid_t *clock_id) { if (attr == NULL || *attr == NULL) return (EINVAL); @@ -89,8 +88,7 @@ _pthread_condattr_getclock(const pthread } int -_pthread_condattr_setclock(pthread_condattr_t *attr, - clockid_t clock_id) +_pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id) { if (attr == NULL || *attr == NULL) return (EINVAL); From owner-svn-src-head@FreeBSD.ORG Mon May 24 13:44:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68633106566B; Mon, 24 May 2010 13:44:39 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57AB68FC1E; Mon, 24 May 2010 13:44:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4ODidsC016235; Mon, 24 May 2010 13:44:39 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4ODidVZ016233; Mon, 24 May 2010 13:44:39 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <201005241344.o4ODidVZ016233@svn.freebsd.org> From: Daniel Eischen Date: Mon, 24 May 2010 13:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208503 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 13:44:39 -0000 Author: deischen Date: Mon May 24 13:44:39 2010 New Revision: 208503 URL: http://svn.freebsd.org/changeset/base/208503 Log: Coalesce one more broken line. Modified: head/lib/libthr/thread/thr_condattr.c Modified: head/lib/libthr/thread/thr_condattr.c ============================================================================== --- head/lib/libthr/thread/thr_condattr.c Mon May 24 13:43:11 2010 (r208502) +++ head/lib/libthr/thread/thr_condattr.c Mon May 24 13:44:39 2010 (r208503) @@ -103,8 +103,7 @@ _pthread_condattr_setclock(pthread_conda } int -_pthread_condattr_getpshared(const pthread_condattr_t *attr, - int *pshared) +_pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared) { if (attr == NULL || *attr == NULL) return (EINVAL); From owner-svn-src-head@FreeBSD.ORG Mon May 24 13:48:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1207F106567A; Mon, 24 May 2010 13:48:58 +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 D606F8FC0C; Mon, 24 May 2010 13:48:57 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 87B6E46B39; Mon, 24 May 2010 09:48:57 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 833E58A025; Mon, 24 May 2010 09:48:53 -0400 (EDT) From: John Baldwin To: Alexander Motin Date: Mon, 24 May 2010 09:44:16 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201005231745.o4NHj2wF045486@svn.freebsd.org> <201005240919.16796.jhb@freebsd.org> <4BFA8037.50108@FreeBSD.org> In-Reply-To: <4BFA8037.50108@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201005240944.16424.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 24 May 2010 09:48:53 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208452 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 13:48:58 -0000 On Monday 24 May 2010 9:33:43 am Alexander Motin wrote: > John Baldwin wrote: > > On Sunday 23 May 2010 1:45:02 pm Alexander Motin wrote: > >> Author: mav > >> Date: Sun May 23 17:45:01 2010 > >> New Revision: 208452 > >> URL: http://svn.freebsd.org/changeset/base/208452 > >> > >> Log: > >> Unify local_apic.c for x86 archs, > > > > Aiee! I have local changes here you just hosed! > > Sorry, but I didn't want to do same work twice. Is there some problems > for you to just patch different file? Or it is specific for only one > platform? No, it is just extra pain, and will make MFC'ing my changes more painful as well. It would perhaps be a good idea in the future for folks to send out a bit of a heads up before moving a file to sys/x86. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon May 24 14:26:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F8431065674; Mon, 24 May 2010 14:26:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B2B38FC08; Mon, 24 May 2010 14:26:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OEQv5o025592; Mon, 24 May 2010 14:26:57 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OEQv92025582; Mon, 24 May 2010 14:26:57 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005241426.o4OEQv92025582@svn.freebsd.org> From: Alan Cox Date: Mon, 24 May 2010 14:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208504 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke powerpc/powerpc sparc64/sparc64 sun4v/sun4v sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 14:26:57 -0000 Author: alc Date: Mon May 24 14:26:57 2010 New Revision: 208504 URL: http://svn.freebsd.org/changeset/base/208504 Log: Roughly half of a typical pmap_mincore() implementation is machine- independent code. Move this code into mincore(), and eliminate the page queues lock from pmap_mincore(). Push down the page queues lock into pmap_clear_modify(), pmap_clear_reference(), and pmap_is_modified(). Assert that these functions are never passed an unmanaged page. Eliminate an inaccurate comment from powerpc/powerpc/mmu_if.m: Contrary to what the comment says, pmap_mincore() is not simply an optimization. Without a complete pmap_mincore() implementation, mincore() cannot return either MINCORE_MODIFIED or MINCORE_REFERENCED because only the pmap can provide this information. Eliminate the page queues lock from vfs_setdirty_locked_object(), vm_pageout_clean(), vm_object_page_collect_flush(), and vm_object_page_clean(). Generally speaking, these are all accesses to the page's dirty field, which are synchronized by the containing vm object's lock. Reduce the scope of the page queues lock in vm_object_madvise() and vm_page_dontneed(). Reviewed by: kib (an earlier version) Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/pmap.c head/sys/kern/vfs_bio.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/sparc64/sparc64/pmap.c head/sys/sun4v/sun4v/pmap.c head/sys/sys/pcpu.h head/sys/vm/pmap.h head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon May 24 13:44:39 2010 (r208503) +++ head/sys/amd64/amd64/pmap.c Mon May 24 14:26:57 2010 (r208504) @@ -4128,12 +4128,25 @@ pmap_remove_pages(pmap_t pmap) boolean_t pmap_is_modified(vm_page_t m) { + boolean_t rv; - if (m->flags & PG_FICTITIOUS) + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_modified: page %p is not managed", m)); + + /* + * If the page is not VPO_BUSY, then PG_WRITEABLE cannot be + * concurrently set while the object is locked. Thus, if PG_WRITEABLE + * is clear, no PTEs can have PG_M set. + */ + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((m->oflags & VPO_BUSY) == 0 && + (m->flags & PG_WRITEABLE) == 0) return (FALSE); - if (pmap_is_modified_pvh(&m->md)) - return (TRUE); - return (pmap_is_modified_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); + vm_page_lock_queues(); + rv = pmap_is_modified_pvh(&m->md) || + pmap_is_modified_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))); + vm_page_unlock_queues(); + return (rv); } /* @@ -4384,9 +4397,20 @@ pmap_clear_modify(vm_page_t m) pt_entry_t oldpte, *pte; vm_offset_t va; - if ((m->flags & PG_FICTITIOUS) != 0) + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_modify: page %p is not managed", m)); + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + KASSERT((m->oflags & VPO_BUSY) == 0, + ("pmap_clear_modify: page %p is busy", m)); + + /* + * If the page is not PG_WRITEABLE, then no PTEs can have PG_M set. + * If the object containing the page is locked and the page is not + * VPO_BUSY, then PG_WRITEABLE cannot be concurrently set. + */ + if ((m->flags & PG_WRITEABLE) == 0) return; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_queues(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { pmap = PV_PMAP(pv); @@ -4432,6 +4456,7 @@ pmap_clear_modify(vm_page_t m) } PMAP_UNLOCK(pmap); } + vm_page_unlock_queues(); } /* @@ -4449,9 +4474,9 @@ pmap_clear_reference(vm_page_t m) pt_entry_t *pte; vm_offset_t va; - if ((m->flags & PG_FICTITIOUS) != 0) - return; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_reference: page %p is not managed", m)); + vm_page_lock_queues(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { pmap = PV_PMAP(pv); @@ -4488,6 +4513,7 @@ pmap_clear_reference(vm_page_t m) } PMAP_UNLOCK(pmap); } + vm_page_unlock_queues(); } /* @@ -4897,70 +4923,49 @@ pmap_change_attr_locked(vm_offset_t va, * perform the pmap work for mincore */ int -pmap_mincore(pmap_t pmap, vm_offset_t addr) +pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { pd_entry_t *pdep; pt_entry_t pte; vm_paddr_t pa; - vm_page_t m; - int val = 0; - + int val; + PMAP_LOCK(pmap); +retry: pdep = pmap_pde(pmap, addr); if (pdep != NULL && (*pdep & PG_V)) { if (*pdep & PG_PS) { pte = *pdep; - val = MINCORE_SUPER; /* Compute the physical address of the 4KB page. */ pa = ((*pdep & PG_PS_FRAME) | (addr & PDRMASK)) & PG_FRAME; + val = MINCORE_SUPER; } else { pte = *pmap_pde_to_pte(pdep, addr); pa = pte & PG_FRAME; + val = 0; } } else { pte = 0; pa = 0; + val = 0; } - PMAP_UNLOCK(pmap); - - if (pte != 0) { + if ((pte & PG_V) != 0) { val |= MINCORE_INCORE; - if ((pte & PG_MANAGED) == 0) - return (val); - - m = PHYS_TO_VM_PAGE(pa); - - /* - * Modified by us - */ if ((pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) - val |= MINCORE_MODIFIED|MINCORE_MODIFIED_OTHER; - else { - /* - * Modified by someone else - */ - vm_page_lock_queues(); - if (m->dirty || pmap_is_modified(m)) - val |= MINCORE_MODIFIED_OTHER; - vm_page_unlock_queues(); - } - /* - * Referenced by us - */ - if (pte & PG_A) - val |= MINCORE_REFERENCED|MINCORE_REFERENCED_OTHER; - else { - /* - * Referenced by someone else - */ - vm_page_lock_queues(); - if ((m->flags & PG_REFERENCED) || - pmap_is_referenced(m)) - val |= MINCORE_REFERENCED_OTHER; - vm_page_unlock_queues(); - } - } + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + if ((pte & PG_A) != 0) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && + (pte & (PG_MANAGED | PG_V)) == (PG_MANAGED | PG_V)) { + /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ + if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) + goto retry; + } else + PA_UNLOCK_COND(*locked_pa); + PMAP_UNLOCK(pmap); return (val); } Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Mon May 24 13:44:39 2010 (r208503) +++ head/sys/arm/arm/pmap.c Mon May 24 14:26:57 2010 (r208504) @@ -4475,6 +4475,8 @@ boolean_t pmap_is_modified(vm_page_t m) { + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_modified: page %p is not managed", m)); if (m->md.pvh_attrs & PVF_MOD) return (TRUE); @@ -4489,8 +4491,23 @@ void pmap_clear_modify(vm_page_t m) { + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_modify: page %p is not managed", m)); + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + KASSERT((m->oflags & VPO_BUSY) == 0, + ("pmap_clear_modify: page %p is busy", m)); + + /* + * If the page is not PG_WRITEABLE, then no mappings can be modified. + * If the object containing the page is locked and the page is not + * VPO_BUSY, then PG_WRITEABLE cannot be concurrently set. + */ + if ((m->flags & PG_WRITEABLE) == 0) + return; + vm_page_lock_queues(); if (m->md.pvh_attrs & PVF_MOD) pmap_clearbit(m, PVF_MOD); + vm_page_unlock_queues(); } @@ -4517,8 +4534,12 @@ void pmap_clear_reference(vm_page_t m) { + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_reference: page %p is not managed", m)); + vm_page_lock_queues(); if (m->md.pvh_attrs & PVF_REF) pmap_clearbit(m, PVF_REF); + vm_page_unlock_queues(); } @@ -4551,7 +4572,7 @@ pmap_remove_write(vm_page_t m) * perform the pmap work for mincore */ int -pmap_mincore(pmap_t pmap, vm_offset_t addr) +pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { printf("pmap_mincore()\n"); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon May 24 13:44:39 2010 (r208503) +++ head/sys/i386/i386/pmap.c Mon May 24 14:26:57 2010 (r208504) @@ -4294,12 +4294,25 @@ pmap_remove_pages(pmap_t pmap) boolean_t pmap_is_modified(vm_page_t m) { + boolean_t rv; - if (m->flags & PG_FICTITIOUS) + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_modified: page %p is not managed", m)); + + /* + * If the page is not VPO_BUSY, then PG_WRITEABLE cannot be + * concurrently set while the object is locked. Thus, if PG_WRITEABLE + * is clear, no PTEs can have PG_M set. + */ + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((m->oflags & VPO_BUSY) == 0 && + (m->flags & PG_WRITEABLE) == 0) return (FALSE); - if (pmap_is_modified_pvh(&m->md)) - return (TRUE); - return (pmap_is_modified_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); + vm_page_lock_queues(); + rv = pmap_is_modified_pvh(&m->md) || + pmap_is_modified_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))); + vm_page_unlock_queues(); + return (rv); } /* @@ -4563,9 +4576,20 @@ pmap_clear_modify(vm_page_t m) pt_entry_t oldpte, *pte; vm_offset_t va; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if ((m->flags & PG_FICTITIOUS) != 0) + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_modify: page %p is not managed", m)); + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + KASSERT((m->oflags & VPO_BUSY) == 0, + ("pmap_clear_modify: page %p is busy", m)); + + /* + * If the page is not PG_WRITEABLE, then no PTEs can have PG_M set. + * If the object containing the page is locked and the page is not + * VPO_BUSY, then PG_WRITEABLE cannot be concurrently set. + */ + if ((m->flags & PG_WRITEABLE) == 0) return; + vm_page_lock_queues(); sched_pin(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { @@ -4623,6 +4647,7 @@ pmap_clear_modify(vm_page_t m) PMAP_UNLOCK(pmap); } sched_unpin(); + vm_page_unlock_queues(); } /* @@ -4640,9 +4665,9 @@ pmap_clear_reference(vm_page_t m) pt_entry_t *pte; vm_offset_t va; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if ((m->flags & PG_FICTITIOUS) != 0) - return; + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_reference: page %p is not managed", m)); + vm_page_lock_queues(); sched_pin(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { @@ -4686,6 +4711,7 @@ pmap_clear_reference(vm_page_t m) PMAP_UNLOCK(pmap); } sched_unpin(); + vm_page_unlock_queues(); } /* @@ -4955,72 +4981,51 @@ pmap_change_attr(vm_offset_t va, vm_size * perform the pmap work for mincore */ int -pmap_mincore(pmap_t pmap, vm_offset_t addr) +pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { pd_entry_t *pdep; pt_entry_t *ptep, pte; vm_paddr_t pa; - vm_page_t m; - int val = 0; - + int val; + PMAP_LOCK(pmap); +retry: pdep = pmap_pde(pmap, addr); if (*pdep != 0) { if (*pdep & PG_PS) { pte = *pdep; - val = MINCORE_SUPER; /* Compute the physical address of the 4KB page. */ pa = ((*pdep & PG_PS_FRAME) | (addr & PDRMASK)) & PG_FRAME; + val = MINCORE_SUPER; } else { ptep = pmap_pte(pmap, addr); pte = *ptep; pmap_pte_release(ptep); pa = pte & PG_FRAME; + val = 0; } } else { pte = 0; pa = 0; + val = 0; } - PMAP_UNLOCK(pmap); - - if (pte != 0) { + if ((pte & PG_V) != 0) { val |= MINCORE_INCORE; - if ((pte & PG_MANAGED) == 0) - return (val); - - m = PHYS_TO_VM_PAGE(pa); - - /* - * Modified by us - */ if ((pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) - val |= MINCORE_MODIFIED|MINCORE_MODIFIED_OTHER; - else { - /* - * Modified by someone else - */ - vm_page_lock_queues(); - if (m->dirty || pmap_is_modified(m)) - val |= MINCORE_MODIFIED_OTHER; - vm_page_unlock_queues(); - } - /* - * Referenced by us - */ - if (pte & PG_A) - val |= MINCORE_REFERENCED|MINCORE_REFERENCED_OTHER; - else { - /* - * Referenced by someone else - */ - vm_page_lock_queues(); - if ((m->flags & PG_REFERENCED) || - pmap_is_referenced(m)) - val |= MINCORE_REFERENCED_OTHER; - vm_page_unlock_queues(); - } - } + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + if ((pte & PG_A) != 0) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && + (pte & (PG_MANAGED | PG_V)) == (PG_MANAGED | PG_V)) { + /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ + if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) + goto retry; + } else + PA_UNLOCK_COND(*locked_pa); + PMAP_UNLOCK(pmap); return (val); } Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Mon May 24 13:44:39 2010 (r208503) +++ head/sys/i386/xen/pmap.c Mon May 24 14:26:57 2010 (r208504) @@ -3663,12 +3663,21 @@ pmap_is_modified(vm_page_t m) pmap_t pmap; boolean_t rv; + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_modified: page %p is not managed", m)); rv = FALSE; - if (m->flags & PG_FICTITIOUS) - return (rv); + /* + * If the page is not VPO_BUSY, then PG_WRITEABLE cannot be + * concurrently set while the object is locked. Thus, if PG_WRITEABLE + * is clear, no PTEs can have PG_M set. + */ + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((m->oflags & VPO_BUSY) == 0 && + (m->flags & PG_WRITEABLE) == 0) + return (rv); + vm_page_lock_queues(); sched_pin(); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -3681,6 +3690,7 @@ pmap_is_modified(vm_page_t m) if (*PMAP1) PT_SET_MA(PADDR1, 0); sched_unpin(); + vm_page_unlock_queues(); return (rv); } @@ -3887,9 +3897,20 @@ pmap_clear_modify(vm_page_t m) pmap_t pmap; pt_entry_t *pte; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if ((m->flags & PG_FICTITIOUS) != 0) + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_modify: page %p is not managed", m)); + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + KASSERT((m->oflags & VPO_BUSY) == 0, + ("pmap_clear_modify: page %p is busy", m)); + + /* + * If the page is not PG_WRITEABLE, then no PTEs can have PG_M set. + * If the object containing the page is locked and the page is not + * VPO_BUSY, then PG_WRITEABLE cannot be concurrently set. + */ + if ((m->flags & PG_WRITEABLE) == 0) return; + vm_page_lock_queues(); sched_pin(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { pmap = PV_PMAP(pv); @@ -3907,6 +3928,7 @@ pmap_clear_modify(vm_page_t m) PMAP_UNLOCK(pmap); } sched_unpin(); + vm_page_unlock_queues(); } /* @@ -3921,9 +3943,9 @@ pmap_clear_reference(vm_page_t m) pmap_t pmap; pt_entry_t *pte; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if ((m->flags & PG_FICTITIOUS) != 0) - return; + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_reference: page %p is not managed", m)); + vm_page_lock_queues(); sched_pin(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { pmap = PV_PMAP(pv); @@ -3941,6 +3963,7 @@ pmap_clear_reference(vm_page_t m) PMAP_UNLOCK(pmap); } sched_unpin(); + vm_page_unlock_queues(); } /* @@ -4133,60 +4156,36 @@ pmap_change_attr(va, size, mode) * perform the pmap work for mincore */ int -pmap_mincore(pmap_t pmap, vm_offset_t addr) +pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { pt_entry_t *ptep, pte; - vm_page_t m; - int val = 0; + vm_paddr_t pa; + int val; PMAP_LOCK(pmap); +retry: ptep = pmap_pte(pmap, addr); pte = (ptep != NULL) ? PT_GET(ptep) : 0; pmap_pte_release(ptep); - PMAP_UNLOCK(pmap); - - if (pte != 0) { - vm_paddr_t pa; - - val = MINCORE_INCORE; - if ((pte & PG_MANAGED) == 0) - return val; - + val = 0; + if ((pte & PG_V) != 0) { + val |= MINCORE_INCORE; + if ((pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + if ((pte & PG_A) != 0) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && + (pte & (PG_MANAGED | PG_V)) == (PG_MANAGED | PG_V)) { pa = pte & PG_FRAME; - - m = PHYS_TO_VM_PAGE(pa); - - /* - * Modified by us - */ - if (pte & PG_M) - val |= MINCORE_MODIFIED|MINCORE_MODIFIED_OTHER; - else { - /* - * Modified by someone else - */ - vm_page_lock_queues(); - if (m->dirty || pmap_is_modified(m)) - val |= MINCORE_MODIFIED_OTHER; - vm_page_unlock_queues(); - } - /* - * Referenced by us - */ - if (pte & PG_A) - val |= MINCORE_REFERENCED|MINCORE_REFERENCED_OTHER; - else { - /* - * Referenced by someone else - */ - vm_page_lock_queues(); - if ((m->flags & PG_REFERENCED) || - pmap_is_referenced(m)) - val |= MINCORE_REFERENCED_OTHER; - vm_page_unlock_queues(); - } - } - return val; + /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ + if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) + goto retry; + } else + PA_UNLOCK_COND(*locked_pa); + PMAP_UNLOCK(pmap); + return (val); } void Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Mon May 24 13:44:39 2010 (r208503) +++ head/sys/ia64/ia64/pmap.c Mon May 24 14:26:57 2010 (r208504) @@ -1981,10 +1981,20 @@ pmap_is_modified(vm_page_t m) pv_entry_t pv; boolean_t rv; + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_modified: page %p is not managed", m)); rv = FALSE; - if (m->flags & PG_FICTITIOUS) - return (rv); + /* + * If the page is not VPO_BUSY, then PG_WRITEABLE cannot be + * concurrently set while the object is locked. Thus, if PG_WRITEABLE + * is clear, no PTEs can be dirty. + */ + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((m->oflags & VPO_BUSY) == 0 && + (m->flags & PG_WRITEABLE) == 0) + return (rv); + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { PMAP_LOCK(pv->pv_pmap); oldpmap = pmap_switch(pv->pv_pmap); @@ -1996,7 +2006,7 @@ pmap_is_modified(vm_page_t m) if (rv) break; } - + vm_page_unlock_queues(); return (rv); } @@ -2058,9 +2068,20 @@ pmap_clear_modify(vm_page_t m) pmap_t oldpmap; pv_entry_t pv; - if (m->flags & PG_FICTITIOUS) - return; + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_modify: page %p is not managed", m)); + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + KASSERT((m->oflags & VPO_BUSY) == 0, + ("pmap_clear_modify: page %p is busy", m)); + /* + * If the page is not PG_WRITEABLE, then no PTEs can be modified. + * If the object containing the page is locked and the page is not + * VPO_BUSY, then PG_WRITEABLE cannot be concurrently set. + */ + if ((m->flags & PG_WRITEABLE) == 0) + return; + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { PMAP_LOCK(pv->pv_pmap); oldpmap = pmap_switch(pv->pv_pmap); @@ -2073,6 +2094,7 @@ pmap_clear_modify(vm_page_t m) pmap_switch(oldpmap); PMAP_UNLOCK(pv->pv_pmap); } + vm_page_unlock_queues(); } /* @@ -2087,9 +2109,9 @@ pmap_clear_reference(vm_page_t m) pmap_t oldpmap; pv_entry_t pv; - if (m->flags & PG_FICTITIOUS) - return; - + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_reference: page %p is not managed", m)); + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { PMAP_LOCK(pv->pv_pmap); oldpmap = pmap_switch(pv->pv_pmap); @@ -2102,6 +2124,7 @@ pmap_clear_reference(vm_page_t m) pmap_switch(oldpmap); PMAP_UNLOCK(pv->pv_pmap); } + vm_page_unlock_queues(); } /* @@ -2178,13 +2201,15 @@ pmap_unmapdev(vm_offset_t va, vm_size_t * perform the pmap work for mincore */ int -pmap_mincore(pmap_t pmap, vm_offset_t addr) +pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { pmap_t oldpmap; struct ia64_lpte *pte, tpte; - int val = 0; + vm_paddr_t pa; + int val; PMAP_LOCK(pmap); +retry: oldpmap = pmap_switch(pmap); pte = pmap_find_vhpt(addr); if (pte != NULL) { @@ -2192,53 +2217,27 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad pte = &tpte; } pmap_switch(oldpmap); - PMAP_UNLOCK(pmap); - - if (pte == NULL) - return 0; - - if (pmap_present(pte)) { - vm_page_t m; - vm_offset_t pa; - - val = MINCORE_INCORE; - if (!pmap_managed(pte)) - return val; - + if (pte == NULL || !pmap_present(pte)) { + val = 0; + goto out; + } + val = MINCORE_INCORE; + if (pmap_dirty(pte)) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + if (pmap_accessed(pte)) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && + pmap_managed(pte)) { pa = pmap_ppn(pte); - - m = PHYS_TO_VM_PAGE(pa); - - /* - * Modified by us - */ - if (pmap_dirty(pte)) - val |= MINCORE_MODIFIED|MINCORE_MODIFIED_OTHER; - else { - /* - * Modified by someone - */ - vm_page_lock_queues(); - if (pmap_is_modified(m)) - val |= MINCORE_MODIFIED_OTHER; - vm_page_unlock_queues(); - } - /* - * Referenced by us - */ - if (pmap_accessed(pte)) - val |= MINCORE_REFERENCED|MINCORE_REFERENCED_OTHER; - else { - /* - * Referenced by someone - */ - vm_page_lock_queues(); - if (pmap_is_referenced(m)) - val |= MINCORE_REFERENCED_OTHER; - vm_page_unlock_queues(); - } - } - return val; + /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ + if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) + goto retry; + } else +out: + PA_UNLOCK_COND(*locked_pa); + PMAP_UNLOCK(pmap); + return (val); } void Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon May 24 13:44:39 2010 (r208503) +++ head/sys/kern/vfs_bio.c Mon May 24 14:26:57 2010 (r208504) @@ -2443,7 +2443,6 @@ vfs_setdirty_locked_object(struct buf *b vm_offset_t boffset; vm_offset_t eoffset; - vm_page_lock_queues(); /* * test the pages to see if they have been modified directly * by users through the VM system. @@ -2469,7 +2468,6 @@ vfs_setdirty_locked_object(struct buf *b } eoffset = ((i + 1) << PAGE_SHIFT) - (bp->b_offset & PAGE_MASK); - vm_page_unlock_queues(); /* * Fit it to the buffer. */ Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Mon May 24 13:44:39 2010 (r208503) +++ head/sys/mips/mips/pmap.c Mon May 24 14:26:57 2010 (r208504) @@ -2586,13 +2586,27 @@ pmap_ts_referenced(vm_page_t m) boolean_t pmap_is_modified(vm_page_t m) { - if (m->flags & PG_FICTITIOUS) - return FALSE; + boolean_t rv; + + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_modified: page %p is not managed", m)); + /* + * If the page is not VPO_BUSY, then PG_WRITEABLE cannot be + * concurrently set while the object is locked. Thus, if PG_WRITEABLE + * is clear, no PTEs can have PTE_M set. + */ + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((m->oflags & VPO_BUSY) == 0 && + (m->flags & PG_WRITEABLE) == 0) + return (FALSE); + vm_page_lock_queues(); if (m->md.pv_flags & PV_TABLE_MOD) - return TRUE; + rv = TRUE; else - return pmap_testbit(m, PTE_M); + rv = pmap_testbit(m, PTE_M); + vm_page_unlock_queues(); + return (rv); } /* N/C */ @@ -2625,13 +2639,26 @@ pmap_is_prefaultable(pmap_t pmap, vm_off void pmap_clear_modify(vm_page_t m) { - if (m->flags & PG_FICTITIOUS) + + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_modify: page %p is not managed", m)); + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + KASSERT((m->oflags & VPO_BUSY) == 0, + ("pmap_clear_modify: page %p is busy", m)); + + /* + * If the page is not PG_WRITEABLE, then no PTEs can have PTE_M set. + * If the object containing the page is locked and the page is not + * VPO_BUSY, then PG_WRITEABLE cannot be concurrently set. + */ + if ((m->flags & PG_WRITEABLE) == 0) return; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_queues(); if (m->md.pv_flags & PV_TABLE_MOD) { pmap_changebit(m, PTE_M, FALSE); m->md.pv_flags &= ~PV_TABLE_MOD; } + vm_page_unlock_queues(); } /* @@ -2656,13 +2683,14 @@ pmap_is_referenced(vm_page_t m) void pmap_clear_reference(vm_page_t m) { - if (m->flags & PG_FICTITIOUS) - return; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_clear_reference: page %p is not managed", m)); + vm_page_lock_queues(); if (m->md.pv_flags & PV_TABLE_REF) { m->md.pv_flags &= ~PV_TABLE_REF; } + vm_page_unlock_queues(); } /* @@ -2733,51 +2761,47 @@ pmap_unmapdev(vm_offset_t va, vm_size_t * perform the pmap work for mincore */ int -pmap_mincore(pmap_t pmap, vm_offset_t addr) +pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { - pt_entry_t *ptep, pte; - vm_page_t m; - int val = 0; + vm_offset_t pa; + int val; + boolean_t managed; PMAP_LOCK(pmap); +retry: ptep = pmap_pte(pmap, addr); pte = (ptep != NULL) ? *ptep : 0; - PMAP_UNLOCK(pmap); - - if (mips_pg_v(pte)) { - vm_offset_t pa; - - val = MINCORE_INCORE; - pa = mips_tlbpfn_to_paddr(pte); - if (!page_is_managed(pa)) - return val; - - m = PHYS_TO_VM_PAGE(pa); - + if (!mips_pg_v(pte)) { + val = 0; + goto out; + } + val = MINCORE_INCORE; + if ((pte & PTE_M) != 0) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + pa = mips_tlbpfn_to_paddr(pte); + managed = page_is_managed(pa); + if (managed) { /* - * Modified by us + * This may falsely report the given address as + * MINCORE_REFERENCED. Unfortunately, due to the lack of + * per-PTE reference information, it is impossible to + * determine if the address is MINCORE_REFERENCED. */ - if (pte & PTE_M) - val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; - /* - * Modified by someone - */ - else { - vm_page_lock_queues(); - if (m->dirty || pmap_is_modified(m)) - val |= MINCORE_MODIFIED_OTHER; - vm_page_unlock_queues(); - } - /* - * Referenced by us or someone - */ - vm_page_lock_queues(); - if ((m->flags & PG_REFERENCED) || pmap_is_referenced(m)) + m = PHYS_TO_VM_PAGE(pa); + if ((m->flags & PG_REFERENCED) != 0) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; - vm_page_unlock_queues(); } - return val; + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && managed) { + /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ + if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) + goto retry; + } else +out: + PA_UNLOCK_COND(*locked_pa); + PMAP_UNLOCK(pmap); + return (val); } void Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Mon May 24 13:44:39 2010 (r208503) +++ head/sys/powerpc/aim/mmu_oea.c Mon May 24 14:26:57 2010 (r208504) @@ -1290,29 +1290,57 @@ moea_is_referenced(mmu_t mmu, vm_page_t boolean_t moea_is_modified(mmu_t mmu, vm_page_t m) { + boolean_t rv; - if ((m->flags & (PG_FICTITIOUS |PG_UNMANAGED)) != 0) - return (FALSE); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("moea_is_modified: page %p is not managed", m)); - return (moea_query_bit(m, PTE_CHG)); + /* + * If the page is not VPO_BUSY, then PG_WRITEABLE cannot be + * concurrently set while the object is locked. Thus, if PG_WRITEABLE + * is clear, no PTEs can have PTE_CHG set. + */ + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((m->oflags & VPO_BUSY) == 0 && + (m->flags & PG_WRITEABLE) == 0) + return (FALSE); + vm_page_lock_queues(); + rv = moea_query_bit(m, PTE_CHG); + vm_page_unlock_queues(); + return (rv); } void moea_clear_reference(mmu_t mmu, vm_page_t m) { - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return; + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("moea_clear_reference: page %p is not managed", m)); + vm_page_lock_queues(); moea_clear_bit(m, PTE_REF, NULL); + vm_page_unlock_queues(); } void moea_clear_modify(mmu_t mmu, vm_page_t m) { - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("moea_clear_modify: page %p is not managed", m)); + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + KASSERT((m->oflags & VPO_BUSY) == 0, + ("moea_clear_modify: page %p is busy", m)); + + /* + * If the page is not PG_WRITEABLE, then no PTEs can have PTE_CHG + * set. If the object containing the page is locked and the page is + * not VPO_BUSY, then PG_WRITEABLE cannot be concurrently set. + */ + if ((m->flags & PG_WRITEABLE) == 0) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon May 24 14:37:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7530C1065674; Mon, 24 May 2010 14:37:28 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id CD7868FC13; Mon, 24 May 2010 14:37:26 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA01500; Mon, 24 May 2010 17:37:24 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OGYmR-000BlE-Uk; Mon, 24 May 2010 17:37:24 +0300 Message-ID: <4BFA8F22.6040402@freebsd.org> Date: Mon, 24 May 2010 17:37:22 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: Alexander Motin References: <201005241140.o4OBeova088506@svn.freebsd.org> In-Reply-To: <201005241140.o4OBeova088506@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208494 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 14:37:28 -0000 on 24/05/2010 14:40 Alexander Motin said the following: > Author: mav > Date: Mon May 24 11:40:49 2010 > New Revision: 208494 > URL: http://svn.freebsd.org/changeset/base/208494 > > Log: > - Implement MI helper functions, dividing one or two timer interrupts with > arbitrary frequencies into hardclock(), statclock() and profclock() calls. > Same code with minor variations duplicated several times over the tree for > different timer drivers and architectures. > - Switch all x86 archs to new functions, simplifying the code and removing > extra logic from timer drivers. Other archs are also welcome. Alexander, could you please describe the new code/KPI in greater detail, perhaps on a more appropriate mailing list? For me it is not immediately obvious why IPI_PROFCLOCK is gone now. I haven't spent much time reverse engineering this change and perhaps it's easier for you to describe the change. Thanks! > Modified: > head/sys/amd64/amd64/mp_machdep.c > head/sys/amd64/include/apicvar.h > head/sys/amd64/include/clock.h > head/sys/i386/i386/mp_machdep.c > head/sys/i386/include/apicvar.h > head/sys/i386/include/clock.h > head/sys/kern/kern_clock.c > head/sys/pc98/cbus/clock.c > head/sys/sys/kernel.h > head/sys/sys/systm.h > head/sys/x86/isa/clock.c > head/sys/x86/x86/local_apic.c > > Modified: head/sys/amd64/amd64/mp_machdep.c > ============================================================================== > --- head/sys/amd64/amd64/mp_machdep.c Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/amd64/amd64/mp_machdep.c Mon May 24 11:40:49 2010 (r208494) > @@ -1112,9 +1112,6 @@ ipi_bitmap_handler(struct trapframe fram > > if (ipi_bitmap & (1 << IPI_STATCLOCK)) > statclockintr(&frame); > - > - if (ipi_bitmap & (1 << IPI_PROFCLOCK)) > - profclockintr(&frame); > } > > /* > > Modified: head/sys/amd64/include/apicvar.h > ============================================================================== > --- head/sys/amd64/include/apicvar.h Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/amd64/include/apicvar.h Mon May 24 11:40:49 2010 (r208494) > @@ -123,8 +123,7 @@ > #define IPI_PREEMPT 1 > #define IPI_HARDCLOCK 2 > #define IPI_STATCLOCK 3 > -#define IPI_PROFCLOCK 4 > -#define IPI_BITMAP_LAST IPI_PROFCLOCK > +#define IPI_BITMAP_LAST IPI_STATCLOCK > #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) > > #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ > > Modified: head/sys/amd64/include/clock.h > ============================================================================== > --- head/sys/amd64/include/clock.h Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/amd64/include/clock.h Mon May 24 11:40:49 2010 (r208494) > @@ -27,7 +27,6 @@ struct trapframe; > > int hardclockintr(struct trapframe *frame); > int statclockintr(struct trapframe *frame); > -int profclockintr(struct trapframe *frame); > > /* > * Driver to clock driver interface. > > Modified: head/sys/i386/i386/mp_machdep.c > ============================================================================== > --- head/sys/i386/i386/mp_machdep.c Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/i386/i386/mp_machdep.c Mon May 24 11:40:49 2010 (r208494) > @@ -1279,9 +1279,6 @@ ipi_bitmap_handler(struct trapframe fram > > if (ipi_bitmap & (1 << IPI_STATCLOCK)) > statclockintr(&frame); > - > - if (ipi_bitmap & (1 << IPI_PROFCLOCK)) > - profclockintr(&frame); > } > > /* > > Modified: head/sys/i386/include/apicvar.h > ============================================================================== > --- head/sys/i386/include/apicvar.h Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/i386/include/apicvar.h Mon May 24 11:40:49 2010 (r208494) > @@ -124,8 +124,7 @@ > #define IPI_PREEMPT 1 > #define IPI_HARDCLOCK 2 > #define IPI_STATCLOCK 3 > -#define IPI_PROFCLOCK 4 > -#define IPI_BITMAP_LAST IPI_PROFCLOCK > +#define IPI_BITMAP_LAST IPI_STATCLOCK > #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) > > #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ > @@ -152,8 +151,7 @@ > #define IPI_PREEMPT 1 > #define IPI_HARDCLOCK 2 > #define IPI_STATCLOCK 3 > -#define IPI_PROFCLOCK 4 > -#define IPI_BITMAP_LAST IPI_PROFCLOCK > +#define IPI_BITMAP_LAST IPI_STATCLOCK > #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) > > #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ > > Modified: head/sys/i386/include/clock.h > ============================================================================== > --- head/sys/i386/include/clock.h Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/i386/include/clock.h Mon May 24 11:40:49 2010 (r208494) > @@ -27,7 +27,6 @@ struct trapframe; > > int hardclockintr(struct trapframe *frame); > int statclockintr(struct trapframe *frame); > -int profclockintr(struct trapframe *frame); > > /* > * Driver to clock driver interface. > > Modified: head/sys/kern/kern_clock.c > ============================================================================== > --- head/sys/kern/kern_clock.c Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/kern/kern_clock.c Mon May 24 11:40:49 2010 (r208494) > @@ -374,6 +374,12 @@ int profprocs; > int ticks; > int psratio; > > +int timer1hz; > +int timer2hz; > +static DPCPU_DEFINE(u_int, hard_cnt); > +static DPCPU_DEFINE(u_int, stat_cnt); > +static DPCPU_DEFINE(u_int, prof_cnt); > + > /* > * Initialize clock frequencies and start both clocks running. > */ > @@ -403,6 +409,52 @@ initclocks(dummy) > #endif > } > > +void > +timer1clock(int usermode, uintfptr_t pc) > +{ > + u_int *cnt; > + > + cnt = DPCPU_PTR(hard_cnt); > + *cnt += hz; > + if (*cnt >= timer1hz) { > + *cnt -= timer1hz; > + if (*cnt >= timer1hz) > + *cnt = 0; > + if (PCPU_GET(cpuid) == 0) > + hardclock(usermode, pc); > + else > + hardclock_cpu(usermode); > + } > + if (timer2hz == 0) > + timer2clock(usermode, pc); > +} > + > +void > +timer2clock(int usermode, uintfptr_t pc) > +{ > + u_int *cnt; > + int t2hz = timer2hz ? timer2hz : timer1hz; > + > + cnt = DPCPU_PTR(stat_cnt); > + *cnt += stathz; > + if (*cnt >= t2hz) { > + *cnt -= t2hz; > + if (*cnt >= t2hz) > + *cnt = 0; > + statclock(usermode); > + } > + if (profprocs == 0) > + return; > + cnt = DPCPU_PTR(prof_cnt); > + *cnt += profhz; > + if (*cnt >= t2hz) { > + *cnt -= t2hz; > + if (*cnt >= t2hz) > + *cnt = 0; > + profclock(usermode, pc); > + } > +} > + > /* > * Each time the real-time timer fires, this function is called on all CPUs. > * Note that hardclock() calls hardclock_cpu() for the boot CPU, so only > > Modified: head/sys/pc98/cbus/clock.c > ============================================================================== > --- head/sys/pc98/cbus/clock.c Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/pc98/cbus/clock.c Mon May 24 11:40:49 2010 (r208494) > @@ -129,10 +129,7 @@ int > hardclockintr(struct trapframe *frame) > { > > - if (PCPU_GET(cpuid) == 0) > - hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); > - else > - hardclock_cpu(TRAPF_USERMODE(frame)); > + timer1clock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); > return (FILTER_HANDLED); > } > > @@ -143,13 +140,6 @@ statclockintr(struct trapframe *frame) > return (FILTER_HANDLED); > } > > -int > -profclockintr(struct trapframe *frame) > -{ > - > - return (FILTER_HANDLED); > -} > - > static int > clkintr(struct trapframe *frame) > { > @@ -448,6 +438,7 @@ cpu_initclocks() > * timecounter to user a simpler algorithm. > */ > if (using_lapic_timer == LAPIC_CLOCK_NONE) { > + timer1hz = hz; > intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, > NULL, INTR_TYPE_CLK, NULL); > i8254_intsrc = intr_lookup_source(0); > @@ -460,6 +451,14 @@ cpu_initclocks() > i8254_timecounter.tc_counter_mask = 0xffff; > set_i8254_freq(i8254_freq, hz); > } > + if (using_lapic_timer != LAPIC_CLOCK_ALL) { > + profhz = hz; > + if (hz < 128) > + stathz = hz; > + else > + stathz = hz / (hz / 128); > + } > + timer2hz = 0; > > init_TSC_tc(); > } > > Modified: head/sys/sys/kernel.h > ============================================================================== > --- head/sys/sys/kernel.h Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/sys/kernel.h Mon May 24 11:40:49 2010 (r208494) > @@ -64,6 +64,8 @@ extern int stathz; /* statistics clock > extern int profhz; /* profiling clock's frequency */ > extern int profprocs; /* number of process's profiling */ > extern int ticks; > +extern int timer1hz; /* timer 1 frequency */ > +extern int timer2hz; /* timer 2 frequency */ > > #endif /* _KERNEL */ > > > Modified: head/sys/sys/systm.h > ============================================================================== > --- head/sys/sys/systm.h Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/sys/systm.h Mon May 24 11:40:49 2010 (r208494) > @@ -240,6 +240,8 @@ void hardclock_cpu(int usermode); > void softclock(void *); > void statclock(int usermode); > void profclock(int usermode, uintfptr_t pc); > +void timer1clock(int usermode, uintfptr_t pc); > +void timer2clock(int usermode, uintfptr_t pc); > > void startprofclock(struct proc *); > void stopprofclock(struct proc *); > > Modified: head/sys/x86/isa/clock.c > ============================================================================== > --- head/sys/x86/isa/clock.c Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/x86/isa/clock.c Mon May 24 11:40:49 2010 (r208494) > @@ -87,8 +87,6 @@ __FBSDID("$FreeBSD$"); > #define TIMER_DIV(x) ((i8254_freq + (x) / 2) / (x)) > > int clkintr_pending; > -static int pscnt = 1; > -static int psdiv = 1; > #ifndef TIMER_FREQ > #define TIMER_FREQ 1193182 > #endif > @@ -134,10 +132,7 @@ int > hardclockintr(struct trapframe *frame) > { > > - if (PCPU_GET(cpuid) == 0) > - hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); > - else > - hardclock_cpu(TRAPF_USERMODE(frame)); > + timer1clock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); > return (FILTER_HANDLED); > } > > @@ -145,19 +140,7 @@ int > statclockintr(struct trapframe *frame) > { > > - profclockintr(frame); > - statclock(TRAPF_USERMODE(frame)); > - return (FILTER_HANDLED); > -} > - > -int > -profclockintr(struct trapframe *frame) > -{ > - > - if (!using_atrtc_timer) > - hardclockintr(frame); > - if (profprocs != 0) > - profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); > + timer2clock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); > return (FILTER_HANDLED); > } > > @@ -190,28 +173,11 @@ clkintr(struct trapframe *frame) > (*cyclic_clock_func[cpu])(frame); > #endif > > - if (using_atrtc_timer) { > -#ifdef SMP > - if (smp_started) > - ipi_all_but_self(IPI_HARDCLOCK); > -#endif > - hardclockintr(frame); > - } else { > - if (--pscnt <= 0) { > - pscnt = psratio; > #ifdef SMP > - if (smp_started) > - ipi_all_but_self(IPI_STATCLOCK); > + if (smp_started) > + ipi_all_but_self(IPI_HARDCLOCK); > #endif > - statclockintr(frame); > - } else { > -#ifdef SMP > - if (smp_started) > - ipi_all_but_self(IPI_PROFCLOCK); > -#endif > - profclockintr(frame); > - } > - } > + hardclockintr(frame); > > #ifdef DEV_MCA > /* Reset clock interrupt by asserting bit 7 of port 0x61 */ > @@ -295,20 +261,11 @@ rtcintr(struct trapframe *frame) > > while (rtcin(RTC_INTR) & RTCIR_PERIOD) { > flag = 1; > - if (--pscnt <= 0) { > - pscnt = psdiv; > #ifdef SMP > - if (smp_started) > - ipi_all_but_self(IPI_STATCLOCK); > -#endif > - statclockintr(frame); > - } else { > -#ifdef SMP > - if (smp_started) > - ipi_all_but_self(IPI_PROFCLOCK); > + if (smp_started) > + ipi_all_but_self(IPI_STATCLOCK); > #endif > - profclockintr(frame); > - } > + statclockintr(frame); > } > return(flag ? FILTER_HANDLED : FILTER_STRAY); > } > @@ -555,6 +512,7 @@ cpu_initclocks() > * timecounter to user a simpler algorithm. > */ > if (using_lapic_timer == LAPIC_CLOCK_NONE) { > + timer1hz = hz; > intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, > NULL, INTR_TYPE_CLK, NULL); > i8254_intsrc = intr_lookup_source(0); > @@ -577,6 +535,7 @@ cpu_initclocks() > if (using_lapic_timer != LAPIC_CLOCK_ALL) { > using_atrtc_timer = tasc; > if (using_atrtc_timer) { > + timer2hz = RTC_NOPROFRATE; > /* Enable periodic interrupts from the RTC. */ > intr_add_handler("rtc", 8, > (driver_filter_t *)rtcintr, NULL, NULL, > @@ -588,6 +547,7 @@ cpu_initclocks() > stathz = hz; > else > stathz = hz / (hz / 128); > + timer2hz = 0; > } > } > > @@ -601,7 +561,7 @@ cpu_startprofclock(void) > if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) > return; > atrtc_rate(RTCSA_PROF); > - psdiv = pscnt = psratio; > + timer2hz = RTC_PROFRATE; > } > > void > @@ -611,7 +571,7 @@ cpu_stopprofclock(void) > if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) > return; > atrtc_rate(RTCSA_NOPROF); > - psdiv = pscnt = 1; > + timer2hz = RTC_NOPROFRATE; > } > > static int > > Modified: head/sys/x86/x86/local_apic.c > ============================================================================== > --- head/sys/x86/x86/local_apic.c Mon May 24 11:14:40 2010 (r208493) > +++ head/sys/x86/x86/local_apic.c Mon May 24 11:40:49 2010 (r208494) > @@ -118,9 +118,6 @@ struct lapic { > u_int la_cluster_id:2; > u_int la_present:1; > u_long *la_timer_count; > - u_long la_hard_ticks; > - u_long la_stat_ticks; > - u_long la_prof_ticks; > /* Include IDT_SYSCALL to make indexing easier. */ > int la_ioint_irqs[APIC_NUM_IOINTS + 1]; > } static lapics[MAX_APIC_ID + 1]; > @@ -493,12 +490,14 @@ lapic_setup_clock(enum lapic_clock srcsd > } else > lapic_timer_hz = hz; > lapic_timer_period = value / lapic_timer_hz; > + timer1hz = lapic_timer_hz; > if (srcsdes == LAPIC_CLOCK_ALL) { > if (lapic_timer_hz < 128) > stathz = lapic_timer_hz; > else > stathz = lapic_timer_hz / (lapic_timer_hz / 128); > profhz = lapic_timer_hz; > + timer2hz = 0; > } > > /* > @@ -790,33 +789,7 @@ lapic_handle_timer(struct trapframe *fra > (*cyclic_clock_func[cpu])(frame); > #endif > > - /* Fire hardclock at hz. */ > - la->la_hard_ticks += hz; > - if (la->la_hard_ticks >= lapic_timer_hz) { > - la->la_hard_ticks -= lapic_timer_hz; > - if (PCPU_GET(cpuid) == 0) > - hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); > - else > - hardclock_cpu(TRAPF_USERMODE(frame)); > - } > - if (clockcoverage == LAPIC_CLOCK_ALL) { > - > - /* Fire statclock at stathz. */ > - la->la_stat_ticks += stathz; > - if (la->la_stat_ticks >= lapic_timer_hz) { > - la->la_stat_ticks -= lapic_timer_hz; > - statclock(TRAPF_USERMODE(frame)); > - } > - > - /* Fire profclock at profhz, but only when needed. */ > - la->la_prof_ticks += profhz; > - if (la->la_prof_ticks >= lapic_timer_hz) { > - la->la_prof_ticks -= lapic_timer_hz; > - if (profprocs != 0) > - profclock(TRAPF_USERMODE(frame), > - TRAPF_PC(frame)); > - } > - } > + timer1clock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); > critical_exit(); > } > -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon May 24 15:12:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6272106567D; Mon, 24 May 2010 15:12:12 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 940F28FC2B; Mon, 24 May 2010 15:12:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OFCCCj035609; Mon, 24 May 2010 15:12:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OFCC9O035607; Mon, 24 May 2010 15:12:12 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005241512.o4OFCC9O035607@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 24 May 2010 15:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208505 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 15:12:12 -0000 Author: jilles Date: Mon May 24 15:12:12 2010 New Revision: 208505 URL: http://svn.freebsd.org/changeset/base/208505 Log: sh(1): Rework documentation of shell variables. * Move the "environment variables" that do not need exporting to be effective or that are set by the shell without exporting to a new section "Special Variables". * Add special variables LINENO and PPID. * Add environment variables LANG, LC_* and PWD; also describe ENV under environment variables. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Mon May 24 14:26:57 2010 (r208504) +++ head/bin/sh/sh.1 Mon May 24 15:12:12 2010 (r208505) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd May 9, 2010 +.Dd May 24, 2010 .Dt SH 1 .Os .Sh NAME @@ -665,11 +665,11 @@ Command names containing a slash are sim performing any searches. .It The shell searches each entry in the -.Ev PATH -environment variable +.Va PATH +variable in turn for the command. The value of the -.Ev PATH +.Va PATH variable should be a series of entries separated by colons. Each entry consists of a @@ -1109,6 +1109,84 @@ pipeline. .It Li $0 (zero) Expands to the name of the shell or shell script. .El +.Ss Special Variables +The following variables are set by the shell or +have special meaning to it: +.Bl -tag -width ".Va HISTSIZE" +.It Va CDPATH +The search path used with the +.Ic cd +built-in. +.It Va EDITOR +The fallback editor used with the +.Ic fc +built-in. +If not set, the default editor is +.Xr ed 1 . +.It Va FCEDIT +The default editor used with the +.Ic fc +built-in. +.It Va HISTSIZE +The number of previous commands that are accessible. +.It Va HOME +The user's home directory, +used in tilde expansion and as a default directory for the +.Ic cd +built-in. +.It Va IFS +Input Field Separators. +This is normally set to +.Aq space , +.Aq tab , +and +.Aq newline . +See the +.Sx White Space Splitting +section for more details. +.It Va LINENO +The current line number in the script or function. +.It Va MAIL +The name of a mail file, that will be checked for the arrival of new +mail. +Overridden by +.Va MAILPATH . +.It Va MAILPATH +A colon +.Pq Ql \&: +separated list of file names, for the shell to check for incoming +mail. +This variable overrides the +.Va MAIL +setting. +There is a maximum of 10 mailboxes that can be monitored at once. +.It Va PATH +The default search path for executables. +See the +.Sx Path Search +section for details. +.It Va PPID +The parent process ID of the invoked shell. +This is set at startup +unless this variable is in the environment. +A later change of parent process ID is not reflected. +A subshell retains the same value of +.Va PPID . +.It Va PS1 +The primary prompt string, which defaults to +.Dq Li "$ " , +unless you are the superuser, in which case it defaults to +.Dq Li "# " . +.It Va PS2 +The secondary prompt string, which defaults to +.Dq Li "> " . +.It Va PS4 +The prefix for the trace output (if +.Fl x +is active). +The default is +.Dq Li "+ " . +.El .Ss Word Expansions This clause describes the various expansions that are performed on words. @@ -1162,7 +1240,7 @@ If the username is missing (as in .Pa ~/foobar ) , the tilde is replaced with the value of the -.Ev HOME +.Va HOME variable (the current user's home directory). .Ss Parameter Expansion The format for parameter expansion is as follows: @@ -1487,10 +1565,10 @@ contains any .Ql / characters, it is used as is. Otherwise, the shell searches the -.Ev PATH +.Va PATH for the file. If it is not found in the -.Ev PATH , +.Va PATH , it is sought in the current working directory. .It Ic \&[ A built-in equivalent of @@ -1534,7 +1612,7 @@ This command is documented in Switch to the specified .Ar directory , or to the directory specified in the -.Ev HOME +.Va HOME environment variable if no .Ar directory is specified. @@ -1545,17 +1623,17 @@ does not begin with or .Pa .. , then the directories listed in the -.Ev CDPATH +.Va CDPATH variable will be searched for the specified .Ar directory . If -.Ev CDPATH +.Va CDPATH is unset, the current directory is searched. The format of -.Ev CDPATH +.Va CDPATH is the same as that of -.Ev PATH . +.Va PATH . In an interactive shell, the .Ic cd @@ -1563,7 +1641,7 @@ command will print out the name of the d that it actually switched to if this is different from the name that the user gave. These may be different either because the -.Ev CDPATH +.Va CDPATH mechanism was used or because a symbolic link was crossed. .Pp If the @@ -1597,7 +1675,7 @@ If the .Fl p option is specified, the command search is performed using a default value of -.Ev PATH +.Va PATH that is guaranteed to find all of the standard utilities. .Pp If the @@ -1756,20 +1834,20 @@ The .Ar editor string is a command name, subject to search via the -.Ev PATH +.Va PATH variable. The value in the -.Ev FCEDIT +.Va FCEDIT variable is used as a default when .Fl e is not specified. If -.Ev FCEDIT +.Va FCEDIT is null or unset, the value of the -.Ev EDITOR +.Va EDITOR variable is used. If -.Ev EDITOR +.Va EDITOR is null or unset, .Xr ed 1 is used as the editor. @@ -1803,7 +1881,7 @@ Re-execute the command without invoking Select the commands to list or edit. The number of previous commands that can be accessed are determined by the value of the -.Ev HISTSIZE +.Va HISTSIZE variable. The value of .Ar first @@ -1834,12 +1912,12 @@ the string form of the first operand can .El .El .Pp -The following environment variables affect the execution of +The following variables affect the execution of .Ic fc : -.Bl -tag -width ".Ev HISTSIZE" -.It Ev FCEDIT +.Bl -tag -width ".Va HISTSIZE" +.It Va FCEDIT Name of the editor to use for history editing. -.It Ev HISTSIZE +.It Va HISTSIZE The number of previous commands that are accessible. .El .It Ic fg Op Ar job @@ -2305,74 +2383,27 @@ command line editing features. .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : -.Bl -tag -width ".Ev HISTSIZE" -.It Ev CDPATH -The search path used with the -.Ic cd -built-in. -.It Ev EDITOR -The fallback editor used with the -.Ic fc -built-in. -If not set, the default editor is -.Xr ed 1 . -.It Ev FCEDIT -The default editor used with the -.Ic fc -built-in. -.It Ev HISTSIZE -The number of previous commands that are accessible. -.It Ev HOME -The starting directory of -.Nm . -.It Ev IFS -Input Field Separators. -This is normally set to -.Aq space , -.Aq tab , -and -.Aq newline . -See the -.Sx White Space Splitting -section for more details. -.It Ev MAIL -The name of a mail file, that will be checked for the arrival of new -mail. -Overridden by -.Ev MAILPATH . -.It Ev MAILPATH -A colon -.Pq Ql \&: -separated list of file names, for the shell to check for incoming -mail. -This environment setting overrides the -.Ev MAIL -setting. -There is a maximum of 10 mailboxes that can be monitored at once. -.It Ev PATH -The default search path for executables. -See the -.Sx Path Search -section for details. -.It Ev PS1 -The primary prompt string, which defaults to -.Dq Li "$ " , -unless you are the superuser, in which case it defaults to -.Dq Li "# " . -.It Ev PS2 -The secondary prompt string, which defaults to -.Dq Li "> " . -.It Ev PS4 -The prefix for the trace output (if -.Fl x -is active). -The default is -.Dq Li "+ " . +.Bl -tag -width ".Ev LANGXXXXXX" +.It Ev ENV +Initialization file for interactive shells. +.It Ev LANG , Ev LC_* +Locale settings. +These are inherited by children of the shell, +and is used in a limited manner by the shell itself. +.It Ev PWD +An absolute pathname for the current directory, +possibly containing symbolic links. +This is used and updated by the shell. .It Ev TERM The default terminal setting for the shell. This is inherited by children of the shell, and is used in the history editing modes. .El +.Pp +Additionally, all environment variables are turned into shell variables +at startup, +which may affect the shell as described under +.Sx Special Variables . .Sh EXIT STATUS Errors that are detected by the shell, such as a syntax error, will cause the shell to exit with a non-zero exit status. From owner-svn-src-head@FreeBSD.ORG Mon May 24 15:20:28 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E12771065674; Mon, 24 May 2010 15:20:28 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from mx.nitro.dk (unknown [77.75.165.90]) by mx1.freebsd.org (Postfix) with ESMTP id A03998FC15; Mon, 24 May 2010 15:20:28 +0000 (UTC) Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3]) by mx.nitro.dk (Postfix) with ESMTP id AD5DA2D4CF0; Mon, 24 May 2010 15:20:27 +0000 (UTC) Received: by arthur.nitro.dk (Postfix, from userid 1000) id A4C7E5C19; Mon, 24 May 2010 17:20:27 +0200 (CEST) Date: Mon, 24 May 2010 17:20:27 +0200 From: "Simon L. Nielsen" To: Marius Strobl Message-ID: <20100524152026.GF1396@arthur.nitro.dk> References: <201005231946.o4NJkJLL072302@svn.freebsd.org> <20100524113941.GA1396@arthur.nitro.dk> <20100524122345.GI68288@alchemy.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100524122345.GI68288@alchemy.franken.de> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208459 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 15:20:29 -0000 On 2010.05.24 14:23:45 +0200, Marius Strobl wrote: > On Mon, May 24, 2010 at 01:39:42PM +0200, Simon L. Nielsen wrote: > > On 2010.05.23 19:46:19 +0000, Marius Strobl wrote: > > > > > New Revision: 208459 > > > > > > Log: > > > Update the sparc64 hardware list regarding machines that will be supported > > > beginning with 8.1-RELEASE as well as correct some existing entries and > > > add previously missed ones. > > > > > > > > - &netra; t1 105 > > > + &sun; &netra; t1 100/105 > > > > If the product is called Netra and you just added the Sun part to > > identify the company it should just be Sun, and not &sun; as you are > > refering to Sun the company and not as part of a trademark. > > > > (It's a bit since I looked at it, but I'm rather sure above ist still > > the case.) > > > > > + Starting with 8.1-RELEASE, &arch.sparc64; systems based on > > > + &fujitsu; &sparc64; V are also supported by &os;, which > > > + includes the following known working systems: > > > > Same here, if you are refering to Fujitsu the company it should not > > include a trademark symbol. > > > > It's kind of hard to think of a case where one would use the name > of a company in a way that doesn't refer to the company but rather > to a trademark when even using "company product" doesn't mean to > refer to it as part of a trademark :) I.e. when would one have to > use the company trademark? Indeed :). I tried a quick check to see where I found the specific examples (which I do remember existing at least at one point) but I couldn't find them now. > In any case, do the attached patches look correct to you? Yes, that looks good - please commit that. (IE, "Approved" with my doc hat.) -- Simon L. Nielsen From owner-svn-src-head@FreeBSD.ORG Mon May 24 15:45:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 268B71065675; Mon, 24 May 2010 15:45:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 135818FC08; Mon, 24 May 2010 15:45:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OFj6fd042928; Mon, 24 May 2010 15:45:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OFj54s042913; Mon, 24 May 2010 15:45:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201005241545.o4OFj54s042913@svn.freebsd.org> From: John Baldwin Date: Mon, 24 May 2010 15:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208507 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 15:45:06 -0000 Author: jhb Date: Mon May 24 15:45:05 2010 New Revision: 208507 URL: http://svn.freebsd.org/changeset/base/208507 Log: Add support for corrected machine check interrupts. CMCI is a new local APIC interrupt that fires when a threshold of corrected machine check events is reached. CMCI also includes a count of events when reporting corrected errors in the bank's status register. Note that individual banks may or may not support CMCI. If they do, each bank includes its own threshold register that determines when the interrupt fires. Currently the code uses a very simple strategy where it doubles the threshold on each interrupt until it succeeds in throttling the interrupt to occur only once a minute (this interval can be tuned via sysctl). The threshold is also adjusted on each hourly poll which will lower the threshold once events stop occurring. Tested by: Sailaja Bangaru sbappana at yahoo com MFC after: 1 month Modified: head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/mca.c head/sys/amd64/include/apicreg.h head/sys/amd64/include/apicvar.h head/sys/amd64/include/mca.h head/sys/amd64/include/pcpu.h head/sys/amd64/include/specialreg.h head/sys/i386/i386/apic_vector.s head/sys/i386/i386/mca.c head/sys/i386/include/apicreg.h head/sys/i386/include/apicvar.h head/sys/i386/include/mca.h head/sys/i386/include/pcpu.h head/sys/i386/include/specialreg.h head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Mon May 24 15:26:40 2010 (r208506) +++ head/sys/amd64/amd64/apic_vector.S Mon May 24 15:45:05 2010 (r208507) @@ -105,6 +105,18 @@ IDTVEC(timerint) jmp doreti /* + * Local APIC CMCI handler. + */ + .text + SUPERALIGN_TEXT +IDTVEC(cmcint) + PUSH_FRAME + FAKE_MCOUNT(TF_RIP(%rsp)) + call lapic_handle_cmc + MEXITCOUNT + jmp doreti + +/* * Local APIC error interrupt handler. */ .text Modified: head/sys/amd64/amd64/mca.c ============================================================================== --- head/sys/amd64/amd64/mca.c Mon May 24 15:26:40 2010 (r208506) +++ head/sys/amd64/amd64/mca.c Mon May 24 15:45:05 2010 (r208507) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -43,11 +45,29 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include +/* Modes for mca_scan() */ +enum scan_mode { + POLLED, + MCE, + CMCI, +}; + +/* + * State maintained for each monitored MCx bank to control the + * corrected machine check interrupt threshold. + */ +struct cmc_state { + int max_threshold; + int last_intr; +}; + struct mca_internal { struct mca_record rec; int logged; @@ -79,19 +99,22 @@ static struct callout mca_timer; static int mca_ticks = 3600; /* Check hourly by default. */ static struct task mca_task; static struct mtx mca_lock; +static struct cmc_state **cmc_state; /* Indexed by cpuid, bank */ +static int cmc_banks; +static int cmc_throttle = 60; /* Time in seconds to throttle CMCI. */ static int -sysctl_mca_ticks(SYSCTL_HANDLER_ARGS) +sysctl_positive_int(SYSCTL_HANDLER_ARGS) { int error, value; - value = mca_ticks; + value = *(int *)arg1; error = sysctl_handle_int(oidp, &value, 0, req); if (error || req->newptr == NULL) return (error); if (value <= 0) return (EINVAL); - mca_ticks = value; + *(int *)arg1 = value; return (0); } @@ -401,31 +424,112 @@ mca_record_entry(const struct mca_record } /* + * Update the interrupt threshold for a CMCI. The strategy is to use + * a low trigger that interrupts as soon as the first event occurs. + * However, if a steady stream of events arrive, the threshold is + * increased until the interrupts are throttled to once every + * cmc_throttle seconds or the periodic scan. If a periodic scan + * finds that the threshold is too high, it is lowered. + */ +static void +cmci_update(enum scan_mode mode, int bank, int valid, struct mca_record *rec) +{ + struct cmc_state *cc; + uint64_t ctl; + u_int delta; + int count, limit; + + /* Fetch the current limit for this bank. */ + cc = &cmc_state[PCPU_GET(cpuid)][bank]; + ctl = rdmsr(MSR_MC_CTL2(bank)); + count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; + delta = (u_int)(ticks - cc->last_intr); + + /* + * If an interrupt was received less than cmc_throttle seconds + * since the previous interrupt and the count from the current + * event is greater than or equal to the current threshold, + * double the threshold up to the max. + */ + if (mode == CMCI && valid) { + limit = ctl & MC_CTL2_THRESHOLD; + if (delta < cmc_throttle && count >= limit && + limit < cc->max_threshold) { + limit = min(limit << 1, cc->max_threshold); + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= limit; + wrmsr(MSR_MC_CTL2(bank), limit); + } + cc->last_intr = ticks; + return; + } + + /* + * When the banks are polled, check to see if the threshold + * should be lowered. + */ + if (mode != POLLED) + return; + + /* If a CMCI occured recently, do nothing for now. */ + if (delta < cmc_throttle) + return; + + /* + * Compute a new limit based on the average rate of events per + * cmc_throttle seconds since the last interrupt. + */ + if (valid) { + count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; + limit = count * cmc_throttle / delta; + if (limit <= 0) + limit = 1; + else if (limit > cc->max_threshold) + limit = cc->max_threshold; + } else + limit = 1; + if ((ctl & MC_CTL2_THRESHOLD) != limit) { + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= limit; + wrmsr(MSR_MC_CTL2(bank), limit); + } +} + +/* * This scans all the machine check banks of the current CPU to see if * there are any machine checks. Any non-recoverable errors are * reported immediately via mca_log(). The current thread must be - * pinned when this is called. The 'mcip' parameter indicates if we - * are being called from the MC exception handler. In that case this - * function returns true if the system is restartable. Otherwise, it - * returns a count of the number of valid MC records found. + * pinned when this is called. The 'mode' parameter indicates if we + * are being called from the MC exception handler, the CMCI handler, + * or the periodic poller. In the MC exception case this function + * returns true if the system is restartable. Otherwise, it returns a + * count of the number of valid MC records found. */ static int -mca_scan(int mcip) +mca_scan(enum scan_mode mode) { struct mca_record rec; uint64_t mcg_cap, ucmask; - int count, i, recoverable; + int count, i, recoverable, valid; count = 0; recoverable = 1; ucmask = MC_STATUS_UC | MC_STATUS_PCC; /* When handling a MCE#, treat the OVER flag as non-restartable. */ - if (mcip) + if (mode == MCE) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - if (mca_check_status(i, &rec)) { + /* + * For a CMCI, only check banks this CPU is + * responsible for. + */ + if (mode == CMCI && !(PCPU_GET(cmci_mask) & 1 << i)) + continue; + + valid = mca_check_status(i, &rec); + if (valid) { count++; if (rec.mr_status & ucmask) { recoverable = 0; @@ -433,8 +537,15 @@ mca_scan(int mcip) } mca_record_entry(&rec); } + + /* + * If this is a bank this CPU monitors via CMCI, + * update the threshold. + */ + if (PCPU_GET(cmci_mask) & (1 << i)) + cmci_update(mode, i, valid, &rec); } - return (mcip ? recoverable : count); + return (mode == MCE ? recoverable : count); } /* @@ -457,7 +568,7 @@ mca_scan_cpus(void *context, int pending continue; sched_bind(td, cpu); thread_unlock(td); - count += mca_scan(0); + count += mca_scan(POLLED); thread_lock(td); sched_unbind(td); } @@ -511,7 +622,24 @@ mca_startup(void *dummy) SYSINIT(mca_startup, SI_SUB_SMP, SI_ORDER_ANY, mca_startup, NULL); static void -mca_setup(void) +cmci_setup(uint64_t mcg_cap) +{ + int i; + + cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state **), + M_MCA, M_WAITOK); + cmc_banks = mcg_cap & MCG_CAP_COUNT; + for (i = 0; i <= mp_maxid; i++) + cmc_state[i] = malloc(sizeof(struct cmc_state) * cmc_banks, + M_MCA, M_WAITOK | M_ZERO); + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, + "cmc_throttle", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + &cmc_throttle, 0, sysctl_positive_int, "I", + "Interval in seconds to throttle corrected MC interrupts"); +} + +static void +mca_setup(uint64_t mcg_cap) { mtx_init(&mca_lock, "mca", NULL, MTX_SPIN); @@ -522,13 +650,62 @@ mca_setup(void) "count", CTLFLAG_RD, &mca_count, 0, "Record count"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "interval", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &mca_ticks, - 0, sysctl_mca_ticks, "I", + 0, sysctl_positive_int, "I", "Periodic interval in seconds to scan for machine checks"); SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "records", CTLFLAG_RD, sysctl_mca_records, "Machine check records"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "force_scan", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, sysctl_mca_scan, "I", "Force an immediate scan for machine checks"); + if (mcg_cap & MCG_CAP_CMCI_P) + cmci_setup(mcg_cap); +} + +/* + * See if we should monitor CMCI for this bank. If CMCI_EN is already + * set in MC_CTL2, then another CPU is responsible for this bank, so + * ignore it. If CMCI_EN returns zero after being set, then this bank + * does not support CMCI_EN. If this CPU sets CMCI_EN, then it should + * now monitor this bank. + */ +static void +cmci_monitor(int i) +{ + struct cmc_state *cc; + uint64_t ctl; + + KASSERT(i < cmc_banks, ("CPU %d has more MC banks", PCPU_GET(cpuid))); + + ctl = rdmsr(MSR_MC_CTL2(i)); + if (ctl & MC_CTL2_CMCI_EN) + /* Already monitored by another CPU. */ + return; + + /* Set the threshold to one event for now. */ + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= MC_CTL2_CMCI_EN | 1; + wrmsr(MSR_MC_CTL2(i), ctl); + ctl = rdmsr(MSR_MC_CTL2(i)); + if (!(ctl & MC_CTL2_CMCI_EN)) + /* This bank does not support CMCI. */ + return; + + cc = &cmc_state[PCPU_GET(cpuid)][i]; + + /* Determine maximum threshold. */ + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= 0x7fff; + wrmsr(MSR_MC_CTL2(i), ctl); + ctl = rdmsr(MSR_MC_CTL2(i)); + cc->max_threshold = ctl & MC_CTL2_THRESHOLD; + + /* Start off with a threshold of 1. */ + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= 1; + wrmsr(MSR_MC_CTL2(i), ctl); + + /* Mark this bank as monitored. */ + PCPU_SET(cmci_mask, PCPU_GET(cmci_mask) | 1 << i); } /* Must be executed on each CPU. */ @@ -554,14 +731,14 @@ mca_init(void) workaround_erratum383 = 1; if (cpu_feature & CPUID_MCA) { - if (PCPU_GET(cpuid) == 0) - mca_setup(); + PCPU_SET(cmci_mask, 0); - sched_pin(); mcg_cap = rdmsr(MSR_MCG_CAP); if (mcg_cap & MCG_CAP_CTL_P) /* Enable MCA features. */ wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); + if (PCPU_GET(cpuid) == 0) + mca_setup(mcg_cap); /* * Disable logging of level one TLB parity (L1TP) errors by @@ -597,10 +774,16 @@ mca_init(void) if (!skip) wrmsr(MSR_MC_CTL(i), ctl); + + if (mcg_cap & MCG_CAP_CMCI_P) + cmci_monitor(i); + /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } - sched_unpin(); + + if (PCPU_GET(cmci_mask) != 0) + lapic_enable_cmc(); } load_cr4(rcr4() | CR4_MCE); @@ -624,7 +807,7 @@ mca_intr(void) } /* Scan the banks and check for any non-recoverable errors. */ - recoverable = mca_scan(1); + recoverable = mca_scan(MCE); mcg_status = rdmsr(MSR_MCG_STATUS); if (!(mcg_status & MCG_STATUS_RIPV)) recoverable = 0; @@ -633,3 +816,31 @@ mca_intr(void) wrmsr(MSR_MCG_STATUS, mcg_status & ~MCG_STATUS_MCIP); return (recoverable); } + +/* Called for a CMCI (correctable machine check interrupt). */ +void +cmc_intr(void) +{ + struct mca_internal *mca; + int count; + + /* + * Serialize MCA bank scanning to prevent collisions from + * sibling threads. + */ + count = mca_scan(CMCI); + + /* If we found anything, log them to the console. */ + if (count != 0) { + mtx_lock_spin(&mca_lock); + STAILQ_FOREACH(mca, &mca_records, link) { + if (!mca->logged) { + mca->logged = 1; + mtx_unlock_spin(&mca_lock); + mca_log(&mca->rec); + mtx_lock_spin(&mca_lock); + } + } + mtx_unlock_spin(&mca_lock); + } +} Modified: head/sys/amd64/include/apicreg.h ============================================================================== --- head/sys/amd64/include/apicreg.h Mon May 24 15:26:40 2010 (r208506) +++ head/sys/amd64/include/apicreg.h Mon May 24 15:45:05 2010 (r208507) @@ -89,7 +89,7 @@ * 2C0 Reserved * 2D0 Reserved * 2E0 Reserved - * 2F0 Reserved + * 2F0 Local Vector Table (CMCI) R/W * 300 ICR_LOW Interrupt Command Reg. (0-31) R/W * 310 ICR_HI Interrupt Command Reg. (32-63) R/W * 320 Local Vector Table (Timer) R/W @@ -172,7 +172,7 @@ struct LAPIC { /* reserved */ PAD4; /* reserved */ PAD4; /* reserved */ PAD4; - /* reserved */ PAD4; + u_int32_t lvt_cmci; PAD3; u_int32_t icr_lo; PAD3; u_int32_t icr_hi; PAD3; u_int32_t lvt_timer; PAD3; Modified: head/sys/amd64/include/apicvar.h ============================================================================== --- head/sys/amd64/include/apicvar.h Mon May 24 15:26:40 2010 (r208506) +++ head/sys/amd64/include/apicvar.h Mon May 24 15:45:05 2010 (r208507) @@ -108,8 +108,9 @@ #define APIC_LOCAL_INTS 240 #define APIC_ERROR_INT APIC_LOCAL_INTS #define APIC_THERMAL_INT (APIC_LOCAL_INTS + 1) +#define APIC_CMC_INT (APIC_LOCAL_INTS + 2) -#define APIC_IPI_INTS (APIC_LOCAL_INTS + 2) +#define APIC_IPI_INTS (APIC_LOCAL_INTS + 3) #define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */ #define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */ #define IPI_INVLPG (APIC_IPI_INTS + 2) @@ -142,7 +143,8 @@ #define LVT_ERROR 3 #define LVT_PMC 4 #define LVT_THERMAL 5 -#define LVT_MAX LVT_THERMAL +#define LVT_CMCI 6 +#define LVT_MAX LVT_CMCI #ifndef LOCORE @@ -178,8 +180,8 @@ struct apic_enumerator { inthand_t IDTVEC(apic_isr1), IDTVEC(apic_isr2), IDTVEC(apic_isr3), IDTVEC(apic_isr4), IDTVEC(apic_isr5), IDTVEC(apic_isr6), - IDTVEC(apic_isr7), IDTVEC(errorint), IDTVEC(spuriousint), - IDTVEC(timerint); + IDTVEC(apic_isr7), IDTVEC(cmcint), IDTVEC(errorint), + IDTVEC(spuriousint), IDTVEC(timerint); extern vm_paddr_t lapic_paddr; extern int apic_cpuids[]; @@ -209,6 +211,7 @@ void lapic_create(u_int apic_id, int boo void lapic_disable(void); void lapic_disable_pmc(void); void lapic_dump(const char *str); +void lapic_enable_cmc(void); int lapic_enable_pmc(void); void lapic_eoi(void); int lapic_id(void); @@ -217,6 +220,7 @@ int lapic_intr_pending(u_int vector); void lapic_ipi_raw(register_t icrlo, u_int dest); void lapic_ipi_vectored(u_int vector, int dest); int lapic_ipi_wait(int delay); +void lapic_handle_cmc(void); void lapic_handle_error(void); void lapic_handle_intr(int vector, struct trapframe *frame); void lapic_handle_timer(struct trapframe *frame); Modified: head/sys/amd64/include/mca.h ============================================================================== --- head/sys/amd64/include/mca.h Mon May 24 15:26:40 2010 (r208506) +++ head/sys/amd64/include/mca.h Mon May 24 15:45:05 2010 (r208507) @@ -46,6 +46,7 @@ struct mca_record { #ifdef _KERNEL +void cmc_intr(void); void mca_init(void); int mca_intr(void); Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Mon May 24 15:26:40 2010 (r208506) +++ head/sys/amd64/include/pcpu.h Mon May 24 15:45:05 2010 (r208507) @@ -75,7 +75,8 @@ /* Pointer to the CPU LDT descriptor */ \ struct system_segment_descriptor *pc_ldt; \ /* Pointer to the CPU TSS descriptor */ \ - struct system_segment_descriptor *pc_tss \ + struct system_segment_descriptor *pc_tss; \ + u_int pc_cmci_mask /* MCx banks for CMCI */ \ PCPU_XEN_FIELDS #ifdef _KERNEL Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Mon May 24 15:26:40 2010 (r208506) +++ head/sys/amd64/include/specialreg.h Mon May 24 15:45:05 2010 (r208507) @@ -385,7 +385,7 @@ #define MC_STATUS_VAL 0x8000000000000000 #define MC_MISC_RA_LSB 0x000000000000003f /* If MCG_CAP_SER_P */ #define MC_MISC_ADDRESS_MODE 0x00000000000001c0 /* If MCG_CAP_SER_P */ -#define MC_CTL2_THRESHOLD 0x0000000000003fff +#define MC_CTL2_THRESHOLD 0x0000000000007fff #define MC_CTL2_CMCI_EN 0x0000000040000000 /* Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Mon May 24 15:26:40 2010 (r208506) +++ head/sys/i386/i386/apic_vector.s Mon May 24 15:45:05 2010 (r208507) @@ -111,6 +111,19 @@ IDTVEC(timerint) jmp doreti /* + * Local APIC CMCI handler. + */ + .text + SUPERALIGN_TEXT +IDTVEC(cmcint) + PUSH_FRAME + SET_KERNEL_SREGS + FAKE_MCOUNT(TF_EIP(%esp)) + call lapic_handle_cmc + MEXITCOUNT + jmp doreti + +/* * Local APIC error interrupt handler. */ .text Modified: head/sys/i386/i386/mca.c ============================================================================== --- head/sys/i386/i386/mca.c Mon May 24 15:26:40 2010 (r208506) +++ head/sys/i386/i386/mca.c Mon May 24 15:45:05 2010 (r208507) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -43,11 +45,29 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include +/* Modes for mca_scan() */ +enum scan_mode { + POLLED, + MCE, + CMCI, +}; + +/* + * State maintained for each monitored MCx bank to control the + * corrected machine check interrupt threshold. + */ +struct cmc_state { + int max_threshold; + int last_intr; +}; + struct mca_internal { struct mca_record rec; int logged; @@ -79,19 +99,22 @@ static struct callout mca_timer; static int mca_ticks = 3600; /* Check hourly by default. */ static struct task mca_task; static struct mtx mca_lock; +static struct cmc_state **cmc_state; /* Indexed by cpuid, bank */ +static int cmc_banks; +static int cmc_throttle = 60; /* Time in seconds to throttle CMCI. */ static int -sysctl_mca_ticks(SYSCTL_HANDLER_ARGS) +sysctl_positive_int(SYSCTL_HANDLER_ARGS) { int error, value; - value = mca_ticks; + value = *(int *)arg1; error = sysctl_handle_int(oidp, &value, 0, req); if (error || req->newptr == NULL) return (error); if (value <= 0) return (EINVAL); - mca_ticks = value; + *(int *)arg1 = value; return (0); } @@ -401,31 +424,112 @@ mca_record_entry(const struct mca_record } /* + * Update the interrupt threshold for a CMCI. The strategy is to use + * a low trigger that interrupts as soon as the first event occurs. + * However, if a steady stream of events arrive, the threshold is + * increased until the interrupts are throttled to once every + * cmc_throttle seconds or the periodic scan. If a periodic scan + * finds that the threshold is too high, it is lowered. + */ +static void +cmci_update(enum scan_mode mode, int bank, int valid, struct mca_record *rec) +{ + struct cmc_state *cc; + uint64_t ctl; + u_int delta; + int count, limit; + + /* Fetch the current limit for this bank. */ + cc = &cmc_state[PCPU_GET(cpuid)][bank]; + ctl = rdmsr(MSR_MC_CTL2(bank)); + count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; + delta = (u_int)(ticks - cc->last_intr); + + /* + * If an interrupt was received less than cmc_throttle seconds + * since the previous interrupt and the count from the current + * event is greater than or equal to the current threshold, + * double the threshold up to the max. + */ + if (mode == CMCI && valid) { + limit = ctl & MC_CTL2_THRESHOLD; + if (delta < cmc_throttle && count >= limit && + limit < cc->max_threshold) { + limit = min(limit << 1, cc->max_threshold); + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= limit; + wrmsr(MSR_MC_CTL2(bank), limit); + } + cc->last_intr = ticks; + return; + } + + /* + * When the banks are polled, check to see if the threshold + * should be lowered. + */ + if (mode != POLLED) + return; + + /* If a CMCI occured recently, do nothing for now. */ + if (delta < cmc_throttle) + return; + + /* + * Compute a new limit based on the average rate of events per + * cmc_throttle seconds since the last interrupt. + */ + if (valid) { + count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; + limit = count * cmc_throttle / delta; + if (limit <= 0) + limit = 1; + else if (limit > cc->max_threshold) + limit = cc->max_threshold; + } else + limit = 1; + if ((ctl & MC_CTL2_THRESHOLD) != limit) { + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= limit; + wrmsr(MSR_MC_CTL2(bank), limit); + } +} + +/* * This scans all the machine check banks of the current CPU to see if * there are any machine checks. Any non-recoverable errors are * reported immediately via mca_log(). The current thread must be - * pinned when this is called. The 'mcip' parameter indicates if we - * are being called from the MC exception handler. In that case this - * function returns true if the system is restartable. Otherwise, it - * returns a count of the number of valid MC records found. + * pinned when this is called. The 'mode' parameter indicates if we + * are being called from the MC exception handler, the CMCI handler, + * or the periodic poller. In the MC exception case this function + * returns true if the system is restartable. Otherwise, it returns a + * count of the number of valid MC records found. */ static int -mca_scan(int mcip) +mca_scan(enum scan_mode mode) { struct mca_record rec; uint64_t mcg_cap, ucmask; - int count, i, recoverable; + int count, i, recoverable, valid; count = 0; recoverable = 1; ucmask = MC_STATUS_UC | MC_STATUS_PCC; /* When handling a MCE#, treat the OVER flag as non-restartable. */ - if (mcip) + if (mode == MCE) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - if (mca_check_status(i, &rec)) { + /* + * For a CMCI, only check banks this CPU is + * responsible for. + */ + if (mode == CMCI && !(PCPU_GET(cmci_mask) & 1 << i)) + continue; + + valid = mca_check_status(i, &rec); + if (valid) { count++; if (rec.mr_status & ucmask) { recoverable = 0; @@ -433,8 +537,15 @@ mca_scan(int mcip) } mca_record_entry(&rec); } + + /* + * If this is a bank this CPU monitors via CMCI, + * update the threshold. + */ + if (PCPU_GET(cmci_mask) & (1 << i)) + cmci_update(mode, i, valid, &rec); } - return (mcip ? recoverable : count); + return (mode == MCE ? recoverable : count); } /* @@ -457,7 +568,7 @@ mca_scan_cpus(void *context, int pending continue; sched_bind(td, cpu); thread_unlock(td); - count += mca_scan(0); + count += mca_scan(POLLED); thread_lock(td); sched_unbind(td); } @@ -511,7 +622,24 @@ mca_startup(void *dummy) SYSINIT(mca_startup, SI_SUB_SMP, SI_ORDER_ANY, mca_startup, NULL); static void -mca_setup(void) +cmci_setup(uint64_t mcg_cap) +{ + int i; + + cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state **), + M_MCA, M_WAITOK); + cmc_banks = mcg_cap & MCG_CAP_COUNT; + for (i = 0; i <= mp_maxid; i++) + cmc_state[i] = malloc(sizeof(struct cmc_state) * cmc_banks, + M_MCA, M_WAITOK | M_ZERO); + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, + "cmc_throttle", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + &cmc_throttle, 0, sysctl_positive_int, "I", + "Interval in seconds to throttle corrected MC interrupts"); +} + +static void +mca_setup(uint64_t mcg_cap) { mtx_init(&mca_lock, "mca", NULL, MTX_SPIN); @@ -522,13 +650,62 @@ mca_setup(void) "count", CTLFLAG_RD, &mca_count, 0, "Record count"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "interval", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &mca_ticks, - 0, sysctl_mca_ticks, "I", + 0, sysctl_positive_int, "I", "Periodic interval in seconds to scan for machine checks"); SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "records", CTLFLAG_RD, sysctl_mca_records, "Machine check records"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "force_scan", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, sysctl_mca_scan, "I", "Force an immediate scan for machine checks"); + if (mcg_cap & MCG_CAP_CMCI_P) + cmci_setup(mcg_cap); +} + +/* + * See if we should monitor CMCI for this bank. If CMCI_EN is already + * set in MC_CTL2, then another CPU is responsible for this bank, so + * ignore it. If CMCI_EN returns zero after being set, then this bank + * does not support CMCI_EN. If this CPU sets CMCI_EN, then it should + * now monitor this bank. + */ +static void +cmci_monitor(int i) +{ + struct cmc_state *cc; + uint64_t ctl; + + KASSERT(i < cmc_banks, ("CPU %d has more MC banks", PCPU_GET(cpuid))); + + ctl = rdmsr(MSR_MC_CTL2(i)); + if (ctl & MC_CTL2_CMCI_EN) + /* Already monitored by another CPU. */ + return; + + /* Set the threshold to one event for now. */ + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= MC_CTL2_CMCI_EN | 1; + wrmsr(MSR_MC_CTL2(i), ctl); + ctl = rdmsr(MSR_MC_CTL2(i)); + if (!(ctl & MC_CTL2_CMCI_EN)) + /* This bank does not support CMCI. */ + return; + + cc = &cmc_state[PCPU_GET(cpuid)][i]; + + /* Determine maximum threshold. */ + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= 0x7fff; + wrmsr(MSR_MC_CTL2(i), ctl); + ctl = rdmsr(MSR_MC_CTL2(i)); + cc->max_threshold = ctl & MC_CTL2_THRESHOLD; + + /* Start off with a threshold of 1. */ + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= 1; + wrmsr(MSR_MC_CTL2(i), ctl); + + /* Mark this bank as monitored. */ + PCPU_SET(cmci_mask, PCPU_GET(cmci_mask) | 1 << i); } /* Must be executed on each CPU. */ @@ -554,14 +731,14 @@ mca_init(void) workaround_erratum383 = 1; if (cpu_feature & CPUID_MCA) { - if (PCPU_GET(cpuid) == 0) - mca_setup(); + PCPU_SET(cmci_mask, 0); - sched_pin(); mcg_cap = rdmsr(MSR_MCG_CAP); if (mcg_cap & MCG_CAP_CTL_P) /* Enable MCA features. */ wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); + if (PCPU_GET(cpuid) == 0) + mca_setup(mcg_cap); /* * Disable logging of level one TLB parity (L1TP) errors by @@ -597,10 +774,16 @@ mca_init(void) if (!skip) wrmsr(MSR_MC_CTL(i), ctl); + + if (mcg_cap & MCG_CAP_CMCI_P) + cmci_monitor(i); + /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } - sched_unpin(); + + if (PCPU_GET(cmci_mask) != 0) + lapic_enable_cmc(); } load_cr4(rcr4() | CR4_MCE); @@ -624,7 +807,7 @@ mca_intr(void) } /* Scan the banks and check for any non-recoverable errors. */ - recoverable = mca_scan(1); + recoverable = mca_scan(MCE); mcg_status = rdmsr(MSR_MCG_STATUS); if (!(mcg_status & MCG_STATUS_RIPV)) recoverable = 0; @@ -633,3 +816,31 @@ mca_intr(void) wrmsr(MSR_MCG_STATUS, mcg_status & ~MCG_STATUS_MCIP); return (recoverable); } + +/* Called for a CMCI (correctable machine check interrupt). */ +void +cmc_intr(void) +{ + struct mca_internal *mca; + int count; + + /* + * Serialize MCA bank scanning to prevent collisions from + * sibling threads. + */ + count = mca_scan(CMCI); + + /* If we found anything, log them to the console. */ + if (count != 0) { + mtx_lock_spin(&mca_lock); + STAILQ_FOREACH(mca, &mca_records, link) { + if (!mca->logged) { + mca->logged = 1; + mtx_unlock_spin(&mca_lock); + mca_log(&mca->rec); + mtx_lock_spin(&mca_lock); + } + } + mtx_unlock_spin(&mca_lock); + } +} Modified: head/sys/i386/include/apicreg.h ============================================================================== --- head/sys/i386/include/apicreg.h Mon May 24 15:26:40 2010 (r208506) +++ head/sys/i386/include/apicreg.h Mon May 24 15:45:05 2010 (r208507) @@ -89,7 +89,7 @@ * 2C0 Reserved * 2D0 Reserved * 2E0 Reserved - * 2F0 Reserved + * 2F0 Local Vector Table (CMCI) R/W * 300 ICR_LOW Interrupt Command Reg. (0-31) R/W * 310 ICR_HI Interrupt Command Reg. (32-63) R/W * 320 Local Vector Table (Timer) R/W @@ -172,7 +172,7 @@ struct LAPIC { /* reserved */ PAD4; /* reserved */ PAD4; /* reserved */ PAD4; - /* reserved */ PAD4; + u_int32_t lvt_cmci; PAD3; u_int32_t icr_lo; PAD3; u_int32_t icr_hi; PAD3; u_int32_t lvt_timer; PAD3; Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Mon May 24 15:26:40 2010 (r208506) +++ head/sys/i386/include/apicvar.h Mon May 24 15:45:05 2010 (r208507) @@ -108,7 +108,8 @@ #define APIC_LOCAL_INTS 240 #define APIC_ERROR_INT APIC_LOCAL_INTS #define APIC_THERMAL_INT (APIC_LOCAL_INTS + 1) -#define APIC_IPI_INTS (APIC_LOCAL_INTS + 2) +#define APIC_CMC_INT (APIC_LOCAL_INTS + 2) +#define APIC_IPI_INTS (APIC_LOCAL_INTS + 3) #define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */ #define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */ @@ -135,7 +136,8 @@ #define APIC_LOCAL_INTS 240 #define APIC_ERROR_INT APIC_LOCAL_INTS #define APIC_THERMAL_INT (APIC_LOCAL_INTS + 1) -#define APIC_IPI_INTS (APIC_LOCAL_INTS + 2) +#define APIC_CMC_INT (APIC_LOCAL_INTS + 2) +#define APIC_IPI_INTS (APIC_LOCAL_INTS + 3) #define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */ #define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */ @@ -170,7 +172,8 @@ #define LVT_ERROR 3 #define LVT_PMC 4 #define LVT_THERMAL 5 -#define LVT_MAX LVT_THERMAL +#define LVT_CMCI 6 +#define LVT_MAX LVT_CMCI #ifndef LOCORE @@ -206,8 +209,8 @@ struct apic_enumerator { inthand_t IDTVEC(apic_isr1), IDTVEC(apic_isr2), IDTVEC(apic_isr3), IDTVEC(apic_isr4), IDTVEC(apic_isr5), IDTVEC(apic_isr6), - IDTVEC(apic_isr7), IDTVEC(errorint), IDTVEC(spuriousint), - IDTVEC(timerint); + IDTVEC(apic_isr7), IDTVEC(cmcint), IDTVEC(errorint), + IDTVEC(spuriousint), IDTVEC(timerint); extern vm_paddr_t lapic_paddr; extern int apic_cpuids[]; @@ -237,6 +240,7 @@ void lapic_create(u_int apic_id, int boo void lapic_disable(void); void lapic_disable_pmc(void); void lapic_dump(const char *str); +void lapic_enable_cmc(void); int lapic_enable_pmc(void); void lapic_eoi(void); int lapic_id(void); @@ -245,6 +249,7 @@ int lapic_intr_pending(u_int vector); void lapic_ipi_raw(register_t icrlo, u_int dest); void lapic_ipi_vectored(u_int vector, int dest); int lapic_ipi_wait(int delay); +void lapic_handle_cmc(void); void lapic_handle_error(void); void lapic_handle_intr(int vector, struct trapframe *frame); void lapic_handle_timer(struct trapframe *frame); Modified: head/sys/i386/include/mca.h ============================================================================== --- head/sys/i386/include/mca.h Mon May 24 15:26:40 2010 (r208506) +++ head/sys/i386/include/mca.h Mon May 24 15:45:05 2010 (r208507) @@ -46,6 +46,7 @@ struct mca_record { #ifdef _KERNEL +void cmc_intr(void); void mca_init(void); int mca_intr(void); Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Mon May 24 15:26:40 2010 (r208506) +++ head/sys/i386/include/pcpu.h Mon May 24 15:45:05 2010 (r208507) @@ -76,6 +76,7 @@ struct shadow_time_info { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon May 24 16:06:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC9291065672; Mon, 24 May 2010 16:06:55 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id B2F188FC1E; Mon, 24 May 2010 16:06:54 +0000 (UTC) Received: by fxm4 with SMTP id 4so3406993fxm.13 for ; Mon, 24 May 2010 09:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=kkxZMg3bmN8XMDhrIh5838f7nRr90ha+Gh+OBZKfg0o=; b=LkcgLXjSdkUYW39UehLS4LzXikJknwRrrYYqIR/8maHNCIRLpNcc+6ePHjY7QE+mQJ YHiKSmZ6aKss/14X7cDde2G6GX6PDAjt7hDWVjjbacqoLeQv++2lQylk90JiEhsEHRU/ RhHxNAEV5KTAnvz82W+LNATg3XLEzzqbTVE1w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=ntn5I0O5X0S1g89pwyZOHTMFB7CXIJ3hqBNfB1pLM+fzGuCudKnOLGM21qwtNuN6al z2+OxndvAAJ+ePXvGQmS+KFzsJkdLfJG1UzmFE3pJSamno0BwPLePSBvz9rMErOtBtIU uKy7Zw40F3po6v68DPReW1ObWcyfxJqcWcWxk= Received: by 10.223.67.144 with SMTP id r16mr4841956fai.102.1274717213599; Mon, 24 May 2010 09:06:53 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id j23sm20179637faa.2.2010.05.24.09.06.51 (version=SSLv3 cipher=RC4-MD5); Mon, 24 May 2010 09:06:52 -0700 (PDT) Sender: Alexander Motin Message-ID: <4BFAA409.4040008@FreeBSD.org> Date: Mon, 24 May 2010 19:06:33 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Andriy Gapon References: <201005241140.o4OBeova088506@svn.freebsd.org> <4BFA8F22.6040402@freebsd.org> In-Reply-To: <4BFA8F22.6040402@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208494 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 16:06:55 -0000 Andriy Gapon wrote: > on 24/05/2010 14:40 Alexander Motin said the following: >> Author: mav >> Date: Mon May 24 11:40:49 2010 >> New Revision: 208494 >> URL: http://svn.freebsd.org/changeset/base/208494 >> >> Log: >> - Implement MI helper functions, dividing one or two timer interrupts with >> arbitrary frequencies into hardclock(), statclock() and profclock() calls. >> Same code with minor variations duplicated several times over the tree for >> different timer drivers and architectures. >> - Switch all x86 archs to new functions, simplifying the code and removing >> extra logic from timer drivers. Other archs are also welcome. > > could you please describe the new code/KPI in greater detail, perhaps on a more > appropriate mailing list? Sent some summary to arch@. > For me it is not immediately obvious why IPI_PROFCLOCK is gone now. I haven't > spent much time reverse engineering this change and perhaps it's easier for you > to describe the change. IPI_PROFCLOCK is not used any more. Separation between statclock() and profclock() now handled in common machine-independent code. Timer driver generates interrupts, MD code manages timers configuration and events redistribution to every CPU, using up to two IPIs if needed, MI code do the rest of things. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon May 24 16:18:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACDA81065674; Mon, 24 May 2010 16:18:16 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4F6018FC12; Mon, 24 May 2010 16:18:14 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA04482; Mon, 24 May 2010 19:18:13 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OGaM1-000Byz-EZ; Mon, 24 May 2010 19:18:13 +0300 Message-ID: <4BFAA6C4.3040706@freebsd.org> Date: Mon, 24 May 2010 19:18:12 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: Alexander Motin References: <201005241140.o4OBeova088506@svn.freebsd.org> <4BFA8F22.6040402@freebsd.org> <4BFAA409.4040008@FreeBSD.org> In-Reply-To: <4BFAA409.4040008@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208494 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 16:18:16 -0000 on 24/05/2010 19:06 Alexander Motin said the following: > Andriy Gapon wrote: >> on 24/05/2010 14:40 Alexander Motin said the following: >>> Author: mav >>> Date: Mon May 24 11:40:49 2010 >>> New Revision: 208494 >>> URL: http://svn.freebsd.org/changeset/base/208494 >>> >>> Log: >>> - Implement MI helper functions, dividing one or two timer interrupts with >>> arbitrary frequencies into hardclock(), statclock() and profclock() calls. >>> Same code with minor variations duplicated several times over the tree for >>> different timer drivers and architectures. >>> - Switch all x86 archs to new functions, simplifying the code and removing >>> extra logic from timer drivers. Other archs are also welcome. >> could you please describe the new code/KPI in greater detail, perhaps on a more >> appropriate mailing list? > > Sent some summary to arch@. Thanks! >> For me it is not immediately obvious why IPI_PROFCLOCK is gone now. I haven't >> spent much time reverse engineering this change and perhaps it's easier for you >> to describe the change. > > IPI_PROFCLOCK is not used any more. Separation between statclock() and > profclock() now handled in common machine-independent code. Timer driver > generates interrupts, MD code manages timers configuration and events > redistribution to every CPU, using up to two IPIs if needed, MI code do > the rest of things. Thank you for the explanation. BTW, with e.g. HPET we may consider using a separate clock for profiling, but I am not sure. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon May 24 16:27:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1541106566C; Mon, 24 May 2010 16:27:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E01EE8FC12; Mon, 24 May 2010 16:27:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OGRlP4052363; Mon, 24 May 2010 16:27:47 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OGRlLV052361; Mon, 24 May 2010 16:27:47 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201005241627.o4OGRlLV052361@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 24 May 2010 16:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208508 - head/sys/netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 16:27:48 -0000 Author: bz Date: Mon May 24 16:27:47 2010 New Revision: 208508 URL: http://svn.freebsd.org/changeset/base/208508 Log: MFp4 @178283: Improve IPsec flow distribution for better netisr parallelism. Instead of using the pointer that would have the last bits masked in a % statement in netisr_select_cpuid() to select the queue, use the SPI. Reviewed by: rwatson MFC after: 4 weeks Modified: head/sys/netipsec/ipsec_input.c Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Mon May 24 15:45:05 2010 (r208507) +++ head/sys/netipsec/ipsec_input.c Mon May 24 16:27:47 2010 (r208508) @@ -489,7 +489,7 @@ ipsec4_common_input_cb(struct mbuf *m, s /* * Re-dispatch via software interrupt. */ - if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav, m))) { + if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav->spi, m))) { IPSEC_ISTAT(sproto, V_espstat.esps_qfull, V_ahstat.ahs_qfull, V_ipcompstat.ipcomps_qfull); From owner-svn-src-head@FreeBSD.ORG Mon May 24 16:41:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39DE9106566C; Mon, 24 May 2010 16:41:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 280748FC1D; Mon, 24 May 2010 16:41:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OGf6LG055313; Mon, 24 May 2010 16:41:06 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OGf6n4055308; Mon, 24 May 2010 16:41:06 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201005241641.o4OGf6n4055308@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 24 May 2010 16:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208509 - in head: share/man/man4 sys/ddb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 16:41:06 -0000 Author: bz Date: Mon May 24 16:41:05 2010 New Revision: 208509 URL: http://svn.freebsd.org/changeset/base/208509 Log: MFp4 @178364: Implement an optional delay to the ddb reset/reboot command. This allows textdumps to be run automatically with unattended reboots after a resonable timeout, while still permitting an administrator to break into debugger if attached to the console at the time of the event for further debugging. Cap the maximum delay at 1 week to avoid highly accidental results, and default to 15s in case of problems parsing the timeout value. Move hex2dec helper function from db_thread.c to db_command.c to make it generally available and prefix it with a "db_" to avoid namespace collisions. Reviewed by: rwatson MFC after: 4 weeks Modified: head/share/man/man4/ddb.4 head/sys/ddb/db_command.c head/sys/ddb/db_command.h head/sys/ddb/db_thread.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Mon May 24 16:27:47 2010 (r208508) +++ head/share/man/man4/ddb.4 Mon May 24 16:41:05 2010 (r208509) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2008 +.Dd May 24, 2010 .Dt DDB 4 .Os .Sh NAME @@ -1092,9 +1092,13 @@ for a list of signals. Note that the arguments are reversed relative to .Xr kill 2 . .Pp -.It Ic reboot -.It Ic reset +.It Ic reboot Op Ar seconds +.It Ic reset Op Ar seconds Hard reset the system. +If the optional argument +.Ar seconds +is given, the debugger will wait for this long, at most a week, +before rebooting. .Pp .It Ic help Print a short summary of the available commands and command Modified: head/sys/ddb/db_command.c ============================================================================== --- head/sys/ddb/db_command.c Mon May 24 16:27:47 2010 (r208508) +++ head/sys/ddb/db_command.c Mon May 24 16:41:05 2010 (r208509) @@ -661,13 +661,42 @@ out: #undef DB_ERROR } +/* + * Reboot. In case there is an additional argument, take it as delay in + * seconds. Default to 15s if we cannot parse it and make sure we will + * never wait longer than 1 week. Some code is similar to + * kern_shutdown.c:shutdown_panic(). + */ +#ifndef DB_RESET_MAXDELAY +#define DB_RESET_MAXDELAY (3600 * 24 * 7) +#endif + static void -db_reset(dummy1, dummy2, dummy3, dummy4) - db_expr_t dummy1; - boolean_t dummy2; - db_expr_t dummy3; - char * dummy4; +db_reset(db_expr_t addr, boolean_t have_addr, db_expr_t count __unused, + char *modif __unused) { + int delay, loop; + + if (have_addr) { + delay = (int)db_hex2dec(addr); + + /* If we parse to fail, use 15s. */ + if (delay == -1) + delay = 15; + + /* Cap at one week. */ + if ((uintmax_t)delay > (uintmax_t)DB_RESET_MAXDELAY) + delay = DB_RESET_MAXDELAY; + + db_printf("Automatic reboot in %d seconds - " + "press a key on the console to abort\n", delay); + for (loop = delay * 10; loop > 0; --loop) { + DELAY(1000 * 100); /* 1/10th second */ + /* Did user type a key? */ + if (cncheckc() != -1) + return; + } + } cpu_reset(); } @@ -771,3 +800,28 @@ db_stack_trace_all(db_expr_t dummy, bool kdb_jmpbuf(prev_jb); } } + +/* + * Take the parsed expression value from the command line that was parsed + * as a hexadecimal value and convert it as if the expression was parsed + * as a decimal value. Returns -1 if the expression was not a valid + * decimal value. + */ +db_expr_t +db_hex2dec(db_expr_t expr) +{ + uintptr_t x, y; + db_expr_t val; + + y = 1; + val = 0; + x = expr; + while (x != 0) { + if (x % 16 > 9) + return (-1); + val += (x % 16) * (y); + x >>= 4; + y *= 10; + } + return (val); +} Modified: head/sys/ddb/db_command.h ============================================================================== --- head/sys/ddb/db_command.h Mon May 24 16:27:47 2010 (r208508) +++ head/sys/ddb/db_command.h Mon May 24 16:41:05 2010 (r208509) @@ -33,6 +33,12 @@ * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 */ + +/* + * Helper functions. + */ +db_expr_t db_hex2dec(db_expr_t expr); + /* * Command loop declarations. */ Modified: head/sys/ddb/db_thread.c ============================================================================== --- head/sys/ddb/db_thread.c Mon May 24 16:27:47 2010 (r208508) +++ head/sys/ddb/db_thread.c Mon May 24 16:41:05 2010 (r208509) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -static db_expr_t hex2dec(db_expr_t expr); - void db_print_thread(void) { @@ -108,31 +106,6 @@ db_show_threads(db_expr_t addr, boolean_ } /* - * Take the parsed expression value from the command line that was parsed - * as a hexadecimal value and convert it as if the expression was parsed - * as a decimal value. Returns -1 if the expression was not a valid - * decimal value. - */ -static db_expr_t -hex2dec(db_expr_t expr) -{ - uintptr_t x, y; - db_expr_t val; - - y = 1; - val = 0; - x = expr; - while (x != 0) { - if (x % 16 > 9) - return (-1); - val += (x % 16) * (y); - x >>= 4; - y *= 10; - } - return (val); -} - -/* * Lookup a thread based on a db expression address. We assume that the * address was parsed in hexadecimal. We reparse the address in decimal * first and try to treat it as a thread ID to find an associated thread. @@ -151,7 +124,7 @@ db_lookup_thread(db_expr_t addr, boolean * If the parsed address was not a valid decimal expression, * assume it is a thread pointer. */ - decaddr = hex2dec(addr); + decaddr = db_hex2dec(addr); if (decaddr == -1) return ((struct thread *)addr); @@ -183,7 +156,7 @@ db_lookup_proc(db_expr_t addr) db_expr_t decaddr; struct proc *p; - decaddr = hex2dec(addr); + decaddr = db_hex2dec(addr); if (decaddr != -1) { FOREACH_PROC_IN_SYSTEM(p) { if (p->p_pid == decaddr) From owner-svn-src-head@FreeBSD.ORG Mon May 24 16:42:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 695961065672; Mon, 24 May 2010 16:42:53 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 587568FC12; Mon, 24 May 2010 16:42:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OGgrIE055752; Mon, 24 May 2010 16:42:53 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OGgrBQ055750; Mon, 24 May 2010 16:42:53 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201005241642.o4OGgrBQ055750@svn.freebsd.org> From: Sean Bruno Date: Mon, 24 May 2010 16:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208510 - head/usr.sbin/iostat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 16:42:53 -0000 Author: sbruno Date: Mon May 24 16:42:53 2010 New Revision: 208510 URL: http://svn.freebsd.org/changeset/base/208510 Log: Cleanup manpage as suggested by jhb@ to start new sentences on a new line. MFC after: 2 Weeks Modified: head/usr.sbin/iostat/iostat.8 Modified: head/usr.sbin/iostat/iostat.8 ============================================================================== --- head/usr.sbin/iostat/iostat.8 Mon May 24 16:41:05 2010 (r208509) +++ head/usr.sbin/iostat/iostat.8 Mon May 24 16:42:53 2010 (r208510) @@ -241,9 +241,9 @@ If no repeat is specified, the default is infinity. The .Nm -command will accept and honor a non-integer number of seconds. Note that -the interval only has millisecond granularity. Smaller values will be -truncated. +command will accept and honor a non-integer number of seconds. +Note that the interval only has millisecond granularity. +Smaller values will be truncated. .Pp e.g. -w1.0001 becomes -w1.000 .Pp From owner-svn-src-head@FreeBSD.ORG Mon May 24 16:42:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC84E106564A; Mon, 24 May 2010 16:42:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAA428FC0A; Mon, 24 May 2010 16:42:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OGgth3055788; Mon, 24 May 2010 16:42:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OGgt0g055786; Mon, 24 May 2010 16:42:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005241642.o4OGgt0g055786@svn.freebsd.org> From: Marius Strobl Date: Mon, 24 May 2010 16:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208511 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 16:42:55 -0000 Author: marius Date: Mon May 24 16:42:55 2010 New Revision: 208511 URL: http://svn.freebsd.org/changeset/base/208511 Log: According to simon@ when referring to a company along a product just to identify the company one shouldn't use the company trademark. Approved by: simon Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Mon May 24 16:42:53 2010 (r208510) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Mon May 24 16:42:55 2010 (r208511) @@ -380,7 +380,7 @@ sparc64 This section describes the systems currently known to be - supported by &os; on the &fujitsu; &sparc64; and &sun; &ultrasparc; + supported by &os; on the Fujitsu &sparc64; and Sun &ultrasparc; platforms. For background information on the various hardware designs see the Sun System @@ -391,8 +391,8 @@ When using the GENERIC kernel, &os;/&arch.sparc64; systems not equipped with a framebuffer - supported by the &man.creator.4; (&sun; Creator, &sun; Creator3D - and &sun; Elite3D) or &man.machfb.4; (&sun; PGX and &sun; PGX64 + supported by the &man.creator.4; (Sun Creator, Sun Creator3D + and Sun Elite3D) or &man.machfb.4; (Sun PGX and Sun PGX64 as well as the ATI Mach64 chips found onboard in for example &sun.blade; 100, &sun.blade; 150, &sun.ultra; 5 and &sun.ultra; 10) driver must use the serial console. @@ -451,55 +451,55 @@ - &sun; &netra; t1 100/105 + Sun &netra; t1 100/105 - &sun; &netra; T1 AC200/DC200 + Sun &netra; T1 AC200/DC200 - &sun; &netra; t 1100 + Sun &netra; t 1100 - &sun; &netra; t 1120 + Sun &netra; t 1120 - &sun; &netra; t 1125 + Sun &netra; t 1125 - &sun; &netra; t 1400/1405 + Sun &netra; t 1400/1405 - &sun; &netra; 120 + Sun &netra; 120 - &sun; &netra; X1 + Sun &netra; X1 - &sun; &sparcengine; Ultra AX1105 + Sun &sparcengine; Ultra AX1105 - &sun; &sparcengine; Ultra AXe + Sun &sparcengine; Ultra AXe - &sun; &sparcengine; Ultra AXi + Sun &sparcengine; Ultra AXi - &sun; &sparcengine; Ultra AXmp + Sun &sparcengine; Ultra AXmp - &sun; &sparcengine; CP1500 + Sun &sparcengine; CP1500 @@ -542,8 +542,8 @@ The following systems are partially supported by &os;. In particular the fibre channel controllers in SBus-based systems are not supported. However, it is possible to use these with a SCSI controller - supported by the &man.esp.4 driver (&sun; ESP SCSI, &sun; FAS Fast-SCSI - and &sun; FAS366 Fast-Wide SCSI controllers). + supported by the &man.esp.4 driver (Sun ESP SCSI, Sun FAS Fast-SCSI + and Sun FAS366 Fast-Wide SCSI controllers). @@ -555,7 +555,7 @@ - Starting with 7.2-RELEASE, &arch.sparc64; systems based on &sun; + Starting with 7.2-RELEASE, &arch.sparc64; systems based on Sun &ultrasparc; III and beyond are also supported by &os;, which includes the following known working systems: @@ -616,7 +616,7 @@ - The following &sun; &ultrasparc; systems are not tested but + The following Sun &ultrasparc; systems are not tested but believed to be also supported by &os;: @@ -639,29 +639,29 @@ Starting with 8.1-RELEASE, &arch.sparc64; systems based on - &fujitsu; &sparc64; V are also supported by &os;, which + Fujitsu &sparc64; V are also supported by &os;, which includes the following known working systems: - &fujitsu; &primepower; 250 + Fujitsu &primepower; 250 - The following &fujitsu; &primepower; systems are not tested but + The following Fujitsu &primepower; systems are not tested but believed to be also supported by &os;: - &fujitsu; &primepower; 450 + Fujitsu &primepower; 450 - &fujitsu; &primepower; 650 + Fujitsu &primepower; 650 - &fujitsu; &primepower; 850 + Fujitsu &primepower; 850 From owner-svn-src-head@FreeBSD.ORG Mon May 24 17:12:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCF6A106566C; Mon, 24 May 2010 17:12:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB88B8FC08; Mon, 24 May 2010 17:12:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OHCiVt062564; Mon, 24 May 2010 17:12:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OHCiLv062562; Mon, 24 May 2010 17:12:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005241712.o4OHCiLv062562@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 24 May 2010 17:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208512 - head/sys/dev/sge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 17:12:44 -0000 Author: yongari Date: Mon May 24 17:12:44 2010 New Revision: 208512 URL: http://svn.freebsd.org/changeset/base/208512 Log: sge_encap() can sometimes return an error with m_head set to NULL. Make sure not to requeue freed mbuf in sge_start_locked(). This should fix NULL pointer dereference panic. Reported by: Nikolay Denev gmail dot com> Submitted by: jhb Modified: head/sys/dev/sge/if_sge.c Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Mon May 24 16:42:55 2010 (r208511) +++ head/sys/dev/sge/if_sge.c Mon May 24 17:12:44 2010 (r208512) @@ -1588,7 +1588,8 @@ sge_start_locked(struct ifnet *ifp) if (m_head == NULL) break; if (sge_encap(sc, &m_head)) { - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (m_head != NULL) + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } From owner-svn-src-head@FreeBSD.ORG Mon May 24 17:23:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5605A10656C6; Mon, 24 May 2010 17:23:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3208FC24; Mon, 24 May 2010 17:23:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OHNEXl064908; Mon, 24 May 2010 17:23:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OHNE3r064906; Mon, 24 May 2010 17:23:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005241723.o4OHNE3r064906@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 24 May 2010 17:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208513 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 17:23:15 -0000 Author: kib Date: Mon May 24 17:23:14 2010 New Revision: 208513 URL: http://svn.freebsd.org/changeset/base/208513 Log: Improve the documentation for PT_LWPINFO. Note that some features are not implemented on MIPS and ARM. MFC after: 1 month Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Mon May 24 17:12:44 2010 (r208512) +++ head/lib/libc/sys/ptrace.2 Mon May 24 17:23:14 2010 (r208513) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd February 11, 2010 +.Dd May 24, 2010 .Dt PTRACE 2 .Os .Sh NAME @@ -289,8 +289,11 @@ argument specifies a pointer to a which is defined as follows: .Bd -literal struct ptrace_lwpinfo { - lwpid_t pl_lwpid; /* LWP described. */ - int pl_event; /* Event received. */ + lwpid_t pl_lwpid; + int pl_event; + int pl_flags; + sigset_t pl_sigmask; + sigset_t pl_siglist; }; .Ed .Pp @@ -298,6 +301,51 @@ The .Fa data argument is to be set to the size of the structure known to the caller. This allows the structure to grow without affecting older programs. +.Pp +The fields in the +.Vt "struct ptrace_lwpinfo" +have the following meaning: +.Bl -tag -width indent -compact +.It pl_lwpid +LWP id of the thread +.It pl_event +Event that caused the stop. +Currently defined events are +.Bl -tag -width indent -compact +.It PL_EVENT_NONE +No reason given +.It PL_EVENT_SIGNAL +Thread stopped due to the pending signal +.El +.It pl_flags +Flags that specify additional details about observed stop. +Currently defined flags are: +.Bl -tag -width indent -compact +.It PL_FLAG_SCE +The thread stopped due to system call entry, right after the kernel is entered. +The debugger may examine syscall arguments that are stored in memory and +registers according to the ABI of the current process, and modify them, +if needed. +.It PL_FLAG_SCX +The thread is stopped immediately before syscall is returning to the usermode. +The debugger may examine system call return values in the ABI-defined registers +and/or memory. +.It PL_FLAG_EXEC +When +.Dv PL_FLAG_SCX +is set, this flag may be additionally specified to inform that the +program being executed by debuggee process has been changed by succesful +execution of a system call from the +.Fn execve 2 +family. +.El +.It pl_sigmask +The current signal mask of the LWP +.It pl_siglist +The current pending set of signals for the LWP. Note that signals that +are delivered to the process would not appear on an LWP siglist until +the thread is selected for delivery. +.El .It PT_GETNUMLWPS This request returns the number of kernel threads associated with the traced process. @@ -501,3 +549,10 @@ The .Fn ptrace function appeared in .At v7 . +.Sh BUGS +The +.Dv PL_FLAG_SCE , +.Dv PL_FLAG_SCX +and +.Dv PL_FLAG_EXEC +are not implemented for MIPS and ARM architectures. From owner-svn-src-head@FreeBSD.ORG Mon May 24 17:24:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 962CB106567C; Mon, 24 May 2010 17:24:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B43D8FC1E; Mon, 24 May 2010 17:24:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OHOEVb065151; Mon, 24 May 2010 17:24:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OHOEuE065147; Mon, 24 May 2010 17:24:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005241724.o4OHOEuE065147@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 24 May 2010 17:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208514 - in head/sys/ia64: ia32 ia64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 17:24:14 -0000 Author: kib Date: Mon May 24 17:24:14 2010 New Revision: 208514 URL: http://svn.freebsd.org/changeset/base/208514 Log: Change ia64' struct syscall_args definition so that args is a pointer to the arguments array instead of array itself. ia64 syscall arguments are readily available in the frame, point args to it, do not do unnecessary bcopy. Still reserve the array in syscall_args for ia32 emulation. Suggested and reviewed by: marcel MFC after: 1 month Modified: head/sys/ia64/ia32/ia32_trap.c head/sys/ia64/ia64/trap.c head/sys/ia64/include/proc.h Modified: head/sys/ia64/ia32/ia32_trap.c ============================================================================== --- head/sys/ia64/ia32/ia32_trap.c Mon May 24 17:23:14 2010 (r208513) +++ head/sys/ia64/ia32/ia32_trap.c Mon May 24 17:24:14 2010 (r208514) @@ -132,10 +132,11 @@ ia32_fetch_syscall_args(struct thread *t error = copyin(params, (caddr_t)args, sa->narg * sizeof(int)); else error = 0; + sa->args = &sa->args32[0]; if (error == 0) { for (i = 0; i < sa->narg; i++) - sa->args[i] = args[i]; + sa->args32[i] = args[i]; td->td_retval[0] = 0; td->td_retval[1] = tf->tf_scratch.gr10; /* edx */ } Modified: head/sys/ia64/ia64/trap.c ============================================================================== --- head/sys/ia64/ia64/trap.c Mon May 24 17:23:14 2010 (r208513) +++ head/sys/ia64/ia64/trap.c Mon May 24 17:24:14 2010 (r208514) @@ -902,13 +902,12 @@ cpu_fetch_syscall_args(struct thread *td { struct proc *p; struct trapframe *tf; - register_t *args; p = td->td_proc; tf = td->td_frame; sa->code = tf->tf_scratch.gr15; - args = &tf->tf_scratch.gr16; + sa->args = &tf->tf_scratch.gr16; /* * syscall() and __syscall() are handled the same on @@ -918,8 +917,8 @@ cpu_fetch_syscall_args(struct thread *td /* * Code is first argument, followed by actual args. */ - sa->code = args[0]; - args++; + sa->code = sa->args[0]; + sa->args++; } if (p->p_sysent->sv_mask) @@ -929,7 +928,6 @@ cpu_fetch_syscall_args(struct thread *td else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; - bcopy(args, sa->args, sa->narg * sizeof(sa->args[0])); td->td_retval[0] = 0; td->td_retval[1] = 0; Modified: head/sys/ia64/include/proc.h ============================================================================== --- head/sys/ia64/include/proc.h Mon May 24 17:23:14 2010 (r208513) +++ head/sys/ia64/include/proc.h Mon May 24 17:24:14 2010 (r208514) @@ -45,7 +45,8 @@ struct mdproc { struct syscall_args { u_int code; struct sysent *callp; - register_t args[8]; + register_t *args; + register_t args32[8]; int narg; }; #define HAVE_SYSCALL_ARGS_DEF 1 From owner-svn-src-head@FreeBSD.ORG Mon May 24 17:33:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9888106564A; Mon, 24 May 2010 17:33:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD3488FC0A; Mon, 24 May 2010 17:33:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OHX2WM067113; Mon, 24 May 2010 17:33:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OHX2Q3067111; Mon, 24 May 2010 17:33:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005241733.o4OHX2Q3067111@svn.freebsd.org> From: Marius Strobl Date: Mon, 24 May 2010 17:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208515 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 17:33:03 -0000 Author: marius Date: Mon May 24 17:33:02 2010 New Revision: 208515 URL: http://svn.freebsd.org/changeset/base/208515 Log: Fix some whitespace nits. Modified: head/sys/geom/part/g_part_vtoc8.c Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Mon May 24 17:24:14 2010 (r208514) +++ head/sys/geom/part/g_part_vtoc8.c Mon May 24 17:33:02 2010 (r208515) @@ -55,19 +55,19 @@ static int g_part_vtoc8_add(struct g_par struct g_part_parms *); static int g_part_vtoc8_create(struct g_part_table *, struct g_part_parms *); static int g_part_vtoc8_destroy(struct g_part_table *, struct g_part_parms *); -static void g_part_vtoc8_dumpconf(struct g_part_table *, struct g_part_entry *, - struct sbuf *, const char *); +static void g_part_vtoc8_dumpconf(struct g_part_table *, + struct g_part_entry *, struct sbuf *, const char *); static int g_part_vtoc8_dumpto(struct g_part_table *, struct g_part_entry *); -static int g_part_vtoc8_modify(struct g_part_table *, struct g_part_entry *, +static int g_part_vtoc8_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); -static const char *g_part_vtoc8_name(struct g_part_table *, struct g_part_entry *, - char *, size_t); +static const char *g_part_vtoc8_name(struct g_part_table *, + struct g_part_entry *, char *, size_t); static int g_part_vtoc8_probe(struct g_part_table *, struct g_consumer *); static int g_part_vtoc8_read(struct g_part_table *, struct g_consumer *); -static const char *g_part_vtoc8_type(struct g_part_table *, struct g_part_entry *, - char *, size_t); +static const char *g_part_vtoc8_type(struct g_part_table *, + struct g_part_entry *, char *, size_t); static int g_part_vtoc8_write(struct g_part_table *, struct g_consumer *); -static int g_part_vtoc8_resize(struct g_part_table *, struct g_part_entry *, +static int g_part_vtoc8_resize(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static kobj_method_t g_part_vtoc8_methods[] = { @@ -261,7 +261,8 @@ g_part_vtoc8_dumpconf(struct g_part_tabl } static int -g_part_vtoc8_dumpto(struct g_part_table *basetable, struct g_part_entry *entry) +g_part_vtoc8_dumpto(struct g_part_table *basetable, + struct g_part_entry *entry) { struct g_part_vtoc8_table *table; uint16_t tag; @@ -477,7 +478,7 @@ g_part_vtoc8_read(struct g_part_table *b } static const char * -g_part_vtoc8_type(struct g_part_table *basetable, struct g_part_entry *entry, +g_part_vtoc8_type(struct g_part_table *basetable, struct g_part_entry *entry, char *buf, size_t bufsz) { struct g_part_vtoc8_table *table; From owner-svn-src-head@FreeBSD.ORG Tue May 25 02:26:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB629106566C; Tue, 25 May 2010 02:26:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA5EA8FC13; Tue, 25 May 2010 02:26:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4P2QPWl085210; Tue, 25 May 2010 02:26:25 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4P2QPC4085207; Tue, 25 May 2010 02:26:25 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005250226.o4P2QPC4085207@svn.freebsd.org> From: Alan Cox Date: Tue, 25 May 2010 02:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208524 - in head/sys: kern vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 02:26:25 -0000 Author: alc Date: Tue May 25 02:26:25 2010 New Revision: 208524 URL: http://svn.freebsd.org/changeset/base/208524 Log: Eliminate the acquisition and release of the page queues lock from vfs_busy_pages(). It is no longer needed. Submitted by: kib Modified: head/sys/kern/vfs_bio.c head/sys/vm/vm_page.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon May 24 21:01:37 2010 (r208523) +++ head/sys/kern/vfs_bio.c Tue May 25 02:26:25 2010 (r208524) @@ -3508,7 +3508,6 @@ vfs_page_set_validclean(struct buf *bp, { vm_ooffset_t soff, eoff; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); /* * Start and end offsets in buffer. eoff - soff may not cross a * page boundry or cross the end of the buffer. The end of the @@ -3571,8 +3570,6 @@ retry: goto retry; } bogus = 0; - if (clear_modify) - vm_page_lock_queues(); for (i = 0; i < bp->b_npages; i++) { m = bp->b_pages[i]; @@ -3605,8 +3602,6 @@ retry: } foff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; } - if (clear_modify) - vm_page_unlock_queues(); VM_OBJECT_UNLOCK(obj); if (bogus) pmap_qenter(trunc_page((vm_offset_t)bp->b_data), Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon May 24 21:01:37 2010 (r208523) +++ head/sys/vm/vm_page.c Tue May 25 02:26:25 2010 (r208524) @@ -2084,7 +2084,6 @@ vm_page_set_validclean(vm_page_t m, int int frag; int endoff; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if (size == 0) /* handle degenerate case */ return; From owner-svn-src-head@FreeBSD.ORG Tue May 25 03:59:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F384D106566B; Tue, 25 May 2010 03:59:47 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (gerbercreations.com [71.39.140.16]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8248FC14; Tue, 25 May 2010 03:59:47 +0000 (UTC) Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) by misty.eyesbeyond.com (8.14.4/8.14.4) with ESMTP id o4P3eIxb075607; Mon, 24 May 2010 20:40:18 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) Received: (from glewis@localhost) by misty.eyesbeyond.com (8.14.4/8.14.4/Submit) id o4P3eHPW075606; Mon, 24 May 2010 20:40:17 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Mon, 24 May 2010 20:40:16 -0700 From: Greg Lewis To: Bruce Evans Message-ID: <20100525034016.GA75384@misty.eyesbeyond.com> References: <11069.1274618175@critter.freebsd.dk> <20100523230410.K17698@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100523230410.K17698@delplex.bde.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, Poul-Henning Kamp , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208332 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 03:59:48 -0000 On Sun, May 23, 2010 at 11:15:09PM +1000, Bruce Evans wrote: > On Sun, 23 May 2010, Poul-Henning Kamp wrote: > > In message <20100523183502.C13588@delplex.bde.org>, Bruce Evans writes: > >> On Thu, 20 May 2010, Poul-Henning Kamp wrote: > > > >> should be kernel-only. > > > > No, it absolutely should not, if anything, it should be pushed as > > international standards (with , and ). > > > > Atomic operations and write barriers are necessary when multiple > > threads or processes cooperate using shared memory. and if anything > > the bug is that POSIX has not updated pthreads to have these and > > other necessary primitives. (pthread_mutex_assert_held() for instance). > > Pehraps, but was only designed, implemented and > documented for use in the kernel. And of course any standardized version > won't look like the FreeBSD kernel one. The kernel one is too bloated > for me, but a general-purpose one should be even more bloated so as > to support all types and more than atomic ops. The FreeBSD port of the "Zero" Java VM uses . Well, except on sparc64 where pulls in too much namespace pollution and it instead includes chunks of the header verbatim instead :(. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Tue May 25 05:42:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B2A11065672; Tue, 25 May 2010 05:42:13 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4EA18FC14; Tue, 25 May 2010 05:42:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4P5gCkr028663; Tue, 25 May 2010 05:42:12 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4P5gCZD028661; Tue, 25 May 2010 05:42:12 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201005250542.o4P5gCZD028661@svn.freebsd.org> From: Neel Natu Date: Tue, 25 May 2010 05:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208532 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 05:42:13 -0000 Author: neel Date: Tue May 25 05:42:12 2010 New Revision: 208532 URL: http://svn.freebsd.org/changeset/base/208532 Log: Fix mips kernel build breakage caused by revision 208504. Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Tue May 25 04:56:31 2010 (r208531) +++ head/sys/mips/mips/pmap.c Tue May 25 05:42:12 2010 (r208532) @@ -2765,6 +2765,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad { pt_entry_t *ptep, pte; vm_offset_t pa; + vm_page_t m; int val; boolean_t managed; From owner-svn-src-head@FreeBSD.ORG Tue May 25 05:45:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF278106566B; Tue, 25 May 2010 05:45:16 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADB178FC12; Tue, 25 May 2010 05:45:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4P5jGIW029370; Tue, 25 May 2010 05:45:16 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4P5jGf9029367; Tue, 25 May 2010 05:45:16 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201005250545.o4P5jGf9029367@svn.freebsd.org> From: Neel Natu Date: Tue, 25 May 2010 05:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208533 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 05:45:16 -0000 Author: neel Date: Tue May 25 05:45:16 2010 New Revision: 208533 URL: http://svn.freebsd.org/changeset/base/208533 Log: Get rid of empty and unused KSEG0TEXT macros. Modified: head/sys/mips/include/asm.h head/sys/mips/mips/swtch.S Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Tue May 25 05:42:12 2010 (r208532) +++ head/sys/mips/include/asm.h Tue May 25 05:45:16 2010 (r208533) @@ -257,10 +257,6 @@ _C_LABEL(x): EXPORT(x ## End); \ END(x) -#define KSEG0TEXT_START -#define KSEG0TEXT_END -#define KSEG0TEXT .text - /* * Macros to panic and printf from assembly language. */ Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Tue May 25 05:42:12 2010 (r208532) +++ head/sys/mips/mips/swtch.S Tue May 25 05:45:16 2010 (r208533) @@ -216,9 +216,6 @@ LEAF(savectx) move v0, zero END(savectx) - -KSEG0TEXT_START; - NON_LEAF(mips_cpu_throw, CALLFRAME_SIZ, ra) mfc0 t0, COP_0_STATUS_REG # t0 = saved status register nop @@ -376,7 +373,6 @@ sw2: j ra nop END(cpu_switch) -KSEG0TEXT_END; /*---------------------------------------------------------------------------- * From owner-svn-src-head@FreeBSD.ORG Tue May 25 09:59:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A3AA1065676; Tue, 25 May 2010 09:59:54 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED6A98FC1B; Tue, 25 May 2010 09:59:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4P9xrFr085270; Tue, 25 May 2010 09:59:53 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4P9xrIs085267; Tue, 25 May 2010 09:59:53 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005250959.o4P9xrIs085267@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 25 May 2010 09:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208534 - in head/sys/boot/uboot: common lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 09:59:54 -0000 Author: raj Date: Tue May 25 09:59:53 2010 New Revision: 208534 URL: http://svn.freebsd.org/changeset/base/208534 Log: Use loader devices only when they initialized properly. Modified: head/sys/boot/uboot/common/main.c head/sys/boot/uboot/lib/disk.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Tue May 25 05:45:16 2010 (r208533) +++ head/sys/boot/uboot/common/main.c Tue May 25 09:59:53 2010 (r208534) @@ -157,20 +157,22 @@ main(void) panic("no U-Boot devices found"); printf("Number of U-Boot devices: %d\n", devs_no); - /* - * March through the device switch probing for things. - */ - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); - printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); meminfo(); + /* + * March through the device switch probing for things. + */ for (i = 0; devsw[i] != NULL; i++) { - printf("\nDevice %d: %s\n", i, devsw[i]->dv_name); + + if (devsw[i]->dv_init == NULL) + continue; + if ((devsw[i]->dv_init)() != 0) + continue; + + printf("\nDevice: %s\n", devsw[i]->dv_name); currdev.d_dev = devsw[i]; currdev.d_type = currdev.d_dev->dv_type; Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Tue May 25 05:45:16 2010 (r208533) +++ head/sys/boot/uboot/lib/disk.c Tue May 25 09:59:53 2010 (r208534) @@ -157,7 +157,7 @@ stor_init(void) } if (!found) { - printf("No storage devices\n"); + debugf("No storage devices\n"); return (-1); } From owner-svn-src-head@FreeBSD.ORG Tue May 25 10:15:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 382DD106564A; Tue, 25 May 2010 10:15:31 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27AA08FC14; Tue, 25 May 2010 10:15:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PAFVaa088804; Tue, 25 May 2010 10:15:31 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PAFVx4088802; Tue, 25 May 2010 10:15:31 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005251015.o4PAFVx4088802@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 25 May 2010 10:15:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208535 - head/sys/boot/uboot/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 10:15:31 -0000 Author: raj Date: Tue May 25 10:15:30 2010 New Revision: 208535 URL: http://svn.freebsd.org/changeset/base/208535 Log: Mostly revert r200691. U-Boot syscall() entry point returns 1 on success. Modified: head/sys/boot/uboot/lib/glue.c Modified: head/sys/boot/uboot/lib/glue.c ============================================================================== --- head/sys/boot/uboot/lib/glue.c Tue May 25 09:59:53 2010 (r208534) +++ head/sys/boot/uboot/lib/glue.c Tue May 25 10:15:30 2010 (r208535) @@ -574,7 +574,7 @@ ub_env_enum(const char *last) * internally, which handles such case */ env = NULL; - if (syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env) != 0) + if (!syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env)) return (NULL); if (env == NULL) From owner-svn-src-head@FreeBSD.ORG Tue May 25 13:27:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4396F1065674; Tue, 25 May 2010 13:27:56 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 193CB8FC26; Tue, 25 May 2010 13:27:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PDRtev035486; Tue, 25 May 2010 13:27:55 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PDRt7Q035485; Tue, 25 May 2010 13:27:55 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005251327.o4PDRt7Q035485@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 25 May 2010 13:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208536 - head/gnu/usr.bin/dtc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 13:27:56 -0000 Author: raj Date: Tue May 25 13:27:55 2010 New Revision: 208536 URL: http://svn.freebsd.org/changeset/base/208536 Log: Correct dtc version header autogen location. While there unify brackets usage. Modified: head/gnu/usr.bin/dtc/Makefile Modified: head/gnu/usr.bin/dtc/Makefile ============================================================================== --- head/gnu/usr.bin/dtc/Makefile Tue May 25 10:15:30 2010 (r208535) +++ head/gnu/usr.bin/dtc/Makefile Tue May 25 13:27:55 2010 (r208536) @@ -11,18 +11,18 @@ PROG= dtc SRCS= dtc.c checks.c fstree.c livetree.c treesource.c data.c \ flattree.c srcpos.c util.c \ fdt.c fdt_ro.c fdt_rw.c fdt_strerror.c \ - fdt_sw.c fdt_wip.c $(DTCDIR)/version_gen.h + fdt_sw.c fdt_wip.c ${DTCVERSIONFILE} CFLAGS = -Wall -g -Os -fPIC -Wpointer-arith -Wcast-qual CFLAGS+= -I. -I${.CURDIR} -I${DTCDIR} -I${LIBFDTDIR} -VERSIONMAJ!= awk '/^VERSION =/ { print $$3 }' $(DTCDIR)/Makefile -VERSIONMIN!= awk '/^PATCHLEVEL =/ { print $$3 }' $(DTCDIR)/Makefile -VERSIONSUB!= awk '/^SUBLEVEL =/ { print $$3 }' $(DTCDIR)/Makefile -VERSIONEXTRA!= $(DTCDIR)/scripts/setlocalversion +VERSIONMAJ!= awk '/^VERSION =/ { print $$3 }' ${DTCDIR}/Makefile +VERSIONMIN!= awk '/^PATCHLEVEL =/ { print $$3 }' ${DTCDIR}/Makefile +VERSIONSUB!= awk '/^SUBLEVEL =/ { print $$3 }' ${DTCDIR}/Makefile +VERSIONEXTRA= DTCVERSION:= ${VERSIONMAJ}.${VERSIONMIN}.${VERSIONSUB}${VERSIONEXTRA} -DTCVERSIONFILE:= $(DTCDIR)/version_gen.h +DTCVERSIONFILE:= version_gen.h MAN= @@ -34,18 +34,18 @@ OBJS+= dtc-parser.tab.o dtc-lexer.lex.o CLEANFILES+= dtc-parser.tab.o dtc-lexer.lex.o dtc-parser.tab.c \ dtc-parser.tab.h dtc-lexer.lex.c ${DTCVERSIONFILE} -$(DTCVERSIONFILE): +${DTCVERSIONFILE}: @echo '#define DTC_VERSION "DTC ${DTCVERSION}"' > ${DTCVERSIONFILE} dtc-parser.tab.o: dtc-parser.tab.c dtc-parser.tab.h dtc-lexer.lex.o: dtc-lexer.lex.c dtc-parser.tab.h dtc-parser.tab.c: dtc-parser.y - $(BISON) -o$@ -d $(DTCDIR)/dtc-parser.y + ${BISON} -o$@ -d ${DTCDIR}/dtc-parser.y dtc-parser.tab.h: dtc-parser.tab.c dtc-lexer.lex.c: dtc-lexer.l - $(LEX) -o$@ $(DTCDIR)/dtc-lexer.l + ${LEX} -o$@ ${DTCDIR}/dtc-lexer.l .include From owner-svn-src-head@FreeBSD.ORG Tue May 25 15:12:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BEBD106567B; Tue, 25 May 2010 15:12:22 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AC018FC12; Tue, 25 May 2010 15:12:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PFCLhj058551; Tue, 25 May 2010 15:12:21 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PFCLwl058548; Tue, 25 May 2010 15:12:21 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005251512.o4PFCLwl058548@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 25 May 2010 15:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208537 - in head: share/mk tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 15:12:22 -0000 Author: raj Date: Tue May 25 15:12:21 2010 New Revision: 208537 URL: http://svn.freebsd.org/changeset/base/208537 Log: Introduce a new build knob for Flattened Device Tree support. Reviewed by: imp Sponsored by: The FreeBSD Foundation Added: head/tools/build/options/WITH_FDT (contents, props changed) Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue May 25 13:27:55 2010 (r208536) +++ head/share/mk/bsd.own.mk Tue May 25 15:12:21 2010 (r208537) @@ -278,6 +278,16 @@ WITH_HESIOD= WITH_IDEA= .endif +# Enable FDT by default for selected platforms. +.if defined(TARGET_ARCH) && \ + (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "powerpc") +# XXX this is temporarily disabled until all FDT support code is in place. +#_fdt= FDT +_no_fdt= FDT +.else +_no_fdt= FDT +.endif + # # MK_* options which default to "yes". # @@ -313,6 +323,7 @@ WITH_IDEA= DICT \ DYNAMICROOT \ EXAMPLES \ + ${_fdt} \ FLOPPY \ FORTH \ FP_LIBC \ @@ -407,6 +418,7 @@ MK_${var}:= yes BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ + ${_no_fdt} \ HESIOD \ IDEA .if defined(WITH_${var}) && defined(WITHOUT_${var}) Added: head/tools/build/options/WITH_FDT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_FDT Tue May 25 15:12:21 2010 (r208537) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build Flattened Device Tree support as part of the base system. This +includes the device tree compiler (dtc) and libfdt support library. From owner-svn-src-head@FreeBSD.ORG Tue May 25 15:21:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1F1D1065674; Tue, 25 May 2010 15:21:39 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E3238FC21; Tue, 25 May 2010 15:21:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PFLd4H060686; Tue, 25 May 2010 15:21:39 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PFLdFa060679; Tue, 25 May 2010 15:21:39 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005251521.o4PFLdFa060679@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 25 May 2010 15:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208538 - in head/sys: arm/include boot/arm/uboot boot/fdt boot/powerpc/uboot boot/uboot/common boot/uboot/lib powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 15:21:39 -0000 Author: raj Date: Tue May 25 15:21:39 2010 New Revision: 208538 URL: http://svn.freebsd.org/changeset/base/208538 Log: Initial loader(8) support for Flattened Device Tree. o This is disabled by default for now, and can be enabled using WITH_FDT at build time. o Tested with ARM and PowerPC. Reviewed by: imp Sponsored by: The FreeBSD Foundation Added: head/sys/boot/fdt/ head/sys/boot/fdt/Makefile (contents, props changed) head/sys/boot/fdt/fdt_loader_cmd.c (contents, props changed) Modified: head/sys/arm/include/metadata.h head/sys/boot/arm/uboot/Makefile head/sys/boot/arm/uboot/version head/sys/boot/powerpc/uboot/Makefile head/sys/boot/powerpc/uboot/version head/sys/boot/uboot/common/main.c head/sys/boot/uboot/common/metadata.c head/sys/boot/uboot/lib/Makefile head/sys/powerpc/include/metadata.h Modified: head/sys/arm/include/metadata.h ============================================================================== --- head/sys/arm/include/metadata.h Tue May 25 15:12:21 2010 (r208537) +++ head/sys/arm/include/metadata.h Tue May 25 15:21:39 2010 (r208538) @@ -30,5 +30,6 @@ #define _MACHINE_METADATA_H_ #define MODINFOMD_BOOTINFO 0x1001 +#define MODINFOMD_DTBP 0x1002 #endif /* !_MACHINE_METADATA_H_ */ Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Tue May 25 15:12:21 2010 (r208537) +++ head/sys/boot/arm/uboot/Makefile Tue May 25 15:21:39 2010 (r208538) @@ -18,6 +18,11 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no +.if defined(WITH_FDT) +LOADER_FDT_SUPPORT= yes +.else +LOADER_FDT_SUPPORT= no +.endif .if ${LOADER_DISK_SUPPORT} == "yes" CFLAGS+= -DLOADER_DISK_SUPPORT @@ -46,6 +51,12 @@ CFLAGS+= -DLOADER_NFS_SUPPORT .if ${LOADER_TFTP_SUPPORT} == "yes" CFLAGS+= -DLOADER_TFTP_SUPPORT .endif +.if ${LOADER_FDT_SUPPORT} == "yes" +CFLAGS+= -I${.CURDIR}/../../fdt +CFLAGS+= -I${.OBJDIR}/../../fdt +CFLAGS+= -DLOADER_FDT_SUPPORT +LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a +.endif .if !defined(NO_FORTH) # Enable BootForth @@ -79,8 +90,8 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} -lstand +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: head/sys/boot/arm/uboot/version ============================================================================== --- head/sys/boot/arm/uboot/version Tue May 25 15:12:21 2010 (r208537) +++ head/sys/boot/arm/uboot/version Tue May 25 15:21:39 2010 (r208538) @@ -3,5 +3,6 @@ $FreeBSD$ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important. Make sure the current version number is on line 6. +1.1: Flattened Device Tree blob support. 1.0: Added storage support. Booting from HDD, USB, etc. is now possible. 0.5: Initial U-Boot/arm version (netbooting only). Added: head/sys/boot/fdt/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/Makefile Tue May 25 15:21:39 2010 (r208538) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../contrib/libfdt/ + +LIB= fdt +INTERNALLIB= + +# Vendor sources of libfdt. +SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c + +# Loader's fdt commands extension sources. +SRCS+= fdt_loader_cmd.c + +CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ \ + -I${.CURDIR}/../uboot/lib + +CFLAGS+= -ffreestanding + +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "arm" +CFLAGS+= -msoft-float +.endif + +CFLAGS+= -Wformat -Wall + +.include Added: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/fdt_loader_cmd.c Tue May 25 15:21:39 2010 (r208538) @@ -0,0 +1,1290 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include "bootstrap.h" +#include "glue.h" + +#define DEBUG + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +#define FDT_CWD_LEN 256 +#define FDT_MAX_DEPTH 6 + +#define FDT_PROP_SEP " = " + +#define STR(number) #number +#define STRINGIFY(number) STR(number) + +#define MIN(num1, num2) (((num1) < (num2)) ? (num1):(num2)) + +static struct fdt_header *fdtp = NULL; + +static int fdt_cmd_nyi(int argc, char *argv[]); + +static int fdt_cmd_mkprop(int argc, char *argv[]); +static int fdt_cmd_cd(int argc, char *argv[]); +static int fdt_cmd_hdr(int argc, char *argv[]); +static int fdt_cmd_ls(int argc, char *argv[]); +static int fdt_cmd_prop(int argc, char *argv[]); +static int fdt_cmd_pwd(int argc, char *argv[]); +static int fdt_cmd_rm(int argc, char *argv[]); +static int fdt_cmd_mknode(int argc, char *argv[]); + +typedef int cmdf_t(int, char *[]); + +struct cmdtab { + char *name; + cmdf_t *handler; +}; + +static const struct cmdtab commands[] = { + { "alias", &fdt_cmd_nyi }, + { "cd", &fdt_cmd_cd }, + { "header", &fdt_cmd_hdr }, + { "ls", &fdt_cmd_ls }, + { "mknode", &fdt_cmd_mknode }, + { "mkprop", &fdt_cmd_mkprop }, + { "mres", &fdt_cmd_nyi }, + { "prop", &fdt_cmd_prop }, + { "pwd", &fdt_cmd_pwd }, + { "rm", &fdt_cmd_rm }, + { NULL, NULL } +}; + +static char cwd[FDT_CWD_LEN] = "/"; + +static int +fdt_setup_fdtp() +{ + struct preloaded_file *bfp; + int err; + + /* + * Find the device tree blob. + */ + bfp = file_findfile(NULL, "dtb"); + if (bfp == NULL) { + command_errmsg = "no device tree blob loaded"; + return (CMD_ERROR); + } + fdtp = (struct fdt_header *)bfp->f_addr; + + /* + * Validate the blob. + */ + err = fdt_check_header(fdtp); + if (err < 0) { + if (err == -FDT_ERR_BADVERSION) + sprintf(command_errbuf, + "incompatible blob version: %d, should be: %d", + fdt_version(fdtp), FDT_LAST_SUPPORTED_VERSION); + + else + sprintf(command_errbuf, "error validating blob: %s", + fdt_strerror(err)); + return (CMD_ERROR); + } + return (CMD_OK); +} + +#define fdt_strtovect(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ + (cellbuf), (lim), (cellsize), 0); + +/* Force using base 16 */ +#define fdt_strtovectx(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ + (cellbuf), (lim), (cellsize), 16); + +static int +_fdt_strtovect(char *str, void *cellbuf, int lim, unsigned char cellsize, + uint8_t base) +{ + char *buf = str; + char *end = str + strlen(str) - 2; + uint32_t *u32buf = NULL; + uint8_t *u8buf = NULL; + int cnt = 0; + + if (cellsize == sizeof(uint32_t)) + u32buf = (uint32_t *)cellbuf; + else + u8buf = (uint8_t *)cellbuf; + + if (lim == 0) + return (0); + + while (buf < end) { + + /* Skip white whitespace(s)/separators */ + while (!isxdigit(*buf) && buf < end) + buf++; + + if (u32buf != NULL) + u32buf[cnt] = + cpu_to_fdt32((uint32_t)strtol(buf, NULL, base)); + + else + u8buf[cnt] = (uint8_t)strtol(buf, NULL, base); + + if (cnt + 1 <= lim - 1) + cnt++; + else + break; + buf++; + /* Find another number */ + while ((isxdigit(*buf) || *buf == 'x') && buf < end) + buf++; + } + return (cnt); +} + +#define TMP_MAX_ETH 8 + +void +fixup_ethernet(const char *env, char *ethstr, int *eth_no, int len) +{ + char *end, *str; + uint8_t tmp_addr[6]; + int i, n; + + /* Extract interface number */ + i = strtol(env + 3, &end, 10); + if (end == (env + 3)) + /* 'ethaddr' means interface 0 address */ + n = 0; + else + n = i; + + if (n > TMP_MAX_ETH) + return; + + str = ub_env_get(env); + + /* Convert macaddr string into a vector of uints */ + fdt_strtovectx(str, &tmp_addr, 6, sizeof(uint8_t)); + if (n != 0) { + i = strlen(env) - 7; + strncpy(ethstr + 8, env + 3, i); + } + /* Set actual property to a value from vect */ + fdt_setprop(fdtp, fdt_path_offset(fdtp, ethstr), + "local-mac-address", &tmp_addr, 6 * sizeof(uint8_t)); + + /* Clear ethernet..XXXX.. string */ + bzero(ethstr + 8, len - 8); + + if (n + 1 > *eth_no) + *eth_no = n + 1; +} + +void +fixup_cpubusfreqs(unsigned long cpufreq, unsigned long busfreq) +{ + int lo, o = 0, o2, maxo = 0, depth; + const uint32_t zero = 0; + + /* We want to modify every subnode of /cpus */ + o = fdt_path_offset(fdtp, "/cpus"); + + /* maxo should contain offset of node next to /cpus */ + depth = 0; + maxo = o; + while (depth != -1) + maxo = fdt_next_node(fdtp, maxo, &depth); + + /* Find CPU frequency properties */ + o = fdt_node_offset_by_prop_value(fdtp, o, "clock-frequency", + &zero, sizeof(uint32_t)); + + o2 = fdt_node_offset_by_prop_value(fdtp, o, "bus-frequency", &zero, + sizeof(uint32_t)); + + lo = MIN(o, o2); + + while (o != -FDT_ERR_NOTFOUND && o2 != -FDT_ERR_NOTFOUND) { + + o = fdt_node_offset_by_prop_value(fdtp, lo, + "clock-frequency", &zero, sizeof(uint32_t)); + + o2 = fdt_node_offset_by_prop_value(fdtp, lo, "bus-frequency", + &zero, sizeof(uint32_t)); + + /* We're only interested in /cpus subnode(s) */ + if (lo > maxo) + break; + + fdt_setprop_inplace_cell(fdtp, lo, "clock-frequency", + (uint32_t)cpufreq); + + fdt_setprop_inplace_cell(fdtp, lo, "bus-frequency", + (uint32_t)busfreq); + + lo = MIN(o, o2); + } +} + +int +fdt_reg_valid(uint32_t *reg, int len, int addr_cells, int size_cells) +{ + int cells_in_tuple, i, tuples, tuple_size; + uint32_t cur_start, cur_size; + + cells_in_tuple = (addr_cells + size_cells); + tuple_size = cells_in_tuple * sizeof(uint32_t); + tuples = len / tuple_size; + if (tuples == 0) + return (EINVAL); + + for (i = 0; i < tuples; i++) { + if (addr_cells == 2) + cur_start = fdt64_to_cpu(reg[i * cells_in_tuple]); + else + cur_start = fdt32_to_cpu(reg[i * cells_in_tuple]); + + if (size_cells == 2) + cur_size = fdt64_to_cpu(reg[i * cells_in_tuple + 2]); + else + cur_size = fdt32_to_cpu(reg[i * cells_in_tuple + 1]); + + if (cur_size == 0) + return (EINVAL); + + debugf(" reg#%d (start: 0x%0x size: 0x%0x) valid!\n", + i, cur_start, cur_size); + } + return (0); +} + +void +fixup_memory(struct sys_info *si) +{ + struct mem_region *curmr; + uint32_t addr_cells, size_cells; + uint32_t *addr_cellsp, *reg, *size_cellsp; + int err, i, len, memory, realmrno, root; + uint8_t *buf, *sb; + + root = fdt_path_offset(fdtp, "/"); + if (root < 0) { + sprintf(command_errbuf, "Could not find root node !"); + return; + } + + memory = fdt_path_offset(fdtp, "/memory"); + if (memory <= 0) { + /* Create proper '/memory' node. */ + memory = fdt_add_subnode(fdtp, root, "memory"); + if (memory <= 0) { + sprintf(command_errbuf, "Could not fixup '/memory' " + "node, error code : %d!\n", memory); + return; + } + + err = fdt_setprop(fdtp, memory, "device_type", "memory", + sizeof("memory")); + + if (err < 0) + return; + } + + addr_cellsp = (uint32_t *)fdt_getprop(fdtp, root, "#address-cells", + NULL); + size_cellsp = (uint32_t *)fdt_getprop(fdtp, root, "#size-cells", NULL); + + if (addr_cellsp == NULL || size_cellsp == NULL) { + sprintf(command_errbuf, "Could not fixup '/memory' node : " + "%s %s property not found in root node!\n", + (!addr_cellsp) ? "#address-cells" : "", + (!size_cellsp) ? "#size-cells" : ""); + return; + } + + addr_cells = fdt32_to_cpu(*addr_cellsp); + size_cells = fdt32_to_cpu(*size_cellsp); + + /* Count valid memory regions entries in sysinfo. */ + realmrno = si->mr_no; + for (i = 0; i < si->mr_no; i++) + if (si->mr[i].start == 0 && si->mr[i].size == 0) + realmrno--; + + if (realmrno == 0) { + sprintf(command_errbuf, "Could not fixup '/memory' node : " + "sysinfo doesn't contain valid memory regions info!\n"); + return; + } + + if ((reg = (uint32_t *)fdt_getprop(fdtp, memory, "reg", + &len)) != NULL) { + + if (fdt_reg_valid(reg, len, addr_cells, size_cells) == 0) + /* + * Do not apply fixup if existing 'reg' property + * seems to be valid. + */ + return; + } + + len = (addr_cells + size_cells) * realmrno * sizeof(uint32_t); + sb = buf = (uint8_t *)malloc(len); + if (!buf) + return; + + bzero(buf, len); + + for (i = 0; i < si->mr_no; i++) { + curmr = &si->mr[i]; + if (curmr->size != 0) { + /* Ensure endianess, and put cells into a buffer */ + if (addr_cells == 2) + *(uint64_t *)buf = + cpu_to_fdt64(curmr->start); + else + *(uint32_t *)buf = + cpu_to_fdt32(curmr->start); + + buf += sizeof(uint32_t) * addr_cells; + if (size_cells == 2) + *(uint64_t *)buf = + cpu_to_fdt64(curmr->size); + else + *(uint32_t *)buf = + cpu_to_fdt32(curmr->size); + + buf += sizeof(uint32_t) * size_cells; + } + } + + /* Set property */ + if ((err = fdt_setprop(fdtp, memory, "reg", sb, len)) < 0) + sprintf(command_errbuf, "Could not fixup '/memory' node.\n"); +} + +void +fixup_stdout(const char *env) +{ + const char *str; + char *ptr; + int serialno; + int len, no, sero; + const struct fdt_property *prop; + char *tmp[10]; + + str = ub_env_get(env); + ptr = (char *)str + strlen(str) - 1; + while (ptr > str && isdigit(*(str - 1))) + str--; + + if (ptr == str) + return; + + serialno = (int)strtol(ptr, NULL, 0); + no = fdt_path_offset(fdtp, "/chosen"); + if (no < 0) + return; + + prop = fdt_get_property(fdtp, no, "stdout", &len); + + /* If /chosen/stdout does not extist, create it */ + if (prop == NULL || (prop != NULL && len == 0)) { + + bzero(tmp, 10 * sizeof(char)); + strcpy((char *)&tmp, "serial"); + if (strlen(ptr) > 3) + /* Serial number too long */ + return; + + strncpy((char *)tmp + 6, ptr, 3); + sero = fdt_path_offset(fdtp, (const char *)tmp); + if (sero < 0) + /* + * If serial device we're trying to assign + * stdout to doesn't exist in DT -- return. + */ + return; + + fdt_setprop(fdtp, no, "stdout", &tmp, + strlen((char *)&tmp) + 1); + fdt_setprop(fdtp, no, "stdin", &tmp, + strlen((char *)&tmp) + 1); + } +} + +int +fdt_fixup(void) +{ + const char *env; + char *ethstr; + int chosen, err, eth_no, len; + struct sys_info *si; + + env = NULL; + eth_no = 0; + ethstr = NULL; + len = 0; + + if (!fdtp) { + err = fdt_setup_fdtp(); + if (err) { + sprintf(command_errbuf, "Could not perform blob " + "fixups. Error code: %d\n", err); + return (err); + } + } + + /* Create /chosen node (if not exists) */ + if ((chosen = fdt_subnode_offset(fdtp, 0, "chosen")) == + -FDT_ERR_NOTFOUND) + chosen = fdt_add_subnode(fdtp, 0, "chosen"); + + /* Value assigned to fixup-applied does not matter. */ + if (fdt_getprop(fdtp, chosen, "fixup-applied", NULL)) + return (CMD_OK); + + /* Acquire sys_info */ + si = ub_get_sys_info(); + + while ((env = ub_env_enum(env)) != NULL) { + if (strncmp(env, "eth", 3) == 0 && + strncmp(env + (strlen(env) - 4), "addr", 4) == 0) { + /* + * Handle Ethernet addrs: parse uboot env eth%daddr + */ + + if (!eth_no) { + /* + * Check how many chars we will need to store + * maximal eth iface number. + */ + len = strlen(STRINGIFY(TMP_MAX_ETH)) + + strlen("ethernet"); + + /* + * Reserve mem for string "ethernet" and len + * chars for iface no. + */ + ethstr = (char *)malloc(len * sizeof(char)); + bzero(ethstr, len * sizeof(char)); + strcpy(ethstr, "ethernet0"); + } + + /* Modify blob */ + fixup_ethernet(env, ethstr, ð_no, len); + + } else if (strcmp(env, "consoledev") == 0) + fixup_stdout(env); + } + + /* Modify cpu(s) and bus clock frequenties in /cpus node [Hz] */ + fixup_cpubusfreqs(si->clk_cpu, si->clk_bus); + + /* Fixup memory regions */ + fixup_memory(si); + + fdt_setprop(fdtp, chosen, "fixup-applied", NULL, 0); + + return (CMD_OK); +} + +int +command_fdt_internal(int argc, char *argv[]) +{ + cmdf_t *cmdh; + char *cmd; + int i, err; + + if (argc < 2) { + command_errmsg = "usage is 'fdt []"; + return (CMD_ERROR); + } + + /* + * Check if uboot env vars were parsed already. If not, do it now. + */ + fdt_fixup(); + + /* + * Validate fdt . + */ + cmd = strdup(argv[1]); + i = 0; + cmdh = NULL; + while (!(commands[i].name == NULL)) { + if (strcmp(cmd, commands[i].name) == 0) { + /* found it */ + cmdh = commands[i].handler; + break; + } + i++; + } + if (cmdh == NULL) { + command_errmsg = "unknown command"; + return (CMD_ERROR); + } + + if (!fdtp) + if (fdt_setup_fdtp()) + return (CMD_ERROR); + + /* + * Call command handler. + */ + err = (*cmdh)(argc, argv); + + return (err); +} + +static int +fdt_cmd_cd(int argc, char *argv[]) +{ + char *path; + char tmp[FDT_CWD_LEN]; + int len, o; + + path = (argc > 2) ? argv[2] : "/"; + + if (path[0] == '/') { + len = strlen(path); + if (len >= FDT_CWD_LEN) + goto fail; + } else { + /* Handle path specification relative to cwd */ + len = strlen(cwd) + strlen(path) + 1; + if (len >= FDT_CWD_LEN) + goto fail; + + strcpy(tmp, cwd); + strcat(tmp, "/"); + strcat(tmp, path); + path = tmp; + } + + o = fdt_path_offset(fdtp, path); + if (o < 0) { + sprintf(command_errbuf, "could not find node: '%s'", path); + return (CMD_ERROR); + } + + strcpy(cwd, path); + return (CMD_OK); + +fail: + sprintf(command_errbuf, "path too long: %d, max allowed: %d", + len, FDT_CWD_LEN - 1); + return (CMD_ERROR); +} + +static int +fdt_cmd_hdr(int argc __unused, char *argv[] __unused) +{ + char line[80]; + int ver; + + if (fdtp == NULL) { + command_errmsg = "no device tree blob pointer?!"; + return (CMD_ERROR); + } + + ver = fdt_version(fdtp); + pager_open(); + sprintf(line, "\nFlattened device tree header (%p):\n", fdtp); + pager_output(line); + sprintf(line, " magic = 0x%08x\n", fdt_magic(fdtp)); + pager_output(line); + sprintf(line, " size = %d\n", fdt_totalsize(fdtp)); + pager_output(line); + sprintf(line, " off_dt_struct = 0x%08x\n", + fdt_off_dt_struct(fdtp)); + pager_output(line); + sprintf(line, " off_dt_strings = 0x%08x\n", + fdt_off_dt_strings(fdtp)); + pager_output(line); + sprintf(line, " off_mem_rsvmap = 0x%08x\n", + fdt_off_mem_rsvmap(fdtp)); + pager_output(line); + sprintf(line, " version = %d\n", ver); + pager_output(line); + sprintf(line, " last compatible version = %d\n", + fdt_last_comp_version(fdtp)); + pager_output(line); + if (ver >= 2) { + sprintf(line, " boot_cpuid = %d\n", + fdt_boot_cpuid_phys(fdtp)); + pager_output(line); + } + if (ver >= 3) { + sprintf(line, " size_dt_strings = %d\n", + fdt_size_dt_strings(fdtp)); + pager_output(line); + } + if (ver >= 17) { + sprintf(line, " size_dt_struct = %d\n", + fdt_size_dt_struct(fdtp)); + pager_output(line); + } + pager_close(); + + return (CMD_OK); +} + +static int +fdt_cmd_ls(int argc, char *argv[]) +{ + const char *prevname[FDT_MAX_DEPTH] = { NULL }; + const char *name; + char *path; + int i, o, depth, len; + + path = (argc > 2) ? argv[2] : NULL; + if (path == NULL) + path = cwd; + + o = fdt_path_offset(fdtp, path); + if (o < 0) { + sprintf(command_errbuf, "could not find node: '%s'", path); + return (CMD_ERROR); + } + + for (depth = 0; + (o >= 0) && (depth >= 0); + o = fdt_next_node(fdtp, o, &depth)) { + + name = fdt_get_name(fdtp, o, &len); + + if (depth > FDT_MAX_DEPTH) { + printf("max depth exceeded: %d\n", depth); + continue; + } + + prevname[depth] = name; + + /* Skip root (i = 1) when printing devices */ + for (i = 1; i <= depth; i++) { + if (prevname[i] == NULL) + break; + + if (strcmp(cwd, "/") == 0) + printf("/"); + printf("%s", prevname[i]); + } + printf("\n"); + } + + return (CMD_OK); +} + +static __inline int +isprint(int c) +{ + + return (c >= ' ' && c <= 0x7e); +} + +static int +fdt_isprint(const void *data, int len, int *count) +{ + const char *d; + char ch; + int yesno, i; + + if (len == 0) + return (0); + + d = (const char *)data; + if (d[len - 1] != '\0') + return (0); + + *count = 0; + yesno = 1; + for (i = 0; i < len; i++) { + ch = *(d + i); + if (isprint(ch) || (ch == '\0' && i > 0)) { + /* Count strings */ + if (ch == '\0') + (*count)++; + continue; + } + + yesno = 0; + break; + } + + return (yesno); +} + +static int +fdt_data_str(const void *data, int len, int count, char **buf) +{ + char tmp[80], *b; + const char *d; + int i, l; + + /* + * Calculate the length for the string and allocate memory. + * + * Note len already includes at least one terminator. + */ + l = len; + if (count > 1) { + /* + * Each token had already a terminator buried in 'len', but we + * only need one eventually, don't count space for these. + */ + l -= count - 1; + + /* Each consecutive token requires a ", " separator. */ + l += count * 2; + } + /* Space for surrounding double quotes. */ + l += count * 2; + + b = (char *)malloc(l); + if (b == NULL) + return (1); + b[0] = '\0'; + + /* + * Now that we have space, format the string. + */ + i = 0; + do { + d = (const char *)data + i; + l = strlen(d) + 1; + + sprintf(tmp, "\"%s\"%s", d, + (i + l) < len ? ", " : ""); + strcat(b, tmp); + + i += l; + + } while (i < len); + *buf = b; + + return (0); +} + +static int +fdt_data_cell(const void *data, int len, char **buf) +{ + char tmp[80], *b; + const uint32_t *c; + int count, i, l; + + /* Number of cells */ + count = len / 4; + + /* + * Calculate the length for the string and allocate memory. + */ + + /* Each byte translates to 2 output characters */ + l = len * 2; + if (count > 1) { + /* Each consecutive cell requires a " " separator. */ + l += (count - 1) * 1; + } + /* Each cell will have a "0x" prefix */ + l += count * 2; + /* Space for surrounding <> and terminator */ + l += 3; + + b = (char *)malloc(l); + if (b == NULL) + return (1); + + b[0] = '\0'; + strcat(b, "<"); + + for (i = 0; i < len; i += 4) { + c = (const uint32_t *)((const uint8_t *)data + i); + sprintf(tmp, "0x%08x%s", fdt32_to_cpu(*c), + i < (len - 4) ? " " : ""); + strcat(b, tmp); + } + strcat(b, ">"); + *buf = b; + + return (0); +} + +static int +fdt_data_bytes(const void *data, int len, char **buf) +{ + char tmp[80], *b; + const char *d; + int i, l; + + /* + * Calculate the length for the string and allocate memory. + */ + + /* Each byte translates to 2 output characters */ + l = len * 2; + if (len > 1) + /* Each consecutive byte requires a " " separator. */ + l += (len - 1) * 1; + /* Each byte will have a "0x" prefix */ + l += len * 2; + /* Space for surrounding [] and terminator. */ + l += 3; + + b = (char *)malloc(l); + if (b == NULL) + return (1); + + b[0] = '\0'; + strcat(b, "["); + + for (i = 0, d = data; i < len; i++) { + sprintf(tmp, "0x%02x%s", d[i], i < len - 1 ? " " : ""); + strcat(b, tmp); + } + strcat(b, "]"); + *buf = b; + + return (0); +} + +static int +fdt_data_fmt(const void *data, int len, char **buf) +{ + int count; + + if (len == 0) { + *buf = NULL; + return (1); + } + + if (fdt_isprint(data, len, &count)) + return (fdt_data_str(data, len, count, buf)); + + else if ((len % 4) == 0) + return (fdt_data_cell(data, len, buf)); + + else + return (fdt_data_bytes(data, len, buf)); +} + +static int +fdt_prop(int offset) +{ + char *line, *buf; + const struct fdt_property *prop; + const char *name; + const void *data; + int len, rv; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 25 15:32:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B5901065686; Tue, 25 May 2010 15:32:08 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8F18FC31; Tue, 25 May 2010 15:32:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PFW8O0063089; Tue, 25 May 2010 15:32:08 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PFW89L063087; Tue, 25 May 2010 15:32:08 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005251532.o4PFW89L063087@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 25 May 2010 15:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208539 - head/sys/boot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 15:32:08 -0000 Author: raj Date: Tue May 25 15:32:07 2010 New Revision: 208539 URL: http://svn.freebsd.org/changeset/base/208539 Log: Bring a missing FDT piece (omitted in the previous commit). Modified: head/sys/boot/Makefile Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Tue May 25 15:21:39 2010 (r208538) +++ head/sys/boot/Makefile Tue May 25 15:32:07 2010 (r208539) @@ -26,6 +26,10 @@ SUBDIR+= uboot SUBDIR+= zfs .endif +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif + # Pick the machine-dependent subdir based on the target architecture. ADIR= ${MACHINE:S/amd64/i386/:S/sun4v/sparc64/} .if exists(${.CURDIR}/${ADIR}/.) From owner-svn-src-head@FreeBSD.ORG Tue May 25 16:31:17 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E533106566C; Tue, 25 May 2010 16:31:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4198A8FC17; Tue, 25 May 2010 16:31:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o4PGPITS024954; Tue, 25 May 2010 10:25:18 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 25 May 2010 10:25:22 -0600 (MDT) Message-Id: <20100525.102522.782174629775191929.imp@bsdimp.com> To: raj@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <201005251512.o4PFCLwl058548@svn.freebsd.org> References: <201005251512.o4PFCLwl058548@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208537 - in head: share/mk tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 16:31:17 -0000 In message: <201005251512.o4PFCLwl058548@svn.freebsd.org> Rafal Jaworowski writes: : +# Enable FDT by default for selected platforms. : +.if defined(TARGET_ARCH) && \ : + (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "powerpc") : +# XXX this is temporarily disabled until all FDT support code is in place. : +#_fdt= FDT : +_no_fdt= FDT : +.else : +_no_fdt= FDT : +.endif The tests here should be: .if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "powerpc" Never test against TARGET_* in our Makefile system (except that binutils, gcc and gdb all use this for piecewise compile)... Warner From owner-svn-src-head@FreeBSD.ORG Tue May 25 16:46:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9640C1065729; Tue, 25 May 2010 16:46:29 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8556D8FC0A; Tue, 25 May 2010 16:46:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PGkTfU079641; Tue, 25 May 2010 16:46:29 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PGkT6F079639; Tue, 25 May 2010 16:46:29 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201005251646.o4PGkT6F079639@svn.freebsd.org> From: Matt Jacob Date: Tue, 25 May 2010 16:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208542 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 16:46:29 -0000 Author: mjacob Date: Tue May 25 16:46:29 2010 New Revision: 208542 URL: http://svn.freebsd.org/changeset/base/208542 Log: Treat PRLI the same as PLOGI and make a database entry for it (target mode). Obtained from: Ken Merry MFC after: One Month Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue May 25 15:58:31 2010 (r208541) +++ head/sys/dev/isp/isp_freebsd.c Tue May 25 16:46:29 2010 (r208542) @@ -2609,7 +2609,14 @@ isp_handle_platform_notify_24xx(ispsoftc msg = "PRLO"; break; case PLOGI: - msg = "PLOGI"; + case PRLI: + /* + * Treat PRLI the same as PLOGI and make a database entry for it. + */ + if (inot->in_status_subcode == PLOGI) + msg = "PLOGI"; + else + msg = "PRLI"; if (ISP_FW_NEWER_THAN(isp, 4, 0, 25)) { ptr = (uint8_t *)inot; /* point to unswizzled entry! */ wwn = (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF]) << 56) | @@ -2625,8 +2632,6 @@ isp_handle_platform_notify_24xx(ispsoftc } isp_add_wwn_entry(isp, chan, wwn, nphdl, portid); break; - case PRLI: - msg = "PRLI"; break; case PDISC: msg = "PDISC"; From owner-svn-src-head@FreeBSD.ORG Tue May 25 16:50:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7FE9106566C; Tue, 25 May 2010 16:50:35 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9726F8FC15; Tue, 25 May 2010 16:50:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PGoZXs080571; Tue, 25 May 2010 16:50:35 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PGoZ5J080569; Tue, 25 May 2010 16:50:35 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201005251650.o4PGoZ5J080569@svn.freebsd.org> From: Matt Jacob Date: Tue, 25 May 2010 16:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208543 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 16:50:35 -0000 Author: mjacob Date: Tue May 25 16:50:35 2010 New Revision: 208543 URL: http://svn.freebsd.org/changeset/base/208543 Log: Remove extra break left by hand editing. X-MFC: 208542 MFC after: One Month Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue May 25 16:46:29 2010 (r208542) +++ head/sys/dev/isp/isp_freebsd.c Tue May 25 16:50:35 2010 (r208543) @@ -2632,7 +2632,6 @@ isp_handle_platform_notify_24xx(ispsoftc } isp_add_wwn_entry(isp, chan, wwn, nphdl, portid); break; - break; case PDISC: msg = "PDISC"; break; From owner-svn-src-head@FreeBSD.ORG Tue May 25 17:43:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A466A1065673; Tue, 25 May 2010 17:43:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 922F18FC16; Tue, 25 May 2010 17:43:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PHhNWk092077; Tue, 25 May 2010 17:43:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PHhNnj092075; Tue, 25 May 2010 17:43:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201005251743.o4PHhNnj092075@svn.freebsd.org> From: Xin LI Date: Tue, 25 May 2010 17:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208544 - head/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 17:43:23 -0000 Author: delphij Date: Tue May 25 17:43:23 2010 New Revision: 208544 URL: http://svn.freebsd.org/changeset/base/208544 Log: Document bc/dc and nc updates. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue May 25 16:50:35 2010 (r208543) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue May 25 17:43:23 2010 (r208544) @@ -30,6 +30,7 @@ 2007 2008 2009 + 2010 The &os; Documentation Project @@ -326,6 +327,9 @@ based on libarchive, have replaced the GNU Binutils versions of these utilities. + BSD-licensed version of &man.bc.1; and &man.dc.1; has + replaced their GNU counterparts. + &man.chflags.1; now supports a flag for verbose output and a flag to ignore errors with the same semantics as (for example) @@ -373,6 +377,9 @@ &man.nc.1; now supports a switch to disable the use of TCP options. + &man.nc.1;'s switch has been deprecated. + It will be removed in future release. + The &man.ping6.8; utility now returns 2 when the packet transmission was successful but no responses were received (this is the same behavior as &man.ping.8;). From owner-svn-src-head@FreeBSD.ORG Tue May 25 17:48:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D5DB1065670; Tue, 25 May 2010 17:48:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BC908FC1A; Tue, 25 May 2010 17:48:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PHmI5q093254; Tue, 25 May 2010 17:48:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PHmI5T093246; Tue, 25 May 2010 17:48:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201005251748.o4PHmI5T093246@svn.freebsd.org> From: Xin LI Date: Tue, 25 May 2010 17:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 17:48:18 -0000 Author: delphij Date: Tue May 25 17:48:17 2010 New Revision: 208545 URL: http://svn.freebsd.org/changeset/base/208545 Log: libarchive now needs libcrypto and liblzma. Modified: head/release/amd64/boot_crunch.conf head/release/i386/boot_crunch.conf head/release/ia64/boot_crunch.conf head/release/pc98/boot_crunch.conf head/release/powerpc/boot_crunch.conf head/release/sparc64/boot_crunch.conf head/release/sun4v/boot_crunch.conf Modified: head/release/amd64/boot_crunch.conf ============================================================================== --- head/release/amd64/boot_crunch.conf Tue May 25 17:43:23 2010 (r208544) +++ head/release/amd64/boot_crunch.conf Tue May 25 17:48:17 2010 (r208545) @@ -39,6 +39,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo -libs -lbsdxml -larchive -lbz2 -lusb -ljail +libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail Modified: head/release/i386/boot_crunch.conf ============================================================================== --- head/release/i386/boot_crunch.conf Tue May 25 17:43:23 2010 (r208544) +++ head/release/i386/boot_crunch.conf Tue May 25 17:48:17 2010 (r208545) @@ -39,6 +39,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo -libs -lbsdxml -larchive -lbz2 -lusb -ljail +libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail Modified: head/release/ia64/boot_crunch.conf ============================================================================== --- head/release/ia64/boot_crunch.conf Tue May 25 17:43:23 2010 (r208544) +++ head/release/ia64/boot_crunch.conf Tue May 25 17:48:17 2010 (r208545) @@ -44,6 +44,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs -ldevinfo -libs -lgeom -lbsdxml -larchive -lbz2 -lusb -ljail +libs -lgeom -lbsdxml -larchive -lbz2 -llzma -lusb -ljail Modified: head/release/pc98/boot_crunch.conf ============================================================================== --- head/release/pc98/boot_crunch.conf Tue May 25 17:43:23 2010 (r208544) +++ head/release/pc98/boot_crunch.conf Tue May 25 17:48:17 2010 (r208545) @@ -38,6 +38,6 @@ progs arp progs ppp progs sysinstall -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml -libs -larchive -lbz2 -ljail +libs -larchive -lbz2 -llzma -ljail Modified: head/release/powerpc/boot_crunch.conf ============================================================================== --- head/release/powerpc/boot_crunch.conf Tue May 25 17:43:23 2010 (r208544) +++ head/release/powerpc/boot_crunch.conf Tue May 25 17:48:17 2010 (r208545) @@ -44,6 +44,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs -libs -lgeom -lbsdxml -larchive -lbz2 -lusb -ljail +libs -lgeom -lbsdxml -larchive -lbz2 -llzma -lusb -ljail Modified: head/release/sparc64/boot_crunch.conf ============================================================================== --- head/release/sparc64/boot_crunch.conf Tue May 25 17:43:23 2010 (r208544) +++ head/release/sparc64/boot_crunch.conf Tue May 25 17:48:17 2010 (r208545) @@ -39,6 +39,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml -libs -larchive -lbz2 -lusb -ljail +libs -larchive -lbz2 -llzma -lusb -ljail Modified: head/release/sun4v/boot_crunch.conf ============================================================================== --- head/release/sun4v/boot_crunch.conf Tue May 25 17:43:23 2010 (r208544) +++ head/release/sun4v/boot_crunch.conf Tue May 25 17:48:17 2010 (r208545) @@ -39,6 +39,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml -libs -larchive -lbz2 -lusb -ljail +libs -larchive -lbz2 -llzma -lusb -ljail From owner-svn-src-head@FreeBSD.ORG Tue May 25 18:10:43 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (unknown [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 1AB76106566C; Tue, 25 May 2010 18:10:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Tue, 25 May 2010 14:10:33 -0400 User-Agent: KMail/1.6.2 References: <201005251748.o4PHmI5T093246@svn.freebsd.org> In-Reply-To: <201005251748.o4PHmI5T093246@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201005251410.35630.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Xin LI Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 18:10:43 -0000 On Tuesday 25 May 2010 01:48 pm, Xin LI wrote: > Author: delphij > Date: Tue May 25 17:48:17 2010 > New Revision: 208545 > URL: http://svn.freebsd.org/changeset/base/208545 > > Log: > libarchive now needs libcrypto and liblzma. > > Modified: > head/release/amd64/boot_crunch.conf > head/release/i386/boot_crunch.conf > head/release/ia64/boot_crunch.conf > head/release/pc98/boot_crunch.conf > head/release/powerpc/boot_crunch.conf > head/release/sparc64/boot_crunch.conf > head/release/sun4v/boot_crunch.conf misc/146904? Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Tue May 25 18:34:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2FFA106566C; Tue, 25 May 2010 18:34:37 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id 512C18FC0C; Tue, 25 May 2010 18:34:37 +0000 (UTC) Received: by qyk11 with SMTP id 11so8107662qyk.13 for ; Tue, 25 May 2010 11:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=yqY5Z0CtCUEr+38sTNc4SlO3pz9T0RlNBSkmdJtE5JA=; b=Wm068W+W4ULwV+YVtlgRiQdU+SDF7dYppuKO96wcK/6XcZPPvQgmutyX6OLz/UnHM2 lxTDKN77awfej1HDI0y378uEu7BcU5zLqFzkXELBasBhHeLEj0xG3iRYtXw8BCQjHiUp fNQml/lizAyP8GFzv+RIwiPizhX612nMRBimI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=UiLQK0SLORTkXvg10wKVLYlFNXYSCD25Z7pf2Kcj+n6qpJ8xMl4Ngp+2wKACYOCfzI H2NCHOPea5d05J20ZaX4n5C7Ol16feVXLlWo0FRrOuxD5SWG7EFmsvAzsozpsdBfiiOr VkcQPOMRJOjQSsB9daizpgKFppBO2AZviR2iY= MIME-Version: 1.0 Received: by 10.224.79.79 with SMTP id o15mr4288214qak.365.1274812476356; Tue, 25 May 2010 11:34:36 -0700 (PDT) Received: by 10.229.190.83 with HTTP; Tue, 25 May 2010 11:34:36 -0700 (PDT) In-Reply-To: <201005251410.35630.jkim@FreeBSD.org> References: <201005251748.o4PHmI5T093246@svn.freebsd.org> <201005251410.35630.jkim@FreeBSD.org> Date: Tue, 25 May 2010 11:34:36 -0700 Message-ID: From: Garrett Cooper To: Jung-uk Kim Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 18:34:38 -0000 On Tue, May 25, 2010 at 11:10 AM, Jung-uk Kim wrote: > On Tuesday 25 May 2010 01:48 pm, Xin LI wrote: >> Author: delphij >> Date: Tue May 25 17:48:17 2010 >> New Revision: 208545 >> URL: http://svn.freebsd.org/changeset/base/208545 >> >> Log: >> =A0 libarchive now needs libcrypto and liblzma. >> >> Modified: >> =A0 head/release/amd64/boot_crunch.conf >> =A0 head/release/i386/boot_crunch.conf >> =A0 head/release/ia64/boot_crunch.conf >> =A0 head/release/pc98/boot_crunch.conf >> =A0 head/release/powerpc/boot_crunch.conf >> =A0 head/release/sparc64/boot_crunch.conf >> =A0 head/release/sun4v/boot_crunch.conf > > misc/146904? joerg brought up an interesting item on #bsddev: <@joerg> seeing Xin Li's last commit: does libmd contain SHA256 and SHA512? lzma doesn't use SHA512, but it does use SHA256. So does it actually need libcrypto now that libmd is included, or was it a bad analysis by your's truly? Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Tue May 25 18:35:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC877106568D; Tue, 25 May 2010 18:35:10 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 45D108FC0A; Tue, 25 May 2010 18:35:10 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id o4PIZ80B049865; Tue, 25 May 2010 20:35:09 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id o4PIZ8j4049864; Tue, 25 May 2010 20:35:08 +0200 (CEST) (envelope-from marius) Date: Tue, 25 May 2010 20:35:08 +0200 From: Marius Strobl To: Xin LI Message-ID: <20100525183508.GD49967@alchemy.franken.de> References: <201005251748.o4PHmI5T093246@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201005251748.o4PHmI5T093246@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 18:35:10 -0000 On Tue, May 25, 2010 at 05:48:18PM +0000, Xin LI wrote: > Author: delphij > Date: Tue May 25 17:48:17 2010 > New Revision: 208545 > URL: http://svn.freebsd.org/changeset/base/208545 > > Log: > libarchive now needs libcrypto and liblzma. > > Modified: > head/release/amd64/boot_crunch.conf > head/release/i386/boot_crunch.conf > head/release/ia64/boot_crunch.conf > head/release/pc98/boot_crunch.conf > head/release/powerpc/boot_crunch.conf > head/release/sparc64/boot_crunch.conf > head/release/sun4v/boot_crunch.conf > > Modified: head/release/amd64/boot_crunch.conf > ============================================================================== > --- head/release/amd64/boot_crunch.conf Tue May 25 17:43:23 2010 (r208544) > +++ head/release/amd64/boot_crunch.conf Tue May 25 17:48:17 2010 (r208545) > @@ -39,6 +39,6 @@ progs ppp > progs sysinstall > progs usbconfig > > -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph > +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph > libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo > -libs -lbsdxml -larchive -lbz2 -lusb -ljail > +libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail > Hrm, wasn't the idea to keep libcrypto and crypto in general out of the install image (see the RELEASE_CRUNCH bits in various Makefiles) in order to be able use them regardless of crypto export/import restrictions? Marius From owner-svn-src-head@FreeBSD.ORG Tue May 25 19:25:37 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45B901065676; Tue, 25 May 2010 19:25:37 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 399FD8FC17; Tue, 25 May 2010 19:25:36 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 0F419A678C0; Wed, 26 May 2010 03:25:34 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id FMxVb8pLuIBF; Wed, 26 May 2010 03:25:27 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id B7E4BA6789F; Wed, 26 May 2010 03:25:23 +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=kg7rowLfBZX2yKQIeMJZID/nkMDR+pu56adNRJgunTJ7ibr2RpPqr2bSI42T0y5uf dyQKeuLYIzwG68HHBIFjA== Message-ID: <4BFC241E.5080001@delphij.net> Date: Tue, 25 May 2010 12:25:18 -0700 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100408 Thunderbird/3.0.4 ThunderBrowse/3.2.8.1 MIME-Version: 1.0 To: Marius Strobl References: <201005251748.o4PHmI5T093246@svn.freebsd.org> <20100525183508.GD49967@alchemy.franken.de> In-Reply-To: <20100525183508.GD49967@alchemy.franken.de> X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 19:25:37 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2010/05/25 11:35, Marius Strobl wrote: > On Tue, May 25, 2010 at 05:48:18PM +0000, Xin LI wrote: >> Author: delphij >> Date: Tue May 25 17:48:17 2010 >> New Revision: 208545 >> URL: http://svn.freebsd.org/changeset/base/208545 >> >> Log: >> libarchive now needs libcrypto and liblzma. >> >> Modified: >> head/release/amd64/boot_crunch.conf >> head/release/i386/boot_crunch.conf >> head/release/ia64/boot_crunch.conf >> head/release/pc98/boot_crunch.conf >> head/release/powerpc/boot_crunch.conf >> head/release/sparc64/boot_crunch.conf >> head/release/sun4v/boot_crunch.conf >> >> Modified: head/release/amd64/boot_crunch.conf >> ============================================================================== >> --- head/release/amd64/boot_crunch.conf Tue May 25 17:43:23 2010 (r208544) >> +++ head/release/amd64/boot_crunch.conf Tue May 25 17:48:17 2010 (r208545) >> @@ -39,6 +39,6 @@ progs ppp >> progs sysinstall >> progs usbconfig >> >> -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph >> +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph >> libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo >> -libs -lbsdxml -larchive -lbz2 -lusb -ljail >> +libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail >> > > Hrm, wasn't the idea to keep libcrypto and crypto in general > out of the install image (see the RELEASE_CRUNCH bits in various > Makefiles) in order to be able use them regardless of crypto > export/import restrictions? Ah... I'm not sure about the crypto export/import restrictions :-/ However, in 2004, there was a discussion [1] about making crypto integrated part of the base system (the 'crypto' distribution was removed in Aug 2004). Could someone familiar with US laws chime in this? [1] http://docs.freebsd.org/cgi/mid.cgi?6.1.0.6.1.20040427094029.03d3d218 Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBCAAGBQJL/CQeAAoJEATO+BI/yjfBe9AH/jrTPHw84gWwPHMb25tHM4BC PIr4DP3CB8nzr3DDaJXMF172eoctDO7+C4xMr0OjU/rfq+xVtwEZ5Pig8ZN7Yg5Z NfCxQpKc0v7wZe5ljQwx7mhovZKKPK1c+Jj/P5X1Jg90n5KbPHL64nzEASojfTR1 mREIiRwG2DzDIOLRC2wYD+JJPFJFLurRUDhjqbeDNxUYKnDq8dUFFx0Hb/ibQ66C Tdb2mdZGOTgqCrmG3/ibS3m+/Xl9JUWWV7VZhPbf5aCiinbPiajVlkYnv7cNv2ZB OtY+7JxjRJB9X9ebwH7CaiGdjDfQAcdbnR7g0sUgT9iNPwHux2qXIkEMToNQkiw= =uMvC -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue May 25 20:06:30 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A8F81065676; Tue, 25 May 2010 20:06:30 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id AB6998FC1A; Tue, 25 May 2010 20:06:29 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 6A856A6791A; Wed, 26 May 2010 04:06:28 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id linYtuuiQpHs; Wed, 26 May 2010 04:06:23 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id B8558A678E9; Wed, 26 May 2010 04:06:20 +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=fmlokI6UZzaTiSzLxB0i8sl1h3IzDm6nIQYEHt0GQWmA88jx5bFI/AqSJg7AQvOtH Y5JqozMe8QMPRpmh0o7qA== Message-ID: <4BFC2DB9.4090509@delphij.net> Date: Tue, 25 May 2010 13:06:17 -0700 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100408 Thunderbird/3.0.4 ThunderBrowse/3.2.8.1 MIME-Version: 1.0 To: Garrett Cooper References: <201005251748.o4PHmI5T093246@svn.freebsd.org> <201005251410.35630.jkim@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI , Jung-uk Kim Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 20:06:30 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2010/05/25 11:34, Garrett Cooper wrote: > On Tue, May 25, 2010 at 11:10 AM, Jung-uk Kim wrote: >> On Tuesday 25 May 2010 01:48 pm, Xin LI wrote: >>> Author: delphij >>> Date: Tue May 25 17:48:17 2010 >>> New Revision: 208545 >>> URL: http://svn.freebsd.org/changeset/base/208545 >>> >>> Log: >>> libarchive now needs libcrypto and liblzma. >>> >>> Modified: >>> head/release/amd64/boot_crunch.conf >>> head/release/i386/boot_crunch.conf >>> head/release/ia64/boot_crunch.conf >>> head/release/pc98/boot_crunch.conf >>> head/release/powerpc/boot_crunch.conf >>> head/release/sparc64/boot_crunch.conf >>> head/release/sun4v/boot_crunch.conf >> >> misc/146904? > > joerg brought up an interesting item on #bsddev: > > <@joerg> seeing Xin Li's last commit: does libmd contain SHA256 and SHA512? > > lzma doesn't use SHA512, but it does use SHA256. > > So does it actually need libcrypto now that libmd is included, or was > it a bad analysis by your's truly? No, it's not about lzma but because libarchive's mtree support. For some reason our config_freebsd.h designates the OpenSSL symbols rather than libmd implementation of MD5, etc., which are used in libarchive's mtree. I'm not going to touch libarchive yet since I'm not familiar with the code enough to under the consequences if we switch over to libmd's implementation. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBCAAGBQJL/C25AAoJEATO+BI/yjfBShAH/0gc/KjjVZCMgM+7LHYt9PYN W3fEqGPA2D78rM9ypWG24Je2jno6belyXAmN9ljgEQwYYwk5LWaxL53hLFFl5oMb I8sQrGQoQME2fPIh/9vX2Uooud448iqnWCLiB3uiFgQV4Kq/P0F26AZdR1o5jayk kdPYsPDI5tgpVk1EsudS8iAdTdCFZJpRGJ1ZDeJEg5zgYjIEsMvVuxydaU9OB6/8 dbD4OuVNo+o6LidXUim2aWzEZ5s+bWLSzWN+XVKjJhTxqbVOvF+I79j6VbD4BOYn 2jQFnW1uVlQA9tzONRw8KvN1TzZiC/o4UGX3S5ZLiSY43wBDilvYKa5BfoinYLc= =KTmH -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue May 25 20:19:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 806141065670; Tue, 25 May 2010 20:19:45 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 701868FC29; Tue, 25 May 2010 20:19:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PKJjZC027108; Tue, 25 May 2010 20:19:45 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PKJjne027106; Tue, 25 May 2010 20:19:45 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201005252019.o4PKJjne027106@svn.freebsd.org> From: Matt Jacob Date: Tue, 25 May 2010 20:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208548 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 20:19:45 -0000 Author: mjacob Date: Tue May 25 20:19:45 2010 New Revision: 208548 URL: http://svn.freebsd.org/changeset/base/208548 Log: Don't leak CCBs for every ABORT. Submitted by: Ken Merry MFC after: One week Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue May 25 20:19:31 2010 (r208547) +++ head/sys/dev/isp/isp_freebsd.c Tue May 25 20:19:45 2010 (r208548) @@ -4421,7 +4421,10 @@ isp_action(struct cam_sim *sim, union cc ccb->ccb_h.status = CAM_REQ_INVALID; break; } - xpt_done(ccb); + /* + * This is not a queued CCB, so the caller expects it to be + * complete when control is returned. + */ break; } #define IS_CURRENT_SETTINGS(c) (c->type == CTS_TYPE_CURRENT_SETTINGS) From owner-svn-src-head@FreeBSD.ORG Tue May 25 20:42:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 428C31065676; Tue, 25 May 2010 20:42:36 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3192F8FC08; Tue, 25 May 2010 20:42:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PKgab9032471; Tue, 25 May 2010 20:42:36 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PKgZdd032462; Tue, 25 May 2010 20:42:35 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201005252042.o4PKgZdd032462@svn.freebsd.org> From: Qing Li Date: Tue, 25 May 2010 20:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208553 - in head/sys: net netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 20:42:36 -0000 Author: qingli Date: Tue May 25 20:42:35 2010 New Revision: 208553 URL: http://svn.freebsd.org/changeset/base/208553 Log: This patch fixes the problem where proxy ARP entries cannot be added over the if_ng interface. MFC after: 3 days Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/net/route.c head/sys/net/rtsock.c head/sys/netinet/in.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_options.c head/sys/netinet/ip_output.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue May 25 20:35:39 2010 (r208552) +++ head/sys/net/if.c Tue May 25 20:42:35 2010 (r208553) @@ -1607,7 +1607,7 @@ done: * is most specific found. */ struct ifaddr * -ifa_ifwithnet(struct sockaddr *addr) +ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1639,7 +1639,8 @@ ifa_ifwithnet(struct sockaddr *addr) if (ifa->ifa_addr->sa_family != af) next: continue; - if (af == AF_INET && ifp->if_flags & IFF_POINTOPOINT) { + if (af == AF_INET && + ifp->if_flags & IFF_POINTOPOINT && !ignore_ptp) { /* * This is a bit broken as it doesn't * take into account that the remote end may Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue May 25 20:35:39 2010 (r208552) +++ head/sys/net/if_var.h Tue May 25 20:42:35 2010 (r208553) @@ -873,7 +873,7 @@ struct ifaddr *ifa_ifwithaddr(struct soc int ifa_ifwithaddr_check(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); -struct ifaddr *ifa_ifwithnet(struct sockaddr *); +struct ifaddr *ifa_ifwithnet(struct sockaddr *, int); struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); struct ifaddr *ifa_ifwithroute_fib(int, struct sockaddr *, struct sockaddr *, u_int); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue May 25 20:35:39 2010 (r208552) +++ head/sys/net/route.c Tue May 25 20:42:35 2010 (r208553) @@ -519,7 +519,7 @@ rtredirect_fib(struct sockaddr *dst, } /* verify the gateway is directly reachable */ - if ((ifa = ifa_ifwithnet(gateway)) == NULL) { + if ((ifa = ifa_ifwithnet(gateway, 0)) == NULL) { error = ENETUNREACH; goto out; } @@ -686,7 +686,7 @@ ifa_ifwithroute_fib(int flags, struct so ifa = ifa_ifwithdstaddr(gateway); } if (ifa == NULL) - ifa = ifa_ifwithnet(gateway); + ifa = ifa_ifwithnet(gateway, 0); if (ifa == NULL) { struct rtentry *rt = rtalloc1_fib(gateway, 0, RTF_RNH_LOCKED, fibnum); if (rt == NULL) @@ -797,7 +797,7 @@ rt_getifa_fib(struct rt_addrinfo *info, */ if (info->rti_ifp == NULL && ifpaddr != NULL && ifpaddr->sa_family == AF_LINK && - (ifa = ifa_ifwithnet(ifpaddr)) != NULL) { + (ifa = ifa_ifwithnet(ifpaddr, 0)) != NULL) { info->rti_ifp = ifa->ifa_ifp; ifa_free(ifa); } Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue May 25 20:35:39 2010 (r208552) +++ head/sys/net/rtsock.c Tue May 25 20:42:35 2010 (r208553) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -673,12 +674,22 @@ route_output(struct mbuf *m, struct sock * another search to retrieve the prefix route of * the local end point of the PPP link. */ - if ((rtm->rtm_flags & RTF_ANNOUNCE) && - (rt->rt_ifp->if_flags & IFF_POINTOPOINT)) { + if (rtm->rtm_flags & RTF_ANNOUNCE) { struct sockaddr laddr; - rt_maskedcopy(rt->rt_ifa->ifa_addr, - &laddr, - rt->rt_ifa->ifa_netmask); + + if (rt->rt_ifp != NULL && + rt->rt_ifp->if_type == IFT_PROPVIRTUAL) { + struct ifaddr *ifa; + + ifa = ifa_ifwithnet(info.rti_info[RTAX_DST], 1); + if (ifa != NULL) + rt_maskedcopy(ifa->ifa_addr, + &laddr, + ifa->ifa_netmask); + } else + rt_maskedcopy(rt->rt_ifa->ifa_addr, + &laddr, + rt->rt_ifa->ifa_netmask); /* * refactor rt and no lock operation necessary */ Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue May 25 20:35:39 2010 (r208552) +++ head/sys/netinet/in.c Tue May 25 20:42:35 2010 (r208553) @@ -1379,8 +1379,9 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ /* XXX rtalloc1 should take a const param */ rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); - if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || - ((rt->rt_ifp != ifp) && !(flags & LLE_PUB))) { + if (rt == NULL || (!(flags & LLE_PUB) && + ((rt->rt_flags & RTF_GATEWAY) || + (rt->rt_ifp != ifp)))) { #ifdef DIAGNOSTIC log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue May 25 20:35:39 2010 (r208552) +++ head/sys/netinet/in_pcb.c Tue May 25 20:42:35 2010 (r208553) @@ -631,7 +631,7 @@ in_pcbladdr(struct inpcb *inp, struct in ia = ifatoia(ifa_ifwithdstaddr((struct sockaddr *)sin)); if (ia == NULL) - ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin)); + ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin, 0)); if (ia == NULL) { error = ENETUNREACH; goto done; @@ -748,7 +748,7 @@ in_pcbladdr(struct inpcb *inp, struct in ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain))); if (ia == NULL) - ia = ifatoia(ifa_ifwithnet(sintosa(&sain))); + ia = ifatoia(ifa_ifwithnet(sintosa(&sain), 0)); if (ia == NULL) ia = ifatoia(ifa_ifwithaddr(sintosa(&sain))); Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Tue May 25 20:35:39 2010 (r208552) +++ head/sys/netinet/ip_options.c Tue May 25 20:42:35 2010 (r208553) @@ -228,7 +228,7 @@ dropit: #define INA struct in_ifaddr * #define SA struct sockaddr * if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == NULL) - ia = (INA)ifa_ifwithnet((SA)&ipaddr); + ia = (INA)ifa_ifwithnet((SA)&ipaddr, 0); } else /* XXX MRT 0 for routing */ ia = ip_rtaddr(ipaddr.sin_addr, M_GETFIB(m)); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Tue May 25 20:35:39 2010 (r208552) +++ head/sys/netinet/ip_output.c Tue May 25 20:42:35 2010 (r208553) @@ -244,7 +244,7 @@ again: isbroadcast = 1; } else if (flags & IP_ROUTETOIF) { if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL && - (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == NULL) { + (ia = ifatoia(ifa_ifwithnet(sintosa(dst), 0))) == NULL) { IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; From owner-svn-src-head@FreeBSD.ORG Tue May 25 21:20:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AD4A1065672; Tue, 25 May 2010 21:20:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 578EB8FC19; Tue, 25 May 2010 21:20:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PLKuPt040998; Tue, 25 May 2010 21:20:56 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PLKuda040990; Tue, 25 May 2010 21:20:56 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201005252120.o4PLKuda040990@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 25 May 2010 21:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208554 - in head: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/input sys/modules/usb/uep X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 21:20:56 -0000 Author: glebius Date: Tue May 25 21:20:56 2010 New Revision: 208554 URL: http://svn.freebsd.org/changeset/base/208554 Log: Add uep(4), driver for USB onscreen touch panel from eGalax. The driver is stub. It just creates device entry and feeds reassembled packets from hardware into it. If in future we would port wsmouse(4) from NetBSD, or make sysmouse(4) to support absolute motion events, then the driver can be extended to act as system mouse. Meanwhile, it just presents a /dev/uep0, that can be utilized by X driver, that I am going to commit to ports tree soon. The name for the driver is chosen to be the same as in NetBSD, however, due to different USB stacks this driver isn't a port. Added: head/share/man/man4/uep.4 (contents, props changed) head/sys/dev/usb/input/uep.c (contents, props changed) head/sys/modules/usb/uep/ head/sys/modules/usb/uep/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/dev/usb/usbdevs Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue May 25 20:42:35 2010 (r208553) +++ head/share/man/man4/Makefile Tue May 25 21:20:56 2010 (r208554) @@ -435,6 +435,7 @@ MAN= aac.4 \ udav.4 \ udbp.4 \ udp.4 \ + uep.4 \ ufm.4 \ ufoma.4 \ uftdi.4 \ Added: head/share/man/man4/uep.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/uep.4 Tue May 25 21:20:56 2010 (r208554) @@ -0,0 +1,79 @@ +.\" Copyright (c) 2010 Gleb Smirnoff +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 25, 2010 +.Dt UEP 4 +.Os +.Sh NAME +.Nm uep +.Nd eGalax touchscreen driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines into +your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device uep" +.Cd "device usb" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +uep_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the eGalax onscreen touch panels. +.Pp +The driver is stub. +It just probes and attaches to USB device, creates device entry +and feeds reassambled packets from the hardware to it. +.Pp +To get mouse working in +.Xr X 7 , +one needs to install +.Pa ports/x11-drivers/xf86-input-egalax . +.Sh BUGS +.Nm +can't act like +.Xr sysmouse 4 , +since the latter does not support absolute motion events. +.Sh FILES +.Nm +creates a blocking pseudo\-device file, +.Pa /dev/uep0 . +.Sh SEE ALSO +.Xr usb 4 , +.Xr loader.conf 5 , +.Xr xorg.conf 5 Pq Pa ports/x11/xorg , +.Xr egalax 4 Pq Pa ports/x11-drivers/xf86-input-egalax . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Gleb Smirnoff Aq glebius@FreeBSD.org Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue May 25 20:42:35 2010 (r208553) +++ head/sys/conf/NOTES Tue May 25 21:20:56 2010 (r208554) @@ -2627,6 +2627,8 @@ device umct device umodem # USB mouse device ums +# eGalax USB touch screen +device uep # Diamond Rio 500 MP3 player device urio # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 25 20:42:35 2010 (r208553) +++ head/sys/conf/files Tue May 25 21:20:56 2010 (r208554) @@ -1781,6 +1781,7 @@ dev/usb/misc/udbp.c optional udbp # USB input drivers # dev/usb/input/atp.c optional atp +dev/usb/input/uep.c optional uep dev/usb/input/uhid.c optional uhid dev/usb/input/ukbd.c optional ukbd dev/usb/input/ums.c optional ums Added: head/sys/dev/usb/input/uep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/input/uep.c Tue May 25 21:20:56 2010 (r208554) @@ -0,0 +1,441 @@ +/*- + * Copyright 2010, Gleb Smirnoff + * 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$ + */ + +/* + * http://home.eeti.com.tw/web20/drivers/Software%20Programming%20Guide_v2.0.pdf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "usbdevs.h" + +#include +#include +#include + +#define USB_DEBUG_VAR uep_debug +#include + +#ifdef USB_DEBUG +static int uep_debug = 0; + +SYSCTL_NODE(_hw_usb, OID_AUTO, uep, CTLFLAG_RW, 0, "USB uep"); +SYSCTL_INT(_hw_usb_uep, OID_AUTO, debug, CTLFLAG_RW, + &uep_debug, 0, "Debug level"); +#endif + +#define UEP_MAX_X 2047 +#define UEP_MAX_Y 2047 + +#define UEP_DOWN 0x01 +#define UEP_PACKET_LEN_MAX 16 +#define UEP_PACKET_LEN_REPORT 5 +#define UEP_PACKET_LEN_REPORT2 6 +#define UEP_PACKET_DIAG 0x0a +#define UEP_PACKET_REPORT_MASK 0xe0 +#define UEP_PACKET_REPORT 0x80 +#define UEP_PACKET_REPORT_PRESSURE 0xc0 +#define UEP_PACKET_REPORT_PLAYER 0xa0 +#define UEP_PACKET_LEN_MASK + +#define UEP_FIFO_BUF_SIZE 8 /* bytes */ +#define UEP_FIFO_QUEUE_MAXLEN 50 /* units */ + +enum { + UEP_INTR_DT, + UEP_N_TRANSFER, +}; + +struct uep_softc { + struct mtx mtx; + + struct usb_xfer *xfer[UEP_N_TRANSFER]; + struct usb_fifo_sc fifo; + + u_int pollrate; + u_int state; +#define UEP_ENABLED 0x01 + + /* Reassembling buffer. */ + u_char buf[UEP_PACKET_LEN_MAX]; + uint8_t buf_len; +}; + +static usb_callback_t uep_intr_callback; + +static device_probe_t uep_probe; +static device_attach_t uep_attach; +static device_detach_t uep_detach; + +static usb_fifo_cmd_t uep_start_read; +static usb_fifo_cmd_t uep_stop_read; +static usb_fifo_open_t uep_open; +static usb_fifo_close_t uep_close; + +static void uep_put_queue(struct uep_softc *, u_char *); + +static struct usb_fifo_methods uep_fifo_methods = { + .f_open = &uep_open, + .f_close = &uep_close, + .f_start_read = &uep_start_read, + .f_stop_read = &uep_stop_read, + .basename[0] = "uep", +}; + +static int +get_pkt_len(u_char *buf) +{ + if (buf[0] == UEP_PACKET_DIAG) { + int len; + + len = buf[1] + 2; + if (len > UEP_PACKET_LEN_MAX) { + DPRINTF("bad packet len %u\n", len); + return (UEP_PACKET_LEN_MAX); + } + + return (len); + } + + switch (buf[0] & UEP_PACKET_REPORT_MASK) { + case UEP_PACKET_REPORT: + return (UEP_PACKET_LEN_REPORT); + case UEP_PACKET_REPORT_PRESSURE: + case UEP_PACKET_REPORT_PLAYER: + case UEP_PACKET_REPORT_PRESSURE | UEP_PACKET_REPORT_PLAYER: + return (UEP_PACKET_LEN_REPORT2); + default: + DPRINTF("bad packet len 0\n"); + return (0); + } +} + +static void +uep_process_pkt(struct uep_softc *sc, u_char *buf) +{ + int32_t x, y; + + if ((buf[0] & 0xFE) != 0x80) { + DPRINTF("bad input packet format 0x%.2x\n", buf[0]); + return; + } + + /* + * Packet format is 5 bytes: + * + * 1000000T + * 0000AAAA + * 0AAAAAAA + * 0000BBBB + * 0BBBBBBB + * + * T: 1=touched 0=not touched + * A: bits of axis A position, MSB to LSB + * B: bits of axis B position, MSB to LSB + * + * For the unit I have, which is CTF1020-S from CarTFT.com, + * A = X and B = Y. But in NetBSD uep(4) it is other way round :) + * + * The controller sends a stream of T=1 events while the + * panel is touched, followed by a single T=0 event. + * + */ + + x = (buf[1] << 7) | buf[2]; + y = (buf[3] << 7) | buf[4]; + + DPRINTFN(2, "x %u y %u\n", x, y); + + uep_put_queue(sc, buf); +} + +static void +uep_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uep_softc *sc = usbd_xfer_softc(xfer); + int len; + + usbd_xfer_status(xfer, &len, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + { + struct usb_page_cache *pc; + u_char buf[17], *p; + int pkt_len; + + if (len > sizeof(buf)) { + DPRINTF("bad input length %d\n", len); + goto tr_setup; + } + + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_out(pc, 0, buf, len); + + /* + * The below code mimics Linux a lot. I don't know + * why NetBSD reads complete packets, but we need + * to reassamble 'em like Linux does (tries?). + */ + if (sc->buf_len > 0) { + int res; + + if (sc->buf_len == 1) + sc->buf[1] = buf[0]; + + if ((pkt_len = get_pkt_len(sc->buf)) == 0) + goto tr_setup; + + res = pkt_len - sc->buf_len; + memcpy(sc->buf + sc->buf_len, buf, res); + uep_process_pkt(sc, sc->buf); + sc->buf_len = 0; + + p = buf + res; + len -= res; + } else + p = buf; + + if (len == 1) { + sc->buf[0] = buf[0]; + sc->buf_len = 1; + + goto tr_setup; + } + + while (len > 0) { + if ((pkt_len = get_pkt_len(p)) == 0) + goto tr_setup; + + /* full packet: process */ + if (pkt_len <= len) { + uep_process_pkt(sc, p); + } else { + /* incomplete packet: save in buffer */ + memcpy(sc->buf, p, len); + sc->buf_len = len; + } + p += pkt_len; + len -= pkt_len; + } + } + case USB_ST_SETUP: + tr_setup: + /* check if we can put more data into the FIFO */ + if (usb_fifo_put_bytes_max(sc->fifo.fp[USB_FIFO_RX]) != 0) { + usbd_xfer_set_frame_len(xfer, 0, + usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + } + break; + + default: + if (error != USB_ERR_CANCELLED) { + /* try clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static const struct usb_config uep_config[UEP_N_TRANSFER] = { + [UEP_INTR_DT] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &uep_intr_callback, + }, +}; + +static int +uep_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + + if ((uaa->info.idVendor == USB_VENDOR_EGALAX) && + ((uaa->info.idProduct == USB_PRODUCT_EGALAX_TPANEL) || + (uaa->info.idProduct == USB_PRODUCT_EGALAX_TPANEL2))) + return (BUS_PROBE_SPECIFIC); + + if ((uaa->info.idVendor == USB_VENDOR_EGALAX2) && + (uaa->info.idProduct == USB_PRODUCT_EGALAX2_TPANEL)) + return (BUS_PROBE_SPECIFIC); + + return (ENXIO); +} + +static int +uep_attach(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + struct uep_softc *sc = device_get_softc(dev); + int error; + + device_set_usb_desc(dev); + + mtx_init(&sc->mtx, "uep lock", NULL, MTX_DEF); + + error = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, + sc->xfer, uep_config, UEP_N_TRANSFER, sc, &sc->mtx); + + if (error) { + DPRINTF("usbd_transfer_setup error=%s\n", usbd_errstr(error)); + goto detach; + } + + error = usb_fifo_attach(uaa->device, sc, &sc->mtx, &uep_fifo_methods, + &sc->fifo, device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex, + UID_ROOT, GID_OPERATOR, 0644); + + if (error) { + DPRINTF("usb_fifo_attach error=%s\n", usbd_errstr(error)); + goto detach; + } + + sc->buf_len = 0; + + return (0); + +detach: + uep_detach(dev); + + return (ENOMEM); /* XXX */ +} + +static int +uep_detach(device_t dev) +{ + struct uep_softc *sc = device_get_softc(dev); + + usb_fifo_detach(&sc->fifo); + + usbd_transfer_unsetup(sc->xfer, UEP_N_TRANSFER); + + mtx_destroy(&sc->mtx); + + return (0); +} + +static void +uep_start_read(struct usb_fifo *fifo) +{ + struct uep_softc *sc = usb_fifo_softc(fifo); + u_int rate; + + if ((rate = sc->pollrate) > 1000) + rate = 1000; + + if (rate > 0 && sc->xfer[UEP_INTR_DT] != NULL) { + usbd_transfer_stop(sc->xfer[UEP_INTR_DT]); + usbd_xfer_set_interval(sc->xfer[UEP_INTR_DT], 1000 / rate); + sc->pollrate = 0; + } + + usbd_transfer_start(sc->xfer[UEP_INTR_DT]); +} + +static void +uep_stop_read(struct usb_fifo *fifo) +{ + struct uep_softc *sc = usb_fifo_softc(fifo); + + usbd_transfer_stop(sc->xfer[UEP_INTR_DT]); +} + +static void +uep_put_queue(struct uep_softc *sc, u_char *buf) +{ + usb_fifo_put_data_linear(sc->fifo.fp[USB_FIFO_RX], buf, + UEP_PACKET_LEN_REPORT, 1); +} + +static int +uep_open(struct usb_fifo *fifo, int fflags) +{ + if (fflags & FREAD) { + struct uep_softc *sc = usb_fifo_softc(fifo); + + if (sc->state & UEP_ENABLED) + return (EBUSY); + if (usb_fifo_alloc_buffer(fifo, UEP_FIFO_BUF_SIZE, + UEP_FIFO_QUEUE_MAXLEN)) + return (ENOMEM); + + sc->state |= UEP_ENABLED; + } + + return (0); +} + +static void +uep_close(struct usb_fifo *fifo, int fflags) +{ + if (fflags & FREAD) { + struct uep_softc *sc = usb_fifo_softc(fifo); + + sc->state &= ~(UEP_ENABLED); + usb_fifo_free_buffer(fifo); + } +} + +static devclass_t uep_devclass; + +static device_method_t uep_methods[] = { + DEVMETHOD(device_probe, uep_probe), + DEVMETHOD(device_attach, uep_attach), + DEVMETHOD(device_detach, uep_detach), + { 0, 0 }, +}; + +static driver_t uep_driver = { + .name = "uep", + .methods = uep_methods, + .size = sizeof(struct uep_softc), +}; + +DRIVER_MODULE(uep, uhub, uep_driver, uep_devclass, NULL, NULL); +MODULE_DEPEND(uep, usb, 1, 1, 1); Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue May 25 20:42:35 2010 (r208553) +++ head/sys/dev/usb/usbdevs Tue May 25 21:20:56 2010 (r208554) @@ -1378,6 +1378,11 @@ product EDIMAX RT2870_1 0x7711 RT2870 product EDIMAX EW7717 0x7717 EW-7717 product EDIMAX EW7718 0x7718 EW-7718 +/* eGalax Products */ +product EGALAX TPANEL 0x0001 Touch Panel +product EGALAX TPANEL2 0x0002 Touch Panel +product EGALAX2 TPANEL 0x0001 Touch Panel + /* Eicon Networks */ product EICON DIVA852 0x4905 Diva 852 ISDN TA Added: head/sys/modules/usb/uep/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/uep/Makefile Tue May 25 21:20:56 2010 (r208554) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/input + +KMOD= uep +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \ + uep.c + +.include From owner-svn-src-head@FreeBSD.ORG Tue May 25 21:32:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41A4C1065676; Tue, 25 May 2010 21:32:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 311E18FC2C; Tue, 25 May 2010 21:32:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PLWcdM043576; Tue, 25 May 2010 21:32:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PLWcB3043574; Tue, 25 May 2010 21:32:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201005252132.o4PLWcB3043574@svn.freebsd.org> From: John Baldwin Date: Tue, 25 May 2010 21:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208555 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 21:32:38 -0000 Author: jhb Date: Tue May 25 21:32:37 2010 New Revision: 208555 URL: http://svn.freebsd.org/changeset/base/208555 Log: Ignore the 'addr' argument passed to PT_STEP (it is required to be '1' for PT_STEP which means "ignore") and PT_DETACH. PR: kern/146167 MFC after: 1 week Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Tue May 25 21:20:56 2010 (r208554) +++ head/sys/kern/sys_process.c Tue May 25 21:32:37 2010 (r208555) @@ -899,24 +899,29 @@ kern_ptrace(struct thread *td, int req, if (error) goto out; break; + case PT_CONTINUE: case PT_TO_SCE: - p->p_stops |= S_PT_SCE; - break; case PT_TO_SCX: - p->p_stops |= S_PT_SCX; - break; case PT_SYSCALL: - p->p_stops |= S_PT_SCE | S_PT_SCX; - break; - } - - if (addr != (void *)1) { - error = ptrace_set_pc(td2, (u_long)(uintfptr_t)addr); - if (error) + if (addr != (void *)1) { + error = ptrace_set_pc(td2, + (u_long)(uintfptr_t)addr); + if (error) + goto out; + } + switch (req) { + case PT_TO_SCE: + p->p_stops |= S_PT_SCE; break; - } - - if (req == PT_DETACH) { + case PT_TO_SCX: + p->p_stops |= S_PT_SCX; + break; + case PT_SYSCALL: + p->p_stops |= S_PT_SCE | S_PT_SCX; + break; + } + break; + case PT_DETACH: /* reset process parent */ if (p->p_oppid != p->p_pptr->p_pid) { struct proc *pp; @@ -941,6 +946,7 @@ kern_ptrace(struct thread *td, int req, /* should we send SIGCHLD? */ /* childproc_continued(p); */ + break; } sendsig: From owner-svn-src-head@FreeBSD.ORG Tue May 25 21:39:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2A71106566C; Tue, 25 May 2010 21:39:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C24258FC1D; Tue, 25 May 2010 21:39:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PLdUm7045083; Tue, 25 May 2010 21:39:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PLdURa045081; Tue, 25 May 2010 21:39:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201005252139.o4PLdURa045081@svn.freebsd.org> From: John Baldwin Date: Tue, 25 May 2010 21:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208556 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 21:39:31 -0000 Author: jhb Date: Tue May 25 21:39:30 2010 New Revision: 208556 URL: http://svn.freebsd.org/changeset/base/208556 Log: Only enable CMCI on i386 if 'device apic' is enabled in the kernel since it requires the local APIC to work. Modified: head/sys/i386/i386/mca.c Modified: head/sys/i386/i386/mca.c ============================================================================== --- head/sys/i386/i386/mca.c Tue May 25 21:32:37 2010 (r208555) +++ head/sys/i386/i386/mca.c Tue May 25 21:39:30 2010 (r208556) @@ -32,6 +32,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_apic.h" + #include #include #include @@ -59,6 +61,7 @@ enum scan_mode { CMCI, }; +#ifdef DEV_APIC /* * State maintained for each monitored MCx bank to control the * corrected machine check interrupt threshold. @@ -67,6 +70,7 @@ struct cmc_state { int max_threshold; int last_intr; }; +#endif struct mca_internal { struct mca_record rec; @@ -99,9 +103,12 @@ static struct callout mca_timer; static int mca_ticks = 3600; /* Check hourly by default. */ static struct task mca_task; static struct mtx mca_lock; + +#ifdef DEV_APIC static struct cmc_state **cmc_state; /* Indexed by cpuid, bank */ static int cmc_banks; static int cmc_throttle = 60; /* Time in seconds to throttle CMCI. */ +#endif static int sysctl_positive_int(SYSCTL_HANDLER_ARGS) @@ -423,6 +430,7 @@ mca_record_entry(const struct mca_record mtx_unlock_spin(&mca_lock); } +#ifdef DEV_APIC /* * Update the interrupt threshold for a CMCI. The strategy is to use * a low trigger that interrupts as soon as the first event occurs. @@ -494,6 +502,7 @@ cmci_update(enum scan_mode mode, int ban wrmsr(MSR_MC_CTL2(bank), limit); } } +#endif /* * This scans all the machine check banks of the current CPU to see if @@ -521,12 +530,14 @@ mca_scan(enum scan_mode mode) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { +#ifdef DEV_APIC /* * For a CMCI, only check banks this CPU is * responsible for. */ if (mode == CMCI && !(PCPU_GET(cmci_mask) & 1 << i)) continue; +#endif valid = mca_check_status(i, &rec); if (valid) { @@ -538,12 +549,14 @@ mca_scan(enum scan_mode mode) mca_record_entry(&rec); } +#ifdef DEV_APIC /* * If this is a bank this CPU monitors via CMCI, * update the threshold. */ if (PCPU_GET(cmci_mask) & (1 << i)) cmci_update(mode, i, valid, &rec); +#endif } return (mode == MCE ? recoverable : count); } @@ -621,6 +634,7 @@ mca_startup(void *dummy) } SYSINIT(mca_startup, SI_SUB_SMP, SI_ORDER_ANY, mca_startup, NULL); +#ifdef DEV_APIC static void cmci_setup(uint64_t mcg_cap) { @@ -637,6 +651,7 @@ cmci_setup(uint64_t mcg_cap) &cmc_throttle, 0, sysctl_positive_int, "I", "Interval in seconds to throttle corrected MC interrupts"); } +#endif static void mca_setup(uint64_t mcg_cap) @@ -657,10 +672,13 @@ mca_setup(uint64_t mcg_cap) SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "force_scan", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, sysctl_mca_scan, "I", "Force an immediate scan for machine checks"); +#ifdef DEV_APIC if (mcg_cap & MCG_CAP_CMCI_P) cmci_setup(mcg_cap); +#endif } +#ifdef DEV_APIC /* * See if we should monitor CMCI for this bank. If CMCI_EN is already * set in MC_CTL2, then another CPU is responsible for this bank, so @@ -707,6 +725,7 @@ cmci_monitor(int i) /* Mark this bank as monitored. */ PCPU_SET(cmci_mask, PCPU_GET(cmci_mask) | 1 << i); } +#endif /* Must be executed on each CPU. */ void @@ -775,15 +794,19 @@ mca_init(void) if (!skip) wrmsr(MSR_MC_CTL(i), ctl); +#ifdef DEV_APIC if (mcg_cap & MCG_CAP_CMCI_P) cmci_monitor(i); +#endif /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } +#ifdef DEV_APIC if (PCPU_GET(cmci_mask) != 0) lapic_enable_cmc(); +#endif } load_cr4(rcr4() | CR4_MCE); @@ -817,6 +840,7 @@ mca_intr(void) return (recoverable); } +#ifdef DEV_APIC /* Called for a CMCI (correctable machine check interrupt). */ void cmc_intr(void) @@ -844,3 +868,4 @@ cmc_intr(void) mtx_unlock_spin(&mca_lock); } } +#endif From owner-svn-src-head@FreeBSD.ORG Tue May 25 22:04:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DD69106564A; Tue, 25 May 2010 22:04:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CA4008FC12; Tue, 25 May 2010 22:04:50 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 659EF46B89; Tue, 25 May 2010 18:04:50 -0400 (EDT) Date: Tue, 25 May 2010 23:04:50 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Qing Li In-Reply-To: <201005252042.o4PKgZdd032462@svn.freebsd.org> Message-ID: References: <201005252042.o4PKgZdd032462@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208553 - in head/sys: net netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 22:04:51 -0000 On Tue, 25 May 2010, Qing Li wrote: > Author: qingli > Date: Tue May 25 20:42:35 2010 > New Revision: 208553 > URL: http://svn.freebsd.org/changeset/base/208553 > > Log: > This patch fixes the problem where proxy ARP entries cannot be added > over the if_ng interface. Hi Qing-- It may be worth checking network-related kernel modules in the ports tree to make sure none reference this symbol (i.e., the virtualbox network device parts). If they do, you may need to add a new symbol in the MFC so that existing modules continue to function, and existing kernel module code continues to compile. If not, shouldn't be an issue (none of the base system modules seem to use it, but we may care about external modules that do in -STABLE). Robert > > MFC after: 3 days > > Modified: > head/sys/net/if.c > head/sys/net/if_var.h > head/sys/net/route.c > head/sys/net/rtsock.c > head/sys/netinet/in.c > head/sys/netinet/in_pcb.c > head/sys/netinet/ip_options.c > head/sys/netinet/ip_output.c > > Modified: head/sys/net/if.c > ============================================================================== > --- head/sys/net/if.c Tue May 25 20:35:39 2010 (r208552) > +++ head/sys/net/if.c Tue May 25 20:42:35 2010 (r208553) > @@ -1607,7 +1607,7 @@ done: > * is most specific found. > */ > struct ifaddr * > -ifa_ifwithnet(struct sockaddr *addr) > +ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) > { > struct ifnet *ifp; > struct ifaddr *ifa; > @@ -1639,7 +1639,8 @@ ifa_ifwithnet(struct sockaddr *addr) > > if (ifa->ifa_addr->sa_family != af) > next: continue; > - if (af == AF_INET && ifp->if_flags & IFF_POINTOPOINT) { > + if (af == AF_INET && > + ifp->if_flags & IFF_POINTOPOINT && !ignore_ptp) { > /* > * This is a bit broken as it doesn't > * take into account that the remote end may > > Modified: head/sys/net/if_var.h > ============================================================================== > --- head/sys/net/if_var.h Tue May 25 20:35:39 2010 (r208552) > +++ head/sys/net/if_var.h Tue May 25 20:42:35 2010 (r208553) > @@ -873,7 +873,7 @@ struct ifaddr *ifa_ifwithaddr(struct soc > int ifa_ifwithaddr_check(struct sockaddr *); > struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); > struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); > -struct ifaddr *ifa_ifwithnet(struct sockaddr *); > +struct ifaddr *ifa_ifwithnet(struct sockaddr *, int); > struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); > struct ifaddr *ifa_ifwithroute_fib(int, struct sockaddr *, struct sockaddr *, u_int); > > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Tue May 25 20:35:39 2010 (r208552) > +++ head/sys/net/route.c Tue May 25 20:42:35 2010 (r208553) > @@ -519,7 +519,7 @@ rtredirect_fib(struct sockaddr *dst, > } > > /* verify the gateway is directly reachable */ > - if ((ifa = ifa_ifwithnet(gateway)) == NULL) { > + if ((ifa = ifa_ifwithnet(gateway, 0)) == NULL) { > error = ENETUNREACH; > goto out; > } > @@ -686,7 +686,7 @@ ifa_ifwithroute_fib(int flags, struct so > ifa = ifa_ifwithdstaddr(gateway); > } > if (ifa == NULL) > - ifa = ifa_ifwithnet(gateway); > + ifa = ifa_ifwithnet(gateway, 0); > if (ifa == NULL) { > struct rtentry *rt = rtalloc1_fib(gateway, 0, RTF_RNH_LOCKED, fibnum); > if (rt == NULL) > @@ -797,7 +797,7 @@ rt_getifa_fib(struct rt_addrinfo *info, > */ > if (info->rti_ifp == NULL && ifpaddr != NULL && > ifpaddr->sa_family == AF_LINK && > - (ifa = ifa_ifwithnet(ifpaddr)) != NULL) { > + (ifa = ifa_ifwithnet(ifpaddr, 0)) != NULL) { > info->rti_ifp = ifa->ifa_ifp; > ifa_free(ifa); > } > > Modified: head/sys/net/rtsock.c > ============================================================================== > --- head/sys/net/rtsock.c Tue May 25 20:35:39 2010 (r208552) > +++ head/sys/net/rtsock.c Tue May 25 20:42:35 2010 (r208553) > @@ -55,6 +55,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -673,12 +674,22 @@ route_output(struct mbuf *m, struct sock > * another search to retrieve the prefix route of > * the local end point of the PPP link. > */ > - if ((rtm->rtm_flags & RTF_ANNOUNCE) && > - (rt->rt_ifp->if_flags & IFF_POINTOPOINT)) { > + if (rtm->rtm_flags & RTF_ANNOUNCE) { > struct sockaddr laddr; > - rt_maskedcopy(rt->rt_ifa->ifa_addr, > - &laddr, > - rt->rt_ifa->ifa_netmask); > + > + if (rt->rt_ifp != NULL && > + rt->rt_ifp->if_type == IFT_PROPVIRTUAL) { > + struct ifaddr *ifa; > + > + ifa = ifa_ifwithnet(info.rti_info[RTAX_DST], 1); > + if (ifa != NULL) > + rt_maskedcopy(ifa->ifa_addr, > + &laddr, > + ifa->ifa_netmask); > + } else > + rt_maskedcopy(rt->rt_ifa->ifa_addr, > + &laddr, > + rt->rt_ifa->ifa_netmask); > /* > * refactor rt and no lock operation necessary > */ > > Modified: head/sys/netinet/in.c > ============================================================================== > --- head/sys/netinet/in.c Tue May 25 20:35:39 2010 (r208552) > +++ head/sys/netinet/in.c Tue May 25 20:42:35 2010 (r208553) > @@ -1379,8 +1379,9 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ > > /* XXX rtalloc1 should take a const param */ > rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); > - if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || > - ((rt->rt_ifp != ifp) && !(flags & LLE_PUB))) { > + if (rt == NULL || (!(flags & LLE_PUB) && > + ((rt->rt_flags & RTF_GATEWAY) || > + (rt->rt_ifp != ifp)))) { > #ifdef DIAGNOSTIC > log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", > inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); > > Modified: head/sys/netinet/in_pcb.c > ============================================================================== > --- head/sys/netinet/in_pcb.c Tue May 25 20:35:39 2010 (r208552) > +++ head/sys/netinet/in_pcb.c Tue May 25 20:42:35 2010 (r208553) > @@ -631,7 +631,7 @@ in_pcbladdr(struct inpcb *inp, struct in > > ia = ifatoia(ifa_ifwithdstaddr((struct sockaddr *)sin)); > if (ia == NULL) > - ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin)); > + ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin, 0)); > if (ia == NULL) { > error = ENETUNREACH; > goto done; > @@ -748,7 +748,7 @@ in_pcbladdr(struct inpcb *inp, struct in > > ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain))); > if (ia == NULL) > - ia = ifatoia(ifa_ifwithnet(sintosa(&sain))); > + ia = ifatoia(ifa_ifwithnet(sintosa(&sain), 0)); > if (ia == NULL) > ia = ifatoia(ifa_ifwithaddr(sintosa(&sain))); > > > Modified: head/sys/netinet/ip_options.c > ============================================================================== > --- head/sys/netinet/ip_options.c Tue May 25 20:35:39 2010 (r208552) > +++ head/sys/netinet/ip_options.c Tue May 25 20:42:35 2010 (r208553) > @@ -228,7 +228,7 @@ dropit: > #define INA struct in_ifaddr * > #define SA struct sockaddr * > if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == NULL) > - ia = (INA)ifa_ifwithnet((SA)&ipaddr); > + ia = (INA)ifa_ifwithnet((SA)&ipaddr, 0); > } else > /* XXX MRT 0 for routing */ > ia = ip_rtaddr(ipaddr.sin_addr, M_GETFIB(m)); > > Modified: head/sys/netinet/ip_output.c > ============================================================================== > --- head/sys/netinet/ip_output.c Tue May 25 20:35:39 2010 (r208552) > +++ head/sys/netinet/ip_output.c Tue May 25 20:42:35 2010 (r208553) > @@ -244,7 +244,7 @@ again: > isbroadcast = 1; > } else if (flags & IP_ROUTETOIF) { > if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL && > - (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == NULL) { > + (ia = ifatoia(ifa_ifwithnet(sintosa(dst), 0))) == NULL) { > IPSTAT_INC(ips_noroute); > error = ENETUNREACH; > goto bad; > From owner-svn-src-head@FreeBSD.ORG Tue May 25 22:19:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE21D1065675; Tue, 25 May 2010 22:19:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD4EA8FC18; Tue, 25 May 2010 22:19:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4PMJpqG053910; Tue, 25 May 2010 22:19:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4PMJpg9053908; Tue, 25 May 2010 22:19:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201005252219.o4PMJpg9053908@svn.freebsd.org> From: Xin LI Date: Tue, 25 May 2010 22:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208557 - head/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 22:19:51 -0000 Author: delphij Date: Tue May 25 22:19:51 2010 New Revision: 208557 URL: http://svn.freebsd.org/changeset/base/208557 Log: Grammar nits. Submitted by: b. f. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue May 25 21:39:30 2010 (r208556) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue May 25 22:19:51 2010 (r208557) @@ -327,7 +327,7 @@ based on libarchive, have replaced the GNU Binutils versions of these utilities. - BSD-licensed version of &man.bc.1; and &man.dc.1; has + BSD-licensed versions of &man.bc.1; and &man.dc.1; have replaced their GNU counterparts. &man.chflags.1; now supports a flag for @@ -378,7 +378,7 @@ disable the use of TCP options. &man.nc.1;'s switch has been deprecated. - It will be removed in future release. + It will be removed in a future release. The &man.ping6.8; utility now returns 2 when the packet transmission was successful but no responses From owner-svn-src-head@FreeBSD.ORG Wed May 26 09:23:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF8E2106564A; Wed, 26 May 2010 09:23:51 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9ECD48FC18; Wed, 26 May 2010 09:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4Q9Npom000148; Wed, 26 May 2010 09:23:51 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4Q9NpGg000146; Wed, 26 May 2010 09:23:51 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005260923.o4Q9NpGg000146@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 26 May 2010 09:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208559 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 09:23:51 -0000 Author: raj Date: Wed May 26 09:23:51 2010 New Revision: 208559 URL: http://svn.freebsd.org/changeset/base/208559 Log: Use MACHINE_ARCH instead of TARGET_ARCH. Pointed out by: imp Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed May 26 04:14:29 2010 (r208558) +++ head/share/mk/bsd.own.mk Wed May 26 09:23:51 2010 (r208559) @@ -279,8 +279,7 @@ WITH_IDEA= .endif # Enable FDT by default for selected platforms. -.if defined(TARGET_ARCH) && \ - (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "powerpc") +.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "powerpc" # XXX this is temporarily disabled until all FDT support code is in place. #_fdt= FDT _no_fdt= FDT From owner-svn-src-head@FreeBSD.ORG Wed May 26 09:34:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 604FF106564A; Wed, 26 May 2010 09:34:02 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E8A78FC08; Wed, 26 May 2010 09:34:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4Q9Y2Rf002411; Wed, 26 May 2010 09:34:02 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4Q9Y2ub002408; Wed, 26 May 2010 09:34:02 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005260934.o4Q9Y2ub002408@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 26 May 2010 09:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208560 - head/sys/boot/fdt/dts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 09:34:02 -0000 Author: raj Date: Wed May 26 09:34:02 2010 New Revision: 208560 URL: http://svn.freebsd.org/changeset/base/208560 Log: Import device tree source (DTS) files for PowerPC MPC8555CDS and MPC8572DS development systems. Special thanks to Phil Brownfield for help with BSD-style relicensing of these files. Obtained from: Freescale Added: head/sys/boot/fdt/dts/ head/sys/boot/fdt/dts/mpc8555cds.dts (contents, props changed) head/sys/boot/fdt/dts/mpc8572ds.dts (contents, props changed) Added: head/sys/boot/fdt/dts/mpc8555cds.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/mpc8555cds.dts Wed May 26 09:34:02 2010 (r208560) @@ -0,0 +1,442 @@ +/* + * MPC8555 CDS Device Tree Source + * + * Copyright 2006, 2008 Freescale Semiconductor Inc. All rights reserved + * + * Neither the name of Freescale Semiconductor, Inc nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Freescale hereby publishes it under the following licenses: + * + * BSD License + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * GNU General Public License, version 2 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * You may select the license of your choice. + *------------------------------------------------------------------ + * + * $FreeBSD$ + */ + +/dts-v1/; + +/ { + model = "MPC8555CDS"; + compatible = "MPC8555CDS", "MPC85xxCDS"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + ethernet0 = &enet0; + ethernet1 = &enet1; + serial0 = &serial0; + serial1 = &serial1; + pci0 = &pci0; + pci1 = &pci1; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,8555@0 { + device_type = "cpu"; + reg = <0x0>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x8000>; // L1, 32K + i-cache-size = <0x8000>; // L1, 32K + timebase-frequency = <0>; // 33 MHz, from uboot + bus-frequency = <0>; // 166 MHz + clock-frequency = <0>; // 825 MHz, from uboot + next-level-cache = <&L2>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x8000000>; // 128M at 0x0 + }; + + localbus@e0005000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "fsl,lbc", "fsl,elbc"; + reg = <0xe0005000 0x1000>; + interrupts = <19 2>; + interrupt-parent = <&mpic>; + + ranges = <0x0 0x0 0xff800000 0x00800000 + 0x1 0x0 0xff000000 0x00800000 + 0x2 0x0 0xf8000000 0x00008000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x00800000>; + bank-width = <2>; + device-width = <1>; + }; + + nor@1,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x1 0x0 0x00800000>; + bank-width = <2>; + device-width = <1>; + }; + + rtc@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "dallas,ds1553"; + reg = <0x2 0x0 0x00008000>; + bank-width = <1>; + device-width = <1>; + }; + }; + + soc8555@e0000000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + compatible = "simple-bus"; + ranges = <0x0 0xe0000000 0x100000>; + bus-frequency = <0>; + + ecm-law@0 { + compatible = "fsl,ecm-law"; + reg = <0x0 0x1000>; + fsl,num-laws = <8>; + }; + + ecm@1000 { + compatible = "fsl,mpc8555-ecm", "fsl,ecm"; + reg = <0x1000 0x1000>; + interrupts = <17 2>; + interrupt-parent = <&mpic>; + }; + + memory-controller@2000 { + compatible = "fsl,8555-memory-controller"; + reg = <0x2000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <18 2>; + }; + + L2: l2-cache-controller@20000 { + compatible = "fsl,8555-l2-cache-controller"; + reg = <0x20000 0x1000>; + cache-line-size = <32>; // 32 bytes + cache-size = <0x40000>; // L2, 256K + interrupt-parent = <&mpic>; + interrupts = <16 2>; + }; + + i2c@3000 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <0>; + compatible = "fsl-i2c"; + reg = <0x3000 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + }; + + dma@21300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,mpc8555-dma", "fsl,eloplus-dma"; + reg = <0x21300 0x4>; + ranges = <0x0 0x21100 0x200>; + cell-index = <0>; + dma-channel@0 { + compatible = "fsl,mpc8555-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&mpic>; + interrupts = <20 2>; + }; + dma-channel@80 { + compatible = "fsl,mpc8555-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&mpic>; + interrupts = <21 2>; + }; + dma-channel@100 { + compatible = "fsl,mpc8555-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&mpic>; + interrupts = <22 2>; + }; + dma-channel@180 { + compatible = "fsl,mpc8555-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupt-parent = <&mpic>; + interrupts = <23 2>; + }; + }; + + enet0: ethernet@24000 { + #address-cells = <1>; + #size-cells = <1>; + cell-index = <0>; + device_type = "network"; + model = "TSEC"; + compatible = "gianfar"; + reg = <0x24000 0x1000>; + ranges = <0x0 0x24000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <29 2 30 2 34 2>; + interrupt-parent = <&mpic>; + tbi-handle = <&tbi0>; + phy-handle = <&phy0>; + + mdio@520 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,gianfar-mdio"; + reg = <0x520 0x20>; + + phy0: ethernet-phy@0 { + interrupt-parent = <&mpic>; + interrupts = <5 1>; + reg = <0x0>; + device_type = "ethernet-phy"; + }; + phy1: ethernet-phy@1 { + interrupt-parent = <&mpic>; + interrupts = <5 1>; + reg = <0x1>; + device_type = "ethernet-phy"; + }; + tbi0: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + }; + + enet1: ethernet@25000 { + #address-cells = <1>; + #size-cells = <1>; + cell-index = <1>; + device_type = "network"; + model = "TSEC"; + compatible = "gianfar"; + reg = <0x25000 0x1000>; + ranges = <0x0 0x25000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <35 2 36 2 40 2>; + interrupt-parent = <&mpic>; + tbi-handle = <&tbi1>; + phy-handle = <&phy1>; + + mdio@520 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,gianfar-tbi"; + reg = <0x520 0x20>; + + tbi1: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + }; + + serial0: serial@4500 { + cell-index = <0>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4500 0x100>; // reg base, size + clock-frequency = <0>; // should we fill in in uboot? + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + serial1: serial@4600 { + cell-index = <1>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4600 0x100>; // reg base, size + clock-frequency = <0>; // should we fill in in uboot? + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + crypto@30000 { + compatible = "fsl,sec2.0"; + reg = <0x30000 0x10000>; + interrupts = <45 2>; + interrupt-parent = <&mpic>; + fsl,num-channels = <4>; + fsl,channel-fifo-len = <24>; + fsl,exec-units-mask = <0x7e>; + fsl,descriptor-types-mask = <0x01010ebf>; + }; + + mpic: pic@40000 { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <2>; + reg = <0x40000 0x40000>; + compatible = "chrp,open-pic"; + device_type = "open-pic"; + }; + + cpm@80000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,mpc8555-cpm", "fsl,cpm2"; + reg = <0x80000 0x20000>; + interrupts = <46 2>; + }; + }; + + pci0: pci@e0008000 { + interrupt-map-mask = <0x1f800 0x0 0x0 0x7>; + interrupt-map = < + + /* IDSEL 0x10 */ + 0x8000 0x0 0x0 0x1 &mpic 0x0 0x1 + 0x8000 0x0 0x0 0x2 &mpic 0x1 0x1 + 0x8000 0x0 0x0 0x3 &mpic 0x2 0x1 + 0x8000 0x0 0x0 0x4 &mpic 0x3 0x1 + + /* IDSEL 0x11 */ + 0x8800 0x0 0x0 0x1 &mpic 0x0 0x1 + 0x8800 0x0 0x0 0x2 &mpic 0x1 0x1 + 0x8800 0x0 0x0 0x3 &mpic 0x2 0x1 + 0x8800 0x0 0x0 0x4 &mpic 0x3 0x1 + + /* IDSEL 0x12 (Slot 1) */ + 0x9000 0x0 0x0 0x1 &mpic 0x0 0x1 + 0x9000 0x0 0x0 0x2 &mpic 0x1 0x1 + 0x9000 0x0 0x0 0x3 &mpic 0x2 0x1 + 0x9000 0x0 0x0 0x4 &mpic 0x3 0x1 + + /* IDSEL 0x13 (Slot 2) */ + 0x9800 0x0 0x0 0x1 &mpic 0x1 0x1 + 0x9800 0x0 0x0 0x2 &mpic 0x2 0x1 + 0x9800 0x0 0x0 0x3 &mpic 0x3 0x1 + 0x9800 0x0 0x0 0x4 &mpic 0x0 0x1 + + /* IDSEL 0x14 (Slot 3) */ + 0xa000 0x0 0x0 0x1 &mpic 0x2 0x1 + 0xa000 0x0 0x0 0x2 &mpic 0x3 0x1 + 0xa000 0x0 0x0 0x3 &mpic 0x0 0x1 + 0xa000 0x0 0x0 0x4 &mpic 0x1 0x1 + + /* IDSEL 0x15 (Slot 4) */ + 0xa800 0x0 0x0 0x1 &mpic 0x3 0x1 + 0xa800 0x0 0x0 0x2 &mpic 0x0 0x1 + 0xa800 0x0 0x0 0x3 &mpic 0x1 0x1 + 0xa800 0x0 0x0 0x4 &mpic 0x2 0x1 + + /* Bus 1 (Tundra Bridge) */ + /* IDSEL 0x12 (ISA bridge) */ + 0x19000 0x0 0x0 0x1 &mpic 0x0 0x1 + 0x19000 0x0 0x0 0x2 &mpic 0x1 0x1 + 0x19000 0x0 0x0 0x3 &mpic 0x2 0x1 + 0x19000 0x0 0x0 0x4 &mpic 0x3 0x1>; + interrupt-parent = <&mpic>; + interrupts = <24 2>; + bus-range = <0 0>; + ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x10000000 + 0x1000000 0x0 0x0 0xfee00000 0x0 0x00010000>; + clock-frequency = <66666666>; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0xe0008000 0x1000>; + compatible = "fsl,mpc8540-pci"; + device_type = "pci"; + + i8259@19000 { + interrupt-controller; + device_type = "interrupt-controller"; + reg = <0x19000 0x0 0x0 0x0 0x1>; + #address-cells = <0>; + #interrupt-cells = <2>; + compatible = "chrp,iic"; + interrupts = <1>; + interrupt-parent = <&pci0>; + }; + }; + + pci1: pci@e0009000 { + interrupt-map-mask = <0xf800 0x0 0x0 0x7>; + interrupt-map = < + + /* IDSEL 0x15 */ + 0xa800 0x0 0x0 0x1 &mpic 0xb 0x1 + 0xa800 0x0 0x0 0x2 &mpic 0xb 0x1 + 0xa800 0x0 0x0 0x3 &mpic 0xb 0x1 + 0xa800 0x0 0x0 0x4 &mpic 0xb 0x1>; + interrupt-parent = <&mpic>; + interrupts = <25 2>; + bus-range = <0 0>; + ranges = <0x2000000 0x0 0x90000000 0x90000000 0x0 0x10000000 + 0x1000000 0x0 0x0 0xfee10000 0x0 0x00010000>; + clock-frequency = <66666666>; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0xe0009000 0x1000>; + compatible = "fsl,mpc8540-pci"; + device_type = "pci"; + }; +}; Added: head/sys/boot/fdt/dts/mpc8572ds.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/mpc8572ds.dts Wed May 26 09:34:02 2010 (r208560) @@ -0,0 +1,895 @@ +/* + * MPC8572 DS Device Tree Source + * + * Copyright 2007-2009 Freescale Semiconductor Inc. All rights reserved + * + * Neither the name of Freescale Semiconductor, Inc nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Freescale hereby publishes it under the following licenses: + * + * BSD License + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * GNU General Public License, version 2 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * You may select the license of your choice. + *------------------------------------------------------------------ + * + * $FreeBSD$ + */ + +/dts-v1/; +/ { + model = "fsl,MPC8572DS"; + compatible = "fsl,MPC8572DS"; + #address-cells = <2>; + #size-cells = <2>; + + aliases { + ethernet0 = &enet0; + ethernet1 = &enet1; + ethernet2 = &enet2; + ethernet3 = &enet3; + serial0 = &serial0; + serial1 = &serial1; + pci0 = &pci0; + pci1 = &pci1; + pci2 = &pci2; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,8572@0 { + device_type = "cpu"; + reg = <0x0>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x8000>; // L1, 32K + i-cache-size = <0x8000>; // L1, 32K + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + next-level-cache = <&L2>; + }; + + PowerPC,8572@1 { + device_type = "cpu"; + reg = <0x1>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x8000>; // L1, 32K + i-cache-size = <0x8000>; // L1, 32K + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + next-level-cache = <&L2>; + }; + }; + + memory { + device_type = "memory"; + }; + + localbus@ffe05000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "fsl,mpc8572-elbc", "fsl,elbc", "simple-bus"; + reg = <0 0xffe05000 0 0x1000>; + interrupts = <19 2>; + interrupt-parent = <&mpic>; + + ranges = <0x0 0x0 0x0 0xe8000000 0x08000000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x8000000>; + bank-width = <2>; + device-width = <1>; + + partition@0 { + reg = <0x0 0x03000000>; + label = "ramdisk-nor"; + read-only; + }; + + partition@3000000 { + reg = <0x03000000 0x00e00000>; + label = "diagnostic-nor"; + read-only; + }; + + partition@3e00000 { + reg = <0x03e00000 0x00200000>; + label = "dink-nor"; + read-only; + }; + + partition@4000000 { + reg = <0x04000000 0x00400000>; + label = "kernel-nor"; + read-only; + }; + + partition@4400000 { + reg = <0x04400000 0x03b00000>; + label = "jffs2-nor"; + }; + + partition@7f00000 { + reg = <0x07f00000 0x00080000>; + label = "dtb-nor"; + read-only; + }; + + partition@7f80000 { + reg = <0x07f80000 0x00080000>; + label = "u-boot-nor"; + read-only; + }; + }; + + nand@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,mpc8572-fcm-nand", + "fsl,elbc-fcm-nand"; + reg = <0x2 0x0 0x40000>; + + partition@0 { + reg = <0x0 0x02000000>; + label = "u-boot-nand"; + read-only; + }; + + partition@2000000 { + reg = <0x02000000 0x10000000>; + label = "jffs2-nand"; + }; + + partition@12000000 { + reg = <0x12000000 0x08000000>; + label = "ramdisk-nand"; + read-only; + }; + + partition@1a000000 { + reg = <0x1a000000 0x04000000>; + label = "kernel-nand"; + }; + + partition@1e000000 { + reg = <0x1e000000 0x01000000>; + label = "dtb-nand"; + read-only; + }; + + partition@1f000000 { + reg = <0x1f000000 0x21000000>; + label = "reserved-nand"; + }; + }; + + nand@4,0 { + compatible = "fsl,mpc8572-fcm-nand", + "fsl,elbc-fcm-nand"; + reg = <0x4 0x0 0x40000>; + }; + + nand@5,0 { + compatible = "fsl,mpc8572-fcm-nand", + "fsl,elbc-fcm-nand"; + reg = <0x5 0x0 0x40000>; + }; + + nand@6,0 { + compatible = "fsl,mpc8572-fcm-nand", + "fsl,elbc-fcm-nand"; + reg = <0x6 0x0 0x40000>; + }; + }; + + soc8572@ffe00000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + compatible = "simple-bus"; + ranges = <0x0 0 0xffe00000 0x100000>; + bus-frequency = <0>; // Filled out by uboot. + + ecm-law@0 { + compatible = "fsl,ecm-law"; + reg = <0x0 0x1000>; + fsl,num-laws = <12>; + }; + + ecm@1000 { + compatible = "fsl,mpc8572-ecm", "fsl,ecm"; + reg = <0x1000 0x1000>; + interrupts = <17 2>; + interrupt-parent = <&mpic>; + }; + + memory-controller@2000 { + compatible = "fsl,mpc8572-memory-controller"; + reg = <0x2000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <18 2>; + }; + + memory-controller@6000 { + compatible = "fsl,mpc8572-memory-controller"; + reg = <0x6000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <18 2>; + }; + + L2: l2-cache-controller@20000 { + compatible = "fsl,mpc8572-l2-cache-controller"; + reg = <0x20000 0x1000>; + cache-line-size = <32>; // 32 bytes + cache-size = <0x100000>; // L2, 1M + interrupt-parent = <&mpic>; + interrupts = <16 2>; + }; + + i2c@3000 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <0>; + compatible = "fsl-i2c"; + reg = <0x3000 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + }; + + i2c@3100 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <1>; + compatible = "fsl-i2c"; + reg = <0x3100 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + }; + + dma@c300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma"; + reg = <0xc300 0x4>; + ranges = <0x0 0xc100 0x200>; + cell-index = <1>; + dma-channel@0 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&mpic>; + interrupts = <76 2>; + }; + dma-channel@80 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&mpic>; + interrupts = <77 2>; + }; + dma-channel@100 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&mpic>; + interrupts = <78 2>; + }; + dma-channel@180 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupt-parent = <&mpic>; + interrupts = <79 2>; + }; + }; + + dma@21300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma"; + reg = <0x21300 0x4>; + ranges = <0x0 0x21100 0x200>; + cell-index = <0>; + dma-channel@0 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&mpic>; + interrupts = <20 2>; + }; + dma-channel@80 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&mpic>; + interrupts = <21 2>; + }; + dma-channel@100 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&mpic>; + interrupts = <22 2>; + }; + dma-channel@180 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupt-parent = <&mpic>; + interrupts = <23 2>; + }; + }; + + ptp_timer: ptimer@24e00 { + compatible = "fsl,gianfar-ptp-timer"; + reg = <0x24e00 0xb0>; + }; + + enet0: ethernet@24000 { + #address-cells = <1>; + #size-cells = <1>; + cell-index = <0>; + device_type = "network"; + model = "eTSEC"; + compatible = "gianfar"; + reg = <0x24000 0x1000>; + ranges = <0x0 0x24000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <29 2 30 2 34 2>; + interrupt-parent = <&mpic>; + tbi-handle = <&tbi0>; + phy-handle = <&phy0>; + ptimer-handle = < &ptp_timer >; + phy-connection-type = "rgmii-id"; + + mdio@520 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,gianfar-mdio"; + reg = <0x520 0x20>; + + phy0: ethernet-phy@0 { + interrupt-parent = <&mpic>; + interrupts = <10 1>; + reg = <0x0>; + }; + phy1: ethernet-phy@1 { + interrupt-parent = <&mpic>; + interrupts = <10 1>; + reg = <0x1>; + }; + phy2: ethernet-phy@2 { + interrupt-parent = <&mpic>; + interrupts = <10 1>; + reg = <0x2>; + }; + phy3: ethernet-phy@3 { + interrupt-parent = <&mpic>; + interrupts = <10 1>; + reg = <0x3>; + }; + + tbi0: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + }; + + enet1: ethernet@25000 { + #address-cells = <1>; + #size-cells = <1>; + cell-index = <1>; + device_type = "network"; + model = "eTSEC"; + compatible = "gianfar"; + reg = <0x25000 0x1000>; + ranges = <0x0 0x25000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <35 2 36 2 40 2>; + interrupt-parent = <&mpic>; + tbi-handle = <&tbi1>; + phy-handle = <&phy1>; + ptimer-handle = < &ptp_timer >; + phy-connection-type = "rgmii-id"; + + mdio@520 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,gianfar-tbi"; + reg = <0x520 0x20>; + + tbi1: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + }; + + enet2: ethernet@26000 { + #address-cells = <1>; + #size-cells = <1>; + cell-index = <2>; + device_type = "network"; + model = "eTSEC"; + compatible = "gianfar"; + reg = <0x26000 0x1000>; + ranges = <0x0 0x26000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <31 2 32 2 33 2>; + interrupt-parent = <&mpic>; + tbi-handle = <&tbi2>; + phy-handle = <&phy2>; + ptimer-handle = < &ptp_timer >; + phy-connection-type = "rgmii-id"; + + mdio@520 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,gianfar-tbi"; + reg = <0x520 0x20>; + + tbi2: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + }; + + enet3: ethernet@27000 { + #address-cells = <1>; + #size-cells = <1>; + cell-index = <3>; + device_type = "network"; + model = "eTSEC"; + compatible = "gianfar"; + reg = <0x27000 0x1000>; + ranges = <0x0 0x27000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <37 2 38 2 39 2>; + interrupt-parent = <&mpic>; + tbi-handle = <&tbi3>; + phy-handle = <&phy3>; + phy-connection-type = "rgmii-id"; + + mdio@520 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,gianfar-tbi"; + reg = <0x520 0x20>; + + tbi3: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + }; + + serial0: serial@4500 { + cell-index = <0>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4500 0x100>; + clock-frequency = <0>; + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + serial1: serial@4600 { + cell-index = <1>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4600 0x100>; + clock-frequency = <0>; + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + global-utilities@e0000 { //global utilities block + compatible = "fsl,mpc8572-guts"; + reg = <0xe0000 0x1000>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed May 26 09:50:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41C41106564A; Wed, 26 May 2010 09:50:10 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FB468FC0C; Wed, 26 May 2010 09:50:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4Q9oA9N006026; Wed, 26 May 2010 09:50:10 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4Q9oAZx006019; Wed, 26 May 2010 09:50:10 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005260950.o4Q9oAZx006019@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 26 May 2010 09:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208561 - head/sys/boot/fdt/dts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 09:50:10 -0000 Author: raj Date: Wed May 26 09:50:09 2010 New Revision: 208561 URL: http://svn.freebsd.org/changeset/base/208561 Log: Initial device tree source (DTS) files for Marvell ARM systems: o DB-88F5182 o DB-88F5281 o DB-88F6281 o DB-78100 o SheevaPlug This also includes device tree bindings definitions for some newly introduced nodes (mpp, gpio). Reviewed by: imp Sponsored by: The FreeBSD Foundation Added: head/sys/boot/fdt/dts/bindings-gpio.txt (contents, props changed) head/sys/boot/fdt/dts/bindings-mpp.txt (contents, props changed) head/sys/boot/fdt/dts/db78100.dts (contents, props changed) head/sys/boot/fdt/dts/db88f5182.dts (contents, props changed) head/sys/boot/fdt/dts/db88f5281.dts (contents, props changed) head/sys/boot/fdt/dts/db88f6281.dts (contents, props changed) head/sys/boot/fdt/dts/sheevaplug.dts (contents, props changed) Added: head/sys/boot/fdt/dts/bindings-gpio.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/bindings-gpio.txt Wed May 26 09:50:09 2010 (r208561) @@ -0,0 +1,101 @@ +$FreeBSD$ + +GPIO configuration. +=================== + +1. Properties for GPIO Controllers + +1.1 #gpio-cells + +Property: #gpio-cells + +Value type: + +Description: The #gpio-cells property defines the number of cells required + to encode a gpio specifier. + + +1.2 gpio-controller + +Property: gpio-controller + +Value type: + +Description: The presence of a gpio-controller property defines a node as a + GPIO controller node. + + +1.3 pin-count + +Property: pin-count + +Value type: + +Description: The pin-count property defines the number of GPIO pins. + + +1.4 Example + + GPIO: gpio@10100 { + #gpio-cells = <3>; + compatible = "mrvl,gpio"; + reg = <0x10100 0x20>; + gpio-controller; + interrupts = <6 7 8 9>; + interrupt-parent = <&PIC>; + pin-count = <50> + }; + +2. Properties for GPIO consumer nodes. + +2.1 gpios + +Property: gpios + +Value type: encoded as arbitrary number of GPIO + specifiers. + +Description: The gpios property of a device node defines the GPIO or GPIOs + that are used by the device. The value of the gpios property + consists of an arbitrary number of GPIO specifiers. + + The first cell of the GPIO specifier is phandle of the node's + parent GPIO controller and remaining cells are defined by the + binding describing the GPIO parent, typically include + information like pin number, direction and various flags. + +Example: + gpios = <&GPIO 0 1 0 /* GPIO[0]: IN, NONE */ + &GPIO 1 2 0>; /* GPIO[1]: OUT, NONE */ + + +3. "mrvl,gpio" controller GPIO specifier + + + + +pin: 0-MAX GPIO pin number. + +dir: + 1 IN Input direction. + 2 OUT Output direction. + +flags: + 0x0000---- IN_NONE + 0x0001---- IN_POL_LOW Polarity low (inverted input value. + 0x0002---- IN_IRQ_EDGE Interrupt, edge triggered. + 0x0004---- IN_IRQ_LEVEL Interrupt, level triggered. + + 0x----0000 OUT_NONE + 0x----0001 OUT_BLINK Blink on the pin. + 0x----0002 OUT_OPEN_DRAIN Open drain output line. + 0x----0004 OUT_OPEN_SRC Open source output line. + + +Example: + gpios = <&GPIO 0 1 0x00000000 /* GPIO[0]: IN */ + &GPIO 1 2 0x00000000 /* GPIO[1]: OUT */ + &GPIO 2 1 0x00020000 /* GPIO[2]: IN, IRQ (edge) */ + &GPIO 3 1 0x00040000 /* GPIO[3]: IN, IRQ (level) */ + ... + &GPIO 10 2 0x00000001>; /* GPIO[10]: OUT, blink */ Added: head/sys/boot/fdt/dts/bindings-mpp.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/bindings-mpp.txt Wed May 26 09:50:09 2010 (r208561) @@ -0,0 +1,50 @@ +$FreeBSD$ + +* Multi purpose pin (MPP) configuration. + +Required properties: + +- pin-map : array of pin configurations. Each pin is defined by 2 cells, + respectively: . Pins not specified in the pin-map property + are assumed to have default value of = 0, which means GPIO. + + - pin : pin number. + + - function : function ID of the pin according to the assignment tables in + User Manual. Each pin can have many possible functions depending on the + MPP unit incarnation. + +- pin-count: number of the physical MPP connections on the SOC (depending on + the model it can be 24-50, or possibly else in future devices). + +Example: + + mpp@10000 { + #pin-cells = <2>; + compatible = "mrvl,mpp"; + reg = <0x10000 0x34>; + pin-count= <50>; + pin-map = < + 0 1 /* MPP[0]: NF_IO[2] */ + 1 1 /* MPP[1]: NF_IO[3] */ + 2 1 /* MPP[2]: NF_IO[4] */ + 3 1 /* MPP[3]: NF_IO[5] */ + 4 1 /* MPP[4]: NF_IO[6] */ + 5 1 /* MPP[5]: NF_IO[7] */ + 6 1 /* MPP[6]: SYSRST_OUTn */ + 7 2 /* MPP[7]: SPI_SCn */ + 8 1 /* MPP[8]: TW_SDA */ + 9 1 /* MPP[9]: TW_SCK */ + 10 3 /* MPP[10]: UA0_TXD */ + 11 3 /* MPP[11]: UA0_RXD */ + 12 1 /* MPP[12]: SD_CLK */ + 13 1 /* MPP[13]: SD_CMD */ + 14 1 /* MPP[14]: SD_D[0] */ + 15 1 /* MPP[15]: SD_D[1] */ + 16 1 /* MPP[16]: SD_D[2] */ + 17 1 /* MPP[17]: SD_D[3] */ + 18 1 /* MPP[18]: NF_IO[0] */ + 19 1 /* MPP[19]: NF_IO[1] */ + 20 5 /* MPP[20]: SATA1_AC */ + 21 5 >; /* MPP[21]: SATA0_AC */ + }; Added: head/sys/boot/fdt/dts/db78100.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/db78100.dts Wed May 26 09:50:09 2010 (r208561) @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Marvell DB-78100 Device Tree Source. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/ { + model = "mrvl,DB-78100"; + compatible = "DB-78100-BP", "DB-78100-BP-A"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + ethernet0 = &enet0; + serial0 = &serial0; + serial1 = &serial1; + mpp = &MPP; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "ARM,88FR571"; + reg = <0x0>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x4000>; // L1, 16K + i-cache-size = <0x4000>; // L1, 16K + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x20000000>; // 512M at 0x0 + }; + + localbus@f1000000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "mrvl,lbc"; + win-count = <14>; + + /* This reflects CPU decode windows setup. */ + ranges = <0x0 0x0f 0xf9300000 0x00100000 + 0x1 0x1e 0xfa000000 0x00100000 + 0x2 0x1d 0xfa100000 0x02000000 + 0x3 0x1b 0xfc100000 0x00000400>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x00100000>; + bank-width = <2>; + device-width = <1>; + }; + + led@1,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "led"; + reg = <0x1 0x0 0x00100000>; + }; + + nor@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x2 0x0 0x02000000>; + bank-width = <2>; + device-width = <1>; + }; + + nand@3,0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0x3 0x0 0x00100000>; + bank-width = <2>; + device-width = <1>; + }; + }; + + soc78100@f1000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges = <0x0 0xf1000000 0x00100000>; + bus-frequency = <0>; + + PIC: pic@20200 { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x20200 0x3c>; + compatible = "mrvl,pic"; + }; + + timer@20300 { + compatible = "mrvl,timer"; + reg = <0x20300 0x30>; + interrupts = <8>; + interrupt-parent = <&PIC>; + mrvl,has-wdt; + }; + + MPP: mpp@10000 { + #pin-cells = <2>; + compatible = "mrvl,mpp"; + reg = <0x10000 0x34>; + pin-count = <50>; + pin-map = < + 0 2 /* MPP[0]: GE1_TXCLK */ + 1 2 /* MPP[1]: GE1_TXCTL */ + 2 2 /* MPP[2]: GE1_RXCTL */ + 3 2 /* MPP[3]: GE1_RXCLK */ + 4 2 /* MPP[4]: GE1_TXD[0] */ + 5 2 /* MPP[5]: GE1_TXD[1] */ + 6 2 /* MPP[6]: GE1_TXD[2] */ + 7 2 /* MPP[7]: GE1_TXD[3] */ + 8 2 /* MPP[8]: GE1_RXD[0] */ + 9 2 /* MPP[9]: GE1_RXD[1] */ + 10 2 /* MPP[10]: GE1_RXD[2] */ + 11 2 /* MPP[11]: GE1_RXD[3] */ + 13 3 /* MPP[13]: SYSRST_OUTn */ + 14 3 /* MPP[14]: SATA1_ACTn */ + 15 3 /* MPP[15]: SATA0_ACTn */ + 16 4 /* MPP[16]: UA2_TXD */ + 17 4 /* MPP[17]: UA2_RXD */ + 18 3 /* MPP[18]: */ + 19 3 /* MPP[19]: */ + 20 3 /* MPP[20]: */ + 21 3 /* MPP[21]: */ + 22 4 /* MPP[22]: UA3_TXD */ + 23 4 >; /* MPP[21]: UA3_RXD */ + }; + + GPIO: gpio@10100 { + #gpio-cells = <3>; + compatible = "mrvl,gpio"; + reg = <0x10100 0x20>; + gpio-controller; + interrupts = <56 57 58 59>; + interrupt-parent = <&PIC>; + }; + + rtc@10300 { + compatible = "mrvl,rtc"; + reg = <0x10300 0x08>; + }; + + twsi@11000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,twsi"; + reg = <0x11000 0x20>; + interrupts = <2>; + interrupt-parent = <&PIC>; + }; + + twsi@11100 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,twsi"; + reg = <0x11100 0x20>; + interrupts = <3>; + interrupt-parent = <&PIC>; + }; + + enet0: ethernet@72000 { + #address-cells = <1>; + #size-cells = <1>; + model = "V2"; + compatible = "mrvl,ge"; + reg = <0x72000 0x2000>; + ranges = <0x0 0x72000 0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <41 42 43 40 70>; + interrupt-parent = <&PIC>; + phy-handle = <&phy0>; + + mdio@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,mdio"; + + phy0: ethernet-phy@0 { + reg = <0x8>; + }; + }; + }; + + enet1: ethernet@76000 { + #address-cells = <1>; + #size-cells = <1>; + model = "V2"; + compatible = "mrvl,ge"; + reg = <0x76000 0x2000>; + ranges = <0x0 0x76000 0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <45 46 47 44 70>; + interrupt-parent = <&PIC>; + phy-handle = <&phy0>; + + mdio@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,mdio"; + + phy0: ethernet-phy@0 { + reg = <0x9>; + }; + }; + }; + + serial0: serial@12000 { + compatible = "ns16550"; + reg = <0x12000 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <12>; + interrupt-parent = <&PIC>; + }; + + serial1: serial@12100 { + compatible = "ns16550"; + reg = <0x12100 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <13>; + interrupt-parent = <&PIC>; + }; + + usb@50000 { + compatible = "mrvl,usb-ehci", "usb-ehci"; + reg = <0x50000 0x1000>; + interrupts = <72 16>; + interrupt-parent = <&PIC>; + }; + + usb@51000 { + compatible = "mrvl,usb-ehci", "usb-ehci"; + reg = <0x51000 0x1000>; + interrupts = <72 17>; + interrupt-parent = <&PIC>; + }; + + usb@52000 { + compatible = "mrvl,usb-ehci", "usb-ehci"; + reg = <0x52000 0x1000>; + interrupts = <72 18>; + interrupt-parent = <&PIC>; + }; + + xor@60000 { + compatible = "mrvl,xor"; + reg = <0x60000 0x1000>; + interrupts = <22 23>; + interrupt-parent = <&PIC>; + }; + + crypto@90000 { + compatible = "mrvl,cesa"; + reg = <0x90000 0x10000>; + interrupts = <19>; + interrupt-parent = <&PIC>; + }; + + sata@a0000 { + compatible = "mrvl,sata"; + reg = <0xa0000 0x6000>; + interrupts = <26>; + interrupt-parent = <&PIC>; + }; + }; + + sram@fd000000 { + compatible = "mrvl,cesa-sram"; + reg = <0xfd000000 0x00100000>; + }; +}; Added: head/sys/boot/fdt/dts/db88f5182.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/db88f5182.dts Wed May 26 09:50:09 2010 (r208561) @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Marvell DB-88F5182 Device Tree Source. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/ { + model = "mrvl,DB-88F5182"; + compatible = "DB-88F5182-BP", "DB-88F5182-BP-A"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + ethernet0 = &enet0; + serial0 = &serial0; + serial1 = &serial1; + mpp = &MPP; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "ARM,88FR531"; + reg = <0x0>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x8000>; // L1, 32K + i-cache-size = <0x8000>; // L1, 32K + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x08000000>; // 128M at 0x0 + }; + + localbus@f1000000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "mrvl,lbc"; + + /* This reflects CPU decode windows setup. */ + ranges = <0x0 0x0f 0xf9300000 0x00100000 + 0x1 0x1e 0xfa000000 0x00100000 + 0x2 0x1d 0xfa100000 0x02000000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x00100000>; + bank-width = <2>; + device-width = <1>; + }; + + led@1,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "led"; + reg = <0x1 0x0 0x00100000>; + }; + + nor@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x2 0x0 0x02000000>; + bank-width = <2>; + device-width = <1>; + }; + }; + + soc88f5182@f1000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges = <0x0 0xf1000000 0x00100000>; + bus-frequency = <0>; + + PIC: pic@20200 { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x20200 0x3c>; + compatible = "mrvl,pic"; + }; + + timer@20300 { + compatible = "mrvl,timer"; + reg = <0x20300 0x30>; + interrupts = <0>; + interrupt-parent = <&PIC>; + mrvl,has-wdt; + }; + + MPP: mpp@10000 { + #pin-cells = <2>; + compatible = "mrvl,mpp"; + reg = <0x10000 0x54>; + pin-count = <20>; + pin-map = < + 0 3 /* MPP[0]: GPIO[0] */ + 2 2 /* MPP[2]: PCI_REQn[3] */ + 3 2 /* MPP[3]: PCI_GNTn[3] */ + 4 2 /* MPP[4]: PCI_REQn[4] */ + 5 2 /* MPP[5]: PCI_GNTn[4] */ + 6 5 /* MPP[6]: SATA0_ACT */ + 7 5 /* MPP[7]: SATA1_ACT */ + 12 5 /* MPP[12]: SATA0_PRESENT */ + 13 5 /* MPP[13]: SATA1_PRESENT */ + 14 4 /* MPP[14]: NAND Flash REn[2] */ + 15 4 /* MPP[15]: NAND Flash WEn[2] */ + 16 0 /* MPP[16]: UA1_RXD */ + 17 0 /* MPP[17]: UA1_TXD */ + 18 0 /* MPP[18]: UA1_CTS */ + 19 0 >; /* MPP[19]: UA1_RTS */ + }; + + GPIO: gpio@10100 { + #gpio-cells = <3>; + compatible = "mrvl,gpio"; + reg = <0x10100 0x20>; + gpio-controller; + interrupts = <6 7 8 9>; + interrupt-parent = <&PIC>; + }; + + twsi@11000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,twsi"; + reg = <0x11000 0x20>; + interrupts = <43>; + interrupt-parent = <&PIC>; + }; + + enet0: ethernet@72000 { + #address-cells = <1>; + #size-cells = <1>; + model = "V1"; + compatible = "mrvl,ge"; + reg = <0x72000 0x2000>; + ranges = <0x0 0x72000 0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <18 19 20 21 22>; + interrupt-parent = <&PIC>; + }; + + serial0: serial@12000 { + compatible = "ns16550"; + reg = <0x12000 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <3>; + interrupt-parent = <&PIC>; + }; + + serial1: serial@12100 { + compatible = "ns16550"; + reg = <0x12100 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <4>; + interrupt-parent = <&PIC>; + }; + + usb@50000 { + compatible = "mrvl,usb-ehci", "usb-ehci"; + reg = <0x50000 0x1000>; + interrupts = <17 16>; + interrupt-parent = <&PIC>; + }; + + idma@60000 { + compatible = "mrvl,idma"; + reg = <0x60000 0x1000>; + interrupts = <24 25 26 27 23>; + interrupt-parent = <&PIC>; + }; + + sata@80000 { + compatible = "mrvl,sata"; + reg = <0x80000 0x6000>; + interrupts = <29>; + interrupt-parent = <&PIC>; + }; + }; +}; Added: head/sys/boot/fdt/dts/db88f5281.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/db88f5281.dts Wed May 26 09:50:09 2010 (r208561) @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Marvell DB-88F5281 Device Tree Source. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/ { + model = "mrvl,DB-88F5281"; + compatible = "DB-88F5281-BP", "DB-88F5281-BP-A"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + ethernet0 = &enet0; + serial0 = &serial0; + serial1 = &serial1; + mpp = &MPP; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "ARM,88FR531"; + reg = <0x0>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x8000>; // L1, 32K + i-cache-size = <0x8000>; // L1, 32K + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x08000000>; // 128M at 0x0 + }; + + localbus@f1000000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "mrvl,lbc"; + + /* This reflects CPU decode windows setup. */ + ranges = <0x0 0x0f 0xf9300000 0x00100000 + 0x1 0x1e 0xfa000000 0x00100000 + 0x2 0x1d 0xfa100000 0x02000000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x00100000>; + bank-width = <2>; + device-width = <1>; + }; + + led@1,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "led"; + reg = <0x1 0x0 0x00100000>; + }; + + nor@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x2 0x0 0x02000000>; + bank-width = <2>; + device-width = <1>; + }; + }; + + soc88f5281@f1000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges = <0x0 0xf1000000 0x00100000>; + bus-frequency = <0>; + + PIC: pic@20200 { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x20200 0x3c>; + compatible = "mrvl,pic"; + }; + + timer@20300 { + compatible = "mrvl,timer"; + reg = <0x20300 0x30>; + interrupts = <0>; + interrupt-parent = <&PIC>; + mrvl,has-wdt; + }; + + MPP: mpp@10000 { + #pin-cells = <2>; + compatible = "mrvl,mpp"; + reg = <0x10000 0x54>; + pin-count = <20>; + pin-map = < + 0 3 /* MPP[0]: GPIO[0] */ + 2 2 /* MPP[2]: PCI_REQn[3] */ + 3 2 /* MPP[3]: PCI_GNTn[3] */ + 4 2 /* MPP[4]: PCI_REQn[4] */ + 5 2 /* MPP[5]: PCI_GNTn[4] */ + 6 3 /* MPP[6]: */ + 7 3 /* MPP[7]: */ + 8 3 /* MPP[8]: */ + 9 3 /* MPP[9]: */ + 14 4 /* MPP[14]: NAND Flash REn[2] */ + 15 4 /* MPP[15]: NAND Flash WEn[2] */ + 16 0 /* MPP[16]: UA1_RXD */ + 17 0 /* MPP[17]: UA1_TXD */ + 18 0 /* MPP[18]: UA1_CTS */ + 19 0 >; /* MPP[19]: UA1_RTS */ + }; + + GPIO: gpio@10100 { + #gpio-cells = <3>; + compatible = "mrvl,gpio"; + reg = <0x10100 0x20>; + gpio-controller; + interrupts = <6 7 8 9>; + interrupt-parent = <&PIC>; + }; + + twsi@11000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,twsi"; + reg = <0x11000 0x20>; + interrupts = <43>; + interrupt-parent = <&PIC>; + }; + + enet0: ethernet@72000 { + #address-cells = <1>; + #size-cells = <1>; + model = "V1"; + compatible = "mrvl,ge"; + reg = <0x72000 0x2000>; + ranges = <0x0 0x72000 0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <18 19 20 21 22>; + interrupt-parent = <&PIC>; + phy-handle = <&phy0>; + + mdio@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "mrvl,mdio"; + + phy0: ethernet-phy@0 { + reg = <0x8>; + }; + }; + }; + + serial0: serial@12000 { + compatible = "ns16550"; + reg = <0x12000 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <3>; + interrupt-parent = <&PIC>; + }; + + serial1: serial@12100 { + compatible = "ns16550"; + reg = <0x12100 0x20>; + reg-shift = <2>; + clock-frequency = <0>; + interrupts = <4>; + interrupt-parent = <&PIC>; + }; + + usb@50000 { + compatible = "mrvl,usb-ehci", "usb-ehci"; + reg = <0x50000 0x1000>; + interrupts = <17 16>; + interrupt-parent = <&PIC>; + }; + + idma@60000 { + compatible = "mrvl,idma"; + reg = <0x60000 0x1000>; + interrupts = <24 25 26 27 23>; + interrupt-parent = <&PIC>; + }; + }; +}; Added: head/sys/boot/fdt/dts/db88f6281.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/db88f6281.dts Wed May 26 09:50:09 2010 (r208561) @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Marvell DB-88F6281 Device Tree Source. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/ { + model = "mrvl,DB-88F6281"; + compatible = "DB-88F6281-BP", "DB-88F6281-BP-A"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + ethernet0 = &enet0; + mpp = &MPP; + pci0 = &pci0; + serial0 = &serial0; + serial1 = &serial1; + soc = &SOC; + sram = &SRAM; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "ARM,88FR131"; + reg = <0x0>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x4000>; // L1, 16K + i-cache-size = <0x4000>; // L1, 16K + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed May 26 10:46:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 619B3106566C; Wed, 26 May 2010 10:46:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2C78FC08; Wed, 26 May 2010 10:46:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QAk3qX018427; Wed, 26 May 2010 10:46:03 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QAk3Ch018424; Wed, 26 May 2010 10:46:03 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201005261046.o4QAk3Ch018424@svn.freebsd.org> From: Robert Watson Date: Wed, 26 May 2010 10:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208562 - head/tools/regression/sockets/unix_close_race X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 10:46:03 -0000 Author: rwatson Date: Wed May 26 10:46:03 2010 New Revision: 208562 URL: http://svn.freebsd.org/changeset/base/208562 Log: Add unix_close_race, a regresion test to catch ENOTCONN being returned improperly from one of two instances of close(2) being called simultaneously on both ends of a connected UNIX domain socket. The test tool is slightly tweaked to improve failure modes, and while often does trigger the problem, doesn't do so consistently due to the nature of the race. PR: kern/144061 Submitted by: Mikolaj Golub MFC after: 3 days Added: head/tools/regression/sockets/unix_close_race/ head/tools/regression/sockets/unix_close_race/Makefile (contents, props changed) head/tools/regression/sockets/unix_close_race/unix_close_race.c (contents, props changed) Added: head/tools/regression/sockets/unix_close_race/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_close_race/Makefile Wed May 26 10:46:03 2010 (r208562) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= unix_close_race +NO_MAN= +WARNS?= 3 + +.include Added: head/tools/regression/sockets/unix_close_race/unix_close_race.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_close_race/unix_close_race.c Wed May 26 10:46:03 2010 (r208562) @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 2010 Mikolaj Golub + * 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$ + */ + +/* + * This regression test attempts to trigger a race that occurs when both + * endpoints of a connected UNIX domain socket are closed at once. The two + * close paths may run concurrently leading to a call to sodisconnect() on an + * already-closed socket in kernel. Before it was fixed, this might lead to + * ENOTCONN being returned improperly from close(). + * + * This race is fairly timing-dependent, so it effectively requires SMP, and + * may not even trigger then. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define UNIXSTR_PATH "/tmp/mytest.socket" +#define USLEEP 100 +#define LOOPS 100000 + +int +main(int argc, char **argv) +{ + struct sockaddr_un servaddr; + int listenfd, connfd, pid; + u_int counter, ncpus; + size_t len; + + len = sizeof(ncpus); + if (sysctlbyname("kern.smp.cpus", &ncpus, &len, NULL, 0) < 0) + err(1, "kern.smp.cpus"); + if (len != sizeof(ncpus)) + errx(1, "kern.smp.cpus: invalid length"); + if (ncpus < 2) + warnx("SMP not present, test may be unable to trigger race"); + + /* + * Create a UNIX domain socket that the parent will repeatedly + * accept() from, and that the child will repeatedly connect() to. + */ + if ((listenfd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) + err(1, "parent: socket error"); + (void)unlink(UNIXSTR_PATH); + bzero(&servaddr, sizeof(servaddr)); + servaddr.sun_family = AF_LOCAL; + strcpy(servaddr.sun_path, UNIXSTR_PATH); + if (bind(listenfd, (struct sockaddr *) &servaddr, + sizeof(servaddr)) < 0) + err(1, "parent: bind error"); + if (listen(listenfd, 1024) < 0) + err(1, "parent: listen error"); + + pid = fork(); + if (pid == -1) + err(1, "fork()"); + if (pid != 0) { + /* + * In the parent, repeatedly connect and disconnect from the + * socket, attempting to induce the race. + */ + close(listenfd); + sleep(1); + bzero(&servaddr, sizeof(servaddr)); + servaddr.sun_family = AF_LOCAL; + strcpy(servaddr.sun_path, UNIXSTR_PATH); + for (counter = 0; counter < LOOPS; counter++) { + if ((connfd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) + err(1, "child: socket error"); + if (connect(connfd, (struct sockaddr *)&servaddr, + sizeof(servaddr)) < 0) + err(1, "child: connect error"); + if (close(connfd) < 0) + err(1, "child: close error"); + usleep(USLEEP); + } + (void)kill(pid, SIGTERM); + } else { + /* + * In the child, loop accepting and closing. We may pick up + * the race here so report errors from close(). + */ + for ( ; ; ) { + if ((connfd = accept(listenfd, + (struct sockaddr *)NULL, NULL)) < 0) + err(1, "parent: accept error"); + if (close(connfd) < 0) + err(1, "parent: close error"); + } + } + printf("OK\n"); + exit(0); +} From owner-svn-src-head@FreeBSD.ORG Wed May 26 11:31:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB496106566C; Wed, 26 May 2010 11:31:57 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A1108FC12; Wed, 26 May 2010 11:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QBVvtR032220; Wed, 26 May 2010 11:31:57 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QBVv7O032218; Wed, 26 May 2010 11:31:57 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201005261131.o4QBVv7O032218@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 26 May 2010 11:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208563 - head/sys/pc98/cbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 11:31:57 -0000 Author: nyan Date: Wed May 26 11:31:57 2010 New Revision: 208563 URL: http://svn.freebsd.org/changeset/base/208563 Log: Reduce diffs against syscons_isa.c. No functional changes. Modified: head/sys/pc98/cbus/syscons_cbus.c Modified: head/sys/pc98/cbus/syscons_cbus.c ============================================================================== --- head/sys/pc98/cbus/syscons_cbus.c Wed May 26 10:46:03 2010 (r208562) +++ head/sys/pc98/cbus/syscons_cbus.c Wed May 26 11:31:57 2010 (r208563) @@ -22,10 +22,11 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include "opt_syscons.h" #include @@ -47,7 +48,7 @@ static devclass_t sc_devclass; -static sc_softc_t main_softc; +static sc_softc_t main_softc; #ifdef SC_NO_SUSPEND_VTYSWITCH static int sc_no_suspend_vtswitch = 1; #else @@ -55,31 +56,34 @@ static int sc_no_suspend_vtswitch = 0; #endif static int sc_cur_scr; -TUNABLE_INT("hw.syscons.sc_no_suspend_vtswitch", (int *)&sc_no_suspend_vtswitch); +TUNABLE_INT("hw.syscons.sc_no_suspend_vtswitch", &sc_no_suspend_vtswitch); SYSCTL_DECL(_hw_syscons); SYSCTL_INT(_hw_syscons, OID_AUTO, sc_no_suspend_vtswitch, CTLFLAG_RW, - &sc_no_suspend_vtswitch, 0, "Disable VT switch before suspend."); + &sc_no_suspend_vtswitch, 0, "Disable VT switch before suspend."); static void -scidentify (driver_t *driver, device_t parent) +scidentify(driver_t *driver, device_t parent) { + BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "sc", 0); } static int scprobe(device_t dev) { + /* No pnp support */ if (isa_get_vendorid(dev)) return (ENXIO); device_set_desc(dev, "System console"); - return sc_probe_unit(device_get_unit(dev), device_get_flags(dev)); + return (sc_probe_unit(device_get_unit(dev), device_get_flags(dev))); } static int scattach(device_t dev) { + return sc_attach_unit(device_get_unit(dev), device_get_flags(dev)); } @@ -127,7 +131,8 @@ scresume(device_t dev) int sc_max_unit(void) { - return devclass_get_maxunit(sc_devclass); + + return (devclass_get_maxunit(sc_devclass)); } sc_softc_t @@ -136,52 +141,52 @@ sc_softc_t sc_softc_t *sc; if (unit < 0) - return NULL; - if (flags & SC_KERNEL_CONSOLE) { + return (NULL); + if ((flags & SC_KERNEL_CONSOLE) != 0) { /* FIXME: clear if it is wired to another unit! */ sc = &main_softc; } else { - sc = (sc_softc_t *)device_get_softc(devclass_get_device(sc_devclass, unit)); + sc = device_get_softc(devclass_get_device(sc_devclass, unit)); if (sc == NULL) - return NULL; + return (NULL); } sc->unit = unit; - if (!(sc->flags & SC_INIT_DONE)) { + if ((sc->flags & SC_INIT_DONE) == 0) { sc->keyboard = -1; sc->adapter = -1; sc->mouse_char = SC_MOUSE_CHAR; } - return sc; + return (sc); } sc_softc_t *sc_find_softc(struct video_adapter *adp, struct keyboard *kbd) { sc_softc_t *sc; - int units; int i; + int units; sc = &main_softc; - if (((adp == NULL) || (adp == sc->adp)) - && ((kbd == NULL) || (kbd == sc->kbd))) - return sc; + if ((adp == NULL || adp == sc->adp) && + (kbd == NULL || kbd == sc->kbd)) + return (sc); units = devclass_get_maxunit(sc_devclass); for (i = 0; i < units; ++i) { - sc = (sc_softc_t *)device_get_softc(devclass_get_device(sc_devclass, i)); + sc = device_get_softc(devclass_get_device(sc_devclass, i)); if (sc == NULL) continue; - if (((adp == NULL) || (adp == sc->adp)) - && ((kbd == NULL) || (kbd == sc->kbd))) - return sc; + if ((adp == NULL || adp == sc->adp) && + (kbd == NULL || kbd == sc->kbd)) + return (sc); } - return NULL; + return (NULL); } int sc_get_cons_priority(int *unit, int *flags) { const char *at; - int u, f; + int f, u; *unit = -1; for (u = 0; u < 16; u++) { @@ -207,7 +212,7 @@ sc_get_cons_priority(int *unit, int *fla *unit = 0; *flags = 0; } - return CN_INTERNAL; + return (CN_INTERNAL); } void @@ -225,12 +230,12 @@ sc_tone(int herz) if (herz) { if (timer_spkr_acquire()) - return EBUSY; + return (EBUSY); timer_spkr_setfreq(herz); - } else { + } else timer_spkr_release(); - } - return 0; + + return (0); } static device_method_t sc_methods[] = { From owner-svn-src-head@FreeBSD.ORG Wed May 26 15:29:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B16106566B; Wed, 26 May 2010 15:29:54 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3A648FC0C; Wed, 26 May 2010 15:29:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QFTrJM084438; Wed, 26 May 2010 15:29:53 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QFTrIA084436; Wed, 26 May 2010 15:29:53 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201005261529.o4QFTrIA084436@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 26 May 2010 15:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208564 - head/sys/isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 15:29:54 -0000 Author: jkim Date: Wed May 26 15:29:53 2010 New Revision: 208564 URL: http://svn.freebsd.org/changeset/base/208564 Log: Let the first device suspend and the last device resume syscons(4). Modified: head/sys/isa/syscons_isa.c Modified: head/sys/isa/syscons_isa.c ============================================================================== --- head/sys/isa/syscons_isa.c Wed May 26 11:31:57 2010 (r208563) +++ head/sys/isa/syscons_isa.c Wed May 26 15:29:53 2010 (r208564) @@ -116,10 +116,10 @@ scsuspend(device_t dev) sc = &main_softc; - if (sc->cur_scp == NULL || sc->suspend_in_progress) + if (sc->cur_scp == NULL) return (0); - if (!sc_no_suspend_vtswitch) { + if (sc->suspend_in_progress == 0 && !sc_no_suspend_vtswitch) { sc_cur_scr = sc->cur_scp->index; do { sc_switch_scr(sc, 0); @@ -128,8 +128,7 @@ scsuspend(device_t dev) pause("scsuspend", hz); } while (retry--); } - - sc->suspend_in_progress = TRUE; + sc->suspend_in_progress++; return (0); } @@ -141,12 +140,8 @@ scresume(device_t dev) sc = &main_softc; - if (!sc->suspend_in_progress) - return (0); - - sc->suspend_in_progress = FALSE; - - if (!sc_no_suspend_vtswitch) + sc->suspend_in_progress--; + if (sc->suspend_in_progress == 0 && !sc_no_suspend_vtswitch) sc_switch_scr(sc, sc_cur_scr); return (0); From owner-svn-src-head@FreeBSD.ORG Wed May 26 15:36:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24354106566B; Wed, 26 May 2010 15:36:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 131148FC1E; Wed, 26 May 2010 15:36:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QFaTXs085921; Wed, 26 May 2010 15:36:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QFaTkR085919; Wed, 26 May 2010 15:36:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005261536.o4QFaTkR085919@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 26 May 2010 15:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208565 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 15:36:30 -0000 Author: kib Date: Wed May 26 15:36:29 2010 New Revision: 208565 URL: http://svn.freebsd.org/changeset/base/208565 Log: Remove a check that should be always true. Discussed with: pjd MFC after: 1 week Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed May 26 15:29:53 2010 (r208564) +++ head/sys/modules/Makefile Wed May 26 15:36:29 2010 (r208565) @@ -476,10 +476,8 @@ _nxge= nxge _wpi= wpi _wpifw= wpifw .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) -.if exists(${.CURDIR}/../crypto/via) _padlock= padlock .endif -.endif _s3= s3 _twa= twa _vesa= vesa @@ -555,10 +553,8 @@ _nxge= nxge _opensolaris= opensolaris .endif .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) -.if exists(${.CURDIR}/../crypto/via) _padlock= padlock .endif -.endif _pccard= pccard _rdma= rdma _s3= s3 From owner-svn-src-head@FreeBSD.ORG Wed May 26 15:39:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB9F91065676; Wed, 26 May 2010 15:39:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA64C8FC16; Wed, 26 May 2010 15:39:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QFdhxi086664; Wed, 26 May 2010 15:39:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QFdhRk086661; Wed, 26 May 2010 15:39:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005261539.o4QFdhRk086661@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 26 May 2010 15:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208566 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 15:39:44 -0000 Author: kib Date: Wed May 26 15:39:43 2010 New Revision: 208566 URL: http://svn.freebsd.org/changeset/base/208566 Log: Allow to use syscallname(9) outside subr_trap.c. MFC after: 1 month Modified: head/sys/kern/subr_trap.c head/sys/sys/sysent.h Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Wed May 26 15:36:29 2010 (r208565) +++ head/sys/kern/subr_trap.c Wed May 26 15:39:43 2010 (r208566) @@ -260,8 +260,7 @@ ast(struct trapframe *framep) } #ifdef HAVE_SYSCALL_ARGS_DEF -static const char *syscallname(struct proc *p, u_int code) __unused; -static const char * +const char * syscallname(struct proc *p, u_int code) { static const char unknown[] = "unknown"; Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Wed May 26 15:36:29 2010 (r208565) +++ head/sys/sys/sysent.h Wed May 26 15:39:43 2010 (r208566) @@ -202,6 +202,9 @@ int syscall_module_handler(struct module int syscall_helper_register(struct syscall_helper_data *sd); int syscall_helper_unregister(struct syscall_helper_data *sd); +struct proc; +const char *syscallname(struct proc *p, u_int code); + /* Special purpose system call functions. */ struct nosys_args; From owner-svn-src-head@FreeBSD.ORG Wed May 26 16:37:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DA85106566C; Wed, 26 May 2010 16:37:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CA238FC16; Wed, 26 May 2010 16:37:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QGbsTF099491; Wed, 26 May 2010 16:37:54 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QGbstv099489; Wed, 26 May 2010 16:37:54 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201005261637.o4QGbstv099489@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 26 May 2010 16:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208567 - head/sys/isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 16:37:55 -0000 Author: jkim Date: Wed May 26 16:37:54 2010 New Revision: 208567 URL: http://svn.freebsd.org/changeset/base/208567 Log: Do not attempt to switch to the same VTs between suspend and resume. Modified: head/sys/isa/syscons_isa.c Modified: head/sys/isa/syscons_isa.c ============================================================================== --- head/sys/isa/syscons_isa.c Wed May 26 15:39:43 2010 (r208566) +++ head/sys/isa/syscons_isa.c Wed May 26 16:37:54 2010 (r208567) @@ -119,14 +119,15 @@ scsuspend(device_t dev) if (sc->cur_scp == NULL) return (0); - if (sc->suspend_in_progress == 0 && !sc_no_suspend_vtswitch) { + if (sc->suspend_in_progress == 0) { sc_cur_scr = sc->cur_scp->index; - do { - sc_switch_scr(sc, 0); - if (!sc->switch_in_progress) - break; - pause("scsuspend", hz); - } while (retry--); + if (!sc_no_suspend_vtswitch && sc_cur_scr != 0) + do { + sc_switch_scr(sc, 0); + if (!sc->switch_in_progress) + break; + pause("scsuspend", hz); + } while (retry--); } sc->suspend_in_progress++; @@ -141,8 +142,9 @@ scresume(device_t dev) sc = &main_softc; sc->suspend_in_progress--; - if (sc->suspend_in_progress == 0 && !sc_no_suspend_vtswitch) - sc_switch_scr(sc, sc_cur_scr); + if (sc->suspend_in_progress == 0) + if (!sc_no_suspend_vtswitch && sc_cur_scr != 0) + sc_switch_scr(sc, sc_cur_scr); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed May 26 18:00:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24B6A1065673; Wed, 26 May 2010 18:00:45 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10FFE8FC22; Wed, 26 May 2010 18:00:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QI0jc2018146; Wed, 26 May 2010 18:00:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QI0iho018130; Wed, 26 May 2010 18:00:44 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005261800.o4QI0iho018130@svn.freebsd.org> From: Alan Cox Date: Wed, 26 May 2010 18:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208574 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 mips/mips powerpc/aim powerpc/booke sparc64/sparc64 sun4v/sun4v vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 18:00:45 -0000 Author: alc Date: Wed May 26 18:00:44 2010 New Revision: 208574 URL: http://svn.freebsd.org/changeset/base/208574 Log: Push down page queues lock acquisition in pmap_enter_object() and pmap_is_referenced(). Eliminate the corresponding page queues lock acquisitions from vm_map_pmap_enter() and mincore(), respectively. In mincore(), this allows some additional cases to complete without ever acquiring the page queues lock. Assert that the page is managed in pmap_is_referenced(). On powerpc/aim, push down the page queues lock acquisition from moea*_is_modified() and moea*_is_referenced() into moea*_query_bit(). Again, this will allow some additional cases to complete without ever acquiring the page queues lock. Reorder a few statements in vm_page_dontneed() so that a race can't lead to an old reference persisting. This scenario is described in detail by a comment. Correct a spelling error in vm_page_dontneed(). Assert that the object is locked in vm_page_clear_dirty(), and restrict the page queues lock assertion to just those cases in which the page is currently writeable. Add object locking to vnode_pager_generic_putpages(). This was the one and only place where vm_page_clear_dirty() was being called without the object being locked. Eliminate an unnecessary vm_page_lock() around vnode_pager_setsize()'s call to vm_page_clear_dirty(). Change vnode_pager_generic_putpages() to the modern-style of function definition. Also, change the name of one of the parameters to follow virtual memory system naming conventions. Reviewed by: kib Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/sun4v/sun4v/pmap.c head/sys/vm/vm_map.c head/sys/vm/vm_mmap.c head/sys/vm/vm_page.c head/sys/vm/vnode_pager.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/amd64/amd64/pmap.c Wed May 26 18:00:44 2010 (r208574) @@ -3389,6 +3389,7 @@ pmap_enter_object(pmap_t pmap, vm_offset psize = atop(end - start); mpte = NULL; m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { va = start + ptoa(diff); @@ -3402,6 +3403,7 @@ pmap_enter_object(pmap_t pmap, vm_offset mpte); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -4209,12 +4211,15 @@ pmap_is_prefaultable(pmap_t pmap, vm_off boolean_t pmap_is_referenced(vm_page_t m) { + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - if (pmap_is_referenced_pvh(&m->md)) - return (TRUE); - return (pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_referenced: page %p is not managed", m)); + vm_page_lock_queues(); + rv = pmap_is_referenced_pvh(&m->md) || + pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))); + vm_page_unlock_queues(); + return (rv); } /* Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/arm/arm/pmap.c Wed May 26 18:00:44 2010 (r208574) @@ -3589,12 +3589,14 @@ pmap_enter_object(pmap_t pmap, vm_offset psize = atop(end - start); m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { pmap_enter_locked(pmap, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE, M_NOWAIT); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -4521,8 +4523,9 @@ boolean_t pmap_is_referenced(vm_page_t m) { - return ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0 && - (m->md.pvh_attrs & PVF_REF) != 0); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_referenced: page %p is not managed", m)); + return ((m->md.pvh_attrs & PVF_REF) != 0); } /* Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/i386/i386/pmap.c Wed May 26 18:00:44 2010 (r208574) @@ -3519,6 +3519,7 @@ pmap_enter_object(pmap_t pmap, vm_offset psize = atop(end - start); mpte = NULL; m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { va = start + ptoa(diff); @@ -3532,6 +3533,7 @@ pmap_enter_object(pmap_t pmap, vm_offset mpte); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -4377,12 +4379,15 @@ pmap_is_prefaultable(pmap_t pmap, vm_off boolean_t pmap_is_referenced(vm_page_t m) { + boolean_t rv; - if (m->flags & PG_FICTITIOUS) - return (FALSE); - if (pmap_is_referenced_pvh(&m->md)) - return (TRUE); - return (pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_referenced: page %p is not managed", m)); + vm_page_lock_queues(); + rv = pmap_is_referenced_pvh(&m->md) || + pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m))); + vm_page_unlock_queues(); + return (rv); } /* Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/i386/xen/pmap.c Wed May 26 18:00:44 2010 (r208574) @@ -2901,6 +2901,7 @@ pmap_enter_object(pmap_t pmap, vm_offset mpte = NULL; m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { mpte = pmap_enter_quick_locked(&mclp, &count, pmap, start + ptoa(diff), m, @@ -2917,7 +2918,7 @@ pmap_enter_object(pmap_t pmap, vm_offset error = HYPERVISOR_multicall(mcl, count); KASSERT(error == 0, ("bad multicall %d", error)); } - + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -3734,11 +3735,11 @@ pmap_is_referenced(vm_page_t m) pmap_t pmap; boolean_t rv; + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_referenced: page %p is not managed", m)); rv = FALSE; - if (m->flags & PG_FICTITIOUS) - return (rv); + vm_page_lock_queues(); sched_pin(); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -3751,6 +3752,7 @@ pmap_is_referenced(vm_page_t m) if (*PMAP1) PT_SET_MA(PADDR1, 0); sched_unpin(); + vm_page_unlock_queues(); return (rv); } Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/ia64/ia64/pmap.c Wed May 26 18:00:44 2010 (r208574) @@ -1625,12 +1625,14 @@ pmap_enter_object(pmap_t pmap, vm_offset VM_OBJECT_LOCK_ASSERT(m_start->object, MA_OWNED); psize = atop(end - start); m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { pmap_enter_quick_locked(pmap, start + ptoa(diff), m, prot); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); pmap_switch(oldpmap); PMAP_UNLOCK(pmap); } @@ -2041,9 +2043,10 @@ pmap_is_referenced(vm_page_t m) pv_entry_t pv; boolean_t rv; + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_referenced: page %p is not managed", m)); rv = FALSE; - if (m->flags & PG_FICTITIOUS) - return (rv); + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { PMAP_LOCK(pv->pv_pmap); oldpmap = pmap_switch(pv->pv_pmap); @@ -2055,6 +2058,7 @@ pmap_is_referenced(vm_page_t m) if (rv) break; } + vm_page_unlock_queues(); return (rv); } Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/mips/mips/pmap.c Wed May 26 18:00:44 2010 (r208574) @@ -2130,12 +2130,14 @@ pmap_enter_object(pmap_t pmap, vm_offset psize = atop(end - start); mpte = NULL; m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { mpte = pmap_enter_quick_locked(pmap, start + ptoa(diff), m, prot, mpte); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -2671,8 +2673,9 @@ boolean_t pmap_is_referenced(vm_page_t m) { - return ((m->flags & PG_FICTITIOUS) == 0 && - (m->md.pv_flags & PV_TABLE_REF) != 0); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_referenced: page %p is not managed", m)); + return ((m->md.pv_flags & PV_TABLE_REF) != 0); } /* Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/powerpc/aim/mmu_oea.c Wed May 26 18:00:44 2010 (r208574) @@ -1197,12 +1197,14 @@ moea_enter_object(mmu_t mmu, pmap_t pm, psize = atop(end - start); m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pm); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { moea_enter_locked(pm, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pm); } @@ -1282,15 +1284,14 @@ boolean_t moea_is_referenced(mmu_t mmu, vm_page_t m) { - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (FALSE); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("moea_is_referenced: page %p is not managed", m)); return (moea_query_bit(m, PTE_REF)); } boolean_t moea_is_modified(mmu_t mmu, vm_page_t m) { - boolean_t rv; KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("moea_is_modified: page %p is not managed", m)); @@ -1304,10 +1305,7 @@ moea_is_modified(mmu_t mmu, vm_page_t m) if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0) return (FALSE); - vm_page_lock_queues(); - rv = moea_query_bit(m, PTE_CHG); - vm_page_unlock_queues(); - return (rv); + return (moea_query_bit(m, PTE_CHG)); } void @@ -2268,6 +2266,7 @@ moea_query_bit(vm_page_t m, int ptebit) if (moea_attr_fetch(m) & ptebit) return (TRUE); + vm_page_lock_queues(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { MOEA_PVO_CHECK(pvo); /* sanity check */ @@ -2278,6 +2277,7 @@ moea_query_bit(vm_page_t m, int ptebit) if (pvo->pvo_pte.pte.pte_lo & ptebit) { moea_attr_save(m, ptebit); MOEA_PVO_CHECK(pvo); /* sanity check */ + vm_page_unlock_queues(); return (TRUE); } } @@ -2303,11 +2303,13 @@ moea_query_bit(vm_page_t m, int ptebit) if (pvo->pvo_pte.pte.pte_lo & ptebit) { moea_attr_save(m, ptebit); MOEA_PVO_CHECK(pvo); /* sanity check */ + vm_page_unlock_queues(); return (TRUE); } } } + vm_page_unlock_queues(); return (FALSE); } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/powerpc/aim/mmu_oea64.c Wed May 26 18:00:44 2010 (r208574) @@ -1330,12 +1330,14 @@ moea64_enter_object(mmu_t mmu, pmap_t pm psize = atop(end - start); m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pm); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { moea64_enter_locked(pm, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pm); } @@ -1477,15 +1479,14 @@ boolean_t moea64_is_referenced(mmu_t mmu, vm_page_t m) { - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (FALSE); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("moea64_is_referenced: page %p is not managed", m)); return (moea64_query_bit(m, PTE_REF)); } boolean_t moea64_is_modified(mmu_t mmu, vm_page_t m) { - boolean_t rv; KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("moea64_is_modified: page %p is not managed", m)); @@ -1499,10 +1500,7 @@ moea64_is_modified(mmu_t mmu, vm_page_t if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0) return (FALSE); - vm_page_lock_queues(); - rv = moea64_query_bit(m, LPTE_CHG); - vm_page_unlock_queues(); - return (rv); + return (moea64_query_bit(m, LPTE_CHG)); } void @@ -2394,7 +2392,7 @@ moea64_query_bit(vm_page_t m, u_int64_t if (moea64_attr_fetch(m) & ptebit) return (TRUE); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_queues(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { MOEA_PVO_CHECK(pvo); /* sanity check */ @@ -2406,6 +2404,7 @@ moea64_query_bit(vm_page_t m, u_int64_t if (pvo->pvo_pte.lpte.pte_lo & ptebit) { moea64_attr_save(m, ptebit); MOEA_PVO_CHECK(pvo); /* sanity check */ + vm_page_unlock_queues(); return (TRUE); } } @@ -2433,12 +2432,14 @@ moea64_query_bit(vm_page_t m, u_int64_t moea64_attr_save(m, ptebit); MOEA_PVO_CHECK(pvo); /* sanity check */ + vm_page_unlock_queues(); return (TRUE); } } UNLOCK_TABLE(); } + vm_page_unlock_queues(); return (FALSE); } Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/powerpc/booke/pmap.c Wed May 26 18:00:44 2010 (r208574) @@ -1711,12 +1711,14 @@ mmu_booke_enter_object(mmu_t mmu, pmap_t psize = atop(end - start); m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { mmu_booke_enter_locked(mmu, pmap, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -2209,19 +2211,22 @@ mmu_booke_is_referenced(mmu_t mmu, vm_pa pv_entry_t pv; boolean_t rv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("mmu_booke_is_referenced: page %p is not managed", m)); rv = FALSE; - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (rv); + vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { PMAP_LOCK(pv->pv_pmap); if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL && - PTE_ISVALID(pte)) - rv = PTE_ISREFERENCED(pte) ? TRUE : FALSE; + PTE_ISVALID(pte)) { + if (PTE_ISREFERENCED(pte)) + rv = TRUE; + } PMAP_UNLOCK(pv->pv_pmap); if (rv) break; } + vm_page_unlock_queues(); return (rv); } Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/sparc64/sparc64/pmap.c Wed May 26 18:00:44 2010 (r208574) @@ -1492,12 +1492,14 @@ pmap_enter_object(pmap_t pm, vm_offset_t psize = atop(end - start); m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pm); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { pmap_enter_locked(pm, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pm); } @@ -1947,17 +1949,22 @@ boolean_t pmap_is_referenced(vm_page_t m) { struct tte *tp; + boolean_t rv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (FALSE); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_referenced: page %p is not managed", m)); + rv = FALSE; + vm_page_lock_queues(); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { if ((tp->tte_data & TD_PV) == 0) continue; - if ((tp->tte_data & TD_REF) != 0) - return (TRUE); + if ((tp->tte_data & TD_REF) != 0) { + rv = TRUE; + break; + } } - return (FALSE); + vm_page_unlock_queues(); + return (rv); } void Modified: head/sys/sun4v/sun4v/pmap.c ============================================================================== --- head/sys/sun4v/sun4v/pmap.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/sun4v/sun4v/pmap.c Wed May 26 18:00:44 2010 (r208574) @@ -1221,11 +1221,13 @@ pmap_enter_object(pmap_t pmap, vm_offset VM_OBJECT_LOCK_ASSERT(m_start->object, MA_OWNED); psize = atop(end - start); m = m_start; + vm_page_lock_queues(); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { pmap_enter_quick_locked(pmap, start + ptoa(diff), m, prot); m = TAILQ_NEXT(m, listq); } + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -1642,8 +1644,14 @@ pmap_is_prefaultable(pmap_t pmap, vm_off boolean_t pmap_is_referenced(vm_page_t m) { + boolean_t rv; - return (tte_get_phys_bit(m, VTD_REF)); + KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + ("pmap_is_referenced: page %p is not managed", m)); + vm_page_lock_queues(); + rv = tte_get_phys_bit(m, VTD_REF); + vm_page_unlock_queues(); + return (rv); } /* Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/vm/vm_map.c Wed May 26 18:00:44 2010 (r208574) @@ -1726,7 +1726,6 @@ vm_map_pmap_enter(vm_map_t map, vm_offse vm_offset_t start; vm_page_t p, p_start; vm_pindex_t psize, tmpidx; - boolean_t are_queues_locked; if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL) return; @@ -1748,7 +1747,6 @@ vm_map_pmap_enter(vm_map_t map, vm_offse psize = object->size - pindex; } - are_queues_locked = FALSE; start = 0; p_start = NULL; @@ -1782,25 +1780,14 @@ vm_map_pmap_enter(vm_map_t map, vm_offse p_start = p; } } else if (p_start != NULL) { - if (!are_queues_locked) { - are_queues_locked = TRUE; - vm_page_lock_queues(); - } pmap_enter_object(map->pmap, start, addr + ptoa(tmpidx), p_start, prot); p_start = NULL; } } - if (p_start != NULL) { - if (!are_queues_locked) { - are_queues_locked = TRUE; - vm_page_lock_queues(); - } + if (p_start != NULL) pmap_enter_object(map->pmap, start, addr + ptoa(psize), p_start, prot); - } - if (are_queues_locked) - vm_page_unlock_queues(); unlock_return: VM_OBJECT_UNLOCK(object); } Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/vm/vm_mmap.c Wed May 26 18:00:44 2010 (r208574) @@ -912,11 +912,18 @@ RestartScan: vm_page_dirty(m); if (m->dirty != 0) mincoreinfo |= MINCORE_MODIFIED_OTHER; - vm_page_lock_queues(); + /* + * The first test for PG_REFERENCED is an + * optimization. The second test is + * required because a concurrent pmap + * operation could clear the last reference + * and set PG_REFERENCED before the call to + * pmap_is_referenced(). + */ if ((m->flags & PG_REFERENCED) != 0 || - pmap_is_referenced(m)) + pmap_is_referenced(m) || + (m->flags & PG_REFERENCED) != 0) mincoreinfo |= MINCORE_REFERENCED_OTHER; - vm_page_unlock_queues(); } if (object != NULL) VM_OBJECT_UNLOCK(object); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/vm/vm_page.c Wed May 26 18:00:44 2010 (r208574) @@ -1894,7 +1894,7 @@ vm_page_dontneed(vm_page_t m) PCPU_INC(dnweight); /* - * occassionally leave the page alone + * Occasionally leave the page alone. */ if ((dnw & 0x01F0) == 0 || VM_PAGE_INQUEUE2(m, PQ_INACTIVE)) { @@ -1906,11 +1906,18 @@ vm_page_dontneed(vm_page_t m) /* * Clear any references to the page. Otherwise, the page daemon will * immediately reactivate the page. + * + * Perform the pmap_clear_reference() first. Otherwise, a concurrent + * pmap operation, such as pmap_remove(), could clear a reference in + * the pmap and set PG_REFERENCED on the page before the + * pmap_clear_reference() had completed. Consequently, the page would + * appear referenced based upon an old reference that occurred before + * this function ran. */ + pmap_clear_reference(m); vm_page_lock_queues(); vm_page_flag_clear(m, PG_REFERENCED); vm_page_unlock_queues(); - pmap_clear_reference(m); if (m->dirty == 0 && pmap_is_modified(m)) vm_page_dirty(m); @@ -2142,7 +2149,9 @@ void vm_page_clear_dirty(vm_page_t m, int base, int size) { - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((m->flags & PG_WRITEABLE) != 0) + mtx_assert(&vm_page_queue_mtx, MA_OWNED); m->dirty &= ~vm_page_bits(base, size); } Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Wed May 26 17:30:19 2010 (r208573) +++ head/sys/vm/vnode_pager.c Wed May 26 18:00:44 2010 (r208574) @@ -429,11 +429,9 @@ vnode_pager_setsize(vp, nsize) * bits. This would prevent bogus_page * replacement from working properly. */ - vm_page_lock(m); vm_page_lock_queues(); vm_page_clear_dirty(m, base, PAGE_SIZE - base); vm_page_unlock_queues(); - vm_page_unlock(m); } else if ((nsize & PAGE_MASK) && __predict_false(object->cache != NULL)) { vm_page_cache_free(object, OFF_TO_IDX(nsize), @@ -1071,15 +1069,12 @@ vnode_pager_putpages(object, m, count, s * then delayed. */ int -vnode_pager_generic_putpages(vp, m, bytecount, flags, rtvals) - struct vnode *vp; - vm_page_t *m; - int bytecount; - int flags; - int *rtvals; +vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *ma, int bytecount, + int flags, int *rtvals) { int i; vm_object_t object; + vm_page_t m; int count; int maxsize, ncount; @@ -1098,9 +1093,9 @@ vnode_pager_generic_putpages(vp, m, byte for (i = 0; i < count; i++) rtvals[i] = VM_PAGER_AGAIN; - if ((int64_t)m[0]->pindex < 0) { + if ((int64_t)ma[0]->pindex < 0) { printf("vnode_pager_putpages: attempt to write meta-data!!! -- 0x%lx(%lx)\n", - (long)m[0]->pindex, (u_long)m[0]->dirty); + (long)ma[0]->pindex, (u_long)ma[0]->dirty); rtvals[0] = VM_PAGER_BAD; return VM_PAGER_BAD; } @@ -1108,7 +1103,7 @@ vnode_pager_generic_putpages(vp, m, byte maxsize = count * PAGE_SIZE; ncount = count; - poffset = IDX_TO_OFF(m[0]->pindex); + poffset = IDX_TO_OFF(ma[0]->pindex); /* * If the page-aligned write is larger then the actual file we @@ -1122,6 +1117,7 @@ vnode_pager_generic_putpages(vp, m, byte * We do not under any circumstances truncate the valid bits, as * this will screw up bogus page replacement. */ + VM_OBJECT_LOCK(object); if (maxsize + poffset > object->un_pager.vnp.vnp_size) { if (object->un_pager.vnp.vnp_size > poffset) { int pgoff; @@ -1129,12 +1125,19 @@ vnode_pager_generic_putpages(vp, m, byte maxsize = object->un_pager.vnp.vnp_size - poffset; ncount = btoc(maxsize); if ((pgoff = (int)maxsize & PAGE_MASK) != 0) { - vm_page_lock(m[ncount - 1]); - vm_page_lock_queues(); - vm_page_clear_dirty(m[ncount - 1], pgoff, - PAGE_SIZE - pgoff); - vm_page_unlock_queues(); - vm_page_unlock(m[ncount - 1]); + /* + * If the object is locked and the following + * conditions hold, then the page's dirty + * field cannot be concurrently changed by a + * pmap operation. + */ + m = ma[ncount - 1]; + KASSERT(m->busy > 0, + ("vnode_pager_generic_putpages: page %p is not busy", m)); + KASSERT((m->flags & PG_WRITEABLE) == 0, + ("vnode_pager_generic_putpages: page %p is not read-only", m)); + vm_page_clear_dirty(m, pgoff, PAGE_SIZE - + pgoff); } } else { maxsize = 0; @@ -1146,6 +1149,7 @@ vnode_pager_generic_putpages(vp, m, byte } } } + VM_OBJECT_UNLOCK(object); /* * pageouts are already clustered, use IO_ASYNC t o force a bawrite() @@ -1182,7 +1186,7 @@ vnode_pager_generic_putpages(vp, m, byte if (auio.uio_resid) { if (ppscheck || ppsratecheck(&lastfail, &curfail, 1)) printf("vnode_pager_putpages: residual I/O %zd at %lu\n", - auio.uio_resid, (u_long)m[0]->pindex); + auio.uio_resid, (u_long)ma[0]->pindex); } for (i = 0; i < ncount; i++) { rtvals[i] = VM_PAGER_OK; From owner-svn-src-head@FreeBSD.ORG Wed May 26 18:28:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7104B106564A; Wed, 26 May 2010 18:28:42 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id B8B438FC0C; Wed, 26 May 2010 18:28:41 +0000 (UTC) Received: by gwj21 with SMTP id 21so676911gwj.13 for ; Wed, 26 May 2010 11:28:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.61.2 with SMTP id j2mr67830yba.360.1274898518059; Wed, 26 May 2010 11:28:38 -0700 (PDT) Received: by 10.150.137.17 with HTTP; Wed, 26 May 2010 11:28:37 -0700 (PDT) X-Originating-IP: [128.95.133.153] In-Reply-To: <201005251748.o4PHmI5T093246@svn.freebsd.org> References: <201005251748.o4PHmI5T093246@svn.freebsd.org> Date: Wed, 26 May 2010 11:28:37 -0700 Message-ID: From: Rob Farmer To: Xin LI Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 18:28:42 -0000 On Tue, May 25, 2010 at 10:48 AM, Xin LI wrote: > Author: delphij > Date: Tue May 25 17:48:17 2010 > New Revision: 208545 > URL: http://svn.freebsd.org/changeset/base/208545 > > Log: > =A0libarchive now needs libcrypto and liblzma. > > Modified: > =A0head/release/amd64/boot_crunch.conf > =A0head/release/i386/boot_crunch.conf > =A0head/release/ia64/boot_crunch.conf > =A0head/release/pc98/boot_crunch.conf > =A0head/release/powerpc/boot_crunch.conf > =A0head/release/sparc64/boot_crunch.conf > =A0head/release/sun4v/boot_crunch.conf > > Modified: head/release/amd64/boot_crunch.conf > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/release/amd64/boot_crunch.conf Tue May 25 17:43:23 2010 =A0 =A0 = =A0 =A0(r208544) > +++ head/release/amd64/boot_crunch.conf Tue May 25 17:48:17 2010 =A0 =A0 = =A0 =A0(r208545) > @@ -39,6 +39,6 @@ progs ppp > =A0progs sysinstall > =A0progs usbconfig > > -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph > +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph > =A0libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo > -libs -lbsdxml -larchive -lbz2 -lusb -ljail > +libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail > Does the order of the libs entries matter? Because I just tried on i386 after this commit and I still get errors related to the sha1, md5, etc. functions but it worked fine with -llzma -lcrypto at the end of the last line. --=20 Rob Farmer From owner-svn-src-head@FreeBSD.ORG Wed May 26 18:47:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70E8D1065670; Wed, 26 May 2010 18:47:34 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id CE92E8FC28; Wed, 26 May 2010 18:47:33 +0000 (UTC) Received: by vws18 with SMTP id 18so3698524vws.13 for ; Wed, 26 May 2010 11:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=2LTuebAI2l84JdqBbJhvkWAC0iHnzHHxL6qrWTEM6Ts=; b=ddZHW1uaFaMNYyNUcFTg7I1x9wOby5F1p4S0hY/sAgExZ9WDUI0Fp/tT+CfX5Cnpst GDYeVmnkgFpD9gy1CtEWchSPs5AIbA/WpvvNqURdy0ETrLgL3liM3k+zn9uwQ0uOVeC4 ZzXnMFBbveamFcoIfTr6ktudICdpCxdhNBPGk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=lUVaSevtgvEW6TetPfAnktzL2Zj3e6ubzt02d7658WzNiNLt/yzdAkSLNJmg5/iNgJ 2h5owt3zmOlb833W9diuvRM/9XXPQvN7pKyMqDt/mNSjtZhqMESwcZSM418XVIH5Vuwl XoK81u397IJeuxoe1m/4m92mNbFhhwzn7yf90= MIME-Version: 1.0 Received: by 10.229.187.147 with SMTP id cw19mr2005732qcb.45.1274899653066; Wed, 26 May 2010 11:47:33 -0700 (PDT) Received: by 10.229.190.83 with HTTP; Wed, 26 May 2010 11:47:32 -0700 (PDT) In-Reply-To: References: <201005251748.o4PHmI5T093246@svn.freebsd.org> Date: Wed, 26 May 2010 11:47:32 -0700 Message-ID: From: Garrett Cooper To: Rob Farmer Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 18:47:34 -0000 On Wed, May 26, 2010 at 11:28 AM, Rob Farmer wro= te: > On Tue, May 25, 2010 at 10:48 AM, Xin LI wrote: >> Author: delphij >> Date: Tue May 25 17:48:17 2010 >> New Revision: 208545 >> URL: http://svn.freebsd.org/changeset/base/208545 >> >> Log: >> =A0libarchive now needs libcrypto and liblzma. >> >> Modified: >> =A0head/release/amd64/boot_crunch.conf >> =A0head/release/i386/boot_crunch.conf >> =A0head/release/ia64/boot_crunch.conf >> =A0head/release/pc98/boot_crunch.conf >> =A0head/release/powerpc/boot_crunch.conf >> =A0head/release/sparc64/boot_crunch.conf >> =A0head/release/sun4v/boot_crunch.conf >> >> Modified: head/release/amd64/boot_crunch.conf >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/release/amd64/boot_crunch.conf Tue May 25 17:43:23 2010 =A0 =A0= =A0 =A0(r208544) >> +++ head/release/amd64/boot_crunch.conf Tue May 25 17:48:17 2010 =A0 =A0= =A0 =A0(r208545) >> @@ -39,6 +39,6 @@ progs ppp >> =A0progs sysinstall >> =A0progs usbconfig >> >> -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph >> +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph >> =A0libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo >> -libs -lbsdxml -larchive -lbz2 -lusb -ljail >> +libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail >> > > Does the order of the libs entries matter? Because I just tried on > i386 after this commit and I still get errors related to the sha1, > md5, etc. functions but it worked fine with -llzma -lcrypto at the end > of the last line. In theory it shouldn't because the linker should be smart enough to evaluate the dependencies and link everything properly, but our copy of binutils isn't intelligent enough to determine the appropriate order from what I've seen. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Wed May 26 18:55:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F5D91065675; Wed, 26 May 2010 18:55:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DE5A8FC1A; Wed, 26 May 2010 18:55:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QItfVA030331; Wed, 26 May 2010 18:55:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QItfTv030323; Wed, 26 May 2010 18:55:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201005261855.o4QItfTv030323@svn.freebsd.org> From: Xin LI Date: Wed, 26 May 2010 18:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208577 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 18:55:41 -0000 Author: delphij Date: Wed May 26 18:55:40 2010 New Revision: 208577 URL: http://svn.freebsd.org/changeset/base/208577 Log: Reorder to have -lcrypto after -larchive. Our linker doesn't seem to like the current ordering :( Modified: head/release/amd64/boot_crunch.conf head/release/i386/boot_crunch.conf head/release/ia64/boot_crunch.conf head/release/pc98/boot_crunch.conf head/release/powerpc/boot_crunch.conf head/release/sparc64/boot_crunch.conf head/release/sun4v/boot_crunch.conf Modified: head/release/amd64/boot_crunch.conf ============================================================================== --- head/release/amd64/boot_crunch.conf Wed May 26 18:50:16 2010 (r208576) +++ head/release/amd64/boot_crunch.conf Wed May 26 18:55:40 2010 (r208577) @@ -39,6 +39,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo -libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail +libs -lbsdxml -larchive -lcrypto -lbz2 -llzma -lusb -ljail Modified: head/release/i386/boot_crunch.conf ============================================================================== --- head/release/i386/boot_crunch.conf Wed May 26 18:50:16 2010 (r208576) +++ head/release/i386/boot_crunch.conf Wed May 26 18:55:40 2010 (r208577) @@ -39,6 +39,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo -libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail +libs -lbsdxml -larchive -lcrypto -lbz2 -llzma -lusb -ljail Modified: head/release/ia64/boot_crunch.conf ============================================================================== --- head/release/ia64/boot_crunch.conf Wed May 26 18:50:16 2010 (r208576) +++ head/release/ia64/boot_crunch.conf Wed May 26 18:55:40 2010 (r208577) @@ -44,6 +44,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs -ldevinfo -libs -lgeom -lbsdxml -larchive -lbz2 -llzma -lusb -ljail +libs -lgeom -lbsdxml -larchive -lcrypto -lbz2 -llzma -lusb -ljail Modified: head/release/pc98/boot_crunch.conf ============================================================================== --- head/release/pc98/boot_crunch.conf Wed May 26 18:50:16 2010 (r208576) +++ head/release/pc98/boot_crunch.conf Wed May 26 18:55:40 2010 (r208577) @@ -38,6 +38,6 @@ progs arp progs ppp progs sysinstall -libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml -libs -larchive -lbz2 -llzma -ljail +libs -larchive -lcrypto -lbz2 -llzma -ljail Modified: head/release/powerpc/boot_crunch.conf ============================================================================== --- head/release/powerpc/boot_crunch.conf Wed May 26 18:50:16 2010 (r208576) +++ head/release/powerpc/boot_crunch.conf Wed May 26 18:55:40 2010 (r208577) @@ -44,6 +44,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs -libs -lgeom -lbsdxml -larchive -lbz2 -llzma -lusb -ljail +libs -lgeom -lbsdxml -larchive -lcrypto -lbz2 -llzma -lusb -ljail Modified: head/release/sparc64/boot_crunch.conf ============================================================================== --- head/release/sparc64/boot_crunch.conf Wed May 26 18:50:16 2010 (r208576) +++ head/release/sparc64/boot_crunch.conf Wed May 26 18:55:40 2010 (r208577) @@ -39,6 +39,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml -libs -larchive -lbz2 -llzma -lusb -ljail +libs -larchive -lcrypto -lbz2 -llzma -lusb -ljail Modified: head/release/sun4v/boot_crunch.conf ============================================================================== --- head/release/sun4v/boot_crunch.conf Wed May 26 18:50:16 2010 (r208576) +++ head/release/sun4v/boot_crunch.conf Wed May 26 18:55:40 2010 (r208577) @@ -39,6 +39,6 @@ progs ppp progs sysinstall progs usbconfig -libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph +libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml -libs -larchive -lbz2 -llzma -lusb -ljail +libs -larchive -lcrypto -lbz2 -llzma -lusb -ljail From owner-svn-src-head@FreeBSD.ORG Wed May 26 18:59:29 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 392581065673; Wed, 26 May 2010 18:59:29 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6DEF38FC20; Wed, 26 May 2010 18:59:27 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id EFFCDA59909; Thu, 27 May 2010 02:59:25 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id nE3ew7P38mMQ; Thu, 27 May 2010 02:59:19 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 03614A5982B; Thu, 27 May 2010 02:59:16 +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=cOJ6pmloMUyx9FfOStDf3MgVoZJADRCM6m82i483W3MjOQSpqk80e4J8K/WmjdBc6 jgt5mZfSQMfWidUfrme2w== Message-ID: <4BFD6F80.8030700@delphij.net> Date: Wed, 26 May 2010 11:59:12 -0700 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100408 Thunderbird/3.0.4 ThunderBrowse/3.2.8.1 MIME-Version: 1.0 To: Garrett Cooper References: <201005251748.o4PHmI5T093246@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Rob Farmer , Xin LI , src-committers@FreeBSD.ORG Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 18:59:29 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2010/05/26 11:47, Garrett Cooper wrote: > On Wed, May 26, 2010 at 11:28 AM, Rob Farmer wrote: >> On Tue, May 25, 2010 at 10:48 AM, Xin LI wrote: >>> Author: delphij >>> Date: Tue May 25 17:48:17 2010 >>> New Revision: 208545 >>> URL: http://svn.freebsd.org/changeset/base/208545 >>> >>> Log: >>> libarchive now needs libcrypto and liblzma. >>> >>> Modified: >>> head/release/amd64/boot_crunch.conf >>> head/release/i386/boot_crunch.conf >>> head/release/ia64/boot_crunch.conf >>> head/release/pc98/boot_crunch.conf >>> head/release/powerpc/boot_crunch.conf >>> head/release/sparc64/boot_crunch.conf >>> head/release/sun4v/boot_crunch.conf >>> >>> Modified: head/release/amd64/boot_crunch.conf >>> ============================================================================== >>> --- head/release/amd64/boot_crunch.conf Tue May 25 17:43:23 2010 (r208544) >>> +++ head/release/amd64/boot_crunch.conf Tue May 25 17:48:17 2010 (r208545) >>> @@ -39,6 +39,6 @@ progs ppp >>> progs sysinstall >>> progs usbconfig >>> >>> -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph >>> +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph >>> libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo >>> -libs -lbsdxml -larchive -lbz2 -lusb -ljail >>> +libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail >>> >> >> Does the order of the libs entries matter? Because I just tried on >> i386 after this commit and I still get errors related to the sha1, >> md5, etc. functions but it worked fine with -llzma -lcrypto at the end >> of the last line. > > In theory it shouldn't because the linker should be smart enough > to evaluate the dependencies and link everything properly, but our > copy of binutils isn't intelligent enough to determine the appropriate > order from what I've seen. Bad last minute change from me, I overlooked this :-/ Will a newer GNU ld solve this issue? Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBCAAGBQJL/W+AAAoJEATO+BI/yjfBdYIH/jrMjcdVUba/5R/Y4TbFq15i kVWRcSj+6R/iqxZ62pKPOKfYim2pJToRVPT+Hx+cTYri3jm25L4U0SQOfWViWU6D 2qQ1BLWwkNTd97hLcdSBePf4pKPq1o49W33zqyE3VAAkvOl5r+HZ9V16xhZ9GnmB VfweQSYb6Nm0YD2H3fSvYpLoNzKW13POxer6sqvmhnEZcU78CCSeQVSYhdf3M7eM ulya3Jsxd1Rn9aReFQR8D14+fMq0xfs2q7DGX1HmVHn1hxC/dWhfGZ7Yv36mbPr8 MwVHoeEjVhnRgUE78o9/XQ3vJyvhOSCQCy+a2IZoFIbqTotaymi0EMmif51zudE= =nD1V -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed May 26 19:01:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AC4A1065670; Wed, 26 May 2010 19:01:31 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3A38FC21; Wed, 26 May 2010 19:01:30 +0000 (UTC) Received: by qyk11 with SMTP id 11so10009680qyk.13 for ; Wed, 26 May 2010 12:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ysimRpVH8gDQTEY1PWc3uAayKawObek0r4xw/HzlvC0=; b=Is5obf/OuqP0Z/9zTdO/E6gryeWQoAr2tGbfxiSUEGtOKmWdfWcAKed6xO57wSnEKk sOQcwNULLZUlkb88DHaC6hjA+lGYNEGNYY90vgEjdm8ho8kwNTXu+ormG3Y24wSHAhj0 gXjgjdij17zn4YyC+icNmZOv8qaSj0XVvlNGo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ENbj15EYLv32I/su+MUSO4bQYZ83/+jaFIidD6tDedbIZMOXCKkuSV3D0D+7DIwdLA g+c4WFktJo6bYrvA7/mXPWRujv7y9V4wDOiC6Ftl2++XhiKmTZtCfrAgPPrdvszBELO1 oXOgjj99YbVF4yfHLSLF+prd/icUX3GcI7dyo= MIME-Version: 1.0 Received: by 10.224.36.92 with SMTP id s28mr5015337qad.293.1274900487651; Wed, 26 May 2010 12:01:27 -0700 (PDT) Received: by 10.229.190.83 with HTTP; Wed, 26 May 2010 12:01:27 -0700 (PDT) In-Reply-To: <4BFD6F80.8030700@delphij.net> References: <201005251748.o4PHmI5T093246@svn.freebsd.org> <4BFD6F80.8030700@delphij.net> Date: Wed, 26 May 2010 12:01:27 -0700 Message-ID: From: Garrett Cooper To: d@delphij.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Rob Farmer , Xin LI , src-committers@freebsd.org Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 19:01:31 -0000 On Wed, May 26, 2010 at 11:59 AM, Xin LI wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 2010/05/26 11:47, Garrett Cooper wrote: >> On Wed, May 26, 2010 at 11:28 AM, Rob Farmer = wrote: >>> On Tue, May 25, 2010 at 10:48 AM, Xin LI wrote: >>>> Author: delphij >>>> Date: Tue May 25 17:48:17 2010 >>>> New Revision: 208545 >>>> URL: http://svn.freebsd.org/changeset/base/208545 >>>> >>>> Log: >>>> =A0libarchive now needs libcrypto and liblzma. >>>> >>>> Modified: >>>> =A0head/release/amd64/boot_crunch.conf >>>> =A0head/release/i386/boot_crunch.conf >>>> =A0head/release/ia64/boot_crunch.conf >>>> =A0head/release/pc98/boot_crunch.conf >>>> =A0head/release/powerpc/boot_crunch.conf >>>> =A0head/release/sparc64/boot_crunch.conf >>>> =A0head/release/sun4v/boot_crunch.conf >>>> >>>> Modified: head/release/amd64/boot_crunch.conf >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- head/release/amd64/boot_crunch.conf Tue May 25 17:43:23 2010 =A0 = =A0 =A0 =A0(r208544) >>>> +++ head/release/amd64/boot_crunch.conf Tue May 25 17:48:17 2010 =A0 = =A0 =A0 =A0(r208545) >>>> @@ -39,6 +39,6 @@ progs ppp >>>> =A0progs sysinstall >>>> =A0progs usbconfig >>>> >>>> -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph >>>> +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph >>>> =A0libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo >>>> -libs -lbsdxml -larchive -lbz2 -lusb -ljail >>>> +libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail >>>> >>> >>> Does the order of the libs entries matter? Because I just tried on >>> i386 after this commit and I still get errors related to the sha1, >>> md5, etc. functions but it worked fine with -llzma -lcrypto at the end >>> of the last line. >> >> =A0 =A0 In theory it shouldn't because the linker should be smart enough >> to evaluate the dependencies and link everything properly, but our >> copy of binutils isn't intelligent enough to determine the appropriate >> order from what I've seen. > > Bad last minute change from me, I overlooked this :-/ > > Will a newer GNU ld solve this issue? Juli informed me (off-list) that GNU ld _does_ in fact do this, but only if you specify --start-group and --end-group in the linker arguments (which she claimed required more RAM). It might just be better to switch the linker library ordering as this would fix the issue cleanly and quickly. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Wed May 26 19:11:30 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF133106564A; Wed, 26 May 2010 19:11:30 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4FD0C8FC13; Wed, 26 May 2010 19:11:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o4QJ4ksv044548; Wed, 26 May 2010 13:04:46 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 26 May 2010 13:04:48 -0600 (MDT) Message-Id: <20100526.130448.902529319782208138.imp@bsdimp.com> To: yanefbsd@gmail.com From: "M. Warner Losh" In-Reply-To: References: <201005251748.o4PHmI5T093246@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, rfarmer@predatorlabs.net, delphij@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 19:11:30 -0000 In message: Garrett Cooper writes: : On Wed, May 26, 2010 at 11:28 AM, Rob Farmer wrote: : > On Tue, May 25, 2010 at 10:48 AM, Xin LI wrot= e: : >> Author: delphij : >> Date: Tue May 25 17:48:17 2010 : >> New Revision: 208545 : >> URL: http://svn.freebsd.org/changeset/base/208545 : >> : >> Log: : >> =A0libarchive now needs libcrypto and liblzma. : >> : >> Modified: : >> =A0head/release/amd64/boot_crunch.conf : >> =A0head/release/i386/boot_crunch.conf : >> =A0head/release/ia64/boot_crunch.conf : >> =A0head/release/pc98/boot_crunch.conf : >> =A0head/release/powerpc/boot_crunch.conf : >> =A0head/release/sparc64/boot_crunch.conf : >> =A0head/release/sun4v/boot_crunch.conf : >> : >> Modified: head/release/amd64/boot_crunch.conf : >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D : >> --- head/release/amd64/boot_crunch.conf Tue May 25 17:43:23 2010 =A0= =A0 =A0 =A0(r208544) : >> +++ head/release/amd64/boot_crunch.conf Tue May 25 17:48:17 2010 =A0= =A0 =A0 =A0(r208545) : >> @@ -39,6 +39,6 @@ progs ppp : >> =A0progs sysinstall : >> =A0progs usbconfig : >> : >> -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph : >> +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgra= ph : >> =A0libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo : >> -libs -lbsdxml -larchive -lbz2 -lusb -ljail : >> +libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail : >> : > : > Does the order of the libs entries matter? Because I just tried on : > i386 after this commit and I still get errors related to the sha1, : > md5, etc. functions but it worked fine with -llzma -lcrypto at the = end : > of the last line. : = : In theory it shouldn't because the linker should be smart enough : to evaluate the dependencies and link everything properly, but our : copy of binutils isn't intelligent enough to determine the appropriat= e : order from what I've seen. the linker has never been that smart. Unless you tell it to link in everything, which we don't do. Warner From owner-svn-src-head@FreeBSD.ORG Wed May 26 19:15:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C24741065672; Wed, 26 May 2010 19:15:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 3F2488FC13; Wed, 26 May 2010 19:15:06 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o4QJFGEc020310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 26 May 2010 22:15:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o4QJF3YN098329; Wed, 26 May 2010 22:15:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o4QJF2UH098325; Wed, 26 May 2010 22:15:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 26 May 2010 22:15:02 +0300 From: Kostik Belousov To: d@delphij.net Message-ID: <20100526191502.GG83316@deviant.kiev.zoral.com.ua> References: <201005251748.o4PHmI5T093246@svn.freebsd.org> <4BFD6F80.8030700@delphij.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ra+QPBLzfvE2u76S" Content-Disposition: inline In-Reply-To: <4BFD6F80.8030700@delphij.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Rob Farmer , Xin LI , svn-src-head@freebsd.org, Garrett Cooper Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 19:15:07 -0000 --Ra+QPBLzfvE2u76S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 26, 2010 at 11:59:12AM -0700, Xin LI wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 >=20 > On 2010/05/26 11:47, Garrett Cooper wrote: > > On Wed, May 26, 2010 at 11:28 AM, Rob Farmer = wrote: > >> On Tue, May 25, 2010 at 10:48 AM, Xin LI wrote: > >>> Author: delphij > >>> Date: Tue May 25 17:48:17 2010 > >>> New Revision: 208545 > >>> URL: http://svn.freebsd.org/changeset/base/208545 > >>> > >>> Log: > >>> libarchive now needs libcrypto and liblzma. > >>> > >>> Modified: > >>> head/release/amd64/boot_crunch.conf > >>> head/release/i386/boot_crunch.conf > >>> head/release/ia64/boot_crunch.conf > >>> head/release/pc98/boot_crunch.conf > >>> head/release/powerpc/boot_crunch.conf > >>> head/release/sparc64/boot_crunch.conf > >>> head/release/sun4v/boot_crunch.conf > >>> > >>> Modified: head/release/amd64/boot_crunch.conf > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >>> --- head/release/amd64/boot_crunch.conf Tue May 25 17:43:23 2010 = (r208544) > >>> +++ head/release/amd64/boot_crunch.conf Tue May 25 17:48:17 2010 = (r208545) > >>> @@ -39,6 +39,6 @@ progs ppp > >>> progs sysinstall > >>> progs usbconfig > >>> > >>> -libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph > >>> +libs -ll -ledit -lutil -lmd -lcrypt -lcrypto -lftpio -lz -lnetgraph > >>> libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo > >>> -libs -lbsdxml -larchive -lbz2 -lusb -ljail > >>> +libs -lbsdxml -larchive -lbz2 -llzma -lusb -ljail > >>> > >> > >> Does the order of the libs entries matter? Because I just tried on > >> i386 after this commit and I still get errors related to the sha1, > >> md5, etc. functions but it worked fine with -llzma -lcrypto at the end > >> of the last line. > >=20 > > In theory it shouldn't because the linker should be smart enough > > to evaluate the dependencies and link everything properly, but our > > copy of binutils isn't intelligent enough to determine the appropriate > > order from what I've seen. >=20 > Bad last minute change from me, I overlooked this :-/ >=20 > Will a newer GNU ld solve this issue? The behaviour is the standard for any unix linker I ever saw. Static libraries participate in symbol resolution only at the point they appear on the command line. Linker makes as many passes over the single library as needed to not have any unresolved symbols that can be resolved from the archive, then moves to the next. There are facilities that allow to change the behaviour, either by grouping the libraries, see --start-group switch, or by repeating the library several times at the proper place in the command line. Comments about "linker not being smart enough" are nonsense. --Ra+QPBLzfvE2u76S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkv9czYACgkQC3+MBN1Mb4jLewCg9mZYzA8zka9rsbRtRZLRHYyx ZogAoKD4XJiojcgJ6BEj5f/w82w0XfhB =YwEN -----END PGP SIGNATURE----- --Ra+QPBLzfvE2u76S-- From owner-svn-src-head@FreeBSD.ORG Wed May 26 22:38:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0845106564A; Wed, 26 May 2010 22:38:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF7398FC15; Wed, 26 May 2010 22:38:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QMcj83079436; Wed, 26 May 2010 22:38:45 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QMcjPe079434; Wed, 26 May 2010 22:38:45 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201005262238.o4QMcjPe079434@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 26 May 2010 22:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208581 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 22:38:46 -0000 Author: gonzo Date: Wed May 26 22:38:45 2010 New Revision: 208581 URL: http://svn.freebsd.org/changeset/base/208581 Log: - Fix kseg0 address calculation - it doesn't always start at page boundary - Add cache ops to ensure memory validity before/after copy operation Modified: head/sys/mips/mips/uio_machdep.c Modified: head/sys/mips/mips/uio_machdep.c ============================================================================== --- head/sys/mips/mips/uio_machdep.c Wed May 26 19:26:28 2010 (r208580) +++ head/sys/mips/mips/uio_machdep.c Wed May 26 22:38:45 2010 (r208581) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + /* * Implement uiomove(9) from physical memory using a combination * of the direct mapping and sf_bufs to reduce the creation and @@ -91,8 +93,14 @@ uiomove_fromphys(vm_page_t ma[], vm_offs m = ma[offset >> PAGE_SHIFT]; pa = VM_PAGE_TO_PHYS(m); if (pa < MIPS_KSEG0_LARGEST_PHYS) { - cp = (char *)MIPS_PHYS_TO_KSEG0(pa); sf = NULL; + cp = (char *)MIPS_PHYS_TO_KSEG0(pa) + page_offset; + /* + * flush all mappings to this page, KSEG0 address first + * in order to get it overwritten by correct data + */ + mips_dcache_wbinv_range((vm_offset_t)cp, cnt); + pmap_flush_pvcache(m); } else { sf = sf_buf_alloc(m, 0); cp = (char *)sf_buf_kva(sf) + page_offset; @@ -122,6 +130,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offs } if (sf != NULL) sf_buf_free(sf); + else + mips_dcache_wbinv_range((vm_offset_t)cp, cnt); iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; From owner-svn-src-head@FreeBSD.ORG Wed May 26 22:49:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB6E6106566B; Wed, 26 May 2010 22:49:42 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A910A8FC12; Wed, 26 May 2010 22:49:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4QMngUX081928; Wed, 26 May 2010 22:49:42 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4QMng4f081922; Wed, 26 May 2010 22:49:42 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201005262249.o4QMng4f081922@svn.freebsd.org> From: Matt Jacob Date: Wed, 26 May 2010 22:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208582 - in head/sys: cam cam/ata cam/scsi dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 22:49:42 -0000 Author: mjacob Date: Wed May 26 22:49:42 2010 New Revision: 208582 URL: http://svn.freebsd.org/changeset/base/208582 Log: Add a new primitive, XPT_SCAN_TGT, to cover the range between scanning a whole bus (XPT_SCAN_BUS) and a single lun on that bus (XPT_SCAN_LUN). It's less resource comsumptive than scanning a whole bus when the caller knows only one target has changes. Reviewed by: scsi@ Sponsored by: Panasas MFC after: 1 month Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_xpt.c head/sys/dev/isp/isp_freebsd.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed May 26 22:38:45 2010 (r208581) +++ head/sys/cam/ata/ata_xpt.c Wed May 26 22:49:42 2010 (r208582) @@ -1185,6 +1185,7 @@ ata_scan_bus(struct cam_periph *periph, ("xpt_scan_bus\n")); switch (request_ccb->ccb_h.func_code) { case XPT_SCAN_BUS: + case XPT_SCAN_TGT: /* Find out the characteristics of the bus */ work_ccb = xpt_alloc_ccb_nowait(); if (work_ccb == NULL) { @@ -1526,6 +1527,7 @@ ata_action(union ccb *start_ccb) break; } case XPT_SCAN_BUS: + case XPT_SCAN_TGT: ata_scan_bus(start_ccb->ccb_h.path->periph, start_ccb); break; case XPT_SCAN_LUN: Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Wed May 26 22:38:45 2010 (r208581) +++ head/sys/cam/cam_ccb.h Wed May 26 22:49:42 2010 (r208582) @@ -184,6 +184,11 @@ typedef enum { /* * Set SIM specific knob values. */ + + XPT_SCAN_TGT = 0x1E | XPT_FC_QUEUED | XPT_FC_USER_CCB + | XPT_FC_XPT_ONLY, + /* Scan Target */ + /* HBA engine commands 0x20->0x2F */ XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY, /* HBA engine feature inquiry */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed May 26 22:38:45 2010 (r208581) +++ head/sys/cam/cam_xpt.c Wed May 26 22:49:42 2010 (r208582) @@ -446,23 +446,36 @@ xptioctl(struct cdev *dev, u_long cmd, c inccb = (union ccb *)addr; bus = xpt_find_bus(inccb->ccb_h.path_id); - if (bus == NULL) { - error = EINVAL; + if (bus == NULL) + return (EINVAL); + + switch (inccb->ccb_h.func_code) { + case XPT_SCAN_BUS: + case XPT_RESET_BUS: + if (inccb->ccb_h.target_id != CAM_TARGET_WILDCARD || + inccb->ccb_h.target_lun != CAM_LUN_WILDCARD) { + xpt_release_bus(bus); + return (EINVAL); + } + break; + case XPT_SCAN_TGT: + if (inccb->ccb_h.target_id == CAM_TARGET_WILDCARD || + inccb->ccb_h.target_lun != CAM_LUN_WILDCARD) { + xpt_release_bus(bus); + return (EINVAL); + } + break; + default: break; } switch(inccb->ccb_h.func_code) { case XPT_SCAN_BUS: case XPT_RESET_BUS: - if ((inccb->ccb_h.target_id != CAM_TARGET_WILDCARD) - || (inccb->ccb_h.target_lun != CAM_LUN_WILDCARD)) { - error = EINVAL; - break; - } - /* FALLTHROUGH */ case XPT_PATH_INQ: case XPT_ENG_INQ: case XPT_SCAN_LUN: + case XPT_SCAN_TGT: ccb = xpt_alloc_ccb(); @@ -839,11 +852,21 @@ xpt_rescan(union ccb *ccb) struct ccb_hdr *hdr; /* Prepare request */ - if (ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD || + if (ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD && ccb->ccb_h.path->device->lun_id == CAM_LUN_WILDCARD) ccb->ccb_h.func_code = XPT_SCAN_BUS; - else + else if (ccb->ccb_h.path->target->target_id != CAM_TARGET_WILDCARD && + ccb->ccb_h.path->device->lun_id == CAM_LUN_WILDCARD) + ccb->ccb_h.func_code = XPT_SCAN_TGT; + else if (ccb->ccb_h.path->target->target_id != CAM_TARGET_WILDCARD && + ccb->ccb_h.path->device->lun_id != CAM_LUN_WILDCARD) ccb->ccb_h.func_code = XPT_SCAN_LUN; + else { + xpt_print(ccb->ccb_h.path, "illegal scan path\n"); + xpt_free_path(ccb->ccb_h.path); + xpt_free_ccb(ccb); + return; + } ccb->ccb_h.ppriv_ptr1 = ccb->ccb_h.cbfcnp; ccb->ccb_h.cbfcnp = xpt_rescan_done; xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, CAM_PRIORITY_XPT); Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Wed May 26 22:38:45 2010 (r208581) +++ head/sys/cam/scsi/scsi_xpt.c Wed May 26 22:49:42 2010 (r208582) @@ -1494,12 +1494,13 @@ scsi_scan_bus(struct cam_periph *periph, ("scsi_scan_bus\n")); switch (request_ccb->ccb_h.func_code) { case XPT_SCAN_BUS: + case XPT_SCAN_TGT: { scsi_scan_bus_info *scan_info; union ccb *work_ccb, *reset_ccb; struct cam_path *path; u_int i; - u_int max_target; + u_int low_target, max_target; u_int initiator_id; /* Find out the characteristics of the bus */ @@ -1564,13 +1565,18 @@ scsi_scan_bus(struct cam_periph *periph, /* Cache on our stack so we can work asynchronously */ max_target = scan_info->cpi->max_target; + low_target = 0; initiator_id = scan_info->cpi->initiator_id; /* * We can scan all targets in parallel, or do it sequentially. */ - if (scan_info->cpi->hba_misc & PIM_SEQSCAN) { + + if (request_ccb->ccb_h.func_code == XPT_SCAN_TGT) { + max_target = low_target = request_ccb->ccb_h.target_id; + scan_info->counter = 0; + } else if (scan_info->cpi->hba_misc & PIM_SEQSCAN) { max_target = 0; scan_info->counter = 0; } else { @@ -1580,7 +1586,7 @@ scsi_scan_bus(struct cam_periph *periph, } } - for (i = 0; i <= max_target; i++) { + for (i = low_target; i <= max_target; i++) { cam_status status; if (i == initiator_id) continue; @@ -1695,7 +1701,9 @@ scsi_scan_bus(struct cam_periph *periph, hop_again: done = 0; - if (scan_info->cpi->hba_misc & PIM_SEQSCAN) { + if (scan_info->request_ccb->ccb_h.func_code == XPT_SCAN_TGT) { + done = 1; + } else if (scan_info->cpi->hba_misc & PIM_SEQSCAN) { scan_info->counter++; if (scan_info->counter == scan_info->cpi->initiator_id) { @@ -2016,6 +2024,7 @@ scsi_action(union ccb *start_ccb) break; } case XPT_SCAN_BUS: + case XPT_SCAN_TGT: scsi_scan_bus(start_ccb->ccb_h.path->periph, start_ccb); break; case XPT_SCAN_LUN: Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Wed May 26 22:38:45 2010 (r208581) +++ head/sys/dev/isp/isp_freebsd.c Wed May 26 22:49:42 2010 (r208582) @@ -3893,19 +3893,14 @@ isp_make_here(ispsoftc_t *isp, int chan, } /* - * Allocate a CCB, create a wildcard path for this bus/target and schedule a rescan. + * Allocate a CCB, create a wildcard path for this target and schedule a rescan. */ ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { isp_prt(isp, ISP_LOGWARN, "Chan %d unable to alloc CCB for rescan", chan); return; } - /* - * xpt_rescan only honors wildcard in the target field. - * Scan the whole bus instead of target, which will then - * force a scan of all luns. - */ - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), tgt, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { isp_prt(isp, ISP_LOGWARN, "unable to create path for rescan"); xpt_free_ccb(ccb); return; From owner-svn-src-head@FreeBSD.ORG Thu May 27 01:27:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CAB0106566C; Thu, 27 May 2010 01:27:25 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8098FC0C; Thu, 27 May 2010 01:27:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4R1RP8f016560; Thu, 27 May 2010 01:27:25 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4R1RPaT016558; Thu, 27 May 2010 01:27:25 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201005270127.o4R1RPaT016558@svn.freebsd.org> From: Neel Natu Date: Thu, 27 May 2010 01:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208585 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 01:27:25 -0000 Author: neel Date: Thu May 27 01:27:25 2010 New Revision: 208585 URL: http://svn.freebsd.org/changeset/base/208585 Log: Simplify clock interrupt handling on mips by using the new KPI - timer1clock() and timer2clock(). Dynamically adjust the tick frequency depending on the value of 'hz'. Tested with hz values of 100, 1000 and 2000. Modified: head/sys/mips/mips/tick.c Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Thu May 27 00:09:09 2010 (r208584) +++ head/sys/mips/mips/tick.c Thu May 27 01:27:25 2010 (r208585) @@ -58,19 +58,12 @@ struct timecounter *platform_timecounter static uint64_t cycles_per_tick; static uint64_t cycles_per_usec; -static uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz; static u_int32_t counter_upper = 0; static u_int32_t counter_lower_last = 0; -struct clk_ticks { - u_long hard_ticks; - u_long stat_ticks; - u_long prof_ticks; - uint32_t compare_ticks; -} __aligned(CACHE_LINE_SIZE); - -static struct clk_ticks pcpu_ticks[MAXCPU]; +static DPCPU_DEFINE(uint32_t, compare_ticks); +static DPCPU_DEFINE(uint32_t, lost_ticks); /* * Device methods @@ -150,22 +143,23 @@ mips_timer_init_params(uint64_t platform if (double_count != 0) counter_freq /= 2; - cycles_per_tick = counter_freq / 1000; - cycles_per_hz = counter_freq / hz; - cycles_per_stathz = counter_freq / stathz; - cycles_per_profhz = counter_freq / profhz; + if (hz >= 1500) + timer1hz = hz; + else if (hz >= 750) + timer1hz = hz * 2; + else + timer1hz = hz * 4; + + cycles_per_tick = counter_freq / timer1hz; cycles_per_usec = counter_freq / (1 * 1000 * 1000); counter_timecounter.tc_frequency = counter_freq; - printf("hz=%d cyl_per_tick:%jd cyl_per_usec:%jd freq:%jd " - "cyl_per_hz:%jd cyl_per_stathz:%jd cyl_per_profhz:%jd\n", + printf("hz=%d timer1hz:%d cyl_per_tick:%jd cyl_per_usec:%jd freq:%jd\n", hz, + timer1hz, cycles_per_tick, cycles_per_usec, - counter_freq, - cycles_per_hz, - cycles_per_stathz, - cycles_per_profhz); + counter_freq); set_cputicker(tick_ticker, counter_freq, 1); } @@ -243,58 +237,59 @@ DELAY(int n) } } -#if 0 /* TARGET_OCTEON */ -int64_t wheel_run = 0; - -void octeon_led_run_wheel(); - -#endif /* * Device section of file below */ static int clock_intr(void *arg) { - struct clk_ticks *cpu_ticks; struct trapframe *tf; - uint32_t count, compare, delta; - - cpu_ticks = &pcpu_ticks[PCPU_GET(cpuid)]; + uint32_t count, compare_last, compare_next, lost_ticks; /* * Set next clock edge. */ count = mips_rd_count(); - compare = cpu_ticks->compare_ticks; - cpu_ticks->compare_ticks = count + cycles_per_tick; - mips_wr_compare(cpu_ticks->compare_ticks); + compare_last = DPCPU_GET(compare_ticks); + compare_next = count + cycles_per_tick; + DPCPU_SET(compare_ticks, compare_next); + mips_wr_compare(compare_next); + critical_enter(); if (count < counter_lower_last) { counter_upper++; counter_lower_last = count; } + /* * Magic. Setting up with an arg of NULL means we get passed tf. */ tf = (struct trapframe *)arg; - delta = cycles_per_tick; - /* * Account for the "lost time" between when the timer interrupt fired * and when 'clock_intr' actually started executing. */ - delta += count - compare; + lost_ticks = DPCPU_GET(lost_ticks); + lost_ticks += count - compare_last; /* * If the COUNT and COMPARE registers are no longer in sync then make - * up some reasonable value for the 'delta'. + * up some reasonable value for the 'lost_ticks'. * * This could happen, for e.g., after we resume normal operations after * exiting the debugger. */ - if (delta > cycles_per_hz) - delta = cycles_per_hz; + if (lost_ticks > 2 * cycles_per_tick) + lost_ticks = cycles_per_tick; + + while (lost_ticks >= cycles_per_tick) { + timer1clock(TRAPF_USERMODE(tf), tf->pc); + timer2clock(TRAPF_USERMODE(tf), tf->pc); + lost_ticks -= cycles_per_tick; + } + DPCPU_SET(lost_ticks, lost_ticks); + #ifdef KDTRACE_HOOKS /* * If the DTrace hooks are configured and a callback function @@ -305,39 +300,9 @@ clock_intr(void *arg) if (cyclic_clock_func[cpu] != NULL) (*cyclic_clock_func[cpu])(tf); #endif - /* Fire hardclock at hz. */ - cpu_ticks->hard_ticks += delta; - if (cpu_ticks->hard_ticks >= cycles_per_hz) { - cpu_ticks->hard_ticks -= cycles_per_hz; - if (PCPU_GET(cpuid) == 0) - hardclock(TRAPF_USERMODE(tf), tf->pc); - else - hardclock_cpu(TRAPF_USERMODE(tf)); - } - - /* Fire statclock at stathz. */ - cpu_ticks->stat_ticks += delta; - if (cpu_ticks->stat_ticks >= cycles_per_stathz) { - cpu_ticks->stat_ticks -= cycles_per_stathz; - statclock(TRAPF_USERMODE(tf)); - } - - /* Fire profclock at profhz, but only when needed. */ - cpu_ticks->prof_ticks += delta; - if (cpu_ticks->prof_ticks >= cycles_per_profhz) { - cpu_ticks->prof_ticks -= cycles_per_profhz; - if (profprocs != 0) - profclock(TRAPF_USERMODE(tf), tf->pc); - } + timer1clock(TRAPF_USERMODE(tf), tf->pc); + timer2clock(TRAPF_USERMODE(tf), tf->pc); critical_exit(); -#if 0 /* TARGET_OCTEON */ - /* Run the FreeBSD display once every hz ticks */ - wheel_run += cycles_per_tick; - if (wheel_run >= cycles_per_usec * 1000000ULL) { - wheel_run = 0; - octeon_led_run_wheel(); - } -#endif return (FILTER_HANDLED); } From owner-svn-src-head@FreeBSD.ORG Thu May 27 03:15:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E0161065677; Thu, 27 May 2010 03:15:05 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69DD48FC13; Thu, 27 May 2010 03:15:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4R3F50l041584; Thu, 27 May 2010 03:15:05 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4R3F5WM041579; Thu, 27 May 2010 03:15:05 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201005270315.o4R3F5WM041579@svn.freebsd.org> From: Colin Percival Date: Thu, 27 May 2010 03:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208586 - head/contrib/opie/libopie head/lib/libc/sys head/sys/nfsclient head/usr.sbin/jail releng/6.4 releng/6.4/contrib/opie/libopie releng/6.4/sys/conf releng/7.1 releng/7.1/contrib/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 03:15:05 -0000 Author: cperciva Date: Thu May 27 03:15:04 2010 New Revision: 208586 URL: http://svn.freebsd.org/changeset/base/208586 Log: Change the current working directory to be inside the jail created by the jail(8) command. [10:04] Fix a one-NUL-byte buffer overflow in libopie. [10:05] Correctly sanity-check a buffer length in nfs mount. [10:06] Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-10:04.jail Security: FreeBSD-SA-10:05.opie Security: FreeBSD-SA-10:06.nfsclient Modified: head/contrib/opie/libopie/readrec.c head/lib/libc/sys/mount.2 head/sys/nfsclient/nfs_vfsops.c head/usr.sbin/jail/jail.c Changes in other areas also in this revision: Modified: releng/6.4/UPDATING releng/6.4/contrib/opie/libopie/readrec.c releng/6.4/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/opie/libopie/readrec.c releng/7.1/sys/conf/newvers.sh releng/7.2/UPDATING releng/7.2/contrib/opie/libopie/readrec.c releng/7.2/lib/libc/sys/mount.2 releng/7.2/sys/conf/newvers.sh releng/7.2/sys/nfsclient/nfs_vfsops.c releng/7.3/UPDATING releng/7.3/contrib/opie/libopie/readrec.c releng/7.3/lib/libc/sys/mount.2 releng/7.3/sys/conf/newvers.sh releng/7.3/sys/nfsclient/nfs_vfsops.c releng/8.0/UPDATING releng/8.0/contrib/opie/libopie/readrec.c releng/8.0/lib/libc/sys/mount.2 releng/8.0/sys/conf/newvers.sh releng/8.0/sys/nfsclient/nfs_vfsops.c releng/8.0/usr.sbin/jail/jail.c stable/6/contrib/opie/libopie/readrec.c stable/7/contrib/opie/libopie/readrec.c stable/7/lib/libc/sys/mount.2 stable/7/sys/nfsclient/nfs_vfsops.c stable/8/contrib/opie/libopie/readrec.c stable/8/lib/libc/sys/mount.2 stable/8/sys/nfsclient/nfs_vfsops.c stable/8/usr.sbin/jail/jail.c Modified: head/contrib/opie/libopie/readrec.c ============================================================================== --- head/contrib/opie/libopie/readrec.c Thu May 27 01:27:25 2010 (r208585) +++ head/contrib/opie/libopie/readrec.c Thu May 27 03:15:04 2010 (r208586) @@ -141,10 +141,8 @@ int __opiereadrec FUNCTION((opie), struc if (c = strchr(opie->opie_principal, ':')) *c = 0; - if (strlen(opie->opie_principal) > OPIE_PRINCIPAL_MAX) - (opie->opie_principal)[OPIE_PRINCIPAL_MAX] = 0; - strcpy(principal, opie->opie_principal); + strlcpy(principal, opie->opie_principal, sizeof(principal)); do { if ((opie->opie_recstart = ftell(f)) < 0) Modified: head/lib/libc/sys/mount.2 ============================================================================== --- head/lib/libc/sys/mount.2 Thu May 27 01:27:25 2010 (r208585) +++ head/lib/libc/sys/mount.2 Thu May 27 03:15:04 2010 (r208586) @@ -107,7 +107,7 @@ This restriction can be removed by setti .Va vfs.usermount .Xr sysctl 8 variable -to a non-zero value. +to a non-zero value; see the BUGS section for more information. .Pp The following .Fa flags @@ -374,3 +374,10 @@ system call first appeared in .Fx 5.0 . .Sh BUGS Some of the error codes need translation to more obvious messages. +.Pp +Allowing untrusted users to mount arbitrary media, e.g. by enabling +.Va vfs.usermount , +should not be considered safe. +Most file systems in +.Fx +were not built to safeguard against malicious devices. Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Thu May 27 01:27:25 2010 (r208585) +++ head/sys/nfsclient/nfs_vfsops.c Thu May 27 03:15:04 2010 (r208586) @@ -1074,6 +1074,11 @@ nfs_mount(struct mount *mp) error = EINVAL; goto out; } + if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX) { + vfs_mount_error(mp, "Bad file handle"); + error = EINVAL; + goto out; + } if (mp->mnt_flag & MNT_UPDATE) { struct nfsmount *nmp = VFSTONFS(mp); Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Thu May 27 01:27:25 2010 (r208585) +++ head/usr.sbin/jail/jail.c Thu May 27 03:15:04 2010 (r208586) @@ -511,6 +511,10 @@ set_param(const char *name, char *value) *value++ = '\0'; } + /* jail_set won't chdir along with its chroot, so do it here. */ + if (!strcmp(name, "path") && chdir(value) < 0) + err(1, "chdir: %s", value); + /* Check for repeat parameters */ for (i = 0; i < nparams; i++) if (!strcmp(name, params[i].jp_name)) { From owner-svn-src-head@FreeBSD.ORG Thu May 27 03:20:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FA901065678; Thu, 27 May 2010 03:20:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 16D3B8FC13; Thu, 27 May 2010 03:20:22 +0000 (UTC) Received: by fxm20 with SMTP id 20so63619fxm.13 for ; Wed, 26 May 2010 20:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=v1e8Oz9vtO7vgqxSA0KfdQ6F5Wh7ZRHc/gSEW1HNgaA=; b=f00A1JeTflATK050KbpPl65JJPSQeqy/gyGo+t58VihiZ8q4LvE1i25LimpDp3i6Qo Y7wT1YE1l5sASA0Gb0Cvje663dDIB6DhD1xRpwZUIFA0j/20M8nnJyCP/Wlt4zu6ArOp 8oZ+ZsM2KZoBrzvq9jw2MJbrnt1qW2d8VVkYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=lXfeJwfr+t9/tVyZkTSc/rrZGPvIwSzAyLFY9Mh6UO81L1BwMZ+Q3U4/SdUX6xe9cK HTrYTU4DpyW09opdvOlfZimXMDr/5Rn58ZrQpKc1jiIomHDrdEbDzsI74zLK+AaavoKQ RGDADXD/DPysgXzTzMrMryUh7EehtITFiCneU= Received: by 10.223.45.200 with SMTP id g8mr3374948faf.67.1274930422183; Wed, 26 May 2010 20:20:22 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id u12sm3513892fah.4.2010.05.26.20.20.20 (version=SSLv3 cipher=RC4-MD5); Wed, 26 May 2010 20:20:21 -0700 (PDT) Sender: Alexander Motin Message-ID: <4BFDE4E3.4060300@FreeBSD.org> Date: Thu, 27 May 2010 06:20:03 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Neel Natu References: <201005270127.o4R1RPaT016558@svn.freebsd.org> In-Reply-To: <201005270127.o4R1RPaT016558@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208585 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 03:20:24 -0000 Neel Natu wrote: > Author: neel > Date: Thu May 27 01:27:25 2010 > New Revision: 208585 > URL: http://svn.freebsd.org/changeset/base/208585 > > Log: > Simplify clock interrupt handling on mips by using the new KPI - timer1clock() > and timer2clock(). > > Dynamically adjust the tick frequency depending on the value of 'hz'. Tested > with hz values of 100, 1000 and 2000. > > Modified: > head/sys/mips/mips/tick.c > - if (profprocs != 0) > - profclock(TRAPF_USERMODE(tf), tf->pc); > - } > + timer1clock(TRAPF_USERMODE(tf), tf->pc); > + timer2clock(TRAPF_USERMODE(tf), tf->pc); > critical_exit(); > -#if 0 /* TARGET_OCTEON */ You are not setting timer2hz, so timer2clock() will be emulated automatically. It should not be called explicitly, or statclock() will be called twice. Also, as soon as you run timer1 on frequency higher then hz - it is strange to see stathz = hz; profhz = hz; there. It is just useless. Better would be to do same as for x86: profhz = timer1hz; if (timer1hz < 128) stathz = timer1hz; else stathz = timer1hz / (timer1hz / 128); -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Thu May 27 05:44:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CD9F1065674; Thu, 27 May 2010 05:44:38 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 698E68FC13; Thu, 27 May 2010 05:44:38 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.3/8.14.3) id o4R5itMf021500; Thu, 27 May 2010 05:44:55 GMT (envelope-from kientzle@freebsd.org) Received: from horton.x.kientzle.com (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id dv7v6nb3fwsgyf3fgsq66nfhme; Thu, 27 May 2010 05:44:54 +0000 (UTC) (envelope-from kientzle@freebsd.org) Message-ID: <4BFE06C3.6040704@freebsd.org> Date: Wed, 26 May 2010 22:44:35 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.23) Gecko/20100314 SeaMonkey/1.1.18 MIME-Version: 1.0 To: Kostik Belousov References: <201005251748.o4PHmI5T093246@svn.freebsd.org> <4BFD6F80.8030700@delphij.net> <20100526191502.GG83316@deviant.kiev.zoral.com.ua> In-Reply-To: <20100526191502.GG83316@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Garrett Cooper , svn-src-all@freebsd.org, Rob Farmer , src-committers@freebsd.org Subject: Re: svn commit: r208545 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 05:44:38 -0000 Kostik Belousov wrote: >> On 2010/05/26 11:47, Garrett Cooper wrote: >>> On Wed, May 26, 2010 at 11:28 AM, Rob Farmer wrote: >>>> Does the order of the libs entries matter? ... >>>> >>> In theory it shouldn't because the linker should be smart enough >>> to evaluate the dependencies and link everything properly, but our >>> copy of binutils isn't intelligent enough to determine the appropriate >>> order from what I've seen. > > Comments about "linker not being smart enough" are nonsense. In fact, library link ordering is quite critical in some places, since it allows you to override functions provided by later libraries. Many people use this to override the system malloc() (for debugging or code size purposes) by simply linking against another library before libc. I've also used this trick to override getpwnam() so as to avoid the 1/2 megabyte of libc networking code that gets pulled in by the standard implementation. Tim From owner-svn-src-head@FreeBSD.ORG Thu May 27 06:24:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4619106567A; Thu, 27 May 2010 06:24:51 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-pz0-f183.google.com (mail-pz0-f183.google.com [209.85.222.183]) by mx1.freebsd.org (Postfix) with ESMTP id 1B4158FC28; Thu, 27 May 2010 06:24:51 +0000 (UTC) Received: by pzk13 with SMTP id 13so5422650pzk.13 for ; Wed, 26 May 2010 23:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=hLrrjWxwIZsdSlMDGWSe8VAyPGC40+D1GdfAqit8mdM=; b=l6kfV1ClV2CzLGbX63Nq3H6v9FW0hChYkZAxGcJF/K0NyKBljyKTZSqWFU2sTLKN6f SsOEsS4C7q/Dl5LMbVWnlxau7BSFf2EswUUTNlr8TneRO3KnQsFhJM4ihxvVZLtSRNsf PI7gBvXeSe35GCdqsguNU2Hd/yNhn6+ydu+sg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=u+IKGo6DkOqblg+aj1IPiCrHLSKsUfhbUUJQzMqXzS/Xi8y7301MpDu3TR2Cb0IW1y MSHTOPvJ2SZV5p0YQUwrE4aD91pLFqdA7ReFdSiE0n8tJ8+OkakslJsPMwybxw/qDZKF 6otv1E66w1AnuPIUWsStNXB816BJhmeCV8Eq8= MIME-Version: 1.0 Received: by 10.142.201.17 with SMTP id y17mr6733307wff.283.1274941490751; Wed, 26 May 2010 23:24:50 -0700 (PDT) Received: by 10.142.172.9 with HTTP; Wed, 26 May 2010 23:24:50 -0700 (PDT) In-Reply-To: <4BFDE4E3.4060300@FreeBSD.org> References: <201005270127.o4R1RPaT016558@svn.freebsd.org> <4BFDE4E3.4060300@FreeBSD.org> Date: Wed, 26 May 2010 23:24:50 -0700 Message-ID: From: Neel Natu To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Neel Natu Subject: Re: svn commit: r208585 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 06:24:51 -0000 Hi Alexander, On Wed, May 26, 2010 at 8:20 PM, Alexander Motin wrote: > Neel Natu wrote: >> Author: neel >> Date: Thu May 27 01:27:25 2010 >> New Revision: 208585 >> URL: http://svn.freebsd.org/changeset/base/208585 >> >> Log: >> =A0 Simplify clock interrupt handling on mips by using the new KPI - tim= er1clock() >> =A0 and timer2clock(). >> >> =A0 Dynamically adjust the tick frequency depending on the value of 'hz'= . Tested >> =A0 with hz values of 100, 1000 and 2000. >> >> Modified: >> =A0 head/sys/mips/mips/tick.c > >> - =A0 =A0 =A0 =A0 =A0 =A0 if (profprocs !=3D 0) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 profclock(TRAPF_USERMODE(tf), = tf->pc); >> - =A0 =A0 } >> + =A0 =A0 timer1clock(TRAPF_USERMODE(tf), tf->pc); >> + =A0 =A0 timer2clock(TRAPF_USERMODE(tf), tf->pc); >> =A0 =A0 =A0 critical_exit(); >> -#if 0 /* TARGET_OCTEON */ > > You are not setting timer2hz, so timer2clock() will be emulated > automatically. It should not be called explicitly, or statclock() will > be called twice. > I'll fix this. > Also, as soon as you run timer1 on frequency higher then hz - it is > strange to see > =A0 =A0 =A0 =A0stathz =3D hz; > =A0 =A0 =A0 =A0profhz =3D hz; > there. It is just useless. Better would be to do same as for x86: > =A0 =A0 =A0 =A0profhz =3D timer1hz; > =A0 =A0 =A0 =A0if (timer1hz < 128) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stathz =3D timer1hz; > =A0 =A0 =A0 =A0else > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stathz =3D timer1hz / (timer1hz / 128); > I see your point with the profiling timer. I'll fix that to be like x86. However it is not immediately obvious why we prefer to run the statistics timer at (or very close to) 128Hz. Any pointers? best Neel > -- > Alexander Motin > From owner-svn-src-head@FreeBSD.ORG Thu May 27 06:57:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 916A31065679; Thu, 27 May 2010 06:57:16 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9253B8FC1B; Thu, 27 May 2010 06:57:15 +0000 (UTC) Received: by fxm20 with SMTP id 20so186936fxm.13 for ; Wed, 26 May 2010 23:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=Rpi5tFnTNs9YHTiaT07KYDNrx73kXxfDeokPdoHFOZw=; b=lJJu+wsZqOzFsd76AbIyOFSFBQncdATz7noDFEaJfX8a2a+Y7wHxpK7oBgAUPoY7GH OIqCHh4jAQCtZEySoVE0/6NANqis2SKeS2kVzo6DjidhaGfHUe8UwJKtimSRMl5NHUE0 +/ous8LKhNcoJ2nefB9TC5DBU67qHdZe6maNI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=hZEi1JIUN9gEEtzUFBVGelRdEgND0AaBuW9pNNT2jvh8tDesgx3n3iT5gWSFOQsuRq oI1KfIZlSlNZ8Z0Lrqt4IV1PkpcBfhcDaI6/W+lXnQDtJH8LGrDRhmIxydYhRDtEoHXM cQG+yJvOExTZPXqr1Mqip8lk5bjR/bXLQk6Oc= Received: by 10.223.77.86 with SMTP id f22mr8612974fak.49.1274943434244; Wed, 26 May 2010 23:57:14 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 2sm4234449faf.15.2010.05.26.23.57.12 (version=SSLv3 cipher=RC4-MD5); Wed, 26 May 2010 23:57:13 -0700 (PDT) Sender: Alexander Motin Message-ID: <4BFE17AE.2080709@FreeBSD.org> Date: Thu, 27 May 2010 09:56:46 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Neel Natu References: <201005270127.o4R1RPaT016558@svn.freebsd.org> <4BFDE4E3.4060300@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208585 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 06:57:16 -0000 Neel Natu wrote: > However it is not immediately obvious why we prefer to run the > statistics timer at (or very close to) 128Hz. Any pointers? I haven't looked myself, but sources report that some legacy code depend on it: http://lists.freebsd.org/pipermail/freebsd-arch/2009-December/009731.html In any case it should not be equal to hz whenever possible. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Thu May 27 08:10:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF9241065670; Thu, 27 May 2010 08:10:12 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEED88FC12; Thu, 27 May 2010 08:10:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4R8ACee006688; Thu, 27 May 2010 08:10:12 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4R8ACEX006685; Thu, 27 May 2010 08:10:12 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201005270810.o4R8ACEX006685@svn.freebsd.org> From: Attilio Rao Date: Thu, 27 May 2010 08:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208587 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 08:10:13 -0000 Author: attilio Date: Thu May 27 08:10:12 2010 New Revision: 208587 URL: http://svn.freebsd.org/changeset/base/208587 Log: Add the support for reporting the NOCOREDUMP flag from sysctl_kern_proc_vmmap(). Sponsored by: Sandvine Incorporated Reviewed by: kib, emaste MFC after: 1 week Modified: head/sys/kern/kern_proc.c head/sys/sys/user.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu May 27 03:15:04 2010 (r208586) +++ head/sys/kern/kern_proc.c Thu May 27 08:10:12 2010 (r208587) @@ -1577,6 +1577,8 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A kve->kve_flags |= KVME_FLAG_COW; if (entry->eflags & MAP_ENTRY_NEEDS_COPY) kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + if (entry->eflags & MAP_ENTRY_NOCOREDUMP) + kve->kve_flags |= KVME_FLAG_NOCOREDUMP; last_timestamp = map->timestamp; vm_map_unlock_read(map); @@ -1752,6 +1754,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_flags |= KVME_FLAG_COW; if (entry->eflags & MAP_ENTRY_NEEDS_COPY) kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + if (entry->eflags & MAP_ENTRY_NOCOREDUMP) + kve->kve_flags |= KVME_FLAG_NOCOREDUMP; last_timestamp = map->timestamp; vm_map_unlock_read(map); Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Thu May 27 03:15:04 2010 (r208586) +++ head/sys/sys/user.h Thu May 27 08:10:12 2010 (r208587) @@ -336,6 +336,7 @@ struct kinfo_file { #define KVME_FLAG_COW 0x00000001 #define KVME_FLAG_NEEDS_COPY 0x00000002 +#define KVME_FLAG_NOCOREDUMP 0x00000004 #if defined(__amd64__) #define KINFO_OVMENTRY_SIZE 1168 From owner-svn-src-head@FreeBSD.ORG Thu May 27 08:21:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CF8E1065678; Thu, 27 May 2010 08:21:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 573C08FC28; Thu, 27 May 2010 08:21:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4R8LqoF009315; Thu, 27 May 2010 08:21:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4R8LqOr009312; Thu, 27 May 2010 08:21:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201005270821.o4R8LqOr009312@svn.freebsd.org> From: Rui Paulo Date: Thu, 27 May 2010 08:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208588 - in head/share/doc/legal: . intel_iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 08:21:53 -0000 Author: rpaulo Date: Thu May 27 08:21:52 2010 New Revision: 208588 URL: http://svn.freebsd.org/changeset/base/208588 Log: Install Intel iwn(4) firmware license. MFC after: 3 days Added: head/share/doc/legal/intel_iwn/ head/share/doc/legal/intel_iwn/Makefile (contents, props changed) Modified: head/share/doc/legal/Makefile Modified: head/share/doc/legal/Makefile ============================================================================== --- head/share/doc/legal/Makefile Thu May 27 08:10:12 2010 (r208587) +++ head/share/doc/legal/Makefile Thu May 27 08:21:52 2010 (r208588) @@ -2,6 +2,7 @@ SUBDIR= intel_ipw \ intel_iwi \ + intel_iwn \ intel_wpi .include Added: head/share/doc/legal/intel_iwn/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/legal/intel_iwn/Makefile Thu May 27 08:21:52 2010 (r208588) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +NO_OBJ= +FILES= ${.CURDIR}/../../../../sys/contrib/dev/iwn/LICENSE +FILESDIR= ${SHAREDIR}/doc/legal/intel_iwn + +.include From owner-svn-src-head@FreeBSD.ORG Thu May 27 10:05:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A16591065677; Thu, 27 May 2010 10:05:40 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9065F8FC1A; Thu, 27 May 2010 10:05:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RA5ewY032271; Thu, 27 May 2010 10:05:40 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RA5eVu032269; Thu, 27 May 2010 10:05:40 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201005271005.o4RA5eVu032269@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 27 May 2010 10:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208589 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 10:05:40 -0000 Author: jchandra Date: Thu May 27 10:05:40 2010 New Revision: 208589 URL: http://svn.freebsd.org/changeset/base/208589 Log: Call VM_WAIT in pmap_ptpgzone_allocf() if M_WAITOK is set. Removed unused variable. Approved by: rrs (mentor) Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu May 27 08:21:52 2010 (r208588) +++ head/sys/mips/mips/pmap.c Thu May 27 10:05:40 2010 (r208589) @@ -969,10 +969,15 @@ pmap_ptpgzone_allocf(uma_zone_t zone, in ("pmap_ptpgzone_allocf: invalid allocation size %d", bytes)); *flags = UMA_SLAB_PRIV; - m = vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LARGEST_PHYS, - PAGE_SIZE, PAGE_SIZE); - if (m == NULL) - return (NULL); + for (;;) { + m = vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LARGEST_PHYS, + PAGE_SIZE, PAGE_SIZE); + if (m != NULL) + break; + if ((wait & M_WAITOK) == 0) + return (NULL); + VM_WAIT; + } paddr = VM_PAGE_TO_PHYS(m); return ((void *)MIPS_PHYS_TO_KSEG0(paddr)); @@ -1039,8 +1044,10 @@ pmap_pinit(pmap_t pmap) * allocate the page directory page */ ptdpg = pmap_alloc_pte_page(pmap, NUSERPGTBLS, M_WAITOK, &ptdva); - pmap->pm_segtab = (pd_entry_t *)ptdva; + if (ptdpg == NULL) + return (0); + pmap->pm_segtab = (pd_entry_t *)ptdva; pmap->pm_active = 0; pmap->pm_ptphint = NULL; for (i = 0; i < MAXCPU; i++) { @@ -1062,13 +1069,11 @@ _pmap_allocpte(pmap_t pmap, unsigned pte { vm_offset_t pteva; vm_page_t m; - int req; KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, ("_pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); - req = VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ; /* * Find or fabricate a new pagetable page */ From owner-svn-src-head@FreeBSD.ORG Thu May 27 11:39:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A5DE1065676; Thu, 27 May 2010 11:39:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 1E5A38FC0C; Thu, 27 May 2010 11:39:22 +0000 (UTC) Received: from besplex.bde.org (c122-106-175-32.carlnfd1.nsw.optusnet.com.au [122.106.175.32]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o4RBdICx009622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 May 2010 21:39:19 +1000 Date: Thu, 27 May 2010 21:39:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Neel Natu In-Reply-To: Message-ID: <20100527200033.K1376@besplex.bde.org> References: <201005270127.o4R1RPaT016558@svn.freebsd.org> <4BFDE4E3.4060300@FreeBSD.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-599122876-1274960358=:1376" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alexander Motin , src-committers@freebsd.org, Neel Natu Subject: Re: svn commit: r208585 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 11:39:23 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-599122876-1274960358=:1376 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 26 May 2010, Neel Natu wrote: > On Wed, May 26, 2010 at 8:20 PM, Alexander Motin wrote: >> Neel Natu wrote: >> Also, as soon as you run timer1 on frequency higher then hz - it is >> strange to see >> =A0 =A0 =A0 =A0stathz =3D hz; >> =A0 =A0 =A0 =A0profhz =3D hz; >> there. It is just useless. Better would be to do same as for x86: >> =A0 =A0 =A0 =A0profhz =3D timer1hz; >> =A0 =A0 =A0 =A0if (timer1hz < 128) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stathz =3D timer1hz; >> =A0 =A0 =A0 =A0else >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stathz =3D timer1hz / (timer1hz / 128); >> This is almost unreadable due to \xa0. =09stathz =3D timer1hz / (timer1hz / 128); only works right if timer1hz is a multiple of 128, or at least a multiple of the final stathz.. Otherwise, there may be significant rounding error in the calculation, and if the final stathz is not an exact divisor of timer1hz it is impossible to generate stathz from timer1hz by dividing it. (This has always been broken for the lapic timer on amd64 and i386. stathz =3D 133 is only nearly a divisor of 1000 or 2000, and 128 is even further from being a divisor of any timer frequency that can generate hz 1000. The effects of this can be seen in systat(1) -v 1 output -- the reported lapic timer interrupt frequencies jump every ~(lapic_timer_hz / stathz) seconds when the divider compensates for the multiple not being exact. Another bug visible in systa= t -v and vmstat -i output on ref9-amd64 right now is that the lapic timer interrupt frequencies are all reported as 960. hz is reported to be 1000, but it is impossible to generate 1000 from 960. Another bug in the lapic timer code on amd64 and i386 is that it doesn't change the lapic timer frequency to generate a high enough profhz. profhz =3D 8192, which is generated by the RTC on amd64 and i386, was adequate in 1990, and it needs to be 100-1000 times larger now, but the lapic doesn't even generate that; it claims to generates 1024, and this is even more impossible to divide down from 960 than is 1000.) > I see your point with the profiling timer. I'll fix that to be like x86. > > However it is not immediately obvious why we prefer to run the > statistics timer at (or very close to) 128Hz. Any pointers? At least SCHED_4BSD requires stathz to be almost 128. More precisely, it requires a clock of frequency about 16 Hz and divides stathz internally by INVERSE_ESTCPU_WEIGHT =3D (8 * smp_cpus) to get this. It gets some extra resolution by accumulating ticks at stathz but has to divide the result by 8 before feeding it to the priority adjustment, else the adjustment would be too sensitive to recent activity, and/or would overflow (overflow is avoided by clamping to the limit, but this is bad too). Dividing by smp_ncpus is a hack to avoid the overflow at a cost of reducing sensitivity. The requirement for stathz to be almost 128 is pushed to the clock generator(s) to avoid having dividers (other than the simple/historical division by 8) in both the clock generator(s) and the scheduler(s). WHen using lapic timers, I normally use lapic_timer_hz =3D hz =3D stathz = =3D profhz =3D 100, and don't worry about the completely broken profhz or the scheduling problems from having stathz =3D hz. The scheduling problems are mostly caused by the hardware clocks behind stathz and hz being indentical. When they are identical, having stathz !=3D hz doesn't help much, at least without the changes that I suggested a few months ago (statclock() and hardclock() should never be called from the same hardware interrupt). There are 2 types of scheduling/statistics problems: - malicious applications may hide from scheduling/statistics interrupts by arranging that they don't run across the interrupts. This is easy to do while running for most of the time if hz is much larger than stathz (now the default :-(). - even non-malicious applications may hide from scheduling/statistics interrupts if the statclock and hardclock interrupts are too synchronous= =2E This is a problem with the lapic timer interrupts in practice. I think it takes almost perfect synchronization for there to be a problem in practice, and I can't see how the syncronization was perfect enough. For hz =3D 1000, lapic_timer_hz was 2000 and hardclock was called every second interrupt, while statclock was called every 2000/(stathz=3D133) = =3D 15th or 16th interrupt. Since 15 is not a multiple of 2, statclock was normally called for the same lapic timer interrupt only every second interrupt. This should be asynchronous enough. I don't know the detail= s of the current or previous implementation (where lapic_timer_hz is not 2000) but IIRC the dividers don't know anything about the synchronicity problem so they could easily make it worse. Bruce --0-599122876-1274960358=:1376-- From owner-svn-src-head@FreeBSD.ORG Thu May 27 12:11:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 993A71065675; Thu, 27 May 2010 12:11:21 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 880548FC20; Thu, 27 May 2010 12:11:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RCBLZp067094; Thu, 27 May 2010 12:11:21 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RCBLmU067092; Thu, 27 May 2010 12:11:21 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201005271211.o4RCBLmU067092@svn.freebsd.org> From: Rui Paulo Date: Thu, 27 May 2010 12:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208590 - head/sys/modules/iwnfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 12:11:21 -0000 Author: rpaulo Date: Thu May 27 12:11:21 2010 New Revision: 208590 URL: http://svn.freebsd.org/changeset/base/208590 Log: Make the user ack the license before using this firmware. MFC after: 3 days Modified: head/sys/modules/iwnfw/Makefile.inc Modified: head/sys/modules/iwnfw/Makefile.inc ============================================================================== --- head/sys/modules/iwnfw/Makefile.inc Thu May 27 10:05:40 2010 (r208589) +++ head/sys/modules/iwnfw/Makefile.inc Thu May 27 12:11:21 2010 (r208590) @@ -9,5 +9,7 @@ CLEANFILES+= ${_FIRM} FIRMWS= ${_FIRM}:${KMOD} +FIRMWARE_LICENSE= intel_iwn + ${_FIRM}: ${.CURDIR}/../../../contrib/dev/iwn/${_FIRM}.uu uudecode -p $? > ${.TARGET} From owner-svn-src-head@FreeBSD.ORG Thu May 27 12:22:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 087A3106566B; Thu, 27 May 2010 12:22:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 779CC8FC16; Thu, 27 May 2010 12:22:52 +0000 (UTC) Received: from besplex.bde.org (c122-106-175-32.carlnfd1.nsw.optusnet.com.au [122.106.175.32]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o4RCMn42031555 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 May 2010 22:22:50 +1000 Date: Thu, 27 May 2010 22:22:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Motin In-Reply-To: <4BFE17AE.2080709@FreeBSD.org> Message-ID: <20100527214304.C1620@besplex.bde.org> References: <201005270127.o4R1RPaT016558@svn.freebsd.org> <4BFDE4E3.4060300@FreeBSD.org> <4BFE17AE.2080709@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Neel Natu Subject: Re: svn commit: r208585 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 12:22:54 -0000 On Thu, 27 May 2010, Alexander Motin wrote: > Neel Natu wrote: >> However it is not immediately obvious why we prefer to run the >> statistics timer at (or very close to) 128Hz. Any pointers? > > I haven't looked myself, but sources report that some legacy code depend > on it: > http://lists.freebsd.org/pipermail/freebsd-arch/2009-December/009731.html That's a good reference for newer scheduler problems. The following from cvs history is better for the 128: % RCS file: /home/ncvs/src/sys/kern/kern_synch.c,v History in sched_4bsd.c was broken by not repo-copying. % Working file: kern_synch.c % head: 1.249 % ... % ---------------------------- % revision 1.83 % date: 1999/11/28 12:12:13; author: bde; state: Exp; lines: +11 -13 % Scheduler fixes equivalent to the ones logged in the following NetBSD % commit to kern_synch.c: % % ---------------------------- % revision 1.55 % date: 1999/02/23 02:56:03; author: ross; state: Exp; lines: +39 -10 % Scheduler bug fixes and reorganization % * fix the ancient nice(1) bug, where nice +20 processes incorrectly % steal 10 - 20% of the CPU, (or even more depending on load average) % * provide a new schedclk() mechanism at a new clock at schedhz, so high % platform hz values don't cause nice +0 processes to look like they are % niced % * change the algorithm slightly, and reorganize the code a lot % * fix percent-CPU calculation bugs, and eliminate some no-op code % % === nice bug === Correctly divide the scheduler queues between niced and % compute-bound processes. The current nice weight of two (sort of, see 2 or 4 was the historical value. % `algorithm change' below) neatly divides the USRPRI queues in half; this % should have been used to clip p_estcpu, instead of UCHAR_MAX. Besides % being the wrong amount, clipping an unsigned char to UCHAR_MAX is a no-op, % and it was done after decay_cpu() which can only _reduce_ the value. It % has to be kept <= NICE_WEIGHT * PRIO_MAX - PPQ or processes can % scheduler-penalize themselves onto the same queue as nice +20 processes. % (Or even a higher one.) % % === New schedclk() mechansism === Some platforms should be cutting down % stathz before hitting the scheduler, since the scheduler algorithm only % works right in the vicinity of 64 Hz. Rather than prescale hz, then scale The historical value was probably 60. % back and forth by 4 every time p_estcpu is touched (each occurance an % abstraction violation), use p_estcpu without scaling and require schedhz % to be generated directly at the right frequency. Use a default stathz (well, % actually, profhz) / 4, so nothing changes unless a platform defines schedhz % and a new clock. Define these for alpha, where hz==1024, and nice was % totally broke. % % === Algorithm change === The nice value used to be added to the % exponentially-decayed scheduler history value p_estcpu, in _addition_ to % be incorporated directly (with greater wieght) into the priority calculation. % At first glance, it appears to be a pointless increase of 1/8 the nice Perhaps I am confused by where the above factor of 2 or 4 was, and the 8 came directly from this 1/8. Anyway, the final version attempts to fold the factors together if possible. % effect (pri = p_estcpu/4 + nice*2), but it's actually at least 3x that % because it will ramp up linearly but be decayed only exponentially, thus % converging to an additional .75 nice for a loadaverage of one. I killed % this, it makes the behavior hard to control, almost impossible to analyze, % and the effect (~~nothing at for the first second, then somewhat increased % niceness after three seconds or more, depending on load average) pointless. % % === Other bugs === hz -> profhz in the p_pctcpu = f(p_cpticks) calcuation. % Collect scheduler functionality. Try to put each abstraction in just one % place. % ---------------------------- % % The details are a little different in FreeBSD: % % === nice bug === Fixing this is the main point of this commit. We use % essentially the same clipping rule as NetBSD (our limit on p_estcpu % differs by a scale factor). However, clipping at all is fundamentally % bad. It gives free CPU the hoggiest hogs once they reach the limit, and % reaching the limit is normal for long-running hogs. This will be fixed % later. % % === New schedclk() mechanism === We don't use the NetBSD schedclk() % (now schedclock()) mechanism. We require (real)stathz to be about 128 % and scale by an extra factor of 2 compared with NetBSD's statclock(). Later another factor of to was added, giving a factor of 8. Later still, another factor of smp_ncpus was added. These factors reduce overflow/clamping. % We scale p_estcpu instead of scaling the clock. This is more accurate % and flexible. % % === Algorithm change === Same change. % % === Other bugs === The p_pctcpu bug was fixed long ago. We don't try as % hard to abstract functionality yet. % % Related changes: the new limit on p_estcpu must be exported to kern_exit.c % for clipping in wait1(). % % Agreed with by: dufault % ---------------------------- % > In any case it should not be equal to hz whenever possible. More precisely, stathz should not be a divisor of hz. I think that requirement is mostly a hack that helps with independent hardware clocks. If the clocks had identical frequencies, then they would be mostly out of sync, but occasionally they would get in sync, and then their identical frequencies would keep them in sync for a long time determined by how closely their frequencies are equal and stable. Using different frequencies significantly reduces the frequency of perfect synchronization -- after the clocks become in perfect sync, their next interrupts are at times separated by (1/hz - 1/stathz). These times are still too predictable, but the difference is far from 0. With a single higher frequency clock divided down into various sub-clocks, it can be arranged that the differences for the sub-clocks are even further from 0. The times of all the pseudo-interrupts for all the sub-clocks would be even more predictable, but I think this is not a problem iff stathz is much larger than hz. (hz much larger than stathz is a problem even with an independent aperiodic statclock. Then it is easy for a malicious program to observe statclock activity using timeouts at the much larger hardclock frequency, and possible to predict future statclock activity since "hz much larger than stathz" means that any randomness in statclock is not so large as to significantly change the average time until the next statclock interrupt.) Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 27 12:54:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 120801065673; Thu, 27 May 2010 12:54:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 010058FC1B; Thu, 27 May 2010 12:54:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RCsgRn076708; Thu, 27 May 2010 12:54:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RCsgLk076706; Thu, 27 May 2010 12:54:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201005271254.o4RCsgLk076706@svn.freebsd.org> From: Rui Paulo Date: Thu, 27 May 2010 12:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208591 - head/sys/modules/iwnfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 12:54:43 -0000 Author: rpaulo Date: Thu May 27 12:54:42 2010 New Revision: 208591 URL: http://svn.freebsd.org/changeset/base/208591 Log: Revert r208590. A license ack is not needed as per r186984. Modified: head/sys/modules/iwnfw/Makefile.inc Modified: head/sys/modules/iwnfw/Makefile.inc ============================================================================== --- head/sys/modules/iwnfw/Makefile.inc Thu May 27 12:11:21 2010 (r208590) +++ head/sys/modules/iwnfw/Makefile.inc Thu May 27 12:54:42 2010 (r208591) @@ -9,7 +9,10 @@ CLEANFILES+= ${_FIRM} FIRMWS= ${_FIRM}:${KMOD} -FIRMWARE_LICENSE= intel_iwn +# +# Note that a license ack is not needed for iwn. +# +#FIRMWARE_LICENSE= ${_FIRM}: ${.CURDIR}/../../../contrib/dev/iwn/${_FIRM}.uu uudecode -p $? > ${.TARGET} From owner-svn-src-head@FreeBSD.ORG Thu May 27 12:59:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75FDA1065674; Thu, 27 May 2010 12:59:49 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 653758FC21; Thu, 27 May 2010 12:59:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RCxnZr077881; Thu, 27 May 2010 12:59:49 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RCxn2O077879; Thu, 27 May 2010 12:59:49 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005271259.o4RCxn2O077879@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 27 May 2010 12:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208592 - head/usr.bin/mail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 12:59:49 -0000 Author: uqs Date: Thu May 27 12:59:49 2010 New Revision: 208592 URL: http://svn.freebsd.org/changeset/base/208592 Log: mail(1) misses addresses when replying to all There's a parsing error for fields where addresses are not separated by space. This is often produced by MS Outlook, eg.: Cc: ,"Mr Foo" The following line now splits into the right tokens: Cc: f@b.com,z@y.de, ,, "foo" ,"bar" PR: bin/131861 Submitted by: Pete French Tested by: Pete French Reviewed by: mikeh MFC after: 2 weeks Modified: head/usr.bin/mail/util.c Modified: head/usr.bin/mail/util.c ============================================================================== --- head/usr.bin/mail/util.c Thu May 27 12:54:42 2010 (r208591) +++ head/usr.bin/mail/util.c Thu May 27 12:59:49 2010 (r208592) @@ -496,10 +496,11 @@ skin(name) *cp2++ = ' '; } *cp2++ = c; - if (c == ',' && *cp == ' ' && !gotlt) { + if (c == ',' && !gotlt && + (*cp == ' ' || *cp == '"' || *cp == '<')) { *cp2++ = ' '; - while (*++cp == ' ') - ; + while (*cp == ' ') + cp++; lastsp = 0; bufend = cp2; } From owner-svn-src-head@FreeBSD.ORG Thu May 27 13:56:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D1E81065670; Thu, 27 May 2010 13:56:20 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C45D8FC19; Thu, 27 May 2010 13:56:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RDuJxX090285; Thu, 27 May 2010 13:56:19 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RDuJ6n090281; Thu, 27 May 2010 13:56:19 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005271356.o4RDuJ6n090281@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 27 May 2010 13:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208593 - in head/usr.sbin: fdcontrol i2c smbmsg X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 13:56:20 -0000 Author: uqs Date: Thu May 27 13:56:19 2010 New Revision: 208593 URL: http://svn.freebsd.org/changeset/base/208593 Log: mdoc: Remove leading garbage, empty lines and order preamble Modified: head/usr.sbin/fdcontrol/fdcontrol.8 head/usr.sbin/i2c/i2c.8 head/usr.sbin/smbmsg/smbmsg.8 Modified: head/usr.sbin/fdcontrol/fdcontrol.8 ============================================================================== --- head/usr.sbin/fdcontrol/fdcontrol.8 Thu May 27 12:59:49 2010 (r208592) +++ head/usr.sbin/fdcontrol/fdcontrol.8 Thu May 27 13:56:19 2010 (r208593) @@ -1,4 +1,3 @@ -'\" t .\" Copyright (C) 1994, 2001 by Joerg Wunsch, Dresden .\" All rights reserved. .\" @@ -27,8 +26,8 @@ .\" $FreeBSD$ .\" .Dd December 25, 2001 -.Os .Dt FDCONTROL 8 +.Os .Sh NAME .Nm fdcontrol .Nd display and modify floppy disk parameters Modified: head/usr.sbin/i2c/i2c.8 ============================================================================== --- head/usr.sbin/i2c/i2c.8 Thu May 27 12:59:49 2010 (r208592) +++ head/usr.sbin/i2c/i2c.8 Thu May 27 13:56:19 2010 (r208593) @@ -25,7 +25,6 @@ .\" .\" $FreeBSD$ .\" - .Dd January 23, 2009 .Dt I2C 8 .Os Modified: head/usr.sbin/smbmsg/smbmsg.8 ============================================================================== --- head/usr.sbin/smbmsg/smbmsg.8 Thu May 27 12:59:49 2010 (r208592) +++ head/usr.sbin/smbmsg/smbmsg.8 Thu May 27 13:56:19 2010 (r208593) @@ -1,4 +1,3 @@ -'\" t .\" Copyright (c) 2004 Joerg Wunsch .\" All rights reserved. .\" From owner-svn-src-head@FreeBSD.ORG Thu May 27 13:56:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A42A91065787; Thu, 27 May 2010 13:56:27 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 790B98FC1B; Thu, 27 May 2010 13:56:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RDuROQ090354; Thu, 27 May 2010 13:56:27 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RDuRuK090349; Thu, 27 May 2010 13:56:27 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005271356.o4RDuRuK090349@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 27 May 2010 13:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208594 - in head: lib/msun/man share/man/man9 usr.sbin/nfsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 13:56:27 -0000 Author: uqs Date: Thu May 27 13:56:27 2010 New Revision: 208594 URL: http://svn.freebsd.org/changeset/base/208594 Log: mdoc: Garbage collect unused/unneeded macros Modified: head/lib/msun/man/math.3 head/share/man/man9/atomic.9 head/usr.sbin/nfsd/nfsv4.4 head/usr.sbin/nfsd/stablerestart.5 Modified: head/lib/msun/man/math.3 ============================================================================== --- head/lib/msun/man/math.3 Thu May 27 13:56:19 2010 (r208593) +++ head/lib/msun/man/math.3 Thu May 27 13:56:27 2010 (r208594) @@ -31,9 +31,6 @@ .Dd December 16, 2007 .Dt MATH 3 .Os -.if n \{\ -.char \[sr] "sqrt -.\} .Sh NAME .Nm math .Nd "floating-point mathematical library" Modified: head/share/man/man9/atomic.9 ============================================================================== --- head/share/man/man9/atomic.9 Thu May 27 13:56:19 2010 (r208593) +++ head/share/man/man9/atomic.9 Thu May 27 13:56:27 2010 (r208594) @@ -62,7 +62,6 @@ .Fn atomic_subtract_[acq_|rel_] "volatile *p" " v" .Ft void .Fn atomic_store_rel_ "volatile *p" " v" -.rm LB RB La Ra .Sh DESCRIPTION Each of the atomic operations is guaranteed to be atomic in the presence of interrupts. Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Thu May 27 13:56:19 2010 (r208593) +++ head/usr.sbin/nfsd/nfsv4.4 Thu May 27 13:56:27 2010 (r208594) @@ -34,7 +34,7 @@ The experimental NFS client and server provides support for the .Tn NFSv4 specification; see -.%T "Network File System (NFS) Version 4 Protocol \\*(tNRFC\\*(sP 3530" . +.%T "Network File System (NFS) Version 4 Protocol RFC 3530" . The protocol is somewhat similar to NFS Version 3, but differs in significant ways. It uses a single compound RPC that concatenates operations to-gether. Modified: head/usr.sbin/nfsd/stablerestart.5 ============================================================================== --- head/usr.sbin/nfsd/stablerestart.5 Thu May 27 13:56:19 2010 (r208593) +++ head/usr.sbin/nfsd/stablerestart.5 Thu May 27 13:56:27 2010 (r208594) @@ -42,7 +42,7 @@ file holds information that allows the server to restart without always returning the NFSERR_NOGRACE error, as described in the .Tn NFSv4 server specification; see -.%T "Network File System (NFS) Version 4 Protocol \\*(tNRFC\\*(sP 3530, Section 8.6.3" . +.%T "Network File System (NFS) Version 4 Protocol RFC 3530, Section 8.6.3" . .Pp The first record in the file, as defined by struct nfsf_rec in /usr/include/fs/nfs/nfsrvstate.h, holds the lease duration of the From owner-svn-src-head@FreeBSD.ORG Thu May 27 13:56:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE088106583D; Thu, 27 May 2010 13:56:33 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC6898FC18; Thu, 27 May 2010 13:56:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RDuXjE090421; Thu, 27 May 2010 13:56:33 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RDuXOL090419; Thu, 27 May 2010 13:56:33 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005271356.o4RDuXOL090419@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 27 May 2010 13:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208595 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 13:56:33 -0000 Author: uqs Date: Thu May 27 13:56:33 2010 New Revision: 208595 URL: http://svn.freebsd.org/changeset/base/208595 Log: mdoc: Use mdoc macro for the (R) symbol While here, also drop the unneeded quotes Modified: head/lib/libpmc/pmc.core.3 Modified: head/lib/libpmc/pmc.core.3 ============================================================================== --- head/lib/libpmc/pmc.core.3 Thu May 27 13:56:27 2010 (r208594) +++ head/lib/libpmc/pmc.core.3 Thu May 27 13:56:33 2010 (r208595) @@ -49,11 +49,11 @@ performance measurement architecture. .Pp These PMCs are documented in .Rs -.%B "IA-32 Intel(R) Architecture Software Developer's Manual" -.%T "Volume 3: System Programming Guide" -.%N "Order Number 253669-027US" +.%B IA-32 Intel\(rg Architecture Software Developer's Manual +.%T Volume 3: System Programming Guide +.%N Order Number 253669-027US .%D July 2008 -.%Q "Intel Corporation" +.%Q Intel Corporation .Re .Ss PMC Features CPUs conforming to version 1 of the @@ -735,11 +735,11 @@ The following errata affect performance processors. These errata are documented in .Rs -.%T "Intel® CoreTM Duo Processor and Intel® CoreTM Solo Processor on 65 nm Process" -.%B "Specification Update" -.%N "Order Number 309222-017" +.%B Specification Update +.%T Intel\(rg CoreTM Duo Processor and Intel\(rg CoreTM Solo Processor on 65 nm Process +.%N Order Number 309222-017 .%D July 2008 -.%Q "Intel Corporation" +.%Q Intel Corporation .Re .Bl -tag -width indent -compact .It AE19 From owner-svn-src-head@FreeBSD.ORG Thu May 27 13:56:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32E7D10658FD; Thu, 27 May 2010 13:56:41 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21E948FC17; Thu, 27 May 2010 13:56:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RDuffq090461; Thu, 27 May 2010 13:56:41 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RDueY7090456; Thu, 27 May 2010 13:56:40 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005271356.o4RDueY7090456@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 27 May 2010 13:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208596 - in head: sbin/fsck_msdosfs share/man/man4 usr.sbin/dconschat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 13:56:41 -0000 Author: uqs Date: Thu May 27 13:56:40 2010 New Revision: 208596 URL: http://svn.freebsd.org/changeset/base/208596 Log: mdoc: .Ud has attitude, it takes no argument! Modified: head/sbin/fsck_msdosfs/fsck_msdosfs.8 head/share/man/man4/dcons.4 head/share/man/man4/sbp_targ.4 head/usr.sbin/dconschat/dconschat.8 Modified: head/sbin/fsck_msdosfs/fsck_msdosfs.8 ============================================================================== --- head/sbin/fsck_msdosfs/fsck_msdosfs.8 Thu May 27 13:56:33 2010 (r208595) +++ head/sbin/fsck_msdosfs/fsck_msdosfs.8 Thu May 27 13:56:40 2010 (r208596) @@ -120,4 +120,4 @@ utility first appeared in The .Nm utility is -.Ud . +.Ud Modified: head/share/man/man4/dcons.4 ============================================================================== --- head/share/man/man4/dcons.4 Thu May 27 13:56:33 2010 (r208595) +++ head/share/man/man4/dcons.4 Thu May 27 13:56:40 2010 (r208596) @@ -122,4 +122,4 @@ dcons_gdb="1" .An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org .Sh BUGS This driver is -.Ud . +.Ud Modified: head/share/man/man4/sbp_targ.4 ============================================================================== --- head/share/man/man4/sbp_targ.4 Thu May 27 13:56:33 2010 (r208595) +++ head/share/man/man4/sbp_targ.4 Thu May 27 13:56:40 2010 (r208596) @@ -93,6 +93,6 @@ driver was written by .An Hidetoshi Shimokawa . .Sh BUGS This driver is -.Ud . +.Ud It does not work correctly in multi-initiator environments or after the bus topology has been changed. Modified: head/usr.sbin/dconschat/dconschat.8 ============================================================================== --- head/usr.sbin/dconschat/dconschat.8 Thu May 27 13:56:33 2010 (r208595) +++ head/usr.sbin/dconschat/dconschat.8 Thu May 27 13:56:40 2010 (r208596) @@ -327,4 +327,4 @@ console remote { .An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org .Sh BUGS This utility is -.Ud . +.Ud From owner-svn-src-head@FreeBSD.ORG Thu May 27 13:56:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AAFE10659C0; Thu, 27 May 2010 13:56:47 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8532B8FC1B; Thu, 27 May 2010 13:56:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RDulQt090530; Thu, 27 May 2010 13:56:47 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RDulHm090528; Thu, 27 May 2010 13:56:47 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005271356.o4RDulHm090528@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 27 May 2010 13:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208597 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 13:56:47 -0000 Author: uqs Date: Thu May 27 13:56:47 2010 New Revision: 208597 URL: http://svn.freebsd.org/changeset/base/208597 Log: mdoc: remove duplicate width argument Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Thu May 27 13:56:40 2010 (r208596) +++ head/share/man/man4/ddb.4 Thu May 27 13:56:47 2010 (r208597) @@ -964,7 +964,7 @@ is printed. Show all threads within the system. Output format is as follows: .Pp -.Bl -tag -width "PPID" -compact -offset indent -width "Second column" +.Bl -tag -compact -offset indent -width "Second column" .It Ic First column Thread identifier (TID) .It Ic Second column From owner-svn-src-head@FreeBSD.ORG Thu May 27 13:56:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D5781065AE9; Thu, 27 May 2010 13:56:53 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACCD48FC1D; Thu, 27 May 2010 13:56:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RDurNG090596; Thu, 27 May 2010 13:56:53 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RDurCi090594; Thu, 27 May 2010 13:56:53 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005271356.o4RDurCi090594@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 27 May 2010 13:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208598 - head/usr.sbin/pkg_install/updating X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 13:56:54 -0000 Author: uqs Date: Thu May 27 13:56:53 2010 New Revision: 208598 URL: http://svn.freebsd.org/changeset/base/208598 Log: mdoc: use mdoc spelling of Umlauts Modified: head/usr.sbin/pkg_install/updating/pkg_updating.1 Modified: head/usr.sbin/pkg_install/updating/pkg_updating.1 ============================================================================== --- head/usr.sbin/pkg_install/updating/pkg_updating.1 Thu May 27 13:56:47 2010 (r208597) +++ head/usr.sbin/pkg_install/updating/pkg_updating.1 Thu May 27 13:56:53 2010 (r208598) @@ -83,7 +83,7 @@ installed ports: .Xr pkg_delete 1 , .Xr pkg_version 1 .Sh AUTHORS -.An Beat Gätzi Aq beat@chruetertee.ch +.An Beat G\(:atzi Aq beat@chruetertee.ch .Sh CONTRIBUTORS .An Martin Tournoij Aq carpetsmoker@xs4all.nl .Sh BUGS From owner-svn-src-head@FreeBSD.ORG Thu May 27 15:27:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B7381065677; Thu, 27 May 2010 15:27:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BA108FC2F; Thu, 27 May 2010 15:27:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RFRVsQ010926; Thu, 27 May 2010 15:27:31 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RFRVpk010924; Thu, 27 May 2010 15:27:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201005271527.o4RFRVpk010924@svn.freebsd.org> From: Robert Watson Date: Thu, 27 May 2010 15:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208601 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 15:27:31 -0000 Author: rwatson Date: Thu May 27 15:27:31 2010 New Revision: 208601 URL: http://svn.freebsd.org/changeset/base/208601 Log: When close() is called on a connected socket pair, SO_ISCONNECTED might be set but be cleared before the call to sodisconnect(). In this case, ENOTCONN is returned: suppress this error rather than returning it to userspace so that close() doesn't report an error improperly. PR: kern/144061 Reported by: Matt Reimer , Nikolay Denev , Mikolaj Golub MFC after: 3 days Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu May 27 15:17:06 2010 (r208600) +++ head/sys/kern/uipc_socket.c Thu May 27 15:27:31 2010 (r208601) @@ -665,8 +665,11 @@ soclose(struct socket *so) if (so->so_state & SS_ISCONNECTED) { if ((so->so_state & SS_ISDISCONNECTING) == 0) { error = sodisconnect(so); - if (error) + if (error) { + if (error == ENOTCONN) + error = 0; goto drop; + } } if (so->so_options & SO_LINGER) { if ((so->so_state & SS_ISDISCONNECTING) && From owner-svn-src-head@FreeBSD.ORG Thu May 27 15:28:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1FF3106566C; Thu, 27 May 2010 15:28:55 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7FFA8FC16; Thu, 27 May 2010 15:28:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RFStNI011261; Thu, 27 May 2010 15:28:55 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RFStEc011259; Thu, 27 May 2010 15:28:55 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201005271528.o4RFStEc011259@svn.freebsd.org> From: Robert Watson Date: Thu, 27 May 2010 15:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208602 - head/tools/regression/sockets/unix_close_race X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 15:28:55 -0000 Author: rwatson Date: Thu May 27 15:28:55 2010 New Revision: 208602 URL: http://svn.freebsd.org/changeset/base/208602 Log: Correct several nits/problems in the unix_close_race regression test. Submitted by: Mikolaj Golub MFC after: 3 days Modified: head/tools/regression/sockets/unix_close_race/unix_close_race.c Modified: head/tools/regression/sockets/unix_close_race/unix_close_race.c ============================================================================== --- head/tools/regression/sockets/unix_close_race/unix_close_race.c Thu May 27 15:27:31 2010 (r208601) +++ head/tools/regression/sockets/unix_close_race/unix_close_race.c Thu May 27 15:28:55 2010 (r208602) @@ -75,8 +75,8 @@ main(int argc, char **argv) warnx("SMP not present, test may be unable to trigger race"); /* - * Create a UNIX domain socket that the parent will repeatedly - * accept() from, and that the child will repeatedly connect() to. + * Create a UNIX domain socket that the child will repeatedly + * accept() from, and that the parent will repeatedly connect() to. */ if ((listenfd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) err(1, "parent: socket error"); @@ -104,13 +104,19 @@ main(int argc, char **argv) servaddr.sun_family = AF_LOCAL; strcpy(servaddr.sun_path, UNIXSTR_PATH); for (counter = 0; counter < LOOPS; counter++) { - if ((connfd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) - err(1, "child: socket error"); + if ((connfd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) { + (void)kill(pid, SIGTERM); + err(1, "parent: socket error"); + } if (connect(connfd, (struct sockaddr *)&servaddr, - sizeof(servaddr)) < 0) - err(1, "child: connect error"); - if (close(connfd) < 0) - err(1, "child: close error"); + sizeof(servaddr)) < 0) { + (void)kill(pid, SIGTERM); + err(1, "parent: connect error"); + } + if (close(connfd) < 0) { + (void)kill(pid, SIGTERM); + err(1, "parent: close error"); + } usleep(USLEEP); } (void)kill(pid, SIGTERM); @@ -122,9 +128,9 @@ main(int argc, char **argv) for ( ; ; ) { if ((connfd = accept(listenfd, (struct sockaddr *)NULL, NULL)) < 0) - err(1, "parent: accept error"); + err(1, "child: accept error"); if (close(connfd) < 0) - err(1, "parent: close error"); + err(1, "child: close error"); } } printf("OK\n"); From owner-svn-src-head@FreeBSD.ORG Thu May 27 18:07:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E0F51065670; Thu, 27 May 2010 18:07:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63EFD8FC16; Thu, 27 May 2010 18:07:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RI7Lew046416; Thu, 27 May 2010 18:07:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RI7L7J046415; Thu, 27 May 2010 18:07:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201005271807.o4RI7L7J046415@svn.freebsd.org> From: John Baldwin Date: Thu, 27 May 2010 18:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208603 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 18:07:21 -0000 Author: jhb Date: Thu May 27 18:07:20 2010 New Revision: 208603 URL: http://svn.freebsd.org/changeset/base/208603 Log: More gracefully handle stale file handles and attributes when opening a file via NFS. Specifically, to satisfy close-to-open-consistency, the NFS client always performs at least one RPC on a file during an open(2) to see if the file has changed. Normally this RPC is an ACCESS or GETATTR RPC that is forced by flushing a file's attribute cache during nfs_open() and then requesting new attributes. However, if the file is noticed to be stale during nfs_open(), the only recourse is to fail the open(2) call with ESTALE. On the other hand, if the ACCESS or GETATTR RPC is sent during nfs_lookup(), then the NFS client can fall back to a LOOKUP RPC to obtain the new file handle in the case that a file has been replaced. This change causes the NFS client to flush the attribute cache during nfs_lookup() when validating a name cache hit if the attributes fetched during nfs_lookup() can be reused in nfs_open(). This allows the client to open a replaced file via the new file handle the first time that it notices a replaced file rather than failing with ESTALE in some cases. Reviewed by: rmacklem, bde Reviewed by: mohans (older version) MFC after: 1 week Modified: head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Thu May 27 15:28:55 2010 (r208602) +++ head/sys/nfsclient/nfs_vnops.c Thu May 27 18:07:20 2010 (r208603) @@ -932,7 +932,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct mbuf *mreq, *mrep, *md, *mb; long len; nfsfh_t *fhp; - struct nfsnode *np; + struct nfsnode *np, *newnp; int error = 0, attrflag, fhsize, ltype; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; @@ -958,10 +958,27 @@ nfs_lookup(struct vop_lookup_args *ap) * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback * to doing a lookup RPC. + * + * To better handle stale file handles and attributes, + * clear the attribute cache of this node if it is a + * leaf component, part of an open() call, and not + * locally modified before fetching the attributes. + * This should allow stale file handles to be detected + * here where we can fall back to a LOOKUP RPC to + * recover rather than having nfs_open() detect the + * stale file handle and failing open(2) with ESTALE. */ newvp = *vpp; - if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred) - && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { + newnp = VTONFS(newvp); + if ((cnp->cn_flags & (ISLASTCN | ISOPEN)) == + (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { + mtx_lock(&newnp->n_mtx); + newnp->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); + mtx_unlock(&newnp->n_mtx); + } + if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && + vattr.va_ctime.tv_sec == newnp->n_ctime) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) From owner-svn-src-head@FreeBSD.ORG Thu May 27 18:33:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 188F1106567A; Thu, 27 May 2010 18:33:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07EF78FC1E; Thu, 27 May 2010 18:33:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RIX0pV052337; Thu, 27 May 2010 18:33:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RIX0bE052335; Thu, 27 May 2010 18:33:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005271833.o4RIX0bE052335@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 27 May 2010 18:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208604 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 18:33:01 -0000 Author: kib Date: Thu May 27 18:33:00 2010 New Revision: 208604 URL: http://svn.freebsd.org/changeset/base/208604 Log: Clarify a potential issue in get_fpcontext() use. MFC after: 1 week Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu May 27 18:07:20 2010 (r208603) +++ head/sys/i386/i386/machdep.c Thu May 27 18:33:00 2010 (r208604) @@ -633,6 +633,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_gs = rgs(); bcopy(regs, &sf.sf_uc.uc_mcontext.mc_fs, sizeof(*regs)); sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ + + /* + * The get_fpcontext() call must be placed before assignments + * to mc_fsbase and mc_gsbase due to the alignment-override + * code in get_fpcontext() that possibly clobbers 12 bytes of + * mcontext after mc_fpstate. + */ get_fpcontext(td, &sf.sf_uc.uc_mcontext); fpstate_drop(td); /* @@ -3240,6 +3247,13 @@ get_mcontext(struct thread *td, mcontext mcp->mc_esp = tp->tf_esp; mcp->mc_ss = tp->tf_ss; mcp->mc_len = sizeof(*mcp); + + /* + * The get_fpcontext() call must be placed before assignments + * to mc_fsbase and mc_gsbase due to the alignment-override + * code in get_fpcontext() that possibly clobbers 12 bytes of + * mcontext after mc_fpstate. + */ get_fpcontext(td, mcp); sdp = &td->td_pcb->pcb_gsd; mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; From owner-svn-src-head@FreeBSD.ORG Thu May 27 22:59:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C805106564A; Thu, 27 May 2010 22:59:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C5218FC12; Thu, 27 May 2010 22:59:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RMxbHD010749; Thu, 27 May 2010 22:59:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RMxbCP010748; Thu, 27 May 2010 22:59:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201005272259.o4RMxbCP010748@svn.freebsd.org> From: Xin LI Date: Thu, 27 May 2010 22:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208605 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 22:59:38 -0000 Author: delphij Date: Thu May 27 22:59:37 2010 New Revision: 208605 URL: http://svn.freebsd.org/changeset/base/208605 Log: Fix build: newnp represents newvp so KDTRACE_NFS_ATTRCACHE_FLUSH_DONE() on newvp instead of vp here. Modified: head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Thu May 27 18:33:00 2010 (r208604) +++ head/sys/nfsclient/nfs_vnops.c Thu May 27 22:59:37 2010 (r208605) @@ -974,7 +974,7 @@ nfs_lookup(struct vop_lookup_args *ap) (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { mtx_lock(&newnp->n_mtx); newnp->n_attrstamp = 0; - KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); mtx_unlock(&newnp->n_mtx); } if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && From owner-svn-src-head@FreeBSD.ORG Fri May 28 01:06:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED1551065674; Fri, 28 May 2010 01:06:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD56D8FC14; Fri, 28 May 2010 01:06:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4S16evN038501; Fri, 28 May 2010 01:06:40 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4S16eSL038499; Fri, 28 May 2010 01:06:40 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201005280106.o4S16eSL038499@svn.freebsd.org> From: Colin Percival Date: Fri, 28 May 2010 01:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208606 - head/crypto/openssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 01:06:41 -0000 Author: cperciva Date: Fri May 28 01:06:40 2010 New Revision: 208606 URL: http://svn.freebsd.org/changeset/base/208606 Log: Fix .Dd line: FreeBSD's mdoc code doesn't understand OpenBSD's $Mdocdate$. MFC after: 3 days Modified: head/crypto/openssh/ssh-pkcs11-helper.8 Modified: head/crypto/openssh/ssh-pkcs11-helper.8 ============================================================================== --- head/crypto/openssh/ssh-pkcs11-helper.8 Thu May 27 22:59:37 2010 (r208605) +++ head/crypto/openssh/ssh-pkcs11-helper.8 Fri May 28 01:06:40 2010 (r208606) @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: February 10 2010 $ +.Dd February 10, 2010 .Dt SSH-PKCS11-HELPER 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Fri May 28 02:00:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF08C106567A; Fri, 28 May 2010 02:00:15 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85E778FC18; Fri, 28 May 2010 02:00:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4S20FRv050178; Fri, 28 May 2010 02:00:15 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4S20F0t050176; Fri, 28 May 2010 02:00:15 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201005280200.o4S20F0t050176@svn.freebsd.org> From: Neel Natu Date: Fri, 28 May 2010 02:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208607 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 02:00:15 -0000 Author: neel Date: Fri May 28 02:00:15 2010 New Revision: 208607 URL: http://svn.freebsd.org/changeset/base/208607 Log: If 'timer2hz' is zero then we don't need to call 'timer2clock()' directly. It will be called automatically by 'timer1clock()'. Do profiling as often as possible by running it as the same frequency as 'timer1hz'. The statistics clock is run as close to 128Hz as possible. Pointed out by: mav@ Modified: head/sys/mips/mips/tick.c Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Fri May 28 01:06:40 2010 (r208606) +++ head/sys/mips/mips/tick.c Fri May 28 02:00:15 2010 (r208607) @@ -127,9 +127,6 @@ void mips_timer_init_params(uint64_t platform_counter_freq, int double_count) { - stathz = hz; - profhz = hz; - /* * XXX: Do not use printf here: uart code 8250 may use DELAY so this * function should be called before cninit. @@ -143,6 +140,17 @@ mips_timer_init_params(uint64_t platform if (double_count != 0) counter_freq /= 2; + /* + * We want to run stathz in the neighborhood of 128hz. We would + * like profhz to run as often as possible, so we let it run on + * each clock tick. We try to honor the requested 'hz' value as + * much as possible. + * + * If 'hz' is above 1500, then we just let the timer + * (and profhz) run at hz. If 'hz' is below 1500 but above + * 750, then we let the timer run at 2 * 'hz'. If 'hz' + * is below 750 then we let the timer run at 4 * 'hz'. + */ if (hz >= 1500) timer1hz = hz; else if (hz >= 750) @@ -150,6 +158,12 @@ mips_timer_init_params(uint64_t platform else timer1hz = hz * 4; + if (timer1hz < 128) + stathz = timer1hz; + else + stathz = timer1hz / (timer1hz / 128); + profhz = timer1hz; + cycles_per_tick = counter_freq / timer1hz; cycles_per_usec = counter_freq / (1 * 1000 * 1000); @@ -285,7 +299,6 @@ clock_intr(void *arg) while (lost_ticks >= cycles_per_tick) { timer1clock(TRAPF_USERMODE(tf), tf->pc); - timer2clock(TRAPF_USERMODE(tf), tf->pc); lost_ticks -= cycles_per_tick; } DPCPU_SET(lost_ticks, lost_ticks); @@ -301,7 +314,6 @@ clock_intr(void *arg) (*cyclic_clock_func[cpu])(tf); #endif timer1clock(TRAPF_USERMODE(tf), tf->pc); - timer2clock(TRAPF_USERMODE(tf), tf->pc); critical_exit(); return (FILTER_HANDLED); } From owner-svn-src-head@FreeBSD.ORG Fri May 28 05:34:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4149F1065680; Fri, 28 May 2010 05:34:44 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 308278FC1D; Fri, 28 May 2010 05:34:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4S5Yibu097231; Fri, 28 May 2010 05:34:44 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4S5Yi4p097229; Fri, 28 May 2010 05:34:44 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201005280534.o4S5Yi4p097229@svn.freebsd.org> From: Neel Natu Date: Fri, 28 May 2010 05:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208608 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 05:34:44 -0000 Author: neel Date: Fri May 28 05:34:43 2010 New Revision: 208608 URL: http://svn.freebsd.org/changeset/base/208608 Log: Get rid of unused variable 'virtual_sys_start'. Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri May 28 02:00:15 2010 (r208607) +++ head/sys/mips/mips/pmap.c Fri May 28 05:34:43 2010 (r208608) @@ -211,7 +211,6 @@ struct local_sysmaps { * bit mode this goes away. */ static struct local_sysmaps sysmap_lmem[MAXCPU]; -caddr_t virtual_sys_start = (caddr_t)0; #define PMAP_LMEM_MAP1(va, phys) \ int cpu; \ @@ -443,7 +442,7 @@ again: PMAP_LGMEM_LOCK_INIT(&sysmap_lmem[i]); } } - virtual_sys_start = (caddr_t)virtual_avail; + /* * Allocate segment table for the kernel */ From owner-svn-src-head@FreeBSD.ORG Fri May 28 06:49:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F1BB1065670; Fri, 28 May 2010 06:49:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 541458FC08; Fri, 28 May 2010 06:49:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4S6nvM5013755; Fri, 28 May 2010 06:49:57 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4S6nvYg013752; Fri, 28 May 2010 06:49:57 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005280649.o4S6nvYg013752@svn.freebsd.org> From: Alan Cox Date: Fri, 28 May 2010 06:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208609 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 06:49:57 -0000 Author: alc Date: Fri May 28 06:49:57 2010 New Revision: 208609 URL: http://svn.freebsd.org/changeset/base/208609 Log: Defer freeing any page table pages in pmap_remove_all() until after the page queues lock is released. This may reduce the amount of time that the page queues lock is held by pmap_remove_all(). Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri May 28 05:34:43 2010 (r208608) +++ head/sys/amd64/amd64/pmap.c Fri May 28 06:49:57 2010 (r208609) @@ -2796,6 +2796,7 @@ pmap_remove_all(vm_page_t m) KASSERT((m->flags & PG_FICTITIOUS) == 0, ("pmap_remove_all: page %p is fictitious", m)); + free = NULL; vm_page_lock_queues(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) { @@ -2825,16 +2826,15 @@ pmap_remove_all(vm_page_t m) */ if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); - free = NULL; pmap_unuse_pt(pmap, pv->pv_va, *pde, &free); pmap_invalidate_page(pmap, pv->pv_va); - pmap_free_zero_pages(free); TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } vm_page_flag_clear(m, PG_WRITEABLE); vm_page_unlock_queues(); + pmap_free_zero_pages(free); } /* Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri May 28 05:34:43 2010 (r208608) +++ head/sys/i386/i386/pmap.c Fri May 28 06:49:57 2010 (r208609) @@ -2900,6 +2900,7 @@ pmap_remove_all(vm_page_t m) KASSERT((m->flags & PG_FICTITIOUS) == 0, ("pmap_remove_all: page %p is fictitious", m)); + free = NULL; vm_page_lock_queues(); sched_pin(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -2930,10 +2931,8 @@ pmap_remove_all(vm_page_t m) */ if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); - free = NULL; pmap_unuse_pt(pmap, pv->pv_va, &free); pmap_invalidate_page(pmap, pv->pv_va); - pmap_free_zero_pages(free); TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); @@ -2941,6 +2940,7 @@ pmap_remove_all(vm_page_t m) vm_page_flag_clear(m, PG_WRITEABLE); sched_unpin(); vm_page_unlock_queues(); + pmap_free_zero_pages(free); } /* From owner-svn-src-head@FreeBSD.ORG Fri May 28 07:34:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABCA81065672; Fri, 28 May 2010 07:34:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A0208FC23; Fri, 28 May 2010 07:34:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4S7YKpT023583; Fri, 28 May 2010 07:34:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4S7YKFB023581; Fri, 28 May 2010 07:34:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201005280734.o4S7YKFB023581@svn.freebsd.org> From: Andriy Gapon Date: Fri, 28 May 2010 07:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208610 - head/sys/boot/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 07:34:20 -0000 Author: avg Date: Fri May 28 07:34:20 2010 New Revision: 208610 URL: http://svn.freebsd.org/changeset/base/208610 Log: boot/zfs: fix gang block reading code - use correct size (512) while reading a gang block - skip holes while reading child blocks - advance buffer pointer while reading child blocks PR: 144214 MFC after: 10 days Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Fri May 28 06:49:57 2010 (r208609) +++ head/sys/boot/zfs/zfsimpl.c Fri May 28 07:34:20 2010 (r208610) @@ -958,12 +958,17 @@ zio_read_gang(spa_t *spa, const blkptr_t break; if (!vdev || !vdev->v_read) return (EIO); - if (vdev->v_read(vdev, bp, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE)) return (EIO); for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { - if (zio_read(spa, &zio_gb.zg_blkptr[i], buf)) + blkptr_t *gbp = &zio_gb.zg_blkptr[i]; + + if (BP_IS_HOLE(gbp)) + continue; + if (zio_read(spa, gbp, buf)) return (EIO); + buf = (char*)buf + BP_GET_PSIZE(gbp); } return (0); @@ -994,9 +999,8 @@ zio_read(spa_t *spa, const blkptr_t *bp, continue; if (DVA_GET_GANG(dva)) { - printf("ZFS: gang block detected!\n"); if (zio_read_gang(spa, bp, dva, buf)) - return (EIO); + continue; } else { vdevid = DVA_GET_VDEV(dva); offset = DVA_GET_OFFSET(dva); From owner-svn-src-head@FreeBSD.ORG Fri May 28 09:26:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B6AC106567B; Fri, 28 May 2010 09:26:54 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59CCB8FC08; Fri, 28 May 2010 09:26:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4S9Qsch048475; Fri, 28 May 2010 09:26:54 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4S9QsWC048472; Fri, 28 May 2010 09:26:54 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201005280926.o4S9QsWC048472@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 28 May 2010 09:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208611 - in head/contrib/nvi: docs ex X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 09:26:54 -0000 Author: jh Date: Fri May 28 09:26:53 2010 New Revision: 208611 URL: http://svn.freebsd.org/changeset/base/208611 Log: Fix misspelling of "substitution". PR: bin/130874 Submitted by: Yoshihiro Ota Modified: head/contrib/nvi/docs/help head/contrib/nvi/ex/ex_cmd.c Modified: head/contrib/nvi/docs/help ============================================================================== --- head/contrib/nvi/docs/help Fri May 28 07:34:20 2010 (r208610) +++ head/contrib/nvi/docs/help Fri May 28 09:26:53 2010 (r208611) @@ -129,7 +129,7 @@ EX COMMANDS: ^D: scroll lines !: filter lines through commands or run commands #: display numbered lines - &: repeat the last subsitution + &: repeat the last substitution *: execute a buffer <: shift lines left =: display line number Modified: head/contrib/nvi/ex/ex_cmd.c ============================================================================== --- head/contrib/nvi/ex/ex_cmd.c Fri May 28 07:34:20 2010 (r208610) +++ head/contrib/nvi/ex/ex_cmd.c Fri May 28 09:26:53 2010 (r208611) @@ -68,7 +68,7 @@ EXCMDLIST const cmds[] = { {"&", ex_subagain, E_ADDR2, "s", "[line [,line]] & [cgr] [count] [#lp]", - "repeat the last subsitution"}, + "repeat the last substitution"}, /* C_STAR */ {"*", ex_at, 0, "b", From owner-svn-src-head@FreeBSD.ORG Fri May 28 09:30:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB2671065675; Fri, 28 May 2010 09:30:13 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B90188FC08; Fri, 28 May 2010 09:30:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4S9UDCa049237; Fri, 28 May 2010 09:30:13 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4S9UDV3049234; Fri, 28 May 2010 09:30:13 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201005280930.o4S9UDV3049234@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 28 May 2010 09:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208612 - head/contrib/nvi/vi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 09:30:14 -0000 Author: jh Date: Fri May 28 09:30:13 2010 New Revision: 208612 URL: http://svn.freebsd.org/changeset/base/208612 Log: Fixes from NetBSD for nvi visual mode: - Fix handling of ^@ when reading an ex command. Don't try to replay the previous input. - Fix handling of ^C in insert mode and when reading an ex command. Repeating an interrupted input could cause a crash and interrupting ex command input could cause a file corruption. - Fix a bug which causes crashes in file name completion when a file name is longer than the screen width. - When an error occurs in v_txt(), leave the input mode. PR: bin/21089, bin/136393 Obtained from: NetBSD Modified: head/contrib/nvi/vi/v_ex.c head/contrib/nvi/vi/v_txt.c Modified: head/contrib/nvi/vi/v_ex.c ============================================================================== --- head/contrib/nvi/vi/v_ex.c Fri May 28 09:26:53 2010 (r208611) +++ head/contrib/nvi/vi/v_ex.c Fri May 28 09:30:13 2010 (r208612) @@ -428,6 +428,10 @@ v_ex(sp, vp) if (tp->term == TERM_BS) break; + /* If the user changed their mind, return. */ + if (tp->term != TERM_OK) + break; + /* Log the command. */ if (O_STR(sp, O_CEDIT) != NULL && v_ecl_log(sp, tp)) return (1); Modified: head/contrib/nvi/vi/v_txt.c ============================================================================== --- head/contrib/nvi/vi/v_txt.c Fri May 28 09:26:53 2010 (r208611) +++ head/contrib/nvi/vi/v_txt.c Fri May 28 09:30:13 2010 (r208612) @@ -510,15 +510,6 @@ next: if (v_event_get(sp, evp, 0, ec_fla case E_EOF: F_SET(sp, SC_EXIT_FORCE); return (1); - case E_INTERRUPT: - /* - * !!! - * Historically, exited the user from text input - * mode or cancelled a colon command, and returned to command - * mode. It also beeped the terminal, but that seems a bit - * excessive. - */ - goto k_escape; case E_REPAINT: if (vs_repaint(sp, &ev)) return (1); @@ -526,10 +517,37 @@ next: if (v_event_get(sp, evp, 0, ec_fla case E_WRESIZE: /* interrupts the input mode. */ v_emsg(sp, NULL, VIM_WRESIZE); - goto k_escape; + /* FALLTHROUGH */ default: - v_event_err(sp, evp); - goto k_escape; + if (evp->e_event != E_INTERRUPT && evp->e_event != E_WRESIZE) + v_event_err(sp, evp); + /* + * !!! + * Historically, exited the user from text input + * mode or cancelled a colon command, and returned to command + * mode. It also beeped the terminal, but that seems a bit + * excessive. + */ + /* + * If we are recording, morph into key so that + * we can repeat the command safely: there is no way to + * invalidate the repetition of an instance of a command, + * which would be the alternative possibility. + * If we are not recording (most likely on the command line), + * simply discard the input and return to command mode + * so that an INTERRUPT doesn't become for example a file + * completion request. -aymeric + */ + if (LF_ISSET(TXT_RECORD)) { + evp->e_event = E_CHARACTER; + evp->e_c = 033; + evp->e_flags = 0; + evp->e_value = K_ESCAPE; + break; + } else { + tp->term = TERM_ESC; + goto k_escape; + } } /* @@ -539,7 +557,7 @@ next: if (v_event_get(sp, evp, 0, ec_fla * This was not documented as far as I know, and is a great test of vi * clones. */ - if (rcol == 0 && !LF_ISSET(TXT_REPLAY) && evp->e_c == '\0') { + if (LF_ISSET(TXT_RECORD) && rcol == 0 && evp->e_c == '\0') { if (vip->rep == NULL) goto done; @@ -1456,6 +1474,7 @@ done: /* Leave input mode. */ err: alloc_err: + F_CLR(sp, SC_TINPUT); txt_err(sp, &sp->tiq); return (1); } @@ -2216,8 +2235,8 @@ txt_fc_col(sp, argc, argv) /* If the largest file name is too large, just print them. */ if (colwidth > sp->cols) { - p = msg_print(sp, av[0]->bp + prefix, &nf); for (ac = argc, av = argv; ac > 0; --ac, ++av) { + p = msg_print(sp, av[0]->bp + prefix, &nf); (void)ex_printf(sp, "%s\n", p); if (F_ISSET(gp, G_INTERRUPTED)) break; From owner-svn-src-head@FreeBSD.ORG Fri May 28 10:35:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D857F1065678; Fri, 28 May 2010 10:35:44 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C82CD8FC1B; Fri, 28 May 2010 10:35:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SAZiHt066746; Fri, 28 May 2010 10:35:44 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SAZiOm066744; Fri, 28 May 2010 10:35:44 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005281035.o4SAZiOm066744@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 28 May 2010 10:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208613 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 10:35:44 -0000 Author: raj Date: Fri May 28 10:35:44 2010 New Revision: 208613 URL: http://svn.freebsd.org/changeset/base/208613 Log: Introduce kernel build options for the Flattened Device Tree support. Reviewed by: imp Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri May 28 09:30:13 2010 (r208612) +++ head/sys/conf/options Fri May 28 10:35:44 2010 (r208613) @@ -848,3 +848,7 @@ SND_PCM_64 opt_snd.h SND_OLDSTEREO opt_snd.h X86BIOS + +# Flattened device tree options +FDT opt_platform.h +FDT_DTB_STATIC opt_platform.h From owner-svn-src-head@FreeBSD.ORG Fri May 28 10:43:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93D7A1065697; Fri, 28 May 2010 10:43:56 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8228C8FC0A; Fri, 28 May 2010 10:43:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SAhud8068973; Fri, 28 May 2010 10:43:56 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SAhuam068965; Fri, 28 May 2010 10:43:56 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005281043.o4SAhuam068965@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 28 May 2010 10:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208614 - in head/sys: dev/ofw powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 10:43:56 -0000 Author: raj Date: Fri May 28 10:43:56 2010 New Revision: 208614 URL: http://svn.freebsd.org/changeset/base/208614 Log: Prepare and extend OFW layer for FDT support. o Let OFW_INIT() and OF_init() return status value. o Provide helper routines for 'compatible' property handling. o Only compile OF and OFW code, which is relevant in FDT scenario. o Other minor cosmetics Reviewed by: imp Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/ofw/ofw_if.m head/sys/dev/ofw/ofw_standard.c head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h head/sys/powerpc/ofw/ofw_real.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Fri May 28 10:35:44 2010 (r208613) +++ head/sys/dev/ofw/ofw_bus_subr.c Fri May 28 10:43:56 2010 (r208614) @@ -30,6 +30,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" #include #include #include @@ -146,6 +147,53 @@ ofw_bus_gen_get_type(device_t bus, devic return (obd->obd_type); } +int +ofw_bus_is_compatible(device_t dev, const char *onecompat) +{ + phandle_t node; + const char *compat; + int len, onelen, l; + + if ((compat = ofw_bus_get_compat(dev)) == NULL) + return (0); + + if ((node = ofw_bus_get_node(dev)) == 0) + return (0); + + /* Get total 'compatible' prop len */ + if ((len = OF_getproplen(node, "compatible")) <= 0) + return (0); + + onelen = strlen(onecompat); + + while (len > 0) { + if (strncasecmp(compat, onecompat, onelen) == 0) + /* Found it. */ + return (1); + + /* Slide to the next sub-string. */ + l = strlen(compat) + 1; + compat += l; + len -= l; + } + return (0); +} + +int +ofw_bus_is_compatible_strict(device_t dev, const char *compatible) +{ + const char *compat; + + if ((compat = ofw_bus_get_compat(dev)) == NULL) + return (0); + + if (strncasecmp(compat, compatible, strlen(compatible)) == 0) + return (1); + + return (0); +} + +#ifndef FDT void ofw_bus_setup_iinfo(phandle_t node, struct ofw_bus_iinfo *ii, int intrsz) { @@ -262,3 +310,4 @@ ofw_bus_search_intrmap(void *intr, int i } return (0); } +#endif /* !FDT */ Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Fri May 28 10:35:44 2010 (r208613) +++ head/sys/dev/ofw/ofw_bus_subr.h Fri May 28 10:43:56 2010 (r208614) @@ -67,4 +67,8 @@ int ofw_bus_lookup_imap(phandle_t, struc int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int); +/* Helper routine for checking compat prop */ +int ofw_bus_is_compatible(device_t, const char *); +int ofw_bus_is_compatible_strict(device_t, const char *); + #endif /* !_DEV_OFW_OFW_BUS_SUBR_H_ */ Modified: head/sys/dev/ofw/ofw_if.m ============================================================================== --- head/sys/dev/ofw/ofw_if.m Fri May 28 10:35:44 2010 (r208613) +++ head/sys/dev/ofw/ofw_if.m Fri May 28 10:43:56 2010 (r208614) @@ -43,7 +43,7 @@ INTERFACE ofw; * @param _cookie A handle to the client interface, generally the OF * callback routine. */ -METHOD void init { +METHOD int init { ofw_t _ofw; void *_cookie; }; Modified: head/sys/dev/ofw/ofw_standard.c ============================================================================== --- head/sys/dev/ofw/ofw_standard.c Fri May 28 10:35:44 2010 (r208613) +++ head/sys/dev/ofw/ofw_standard.c Fri May 28 10:43:56 2010 (r208614) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); #include "ofw_if.h" -static void ofw_std_init(ofw_t ofw, void *openfirm); +static int ofw_std_init(ofw_t ofw, void *openfirm); static int ofw_std_test(ofw_t ofw, const char *name); static int ofw_std_interpret(ofw_t ofw, const char *cmd, int nreturns, unsigned long *returns); @@ -150,11 +150,12 @@ static int (*openfirmware)(void *); /* Initializer */ -static void +static int ofw_std_init(ofw_t ofw, void *openfirm) { openfirmware = (int (*)(void *))openfirm; + return (0); } /* Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Fri May 28 10:35:44 2010 (r208613) +++ head/sys/dev/ofw/openfirm.c Fri May 28 10:43:56 2010 (r208614) @@ -58,6 +58,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -110,10 +112,11 @@ OF_install(char *name, int prio) } /* Initializer */ -void +int OF_init(void *cookie) { phandle_t chosen; + int rv; ofw_obj = &ofw_kernel_obj; /* @@ -123,14 +126,16 @@ OF_init(void *cookie) kobj_class_compile_static(ofw_def_impl, &ofw_kernel_kops); kobj_init((kobj_t)ofw_obj, ofw_def_impl); - OFW_INIT(ofw_obj, cookie); + rv = OFW_INIT(ofw_obj, cookie); + + if ((chosen = OF_finddevice("/chosen")) > 0) + if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) + stdout = -1; - if ((chosen = OF_finddevice("/chosen")) == -1) - OF_exit(); - if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) - stdout = -1; + return (rv); } +#ifndef FDT void OF_printf(const char *fmt, ...) { @@ -154,6 +159,7 @@ OF_test(const char *name) return (OFW_TEST(ofw_obj, name)); } +#endif int OF_interpret(const char *cmd, int nreturns, ...) @@ -228,7 +234,7 @@ OF_getprop(phandle_t package, const char } /* - * Resursively search the node and its parent for the given property, working + * Recursively search the node and its parent for the given property, working * downward from the node to the device tree root. Returns the value of the * first match. */ @@ -315,6 +321,7 @@ OF_package_to_path(phandle_t package, ch return (OFW_PACKAGE_TO_PATH(ofw_obj, package, buf, len)); } +#ifndef FDT /* Call the method in the scope of a given instance. */ int OF_call_method(const char *method, ihandle_t instance, int nargs, int nreturns, @@ -428,3 +435,4 @@ OF_exit() for (;;) /* just in case */ ; } +#endif Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Fri May 28 10:35:44 2010 (r208613) +++ head/sys/dev/ofw/openfirm.h Fri May 28 10:43:56 2010 (r208614) @@ -83,7 +83,7 @@ MALLOC_DECLARE(M_OFWPROP); */ boolean_t OF_install(char *name, int prio); -void OF_init(void *cookie); +int OF_init(void *cookie); /* * Known Open Firmware interface names Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Fri May 28 10:35:44 2010 (r208613) +++ head/sys/powerpc/ofw/ofw_real.c Fri May 28 10:43:56 2010 (r208614) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include "ofw_if.h" -static void ofw_real_init(ofw_t, void *openfirm); +static int ofw_real_init(ofw_t, void *openfirm); static int ofw_real_test(ofw_t, const char *name); static phandle_t ofw_real_peer(ofw_t, phandle_t node); static phandle_t ofw_real_child(ofw_t, phandle_t node); @@ -256,13 +256,14 @@ ofw_real_unmap(cell_t physaddr, void *bu /* Initialiser */ -static void +static int ofw_real_init(ofw_t ofw, void *openfirm) { openfirmware = (int (*)(void *))openfirm; mtx_init(&of_bounce_mtx, "OF Bounce Page", MTX_DEF, 0); of_bounce_virt = NULL; + return (0); } /* From owner-svn-src-head@FreeBSD.ORG Fri May 28 10:51:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A31106566B; Fri, 28 May 2010 10:51:45 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340158FC0A; Fri, 28 May 2010 10:51:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SApjMO071248; Fri, 28 May 2010 10:51:45 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SApjg4071246; Fri, 28 May 2010 10:51:45 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005281051.o4SApjg4071246@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 28 May 2010 10:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208615 - head/sys/dev/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 10:51:45 -0000 Author: raj Date: Fri May 28 10:51:44 2010 New Revision: 208615 URL: http://svn.freebsd.org/changeset/base/208615 Log: Initial implementation of the OFW i/f methods for FDT back-end. Reviewed by: imp Sponsored by: The FreeBSD Foundation Added: head/sys/dev/ofw/ofw_fdt.c (contents, props changed) Added: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofw_fdt.c Fri May 28 10:51:44 2010 (r208615) @@ -0,0 +1,458 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#include "ofw_if.h" + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +static int ofw_fdt_init(ofw_t, void *); +static phandle_t ofw_fdt_peer(ofw_t, phandle_t); +static phandle_t ofw_fdt_child(ofw_t, phandle_t); +static phandle_t ofw_fdt_parent(ofw_t, phandle_t); +static phandle_t ofw_fdt_instance_to_package(ofw_t, ihandle_t); +static ssize_t ofw_fdt_getproplen(ofw_t, phandle_t, const char *); +static ssize_t ofw_fdt_getprop(ofw_t, phandle_t, const char *, void *, size_t); +static int ofw_fdt_nextprop(ofw_t, phandle_t, const char *, char *, size_t); +static int ofw_fdt_setprop(ofw_t, phandle_t, const char *, const void *, + size_t); +static ssize_t ofw_fdt_canon(ofw_t, const char *, char *, size_t); +static phandle_t ofw_fdt_finddevice(ofw_t, const char *); +static ssize_t ofw_fdt_instance_to_path(ofw_t, ihandle_t, char *, size_t); +static ssize_t ofw_fdt_package_to_path(ofw_t, phandle_t, char *, size_t); +static int ofw_fdt_interpret(ofw_t, const char *, int, unsigned long *); + +static ofw_method_t ofw_fdt_methods[] = { + OFWMETHOD(ofw_init, ofw_fdt_init), + OFWMETHOD(ofw_peer, ofw_fdt_peer), + OFWMETHOD(ofw_child, ofw_fdt_child), + OFWMETHOD(ofw_parent, ofw_fdt_parent), + OFWMETHOD(ofw_instance_to_package, ofw_fdt_instance_to_package), + OFWMETHOD(ofw_getproplen, ofw_fdt_getproplen), + OFWMETHOD(ofw_getprop, ofw_fdt_getprop), + OFWMETHOD(ofw_nextprop, ofw_fdt_nextprop), + OFWMETHOD(ofw_setprop, ofw_fdt_setprop), + OFWMETHOD(ofw_canon, ofw_fdt_canon), + OFWMETHOD(ofw_finddevice, ofw_fdt_finddevice), + OFWMETHOD(ofw_instance_to_path, ofw_fdt_instance_to_path), + OFWMETHOD(ofw_package_to_path, ofw_fdt_package_to_path), + OFWMETHOD(ofw_interpret, ofw_fdt_interpret), + { 0, 0 } +}; + +static ofw_def_t ofw_fdt = { + OFW_FDT, + ofw_fdt_methods, + 0 +}; +OFW_DEF(ofw_fdt); + +static void *fdtp = NULL; + +static int +ofw_fdt_init(ofw_t ofw, void *data) +{ + int err; + + /* Check FDT blob integrity */ + if ((err = fdt_check_header(data)) != 0) + return (err); + + fdtp = data; + return (0); +} + +/* + * Device tree functions + */ + +static int +fdt_phandle_offset(phandle_t p) +{ + const char *dt_struct; + int offset; + + dt_struct = (const char *)fdtp + fdt_off_dt_struct(fdtp); + + if (((const char *)p < dt_struct) || + (const char *)p > (dt_struct + fdt_size_dt_struct(fdtp))) + return (-1); + + offset = (const char *)p - dt_struct; + if (offset < 0) + return (-1); + + return (offset); +} + +/* Return the next sibling of this node or 0. */ +static phandle_t +ofw_fdt_peer(ofw_t ofw, phandle_t node) +{ + phandle_t p; + int depth, offset; + + if (node == 0) { + /* Find root node */ + offset = fdt_path_offset(fdtp, "/"); + p = (phandle_t)fdt_offset_ptr(fdtp, offset, sizeof(p)); + + return (p); + } + + offset = fdt_phandle_offset(node); + if (offset < 0) + return (0); + + for (depth = 1, offset = fdt_next_node(fdtp, offset, &depth); + offset >= 0; + offset = fdt_next_node(fdtp, offset, &depth)) { + if (depth < 0) + return (0); + if (depth == 1) { + p = (phandle_t)fdt_offset_ptr(fdtp, offset, sizeof(p)); + return (p); + } + } + + return (0); +} + +/* Return the first child of this node or 0. */ +static phandle_t +ofw_fdt_child(ofw_t ofw, phandle_t node) +{ + phandle_t p; + int depth, offset; + + offset = fdt_phandle_offset(node); + if (offset < 0) + return (0); + + for (depth = 0, offset = fdt_next_node(fdtp, offset, &depth); + (offset >= 0) && (depth > 0); + offset = fdt_next_node(fdtp, offset, &depth)) { + if (depth < 0) + return (0); + if (depth == 1) { + p = (phandle_t)fdt_offset_ptr(fdtp, offset, sizeof(p)); + return (p); + } + } + + return (0); +} + +/* Return the parent of this node or 0. */ +static phandle_t +ofw_fdt_parent(ofw_t ofw, phandle_t node) +{ + phandle_t p; + int offset, paroffset; + + offset = fdt_phandle_offset(node); + if (offset < 0) + return (0); + + paroffset = fdt_parent_offset(fdtp, offset); + p = (phandle_t)fdt_offset_ptr(fdtp, paroffset, sizeof(phandle_t)); + return (p); +} + +/* Return the package handle that corresponds to an instance handle. */ +static phandle_t +ofw_fdt_instance_to_package(ofw_t ofw, ihandle_t instance) +{ + phandle_t p; + int offset; + + /* + * Note: FDT does not have the notion of instances, but we somewhat + * abuse the semantics and let treat as 'instance' the internal + * 'phandle' prop, so that ofw I/F consumers have a uniform way of + * translation between internal representation (which appear in some + * contexts as property values) and effective phandles. + */ + offset = fdt_node_offset_by_phandle(fdtp, instance); + if (offset < 0) + return (0); + + p = (phandle_t)fdt_offset_ptr(fdtp, offset, sizeof(phandle_t)); + return (p); +} + +/* Get the length of a property of a package. */ +static ssize_t +ofw_fdt_getproplen(ofw_t ofw, phandle_t package, const char *propname) +{ + const struct fdt_property *prop; + int offset, len; + + offset = fdt_phandle_offset(package); + if (offset < 0) + return (0); + + if (strcmp(propname, "name") == 0) { + /* Emulate the 'name' property */ + fdt_get_name(fdtp, offset, &len); + return (len + 1); + } + + len = 0; + prop = fdt_get_property(fdtp, offset, propname, &len); + + return (len); +} + +/* Get the value of a property of a package. */ +static ssize_t +ofw_fdt_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf, + size_t buflen) +{ + const void *prop; + const char *name; + int len, offset; + + offset = fdt_phandle_offset(package); + if (offset < 0) + return (0); + + if (strcmp(propname, "name") == 0) { + /* Emulate the 'name' property */ + name = fdt_get_name(fdtp, offset, &len); + strncpy(buf, name, buflen); + if (len + 1 > buflen) + len = buflen; + return (len + 1); + } + + prop = fdt_getprop(fdtp, offset, propname, &len); + if (prop == NULL) + return (0); + + if (len > buflen) + len = buflen; + bcopy(prop, buf, len); + return (len); +} + +static int +fdt_nextprop(int offset, char *buf, size_t size) +{ + const struct fdt_property *prop; + const char *name; + uint32_t tag; + int nextoffset, depth; + + depth = 0; + tag = fdt_next_tag(fdtp, offset, &nextoffset); + + /* Find the next prop */ + do { + offset = nextoffset; + tag = fdt_next_tag(fdtp, offset, &nextoffset); + + if (tag == FDT_BEGIN_NODE) + depth++; + else if (tag == FDT_END_NODE) + depth--; + else if ((tag == FDT_PROP) && (depth == 0)) { + prop = + (const struct fdt_property *)fdt_offset_ptr(fdtp, + offset, sizeof(*prop)); + name = fdt_string(fdtp, + fdt32_to_cpu(prop->nameoff)); + strncpy(buf, name, size); + return (strlen(name)); + } else + depth = -1; + } while (depth >= 0); + + return (0); +} + +/* + * Get the next property of a package. Return the actual len of retrieved + * prop name. + */ +static int +ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, + size_t size) +{ + const struct fdt_property *prop; + int offset, rv; + + offset = fdt_phandle_offset(package); + if (offset < 0) + return (0); + + if (previous == NULL) + /* Find the first prop in the node */ + return (fdt_nextprop(offset, buf, size)); + + /* + * Advance to the previous prop + */ + prop = fdt_get_property(fdtp, offset, previous, NULL); + if (prop == NULL) + return (0); + + offset = fdt_phandle_offset((phandle_t)prop); + rv = fdt_nextprop(offset, buf, size); + return (rv); +} + +/* Set the value of a property of a package. */ +static int +ofw_fdt_setprop(ofw_t ofw, phandle_t package, const char *propname, + const void *buf, size_t len) +{ + int offset; + + offset = fdt_phandle_offset(package); + if (offset < 0) + return (-1); + + return (fdt_setprop_inplace(fdtp, offset, propname, buf, len)); +} + +/* Convert a device specifier to a fully qualified pathname. */ +static ssize_t +ofw_fdt_canon(ofw_t ofw, const char *device, char *buf, size_t len) +{ + + return (-1); +} + +/* Return a package handle for the specified device. */ +static phandle_t +ofw_fdt_finddevice(ofw_t ofw, const char *device) +{ + phandle_t p; + int offset; + + offset = fdt_path_offset(fdtp, device); + + p = (phandle_t)fdt_offset_ptr(fdtp, offset, sizeof(p)); + + return (p); +} + +/* Return the fully qualified pathname corresponding to an instance. */ +static ssize_t +ofw_fdt_instance_to_path(ofw_t ofw, ihandle_t instance, char *buf, size_t len) +{ + + return (-1); +} + +/* Return the fully qualified pathname corresponding to a package. */ +static ssize_t +ofw_fdt_package_to_path(ofw_t ofw, phandle_t package, char *buf, size_t len) +{ + + return (-1); +} + +static int +ofw_fdt_fixup(ofw_t ofw) +{ +#define FDT_MODEL_LEN 80 + char model[FDT_MODEL_LEN]; + phandle_t root; + ssize_t len; + int i; + + if ((root = ofw_fdt_finddevice(ofw, "/")) == 0) + return (ENODEV); + + if ((len = ofw_fdt_getproplen(ofw, root, "model")) <= 0) + return (0); + + bzero(model, FDT_MODEL_LEN); + if (ofw_fdt_getprop(ofw, root, "model", model, FDT_MODEL_LEN) <= 0) + return (0); + + /* + * Search fixup table and call handler if appropriate. + */ + for (i = 0; fdt_fixup_table[i].model != NULL; i++) { + if (strncmp(model, fdt_fixup_table[i].model, + FDT_MODEL_LEN) != 0) + continue; + + if (fdt_fixup_table[i].handler != NULL) + (*fdt_fixup_table[i].handler)(root); + } + + return (0); +} + +static int +ofw_fdt_interpret(ofw_t ofw, const char *cmd, int nret, unsigned long *retvals) +{ + int rv; + + /* + * Note: FDT does not have the possibility to 'interpret' commands, + * but we abuse the interface a bit to use it for doing non-standard + * operations on the device tree blob. + * + * Currently the only supported 'command' is to trigger performing + * fixups. + */ + if (strncmp("perform-fixup", cmd, 13) != 0) + return (0); + + rv = ofw_fdt_fixup(ofw); + if (nret > 0) + retvals[0] = rv; + + return (rv); +} From owner-svn-src-head@FreeBSD.ORG Fri May 28 12:05:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08079106566C; Fri, 28 May 2010 12:05:57 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB8B68FC12; Fri, 28 May 2010 12:05:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SC5u2M087604; Fri, 28 May 2010 12:05:56 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SC5uPN087602; Fri, 28 May 2010 12:05:56 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201005281205.o4SC5uPN087602@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 28 May 2010 12:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208616 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 12:05:57 -0000 Author: jchandra Date: Fri May 28 12:05:56 2010 New Revision: 208616 URL: http://svn.freebsd.org/changeset/base/208616 Log: Fix lock order reversal, unlock page queue and pmap locks before calling uma_zfree(). Also if needed, acquire page queue lock before modifying pte page attributes. Approved by: rrs (mentor) Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri May 28 10:51:44 2010 (r208615) +++ head/sys/mips/mips/pmap.c Fri May 28 12:05:56 2010 (r208616) @@ -885,8 +885,12 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_pa /* * If the page is finally unwired, simply free it. */ - pmap_release_pte_page(m); atomic_subtract_int(&cnt.v_wire_count, 1); + PMAP_UNLOCK(pmap); + vm_page_unlock_queues(); + pmap_release_pte_page(m); + vm_page_lock_queues(); + PMAP_LOCK(pmap); return (1); } @@ -1007,9 +1011,14 @@ pmap_alloc_pte_page(pmap_t pmap, unsigne paddr = MIPS_KSEG0_TO_PHYS(va); m = PHYS_TO_VM_PAGE(paddr); + if (!locked) + vm_page_lock_queues(); m->pindex = index; m->valid = VM_PAGE_BITS_ALL; m->wire_count = 1; + if (!locked) + vm_page_unlock_queues(); + atomic_add_int(&cnt.v_wire_count, 1); *vap = (vm_offset_t)va; return (m); From owner-svn-src-head@FreeBSD.ORG Fri May 28 16:57:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 855221065679; Fri, 28 May 2010 16:57:58 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id E876D8FC14; Fri, 28 May 2010 16:57:57 +0000 (UTC) Received: by vws12 with SMTP id 12so1493123vws.13 for ; Fri, 28 May 2010 09:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=A1QDlK8lif9rHBpj1e1cMipQ/33WbrZDtUI9WNhsoVs=; b=V5Q/MNAsN4y8Qj4C/NTy+sjBl9TNTPeB0YS5xy552XB1RVtgTSDdYLBCPC2plS8sap epw8nB4RQdqXppGHiZxJ47JFtvo4wF2EmBPxh2n76Raq2yM7UIBgmSH63cHqCa27BOpC LE6Rl6385YZzTTqJJn0tBgvmz3XCBiaqIeg2o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=pm4B6oqdkyb0pFYPQG2ekj9re4178n+xcVY3ns4E14NleDpQZDLgICVf+gfictZrnj SmyGVNfiSUK6HbpkxMHuuZXO2ktlE+omav6KISU5TGlxZNOywSGNbu6cfyZB9lxEibo8 mCSIh2v7lOLt3CPCf+2qiiLtBSecOxpuuoZvQ= MIME-Version: 1.0 Received: by 10.224.53.131 with SMTP id m3mr350996qag.266.1275065876969; Fri, 28 May 2010 09:57:56 -0700 (PDT) Received: by 10.229.190.83 with HTTP; Fri, 28 May 2010 09:57:56 -0700 (PDT) In-Reply-To: <201005281035.o4SAZiOm066744@svn.freebsd.org> References: <201005281035.o4SAZiOm066744@svn.freebsd.org> Date: Fri, 28 May 2010 09:57:56 -0700 Message-ID: From: Garrett Cooper To: Rafal Jaworowski Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208613 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 16:57:58 -0000 On Fri, May 28, 2010 at 3:35 AM, Rafal Jaworowski wrote: > Author: raj > Date: Fri May 28 10:35:44 2010 > New Revision: 208613 > URL: http://svn.freebsd.org/changeset/base/208613 > > Log: > =A0Introduce kernel build options for the Flattened Device Tree support. > > =A0Reviewed by: =A0imp > =A0Sponsored by: The FreeBSD Foundation > > Modified: > =A0head/sys/conf/options > > Modified: head/sys/conf/options > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/conf/options =A0 =A0 =A0 Fri May 28 09:30:13 2010 =A0 =A0 = =A0 =A0(r208612) > +++ head/sys/conf/options =A0 =A0 =A0 Fri May 28 10:35:44 2010 =A0 =A0 = =A0 =A0(r208613) > @@ -848,3 +848,7 @@ SND_PCM_64 =A0 =A0 =A0 =A0 =A0opt_snd.h > =A0SND_OLDSTEREO =A0 =A0 =A0 =A0 =A0opt_snd.h > > =A0X86BIOS > + > +# Flattened device tree options > +FDT =A0 =A0 =A0 =A0 =A0 =A0opt_platform.h > +FDT_DTB_STATIC opt_platform.h Wewt -- awesome work guys...! Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Fri May 28 17:50:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E66D1065675; Fri, 28 May 2010 17:50:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 741198FC14; Fri, 28 May 2010 17:50:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SHoOhf064719; Fri, 28 May 2010 17:50:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SHoOE6064714; Fri, 28 May 2010 17:50:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201005281750.o4SHoOE6064714@svn.freebsd.org> From: John Baldwin Date: Fri, 28 May 2010 17:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208621 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 17:50:24 -0000 Author: jhb Date: Fri May 28 17:50:24 2010 New Revision: 208621 URL: http://svn.freebsd.org/changeset/base/208621 Log: Defer initializing machine checks for the boot CPU until the local APIC is fully configured. MFC after: 1 month Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mca.c head/sys/i386/i386/machdep.c head/sys/i386/i386/mca.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri May 28 15:45:17 2010 (r208620) +++ head/sys/amd64/amd64/machdep.c Fri May 28 17:50:24 2010 (r208621) @@ -285,7 +285,6 @@ cpu_startup(dummy) vm_pager_bufferinit(); cpu_setregs(); - mca_init(); } /* Modified: head/sys/amd64/amd64/mca.c ============================================================================== --- head/sys/amd64/amd64/mca.c Fri May 28 15:45:17 2010 (r208620) +++ head/sys/amd64/amd64/mca.c Fri May 28 17:50:24 2010 (r208621) @@ -789,6 +789,19 @@ mca_init(void) load_cr4(rcr4() | CR4_MCE); } +/* + * The machine check registers for the BSP cannot be initialized until + * the local APIC is initialized. This happens at SI_SUB_CPU, + * SI_ORDER_SECOND. + */ +static void +mca_init_bsp(void *arg __unused) +{ + + mca_init(); +} +SYSINIT(mca_init_bsp, SI_SUB_CPU, SI_ORDER_ANY, mca_init_bsp, NULL); + /* Called when a machine check exception fires. */ int mca_intr(void) Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri May 28 15:45:17 2010 (r208620) +++ head/sys/i386/i386/machdep.c Fri May 28 17:50:24 2010 (r208621) @@ -328,7 +328,6 @@ cpu_startup(dummy) #ifndef XEN cpu_setregs(); #endif - mca_init(); } /* Modified: head/sys/i386/i386/mca.c ============================================================================== --- head/sys/i386/i386/mca.c Fri May 28 15:45:17 2010 (r208620) +++ head/sys/i386/i386/mca.c Fri May 28 17:50:24 2010 (r208621) @@ -812,6 +812,19 @@ mca_init(void) load_cr4(rcr4() | CR4_MCE); } +/* + * The machine check registers for the BSP cannot be initialized until + * the local APIC is initialized. This happens at SI_SUB_CPU, + * SI_ORDER_SECOND. + */ +static void +mca_init_bsp(void *arg __unused) +{ + + mca_init(); +} +SYSINIT(mca_init_bsp, SI_SUB_CPU, SI_ORDER_ANY, mca_init_bsp, NULL); + /* Called when a machine check exception fires. */ int mca_intr(void) From owner-svn-src-head@FreeBSD.ORG Fri May 28 17:50:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 445E1106566C; Fri, 28 May 2010 17:50:36 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33F078FC1A; Fri, 28 May 2010 17:50:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SHoasc064818; Fri, 28 May 2010 17:50:36 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SHoaC5064816; Fri, 28 May 2010 17:50:36 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201005281750.o4SHoaC5064816@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 28 May 2010 17:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208622 - head/release/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 17:50:36 -0000 Author: marcel Date: Fri May 28 17:50:35 2010 New Revision: 208622 URL: http://svn.freebsd.org/changeset/base/208622 Log: The EFI system partition used to make the CD image bootable is running out of space. Bump it up... Modified: head/release/ia64/mkisoimages.sh Modified: head/release/ia64/mkisoimages.sh ============================================================================== --- head/release/ia64/mkisoimages.sh Fri May 28 17:50:24 2010 (r208621) +++ head/release/ia64/mkisoimages.sh Fri May 28 17:50:35 2010 (r208622) @@ -67,7 +67,7 @@ EFIPART=efipart.sys # To create a bootable CD under EFI, the boot image should be an EFI # system partition. if [ $bootable = yes ]; then - EFISZ=40960 + EFISZ=65536 MNT=/mnt dd if=/dev/zero of=$BASE/$EFIPART count=$EFISZ md=`mdconfig -a -t vnode -f $BASE/$EFIPART` From owner-svn-src-head@FreeBSD.ORG Fri May 28 18:15:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E3401065670; Fri, 28 May 2010 18:15:28 +0000 (UTC) (envelope-from zml@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52E5D8FC19; Fri, 28 May 2010 18:15:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SIFSkZ070285; Fri, 28 May 2010 18:15:28 GMT (envelope-from zml@svn.freebsd.org) Received: (from zml@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SIFSWr070281; Fri, 28 May 2010 18:15:28 GMT (envelope-from zml@svn.freebsd.org) Message-Id: <201005281815.o4SIFSWr070281@svn.freebsd.org> From: Zachary Loafman Date: Fri, 28 May 2010 18:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208623 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 18:15:28 -0000 Author: zml Date: Fri May 28 18:15:28 2010 New Revision: 208623 URL: http://svn.freebsd.org/changeset/base/208623 Log: Revert r207439 and solve the problem differently. The task handler ta_func may free the task structure, so no references to its members are valid after the handler has been called. Using a per-queue member and having waits longer than strictly necessary was suggested by jhb. Submitted by: Matthew Fleming Reviewed by: zml, jhb Modified: head/sys/kern/subr_taskqueue.c head/sys/sys/_task.h head/sys/sys/taskqueue.h Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Fri May 28 17:50:35 2010 (r208622) +++ head/sys/kern/subr_taskqueue.c Fri May 28 18:15:28 2010 (r208623) @@ -56,6 +56,7 @@ struct taskqueue { int tq_tcount; int tq_spin; int tq_flags; + int tq_tasks_running; }; #define TQ_FLAGS_ACTIVE (1 << 0) @@ -232,13 +233,13 @@ taskqueue_run(struct taskqueue *queue) STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link); pending = task->ta_pending; task->ta_pending = 0; - task->ta_flags |= TA_FLAGS_RUNNING; + queue->tq_tasks_running++; TQ_UNLOCK(queue); task->ta_func(task->ta_context, pending); TQ_LOCK(queue); - task->ta_flags &= ~TA_FLAGS_RUNNING; + queue->tq_tasks_running--; wakeup(task); } @@ -255,16 +256,14 @@ taskqueue_drain(struct taskqueue *queue, { if (queue->tq_spin) { /* XXX */ mtx_lock_spin(&queue->tq_mutex); - while (task->ta_pending != 0 || - (task->ta_flags & TA_FLAGS_RUNNING) != 0) + while (task->ta_pending != 0 || queue->tq_tasks_running > 0) msleep_spin(task, &queue->tq_mutex, "-", 0); mtx_unlock_spin(&queue->tq_mutex); } else { WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); mtx_lock(&queue->tq_mutex); - while (task->ta_pending != 0 || - (task->ta_flags & TA_FLAGS_RUNNING) != 0) + while (task->ta_pending != 0 || queue->tq_tasks_running > 0) msleep(task, &queue->tq_mutex, PWAIT, "-", 0); mtx_unlock(&queue->tq_mutex); } Modified: head/sys/sys/_task.h ============================================================================== --- head/sys/sys/_task.h Fri May 28 17:50:35 2010 (r208622) +++ head/sys/sys/_task.h Fri May 28 18:15:28 2010 (r208623) @@ -45,8 +45,6 @@ typedef void task_fn_t(void *context, in struct task { STAILQ_ENTRY(task) ta_link; /* (q) link for queue */ - u_int ta_flags; /* (q) state of this task */ -#define TA_FLAGS_RUNNING 0x01 u_short ta_pending; /* (q) count times queued */ u_short ta_priority; /* (c) Priority */ task_fn_t *ta_func; /* (c) task handler */ Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Fri May 28 17:50:35 2010 (r208622) +++ head/sys/sys/taskqueue.h Fri May 28 18:15:28 2010 (r208623) @@ -75,7 +75,6 @@ void taskqueue_thread_enqueue(void *cont (task)->ta_priority = (priority); \ (task)->ta_func = (func); \ (task)->ta_context = (context); \ - (task)->ta_flags = 0; \ } while (0) /* From owner-svn-src-head@FreeBSD.ORG Fri May 28 18:15:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DAEC106576F; Fri, 28 May 2010 18:15:34 +0000 (UTC) (envelope-from zml@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A04008FC12; Fri, 28 May 2010 18:15:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SIFYBP070357; Fri, 28 May 2010 18:15:34 GMT (envelope-from zml@svn.freebsd.org) Received: (from zml@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SIFYY4070355; Fri, 28 May 2010 18:15:34 GMT (envelope-from zml@svn.freebsd.org) Message-Id: <201005281815.o4SIFYY4070355@svn.freebsd.org> From: Zachary Loafman Date: Fri, 28 May 2010 18:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208624 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 18:15:35 -0000 Author: zml Date: Fri May 28 18:15:34 2010 New Revision: 208624 URL: http://svn.freebsd.org/changeset/base/208624 Log: Avoid a wakeup(9) if we can be sure no one is waiting on the task. Submitted by: Matthew Fleming Reviewed by: zml, jhb Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Fri May 28 18:15:28 2010 (r208623) +++ head/sys/kern/subr_taskqueue.c Fri May 28 18:15:34 2010 (r208624) @@ -57,6 +57,7 @@ struct taskqueue { int tq_spin; int tq_flags; int tq_tasks_running; + int tq_task_waiters; }; #define TQ_FLAGS_ACTIVE (1 << 0) @@ -240,7 +241,8 @@ taskqueue_run(struct taskqueue *queue) TQ_LOCK(queue); queue->tq_tasks_running--; - wakeup(task); + if (queue->tq_task_waiters > 0) + wakeup(task); } /* @@ -256,15 +258,21 @@ taskqueue_drain(struct taskqueue *queue, { if (queue->tq_spin) { /* XXX */ mtx_lock_spin(&queue->tq_mutex); - while (task->ta_pending != 0 || queue->tq_tasks_running > 0) + while (task->ta_pending != 0 || queue->tq_tasks_running > 0) { + queue->tq_task_waiters++; msleep_spin(task, &queue->tq_mutex, "-", 0); + queue->tq_task_waiters--; + } mtx_unlock_spin(&queue->tq_mutex); } else { WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); mtx_lock(&queue->tq_mutex); - while (task->ta_pending != 0 || queue->tq_tasks_running > 0) + while (task->ta_pending != 0 || queue->tq_tasks_running > 0) { + queue->tq_task_waiters++; msleep(task, &queue->tq_mutex, PWAIT, "-", 0); + queue->tq_task_waiters--; + } mtx_unlock(&queue->tq_mutex); } } From owner-svn-src-head@FreeBSD.ORG Fri May 28 22:08:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54EEA1065675; Fri, 28 May 2010 22:08:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 439408FC13; Fri, 28 May 2010 22:08:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SM8ZoA021880; Fri, 28 May 2010 22:08:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SM8Z3I021877; Fri, 28 May 2010 22:08:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005282208.o4SM8Z3I021877@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 28 May 2010 22:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208629 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 22:08:35 -0000 Author: jilles Date: Fri May 28 22:08:34 2010 New Revision: 208629 URL: http://svn.freebsd.org/changeset/base/208629 Log: sh: Add some simple tests for ., exec and return from . script. Added: head/tools/regression/bin/sh/builtins/dot1.0 (contents, props changed) head/tools/regression/bin/sh/builtins/exec1.0 (contents, props changed) head/tools/regression/bin/sh/builtins/return4.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/dot1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/dot1.0 Fri May 28 22:08:34 2010 (r208629) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) || exit +trap 'rm -rf $T' 0 +cd $T || exit 3 +unset x +echo 'x=2' >testscript +. ./testscript +[ "$x" = 2 ] || failure $LINENO +cd / || exit 3 +x=1 +PATH=$T:$PATH . testscript +[ "$x" = 2 ] || failure $LINENO + +test -z "$failures" Added: head/tools/regression/bin/sh/builtins/exec1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/exec1.0 Fri May 28 22:08:34 2010 (r208629) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +( + exec >/dev/null + echo bad +) +[ $? = 0 ] || failure $LINENO +( + exec sh -c 'exit 42' + echo bad +) +[ $? = 42 ] || failure $LINENO +( + exec /var/empty/nosuch + echo bad +) 2>/dev/null +[ $? = 127 ] || failure $LINENO + +test -z "$failures" Added: head/tools/regression/bin/sh/builtins/return4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/return4.0 Fri May 28 22:08:34 2010 (r208629) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) || exit +trap 'rm -rf $T' 0 +cd $T || exit 3 +echo 'return 42; exit 4' >testscript +. ./testscript +[ "$?" = 42 ] || failure $LINENO + +test -z "$failures" From owner-svn-src-head@FreeBSD.ORG Fri May 28 22:40:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29ABC1065670; Fri, 28 May 2010 22:40:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17D848FC1E; Fri, 28 May 2010 22:40:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SMeOCx028919; Fri, 28 May 2010 22:40:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4SMeOcJ028914; Fri, 28 May 2010 22:40:24 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005282240.o4SMeOcJ028914@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 28 May 2010 22:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208630 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 22:40:25 -0000 Author: jilles Date: Fri May 28 22:40:24 2010 New Revision: 208630 URL: http://svn.freebsd.org/changeset/base/208630 Log: sh: Recognize "--" in . and exec. Although "--" historically has not been required to be recognized for certain special builtins that do not take options in POSIX, some other implementations recognize options for them, requiring scripts to use "--" or avoid operands starting with "-". Operands starting with "-" can be avoided with eval by prepending a space, and cannot occur with break, continue, exit, return and shift as they only take numbers, nor with times as it does not take operands. With . and exec, avoiding "-" is not so easy as it may require reimplementing the PATH search; therefore the current proposal for POSIX is to require recognition of "--" for them. We continue to accept other strings starting with "-" as operands to . and exec, and also "--" if it is alone to . (which would otherwise be invalid anyway). Added: head/tools/regression/bin/sh/builtins/dot2.0 (contents, props changed) head/tools/regression/bin/sh/builtins/exec2.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/main.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Fri May 28 22:08:34 2010 (r208629) +++ head/bin/sh/eval.c Fri May 28 22:40:24 2010 (r208630) @@ -1170,6 +1170,12 @@ truecmd(int argc __unused, char **argv _ int execcmd(int argc, char **argv) { + /* + * Because we have historically not supported any options, + * only treat "--" specially. + */ + if (argc > 1 && strcmp(argv[1], "--") == 0) + argc--, argv++; if (argc > 1) { struct strlist *sp; Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Fri May 28 22:08:34 2010 (r208629) +++ head/bin/sh/main.c Fri May 28 22:40:24 2010 (r208630) @@ -314,14 +314,20 @@ find_dot_file(char *basename) int dotcmd(int argc, char **argv) { - char *fullname; + char *filename, *fullname; if (argc < 2) error("missing filename"); exitstatus = 0; - fullname = find_dot_file(argv[1]); + /* + * Because we have historically not supported any options, + * only treat "--" specially. + */ + filename = argc > 2 && strcmp(argv[1], "--") == 0 ? argv[2] : argv[1]; + + fullname = find_dot_file(filename); setinputfile(fullname, 1); commandname = fullname; cmdloop(0); Added: head/tools/regression/bin/sh/builtins/dot2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/dot2.0 Fri May 28 22:40:24 2010 (r208630) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) || exit +trap 'rm -rf $T' 0 +cd $T || exit 3 +unset x +echo 'x=2' >testscript +. -- ./testscript +[ "$x" = 2 ] || failure $LINENO +cd / || exit 3 +x=1 +PATH=$T:$PATH . -- testscript +[ "$x" = 2 ] || failure $LINENO + +test -z "$failures" Added: head/tools/regression/bin/sh/builtins/exec2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/exec2.0 Fri May 28 22:40:24 2010 (r208630) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +( + exec -- >/dev/null + echo bad +) +[ $? = 0 ] || failure $LINENO +( + exec -- sh -c 'exit 42' + echo bad +) +[ $? = 42 ] || failure $LINENO +( + exec -- /var/empty/nosuch + echo bad +) 2>/dev/null +[ $? = 127 ] || failure $LINENO + +test -z "$failures" From owner-svn-src-head@FreeBSD.ORG Sat May 29 03:06:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E64DA1065670; Sat, 29 May 2010 03:06:56 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D52368FC1B; Sat, 29 May 2010 03:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4T36uff087143; Sat, 29 May 2010 03:06:56 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4T36uog087141; Sat, 29 May 2010 03:06:56 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201005290306.o4T36uog087141@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 29 May 2010 03:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208632 - head/sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 03:06:57 -0000 Author: nyan Date: Sat May 29 03:06:56 2010 New Revision: 208632 URL: http://svn.freebsd.org/changeset/base/208632 Log: MFi386: revision 208604 Clarify a potential issue in get_fpcontext() use. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat May 29 02:14:05 2010 (r208631) +++ head/sys/pc98/pc98/machdep.c Sat May 29 03:06:56 2010 (r208632) @@ -563,6 +563,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_gs = rgs(); bcopy(regs, &sf.sf_uc.uc_mcontext.mc_fs, sizeof(*regs)); sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ + + /* + * The get_fpcontext() call must be placed before assignments + * to mc_fsbase and mc_gsbase due to the alignment-override + * code in get_fpcontext() that possibly clobbers 12 bytes of + * mcontext after mc_fpstate. + */ get_fpcontext(td, &sf.sf_uc.uc_mcontext); fpstate_drop(td); /* @@ -2455,6 +2462,13 @@ get_mcontext(struct thread *td, mcontext mcp->mc_esp = tp->tf_esp; mcp->mc_ss = tp->tf_ss; mcp->mc_len = sizeof(*mcp); + + /* + * The get_fpcontext() call must be placed before assignments + * to mc_fsbase and mc_gsbase due to the alignment-override + * code in get_fpcontext() that possibly clobbers 12 bytes of + * mcontext after mc_fpstate. + */ get_fpcontext(td, mcp); sdp = &td->td_pcb->pcb_gsd; mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; From owner-svn-src-head@FreeBSD.ORG Sat May 29 03:09:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D9ED106564A; Sat, 29 May 2010 03:09:30 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C9A88FC0A; Sat, 29 May 2010 03:09:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4T39UUC087702; Sat, 29 May 2010 03:09:30 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4T39TSS087700; Sat, 29 May 2010 03:09:29 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201005290309.o4T39TSS087700@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 29 May 2010 03:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208633 - head/sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 03:09:30 -0000 Author: nyan Date: Sat May 29 03:09:29 2010 New Revision: 208633 URL: http://svn.freebsd.org/changeset/base/208633 Log: MFi386: revision 208621 Defer initializing machine checks for the boot CPU until the local APIC is fully configured. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat May 29 03:06:56 2010 (r208632) +++ head/sys/pc98/pc98/machdep.c Sat May 29 03:09:29 2010 (r208633) @@ -257,8 +257,6 @@ cpu_startup(dummy) vm_pager_bufferinit(); cpu_setregs(); - - mca_init(); } /* From owner-svn-src-head@FreeBSD.ORG Sat May 29 03:40:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB793106566B; Sat, 29 May 2010 03:40:00 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2F58FC14; Sat, 29 May 2010 03:40:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4T3e0TR094522; Sat, 29 May 2010 03:40:00 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4T3e03n094520; Sat, 29 May 2010 03:40:00 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201005290340.o4T3e03n094520@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 29 May 2010 03:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208634 - head/sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 03:40:00 -0000 Author: nyan Date: Sat May 29 03:40:00 2010 New Revision: 208634 URL: http://svn.freebsd.org/changeset/base/208634 Log: Reduce diffs against i386. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat May 29 03:09:29 2010 (r208633) +++ head/sys/pc98/pc98/machdep.c Sat May 29 03:40:00 2010 (r208634) @@ -213,6 +213,8 @@ static void cpu_startup(dummy) void *dummy; { + uintmax_t memsize; + /* * Good {morning,afternoon,evening,night}. */ @@ -222,9 +224,14 @@ cpu_startup(dummy) #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), - ptoa((uintmax_t)Maxmem) / 1048576); realmem = Maxmem; + + /* + * Display physical memory. + */ + memsize = ptoa((uintmax_t)Maxmem); + printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); + /* * Display any holes after the first chunk of extended memory. */ @@ -255,7 +262,6 @@ cpu_startup(dummy) */ bufinit(); vm_pager_bufferinit(); - cpu_setregs(); } @@ -1028,8 +1034,8 @@ sigreturn(td, uap) else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); return (EJUSTRETURN); } @@ -1296,10 +1302,11 @@ SYSCTL_ULONG(_machdep, OID_AUTO, guessed */ int _default_ldt; + union descriptor gdt[NGDT * MAXCPU]; /* global descriptor table */ +union descriptor ldt[NLDT]; /* local descriptor table */ static struct gate_descriptor idt0[NIDT]; struct gate_descriptor *idt = &idt0[0]; /* interrupt descriptor table */ -union descriptor ldt[NLDT]; /* local descriptor table */ struct region_descriptor r_gdt, r_idt; /* table descriptors */ struct mtx dt_lock; /* lock for GDT and LDT */ @@ -1655,7 +1662,8 @@ getmemsize(int first) int i, off, physmap_idx, pa_indx, da_indx; int pg_n; u_long physmem_tunable; - u_int extmem, under16; + u_int extmem; + u_int under16; vm_paddr_t pa, physmap[PHYSMAP_SIZE]; pt_entry_t *pte; quad_t dcons_addr, dcons_size; @@ -1680,7 +1688,7 @@ getmemsize(int first) /* * Perform "base memory" related probes & setup */ - under16 = pc98_getmemsize(&basemem, &extmem); + under16 = pc98_getmemsize(&basemem, &extmem); if (basemem > 640) { printf("Preposterous BIOS basemem of %uK, truncating to 640K\n", basemem); @@ -1912,7 +1920,7 @@ do_next: } *pte = 0; invltlb(); - + /* * XXX * The last chunk must contain at least one page plus the message @@ -1942,9 +1950,8 @@ init386(first) int first; { struct gate_descriptor *gdp; - int gsel_tss, metadata_missing, x; + int gsel_tss, metadata_missing, x, pa; struct pcpu *pc; - int pa; thread0.td_kstack = proc0kstack; thread0.td_pcb = (struct pcb *) @@ -2005,7 +2012,6 @@ init386(first) pmap_kenter(pa + KERNBASE, pa); dpcpu_init((void *)(first + KERNBASE), 0); first += DPCPU_SIZE; - PCPU_SET(prvspace, pc); PCPU_SET(curthread, &thread0); PCPU_SET(curpcb, thread0.td_pcb); From owner-svn-src-head@FreeBSD.ORG Sat May 29 09:07:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 478D01065675; Sat, 29 May 2010 09:07:41 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3500D8FC13; Sat, 29 May 2010 09:07:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4T97fCA066450; Sat, 29 May 2010 09:07:41 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4T97fNZ066448; Sat, 29 May 2010 09:07:41 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201005290907.o4T97fNZ066448@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 29 May 2010 09:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208638 - head/sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 09:07:41 -0000 Author: nyan Date: Sat May 29 09:07:40 2010 New Revision: 208638 URL: http://svn.freebsd.org/changeset/base/208638 Log: MFi386: revision 178471 - Add an integer argument to idle to indicate how likely we are to wake from idle over the next tick. - Add a new MD routine, cpu_wake_idle() to wakeup idle threads who are suspended in cpu specific states. This function can fail and cause the scheduler to fall back to another mechanism (ipi). - Implement support for mwait in cpu_idle() on i386/amd64 machines that support it. mwait is a higher performance way to synchronize cpus as compared to hlt & ipis. - Allow selecting the idle routine by name via sysctl machdep.idle. This replaces machdep.cpu_idle_hlt. Only idle routines supported by the current machine are permitted. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat May 29 09:07:25 2010 (r208637) +++ head/sys/pc98/pc98/machdep.c Sat May 29 09:07:40 2010 (r208638) @@ -1108,6 +1108,7 @@ cpu_est_clockrate(int cpu_id, uint64_t * return (0); } + /* * Shutdown the CPU as much as possible */ @@ -1118,70 +1119,177 @@ cpu_halt(void) __asm__ ("hlt"); } -/* - * Hook to idle the CPU when possible. In the SMP case we default to - * off because a halted cpu will not currently pick up a new thread in the - * run queue until the next timer tick. If turned on this will result in - * approximately a 4.2% loss in real time performance in buildworld tests - * (but improves user and sys times oddly enough), and saves approximately - * 5% in power consumption on an idle machine (tests w/2xCPU 1.1GHz P3). - * - * XXX we need to have a cpu mask of idle cpus and generate an IPI or - * otherwise generate some sort of interrupt to wake up cpus sitting in HLT. - * Then we can have our cake and eat it too. - * - * XXX I'm turning it on for SMP as well by default for now. It seems to - * help lock contention somewhat, and this is critical for HTT. -Peter - */ -static int cpu_idle_hlt = 1; -TUNABLE_INT("machdep.cpu_idle_hlt", &cpu_idle_hlt); -SYSCTL_INT(_machdep, OID_AUTO, cpu_idle_hlt, CTLFLAG_RW, - &cpu_idle_hlt, 0, "Idle loop HLT enable"); - static void -cpu_idle_default(void) +cpu_idle_hlt(int busy) { /* - * we must absolutely guarentee that hlt is the - * absolute next instruction after sti or we - * introduce a timing window. + * we must absolutely guarentee that hlt is the next instruction + * after sti or we introduce a timing window. */ - __asm __volatile("sti; hlt"); + disable_intr(); + if (sched_runnable()) + enable_intr(); + else + __asm __volatile("sti; hlt"); } -/* - * Note that we have to be careful here to avoid a race between checking - * sched_runnable() and actually halting. If we don't do this, we may waste - * the time between calling hlt and the next interrupt even though there - * is a runnable process. - */ +static void +cpu_idle_spin(int busy) +{ + return; +} + +void (*cpu_idle_fn)(int) = cpu_idle_hlt; + void cpu_idle(int busy) { - -#ifdef SMP +#if defined(SMP) if (mp_grab_cpu_hlt()) return; #endif + cpu_idle_fn(busy); +} + +/* + * mwait cpu power states. Lower 4 bits are sub-states. + */ +#define MWAIT_C0 0xf0 +#define MWAIT_C1 0x00 +#define MWAIT_C2 0x10 +#define MWAIT_C3 0x20 +#define MWAIT_C4 0x30 + +#define MWAIT_DISABLED 0x0 +#define MWAIT_WOKEN 0x1 +#define MWAIT_WAITING 0x2 + +static void +cpu_idle_mwait(int busy) +{ + int *mwait; - if (cpu_idle_hlt) { - disable_intr(); - if (sched_runnable()) - enable_intr(); - else - (*cpu_idle_hook)(); + mwait = (int *)PCPU_PTR(monitorbuf); + *mwait = MWAIT_WAITING; + if (sched_runnable()) + return; + cpu_monitor(mwait, 0, 0); + if (*mwait == MWAIT_WAITING) + cpu_mwait(0, MWAIT_C1); +} + +static void +cpu_idle_mwait_hlt(int busy) +{ + int *mwait; + + mwait = (int *)PCPU_PTR(monitorbuf); + if (busy == 0) { + *mwait = MWAIT_DISABLED; + cpu_idle_hlt(busy); + return; } + *mwait = MWAIT_WAITING; + if (sched_runnable()) + return; + cpu_monitor(mwait, 0, 0); + if (*mwait == MWAIT_WAITING) + cpu_mwait(0, MWAIT_C1); } int cpu_idle_wakeup(int cpu) { + struct pcpu *pcpu; + int *mwait; - return (0); + if (cpu_idle_fn == cpu_idle_spin) + return (1); + if (cpu_idle_fn != cpu_idle_mwait && cpu_idle_fn != cpu_idle_mwait_hlt) + return (0); + pcpu = pcpu_find(cpu); + mwait = (int *)pcpu->pc_monitorbuf; + /* + * This doesn't need to be atomic since missing the race will + * simply result in unnecessary IPIs. + */ + if (cpu_idle_fn == cpu_idle_mwait_hlt && *mwait == MWAIT_DISABLED) + return (0); + *mwait = MWAIT_WOKEN; + + return (1); +} + +/* + * Ordered by speed/power consumption. + */ +struct { + void *id_fn; + char *id_name; +} idle_tbl[] = { + { cpu_idle_spin, "spin" }, + { cpu_idle_mwait, "mwait" }, + { cpu_idle_mwait_hlt, "mwait_hlt" }, + { cpu_idle_hlt, "hlt" }, + { NULL, NULL } +}; + +static int +idle_sysctl_available(SYSCTL_HANDLER_ARGS) +{ + char *avail, *p; + int error; + int i; + + avail = malloc(256, M_TEMP, M_WAITOK); + p = avail; + for (i = 0; idle_tbl[i].id_name != NULL; i++) { + if (strstr(idle_tbl[i].id_name, "mwait") && + (cpu_feature2 & CPUID2_MON) == 0) + continue; + p += sprintf(p, "%s, ", idle_tbl[i].id_name); + } + error = sysctl_handle_string(oidp, avail, 0, req); + free(avail, M_TEMP); + return (error); } -/* Other subsystems (e.g., ACPI) can hook this later. */ -void (*cpu_idle_hook)(void) = cpu_idle_default; +static int +idle_sysctl(SYSCTL_HANDLER_ARGS) +{ + char buf[16]; + int error; + char *p; + int i; + + p = "unknown"; + for (i = 0; idle_tbl[i].id_name != NULL; i++) { + if (idle_tbl[i].id_fn == cpu_idle_fn) { + p = idle_tbl[i].id_name; + break; + } + } + strncpy(buf, p, sizeof(buf)); + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + for (i = 0; idle_tbl[i].id_name != NULL; i++) { + if (strstr(idle_tbl[i].id_name, "mwait") && + (cpu_feature2 & CPUID2_MON) == 0) + continue; + if (strcmp(idle_tbl[i].id_name, buf)) + continue; + cpu_idle_fn = idle_tbl[i].id_fn; + return (0); + } + return (EINVAL); +} + +SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, + 0, 0, idle_sysctl_available, "A", "list of available idle functions"); + +SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, + idle_sysctl, "A", "currently selected idle function"); /* * Reset registers to default values on exec. From owner-svn-src-head@FreeBSD.ORG Sat May 29 09:12:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5A3B1065674; Sat, 29 May 2010 09:12:02 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3E8B8FC08; Sat, 29 May 2010 09:12:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4T9C2o0067461; Sat, 29 May 2010 09:12:02 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4T9C2mX067459; Sat, 29 May 2010 09:12:02 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201005290912.o4T9C2mX067459@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 29 May 2010 09:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208639 - head/sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 09:12:03 -0000 Author: nyan Date: Sat May 29 09:12:02 2010 New Revision: 208639 URL: http://svn.freebsd.org/changeset/base/208639 Log: MFi386: the part of revision 181809 Use SEL_KPL macro. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat May 29 09:07:40 2010 (r208638) +++ head/sys/pc98/pc98/machdep.c Sat May 29 09:12:02 2010 (r208639) @@ -1439,7 +1439,7 @@ struct soft_segment_descriptor gdt_segs[ { .ssd_base = 0x0, .ssd_limit = 0x0, .ssd_type = 0, - .ssd_dpl = 0, + .ssd_dpl = SEL_KPL, .ssd_p = 0, .ssd_xx = 0, .ssd_xx1 = 0, .ssd_def32 = 0, @@ -1448,7 +1448,7 @@ struct soft_segment_descriptor gdt_segs[ { .ssd_base = 0x0, .ssd_limit = 0xfffff, .ssd_type = SDT_MEMRWA, - .ssd_dpl = 0, + .ssd_dpl = SEL_KPL, .ssd_p = 1, .ssd_xx = 0, .ssd_xx1 = 0, .ssd_def32 = 1, @@ -1475,7 +1475,7 @@ struct soft_segment_descriptor gdt_segs[ { .ssd_base = 0x0, .ssd_limit = 0xfffff, .ssd_type = SDT_MEMERA, - .ssd_dpl = 0, + .ssd_dpl = SEL_KPL, .ssd_p = 1, .ssd_xx = 0, .ssd_xx1 = 0, .ssd_def32 = 1, @@ -1484,7 +1484,7 @@ struct soft_segment_descriptor gdt_segs[ { .ssd_base = 0x0, .ssd_limit = 0xfffff, .ssd_type = SDT_MEMRWA, - .ssd_dpl = 0, + .ssd_dpl = SEL_KPL, .ssd_p = 1, .ssd_xx = 0, .ssd_xx1 = 0, .ssd_def32 = 1, @@ -1511,7 +1511,7 @@ struct soft_segment_descriptor gdt_segs[ { .ssd_base = 0x400, .ssd_limit = 0xfffff, .ssd_type = SDT_MEMRWA, - .ssd_dpl = 0, + .ssd_dpl = SEL_KPL, .ssd_p = 1, .ssd_xx = 0, .ssd_xx1 = 0, .ssd_def32 = 1, From owner-svn-src-head@FreeBSD.ORG Sat May 29 16:10:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9619A106564A; Sat, 29 May 2010 16:10:08 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 361918FC1A; Sat, 29 May 2010 16:10:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4TGA8EH063514; Sat, 29 May 2010 16:10:08 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4TGA8s8063512; Sat, 29 May 2010 16:10:08 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201005291610.o4TGA8s8063512@svn.freebsd.org> From: Rui Paulo Date: Sat, 29 May 2010 16:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208642 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 16:10:08 -0000 Author: rpaulo Date: Sat May 29 16:10:07 2010 New Revision: 208642 URL: http://svn.freebsd.org/changeset/base/208642 Log: Don't shadow the global variable 'version'. Submitted by: Arnaud Lacombe MFC after: 1 week Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v1.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v1.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v1.c Sat May 29 13:05:41 2010 (r208641) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v1.c Sat May 29 16:10:07 2010 (r208642) @@ -112,7 +112,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a { HAL_EEPROM_v1 *ee = AH_PRIVATE(ah)->ah_eeprom; uint16_t athvals[AR_EEPROM_ATHEROS_MAX]; /* XXX off stack */ - uint16_t protect, version, eeval; + uint16_t protect, eeprom_version, eeval; uint32_t sum; int i, loc; @@ -138,18 +138,18 @@ ath_hal_v1EepromAttach(struct ath_hal *a HALDEBUG(ah, HAL_DEBUG_ATTACH, "EEPROM protect 0x%x\n", protect); /* XXX check proper access before continuing */ - if (!ath_hal_eepromRead(ah, AR_EEPROM_VERSION, &version)) { + if (!ath_hal_eepromRead(ah, AR_EEPROM_VERSION, &eeprom_version)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unable to read EEPROM version\n", __func__); return HAL_EEREAD; } - if (((version>>12) & 0xf) != 1) { + if (((eeprom_version>>12) & 0xf) != 1) { /* * This code only groks the version 1 EEPROM layout. */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unsupported EEPROM version 0x%x found\n", - __func__, version); + __func__, eeprom_version); return HAL_EEVERSION; } @@ -183,7 +183,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a return HAL_ENOMEM; } - ee->ee_version = version; + ee->ee_version = eeprom_version; ee->ee_protect = protect; ee->ee_antenna = athvals[2]; ee->ee_biasCurrents = athvals[3]; @@ -243,7 +243,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a } AH_PRIVATE(ah)->ah_eeprom = ee; - AH_PRIVATE(ah)->ah_eeversion = version; + AH_PRIVATE(ah)->ah_eeversion = eeprom_version; AH_PRIVATE(ah)->ah_eepromDetach = v1EepromDetach; AH_PRIVATE(ah)->ah_eepromGet = v1EepromGet; AH_PRIVATE(ah)->ah_eepromSet = v1EepromSet; From owner-svn-src-head@FreeBSD.ORG Sat May 29 16:11:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD1A4106566C; Sat, 29 May 2010 16:11:51 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC7AF8FC18; Sat, 29 May 2010 16:11:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4TGBpIK063919; Sat, 29 May 2010 16:11:51 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4TGBpUL063917; Sat, 29 May 2010 16:11:51 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201005291611.o4TGBpUL063917@svn.freebsd.org> From: Rui Paulo Date: Sat, 29 May 2010 16:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208643 - head/sys/dev/ath/ath_hal/ar5210 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 16:11:51 -0000 Author: rpaulo Date: Sat May 29 16:11:51 2010 New Revision: 208643 URL: http://svn.freebsd.org/changeset/base/208643 Log: Due to the way HALDEBUG() is defined, we need to add curly brackets when using it as a sole if clause instruction. Submitted by: Arnaud Lacombe MFC after: 1 week Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Sat May 29 16:10:07 2010 (r208642) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Sat May 29 16:11:51 2010 (r208643) @@ -526,9 +526,10 @@ ar5210PerCalibrationN(struct ath_hal *ah /* AGC calibration (this was added to make the NF threshold check work) */ OS_REG_WRITE(ah, AR_PHY_AGCCTL, OS_REG_READ(ah, AR_PHY_AGCCTL) | AR_PHY_AGC_CAL); - if (!ath_hal_wait(ah, AR_PHY_AGCCTL, AR_PHY_AGC_CAL, 0)) + if (!ath_hal_wait(ah, AR_PHY_AGCCTL, AR_PHY_AGC_CAL, 0)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: AGC calibration timeout\n", __func__); + } /* Rewrite our AGC values we stored off earlier (return AGC to normal operation) */ OS_REG_WRITE(ah, 0x9858, reg9858); From owner-svn-src-head@FreeBSD.ORG Sat May 29 16:14:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05FAA1065677; Sat, 29 May 2010 16:14:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E954D8FC0A; Sat, 29 May 2010 16:14:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4TGE2eS064437; Sat, 29 May 2010 16:14:02 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4TGE2cM064435; Sat, 29 May 2010 16:14:02 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201005291614.o4TGE2cM064435@svn.freebsd.org> From: Rui Paulo Date: Sat, 29 May 2010 16:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208644 - head/sys/dev/ath/ath_hal/ar5211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 16:14:03 -0000 Author: rpaulo Date: Sat May 29 16:14:02 2010 New Revision: 208644 URL: http://svn.freebsd.org/changeset/base/208644 Log: Due to the way HALDEBUG() is defined, we need to add curly brackets when using it as a sole if clause instruction. While there, fix 'const static' typo. Submitted by: Arnaud Lacombe MFC after: 1 week Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Sat May 29 16:11:51 2010 (r208643) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Sat May 29 16:14:02 2010 (r208644) @@ -46,7 +46,7 @@ typedef struct { } CHAN_INFO_2GHZ; #define CI_2GHZ_INDEX_CORRECTION 19 -const static CHAN_INFO_2GHZ chan2GHzData[] = { +static const CHAN_INFO_2GHZ chan2GHzData[] = { { 1, 0x46, 96 }, /* 2312 -19 */ { 1, 0x46, 97 }, /* 2317 -18 */ { 1, 0x46, 98 }, /* 2322 -17 */ @@ -926,9 +926,10 @@ ar5211IsNfGood(struct ath_hal *ah, struc if (!getNoiseFloorThresh(ah, chan, &nfThresh)) return AH_FALSE; - if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) + if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: NF did not complete in calibration window\n", __func__); + } nf = ar5211GetNoiseFloor(ah); if (nf > nfThresh) { HALDEBUG(ah, HAL_DEBUG_ANY, From owner-svn-src-head@FreeBSD.ORG Sat May 29 17:10:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C2BA1065673; Sat, 29 May 2010 17:10:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 144F98FC08; Sat, 29 May 2010 17:10:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4THAjwP076874; Sat, 29 May 2010 17:10:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4THAjk8076870; Sat, 29 May 2010 17:10:45 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005291710.o4THAjk8076870@svn.freebsd.org> From: Alan Cox Date: Sat, 29 May 2010 17:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208645 - in head/sys: amd64/amd64 i386/i386 vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 17:10:46 -0000 Author: alc Date: Sat May 29 17:10:45 2010 New Revision: 208645 URL: http://svn.freebsd.org/changeset/base/208645 Log: When I pushed down the page queues lock into pmap_is_modified(), I created an ordering dependence: A pmap operation that clears PG_WRITEABLE and calls vm_page_dirty() must perform the call first. Otherwise, pmap_is_modified() could return FALSE without acquiring the page queues lock because the page is not (currently) writeable, and the caller to pmap_is_modified() might believe that the page's dirty field is clear because it has not seen the effect of the vm_page_dirty() call. When I pushed down the page queues lock into pmap_is_modified(), I overlooked one place where this ordering dependence is violated: pmap_enter(). In a rare situation pmap_enter() can be called to replace a dirty mapping to one page with a mapping to another page. (I say rare because replacements generally occur as a result of a copy-on-write fault, and so the old page is not dirty.) This change delays clearing PG_WRITEABLE until after vm_page_dirty() has been called. Fixing the ordering dependency also makes it easy to introduce a small optimization: When pmap_enter() used to replace a mapping to one page with a mapping to another page, it freed the pv entry for the first mapping and later called the pv entry allocator for the new mapping. Now, pmap_enter() attempts to recycle the old pv entry, saving two calls to the pv entry allocator. There is no point in setting PG_WRITEABLE on unmanaged pages, so don't. Update a comment to reflect this. Tidy up the variable declarations at the start of pmap_enter(). Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/vm/vm_page.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat May 29 16:14:02 2010 (r208644) +++ head/sys/amd64/amd64/pmap.c Sat May 29 17:10:45 2010 (r208645) @@ -3128,11 +3128,11 @@ void pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, vm_prot_t prot, boolean_t wired) { - vm_paddr_t pa; pd_entry_t *pde; pt_entry_t *pte; - vm_paddr_t opa; - pt_entry_t origpte, newpte; + pt_entry_t newpte, origpte; + pv_entry_t pv; + vm_paddr_t opa, pa; vm_page_t mpte, om; boolean_t invlva; @@ -3200,6 +3200,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, } goto validate; } + + pv = NULL; + /* * Mapping has changed, invalidate old range and fall through to * handle validating new mapping. @@ -3209,7 +3212,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pmap->pm_stats.wired_count--; if (origpte & PG_MANAGED) { om = PHYS_TO_VM_PAGE(opa); - pmap_remove_entry(pmap, om, va); + pv = pmap_pvh_remove(&om->md, pmap, va); } if (mpte != NULL) { mpte->wire_count--; @@ -3226,9 +3229,13 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); - pmap_insert_entry(pmap, va, m); + if (pv == NULL) + pv = get_pv_entry(pmap, FALSE); + pv->pv_va = va; + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); pa |= PG_MANAGED; - } + } else if (pv != NULL) + free_pv_entry(pmap, pv); /* * Increment counters @@ -3243,7 +3250,8 @@ validate: newpte = (pt_entry_t)(pa | pmap_cache_bits(m->md.pat_mode, 0) | PG_V); if ((prot & VM_PROT_WRITE) != 0) { newpte |= PG_RW; - vm_page_flag_set(m, PG_WRITEABLE); + if ((newpte & PG_MANAGED) != 0) + vm_page_flag_set(m, PG_WRITEABLE); } if ((prot & VM_PROT_EXECUTE) == 0) newpte |= pg_nx; @@ -3278,6 +3286,10 @@ validate: if ((newpte & PG_RW) == 0) invlva = TRUE; } + if ((origpte & PG_MANAGED) != 0 && + TAILQ_EMPTY(&om->md.pv_list) && + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list)) + vm_page_flag_clear(om, PG_WRITEABLE); if (invlva) pmap_invalidate_page(pmap, va); } else Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat May 29 16:14:02 2010 (r208644) +++ head/sys/i386/i386/pmap.c Sat May 29 17:10:45 2010 (r208645) @@ -3257,11 +3257,11 @@ void pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, vm_prot_t prot, boolean_t wired) { - vm_paddr_t pa; pd_entry_t *pde; pt_entry_t *pte; - vm_paddr_t opa; - pt_entry_t origpte, newpte; + pt_entry_t newpte, origpte; + pv_entry_t pv; + vm_paddr_t opa, pa; vm_page_t mpte, om; boolean_t invlva; @@ -3336,6 +3336,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, } goto validate; } + + pv = NULL; + /* * Mapping has changed, invalidate old range and fall through to * handle validating new mapping. @@ -3345,7 +3348,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pmap->pm_stats.wired_count--; if (origpte & PG_MANAGED) { om = PHYS_TO_VM_PAGE(opa); - pmap_remove_entry(pmap, om, va); + pv = pmap_pvh_remove(&om->md, pmap, va); } if (mpte != NULL) { mpte->wire_count--; @@ -3362,9 +3365,13 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); - pmap_insert_entry(pmap, va, m); + if (pv == NULL) + pv = get_pv_entry(pmap, FALSE); + pv->pv_va = va; + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); pa |= PG_MANAGED; - } + } else if (pv != NULL) + free_pv_entry(pmap, pv); /* * Increment counters @@ -3379,7 +3386,8 @@ validate: newpte = (pt_entry_t)(pa | pmap_cache_bits(m->md.pat_mode, 0) | PG_V); if ((prot & VM_PROT_WRITE) != 0) { newpte |= PG_RW; - vm_page_flag_set(m, PG_WRITEABLE); + if ((newpte & PG_MANAGED) != 0) + vm_page_flag_set(m, PG_WRITEABLE); } #ifdef PAE if ((prot & VM_PROT_EXECUTE) == 0) @@ -3420,6 +3428,10 @@ validate: if ((prot & VM_PROT_WRITE) == 0) invlva = TRUE; } + if ((origpte & PG_MANAGED) != 0 && + TAILQ_EMPTY(&om->md.pv_list) && + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list)) + vm_page_flag_clear(om, PG_WRITEABLE); if (invlva) pmap_invalidate_page(pmap, va); } else Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sat May 29 16:14:02 2010 (r208644) +++ head/sys/vm/vm_page.h Sat May 29 17:10:45 2010 (r208645) @@ -219,8 +219,8 @@ extern struct vpglocks pa_lock[]; * pte mappings, nor can they be removed from their objects via * the object, and such pages are also not on any PQ queue. * - * PG_WRITEABLE is set exclusively by pmap_enter(). When it does so, the page - * must be VPO_BUSY. + * PG_WRITEABLE is set exclusively on managed pages by pmap_enter(). When it + * does so, the page must be VPO_BUSY. */ #define PG_CACHED 0x0001 /* page is cached */ #define PG_FREE 0x0002 /* page is free */ From owner-svn-src-head@FreeBSD.ORG Sat May 29 18:26:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A13F51065675; Sat, 29 May 2010 18:26:44 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 910B08FC0C; Sat, 29 May 2010 18:26:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4TIQimV093531; Sat, 29 May 2010 18:26:44 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4TIQisq093529; Sat, 29 May 2010 18:26:44 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005291826.o4TIQisq093529@svn.freebsd.org> From: Alan Cox Date: Sat, 29 May 2010 18:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208646 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 18:26:44 -0000 Author: alc Date: Sat May 29 18:26:44 2010 New Revision: 208646 URL: http://svn.freebsd.org/changeset/base/208646 Log: Don't set PG_WRITEABLE in pmap_enter() unless the page is managed. Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Sat May 29 17:10:45 2010 (r208645) +++ head/sys/ia64/ia64/pmap.c Sat May 29 18:26:44 2010 (r208646) @@ -1595,7 +1595,7 @@ validate: if (icache_inval) ia64_sync_icache(va, PAGE_SIZE); - if ((prot & VM_PROT_WRITE) != 0) + if ((prot & VM_PROT_WRITE) != 0 && managed) vm_page_flag_set(m, PG_WRITEABLE); vm_page_unlock_queues(); pmap_switch(oldpmap); From owner-svn-src-head@FreeBSD.ORG Sat May 29 20:24:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E680C1065673; Sat, 29 May 2010 20:24:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D53268FC0A; Sat, 29 May 2010 20:24:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4TKO1Rf019226; Sat, 29 May 2010 20:24:01 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4TKO1gf019223; Sat, 29 May 2010 20:24:01 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005292024.o4TKO1gf019223@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 29 May 2010 20:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208647 - in head: sbin/mount share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 20:24:02 -0000 Author: jilles Date: Sat May 29 20:24:01 2010 New Revision: 208647 URL: http://svn.freebsd.org/changeset/base/208647 Log: Clarify devfs manpages slightly. mount(8): add xref to devfs(5) devfs(5): change example to something more likely to be useful (it is not necessary to mount a devfs on /dev manually, but for chroots/jails it is often needed), mention since when devfs is preferred to device nodes on ufs PR: 146600 MFC after: 2 weeks Modified: head/sbin/mount/mount.8 head/share/man/man5/devfs.5 Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Sat May 29 18:26:44 2010 (r208646) +++ head/sbin/mount/mount.8 Sat May 29 20:24:01 2010 (r208647) @@ -525,6 +525,7 @@ support for a particular file system mig .Xr nmount 2 , .Xr acl 3 , .Xr mac 4 , +.Xr devfs 5 , .Xr ext2fs 5 , .Xr fstab 5 , .Xr procfs 5 , Modified: head/share/man/man5/devfs.5 ============================================================================== --- head/share/man/man5/devfs.5 Sat May 29 18:26:44 2010 (r208646) +++ head/share/man/man5/devfs.5 Sat May 29 20:24:01 2010 (r208647) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 1996 +.Dd May 29, 2010 .Dt DEVFS 5 .Os .Sh NAME @@ -80,9 +80,9 @@ mount point. To mount a .Nm volume located on -.Pa /dev : +.Pa /mychroot/dev : .Pp -.Dl "mount -t devfs devfs /dev" +.Dl "mount -t devfs devfs /mychroot/dev" .Sh SEE ALSO .Xr devfs 8 , .Xr mount 8 @@ -90,7 +90,9 @@ volume located on The .Nm file system first appeared in -.Fx 2.0 . +.Fx 2.0 +and became the preferred method for accessing devices in +.Fx 5.0 . The .Nm manual page first appeared in From owner-svn-src-head@FreeBSD.ORG Sat May 29 22:38:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC699106567E; Sat, 29 May 2010 22:38:03 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9EB8FC18; Sat, 29 May 2010 22:38:03 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id D2CE011BA59; Sat, 29 May 2010 17:38:02 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id TFZBHLU5PX48; Sat, 29 May 2010 17:38:02 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1078) From: Rui Paulo In-Reply-To: <201005291614.o4TGE2cM064435@svn.freebsd.org> Date: Sat, 29 May 2010 23:37:59 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <201005291614.o4TGE2cM064435@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.1078) Cc: Subject: Re: svn commit: r208644 - head/sys/dev/ath/ath_hal/ar5211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 22:38:04 -0000 On 29 May 2010, at 17:14, Rui Paulo wrote: > Author: rpaulo > Date: Sat May 29 16:14:02 2010 > New Revision: 208644 > URL: http://svn.freebsd.org/changeset/base/208644 > > Log: > Due to the way HALDEBUG() is defined, we need to add curly brackets > when using it as a sole if clause instruction. > While there, fix 'const static' typo. > > Submitted by: Arnaud Lacombe This should read alc@NetBSD.org. Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sat May 29 22:52:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79DD71065670; Sat, 29 May 2010 22:52:18 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 671B78FC12; Sat, 29 May 2010 22:52:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4TMqIg6055251; Sat, 29 May 2010 22:52:18 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4TMqIOU055249; Sat, 29 May 2010 22:52:18 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201005292252.o4TMqIOU055249@svn.freebsd.org> From: Gordon Tetlow Date: Sat, 29 May 2010 22:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208648 - head/usr.sbin/newsyslog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 22:52:18 -0000 Author: gordon Date: Sat May 29 22:52:17 2010 New Revision: 208648 URL: http://svn.freebsd.org/changeset/base/208648 Log: Convert newsyslog to using queue(3) macros instead of a home rolled version. Reviewed by: gad@ Approved by: wes@ (mentor) MFC after: 2 months Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sat May 29 20:24:01 2010 (r208647) +++ head/usr.sbin/newsyslog/newsyslog.c Sat May 29 22:52:17 2010 (r208648) @@ -113,6 +113,7 @@ __FBSDID("$FreeBSD$"); #define DEBUG_MARKER "" struct conf_entry { + STAILQ_ENTRY(conf_entry) cf_nextp; char *log; /* Name of the log */ char *pid_file; /* PID file */ char *r_reason; /* The reason this file is being rotated */ @@ -129,7 +130,6 @@ struct conf_entry { int flags; /* CE_COMPACT, CE_BZCOMPACT, CE_BINARY */ int sig; /* Signal to send */ int def_cfg; /* Using the rule for this file */ - struct conf_entry *next;/* Linked list pointer */ }; struct sigwork_entry { @@ -153,6 +153,7 @@ typedef enum { FREE_ENT, KEEP_ENT } fk_entry; +STAILQ_HEAD(cflist, conf_entry); SLIST_HEAD(swlisthead, sigwork_entry) swhead = SLIST_HEAD_INITIALIZER(swhead); SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); @@ -186,9 +187,9 @@ char daytime[DAYTIME_LEN]; /* The curren * used for rotation-tracking messages. */ char hostname[MAXHOSTNAMELEN]; /* hostname */ -static struct conf_entry *get_worklist(char **files); -static void parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, - struct conf_entry **glob_p, struct conf_entry **defconf_p); +static struct cflist *get_worklist(char **files); +static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, + struct conf_entry *defconf_p); static char *sob(char *p); static char *son(char *p); static int isnumberstr(const char *); @@ -205,9 +206,8 @@ static struct zipwork_entry * sigwork_entry *, int, const char *); static void set_swpid(struct sigwork_entry *, const struct conf_entry *); static int sizefile(const char *); -static void expand_globs(struct conf_entry **work_p, - struct conf_entry **glob_p); -static void free_clist(struct conf_entry **firstent); +static void expand_globs(struct cflist *work_p, struct cflist *glob_p); +static void free_clist(struct cflist *list); static void free_entry(struct conf_entry *ent); static struct conf_entry *init_entry(const char *fname, struct conf_entry *src_entry); @@ -233,8 +233,8 @@ static void createlog(const struct conf_ int main(int argc, char **argv) { - fk_entry free_or_keep; - struct conf_entry *p, *q; + struct cflist *worklist; + struct conf_entry *p; struct sigwork_entry *stmp; struct zipwork_entry *ztmp; @@ -247,18 +247,17 @@ main(int argc, char **argv) if (needroot && getuid() && geteuid()) errx(1, "must have root privs"); - p = q = get_worklist(argv); + worklist = get_worklist(argv); /* * Rotate all the files which need to be rotated. Note that * some users have *hundreds* of entries in newsyslog.conf! */ - while (p) { - free_or_keep = do_entry(p); - p = p->next; - if (free_or_keep == FREE_ENT) - free_entry(q); - q = p; + while (!STAILQ_EMPTY(worklist)) { + p = STAILQ_FIRST(worklist); + STAILQ_REMOVE_HEAD(worklist, cf_nextp); + if (do_entry(p) == FREE_ENT) + free_entry(p); } /* @@ -365,7 +364,6 @@ init_entry(const char *fname, struct con tempwork->sig = SIGHUP; tempwork->def_cfg = 0; } - tempwork->next = NULL; return (tempwork); } @@ -403,21 +401,18 @@ free_entry(struct conf_entry *ent) } static void -free_clist(struct conf_entry **firstent) +free_clist(struct cflist *list) { - struct conf_entry *ent, *nextent; - - if (firstent == NULL) - return; /* There is nothing to do. */ + struct conf_entry *ent; - ent = *firstent; - firstent = NULL; - - while (ent) { - nextent = ent->next; + while (!STAILQ_EMPTY(list)) { + ent = STAILQ_FIRST(list); + STAILQ_REMOVE_HEAD(list, cf_nextp); free_entry(ent); - ent = nextent; } + + free(list); + list = NULL; } static fk_entry @@ -732,17 +727,26 @@ usage(void) * Parse a configuration file and return a linked list of all the logs * which should be processed. */ -static struct conf_entry * +static struct cflist * get_worklist(char **files) { FILE *f; const char *fname; char **given; - struct conf_entry *defconf, *dupent, *ent, *firstnew; - struct conf_entry *globlist, *lastnew, *worklist; + struct cflist *filelist, *globlist, *cmdlist; + struct conf_entry *defconf, *dupent, *ent; int gmatch, fnres; - defconf = globlist = worklist = NULL; + defconf = NULL; + + filelist = malloc(sizeof(struct cflist)); + if (filelist == NULL) + err(1, "malloc of filelist"); + STAILQ_INIT(filelist); + globlist = malloc(sizeof(struct cflist)); + if (globlist == NULL) + err(1, "malloc of globlist"); + STAILQ_INIT(globlist); fname = conf; if (fname == NULL) @@ -757,22 +761,22 @@ get_worklist(char **files) if (!f) err(1, "%s", fname); - parse_file(f, fname, &worklist, &globlist, &defconf); + parse_file(f, filelist, globlist, defconf); (void) fclose(f); /* * All config-file information has been read in and turned into - * a worklist and a globlist. If there were no specific files + * a filelist and a globlist. If there were no specific files * given on the run command, then the only thing left to do is to * call a routine which finds all files matched by the globlist - * and adds them to the worklist. Then return the worklist. + * and adds them to the filelist. Then return the worklist. */ if (*files == NULL) { - expand_globs(&worklist, &globlist); - free_clist(&globlist); + expand_globs(filelist, globlist); + free_clist(globlist); if (defconf != NULL) free_entry(defconf); - return (worklist); + return (filelist); /* NOTREACHED */ } @@ -794,7 +798,7 @@ get_worklist(char **files) * If newsyslog was run with a list of specific filenames, * then create a new worklist which has only those files in * it, picking up the rotation-rules for those files from - * the original worklist. + * the original filelist. * * XXX - Note that this will copy multiple rules for a single * logfile, if multiple entries are an exact match for @@ -802,21 +806,21 @@ get_worklist(char **files) * we want to continue to allow it? If so, it should * probably be handled more intelligently. */ - firstnew = lastnew = NULL; + cmdlist = malloc(sizeof(struct cflist)); + if (cmdlist == NULL) + err(1, "malloc of cmdlist"); + STAILQ_INIT(cmdlist); + for (given = files; *given; ++given) { /* * First try to find exact-matches for this given file. */ gmatch = 0; - for (ent = worklist; ent; ent = ent->next) { + STAILQ_FOREACH(ent, filelist, cf_nextp) { if (strcmp(ent->log, *given) == 0) { gmatch++; dupent = init_entry(*given, ent); - if (!firstnew) - firstnew = dupent; - else - lastnew->next = dupent; - lastnew = dupent; + STAILQ_INSERT_TAIL(cmdlist, dupent, cf_nextp); } } if (gmatch) { @@ -832,7 +836,7 @@ get_worklist(char **files) gmatch = 0; if (verbose > 2 && globlist != NULL) printf("\t+ Checking globs for %s\n", *given); - for (ent = globlist; ent; ent = ent->next) { + STAILQ_FOREACH(ent, globlist, cf_nextp) { fnres = fnmatch(ent->log, *given, FNM_PATHNAME); if (verbose > 2) printf("\t+ = %d for pattern %s\n", fnres, @@ -840,13 +844,9 @@ get_worklist(char **files) if (fnres == 0) { gmatch++; dupent = init_entry(*given, ent); - if (!firstnew) - firstnew = dupent; - else - lastnew->next = dupent; - lastnew = dupent; /* This new entry is not a glob! */ dupent->flags &= ~CE_GLOB; + STAILQ_INSERT_TAIL(cmdlist, dupent, cf_nextp); /* Only allow a match to one glob-entry */ break; } @@ -866,25 +866,21 @@ get_worklist(char **files) printf("\t+ No entry matched %s (will use %s)\n", *given, DEFAULT_MARKER); dupent = init_entry(*given, defconf); - if (!firstnew) - firstnew = dupent; - else - lastnew->next = dupent; /* Mark that it was *not* found in a config file */ dupent->def_cfg = 1; - lastnew = dupent; + STAILQ_INSERT_TAIL(cmdlist, dupent, cf_nextp); } /* * Free all the entries in the original work list, the list of * glob entries, and the default entry. */ - free_clist(&worklist); - free_clist(&globlist); + free_clist(filelist); + free_clist(globlist); free_entry(defconf); /* And finally, return a worklist which matches the given files. */ - return (firstnew); + return (cmdlist); } /* @@ -892,19 +888,15 @@ get_worklist(char **files) * which match those glob-entries onto the worklist. */ static void -expand_globs(struct conf_entry **work_p, struct conf_entry **glob_p) +expand_globs(struct cflist *work_p, struct cflist *glob_p) { int gmatch, gres; size_t i; char *mfname; - struct conf_entry *dupent, *ent, *firstmatch, *globent; - struct conf_entry *lastmatch; + struct conf_entry *dupent, *ent, *globent; glob_t pglob; struct stat st_fm; - if ((glob_p == NULL) || (*glob_p == NULL)) - return; /* There is nothing to do. */ - /* * The worklist contains all fully-specified (non-GLOB) names. * @@ -913,9 +905,7 @@ expand_globs(struct conf_entry **work_p, * that already exist. Do not add a glob-related entry for any * file which already exists in the fully-specified list. */ - firstmatch = lastmatch = NULL; - for (globent = *glob_p; globent; globent = globent->next) { - + STAILQ_FOREACH(globent, glob_p, cf_nextp) { gres = glob(globent->log, GLOB_NOCHECK, NULL, &pglob); if (gres != 0) { warn("cannot expand pattern (%d): %s", gres, @@ -930,7 +920,7 @@ expand_globs(struct conf_entry **work_p, /* See if this file already has a specific entry. */ gmatch = 0; - for (ent = *work_p; ent; ent = ent->next) { + STAILQ_FOREACH(ent, work_p, cf_nextp) { if (strcmp(mfname, ent->log) == 0) { gmatch++; break; @@ -957,29 +947,16 @@ expand_globs(struct conf_entry **work_p, if (verbose > 2) printf("\t+ . add file %s\n", mfname); dupent = init_entry(mfname, globent); - if (!firstmatch) - firstmatch = dupent; - else - lastmatch->next = dupent; - lastmatch = dupent; /* This new entry is not a glob! */ dupent->flags &= ~CE_GLOB; + + /* Add to the worklist. */ + STAILQ_INSERT_TAIL(work_p, dupent, cf_nextp); } globfree(&pglob); if (verbose > 2) printf("\t+ Done with pattern %s\n", globent->log); } - - /* Add the list of matched files to the end of the worklist. */ - if (!*work_p) - *work_p = firstmatch; - else { - ent = *work_p; - while (ent->next) - ent = ent->next; - ent->next = firstmatch; - } - } /* @@ -987,22 +964,16 @@ expand_globs(struct conf_entry **work_p, * process. */ static void -parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, - struct conf_entry **glob_p, struct conf_entry **defconf_p) +parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, + struct conf_entry *defconf_p) { char line[BUFSIZ], *parse, *q; char *cp, *errline, *group; - struct conf_entry *lastglob, *lastwork, *working; + struct conf_entry *working; struct passwd *pwd; struct group *grp; int eol, ptm_opts, res, special; - /* - * XXX - for now, assume that only one config file will be read, - * ie, this routine is only called one time. - */ - lastglob = lastwork = NULL; - errline = NULL; while (fgets(line, BUFSIZ, cf)) { if ((line[0] == '\n') || (line[0] == '#') || @@ -1032,7 +1003,7 @@ parse_file(FILE *cf, const char *cfname, /* * Allow people to set debug options via the config file. - * (NOTE: debug optons are undocumented, and may disappear + * (NOTE: debug options are undocumented, and may disappear * at any time, etc). */ if (strcasecmp(DEBUG_MARKER, q) == 0) { @@ -1052,17 +1023,12 @@ parse_file(FILE *cf, const char *cfname, working = init_entry(q, NULL); if (strcasecmp(DEFAULT_MARKER, q) == 0) { special = 1; - if (defconf_p == NULL) { - warnx("Ignoring entry for %s in %s!", q, - cfname); - free_entry(working); - continue; - } else if (*defconf_p != NULL) { + if (defconf_p != NULL) { warnx("Ignoring duplicate entry for %s!", q); free_entry(working); continue; } - *defconf_p = working; + defconf_p = working; } q = parse = missing_field(sob(++parse), errline); @@ -1328,17 +1294,9 @@ no_trimat: if (special) { ; /* Do not add to any list */ } else if (working->flags & CE_GLOB) { - if (!*glob_p) - *glob_p = working; - else - lastglob->next = working; - lastglob = working; + STAILQ_INSERT_TAIL(glob_p, working, cf_nextp); } else { - if (!*work_p) - *work_p = working; - else - lastwork->next = working; - lastwork = working; + STAILQ_INSERT_TAIL(work_p, working, cf_nextp); } } if (errline != NULL) From owner-svn-src-head@FreeBSD.ORG Sat May 29 22:55:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 966621065670; Sat, 29 May 2010 22:55:59 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 840368FC12; Sat, 29 May 2010 22:55:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4TMtxh9056398; Sat, 29 May 2010 22:55:59 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4TMtxmT056395; Sat, 29 May 2010 22:55:59 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201005292255.o4TMtxmT056395@svn.freebsd.org> From: Gordon Tetlow Date: Sat, 29 May 2010 22:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208649 - head/usr.sbin/newsyslog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 22:55:59 -0000 Author: gordon Date: Sat May 29 22:55:59 2010 New Revision: 208649 URL: http://svn.freebsd.org/changeset/base/208649 Log: Add file include processing for newsyslog. Format for the include line in /etc/newsyslog.conf is: /etc/defaults/newsyslog.conf Other notes of interest: Globbing is supported in statements. Properly detect circular include loop dependencies. Reviewed by: gad@ Approved by: wes@ (mentor) MFC after: 2 months Modified: head/usr.sbin/newsyslog/newsyslog.c head/usr.sbin/newsyslog/newsyslog.conf.5 Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sat May 29 22:52:17 2010 (r208648) +++ head/usr.sbin/newsyslog/newsyslog.c Sat May 29 22:55:59 2010 (r208649) @@ -111,6 +111,7 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_MARKER "" #define DEBUG_MARKER "" +#define INCLUDE_MARKER "" struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; @@ -149,6 +150,11 @@ struct zipwork_entry { char zw_fname[1]; /* the file to compress */ }; +struct include_entry { + STAILQ_ENTRY(include_entry) inc_nextp; + const char *file; /* Name of file to process */ +}; + typedef enum { FREE_ENT, KEEP_ENT } fk_entry; @@ -156,6 +162,7 @@ typedef enum { STAILQ_HEAD(cflist, conf_entry); SLIST_HEAD(swlisthead, sigwork_entry) swhead = SLIST_HEAD_INITIALIZER(swhead); SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); +STAILQ_HEAD(ilist, include_entry); int dbg_at_times; /* -D Show details of 'trim_at' code */ @@ -189,10 +196,12 @@ char hostname[MAXHOSTNAMELEN]; /* hostna static struct cflist *get_worklist(char **files); static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry *defconf_p); + struct conf_entry *defconf_p, struct ilist *inclist); +static void add_to_queue(const char *fname, struct ilist *inclist); static char *sob(char *p); static char *son(char *p); static int isnumberstr(const char *); +static int isglobstr(const char *); static char *missing_field(char *p, char *errline); static void change_attrs(const char *, const struct conf_entry *); static fk_entry do_entry(struct conf_entry *); @@ -731,13 +740,15 @@ static struct cflist * get_worklist(char **files) { FILE *f; - const char *fname; char **given; - struct cflist *filelist, *globlist, *cmdlist; + struct cflist *cmdlist, *filelist, *globlist; struct conf_entry *defconf, *dupent, *ent; + struct ilist inclist; + struct include_entry *inc; int gmatch, fnres; defconf = NULL; + STAILQ_INIT(&inclist); filelist = malloc(sizeof(struct cflist)); if (filelist == NULL) @@ -748,21 +759,29 @@ get_worklist(char **files) err(1, "malloc of globlist"); STAILQ_INIT(globlist); - fname = conf; - if (fname == NULL) - fname = _PATH_CONF; + inc = malloc(sizeof(struct include_entry)); + if (inc == NULL) + err(1, "malloc of inc"); + inc->file = conf; + if (inc->file == NULL) + inc->file = _PATH_CONF; + STAILQ_INSERT_TAIL(&inclist, inc, inc_nextp); + + STAILQ_FOREACH(inc, &inclist, inc_nextp) { + if (strcmp(inc->file, "-") != 0) + f = fopen(inc->file, "r"); + else { + f = stdin; + inc->file = ""; + } + if (!f) + err(1, "%s", inc->file); - if (strcmp(fname, "-") != 0) - f = fopen(fname, "r"); - else { - f = stdin; - fname = ""; + if (verbose) + printf("Processing %s\n", inc->file); + parse_file(f, filelist, globlist, defconf, &inclist); + (void) fclose(f); } - if (!f) - err(1, "%s", fname); - - parse_file(f, filelist, globlist, defconf); - (void) fclose(f); /* * All config-file information has been read in and turned into @@ -965,14 +984,16 @@ expand_globs(struct cflist *work_p, stru */ static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry *defconf_p) + struct conf_entry *defconf_p, struct ilist *inclist) { char line[BUFSIZ], *parse, *q; char *cp, *errline, *group; struct conf_entry *working; struct passwd *pwd; struct group *grp; + glob_t pglob; int eol, ptm_opts, res, special; + size_t i; errline = NULL; while (fgets(line, BUFSIZ, cf)) { @@ -1017,6 +1038,37 @@ parse_file(FILE *cf, struct cflist *work parse_doption(q); } continue; + } else if (strcasecmp(INCLUDE_MARKER, q) == 0) { + if (verbose) + printf("Found: %s", errline); + q = parse = missing_field(sob(++parse), errline); + parse = son(parse); + if (!*parse) { + warnx("include line missing argument:\n%s", + errline); + continue; + } + + *parse = '\0'; + + if (isglobstr(q)) { + res = glob(q, GLOB_NOCHECK, NULL, &pglob); + if (res != 0) { + warn("cannot expand pattern (%d): %s", + res, q); + continue; + } + + if (verbose > 2) + printf("\t+ Expanding pattern %s\n", q); + + for (i = 0; i < pglob.gl_matchc; i++) + add_to_queue(pglob.gl_pathv[i], + inclist); + globfree(&pglob); + } else + add_to_queue(q, inclist); + continue; } special = 0; @@ -1312,6 +1364,33 @@ missing_field(char *p, char *errline) return (p); } +/* + * Only add to the queue if the file hasn't already been added. This is + * done to prevent circular include loops. + */ +static void +add_to_queue(const char *fname, struct ilist *inclist) +{ + struct include_entry *inc; + + STAILQ_FOREACH(inc, inclist, inc_nextp) { + if (strcmp(fname, inc->file) == 0) { + warnx("duplicate include detected: %s", fname); + return; + } + } + + inc = malloc(sizeof(struct include_entry)); + if (inc == NULL) + err(1, "malloc of inc"); + inc->file = strdup(fname); + + if (verbose > 2) + printf("\t+ Adding %s to the processing queue.\n", fname); + + STAILQ_INSERT_TAIL(inclist, inc, inc_nextp); +} + static fk_entry do_rotate(const struct conf_entry *ent) { @@ -1916,6 +1995,19 @@ isnumberstr(const char *string) return (1); } +/* Check if string contains a glob */ +static int +isglobstr(const char *string) +{ + char chr; + + while ((chr = *string++)) { + if (chr == '*' || chr == '?' || chr == '[') + return (1); + } + return (0); +} + /* * Save the active log file under a new name. A link to the new name * is the quick-and-easy way to do this. If that fails (which it will Modified: head/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.conf.5 Sat May 29 22:52:17 2010 (r208648) +++ head/usr.sbin/newsyslog/newsyslog.conf.5 Sat May 29 22:55:59 2010 (r208649) @@ -69,13 +69,18 @@ is treated as an ordinary character. The fields of the configuration file are as follows: .Bl -tag -width indent .It Ar logfile_name -Name of the system log file to be archived, or the literal string -.Dq Aq Li default . +Name of the system log file to be archived, +or one of the literal strings +.Dq Aq Li default , +or +.Dq Aq Li include . The special default entry will only be used if a log file name is given as a command line argument to .Xr newsyslog 8 , and if that log file name is not matched by any other line in the configuration file. +The include entry is used to include other configuration +files and supports globbing. .It Ar owner : Ns Ar group This optional field specifies the owner and group for the archive file. The