From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 00:38:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46DAF106564A; Sun, 24 Jun 2012 00:38:15 +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 DD4F78FC0A; Sun, 24 Jun 2012 00:38:14 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q5O0cDZh045433; Sun, 24 Jun 2012 02:38:13 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q5O0cDjR045432; Sun, 24 Jun 2012 02:38:13 +0200 (CEST) (envelope-from marius) Date: Sun, 24 Jun 2012 02:38:13 +0200 From: Marius Strobl To: John Baldwin Message-ID: <20120624003813.GA45417@alchemy.franken.de> References: <201206131504.q5DF4opt031336@svn.freebsd.org> <20120623221626.GH69382@alchemy.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120623221626.GH69382@alchemy.franken.de> 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: r237008 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 00:38:15 -0000 On Sun, Jun 24, 2012 at 12:16:26AM +0200, Marius Strobl wrote: > On Wed, Jun 13, 2012 at 03:04:50PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Wed Jun 13 15:04:50 2012 > > New Revision: 237008 > > URL: http://svn.freebsd.org/changeset/base/237008 > > > > Log: > > Fix a couple of bugs that prevented windows in PCI-PCI bridges from > > growing "downward" (moving the start address down). First, an off by > > one error caused the end address to be moved down an extra alignment > > chunk unnecessarily. Second, when aligning the new candidate starting > > address, the wrong bits were masked off. > > > > Unfortunately, this now panics a sparc64 machine on the first attempt > to use a grown resource via bus_space(9) for me: > pcib3: at device 0.0 on pci2 > pcib2: allocated I/O port range (0x1000-0x1fff) for rid 1c of pcib3 > pcib2: allocated memory range (0x200000-0x3ffffff) for rid 20 of pcib3 > pcib3: domain 0 > pcib3: secondary bus 5 > pcib3: subordinate bus 5 > pcib3: I/O decode 0x1000-0x1fff > pcib3: memory decode 0x200000-0x3ffffff > pcib3: no prefetched decode > pcib3: Subtractively decoded bridge. > <...> > pci3: on pcib3 > <...> > isab0: at device 30.0 on pci3 > isa0: on isab0 > <...> > rtc0: at port 0x70-0x73 on isa0 > pcib3: attempting to grow I/O port window for (0x70-0x73,0x4) > front candidate range: 0x70-0x73 > pcib3: grew I/O port window to 0x70-0x1fff > panic: start address is not aligned > Alternatively, this may also be a data access trap, which also indicates > that some invalid address being used for the access. Eh, the type of panic obviously is based on whether the kernel is built with INVARIANTS enabled or not ... trying to figure out too many regressions in head concurrently ... > > before: > rtc0: at port 0x70-0x73 on isa0 > pcib3: attempting to grow I/O port window for (0x70-0x73,0x4) > pcib2: allocated I/O port range (0x70-0x73) for rid 0 of rtc0 > > Shouldn't a subtractively decoded resource actually be outside of > the window of the parent PCI-PCI bridge, i.e. it seems we shouldn't > try to grow the window in that case? The below patch fixes this for > me, I'm not sure whether that actually is the right approach though. > > Marius > > Index: pci_pci.c > =================================================================== > --- pci_pci.c (revision 237511) > +++ pci_pci.c (working copy) > @@ -1038,7 +1038,7 @@ pcib_alloc_resource(device_t dev, device_t child, > case SYS_RES_IOPORT: > r = pcib_suballoc_resource(sc, &sc->io, child, type, rid, start, > end, count, flags); > - if (r != NULL) > + if (r != NULL || (sc->flags & PCIB_SUBTRACTIVE) != 0) > break; > if (pcib_grow_window(sc, &sc->io, type, start, end, count, > flags) == 0) > @@ -1062,7 +1062,7 @@ pcib_alloc_resource(device_t dev, device_t child, > } > r = pcib_suballoc_resource(sc, &sc->mem, child, type, rid, > start, end, count, flags); > - if (r != NULL) > + if (r != NULL || (sc->flags & PCIB_SUBTRACTIVE) != 0) > break; > if (flags & RF_PREFETCHABLE) { > if (pcib_grow_window(sc, &sc->pmem, type, start, end, From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 04:15:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87E851065670; Sun, 24 Jun 2012 04:15:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 706898FC08; Sun, 24 Jun 2012 04:15:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O4FxQU086467; Sun, 24 Jun 2012 04:15:59 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O4FwP8086451; Sun, 24 Jun 2012 04:15:58 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201206240415.q5O4FwP8086451@svn.freebsd.org> From: Andrew Turner Date: Sun, 24 Jun 2012 04:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237517 - in head: include sys/arm/include sys/ia64/include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 04:15:59 -0000 Author: andrew Date: Sun Jun 24 04:15:58 2012 New Revision: 237517 URL: http://svn.freebsd.org/changeset/base/237517 Log: Make the wchar_t type machine dependent. This is required for ARM EABI. Section 7.1.1 of the Procedure Call for the ARM Architecture (AAPCS) defines wchar_t as either an unsigned int or an unsigned short with the former preferred. Because of this requirement we need to move the definition of __wchar_t to a machine dependent header. It also cleans up the macros defining the limits of wchar_t by defining __WCHAR_MIN and __WCHAR_MAX in the same machine dependent header then using them to define WCHAR_MIN and WCHAR_MAX respectively. Discussed with: bde Modified: head/include/wchar.h head/sys/arm/include/_stdint.h head/sys/arm/include/_types.h head/sys/ia64/include/_stdint.h head/sys/ia64/include/_types.h head/sys/mips/include/_stdint.h head/sys/mips/include/_types.h head/sys/powerpc/include/_stdint.h head/sys/powerpc/include/_types.h head/sys/sparc64/include/_stdint.h head/sys/sparc64/include/_types.h head/sys/sys/_types.h head/sys/sys/stdint.h head/sys/x86/include/_stdint.h head/sys/x86/include/_types.h Modified: head/include/wchar.h ============================================================================== --- head/include/wchar.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/include/wchar.h Sun Jun 24 04:15:58 2012 (r237517) @@ -88,10 +88,8 @@ typedef __wint_t wint_t; #define _WINT_T_DECLARED #endif -#ifndef WCHAR_MIN -#define WCHAR_MIN __INT_MIN -#define WCHAR_MAX __INT_MAX -#endif +#define WCHAR_MIN __WCHAR_MIN +#define WCHAR_MAX __WCHAR_MAX #ifndef WEOF #define WEOF ((wint_t)-1) Modified: head/sys/arm/include/_stdint.h ============================================================================== --- head/sys/arm/include/_stdint.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/arm/include/_stdint.h Sun Jun 24 04:15:58 2012 (r237517) @@ -149,12 +149,6 @@ /* Limit of size_t. */ #define SIZE_MAX UINT32_MAX -#ifndef WCHAR_MIN /* Also possibly defined in */ -/* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX -#endif - /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX Modified: head/sys/arm/include/_types.h ============================================================================== --- head/sys/arm/include/_types.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/arm/include/_types.h Sun Jun 24 04:15:58 2012 (r237517) @@ -105,6 +105,16 @@ typedef __uint32_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint32_t __vm_size_t; +#ifdef __ARM_EABI__ +typedef unsigned int __wchar_t; +#define __WCHAR_MIN 0 /* min value for a wchar_t */ +#define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ +#else +typedef int __wchar_t; +#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ +#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ +#endif + /* * Unusual type definitions. */ Modified: head/sys/ia64/include/_stdint.h ============================================================================== --- head/sys/ia64/include/_stdint.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/ia64/include/_stdint.h Sun Jun 24 04:15:58 2012 (r237517) @@ -149,12 +149,6 @@ /* Limit of size_t. */ #define SIZE_MAX UINT64_MAX -#ifndef WCHAR_MIN /* Also possibly defined in */ -/* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX -#endif - /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX Modified: head/sys/ia64/include/_types.h ============================================================================== --- head/sys/ia64/include/_types.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/ia64/include/_types.h Sun Jun 24 04:15:58 2012 (r237517) @@ -96,6 +96,10 @@ typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; +typedef int __wchar_t; + +#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ +#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ /* * Unusual type definitions. Modified: head/sys/mips/include/_stdint.h ============================================================================== --- head/sys/mips/include/_stdint.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/mips/include/_stdint.h Sun Jun 24 04:15:58 2012 (r237517) @@ -186,12 +186,6 @@ #define SIG_ATOMIC_MIN INT32_MIN #define SIG_ATOMIC_MAX INT32_MAX -#ifndef WCHAR_MIN /* Also possibly defined in */ -/* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX -#endif - /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX Modified: head/sys/mips/include/_types.h ============================================================================== --- head/sys/mips/include/_types.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/mips/include/_types.h Sun Jun 24 04:15:58 2012 (r237517) @@ -145,6 +145,10 @@ typedef __uint32_t __vm_paddr_t; typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_pindex_t; +typedef int __wchar_t; + +#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ +#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ /* * Unusual type definitions. Modified: head/sys/powerpc/include/_stdint.h ============================================================================== --- head/sys/powerpc/include/_stdint.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/powerpc/include/_stdint.h Sun Jun 24 04:15:58 2012 (r237517) @@ -189,12 +189,6 @@ #define SIZE_MAX UINT32_MAX #endif -#ifndef WCHAR_MIN /* Also possibly defined in */ -/* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX -#endif - /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX Modified: head/sys/powerpc/include/_types.h ============================================================================== --- head/sys/powerpc/include/_types.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/powerpc/include/_types.h Sun Jun 24 04:15:58 2012 (r237517) @@ -133,6 +133,10 @@ typedef __uint32_t __vm_size_t; #endif typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_pindex_t; +typedef int __wchar_t; + +#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ +#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ /* * Unusual type definitions. Modified: head/sys/sparc64/include/_stdint.h ============================================================================== --- head/sys/sparc64/include/_stdint.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/sparc64/include/_stdint.h Sun Jun 24 04:15:58 2012 (r237517) @@ -149,12 +149,6 @@ /* Limit of size_t. */ #define SIZE_MAX UINT64_MAX -#ifndef WCHAR_MIN /* Also possibly defined in */ -/* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX -#endif - /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX Modified: head/sys/sparc64/include/_types.h ============================================================================== --- head/sys/sparc64/include/_types.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/sparc64/include/_types.h Sun Jun 24 04:15:58 2012 (r237517) @@ -92,6 +92,10 @@ typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; +typedef int __wchar_t; + +#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ +#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ /* * Unusual type definitions. Modified: head/sys/sys/_types.h ============================================================================== --- head/sys/sys/_types.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/sys/_types.h Sun Jun 24 04:15:58 2012 (r237517) @@ -80,14 +80,13 @@ typedef int __cpusetid_t; /* cpuset ide * ANSI C), but they use __ct_rune_t instead of int. * * NOTE: rune_t is not covered by ANSI nor other standards, and should not - * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and - * rune_t must be the same type. Also, wint_t must be no narrower than - * wchar_t, and should be able to hold all members of the largest - * character set plus one extra value (WEOF), and must be at least 16 bits. + * be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and + * rune_t must be the same type. Also, wint_t should be able to hold all + * members of the largest character set plus one extra value (WEOF), and + * must be at least 16 bits. */ typedef int __ct_rune_t; /* arg type for ctype funcs */ typedef __ct_rune_t __rune_t; /* rune_t (see above) */ -typedef __ct_rune_t __wchar_t; /* wchar_t (see above) */ typedef __ct_rune_t __wint_t; /* wint_t (see above) */ typedef __uint32_t __dev_t; /* device number */ Modified: head/sys/sys/stdint.h ============================================================================== --- head/sys/sys/stdint.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/sys/stdint.h Sun Jun 24 04:15:58 2012 (r237517) @@ -71,4 +71,8 @@ typedef __uintmax_t uintmax_t; #define __WORDSIZE 32 #endif +/* Limits of wchar_t. */ +#define WCHAR_MIN __WCHAR_MIN +#define WCHAR_MAX __WCHAR_MAX + #endif /* !_SYS_STDINT_H_ */ Modified: head/sys/x86/include/_stdint.h ============================================================================== --- head/sys/x86/include/_stdint.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/x86/include/_stdint.h Sun Jun 24 04:15:58 2012 (r237517) @@ -180,12 +180,6 @@ #define SIZE_MAX UINT32_MAX #endif -#ifndef WCHAR_MIN /* Also possibly defined in */ -/* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX -#endif - /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Sun Jun 24 01:32:42 2012 (r237516) +++ head/sys/x86/include/_types.h Sun Jun 24 04:15:58 2012 (r237517) @@ -142,6 +142,10 @@ typedef __uint32_t __vm_size_t; #endif typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_pindex_t; +typedef int __wchar_t; + +#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ +#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ /* * Unusual type definitions. From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 04:29:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9423106566C; Sun, 24 Jun 2012 04:29:03 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C16768FC0C; Sun, 24 Jun 2012 04:29:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O4T33h087021; Sun, 24 Jun 2012 04:29:03 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O4T3D7087012; Sun, 24 Jun 2012 04:29:03 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206240429.q5O4T3D7087012@svn.freebsd.org> From: "Kenneth D. Merry" Date: Sun, 24 Jun 2012 04:29: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: r237518 - in head: share/man/man9 sys/cam/scsi sys/dev/xen/blkfront sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 04:29:04 -0000 Author: ken Date: Sun Jun 24 04:29:03 2012 New Revision: 237518 URL: http://svn.freebsd.org/changeset/base/237518 Log: Fix a bug which causes a panic in daopen(). The panic is caused by a da(4) instance going away while GEOM is still probing it. In this case, the GEOM disk class instance has been created by disk_create(), and the taste of the disk is queued in the GEOM event queue. While that event is queued, the da(4) instance goes away. When the open call comes into the da(4) driver, it dereferences the freed (but non-NULL) peripheral pointer provided by GEOM, which results in a panic. The solution is to add a callback to the GEOM disk code that is called when all of its resources are cleaned up. This is implemented inside GEOM by adding an optional callback that is called when all consumers have detached from a provider, and the provider is about to be deleted. scsi_cd.c, scsi_da.c: In the register routine for the cd(4) and da(4) routines, acquire a reference to the CAM peripheral instance just before we call disk_create(). Use the new GEOM disk d_gone() callback to register a callback (dadiskgonecb()/cddiskgonecb()) that decrements the peripheral reference count once GEOM has finished cleaning up its resources. In the cd(4) driver, clean up open and close behavior slightly. GEOM makes sure we only get one open() and one close call, so there is no need to set an open flag and decrement the reference count if we are not the first open. In the cd(4) driver, use cam_periph_release_locked() in a couple of error scenarios to avoid extra mutex calls. geom.h: Add a new, optional, providergone callback that is called when a provider is about to be deleted. geom_disk.h: Add a new d_gone() callback to the GEOM disk interface. Bump the DISK_VERSION to version 2. This probably should have been done after a couple of previous changes, especially the addition of the d_getattr() callback. geom_disk.c: Add a providergone callback for the disk class, g_disk_providergone(), that calls the user's d_gone() callback if it exists. Bump the DISK_VERSION to 2. geom_subr.c: In g_destroy_provider(), call the providergone callback if it has been provided. In g_new_geomf(), propagate the class's providergone callback to the new geom instance. blkfront.c: Callers of disk_create() are supposed to pass in DISK_VERSION, not an explicit disk API version number. Update the blkfront driver to do that. disk.9: Update the disk(9) man page to include information on the new d_gone() callback, as well as the previously added d_getattr() callback, d_descr field, and HBA PCI ID fields. MFC after: 5 days Modified: head/share/man/man9/disk.9 head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/dev/xen/blkfront/blkfront.c head/sys/geom/geom.h head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/sys/geom/geom_subr.c Modified: head/share/man/man9/disk.9 ============================================================================== --- head/share/man/man9/disk.9 Sun Jun 24 04:15:58 2012 (r237517) +++ head/share/man/man9/disk.9 Sun Jun 24 04:29:03 2012 (r237518) @@ -145,6 +145,16 @@ Optional: if configured with .Xr dumpon 8 , this function is invoked from a very restricted system state after a kernel panic to record a copy of the system RAM to the disk. +.It Vt "disk_getattr_t *" Va d_getattr +Optional: if this method is provided, it gives the disk driver the +opportunity to override the default GEOM response to BIO_GETATTR requests. +This function should return -1 if the attribute is not handled, 0 if the +attribute is handled, or an errno to be passed to g_io_deliver(). +.It Vt "disk_gone_t *" Va d_gone +Optional: if this method is provided, it will be called after disk_gone() +is called, once GEOM has finished its cleanup process. +Once this callback is called, it is safe for the disk driver to free all of +its resources, as it will not be receiving further calls from GEOM. .El .Ss Mandatory Media Properties The following fields identify the size and granularity of the disk device. @@ -180,7 +190,23 @@ Please see .Pa src/sys/geom/notes for details. .It Vt char Va d_ident[DISK_IDENT_SIZE] -This field can and should be used to store disk's serial number. +This field can and should be used to store disk's serial number if the +d_getattr method described above isn't implemented, or if it does not +support the GEOM::ident attribute. +.It Vt char Va d_descr[DISK_IDENT_SIZE] +This field can be used to store the disk vendor and product description. +.It Vt uint16_t Va d_hba_vendor +This field can be used to store the PCI vendor ID for the HBA connected to +the disk. +.It Vt uint16_t Va d_hba_device +This field can be used to store the PCI device ID for the HBA connected to +the disk. +.It Vt uint16_t Va d_hba_subvendor +This field can be used to store the PCI subvendor ID for the HBA connected to +the disk. +.It Vt uint16_t Va d_hba_subdevice +This field can be used to store the PCI subdevice ID for the HBA connected to +the disk. .El .Ss Driver Private Data This field may be used by the device driver to store a pointer to Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Sun Jun 24 04:15:58 2012 (r237517) +++ head/sys/cam/scsi/scsi_cd.c Sun Jun 24 04:29:03 2012 (r237518) @@ -103,8 +103,7 @@ typedef enum { CD_FLAG_RETRY_UA = 0x0200, CD_FLAG_VALID_MEDIA = 0x0400, CD_FLAG_VALID_TOC = 0x0800, - CD_FLAG_SCTX_INIT = 0x1000, - CD_FLAG_OPEN = 0x2000 + CD_FLAG_SCTX_INIT = 0x1000 } cd_flags; typedef enum { @@ -358,6 +357,20 @@ cdinit(void) } } +/* + * Callback from GEOM, called when it has finished cleaning up its + * resources. + */ +static void +cddiskgonecb(struct disk *dp) +{ + struct cam_periph *periph; + + periph = (struct cam_periph *)dp->d_drv1; + + cam_periph_release(periph); +} + static void cdoninvalidate(struct cam_periph *periph) { @@ -389,7 +402,7 @@ cdoninvalidate(struct cam_periph *periph camq_remove(&softc->changer->devq, softc->pinfo.index); disk_gone(softc->disk); - xpt_print(periph->path, "lost device\n"); + xpt_print(periph->path, "lost device, %d refs\n", periph->refcount); } static void @@ -726,6 +739,7 @@ cdregister(struct cam_periph *periph, vo softc->disk->d_open = cdopen; softc->disk->d_close = cdclose; softc->disk->d_strategy = cdstrategy; + softc->disk->d_gone = cddiskgonecb; softc->disk->d_ioctl = cdioctl; softc->disk->d_name = "cd"; cam_strvis(softc->disk->d_descr, cgd->inq_data.vendor, @@ -747,6 +761,19 @@ cdregister(struct cam_periph *periph, vo softc->disk->d_hba_device = cpi.hba_device; softc->disk->d_hba_subvendor = cpi.hba_subvendor; softc->disk->d_hba_subdevice = cpi.hba_subdevice; + + /* + * Acquire a reference to the periph before we register with GEOM. + * We'll release this reference once GEOM calls us back (via + * dadiskgonecb()) telling us that our provider has been freed. + */ + if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + xpt_print(periph->path, "%s: lost periph during " + "registration!\n", __func__); + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } + disk_create(softc->disk, DISK_VERSION); cam_periph_lock(periph); @@ -1000,14 +1027,14 @@ cdopen(struct disk *dp) cam_periph_lock(periph); if (softc->flags & CD_FLAG_INVALID) { + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return(ENXIO); } if ((error = cam_periph_hold(periph, PRIBIO | PCATCH)) != 0) { + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return (error); } @@ -1024,14 +1051,7 @@ cdopen(struct disk *dp) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("leaving cdopen\n")); cam_periph_unhold(periph); - /* Closes aren't symmetrical with opens, so fix up the refcounting. */ - if ((softc->flags & CD_FLAG_OPEN) == 0) { - softc->flags |= CD_FLAG_OPEN; - cam_periph_unlock(periph); - } else { - cam_periph_unlock(periph); - cam_periph_release(periph); - } + cam_periph_unlock(periph); return (0); } @@ -1070,11 +1090,11 @@ cdclose(struct disk *dp) /* * We'll check the media and toc again at the next open(). */ - softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC|CD_FLAG_OPEN); + softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC); cam_periph_unhold(periph); + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return (0); } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sun Jun 24 04:15:58 2012 (r237517) +++ head/sys/cam/scsi/scsi_da.c Sun Jun 24 04:29:03 2012 (r237518) @@ -1233,6 +1233,20 @@ dainit(void) } } +/* + * Callback from GEOM, called when it has finished cleaning up its + * resources. + */ +static void +dadiskgonecb(struct disk *dp) +{ + struct cam_periph *periph; + + periph = (struct cam_periph *)dp->d_drv1; + + cam_periph_release(periph); +} + static void daoninvalidate(struct cam_periph *periph) { @@ -1255,7 +1269,12 @@ daoninvalidate(struct cam_periph *periph bioq_flush(&softc->bio_queue, NULL, ENXIO); bioq_flush(&softc->delete_queue, NULL, ENXIO); + /* + * Tell GEOM that we've gone away, we'll get a callback when it is + * done cleaning up its resources. + */ disk_gone(softc->disk); + xpt_print(periph->path, "lost device - %d outstanding, %d refs\n", softc->outstanding_cmds, periph->refcount); } @@ -1633,6 +1652,7 @@ daregister(struct cam_periph *periph, vo softc->disk->d_strategy = dastrategy; softc->disk->d_dump = dadump; softc->disk->d_getattr = dagetattr; + softc->disk->d_gone = dadiskgonecb; softc->disk->d_name = "da"; softc->disk->d_drv1 = periph; if (cpi.maxio == 0) @@ -1655,6 +1675,19 @@ daregister(struct cam_periph *periph, vo softc->disk->d_hba_device = cpi.hba_device; softc->disk->d_hba_subvendor = cpi.hba_subvendor; softc->disk->d_hba_subdevice = cpi.hba_subdevice; + + /* + * Acquire a reference to the periph before we register with GEOM. + * We'll release this reference once GEOM calls us back (via + * dadiskgonecb()) telling us that our provider has been freed. + */ + if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + xpt_print(periph->path, "%s: lost periph during " + "registration!\n", __func__); + mtx_lock(periph->sim->mtx); + return (CAM_REQ_CMP_ERR); + } + disk_create(softc->disk, DISK_VERSION); mtx_lock(periph->sim->mtx); Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Sun Jun 24 04:15:58 2012 (r237517) +++ head/sys/dev/xen/blkfront/blkfront.c Sun Jun 24 04:29:03 2012 (r237518) @@ -230,7 +230,7 @@ xlvbd_add(struct xb_softc *sc, blkif_sec sc->xb_disk->d_mediasize = sectors * sector_size; sc->xb_disk->d_maxsize = sc->max_request_size; sc->xb_disk->d_flags = 0; - disk_create(sc->xb_disk, DISK_VERSION_00); + disk_create(sc->xb_disk, DISK_VERSION); return error; } Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Sun Jun 24 04:15:58 2012 (r237517) +++ head/sys/geom/geom.h Sun Jun 24 04:29:03 2012 (r237518) @@ -76,6 +76,7 @@ typedef void g_orphan_t (struct g_consum typedef void g_start_t (struct bio *); typedef void g_spoiled_t (struct g_consumer *); typedef void g_attrchanged_t (struct g_consumer *, const char *attr); +typedef void g_provgone_t (struct g_provider *); typedef void g_dumpconf_t (struct sbuf *, const char *indent, struct g_geom *, struct g_consumer *, struct g_provider *); @@ -102,6 +103,7 @@ struct g_class { g_start_t *start; g_spoiled_t *spoiled; g_attrchanged_t *attrchanged; + g_provgone_t *providergone; g_dumpconf_t *dumpconf; g_access_t *access; g_orphan_t *orphan; @@ -133,6 +135,7 @@ struct g_geom { g_start_t *start; g_spoiled_t *spoiled; g_attrchanged_t *attrchanged; + g_provgone_t *providergone; g_dumpconf_t *dumpconf; g_access_t *access; g_orphan_t *orphan; Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Sun Jun 24 04:15:58 2012 (r237517) +++ head/sys/geom/geom_disk.c Sun Jun 24 04:29:03 2012 (r237518) @@ -75,6 +75,7 @@ static g_fini_t g_disk_fini; static g_start_t g_disk_start; static g_ioctl_t g_disk_ioctl; static g_dumpconf_t g_disk_dumpconf; +static g_provgone_t g_disk_providergone; static struct g_class g_disk_class = { .name = "DISK", @@ -84,6 +85,7 @@ static struct g_class g_disk_class = { .start = g_disk_start, .access = g_disk_access, .ioctl = g_disk_ioctl, + .providergone = g_disk_providergone, .dumpconf = g_disk_dumpconf, }; @@ -487,6 +489,25 @@ g_disk_create(void *arg, int flag) g_error_provider(pp, 0); } +/* + * We get this callback after all of the consumers have gone away, and just + * before the provider is freed. If the disk driver provided a d_gone + * callback, let them know that it is okay to free resources -- they won't + * be getting any more accesses from GEOM. + */ +static void +g_disk_providergone(struct g_provider *pp) +{ + struct disk *dp; + struct g_disk_softc *sc; + + sc = (struct g_disk_softc *)pp->geom->softc; + dp = sc->dp; + + if (dp->d_gone != NULL) + dp->d_gone(dp); +} + static void g_disk_destroy(void *ptr, int flag) { @@ -550,7 +571,7 @@ void disk_create(struct disk *dp, int version) { - if (version != DISK_VERSION_00 && version != DISK_VERSION_01) { + if (version != DISK_VERSION_02) { printf("WARNING: Attempt to add disk %s%d %s", dp->d_name, dp->d_unit, " using incompatible ABI version of disk(9)\n"); Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Sun Jun 24 04:15:58 2012 (r237517) +++ head/sys/geom/geom_disk.h Sun Jun 24 04:29:03 2012 (r237518) @@ -50,6 +50,7 @@ typedef int disk_open_t(struct disk *); typedef int disk_close_t(struct disk *); typedef void disk_strategy_t(struct bio *bp); typedef int disk_getattr_t(struct bio *bp); +typedef void disk_gone_t(struct disk *); typedef int disk_ioctl_t(struct disk *, u_long cmd, void *data, int fflag, struct thread *td); /* NB: disk_ioctl_t SHALL be cast'able to d_ioctl_t */ @@ -77,6 +78,7 @@ struct disk { disk_ioctl_t *d_ioctl; dumper_t *d_dump; disk_getattr_t *d_getattr; + disk_gone_t *d_gone; /* Info fields from driver to geom_disk.c. Valid when open */ u_int d_sectorsize; @@ -110,7 +112,8 @@ void disk_attr_changed(struct disk *dp, #define DISK_VERSION_00 0x58561059 #define DISK_VERSION_01 0x5856105a -#define DISK_VERSION DISK_VERSION_01 +#define DISK_VERSION_02 0x5856105b +#define DISK_VERSION DISK_VERSION_02 #endif /* _KERNEL */ #endif /* _GEOM_GEOM_DISK_H_ */ Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Sun Jun 24 04:15:58 2012 (r237517) +++ head/sys/geom/geom_subr.c Sun Jun 24 04:29:03 2012 (r237518) @@ -351,6 +351,7 @@ g_new_geomf(struct g_class *mp, const ch gp->start = mp->start; gp->spoiled = mp->spoiled; gp->attrchanged = mp->attrchanged; + gp->providergone = mp->providergone; gp->dumpconf = mp->dumpconf; gp->access = mp->access; gp->orphan = mp->orphan; @@ -634,6 +635,13 @@ g_destroy_provider(struct g_provider *pp LIST_REMOVE(pp, provider); gp = pp->geom; devstat_remove_entry(pp->stat); + /* + * If a callback was provided, send notification that the provider + * is now gone. + */ + if (gp->providergone != NULL) + gp->providergone(pp); + g_free(pp); if ((gp->flags & G_GEOM_WITHER)) g_do_wither(); From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 05:59:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B2D1106566B; Sun, 24 Jun 2012 05:59:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C5678FC08; Sun, 24 Jun 2012 05:59:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O5xWvC090691; Sun, 24 Jun 2012 05:59:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O5xWTo090688; Sun, 24 Jun 2012 05:59:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206240559.q5O5xWTo090688@svn.freebsd.org> From: Adrian Chadd Date: Sun, 24 Jun 2012 05:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237519 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 05:59:33 -0000 Author: adrian Date: Sun Jun 24 05:59:32 2012 New Revision: 237519 URL: http://svn.freebsd.org/changeset/base/237519 Log: Sometimes the AR5416 sends back radar PHY errors with both the PHY error and the CRC error bits set. The radar payload is correct. When this happens, the stack doesn't see them PHY error frames and isn't interpreted as a PHY error. So, no radar detection and no radiotap PHY error handling. Now, this may introduce some weird issues if the MAC sends up some other combination of CRC error + PHY error frames; this commit would break that and mark them as PHY errors instead of CRC errors. I may tinker with this a little more to pass radar/early radar/spectral frames up as PHY errors if the CRC bit is set, to restore the previous behaviour (where if CRC is set on a PHY error frame, it's marked as a CRC error rather than PHY error.) Tested on: AR5416, over the air, to a USRP N200 which is generating a large number of a variety of radar pulses. TODO: Test on AR9130, AR9160, AR9280 (and maybe radar pulses on 2GHz on AR9285/AR9287.) PR: kern/169362 Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Sun Jun 24 04:29:03 2012 (r237518) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Sun Jun 24 05:59:32 2012 (r237519) @@ -228,15 +228,23 @@ ar5416ProcRxDesc(struct ath_hal *ah, str * Consequently we filter them out here so we don't * confuse and/or complicate drivers. */ - if (ads->ds_rxstatus8 & AR_CRCErr) - rs->rs_status |= HAL_RXERR_CRC; - else if (ads->ds_rxstatus8 & AR_PHYErr) { + + /* + * The AR5416 sometimes sets both AR_CRCErr and AR_PHYErr + * when reporting radar pulses. In this instance, + * clear HAL_RXERR_CRC and set HAL_RXERR_PHY. + * + * See PR kern/169362. + */ + if (ads->ds_rxstatus8 & AR_PHYErr) { u_int phyerr; rs->rs_status |= HAL_RXERR_PHY; phyerr = MS(ads->ds_rxstatus8, AR_PHYErrCode); rs->rs_phyerr = phyerr; - } else if (ads->ds_rxstatus8 & AR_DecryptCRCErr) + } else if (ads->ds_rxstatus8 & AR_CRCErr) + rs->rs_status |= HAL_RXERR_CRC; + else if (ads->ds_rxstatus8 & AR_DecryptCRCErr) rs->rs_status |= HAL_RXERR_DECRYPT; else if (ads->ds_rxstatus8 & AR_MichaelErr) rs->rs_status |= HAL_RXERR_MIC; From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 06:36:44 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C570106567B; Sun, 24 Jun 2012 06:36:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by mx1.freebsd.org (Postfix) with ESMTP id 9CD758FC0C; Sun, 24 Jun 2012 06:36:43 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q5O6aO5W014629 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Jun 2012 16:36:26 +1000 Date: Sun, 24 Jun 2012 16:36:24 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Motin In-Reply-To: <4FE6209B.7050809@FreeBSD.org> Message-ID: <20120624142958.C850@besplex.bde.org> References: <201206220713.q5M7DVH0063098@svn.freebsd.org> <20120622073455.GE69382@alchemy.franken.de> <20120622074817.GA2337@deviant.kiev.zoral.com.ua> <20120623131757.GB46065@alchemy.franken.de> <20120623140556.GU2337@deviant.kiev.zoral.com.ua> <20120624005418.W2417@besplex.bde.org> <4FE6209B.7050809@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Davide Italiano , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Bruce Evans , Marius Strobl , Konstantin Belousov Subject: Re: svn commit: r237434 - in head/lib/libc: amd64/sys gen i386/sys include sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 06:36:44 -0000 On Sat, 23 Jun 2012, Alexander Motin wrote: > On 06/23/12 18:26, Bruce Evans wrote: >> On Sat, 23 Jun 2012, Konstantin Belousov wrote: >>> On Sat, Jun 23, 2012 at 03:17:57PM +0200, Marius Strobl wrote: >>>> So apart from introducing code to constantly synchronize the >>>> TICK counters, using the timecounters on the host busses also >>>> seems to be the only viable solution for userland. The latter >>>> should be doable but is long-winded as besides duplicating >>>> portions of the corresponding device drivers in userland, it >>>> probably also means to get some additional infrastructure >>>> like being able to memory map registers for devices on the >>>> nexus(4) level in place ... >> >> There is little point in optimizations to avoid syscalls for hardware. >> On x86, a syscall takes 100-400 nsec extra, so if the hardware takes >> 500-2000 nsec then reduction the total time by 100-400 nsec is not >> very useful. > > Just out of curiosity I've run my own binuptime() micro-benchmarks: > - on Core i5-650: > TSC 11ns > HPET 433ns > ACPI-fast 515ns > i8254 3736ns The TSC is surprisingly fast and the others are depressingly slow, although about the fastest I've seen for bus-based timecounters. On Athlon64, rdtsc() takes 6.5 cycles, but I thought all P-state invariant TSCs took > 40 cycles. rdtsc() takes 65 cycles on FreeBSD x86 cluster machines (core2 Xeon), except on freefall (P4(?) Xeon). I hardly believe 11ns. That's 44 cycles at 4GHz. IIRC, the Athlon64 at 2.2GHz took 29nsec for binuptime() last time I measured it (long ago, when it still had the statistics counter pessimization). > - on dual-socket Xeon E5645: > TSC 15ns > HPET 580ns > ACPI-fast 1118ns > i8254 3911ns > > I think it could be useful to have that small benchmark in base kernel. I think kib put one in src/tools for userland. I mostly use a userland one. Except for the TSC, the overhead for the kernel parts can be estimate accurately from userland, since it is so large. This is more normal slowness for ACPI-[!]fast. freefall still uses ACPI-fast and it takes a minimum of 1396 and an average of 1729nsec from usrerland (load average 1.3). Other x86 cluster machines now use TSC-[s]low, and it takes a minimum of 481 and an average of 533nsec (now the swing from 481 to 533 is given by its gratuitous impreciseness and not by system load). BTW, the i8254 timecounter can be made about 3/2 times faster if anyone cared, by reading only the low 8 bits of the timer. This would require running clock interrupts at >= 4kHz so that the top 8 bits are rarely needed (great for a tickless kernel :-), or maybe by using a fuzzier timer to determine when the top bits are needed. At ~2500ns, it would be only slightly slower than the slowest ACPI-fast, and faster than ACPI-safe. OTOH, I have measured i8254 timer reads taking 138000ns (on UP with interrupts disabled) on a system where they normally take only 4000ns. Apparently the ISA bus waits for other bus activity (DMA?) for that long. Does this happen for other buses? Extra bridges for ISA can't help. >> ... >> The new timeout code to support tickless kernels looks like it will give >> large pessimizations unless the timecounter is fast. Instead of using >> the tick counter (1 atomic increment on every clock tick) and some >> getbinuptime() calls in places like select(), it uses the hardware >> timecounter via binuptime() in most places (since without a tick counter >> and without clock interrupts updating the timehands periodically, it takes >> a hardware timecounter read to determine the time). So callout_reset() >> might start taking thousands of nsec for per call, depending on how slow >> the timecounter is. This fix is probably to use a fuzzy time for long >> long timeouts and to discourage use of short timeouts and/or to turn them >> into long or fuzzy timeouts so that they are not very useful. > > The new timeout code is still in active development and optimization was not > the first priority yet. My idea was to use much faster getbinuptime() for > periods above let's say 100ms. You would need to run non-tickless with a clock interrupt frequency of >= 10Hz to keep getbinuptime() working. Seems like a bad thing to aim for. Better not use bintimes at all. I would try using pseudo-ticks, (where the tick counter is advanced on every not-very-periodic clock interrupt and at some other times when you know that clock interrupts have been stopped, and maybe at other interesting places (all interrupts and all syscalls?)). Only call binuptime() every few thousand pseudo-ticks to prevent long-term drift. Timeouts would become longer and fuzzier than now, but that is a feature (it inhibits using them for busy-waiting). You know when you scheduled clock interrupts and can advance the tick counter to represent the interval between clock interrupts fairly accurately (say to within 10%). The fuzziness comes mainly from not scheduling clock interrupts very often, so that for example when something asks for a sleep of 1 tick now, it might take 100 times longer because there isn't a clock interrupt for 100 times longer. You also should schedule clock interrupts just because something asks for a short timeout. > Legacy ticks-oriented callout_reset() > functions are by default not supposed to provide sub-tick resolution and with > some assumptions could use getbinuptime(). For new interfaces it depends on > caller, how will it get present time. Even 1 tick is too short. Using binuptime() encourages asking for much shorter intervals. Even for long sleeps, many places try to micro-sleep for the residual time after waking up early. E.g., nanotime(), select() and poll(). These places can also ask for an initial sleep with a resolution of nsec, usec or msec, respectively. If the timeout code actually honors these requests, then it would generate lots of clock interrupts and even more overheads by allowing more timeouts to actually expire. OTOH, supporting nano-sleeps allows nanotime() to actually approach its name. > I understand that integer tick counter is as fast as nothing else can ever > be. But sorry, 32bit counter doesn't fit present goals. To have more we need On the contrary, it becomes more adequate than with periodic ticks, since you need to reduce the tick frequency, so 32 bit works for longer. > some artificial atomicity -- exactly what getbinuptime() implements. Why would you need any atomicity? Timeouts become fuzzier (because you can't afford to generate clock interrupts to keep them as short as possible, and want to generate even fewer clock interrupts than now). Who cares if a non-atomic comparison results on more fuzziness. OTOH, if a timeout actually expires, it would be good to maintain the invariant that it never expires early, and some sort of clock that is known to never run fast (relative to all earlier times measured on it) is needed to ensure this, and some atomicity is also required for this. I think most timeouts never expire (because most are for emergency conditions), so checking the time accurately only when a timeout expires according to a fuzzy clock may be efficient enouugh. The problem is the initial time read for converting a relative time to an absolute expiry time -- unless that is accurate, the expiry time is fuzzy. > What I > would like to see there is tc_tick removal to make tc_windup() called for > every hardclock tick. That would break it. People can set HZ to 10KHz or more (I once tried 1MHz with lapic_timer, and it worked more or less correctly). Calling it that often would make the timehands cycle too fast, and tc_tick is used to prevent this. You could "fix" this by increasing the number of timehands from 10 to 1000[0..] according to HZ. > Having new tick-irrelevant callout interfaces we > probably won't so much need to increase HZ too high any more, while this > simplification would make ticks and getbinuptime() precision equal, solving > some of your valid arguments against the last. People increase HZ to do bogus polling. A periodic timer for this is at least as efficient as possible. The periodic timer for this is hung off hardclock() (hardclock() calls hardclock_device_poll() unconditionally iff DEVICE_POLLING is configured). This avoids the overhead of re-arming the period timer on every clock tick. It would be a good pessimization to use the standard callout interface for this. A tickless kernel should go the other way and not call tc_ticktock() every clock tick. It should do the tc_tick counting itself (since it uses virtual ticks or at least ticks of a highly variable and fuzzy length and only it should have a vague idea about the tick lengths). It needs to call tc_windup() often enough. Only the timecounter code really knows how often this is, but this must have some interaction with the tickless code since lots of ticks (clock interrupts) may be needed to keep timecounters working. The main problem is that hardware timecounters may wrap if you don't call them often enough. This problem is largest for the i8254 timecounter when the clock interrupt source is also the i8254. Then: - clock interrupts must be scheduled at least as often as the i8254 wraps (at least every 54.9ms, so HZ must be > 18 with periodic ticks). Else the time must be recovered from somewhere else and the timecounter reinitialized before any timecounter interface is used again (same as after resume, except you might have to do this every 54.9ms) - the timecounter must be read at least as often as its hardware wraps. This is normally accomplished by reading it on every clock interrupt. tc_tick must be 1 for this. A bug in the current initialization of tc_tick is now clear: suppose someone uses the i8254 timecounter and has HZ > 1000. Then tc_tick > 1 and the timecounter is broken. The i8254 can easily support much larger HZ than this. I used to try to keep pcaudio maintained to test corner cases in timers. pcaudio set the i8254 interrupt frequency to 62.5 kHz (?), though it only called hardclock at a frequency of HZ (normally 100). The timecounter read in tc_windup() is now inadequate for avoiding wrap. So the pcaudio low-level code virtualized the timecounter hardware by updating counts on every i8254 interrupt. Only the low-level code sees every interrupt. Other timecounter hardware that wraps too often should probably be handled similarly, but clock interrupts (possibly from another source) would be needed to keep it going. I don't know of any other x86 hardware timecounters that wrap too fast. The 32 bits of the TSC that are used wrap after ~1 second at 4GHz. Apart from the problems with the i8254, there are few or no reasons to call tc_windup() very often. Every 1 second is probably enough. I always use HZ=100 and every 1/100 second is enough. The default is at most every 1/1000 second. This seems to be mainly to keep the i8254 working up to the default HZ although it is broken above that. ntpd only updates things every 64 seconds or so. By calling tc_windup() very often, you mainly see each of thse updates take effect after only 1-10 msec. The most interesting case is after a leap second is inserted. Now it is good to see the leap second immediately, and even a delay of 1 msec may be too long. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 06:37:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 950A71065673; Sun, 24 Jun 2012 06:37:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FB1A8FC16; Sun, 24 Jun 2012 06:37:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O6bTGZ092274; Sun, 24 Jun 2012 06:37:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O6bTHN092272; Sun, 24 Jun 2012 06:37:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206240637.q5O6bTHN092272@svn.freebsd.org> From: Adrian Chadd Date: Sun, 24 Jun 2012 06:37: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: r237521 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 06:37:29 -0000 Author: adrian Date: Sun Jun 24 06:37:28 2012 New Revision: 237521 URL: http://svn.freebsd.org/changeset/base/237521 Log: On second thought, let's just set both CRC and PHY errors together on frames that have it and let the upper layer sort it out. PR: kern/169362 Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Sun Jun 24 06:00:29 2012 (r237520) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Sun Jun 24 06:37:28 2012 (r237521) @@ -231,8 +231,9 @@ ar5416ProcRxDesc(struct ath_hal *ah, str /* * The AR5416 sometimes sets both AR_CRCErr and AR_PHYErr - * when reporting radar pulses. In this instance, - * clear HAL_RXERR_CRC and set HAL_RXERR_PHY. + * when reporting radar pulses. In this instance + * set HAL_RXERR_PHY as well as HAL_RXERR_CRC and + * let the driver layer figure out what to do. * * See PR kern/169362. */ @@ -242,7 +243,9 @@ ar5416ProcRxDesc(struct ath_hal *ah, str rs->rs_status |= HAL_RXERR_PHY; phyerr = MS(ads->ds_rxstatus8, AR_PHYErrCode); rs->rs_phyerr = phyerr; - } else if (ads->ds_rxstatus8 & AR_CRCErr) + } + + if (ads->ds_rxstatus8 & AR_CRCErr) rs->rs_status |= HAL_RXERR_CRC; else if (ads->ds_rxstatus8 & AR_DecryptCRCErr) rs->rs_status |= HAL_RXERR_DECRYPT; From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 07:01:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5A3E1065670; Sun, 24 Jun 2012 07:01:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D04468FC0A; Sun, 24 Jun 2012 07:01:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O71nC1093566; Sun, 24 Jun 2012 07:01:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O71nu1093561; Sun, 24 Jun 2012 07:01:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206240701.q5O71nu1093561@svn.freebsd.org> From: Adrian Chadd Date: Sun, 24 Jun 2012 07:01: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: r237522 - in head/sys: conf dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 07:01:50 -0000 Author: adrian Date: Sun Jun 24 07:01:49 2012 New Revision: 237522 URL: http://svn.freebsd.org/changeset/base/237522 Log: Introduce an optional ath(4) radiotap vendor extension. This includes a few new fields in each RXed frame: * per chain RX RSSI (ctl and ext); * current RX chainmask; * EVM information; * PHY error code; * basic RX status bits (CRC error, PHY error, etc). This is primarily to allow me to do some userland PHY error processing for radar and spectral scan data. However since EVM and per-chain RSSI is provided, others may find it useful for a variety of tasks. The default is to not compile in the radiotap vendor extensions, primarily because tcpdump doesn't seem to handle the particular vendor extension layout I'm using, and I'd rather not break existing code out there that may be (badly) parsing the radiotap data. Instead, add the option 'ATH_ENABLE_RADIOTAP_VENDOR_EXT' to your kernel configuration file to enable these options. Modified: head/sys/conf/options head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Jun 24 06:37:28 2012 (r237521) +++ head/sys/conf/options Sun Jun 24 07:01:49 2012 (r237522) @@ -783,6 +783,7 @@ ATH_TX99_DIAG opt_ath.h ATH_ENABLE_11N opt_ath.h ATH_ENABLE_DFS opt_ath.h ATH_EEPROM_FIRMWARE opt_ath.h +ATH_ENABLE_RADIOTAP_VENDOR_EXT opt_ath.h # options for the Atheros hal AH_SUPPORT_AR5416 opt_ah.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Jun 24 06:37:28 2012 (r237521) +++ head/sys/dev/ath/if_ath.c Sun Jun 24 07:01:49 2012 (r237522) @@ -799,11 +799,26 @@ ath_attach(u_int16_t devid, struct ath_s ic->ic_update_chw = ath_update_chw; #endif /* ATH_ENABLE_11N */ +#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT + /* + * There's one vendor bitmap entry in the RX radiotap + * header; make sure that's taken into account. + */ + ieee80211_radiotap_attachv(ic, + &sc->sc_tx_th.wt_ihdr, sizeof(sc->sc_tx_th), 0, + ATH_TX_RADIOTAP_PRESENT, + &sc->sc_rx_th.wr_ihdr, sizeof(sc->sc_rx_th), 1, + ATH_RX_RADIOTAP_PRESENT); +#else + /* + * No vendor bitmap/extensions are present. + */ ieee80211_radiotap_attach(ic, &sc->sc_tx_th.wt_ihdr, sizeof(sc->sc_tx_th), ATH_TX_RADIOTAP_PRESENT, &sc->sc_rx_th.wr_ihdr, sizeof(sc->sc_rx_th), ATH_RX_RADIOTAP_PRESENT); +#endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */ /* * Setup dynamic sysctl's now that country code and Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun Jun 24 06:37:28 2012 (r237521) +++ head/sys/dev/ath/if_ath_rx.c Sun Jun 24 07:01:49 2012 (r237522) @@ -354,6 +354,55 @@ ath_recv_mgmt(struct ieee80211_node *ni, } } +#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT +static void +ath_rx_tap_vendor(struct ifnet *ifp, struct mbuf *m, + const struct ath_rx_status *rs, u_int64_t tsf, int16_t nf) +{ + struct ath_softc *sc = ifp->if_softc; + + /* Fill in the extension bitmap */ + sc->sc_rx_th.wr_ext_bitmap = htole32(1 << ATH_RADIOTAP_VENDOR_HEADER); + + /* Fill in the vendor header */ + sc->sc_rx_th.wr_vh.vh_oui[0] = 0x7f; + sc->sc_rx_th.wr_vh.vh_oui[1] = 0x03; + sc->sc_rx_th.wr_vh.vh_oui[2] = 0x00; + + /* XXX what should this be? */ + sc->sc_rx_th.wr_vh.vh_sub_ns = 0; + sc->sc_rx_th.wr_vh.vh_skip_len = + htole16(sizeof(struct ath_radiotap_vendor_hdr)); + + /* General version info */ + sc->sc_rx_th.wr_v.vh_version = 1; + + sc->sc_rx_th.wr_v.vh_rx_chainmask = sc->sc_rxchainmask; + + /* rssi */ + sc->sc_rx_th.wr_v.rssi_ctl[0] = rs->rs_rssi_ctl[0]; + sc->sc_rx_th.wr_v.rssi_ctl[1] = rs->rs_rssi_ctl[1]; + sc->sc_rx_th.wr_v.rssi_ctl[2] = rs->rs_rssi_ctl[2]; + sc->sc_rx_th.wr_v.rssi_ext[0] = rs->rs_rssi_ext[0]; + sc->sc_rx_th.wr_v.rssi_ext[1] = rs->rs_rssi_ext[1]; + sc->sc_rx_th.wr_v.rssi_ext[2] = rs->rs_rssi_ext[2]; + + /* evm */ + sc->sc_rx_th.wr_v.evm[0] = rs->rs_evm0; + sc->sc_rx_th.wr_v.evm[1] = rs->rs_evm1; + sc->sc_rx_th.wr_v.evm[2] = rs->rs_evm2; + /* XXX TODO: extend this to include 3-stream EVM */ + + /* phyerr info */ + if (rs->rs_status & HAL_RXERR_PHY) + sc->sc_rx_th.wr_v.vh_phyerr_code = rs->rs_phyerr; + else + sc->sc_rx_th.wr_v.vh_phyerr_code = 0xff; + sc->sc_rx_th.wr_v.vh_rs_status = rs->rs_status; + sc->sc_rx_th.wr_v.vh_rssi = rs->rs_rssi; +} +#endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */ + static void ath_rx_tap(struct ifnet *ifp, struct mbuf *m, const struct ath_rx_status *rs, u_int64_t tsf, int16_t nf) @@ -552,6 +601,9 @@ rx_error: m->m_pkthdr.len = m->m_len = len; bf->bf_m = NULL; ath_rx_tap(ifp, m, rs, rstamp, nf); +#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT + ath_rx_tap_vendor(ifp, m, rs, rstamp, nf); +#endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */ ieee80211_radiotap_rx_all(ic, m); m_freem(m); } @@ -646,8 +698,12 @@ rx_accept: * material required by ieee80211_input. Note that * noise setting is filled in above. */ - if (ieee80211_radiotap_active(ic)) + if (ieee80211_radiotap_active(ic)) { ath_rx_tap(ifp, m, rs, rstamp, nf); +#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT + ath_rx_tap_vendor(ifp, m, rs, rstamp, nf); +#endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */ + } /* * From this point on we assume the frame is at least Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Sun Jun 24 06:37:28 2012 (r237521) +++ head/sys/dev/ath/if_athioctl.h Sun Jun 24 07:01:49 2012 (r237522) @@ -187,7 +187,7 @@ struct ath_diag { /* * Radio capture format. */ -#define ATH_RX_RADIOTAP_PRESENT ( \ +#define ATH_RX_RADIOTAP_PRESENT_BASE ( \ (1 << IEEE80211_RADIOTAP_TSFT) | \ (1 << IEEE80211_RADIOTAP_FLAGS) | \ (1 << IEEE80211_RADIOTAP_RATE) | \ @@ -197,8 +197,80 @@ struct ath_diag { (1 << IEEE80211_RADIOTAP_XCHANNEL) | \ 0) +#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT +#define ATH_RX_RADIOTAP_PRESENT \ + (ATH_RX_RADIOTAP_PRESENT_BASE | \ + (1 << IEEE80211_RADIOTAP_VENDOREXT) | \ + (1 << IEEE80211_RADIOTAP_EXT) | \ + 0) +#else +#define ATH_RX_RADIOTAP_PRESENT ATH_RX_RADIOTAP_PRESENT_BASE +#endif /* ATH_ENABLE_RADIOTAP_PRESENT */ + +#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT +/* + * This is higher than the vendor bitmap used inside + * the Atheros reference codebase. + */ + +/* Bit 8 */ +#define ATH_RADIOTAP_VENDOR_HEADER 8 + +/* + * Using four chains makes all the fields in the + * per-chain info header be 4-byte aligned. + */ +#define ATH_RADIOTAP_MAX_CHAINS 4 + +/* + * The vendor radiotap header data needs to be: + * + * + Aligned to a 4 byte address + * + .. so all internal fields are 4 bytes aligned; + * + .. and no 64 bit fields are allowed. + * + * So padding is required to ensure this is the case. + * + * Note that because of the lack of alignment with the + * vendor header (6 bytes), the first field must be + * two bytes so it can be accessed by alignment-strict + * platform (eg MIPS.) + */ +struct ath_radiotap_vendor_hdr { /* 30 bytes */ + uint8_t vh_version; /* 1 */ + uint8_t vh_rx_chainmask; /* 1 */ + + /* At this point it should be 4 byte aligned */ + uint32_t evm[ATH_RADIOTAP_MAX_CHAINS]; /* 4 * 4 = 16 */ + + uint8_t rssi_ctl[ATH_RADIOTAP_MAX_CHAINS]; /* 4 */ + uint8_t rssi_ext[ATH_RADIOTAP_MAX_CHAINS]; /* 4 */ + + uint8_t vh_phyerr_code; /* Phy error code, or 0xff */ + uint8_t vh_rs_status; /* RX status */ + uint8_t vh_rssi; /* Raw RSSI */ + uint8_t vh_pad1[1]; /* Pad to 4 byte boundary */ +} __packed; +#endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */ + struct ath_rx_radiotap_header { struct ieee80211_radiotap_header wr_ihdr; + +#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT + /* Vendor extension header bitmap */ + uint32_t wr_ext_bitmap; /* 4 */ + + /* + * This padding is needed because: + * + the radiotap header is 8 bytes; + * + the extension bitmap is 4 bytes; + * + the tsf is 8 bytes, so it must start on an 8 byte + * boundary. + */ + uint32_t wr_pad1; +#endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */ + + /* Normal radiotap fields */ u_int64_t wr_tsf; u_int8_t wr_flags; u_int8_t wr_rate; @@ -210,6 +282,26 @@ struct ath_rx_radiotap_header { u_int16_t wr_chan_freq; u_int8_t wr_chan_ieee; int8_t wr_chan_maxpow; + +#ifdef ATH_ENABLE_RADIOTAP_VENDOR_EXT + /* + * Vendor header section, as required by the + * presence of the vendor extension bit and bitmap + * entry. + * + * XXX This must be aligned to a 4 byte address? + * XXX or 8 byte address? + */ + struct ieee80211_radiotap_vendor_header wr_vh; /* 6 bytes */ + + /* + * Because of the lack of alignment enforced by the above + * header, this vendor section won't be aligned in any + * useful way. So, this will include a two-byte version + * value which will force the structure to be 4-byte aligned. + */ + struct ath_radiotap_vendor_hdr wr_v; +#endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */ } __packed; #define ATH_TX_RADIOTAP_PRESENT ( \ From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 07:03:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 014101065675; Sun, 24 Jun 2012 07:03:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0ADA8FC0C; Sun, 24 Jun 2012 07:03:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O73Msu093663; Sun, 24 Jun 2012 07:03:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O73MvB093661; Sun, 24 Jun 2012 07:03:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206240703.q5O73MvB093661@svn.freebsd.org> From: Eitan Adler Date: Sun, 24 Jun 2012 07:03: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: r237523 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 07:03:23 -0000 Author: eadler Date: Sun Jun 24 07:03:22 2012 New Revision: 237523 URL: http://svn.freebsd.org/changeset/base/237523 Log: Remove the assert added in r237286 The use of assertions in libraries is not widely accepted. Requested by: bde, scottl Approved by: cperciva MFC after: 3 days X-MFC-With: r237286 Modified: head/lib/libc/gen/syslog.c Modified: head/lib/libc/gen/syslog.c ============================================================================== --- head/lib/libc/gen/syslog.c Sun Jun 24 07:01:49 2012 (r237522) +++ head/lib/libc/gen/syslog.c Sun Jun 24 07:03:22 2012 (r237523) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -414,7 +413,6 @@ void closelog(void) { THREAD_LOCK(); - assert(LogFile >= -1); if (LogFile != -1) { (void)_close(LogFile); LogFile = -1; From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 07:13:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6827A106567A; Sun, 24 Jun 2012 07:13:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail30.syd.optusnet.com.au (mail30.syd.optusnet.com.au [211.29.133.193]) by mx1.freebsd.org (Postfix) with ESMTP id DA7F48FC16; Sun, 24 Jun 2012 07:13:04 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail30.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q5O7CuHZ002266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Jun 2012 17:12:57 +1000 Date: Sun, 24 Jun 2012 17:12:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler In-Reply-To: <201206240703.q5O73MvB093661@svn.freebsd.org> Message-ID: <20120624171237.H1297@besplex.bde.org> References: <201206240703.q5O73MvB093661@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: r237523 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 07:13:05 -0000 On Sun, 24 Jun 2012, Eitan Adler wrote: > Log: > Remove the assert added in r237286 > The use of assertions in libraries is not widely accepted. > > Requested by: bde, scottl > Approved by: cperciva Thanks. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 07:54:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F4611065670; Sun, 24 Jun 2012 07:54:29 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78E368FC08; Sun, 24 Jun 2012 07:54:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O7sTeU096046; Sun, 24 Jun 2012 07:54:29 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O7sTck096044; Sun, 24 Jun 2012 07:54:29 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206240754.q5O7sTck096044@svn.freebsd.org> From: Joel Dahl Date: Sun, 24 Jun 2012 07:54: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: r237525 - head/lib/libedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 07:54:29 -0000 Author: joel (doc committer) Date: Sun Jun 24 07:54:28 2012 New Revision: 237525 URL: http://svn.freebsd.org/changeset/base/237525 Log: Fix mandoc "Oc breaks Op" warning. Modified: head/lib/libedit/editrc.5 Modified: head/lib/libedit/editrc.5 ============================================================================== --- head/lib/libedit/editrc.5 Sun Jun 24 07:10:34 2012 (r237524) +++ head/lib/libedit/editrc.5 Sun Jun 24 07:54:28 2012 (r237525) @@ -90,7 +90,7 @@ shell. The following builtin commands are available: .Bl -tag -width 4n .It Ic bind Oo Fl a Oc Oo Fl e Oc Oo Fl k Oc Oo Fl l Oc Oo Fl r Oc \ -Oo Fl s Oc Oo Fl v Oc Oo Ar key Op Ar command Oc +Oo Fl s Oc Oo Fl v Oc Oo Ar key Oo Ar command Oc Oc Without options, list all bound keys, and the editor command to which each is bound. If From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 08:09:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 560CC1065670; Sun, 24 Jun 2012 08:09:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 407D88FC08; Sun, 24 Jun 2012 08:09:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O8978V096750; Sun, 24 Jun 2012 08:09:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O897Wv096746; Sun, 24 Jun 2012 08:09:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206240809.q5O897Wv096746@svn.freebsd.org> From: Adrian Chadd Date: Sun, 24 Jun 2012 08:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237526 - in head/sys/dev/ath: . ath_dfs/null X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 08:09:07 -0000 Author: adrian Date: Sun Jun 24 08:09:06 2012 New Revision: 237526 URL: http://svn.freebsd.org/changeset/base/237526 Log: Change the ath_dfs_process_phy_err() method to take an mbuf rather than a buffer pointer. For large radar pulses, the AR9130 and later will return a series of FFT results for software processing. These can overflow a single 2KB buffer on longer pulses. This would result in undefined buffer behaviour. Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_athdfs.h Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Sun Jun 24 07:54:28 2012 (r237525) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Sun Jun 24 08:09:06 2012 (r237526) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); int ath_dfs_attach(struct ath_softc *sc) { - return 1; + return (1); } /* @@ -111,11 +111,12 @@ ath_dfs_attach(struct ath_softc *sc) int ath_dfs_detach(struct ath_softc *sc) { - return 1; + return (1); } /* - * Enable radar check + * Enable radar check. Return 1 if the driver should + * enable radar PHY errors, or 0 if not. */ int ath_dfs_radar_enable(struct ath_softc *sc, struct ieee80211_channel *chan) @@ -163,9 +164,12 @@ ath_dfs_radar_enable(struct ath_softc *s /* * Process DFS related PHY errors + * + * The mbuf is not "ours" and if we want a copy, we have + * to take a copy. It'll be freed after this function returns. */ void -ath_dfs_process_phy_err(struct ath_softc *sc, const char *buf, +ath_dfs_process_phy_err(struct ath_softc *sc, struct mbuf *m, uint64_t tsf, struct ath_rx_status *rxstat) { @@ -182,7 +186,7 @@ int ath_dfs_process_radar_event(struct ath_softc *sc, struct ieee80211_channel *chan) { - return 0; + return (0); } /* @@ -195,7 +199,7 @@ ath_dfs_process_radar_event(struct ath_s int ath_dfs_tasklet_needed(struct ath_softc *sc, struct ieee80211_channel *chan) { - return 0; + return (0); } /* @@ -272,7 +276,7 @@ bad: free(indata, M_TEMP); if ((ad->ad_id & ATH_DIAG_DYN) && outdata != NULL) free(outdata, M_TEMP); - return error; + return (error); } /* @@ -282,5 +286,5 @@ int ath_dfs_get_thresholds(struct ath_softc *sc, HAL_PHYERR_PARAM *param) { ath_hal_getdfsthresh(sc->sc_ah, param); - return 1; + return (1); } Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun Jun 24 07:54:28 2012 (r237525) +++ head/sys/dev/ath/if_ath_rx.c Sun Jun 24 08:09:06 2012 (r237526) @@ -536,7 +536,7 @@ ath_rx_pkt(struct ath_softc *sc, struct bf->bf_dmamap, BUS_DMASYNC_POSTREAD); /* Now pass it to the radar processing code */ - ath_dfs_process_phy_err(sc, mtod(m, char *), rstamp, rs); + ath_dfs_process_phy_err(sc, m, rstamp, rs); } /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ Modified: head/sys/dev/ath/if_athdfs.h ============================================================================== --- head/sys/dev/ath/if_athdfs.h Sun Jun 24 07:54:28 2012 (r237525) +++ head/sys/dev/ath/if_athdfs.h Sun Jun 24 08:09:06 2012 (r237526) @@ -35,7 +35,7 @@ extern int ath_dfs_attach(struct ath_sof extern int ath_dfs_detach(struct ath_softc *sc); extern int ath_dfs_radar_enable(struct ath_softc *, struct ieee80211_channel *chan); -extern void ath_dfs_process_phy_err(struct ath_softc *sc, const char *buf, +extern void ath_dfs_process_phy_err(struct ath_softc *sc, struct mbuf *m, uint64_t tsf, struct ath_rx_status *rxstat); extern int ath_dfs_process_radar_event(struct ath_softc *sc, struct ieee80211_channel *chan); From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 08:28:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFADE106566B; Sun, 24 Jun 2012 08:28:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB6098FC12; Sun, 24 Jun 2012 08:28:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O8S61M097565; Sun, 24 Jun 2012 08:28:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O8S6Kf097563; Sun, 24 Jun 2012 08:28:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206240828.q5O8S6Kf097563@svn.freebsd.org> From: Adrian Chadd Date: Sun, 24 Jun 2012 08:28: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: r237527 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 08:28:07 -0000 Author: adrian Date: Sun Jun 24 08:28:06 2012 New Revision: 237527 URL: http://svn.freebsd.org/changeset/base/237527 Log: Shuffle these initialisations to where they should be. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Jun 24 08:09:06 2012 (r237526) +++ head/sys/dev/ath/if_ath.c Sun Jun 24 08:28:06 2012 (r237527) @@ -723,6 +723,13 @@ ath_attach(u_int16_t devid, struct ath_s #endif /* + * Initial aggregation settings. + */ + sc->sc_hwq_limit = ATH_AGGR_MIN_QDEPTH; + sc->sc_tid_hwq_lo = ATH_AGGR_SCHED_LOW; + sc->sc_tid_hwq_hi = ATH_AGGR_SCHED_HIGH; + + /* * Check if the hardware requires PCI register serialisation. * Some of the Owl based MACs require this. */ @@ -1824,13 +1831,6 @@ ath_init(void *arg) sc->sc_beacons = 0; /* - * Initial aggregation settings. - */ - sc->sc_hwq_limit = ATH_AGGR_MIN_QDEPTH; - sc->sc_tid_hwq_lo = ATH_AGGR_SCHED_LOW; - sc->sc_tid_hwq_hi = ATH_AGGR_SCHED_HIGH; - - /* * Setup the hardware after reset: the key cache * is filled as needed and the receive engine is * set going. Frame transmit is handled entirely From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 08:43:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91AAE106566B; Sun, 24 Jun 2012 08:43:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D1D08FC0A; Sun, 24 Jun 2012 08:43:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O8hYMw098201; Sun, 24 Jun 2012 08:43:34 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O8hYmo098199; Sun, 24 Jun 2012 08:43:34 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201206240843.q5O8hYmo098199@svn.freebsd.org> From: Andrew Turner Date: Sun, 24 Jun 2012 08:43: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: r237528 - head/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 08:43:34 -0000 Author: andrew Date: Sun Jun 24 08:43:34 2012 New Revision: 237528 URL: http://svn.freebsd.org/changeset/base/237528 Log: Create a symlink to sys/elf32.h, sys/elf64.h, and sys/elf_common.h. When building libelf in the bootstrap stage this would include the tree versions of, for example, sys/_types.h. This would work as long as the tree's version of this file was close enough to the system's version of the file. If, however, there was a change in the tree such that the location of a typedef was moved this would cause problems. In this case the version of sys/_types.h in the tree no longer defines __wchar_t and expects it to to be defined in machine/_types.h, however we pick up machine/_types.h from the system and find it is not defined there. The solution is to restrict the parts of sys er include from the tree to those that are needed. This fixes the recent Tinderbox failure. Pointy Hat to: andrew Modified: head/lib/libelf/Makefile Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Sun Jun 24 08:28:06 2012 (r237527) +++ head/lib/libelf/Makefile Sun Jun 24 08:43:34 2012 (r237528) @@ -55,9 +55,23 @@ SRCS= elf_begin.c \ ${GENSRCS} INCS= libelf.h gelf.h +# +# We need to link against the correct version of these files. One +# solution is to include ../../sys in the include path. This causes +# problems when a header file in sys depends on a file in another +# part of the tree, e.g. a machine dependent header. +# +SRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h + GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c CLEANFILES= ${GENSRCS} -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../sys +CFLAGS+= -I${.CURDIR} -I. + +sys/elf32.h sys/elf64.h sys/elf_common.h: sys + ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET} + +sys: + mkdir -p ${.OBJDIR}/sys SHLIB_MAJOR= 1 From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 08:47:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F571106564A; Sun, 24 Jun 2012 08:47:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88EF48FC0A; Sun, 24 Jun 2012 08:47:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O8lK9i098504; Sun, 24 Jun 2012 08:47:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O8lK29098498; Sun, 24 Jun 2012 08:47:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206240847.q5O8lK29098498@svn.freebsd.org> From: Adrian Chadd Date: Sun, 24 Jun 2012 08:47: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: r237529 - in head/sys/dev/ath: . ath_dfs/null ath_rate/amrr ath_rate/onoe ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 08:47:20 -0000 Author: adrian Date: Sun Jun 24 08:47:19 2012 New Revision: 237529 URL: http://svn.freebsd.org/changeset/base/237529 Log: In a complete lack of foresight on my part, my previous commit broke the assumption that ath_softc doesn't change size based on build time configuration. I picked up on this because suddenly radar stuff didn't work; and although the ath_dfs code was setting sc_dodfs=1, the main ath driver saw sc_dodfs=0. So for now, include opt_ath.h in driver source files. This seems like the sane thing to do anyway. I'll have to do a pass over the code at some later stage and turn the radiotap TX/RX structs into malloc'ed memory, rather than in-line inside of ath_softc. I'd rather like to keep ath_softc the same layout regardless of configuration parameters. Pointy hat to: adrian Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c head/sys/dev/ath/ath_rate/amrr/amrr.c head/sys/dev/ath/ath_rate/onoe/onoe.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/if_ath_ahb.c Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Sun Jun 24 08:43:34 2012 (r237528) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Sun Jun 24 08:47:19 2012 (r237529) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); /* * This implements an empty DFS module. */ +#include "opt_ath.h" #include "opt_inet.h" #include "opt_wlan.h" Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c ============================================================================== --- head/sys/dev/ath/ath_rate/amrr/amrr.c Sun Jun 24 08:43:34 2012 (r237528) +++ head/sys/dev/ath/ath_rate/amrr/amrr.c Sun Jun 24 08:47:19 2012 (r237529) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); * "IEEE 802.11 Rate Adaptation: A Practical Approach" by * Mathieu Lacage, Hossein Manshaei, Thierry Turletti */ +#include "opt_ath.h" #include "opt_inet.h" #include "opt_wlan.h" Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c ============================================================================== --- head/sys/dev/ath/ath_rate/onoe/onoe.c Sun Jun 24 08:43:34 2012 (r237528) +++ head/sys/dev/ath/ath_rate/onoe/onoe.c Sun Jun 24 08:47:19 2012 (r237529) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); /* * Atsushi Onoe's rate control algorithm. */ +#include "opt_ath.h" #include "opt_inet.h" #include "opt_wlan.h" Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sun Jun 24 08:43:34 2012 (r237528) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sun Jun 24 08:47:19 2012 (r237529) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); /* * John Bicket's SampleRate control algorithm. */ +#include "opt_ath.h" #include "opt_inet.h" #include "opt_wlan.h" #include "opt_ah.h" Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Sun Jun 24 08:43:34 2012 (r237528) +++ head/sys/dev/ath/if_ath_ahb.c Sun Jun 24 08:47:19 2012 (r237529) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); * AHB bus front-end for the Atheros Wireless LAN controller driver. */ +#include "opt_ath.h" + #include #include #include From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 09:19:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9B38106567B; Sun, 24 Jun 2012 09:19:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D49968FC15; Sun, 24 Jun 2012 09:19:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O9JO66000224; Sun, 24 Jun 2012 09:19:24 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O9JO7n000222; Sun, 24 Jun 2012 09:19:24 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201206240919.q5O9JO7n000222@svn.freebsd.org> From: Andrew Turner Date: Sun, 24 Jun 2012 09:19: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: r237531 - head/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 09:19:25 -0000 Author: andrew Date: Sun Jun 24 09:19:24 2012 New Revision: 237531 URL: http://svn.freebsd.org/changeset/base/237531 Log: Add the sys directory we create to the list of items to clean. Modified: head/lib/libelf/Makefile Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Sun Jun 24 09:12:49 2012 (r237530) +++ head/lib/libelf/Makefile Sun Jun 24 09:19:24 2012 (r237531) @@ -65,6 +65,7 @@ SRCS+= sys/elf32.h sys/elf64.h sys/elf_c GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c CLEANFILES= ${GENSRCS} +CLEANDIRS= sys CFLAGS+= -I${.CURDIR} -I. sys/elf32.h sys/elf64.h sys/elf_common.h: sys From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 09:41:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29D7A1065677; Sun, 24 Jun 2012 09:41:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE3A38FC12; Sun, 24 Jun 2012 09:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O9fRBS001330; Sun, 24 Jun 2012 09:41:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O9fRkm001327; Sun, 24 Jun 2012 09:41:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206240941.q5O9fRkm001327@svn.freebsd.org> From: Alexander Motin Date: Sun, 24 Jun 2012 09:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237532 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 09:41:28 -0000 Author: mav Date: Sun Jun 24 09:41:27 2012 New Revision: 237532 URL: http://svn.freebsd.org/changeset/base/237532 Log: MFC r237225: Remove never used CD/DA_FLAG_TAGGED_QUEUING flags. Modified: stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Sun Jun 24 09:19:24 2012 (r237531) +++ stable/9/sys/cam/scsi/scsi_cd.c Sun Jun 24 09:41:27 2012 (r237532) @@ -97,7 +97,6 @@ typedef enum { CD_FLAG_NEW_DISC = 0x0002, CD_FLAG_DISC_LOCKED = 0x0004, CD_FLAG_DISC_REMOVABLE = 0x0008, - CD_FLAG_TAGGED_QUEUING = 0x0010, CD_FLAG_CHANGER = 0x0040, CD_FLAG_ACTIVE = 0x0080, CD_FLAG_SCHED_ON_COMP = 0x0100, @@ -652,8 +651,6 @@ cdregister(struct cam_periph *periph, vo bioq_init(&softc->bio_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= CD_FLAG_DISC_REMOVABLE; - if ((cgd->inq_data.flags & SID_CmdQue) != 0) - softc->flags |= CD_FLAG_TAGGED_QUEUING; periph->softc = softc; softc->periph = periph; Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Sun Jun 24 09:19:24 2012 (r237531) +++ stable/9/sys/cam/scsi/scsi_da.c Sun Jun 24 09:41:27 2012 (r237532) @@ -77,7 +77,6 @@ typedef enum { DA_FLAG_NEW_PACK = 0x002, DA_FLAG_PACK_LOCKED = 0x004, DA_FLAG_PACK_REMOVABLE = 0x008, - DA_FLAG_TAGGED_QUEUING = 0x010, DA_FLAG_NEED_OTAG = 0x020, DA_FLAG_WENT_IDLE = 0x040, DA_FLAG_RETRY_UA = 0x080, @@ -1540,8 +1539,6 @@ daregister(struct cam_periph *periph, vo bioq_init(&softc->delete_run_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= DA_FLAG_PACK_REMOVABLE; - if ((cgd->inq_data.flags & SID_CmdQue) != 0) - softc->flags |= DA_FLAG_TAGGED_QUEUING; softc->unmap_max_ranges = UNMAP_MAX_RANGES; softc->unmap_max_lba = 1024*1024*2; From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 09:42:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DFA91065670; Sun, 24 Jun 2012 09:42:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 082958FC19; Sun, 24 Jun 2012 09:42:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5O9ga8X001432; Sun, 24 Jun 2012 09:42:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5O9gaYp001429; Sun, 24 Jun 2012 09:42:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206240942.q5O9gaYp001429@svn.freebsd.org> From: Alexander Motin Date: Sun, 24 Jun 2012 09:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237533 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 09:42:37 -0000 Author: mav Date: Sun Jun 24 09:42:36 2012 New Revision: 237533 URL: http://svn.freebsd.org/changeset/base/237533 Log: MFC r237225: Remove never used CD/DA_FLAG_TAGGED_QUEUING flags. Modified: stable/8/sys/cam/scsi/scsi_cd.c stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Sun Jun 24 09:41:27 2012 (r237532) +++ stable/8/sys/cam/scsi/scsi_cd.c Sun Jun 24 09:42:36 2012 (r237533) @@ -97,7 +97,6 @@ typedef enum { CD_FLAG_NEW_DISC = 0x0002, CD_FLAG_DISC_LOCKED = 0x0004, CD_FLAG_DISC_REMOVABLE = 0x0008, - CD_FLAG_TAGGED_QUEUING = 0x0010, CD_FLAG_CHANGER = 0x0040, CD_FLAG_ACTIVE = 0x0080, CD_FLAG_SCHED_ON_COMP = 0x0100, @@ -652,8 +651,6 @@ cdregister(struct cam_periph *periph, vo bioq_init(&softc->bio_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= CD_FLAG_DISC_REMOVABLE; - if ((cgd->inq_data.flags & SID_CmdQue) != 0) - softc->flags |= CD_FLAG_TAGGED_QUEUING; periph->softc = softc; softc->periph = periph; Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Sun Jun 24 09:41:27 2012 (r237532) +++ stable/8/sys/cam/scsi/scsi_da.c Sun Jun 24 09:42:36 2012 (r237533) @@ -76,7 +76,6 @@ typedef enum { DA_FLAG_NEW_PACK = 0x002, DA_FLAG_PACK_LOCKED = 0x004, DA_FLAG_PACK_REMOVABLE = 0x008, - DA_FLAG_TAGGED_QUEUING = 0x010, DA_FLAG_NEED_OTAG = 0x020, DA_FLAG_WENT_IDLE = 0x040, DA_FLAG_RETRY_UA = 0x080, @@ -1445,8 +1444,6 @@ daregister(struct cam_periph *periph, vo bioq_init(&softc->bio_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= DA_FLAG_PACK_REMOVABLE; - if ((cgd->inq_data.flags & SID_CmdQue) != 0) - softc->flags |= DA_FLAG_TAGGED_QUEUING; periph->softc = softc; From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 13:39:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6471B106567A; Sun, 24 Jun 2012 13:39:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34AF68FC12; Sun, 24 Jun 2012 13:39:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5ODdgNB012904; Sun, 24 Jun 2012 13:39:42 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5ODdgOv012902; Sun, 24 Jun 2012 13:39:42 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201206241339.q5ODdgOv012902@svn.freebsd.org> From: Rick Macklem Date: Sun, 24 Jun 2012 13:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237534 - stable/9/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 13:39:42 -0000 Author: rmacklem Date: Sun Jun 24 13:39:41 2012 New Revision: 237534 URL: http://svn.freebsd.org/changeset/base/237534 Log: MFC: r237200 Move the nfsrpc_close() call in ncl_reclaim() for the NFSv4 client to below the vnode_destroy_vobject() call, since that is where writes are flushed. Modified: stable/9/sys/fs/nfsclient/nfs_clnode.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clnode.c Sun Jun 24 09:42:36 2012 (r237533) +++ stable/9/sys/fs/nfsclient/nfs_clnode.c Sun Jun 24 13:39:41 2012 (r237534) @@ -257,15 +257,6 @@ ncl_reclaim(struct vop_reclaim_args *ap) struct nfsnode *np = VTONFS(vp); struct nfsdmap *dp, *dp2; - if (NFS_ISV4(vp) && vp->v_type == VREG) - /* - * Since mmap()'d files do I/O after VOP_CLOSE(), the NFSv4 - * Close operations are delayed until ncl_inactive(). - * However, since VOP_INACTIVE() is not guaranteed to be - * called, we need to do it again here. - */ - (void) nfsrpc_close(vp, 1, ap->a_td); - /* * If the NLM is running, give it a chance to abort pending * locks. @@ -278,6 +269,15 @@ ncl_reclaim(struct vop_reclaim_args *ap) */ vnode_destroy_vobject(vp); + if (NFS_ISV4(vp) && vp->v_type == VREG) + /* + * We can now safely close any remaining NFSv4 Opens for + * this file. Most opens will have already been closed by + * ncl_inactive(), but there are cases where it is not + * called, so we need to do it again here. + */ + (void) nfsrpc_close(vp, 1, ap->a_td); + vfs_hash_remove(vp); /* From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 17:02:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 861241065676; Sun, 24 Jun 2012 17:02:29 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57F438FC17; Sun, 24 Jun 2012 17:02:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5OH2T4H021238; Sun, 24 Jun 2012 17:02:29 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5OH2Tvv021236; Sun, 24 Jun 2012 17:02:29 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201206241702.q5OH2Tvv021236@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 24 Jun 2012 17:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237536 - stable/9/release/picobsd/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 17:02:29 -0000 Author: luigi Date: Sun Jun 24 17:02:28 2012 New Revision: 237536 URL: http://svn.freebsd.org/changeset/base/237536 Log: partial MFC. Mostly, do not build clang when initializing picobsd Modified: stable/9/release/picobsd/build/picobsd Modified: stable/9/release/picobsd/build/picobsd ============================================================================== --- stable/9/release/picobsd/build/picobsd Sun Jun 24 16:56:48 2012 (r237535) +++ stable/9/release/picobsd/build/picobsd Sun Jun 24 17:02:28 2012 (r237536) @@ -164,6 +164,7 @@ create_includes_and_libraries2() { # opt log "create_includes_and_libraries2() for ${SRC} $1" if [ ${OSVERSION} -ge 600000 ] ; then no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" + no="$no -DWITHOUT_CLANG" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi @@ -441,7 +442,7 @@ do_kernel() { # OK [ "${o_do_modules}" = "yes" ] && export MODULES="" ${BINMAKE} ${o_par} KERNCONF=${l_kernconf} \ -v -f ${PICO_TREE}/build/Makefile.conf ) || \ - fail $? missing_kernel + fail $? missing_kernel } # Populate the variable part of the floppy filesystem. Must be done before @@ -591,7 +592,7 @@ find_progs() { # programs if [ "$old_libs" = "$i" ] ; then log "libraries for: $my_progs ($u_progs) are ($i) $u_libs" log "--- done find_progs ---" - return 0 + return 0 else # logverbose "old--- $old_libs --- new +++ $i +++" fi @@ -881,11 +882,11 @@ fill_floppy_image() { fi log "Compress with kgzip and copy to floppy image" - mkdir -p ${dst}/boot/kernel + mkdir -p ${dst}/boot/kernel # XXX update loader.conf - echo "hint.acpi.0.disabled=\"1\"" > ${dst}/boot/loader.conf - echo "console=\"comconsole\"" >> ${dst}/boot/loader.conf - cp -p /boot/loader ${dst}/boot/loader || fail $? no_space "copying bootloader" + echo "hint.acpi.0.disabled=\"1\"" > ${dst}/boot/loader.conf + echo "console=\"comconsole\"" >> ${dst}/boot/loader.conf + cp -p /boot/loader ${dst}/boot/loader || fail $? no_space "copying bootloader" gzip -c kernel > ${dst}/boot/kernel/kernel.gz || fail $? no_space "copying kernel" # now transfer the floppy tree. If it is already in mfs, dont bother. From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 17:30:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E46DE1065673; Sun, 24 Jun 2012 17:30:54 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD4EC8FC1A; Sun, 24 Jun 2012 17:30:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5OHUsMi022543; Sun, 24 Jun 2012 17:30:54 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5OHUsF9022536; Sun, 24 Jun 2012 17:30:54 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201206241730.q5OHUsF9022536@svn.freebsd.org> From: Matt Jacob Date: Sun, 24 Jun 2012 17:30: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: r237537 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 17:30:55 -0000 Author: mjacob Date: Sun Jun 24 17:30:54 2012 New Revision: 237537 URL: http://svn.freebsd.org/changeset/base/237537 Log: Clean up multi-id mode so it's driven by the f/w loaded, not by some hint setting. Do more preparations for FC-Tape. Clean up resource counting for 24XX or later chipsets so we find out after EXEC_FIRMWARE what is actually supported. Set target mode exchange count based upon whether or not we are supporting simultaneous target/initiator mode. Clean up some old (pre-24XX) xfwoption and zfwoption issues. Sponsored by: Spectralogic MFC after: 3 days Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_pci.c head/sys/dev/isp/ispmbox.h head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Jun 24 17:02:28 2012 (r237536) +++ head/sys/dev/isp/isp.c Sun Jun 24 17:30:54 2012 (r237537) @@ -1088,7 +1088,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d isp->isp_fwattr = mbs.param[6]; } if (IS_24XX(isp) && (isp->isp_fwattr & ISP2400_FW_ATTR_EXTNDED)) { - isp->isp_fwattr ^= ISP2400_FW_ATTR_EXTNDED; isp->isp_fwattr |= (((uint64_t) mbs.param[15]) << 16) | (((uint64_t) mbs.param[16]) << 32) | (((uint64_t) mbs.param[17]) << 48); } } else if (IS_SCSI(isp)) { @@ -1140,7 +1139,8 @@ isp_reset(ispsoftc_t *isp, int do_load_d } fwt &= ~ISP2400_FW_ATTR_EXTNDED; if (fwt) { - ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s (unknown 0x%jx)", buf, (uintmax_t)fwt); + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s (unknown 0x%08x%08x)", buf, + (uint32_t) (fwt >> 32), (uint32_t) fwt); } isp_prt(isp, ISP_LOGCONFIG, "%s", buf); } else if (IS_FC(isp)) { @@ -1183,12 +1183,23 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s 2K-Login", buf); } if (fwt != 0) { - ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s (unknown 0x%jx)", buf, (uintmax_t)fwt); + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s (unknown 0x%08x%08x)", buf, + (uint32_t) (fwt >> 32), (uint32_t) fwt); } isp_prt(isp, ISP_LOGCONFIG, "%s", buf); } - if (!IS_24XX(isp)) { + if (IS_24XX(isp)) { + MBSINIT(&mbs, MBOX_GET_RESOURCE_COUNT, MBLOGALL, 0); + isp_mboxcmd(isp, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + ISP_RESET0(isp); + return; + } + if (isp->isp_maxcmds >= mbs.param[3]) { + isp->isp_maxcmds = mbs.param[3]; + } + } else { MBSINIT(&mbs, MBOX_GET_FIRMWARE_STATUS, MBLOGALL, 0); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { @@ -1206,11 +1217,12 @@ isp_reset(ispsoftc_t *isp, int do_load_d * Only make this check for non-SCSI cards (I'm not sure firmware attributes * work for them). */ - if (IS_FC(isp) && ISP_CAP_MULTI_ID(isp) == 0 && isp->isp_nchan > 1) { - isp_prt(isp, ISP_LOGWARN, "non-MULTIID f/w loaded, only can enable 1 of %d channels", isp->isp_nchan); - isp->isp_nchan = 1; + if (IS_FC(isp) && isp->isp_nchan > 1) { + if (!IS_24XX(isp) || (fwt & ISP2400_FW_ATTR_MULTIID) == 0) { + isp_prt(isp, ISP_LOGWARN, "non-MULTIID f/w loaded, only can enable 1 of %d channels", isp->isp_nchan); + isp->isp_nchan = 1; + } } - for (i = 0; i < isp->isp_nchan; i++) { isp_fw_state(isp, i); } @@ -1697,21 +1709,39 @@ isp_fibre_init(ispsoftc_t *isp) */ if (IS_2200(isp) || IS_23XX(isp)) { icbp->icb_fwoptions |= ICBOPT_EXTENDED; + + icbp->icb_xfwoptions = fcp->isp_xfwoptions; + /* * Prefer or force Point-To-Point instead Loop? */ switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { case ISP_CFG_NPORT: + icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; icbp->icb_xfwoptions |= ICBXOPT_PTP_2_LOOP; break; case ISP_CFG_NPORT_ONLY: + icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; icbp->icb_xfwoptions |= ICBXOPT_PTP_ONLY; break; case ISP_CFG_LPORT_ONLY: + icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; icbp->icb_xfwoptions |= ICBXOPT_LOOP_ONLY; break; default: - icbp->icb_xfwoptions |= ICBXOPT_LOOP_2_PTP; + /* + * Let NVRAM settings define it if they are sane + */ + switch (icbp->icb_xfwoptions & ICBXOPT_TOPO_MASK) { + case ICBXOPT_PTP_2_LOOP: + case ICBXOPT_PTP_ONLY: + case ICBXOPT_LOOP_ONLY: + case ICBXOPT_LOOP_2_PTP: + break; + default: + icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; + icbp->icb_xfwoptions |= ICBXOPT_LOOP_2_PTP; + } break; } if (IS_2200(isp)) { @@ -1737,15 +1767,24 @@ isp_fibre_init(ispsoftc_t *isp) icbp->icb_xfwoptions |= ICBXOPT_ZIO; icbp->icb_idelaytimer = 10; } + icbp->icb_zfwoptions = fcp->isp_zfwoptions; if (isp->isp_confopts & ISP_CFG_ONEGB) { + icbp->icb_zfwoptions &= ~ICBZOPT_RATE_MASK; icbp->icb_zfwoptions |= ICBZOPT_RATE_ONEGB; } else if (isp->isp_confopts & ISP_CFG_TWOGB) { + icbp->icb_zfwoptions &= ~ICBZOPT_RATE_MASK; icbp->icb_zfwoptions |= ICBZOPT_RATE_TWOGB; } else { - icbp->icb_zfwoptions |= ICBZOPT_RATE_AUTO; - } - if (fcp->isp_zfwoptions & ICBZOPT_50_OHM) { - icbp->icb_zfwoptions |= ICBZOPT_50_OHM; + switch (icbp->icb_zfwoptions & ICBZOPT_RATE_MASK) { + case ICBZOPT_RATE_ONEGB: + case ICBZOPT_RATE_TWOGB: + case ICBZOPT_RATE_AUTO: + break; + default: + icbp->icb_zfwoptions &= ~ICBZOPT_RATE_MASK; + icbp->icb_zfwoptions |= ICBZOPT_RATE_AUTO; + break; + } } } } @@ -1915,16 +1954,13 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_execthrottle = ICB_DFLT_THROTTLE; } + /* + * Set target exchange count. Take half if we are supporting both roles. + */ if (icbp->icb_fwoptions1 & ICB2400_OPT1_TGT_ENABLE) { - /* - * Get current resource count - */ - MBSINIT(&mbs, MBOX_GET_RESOURCE_COUNT, MBLOGALL, 0); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - return; - } - icbp->icb_xchgcnt = mbs.param[3]; + icbp->icb_xchgcnt = isp->isp_maxcmds; + if ((icbp->icb_fwoptions1 & ICB2400_OPT1_INI_DISABLE) == 0) + icbp->icb_xchgcnt >>= 1; } @@ -2511,15 +2547,12 @@ isp_get_wwn(ispsoftc_t *isp, int chan, i MBSINIT(&mbs, MBOX_GET_PORT_NAME, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR, 500000); if (ISP_CAP_2KLOGIN(isp)) { mbs.param[1] = loopid; - mbs.ibits = (1 << 10); if (nodename) { mbs.param[10] = 1; } - if (ISP_CAP_MULTI_ID(isp)) { - mbs.ibits |= (1 << 9); - mbs.param[9] = chan; - } + mbs.param[9] = chan; } else { + mbs.ibits = 3; mbs.param[1] = loopid << 8; if (nodename) { mbs.param[1] |= 1; @@ -7013,7 +7046,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x00, 0x00), /* 0x3f: */ ISP_FC_OPMAP(0x03, 0x01), /* 0x40: MBOX_LOOP_PORT_BYPASS */ ISP_FC_OPMAP(0x03, 0x01), /* 0x41: MBOX_LOOP_PORT_ENABLE */ - ISP_FC_OPMAP_HALF(0x3, 0xcf, 0x0, 0x07), /* 0x42: MBOX_GET_RESOURCE_COUNT */ + ISP_FC_OPMAP_HALF(0x0, 0x01, 0x3, 0xcf), /* 0x42: MBOX_GET_RESOURCE_COUNT */ ISP_FC_OPMAP(0x01, 0x01), /* 0x43: MBOX_REQUEST_OFFLINE_MODE */ ISP_FC_OPMAP(0x00, 0x00), /* 0x44: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x45: */ @@ -7053,7 +7086,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x07, 0x01), /* 0x67: MBOX_CLEAR_TASK_SET */ ISP_FC_OPMAP(0x07, 0x01), /* 0x68: MBOX_ABORT_TASK_SET */ ISP_FC_OPMAP(0x01, 0x07), /* 0x69: MBOX_GET_FW_STATE */ - ISP_FC_OPMAP(0x03, 0xcf), /* 0x6a: MBOX_GET_PORT_NAME */ + ISP_FC_OPMAP_HALF(0x6, 0x03, 0x0, 0xcf), /* 0x6a: MBOX_GET_PORT_NAME */ ISP_FC_OPMAP(0xcf, 0x01), /* 0x6b: MBOX_GET_LINK_STATUS */ ISP_FC_OPMAP(0x0f, 0x01), /* 0x6c: MBOX_INIT_LIP_RESET */ ISP_FC_OPMAP(0x00, 0x00), /* 0x6d: */ Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sun Jun 24 17:02:28 2012 (r237536) +++ head/sys/dev/isp/isp_freebsd.c Sun Jun 24 17:30:54 2012 (r237537) @@ -2210,6 +2210,7 @@ isp_handle_platform_atio7(ispsoftc_t *is tstate_t *tptr; struct ccb_accept_tio *atiop; atio_private_data_t *atp = NULL; + atio_private_data_t *oatp; inot_private_data_t *ntp; did = (aep->at_hdr.d_id[0] << 16) | (aep->at_hdr.d_id[1] << 8) | aep->at_hdr.d_id[2]; @@ -2304,6 +2305,7 @@ isp_handle_platform_atio7(ispsoftc_t *is * it and go to noresrc. */ if (tptr->restart_queue) { + isp_prt(isp, ISP_LOGTDEBUG0, "%s: restart queue refilling", __func__); if (restart_queue) { ntp = tptr->restart_queue; tptr->restart_queue = restart_queue; @@ -2340,15 +2342,15 @@ isp_handle_platform_atio7(ispsoftc_t *is isp_prt(isp, ISP_LOGTDEBUG0, "[0x%x] out of atps", aep->at_rxid); goto noresrc; } - if (isp_get_atpd(isp, tptr, aep->at_rxid)) { - isp_prt(isp, ISP_LOGTDEBUG0, "[0x%x] tag wraparound in isp_handle_platforms_atio7 (N-Port Handle 0x%04x S_ID 0x%04x OX_ID 0x%04x)\n", - aep->at_rxid, nphdl, sid, aep->at_hdr.ox_id); + oatp = isp_get_atpd(isp, tptr, aep->at_rxid); + if (oatp) { + isp_prt(isp, ISP_LOGTDEBUG0, "[0x%x] tag wraparound in isp_handle_platforms_atio7 (N-Port Handle 0x%04x S_ID 0x%04x OX_ID 0x%04x) oatp state %d\n", + aep->at_rxid, nphdl, sid, aep->at_hdr.ox_id, oatp->state); /* * It's not a "no resource" condition- but we can treat it like one */ goto noresrc; } - atp->tag = aep->at_rxid; atp->state = ATPD_STATE_ATIO; SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle); @@ -2394,6 +2396,7 @@ isp_handle_platform_atio7(ispsoftc_t *is atp->nphdl = nphdl; atp->portid = sid; atp->oxid = aep->at_hdr.ox_id; + atp->rxid = aep->at_hdr.rx_id; atp->cdb0 = atiop->cdb_io.cdb_bytes[0]; atp->tattr = aep->at_cmnd.fcp_cmnd_task_attribute & FCP_CMND_TASK_ATTR_MASK; atp->state = ATPD_STATE_CAM; Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Sun Jun 24 17:02:28 2012 (r237536) +++ head/sys/dev/isp/isp_freebsd.h Sun Jun 24 17:30:54 2012 (r237537) @@ -62,7 +62,7 @@ #include "opt_isp.h" #define ISP_PLATFORM_VERSION_MAJOR 7 -#define ISP_PLATFORM_VERSION_MINOR 0 +#define ISP_PLATFORM_VERSION_MINOR 10 /* * Efficiency- get rid of SBus code && tests unless we need them. @@ -93,13 +93,14 @@ typedef struct { uint32_t orig_datalen; uint32_t bytes_xfered; uint32_t last_xframt; - uint32_t tag; + uint32_t tag; /* typically f/w RX_ID */ uint32_t lun; uint32_t nphdl; uint32_t sid; uint32_t portid; + uint16_t rxid; /* wire rxid */ + uint16_t oxid; /* wire oxid */ uint32_t - oxid : 16, cdb0 : 8, : 1, dead : 1, Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sun Jun 24 17:02:28 2012 (r237536) +++ head/sys/dev/isp/isp_pci.c Sun Jun 24 17:30:54 2012 (r237537) @@ -374,6 +374,7 @@ static devclass_t isp_devclass; DRIVER_MODULE(isp, pci, isp_pci_driver, isp_devclass, 0, 0); MODULE_DEPEND(isp, cam, 1, 1, 1); MODULE_DEPEND(isp, firmware, 1, 1, 1); +static int isp_nvports = 0; static int isp_pci_probe(device_t dev) @@ -451,7 +452,7 @@ isp_pci_probe(device_t dev) } static void -isp_get_generic_options(device_t dev, ispsoftc_t *isp, int *nvp) +isp_get_generic_options(device_t dev, ispsoftc_t *isp) { int tval; @@ -483,12 +484,10 @@ isp_get_generic_options(device_t dev, is if (bootverbose) { isp->isp_dblev |= ISP_LOGCONFIG|ISP_LOGINFO; } - tval = 0; + tval = -1; (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "vports", &tval); if (tval > 0 && tval < 127) { - *nvp = tval; - } else { - *nvp = 0; + isp_nvports = tval; } tval = 1; (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "autoconfig", &tval); @@ -527,7 +526,7 @@ static void isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp) { const char *sptr; - int tval; + int tval = 0; if (resource_int_value(device_get_name(dev), device_get_unit(dev), "iid", &tval)) { if (IS_FC(isp)) { @@ -648,7 +647,6 @@ static int isp_pci_attach(device_t dev) { int i, m1, m2, locksetup = 0; - int isp_nvports = 0; uint32_t data, cmd, linesz, did; struct isp_pcisoftc *pcs; ispsoftc_t *isp; @@ -670,7 +668,8 @@ isp_pci_attach(device_t dev) /* * Get Generic Options */ - isp_get_generic_options(dev, isp, &isp_nvports); + isp_nvports = 0; + isp_get_generic_options(dev, isp); /* * Check to see if options have us disabled @@ -876,21 +875,16 @@ isp_pci_attach(device_t dev) /* * Make sure that SERR, PERR, WRITE INVALIDATE and BUSMASTER are set. */ - cmd |= PCIM_CMD_SEREN | PCIM_CMD_PERRESPEN | - PCIM_CMD_BUSMASTEREN | PCIM_CMD_INVEN; - + cmd |= PCIM_CMD_SEREN | PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_INVEN; if (IS_2300(isp)) { /* per QLogic errata */ cmd &= ~PCIM_CMD_INVEN; } - if (IS_2322(isp) || pci_get_devid(dev) == PCI_QLOGIC_ISP6312) { cmd &= ~PCIM_CMD_INTX_DISABLE; } - if (IS_24XX(isp)) { cmd &= ~PCIM_CMD_INTX_DISABLE; } - pci_write_config(dev, PCIR_COMMAND, cmd, 2); /* Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Sun Jun 24 17:02:28 2012 (r237536) +++ head/sys/dev/isp/ispmbox.h Sun Jun 24 17:30:54 2012 (r237537) @@ -851,21 +851,36 @@ typedef struct { #define ISP2400_FW_ATTR_EXPFW 0x2000 #define ISP2400_FW_ATTR_EXTNDED 0x8000 -#define ISP_CAP_FCTAPE(isp) \ - (IS_24XX(isp)? 1 : (isp->isp_fwattr & ISP_FW_ATTR_FCTAPE)) +/* + * These are either manifestly true or are dependent on f/w attributes + */ #define ISP_CAP_TMODE(isp) \ (IS_24XX(isp)? 1 : (isp->isp_fwattr & ISP_FW_ATTR_TMODE)) #define ISP_CAP_SCCFW(isp) \ (IS_24XX(isp)? 1 : (isp->isp_fwattr & ISP_FW_ATTR_SCCLUN)) #define ISP_CAP_2KLOGIN(isp) \ (IS_24XX(isp)? 1 : (isp->isp_fwattr & ISP_FW_ATTR_2KLOGINS)) + +/* + * This is only true for 24XX cards with this f/w attribute + */ #define ISP_CAP_MULTI_ID(isp) \ (IS_24XX(isp)? (isp->isp_fwattr & ISP2400_FW_ATTR_MULTIID) : 0) - #define ISP_GET_VPIDX(isp, tag) \ (ISP_CAP_MULTI_ID(isp) ? tag : 0) /* + * This is true manifestly or is dependent on a f/w attribute + * but may or may not actually be *enabled*. In any case, it + * is enabled on a per-channel basis. + */ +#define ISP_CAP_FCTAPE(isp) \ + (IS_24XX(isp)? 1 : (isp->isp_fwattr & ISP_FW_ATTR_FCTAPE)) + +#define ISP_FCTAPE_ENABLED(isp, chan) \ + (IS_24XX(isp)? (FCPARAM(isp, chan)->isp_xfwoptions & ICB2400_OPT2_FCTAPE) != 0 : (FCPARAM(isp, chan)->isp_xfwoptions & ICBXOPT_FCTAPE) != 0) + +/* * Reduced Interrupt Operation Response Queue Entries */ Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Sun Jun 24 17:02:28 2012 (r237536) +++ head/sys/dev/isp/ispvar.h Sun Jun 24 17:30:54 2012 (r237537) @@ -678,7 +678,7 @@ struct ispsoftc { #define ISP_RUNSTATE 4 /* - * ISP Configuration Options + * ISP Runtime Configuration Options */ #define ISP_CFG_NORELOAD 0x80 /* don't download f/w */ #define ISP_CFG_NONVRAM 0x40 /* ignore NVRAM */ From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 17:37:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C6368106566B; Sun, 24 Jun 2012 17:37:08 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96F7B8FC12; Sun, 24 Jun 2012 17:37:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5OHb8nX022831; Sun, 24 Jun 2012 17:37:08 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5OHb8Y4022827; Sun, 24 Jun 2012 17:37:08 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201206241737.q5OHb8Y4022827@svn.freebsd.org> From: Christian Brueffer Date: Sun, 24 Jun 2012 17:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237538 - in stable/8: . share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 17:37:08 -0000 Author: brueffer Date: Sun Jun 24 17:37:08 2012 New Revision: 237538 URL: http://svn.freebsd.org/changeset/base/237538 Log: MFC: r211353 Tie up some loose ends r88509 left behind: - chooseproc() is long gone, MLINK choosethread instead - Update NAME section for choosethread - Mark chooseproc.9 for removal Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/share/man/man9/Makefile stable/8/share/man/man9/runqueue.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Sun Jun 24 17:30:54 2012 (r237537) +++ stable/8/ObsoleteFiles.inc Sun Jun 24 17:37:08 2012 (r237538) @@ -27,6 +27,8 @@ OLD_FILES+=usr/share/man/man8/MAKEDEV.8. OLD_FILES+=usr/share/man/man9/vgonel.9.gz # 20101025: catch up with vm_page_sleep_if_busy rename OLD_FILES+=usr/share/man/man9/vm_page_sleep_busy.9.gz +# 20100815: retired last traces of chooseproc(9) +OLD_FILES+=usr/share/man/man9/chooseproc.9.gz # 20100327: fusword.9 and susword.9 removed OLD_FILES+=usr/share/man/man9/fusword.9.gz OLD_FILES+=usr/share/man/man9/susword.9.gz Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Sun Jun 24 17:30:54 2012 (r237537) +++ stable/8/share/man/man9/Makefile Sun Jun 24 17:37:08 2012 (r237538) @@ -1036,7 +1036,7 @@ MLINKS+=rtalloc.9 rtalloc1.9 \ rtalloc.9 rtalloc_ign.9 \ rtalloc.9 RTFREE.9 \ rtalloc.9 rtfree.9 -MLINKS+=runqueue.9 chooseproc.9 \ +MLINKS+=runqueue.9 choosethread.9 \ runqueue.9 procrunnable.9 \ runqueue.9 remrunqueue.9 \ runqueue.9 setrunqueue.9 Modified: stable/8/share/man/man9/runqueue.9 ============================================================================== --- stable/8/share/man/man9/runqueue.9 Sun Jun 24 17:30:54 2012 (r237537) +++ stable/8/share/man/man9/runqueue.9 Sun Jun 24 17:37:08 2012 (r237538) @@ -23,11 +23,11 @@ .\" .\" $FreeBSD$ .\" -.Dd November 3, 2000 +.Dd August 15, 2010 .Dt RUNQUEUE 9 .Os .Sh NAME -.Nm chooseproc , +.Nm choosethread , .Nm procrunnable , .Nm remrunqueue , .Nm setrunqueue From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 18:14:08 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29001106566C; Sun, 24 Jun 2012 18:14:08 +0000 (UTC) (envelope-from br@jail.io) Received: from mx.bsdpad.com (mx.bsdpad.com [46.4.68.80]) by mx1.freebsd.org (Postfix) with ESMTP id D47108FC12; Sun, 24 Jun 2012 18:14:07 +0000 (UTC) Received: from mx.bsdpad.com ([46.4.68.80] helo=jail.io) by mx.bsdpad.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1SirJk-000EIy-Ta; Sun, 24 Jun 2012 22:13:49 +0400 Received: (from br@localhost) by jail.io (8.14.5/8.14.5/Submit) id q5OIDmKx054991; Sun, 24 Jun 2012 18:13:48 GMT (envelope-from br) Date: Sun, 24 Jun 2012 22:13:48 +0400 From: Ruslan Bukin To: Jung-uk Kim Message-ID: <20120624181348.GA54897@jail.io> References: <201206220040.q5M0ejNk045397@svn.freebsd.org> <20120622095847.GC2337@deviant.kiev.zoral.com.ua> <4FE494FA.1030907@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4FE494FA.1030907@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237412 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/components/disa... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 18:14:08 -0000 On Fri, Jun 22, 2012 at 11:53:30AM -0400, Jung-uk Kim wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 2012-06-22 05:58:47 -0400, Konstantin Belousov wrote: > > On Fri, Jun 22, 2012 at 12:40:45AM +0000, Jung-uk Kim wrote: > >> Author: jkim Date: Fri Jun 22 00:40:44 2012 New Revision: 237412 > >> URL: http://svn.freebsd.org/changeset/base/237412 > >> > >> Log: Merge ACPICA 20120620. > > > > I think it is caused by import, malloc is called while spinlock is > > held: > > > > ACPI: Executed 1 blocks of module-level executable AML code acpi0: > > Power Button (fixed) panic: blockable sleep lock (sleep mutex) 16 @ > > /usr/home/kostik/work/build/bsd/DEV/src/sys/vm/uma_core.c:2040 > > cpuid = 0 KDB: stack backtrace: db_trace_self_wrapper() at > > 0xffffffff80279d0a = db_trace_self_wrapper+0x2a panic() at > > 0xffffffff80325a28 = panic+0x1d8 witness_checkorder() at > > 0xffffffff80377938 = witness_checkorder+0x1d8 _mtx_lock_flags() at > > 0xffffffff80313777 = _mtx_lock_flags+0x87 uma_zalloc_arg() at > > 0xffffffff804db97a = uma_zalloc_arg+0x2ea malloc() at > > 0xffffffff8030f7cd = malloc+0xbd AcpiUtAllocate() at > > 0xffffffff802704f1 = AcpiUtAllocate+0x31 AcpiUtAllocateZeroed() at > > 0xffffffff80270559 = AcpiUtAllocateZeroed+0x19 > > AcpiSetupGpeForWake() at 0xffffffff8025becc = > > AcpiSetupGpeForWake+0xfc acpi_probe_child() at 0xffffffff802848e9 = > > acpi_probe_child+0x2b9 AcpiNsWalkNamespace() at 0xffffffff802686ef > > = AcpiNsWalkNamespace+0x15f AcpiWalkNamespace() at > > 0xffffffff80268c0f = AcpiWalkNamespace+0xbf acpi_attach() at > > 0xffffffff80283e43 = acpi_attach+0x993 device_attach() at > > 0xffffffff8035ab62 = device_attach+0x72 bus_generic_attach() at > > 0xffffffff8035bd3a = bus_generic_attach+0x1a nexus_acpi_attach() at > > 0xffffffff804fbd89 = nexus_acpi_attach+0x69 device_attach() at > > 0xffffffff8035ab62 = device_attach+0x72 bus_generic_new_pass() at > > 0xffffffff8035bf46 = bus_generic_new_pass+0xd6 bus_set_pass() at > > 0xffffffff803597ba = bus_set_pass+0x7a configure() at > > 0xffffffff804fd51a = configure+0xa mi_startup() at > > 0xffffffff802d5c17 = mi_startup+0x77 btext() at 0xffffffff802531cc > > = btext+0x2c KDB: enter: panic [ thread pid 0 tid 100000 ] Stopped > > at 0xffffffff8035fffb = kdb_enter+0x3b: movq > > $0,0x1027d62(%rip) db> show alllocks Process 0 (kernel) thread > > 0xffffffff80837cc0 (100000) exclusive sleep mutex Giant (Giant) r = > > 0 (0xffffffff8133a900) locked @ > > /usr/home/kostik/work/build/bsd/DEV/src/sys/kern/kern_module.c:116 > > exclusive spin mutex ACPI lock (0xfffffe000321da80) (ACPI lock > > (0xfffffe000321da80)) r = 0 (0xfffffe000321da80) locked @ > > /usr/home/kostik/work/build/bsd/DEV/src/sys/dev/acpica/Osd/OsdSynch.c:535 > > Hmm... > > > I was afraid it might happen. I'll look into it ASAP. > > Sorry for the trouble, > I have the same problem on server & laptop -Ruslan From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 18:38:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A2A9C106566C; Sun, 24 Jun 2012 18:38:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72FC08FC15; Sun, 24 Jun 2012 18:38:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5OIcHkQ025389; Sun, 24 Jun 2012 18:38:17 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5OIcHfu025385; Sun, 24 Jun 2012 18:38:17 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201206241838.q5OIcHfu025385@svn.freebsd.org> From: Christian Brueffer Date: Sun, 24 Jun 2012 18:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237539 - in stable/7: . share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 18:38:17 -0000 Author: brueffer Date: Sun Jun 24 18:38:16 2012 New Revision: 237539 URL: http://svn.freebsd.org/changeset/base/237539 Log: MFC: r211353 Tie up some loose ends r88509 left behind: - chooseproc() is long gone, MLINK choosethread instead - Update NAME section for choosethread - Mark chooseproc.9 for removal Modified: stable/7/ObsoleteFiles.inc (contents, props changed) stable/7/share/man/man9/Makefile stable/7/share/man/man9/runqueue.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/ObsoleteFiles.inc ============================================================================== --- stable/7/ObsoleteFiles.inc Sun Jun 24 17:37:08 2012 (r237538) +++ stable/7/ObsoleteFiles.inc Sun Jun 24 18:38:16 2012 (r237539) @@ -22,6 +22,8 @@ OLD_FILES+=usr/share/man/man8/MAKEDEV.8. OLD_FILES+=usr/share/man/man9/vgonel.9.gz # 20101025: catch up with vm_page_sleep_if_busy rename OLD_FILES+=usr/share/man/man9/vm_page_sleep_busy.9.gz +# 20100815: retired last traces of chooseproc(9) +OLD_FILES+=usr/share/man/man9/chooseproc.9.gz # 20091129: pecoff image activator removed .if ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/pecoff_machdep.h Modified: stable/7/share/man/man9/Makefile ============================================================================== --- stable/7/share/man/man9/Makefile Sun Jun 24 17:37:08 2012 (r237538) +++ stable/7/share/man/man9/Makefile Sun Jun 24 18:38:16 2012 (r237539) @@ -930,7 +930,7 @@ MLINKS+=rtalloc.9 rtalloc1.9 \ rtalloc.9 rtalloc_ign.9 \ rtalloc.9 RTFREE.9 \ rtalloc.9 rtfree.9 -MLINKS+=runqueue.9 chooseproc.9 \ +MLINKS+=runqueue.9 choosethread.9 \ runqueue.9 procrunnable.9 \ runqueue.9 remrunqueue.9 \ runqueue.9 setrunqueue.9 Modified: stable/7/share/man/man9/runqueue.9 ============================================================================== --- stable/7/share/man/man9/runqueue.9 Sun Jun 24 17:37:08 2012 (r237538) +++ stable/7/share/man/man9/runqueue.9 Sun Jun 24 18:38:16 2012 (r237539) @@ -23,11 +23,11 @@ .\" .\" $FreeBSD$ .\" -.Dd November 3, 2000 +.Dd August 15, 2010 .Dt RUNQUEUE 9 .Os .Sh NAME -.Nm chooseproc , +.Nm choosethread , .Nm procrunnable , .Nm remrunqueue , .Nm setrunqueue From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 21:25:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 888CB1065670; Sun, 24 Jun 2012 21:25:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 727D38FC21; Sun, 24 Jun 2012 21:25:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5OLPtA3032321; Sun, 24 Jun 2012 21:25:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5OLPtPL032314; Sun, 24 Jun 2012 21:25:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201206242125.q5OLPtPL032314@svn.freebsd.org> From: Michael Tuexen Date: Sun, 24 Jun 2012 21:25: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: r237540 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 21:25:55 -0000 Author: tuexen Date: Sun Jun 24 21:25:54 2012 New Revision: 237540 URL: http://svn.freebsd.org/changeset/base/237540 Log: Do packet logging in a consistent way. MFC after: 3 days Modified: head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_bsd_addr.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Sun Jun 24 18:38:16 2012 (r237539) +++ head/sys/netinet/sctp_bsd_addr.c Sun Jun 24 21:25:54 2012 (r237540) @@ -422,11 +422,12 @@ sctp_get_mbuf_for_msg(unsigned int space #ifdef SCTP_PACKET_LOGGING void -sctp_packet_log(struct mbuf *m, int length) +sctp_packet_log(struct mbuf *m) { int *lenat, thisone; void *copyto; uint32_t *tick_tock; + int length; int total_len; int grabbed_lock = 0; int value, newval, thisend, thisbegin; @@ -436,6 +437,7 @@ sctp_packet_log(struct mbuf *m, int leng * (value) -ticks of log (ticks) o -ip packet o -as logged - * where this started (thisbegin) x <--end points here */ + length = SCTP_HEADER_LEN(m); total_len = SCTP_SIZE32((length + (4 * sizeof(int)))); /* Log a packet to the buffer. */ if (total_len > SCTP_PACKET_LOG_SIZE) { Modified: head/sys/netinet/sctp_bsd_addr.h ============================================================================== --- head/sys/netinet/sctp_bsd_addr.h Sun Jun 24 18:38:16 2012 (r237539) +++ head/sys/netinet/sctp_bsd_addr.h Sun Jun 24 21:25:54 2012 (r237540) @@ -53,7 +53,7 @@ void sctp_gather_internal_ifa_flags(stru #ifdef SCTP_PACKET_LOGGING -void sctp_packet_log(struct mbuf *m, int length); +void sctp_packet_log(struct mbuf *m); int sctp_copy_out_packet_log(uint8_t * target, int length); #endif Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Jun 24 18:38:16 2012 (r237539) +++ head/sys/netinet/sctp_input.c Sun Jun 24 21:25:54 2012 (r237540) @@ -5932,9 +5932,9 @@ sctp_input_with_port(struct mbuf *i_pak, } } #endif -#ifdef SCTP_PACKET_LOGGING +#ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, mlen); + sctp_packet_log(m); #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sun Jun 24 18:38:16 2012 (r237539) +++ head/sys/netinet/sctp_os_bsd.h Sun Jun 24 21:25:54 2012 (r237540) @@ -365,7 +365,7 @@ typedef struct callout sctp_os_timer_t; */ #define SCTP_HEADER_TO_CHAIN(m) (m) #define SCTP_DETACH_HEADER_FROM_CHAIN(m) -#define SCTP_HEADER_LEN(m) (m->m_pkthdr.len) +#define SCTP_HEADER_LEN(m) ((m)->m_pkthdr.len) #define SCTP_GET_HEADER_FOR_OUTPUT(o_pak) 0 #define SCTP_RELEASE_HEADER(m) #define SCTP_RELEASE_PKT(m) sctp_m_freem(m) Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jun 24 18:38:16 2012 (r237539) +++ head/sys/netinet/sctp_output.c Sun Jun 24 21:25:54 2012 (r237540) @@ -4107,10 +4107,6 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_m_freem(m); return (ENOMEM); } -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, packet_length); -#endif SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -4131,6 +4127,10 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + sctp_packet_log(o_pak); +#endif /* send it out. table id is taken from stcb */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { @@ -4459,10 +4459,6 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); return (ENOMEM); } -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, packet_length); -#endif SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -4490,6 +4486,10 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_SOCKET_UNLOCK(so, 0); } #endif +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + sctp_packet_log(o_pak); +#endif SCTP_IP6_OUTPUT(ret, o_pak, (struct route_in6 *)ro, &ifp, stcb, vrf_id); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { @@ -11067,11 +11067,6 @@ sctp_send_resp_msg(struct mbuf *m, struc } } iph_out->ip_len = len; -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { - sctp_packet_log(mout, len); - } -#endif if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); @@ -11091,6 +11086,11 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(o_pak); + } +#endif SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id); /* Free the route if we got one back */ if (ro.ro_rt) { @@ -11101,11 +11101,6 @@ sctp_send_resp_msg(struct mbuf *m, struc #ifdef INET6 if (ip6_out != NULL) { ip6_out->ip6_plen = len - sizeof(struct ip6_hdr); -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { - sctp_packet_log(mout, len); - } -#endif if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); @@ -11125,6 +11120,11 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(o_pak); + } +#endif SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); } #endif Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun Jun 24 18:38:16 2012 (r237539) +++ head/sys/netinet6/sctp6_usrreq.c Sun Jun 24 21:25:54 2012 (r237540) @@ -100,10 +100,12 @@ sctp6_input(struct mbuf **i_pak, int *of return (-1); } m = SCTP_HEADER_TO_CHAIN(*i_pak); - pkt_len = SCTP_HEADER_LEN((*i_pak)); + pkt_len = SCTP_HEADER_LEN(*i_pak); -#ifdef SCTP_PACKET_LOGGING - sctp_packet_log(m, pkt_len); +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(m); + } #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 22:22:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A7961065674; Sun, 24 Jun 2012 22:22:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BEA78FC17; Sun, 24 Jun 2012 22:22:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5OMMilm034616; Sun, 24 Jun 2012 22:22:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5OMMigF034614; Sun, 24 Jun 2012 22:22:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201206242222.q5OMMigF034614@svn.freebsd.org> From: Michael Tuexen Date: Sun, 24 Jun 2012 22:22: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: r237541 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 22:22:45 -0000 Author: tuexen Date: Sun Jun 24 22:22:44 2012 New Revision: 237541 URL: http://svn.freebsd.org/changeset/base/237541 Log: Remove redundant check. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Jun 24 21:25:54 2012 (r237540) +++ head/sys/netinet/sctp_input.c Sun Jun 24 22:22:44 2012 (r237541) @@ -2392,7 +2392,7 @@ sctp_handle_cookie_echo(struct mbuf *m, uint8_t calc_sig[SCTP_SIGNATURE_SIZE], tmp_sig[SCTP_SIGNATURE_SIZE]; uint8_t *sig; uint8_t cookie_ok = 0; - unsigned int size_of_pkt, sig_offset, cookie_offset; + unsigned int sig_offset, cookie_offset; unsigned int cookie_len; struct timeval now; struct timeval time_expires; @@ -2434,7 +2434,6 @@ sctp_handle_cookie_echo(struct mbuf *m, lsin->sin_len = sizeof(*lsin); lsin->sin_port = sh->dest_port; lsin->sin_addr.s_addr = iph->ip_dst.s_addr; - size_of_pkt = SCTP_GET_IPV4_LENGTH(iph); break; } #endif @@ -2452,7 +2451,6 @@ sctp_handle_cookie_echo(struct mbuf *m, ip6 = mtod(m, struct ip6_hdr *); lsin6->sin6_port = sh->dest_port; lsin6->sin6_addr = ip6->ip6_dst; - size_of_pkt = SCTP_GET_IPV6_LENGTH(ip6) + iphlen; break; } #endif @@ -2476,11 +2474,10 @@ sctp_handle_cookie_echo(struct mbuf *m, */ return (NULL); } - if (cookie_len > size_of_pkt || - cookie_len < sizeof(struct sctp_cookie_echo_chunk) + + if (cookie_len < sizeof(struct sctp_cookie_echo_chunk) + sizeof(struct sctp_init_chunk) + sizeof(struct sctp_init_ack_chunk) + SCTP_SIGNATURE_SIZE) { - /* cookie too long! or too small */ + /* cookie too small */ return (NULL); } /* @@ -2488,11 +2485,6 @@ sctp_handle_cookie_echo(struct mbuf *m, * calculated in the sctp_hmac_m() call). */ sig_offset = offset + cookie_len - SCTP_SIGNATURE_SIZE; - if (sig_offset > size_of_pkt) { - /* packet not correct size! */ - /* XXX this may already be accounted for earlier... */ - return (NULL); - } m_sig = m_split(m, sig_offset, M_DONTWAIT); if (m_sig == NULL) { /* out of memory or ?? */ From owner-svn-src-all@FreeBSD.ORG Sun Jun 24 23:12:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 071A9106567A; Sun, 24 Jun 2012 23:12:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E513D8FC08; Sun, 24 Jun 2012 23:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5ONCOdB036709; Sun, 24 Jun 2012 23:12:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5ONCOoO036703; Sun, 24 Jun 2012 23:12:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201206242312.q5ONCOoO036703@svn.freebsd.org> From: Michael Tuexen Date: Sun, 24 Jun 2012 23:12: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: r237542 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 23:12:25 -0000 Author: tuexen Date: Sun Jun 24 23:12:24 2012 New Revision: 237542 URL: http://svn.freebsd.org/changeset/base/237542 Log: Pass the packet length explicitly around. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Jun 24 22:22:44 2012 (r237541) +++ head/sys/netinet/sctp_indata.c Sun Jun 24 23:12:24 2012 (r237542) @@ -2762,7 +2762,7 @@ sctp_process_data(struct mbuf **mm, int /* * we need to report rwnd overrun drops. */ - sctp_send_packet_dropped(stcb, net, *mm, iphlen, 0); + sctp_send_packet_dropped(stcb, net, *mm, length, iphlen, 0); } if (num_chunks) { /* Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Jun 24 22:22:44 2012 (r237541) +++ head/sys/netinet/sctp_input.c Sun Jun 24 23:12:24 2012 (r237542) @@ -6013,7 +6013,7 @@ sctp_input_with_port(struct mbuf *i_pak, #endif } if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, mlen + iphlen, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jun 24 22:22:44 2012 (r237541) +++ head/sys/netinet/sctp_output.c Sun Jun 24 23:12:24 2012 (r237542) @@ -11312,21 +11312,15 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb void sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, - struct mbuf *m, int iphlen, int bad_crc) + struct mbuf *m, int len, int iphlen, int bad_crc) { struct sctp_association *asoc; struct sctp_pktdrop_chunk *drp; struct sctp_tmit_chunk *chk; uint8_t *datap; - int len; int was_trunc = 0; struct ip *iph; - -#ifdef INET6 - struct ip6_hdr *ip6h; - -#endif - int fullsz = 0, extra = 0; + int fullsz = 0; long spc; int offset; struct sctp_chunkhdr *ch, chunk_buf; @@ -11356,23 +11350,8 @@ sctp_send_packet_dropped(struct sctp_tcb sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - /* IPv4 */ - len = chk->send_size = iph->ip_len; - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - /* IPv6 */ - ip6h = mtod(m, struct ip6_hdr *); - len = chk->send_size = htons(ip6h->ip6_plen); - break; -#endif - default: - return; - } + len -= iphlen; + chk->send_size = len; /* Validate that we do not have an ABORT in here. */ offset = iphlen + sizeof(struct sctphdr); ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, @@ -11408,7 +11387,7 @@ sctp_send_packet_dropped(struct sctp_tcb /* * only send 1 mtu worth, trim off the excess on the end. */ - fullsz = len - extra; + fullsz = len; len = min(stcb->asoc.smallest_mtu, MCLBYTES) - SCTP_MAX_OVERHEAD; was_trunc = 1; } Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sun Jun 24 22:22:44 2012 (r237541) +++ head/sys/netinet/sctp_output.h Sun Jun 24 23:12:24 2012 (r237542) @@ -162,7 +162,7 @@ void sctp_send_ecn_echo(struct sctp_tcb void sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *, - int, int); + int, int, int); Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun Jun 24 22:22:44 2012 (r237541) +++ head/sys/netinet6/sctp6_usrreq.c Sun Jun 24 23:12:24 2012 (r237542) @@ -183,7 +183,7 @@ sctp6_input(struct mbuf **i_pak, int *of } /* in6p's ref-count increased && stcb locked */ if ((in6p) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, pkt_len, iphlen, 1); sctp_chunk_output((struct sctp_inpcb *)in6p, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((in6p != NULL) && (stcb == NULL)) { refcount_up = 1; From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 01:48:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39D6B1065673; Mon, 25 Jun 2012 01:48:19 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B15C8FC17; Mon, 25 Jun 2012 01:48:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P1mI22043071; Mon, 25 Jun 2012 01:48:18 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P1mIr8043069; Mon, 25 Jun 2012 01:48:18 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201206250148.q5P1mIr8043069@svn.freebsd.org> From: Rick Macklem Date: Mon, 25 Jun 2012 01:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237543 - stable/9/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 01:48:19 -0000 Author: rmacklem Date: Mon Jun 25 01:48:18 2012 New Revision: 237543 URL: http://svn.freebsd.org/changeset/base/237543 Log: MFC: r237244 Fix the NFSv4 client for the case where mmap'd files are written, but not msync'd by a process. A VOP_PUTPAGES() called when VOP_RECLAIM() happens will usually fail, since the NFSv4 Open has already been closed by VOP_INACTIVE(). Add a vm_object_page_clean() call to the NFSv4 client's VOP_INACTIVE(), so that the write happens before the NFSv4 Open is closed. kib@ suggested using vgone() instead and I will explore this, but this patch fixes things in the meantime. For some reason, the VOP_PUTPAGES() is still attaempted in VOP_RECLAIM(), but having this fail doesn't cause any problems except a "stateid0 in write" being logged. Modified: stable/9/sys/fs/nfsclient/nfs_clnode.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clnode.c Sun Jun 24 23:12:24 2012 (r237542) +++ stable/9/sys/fs/nfsclient/nfs_clnode.c Mon Jun 25 01:48:18 2012 (r237543) @@ -210,18 +210,28 @@ ncl_inactive(struct vop_inactive_args *a struct nfsnode *np; struct sillyrename *sp; struct vnode *vp = ap->a_vp; + boolean_t retv; np = VTONFS(vp); if (NFS_ISV4(vp) && vp->v_type == VREG) { /* * Since mmap()'d files do I/O after VOP_CLOSE(), the NFSv4 - * Close operations are delayed until now. Any dirty buffers - * must be flushed before the close, so that the stateid is - * available for the writes. + * Close operations are delayed until now. Any dirty + * buffers/pages must be flushed before the close, so that the + * stateid is available for the writes. */ - (void) ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1, 0); - (void) nfsrpc_close(vp, 1, ap->a_td); + if (vp->v_object != NULL) { + VM_OBJECT_LOCK(vp->v_object); + retv = vm_object_page_clean(vp->v_object, 0, 0, + OBJPC_SYNC); + VM_OBJECT_UNLOCK(vp->v_object); + } else + retv = TRUE; + if (retv == TRUE) { + (void)ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1, 0); + (void)nfsrpc_close(vp, 1, ap->a_td); + } } mtx_lock(&np->n_mtx); From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 03:06:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DAB9F106566C; Mon, 25 Jun 2012 03:06:30 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AA1A8FC08; Mon, 25 Jun 2012 03:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P36ULx046377; Mon, 25 Jun 2012 03:06:30 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P36Umu046375; Mon, 25 Jun 2012 03:06:30 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201206250306.q5P36Umu046375@svn.freebsd.org> From: Matt Jacob Date: Mon, 25 Jun 2012 03:06: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: r237544 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 03:06:31 -0000 Author: mjacob Date: Mon Jun 25 03:06:29 2012 New Revision: 237544 URL: http://svn.freebsd.org/changeset/base/237544 Log: Unbreak register tests for parallel SCSI. You can't overwrite registers 7 and 8. MFC after: 3 days Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Mon Jun 25 01:48:18 2012 (r237543) +++ head/sys/dev/isp/isp.c Mon Jun 25 03:06:29 2012 (r237544) @@ -710,8 +710,11 @@ isp_reset(ispsoftc_t *isp, int do_load_d 0x6666, 0x6677, 0x1122, 0x33ff, 0x0000, 0x0001, 0x1000, 0x1010, }; + int nmbox = ISP_NMBOX(isp); + if (IS_SCSI(isp)) + nmbox = 6; MBSINIT(&mbs, MBOX_MAILBOX_REG_TEST, MBLOGALL, 0); - for (i = 1; i < ISP_NMBOX(isp); i++) { + for (i = 1; i < nmbox; i++) { mbs.param[i] = patterns[i]; } isp_mboxcmd(isp, &mbs); @@ -719,7 +722,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_RESET0(isp); return; } - for (i = 1; i < ISP_NMBOX(isp); i++) { + for (i = 1; i < nmbox; i++) { if (mbs.param[i] != patterns[i]) { ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "Register Test Failed at Register %d: should have 0x%04x but got 0x%04x", i, patterns[i], mbs.param[i]); From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 03:48:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F29541065674; Mon, 25 Jun 2012 03:48:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mail.kirov.so-ups.ru (ns.kirov.so-ups.ru [178.74.170.1]) by mx1.freebsd.org (Postfix) with ESMTP id 636D58FC08; Mon, 25 Jun 2012 03:48:11 +0000 (UTC) Received: from kas30pipe.localhost (localhost.kirov.so-ups.ru [127.0.0.1]) by mail.kirov.so-ups.ru (Postfix) with SMTP id F1E2FB8027; Mon, 25 Jun 2012 07:48:01 +0400 (MSK) Received: from kirov.so-ups.ru (unknown [172.21.81.1]) by mail.kirov.so-ups.ru (Postfix) with ESMTP id EC3D8B8024; Mon, 25 Jun 2012 07:48:01 +0400 (MSK) Received: by ns.kirov.so-ups.ru (Postfix, from userid 1010) id E48BFBA054; Mon, 25 Jun 2012 07:48:01 +0400 (MSK) Received: from [127.0.0.1] (unknown [10.118.3.52]) by ns.kirov.so-ups.ru (Postfix) with ESMTP id AD068BA043; Mon, 25 Jun 2012 07:48:01 +0400 (MSK) Message-ID: <4FE7DF6F.6020007@FreeBSD.org> Date: Mon, 25 Jun 2012 07:47:59 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: "Kenneth D. Merry" References: <201206240429.q5O4T3D7087012@svn.freebsd.org> In-Reply-To: <201206240429.q5O4T3D7087012@svn.freebsd.org> X-Enigmail-Version: 1.4.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig47FE5512055CB5C1C8DF0872" X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release X-SpamTest-Info: Not protected Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237518 - in head: share/man/man9 sys/cam/scsi sys/dev/xen/blkfront sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 03:48:12 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig47FE5512055CB5C1C8DF0872 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 24.06.2012 8:29, Kenneth D. Merry wrote: > Author: ken > Date: Sun Jun 24 04:29:03 2012 > New Revision: 237518 > URL: http://svn.freebsd.org/changeset/base/237518 >=20 > Log: > Fix a bug which causes a panic in daopen(). The panic is caused by > a da(4) instance going away while GEOM is still probing it. > =20 > In this case, the GEOM disk class instance has been created by > disk_create(), and the taste of the disk is queued in the GEOM > event queue. > =20 > While that event is queued, the da(4) instance goes away. When the > open call comes into the da(4) driver, it dereferences the freed > (but non-NULL) peripheral pointer provided by GEOM, which results > in a panic. > =20 > The solution is to add a callback to the GEOM disk code that is > called when all of its resources are cleaned up. This is > implemented inside GEOM by adding an optional callback that is > called when all consumers have detached from a provider, and the > provider is about to be deleted. > =20 > geom.h: Add a new, optional, providergone callback that > is called when a provider is about to be deleted. > =20 > MFC after: 5 days This will break ABI. If you want to merge this change, it is better to use one of spare field in the geom structures. > @@ -102,6 +103,7 @@ struct g_class { > g_start_t *start; > g_spoiled_t *spoiled; > g_attrchanged_t *attrchanged; > + g_provgone_t *providergone; > g_dumpconf_t *dumpconf; > g_access_t *access; > g_orphan_t *orphan; > @@ -133,6 +135,7 @@ struct g_geom { > g_start_t *start; > g_spoiled_t *spoiled; > g_attrchanged_t *attrchanged; > + g_provgone_t *providergone; > g_dumpconf_t *dumpconf; > g_access_t *access; > g_orphan_t *orphan; --=20 WBR, Andrey V. Elsukov --------------enig47FE5512055CB5C1C8DF0872 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJP599zAAoJEAHF6gQQyKF6SR4H/27Fly46TutKiwWR5aa0MwtI Pit/4fppncPdkWlXnPubNkUfczwCDIKA5XRQQlgSEVVHeSJoSI5LSVMwGShNDQPE 9j6k8xyoI+D2v9lCqHKjgDm8xc3Ju3tw7vjkSZVjaiZ0rrpMUlnh/iwDZWgYIyu3 UUGl/T9VtBV49VeLR3GAk8F/mnr/SQ6pBCCIWeZ8148t9DyZI3AOewSv4kqjXy9/ +8sZcoFo+vKGEpFfU3VkdpiAmL9HTQBN20zWAVX6p/QqPOWsiwo8VhNrPZ70Qk5G 2DnRw8UgS+a498Ur8WFRMjob6XEN2y45yNkg7CisxS1VcZ5Pejq9isHnW9bk848= =5UXk -----END PGP SIGNATURE----- --------------enig47FE5512055CB5C1C8DF0872-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 04:26:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5431A106566B; Mon, 25 Jun 2012 04:26:11 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F5678FC19; Mon, 25 Jun 2012 04:26:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P4QBTA049885; Mon, 25 Jun 2012 04:26:11 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P4QBSA049883; Mon, 25 Jun 2012 04:26:11 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206250426.q5P4QBSA049883@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 25 Jun 2012 04:26: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: r237545 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 04:26:11 -0000 Author: ken Date: Mon Jun 25 04:26:10 2012 New Revision: 237545 URL: http://svn.freebsd.org/changeset/base/237545 Log: Consume spare fields for the providergone pointers added to the g_class and g_geom structures in change 237518. The original change would have broken the ABI. Suggested by: ae MFC after: 4 days Modified: head/sys/geom/geom.h Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Mon Jun 25 03:06:29 2012 (r237544) +++ head/sys/geom/geom.h Mon Jun 25 04:26:10 2012 (r237545) @@ -103,12 +103,11 @@ struct g_class { g_start_t *start; g_spoiled_t *spoiled; g_attrchanged_t *attrchanged; - g_provgone_t *providergone; g_dumpconf_t *dumpconf; g_access_t *access; g_orphan_t *orphan; g_ioctl_t *ioctl; - void *spare1; + g_provgone_t *providergone; void *spare2; /* * The remaining elements are private @@ -135,12 +134,11 @@ struct g_geom { g_start_t *start; g_spoiled_t *spoiled; g_attrchanged_t *attrchanged; - g_provgone_t *providergone; g_dumpconf_t *dumpconf; g_access_t *access; g_orphan_t *orphan; g_ioctl_t *ioctl; - void *spare0; + g_provgone_t *providergone; void *spare1; void *softc; unsigned flags; From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 04:26:35 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C47F11065680; Mon, 25 Jun 2012 04:26:35 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 6E93F8FC15; Mon, 25 Jun 2012 04:26:35 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q5P4QYN6055657; Sun, 24 Jun 2012 22:26:34 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q5P4QY1k055656; Sun, 24 Jun 2012 22:26:34 -0600 (MDT) (envelope-from ken) Date: Sun, 24 Jun 2012 22:26:34 -0600 From: "Kenneth D. Merry" To: "Andrey V. Elsukov" Message-ID: <20120625042634.GA55640@nargothrond.kdm.org> References: <201206240429.q5O4T3D7087012@svn.freebsd.org> <4FE7DF6F.6020007@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FE7DF6F.6020007@FreeBSD.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237518 - in head: share/man/man9 sys/cam/scsi sys/dev/xen/blkfront sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 04:26:35 -0000 On Mon, Jun 25, 2012 at 07:47:59 +0400, Andrey V. Elsukov wrote: > On 24.06.2012 8:29, Kenneth D. Merry wrote: > > Author: ken > > Date: Sun Jun 24 04:29:03 2012 > > New Revision: 237518 > > URL: http://svn.freebsd.org/changeset/base/237518 > > > > Log: > > Fix a bug which causes a panic in daopen(). The panic is caused by > > a da(4) instance going away while GEOM is still probing it. > > > > In this case, the GEOM disk class instance has been created by > > disk_create(), and the taste of the disk is queued in the GEOM > > event queue. > > > > While that event is queued, the da(4) instance goes away. When the > > open call comes into the da(4) driver, it dereferences the freed > > (but non-NULL) peripheral pointer provided by GEOM, which results > > in a panic. > > > > The solution is to add a callback to the GEOM disk code that is > > called when all of its resources are cleaned up. This is > > implemented inside GEOM by adding an optional callback that is > > called when all consumers have detached from a provider, and the > > provider is about to be deleted. > > > > > geom.h: Add a new, optional, providergone callback that > > is called when a provider is about to be deleted. > > > > MFC after: 5 days > > This will break ABI. If you want to merge this change, > it is better to use one of spare field in the geom structures. Done, thanks! Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 05:41:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03663106564A; Mon, 25 Jun 2012 05:41:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E04A88FC08; Mon, 25 Jun 2012 05:41:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P5fGBq052892; Mon, 25 Jun 2012 05:41:16 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P5fGIv052885; Mon, 25 Jun 2012 05:41:16 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201206250541.q5P5fGIv052885@svn.freebsd.org> From: Kevin Lo Date: Mon, 25 Jun 2012 05:41: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: r237546 - in head: sys/dev/mfi sys/dev/mps sys/dev/mpt sys/kern tools/tools/net80211/w00t/redir tools/tools/net80211/wesside/dics X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 05:41:17 -0000 Author: kevlo Date: Mon Jun 25 05:41:16 2012 New Revision: 237546 URL: http://svn.freebsd.org/changeset/base/237546 Log: Correct sizeof usage Obtained from: DragonFly Modified: head/sys/dev/mfi/mfi_tbolt.c head/sys/dev/mps/mps_sas.c head/sys/dev/mpt/mpt_cam.c head/sys/kern/subr_firmware.c head/tools/tools/net80211/w00t/redir/buddy.c head/tools/tools/net80211/wesside/dics/dics.c Modified: head/sys/dev/mfi/mfi_tbolt.c ============================================================================== --- head/sys/dev/mfi/mfi_tbolt.c Mon Jun 25 04:26:10 2012 (r237545) +++ head/sys/dev/mfi/mfi_tbolt.c Mon Jun 25 05:41:16 2012 (r237546) @@ -1078,7 +1078,7 @@ mfi_tbolt_build_mpt_cmd(struct mfi_softc if (!req_desc) return NULL; - bzero(req_desc, sizeof(req_desc)); + bzero(req_desc, sizeof(*req_desc)); req_desc->header.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MFI_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); req_desc->header.SMID = index; Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Mon Jun 25 04:26:10 2012 (r237545) +++ head/sys/dev/mps/mps_sas.c Mon Jun 25 05:41:16 2012 (r237546) @@ -2214,7 +2214,7 @@ mpssas_scsiio_complete(struct mps_softc sense_len = min(returned_sense_len, ccb->csio.sense_len - ccb->csio.sense_resid); bzero(&ccb->csio.sense_data, - sizeof(&ccb->csio.sense_data)); + sizeof(ccb->csio.sense_data)); bcopy(cm->cm_sense, &ccb->csio.sense_data, sense_len); ccb->ccb_h.status |= CAM_AUTOSNS_VALID; } Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Mon Jun 25 04:26:10 2012 (r237545) +++ head/sys/dev/mpt/mpt_cam.c Mon Jun 25 05:41:16 2012 (r237546) @@ -3187,7 +3187,7 @@ mpt_scsi_reply_frame_handler(struct mpt_ else ccb->csio.sense_resid = 0; - bzero(&ccb->csio.sense_data, sizeof(&ccb->csio.sense_data)); + bzero(&ccb->csio.sense_data, sizeof(ccb->csio.sense_data)); bcopy(req->sense_vbuf, &ccb->csio.sense_data, min(ccb->csio.sense_len, sense_returned)); } Modified: head/sys/kern/subr_firmware.c ============================================================================== --- head/sys/kern/subr_firmware.c Mon Jun 25 04:26:10 2012 (r237545) +++ head/sys/kern/subr_firmware.c Mon Jun 25 05:41:16 2012 (r237546) @@ -198,7 +198,7 @@ firmware_register(const char *imagename, free(str, M_TEMP); return NULL; } - bzero(frp, sizeof(frp)); /* start from a clean record */ + bzero(frp, sizeof(*frp)); /* start from a clean record */ frp->fw.name = str; frp->fw.data = data; frp->fw.datasize = datasize; Modified: head/tools/tools/net80211/w00t/redir/buddy.c ============================================================================== --- head/tools/tools/net80211/w00t/redir/buddy.c Mon Jun 25 04:26:10 2012 (r237545) +++ head/tools/tools/net80211/w00t/redir/buddy.c Mon Jun 25 05:41:16 2012 (r237546) @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) int len; int raw; - memset(&s_in, 0, sizeof(&s_in)); + memset(&s_in, 0, sizeof(s_in)); s_in.sin_family = PF_INET; s_in.sin_port = htons(666); s_in.sin_addr.s_addr = INADDR_ANY; Modified: head/tools/tools/net80211/wesside/dics/dics.c ============================================================================== --- head/tools/tools/net80211/wesside/dics/dics.c Mon Jun 25 04:26:10 2012 (r237545) +++ head/tools/tools/net80211/wesside/dics/dics.c Mon Jun 25 05:41:16 2012 (r237546) @@ -332,7 +332,7 @@ int main(int argc, char *argv[]) { sip = argv[1]; - memset(&s_in, 0, sizeof(&s_in)); + memset(&s_in, 0, sizeof(s_in)); us = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP); if (s == -1) { perror("socket()"); From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 05:47:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA7141065673; Mon, 25 Jun 2012 05:47:13 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 376328FC16; Mon, 25 Jun 2012 05:47:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P5lDNu053178; Mon, 25 Jun 2012 05:47:13 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P5lCN6053176; Mon, 25 Jun 2012 05:47:13 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201206250547.q5P5lCN6053176@svn.freebsd.org> From: Kevin Lo Date: Mon, 25 Jun 2012 05:47: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: r237547 - head/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 05:47:14 -0000 Author: kevlo Date: Mon Jun 25 05:47:12 2012 New Revision: 237547 URL: http://svn.freebsd.org/changeset/base/237547 Log: Fix size of the bcopy when extracting ethernet address Obtained from: DragonFly Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Jun 25 05:41:16 2012 (r237546) +++ head/sys/dev/re/if_re.c Mon Jun 25 05:47:12 2012 (r237547) @@ -1527,7 +1527,7 @@ re_attach(device_t dev) re_read_eeprom(sc, (caddr_t)as, RL_EE_EADDR, 3); for (i = 0; i < ETHER_ADDR_LEN / 2; i++) as[i] = le16toh(as[i]); - bcopy(as, eaddr, sizeof(eaddr)); + bcopy(as, eaddr, ETHER_ADDR_LEN); } if (sc->rl_type == RL_8169) { From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 07:06:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB5AE1065675; Mon, 25 Jun 2012 07:06:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D71D08FC0A; Mon, 25 Jun 2012 07:06:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P76wVX056608; Mon, 25 Jun 2012 07:06:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P76w57056606; Mon, 25 Jun 2012 07:06:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206250706.q5P76w57056606@svn.freebsd.org> From: Alexander Motin Date: Mon, 25 Jun 2012 07:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237548 - stable/9/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 07:06:59 -0000 Author: mav Date: Mon Jun 25 07:06:58 2012 New Revision: 237548 URL: http://svn.freebsd.org/changeset/base/237548 Log: MFC r237446: Don't print SCSI Queue Full and CAM_REQUEUE_REQ statuses as errors if they were handled and retried. They are part of normal operation for SCSI TCQ. Modified: stable/9/sys/cam/cam_periph.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Mon Jun 25 05:47:12 2012 (r237547) +++ stable/9/sys/cam/cam_periph.c Mon Jun 25 07:06:58 2012 (r237548) @@ -1325,6 +1325,7 @@ camperiphscsistatuserror(union ccb *ccb, } *timeout = 0; error = ERESTART; + *print = 0; break; } /* FALLTHROUGH */ @@ -1654,8 +1655,10 @@ cam_periph_error(union ccb *ccb, cam_fla } else if (sense_flags & SF_NO_RETRY) { error = EIO; action_string = "Retry was blocked"; - } else + } else { error = ERESTART; + print = 0; + } break; case CAM_RESRC_UNAVAIL: /* Wait a bit for the resource shortage to abate. */ From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 07:09:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5F65E1065673; Mon, 25 Jun 2012 07:09:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A8D88FC08; Mon, 25 Jun 2012 07:09:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P79bq5056758; Mon, 25 Jun 2012 07:09:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P79bVW056756; Mon, 25 Jun 2012 07:09:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206250709.q5P79bVW056756@svn.freebsd.org> From: Alexander Motin Date: Mon, 25 Jun 2012 07:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237549 - stable/9/sys/dev/twa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 07:09:37 -0000 Author: mav Date: Mon Jun 25 07:09:36 2012 New Revision: 237549 URL: http://svn.freebsd.org/changeset/base/237549 Log: MFC r237460: Return CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE instead of CAM_TID_INVALID and CAM_LUN_INVALID for case of missing devices. In removes tons of error messages from CAM during bus scans. Reported and tested by: Mike Tancsa Modified: stable/9/sys/dev/twa/tw_osl_cam.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/twa/tw_osl_cam.c ============================================================================== --- stable/9/sys/dev/twa/tw_osl_cam.c Mon Jun 25 07:06:58 2012 (r237548) +++ stable/9/sys/dev/twa/tw_osl_cam.c Mon Jun 25 07:09:36 2012 (r237549) @@ -678,9 +678,9 @@ tw_osl_complete_io(struct tw_cl_req_hand ccb->ccb_h.status = CAM_REQ_CMP; else { if (req_pkt->status & TW_CL_ERR_REQ_INVALID_TARGET) - ccb->ccb_h.status |= CAM_TID_INVALID; + ccb->ccb_h.status |= CAM_SEL_TIMEOUT; else if (req_pkt->status & TW_CL_ERR_REQ_INVALID_LUN) - ccb->ccb_h.status |= CAM_LUN_INVALID; + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; else if (req_pkt->status & TW_CL_ERR_REQ_SCSI_ERROR) ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; else if (req_pkt->status & TW_CL_ERR_REQ_BUS_RESET) From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 07:11:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46789106564A; Mon, 25 Jun 2012 07:11:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30F818FC1E; Mon, 25 Jun 2012 07:11:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P7B4GA056890; Mon, 25 Jun 2012 07:11:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P7B3X2056888; Mon, 25 Jun 2012 07:11:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206250711.q5P7B3X2056888@svn.freebsd.org> From: Alexander Motin Date: Mon, 25 Jun 2012 07:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237550 - stable/8/sys/dev/twa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 07:11:04 -0000 Author: mav Date: Mon Jun 25 07:11:03 2012 New Revision: 237550 URL: http://svn.freebsd.org/changeset/base/237550 Log: MFC r237460: Return CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE instead of CAM_TID_INVALID and CAM_LUN_INVALID for case of missing devices. In removes tons of error messages from CAM during bus scans. Reported and tested by: Mike Tancsa Modified: stable/8/sys/dev/twa/tw_osl_cam.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/twa/tw_osl_cam.c ============================================================================== --- stable/8/sys/dev/twa/tw_osl_cam.c Mon Jun 25 07:09:36 2012 (r237549) +++ stable/8/sys/dev/twa/tw_osl_cam.c Mon Jun 25 07:11:03 2012 (r237550) @@ -678,9 +678,9 @@ tw_osl_complete_io(struct tw_cl_req_hand ccb->ccb_h.status = CAM_REQ_CMP; else { if (req_pkt->status & TW_CL_ERR_REQ_INVALID_TARGET) - ccb->ccb_h.status |= CAM_TID_INVALID; + ccb->ccb_h.status |= CAM_SEL_TIMEOUT; else if (req_pkt->status & TW_CL_ERR_REQ_INVALID_LUN) - ccb->ccb_h.status |= CAM_LUN_INVALID; + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; else if (req_pkt->status & TW_CL_ERR_REQ_SCSI_ERROR) ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; else if (req_pkt->status & TW_CL_ERR_REQ_BUS_RESET) From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 07:13:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C1D4106566B; Mon, 25 Jun 2012 07:13:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 867EF8FC0A; Mon, 25 Jun 2012 07:13:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P7DPNV057020; Mon, 25 Jun 2012 07:13:25 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P7DP5V057017; Mon, 25 Jun 2012 07:13:25 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201206250713.q5P7DP5V057017@svn.freebsd.org> From: Alan Cox Date: Mon, 25 Jun 2012 07:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237551 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 07:13:25 -0000 Author: alc Date: Mon Jun 25 07:13:25 2012 New Revision: 237551 URL: http://svn.freebsd.org/changeset/base/237551 Log: Add PV chunk and list locking to pmap_change_wiring(), pmap_protect(), and pmap_remove(). The execution of these functions is no longer serialized by the pvh global lock. Make some stylistic changes to the affected code for the sake of consistency with related code elsewhere in the pmap. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Jun 25 07:11:03 2012 (r237550) +++ head/sys/amd64/amd64/pmap.c Mon Jun 25 07:13:25 2012 (r237551) @@ -257,8 +257,11 @@ static void free_pv_chunk(struct pv_chun static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, boolean_t try); static int popcnt_pc_map_elem(uint64_t elem); -static void reserve_pv_entry(pmap_t pmap, int needed); -static void pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); +static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); +static void reserve_pv_entries(pmap_t pmap, int needed, + struct rwlock **lockp); +static void pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp); static boolean_t pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, struct rwlock **lockp); static void pmap_pv_promote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); @@ -269,6 +272,8 @@ static int pmap_pvh_wired_mappings(struc static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode); static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); +static boolean_t pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, + vm_offset_t va, struct rwlock **lockp); static boolean_t pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va); static boolean_t pmap_enter_pde(pmap_t pmap, vm_offset_t va, vm_page_t m, @@ -287,9 +292,10 @@ static boolean_t pmap_protect_pde(pmap_t vm_prot_t prot); static void pmap_pte_attr(pt_entry_t *pte, int cache_bits); static int pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, - vm_page_t *free); + vm_page_t *free, struct rwlock **lockp); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, - vm_offset_t sva, pd_entry_t ptepde, vm_page_t *free); + vm_offset_t sva, pd_entry_t ptepde, vm_page_t *free, + struct rwlock **lockp); static void pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte); static void pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, vm_page_t *free); @@ -2094,9 +2100,9 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_ * exacerbating the shortage of free pv entries. */ static vm_page_t -pmap_pv_reclaim(pmap_t locked_pmap) +reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp) { - struct pch newtail; + struct pch new_tail; struct pv_chunk *pc; struct md_page *pvh; pd_entry_t *pde; @@ -2108,13 +2114,15 @@ pmap_pv_reclaim(pmap_t locked_pmap) uint64_t inuse; int bit, field, freed; - rw_assert(&pvh_global_lock, RA_WLOCKED); + rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); pmap = NULL; free = m_pc = NULL; - TAILQ_INIT(&newtail); + TAILQ_INIT(&new_tail); + mtx_lock(&pv_chunks_mutex); while ((pc = TAILQ_FIRST(&pv_chunks)) != NULL && free == NULL) { TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + mtx_unlock(&pv_chunks_mutex); if (pmap != pc->pc_pmap) { if (pmap != NULL) { pmap_invalidate_all(pmap); @@ -2123,11 +2131,17 @@ pmap_pv_reclaim(pmap_t locked_pmap) } pmap = pc->pc_pmap; /* Avoid deadlock and lock recursion. */ - if (pmap > locked_pmap) + if (pmap > locked_pmap) { + if (*lockp != NULL) { + rw_wunlock(*lockp); + *lockp = NULL; + } PMAP_LOCK(pmap); - else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) { + } else if (pmap != locked_pmap && + !PMAP_TRYLOCK(pmap)) { pmap = NULL; - TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); + TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); + mtx_lock(&pv_chunks_mutex); continue; } } @@ -2156,6 +2170,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) vm_page_dirty(m); if ((tpte & PG_A) != 0) vm_page_aflag_set(m, PGA_REFERENCED); + CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m); TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); if (TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { @@ -2171,32 +2186,36 @@ pmap_pv_reclaim(pmap_t locked_pmap) } } if (freed == 0) { - TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); + TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); + mtx_lock(&pv_chunks_mutex); continue; } /* Every freed mapping is for a 4 KB page. */ pmap_resident_count_dec(pmap, freed); - PV_STAT(pv_entry_frees += freed); - PV_STAT(pv_entry_spare += freed); + PV_STAT(atomic_add_long(&pv_entry_frees, freed)); + PV_STAT(atomic_add_int(&pv_entry_spare, freed)); PV_STAT(atomic_subtract_long(&pv_entry_count, freed)); TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); if (pc->pc_map[0] == PC_FREE0 && pc->pc_map[1] == PC_FREE1 && pc->pc_map[2] == PC_FREE2) { - PV_STAT(pv_entry_spare -= _NPCPV); - PV_STAT(pc_chunk_count--); - PV_STAT(pc_chunk_frees++); + PV_STAT(atomic_subtract_int(&pv_entry_spare, _NPCPV)); + PV_STAT(atomic_subtract_int(&pc_chunk_count, 1)); + PV_STAT(atomic_add_int(&pc_chunk_frees, 1)); /* Entire chunk is free; return it. */ m_pc = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m_pc->phys_addr); + mtx_lock(&pv_chunks_mutex); break; } TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); - TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); + TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); + mtx_lock(&pv_chunks_mutex); /* One freed pv entry in locked_pmap is sufficient. */ if (pmap == locked_pmap) break; } - TAILQ_CONCAT(&pv_chunks, &newtail, pc_lru); + TAILQ_CONCAT(&pv_chunks, &new_tail, pc_lru); + mtx_unlock(&pv_chunks_mutex); if (pmap != NULL) { pmap_invalidate_all(pmap); if (pmap != locked_pmap) @@ -2273,6 +2292,7 @@ get_pv_entry(pmap_t pmap, boolean_t try) int bit, field; pv_entry_t pv; struct pv_chunk *pc; + struct rwlock *lock; vm_page_t m; rw_assert(&pvh_global_lock, RA_LOCKED); @@ -2310,7 +2330,10 @@ retry: PV_STAT(pc_chunk_tryfail++); return (NULL); } - m = pmap_pv_reclaim(pmap); + lock = NULL; + m = reclaim_pv_chunk(pmap, &lock); + if (lock != NULL) + rw_wunlock(lock); if (m == NULL) goto retry; } @@ -2355,7 +2378,7 @@ popcnt_pc_map_elem(uint64_t elem) * exceeds the given count, "needed". */ static void -reserve_pv_entry(pmap_t pmap, int needed) +reserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp) { struct pch new_tail; struct pv_chunk *pc; @@ -2368,8 +2391,8 @@ reserve_pv_entry(pmap_t pmap, int needed /* * Newly allocated PV chunks must be stored in a private list until * the required number of PV chunks have been allocated. Otherwise, - * pmap_pv_reclaim() could recycle one of these chunks. In contrast, - * these chunks must be added to the pmap upon allocation. + * reclaim_pv_chunk() could recycle one of these chunks. In + * contrast, these chunks must be added to the pmap upon allocation. */ TAILQ_INIT(&new_tail); retry: @@ -2388,7 +2411,7 @@ retry: m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (m == NULL) { - m = pmap_pv_reclaim(pmap); + m = reclaim_pv_chunk(pmap, lockp); if (m == NULL) goto retry; } @@ -2422,7 +2445,7 @@ pmap_pvh_remove(struct md_page *pvh, pma { pv_entry_t pv; - rw_assert(&pvh_global_lock, RA_WLOCKED); + rw_assert(&pvh_global_lock, RA_LOCKED); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); @@ -2438,17 +2461,19 @@ pmap_pvh_remove(struct md_page *pvh, pma * entries for each of the 4KB page mappings. */ static void -pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa) +pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp) { struct md_page *pvh; pv_entry_t pv; vm_offset_t va_last; vm_page_t m; - rw_assert(&pvh_global_lock, RA_WLOCKED); + rw_assert(&pvh_global_lock, RA_LOCKED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_demote_pde: pa is not 2mpage aligned")); - reserve_pv_entry(pmap, NPTEPG - 1); + reserve_pv_entries(pmap, NPTEPG - 1, lockp); + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); /* * Transfer the 2mpage's pv entry for this mapping to the first @@ -2491,11 +2516,11 @@ pmap_pv_promote_pde(pmap_t pmap, vm_offs ("pmap_pv_promote_pde: pa is not 2mpage aligned")); /* - * Transfer the first page's pv entry for this mapping to the - * 2mpage's pv list. Aside from avoiding the cost of a call - * to get_pv_entry(), a transfer avoids the possibility that - * get_pv_entry() calls pmap_pv_reclaim() and that pmap_pv_reclaim() - * removes one of the mappings that is being promoted. + * Transfer the first page's pv entry for this mapping to the 2mpage's + * pv list. Aside from avoiding the cost of a call to get_pv_entry(), + * a transfer avoids the possibility that get_pv_entry() calls + * reclaim_pv_chunk() and that reclaim_pv_chunk() removes one of the + * mappings that is being promoted. */ m = PHYS_TO_VM_PAGE(pa); va = trunc_2mpage(va); @@ -2589,6 +2614,20 @@ pmap_fill_ptp(pt_entry_t *firstpte, pt_e static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) { + struct rwlock *lock; + boolean_t rv; + + lock = NULL; + rv = pmap_demote_pde_locked(pmap, pde, va, &lock); + if (lock != NULL) + rw_wunlock(lock); + return (rv); +} + +static boolean_t +pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, + struct rwlock **lockp) +{ pd_entry_t newpde, oldpde; pt_entry_t *firstpte, newpte; vm_paddr_t mptepa; @@ -2623,7 +2662,8 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { free = NULL; - pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free); + pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free, + lockp); pmap_invalidate_page(pmap, trunc_2mpage(va)); pmap_free_zero_pages(free); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx" @@ -2683,16 +2723,16 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t /* * Demote the pv entry. This depends on the earlier demotion * of the mapping. Specifically, the (re)creation of a per- - * page pv entry might trigger the execution of pmap_pv_reclaim(), + * page pv entry might trigger the execution of reclaim_pv_chunk(), * which might reclaim a newly (re)created per-page pv entry * and destroy the associated mapping. In order to destroy * the mapping, the PDE must have already changed from mapping * the 2mpage to referencing the page table page. */ if ((oldpde & PG_MANAGED) != 0) - pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME); + pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME, lockp); - pmap_pde_demotions++; + atomic_add_long(&pmap_pde_demotions, 1); CTR2(KTR_PMAP, "pmap_demote_pde: success for va %#lx" " in pmap %p", va, pmap); return (TRUE); @@ -2703,7 +2743,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t */ static int pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, - vm_page_t *free) + vm_page_t *free, struct rwlock **lockp) { struct md_page *pvh; pd_entry_t oldpde; @@ -2725,6 +2765,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t pmap_invalidate_page(kernel_pmap, sva); pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); if (oldpde & PG_MANAGED) { + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, oldpde & PG_PS_FRAME); pvh = pa_to_pvh(oldpde & PG_PS_FRAME); pmap_pvh_free(pvh, pmap, sva); eva = sva + NBPDR; @@ -2740,7 +2781,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t } } if (pmap == kernel_pmap) { - if (!pmap_demote_pde(pmap, pdq, sva)) + if (!pmap_demote_pde_locked(pmap, pdq, sva, lockp)) panic("pmap_remove_pde: failed demotion"); } else { mpte = pmap_lookup_pt_page(pmap, sva); @@ -2762,7 +2803,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t */ static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t va, - pd_entry_t ptepde, vm_page_t *free) + pd_entry_t ptepde, vm_page_t *free, struct rwlock **lockp) { struct md_page *pvh; pt_entry_t oldpte; @@ -2779,6 +2820,7 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t vm_page_dirty(m); if (oldpte & PG_A) vm_page_aflag_set(m, PGA_REFERENCED); + CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m); pmap_pvh_free(&m->md, pmap, va); if (TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { @@ -2796,6 +2838,7 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t static void pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, vm_page_t *free) { + struct rwlock *lock; pt_entry_t *pte; PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -2804,7 +2847,10 @@ pmap_remove_page(pmap_t pmap, vm_offset_ pte = pmap_pde_to_pte(pde, va); if ((*pte & PG_V) == 0) return; - pmap_remove_pte(pmap, pte, va, *pde, free); + lock = NULL; + pmap_remove_pte(pmap, pte, va, *pde, free, &lock); + if (lock != NULL) + rw_wunlock(lock); pmap_invalidate_page(pmap, va); } @@ -2817,6 +2863,7 @@ pmap_remove_page(pmap_t pmap, vm_offset_ void pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { + struct rwlock *lock; vm_offset_t va, va_next; pml4_entry_t *pml4e; pdp_entry_t *pdpe; @@ -2833,7 +2880,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva anyvalid = 0; - rw_wlock(&pvh_global_lock); + rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); /* @@ -2849,6 +2896,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva } } + lock = NULL; for (; sva < eva; sva = va_next) { if (pmap->pm_stats.resident_count == 0) @@ -2901,9 +2949,10 @@ pmap_remove(pmap_t pmap, vm_offset_t sva */ if ((ptpaddr & PG_G) == 0) anyvalid = 1; - pmap_remove_pde(pmap, pde, sva, &free); + pmap_remove_pde(pmap, pde, sva, &free, &lock); continue; - } else if (!pmap_demote_pde(pmap, pde, sva)) { + } else if (!pmap_demote_pde_locked(pmap, pde, sva, + &lock)) { /* The large page mapping was destroyed. */ continue; } else @@ -2932,7 +2981,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva anyvalid = 1; else if (va == va_next) va = sva; - if (pmap_remove_pte(pmap, pte, sva, ptpaddr, &free)) { + if (pmap_remove_pte(pmap, pte, sva, ptpaddr, &free, + &lock)) { sva += PAGE_SIZE; break; } @@ -2940,10 +2990,12 @@ pmap_remove(pmap_t pmap, vm_offset_t sva if (va != va_next) pmap_invalidate_range(pmap, va, sva); } + if (lock != NULL) + rw_wunlock(lock); out: if (anyvalid) pmap_invalidate_all(pmap); - rw_wunlock(&pvh_global_lock); + rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(free); } @@ -3135,12 +3187,12 @@ resume: } else { if (!pv_lists_locked) { pv_lists_locked = TRUE; - if (!rw_try_wlock(&pvh_global_lock)) { + if (!rw_try_rlock(&pvh_global_lock)) { if (anychanged) pmap_invalidate_all( pmap); PMAP_UNLOCK(pmap); - rw_wlock(&pvh_global_lock); + rw_rlock(&pvh_global_lock); goto resume; } } @@ -3191,7 +3243,7 @@ retry: if (anychanged) pmap_invalidate_all(pmap); if (pv_lists_locked) - rw_wunlock(&pvh_global_lock); + rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3862,9 +3914,9 @@ pmap_change_wiring(pmap_t pmap, vm_offse { pd_entry_t *pde; pt_entry_t *pte; - boolean_t are_queues_locked; + boolean_t pv_lists_locked; - are_queues_locked = FALSE; + pv_lists_locked = FALSE; /* * Wiring is not a hardware characteristic so there is no need to @@ -3875,11 +3927,11 @@ retry: pde = pmap_pde(pmap, va); if ((*pde & PG_PS) != 0) { if (!wired != ((*pde & PG_W) == 0)) { - if (!are_queues_locked) { - are_queues_locked = TRUE; - if (!rw_try_wlock(&pvh_global_lock)) { + if (!pv_lists_locked) { + pv_lists_locked = TRUE; + if (!rw_try_rlock(&pvh_global_lock)) { PMAP_UNLOCK(pmap); - rw_wlock(&pvh_global_lock); + rw_rlock(&pvh_global_lock); goto retry; } } @@ -3897,8 +3949,8 @@ retry: atomic_clear_long(pte, PG_W); } out: - if (are_queues_locked) - rw_wunlock(&pvh_global_lock); + if (pv_lists_locked) + rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 07:27:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3EBF61065673; Mon, 25 Jun 2012 07:27:32 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 292DC8FC12; Mon, 25 Jun 2012 07:27:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P7RVTV057646; Mon, 25 Jun 2012 07:27:31 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P7RVRp057644; Mon, 25 Jun 2012 07:27:31 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201206250727.q5P7RVRp057644@svn.freebsd.org> From: Fabien Thomas Date: Mon, 25 Jun 2012 07:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237552 - stable/9/sys/dev/xen/balloon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 07:27:32 -0000 Author: fabient Date: Mon Jun 25 07:27:31 2012 New Revision: 237552 URL: http://svn.freebsd.org/changeset/base/237552 Log: MFC r237322: Allow booting XENHVM kernel without Xen hypervisor. Modified: stable/9/sys/dev/xen/balloon/balloon.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/xen/balloon/balloon.c ============================================================================== --- stable/9/sys/dev/xen/balloon/balloon.c Mon Jun 25 07:13:25 2012 (r237551) +++ stable/9/sys/dev/xen/balloon/balloon.c Mon Jun 25 07:27:31 2012 (r237552) @@ -437,6 +437,9 @@ balloon_init_watcher(void *arg) { int err; + if (!is_running_on_xen()) + return; + err = xs_register_watch(&target_watch); if (err) printf("Failed to set balloon watcher\n"); From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 07:29:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5D4D106564A; Mon, 25 Jun 2012 07:29:14 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B01148FC0C; Mon, 25 Jun 2012 07:29:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P7TERd057761; Mon, 25 Jun 2012 07:29:14 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P7TE9p057759; Mon, 25 Jun 2012 07:29:14 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201206250729.q5P7TE9p057759@svn.freebsd.org> From: Fabien Thomas Date: Mon, 25 Jun 2012 07:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237553 - stable/8/sys/dev/xen/balloon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 07:29:14 -0000 Author: fabient Date: Mon Jun 25 07:29:14 2012 New Revision: 237553 URL: http://svn.freebsd.org/changeset/base/237553 Log: MFC r237322: Allow booting XENHVM kernel without Xen hypervisor. Modified: stable/8/sys/dev/xen/balloon/balloon.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/xen/balloon/balloon.c ============================================================================== --- stable/8/sys/dev/xen/balloon/balloon.c Mon Jun 25 07:27:31 2012 (r237552) +++ stable/8/sys/dev/xen/balloon/balloon.c Mon Jun 25 07:29:14 2012 (r237553) @@ -437,6 +437,9 @@ balloon_init_watcher(void *arg) { int err; + if (!is_running_on_xen()) + return; + err = xs_register_watch(&target_watch); if (err) printf("Failed to set balloon watcher\n"); From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 07:33:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 435AD106567D; Mon, 25 Jun 2012 07:33:55 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D86B8FC15; Mon, 25 Jun 2012 07:33:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P7XtW4058018; Mon, 25 Jun 2012 07:33:55 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P7Xssb058016; Mon, 25 Jun 2012 07:33:54 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201206250733.q5P7Xssb058016@svn.freebsd.org> From: Fabien Thomas Date: Mon, 25 Jun 2012 07:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237554 - stable/9/sys/dev/viawd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 07:33:55 -0000 Author: fabient Date: Mon Jun 25 07:33:54 2012 New Revision: 237554 URL: http://svn.freebsd.org/changeset/base/237554 Log: MFC r237295: Fix viawd(4) that was only working as a module. Modified: stable/9/sys/dev/viawd/viawd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/viawd/viawd.c ============================================================================== --- stable/9/sys/dev/viawd/viawd.c Mon Jun 25 07:29:14 2012 (r237553) +++ stable/9/sys/dev/viawd/viawd.c Mon Jun 25 07:33:54 2012 (r237554) @@ -168,14 +168,18 @@ viawd_attach(device_t dev) } /* Allocate I/O register space. */ - sc->wd_rid = 0; - sc->wd_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->wd_rid, - pmbase, pmbase + VIAWD_MEM_LEN - 1, VIAWD_MEM_LEN, + sc->wd_rid = VIAWD_CONFIG_BASE; + sc->wd_res = bus_alloc_resource_any(sb_dev, SYS_RES_MEMORY, &sc->wd_rid, RF_ACTIVE | RF_SHAREABLE); if (sc->wd_res == NULL) { device_printf(dev, "Unable to map watchdog memory\n"); goto fail; } + if (rman_get_size(sc->wd_res) < VIAWD_MEM_LEN) { + device_printf(dev, "Bad size for watchdog memory: %#x\n", + (unsigned)rman_get_size(sc->wd_res)); + goto fail; + } /* Check if watchdog fired last boot. */ reg = viawd_read_4(sc, VIAWD_MEM_CTRL); @@ -192,7 +196,7 @@ viawd_attach(device_t dev) return (0); fail: if (sc->wd_res != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, + bus_release_resource(sb_dev, SYS_RES_MEMORY, sc->wd_rid, sc->wd_res); return (ENXIO); } @@ -224,7 +228,7 @@ viawd_detach(device_t dev) } if (sc->wd_res != NULL) - bus_release_resource(sc->dev, SYS_RES_MEMORY, + bus_release_resource(sc->sb_dev, SYS_RES_MEMORY, sc->wd_rid, sc->wd_res); return (0); From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 07:36:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50270106567C; Mon, 25 Jun 2012 07:36:01 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ACF38FC15; Mon, 25 Jun 2012 07:36:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P7a1CI058160; Mon, 25 Jun 2012 07:36:01 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P7a1Tw058158; Mon, 25 Jun 2012 07:36:01 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201206250736.q5P7a1Tw058158@svn.freebsd.org> From: Fabien Thomas Date: Mon, 25 Jun 2012 07:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237555 - stable/8/sys/dev/viawd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 07:36:01 -0000 Author: fabient Date: Mon Jun 25 07:36:00 2012 New Revision: 237555 URL: http://svn.freebsd.org/changeset/base/237555 Log: MFC r237295: Fix viawd(4) that was only working as a module. Modified: stable/8/sys/dev/viawd/viawd.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/viawd/viawd.c ============================================================================== --- stable/8/sys/dev/viawd/viawd.c Mon Jun 25 07:33:54 2012 (r237554) +++ stable/8/sys/dev/viawd/viawd.c Mon Jun 25 07:36:00 2012 (r237555) @@ -168,14 +168,18 @@ viawd_attach(device_t dev) } /* Allocate I/O register space. */ - sc->wd_rid = 0; - sc->wd_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->wd_rid, - pmbase, pmbase + VIAWD_MEM_LEN - 1, VIAWD_MEM_LEN, + sc->wd_rid = VIAWD_CONFIG_BASE; + sc->wd_res = bus_alloc_resource_any(sb_dev, SYS_RES_MEMORY, &sc->wd_rid, RF_ACTIVE | RF_SHAREABLE); if (sc->wd_res == NULL) { device_printf(dev, "Unable to map watchdog memory\n"); goto fail; } + if (rman_get_size(sc->wd_res) < VIAWD_MEM_LEN) { + device_printf(dev, "Bad size for watchdog memory: %#x\n", + (unsigned)rman_get_size(sc->wd_res)); + goto fail; + } /* Check if watchdog fired last boot. */ reg = viawd_read_4(sc, VIAWD_MEM_CTRL); @@ -192,7 +196,7 @@ viawd_attach(device_t dev) return (0); fail: if (sc->wd_res != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, + bus_release_resource(sb_dev, SYS_RES_MEMORY, sc->wd_rid, sc->wd_res); return (ENXIO); } @@ -224,7 +228,7 @@ viawd_detach(device_t dev) } if (sc->wd_res != NULL) - bus_release_resource(sc->dev, SYS_RES_MEMORY, + bus_release_resource(sc->sb_dev, SYS_RES_MEMORY, sc->wd_rid, sc->wd_res); return (0); From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 07:56:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6C53106566C; Mon, 25 Jun 2012 07:56:23 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B13388FC14; Mon, 25 Jun 2012 07:56:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P7uNbx059036; Mon, 25 Jun 2012 07:56:23 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P7uNxw059033; Mon, 25 Jun 2012 07:56:23 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201206250756.q5P7uNxw059033@svn.freebsd.org> From: Fabien Thomas Date: Mon, 25 Jun 2012 07:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237556 - in stable/9/sys: arm/include dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 07:56:23 -0000 Author: fabient Date: Mon Jun 25 07:56:23 2012 New Revision: 237556 URL: http://svn.freebsd.org/changeset/base/237556 Log: MFC r236997: Add ARM callchain support for hwpmc. Modified: stable/9/sys/arm/include/pmc_mdep.h stable/9/sys/dev/hwpmc/hwpmc_arm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/arm/include/pmc_mdep.h ============================================================================== --- stable/9/sys/arm/include/pmc_mdep.h Mon Jun 25 07:36:00 2012 (r237555) +++ stable/9/sys/arm/include/pmc_mdep.h Mon Jun 25 07:56:23 2012 (r237556) @@ -50,9 +50,17 @@ union pmc_md_pmc { struct pmc_md_xscale_pmc pm_xscale; }; -#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_pc) -#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_usr_lr) -#define PMC_TRAPFRAME_TO_SP(TF) ((TF)->tf_usr_sp) +#define PMC_IN_KERNEL_STACK(S,START,END) \ + ((S) >= (START) && (S) < (END)) +#define PMC_IN_KERNEL(va) (((va) >= USRSTACK) && \ + ((va) < VM_MAX_KERNEL_ADDRESS)) + +#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) + +#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_pc) +#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_r11) +#define PMC_TRAPFRAME_TO_SVC_SP(TF) ((TF)->tf_svc_sp) +#define PMC_TRAPFRAME_TO_USR_SP(TF) ((TF)->tf_usr_sp) /* Build a fake kernel trapframe from current instruction pointer. */ #define PMC_FAKE_TRAPFRAME(TF) \ Modified: stable/9/sys/dev/hwpmc/hwpmc_arm.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_arm.c Mon Jun 25 07:36:00 2012 (r237555) +++ stable/9/sys/dev/hwpmc/hwpmc_arm.c Mon Jun 25 07:56:23 2012 (r237556) @@ -30,10 +30,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include -#include +#include #include +#include + +#include +#include +#include struct pmc_mdep * pmc_md_initialize() @@ -58,27 +64,101 @@ pmc_md_finalize(struct pmc_mdep *md) #endif } -static int -pmc_save_callchain(uintptr_t *cc, int maxsamples, - struct trapframe *tf) -{ - - *cc = PMC_TRAPFRAME_TO_PC(tf); - return (1); -} - int pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, struct trapframe *tf) { + uintptr_t pc, r, stackstart, stackend, fp; + struct thread *td; + int count; + + KASSERT(TRAPF_USERMODE(tf) == 0,("[arm,%d] not a kernel backtrace", + __LINE__)); + + pc = PMC_TRAPFRAME_TO_PC(tf); + *cc++ = pc; + + if ((td = curthread) == NULL) + return (1); + + if (maxsamples <= 1) + return (1); + + stackstart = (uintptr_t) td->td_kstack; + stackend = (uintptr_t) td->td_kstack + td->td_kstack_pages * PAGE_SIZE; + fp = PMC_TRAPFRAME_TO_FP(tf); + + if (!PMC_IN_KERNEL(pc) || + !PMC_IN_KERNEL_STACK(fp, stackstart, stackend)) + return (1); + + for (count = 1; count < maxsamples; count++) { + /* Use saved lr as pc. */ + r = fp - sizeof(uintptr_t); + if (!PMC_IN_KERNEL_STACK(r, stackstart, stackend)) + break; + pc = *(uintptr_t *)r; + if (!PMC_IN_KERNEL(pc)) + break; + + *cc++ = pc; + + /* Switch to next frame up */ + r = fp - 3 * sizeof(uintptr_t); + if (!PMC_IN_KERNEL_STACK(r, stackstart, stackend)) + break; + fp = *(uintptr_t *)r; + if (!PMC_IN_KERNEL_STACK(fp, stackstart, stackend)) + break; + } - return pmc_save_callchain(cc, maxsamples, tf); + return (count); } int pmc_save_user_callchain(uintptr_t *cc, int maxsamples, struct trapframe *tf) { + uintptr_t pc, r, oldfp, fp; + struct thread *td; + int count; + + KASSERT(TRAPF_USERMODE(tf), ("[x86,%d] Not a user trap frame tf=%p", + __LINE__, (void *) tf)); + + pc = PMC_TRAPFRAME_TO_PC(tf); + *cc++ = pc; + + if ((td = curthread) == NULL) + return (1); + + if (maxsamples <= 1) + return (1); + + oldfp = fp = PMC_TRAPFRAME_TO_FP(tf); + + if (!PMC_IN_USERSPACE(pc) || + !PMC_IN_USERSPACE(fp)) + return (1); + + for (count = 1; count < maxsamples; count++) { + /* Use saved lr as pc. */ + r = fp - sizeof(uintptr_t); + if (copyin((void *)r, &pc, sizeof(pc)) != 0) + break; + if (!PMC_IN_USERSPACE(pc)) + break; + + *cc++ = pc; + + /* Switch to next frame up */ + oldfp = fp; + r = fp - 3 * sizeof(uintptr_t); + if (copyin((void *)r, &fp, sizeof(fp)) != 0) + break; + if (fp < oldfp || !PMC_IN_USERSPACE(fp)) + break; + } - return pmc_save_callchain(cc, maxsamples, tf); + return (count); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 09:41:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65FFF1065680; Mon, 25 Jun 2012 09:41:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5077C8FC08; Mon, 25 Jun 2012 09:41:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P9fm0L063470; Mon, 25 Jun 2012 09:41:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P9fmFS063468; Mon, 25 Jun 2012 09:41:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206250941.q5P9fmFS063468@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 25 Jun 2012 09:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237559 - stable/9/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 09:41:48 -0000 Author: kib Date: Mon Jun 25 09:41:47 2012 New Revision: 237559 URL: http://svn.freebsd.org/changeset/base/237559 Log: MFC r237243: Adjust the fix in r236953, by not generating the signal manually, but performing the return to usermode using full return path. Modified: stable/9/sys/amd64/amd64/trap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/trap.c ============================================================================== --- stable/9/sys/amd64/amd64/trap.c Mon Jun 25 08:34:14 2012 (r237558) +++ stable/9/sys/amd64/amd64/trap.c Mon Jun 25 09:41:47 2012 (r237559) @@ -982,16 +982,10 @@ amd64_syscall(struct thread *td, int tra * If the user-supplied value of %rip is not a canonical * address, then some CPUs will trigger a ring 0 #GP during * the sysret instruction. However, the fault handler would - * execute with the user's %gs and %rsp in ring 0 which would - * not be safe. Instead, preemptively kill the thread with a - * SIGBUS. + * execute in ring 0 with the user's %gs and %rsp which would + * not be safe. Instead, use the full return path which + * catches the problem safely. */ - if (td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS) { - ksiginfo_init_trap(&ksi); - ksi.ksi_signo = SIGBUS; - ksi.ksi_code = BUS_OBJERR; - ksi.ksi_trapno = T_PROTFLT; - ksi.ksi_addr = (void *)td->td_frame->tf_rip; - trapsignal(td, &ksi); - } + if (td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS) + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 09:46:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 745771065679; Mon, 25 Jun 2012 09:46:07 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F04C8FC15; Mon, 25 Jun 2012 09:46:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5P9k7WO063692; Mon, 25 Jun 2012 09:46:07 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5P9k7Fn063689; Mon, 25 Jun 2012 09:46:07 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201206250946.q5P9k7Fn063689@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 25 Jun 2012 09:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237560 - in head/sys/modules: rdma/krping toecore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 09:46:07 -0000 Author: uqs Date: Mon Jun 25 09:46:06 2012 New Revision: 237560 URL: http://svn.freebsd.org/changeset/base/237560 Log: Fix 'make depend'. Modified: head/sys/modules/rdma/krping/Makefile head/sys/modules/toecore/Makefile Modified: head/sys/modules/rdma/krping/Makefile ============================================================================== --- head/sys/modules/rdma/krping/Makefile Mon Jun 25 09:41:47 2012 (r237559) +++ head/sys/modules/rdma/krping/Makefile Mon Jun 25 09:46:06 2012 (r237560) @@ -5,8 +5,8 @@ RDMA= ${.CURDIR}/../../../contrib/rdma/k KMOD= krping SRCS= krping.c krping_dev.c getopt.c -SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h -SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../ofed/include +SRCS+= bus_if.h device_if.h pci_if.h pcib_if.h vnode_if.h +SRCS+= opt_sched.h opt_inet.h opt_inet6.h +CFLAGS+= -I${.CURDIR}/../../../ofed/include .include Modified: head/sys/modules/toecore/Makefile ============================================================================== --- head/sys/modules/toecore/Makefile Mon Jun 25 09:41:47 2012 (r237559) +++ head/sys/modules/toecore/Makefile Mon Jun 25 09:46:06 2012 (r237560) @@ -4,6 +4,6 @@ KMOD= toecore SRCS= toecore.c -SRCS+= opt_ofed.h +SRCS+= opt_ofed.h opt_inet.h opt_inet6.h .include From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 11:52:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63B521065670; Mon, 25 Jun 2012 11:52:27 +0000 (UTC) (envelope-from monthadar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F28A8FC0A; Mon, 25 Jun 2012 11:52:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PBqRfo072178; Mon, 25 Jun 2012 11:52:27 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PBqRHK072176; Mon, 25 Jun 2012 11:52:27 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201206251152.q5PBqRHK072176@svn.freebsd.org> From: Monthadar Al Jaberi Date: Mon, 25 Jun 2012 11:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237561 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 11:52:27 -0000 Author: monthadar Date: Mon Jun 25 11:52:26 2012 New Revision: 237561 URL: http://svn.freebsd.org/changeset/base/237561 Log: Mesh mode, potential garbage in QoS subfield. * qos[1] subfield is never assigned a value before this statement. qos[1] can potentially be OR:ed with garbage. Make it an assignment instead; * Remove brackets around if statement; Approved by: adrian Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Mon Jun 25 09:46:06 2012 (r237560) +++ head/sys/net80211/ieee80211_output.c Mon Jun 25 11:52:26 2012 (r237561) @@ -1313,9 +1313,9 @@ ieee80211_encap(struct ieee80211vap *vap if (ic->ic_wme.wme_wmeChanParams.cap_wmeParams[ac].wmep_noackPolicy) qos[0] |= IEEE80211_QOS_ACKPOLICY_NOACK; #ifdef IEEE80211_SUPPORT_MESH - if (vap->iv_opmode == IEEE80211_M_MBSS) { - qos[1] |= IEEE80211_QOS_MC; - } else + if (vap->iv_opmode == IEEE80211_M_MBSS) + qos[1] = IEEE80211_QOS_MC; + else #endif qos[1] = 0; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_QOS; From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 12:30:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2BBC81065690; Mon, 25 Jun 2012 12:30:52 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 115168FC0A; Mon, 25 Jun 2012 12:30:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PCUpt9073765; Mon, 25 Jun 2012 12:30:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PCUpPA073759; Mon, 25 Jun 2012 12:30:51 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201206251230.q5PCUpPA073759@svn.freebsd.org> From: Christian Brueffer Date: Mon, 25 Jun 2012 12:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237562 - in stable/8/sys: amd64/conf i386/conf mips/conf pc98/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 12:30:52 -0000 Author: brueffer Date: Mon Jun 25 12:30:51 2012 New Revision: 237562 URL: http://svn.freebsd.org/changeset/base/237562 Log: MFC: r225482 Fix a zyd(4) comment typo that was copy+pasted into most kernel config files. Modified: stable/8/sys/amd64/conf/GENERIC stable/8/sys/i386/conf/GENERIC stable/8/sys/mips/conf/OCTEON1 stable/8/sys/pc98/conf/GENERIC stable/8/sys/sparc64/conf/GENERIC Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/amd64/conf/GENERIC ============================================================================== --- stable/8/sys/amd64/conf/GENERIC Mon Jun 25 11:52:26 2012 (r237561) +++ stable/8/sys/amd64/conf/GENERIC Mon Jun 25 12:30:51 2012 (r237562) @@ -319,7 +319,7 @@ device udav # Davicom DM9601E USB device rum # Ralink Technology RT2501USB wireless NICs device uath # Atheros AR5523 wireless NICs device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs +device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code Modified: stable/8/sys/i386/conf/GENERIC ============================================================================== --- stable/8/sys/i386/conf/GENERIC Mon Jun 25 11:52:26 2012 (r237561) +++ stable/8/sys/i386/conf/GENERIC Mon Jun 25 12:30:51 2012 (r237562) @@ -333,7 +333,7 @@ device udav # Davicom DM9601E USB device rum # Ralink Technology RT2501USB wireless NICs device uath # Atheros AR5523 wireless NICs device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs +device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code Modified: stable/8/sys/mips/conf/OCTEON1 ============================================================================== --- stable/8/sys/mips/conf/OCTEON1 Mon Jun 25 11:52:26 2012 (r237561) +++ stable/8/sys/mips/conf/OCTEON1 Mon Jun 25 12:30:51 2012 (r237562) @@ -295,4 +295,4 @@ device udav # Davicom DM9601E USB device rum # Ralink Technology RT2501USB wireless NICs device uath # Atheros AR5523 wireless NICs device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs +device zyd # ZyDAS zd1211/zd1211b wireless NICs Modified: stable/8/sys/pc98/conf/GENERIC ============================================================================== --- stable/8/sys/pc98/conf/GENERIC Mon Jun 25 11:52:26 2012 (r237561) +++ stable/8/sys/pc98/conf/GENERIC Mon Jun 25 12:30:51 2012 (r237562) @@ -283,7 +283,7 @@ device bpf # Berkeley packet filter #device rum # Ralink Technology RT2501USB wireless NICs #device uath # Atheros AR5523 wireless NICs #device ural # Ralink Technology RT2500USB wireless NICs -#device zyd # ZyDAS zb1211/zb1211b wireless NICs +#device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support #device firewire # FireWire bus code Modified: stable/8/sys/sparc64/conf/GENERIC ============================================================================== --- stable/8/sys/sparc64/conf/GENERIC Mon Jun 25 11:52:26 2012 (r237561) +++ stable/8/sys/sparc64/conf/GENERIC Mon Jun 25 12:30:51 2012 (r237562) @@ -262,7 +262,7 @@ device udav # Davicom DM9601E USB device rum # Ralink Technology RT2501USB wireless NICs device uath # Atheros AR5523 wireless NICs device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs +device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 14:27:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB29B106566C; Mon, 25 Jun 2012 14:27:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9E33C8FC15; Mon, 25 Jun 2012 14:27:53 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 07153B915; Mon, 25 Jun 2012 10:27:53 -0400 (EDT) From: John Baldwin To: Marius Strobl Date: Mon, 25 Jun 2012 10:00:08 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201206131504.q5DF4opt031336@svn.freebsd.org> <20120623221626.GH69382@alchemy.franken.de> In-Reply-To: <20120623221626.GH69382@alchemy.franken.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201206251000.09052.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 25 Jun 2012 10:27:53 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237008 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 14:27:53 -0000 On Saturday, June 23, 2012 6:16:26 pm Marius Strobl wrote: > On Wed, Jun 13, 2012 at 03:04:50PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Wed Jun 13 15:04:50 2012 > > New Revision: 237008 > > URL: http://svn.freebsd.org/changeset/base/237008 > > > > Log: > > Fix a couple of bugs that prevented windows in PCI-PCI bridges from > > growing "downward" (moving the start address down). First, an off by > > one error caused the end address to be moved down an extra alignment > > chunk unnecessarily. Second, when aligning the new candidate starting > > address, the wrong bits were masked off. > > > > Unfortunately, this now panics a sparc64 machine on the first attempt > to use a grown resource via bus_space(9) for me: > pcib3: at device 0.0 on pci2 > pcib2: allocated I/O port range (0x1000-0x1fff) for rid 1c of pcib3 > pcib2: allocated memory range (0x200000-0x3ffffff) for rid 20 of pcib3 > pcib3: domain 0 > pcib3: secondary bus 5 > pcib3: subordinate bus 5 > pcib3: I/O decode 0x1000-0x1fff > pcib3: memory decode 0x200000-0x3ffffff > pcib3: no prefetched decode > pcib3: Subtractively decoded bridge. > <...> > pci3: on pcib3 > <...> > isab0: at device 30.0 on pci3 > isa0: on isab0 > <...> > rtc0: at port 0x70-0x73 on isa0 > pcib3: attempting to grow I/O port window for (0x70-0x73,0x4) > front candidate range: 0x70-0x73 > pcib3: grew I/O port window to 0x70-0x1fff > panic: start address is not aligned > Alternatively, this may also be a data access trap, which also indicates > that some invalid address being used for the access. I think this was fixed in the next commit to this file (I had gotten the mask bits on 'front' wrong). Yes, it should be fixed by r237271: Old version: (gdb) p/x (0x70 & (~(1ul << 12) - 1)) $1 = 0x70 Fixed version: (gdb) p/x (0x70 & (~((1ul << 12) - 1))) $2 = 0x0 > before: > rtc0: at port 0x70-0x73 on isa0 > pcib3: attempting to grow I/O port window for (0x70-0x73,0x4) > pcib2: allocated I/O port range (0x70-0x73) for rid 0 of rtc0 > > Shouldn't a subtractively decoded resource actually be outside of > the window of the parent PCI-PCI bridge, i.e. it seems we shouldn't > try to grow the window in that case? The below patch fixes this for > me, I'm not sure whether that actually is the right approach though. Well, I've seen subtractive bridges with programmed windows, and the resource will decode properly either way. What the current code does is allow the request to pass up the tree if growing fails. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 16:52:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F009A106566B; Mon, 25 Jun 2012 16:52:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBA128FC0A; Mon, 25 Jun 2012 16:52:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PGqR14084472; Mon, 25 Jun 2012 16:52:27 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PGqRG0084470; Mon, 25 Jun 2012 16:52:27 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201206251652.q5PGqRG0084470@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 25 Jun 2012 16:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237563 - head/sys/ofed/include/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 16:52:28 -0000 Author: np Date: Mon Jun 25 16:52:27 2012 New Revision: 237563 URL: http://svn.freebsd.org/changeset/base/237563 Log: Fix clang warning when compiling iw_cxgb. Reported by: rene, dim Modified: head/sys/ofed/include/linux/workqueue.h Modified: head/sys/ofed/include/linux/workqueue.h ============================================================================== --- head/sys/ofed/include/linux/workqueue.h Mon Jun 25 12:30:51 2012 (r237562) +++ head/sys/ofed/include/linux/workqueue.h Mon Jun 25 16:52:27 2012 (r237563) @@ -129,7 +129,7 @@ _create_workqueue_common(char *name, int wq = kmalloc(sizeof(*wq), M_WAITOK); wq->taskqueue = taskqueue_create((name), M_WAITOK, taskqueue_thread_enqueue, &wq->taskqueue); - taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, (name)); + taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, "%s", name); return (wq); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 17:08:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 528CF1065676; Mon, 25 Jun 2012 17:08:19 +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 DDAA38FC15; Mon, 25 Jun 2012 17:08:18 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q5PH8CuD058940; Mon, 25 Jun 2012 19:08:12 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q5PH8CjT058939; Mon, 25 Jun 2012 19:08:12 +0200 (CEST) (envelope-from marius) Date: Mon, 25 Jun 2012 19:08:11 +0200 From: Marius Strobl To: John Baldwin Message-ID: <20120625170811.GI69382@alchemy.franken.de> References: <201206131504.q5DF4opt031336@svn.freebsd.org> <20120623221626.GH69382@alchemy.franken.de> <201206251000.09052.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201206251000.09052.jhb@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: r237008 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 17:08:19 -0000 On Mon, Jun 25, 2012 at 10:00:08AM -0400, John Baldwin wrote: > On Saturday, June 23, 2012 6:16:26 pm Marius Strobl wrote: > > On Wed, Jun 13, 2012 at 03:04:50PM +0000, John Baldwin wrote: > > > Author: jhb > > > Date: Wed Jun 13 15:04:50 2012 > > > New Revision: 237008 > > > URL: http://svn.freebsd.org/changeset/base/237008 > > > > > > Log: > > > Fix a couple of bugs that prevented windows in PCI-PCI bridges from > > > growing "downward" (moving the start address down). First, an off by > > > one error caused the end address to be moved down an extra alignment > > > chunk unnecessarily. Second, when aligning the new candidate starting > > > address, the wrong bits were masked off. > > > > > > > Unfortunately, this now panics a sparc64 machine on the first attempt > > to use a grown resource via bus_space(9) for me: > > pcib3: at device 0.0 on pci2 > > pcib2: allocated I/O port range (0x1000-0x1fff) for rid 1c of pcib3 > > pcib2: allocated memory range (0x200000-0x3ffffff) for rid 20 of pcib3 > > pcib3: domain 0 > > pcib3: secondary bus 5 > > pcib3: subordinate bus 5 > > pcib3: I/O decode 0x1000-0x1fff > > pcib3: memory decode 0x200000-0x3ffffff > > pcib3: no prefetched decode > > pcib3: Subtractively decoded bridge. > > <...> > > pci3: on pcib3 > > <...> > > isab0: at device 30.0 on pci3 > > isa0: on isab0 > > <...> > > rtc0: at port 0x70-0x73 on isa0 > > pcib3: attempting to grow I/O port window for (0x70-0x73,0x4) > > front candidate range: 0x70-0x73 > > pcib3: grew I/O port window to 0x70-0x1fff > > panic: start address is not aligned > > Alternatively, this may also be a data access trap, which also indicates > > that some invalid address being used for the access. > > I think this was fixed in the next commit to this file (I had gotten the > mask bits on 'front' wrong). Yes, it should be fixed by r237271: > > Old version: > > (gdb) p/x (0x70 & (~(1ul << 12) - 1)) > $1 = 0x70 > > Fixed version: > > (gdb) p/x (0x70 & (~((1ul << 12) - 1))) > $2 = 0x0 Well, a stock r237433 still panics with a data access trap when trying to use the resource via bus_space(9). So while the math for growing the window is probably right now, there still is a problem. > > > before: > > rtc0: at port 0x70-0x73 on isa0 > > pcib3: attempting to grow I/O port window for (0x70-0x73,0x4) > > pcib2: allocated I/O port range (0x70-0x73) for rid 0 of rtc0 > > > > Shouldn't a subtractively decoded resource actually be outside of > > the window of the parent PCI-PCI bridge, i.e. it seems we shouldn't > > try to grow the window in that case? The below patch fixes this for > > me, I'm not sure whether that actually is the right approach though. > > Well, I've seen subtractive bridges with programmed windows, and the resource > will decode properly either way. What the current code does is allow the > request to pass up the tree if growing fails. By growing the window to 0x0-0x1fff in this case we are effectively turning the formerly subtractively decoded resource in a positively decodeded one. Maybe there's some additional bit, probably in the PCI-ISA bridge, that needs to be switch for that, too? In any case, growing the window in this case and by that changing the type of decoding seems like a strange approach to me. Why do subtractive decoders exist in the first place when the windows alternatively could be grown/set up to only just do positive decoding instead? Marius From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 17:15:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47F9B1065670; Mon, 25 Jun 2012 17:15:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31AF98FC15; Mon, 25 Jun 2012 17:15:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PHFAuf085472; Mon, 25 Jun 2012 17:15:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PHF9lF085463; Mon, 25 Jun 2012 17:15:09 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201206251715.q5PHF9lF085463@svn.freebsd.org> From: Michael Tuexen Date: Mon, 25 Jun 2012 17:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237565 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 17:15:10 -0000 Author: tuexen Date: Mon Jun 25 17:15:09 2012 New Revision: 237565 URL: http://svn.freebsd.org/changeset/base/237565 Log: Whitespace cleanup. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Jun 25 17:12:51 2012 (r237564) +++ head/sys/netinet/sctp_indata.c Mon Jun 25 17:15:09 2012 (r237565) @@ -1529,7 +1529,7 @@ sctp_process_a_data_chunk(struct sctp_tc */ if (stcb->sctp_socket->so_rcv.sb_cc) { /* some to read, wake-up */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -1545,7 +1545,7 @@ sctp_process_a_data_chunk(struct sctp_tc } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3982,7 +3982,7 @@ sctp_express_handle_sack(struct sctp_tcb } /* sa_ignore NO_NULL_CHK */ if (stcb->sctp_socket) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3991,7 +3991,7 @@ sctp_express_handle_sack(struct sctp_tcb /* sa_ignore NO_NULL_CHK */ sctp_wakeup_log(stcb, 1, SCTP_WAKESND_FROM_SACK); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4005,7 +4005,7 @@ sctp_express_handle_sack(struct sctp_tcb } #endif sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else { @@ -4734,7 +4734,7 @@ sctp_handle_sack(struct mbuf *m, int off } /* sa_ignore NO_NULL_CHK */ if ((wake_him) && (stcb->sctp_socket)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -4742,7 +4742,7 @@ sctp_handle_sack(struct mbuf *m, int off if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { sctp_wakeup_log(stcb, wake_him, SCTP_WAKESND_FROM_SACK); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4756,7 +4756,7 @@ sctp_handle_sack(struct mbuf *m, int off } #endif sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else { Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Jun 25 17:12:51 2012 (r237564) +++ head/sys/netinet/sctp_input.c Mon Jun 25 17:15:09 2012 (r237565) @@ -757,7 +757,7 @@ static void sctp_handle_abort(struct sctp_abort_chunk *abort, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -807,7 +807,7 @@ sctp_handle_abort(struct sctp_abort_chun #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -818,7 +818,7 @@ sctp_handle_abort(struct sctp_abort_chun stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_6); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_abort: finished\n"); @@ -860,7 +860,7 @@ sctp_handle_shutdown(struct sctp_shutdow struct sctp_association *asoc; int some_on_streamwheel; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -892,7 +892,7 @@ sctp_handle_shutdown(struct sctp_shutdow asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; SCTP_INP_READ_UNLOCK(stcb->sctp_ep); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -906,7 +906,7 @@ sctp_handle_shutdown(struct sctp_shutdow } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -966,7 +966,7 @@ sctp_handle_shutdown_ack(struct sctp_shu { struct sctp_association *asoc; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -1000,7 +1000,7 @@ sctp_handle_shutdown_ack(struct sctp_shu asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; SCTP_INP_READ_UNLOCK(stcb->sctp_ep); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -1013,7 +1013,7 @@ sctp_handle_shutdown_ack(struct sctp_shu } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1037,7 +1037,7 @@ sctp_handle_shutdown_ack(struct sctp_shu } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); /* free the TCB but first save off the ep */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -1046,7 +1046,7 @@ sctp_handle_shutdown_ack(struct sctp_shu #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_10); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1132,7 +1132,7 @@ sctp_handle_error(struct sctp_chunkhdr * struct sctp_association *asoc; int adjust; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1195,7 +1195,7 @@ sctp_handle_error(struct sctp_chunkhdr * asoc->max_init_times) { sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); /* now free the asoc */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1205,7 +1205,7 @@ sctp_handle_error(struct sctp_chunkhdr * #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_11); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif return (-1); @@ -1580,7 +1580,7 @@ sctp_process_cookie_existing(struct mbuf (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (inp->sctp_socket->so_qlimit == 0) ) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1592,7 +1592,7 @@ sctp_process_cookie_existing(struct mbuf */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1605,7 +1605,7 @@ sctp_process_cookie_existing(struct mbuf } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1798,13 +1798,13 @@ sctp_process_cookie_existing(struct mbuf if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (inp->sctp_socket->so_qlimit == 0)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1817,7 +1817,7 @@ sctp_process_cookie_existing(struct mbuf } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -2029,7 +2029,7 @@ sctp_process_cookie_new(struct mbuf *m, struct sockaddr_in6 *sin6; #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -2133,14 +2133,14 @@ sctp_process_cookie_new(struct mbuf *m, sh, op_err, use_mflowid, mflowid, vrf_id, port); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2165,13 +2165,13 @@ sctp_process_cookie_new(struct mbuf *m, retval = 0; if (retval < 0) { atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2182,13 +2182,13 @@ sctp_process_cookie_new(struct mbuf *m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, init_src)) { atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_17); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2211,13 +2211,13 @@ sctp_process_cookie_new(struct mbuf *m, SCTPDBG(SCTP_DEBUG_AUTH1, "COOKIE-ECHO: AUTH failed\n"); atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_18); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2274,13 +2274,13 @@ sctp_process_cookie_new(struct mbuf *m, #endif default: atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2301,7 +2301,7 @@ sctp_process_cookie_new(struct mbuf *m, * a bit of protection is worth having.. */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -2313,7 +2313,7 @@ sctp_process_cookie_new(struct mbuf *m, } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && @@ -2780,7 +2780,7 @@ sctp_handle_cookie_echo(struct mbuf *m, if (so == NULL) { struct mbuf *op_err; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *pcb_so; #endif @@ -2791,7 +2791,7 @@ sctp_handle_cookie_echo(struct mbuf *m, sh, op_err, use_mflowid, mflowid, vrf_id, port); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) pcb_so = SCTP_INP_SO(*inp_p); atomic_add_int(&(*stcb)->asoc.refcnt, 1); SCTP_TCB_UNLOCK((*stcb)); @@ -2800,7 +2800,7 @@ sctp_handle_cookie_echo(struct mbuf *m, atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); #endif (void)sctp_free_assoc(*inp_p, *stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_20); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(pcb_so, 1); #endif return (NULL); @@ -2890,13 +2890,13 @@ sctp_handle_cookie_echo(struct mbuf *m, * Pull it from the incomplete queue and wake the * guy */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&(*stcb)->asoc.refcnt, 1); SCTP_TCB_UNLOCK((*stcb)); SCTP_SOCKET_LOCK(so, 1); #endif soisconnected(so); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_LOCK((*stcb)); atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); SCTP_SOCKET_UNLOCK(so, 1); @@ -2954,12 +2954,12 @@ sctp_handle_cookie_ack(struct sctp_cooki sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -2970,7 +2970,7 @@ sctp_handle_cookie_ack(struct sctp_cooki if ((stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) == 0) { soisconnected(stcb->sctp_socket); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3198,7 +3198,7 @@ sctp_handle_shutdown_complete(struct sct { struct sctp_association *asoc; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3233,7 +3233,7 @@ sctp_handle_shutdown_complete(struct sct /* free the TCB */ SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_complete: calls free-asoc\n"); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3242,7 +3242,7 @@ sctp_handle_shutdown_complete(struct sct atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_23); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif return; @@ -4429,7 +4429,7 @@ __attribute__((noinline)) int auth_skipped = 0; int asconf_cnt = 0; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -4787,7 +4787,7 @@ process_control_chunks: } *offset = length; if (stcb) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4796,7 +4796,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_27); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -5207,7 +5207,7 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else if (stcb) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5216,7 +5216,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_27); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; @@ -5370,7 +5370,7 @@ process_control_chunks: *fwd_tsn_seen = 1; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5379,7 +5379,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_29); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; @@ -5415,7 +5415,7 @@ process_control_chunks: } if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5424,7 +5424,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_30); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Jun 25 17:12:51 2012 (r237564) +++ head/sys/netinet/sctp_output.c Mon Jun 25 17:15:09 2012 (r237565) @@ -3892,7 +3892,7 @@ sctp_lowlevel_chunk_output(struct sctp_i struct udphdr *udp = NULL; uint8_t tos_value; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so = NULL; #endif @@ -4132,14 +4132,14 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_packet_log(o_pak); #endif /* send it out. table id is taken from stcb */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { so = SCTP_INP_SO(inp); SCTP_SOCKET_UNLOCK(so, 0); } #endif SCTP_IP_OUTPUT(ret, o_pak, ro, stcb, vrf_id); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4480,7 +4480,7 @@ sctp_lowlevel_chunk_output(struct sctp_i #endif } /* send it out. table id is taken from stcb */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { so = SCTP_INP_SO(inp); SCTP_SOCKET_UNLOCK(so, 0); @@ -4491,7 +4491,7 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_packet_log(o_pak); #endif SCTP_IP6_OUTPUT(ret, o_pak, (struct route_in6 *)ro, &ifp, stcb, vrf_id); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Mon Jun 25 17:12:51 2012 (r237564) +++ head/sys/netinet/sctp_sysctl.c Mon Jun 25 17:15:09 2012 (r237565) @@ -665,7 +665,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #ifdef SCTP_DEBUG RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) RANGECHK(SCTP_BASE_SYSCTL(sctp_output_unlocked), SCTPCTL_OUTPUT_UNLOCKED_MIN, SCTPCTL_OUTPUT_UNLOCKED_MAX); #endif } @@ -1125,7 +1125,7 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTPUT_UNLOCKED_DESC); Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Mon Jun 25 17:12:51 2012 (r237564) +++ head/sys/netinet/sctp_sysctl.h Mon Jun 25 17:15:09 2012 (r237565) @@ -531,7 +531,7 @@ struct sctp_sysctl { #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) #define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP." #define SCTPCTL_OUTPUT_UNLOCKED_MIN 0 #define SCTPCTL_OUTPUT_UNLOCKED_MAX 1 Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon Jun 25 17:12:51 2012 (r237564) +++ head/sys/netinet/sctp_usrreq.c Mon Jun 25 17:15:09 2012 (r237565) @@ -224,7 +224,7 @@ sctp_notify(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -283,7 +283,7 @@ sctp_notify(struct sctp_inpcb *inp, * with no TCB */ sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -292,7 +292,7 @@ sctp_notify(struct sctp_inpcb *inp, atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); /* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */ #endif @@ -5842,7 +5842,7 @@ sctp_ctloutput(struct socket *so, struct if (INP_CHECK_SOCKAF(so, AF_INET6)) error = ip6_ctloutput(so, sopt); #endif /* INET6 */ -#if defined(INET) && defined (INET6) +#if defined(INET) && defined(INET6) else #endif #ifdef INET Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Jun 25 17:12:51 2012 (r237564) +++ head/sys/netinet/sctputil.c Mon Jun 25 17:15:09 2012 (r237565) @@ -1412,7 +1412,7 @@ sctp_timeout_handler(void *t) struct sctp_nets *net; struct sctp_timer *tmr; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1777,7 +1777,7 @@ sctp_timeout_handler(void *t) /* Can we free it yet? */ SCTP_INP_DECR_REF(inp); sctp_timer_stop(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1786,7 +1786,7 @@ sctp_timeout_handler(void *t) atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif /* @@ -2600,7 +2600,7 @@ sctp_notify_assoc_change(uint16_t state, size_t notif_len, abort_len; unsigned int i; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -2698,7 +2698,7 @@ set_error: } } /* Wake ANY sleepers */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); if (!so_locked) { atomic_add_int(&stcb->asoc.refcnt, 1); @@ -2719,7 +2719,7 @@ set_error: } sorwakeup(stcb->sctp_socket); sowwakeup(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -3134,7 +3134,7 @@ sctp_notify_partial_delivery_indication( } if (stcb->sctp_ep && stcb->sctp_socket) { /* This should always be the case */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -3151,7 +3151,7 @@ sctp_notify_partial_delivery_indication( } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -3173,7 +3173,7 @@ sctp_notify_shutdown_event(struct sctp_t if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /* mark socket closed for read/write and wakeup! */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -3188,7 +3188,7 @@ sctp_notify_shutdown_event(struct sctp_t } #endif socantsendmore(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3830,7 +3830,7 @@ sctp_abort_association(struct sctp_inpcb { uint32_t vtag; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3849,7 +3849,7 @@ sctp_abort_association(struct sctp_inpcb vrf_id, port); if (stcb != NULL) { /* Ok, now lets free it */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3863,7 +3863,7 @@ sctp_abort_association(struct sctp_inpcb SCTP_STAT_DECR_GAUGE32(sctps_currestab); } (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_4); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3942,12 +3942,12 @@ sctp_abort_an_association(struct sctp_in #endif ) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); #endif if (stcb == NULL) { @@ -3977,7 +3977,7 @@ sctp_abort_an_association(struct sctp_in #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3987,7 +3987,7 @@ sctp_abort_an_association(struct sctp_in } #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_5); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -4475,7 +4475,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); } else { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -4496,7 +4496,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp } #endif sctp_sorwakeup(inp, inp->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -4629,7 +4629,7 @@ get_out: if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); } else { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -4648,7 +4648,7 @@ get_out: } #endif sctp_sorwakeup(inp, inp->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -4905,7 +4905,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t SCTP_TCB_SEND_UNLOCK(stcb); } if (do_wakeup_routine) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -4923,7 +4923,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t } #endif sctp_sowwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Mon Jun 25 17:12:51 2012 (r237564) +++ head/sys/netinet6/sctp6_usrreq.c Mon Jun 25 17:15:09 2012 (r237565) @@ -395,7 +395,7 @@ sctp6_notify(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -450,7 +450,7 @@ sctp6_notify(struct sctp_inpcb *inp, * with no TCB */ sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -459,7 +459,7 @@ sctp6_notify(struct sctp_inpcb *inp, atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); /* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */ #endif From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 17:50:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 428D21065674; Mon, 25 Jun 2012 17:50:12 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4B38FC18; Mon, 25 Jun 2012 17:50:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PHoCXM086905; Mon, 25 Jun 2012 17:50:12 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PHoBIi086903; Mon, 25 Jun 2012 17:50:11 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201206251750.q5PHoBIi086903@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 25 Jun 2012 17:50: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: r237566 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 17:50:12 -0000 Author: gonzo Date: Mon Jun 25 17:50:11 2012 New Revision: 237566 URL: http://svn.freebsd.org/changeset/base/237566 Log: Handle case when result of pmap_pte is NULL. This issue was uncovered by r237367 Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Mon Jun 25 17:15:09 2012 (r237565) +++ head/sys/mips/mips/pmap.c Mon Jun 25 17:50:11 2012 (r237566) @@ -765,6 +765,7 @@ pmap_extract(pmap_t pmap, vm_offset_t va vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { + pt_entry_t *ptep; pt_entry_t pte; vm_page_t m; vm_paddr_t pa; @@ -773,8 +774,9 @@ pmap_extract_and_hold(pmap_t pmap, vm_of pa = 0; PMAP_LOCK(pmap); retry: - pte = *pmap_pte(pmap, va); - if (pte != 0 && pte_test(&pte, PTE_V) && + ptep = pmap_pte(pmap, va); + if ((ptep != NULL) && ((pte = *ptep) != 0) && + pte_test(&pte, PTE_V) && (pte_test(&pte, PTE_D) || (prot & VM_PROT_WRITE) == 0)) { if (vm_page_pa_tryrelock(pmap, TLBLO_PTE_TO_PA(pte), &pa)) goto retry; From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 18:46:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E451106567D; Mon, 25 Jun 2012 18:46:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id D45668FC0C; Mon, 25 Jun 2012 18:46:57 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 33A28B98A; Mon, 25 Jun 2012 14:46:57 -0400 (EDT) From: John Baldwin To: Marius Strobl Date: Mon, 25 Jun 2012 14:24:24 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201206131504.q5DF4opt031336@svn.freebsd.org> <201206251000.09052.jhb@freebsd.org> <20120625170811.GI69382@alchemy.franken.de> In-Reply-To: <20120625170811.GI69382@alchemy.franken.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201206251424.24621.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 25 Jun 2012 14:46:57 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237008 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 18:46:58 -0000 On Monday, June 25, 2012 1:08:11 pm Marius Strobl wrote: > On Mon, Jun 25, 2012 at 10:00:08AM -0400, John Baldwin wrote: > > On Saturday, June 23, 2012 6:16:26 pm Marius Strobl wrote: > > > On Wed, Jun 13, 2012 at 03:04:50PM +0000, John Baldwin wrote: > > > > Author: jhb > > > > Date: Wed Jun 13 15:04:50 2012 > > > > New Revision: 237008 > > > > URL: http://svn.freebsd.org/changeset/base/237008 > > > > > > > > Log: > > > > Fix a couple of bugs that prevented windows in PCI-PCI bridges from > > > > growing "downward" (moving the start address down). First, an off by > > > > one error caused the end address to be moved down an extra alignment > > > > chunk unnecessarily. Second, when aligning the new candidate starting > > > > address, the wrong bits were masked off. > > > > > > > > > > Unfortunately, this now panics a sparc64 machine on the first attempt > > > to use a grown resource via bus_space(9) for me: > > > pcib3: at device 0.0 on pci2 > > > pcib2: allocated I/O port range (0x1000-0x1fff) for rid 1c of pcib3 > > > pcib2: allocated memory range (0x200000-0x3ffffff) for rid 20 of pcib3 > > > pcib3: domain 0 > > > pcib3: secondary bus 5 > > > pcib3: subordinate bus 5 > > > pcib3: I/O decode 0x1000-0x1fff > > > pcib3: memory decode 0x200000-0x3ffffff > > > pcib3: no prefetched decode > > > pcib3: Subtractively decoded bridge. > > > <...> > > > pci3: on pcib3 > > > <...> > > > isab0: at device 30.0 on pci3 > > > isa0: on isab0 > > > <...> > > > rtc0: at port 0x70-0x73 on isa0 > > > pcib3: attempting to grow I/O port window for (0x70-0x73,0x4) > > > front candidate range: 0x70-0x73 > > > pcib3: grew I/O port window to 0x70-0x1fff > > > panic: start address is not aligned > > > Alternatively, this may also be a data access trap, which also indicates > > > that some invalid address being used for the access. > > > > I think this was fixed in the next commit to this file (I had gotten the > > mask bits on 'front' wrong). Yes, it should be fixed by r237271: > > > > Old version: > > > > (gdb) p/x (0x70 & (~(1ul << 12) - 1)) > > $1 = 0x70 > > > > Fixed version: > > > > (gdb) p/x (0x70 & (~((1ul << 12) - 1))) > > $2 = 0x0 > > Well, a stock r237433 still panics with a data access trap when > trying to use the resource via bus_space(9). So while the math for > growing the window is probably right now, there still is a problem. Hmm. It would be interesting to know if it used to grow before (it might not have due to the bugs I fixed in the growing code). > > > > > before: > > > rtc0: at port 0x70-0x73 on isa0 > > > pcib3: attempting to grow I/O port window for (0x70-0x73,0x4) > > > pcib2: allocated I/O port range (0x70-0x73) for rid 0 of rtc0 > > > > > > Shouldn't a subtractively decoded resource actually be outside of > > > the window of the parent PCI-PCI bridge, i.e. it seems we shouldn't > > > try to grow the window in that case? The below patch fixes this for > > > me, I'm not sure whether that actually is the right approach though. > > > > Well, I've seen subtractive bridges with programmed windows, and the resource > > will decode properly either way. What the current code does is allow the > > request to pass up the tree if growing fails. > > By growing the window to 0x0-0x1fff in this case we are effectively > turning the formerly subtractively decoded resource in a positively > decodeded one. Maybe there's some additional bit, probably in the > PCI-ISA bridge, that needs to be switch for that, too? In any case, > growing the window in this case and by that changing the type of > decoding seems like a strange approach to me. Why do subtractive > decoders exist in the first place when the windows alternatively > could be grown/set up to only just do positive decoding instead? The PCI-ISA bridge should already be decoding that range. Note that subtractive decoding is slower (it has to wait for an extra cycle to give other devices a chance to snag a request). I would not mind a tunable to control growing or not growing a window on a subtractively decoded bridge. Does the firmware assign a window to this bridge btw? We probably should not allocate a new window for a subtractively decoded bridge, but if the firmware has already assigned a window, growing an existing window seems less problematic. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 18:54:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85DA5106566B; Mon, 25 Jun 2012 18:54:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 574D78FC16; Mon, 25 Jun 2012 18:54:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PIs3lt089522; Mon, 25 Jun 2012 18:54:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PIs3fj089519; Mon, 25 Jun 2012 18:54:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206251854.q5PIs3fj089519@svn.freebsd.org> From: Xin LI Date: Mon, 25 Jun 2012 18:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237567 - vendor-crypto/openssh/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 18:54:03 -0000 Author: delphij Date: Mon Jun 25 18:54:02 2012 New Revision: 237567 URL: http://svn.freebsd.org/changeset/base/237567 Log: Merge from upstream: - djm@cvs.openbsd.org 2012/04/11 13:34:17 [ssh-keyscan.1 ssh-keyscan.c] now that sshd defaults to offering ECDSA keys, ssh-keyscan should also look for them by default; bz#1971 Approved by: des Modified: vendor-crypto/openssh/dist/ssh-keyscan.1 vendor-crypto/openssh/dist/ssh-keyscan.c Modified: vendor-crypto/openssh/dist/ssh-keyscan.1 ============================================================================== --- vendor-crypto/openssh/dist/ssh-keyscan.1 Mon Jun 25 17:50:11 2012 (r237566) +++ vendor-crypto/openssh/dist/ssh-keyscan.1 Mon Jun 25 18:54:02 2012 (r237567) @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-keyscan.1,v 1.29 2010/08/31 11:54:45 djm Exp $ +.\" $OpenBSD: ssh-keyscan.1,v 1.30 2012/04/11 13:34:17 djm Exp $ .\" .\" Copyright 1995, 1996 by David Mazieres . .\" @@ -6,7 +6,7 @@ .\" permitted provided that due credit is given to the author and the .\" OpenBSD project by leaving this copyright notice intact. .\" -.Dd $Mdocdate: August 31 2010 $ +.Dd $Mdocdate: April 11 2012 $ .Dt SSH-KEYSCAN 1 .Os .Sh NAME @@ -94,8 +94,11 @@ or .Dq rsa for protocol version 2. Multiple values may be specified by separating them with commas. -The default is -.Dq rsa . +The default is to fetch +.Dq rsa +and +.Dq ecdsa +keys. .It Fl v Verbose mode. Causes Modified: vendor-crypto/openssh/dist/ssh-keyscan.c ============================================================================== --- vendor-crypto/openssh/dist/ssh-keyscan.c Mon Jun 25 17:50:11 2012 (r237566) +++ vendor-crypto/openssh/dist/ssh-keyscan.c Mon Jun 25 18:54:02 2012 (r237567) @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keyscan.c,v 1.85 2011/03/15 10:36:02 okan Exp $ */ +/* $OpenBSD: ssh-keyscan.c,v 1.86 2012/04/11 13:34:17 djm Exp $ */ /* * Copyright 1995, 1996 by David Mazieres . * @@ -57,7 +57,7 @@ int ssh_port = SSH_DEFAULT_PORT; #define KT_RSA 4 #define KT_ECDSA 8 -int get_keytypes = KT_RSA; /* Get only RSA keys by default */ +int get_keytypes = KT_RSA|KT_ECDSA;/* Get RSA and ECDSA keys by default */ int hash_hosts = 0; /* Hash hostname on output */ From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 19:01:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B36151065689; Mon, 25 Jun 2012 19:01:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD6BF8FC1A; Mon, 25 Jun 2012 19:01:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PJ146i089890; Mon, 25 Jun 2012 19:01:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PJ14DB089886; Mon, 25 Jun 2012 19:01:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206251901.q5PJ14DB089886@svn.freebsd.org> From: Xin LI Date: Mon, 25 Jun 2012 19:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237568 - head/crypto/openssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 19:01:05 -0000 Author: delphij Date: Mon Jun 25 19:01:04 2012 New Revision: 237568 URL: http://svn.freebsd.org/changeset/base/237568 Log: MFV (r237567): Fetch both ECDSA and RSA keys by default in ssh-keyscan(1). Approved by: des Obtained from: OpenSSH portable MFC after: 1 week Modified: head/crypto/openssh/ssh-keyscan.1 head/crypto/openssh/ssh-keyscan.c Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/ssh-keyscan.1 ============================================================================== --- head/crypto/openssh/ssh-keyscan.1 Mon Jun 25 18:54:02 2012 (r237567) +++ head/crypto/openssh/ssh-keyscan.1 Mon Jun 25 19:01:04 2012 (r237568) @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-keyscan.1,v 1.29 2010/08/31 11:54:45 djm Exp $ +.\" $OpenBSD: ssh-keyscan.1,v 1.30 2012/04/11 13:34:17 djm Exp $ .\" $FreeBSD$ .\" .\" Copyright 1995, 1996 by David Mazieres . @@ -7,7 +7,7 @@ .\" permitted provided that due credit is given to the author and the .\" OpenBSD project by leaving this copyright notice intact. .\" -.Dd August 31, 2010 +.Dd April 11 2012 .Dt SSH-KEYSCAN 1 .Os .Sh NAME @@ -95,8 +95,11 @@ or .Dq rsa for protocol version 2. Multiple values may be specified by separating them with commas. -The default is -.Dq rsa . +The default is to fetch +.Dq rsa +and +.Dq ecdsa +keys. .It Fl v Verbose mode. Causes Modified: head/crypto/openssh/ssh-keyscan.c ============================================================================== --- head/crypto/openssh/ssh-keyscan.c Mon Jun 25 18:54:02 2012 (r237567) +++ head/crypto/openssh/ssh-keyscan.c Mon Jun 25 19:01:04 2012 (r237568) @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keyscan.c,v 1.85 2011/03/15 10:36:02 okan Exp $ */ +/* $OpenBSD: ssh-keyscan.c,v 1.86 2012/04/11 13:34:17 djm Exp $ */ /* * Copyright 1995, 1996 by David Mazieres . * @@ -57,7 +57,7 @@ int ssh_port = SSH_DEFAULT_PORT; #define KT_RSA 4 #define KT_ECDSA 8 -int get_keytypes = KT_RSA; /* Get only RSA keys by default */ +int get_keytypes = KT_RSA|KT_ECDSA;/* Get RSA and ECDSA keys by default */ int hash_hosts = 0; /* Hash hostname on output */ From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 19:13:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 73E7E1065672; Mon, 25 Jun 2012 19:13:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D5558FC08; Mon, 25 Jun 2012 19:13:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PJDiLA090431; Mon, 25 Jun 2012 19:13:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PJDihX090427; Mon, 25 Jun 2012 19:13:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201206251913.q5PJDihX090427@svn.freebsd.org> From: Michael Tuexen Date: Mon, 25 Jun 2012 19:13: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: r237569 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 19:13:44 -0000 Author: tuexen Date: Mon Jun 25 19:13:43 2012 New Revision: 237569 URL: http://svn.freebsd.org/changeset/base/237569 Log: Unify sctp_input() and sctp6_input(). MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Jun 25 19:01:04 2012 (r237568) +++ head/sys/netinet/sctp_input.c Mon Jun 25 19:13:43 2012 (r237569) @@ -5885,12 +5885,12 @@ sctp_input_with_port(struct mbuf *i_pak, uint8_t ecn_bits; struct ip *ip; struct sctphdr *sh; + struct sctp_chunkhdr *ch; struct sctp_inpcb *inp = NULL; - struct sctp_nets *net; struct sctp_tcb *stcb = NULL; - struct sctp_chunkhdr *ch; + struct sctp_nets *net = NULL; int refcount_up = 0; - int length, mlen, offset; + int length, offset; uint32_t mflowid; uint8_t use_mflowid; @@ -5899,19 +5899,12 @@ sctp_input_with_port(struct mbuf *i_pak, #endif + iphlen = off; if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { SCTP_RELEASE_PKT(i_pak); return; } - mlen = SCTP_HEADER_LEN(i_pak); - iphlen = off; m = SCTP_HEADER_TO_CHAIN(i_pak); - - net = NULL; - SCTP_STAT_INCR(sctps_recvpackets); - SCTP_STAT_INCR_COUNTER64(sctps_inpackets); - - #ifdef SCTP_MBUF_LOGGING /* Log in any input mbufs */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { @@ -5925,8 +5918,9 @@ sctp_input_with_port(struct mbuf *i_pak, } #endif #ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { sctp_packet_log(m); + } #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; @@ -5935,17 +5929,11 @@ sctp_input_with_port(struct mbuf *i_pak, mflowid = 0; use_mflowid = 0; } - /* - * Must take out the iphlen, since mlen expects this (only effect lb - * case) - */ - mlen -= iphlen; - - /* - * Get IP, SCTP, and first chunk header together in first mbuf. - */ + SCTP_STAT_INCR(sctps_recvpackets); + SCTP_STAT_INCR_COUNTER64(sctps_inpackets); + /* Get IP, SCTP, and first chunk header together in the first mbuf. */ ip = mtod(m, struct ip *); - offset = iphlen + sizeof(*sh) + sizeof(*ch); + offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); if (SCTP_BUF_LEN(m) < offset) { if ((m = m_pullup(m, offset)) == 0) { SCTP_STAT_INCR(sctps_hdrops); @@ -5953,28 +5941,26 @@ sctp_input_with_port(struct mbuf *i_pak, } ip = mtod(m, struct ip *); } - /* validate mbuf chain length with IP payload length */ - if (mlen < (SCTP_GET_IPV4_LENGTH(ip) - iphlen)) { + sh = (struct sctphdr *)((caddr_t)ip + iphlen); + ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); + offset -= sizeof(struct sctp_chunkhdr); + length = ip->ip_len + iphlen; + /* Validate mbuf chain length with IP payload length. */ + if (SCTP_HEADER_LEN(i_pak) != length) { + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(i_pak)); SCTP_STAT_INCR(sctps_hdrops); goto bad; } - sh = (struct sctphdr *)((caddr_t)ip + iphlen); - ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(*sh)); - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d iphlen:%d\n", mlen, iphlen); - /* SCTP does not allow broadcasts or multicasts */ if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { goto bad; } if (SCTP_IS_IT_BROADCAST(ip->ip_dst, m)) { - /* - * We only look at broadcast if its a front state, All - * others we will not have a tcb for anyway. - */ goto bad; } - /* validate SCTP checksum */ + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp_input() length:%d iphlen:%d\n", length, iphlen); SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", m->m_pkthdr.len, @@ -5985,21 +5971,18 @@ sctp_input_with_port(struct mbuf *i_pak, #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum_4; + goto sctp_skip_csum; } - check = sh->checksum; /* save incoming checksum */ - sh->checksum = 0; /* prepare for calc */ + check = sh->checksum; + sh->checksum = 0; calc_check = sctp_calculate_cksum(m, iphlen); sh->checksum = check; SCTP_STAT_INCR(sctps_recvswcrc); if (calc_check != check) { SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, mlen, iphlen); - - stcb = sctp_findassociation_addr(m, - offset - sizeof(*ch), - sh, ch, &inp, &net, - vrf_id); + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -6013,7 +5996,7 @@ sctp_input_with_port(struct mbuf *i_pak, #endif } if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, mlen + iphlen, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; @@ -6022,18 +6005,14 @@ sctp_input_with_port(struct mbuf *i_pak, SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); goto bad; } -sctp_skip_csum_4: +sctp_skip_csum: #endif /* destination port of 0 is illegal, based on RFC2960. */ if (sh->dest_port == 0) { SCTP_STAT_INCR(sctps_hdrops); goto bad; } - /* - * Locate pcb and tcb for datagram sctp_findassociation_addr() wants - * IP/SCTP/first chunk header... - */ - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), + stcb = sctp_findassociation_addr(m, offset, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6047,27 +6026,10 @@ sctp_skip_csum_4: net->flowidset = 1; #endif } - /* inp's ref-count increased && stcb locked */ if (inp == NULL) { - struct sctp_init_chunk *init_chk, chunk_buf; - SCTP_STAT_INCR(sctps_noport); if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) goto bad; - SCTPDBG(SCTP_DEBUG_INPUT1, - "Sending a ABORT from packet entry!\n"); - if (ch->chunk_type == SCTP_INITIATION) { - /* - * we do a trick here to get the INIT tag, dig in - * and get the tag from the INIT and put it in the - * common header. - */ - init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m, - iphlen + sizeof(*sh), sizeof(*init_chk), - (uint8_t *) & chunk_buf); - if (init_chk != NULL) - sh->v_tag = init_chk->init.initiate_tag; - } if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { sctp_send_shutdown_complete2(m, sh, use_mflowid, mflowid, @@ -6091,7 +6053,7 @@ sctp_skip_csum_4: refcount_up = 1; } #ifdef IPSEC - /* + /*- * I very much doubt any of the IPSEC stuff will work but I have no * idea, so I will leave it in place. */ @@ -6100,28 +6062,22 @@ sctp_skip_csum_4: SCTP_STAT_INCR(sctps_hdrops); goto bad; } -#endif /* IPSEC */ - - /* - * common chunk processing - */ - length = ip->ip_len + iphlen; - offset -= sizeof(struct sctp_chunkhdr); +#endif ecn_bits = ip->ip_tos; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); - /* inp's ref-count reduced && stcb unlocked */ if (m) { sctp_m_freem(m); } if ((inp) && (refcount_up)) { /* reduce ref-count */ + SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } return; bad: @@ -6130,7 +6086,9 @@ bad: } if ((inp) && (refcount_up)) { /* reduce ref-count */ + SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } if (m) { sctp_m_freem(m); Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Mon Jun 25 19:01:04 2012 (r237568) +++ head/sys/netinet6/sctp6_usrreq.c Mon Jun 25 19:13:43 2012 (r237569) @@ -68,22 +68,17 @@ int sctp6_input(struct mbuf **i_pak, int *offp, int proto) { struct mbuf *m; + int iphlen; + uint32_t vrf_id = 0; + uint8_t ecn_bits; struct ip6_hdr *ip6; struct sctphdr *sh; - struct sctp_inpcb *in6p = NULL; - struct sctp_nets *net; - int refcount_up = 0; - uint32_t vrf_id = 0; - -#ifdef IPSEC - struct inpcb *in6p_ip; - -#endif struct sctp_chunkhdr *ch; - int length, offset, iphlen; - uint8_t ecn_bits; + struct sctp_inpcb *inp = NULL; struct sctp_tcb *stcb = NULL; - int pkt_len = 0; + struct sctp_nets *net = NULL; + int refcount_up = 0; + int length, offset; uint32_t mflowid; uint8_t use_mflowid; @@ -91,17 +86,26 @@ sctp6_input(struct mbuf **i_pak, int *of uint32_t check, calc_check; #endif - int off = *offp; uint16_t port = 0; - /* get the VRF and table id's */ + iphlen = *offp; if (SCTP_GET_PKT_VRFID(*i_pak, vrf_id)) { SCTP_RELEASE_PKT(*i_pak); - return (-1); + return (IPPROTO_DONE); } m = SCTP_HEADER_TO_CHAIN(*i_pak); - pkt_len = SCTP_HEADER_LEN(*i_pak); - +#ifdef SCTP_MBUF_LOGGING + /* Log in any input mbufs */ + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { + struct mbuf *mat; + + for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { + if (SCTP_BUF_IS_EXTENDED(mat)) { + sctp_log_mb(mat, SCTP_MBUF_INPUT); + } + } + } +#endif #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { sctp_packet_log(m); @@ -114,42 +118,38 @@ sctp6_input(struct mbuf **i_pak, int *of mflowid = 0; use_mflowid = 0; } + SCTP_STAT_INCR(sctps_recvpackets); + SCTP_STAT_INCR_COUNTER64(sctps_inpackets); + /* Get IP, SCTP, and first chunk header together in the first mbuf. */ ip6 = mtod(m, struct ip6_hdr *); - /* Ensure that (sctphdr + sctp_chunkhdr) in a row. */ - IP6_EXTHDR_GET(sh, struct sctphdr *, m, off, - (int)(sizeof(*sh) + sizeof(*ch))); + offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); + IP6_EXTHDR_GET(sh, struct sctphdr *, m, iphlen, + (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); if (sh == NULL) { SCTP_STAT_INCR(sctps_hdrops); return (IPPROTO_DONE); } ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); - iphlen = off; - offset = iphlen + sizeof(*sh) + sizeof(*ch); - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d iphlen:%d\n", pkt_len, iphlen); - - -#if defined(NFAITH) && NFAITH > 0 - + offset -= sizeof(struct sctp_chunkhdr); if (faithprefix_p != NULL && (*faithprefix_p) (&ip6->ip6_dst)) { /* XXX send icmp6 host/port unreach? */ goto bad; } -#endif /* NFAITH defined and > 0 */ - SCTP_STAT_INCR(sctps_recvpackets); - SCTP_STAT_INCR_COUNTER64(sctps_inpackets); - SCTPDBG(SCTP_DEBUG_INPUT1, "V6 input gets a packet iphlen:%d pktlen:%d\n", - iphlen, pkt_len); - if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - /* No multi-cast support in SCTP */ + length = ntohs(ip6->ip6_plen) + iphlen; + /* Validate mbuf chain length with IP payload length. */ + if (SCTP_HEADER_LEN(*i_pak) != length) { + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(*i_pak)); + SCTP_STAT_INCR(sctps_hdrops); goto bad; } - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) + if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { goto bad; - + } + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp6_input() length:%d iphlen:%d\n", length, iphlen); SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", m->m_pkthdr.len, if_name(m->m_pkthdr.rcvif), m->m_pkthdr.csum_flags); @@ -160,15 +160,16 @@ sctp6_input(struct mbuf **i_pak, int *of SCTP_STAT_INCR(sctps_recvhwcrc); goto sctp_skip_csum; } - check = sh->checksum; /* save incoming checksum */ - sh->checksum = 0; /* prepare for calc */ + check = sh->checksum; + sh->checksum = 0; calc_check = sctp_calculate_cksum(m, iphlen); + sh->checksum = check; SCTP_STAT_INCR(sctps_recvswcrc); if (calc_check != check) { - SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p phlen:%d\n", - calc_check, check, m, iphlen); - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), - sh, ch, &in6p, &net, vrf_id); + SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -181,28 +182,25 @@ sctp6_input(struct mbuf **i_pak, int *of net->flowidset = 1; #endif } - /* in6p's ref-count increased && stcb locked */ - if ((in6p) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, pkt_len, iphlen, 1); - sctp_chunk_output((struct sctp_inpcb *)in6p, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((in6p != NULL) && (stcb == NULL)) { + if ((inp) && (stcb)) { + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); + } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; } SCTP_STAT_INCR(sctps_badsum); SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); goto bad; } - sh->checksum = calc_check; - sctp_skip_csum: #endif - net = NULL; - /* - * Locate pcb and tcb for datagram sctp_findassociation_addr() wants - * IP/SCTP/first chunk header... - */ - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), - sh, ch, &in6p, &net, vrf_id); + /* destination port of 0 is illegal, based on RFC2960. */ + if (sh->dest_port == 0) { + SCTP_STAT_INCR(sctps_hdrops); + goto bad; + } + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -215,25 +213,10 @@ sctp_skip_csum: net->flowidset = 1; #endif } - /* in6p's ref-count increased */ - if (in6p == NULL) { - struct sctp_init_chunk *init_chk, chunk_buf; - + if (inp == NULL) { SCTP_STAT_INCR(sctps_noport); - if (ch->chunk_type == SCTP_INITIATION) { - /* - * we do a trick here to get the INIT tag, dig in - * and get the tag from the INIT and put it in the - * common header. - */ - init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m, - iphlen + sizeof(*sh), sizeof(*init_chk), - (uint8_t *) & chunk_buf); - if (init_chk) - sh->v_tag = init_chk->init.initiate_tag; - else - sh->v_tag = 0; - } + if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) + goto bad; if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { sctp_send_shutdown_complete2(m, sh, use_mflowid, mflowid, @@ -257,55 +240,46 @@ sctp_skip_csum: refcount_up = 1; } #ifdef IPSEC - /* - * Check AH/ESP integrity. + /*- + * I very much doubt any of the IPSEC stuff will work but I have no + * idea, so I will leave it in place. */ - in6p_ip = (struct inpcb *)in6p; - if (in6p_ip && (ipsec6_in_reject(m, in6p_ip))) { -/* XXX */ + if (inp && ipsec6_in_reject(m, &inp->ip_inp.inp)) { MODULE_GLOBAL(ipsec6stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); goto bad; } -#endif /* IPSEC */ +#endif - /* - * CONTROL chunk processing - */ - offset -= sizeof(*ch); ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); - - /* Length now holds the total packet length payload + iphlen */ - length = ntohs(ip6->ip6_plen) + iphlen; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, - in6p, stcb, net, ecn_bits, + inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); - /* inp's ref-count reduced && stcb unlocked */ - /* XXX this stuff below gets moved to appropriate parts later... */ - if (m) + if (m) { sctp_m_freem(m); - if ((in6p) && refcount_up) { + } + if ((inp) && (refcount_up)) { /* reduce ref-count */ - SCTP_INP_WLOCK(in6p); - SCTP_INP_DECR_REF(in6p); - SCTP_INP_WUNLOCK(in6p); + SCTP_INP_WLOCK(inp); + SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } return (IPPROTO_DONE); - bad: if (stcb) { SCTP_TCB_UNLOCK(stcb); } - if ((in6p) && refcount_up) { + if ((inp) && (refcount_up)) { /* reduce ref-count */ - SCTP_INP_WLOCK(in6p); - SCTP_INP_DECR_REF(in6p); - SCTP_INP_WUNLOCK(in6p); + SCTP_INP_WLOCK(inp); + SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } - if (m) + if (m) { sctp_m_freem(m); + } return (IPPROTO_DONE); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 20:56:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BB91106566C; Mon, 25 Jun 2012 20:56:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F09988FC0C; Mon, 25 Jun 2012 20:56:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PKuWT1094974; Mon, 25 Jun 2012 20:56:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PKuW6M094972; Mon, 25 Jun 2012 20:56:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206252056.q5PKuW6M094972@svn.freebsd.org> From: Xin LI Date: Mon, 25 Jun 2012 20:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237571 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 20:56:33 -0000 Author: delphij Date: Mon Jun 25 20:56:32 2012 New Revision: 237571 URL: http://svn.freebsd.org/changeset/base/237571 Log: Fix a LOR acquiring the if_afdata lock while holding an rtentry lock. Possibly do some entra work in case we would not get into the ifa0 != NULL paths later as we already do for the mltaddr before. XXX We should possibly error in case in6_setscope fails. Reference: http://lists.freebsd.org/pipermail/freebsd-net/2011-September/029829.html Submitted by: bz MFC after: 1 week Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Jun 25 19:59:08 2012 (r237570) +++ head/sys/netinet6/in6.c Mon Jun 25 20:56:32 2012 (r237571) @@ -1330,6 +1330,7 @@ in6_purgeaddr_mc(struct ifnet *ifp, stru struct sockaddr_in6 mltaddr, mltmask; struct in6_multi_mship *imm; struct rtentry *rt; + struct sockaddr_in6 sin6; int error; /* @@ -1356,6 +1357,19 @@ in6_purgeaddr_mc(struct ifnet *ifp, stru if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != 0) return (error); + /* + * As for the mltaddr above, proactively prepare the sin6 to avoid + * rtentry un- and re-locking. + */ + if (ifa0 != NULL) { + bzero(&sin6, sizeof(sin6)); + sin6.sin6_len = sizeof(sin6); + sin6.sin6_family = AF_INET6; + memcpy(&sin6.sin6_addr, &satosin6(ifa0->ifa_addr)->sin6_addr, + sizeof(sin6.sin6_addr)); + in6_setscope(&sin6.sin6_addr, ifa0->ifa_ifp, NULL); + } + rt = in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, RT_DEFAULT_FIB); if (rt != NULL && rt->rt_gateway != NULL && (memcmp(&satosin6(rt->rt_gateway)->sin6_addr, @@ -1382,15 +1396,7 @@ in6_purgeaddr_mc(struct ifnet *ifp, stru /* * Replace the gateway of the route. */ - struct sockaddr_in6 sa; - - bzero(&sa, sizeof(sa)); - sa.sin6_len = sizeof(struct sockaddr_in6); - sa.sin6_family = AF_INET6; - memcpy(&sa.sin6_addr, &satosin6(ifa0->ifa_addr)->sin6_addr, - sizeof(sa.sin6_addr)); - in6_setscope(&sa.sin6_addr, ifa0->ifa_ifp, NULL); - memcpy(rt->rt_gateway, &sa, sizeof(sa)); + memcpy(rt->rt_gateway, &sin6, sizeof(sin6)); RTFREE_LOCKED(rt); } } else { @@ -1432,15 +1438,7 @@ in6_purgeaddr_mc(struct ifnet *ifp, stru /* * Replace the gateway of the route. */ - struct sockaddr_in6 sa; - - bzero(&sa, sizeof(sa)); - sa.sin6_len = sizeof(struct sockaddr_in6); - sa.sin6_family = AF_INET6; - memcpy(&sa.sin6_addr, &satosin6(ifa0->ifa_addr)->sin6_addr, - sizeof(sa.sin6_addr)); - in6_setscope(&sa.sin6_addr, ifa0->ifa_ifp, NULL); - memcpy(rt->rt_gateway, &sa, sizeof(sa)); + memcpy(rt->rt_gateway, &sin6, sizeof(sin6)); RTFREE_LOCKED(rt); } } else { From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 21:33:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C1BF5106564A; Mon, 25 Jun 2012 21:33:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 930468FC08; Mon, 25 Jun 2012 21:33:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PLXj1s096535; Mon, 25 Jun 2012 21:33:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PLXjsY096533; Mon, 25 Jun 2012 21:33:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206252133.q5PLXjsY096533@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 25 Jun 2012 21:33: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: r237572 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 21:33:45 -0000 Author: trasz Date: Mon Jun 25 21:33:45 2012 New Revision: 237572 URL: http://svn.freebsd.org/changeset/base/237572 Log: Add missing MLINKS for whatever -> if_whatever. Reviewed by: brueffer MFC after: 1 week Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Jun 25 20:56:32 2012 (r237571) +++ head/share/man/man4/Makefile Mon Jun 25 21:33:45 2012 (r237572) @@ -547,8 +547,11 @@ MAN= aac.4 \ MLINKS= ae.4 if_ae.4 MLINKS+=age.4 if_age.4 MLINKS+=agp.4 agpgart.4 +MLINKS+=alc.4 if_alc.4 MLINKS+=ale.4 if_ale.4 MLINKS+=altq.4 ALTQ.4 +MLINKS+=ath.4 if_ath.4 +MLINKS+=ath_pci.4 if_ath_pci.4 MLINKS+=an.4 if_an.4 MLINKS+=aue.4 if_aue.4 MLINKS+=axe.4 if_axe.4 @@ -558,9 +561,13 @@ MLINKS+=bge.4 if_bge.4 MLINKS+=bktr.4 brooktree.4 MLINKS+=bridge.4 if_bridge.4 MLINKS+=bwi.4 if_bwi.4 +MLINKS+=bwn.4 if_bwn.4 MLINKS+=cas.4 if_cas.4 +MLINKS+=cdce.4 if_cdce.4 MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 +MLINKS+=cxgb.4 if_cxgb.4 +MLINKS+=cxgbe.4 if_cxgbe.4 MLINKS+=dc.4 if_dc.4 MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 @@ -606,14 +613,19 @@ MLINKS+=ixgbe.4 if_ixgbe.4 MLINKS+=jme.4 if_jme.4 MLINKS+=kue.4 if_kue.4 MLINKS+=lagg.4 trunk.4 +MLINKS+=lagg.4 if_lagg.4 MLINKS+=le.4 if_le.4 MLINKS+=lge.4 if_lge.4 +MLINKS+=lmc.4 if_lmc.4 MLINKS+=lo.4 loop.4 MLINKS+=lp.4 plip.4 MLINKS+=malo.4 if_malo.4 MLINKS+=md.4 vn.4 MLINKS+=mem.4 kmem.4 MLINKS+=mn.4 if_mn.4 +MLINKS+=mos.4 if_mos.4 +MLINKS+=msk.4 if_msk.4 +MLINKS+=mwl.4 if_mwl.4 MLINKS+=mxge.4 if_mxge.4 MLINKS+=my.4 if_my.4 MLINKS+=${_ndis.4} ${_if_ndis.4} @@ -633,11 +645,13 @@ MLINKS+=re.4 if_re.4 MLINKS+=rl.4 if_rl.4 MLINKS+=rue.4 if_rue.4 MLINKS+=rum.4 if_rum.4 +MLINKS+=run.4 if_run.4 MLINKS+=scsi.4 CAM.4 \ scsi.4 cam.4 \ scsi.4 scbus.4 \ scsi.4 SCSI.4 MLINKS+=sf.4 if_sf.4 +MLINKS+=sge.4 if_sge.4 MLINKS+=sis.4 if_sis.4 MLINKS+=sk.4 if_sk.4 MLINKS+=smp.4 SMP.4 @@ -669,6 +683,7 @@ MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 +MLINKS+=vte.4 if_vte.4 MLINKS+=${_vtnet.4} ${_if_vtnet.4} MLINKS+=${_vxge.4} ${_if_vxge.4} MLINKS+=watchdog.4 SW_WATCHDOG.4 @@ -749,6 +764,9 @@ MLINKS+=lindev.4 full.4 .if ${MACHINE_CPUARCH} == "amd64" _qlxgb.4= qlxgb.4 _sfxge.4= sfxge.4 + +MLINKS+=qlxgb.4 if_qlxgb.4 +MLINKS+=sfxge.4 if_sfxge.4 .endif .if ${MACHINE_CPUARCH} == "powerpc" From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 21:37:51 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEF79106566B; Mon, 25 Jun 2012 21:37:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2360A8FC15; Mon, 25 Jun 2012 21:37:51 +0000 (UTC) Message-ID: <4FE8DA2E.2060209@FreeBSD.org> Date: Mon, 25 Jun 2012 17:37:50 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120612 Thunderbird/13.0 MIME-Version: 1.0 To: Ruslan Bukin References: <201206220040.q5M0ejNk045397@svn.freebsd.org> <20120622095847.GC2337@deviant.kiev.zoral.com.ua> <4FE494FA.1030907@FreeBSD.org> <20120624181348.GA54897@jail.io> In-Reply-To: <20120624181348.GA54897@jail.io> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237412 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/components/disa... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 21:37:51 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-06-24 14:13:48 -0400, Ruslan Bukin wrote: > On Fri, Jun 22, 2012 at 11:53:30AM -0400, Jung-uk Kim wrote: >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >> >> On 2012-06-22 05:58:47 -0400, Konstantin Belousov wrote: >>> On Fri, Jun 22, 2012 at 12:40:45AM +0000, Jung-uk Kim wrote: >>>> Author: jkim Date: Fri Jun 22 00:40:44 2012 New Revision: >>>> 237412 URL: http://svn.freebsd.org/changeset/base/237412 >>>> >>>> Log: Merge ACPICA 20120620. >>> >>> I think it is caused by import, malloc is called while spinlock >>> is held: >>> >>> ACPI: Executed 1 blocks of module-level executable AML code >>> acpi0: Power Button (fixed) panic: blockable sleep lock (sleep >>> mutex) 16 @ >>> /usr/home/kostik/work/build/bsd/DEV/src/sys/vm/uma_core.c:2040 >>> cpuid = 0 KDB: stack backtrace: db_trace_self_wrapper() at >>> 0xffffffff80279d0a = db_trace_self_wrapper+0x2a panic() at >>> 0xffffffff80325a28 = panic+0x1d8 witness_checkorder() at >>> 0xffffffff80377938 = witness_checkorder+0x1d8 _mtx_lock_flags() >>> at 0xffffffff80313777 = _mtx_lock_flags+0x87 uma_zalloc_arg() >>> at 0xffffffff804db97a = uma_zalloc_arg+0x2ea malloc() at >>> 0xffffffff8030f7cd = malloc+0xbd AcpiUtAllocate() at >>> 0xffffffff802704f1 = AcpiUtAllocate+0x31 AcpiUtAllocateZeroed() >>> at 0xffffffff80270559 = AcpiUtAllocateZeroed+0x19 >>> AcpiSetupGpeForWake() at 0xffffffff8025becc = >>> AcpiSetupGpeForWake+0xfc acpi_probe_child() at >>> 0xffffffff802848e9 = acpi_probe_child+0x2b9 >>> AcpiNsWalkNamespace() at 0xffffffff802686ef = >>> AcpiNsWalkNamespace+0x15f AcpiWalkNamespace() at >>> 0xffffffff80268c0f = AcpiWalkNamespace+0xbf acpi_attach() at >>> 0xffffffff80283e43 = acpi_attach+0x993 device_attach() at >>> 0xffffffff8035ab62 = device_attach+0x72 bus_generic_attach() >>> at 0xffffffff8035bd3a = bus_generic_attach+0x1a >>> nexus_acpi_attach() at 0xffffffff804fbd89 = >>> nexus_acpi_attach+0x69 device_attach() at 0xffffffff8035ab62 = >>> device_attach+0x72 bus_generic_new_pass() at 0xffffffff8035bf46 >>> = bus_generic_new_pass+0xd6 bus_set_pass() at >>> 0xffffffff803597ba = bus_set_pass+0x7a configure() at >>> 0xffffffff804fd51a = configure+0xa mi_startup() at >>> 0xffffffff802d5c17 = mi_startup+0x77 btext() at >>> 0xffffffff802531cc = btext+0x2c KDB: enter: panic [ thread pid >>> 0 tid 100000 ] Stopped at 0xffffffff8035fffb = >>> kdb_enter+0x3b: movq $0,0x1027d62(%rip) db> show alllocks >>> Process 0 (kernel) thread 0xffffffff80837cc0 (100000) exclusive >>> sleep mutex Giant (Giant) r = 0 (0xffffffff8133a900) locked @ >>> /usr/home/kostik/work/build/bsd/DEV/src/sys/kern/kern_module.c:116 >>> exclusive spin mutex ACPI lock (0xfffffe000321da80) (ACPI >>> lock (0xfffffe000321da80)) r = 0 (0xfffffe000321da80) locked @ >>> /usr/home/kostik/work/build/bsd/DEV/src/sys/dev/acpica/Osd/OsdSynch.c:535 >> >> >>> Hmm... >>> >> I was afraid it might happen. I'll look into it ASAP. >> >> Sorry for the trouble, >> > > I have the same problem on server & laptop > > -Ruslan . > I submitted this patch and I am waiting for confirmation: http://people.freebsd.org/~jkim/evxfgpe.diff Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/o2i4ACgkQmlay1b9qnVOQxwCcDkT6IRp7BhI0OqC2drumJ7wP R3kAoISjm6sEyxQ6TF6hbgNxv9JA07Xe =ityD -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 21:51:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D83791065673; Mon, 25 Jun 2012 21:51:40 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8F998FC08; Mon, 25 Jun 2012 21:51:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PLpech097385; Mon, 25 Jun 2012 21:51:40 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PLpeX3097379; Mon, 25 Jun 2012 21:51:40 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201206252151.q5PLpeX3097379@svn.freebsd.org> From: Isabell Long Date: Mon, 25 Jun 2012 21:51: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: r237573 - in head/lib/libc: stdlib stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 21:51:41 -0000 Author: issyl0 (doc committer) Date: Mon Jun 25 21:51:40 2012 New Revision: 237573 URL: http://svn.freebsd.org/changeset/base/237573 Log: Add more locale-specific functions to the relevant man pages and Makefiles: - libc/stdtime/strftime.3 - libc/stdtime/strptime.3 - libc/stdlib/strfmon.3 Reviewed by: theraven Approved by: gabor (mentor) Modified: head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/strfmon.3 head/lib/libc/stdtime/Makefile.inc head/lib/libc/stdtime/strftime.3 head/lib/libc/stdtime/strptime.3 Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Mon Jun 25 21:33:45 2012 (r237572) +++ head/lib/libc/stdlib/Makefile.inc Mon Jun 25 21:51:40 2012 (r237573) @@ -42,6 +42,7 @@ MLINKS+=rand.3 rand_r.3 rand.3 srand.3 r MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \ random.3 srandomdev.3 MLINKS+=radixsort.3 sradixsort.3 +MLINKS+=strfmon.3 strfmon_l.3 MLINKS+=strtod.3 strtof.3 strtod.3 strtold.3 MLINKS+=strtol.3 strtoll.3 strtol.3 strtoq.3 strtol.3 strtoimax.3 MLINKS+=strtoul.3 strtoull.3 strtoul.3 strtouq.3 strtoul.3 strtoumax.3 Modified: head/lib/libc/stdlib/strfmon.3 ============================================================================== --- head/lib/libc/stdlib/strfmon.3 Mon Jun 25 21:33:45 2012 (r237572) +++ head/lib/libc/stdlib/strfmon.3 Mon Jun 25 21:51:40 2012 (r237573) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2002 +.Dd June 25, 2012 .Dt STRFMON 3 .Os .Sh NAME @@ -36,6 +36,8 @@ .In monetary.h .Ft ssize_t .Fn strfmon "char * restrict s" "size_t maxsize" "const char * restrict format" "..." +.Ft ssize_t +.Fn strfmon_l "char * restrict s" "size_t maxsize" "locale_t loc" "const char * restrict format" "..." .Sh DESCRIPTION The .Fn strfmon @@ -47,6 +49,12 @@ No more than .Fa maxsize bytes are placed into the array. .Pp +The +.Fn strfmon_l +function does the same as +.Fn strfmon +but takes an explicit locale rather than using the current locale. +.Pp The format string is composed of zero or more directives: ordinary characters (not .Cm % ) , @@ -129,6 +137,11 @@ the contents of the array are indetermin and .Va errno is set to indicate the error. +.Pp +The +.Fn strfmon_l +function returns the same values as +.Fn strfmon . .Sh ERRORS The .Fn strfmon @@ -149,6 +162,10 @@ The function conforms to .St -p1003.1-2001 . +The +.Fn strfmon_l +function conforms to +.St -p1003.1-2008 . .Sh AUTHORS .An -nosplit The Modified: head/lib/libc/stdtime/Makefile.inc ============================================================================== --- head/lib/libc/stdtime/Makefile.inc Mon Jun 25 21:33:45 2012 (r237572) +++ head/lib/libc/stdtime/Makefile.inc Mon Jun 25 21:51:40 2012 (r237573) @@ -18,4 +18,6 @@ MLINKS+=ctime.3 asctime.3 ctime.3 diffti ctime.3 localtime.3 ctime.3 mktime.3 ctime.3 timegm.3 \ ctime.3 ctime_r.3 ctime.3 localtime_r.3 ctime.3 gmtime_r.3 \ ctime.3 asctime_r.3 +MLINKS+=strftime.3 strftime_l.3 +MLINKS+=strptime.3 strptime_l.3 MLINKS+=time2posix.3 posix2time.3 Modified: head/lib/libc/stdtime/strftime.3 ============================================================================== --- head/lib/libc/stdtime/strftime.3 Mon Jun 25 21:33:45 2012 (r237572) +++ head/lib/libc/stdtime/strftime.3 Mon Jun 25 21:51:40 2012 (r237573) @@ -32,7 +32,7 @@ .\" @(#)strftime.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 4, 2004 +.Dd June 25, 2012 .Dt STRFTIME 3 .Os .Sh NAME @@ -49,6 +49,8 @@ .Fa "const char * restrict format" .Fa "const struct tm * restrict timeptr" .Fc +.Ft size_t +.Fn strftime_l "char *restrict buf" "size_t maxsize" "const char * restrict format" "const struct tm *restrict timeptr" "locale_t loc" .Sh DESCRIPTION The .Fn strftime @@ -58,6 +60,11 @@ into the buffer .Fa buf according to the string pointed to by .Fa format . +The function +.Fn strftime_l +does the same as +.Fn strftime +but takes an explicit locale rather than using the current locale. .Pp The .Fa format @@ -268,6 +275,10 @@ The peculiar week number and year in the and .Ql \&%V are defined in ISO 8601: 1988. +The +.Fn strftime_l +function conforms to +.St -p1003.1-2008 . .Sh BUGS There is no conversion specification for the phase of the moon. .Pp Modified: head/lib/libc/stdtime/strptime.3 ============================================================================== --- head/lib/libc/stdtime/strptime.3 Mon Jun 25 21:33:45 2012 (r237572) +++ head/lib/libc/stdtime/strptime.3 Mon Jun 25 21:51:40 2012 (r237573) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" " -.Dd January 4, 2003 +.Dd June 25, 2012 .Dt STRPTIME 3 .Os .Sh NAME @@ -41,6 +41,10 @@ .Fa "const char * restrict format" .Fa "struct tm * restrict timeptr" .Fc +.In time.h +.In xlocale.h +.Ft char * +.Fn strptime_l "const char * restrict buf" "const char * restrict format" "struct tm * restrict timeptr" "locale_t loc" .Sh DESCRIPTION The .Fn strptime @@ -53,6 +57,11 @@ and fills in the elements of the structu The resulting values will be relative to the local time zone. Thus, it can be considered the reverse operation of .Xr strftime 3 . +The +.Fn strptime_l +function does the same as +.Fn strptime , +but takes an explicit locale rather than using the current locale. .Pp The .Fa format @@ -104,6 +113,9 @@ that has not been required to satisfy th It returns .Dv NULL if one of the conversions failed. +.Fn strptime_l +returns the same values as +.Fn strptime . .Sh SEE ALSO .Xr date 1 , .Xr scanf 3 , From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 21:56:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75810106566C; Mon, 25 Jun 2012 21:56:37 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4692D8FC1C; Mon, 25 Jun 2012 21:56:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PLubwB097619; Mon, 25 Jun 2012 21:56:37 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PLub35097616; Mon, 25 Jun 2012 21:56:37 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206252156.q5PLub35097616@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 25 Jun 2012 21:56: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: r237574 - in head: share/mk usr.sbin/crunch/crunchgen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 21:56:37 -0000 Author: obrien Date: Mon Jun 25 21:56:36 2012 New Revision: 237574 URL: http://svn.freebsd.org/changeset/base/237574 Log: Ensure crunchen uses the same make binary as the rest of the build. Submitted by: Simon Gerraty Modified: head/share/mk/bsd.crunchgen.mk head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Mon Jun 25 21:51:40 2012 (r237573) +++ head/share/mk/bsd.crunchgen.mk Mon Jun 25 21:56:36 2012 (r237574) @@ -105,7 +105,7 @@ $(CONF): Makefile .MAKEFLAGS:= ${.MAKEFLAGS:N-P} .ORDER: $(OUTPUTS) objs $(OUTPUTS): $(CONF) - MAKEOBJDIRPREFIX=${CRUNCHOBJS} crunchgen -fq -m $(OUTMK) \ + MAKE=${MAKE} MAKEOBJDIRPREFIX=${CRUNCHOBJS} crunchgen -fq -m $(OUTMK) \ -c $(OUTC) $(CONF) $(PROG): $(OUTPUTS) objs Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Mon Jun 25 21:51:40 2012 (r237573) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Mon Jun 25 21:56:36 2012 (r237574) @@ -92,6 +92,7 @@ char outmkname[MAXPATHLEN], outcfname[MA char tempfname[MAXPATHLEN], cachename[MAXPATHLEN], curfilename[MAXPATHLEN]; char outhdrname[MAXPATHLEN] ; /* user-supplied header for *.mk */ char *objprefix; /* where are the objects ? */ +char *path_make; int linenum = -1; int goterror = 0; @@ -127,6 +128,10 @@ int main(int argc, char **argv) readcache = 1; *outmkname = *outcfname = *execfname = '\0'; + path_make = getenv("MAKE"); + if (path_make == NULL || *path_make == '\0') + path_make = "make"; + p = getenv("MAKEOBJDIRPREFIX"); if (p == NULL || *p == '\0') objprefix = "/usr/obj"; /* default */ @@ -599,7 +604,8 @@ void gen_outputs(void) gen_output_makefile(); status(""); fprintf(stderr, - "Run \"make -f %s\" to build crunched binary.\n", outmkname); + "Run \"%s -f %s\" to build crunched binary.\n", + path_make, outmkname); } /* @@ -720,16 +726,16 @@ void fillin_program_objs(prog_t *p, char fprintf(f, "loop:\n\t@echo 'OBJS= '${%s}\n", objvar); fprintf(f, "crunchgen_objs:\n" - "\t@cd %s && make -f %s $(BUILDOPTS) $(%s_OPTS)", - p->srcdir, tempfname, p->ident); + "\t@cd %s && %s -f %s $(BUILDOPTS) $(%s_OPTS)", + p->srcdir, path_make, tempfname, p->ident); for (s = p->buildopts; s != NULL; s = s->next) fprintf(f, " %s", s->str); fprintf(f, " loop\n"); fclose(f); - snprintf(line, MAXLINELEN, "cd %s && make -f %s -B crunchgen_objs", - p->srcdir, tempfname); + snprintf(line, MAXLINELEN, "cd %s && %s -f %s -B crunchgen_objs", + p->srcdir, path_make, tempfname); if ((f = popen(line, "r")) == NULL) { warn("submake pipe"); goterror = 1; From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 22:05:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BDF271065673 for ; Mon, 25 Jun 2012 22:05:09 +0000 (UTC) (envelope-from isabell@issyl0.co.uk) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id DD1178FC12 for ; Mon, 25 Jun 2012 22:05:00 +0000 (UTC) Received: by eeke49 with SMTP id e49so1771950eek.13 for ; Mon, 25 Jun 2012 15:04:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-gm-message-state; bh=W/OyNE19F0FokFuS6+f+zeNLFowyHDzLDsTVdF7yDsY=; b=iDY3eT1KB00YfZvEhAvSelWXjbuWOoeYonYf8iAn0Sy3qZp+ZMUOOGKbRargmjcm9G Dp0nJOy4udjYXCacn6m2eNbJinvHGOoJrR8vsNz1O/sbON7Ewedu5N1Bk1diHR6DjNPO lXPPZXAAEjt5N/d8+idJqhI00LH1U8JDYTCYXrglz7vIwmUA6OSBCWCC9bDFHUXhRYe1 GWe/NAvY7qwhtc/C0Qd82d4C8ZMId/1opEATMfxzvjrwyoGKaO0dPoTHUMqzjIOZXtJo 30rvSxcChiZGYMRbtHnyieNj38czw3hCpGvP7zeb96ai0vOYlpcZNQ05ZX948/z+pxlI wzJw== Received: by 10.14.48.71 with SMTP id u47mr2611661eeb.205.1340661898955; Mon, 25 Jun 2012 15:04:58 -0700 (PDT) Received: from sky.issyl0.co.uk ([2001:ba8:1f1:f1f0::2]) by mx.google.com with ESMTPS id x52sm142837058eea.11.2012.06.25.15.04.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jun 2012 15:04:58 -0700 (PDT) Sender: Isabell Long Date: Mon, 25 Jun 2012 23:04:55 +0100 From: Isabell Long To: Isabell Long Message-ID: <20120625220455.GB1449@sky.issyl0.co.uk> References: <201206252151.q5PLpeX3097379@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201206252151.q5PLpeX3097379@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Gm-Message-State: ALoCoQld9+JnyZF5kIZq59KgV/vQH7khdDKXqoiig+mZJBG+Ck0i71HbdzBy3K3UAgzeHjdL9P94 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237573 - in head/lib/libc: stdlib stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 22:05:09 -0000 On Mon, Jun 25, 2012 at 09:51:40PM +0000, Isabell Long wrote: > Author: issyl0 (doc committer) > Date: Mon Jun 25 21:51:40 2012 > New Revision: 237573 > URL: http://svn.freebsd.org/changeset/base/237573 > > Log: > Add more locale-specific functions to the relevant man pages and > Makefiles: > - libc/stdtime/strftime.3 > - libc/stdtime/strptime.3 > - libc/stdlib/strfmon.3 I forgot to add the MFC time! 5 days. :-) From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 22:20:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4D28106564A; Mon, 25 Jun 2012 22:20:52 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDAA28FC1C; Mon, 25 Jun 2012 22:20:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PMKq4g099013; Mon, 25 Jun 2012 22:20:52 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PMKq3a098991; Mon, 25 Jun 2012 22:20:52 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206252220.q5PMKq3a098991@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 25 Jun 2012 22:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237578 - in vendor/NetBSD/bmake/dist: . unit-tests X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 22:20:53 -0000 Author: obrien Date: Mon Jun 25 22:20:51 2012 New Revision: 237578 URL: http://svn.freebsd.org/changeset/base/237578 Log: Import the 20-June-2012 release of the "Portable" BSD make tool (from NetBSD). Submitted by: sjg@juniper.net Added: vendor/NetBSD/bmake/dist/unit-tests/forloop Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/FILES vendor/NetBSD/bmake/dist/Makefile.in vendor/NetBSD/bmake/dist/arch.c vendor/NetBSD/bmake/dist/bsd.after-import.mk vendor/NetBSD/bmake/dist/compat.c vendor/NetBSD/bmake/dist/cond.c vendor/NetBSD/bmake/dist/configure vendor/NetBSD/bmake/dist/configure.in vendor/NetBSD/bmake/dist/dir.c vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/make.c vendor/NetBSD/bmake/dist/make.h vendor/NetBSD/bmake/dist/make_malloc.c vendor/NetBSD/bmake/dist/nonints.h vendor/NetBSD/bmake/dist/parse.c vendor/NetBSD/bmake/dist/targ.c vendor/NetBSD/bmake/dist/unit-tests/Makefile.in vendor/NetBSD/bmake/dist/unit-tests/test.exp vendor/NetBSD/bmake/dist/var.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/ChangeLog Mon Jun 25 22:20:51 2012 (r237578) @@ -1,3 +1,24 @@ +2012-06-20 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120620 + Merge with NetBSD make, pick up + o make_malloc.c: avoid including make_malloc.h again + + * Makefile.in: avoid bmake only syntax or protect with + .if defined(.MAKE.LEVEL) + * bsd.after-import.mk: replace .-include with .sinclude + ensure? SRCTOP gets a value + * configure.in: look for filemon.h in /usr/include/dev/filemon first. + +2012-06-19 Simon J. Gerraty + + * Makefile.in (MAKE_VERSION): bump version to 20120612 + Merge with NetBSD make, pick up + o use MAKE_ATTR_* rather than those defined by cdefs.h or compiler + for greater portability. + o unit-tests/forloop: check that .for works as expected wrt + number of times and with "quoted strings". + 2012-06-06 Simon J. Gerraty * Makefile.in (MAKE_VERSION): bump version to 20120606 Modified: vendor/NetBSD/bmake/dist/FILES ============================================================================== --- vendor/NetBSD/bmake/dist/FILES Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/FILES Mon Jun 25 22:20:51 2012 (r237578) @@ -100,6 +100,7 @@ unit-tests/dotwait unit-tests/error unit-tests/export unit-tests/export-all +unit-tests/forloop unit-tests/forsubst unit-tests/hash unit-tests/misc Modified: vendor/NetBSD/bmake/dist/Makefile.in ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile.in Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/Makefile.in Mon Jun 25 22:20:51 2012 (r237578) @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.56 2012/05/30 21:54:23 sjg Exp $ # @(#)Makefile 5.2 (Berkeley) 12/28/90 -# $Id: Makefile.in,v 1.161 2012/06/06 20:02:32 sjg Exp $ +# $Id: Makefile.in,v 1.164 2012/06/20 22:44:26 sjg Exp $ PROG= bmake SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \ @@ -21,7 +21,7 @@ srcdir= @srcdir@ CC?= @CC@ # Base version on src date -MAKE_VERSION= 20120606 +MAKE_VERSION= 20120620 MACHINE=@machine@ MACHINE_ARCH=@machine_arch@ DEFAULT_SYS_PATH = @default_sys_path@ @@ -40,7 +40,7 @@ SRCS+= ${LIBOBJS:T:.o=.c} .endif USE_META ?= @use_meta@ -.if ${USE_META:tl} != "no" +.if ${USE_META} != "no" SRCS+= meta.c CPPFLAGS+= -DUSE_META FILEMON_H ?= @filemon_h@ @@ -83,9 +83,11 @@ SRCS+= sigcompat.c CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART .endif .endif +.if defined(.MAKE.LEVEL) .if make(obj) || make(clean) SUBDIR+= unit-tests .endif +.endif # many systems use gcc these days CC_IS_GCC=@GCC@ @@ -132,9 +134,11 @@ _mfromdir=${srcdir} # sigh, FreeBSD at least includes bsd.subdir.mk via bsd.obj.mk # so the inclusion below, results in complaints about re-defined # targets. For NetBSD though we need to explicitly include it. +.if defined(.MAKE.LEVEL) .if defined(SUBDIR) && !target(${SUBDIR:[1]}) .-include .endif +.endif CPPFLAGS+= -DMAKE_NATIVE COPTS.var.c += -Wno-cast-qual Modified: vendor/NetBSD/bmake/dist/arch.c ============================================================================== --- vendor/NetBSD/bmake/dist/arch.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/arch.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.62 2010/11/27 16:00:09 christos Exp $ */ +/* $NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.62 2010/11/27 16:00:09 christos Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.62 2010/11/27 16:00:09 christos Exp $"); +__RCSID("$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -1077,7 +1077,7 @@ Arch_Touch(GNode *gn) */ void #if !defined(RANLIBMAG) -Arch_TouchLib(GNode *gn __unused) +Arch_TouchLib(GNode *gn MAKE_ATTR_UNUSED) #else Arch_TouchLib(GNode *gn) #endif Modified: vendor/NetBSD/bmake/dist/bsd.after-import.mk ============================================================================== --- vendor/NetBSD/bmake/dist/bsd.after-import.mk Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/bsd.after-import.mk Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -# $Id: bsd.after-import.mk,v 1.3 2012/06/06 17:48:14 sjg Exp $ +# $Id: bsd.after-import.mk,v 1.5 2012/06/20 22:45:07 sjg Exp $ # This makefile is for use when integrating bmake into a BSD build # system. Use this makefile after importing bmake. @@ -13,12 +13,24 @@ all: ${.CURDIR}/Makefile all: after-import # we rely on bmake +.if !defined(.MAKE.LEVEL) +.error this makefile requires bmake +.endif + _this := ${MAKEFILE:tA} BMAKE_SRC := ${.PARSEDIR} # it helps to know where the top of the tree is. .if !defined(SRCTOP) srctop := ${.MAKE.MAKEFILES:M*src/share/mk/sys.mk:H:H:H} +.if empty(srctop) +# likely locations? +.for d in contrib/bmake external/bsd/bmake/dist +.if ${BMAKE_SRC:M*/$d} != "" +srctop := ${BMAKE_SRC:tA:S,/$d,,} +.endif +.endfor +.endif .if !empty(srctop) SRCTOP := ${srctop} .endif @@ -47,6 +59,7 @@ bootstrap: ${BMAKE_SRC}/boot-strap ${MAK # Makefiles need a little more tweaking than say config.h MAKEFILE_SED = sed -e '/^MACHINE/d' \ -e '/^PROG/s,bmake,${.CURDIR:T},' \ + -e 's,^.-include,.sinclude,' \ -e 's,${SRCTOP},$${SRCTOP},g' # These are the simple files we want to capture @@ -55,11 +68,13 @@ configured_files= config.h unit-tests/Ma after-import: bootstrap ${MAKEFILE} .for f in ${configured_files:N*Makefile} @echo Capturing $f + @mkdir -p ${${.CURDIR}/$f:L:H} @cmp -s ${.CURDIR}/$f ${HOST_OS}/$f || \ cp ${HOST_OS}/$f ${.CURDIR}/$f .endfor .for f in ${configured_files:M*Makefile} @echo Capturing $f + @mkdir -p ${${.CURDIR}/$f:L:H} @${MAKEFILE_SED} ${HOST_OS}/$f > ${.CURDIR}/$f .endfor @@ -68,6 +83,8 @@ ${.CURDIR}/Makefile: bootstrap ${MAKEFIL @echo Generating ${.TARGET:T} @(echo '# This is a generated file, do NOT edit!'; \ echo '# See ${_this:S,${SRCTOP}/,,}'; \ + echo '#'; echo '# $$${OS}$$'; echo; \ + echo 'SRCTOP?= $${.CURDIR:${.CURDIR:S,${SRCTOP}/,,:C,[^/]+,H,g:S,/,:,g}}'; echo; \ echo; echo '# look here first for config.h'; \ echo 'CFLAGS+= -I$${.CURDIR}'; echo; \ ${MAKEFILE_SED} ${HOST_OS}/Makefile; \ @@ -79,7 +96,7 @@ ${.CURDIR}/Makefile: bootstrap ${MAKEFIL echo 'CLEANFILES+= bootstrap'; \ echo; echo 'after-import: ${_this:S,${SRCTOP},\${SRCTOP},}'; \ echo ' cd $${.CURDIR} && $${.MAKE} -f ${_this:S,${SRCTOP},\${SRCTOP},}'; \ - echo; echo '.-include "Makefile.inc"'; \ + echo; echo '.sinclude "Makefile.inc"'; \ echo ) > ${.TARGET:T}.new @mv ${.TARGET:T}.new ${.TARGET} Modified: vendor/NetBSD/bmake/dist/compat.c ============================================================================== --- vendor/NetBSD/bmake/dist/compat.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/compat.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.88 2012/06/05 17:31:04 sjg Exp $ */ +/* $NetBSD: compat.c,v 1.89 2012/06/10 21:44:01 wiz Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.88 2012/06/05 17:31:04 sjg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.89 2012/06/10 21:44:01 wiz Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.88 2012/06/05 17:31:04 sjg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.89 2012/06/10 21:44:01 wiz Exp $"); #endif #endif /* not lint */ #endif @@ -124,7 +124,7 @@ static char meta[256]; static GNode *curTarg = NULL; static GNode *ENDNode; -static void CompatInterrupt(int) __dead; +static void CompatInterrupt(int); static void Compat_Init(void) Modified: vendor/NetBSD/bmake/dist/cond.c ============================================================================== --- vendor/NetBSD/bmake/dist/cond.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/cond.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $ */ +/* $NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $"; +static char rcsid[] = "$NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $"); +__RCSID("$NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -327,7 +327,7 @@ CondGetArg(char **linePtr, char **argPtr *----------------------------------------------------------------------- */ static Boolean -CondDoDefined(int argLen __unused, const char *arg) +CondDoDefined(int argLen MAKE_ATTR_UNUSED, const char *arg) { char *p1; Boolean result; @@ -376,7 +376,7 @@ CondStrMatch(const void *string, const v *----------------------------------------------------------------------- */ static Boolean -CondDoMake(int argLen __unused, const char *arg) +CondDoMake(int argLen MAKE_ATTR_UNUSED, const char *arg) { return Lst_Find(create, arg, CondStrMatch) != NULL; } @@ -395,7 +395,7 @@ CondDoMake(int argLen __unused, const ch *----------------------------------------------------------------------- */ static Boolean -CondDoExists(int argLen __unused, const char *arg) +CondDoExists(int argLen MAKE_ATTR_UNUSED, const char *arg) { Boolean result; char *path; @@ -428,7 +428,7 @@ CondDoExists(int argLen __unused, const *----------------------------------------------------------------------- */ static Boolean -CondDoTarget(int argLen __unused, const char *arg) +CondDoTarget(int argLen MAKE_ATTR_UNUSED, const char *arg) { GNode *gn; @@ -452,7 +452,7 @@ CondDoTarget(int argLen __unused, const *----------------------------------------------------------------------- */ static Boolean -CondDoCommands(int argLen __unused, const char *arg) +CondDoCommands(int argLen MAKE_ATTR_UNUSED, const char *arg) { GNode *gn; @@ -790,7 +790,7 @@ done: } static int -get_mpt_arg(char **linePtr, char **argPtr, const char *func __unused) +get_mpt_arg(char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSED) { /* * Use Var_Parse to parse the spec in parens and return @@ -831,7 +831,7 @@ get_mpt_arg(char **linePtr, char **argPt } static Boolean -CondDoEmpty(int arglen, const char *arg __unused) +CondDoEmpty(int arglen, const char *arg MAKE_ATTR_UNUSED) { return arglen == 1; } Modified: vendor/NetBSD/bmake/dist/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/NetBSD/bmake/dist/configure.in ============================================================================== --- vendor/NetBSD/bmake/dist/configure.in Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/configure.in Mon Jun 25 22:20:51 2012 (r237578) @@ -1,10 +1,10 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.44 2012/06/06 17:48:14 sjg Exp $ +dnl $Id: configure.in,v 1.45 2012/06/20 22:43:41 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl -AC_INIT([bmake], [20120606], [sjg@NetBSD.org]) +AC_INIT([bmake], [20120620], [sjg@NetBSD.org]) AC_CONFIG_HEADER(config.h) dnl @@ -39,7 +39,7 @@ AC_ARG_WITH(filemon, esac], [ OS=`uname -s` -for d in "$srcdir/filemon" "$srcdir/../filemon" "$srcdir/../../sys/dev/filemon" +for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/filemon" "$srcdir/../filemon" "$srcdir/../../sys/dev/filemon" do for x in "/$OS" "" do Modified: vendor/NetBSD/bmake/dist/dir.c ============================================================================== --- vendor/NetBSD/bmake/dist/dir.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/dir.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.64 2012/04/07 18:29:08 christos Exp $ */ +/* $NetBSD: dir.c,v 1.65 2012/06/12 19:21:50 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.64 2012/04/07 18:29:08 christos Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.65 2012/06/12 19:21:50 joerg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.64 2012/04/07 18:29:08 christos Exp $"); +__RCSID("$NetBSD: dir.c,v 1.65 2012/06/12 19:21:50 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -860,8 +860,8 @@ Dir_Expand(const char *word, Lst path, L *----------------------------------------------------------------------- */ static char * -DirLookup(Path *p, const char *name __unused, const char *cp, - Boolean hasSlash __unused) +DirLookup(Path *p, const char *name MAKE_ATTR_UNUSED, const char *cp, + Boolean hasSlash MAKE_ATTR_UNUSED) { char *file; /* the current filename to check */ @@ -1004,7 +1004,7 @@ DirLookupAbs(Path *p, const char *name, *----------------------------------------------------------------------- */ static char * -DirFindDot(Boolean hasSlash __unused, const char *name, const char *cp) +DirFindDot(Boolean hasSlash MAKE_ATTR_UNUSED, const char *name, const char *cp) { if (Hash_FindEntry(&dot->files, cp) != NULL) { Modified: vendor/NetBSD/bmake/dist/job.c ============================================================================== --- vendor/NetBSD/bmake/dist/job.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/job.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.161 2012/04/07 18:29:08 christos Exp $ */ +/* $NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.161 2012/04/07 18:29:08 christos Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.161 2012/04/07 18:29:08 christos Exp $"); +__RCSID("$NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -365,7 +365,7 @@ static int JobStart(GNode *, int); static char *JobOutput(Job *, char *, char *, int); static void JobDoOutput(Job *, Boolean); static Shell *JobMatchShell(const char *); -static void JobInterrupt(int, int) __dead; +static void JobInterrupt(int, int) MAKE_ATTR_DEAD; static void JobRestartJobs(void); static void JobTokenAdd(void); static void JobSigLock(sigset_t *); @@ -488,7 +488,7 @@ JobCondPassSig(int signo) *----------------------------------------------------------------------- */ static void -JobChildSig(int signo __unused) +JobChildSig(int signo MAKE_ATTR_UNUSED) { write(childExitJob.outPipe, CHILD_EXIT, 1); } @@ -511,7 +511,7 @@ JobChildSig(int signo __unused) *----------------------------------------------------------------------- */ static void -JobContinueSig(int signo __unused) +JobContinueSig(int signo MAKE_ATTR_UNUSED) { /* * Defer sending to SIGCONT to our stopped children until we return @@ -536,14 +536,14 @@ JobContinueSig(int signo __unused) * *----------------------------------------------------------------------- */ -__dead static void +MAKE_ATTR_DEAD static void JobPassSig_int(int signo) { /* Run .INTERRUPT target then exit */ JobInterrupt(TRUE, signo); } -__dead static void +MAKE_ATTR_DEAD static void JobPassSig_term(int signo) { /* Dont run .INTERRUPT target then exit */ Modified: vendor/NetBSD/bmake/dist/main.c ============================================================================== --- vendor/NetBSD/bmake/dist/main.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/main.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.199 2012/04/24 20:35:04 sjg Exp $ */ +/* $NetBSD: main.c,v 1.200 2012/06/12 19:21:51 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.199 2012/04/24 20:35:04 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.200 2012/06/12 19:21:51 joerg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.199 2012/04/24 20:35:04 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.200 2012/06/12 19:21:51 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -180,7 +180,7 @@ static char * Check_Cwd_av(int, char ** #endif static void MainParseArgs(int, char **); static int ReadMakefile(const void *, const void *); -static void usage(void) __dead; +static void usage(void) MAKE_ATTR_DEAD; static Boolean ignorePWD; /* if we use -C, PWD is meaningless */ static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */ @@ -736,7 +736,7 @@ str2Lst_Append(Lst lp, char *str, const #ifdef SIGINFO /*ARGSUSED*/ static void -siginfo(int signo __unused) +siginfo(int signo MAKE_ATTR_UNUSED) { char dir[MAXPATHLEN]; char str[2 * MAXPATHLEN]; @@ -1340,7 +1340,7 @@ main(int argc, char **argv) * lots */ static int -ReadMakefile(const void *p, const void *q __unused) +ReadMakefile(const void *p, const void *q MAKE_ATTR_UNUSED) { const char *fname = p; /* makefile to read */ int fd; Modified: vendor/NetBSD/bmake/dist/make.c ============================================================================== --- vendor/NetBSD/bmake/dist/make.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/make.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.86 2012/05/10 19:53:26 christos Exp $ */ +/* $NetBSD: make.c,v 1.87 2012/06/12 19:21:51 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: make.c,v 1.86 2012/05/10 19:53:26 christos Exp $"; +static char rcsid[] = "$NetBSD: make.c,v 1.87 2012/06/12 19:21:51 joerg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: make.c,v 1.86 2012/05/10 19:53:26 christos Exp $"); +__RCSID("$NetBSD: make.c,v 1.87 2012/06/12 19:21:51 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -139,7 +139,7 @@ static int MakeCheckOrder(void *, void * static int MakeBuildChild(void *, void *); static int MakeBuildParent(void *, void *); -__dead static void +MAKE_ATTR_DEAD static void make_abort(GNode *gn, int line) { static int two = 2; @@ -867,7 +867,7 @@ Make_Update(GNode *cgn) *----------------------------------------------------------------------- */ static int -MakeUnmark(void *cgnp, void *pgnp __unused) +MakeUnmark(void *cgnp, void *pgnp MAKE_ATTR_UNUSED) { GNode *cgn = (GNode *)cgnp; @@ -1005,7 +1005,7 @@ Make_DoAllVar(GNode *gn) */ static int -MakeCheckOrder(void *v_bn, void *ignore __unused) +MakeCheckOrder(void *v_bn, void *ignore MAKE_ATTR_UNUSED) { GNode *bn = v_bn; Modified: vendor/NetBSD/bmake/dist/make.h ============================================================================== --- vendor/NetBSD/bmake/dist/make.h Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/make.h Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.88 2012/06/04 20:34:20 sjg Exp $ */ +/* $NetBSD: make.h,v 1.89 2012/06/12 19:21:51 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -98,26 +98,33 @@ #include #include -#if !defined(__GNUC_PREREQ__) #if defined(__GNUC__) -#define __GNUC_PREREQ__(x, y) \ +#define MAKE_GNUC_PREREQ(x, y) \ ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \ (__GNUC__ > (x))) #else /* defined(__GNUC__) */ -#define __GNUC_PREREQ__(x, y) 0 +#define MAKE_GNUC_PREREQx, y) 0 #endif /* defined(__GNUC__) */ -#endif /* !defined(__GNUC_PREREQ__) */ -#if !defined(__unused) -#if __GNUC_PREREQ__(2, 7) -#define __unused __attribute__((__unused__)) +#if MAKE_GNUC_PREREQ(2, 7) +#define MAKE_ATTR_UNUSED __attribute__((__unused__)) #else -#define __unused /* delete */ +#define MAKE_ATTR_UNUSED /* delete */ #endif + +#if MAKE_GNUC_PREREQ(2, 5) +#define MAKE_ATTR_DEAD __attribute__((__noreturn__)) +#elif defined(__GNUC__) +#define MAKE_ATTR_DEAD __volatile +#else +#define MAKE_ATTR_DEAD /* delete */ #endif -#if !defined(__dead) -#define __dead +#if MAKE_GNUC_PREREQ(2, 7) +#define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg) \ + __attribute__((__format__ (__printf__, fmtarg, firstvararg))) +#else +#define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg) /* delete */ #endif #include "sprite.h" Modified: vendor/NetBSD/bmake/dist/make_malloc.c ============================================================================== --- vendor/NetBSD/bmake/dist/make_malloc.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/make_malloc.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: make_malloc.c,v 1.7 2012/05/18 02:28:16 sjg Exp $ */ +/* $NetBSD: make_malloc.c,v 1.10 2012/06/20 17:46:28 sjg Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #ifdef MAKE_NATIVE #include -__RCSID("$NetBSD: make_malloc.c,v 1.7 2012/05/18 02:28:16 sjg Exp $"); +__RCSID("$NetBSD: make_malloc.c,v 1.10 2012/06/20 17:46:28 sjg Exp $"); #endif #include @@ -36,15 +36,15 @@ __RCSID("$NetBSD: make_malloc.c,v 1.7 20 #include #include -#include "make_malloc.h" +#include "make.h" #ifndef USE_EMALLOC +static void enomem(void) MAKE_ATTR_DEAD; + /* * enomem -- * die when out of memory. */ -extern char *progname; - static void enomem(void) { Modified: vendor/NetBSD/bmake/dist/nonints.h ============================================================================== --- vendor/NetBSD/bmake/dist/nonints.h Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/nonints.h Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.63 2011/09/16 15:38:04 joerg Exp $ */ +/* $NetBSD: nonints.h,v 1.64 2012/06/12 19:21:51 joerg Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -72,11 +72,6 @@ * from: @(#)nonints.h 8.3 (Berkeley) 3/19/94 */ -#ifndef MAKE_NATIVE -#undef __attribute__ -#define __attribute__(x) -#endif - /* arch.c */ ReturnStatus Arch_ParseArchive(char **, Lst, GNode *); void Arch_Touch(GNode *); @@ -116,21 +111,18 @@ void Main_ParseArgLine(const char *); void MakeMode(const char *); int main(int, char **); char *Cmd_Exec(const char *, const char **); -void Error(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); -void Fatal(const char *, ...) - __attribute__((__format__(__printf__, 1, 2),__noreturn__)); -void Punt(const char *, ...) - __attribute__((__format__(__printf__, 1, 2),__noreturn__)); -void DieHorribly(void) __attribute__((__noreturn__)); +void Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2); +void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; +void Punt(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; +void DieHorribly(void) MAKE_ATTR_DEAD; int PrintAddr(void *, void *); -void Finish(int) __dead; +void Finish(int) MAKE_ATTR_DEAD; int eunlink(const char *); void execError(const char *, const char *); char *getTmpdir(void); /* parse.c */ -void Parse_Error(int, const char *, ...) - __attribute__((__format__(__printf__, 2, 3))); +void Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); Boolean Parse_AnyExport(void); Boolean Parse_IsVar(char *); void Parse_DoVar(char *, GNode *); Modified: vendor/NetBSD/bmake/dist/parse.c ============================================================================== --- vendor/NetBSD/bmake/dist/parse.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/parse.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.184 2012/04/24 20:12:16 sjg Exp $ */ +/* $NetBSD: parse.c,v 1.185 2012/06/12 19:21:51 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.184 2012/04/24 20:12:16 sjg Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.185 2012/06/12 19:21:51 joerg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.184 2012/04/24 20:12:16 sjg Exp $"); +__RCSID("$NetBSD: parse.c,v 1.185 2012/06/12 19:21:51 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -347,9 +347,9 @@ static const struct { static int ParseIsEscaped(const char *, const char *); static void ParseErrorInternal(const char *, size_t, int, const char *, ...) - __attribute__((__format__(__printf__, 4, 5))); + MAKE_ATTR_PRINTFLIKE(4,5); static void ParseVErrorInternal(FILE *, const char *, size_t, int, const char *, va_list) - __attribute__((__format__(__printf__, 5, 0))); + MAKE_ATTR_PRINTFLIKE(5, 0); static int ParseFindKeyword(const char *); static int ParseLinkSrc(void *, void *); static int ParseDoOp(void *, void *); Modified: vendor/NetBSD/bmake/dist/targ.c ============================================================================== --- vendor/NetBSD/bmake/dist/targ.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/targ.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: targ.c,v 1.56 2010/11/25 21:31:09 christos Exp $ */ +/* $NetBSD: targ.c,v 1.57 2012/06/12 19:21:51 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: targ.c,v 1.56 2010/11/25 21:31:09 christos Exp $"; +static char rcsid[] = "$NetBSD: targ.c,v 1.57 2012/06/12 19:21:51 joerg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: targ.c,v 1.56 2010/11/25 21:31:09 christos Exp $"); +__RCSID("$NetBSD: targ.c,v 1.57 2012/06/12 19:21:51 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -512,7 +512,7 @@ Targ_SetMain(GNode *gn) } static int -TargPrintName(void *gnp, void *pflags __unused) +TargPrintName(void *gnp, void *pflags MAKE_ATTR_UNUSED) { GNode *gn = (GNode *)gnp; @@ -717,7 +717,7 @@ Targ_PrintNode(void *gnp, void *passp) *----------------------------------------------------------------------- */ static int -TargPrintOnlySrc(void *gnp, void *dummy __unused) +TargPrintOnlySrc(void *gnp, void *dummy MAKE_ATTR_UNUSED) { GNode *gn = (GNode *)gnp; if (!OP_NOP(gn->type)) @@ -790,7 +790,7 @@ Targ_PrintGraph(int pass) *----------------------------------------------------------------------- */ static int -TargPropagateNode(void *gnp, void *junk __unused) +TargPropagateNode(void *gnp, void *junk MAKE_ATTR_UNUSED) { GNode *gn = (GNode *)gnp; Modified: vendor/NetBSD/bmake/dist/unit-tests/Makefile.in ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/Makefile.in Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/unit-tests/Makefile.in Mon Jun 25 22:20:51 2012 (r237578) @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.37 2011/10/01 20:30:30 sjg Exp $ +# $Id: Makefile.in,v 1.38 2012/06/19 23:38:48 sjg Exp $ # -# $NetBSD: Makefile,v 1.33 2011/09/29 23:38:04 sjg Exp $ +# $NetBSD: Makefile,v 1.34 2012/06/19 23:25:53 sjg Exp $ # # Unit tests for make(1) # The main targets are: @@ -30,6 +30,7 @@ SUBFILES= \ export-all \ doterror \ dotwait \ + forloop \ forsubst \ hash \ misc \ Added: vendor/NetBSD/bmake/dist/unit-tests/forloop ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/bmake/dist/unit-tests/forloop Mon Jun 25 22:20:51 2012 (r237578) @@ -0,0 +1,45 @@ +# $Id: forloop,v 1.1.1.1 2012/06/19 23:30:49 sjg Exp $ + +all: for-loop + +LIST = one "two and three" four "five" + +.if make(for-fail) +for-fail: + +XTRA_LIST = xtra +.else + +.for x in ${LIST} +X!= echo 'x=$x' >&2; echo +.endfor + +CFL = -I/this -I"This or that" -Ithat "-DTHIS=\"this and that\"" +cfl= +.for x in ${CFL} +X!= echo 'x=$x' >&2; echo +.if empty(cfl) +cfl= $x +.else +cfl+= $x +.endif +.endfor +X!= echo 'cfl=${cfl}' >&2; echo + +.if ${cfl} != ${CFL} +.error ${.newline}'${cfl}' != ${.newline}'${CFL}' +.endif + +.for a b in ${EMPTY} +X!= echo 'a=$a b=$b' >&2; echo +.endfor +.endif + +.for a b in ${LIST} ${LIST:tu} ${XTRA_LIST} +X!= echo 'a=$a b=$b' >&2; echo +.endfor + +for-loop: + @echo We expect an error next: + @(cd ${.CURDIR} && ${.MAKE} -f ${MAKEFILE} for-fail) && \ + { echo "Oops that should have failed!"; exit 1; } || echo OK Modified: vendor/NetBSD/bmake/dist/unit-tests/test.exp ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/test.exp Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/unit-tests/test.exp Mon Jun 25 22:20:51 2012 (r237578) @@ -80,6 +80,24 @@ make: Graph cycles through `cycle.2.98' make: Graph cycles through `cycle.2.97' cycle.1.99 cycle.1.99 +x=one +x="two and three" +x=four +x="five" +x=-I/this +x=-I"This or that" +x=-Ithat +x="-DTHIS=\"this and that\"" +cfl=-I/this -I"This or that" -Ithat "-DTHIS=\"this and that\"" +a=one b="two and three" +a=four b="five" +a=ONE b="TWO AND THREE" +a=FOUR b="FIVE" +We expect an error next: +make: "forloop" line 38: Wrong number of words (9) in .for substitution list with 2 vars +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +OK .for with :S;... OK b2af338b 3360ac65 Modified: vendor/NetBSD/bmake/dist/var.c ============================================================================== --- vendor/NetBSD/bmake/dist/var.c Mon Jun 25 22:19:20 2012 (r237577) +++ vendor/NetBSD/bmake/dist/var.c Mon Jun 25 22:20:51 2012 (r237578) @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.170 2012/06/04 20:34:20 sjg Exp $ */ +/* $NetBSD: var.c,v 1.171 2012/06/12 19:21:51 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.170 2012/06/04 20:34:20 sjg Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.171 2012/06/12 19:21:51 joerg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.170 2012/06/04 20:34:20 sjg Exp $"); +__RCSID("$NetBSD: var.c,v 1.171 2012/06/12 19:21:51 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -1145,7 +1145,7 @@ Var_Value(const char *name, GNode *ctxt, *----------------------------------------------------------------------- */ static Boolean -VarHead(GNode *ctx __unused, Var_Parse_State *vpstate, +VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate, char *word, Boolean addSpace, Buffer *buf, void *dummy) { @@ -1193,7 +1193,7 @@ VarHead(GNode *ctx __unused, Var_Parse_S *----------------------------------------------------------------------- */ static Boolean -VarTail(GNode *ctx __unused, Var_Parse_State *vpstate, +VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate, char *word, Boolean addSpace, Buffer *buf, void *dummy) { @@ -1235,7 +1235,7 @@ VarTail(GNode *ctx __unused, Var_Parse_S *----------------------------------------------------------------------- */ static Boolean -VarSuffix(GNode *ctx __unused, Var_Parse_State *vpstate, +VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate, char *word, Boolean addSpace, Buffer *buf, void *dummy) { @@ -1276,7 +1276,7 @@ VarSuffix(GNode *ctx __unused, Var_Parse *----------------------------------------------------------------------- */ static Boolean -VarRoot(GNode *ctx __unused, Var_Parse_State *vpstate, +VarRoot(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate, char *word, Boolean addSpace, Buffer *buf, void *dummy) { @@ -1320,7 +1320,7 @@ VarRoot(GNode *ctx __unused, Var_Parse_S *----------------------------------------------------------------------- */ static Boolean -VarMatch(GNode *ctx __unused, Var_Parse_State *vpstate, +VarMatch(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate, char *word, Boolean addSpace, Buffer *buf, void *pattern) { @@ -1411,7 +1411,7 @@ VarSYSVMatch(GNode *ctx, Var_Parse_State *----------------------------------------------------------------------- */ static Boolean -VarNoMatch(GNode *ctx __unused, Var_Parse_State *vpstate, +VarNoMatch(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate, char *word, Boolean addSpace, Buffer *buf, void *pattern) { @@ -1448,7 +1448,7 @@ VarNoMatch(GNode *ctx __unused, Var_Pars *----------------------------------------------------------------------- */ static Boolean -VarSubstitute(GNode *ctx __unused, Var_Parse_State *vpstate, +VarSubstitute(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate, char *word, Boolean addSpace, Buffer *buf, void *patternp) { @@ -1644,7 +1644,8 @@ VarREError(int errnum, regex_t *pat, con *----------------------------------------------------------------------- */ static Boolean -VarRESubstitute(GNode *ctx __unused, Var_Parse_State *vpstate __unused, +VarRESubstitute(GNode *ctx MAKE_ATTR_UNUSED, + Var_Parse_State *vpstate MAKE_ATTR_UNUSED, char *word, Boolean addSpace, Buffer *buf, void *patternp) { @@ -1784,7 +1785,8 @@ VarRESubstitute(GNode *ctx __unused, Var *----------------------------------------------------------------------- */ static Boolean -VarLoopExpand(GNode *ctx __unused, Var_Parse_State *vpstate __unused, +VarLoopExpand(GNode *ctx MAKE_ATTR_UNUSED, + Var_Parse_State *vpstate MAKE_ATTR_UNUSED, char *word, Boolean addSpace, Buffer *buf, void *loopp) { @@ -1827,7 +1829,7 @@ VarLoopExpand(GNode *ctx __unused, Var_P *----------------------------------------------------------------------- */ static char * -VarSelectWords(GNode *ctx __unused, Var_Parse_State *vpstate, +VarSelectWords(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate, const char *str, VarSelectWords_t *seldata) { Buffer buf; /* Buffer for the new string */ @@ -1902,9 +1904,9 @@ VarSelectWords(GNode *ctx __unused, Var_ * if successful. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 22:22:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8254106564A; Mon, 25 Jun 2012 22:22:39 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99DD48FC14; Mon, 25 Jun 2012 22:22:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PMMdLF099161; Mon, 25 Jun 2012 22:22:39 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PMMdE7099160; Mon, 25 Jun 2012 22:22:39 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206252222.q5PMMdE7099160@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 25 Jun 2012 22:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237580 - vendor/NetBSD/bmake/20120620 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 22:22:39 -0000 Author: obrien Date: Mon Jun 25 22:22:39 2012 New Revision: 237580 URL: http://svn.freebsd.org/changeset/base/237580 Log: "Tag" the r237578 Portable BSD make 20-June-2012 import. Added: vendor/NetBSD/bmake/20120620/ - copied from r237578, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 22:39:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8969D106566B; Mon, 25 Jun 2012 22:39:38 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BB2A8FC21; Mon, 25 Jun 2012 22:39:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PMdcID099948; Mon, 25 Jun 2012 22:39:38 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PMdclY099946; Mon, 25 Jun 2012 22:39:38 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201206252239.q5PMdclY099946@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 25 Jun 2012 22:39: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: r237581 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 22:39:38 -0000 Author: bjk (doc committer) Date: Mon Jun 25 22:39:37 2012 New Revision: 237581 URL: http://svn.freebsd.org/changeset/base/237581 Log: Explicitly mention that setting the change and expiry times to zero is equivalent to leaving the time unset. [1] Wordsmith in the compat support section. Use a full path to nologin(8) in the context of setting it as a user's shell, keeping a separate cross-reference. PR: docs/169354 [1] Approved by: hrs (mentor) MFC after: 3 weeks Modified: head/share/man/man5/passwd.5 Modified: head/share/man/man5/passwd.5 ============================================================================== --- head/share/man/man5/passwd.5 Mon Jun 25 22:22:39 2012 (r237580) +++ head/share/man/man5/passwd.5 Mon Jun 25 22:39:37 2012 (r237581) @@ -35,7 +35,7 @@ .\" From: @(#)passwd.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 8, 2007 +.Dd June 23, 2012 .Dt PASSWD 5 .Os .Sh NAME @@ -203,7 +203,8 @@ field is the number of seconds from the .Dv UTC , until the password for the account must be changed. -This field may be left empty to turn off the password aging feature. +This field may be left empty to turn off the password aging feature; +a value of zero is equivalent to leaving the field empty. .Pp The .Ar expire @@ -211,7 +212,8 @@ field is the number of seconds from the .Dv UTC , until the account expires. -This field may be left empty to turn off the account aging feature. +This field may be left empty to turn off the account aging feature; +a value of zero is equivalent to leaving the field empty. .Pp The .Ar gecos @@ -271,7 +273,8 @@ as it is done for system accounts, is to set its .Ar shell to -.Xr nologin 8 . +.Pa /sbin/nologin +.Pq see Xr nologin 8 . .Sh HESIOD SUPPORT If .Sq Li dns @@ -363,7 +366,7 @@ fields, the specified numbers will overr from the Hesiod domain or the .Tn NIS maps. -As well, if the +Likewise, if the .Ar gecos , .Ar dir or @@ -399,7 +402,8 @@ The additional fields .Ar change and .Ar expire -are added, but are turned off by default. +are added, but are turned off by default +.Pq setting these fields to zero is equivalent to leaving them blank . Class is currently not implemented, but change and expire are; to set them, use the current day in seconds from the epoch + whatever number of seconds of offset you want. From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 23:07:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06E0C106566C; Mon, 25 Jun 2012 23:07:19 +0000 (UTC) (envelope-from bjk@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E130C8FC08; Mon, 25 Jun 2012 23:07:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5PN7ITk052611; Mon, 25 Jun 2012 23:07:18 GMT (envelope-from bjk@freebsd.org) Received: from localhost (bjk@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) with ESMTP id q5PN7IeS052608; Mon, 25 Jun 2012 23:07:18 GMT (envelope-from bjk@freebsd.org) X-Authentication-Warning: freefall.freebsd.org: bjk owned process doing -bs Date: Mon, 25 Jun 2012 23:07:18 +0000 (UTC) From: Benjamin Kaduk To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201206252239.q5PMdclY099946@svn.freebsd.org> Message-ID: References: <201206252239.q5PMdclY099946@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: Benjamin Kaduk Subject: Re: svn commit: r237581 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 23:07:19 -0000 On Mon, 25 Jun 2012, Benjamin Kaduk wrote: > Author: bjk (doc committer) > Date: Mon Jun 25 22:39:37 2012 > New Revision: 237581 > URL: http://svn.freebsd.org/changeset/base/237581 > > Log: > Explicitly mention that setting the change and expiry times to zero is > equivalent to leaving the time unset. [1] > > Wordsmith in the compat support section. > > Use a full path to nologin(8) in the context of setting it as a user's shell, > keeping a separate cross-reference. > > PR: docs/169354 [1] > Approved by: hrs (mentor) > MFC after: 3 weeks Due to popular request, I am dropping the MFC timer to 5 days. -Ben From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 23:39:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA4C41065672; Mon, 25 Jun 2012 23:39:35 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4F5A8FC18; Mon, 25 Jun 2012 23:39:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PNdZjw002788; Mon, 25 Jun 2012 23:39:35 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PNdZGA002786; Mon, 25 Jun 2012 23:39:35 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206252339.q5PNdZGA002786@svn.freebsd.org> From: Warren Block Date: Mon, 25 Jun 2012 23:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237584 - stable/9/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 23:39:35 -0000 Author: wblock (doc committer) Date: Mon Jun 25 23:39:35 2012 New Revision: 237584 URL: http://svn.freebsd.org/changeset/base/237584 Log: MFC r225808: Fix grammar. PR: 140457 Submitted by: jeremyhu AT apple.com Approved by: gjb (mentor) Modified: stable/9/lib/libc/locale/isspace.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/locale/isspace.3 ============================================================================== --- stable/9/lib/libc/locale/isspace.3 Mon Jun 25 23:22:43 2012 (r237583) +++ stable/9/lib/libc/locale/isspace.3 Mon Jun 25 23:39:35 2012 (r237584) @@ -47,16 +47,16 @@ .Sh DESCRIPTION The .Fn isspace -function tests for the white-space characters. +function tests for white-space characters. For any locale, this includes the following standard characters: .Pp .Bl -column \&`\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ .It "\&``\et''\t``\en''\t``\ev''\t``\ef''\t``\er''\t`` ''" .El .Pp -In the "C" locale +In the "C" locale, .Fn isspace -successful test is limited to this characters only. +returns non-zero for these characters only. The value of the argument must be representable as an .Vt "unsigned char" or the value of From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 23:40:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6505106566B; Mon, 25 Jun 2012 23:40:19 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A124E8FC0C; Mon, 25 Jun 2012 23:40:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PNeJss002861; Mon, 25 Jun 2012 23:40:19 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PNeJgE002859; Mon, 25 Jun 2012 23:40:19 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206252340.q5PNeJgE002859@svn.freebsd.org> From: Warren Block Date: Mon, 25 Jun 2012 23:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237585 - stable/8/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 23:40:19 -0000 Author: wblock (doc committer) Date: Mon Jun 25 23:40:19 2012 New Revision: 237585 URL: http://svn.freebsd.org/changeset/base/237585 Log: MFC r225808: Fix grammar. PR: 140457 Submitted by: jeremyhu AT apple.com Approved by: gjb (mentor) Modified: stable/8/lib/libc/locale/isspace.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/locale/isspace.3 ============================================================================== --- stable/8/lib/libc/locale/isspace.3 Mon Jun 25 23:39:35 2012 (r237584) +++ stable/8/lib/libc/locale/isspace.3 Mon Jun 25 23:40:19 2012 (r237585) @@ -47,16 +47,16 @@ .Sh DESCRIPTION The .Fn isspace -function tests for the white-space characters. +function tests for white-space characters. For any locale, this includes the following standard characters: .Pp .Bl -column \&`\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ .It "\&``\et''\t``\en''\t``\ev''\t``\ef''\t``\er''\t`` ''" .El .Pp -In the "C" locale +In the "C" locale, .Fn isspace -successful test is limited to this characters only. +returns non-zero for these characters only. The value of the argument must be representable as an .Vt "unsigned char" or the value of From owner-svn-src-all@FreeBSD.ORG Mon Jun 25 23:40:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 898C81065673; Mon, 25 Jun 2012 23:40:58 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EC178FC19; Mon, 25 Jun 2012 23:40:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5PNewgQ002921; Mon, 25 Jun 2012 23:40:58 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5PNewXt002919; Mon, 25 Jun 2012 23:40:58 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206252340.q5PNewXt002919@svn.freebsd.org> From: Warren Block Date: Mon, 25 Jun 2012 23:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237586 - stable/7/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 23:40:58 -0000 Author: wblock (doc committer) Date: Mon Jun 25 23:40:58 2012 New Revision: 237586 URL: http://svn.freebsd.org/changeset/base/237586 Log: MFC r225808: Fix grammar. PR: 140457 Submitted by: jeremyhu AT apple.com Approved by: gjb (mentor) Modified: stable/7/lib/libc/locale/isspace.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/locale/isspace.3 ============================================================================== --- stable/7/lib/libc/locale/isspace.3 Mon Jun 25 23:40:19 2012 (r237585) +++ stable/7/lib/libc/locale/isspace.3 Mon Jun 25 23:40:58 2012 (r237586) @@ -47,16 +47,16 @@ .Sh DESCRIPTION The .Fn isspace -function tests for the white-space characters. +function tests for white-space characters. For any locale, this includes the following standard characters: .Pp .Bl -column \&`\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ .It "\&``\et''\t``\en''\t``\ev''\t``\ef''\t``\er''\t`` ''" .El .Pp -In the "C" locale +In the "C" locale, .Fn isspace -successful test is limited to this characters only. +returns non-zero for these characters only. The value of the argument must be representable as an .Vt "unsigned char" or the value of From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 00:34:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35A1F1065670; Tue, 26 Jun 2012 00:34:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 205488FC0A; Tue, 26 Jun 2012 00:34:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5Q0YYIM005149; Tue, 26 Jun 2012 00:34:34 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5Q0YYlY005146; Tue, 26 Jun 2012 00:34:34 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201206260034.q5Q0YYlY005146@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 26 Jun 2012 00:34: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: r237587 - head/sys/dev/cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 00:34:35 -0000 Author: np Date: Tue Jun 26 00:34:34 2012 New Revision: 237587 URL: http://svn.freebsd.org/changeset/base/237587 Log: Allow cxgbe(4) running within a VM to attach to its devices that have been exported via PCI passthrough. - Do not check for a specific physical function (PF) before claiming a device. Different PFs have different device-ids so this check is redundant anyway. - Obtain the PF# from the WHOAMI register instead of pci_get_function(). - Setup the memory windows using the real BAR0 address, not what the VM says it is. Obtained from: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jun 25 23:40:58 2012 (r237586) +++ head/sys/dev/cxgbe/t4_main.c Tue Jun 26 00:34:34 2012 (r237587) @@ -355,21 +355,20 @@ static int t4_mod_event(module_t, int, v struct t4_pciids { uint16_t device; - uint8_t mpf; char *desc; } t4_pciids[] = { - {0xa000, 0, "Chelsio Terminator 4 FPGA"}, - {0x4400, 4, "Chelsio T440-dbg"}, - {0x4401, 4, "Chelsio T420-CR"}, - {0x4402, 4, "Chelsio T422-CR"}, - {0x4403, 4, "Chelsio T440-CR"}, - {0x4404, 4, "Chelsio T420-BCH"}, - {0x4405, 4, "Chelsio T440-BCH"}, - {0x4406, 4, "Chelsio T440-CH"}, - {0x4407, 4, "Chelsio T420-SO"}, - {0x4408, 4, "Chelsio T420-CX"}, - {0x4409, 4, "Chelsio T420-BT"}, - {0x440a, 4, "Chelsio T404-BT"}, + {0xa000, "Chelsio Terminator 4 FPGA"}, + {0x4400, "Chelsio T440-dbg"}, + {0x4401, "Chelsio T420-CR"}, + {0x4402, "Chelsio T422-CR"}, + {0x4403, "Chelsio T440-CR"}, + {0x4404, "Chelsio T420-BCH"}, + {0x4405, "Chelsio T440-BCH"}, + {0x4406, "Chelsio T440-CH"}, + {0x4407, "Chelsio T420-SO"}, + {0x4408, "Chelsio T420-CX"}, + {0x4409, "Chelsio T420-BT"}, + {0x440a, "Chelsio T404-BT"}, }; #ifdef TCP_OFFLOAD @@ -387,13 +386,17 @@ t4_probe(device_t dev) int i; uint16_t v = pci_get_vendor(dev); uint16_t d = pci_get_device(dev); + uint8_t f = pci_get_function(dev); if (v != PCI_VENDOR_ID_CHELSIO) return (ENXIO); + /* Attach only to PF0 of the FPGA */ + if (d == 0xa000 && f != 0) + return (ENXIO); + for (i = 0; i < ARRAY_SIZE(t4_pciids); i++) { - if (d == t4_pciids[i].device && - pci_get_function(dev) == t4_pciids[i].mpf) { + if (d == t4_pciids[i].device) { device_set_desc(dev, t4_pciids[i].desc); return (BUS_PROBE_DEFAULT); } @@ -415,8 +418,6 @@ t4_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - sc->pf = pci_get_function(dev); - sc->mbox = sc->pf; pci_enable_busmaster(dev); if (pci_find_cap(dev, PCIY_EXPRESS, &i) == 0) { @@ -443,6 +444,15 @@ t4_attach(device_t dev) if (rc != 0) goto done; /* error message displayed already */ + /* + * This is the real PF# to which we're attaching. Works from within PCI + * passthrough environments too, where pci_get_function() could return a + * different PF# depending on the passthrough configuration. We need to + * use the real PF# in all our communication with the firmware. + */ + sc->pf = G_SOURCEPF(t4_read_reg(sc, A_PL_WHOAMI)); + sc->mbox = sc->pf; + memset(sc->chan_map, 0xff, sizeof(sc->chan_map)); sc->an_handler = an_not_handled; for (i = 0; i < ARRAY_SIZE(sc->cpl_handler); i++) @@ -1277,9 +1287,17 @@ map_bars(struct adapter *sc) static void setup_memwin(struct adapter *sc) { - u_long bar0; + uint32_t bar0; - bar0 = rman_get_start(sc->regs_res); + /* + * Read low 32b of bar0 indirectly via the hardware backdoor mechanism. + * Works from within PCI passthrough environments too, where + * rman_get_start() can return a different value. We need to program + * the memory window decoders with the actual addresses that will be + * coming across the PCIe link. + */ + bar0 = t4_hw_pci_read_cfg4(sc, PCIR_BAR(0)); + bar0 &= (uint32_t) PCIM_BAR_MEM_BASE; t4_write_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_BASE_WIN, 0), (bar0 + MEMWIN0_BASE) | V_BIR(0) | @@ -1292,6 +1310,9 @@ setup_memwin(struct adapter *sc) t4_write_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_BASE_WIN, 2), (bar0 + MEMWIN2_BASE) | V_BIR(0) | V_WINDOW(ilog2(MEMWIN2_APERTURE) - 10)); + + /* flush */ + t4_read_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_BASE_WIN, 2)); } static int From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 03:05:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF3EA1065672; Tue, 26 Jun 2012 03:05:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 971C38FC16; Tue, 26 Jun 2012 03:05:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5Q35IA8011357; Tue, 26 Jun 2012 03:05:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5Q35IZ5011345; Tue, 26 Jun 2012 03:05:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206260305.q5Q35IZ5011345@svn.freebsd.org> From: Eitan Adler Date: Tue, 26 Jun 2012 03:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237589 - stable/9/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 03:05:18 -0000 Author: eadler Date: Tue Jun 26 03:05:17 2012 New Revision: 237589 URL: http://svn.freebsd.org/changeset/base/237589 Log: MFC r237259 r237260 r237329: Allow users with RO privilege to the device to read the RO attributes. [0] Add __unused macros to appropriate places in order to allow building with WARNS=6 on base gcc, gcc46, and clang PR: bin/167302 [0] Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/mfiutil/Makefile stable/9/usr.sbin/mfiutil/mfi_cmd.c stable/9/usr.sbin/mfiutil/mfi_config.c stable/9/usr.sbin/mfiutil/mfi_drive.c stable/9/usr.sbin/mfiutil/mfi_evt.c stable/9/usr.sbin/mfiutil/mfi_flash.c stable/9/usr.sbin/mfiutil/mfi_patrol.c stable/9/usr.sbin/mfiutil/mfi_show.c stable/9/usr.sbin/mfiutil/mfi_volume.c stable/9/usr.sbin/mfiutil/mfiutil.c stable/9/usr.sbin/mfiutil/mfiutil.h Directory Properties: stable/9/usr.sbin/mfiutil/ (props changed) Modified: stable/9/usr.sbin/mfiutil/Makefile ============================================================================== --- stable/9/usr.sbin/mfiutil/Makefile Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/Makefile Tue Jun 26 03:05:17 2012 (r237589) @@ -6,7 +6,6 @@ SRCS= mfiutil.c mfi_cmd.c mfi_config.c m MAN8= mfiutil.8 CFLAGS+= -fno-builtin-strftime -WARNS?=3 DPADD= ${LIBUTIL} LDADD= -lutil Modified: stable/9/usr.sbin/mfiutil/mfi_cmd.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_cmd.c Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/mfi_cmd.c Tue Jun 26 03:05:17 2012 (r237589) @@ -301,12 +301,12 @@ mfi_ctrl_get_info(int fd, struct mfi_ctr } int -mfi_open(int unit) +mfi_open(int unit, int acs) { char path[MAXPATHLEN]; snprintf(path, sizeof(path), "/dev/mfi%d", unit); - return (open(path, O_RDWR)); + return (open(path, acs)); } void Modified: stable/9/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_config.c Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/mfi_config.c Tue Jun 26 03:05:17 2012 (r237589) @@ -35,6 +35,7 @@ #endif #include #include +#include #include #ifdef DEBUG #include @@ -151,13 +152,13 @@ mfi_config_lookup_volume(struct mfi_conf } static int -clear_config(int ac, char **av) +clear_config(int ac __unused, char **av __unused) { struct mfi_ld_list list; int ch, error, fd; u_int i; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -410,7 +411,7 @@ find_next_volume(struct config_id_state /* Populate an array with drives. */ static void -build_array(int fd, char *arrayp, struct array_info *array_info, +build_array(int fd __unused, char *arrayp, struct array_info *array_info, struct config_id_state *state, int verbose) { struct mfi_array *ar = (struct mfi_array *)arrayp; @@ -575,7 +576,7 @@ create_volume(int ac, char **av) narrays = 0; error = 0; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -857,7 +858,7 @@ delete_volume(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -925,7 +926,7 @@ add_spare(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -1050,7 +1051,7 @@ remove_spare(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -1196,7 +1197,7 @@ debug_config(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -1233,7 +1234,7 @@ dump(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/9/usr.sbin/mfiutil/mfi_drive.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_drive.c Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/mfi_drive.c Tue Jun 26 03:05:17 2012 (r237589) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -71,7 +72,7 @@ mfi_drive_name(struct mfi_pd_info *pinfo else snprintf(buf, sizeof(buf), "%2u", device_id); - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { warn("mfi_open"); return (buf); @@ -329,11 +330,13 @@ cam_strvis(char *dst, const char *src, i const char * mfi_pd_inq_string(struct mfi_pd_info *info) { - struct scsi_inquiry_data *inq_data; + struct scsi_inquiry_data iqd, *inq_data = &iqd; char vendor[16], product[48], revision[16], rstr[12], serial[SID_VENDOR_SPECIFIC_0_SIZE]; static char inq_string[64]; - inq_data = (struct scsi_inquiry_data *)info->inquiry_data; + memcpy(inq_data, info->inquiry_data, + (sizeof (iqd) < sizeof (info->inquiry_data))? + sizeof (iqd) : sizeof (info->inquiry_data)); if (SID_QUAL_IS_VENDOR_UNIQUE(inq_data)) return (NULL); if (SID_TYPE(inq_data) != T_DIRECT) @@ -383,7 +386,7 @@ drive_set_state(char *drive, uint16_t ne uint8_t mbox[6]; int error, fd; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -484,7 +487,7 @@ start_rebuild(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -541,7 +544,7 @@ abort_rebuild(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -597,7 +600,7 @@ drive_progress(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -663,7 +666,7 @@ drive_clear(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -723,7 +726,7 @@ drive_locate(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/9/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_evt.c Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/mfi_evt.c Tue Jun 26 03:05:17 2012 (r237589) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -63,7 +64,7 @@ mfi_get_events(int fd, struct mfi_evt_li } static int -show_logstate(int ac, char **av) +show_logstate(int ac, char **av __unused) { struct mfi_evt_log_state info; int error, fd; @@ -73,7 +74,7 @@ show_logstate(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -541,7 +542,7 @@ show_events(int ac, char **av) int ch, error, fd, num_events, verbose; u_int i; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/9/usr.sbin/mfiutil/mfi_flash.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_flash.c Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/mfi_flash.c Tue Jun 26 03:05:17 2012 (r237589) @@ -150,7 +150,7 @@ flash_adapter(int ac, char **av) goto error; } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/9/usr.sbin/mfiutil/mfi_patrol.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_patrol.c Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/mfi_patrol.c Tue Jun 26 03:05:17 2012 (r237589) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -74,7 +75,7 @@ patrol_get_props(int fd, struct mfi_pr_p } static int -show_patrol(int ac, char **av) +show_patrol(int ac __unused, char **av __unused) { struct mfi_pr_properties prop; struct mfi_pr_status status; @@ -86,7 +87,7 @@ show_patrol(int ac, char **av) int error, fd; u_int i; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -192,11 +193,11 @@ show_patrol(int ac, char **av) MFI_COMMAND(show, patrol, show_patrol); static int -start_patrol(int ac, char **av) +start_patrol(int ac __unused, char **av __unused) { int error, fd; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -218,11 +219,11 @@ start_patrol(int ac, char **av) MFI_COMMAND(start, patrol, start_patrol); static int -stop_patrol(int ac, char **av) +stop_patrol(int ac __unused, char **av __unused) { int error, fd; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -292,7 +293,7 @@ patrol_config(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/9/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_show.c Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/mfi_show.c Tue Jun 26 03:05:17 2012 (r237589) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -50,7 +51,7 @@ format_stripe(char *buf, size_t buflen, } static int -show_adapter(int ac, char **av) +show_adapter(int ac, char **av __unused) { struct mfi_ctrl_info info; char stripe[5]; @@ -61,7 +62,7 @@ show_adapter(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -135,7 +136,7 @@ show_adapter(int ac, char **av) MFI_COMMAND(show, adapter, show_adapter); static int -show_battery(int ac, char **av) +show_battery(int ac, char **av __unused) { struct mfi_bbu_capacity_info cap; struct mfi_bbu_design_info design; @@ -148,7 +149,7 @@ show_battery(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -303,7 +304,7 @@ print_pd(struct mfi_pd_info *info, int s } static int -show_config(int ac, char **av) +show_config(int ac, char **av __unused) { struct mfi_config_data *config; struct mfi_array *ar; @@ -320,7 +321,7 @@ show_config(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -409,7 +410,7 @@ show_config(int ac, char **av) MFI_COMMAND(show, config, show_config); static int -show_volumes(int ac, char **av) +show_volumes(int ac, char **av __unused) { struct mfi_ld_list list; struct mfi_ld_info info; @@ -421,7 +422,7 @@ show_volumes(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -492,7 +493,7 @@ show_volumes(int ac, char **av) MFI_COMMAND(show, volumes, show_volumes); static int -show_drives(int ac, char **av) +show_drives(int ac, char **av __unused) { struct mfi_pd_list *list; struct mfi_pd_info info; @@ -504,7 +505,7 @@ show_drives(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -600,7 +601,7 @@ display_firmware(struct mfi_info_compone } static int -show_firmware(int ac, char **av) +show_firmware(int ac, char **av __unused) { struct mfi_ctrl_info info; struct mfi_info_component header; @@ -612,7 +613,7 @@ show_firmware(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -656,7 +657,7 @@ show_firmware(int ac, char **av) MFI_COMMAND(show, firmware, show_firmware); static int -show_progress(int ac, char **av) +show_progress(int ac, char **av __unused) { struct mfi_ld_list llist; struct mfi_pd_list *plist; @@ -672,7 +673,7 @@ show_progress(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/9/usr.sbin/mfiutil/mfi_volume.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_volume.c Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/mfi_volume.c Tue Jun 26 03:05:17 2012 (r237589) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -294,7 +295,7 @@ volume_cache(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -402,7 +403,7 @@ volume_name(int ac, char **av) return (ENOSPC); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -453,7 +454,7 @@ volume_progress(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/9/usr.sbin/mfiutil/mfiutil.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfiutil.c Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/mfiutil.c Tue Jun 26 03:05:17 2012 (r237589) @@ -92,10 +92,10 @@ usage(void) } static int -version(int ac, char **av) +version(int ac __unused, char **av __unused) { - printf("mfiutil version 1.0.13"); + printf("mfiutil version 1.0.14"); #ifdef DEBUG printf(" (DEBUG)"); #endif Modified: stable/9/usr.sbin/mfiutil/mfiutil.h ============================================================================== --- stable/9/usr.sbin/mfiutil/mfiutil.h Tue Jun 26 01:32:58 2012 (r237588) +++ stable/9/usr.sbin/mfiutil/mfiutil.h Tue Jun 26 03:05:17 2012 (r237589) @@ -139,7 +139,7 @@ int mfi_lookup_drive(int fd, char *drive int mfi_lookup_volume(int fd, const char *name, uint8_t *target_id); int mfi_dcmd_command(int fd, uint32_t opcode, void *buf, size_t bufsize, uint8_t *mbox, size_t mboxlen, uint8_t *statusp); -int mfi_open(int unit); +int mfi_open(int unit, int acs); int mfi_ctrl_get_info(int fd, struct mfi_ctrl_info *info, uint8_t *statusp); int mfi_ld_get_info(int fd, uint8_t target_id, struct mfi_ld_info *info, uint8_t *statusp); From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 03:05:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0B5510656B4; Tue, 26 Jun 2012 03:05:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A84A38FC17; Tue, 26 Jun 2012 03:05:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5Q35gxN011417; Tue, 26 Jun 2012 03:05:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5Q35g6f011405; Tue, 26 Jun 2012 03:05:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206260305.q5Q35g6f011405@svn.freebsd.org> From: Eitan Adler Date: Tue, 26 Jun 2012 03:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237590 - stable/8/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 03:05:42 -0000 Author: eadler Date: Tue Jun 26 03:05:42 2012 New Revision: 237590 URL: http://svn.freebsd.org/changeset/base/237590 Log: MFC r237259 r237260 r237329: Allow users with RO privilege to the device to read the RO attributes. [0] Add __unused macros to appropriate places in order to allow building with WARNS=6 on base gcc, gcc46, and clang PR: bin/167302 [0] Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/mfiutil/Makefile stable/8/usr.sbin/mfiutil/mfi_cmd.c stable/8/usr.sbin/mfiutil/mfi_config.c stable/8/usr.sbin/mfiutil/mfi_drive.c stable/8/usr.sbin/mfiutil/mfi_evt.c stable/8/usr.sbin/mfiutil/mfi_flash.c stable/8/usr.sbin/mfiutil/mfi_patrol.c stable/8/usr.sbin/mfiutil/mfi_show.c stable/8/usr.sbin/mfiutil/mfi_volume.c stable/8/usr.sbin/mfiutil/mfiutil.c stable/8/usr.sbin/mfiutil/mfiutil.h Directory Properties: stable/8/usr.sbin/mfiutil/ (props changed) Modified: stable/8/usr.sbin/mfiutil/Makefile ============================================================================== --- stable/8/usr.sbin/mfiutil/Makefile Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/Makefile Tue Jun 26 03:05:42 2012 (r237590) @@ -6,7 +6,6 @@ SRCS= mfiutil.c mfi_cmd.c mfi_config.c m MAN8= mfiutil.8 CFLAGS+= -fno-builtin-strftime -WARNS?=3 DPADD= ${LIBUTIL} LDADD= -lutil Modified: stable/8/usr.sbin/mfiutil/mfi_cmd.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_cmd.c Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/mfi_cmd.c Tue Jun 26 03:05:42 2012 (r237590) @@ -301,12 +301,12 @@ mfi_ctrl_get_info(int fd, struct mfi_ctr } int -mfi_open(int unit) +mfi_open(int unit, int acs) { char path[MAXPATHLEN]; snprintf(path, sizeof(path), "/dev/mfi%d", unit); - return (open(path, O_RDWR)); + return (open(path, acs)); } void Modified: stable/8/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_config.c Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/mfi_config.c Tue Jun 26 03:05:42 2012 (r237590) @@ -35,6 +35,7 @@ #endif #include #include +#include #include #ifdef DEBUG #include @@ -151,13 +152,13 @@ mfi_config_lookup_volume(struct mfi_conf } static int -clear_config(int ac, char **av) +clear_config(int ac __unused, char **av __unused) { struct mfi_ld_list list; int ch, error, fd; u_int i; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -410,7 +411,7 @@ find_next_volume(struct config_id_state /* Populate an array with drives. */ static void -build_array(int fd, char *arrayp, struct array_info *array_info, +build_array(int fd __unused, char *arrayp, struct array_info *array_info, struct config_id_state *state, int verbose) { struct mfi_array *ar = (struct mfi_array *)arrayp; @@ -575,7 +576,7 @@ create_volume(int ac, char **av) narrays = 0; error = 0; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -857,7 +858,7 @@ delete_volume(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -925,7 +926,7 @@ add_spare(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -1050,7 +1051,7 @@ remove_spare(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -1196,7 +1197,7 @@ debug_config(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -1233,7 +1234,7 @@ dump(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/8/usr.sbin/mfiutil/mfi_drive.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_drive.c Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/mfi_drive.c Tue Jun 26 03:05:42 2012 (r237590) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -71,7 +72,7 @@ mfi_drive_name(struct mfi_pd_info *pinfo else snprintf(buf, sizeof(buf), "%2u", device_id); - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { warn("mfi_open"); return (buf); @@ -329,11 +330,13 @@ cam_strvis(char *dst, const char *src, i const char * mfi_pd_inq_string(struct mfi_pd_info *info) { - struct scsi_inquiry_data *inq_data; + struct scsi_inquiry_data iqd, *inq_data = &iqd; char vendor[16], product[48], revision[16], rstr[12], serial[SID_VENDOR_SPECIFIC_0_SIZE]; static char inq_string[64]; - inq_data = (struct scsi_inquiry_data *)info->inquiry_data; + memcpy(inq_data, info->inquiry_data, + (sizeof (iqd) < sizeof (info->inquiry_data))? + sizeof (iqd) : sizeof (info->inquiry_data)); if (SID_QUAL_IS_VENDOR_UNIQUE(inq_data)) return (NULL); if (SID_TYPE(inq_data) != T_DIRECT) @@ -383,7 +386,7 @@ drive_set_state(char *drive, uint16_t ne uint8_t mbox[6]; int error, fd; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -484,7 +487,7 @@ start_rebuild(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -541,7 +544,7 @@ abort_rebuild(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -597,7 +600,7 @@ drive_progress(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -663,7 +666,7 @@ drive_clear(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -723,7 +726,7 @@ drive_locate(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/8/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_evt.c Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/mfi_evt.c Tue Jun 26 03:05:42 2012 (r237590) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -63,7 +64,7 @@ mfi_get_events(int fd, struct mfi_evt_li } static int -show_logstate(int ac, char **av) +show_logstate(int ac, char **av __unused) { struct mfi_evt_log_state info; int error, fd; @@ -73,7 +74,7 @@ show_logstate(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -541,7 +542,7 @@ show_events(int ac, char **av) int ch, error, fd, num_events, verbose; u_int i; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/8/usr.sbin/mfiutil/mfi_flash.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_flash.c Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/mfi_flash.c Tue Jun 26 03:05:42 2012 (r237590) @@ -150,7 +150,7 @@ flash_adapter(int ac, char **av) goto error; } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/8/usr.sbin/mfiutil/mfi_patrol.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_patrol.c Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/mfi_patrol.c Tue Jun 26 03:05:42 2012 (r237590) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -74,7 +75,7 @@ patrol_get_props(int fd, struct mfi_pr_p } static int -show_patrol(int ac, char **av) +show_patrol(int ac __unused, char **av __unused) { struct mfi_pr_properties prop; struct mfi_pr_status status; @@ -86,7 +87,7 @@ show_patrol(int ac, char **av) int error, fd; u_int i; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -192,11 +193,11 @@ show_patrol(int ac, char **av) MFI_COMMAND(show, patrol, show_patrol); static int -start_patrol(int ac, char **av) +start_patrol(int ac __unused, char **av __unused) { int error, fd; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -218,11 +219,11 @@ start_patrol(int ac, char **av) MFI_COMMAND(start, patrol, start_patrol); static int -stop_patrol(int ac, char **av) +stop_patrol(int ac __unused, char **av __unused) { int error, fd; - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -293,7 +294,7 @@ patrol_config(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/8/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_show.c Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/mfi_show.c Tue Jun 26 03:05:42 2012 (r237590) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -50,7 +51,7 @@ format_stripe(char *buf, size_t buflen, } static int -show_adapter(int ac, char **av) +show_adapter(int ac, char **av __unused) { struct mfi_ctrl_info info; char stripe[5]; @@ -61,7 +62,7 @@ show_adapter(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -135,7 +136,7 @@ show_adapter(int ac, char **av) MFI_COMMAND(show, adapter, show_adapter); static int -show_battery(int ac, char **av) +show_battery(int ac, char **av __unused) { struct mfi_bbu_capacity_info cap; struct mfi_bbu_design_info design; @@ -148,7 +149,7 @@ show_battery(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -303,7 +304,7 @@ print_pd(struct mfi_pd_info *info, int s } static int -show_config(int ac, char **av) +show_config(int ac, char **av __unused) { struct mfi_config_data *config; struct mfi_array *ar; @@ -320,7 +321,7 @@ show_config(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -409,7 +410,7 @@ show_config(int ac, char **av) MFI_COMMAND(show, config, show_config); static int -show_volumes(int ac, char **av) +show_volumes(int ac, char **av __unused) { struct mfi_ld_list list; struct mfi_ld_info info; @@ -421,7 +422,7 @@ show_volumes(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -492,7 +493,7 @@ show_volumes(int ac, char **av) MFI_COMMAND(show, volumes, show_volumes); static int -show_drives(int ac, char **av) +show_drives(int ac, char **av __unused) { struct mfi_pd_list *list; struct mfi_pd_info info; @@ -504,7 +505,7 @@ show_drives(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -600,7 +601,7 @@ display_firmware(struct mfi_info_compone } static int -show_firmware(int ac, char **av) +show_firmware(int ac, char **av __unused) { struct mfi_ctrl_info info; struct mfi_info_component header; @@ -612,7 +613,7 @@ show_firmware(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); @@ -656,7 +657,7 @@ show_firmware(int ac, char **av) MFI_COMMAND(show, firmware, show_firmware); static int -show_progress(int ac, char **av) +show_progress(int ac, char **av __unused) { struct mfi_ld_list llist; struct mfi_pd_list *plist; @@ -672,7 +673,7 @@ show_progress(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/8/usr.sbin/mfiutil/mfi_volume.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_volume.c Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/mfi_volume.c Tue Jun 26 03:05:42 2012 (r237590) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -294,7 +295,7 @@ volume_cache(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -402,7 +403,7 @@ volume_name(int ac, char **av) return (ENOSPC); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDWR); if (fd < 0) { error = errno; warn("mfi_open"); @@ -453,7 +454,7 @@ volume_progress(int ac, char **av) return (EINVAL); } - fd = mfi_open(mfi_unit); + fd = mfi_open(mfi_unit, O_RDONLY); if (fd < 0) { error = errno; warn("mfi_open"); Modified: stable/8/usr.sbin/mfiutil/mfiutil.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfiutil.c Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/mfiutil.c Tue Jun 26 03:05:42 2012 (r237590) @@ -92,10 +92,10 @@ usage(void) } static int -version(int ac, char **av) +version(int ac __unused, char **av __unused) { - printf("mfiutil version 1.0.13"); + printf("mfiutil version 1.0.14"); #ifdef DEBUG printf(" (DEBUG)"); #endif Modified: stable/8/usr.sbin/mfiutil/mfiutil.h ============================================================================== --- stable/8/usr.sbin/mfiutil/mfiutil.h Tue Jun 26 03:05:17 2012 (r237589) +++ stable/8/usr.sbin/mfiutil/mfiutil.h Tue Jun 26 03:05:42 2012 (r237590) @@ -139,7 +139,7 @@ int mfi_lookup_drive(int fd, char *drive int mfi_lookup_volume(int fd, const char *name, uint8_t *target_id); int mfi_dcmd_command(int fd, uint32_t opcode, void *buf, size_t bufsize, uint8_t *mbox, size_t mboxlen, uint8_t *statusp); -int mfi_open(int unit); +int mfi_open(int unit, int acs); int mfi_ctrl_get_info(int fd, struct mfi_ctrl_info *info, uint8_t *statusp); int mfi_ld_get_info(int fd, uint8_t target_id, struct mfi_ld_info *info, uint8_t *statusp); From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 05:34:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8624106564A; Tue, 26 Jun 2012 05:34:32 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A30AA8FC0A; Tue, 26 Jun 2012 05:34:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5Q5YWu4017586; Tue, 26 Jun 2012 05:34:32 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5Q5YWKs017584; Tue, 26 Jun 2012 05:34:32 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206260534.q5Q5YWKs017584@svn.freebsd.org> From: Joel Dahl Date: Tue, 26 Jun 2012 05:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237591 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 05:34:32 -0000 Author: joel (doc committer) Date: Tue Jun 26 05:34:31 2012 New Revision: 237591 URL: http://svn.freebsd.org/changeset/base/237591 Log: Remove end of line whitespace. Modified: head/lib/libc/stdlib/strfmon.3 Modified: head/lib/libc/stdlib/strfmon.3 ============================================================================== --- head/lib/libc/stdlib/strfmon.3 Tue Jun 26 03:05:42 2012 (r237590) +++ head/lib/libc/stdlib/strfmon.3 Tue Jun 26 05:34:31 2012 (r237591) @@ -53,7 +53,7 @@ The .Fn strfmon_l function does the same as .Fn strfmon -but takes an explicit locale rather than using the current locale. +but takes an explicit locale rather than using the current locale. .Pp The format string is composed of zero or more directives: ordinary characters (not From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 06:02:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E02F8106566C; Tue, 26 Jun 2012 06:02:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFD508FC17; Tue, 26 Jun 2012 06:02:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5Q62hCZ018731; Tue, 26 Jun 2012 06:02:43 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5Q62hSg018729; Tue, 26 Jun 2012 06:02:43 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201206260602.q5Q62hSg018729@svn.freebsd.org> From: Alan Cox Date: Tue, 26 Jun 2012 06:02: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: r237592 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 06:02:44 -0000 Author: alc Date: Tue Jun 26 06:02:43 2012 New Revision: 237592 URL: http://svn.freebsd.org/changeset/base/237592 Log: Add PV list locking to pmap_enter(). Its execution is no longer serialized by the pvh global lock. Add a needed atomic operation to pmap_object_init_pt(). Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Jun 26 05:34:31 2012 (r237591) +++ head/sys/amd64/amd64/pmap.c Tue Jun 26 06:02:43 2012 (r237592) @@ -264,7 +264,8 @@ static void pmap_pv_demote_pde(pmap_t pm struct rwlock **lockp); static boolean_t pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, struct rwlock **lockp); -static void pmap_pv_promote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa); +static void pmap_pv_promote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp); static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); @@ -287,7 +288,8 @@ static boolean_t pmap_is_referenced_pvh( static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va); static void pmap_pde_attr(pd_entry_t *pde, int cache_bits); -static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); +static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, + struct rwlock **lockp); static boolean_t pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, vm_prot_t prot); static void pmap_pte_attr(pt_entry_t *pte, int cache_bits); @@ -305,10 +307,13 @@ static void pmap_update_pde(pmap_t pmap, pd_entry_t newpde); static void pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde); -static vm_page_t pmap_allocpde(pmap_t pmap, vm_offset_t va, int flags); -static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); +static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, + struct rwlock **lockp); +static vm_page_t pmap_allocpde(pmap_t pmap, vm_offset_t va, + struct rwlock **lockp); +static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, + struct rwlock **lockp); -static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, int flags); static int _pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t* free); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t, vm_page_t *); @@ -1686,8 +1691,10 @@ pmap_pinit(pmap_t pmap) } /* - * this routine is called if the page table page is not - * mapped correctly. + * This routine is called if the desired page table page does not exist. + * + * If page table page allocation fails, this routine may sleep before + * returning NULL. It sleeps only if a lock pointer was given. * * Note: If a page allocation fails at page table level two or three, * one or two pages may be held during the wait, only to be released @@ -1695,25 +1702,26 @@ pmap_pinit(pmap_t pmap) * race conditions. */ static vm_page_t -_pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, int flags) +_pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) { vm_page_t m, pdppg, pdpg; - 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")); - PMAP_LOCK_ASSERT(pmap, MA_OWNED); + /* * Allocate a page table page. */ if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { - if (flags & M_WAITOK) { + if (lockp != NULL) { + if (*lockp != NULL) { + rw_wunlock(*lockp); + *lockp = NULL; + } PMAP_UNLOCK(pmap); - rw_wunlock(&pvh_global_lock); + rw_runlock(&pvh_global_lock); VM_WAIT; - rw_wlock(&pvh_global_lock); + rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); } @@ -1754,7 +1762,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if ((*pml4 & PG_V) == 0) { /* Have to allocate a new pdp, recurse */ if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index, - flags) == NULL) { + lockp) == NULL) { --m->wire_count; atomic_subtract_int(&cnt.v_wire_count, 1); vm_page_free_zero(m); @@ -1787,7 +1795,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if ((*pml4 & PG_V) == 0) { /* Have to allocate a new pd, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex, - flags) == NULL) { + lockp) == NULL) { --m->wire_count; atomic_subtract_int(&cnt.v_wire_count, 1); vm_page_free_zero(m); @@ -1801,7 +1809,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if ((*pdp & PG_V) == 0) { /* Have to allocate a new pd, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex, - flags) == NULL) { + lockp) == NULL) { --m->wire_count; atomic_subtract_int(&cnt.v_wire_count, 1); @@ -1827,15 +1835,12 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t } static vm_page_t -pmap_allocpde(pmap_t pmap, vm_offset_t va, int flags) +pmap_allocpde(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) { vm_pindex_t pdpindex, ptepindex; pdp_entry_t *pdpe; vm_page_t pdpg; - KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || - (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, - ("pmap_allocpde: flags is neither M_NOWAIT nor M_WAITOK")); retry: pdpe = pmap_pdpe(pmap, va); if (pdpe != NULL && (*pdpe & PG_V) != 0) { @@ -1846,24 +1851,20 @@ retry: /* Allocate a pd page. */ ptepindex = pmap_pde_pindex(va); pdpindex = ptepindex >> NPDPEPGSHIFT; - pdpg = _pmap_allocpte(pmap, NUPDE + pdpindex, flags); - if (pdpg == NULL && (flags & M_WAITOK)) + pdpg = _pmap_allocpte(pmap, NUPDE + pdpindex, lockp); + if (pdpg == NULL && lockp != NULL) goto retry; } return (pdpg); } static vm_page_t -pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags) +pmap_allocpte(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) { vm_pindex_t ptepindex; pd_entry_t *pd; vm_page_t m; - 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")); - /* * Calculate pagetable page index */ @@ -1879,7 +1880,7 @@ retry: * normal 4K page. */ if (pd != NULL && (*pd & (PG_PS | PG_V)) == (PG_PS | PG_V)) { - if (!pmap_demote_pde(pmap, pd, va)) { + if (!pmap_demote_pde_locked(pmap, pd, va, lockp)) { /* * Invalidation of the 2MB page mapping may have caused * the deallocation of the underlying PD page. @@ -1900,8 +1901,8 @@ retry: * Here if the pte page isn't mapped, or if it has been * deallocated. */ - m = _pmap_allocpte(pmap, ptepindex, flags); - if (m == NULL && (flags & M_WAITOK)) + m = _pmap_allocpte(pmap, ptepindex, lockp); + if (m == NULL && lockp != NULL) goto retry; } return (m); @@ -2504,16 +2505,18 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse * for the 2MB page mapping. */ static void -pmap_pv_promote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa) +pmap_pv_promote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp) { struct md_page *pvh; pv_entry_t pv; vm_offset_t va_last; vm_page_t m; - rw_assert(&pvh_global_lock, RA_WLOCKED); + rw_assert(&pvh_global_lock, RA_LOCKED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_promote_pde: pa is not 2mpage aligned")); + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); /* * Transfer the first page's pv entry for this mapping to the 2mpage's @@ -3255,7 +3258,8 @@ retry: * identical characteristics. */ static void -pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) +pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, + struct rwlock **lockp) { pd_entry_t newpde; pt_entry_t *firstpte, oldpte, pa, *pte; @@ -3273,7 +3277,7 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t setpde: newpde = *firstpte; if ((newpde & ((PG_FRAME & PDRMASK) | PG_A | PG_V)) != (PG_A | PG_V)) { - pmap_pde_p_failures++; + atomic_add_long(&pmap_pde_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_pde: failure for va %#lx" " in pmap %p", va, pmap); return; @@ -3298,7 +3302,7 @@ setpde: setpte: oldpte = *pte; if ((oldpte & (PG_FRAME | PG_A | PG_V)) != pa) { - pmap_pde_p_failures++; + atomic_add_long(&pmap_pde_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_pde: failure for va %#lx" " in pmap %p", va, pmap); return; @@ -3317,7 +3321,7 @@ setpte: " in pmap %p", oldpteva, pmap); } if ((oldpte & PG_PTE_PROMOTE) != (newpde & PG_PTE_PROMOTE)) { - pmap_pde_p_failures++; + atomic_add_long(&pmap_pde_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_pde: failure for va %#lx" " in pmap %p", va, pmap); return; @@ -3342,7 +3346,7 @@ setpte: * Promote the pv entries. */ if ((newpde & PG_MANAGED) != 0) - pmap_pv_promote_pde(pmap, va, newpde & PG_PS_FRAME); + pmap_pv_promote_pde(pmap, va, newpde & PG_PS_FRAME, lockp); /* * Propagate the PAT index to its proper position. @@ -3358,7 +3362,7 @@ setpte: else pde_store(pde, PG_PS | newpde); - pmap_pde_promotions++; + atomic_add_long(&pmap_pde_promotions, 1); CTR2(KTR_PMAP, "pmap_promote_pde: success for va %#lx" " in pmap %p", va, pmap); } @@ -3379,6 +3383,7 @@ 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) { + struct rwlock *lock; pd_entry_t *pde; pt_entry_t *pte; pt_entry_t newpte, origpte; @@ -3398,7 +3403,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, mpte = NULL; - rw_wlock(&pvh_global_lock); + lock = NULL; + rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); /* @@ -3406,7 +3412,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * resident, we are creating it here. */ if (va < VM_MAXUSER_ADDRESS) - mpte = pmap_allocpte(pmap, va, M_WAITOK); + mpte = pmap_allocpte(pmap, va, &lock); pde = pmap_pde(pmap, va); if (pde != NULL && (*pde & PG_V) != 0) { @@ -3460,6 +3466,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); + CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, om); pv = pmap_pvh_remove(&om->md, pmap, va); } if (mpte != NULL) { @@ -3479,6 +3486,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, ("pmap_enter: managed mapping within the clean submap")); if (pv == NULL) pv = get_pv_entry(pmap, FALSE); + CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, m); pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); pa |= PG_MANAGED; @@ -3534,11 +3542,13 @@ validate: if ((newpte & PG_RW) == 0) invlva = TRUE; } - if ((origpte & PG_MANAGED) != 0 && - TAILQ_EMPTY(&om->md.pv_list) && - ((om->flags & PG_FICTITIOUS) != 0 || - TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) - vm_page_aflag_clear(om, PGA_WRITEABLE); + if ((origpte & PG_MANAGED) != 0) { + CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, om); + if (TAILQ_EMPTY(&om->md.pv_list) && + ((om->flags & PG_FICTITIOUS) != 0 || + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) + vm_page_aflag_clear(om, PGA_WRITEABLE); + } if (invlva) pmap_invalidate_page(pmap, va); } else @@ -3552,9 +3562,11 @@ validate: if ((mpte == NULL || mpte->wire_count == NPTEPG) && pg_ps_enabled && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) - pmap_promote_pde(pmap, pde, va); + pmap_promote_pde(pmap, pde, va, &lock); - rw_wunlock(&pvh_global_lock); + if (lock != NULL) + rw_wunlock(lock); + rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3573,7 +3585,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if ((mpde = pmap_allocpde(pmap, va, M_NOWAIT)) == NULL) { + if ((mpde = pmap_allocpde(pmap, va, NULL)) == NULL) { CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" " in pmap %p", va, pmap); return (FALSE); @@ -3735,7 +3747,9 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * If the page table page is mapped, we just increment - * the hold count, and activate it. + * the hold count, and activate it. Otherwise, we + * attempt to allocate a page table page. If this + * attempt fails, we don't retry. Instead, we give up. */ if (ptepa && (*ptepa & PG_V) != 0) { if (*ptepa & PG_PS) @@ -3743,8 +3757,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ mpte = PHYS_TO_VM_PAGE(*ptepa & PG_FRAME); mpte->wire_count++; } else { - mpte = _pmap_allocpte(pmap, ptepindex, - M_NOWAIT); + mpte = _pmap_allocpte(pmap, ptepindex, NULL); if (mpte == NULL) return (mpte); } @@ -3870,7 +3883,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs PMAP_LOCK(pmap); for (pa = ptepa | pmap_cache_bits(pat_mode, 1); pa < ptepa + size; pa += NBPDR) { - pdpg = pmap_allocpde(pmap, addr, M_NOWAIT); + pdpg = pmap_allocpde(pmap, addr, NULL); if (pdpg == NULL) { /* * The creation of mappings below is only an @@ -3888,7 +3901,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs pde_store(pde, pa | PG_PS | PG_M | PG_A | PG_U | PG_RW | PG_V); pmap_resident_count_inc(pmap, NBPDR / PAGE_SIZE); - pmap_pde_mappings++; + atomic_add_long(&pmap_pde_mappings, 1); } else { /* Continue on if the PDE is already valid. */ pdpg->wire_count--; @@ -4020,7 +4033,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm continue; if (srcptepaddr & PG_PS) { - dstmpde = pmap_allocpde(dst_pmap, addr, M_NOWAIT); + dstmpde = pmap_allocpde(dst_pmap, addr, NULL); if (dstmpde == NULL) break; pde = (pd_entry_t *) @@ -4058,7 +4071,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm dstmpte->pindex == pmap_pde_pindex(addr)) dstmpte->wire_count++; else if ((dstmpte = pmap_allocpte(dst_pmap, - addr, M_NOWAIT)) == NULL) + addr, NULL)) == NULL) goto out; dst_pte = (pt_entry_t *) PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dstmpte)); From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 07:56:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63708106564A; Tue, 26 Jun 2012 07:56:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DE178FC0C; Tue, 26 Jun 2012 07:56:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5Q7uGFb023346; Tue, 26 Jun 2012 07:56:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5Q7uGFu023344; Tue, 26 Jun 2012 07:56:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206260756.q5Q7uGFu023344@svn.freebsd.org> From: Adrian Chadd Date: Tue, 26 Jun 2012 07:56: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: r237593 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 07:56:16 -0000 Author: adrian Date: Tue Jun 26 07:56:15 2012 New Revision: 237593 URL: http://svn.freebsd.org/changeset/base/237593 Log: Make sure the BAR TX session pause is correctly unpaused when a node is reassociating. PR: kern/169432 Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Jun 26 06:02:43 2012 (r237592) +++ head/sys/dev/ath/if_ath_tx.c Tue Jun 26 07:56:15 2012 (r237593) @@ -4330,6 +4330,9 @@ ath_addba_response(struct ieee80211_node /* * Stop ADDBA on a queue. + * + * This can be called whilst BAR TX is currently active on the queue, + * so make sure this is unblocked before continuing. */ void ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) @@ -4341,9 +4344,21 @@ ath_addba_stop(struct ieee80211_node *ni DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: called\n", __func__); - /* Pause TID traffic early, so there aren't any races */ + /* + * Pause TID traffic early, so there aren't any races + * Unblock the pending BAR held traffic, if it's currently paused. + */ ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); ath_tx_tid_pause(sc, atid); + if (atid->bar_wait) { + /* + * bar_unsuspend() expects bar_tx == 1, as it should be + * called from the TX completion path. This quietens + * the warning. It's cleared for us anyway. + */ + atid->bar_tx = 1; + ath_tx_tid_bar_unsuspend(sc, atid); + } ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); /* There's no need to hold the TXQ lock here */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 10:14:01 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A90F106566C; Tue, 26 Jun 2012 10:14:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 675228FC0A; Tue, 26 Jun 2012 10:14:00 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:293b:9cd4:4eeb:59af] (unknown [IPv6:2001:7b8:3a7:0:293b:9cd4:4eeb:59af]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 61C145C59; Tue, 26 Jun 2012 12:13:52 +0200 (CEST) Message-ID: <4FE98B60.1020102@FreeBSD.org> Date: Tue, 26 Jun 2012 12:13:52 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120619 Thunderbird/14.0 MIME-Version: 1.0 To: Jung-uk Kim References: <201206220040.q5M0ejNk045397@svn.freebsd.org> <20120622095847.GC2337@deviant.kiev.zoral.com.ua> <4FE494FA.1030907@FreeBSD.org> <20120624181348.GA54897@jail.io> <4FE8DA2E.2060209@FreeBSD.org> In-Reply-To: <4FE8DA2E.2060209@FreeBSD.org> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Bukin Subject: Re: svn commit: r237412 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/components/disa... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 10:14:01 -0000 On 2012-06-25 23:37, Jung-uk Kim wrote: ... > I submitted this patch and I am waiting for confirmation: > > http://people.freebsd.org/~jkim/evxfgpe.diff I've tested your diff, and it made the panic disappear for me. Thanks! From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 10:32:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C34A1065672; Tue, 26 Jun 2012 10:32:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 269568FC14; Tue, 26 Jun 2012 10:32:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QAWAmf029589; Tue, 26 Jun 2012 10:32:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QAW9C2029587; Tue, 26 Jun 2012 10:32:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206261032.q5QAW9C2029587@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 26 Jun 2012 10:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237594 - stable/9/sys/dev/agp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 10:32:10 -0000 Author: kib Date: Tue Jun 26 10:32:09 2012 New Revision: 237594 URL: http://svn.freebsd.org/changeset/base/237594 Log: MFC r237484: Correct device id for GPU on some server SandyBridge model. Modified: stable/9/sys/dev/agp/agp_i810.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/agp/agp_i810.c ============================================================================== --- stable/9/sys/dev/agp/agp_i810.c Tue Jun 26 07:56:15 2012 (r237593) +++ stable/9/sys/dev/agp/agp_i810.c Tue Jun 26 10:32:09 2012 (r237594) @@ -700,7 +700,7 @@ static const struct agp_i810_match { .driver = &agp_i810_sb_driver }, { - .devid = 0x01088086, + .devid = 0x010a8086, .name = "SandyBridge server IG", .driver = &agp_i810_sb_driver }, From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 14:51:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE38E106564A; Tue, 26 Jun 2012 14:51:36 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A4598FC08; Tue, 26 Jun 2012 14:51:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QEpaAZ046525; Tue, 26 Jun 2012 14:51:36 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QEpaCA046515; Tue, 26 Jun 2012 14:51:36 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206261451.q5QEpaCA046515@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 26 Jun 2012 14:51: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: r237601 - in head: share/examples/scsi_target sys/cam/ctl sys/dev/aic7xxx sys/dev/firewire sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 14:51:36 -0000 Author: ken Date: Tue Jun 26 14:51:35 2012 New Revision: 237601 URL: http://svn.freebsd.org/changeset/base/237601 Log: Fix an issue that caused the kernel to panic inside CTL when trying to attach to target capable HBAs that implement the old immediate notify (XPT_IMMED_NOTIFY) and notify acknowledge (XPT_NOTIFY_ACK) CCBs. The new API has been in place since SVN change 196008 in 2009. The solution is two-fold: fix CTL to handle the responses from the HBAs, and convert the HBA drivers in question to use the new API. These drivers have not been tested with CTL, so how well they will interoperate with CTL is unknown. scsi_target.c: Update the userland target example code to use the new immediate notify API. scsi_ctl.c: Detect when an immediate notify CCB is returned with CAM_REQ_INVALID or CAM_PROVIDE_FAIL status, and just free it. Fix a duplicate assignment. aic79xx.c, aic79xx_osm.c: Update the aic79xx driver to use the new API. Target mode is not enabled on for this driver, so the changes will have no practical effect. aic7xxx.c, aic7xxx_osm.c: Update the aic7xxx driver to use the new API. sbp_targ.c: Update the firewire target code to work with the new API. mpt_cam.c: Update the mpt(4) driver to work with the new API. Target mode is only enabled for Fibre Channel mpt(4) devices. MFC after: 3 days Modified: head/share/examples/scsi_target/scsi_target.c head/sys/cam/ctl/scsi_ctl.c head/sys/dev/aic7xxx/aic79xx.c head/sys/dev/aic7xxx/aic79xx_osm.c head/sys/dev/aic7xxx/aic7xxx.c head/sys/dev/aic7xxx/aic7xxx_osm.c head/sys/dev/firewire/sbp_targ.c head/sys/dev/mpt/mpt_cam.c Modified: head/share/examples/scsi_target/scsi_target.c ============================================================================== --- head/share/examples/scsi_target/scsi_target.c Tue Jun 26 11:13:58 2012 (r237600) +++ head/share/examples/scsi_target/scsi_target.c Tue Jun 26 14:51:35 2012 (r237601) @@ -88,7 +88,7 @@ static void handle_read(void); /* static int work_atio(struct ccb_accept_tio *); */ static void queue_io(struct ccb_scsiio *); static int run_queue(struct ccb_accept_tio *); -static int work_inot(struct ccb_immed_notify *); +static int work_inot(struct ccb_immediate_notify *); static struct ccb_scsiio * get_ctio(void); /* static void free_ccb(union ccb *); */ @@ -387,7 +387,7 @@ init_ccbs() warn("malloc INOT"); return (-1); } - inot->ccb_h.func_code = XPT_IMMED_NOTIFY; + inot->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; send_ccb((union ccb *)inot, /*priority*/1); } @@ -495,8 +495,8 @@ request_loop() /* Start one more transfer. */ retval = work_atio(&ccb->atio); break; - case XPT_IMMED_NOTIFY: - retval = work_inot(&ccb->cin); + case XPT_IMMEDIATE_NOTIFY: + retval = work_inot(&ccb->cin1); break; default: warnx("Unhandled ccb type %#x on workq", @@ -651,7 +651,7 @@ work_atio(struct ccb_accept_tio *atio) warnx("ATIO with %u bytes sense received", atio->sense_len); } - sense = &atio->sense_data; + sense = (struct scsi_sense_data_fixed *)&atio->sense_data; tcmd_sense(ctio->init_id, ctio, sense->flags, sense->add_sense_code, sense->add_sense_code_qual); send_ccb((union ccb *)ctio, /*priority*/1); @@ -772,16 +772,14 @@ run_queue(struct ccb_accept_tio *atio) } static int -work_inot(struct ccb_immed_notify *inot) +work_inot(struct ccb_immediate_notify *inot) { cam_status status; - int sense; if (debug) warnx("Working on INOT %p", inot); status = inot->ccb_h.status; - sense = (status & CAM_AUTOSNS_VALID) != 0; status &= CAM_STATUS_MASK; switch (status) { @@ -794,7 +792,7 @@ work_inot(struct ccb_immed_notify *inot) abort_all_pending(); break; case CAM_MESSAGE_RECV: - switch (inot->message_args[0]) { + switch (inot->arg) { case MSG_TASK_COMPLETE: case MSG_INITIATOR_DET_ERR: case MSG_ABORT_TASK_SET: @@ -805,7 +803,7 @@ work_inot(struct ccb_immed_notify *inot) case MSG_ABORT_TASK: case MSG_CLEAR_TASK_SET: default: - warnx("INOT message %#x", inot->message_args[0]); + warnx("INOT message %#x", inot->arg); break; } break; @@ -817,17 +815,6 @@ work_inot(struct ccb_immed_notify *inot) break; } - /* If there is sense data, use it */ - if (sense != 0) { - struct scsi_sense_data_fixed *sense; - - sense = (struct scsi_sense_data_fixed *)&inot->sense_data; - tcmd_sense(inot->initiator_id, NULL, sense->flags, - sense->add_sense_code, sense->add_sense_code_qual); - if (debug) - warnx("INOT has sense: %#x", sense->flags); - } - /* Requeue on SIM */ TAILQ_REMOVE(&work_queue, &inot->ccb_h, periph_links.tqe); send_ccb((union ccb *)inot, /*priority*/1); Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Tue Jun 26 11:13:58 2012 (r237600) +++ head/sys/cam/ctl/scsi_ctl.c Tue Jun 26 14:51:35 2012 (r237601) @@ -558,7 +558,6 @@ ctlferegister(struct cam_periph *periph, TAILQ_INIT(&softc->work_queue); softc->periph = periph; - softc->parent_softc = bus_softc; callout_init_mtx(&softc->dma_callout, sim->mtx, /*flags*/ 0); periph->softc = softc; @@ -628,12 +627,22 @@ ctlferegister(struct cam_periph *periph, xpt_action(new_ccb); softc->inots_sent++; status = new_ccb->ccb_h.status; - if (status != CAM_REQ_INPROG) { - free(new_ccb, M_CTLFE); + if ((status & CAM_STATUS_MASK) != CAM_REQ_INPROG) { + /* + * Note that we don't free the CCB here. If the + * status is not CAM_REQ_INPROG, then we're + * probably talking to a SIM that says it is + * target-capable but doesn't support the + * XPT_IMMEDIATE_NOTIFY CCB. i.e. it supports the + * older API. In that case, it'll call xpt_done() + * on the CCB, and we need to free it in our done + * routine as a result. + */ break; } } - if (i == 0) { + if ((i == 0) + || (status != CAM_REQ_INPROG)) { xpt_print(periph->path, "%s: could not allocate immediate " "notify CCBs, status 0x%x\n", __func__, status); return (CAM_REQ_CMP_ERR); @@ -1460,12 +1469,29 @@ ctlfedone(struct cam_periph *periph, uni */ send_ctl_io = 0; break; + case CAM_REQ_INVALID: + case CAM_PROVIDE_FAIL: default: - xpt_print(periph->path, "%s: " - "unsupported CAM status 0x%x\n", - __func__, status); - send_ctl_io = 0; - break; + /* + * We should only get here if we're talking + * to a talking to a SIM that is target + * capable but supports the old API. In + * that case, we need to just free the CCB. + * If we actually send a notify acknowledge, + * it will send that back with an error as + * well. + */ + + if ((status != CAM_REQ_INVALID) + && (status != CAM_PROVIDE_FAIL)) + xpt_print(periph->path, "%s: " + "unsupported CAM status " + "0x%x\n", __func__, status); + + ctl_free_io(io); + ctlfe_free_ccb(periph, done_ccb); + + return; } if (send_ctl_io != 0) { ctl_queue(io); Modified: head/sys/dev/aic7xxx/aic79xx.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx.c Tue Jun 26 11:13:58 2012 (r237600) +++ head/sys/dev/aic7xxx/aic79xx.c Tue Jun 26 14:51:35 2012 (r237601) @@ -8561,7 +8561,7 @@ void ahd_send_lstate_events(struct ahd_softc *ahd, struct ahd_tmode_lstate *lstate) { struct ccb_hdr *ccbh; - struct ccb_immed_notify *inot; + struct ccb_immediate_notify *inot; while (lstate->event_r_idx != lstate->event_w_idx && (ccbh = SLIST_FIRST(&lstate->immed_notifies)) != NULL) { @@ -8569,19 +8569,18 @@ ahd_send_lstate_events(struct ahd_softc event = &lstate->event_buffer[lstate->event_r_idx]; SLIST_REMOVE_HEAD(&lstate->immed_notifies, sim_links.sle); - inot = (struct ccb_immed_notify *)ccbh; + inot = (struct ccb_immediate_notify *)ccbh; switch (event->event_type) { case EVENT_TYPE_BUS_RESET: ccbh->status = CAM_SCSI_BUS_RESET|CAM_DEV_QFRZN; break; default: ccbh->status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; - inot->message_args[0] = event->event_type; - inot->message_args[1] = event->event_arg; + inot->arg = event->event_type; + inot->seq_id = event->event_arg; break; } inot->initiator_id = event->initiator_id; - inot->sense_len = 0; xpt_done((union ccb *)inot); lstate->event_r_idx++; if (lstate->event_r_idx == AHD_TMODE_EVENT_BUFFER_SIZE) Modified: head/sys/dev/aic7xxx/aic79xx_osm.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx_osm.c Tue Jun 26 11:13:58 2012 (r237600) +++ head/sys/dev/aic7xxx/aic79xx_osm.c Tue Jun 26 14:51:35 2012 (r237601) @@ -601,8 +601,8 @@ ahd_action(struct cam_sim *sim, union cc break; } #ifdef AHD_TARGET_MODE - case XPT_NOTIFY_ACK: - case XPT_IMMED_NOTIFY: + case XPT_NOTIFY_ACKNOWLEDGE: + case XPT_IMMEDIATE_NOTIFY: { struct ahd_tmode_tstate *tstate; struct ahd_tmode_lstate *lstate; @@ -1189,7 +1189,7 @@ ahd_abort_ccb(struct ahd_softc *ahd, str switch (abort_ccb->ccb_h.func_code) { #ifdef AHD_TARGET_MODE case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: + case XPT_IMMEDIATE_NOTIFY: case XPT_CONT_TARGET_IO: { struct ahd_tmode_tstate *tstate; @@ -1207,7 +1207,7 @@ ahd_abort_ccb(struct ahd_softc *ahd, str if (abort_ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) list = &lstate->accept_tios; - else if (abort_ccb->ccb_h.func_code == XPT_IMMED_NOTIFY) + else if (abort_ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) list = &lstate->immed_notifies; else list = NULL; Modified: head/sys/dev/aic7xxx/aic7xxx.c ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.c Tue Jun 26 11:13:58 2012 (r237600) +++ head/sys/dev/aic7xxx/aic7xxx.c Tue Jun 26 14:51:35 2012 (r237601) @@ -6368,7 +6368,7 @@ void ahc_send_lstate_events(struct ahc_softc *ahc, struct ahc_tmode_lstate *lstate) { struct ccb_hdr *ccbh; - struct ccb_immed_notify *inot; + struct ccb_immediate_notify *inot; while (lstate->event_r_idx != lstate->event_w_idx && (ccbh = SLIST_FIRST(&lstate->immed_notifies)) != NULL) { @@ -6376,19 +6376,18 @@ ahc_send_lstate_events(struct ahc_softc event = &lstate->event_buffer[lstate->event_r_idx]; SLIST_REMOVE_HEAD(&lstate->immed_notifies, sim_links.sle); - inot = (struct ccb_immed_notify *)ccbh; + inot = (struct ccb_immediate_notify *)ccbh; switch (event->event_type) { case EVENT_TYPE_BUS_RESET: ccbh->status = CAM_SCSI_BUS_RESET|CAM_DEV_QFRZN; break; default: ccbh->status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; - inot->message_args[0] = event->event_type; - inot->message_args[1] = event->event_arg; + inot->arg = event->event_type; + inot->seq_id = event->event_arg; break; } inot->initiator_id = event->initiator_id; - inot->sense_len = 0; xpt_done((union ccb *)inot); lstate->event_r_idx++; if (lstate->event_r_idx == AHC_TMODE_EVENT_BUFFER_SIZE) Modified: head/sys/dev/aic7xxx/aic7xxx_osm.c ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx_osm.c Tue Jun 26 11:13:58 2012 (r237600) +++ head/sys/dev/aic7xxx/aic7xxx_osm.c Tue Jun 26 14:51:35 2012 (r237601) @@ -568,8 +568,8 @@ ahc_action(struct cam_sim *sim, union cc } break; } - case XPT_NOTIFY_ACK: - case XPT_IMMED_NOTIFY: + case XPT_NOTIFY_ACKNOWLEDGE: + case XPT_IMMEDIATE_NOTIFY: { struct ahc_tmode_tstate *tstate; struct ahc_tmode_lstate *lstate; @@ -1248,7 +1248,7 @@ ahc_abort_ccb(struct ahc_softc *ahc, str abort_ccb = ccb->cab.abort_ccb; switch (abort_ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: + case XPT_IMMEDIATE_NOTIFY: case XPT_CONT_TARGET_IO: { struct ahc_tmode_tstate *tstate; @@ -1266,7 +1266,7 @@ ahc_abort_ccb(struct ahc_softc *ahc, str if (abort_ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) list = &lstate->accept_tios; - else if (abort_ccb->ccb_h.func_code == XPT_IMMED_NOTIFY) + else if (abort_ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) list = &lstate->immed_notifies; else list = NULL; Modified: head/sys/dev/firewire/sbp_targ.c ============================================================================== --- head/sys/dev/firewire/sbp_targ.c Tue Jun 26 11:13:58 2012 (r237600) +++ head/sys/dev/firewire/sbp_targ.c Tue Jun 26 14:51:35 2012 (r237601) @@ -533,7 +533,7 @@ sbp_targ_send_lstate_events(struct sbp_t { #if 0 struct ccb_hdr *ccbh; - struct ccb_immed_notify *inot; + struct ccb_immediate_notify *inot; printf("%s: not implemented yet\n", __func__); #endif @@ -908,7 +908,7 @@ sbp_targ_abort_ccb(struct sbp_targ_softc if (accb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) list = &lstate->accept_tios; - else if (accb->ccb_h.func_code == XPT_IMMED_NOTIFY) + else if (accb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) list = &lstate->immed_notifies; else return (CAM_UA_ABORT); @@ -1301,8 +1301,8 @@ sbp_targ_action1(struct cam_sim *sim, un } } break; - case XPT_NOTIFY_ACK: /* recycle notify ack */ - case XPT_IMMED_NOTIFY: /* Add Immediate Notify Resource */ + case XPT_NOTIFY_ACKNOWLEDGE: /* recycle notify ack */ + case XPT_IMMEDIATE_NOTIFY: /* Add Immediate Notify Resource */ if (status != CAM_REQ_CMP) { ccb->ccb_h.status = status; xpt_done(ccb); @@ -1349,7 +1349,7 @@ sbp_targ_action1(struct cam_sim *sim, un switch (accb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: + case XPT_IMMEDIATE_NOTIFY: ccb->ccb_h.status = sbp_targ_abort_ccb(sc, ccb); break; case XPT_CONT_TARGET_IO: Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Tue Jun 26 11:13:58 2012 (r237600) +++ head/sys/dev/mpt/mpt_cam.c Tue Jun 26 14:51:35 2012 (r237601) @@ -3411,7 +3411,7 @@ mpt_action(struct cam_sim *sim, union cc CAMLOCK_2_MPTLOCK(mpt); switch (accb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: + case XPT_IMMEDIATE_NOTIFY: ccb->ccb_h.status = mpt_abort_target_ccb(mpt, ccb); break; case XPT_CONT_TARGET_IO: @@ -3785,8 +3785,8 @@ mpt_action(struct cam_sim *sim, union cc } break; } - case XPT_NOTIFY_ACK: /* recycle notify ack */ - case XPT_IMMED_NOTIFY: /* Add Immediate Notify Resource */ + case XPT_NOTIFY_ACKNOWLEDGE: /* recycle notify ack */ + case XPT_IMMEDIATE_NOTIFY: /* Add Immediate Notify Resource */ case XPT_ACCEPT_TARGET_IO: /* Add Accept Target IO Resource */ { tgt_resource_t *trtp; @@ -3813,7 +3813,7 @@ mpt_action(struct cam_sim *sim, union cc "Put FREE ATIO %p lun %d\n", ccb, lun); STAILQ_INSERT_TAIL(&trtp->atios, &ccb->ccb_h, sim_links.stqe); - } else if (ccb->ccb_h.func_code == XPT_IMMED_NOTIFY) { + } else if (ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) { mpt_lprt(mpt, MPT_PRT_DEBUG1, "Put FREE INOT lun %d\n", lun); STAILQ_INSERT_TAIL(&trtp->inots, &ccb->ccb_h, @@ -4822,7 +4822,7 @@ mpt_abort_target_ccb(struct mpt_softc *m if (accb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { lp = &trtp->atios; - } else if (accb->ccb_h.func_code == XPT_IMMED_NOTIFY) { + } else if (accb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) { lp = &trtp->inots; } else { return (CAM_REQ_INVALID); @@ -5043,11 +5043,11 @@ static void mpt_scsi_tgt_tsk_mgmt(struct mpt_softc *mpt, request_t *req, mpt_task_mgmt_t fc, tgt_resource_t *trtp, int init_id) { - struct ccb_immed_notify *inot; + struct ccb_immediate_notify *inot; mpt_tgt_state_t *tgt; tgt = MPT_TGT_STATE(mpt, req); - inot = (struct ccb_immed_notify *) STAILQ_FIRST(&trtp->inots); + inot = (struct ccb_immediate_notify *) STAILQ_FIRST(&trtp->inots); if (inot == NULL) { mpt_lprt(mpt, MPT_PRT_WARN, "no INOTSs- sending back BSY\n"); mpt_scsi_tgt_status(mpt, NULL, req, SCSI_STATUS_BUSY, NULL); @@ -5057,35 +5057,35 @@ mpt_scsi_tgt_tsk_mgmt(struct mpt_softc * mpt_lprt(mpt, MPT_PRT_DEBUG1, "Get FREE INOT %p lun %d\n", inot, inot->ccb_h.target_lun); - memset(&inot->sense_data, 0, sizeof (inot->sense_data)); - inot->sense_len = 0; - memset(inot->message_args, 0, sizeof (inot->message_args)); inot->initiator_id = init_id; /* XXX */ - /* * This is a somewhat grotesque attempt to map from task management * to old style SCSI messages. God help us all. */ switch (fc) { case MPT_ABORT_TASK_SET: - inot->message_args[0] = MSG_ABORT_TAG; + inot->arg = MSG_ABORT_TAG; break; case MPT_CLEAR_TASK_SET: - inot->message_args[0] = MSG_CLEAR_TASK_SET; + inot->arg = MSG_CLEAR_TASK_SET; break; case MPT_TARGET_RESET: - inot->message_args[0] = MSG_TARGET_RESET; + inot->arg = MSG_TARGET_RESET; break; case MPT_CLEAR_ACA: - inot->message_args[0] = MSG_CLEAR_ACA; + inot->arg = MSG_CLEAR_ACA; break; case MPT_TERMINATE_TASK: - inot->message_args[0] = MSG_ABORT_TAG; + inot->arg = MSG_ABORT_TAG; break; default: - inot->message_args[0] = MSG_NOOP; + inot->arg = MSG_NOOP; break; } + /* + * XXX KDM we need the sequence/tag number for the target of the + * task management operation, especially if it is an abort. + */ tgt->ccb = (union ccb *) inot; inot->ccb_h.status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; MPTLOCK_2_CAMLOCK(mpt); From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 15:29:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E15D5106566B; Tue, 26 Jun 2012 15:29:38 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C85DB8FC1B; Tue, 26 Jun 2012 15:29:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QFTc2P048201; Tue, 26 Jun 2012 15:29:38 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QFTcX4048199; Tue, 26 Jun 2012 15:29:38 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201206261529.q5QFTcX4048199@svn.freebsd.org> From: Mitsuru IWASAKI Date: Tue, 26 Jun 2012 15:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237602 - stable/9/sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 15:29:39 -0000 Author: iwasaki Date: Tue Jun 26 15:29:38 2012 New Revision: 237602 URL: http://svn.freebsd.org/changeset/base/237602 Log: MFC 237493: - Add in-driver event handler. Modified: stable/9/sys/dev/acpi_support/acpi_ibm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- stable/9/sys/dev/acpi_support/acpi_ibm.c Tue Jun 26 14:51:35 2012 (r237601) +++ stable/9/sys/dev/acpi_support/acpi_ibm.c Tue Jun 26 15:29:38 2012 (r237602) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -70,6 +72,7 @@ ACPI_MODULE_NAME("IBM") #define ACPI_IBM_METHOD_FANLEVEL 11 #define ACPI_IBM_METHOD_FANSTATUS 12 #define ACPI_IBM_METHOD_THERMAL 13 +#define ACPI_IBM_METHOD_HANDLEREVENTS 14 /* Hotkeys/Buttons */ #define IBM_RTC_HOTKEY1 0x64 @@ -126,6 +129,21 @@ ACPI_MODULE_NAME("IBM") #define IBM_NAME_EVENTS_GET "MHKP" #define IBM_NAME_EVENTS_AVAILMASK "MHKA" +/* Event Code */ +#define IBM_EVENT_LCD_BACKLIGHT 0x03 +#define IBM_EVENT_SUSPEND_TO_RAM 0x04 +#define IBM_EVENT_BLUETOOTH 0x05 +#define IBM_EVENT_SCREEN_EXPAND 0x07 +#define IBM_EVENT_SUSPEND_TO_DISK 0x0c +#define IBM_EVENT_BRIGHTNESS_UP 0x10 +#define IBM_EVENT_BRIGHTNESS_DOWN 0x11 +#define IBM_EVENT_THINKLIGHT 0x12 +#define IBM_EVENT_ZOOM 0x14 +#define IBM_EVENT_VOLUME_UP 0x15 +#define IBM_EVENT_VOLUME_DOWN 0x16 +#define IBM_EVENT_MUTE 0x17 +#define IBM_EVENT_ACCESS_IBM_BUTTON 0x18 + #define ABS(x) (((x) < 0)? -(x) : (x)) struct acpi_ibm_softc { @@ -164,6 +182,8 @@ struct acpi_ibm_softc { int events_mask_supported; int events_enable; + unsigned int handler_events; + struct sysctl_ctx_list *sysctl_ctx; struct sysctl_oid *sysctl_tree; }; @@ -267,8 +287,15 @@ static int acpi_ibm_sysctl_set(struct ac static int acpi_ibm_eventmask_set(struct acpi_ibm_softc *sc, int val); static int acpi_ibm_thermal_sysctl(SYSCTL_HANDLER_ARGS); +static int acpi_ibm_handlerevents_sysctl(SYSCTL_HANDLER_ARGS); static void acpi_ibm_notify(ACPI_HANDLE h, UINT32 notify, void *context); +static int acpi_ibm_brightness_set(struct acpi_ibm_softc *sc, int arg); +static int acpi_ibm_bluetooth_set(struct acpi_ibm_softc *sc, int arg); +static int acpi_ibm_thinklight_set(struct acpi_ibm_softc *sc, int arg); +static int acpi_ibm_volume_set(struct acpi_ibm_softc *sc, int arg); +static int acpi_ibm_mute_set(struct acpi_ibm_softc *sc, int arg); + static device_method_t acpi_ibm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_ibm_probe), @@ -404,6 +431,15 @@ acpi_ibm_attach(device_t dev) "Thermal zones"); } + /* Hook up handlerevents node */ + if (acpi_ibm_sysctl_init(sc, ACPI_IBM_METHOD_HANDLEREVENTS)) { + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + "handlerevents", CTLTYPE_STRING | CTLFLAG_RW, + sc, 0, acpi_ibm_handlerevents_sysctl, "I", + "devd(8) events handled by acpi_ibm"); + } + /* Handle notifies */ AcpiInstallNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY, acpi_ibm_notify, dev); @@ -656,10 +692,8 @@ acpi_ibm_sysctl_get(struct acpi_ibm_soft static int acpi_ibm_sysctl_set(struct acpi_ibm_softc *sc, int method, int arg) { - int val, step; + int val; UINT64 val_ec; - ACPI_OBJECT Arg; - ACPI_OBJECT_LIST Args; ACPI_STATUS status; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -683,101 +717,23 @@ acpi_ibm_sysctl_set(struct acpi_ibm_soft break; case ACPI_IBM_METHOD_BRIGHTNESS: - if (arg < 0 || arg > 7) - return (EINVAL); - - if (sc->cmos_handle) { - /* Read the current brightness */ - status = ACPI_EC_READ(sc->ec_dev, IBM_EC_BRIGHTNESS, &val_ec, 1); - if (ACPI_FAILURE(status)) - return (status); - val = val_ec & IBM_EC_MASK_BRI; - - Args.Count = 1; - Args.Pointer = &Arg; - Arg.Type = ACPI_TYPE_INTEGER; - Arg.Integer.Value = (arg > val) ? IBM_CMOS_BRIGHTNESS_UP : IBM_CMOS_BRIGHTNESS_DOWN; - - step = (arg > val) ? 1 : -1; - for (int i = val; i != arg; i += step) { - status = AcpiEvaluateObject(sc->cmos_handle, NULL, &Args, NULL); - if (ACPI_FAILURE(status)) - break; - } - } - return ACPI_EC_WRITE(sc->ec_dev, IBM_EC_BRIGHTNESS, arg, 1); + return acpi_ibm_brightness_set(sc, arg); break; case ACPI_IBM_METHOD_VOLUME: - if (arg < 0 || arg > 14) - return (EINVAL); - - status = ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); - if (ACPI_FAILURE(status)) - return (status); - - if (sc->cmos_handle) { - val = val_ec & IBM_EC_MASK_VOL; - - Args.Count = 1; - Args.Pointer = &Arg; - Arg.Type = ACPI_TYPE_INTEGER; - Arg.Integer.Value = (arg > val) ? IBM_CMOS_VOLUME_UP : IBM_CMOS_VOLUME_DOWN; - - step = (arg > val) ? 1 : -1; - for (int i = val; i != arg; i += step) { - status = AcpiEvaluateObject(sc->cmos_handle, NULL, &Args, NULL); - if (ACPI_FAILURE(status)) - break; - } - } - return ACPI_EC_WRITE(sc->ec_dev, IBM_EC_VOLUME, arg + (val_ec & (~IBM_EC_MASK_VOL)), 1); + return acpi_ibm_volume_set(sc, arg); break; case ACPI_IBM_METHOD_MUTE: - if (arg < 0 || arg > 1) - return (EINVAL); - - status = ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); - if (ACPI_FAILURE(status)) - return (status); - - if (sc->cmos_handle) { - Args.Count = 1; - Args.Pointer = &Arg; - Arg.Type = ACPI_TYPE_INTEGER; - Arg.Integer.Value = IBM_CMOS_VOLUME_MUTE; - - status = AcpiEvaluateObject(sc->cmos_handle, NULL, &Args, NULL); - if (ACPI_FAILURE(status)) - break; - } - return ACPI_EC_WRITE(sc->ec_dev, IBM_EC_VOLUME, (arg==1) ? val_ec | IBM_EC_MASK_MUTE : val_ec & (~IBM_EC_MASK_MUTE), 1); + return acpi_ibm_mute_set(sc, arg); break; case ACPI_IBM_METHOD_THINKLIGHT: - if (arg < 0 || arg > 1) - return (EINVAL); - - if (sc->light_set_supported) { - Args.Count = 1; - Args.Pointer = &Arg; - Arg.Type = ACPI_TYPE_INTEGER; - Arg.Integer.Value = arg ? sc->light_cmd_on : sc->light_cmd_off; - - status = AcpiEvaluateObject(sc->light_handle, NULL, &Args, NULL); - if (ACPI_SUCCESS(status)) - sc->light_val = arg; - return (status); - } + return acpi_ibm_thinklight_set(sc, arg); break; case ACPI_IBM_METHOD_BLUETOOTH: - if (arg < 0 || arg > 1) - return (EINVAL); - - val = (arg == 1) ? sc->wlan_bt_flags | IBM_NAME_MASK_BT : sc->wlan_bt_flags & (~IBM_NAME_MASK_BT); - return acpi_SetInteger(sc->handle, IBM_NAME_WLAN_BT_SET, val); + return acpi_ibm_bluetooth_set(sc, arg); break; case ACPI_IBM_METHOD_FANLEVEL: @@ -898,6 +854,9 @@ acpi_ibm_sysctl_init(struct acpi_ibm_sof return (TRUE); } return (FALSE); + + case ACPI_IBM_METHOD_HANDLEREVENTS: + return (TRUE); } return (FALSE); } @@ -937,6 +896,328 @@ acpi_ibm_thermal_sysctl(SYSCTL_HANDLER_A return (error); } +static int +acpi_ibm_handlerevents_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct acpi_ibm_softc *sc; + int error = 0; + struct sbuf sb; + char *cp, *ep; + int l, val; + unsigned int handler_events; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + sc = (struct acpi_ibm_softc *)oidp->oid_arg1; + + if (sbuf_new(&sb, NULL, 128, SBUF_AUTOEXTEND) == NULL) + return (ENOMEM); + + ACPI_SERIAL_BEGIN(ibm); + + /* Get old values if this is a get request. */ + if (req->newptr == NULL) { + for (int i = 0; i < 8 * sizeof(sc->handler_events); i++) + if (sc->handler_events & (1 << i)) + sbuf_printf(&sb, "0x%02x ", i + 1); + if (sbuf_len(&sb) == 0) + sbuf_printf(&sb, "NONE"); + } + + sbuf_trim(&sb); + sbuf_finish(&sb); + + /* Copy out the old values to the user. */ + error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + sbuf_delete(&sb); + + if (error != 0 || req->newptr == NULL) + goto out; + + /* If the user is setting a string, parse it. */ + handler_events = 0; + cp = (char *)req->newptr; + while (*cp) { + if (isspace(*cp)) { + cp++; + continue; + } + + ep = cp; + + while (*ep && !isspace(*ep)) + ep++; + + l = ep - cp; + if (l == 0) + break; + + if (strncmp(cp, "NONE", 4) == 0) { + cp = ep; + continue; + } + + if (l >= 3 && cp[0] == '0' && (cp[1] == 'X' || cp[1] == 'x')) + val = strtoul(cp, &ep, 16); + else + val = strtoul(cp, &ep, 10); + + if (val == 0 || ep == cp || val >= 8 * sizeof(handler_events)) { + cp[l] = '\0'; + device_printf(sc->dev, "invalid event code: %s\n", cp); + error = EINVAL; + goto out; + } + + handler_events |= 1 << (val - 1); + + cp = ep; + } + + sc->handler_events = handler_events; +out: + ACPI_SERIAL_END(ibm); + return (error); +} + +static int +acpi_ibm_brightness_set(struct acpi_ibm_softc *sc, int arg) +{ + int val, step; + UINT64 val_ec; + ACPI_OBJECT Arg; + ACPI_OBJECT_LIST Args; + ACPI_STATUS status; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + ACPI_SERIAL_ASSERT(ibm); + + if (arg < 0 || arg > 7) + return (EINVAL); + + /* Read the current brightness */ + status = ACPI_EC_READ(sc->ec_dev, IBM_EC_BRIGHTNESS, &val_ec, 1); + if (ACPI_FAILURE(status)) + return (status); + + if (sc->cmos_handle) { + val = val_ec & IBM_EC_MASK_BRI; + + Args.Count = 1; + Args.Pointer = &Arg; + Arg.Type = ACPI_TYPE_INTEGER; + Arg.Integer.Value = (arg > val) ? IBM_CMOS_BRIGHTNESS_UP : + IBM_CMOS_BRIGHTNESS_DOWN; + + step = (arg > val) ? 1 : -1; + for (int i = val; i != arg; i += step) { + status = AcpiEvaluateObject(sc->cmos_handle, NULL, + &Args, NULL); + if (ACPI_FAILURE(status)) { + /* Record the last value */ + if (i != val) { + ACPI_EC_WRITE(sc->ec_dev, + IBM_EC_BRIGHTNESS, i - step, 1); + } + return (status); + } + } + } + + return ACPI_EC_WRITE(sc->ec_dev, IBM_EC_BRIGHTNESS, arg, 1); +} + +static int +acpi_ibm_bluetooth_set(struct acpi_ibm_softc *sc, int arg) +{ + int val; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + ACPI_SERIAL_ASSERT(ibm); + + if (arg < 0 || arg > 1) + return (EINVAL); + + val = (arg == 1) ? sc->wlan_bt_flags | IBM_NAME_MASK_BT : + sc->wlan_bt_flags & (~IBM_NAME_MASK_BT); + return acpi_SetInteger(sc->handle, IBM_NAME_WLAN_BT_SET, val); +} + +static int +acpi_ibm_thinklight_set(struct acpi_ibm_softc *sc, int arg) +{ + ACPI_OBJECT Arg; + ACPI_OBJECT_LIST Args; + ACPI_STATUS status; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + ACPI_SERIAL_ASSERT(ibm); + + if (arg < 0 || arg > 1) + return (EINVAL); + + if (sc->light_set_supported) { + Args.Count = 1; + Args.Pointer = &Arg; + Arg.Type = ACPI_TYPE_INTEGER; + Arg.Integer.Value = arg ? sc->light_cmd_on : sc->light_cmd_off; + + status = AcpiEvaluateObject(sc->light_handle, NULL, + &Args, NULL); + if (ACPI_SUCCESS(status)) + sc->light_val = arg; + return (status); + } + + return (0); +} + +static int +acpi_ibm_volume_set(struct acpi_ibm_softc *sc, int arg) +{ + int val, step; + UINT64 val_ec; + ACPI_OBJECT Arg; + ACPI_OBJECT_LIST Args; + ACPI_STATUS status; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + ACPI_SERIAL_ASSERT(ibm); + + if (arg < 0 || arg > 14) + return (EINVAL); + + /* Read the current volume */ + status = ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); + if (ACPI_FAILURE(status)) + return (status); + + if (sc->cmos_handle) { + val = val_ec & IBM_EC_MASK_VOL; + + Args.Count = 1; + Args.Pointer = &Arg; + Arg.Type = ACPI_TYPE_INTEGER; + Arg.Integer.Value = (arg > val) ? IBM_CMOS_VOLUME_UP : + IBM_CMOS_VOLUME_DOWN; + + step = (arg > val) ? 1 : -1; + for (int i = val; i != arg; i += step) { + status = AcpiEvaluateObject(sc->cmos_handle, NULL, + &Args, NULL); + if (ACPI_FAILURE(status)) { + /* Record the last value */ + if (i != val) { + val_ec = i - step + + (val_ec & (~IBM_EC_MASK_VOL)); + ACPI_EC_WRITE(sc->ec_dev, IBM_EC_VOLUME, + val_ec, 1); + } + return (status); + } + } + } + + val_ec = arg + (val_ec & (~IBM_EC_MASK_VOL)); + return ACPI_EC_WRITE(sc->ec_dev, IBM_EC_VOLUME, val_ec, 1); +} + +static int +acpi_ibm_mute_set(struct acpi_ibm_softc *sc, int arg) +{ + UINT64 val_ec; + ACPI_OBJECT Arg; + ACPI_OBJECT_LIST Args; + ACPI_STATUS status; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + ACPI_SERIAL_ASSERT(ibm); + + if (arg < 0 || arg > 1) + return (EINVAL); + + status = ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); + if (ACPI_FAILURE(status)) + return (status); + + if (sc->cmos_handle) { + Args.Count = 1; + Args.Pointer = &Arg; + Arg.Type = ACPI_TYPE_INTEGER; + Arg.Integer.Value = IBM_CMOS_VOLUME_MUTE; + + status = AcpiEvaluateObject(sc->cmos_handle, NULL, &Args, NULL); + if (ACPI_FAILURE(status)) + return (status); + } + + val_ec = (arg == 1) ? val_ec | IBM_EC_MASK_MUTE : + val_ec & (~IBM_EC_MASK_MUTE); + return ACPI_EC_WRITE(sc->ec_dev, IBM_EC_VOLUME, val_ec, 1); +} + +static void +acpi_ibm_eventhandler(struct acpi_ibm_softc *sc, int arg) +{ + int val; + UINT64 val_ec; + ACPI_STATUS status; + + ACPI_SERIAL_BEGIN(ibm); + switch (arg) { + case IBM_EVENT_SUSPEND_TO_RAM: + power_pm_suspend(POWER_SLEEP_STATE_SUSPEND); + break; + + case IBM_EVENT_BLUETOOTH: + acpi_ibm_bluetooth_set(sc, (sc->wlan_bt_flags == 0)); + break; + + case IBM_EVENT_BRIGHTNESS_UP: + case IBM_EVENT_BRIGHTNESS_DOWN: + /* Read the current brightness */ + status = ACPI_EC_READ(sc->ec_dev, IBM_EC_BRIGHTNESS, + &val_ec, 1); + if (ACPI_FAILURE(status)) + return; + + val = val_ec & IBM_EC_MASK_BRI; + val = (arg == IBM_EVENT_BRIGHTNESS_UP) ? val + 1 : val - 1; + acpi_ibm_brightness_set(sc, val); + break; + + case IBM_EVENT_THINKLIGHT: + acpi_ibm_thinklight_set(sc, (sc->light_val == 0)); + break; + + case IBM_EVENT_VOLUME_UP: + case IBM_EVENT_VOLUME_DOWN: + /* Read the current volume */ + status = ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); + if (ACPI_FAILURE(status)) + return; + + val = val_ec & IBM_EC_MASK_VOL; + val = (arg == IBM_EVENT_VOLUME_UP) ? val + 1 : val - 1; + acpi_ibm_volume_set(sc, val); + break; + + case IBM_EVENT_MUTE: + /* Read the current value */ + status = ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); + if (ACPI_FAILURE(status)) + return; + + val = ((val_ec & IBM_EC_MASK_MUTE) == IBM_EC_MASK_MUTE); + acpi_ibm_mute_set(sc, (val == 0)); + break; + + default: + break; + } + ACPI_SERIAL_END(ibm); +} + static void acpi_ibm_notify(ACPI_HANDLE h, UINT32 notify, void *context) { @@ -965,6 +1246,10 @@ acpi_ibm_notify(ACPI_HANDLE h, UINT32 no break; } + /* Execute event handler */ + if (sc->handler_events & (1 << (arg - 1))) + acpi_ibm_eventhandler(sc, (arg & 0xff)); + /* Notify devd(8) */ acpi_UserNotify("IBM", h, (arg & 0xff)); break; From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 15:30:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A8521065674; Tue, 26 Jun 2012 15:30:36 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9F198FC17; Tue, 26 Jun 2012 15:30:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QFUZLp048288; Tue, 26 Jun 2012 15:30:35 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QFUZoM048286; Tue, 26 Jun 2012 15:30:35 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201206261530.q5QFUZoM048286@svn.freebsd.org> From: Mitsuru IWASAKI Date: Tue, 26 Jun 2012 15:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237603 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 15:30:36 -0000 Author: iwasaki Date: Tue Jun 26 15:30:35 2012 New Revision: 237603 URL: http://svn.freebsd.org/changeset/base/237603 Log: MFC 237494: - Add description about dev.acpi_ibm.0.handlerevents. Modified: stable/9/share/man/man4/acpi_ibm.4 Directory Properties: stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/acpi_ibm.4 ============================================================================== --- stable/9/share/man/man4/acpi_ibm.4 Tue Jun 26 15:29:38 2012 (r237602) +++ stable/9/share/man/man4/acpi_ibm.4 Tue Jun 26 15:30:35 2012 (r237603) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2010 +.Dd June 24, 2012 .Dt ACPI_IBM 4 .Os .Sh NAME @@ -335,6 +335,17 @@ Built-in battery .It UltraBay battery .El +.It Va dev.acpi_ibm.0.handlerevents +.Xr devd 8 +events handled by +.Nm +when +.Va events +is set to 1. +Events are specified as a whitespace-separated list of event code in +hexadecimal or decimal form. +Note that the event maybe handled twice (eg. Brightness up/down) if ACPI BIOS +already handled the event. .El .Pp Defaults for these sysctls can be set in @@ -436,6 +447,20 @@ then fi exit 0 .Ed +.Pp +The following example specify that event code 0x04 (Suspend to RAM), +0x10 (Brightness up) and 0x11 (Brightness down) are handled by +.Nm . +.Bd -literal -offset indent +sysctl dev.acpi_ibm.0.handlerevents='0x04 0x10 0x11' +.Ed +.Pp +in +.Xr sysctl.conf 5 : +.Bd -literal -offset indent +dev.acpi_ibm.0.handlerevents=0x04\\ 0x10\\ 0x11 +.Ed +.Pp .Sh SEE ALSO .Xr acpi 4 , .Xr led 4 , From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 16:45:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12F981065676; Tue, 26 Jun 2012 16:45:19 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA7A88FC08; Tue, 26 Jun 2012 16:45:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QGjI19051359; Tue, 26 Jun 2012 16:45:18 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QGjIa6051357; Tue, 26 Jun 2012 16:45:18 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201206261645.q5QGjIa6051357@svn.freebsd.org> From: Alan Cox Date: Tue, 26 Jun 2012 16:45: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: r237604 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 16:45:19 -0000 Author: alc Date: Tue Jun 26 16:45:18 2012 New Revision: 237604 URL: http://svn.freebsd.org/changeset/base/237604 Log: Introduce RELEASE_PV_LIST_LOCK(). Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Jun 26 15:30:35 2012 (r237603) +++ head/sys/amd64/amd64/pmap.c Tue Jun 26 16:45:18 2012 (r237604) @@ -189,6 +189,15 @@ __FBSDID("$FreeBSD$"); #define CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m) \ CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, VM_PAGE_TO_PHYS(m)) +#define RELEASE_PV_LIST_LOCK(lockp) do { \ + struct rwlock **_lockp = (lockp); \ + \ + if (*_lockp != NULL) { \ + rw_wunlock(*_lockp); \ + *_lockp = NULL; \ + } \ +} while (0) + #define VM_PAGE_TO_PV_LIST_LOCK(m) \ PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)) @@ -1714,10 +1723,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { if (lockp != NULL) { - if (*lockp != NULL) { - rw_wunlock(*lockp); - *lockp = NULL; - } + RELEASE_PV_LIST_LOCK(lockp); PMAP_UNLOCK(pmap); rw_runlock(&pvh_global_lock); VM_WAIT; @@ -2133,10 +2139,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str pmap = pc->pc_pmap; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) { - if (*lockp != NULL) { - rw_wunlock(*lockp); - *lockp = NULL; - } + RELEASE_PV_LIST_LOCK(lockp); PMAP_LOCK(pmap); } else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) { From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 18:08:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6CE2106566B; Tue, 26 Jun 2012 18:08:04 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91E788FC19; Tue, 26 Jun 2012 18:08:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QI84fW054765; Tue, 26 Jun 2012 18:08:04 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QI84Ih054761; Tue, 26 Jun 2012 18:08:04 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <201206261808.q5QI84Ih054761@svn.freebsd.org> From: Takanori Watanabe Date: Tue, 26 Jun 2012 18:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237605 - in head/sys: dev/nand modules/nand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 18:08:04 -0000 Author: takawata Date: Tue Jun 26 18:08:03 2012 New Revision: 237605 URL: http://svn.freebsd.org/changeset/base/237605 Log: Add nand core module and module dependency information. Reviewed by:gber Added: head/sys/modules/nand/ head/sys/modules/nand/Makefile (contents, props changed) Modified: head/sys/dev/nand/nand.c head/sys/dev/nand/nandsim.c Modified: head/sys/dev/nand/nand.c ============================================================================== --- head/sys/dev/nand/nand.c Tue Jun 26 16:45:18 2012 (r237604) +++ head/sys/dev/nand/nand.c Tue Jun 26 18:08:03 2012 (r237605) @@ -830,3 +830,5 @@ nand_erase_blocks(struct nand_chip *chip return (err); } + +MODULE_VERSION(nand, 1); Modified: head/sys/dev/nand/nandsim.c ============================================================================== --- head/sys/dev/nand/nandsim.c Tue Jun 26 16:45:18 2012 (r237604) +++ head/sys/dev/nand/nandsim.c Tue Jun 26 18:08:03 2012 (r237605) @@ -663,3 +663,5 @@ nandsim_modevent(module_t mod __unused, DEV_MODULE(nandsim, nandsim_modevent, NULL); MODULE_VERSION(nandsim, 1); +MODULE_DEPEND(nandsim, nand, 1, 1, 1); +MODULE_DEPEND(nandsim, alq, 1, 1, 1); Added: head/sys/modules/nand/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/nand/Makefile Tue Jun 26 18:08:03 2012 (r237605) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/nand + +KMOD = nand +SRCS= nand.c nand_bbt.c nand_cdev.c nand_generic.c nand_geom.c \ + nand_id.c nandbus.c nandbus_if.c nand_if.c nfc_if.c \ + nand_if.h device_if.h bus_if.h nfc_if.h nandbus_if.h + +MFILES= kern/bus_if.m kern/device_if.m dev/nand/nfc_if.m \ + dev/nand/nand_if.m dev/nand/nandbus_if.m + +.include From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 20:38:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72E85106566B; Tue, 26 Jun 2012 20:38:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF7E8FC1D; Tue, 26 Jun 2012 20:38:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QKcsca060962; Tue, 26 Jun 2012 20:38:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QKcsDo060947; Tue, 26 Jun 2012 20:38:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206262038.q5QKcsDo060947@svn.freebsd.org> From: Xin LI Date: Tue, 26 Jun 2012 20:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237607 - vendor/less/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 20:38:54 -0000 Author: delphij Date: Tue Jun 26 20:38:53 2012 New Revision: 237607 URL: http://svn.freebsd.org/changeset/base/237607 Log: Vendor import of less v449 (beta). Modified: vendor/less/dist/LICENSE vendor/less/dist/Makefile.aut vendor/less/dist/NEWS vendor/less/dist/README vendor/less/dist/brac.c vendor/less/dist/ch.c vendor/less/dist/charset.c vendor/less/dist/charset.h vendor/less/dist/cmd.h vendor/less/dist/cmdbuf.c vendor/less/dist/command.c vendor/less/dist/configure vendor/less/dist/configure.ac vendor/less/dist/cvt.c vendor/less/dist/decode.c vendor/less/dist/defines.ds vendor/less/dist/defines.h.in vendor/less/dist/defines.o2 vendor/less/dist/defines.o9 vendor/less/dist/defines.wn vendor/less/dist/edit.c vendor/less/dist/filename.c vendor/less/dist/forwback.c vendor/less/dist/help.c vendor/less/dist/ifile.c vendor/less/dist/input.c vendor/less/dist/jump.c vendor/less/dist/less.h vendor/less/dist/less.hlp vendor/less/dist/less.man vendor/less/dist/less.nro vendor/less/dist/lessecho.c vendor/less/dist/lessecho.man vendor/less/dist/lessecho.nro vendor/less/dist/lesskey.c vendor/less/dist/lesskey.h vendor/less/dist/lesskey.man vendor/less/dist/lesskey.nro vendor/less/dist/lglob.h vendor/less/dist/line.c vendor/less/dist/linenum.c vendor/less/dist/lsystem.c vendor/less/dist/main.c vendor/less/dist/mark.c vendor/less/dist/mkhelp.c vendor/less/dist/optfunc.c vendor/less/dist/option.c vendor/less/dist/option.h vendor/less/dist/opttbl.c vendor/less/dist/os.c vendor/less/dist/output.c vendor/less/dist/pattern.c vendor/less/dist/pattern.h vendor/less/dist/pckeys.h vendor/less/dist/position.c vendor/less/dist/position.h vendor/less/dist/prompt.c vendor/less/dist/screen.c vendor/less/dist/scrsize.c vendor/less/dist/search.c vendor/less/dist/signal.c vendor/less/dist/tags.c vendor/less/dist/ttyin.c vendor/less/dist/version.c Modified: vendor/less/dist/LICENSE ============================================================================== --- vendor/less/dist/LICENSE Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/LICENSE Tue Jun 26 20:38:53 2012 (r237607) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2011 Mark Nudelman +Copyright (C) 1984-2012 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: vendor/less/dist/Makefile.aut ============================================================================== --- vendor/less/dist/Makefile.aut Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/Makefile.aut Tue Jun 26 20:38:53 2012 (r237607) @@ -1,6 +1,6 @@ # Makefile for authoring less. -EMAIL = markn@greenwoodsoftware.com +EMAIL = bug-less@gnu.org HOMEPAGE = http://www.greenwoodsoftware.com/less SHELL = /bin/sh RCS = rcs @@ -112,8 +112,7 @@ dist: ${DISTFILES} echo "Preparing $$REL"; \ rm -rf $$REL; mkdir $$REL; \ for file in ${DISTFILES}; do \ - cp -p $$file $$REL; \ - chmod -w $$REL/$$file; \ + ./add_copyright $$file $$REL; \ done; \ cd $$REL; chmod +w ${DISTFILES_W}; cd ..; \ echo "Creating release/$$REL/$$REL.tar.gz"; \ Modified: vendor/less/dist/NEWS ============================================================================== --- vendor/less/dist/NEWS Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/NEWS Tue Jun 26 20:38:53 2012 (r237607) @@ -7,8 +7,34 @@ http://www.greenwoodsoftware.com/less You can also download the latest version of less from there. - To report bugs, suggestions or comments, send email to - bug-less@gnu.org or markn@greenwoodsoftware.com. + To report bugs, suggestions or comments, send email to bug-less@gnu.org. + +====================================================================== + + Major changes between "less" versions 444 and 449 + +* Add ESC-F command to keep reading data until a pattern is found. + +* Use exit code of LESSOPEN script if LESSOPEN starts with "||". + +* When up/down arrow is used on the command line immediately after + typing text, the next command starting with that text is found. + +* Add support for GNU regex. + +* Add configure option --with-regex=none and fix compile errors + when compiling with no regex library. + +* Fix bugs handling SGR sequences in Win32. + +* Fix possible crashes caused by malformed LESSOPEN or + LESSCLOSE variables. + +* Fix bug highlighting text which is discontiguous in the file + due to backspace processing. + +* Fix bug in displaying status column when scrolling backwards + with -J and -S in effect. ====================================================================== Modified: vendor/less/dist/README ============================================================================== --- vendor/less/dist/README Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/README Tue Jun 26 20:38:53 2012 (r237607) @@ -1,7 +1,7 @@ - Less, version 444 + Less, version 449 - This is the distribution of less, version 444, released 09 Jun 2011. + This is the distribution of less, version 449, released 26 Jun 2012. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -13,7 +13,7 @@ or 2. The Less License, in the file LICENSE. - Please report any problems to bug-less@gnu.org or markn@greenwoodsoftware.com. + Please report any problems to bug-less@gnu.org. See http://www.greenwoodsoftware.com/less for the latest info. ========================================================================= @@ -52,10 +52,11 @@ INSTALLATION (Unix systems only): regcomp Use the V8-compatible regcomp. regcomp-local Use Henry Spencer's V8-compatible regcomp (source is supplied with less). + none No regular expressions, only simple string matching. --with-secure Builds a "secure" version of less, with some features disabled - to prevent users from viewing other files, accessing shell - commands, etc. + to prevent users from viewing other files, accessing shell + commands, etc. 3. It is a good idea to look over the generated Makefile and defines.h @@ -88,7 +89,7 @@ INSTALLATION (Unix systems only): bindir and/or mandir to the appropriate directories. If you have any problems building or running "less", suggestions, -complaints, etc., you may mail to the author at markn@greenwoodsoftware.com. +complaints, etc., you may mail to bug-less@gnu.org. Note to hackers: comments noting possible improvements are enclosed in double curly brackets {{ like this }}. Modified: vendor/less/dist/brac.c ============================================================================== --- vendor/less/dist/brac.c Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/brac.c Tue Jun 26 20:38:53 2012 (r237607) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/ch.c ============================================================================== --- vendor/less/dist/ch.c Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/ch.c Tue Jun 26 20:38:53 2012 (r237607) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -582,6 +581,8 @@ ch_length() return (NULL_POSITION); if (ch_flags & CH_HELPFILE) return (size_helpdata); + if (ch_flags & CH_NODATA) + return (0); return (ch_fsize); } Modified: vendor/less/dist/charset.c ============================================================================== --- vendor/less/dist/charset.c Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/charset.c Tue Jun 26 20:38:53 2012 (r237607) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/charset.h ============================================================================== --- vendor/less/dist/charset.h Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/charset.h Tue Jun 26 20:38:53 2012 (r237607) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 2005-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #define IS_ASCII_OCTET(c) (((c) & 0x80) == 0) #define IS_UTF8_TRAIL(c) (((c) & 0xC0) == 0x80) Modified: vendor/less/dist/cmd.h ============================================================================== --- vendor/less/dist/cmd.h Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/cmd.h Tue Jun 26 20:38:53 2012 (r237607) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #define MAX_USERCMD 500 @@ -66,6 +65,7 @@ #define A_NEXT_TAG 53 #define A_PREV_TAG 54 #define A_FILTER 55 +#define A_F_UNTIL_HILITE 56 #define A_INVALID 100 #define A_NOACTION 101 @@ -78,7 +78,7 @@ #define A_EXTRA 0200 -/* Line editting characters */ +/* Line editing characters */ #define EC_BACKSPACE 1 #define EC_LINEKILL 2 Modified: vendor/less/dist/cmdbuf.c ============================================================================== --- vendor/less/dist/cmdbuf.c Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/cmdbuf.c Tue Jun 26 20:38:53 2012 (r237607) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -30,6 +29,7 @@ static int prompt_col; /* Column of cur static char *cp; /* Pointer into cmdbuf */ static int cmd_offset; /* Index into cmdbuf of first displayed char */ static int literal; /* Next input char should not be interpreted */ +static int updown_match = -1; /* Prefix length in up/down movement */ #if TAB_COMPLETE_FILENAME static int cmd_complete(); @@ -122,6 +122,7 @@ cmd_reset() cmd_offset = 0; literal = 0; cmd_mbc_buf_len = 0; + updown_match = -1; } /* @@ -132,6 +133,7 @@ clear_cmd() { cmd_col = prompt_col = 0; cmd_mbc_buf_len = 0; + updown_match = -1; } /* @@ -504,6 +506,7 @@ cmd_ichar(cs, clen) /* * Reprint the tail of the line from the inserted char. */ + updown_match = -1; cmd_repaint(cp); cmd_right(); return (CC_OK); @@ -547,6 +550,7 @@ cmd_erase() /* * Repaint the buffer after the erased char. */ + updown_match = -1; cmd_repaint(cp); /* @@ -643,6 +647,7 @@ cmd_kill() cmd_offset = 0; cmd_home(); *cp = '\0'; + updown_match = -1; cmd_repaint(cp); /* @@ -675,12 +680,15 @@ set_mlist(mlist, cmdflags) #if CMD_HISTORY /* * Move up or down in the currently selected command history list. + * Only consider entries whose first updown_match chars are equal to + * cmdbuf's corresponding chars. */ static int cmd_updown(action) int action; { char *s; + struct mlist *ml; if (curr_mlist == NULL) { @@ -690,24 +698,47 @@ cmd_updown(action) bell(); return (CC_OK); } - cmd_home(); - clear_eol(); + + if (updown_match < 0) + { + updown_match = cp - cmdbuf; + } + /* - * Move curr_mp to the next/prev entry. + * Find the next history entry which matches. */ - if (action == EC_UP) - curr_mlist->curr_mp = curr_mlist->curr_mp->prev; - else - curr_mlist->curr_mp = curr_mlist->curr_mp->next; - /* - * Copy the entry into cmdbuf and echo it on the screen. - */ - s = curr_mlist->curr_mp->string; - if (s == NULL) - s = ""; - strcpy(cmdbuf, s); - for (cp = cmdbuf; *cp != '\0'; ) - cmd_right(); + for (ml = curr_mlist->curr_mp;;) + { + ml = (action == EC_UP) ? ml->prev : ml->next; + if (ml == curr_mlist) + { + /* + * We reached the end (or beginning) of the list. + */ + break; + } + if (strncmp(cmdbuf, ml->string, updown_match) == 0) + { + /* + * This entry matches; stop here. + * Copy the entry into cmdbuf and echo it on the screen. + */ + curr_mlist->curr_mp = ml; + s = ml->string; + if (s == NULL) + s = ""; + strcpy(cmdbuf, s); + cmd_home(); + clear_eol(); + for (cp = cmdbuf; *cp != '\0'; ) + cmd_right(); + return (CC_OK); + } + } + /* + * We didn't find a history entry that matches. + */ + bell(); return (CC_OK); } #endif @@ -1457,9 +1488,6 @@ save_cmdhist() FILE *f; int modified = 0; - filename = histfile_name(); - if (filename == NULL) - return; if (mlist_search.modified) modified = 1; #if SHELL_ESCAPE || PIPEC @@ -1468,6 +1496,9 @@ save_cmdhist() #endif if (!modified) return; + filename = histfile_name(); + if (filename == NULL) + return; f = fopen(filename, "w"); free(filename); if (f == NULL) Modified: vendor/less/dist/command.c ============================================================================== --- vendor/less/dist/command.c Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/command.c Tue Jun 26 20:38:53 2012 (r237607) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -36,6 +35,7 @@ extern int ignore_eoi; extern int secure; extern int hshift; extern int show_attn; +extern POSITION highest_hilite; extern char *every_first_cmd; extern char *curr_altfilename; extern char version[]; @@ -102,8 +102,8 @@ cmd_exec() static void start_mca(action, prompt, mlist, cmdflags) int action; - char *prompt; - void *mlist; + constant char *prompt; + constant void *mlist; int cmdflags; { mca = action; @@ -680,7 +680,7 @@ make_display() static void prompt() { - register char *p; + register constant char *p; if (ungot != NULL) { @@ -956,6 +956,44 @@ multi_search(pattern, n) } /* + * Forward forever, or until a highlighted line appears. + */ + static int +forw_loop(until_hilite) + int until_hilite; +{ + POSITION curr_len; + + if (ch_getflags() & CH_HELPFILE) + return (A_NOACTION); + + cmd_exec(); + jump_forw(); + curr_len = ch_length(); + highest_hilite = until_hilite ? curr_len : NULL_POSITION; + ignore_eoi = 1; + while (!sigs) + { + if (until_hilite && highest_hilite > curr_len) + { + bell(); + break; + } + make_display(); + forward(1, 0, 0); + } + ignore_eoi = 0; + + /* + * This gets us back in "F mode" after processing + * a non-abort signal (e.g. window-change). + */ + if (sigs && !ABORT_SIGS()) + return (A_F_FOREVER); + return (A_NOACTION); +} + +/* * Main command processor. * Accept and execute commands until a quit command. */ @@ -973,6 +1011,7 @@ commands() IFILE old_ifile; IFILE new_ifile; char *tagfile; + int until_hilite = 0; search_type = SRCH_FORW; wscroll = (sc_height + 1) / 2; @@ -1200,23 +1239,11 @@ commands() /* * Forward forever, ignoring EOF. */ - if (ch_getflags() & CH_HELPFILE) - break; - cmd_exec(); - jump_forw(); - ignore_eoi = 1; - while (!sigs) - { - make_display(); - forward(1, 0, 0); - } - ignore_eoi = 0; - /* - * This gets us back in "F mode" after processing - * a non-abort signal (e.g. window-change). - */ - if (sigs && !ABORT_SIGS()) - newaction = A_F_FOREVER; + newaction = forw_loop(0); + break; + + case A_F_UNTIL_HILITE: + newaction = forw_loop(1); break; case A_F_SCROLL: Modified: vendor/less/dist/configure ============================================================================== --- vendor/less/dist/configure Tue Jun 26 19:07:05 2012 (r237606) +++ vendor/less/dist/configure Tue Jun 26 20:38:53 2012 (r237607) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for less 1. +# Generated by GNU Autoconf 2.68 for less 1. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -89,6 +89,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -214,11 +215,18 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -1067,7 +1075,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1281,7 +1289,7 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-secure Compile in secure mode --with-no-float Do not use floating point - --with-regex={auto,pcre,posix,regcmp,re_comp,regcomp,regcomp-local} Select a regular expression library auto + --with-regex={auto,gnu,pcre,posix,regcmp,re_comp,regcomp,regcomp-local,none} Select a regular expression library auto --with-editor=PROGRAM use PROGRAM as the default editor vi Some influential environment variables: @@ -1361,7 +1369,7 @@ test -n "$ac_init_help" && exit $ac_stat if $ac_init_version; then cat <<\_ACEOF less configure 1 -generated by GNU Autoconf 2.67 +generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1407,7 +1415,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1453,7 +1461,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1490,7 +1498,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1532,7 +1540,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1545,10 +1553,10 @@ fi ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1611,7 +1619,7 @@ $as_echo "$as_me: WARNING: $2: proceedin esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1620,7 +1628,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -1633,7 +1641,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1651,7 +1659,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1664,7 +1672,7 @@ ac_fn_c_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -1705,7 +1713,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -1717,7 +1725,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1772,7 +1780,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF @@ -1780,7 +1788,7 @@ This file contains any messages produced running configure, to aid debugging if configure makes a mistake. It was created by less $as_me 1, which was -generated by GNU Autoconf 2.67. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2142,7 +2150,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2182,7 +2190,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2235,7 +2243,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2275,7 +2283,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2334,7 +2342,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2378,7 +2386,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2661,7 +2669,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_ex ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2712,7 +2720,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2749,7 +2757,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -2827,7 +2835,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -2925,7 +2933,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } -if test "${ac_cv_search_strerror+set}" = set; then : +if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -2959,11 +2967,11 @@ for ac_lib in '' cposix; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_strerror+set}" = set; then : + if ${ac_cv_search_strerror+:} false; then : break fi done -if test "${ac_cv_search_strerror+set}" = set; then : +if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no @@ -2991,7 +2999,7 @@ if test -n "$CPP" && test -d "$CPP"; the CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -3119,7 +3127,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -3182,7 +3190,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -3250,7 +3258,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } -if test "${ac_cv_prog_gcc_traditional+set}" = set; then : +if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" @@ -3335,7 +3343,7 @@ ac_configure="$SHELL $ac_aux_dir/configu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3422,7 +3430,7 @@ if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then : +if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no @@ -3473,7 +3481,7 @@ $as_echo "$ac_cv_sys_largefile_CC" >&6; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then : +if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -3542,7 +3550,7 @@ rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then : +if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -3615,7 +3623,7 @@ fi # Checks for general libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgoto in -ltinfo" >&5 $as_echo_n "checking for tgoto in -ltinfo... " >&6; } -if test "${ac_cv_lib_tinfo_tgoto+set}" = set; then : +if ${ac_cv_lib_tinfo_tgoto+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3649,7 +3657,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgoto" >&5 $as_echo "$ac_cv_lib_tinfo_tgoto" >&6; } -if test "x$ac_cv_lib_tinfo_tgoto" = x""yes; then : +if test "x$ac_cv_lib_tinfo_tgoto" = xyes; then : have_tinfo=yes else have_tinfo=no @@ -3657,7 +3665,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lxcurses" >&5 $as_echo_n "checking for initscr in -lxcurses... " >&6; } -if test "${ac_cv_lib_xcurses_initscr+set}" = set; then : +if ${ac_cv_lib_xcurses_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3691,7 +3699,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xcurses_initscr" >&5 $as_echo "$ac_cv_lib_xcurses_initscr" >&6; } -if test "x$ac_cv_lib_xcurses_initscr" = x""yes; then : +if test "x$ac_cv_lib_xcurses_initscr" = xyes; then : have_xcurses=yes else have_xcurses=no @@ -3699,7 +3707,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncursesw" >&5 $as_echo_n "checking for initscr in -lncursesw... " >&6; } -if test "${ac_cv_lib_ncursesw_initscr+set}" = set; then : +if ${ac_cv_lib_ncursesw_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3733,7 +3741,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_initscr" >&5 $as_echo "$ac_cv_lib_ncursesw_initscr" >&6; } -if test "x$ac_cv_lib_ncursesw_initscr" = x""yes; then : +if test "x$ac_cv_lib_ncursesw_initscr" = xyes; then : have_ncursesw=yes else have_ncursesw=no @@ -3741,7 +3749,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 $as_echo_n "checking for initscr in -lncurses... " >&6; } -if test "${ac_cv_lib_ncurses_initscr+set}" = set; then : +if ${ac_cv_lib_ncurses_initscr+:} false; then : $as_echo_n "(cached) " >&6 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 20:39:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EC920106568D; Tue, 26 Jun 2012 20:39:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE5918FC24; Tue, 26 Jun 2012 20:39:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QKdT2V061019; Tue, 26 Jun 2012 20:39:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QKdT2k061018; Tue, 26 Jun 2012 20:39:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206262039.q5QKdT2k061018@svn.freebsd.org> From: Xin LI Date: Tue, 26 Jun 2012 20:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237608 - vendor/less/v449 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 20:39:30 -0000 Author: delphij Date: Tue Jun 26 20:39:29 2012 New Revision: 237608 URL: http://svn.freebsd.org/changeset/base/237608 Log: Tag less v449. Added: vendor/less/v449/ - copied from r237607, vendor/less/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 21:14:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C98C1106564A; Tue, 26 Jun 2012 21:14:53 +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 3097A8FC1A; Tue, 26 Jun 2012 21:14:53 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q5QLEjpp066251; Tue, 26 Jun 2012 23:14:45 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q5QLEjT7066250; Tue, 26 Jun 2012 23:14:45 +0200 (CEST) (envelope-from marius) Date: Tue, 26 Jun 2012 23:14:45 +0200 From: Marius Strobl To: John Baldwin Message-ID: <20120626211445.GB63893@alchemy.franken.de> References: <201206131504.q5DF4opt031336@svn.freebsd.org> <201206251000.09052.jhb@freebsd.org> <20120625170811.GI69382@alchemy.franken.de> <201206251424.24621.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201206251424.24621.jhb@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: r237008 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 21:14:53 -0000 On Mon, Jun 25, 2012 at 02:24:24PM -0400, John Baldwin wrote: > On Monday, June 25, 2012 1:08:11 pm Marius Strobl wrote: > > On Mon, Jun 25, 2012 at 10:00:08AM -0400, John Baldwin wrote: > > > On Saturday, June 23, 2012 6:16:26 pm Marius Strobl wrote: > > > > On Wed, Jun 13, 2012 at 03:04:50PM +0000, John Baldwin wrote: > > > > > Author: jhb > > > > > Date: Wed Jun 13 15:04:50 2012 > > > > > New Revision: 237008 > > > > > URL: http://svn.freebsd.org/changeset/base/237008 > > > > > > > > > > Log: > > > > > Fix a couple of bugs that prevented windows in PCI-PCI bridges from > > > > > growing "downward" (moving the start address down). First, an off by > > > > > one error caused the end address to be moved down an extra alignment > > > > > chunk unnecessarily. Second, when aligning the new candidate starting > > > > > address, the wrong bits were masked off. > > > > > > > > > > > > > Unfortunately, this now panics a sparc64 machine on the first attempt > > > > to use a grown resource via bus_space(9) for me: > > > > pcib3: at device 0.0 on pci2 > > > > pcib2: allocated I/O port range (0x1000-0x1fff) for rid 1c of pcib3 > > > > pcib2: allocated memory range (0x200000-0x3ffffff) for rid 20 of pcib3 > > > > pcib3: domain 0 > > > > pcib3: secondary bus 5 > > > > pcib3: subordinate bus 5 > > > > pcib3: I/O decode 0x1000-0x1fff > > > > pcib3: memory decode 0x200000-0x3ffffff > > > > pcib3: no prefetched decode > > > > pcib3: Subtractively decoded bridge. > > > > <...> > > > > pci3: on pcib3 > > > > <...> > > > > isab0: at device 30.0 on pci3 > > > > isa0: on isab0 > > > > <...> > > > > rtc0: at port 0x70-0x73 on isa0 > > > > pcib3: attempting to grow I/O port window for (0x70-0x73,0x4) > > > > front candidate range: 0x70-0x73 > > > > pcib3: grew I/O port window to 0x70-0x1fff > > > > panic: start address is not aligned > > > > Alternatively, this may also be a data access trap, which also indicates > > > > that some invalid address being used for the access. > > > > > > I think this was fixed in the next commit to this file (I had gotten the > > > mask bits on 'front' wrong). Yes, it should be fixed by r237271: > > > > > > Old version: > > > > > > (gdb) p/x (0x70 & (~(1ul << 12) - 1)) > > > $1 = 0x70 > > > > > > Fixed version: > > > > > > (gdb) p/x (0x70 & (~((1ul << 12) - 1))) > > > $2 = 0x0 > > > > Well, a stock r237433 still panics with a data access trap when > > trying to use the resource via bus_space(9). So while the math for > > growing the window is probably right now, there still is a problem. > > Hmm. It would be interesting to know if it used to grow before (it might > not have due to the bugs I fixed in the growing code). Prior to r237008 growing was attempted but failed due to the bug. See the "before:" snippet in my original email. > > > > > > > > before: > > > > rtc0: at port 0x70-0x73 on isa0 > > > > pcib3: attempting to grow I/O port window for (0x70-0x73,0x4) > > > > pcib2: allocated I/O port range (0x70-0x73) for rid 0 of rtc0 > > > > > > > > Shouldn't a subtractively decoded resource actually be outside of > > > > the window of the parent PCI-PCI bridge, i.e. it seems we shouldn't > > > > try to grow the window in that case? The below patch fixes this for > > > > me, I'm not sure whether that actually is the right approach though. > > > > > > Well, I've seen subtractive bridges with programmed windows, and the resource > > > will decode properly either way. What the current code does is allow the > > > request to pass up the tree if growing fails. > > > > By growing the window to 0x0-0x1fff in this case we are effectively > > turning the formerly subtractively decoded resource in a positively > > decodeded one. Maybe there's some additional bit, probably in the > > PCI-ISA bridge, that needs to be switch for that, too? In any case, > > growing the window in this case and by that changing the type of > > decoding seems like a strange approach to me. Why do subtractive > > decoders exist in the first place when the windows alternatively > > could be grown/set up to only just do positive decoding instead? > > The PCI-ISA bridge should already be decoding that range. Note that > subtractive decoding is slower (it has to wait for an extra cycle to > give other devices a chance to snag a request). I would not mind a > tunable to control growing or not growing a window on a subtractively > decoded bridge. Does the firmware assign a window to this bridge > btw? We probably should not allocate a new window for a subtractively > decoded bridge, but if the firmware has already assigned a window, > growing an existing window seems less problematic. > Yes, it does but switching to positive decoding nevertheless is problematic in this case. According to the PCI 2.3 specification, a child wanting its addresses to be decoded subtractively needs to provide special DEVSEL# behavior. It seems that it should work for a bridge to actually positively decoding such transactions, but I'm not familiar with the physical layer of PCI and thus not sure. On the other hand, both the PCI-ISA and PCI-PCI bridges in question are ALi/ULi crap and based on fun I had with their chips in the past, I also wouldn't be surprised their again being a magic bit in the configuration space needing to be set to make this work. Unfortunately, I don't have a datasheet for this M5249 PCI-PCI bridge. If we'd implement a tunable for changing the decoding of subtractive bridges, the way to go would seem to be to have it off by default in order to preserve pre-NEW_PCIB/ r237008 as at this time it's unknown how many bridges are affected. If you'd want to keep the new/current behavior by default, introducing something like a PCIB_SUBTRACTIVE_FORCED flag along a PCI_QUIRK_SUB_FORCED quirk in addition to a tuneable defaulting to on probably would be a good idea. From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 21:45:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F1621065756; Tue, 26 Jun 2012 21:45:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 077998FC1E; Tue, 26 Jun 2012 21:45:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QLjlSm064004; Tue, 26 Jun 2012 21:45:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QLjlht064002; Tue, 26 Jun 2012 21:45:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206262145.q5QLjlht064002@svn.freebsd.org> From: Xin LI Date: Tue, 26 Jun 2012 21:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237610 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 21:45:48 -0000 Author: delphij Date: Tue Jun 26 21:45:47 2012 New Revision: 237610 URL: http://svn.freebsd.org/changeset/base/237610 Log: MFC r235036: Add ToS definitions for DiffServ Codepoints as per RFC2474. Obtained from: OpenBSD Modified: stable/8/sys/netinet/ip.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ip.h ============================================================================== --- stable/8/sys/netinet/ip.h Tue Jun 26 21:20:54 2012 (r237609) +++ stable/8/sys/netinet/ip.h Tue Jun 26 21:45:47 2012 (r237610) @@ -92,6 +92,31 @@ struct ip { #define IPTOS_PREC_ROUTINE 0x00 /* + * Definitions for DiffServ Codepoints as per RFC2474 + */ +#define IPTOS_DSCP_CS0 0x00 +#define IPTOS_DSCP_CS1 0x20 +#define IPTOS_DSCP_AF11 0x28 +#define IPTOS_DSCP_AF12 0x30 +#define IPTOS_DSCP_AF13 0x38 +#define IPTOS_DSCP_CS2 0x40 +#define IPTOS_DSCP_AF21 0x48 +#define IPTOS_DSCP_AF22 0x50 +#define IPTOS_DSCP_AF23 0x58 +#define IPTOS_DSCP_CS3 0x60 +#define IPTOS_DSCP_AF31 0x68 +#define IPTOS_DSCP_AF32 0x70 +#define IPTOS_DSCP_AF33 0x78 +#define IPTOS_DSCP_CS4 0x80 +#define IPTOS_DSCP_AF41 0x88 +#define IPTOS_DSCP_AF42 0x90 +#define IPTOS_DSCP_AF43 0x98 +#define IPTOS_DSCP_CS5 0xa0 +#define IPTOS_DSCP_EF 0xb8 +#define IPTOS_DSCP_CS6 0xc0 +#define IPTOS_DSCP_CS7 0xe0 + +/* * ECN (Explicit Congestion Notification) codepoints in RFC3168 mapped to the * lower 2 bits of the TOS field. */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 22:16:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7063106564A; Tue, 26 Jun 2012 22:16:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEF648FC08; Tue, 26 Jun 2012 22:16:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QMGrZZ065418; Tue, 26 Jun 2012 22:16:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QMGrTc065408; Tue, 26 Jun 2012 22:16:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206262216.q5QMGrTc065408@svn.freebsd.org> From: Adrian Chadd Date: Tue, 26 Jun 2012 22:16: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: r237611 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416 ath_hal/ar9002 ath_hal/ar9003 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 22:16:54 -0000 Author: adrian Date: Tue Jun 26 22:16:53 2012 New Revision: 237611 URL: http://svn.freebsd.org/changeset/base/237611 Log: Bring over the initial 802.11n bluetooth coexistence support code. The Linux ath9k btcoex code is based off of this code. Note this doesn't actually implement functional btcoex; there's some driver glue and a whole lot of verification that is required. On the other hand, I do have the AR9285+BT and AR9287+BT NICs which this code supports.. Obtained from: Qualcomm Atheros, Linux ath9k Added: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c (contents, props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.h (contents, props changed) head/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c (contents, props changed) head/sys/dev/ath/ath_hal/ar9003/ar9300_btcoex.h (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c head/sys/dev/ath/ath_hal/ar9002/ar9285.h head/sys/dev/ath/if_ath_led.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Jun 26 21:45:47 2012 (r237610) +++ head/sys/dev/ath/ath_hal/ah.h Tue Jun 26 22:16:53 2012 (r237611) @@ -421,13 +421,13 @@ typedef enum { } HAL_INT; typedef enum { - HAL_GPIO_MUX_OUTPUT = 0, - HAL_GPIO_MUX_PCIE_ATTENTION_LED = 1, - HAL_GPIO_MUX_PCIE_POWER_LED = 2, - HAL_GPIO_MUX_TX_FRAME = 3, - HAL_GPIO_MUX_RX_CLEAR_EXTERNAL = 4, - HAL_GPIO_MUX_MAC_NETWORK_LED = 5, - HAL_GPIO_MUX_MAC_POWER_LED = 6 + HAL_GPIO_OUTPUT_MUX_AS_OUTPUT = 0, + HAL_GPIO_OUTPUT_MUX_PCIE_ATTENTION_LED = 1, + HAL_GPIO_OUTPUT_MUX_PCIE_POWER_LED = 2, + HAL_GPIO_OUTPUT_MUX_MAC_NETWORK_LED = 3, + HAL_GPIO_OUTPUT_MUX_MAC_POWER_LED = 4, + HAL_GPIO_OUTPUT_MUX_AS_WLAN_ACTIVE = 5, + HAL_GPIO_OUTPUT_MUX_AS_TX_FRAME = 6 } HAL_GPIO_MUX_TYPE; typedef enum { @@ -777,6 +777,139 @@ struct hal_dfs_event { }; typedef struct hal_dfs_event HAL_DFS_EVENT; +/* + * BT Co-existence definitions + */ +typedef enum { + HAL_BT_MODULE_CSR_BC4 = 0, /* CSR BlueCore v4 */ + HAL_BT_MODULE_JANUS = 1, /* Kite + Valkyrie combo */ + HAL_BT_MODULE_HELIUS = 2, /* Kiwi + Valkyrie combo */ + HAL_MAX_BT_MODULES +} HAL_BT_MODULE; + +typedef struct { + HAL_BT_MODULE bt_module; + u_int8_t bt_coex_config; + u_int8_t bt_gpio_bt_active; + u_int8_t bt_gpio_bt_priority; + u_int8_t bt_gpio_wlan_active; + u_int8_t bt_active_polarity; + HAL_BOOL bt_single_ant; + u_int8_t bt_dutyCycle; + u_int8_t bt_isolation; + u_int8_t bt_period; +} HAL_BT_COEX_INFO; + +typedef enum { + HAL_BT_COEX_MODE_LEGACY = 0, /* legacy rx_clear mode */ + HAL_BT_COEX_MODE_UNSLOTTED = 1, /* untimed/unslotted mode */ + HAL_BT_COEX_MODE_SLOTTED = 2, /* slotted mode */ + HAL_BT_COEX_MODE_DISALBED = 3, /* coexistence disabled */ +} HAL_BT_COEX_MODE; + +typedef enum { + HAL_BT_COEX_CFG_NONE, /* No bt coex enabled */ + HAL_BT_COEX_CFG_2WIRE_2CH, /* 2-wire with 2 chains */ + HAL_BT_COEX_CFG_2WIRE_CH1, /* 2-wire with ch1 */ + HAL_BT_COEX_CFG_2WIRE_CH0, /* 2-wire with ch0 */ + HAL_BT_COEX_CFG_3WIRE, /* 3-wire */ + HAL_BT_COEX_CFG_MCI /* MCI */ +} HAL_BT_COEX_CFG; + +typedef enum { + HAL_BT_COEX_SET_ACK_PWR = 0, /* Change ACK power setting */ + HAL_BT_COEX_LOWER_TX_PWR, /* Change transmit power */ + HAL_BT_COEX_ANTENNA_DIVERSITY, /* Enable RX diversity for Kite */ +} HAL_BT_COEX_SET_PARAMETER; + +#define HAL_BT_COEX_FLAG_LOW_ACK_PWR 0x00000001 +#define HAL_BT_COEX_FLAG_LOWER_TX_PWR 0x00000002 +/* Check Rx Diversity is allowed */ +#define HAL_BT_COEX_FLAG_ANT_DIV_ALLOW 0x00000004 +/* Check Diversity is on or off */ +#define HAL_BT_COEX_FLAG_ANT_DIV_ENABLE 0x00000008 + +#define HAL_BT_COEX_ANTDIV_CONTROL1_ENABLE 0x0b +/* main: LNA1, alt: LNA2 */ +#define HAL_BT_COEX_ANTDIV_CONTROL2_ENABLE 0x09 +#define HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_A 0x04 +#define HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_A 0x09 +#define HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_B 0x02 +#define HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_B 0x06 + +#define HAL_BT_COEX_ISOLATION_FOR_NO_COEX 30 + +#define HAL_BT_COEX_ANT_DIV_SWITCH_COM 0x66666666 + +#define HAL_BT_COEX_HELIUS_CHAINMASK 0x02 + +#define HAL_BT_COEX_LOW_ACK_POWER 0x0 +#define HAL_BT_COEX_HIGH_ACK_POWER 0x3f3f3f + +typedef enum { + HAL_BT_COEX_NO_STOMP = 0, + HAL_BT_COEX_STOMP_ALL, + HAL_BT_COEX_STOMP_LOW, + HAL_BT_COEX_STOMP_NONE, + HAL_BT_COEX_STOMP_ALL_FORCE, + HAL_BT_COEX_STOMP_LOW_FORCE, +} HAL_BT_COEX_STOMP_TYPE; + +typedef struct { + /* extend rx_clear after tx/rx to protect the burst (in usec). */ + u_int8_t bt_time_extend; + + /* + * extend rx_clear as long as txsm is + * transmitting or waiting for ack. + */ + HAL_BOOL bt_txstate_extend; + + /* + * extend rx_clear so that when tx_frame + * is asserted, rx_clear will drop. + */ + HAL_BOOL bt_txframe_extend; + + /* + * coexistence mode + */ + HAL_BT_COEX_MODE bt_mode; + + /* + * treat BT high priority traffic as + * a quiet collision + */ + HAL_BOOL bt_quiet_collision; + + /* + * invert rx_clear as WLAN_ACTIVE + */ + HAL_BOOL bt_rxclear_polarity; + + /* + * slotted mode only. indicate the time in usec + * from the rising edge of BT_ACTIVE to the time + * BT_PRIORITY can be sampled to indicate priority. + */ + u_int8_t bt_priority_time; + + /* + * slotted mode only. indicate the time in usec + * from the rising edge of BT_ACTIVE to the time + * BT_PRIORITY can be sampled to indicate tx/rx and + * BT_FREQ is sampled. + */ + u_int8_t bt_first_slot_time; + + /* + * slotted mode only. rx_clear and bt_ant decision + * will be held the entire time that BT_ACTIVE is asserted, + * otherwise the decision is made before every slot boundry. + */ + HAL_BOOL bt_hold_rxclear; +} HAL_BT_COEX_CONFIG; + typedef struct { int ah_debug; /* only used if AH_DEBUG is defined */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Jun 26 21:45:47 2012 (r237610) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Jun 26 22:16:53 2012 (r237611) @@ -132,6 +132,28 @@ struct ath_hal_5416 { int initPDADC; int ah_need_an_top2_fixup; /* merlin or later chips that may need this workaround */ + + /* + * Bluetooth coexistence static setup according to the registry + */ + HAL_BT_MODULE ah_btModule; /* Bluetooth module identifier */ + uint8_t ah_btCoexConfigType; /* BT coex configuration */ + uint8_t ah_btActiveGpioSelect; /* GPIO pin for BT_ACTIVE */ + uint8_t ah_btPriorityGpioSelect; /* GPIO pin for BT_PRIORITY */ + uint8_t ah_wlanActiveGpioSelect; /* GPIO pin for WLAN_ACTIVE */ + uint8_t ah_btActivePolarity; /* Polarity of BT_ACTIVE */ + HAL_BOOL ah_btCoexSingleAnt; /* Single or dual antenna configuration */ + uint8_t ah_btWlanIsolation; /* Isolation between BT and WLAN in dB */ + + /* + * Bluetooth coexistence runtime settings + */ + HAL_BOOL ah_btCoexEnabled; /* If Bluetooth coexistence is enabled */ + uint32_t ah_btCoexMode; /* Register setting for AR_BT_COEX_MODE */ + uint32_t ah_btCoexBTWeight; /* Register setting for AR_BT_COEX_WEIGHT */ + uint32_t ah_btCoexWLANWeight; /* Register setting for AR_BT_COEX_WEIGHT */ + uint32_t ah_btCoexMode2; /* Register setting for AR_BT_COEX_MODE2 */ + uint32_t ah_btCoexFlag; /* Special tuning flags for BT coex */ }; #define AH5416(_ah) ((struct ath_hal_5416 *)(_ah)) @@ -173,6 +195,21 @@ extern void ar5416SetStaBeaconTimers(str const HAL_BEACON_STATE *); extern uint64_t ar5416GetNextTBTT(struct ath_hal *); +/* ar5416_btcoex.c */ +extern void ar5416SetBTCoexInfo(struct ath_hal *ah, + HAL_BT_COEX_INFO *btinfo); +extern void ar5416BTCoexConfig(struct ath_hal *ah, + HAL_BT_COEX_CONFIG *btconf); +extern void ar5416BTCoexSetQcuThresh(struct ath_hal *ah, int qnum); +extern void ar5416BTCoexSetWeights(struct ath_hal *ah, uint32_t stompType); +extern void ar5416BTCoexSetupBmissThresh(struct ath_hal *ah, + uint32_t thresh); +extern void ar5416BTCoexSetParameter(struct ath_hal *ah, uint32_t type, + uint32_t value); +extern void ar5416BTCoexDisable(struct ath_hal *ah); +extern int ar5416BTCoexEnable(struct ath_hal *ah); +extern void ar5416InitBTCoex(struct ath_hal *ah); + extern HAL_BOOL ar5416EepromRead(struct ath_hal *, u_int off, uint16_t *data); extern HAL_BOOL ar5416EepromWrite(struct ath_hal *, u_int off, uint16_t data); Added: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Tue Jun 26 22:16:53 2012 (r237611) @@ -0,0 +1,385 @@ +/* + * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2005 Atheros Communications, Inc. + * Copyright (c) 2008-2010, Atheros Communications Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_devid.h" +#ifdef AH_DEBUG +#include "ah_desc.h" /* NB: for HAL_PHYERR* */ +#endif + +#include "ar5416/ar5416.h" +#include "ar5416/ar5416reg.h" +#include "ar5416/ar5416phy.h" +#include "ar5416/ar5416desc.h" /* AR5416_CONTTXMODE */ +#include "ar5416/ar5416_btcoex.h" + +void +ar5416SetBTCoexInfo(struct ath_hal *ah, HAL_BT_COEX_INFO *btinfo) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + + ahp->ah_btModule = btinfo->bt_module; + ahp->ah_btCoexConfigType = btinfo->bt_coex_config; + ahp->ah_btActiveGpioSelect = btinfo->bt_gpio_bt_active; + ahp->ah_btPriorityGpioSelect = btinfo->bt_gpio_bt_priority; + ahp->ah_wlanActiveGpioSelect = btinfo->bt_gpio_wlan_active; + ahp->ah_btActivePolarity = btinfo->bt_active_polarity; + ahp->ah_btCoexSingleAnt = btinfo->bt_single_ant; + ahp->ah_btWlanIsolation = btinfo->bt_isolation; +} + +void +ar5416BTCoexConfig(struct ath_hal *ah, HAL_BT_COEX_CONFIG *btconf) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + HAL_BOOL rxClearPolarity = btconf->bt_rxclear_polarity; + + /* + * For Kiwi and Osprey, the polarity of rx_clear is active high. + * The bt_rxclear_polarity flag from ath(4) needs to be inverted. + */ + if (AR_SREV_KIWI(ah)) { + rxClearPolarity = !btconf->bt_rxclear_polarity; + } + + ahp->ah_btCoexMode = (ahp->ah_btCoexMode & AR_BT_QCU_THRESH) | + SM(btconf->bt_time_extend, AR_BT_TIME_EXTEND) | + SM(btconf->bt_txstate_extend, AR_BT_TXSTATE_EXTEND) | + SM(btconf->bt_txframe_extend, AR_BT_TX_FRAME_EXTEND) | + SM(btconf->bt_mode, AR_BT_MODE) | + SM(btconf->bt_quiet_collision, AR_BT_QUIET) | + SM(rxClearPolarity, AR_BT_RX_CLEAR_POLARITY) | + SM(btconf->bt_priority_time, AR_BT_PRIORITY_TIME) | + SM(btconf->bt_first_slot_time, AR_BT_FIRST_SLOT_TIME); + + ahp->ah_btCoexMode2 |= SM(btconf->bt_hold_rxclear, + AR_BT_HOLD_RX_CLEAR); + + if (ahp->ah_btCoexSingleAnt == AH_FALSE) { + /* Enable ACK to go out even though BT has higher priority. */ + ahp->ah_btCoexMode2 |= AR_BT_DISABLE_BT_ANT; + } +} + +void +ar5416BTCoexSetQcuThresh(struct ath_hal *ah, int qnum) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + + ahp->ah_btCoexMode |= SM(qnum, AR_BT_QCU_THRESH); +} + +void +ar5416BTCoexSetWeights(struct ath_hal *ah, u_int32_t stompType) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + + if (AR_SREV_KIWI_10_OR_LATER(ah)) { + /* TODO: TX RX seperate is not enabled. */ + switch (stompType) { + case HAL_BT_COEX_STOMP_ALL: + ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; + ahp->ah_btCoexWLANWeight = AR5416_STOMP_ALL_WLAN_WGHT; + break; + case HAL_BT_COEX_STOMP_LOW: + ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; + ahp->ah_btCoexWLANWeight = AR5416_STOMP_LOW_WLAN_WGHT; + break; + case HAL_BT_COEX_STOMP_ALL_FORCE: + ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; + ahp->ah_btCoexWLANWeight = + AR5416_STOMP_ALL_FORCE_WLAN_WGHT; + break; + case HAL_BT_COEX_STOMP_LOW_FORCE: + ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; + ahp->ah_btCoexWLANWeight = + AR5416_STOMP_LOW_FORCE_WLAN_WGHT; + break; + case HAL_BT_COEX_STOMP_NONE: + case HAL_BT_COEX_NO_STOMP: + ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; + ahp->ah_btCoexWLANWeight = AR5416_STOMP_NONE_WLAN_WGHT; + break; + default: + /* There is a forceWeight from registry */ + ahp->ah_btCoexBTWeight = stompType & 0xffff; + ahp->ah_btCoexWLANWeight = stompType >> 16; + break; + } + } else { + switch (stompType) { + case HAL_BT_COEX_STOMP_ALL: + ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; + ahp->ah_btCoexWLANWeight = AR5416_STOMP_ALL_WLAN_WGHT; + break; + case HAL_BT_COEX_STOMP_LOW: + ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; + ahp->ah_btCoexWLANWeight = AR5416_STOMP_LOW_WLAN_WGHT; + break; + case HAL_BT_COEX_STOMP_ALL_FORCE: + ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; + ahp->ah_btCoexWLANWeight = + AR5416_STOMP_ALL_FORCE_WLAN_WGHT; + break; + case HAL_BT_COEX_STOMP_LOW_FORCE: + ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; + ahp->ah_btCoexWLANWeight = + AR5416_STOMP_LOW_FORCE_WLAN_WGHT; + break; + case HAL_BT_COEX_STOMP_NONE: + case HAL_BT_COEX_NO_STOMP: + ahp->ah_btCoexBTWeight = AR5416_BT_WGHT; + ahp->ah_btCoexWLANWeight = AR5416_STOMP_NONE_WLAN_WGHT; + break; + default: + /* There is a forceWeight from registry */ + ahp->ah_btCoexBTWeight = stompType & 0xffff; + ahp->ah_btCoexWLANWeight = stompType >> 16; + break; + } + } +} + +void +ar5416BTCoexSetupBmissThresh(struct ath_hal *ah, u_int32_t thresh) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + + ahp->ah_btCoexMode2 |= SM(thresh, AR_BT_BCN_MISS_THRESH); +} + +/* + * There is no antenna diversity for Owl, Kiwi, etc. + * + * Kite will override this particular method. + */ +static void +ar5416BTCoexAntennaDiversity(struct ath_hal *ah) +{ +} + +void +ar5416BTCoexSetParameter(struct ath_hal *ah, u_int32_t type, u_int32_t value) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + + switch (type) { + case HAL_BT_COEX_SET_ACK_PWR: + if (value) { + ahp->ah_btCoexFlag |= HAL_BT_COEX_FLAG_LOW_ACK_PWR; + OS_REG_WRITE(ah, AR_TPC, HAL_BT_COEX_LOW_ACK_POWER); + } else { + ahp->ah_btCoexFlag &= ~HAL_BT_COEX_FLAG_LOW_ACK_PWR; + OS_REG_WRITE(ah, AR_TPC, HAL_BT_COEX_HIGH_ACK_POWER); + } + break; + case HAL_BT_COEX_ANTENNA_DIVERSITY: + /* This is overridden for Kite */ + break; +#if 0 + case HAL_BT_COEX_LOWER_TX_PWR: + if (value) { + if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_LOWER_TX_PWR) == 0) { + ahp->ah_btCoexFlag |= HAL_BT_COEX_FLAG_LOWER_TX_PWR; + AH_PRIVATE(ah)->ah_config.ath_hal_desc_tpc = 1; + ar5416SetTxPowerLimit(ah, AH_PRIVATE(ah)->ah_power_limit, AH_PRIVATE(ah)->ah_extra_txpow, 0); + } + } + else { + if (ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_LOWER_TX_PWR) { + ahp->ah_btCoexFlag &= ~HAL_BT_COEX_FLAG_LOWER_TX_PWR; + AH_PRIVATE(ah)->ah_config.ath_hal_desc_tpc = 0; + ar5416SetTxPowerLimit(ah, AH_PRIVATE(ah)->ah_power_limit, AH_PRIVATE(ah)->ah_extra_txpow, 0); + } + } + break; +#endif + default: + break; + } +} + +void +ar5416BTCoexDisable(struct ath_hal *ah) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + + /* Always drive rx_clear_external output as 0 */ + ar5416GpioSet(ah, ahp->ah_wlanActiveGpioSelect, 0); + ar5416GpioCfgOutput(ah, ahp->ah_wlanActiveGpioSelect, + HAL_GPIO_OUTPUT_MUX_AS_OUTPUT); + + if (AR_SREV_9271(ah)) { + /* + * Set wlanActiveGpio to input when disabling BT-COEX to + * reduce power consumption + */ + ar5416GpioCfgInput(ah, ahp->ah_wlanActiveGpioSelect); + } + + if (ahp->ah_btCoexSingleAnt == AH_TRUE) { + OS_REG_RMW_FIELD(ah, AR_QUIET1, AR_QUIET1_QUIET_ACK_CTS_ENABLE, + 1); + OS_REG_RMW_FIELD(ah, AR_MISC_MODE, AR_PCU_BT_ANT_PREVENT_RX, + 0); + } + + OS_REG_WRITE(ah, AR_BT_COEX_MODE, AR_BT_QUIET | AR_BT_MODE); + OS_REG_WRITE(ah, AR_BT_COEX_WEIGHT, 0); + if (AR_SREV_KIWI_10_OR_LATER(ah)) + OS_REG_WRITE(ah, AR_BT_COEX_WEIGHT2, 0); + OS_REG_WRITE(ah, AR_BT_COEX_MODE2, 0); + + ahp->ah_btCoexEnabled = AH_FALSE; +} + +int +ar5416BTCoexEnable(struct ath_hal *ah) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + + /* Program coex mode and weight registers to actually enable coex */ + OS_REG_WRITE(ah, AR_BT_COEX_MODE, ahp->ah_btCoexMode); + OS_REG_WRITE(ah, AR_BT_COEX_WEIGHT, + SM(ahp->ah_btCoexWLANWeight & 0xFFFF, AR_BT_WL_WGHT) | + SM(ahp->ah_btCoexBTWeight & 0xFFFF, AR_BT_BT_WGHT)); + if (AR_SREV_KIWI_10_OR_LATER(ah)) { + OS_REG_WRITE(ah, AR_BT_COEX_WEIGHT2, + SM(ahp->ah_btCoexWLANWeight >> 16, AR_BT_WL_WGHT)); + } + OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); + +#if 0 + /* Added Select GPIO5~8 instaed SPI */ + if (AR_SREV_9271(ah)) { + val = OS_REG_READ(ah, AR9271_CLOCK_CONTROL); + val &= 0xFFFFFEFF; + OS_REG_WRITE(ah, AR9271_CLOCK_CONTROL, val); + } +#endif + + if (ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_LOW_ACK_PWR) + OS_REG_WRITE(ah, AR_TPC, HAL_BT_COEX_LOW_ACK_POWER); + else + OS_REG_WRITE(ah, AR_TPC, HAL_BT_COEX_HIGH_ACK_POWER); + + if (ahp->ah_btCoexSingleAnt == AH_TRUE) { + OS_REG_RMW_FIELD(ah, AR_QUIET1, + AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1); + /* XXX should update miscMode? */ + OS_REG_RMW_FIELD(ah, AR_MISC_MODE, + AR_PCU_BT_ANT_PREVENT_RX, 1); + } else { + OS_REG_RMW_FIELD(ah, AR_QUIET1, + AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1); + /* XXX should update miscMode? */ + OS_REG_RMW_FIELD(ah, AR_MISC_MODE, + AR_PCU_BT_ANT_PREVENT_RX, 0); + } + + if (ahp->ah_btCoexConfigType == HAL_BT_COEX_CFG_3WIRE) { + /* For 3-wire, configure the desired GPIO port for rx_clear */ + ar5416GpioCfgOutput(ah, ahp->ah_wlanActiveGpioSelect, + HAL_GPIO_OUTPUT_MUX_AS_WLAN_ACTIVE); + } else { + /* + * For 2-wire, configure the desired GPIO port + * for TX_FRAME output + */ + ar5416GpioCfgOutput(ah, ahp->ah_wlanActiveGpioSelect, + HAL_GPIO_OUTPUT_MUX_AS_TX_FRAME); + } + + /* + * Enable a weak pull down on BT_ACTIVE. + * When BT device is disabled, BT_ACTIVE might be floating. + */ + OS_REG_RMW(ah, AR_GPIO_PDPU, + (0x2 << (ahp->ah_btActiveGpioSelect * 2)), + (0x3 << (ahp->ah_btActiveGpioSelect * 2))); + + ahp->ah_btCoexEnabled = AH_TRUE; + + return (0); +} + +void +ar5416InitBTCoex(struct ath_hal *ah) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + + if (ahp->ah_btCoexConfigType == HAL_BT_COEX_CFG_3WIRE) { + OS_REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, + (AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB | + AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB)); + + /* + * Set input mux for bt_prority_async and + * bt_active_async to GPIO pins + */ + OS_REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, + AR_GPIO_INPUT_MUX1_BT_ACTIVE, + ahp->ah_btActiveGpioSelect); + OS_REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, + AR_GPIO_INPUT_MUX1_BT_PRIORITY, + ahp->ah_btPriorityGpioSelect); + + /* + * Configure the desired GPIO ports for input + */ + ar5416GpioCfgInput(ah, ahp->ah_btActiveGpioSelect); + ar5416GpioCfgInput(ah, ahp->ah_btPriorityGpioSelect); + + if (AR_SREV_KITE(ah)) + ar5416BTCoexAntennaDiversity(ah); + + if (ahp->ah_btCoexEnabled) + ar5416BTCoexEnable(ah); + else + ar5416BTCoexDisable(ah); + } else if (ahp->ah_btCoexConfigType != HAL_BT_COEX_CFG_NONE) { + /* 2-wire */ + if (ahp->ah_btCoexEnabled) { + /* Connect bt_active_async to baseband */ + OS_REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL, + (AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF | + AR_GPIO_INPUT_EN_VAL_BT_FREQUENCY_DEF)); + OS_REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, + AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB); + + /* + * Set input mux for bt_prority_async and + * bt_active_async to GPIO pins + */ + OS_REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, + AR_GPIO_INPUT_MUX1_BT_ACTIVE, + ahp->ah_btActiveGpioSelect); + + /* Configure the desired GPIO ports for input */ + ar5416GpioCfgInput(ah, ahp->ah_btActiveGpioSelect); + + /* Enable coexistence on initialization */ + ar5416BTCoexEnable(ah); + } + } +} Added: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.h Tue Jun 26 22:16:53 2012 (r237611) @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2011 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#ifndef __ATH_AR5416_BTCOEX_H__ +#define __ATH_AR5416_BTCOEX_H__ +/* + * Weight table configurations. + */ +#define AR5416_BT_WGHT 0xff55 +#define AR5416_STOMP_ALL_WLAN_WGHT 0xfcfc +#define AR5416_STOMP_LOW_WLAN_WGHT 0xa8a8 +#define AR5416_STOMP_NONE_WLAN_WGHT 0x0000 +#define AR5416_STOMP_ALL_FORCE_WLAN_WGHT 0xffff // Stomp BT even when WLAN is idle +#define AR5416_STOMP_LOW_FORCE_WLAN_WGHT 0xaaaa // Stomp BT even when WLAN is idle + +#define AR9300_BT_WGHT 0xcccc4444 +#define AR9300_STOMP_ALL_WLAN_WGHT0 0xfffffff0 +#define AR9300_STOMP_ALL_WLAN_WGHT1 0xfffffff0 +#define AR9300_STOMP_LOW_WLAN_WGHT0 0x88888880 +#define AR9300_STOMP_LOW_WLAN_WGHT1 0x88888880 +#define AR9300_STOMP_NONE_WLAN_WGHT0 0x00000000 +#define AR9300_STOMP_NONE_WLAN_WGHT1 0x00000000 +#define AR9300_STOMP_ALL_FORCE_WLAN_WGHT0 0xffffffff // Stomp BT even when WLAN is idle +#define AR9300_STOMP_ALL_FORCE_WLAN_WGHT1 0xffffffff +#define AR9300_STOMP_LOW_FORCE_WLAN_WGHT0 0x88888888 // Stomp BT even when WLAN is idle +#define AR9300_STOMP_LOW_FORCE_WLAN_WGHT1 0x88888888 + +#define JUPITER_STOMP_ALL_WLAN_WGHT0 0x00007d00 +#define JUPITER_STOMP_ALL_WLAN_WGHT1 0x7d7d7d00 +#define JUPITER_STOMP_ALL_WLAN_WGHT2 0x7d7d7d00 +#define JUPITER_STOMP_ALL_WLAN_WGHT3 0x7d7d7d7d +#define JUPITER_STOMP_LOW_WLAN_WGHT0 0x00007d00 +#define JUPITER_STOMP_LOW_WLAN_WGHT1 0x7d3b3b00 +#define JUPITER_STOMP_LOW_WLAN_WGHT2 0x3b3b3b00 +#define JUPITER_STOMP_LOW_WLAN_WGHT3 0x3b3b3b3b +#define JUPITER_STOMP_NONE_WLAN_WGHT0 0x00007d00 +#define JUPITER_STOMP_NONE_WLAN_WGHT1 0x7d000000 +#define JUPITER_STOMP_NONE_WLAN_WGHT2 0x00000000 +#define JUPITER_STOMP_NONE_WLAN_WGHT3 0x00000000 +#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT0 0x00007d7d +#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT1 0x7d7d7d00 +#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT2 0x7d7d7d7d +#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT3 0x7d7d7d7d +#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT0 0x00003b3b +#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT1 0x3b3b3b00 +#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT2 0x3b3b3b3b +#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT3 0x3b3b3b3b + +#endif /* __ATH_AR5416_BTCOEX_H__ */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c Tue Jun 26 21:45:47 2012 (r237610) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c Tue Jun 26 22:16:53 2012 (r237611) @@ -85,23 +85,49 @@ ar5416GpioCfgOutput(struct ath_hal *ah, { uint32_t gpio_shift, reg; +#define N(a) (sizeof(a) / sizeof(a[0])) + HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); + /* + * This table maps the HAL GPIO pins to the actual hardware + * values. + */ + static const u_int32_t MuxSignalConversionTable[] = { + AR_GPIO_OUTPUT_MUX_AS_OUTPUT, + AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED, + AR_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED, + AR_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED, + AR_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED, + AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL, + AR_GPIO_OUTPUT_MUX_AS_TX_FRAME, + }; + HALDEBUG(ah, HAL_DEBUG_GPIO, "%s: gpio=%d, type=%d\n", __func__, gpio, type); - /* NB: type maps directly to hardware */ - /* XXX this may not actually be the case, for anything but output */ - cfgOutputMux(ah, gpio, type); - gpio_shift = gpio << 1; /* 2 bits per output mode */ + /* + * Convert HAL signal type definitions to hardware-specific values. + */ + if (type >= N(MuxSignalConversionTable)) { + ath_hal_printf(ah, "%s: mux %d is invalid!\n", + __func__, + type); + return AH_FALSE; + } + cfgOutputMux(ah, gpio, MuxSignalConversionTable[type]); + + /* 2 bits per output mode */ + gpio_shift = gpio << 1; + /* Always drive, rather than tristate/drive low/drive high */ reg = OS_REG_READ(ah, AR_GPIO_OE_OUT); reg &= ~(AR_GPIO_OE_OUT_DRV << gpio_shift); - /* Always drive, rather than tristate/drive low/drive high */ reg |= AR_GPIO_OE_OUT_DRV_ALL << gpio_shift; OS_REG_WRITE(ah, AR_GPIO_OE_OUT, reg); return AH_TRUE; +#undef N } /* Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285.h Tue Jun 26 21:45:47 2012 (r237610) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285.h Tue Jun 26 22:16:53 2012 (r237611) @@ -86,4 +86,9 @@ extern HAL_BOOL ar9285SetTransmitPower(s extern HAL_BOOL ar9285SetBoardValues(struct ath_hal *, const struct ieee80211_channel *); +/* ar9285_btcoex.h */ +extern void ar9285BTCoexAntennaDiversity(struct ath_hal *ah); +extern void ar9285BTCoexSetParameter(struct ath_hal *ah, + u_int32_t value, u_int32_t type); + #endif /* _ATH_AR9285_H_ */ Added: head/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c Tue Jun 26 22:16:53 2012 (r237611) @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2005 Atheros Communications, Inc. + * Copyright (c) 2008-2010, Atheros Communications Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_devid.h" +#ifdef AH_DEBUG +#include "ah_desc.h" /* NB: for HAL_PHYERR* */ +#endif + +#include "ar5416/ar5416.h" +#include "ar5416/ar5416reg.h" +#include "ar5416/ar5416phy.h" +#include "ar5416/ar5416desc.h" /* AR5416_CONTTXMODE */ + +#include "ar9002/ar9285phy.h" +#include "ar9002/ar9285.h" + +/* + * This is specific to Kite. + * + * Kiwi and others don't have antenna diversity like this. + */ +void +ar9285BTCoexAntennaDiversity(struct ath_hal *ah) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + u_int32_t regVal; + u_int8_t ant_div_control1, ant_div_control2; + + if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ALLOW) || + (AH5212(ah)->ah_diversity != HAL_ANT_VARIABLE)) { + if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ENABLE) && + (AH5212(ah)->ah_diversity == HAL_ANT_VARIABLE)) { + /* Enable antenna diversity */ + ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_ENABLE; + ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_ENABLE; + + /* Don't disable BT ant to allow BB to control SWCOM */ + ahp->ah_btCoexMode2 &= (~(AR_BT_DISABLE_BT_ANT)); + OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); + + /* Program the correct SWCOM table */ + OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, + HAL_BT_COEX_ANT_DIV_SWITCH_COM); + OS_REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, 0, 0xf0000000); + } else if (AH5212(ah)->ah_diversity == HAL_ANT_FIXED_B) { + /* Disable antenna diversity. Use antenna B(LNA2) only. */ + ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_B; + ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_B; + + /* Disable BT ant to allow concurrent BT and WLAN receive */ + ahp->ah_btCoexMode2 |= AR_BT_DISABLE_BT_ANT; + OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); + + /* Program SWCOM talbe to make sure RF switch always parks at WLAN side */ + OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, HAL_BT_COEX_ANT_DIV_SWITCH_COM); + OS_REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, 0x60000000, 0xf0000000); + } else { + /* Disable antenna diversity. Use antenna A(LNA1) only */ + ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_A; + ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_A; + + /* Disable BT ant to allow concurrent BT and WLAN receive */ + ahp->ah_btCoexMode2 |= AR_BT_DISABLE_BT_ANT; + OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); + + /* Program SWCOM talbe to make sure RF switch always parks at BT side */ + OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, 0); + OS_REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, 0, 0xf0000000); + } + + regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); + regVal &= (~(AR_PHY_9285_ANT_DIV_CTL_ALL)); + /* Clear ant_fast_div_bias [14:9] since for Janus the main LNA is always LNA1. */ + regVal &= (~(AR_PHY_9285_FAST_DIV_BIAS)); + + regVal |= SM(ant_div_control1, AR_PHY_9285_ANT_DIV_CTL); + regVal |= SM(ant_div_control2, AR_PHY_9285_ANT_DIV_ALT_LNACONF); + regVal |= SM((ant_div_control2 >> 2), AR_PHY_9285_ANT_DIV_MAIN_LNACONF); + regVal |= SM((ant_div_control1 >> 1), AR_PHY_9285_ANT_DIV_ALT_GAINTB); + regVal |= SM((ant_div_control1 >> 2), AR_PHY_9285_ANT_DIV_MAIN_GAINTB); + OS_REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regVal); + + regVal = OS_REG_READ(ah, AR_PHY_CCK_DETECT); + regVal &= (~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); + regVal |= SM((ant_div_control1 >> 3), AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); + OS_REG_WRITE(ah, AR_PHY_CCK_DETECT, regVal); + } +} + +void +ar9285BTCoexSetParameter(struct ath_hal *ah, u_int32_t type, u_int32_t value) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + + switch (type) { + case HAL_BT_COEX_ANTENNA_DIVERSITY: + if (AR_SREV_KITE(ah)) { + ahp->ah_btCoexFlag |= HAL_BT_COEX_FLAG_ANT_DIV_ALLOW; + if (value) + ahp->ah_btCoexFlag |= + HAL_BT_COEX_FLAG_ANT_DIV_ENABLE; + else + ahp->ah_btCoexFlag &= + ~HAL_BT_COEX_FLAG_ANT_DIV_ENABLE; + ar9285BTCoexAntennaDiversity(ah); + } + break; + default: + ar5416BTCoexSetParameter(ah, type, value); + break; + } +} + + Added: head/sys/dev/ath/ath_hal/ar9003/ar9300_btcoex.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9003/ar9300_btcoex.h Tue Jun 26 22:16:53 2012 (r237611) @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2011 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#ifndef __ATH_AR9300_BTCOEX_H__ +#define __ATH_AR9300_BTCOEX_H__ +/* + * Weight table configurations. + */ +#define AR9300_BT_WGHT 0xcccc4444 +#define AR9300_STOMP_ALL_WLAN_WGHT0 0xfffffff0 +#define AR9300_STOMP_ALL_WLAN_WGHT1 0xfffffff0 +#define AR9300_STOMP_LOW_WLAN_WGHT0 0x88888880 +#define AR9300_STOMP_LOW_WLAN_WGHT1 0x88888880 +#define AR9300_STOMP_NONE_WLAN_WGHT0 0x00000000 +#define AR9300_STOMP_NONE_WLAN_WGHT1 0x00000000 +/* Stomp BT even when WLAN is idle */ +#define AR9300_STOMP_ALL_FORCE_WLAN_WGHT0 0xffffffff +#define AR9300_STOMP_ALL_FORCE_WLAN_WGHT1 0xffffffff +/* Stomp BT even when WLAN is idle */ +#define AR9300_STOMP_LOW_FORCE_WLAN_WGHT0 0x88888888 +#define AR9300_STOMP_LOW_FORCE_WLAN_WGHT1 0x88888888 + +#define JUPITER_STOMP_ALL_WLAN_WGHT0 0x00007d00 +#define JUPITER_STOMP_ALL_WLAN_WGHT1 0x7d7d7d00 +#define JUPITER_STOMP_ALL_WLAN_WGHT2 0x7d7d7d00 +#define JUPITER_STOMP_ALL_WLAN_WGHT3 0x7d7d7d7d +#define JUPITER_STOMP_LOW_WLAN_WGHT0 0x00007d00 +#define JUPITER_STOMP_LOW_WLAN_WGHT1 0x7d3b3b00 +#define JUPITER_STOMP_LOW_WLAN_WGHT2 0x3b3b3b00 +#define JUPITER_STOMP_LOW_WLAN_WGHT3 0x3b3b3b3b +#define JUPITER_STOMP_NONE_WLAN_WGHT0 0x00007d00 +#define JUPITER_STOMP_NONE_WLAN_WGHT1 0x7d000000 +#define JUPITER_STOMP_NONE_WLAN_WGHT2 0x00000000 +#define JUPITER_STOMP_NONE_WLAN_WGHT3 0x00000000 +#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT0 0x00007d7d +#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT1 0x7d7d7d00 +#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT2 0x7d7d7d7d +#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT3 0x7d7d7d7d +#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT0 0x00003b3b +#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT1 0x3b3b3b00 +#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT2 0x3b3b3b3b +#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT3 0x3b3b3b3b + +#endif /* __ATH_AR9300_BTCOEX_H__ */ Modified: head/sys/dev/ath/if_ath_led.c ============================================================================== --- head/sys/dev/ath/if_ath_led.c Tue Jun 26 21:45:47 2012 (r237610) +++ head/sys/dev/ath/if_ath_led.c Tue Jun 26 22:16:53 2012 (r237611) @@ -125,7 +125,7 @@ ath_led_config(struct ath_softc *sc) /* Software LED blinking - GPIO controlled LED */ if (sc->sc_softled) { ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin, - HAL_GPIO_MUX_OUTPUT); + HAL_GPIO_OUTPUT_MUX_AS_OUTPUT); ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, !sc->sc_ledon); } @@ -139,10 +139,10 @@ ath_led_config(struct ath_softc *sc) */ if (sc->sc_led_pwr_pin > 0) ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_led_pwr_pin, - HAL_GPIO_MUX_MAC_POWER_LED); + HAL_GPIO_OUTPUT_MUX_MAC_POWER_LED); if (sc->sc_led_net_pin > 0) ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_led_net_pin, - HAL_GPIO_MUX_MAC_NETWORK_LED); + HAL_GPIO_OUTPUT_MUX_MAC_NETWORK_LED); } } From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 23:15:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5EF51106566B; Tue, 26 Jun 2012 23:15:56 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48E908FC15; Tue, 26 Jun 2012 23:15:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QNFuPl067916; Tue, 26 Jun 2012 23:15:56 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QNFuSD067914; Tue, 26 Jun 2012 23:15:56 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206262315.q5QNFuSD067914@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 26 Jun 2012 23:15: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: r237612 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 23:15:56 -0000 Author: obrien Date: Tue Jun 26 23:15:55 2012 New Revision: 237612 URL: http://svn.freebsd.org/changeset/base/237612 Log: Add -DWITH_INSTALL_AS_USER to the source build (naming matches the same functionality of The Ports Collection). This sets BINOWN, BINGRP, etc... to match current user. This this allows 'install', as used in 'make install', to succeed (assuming user has write permissions). Submitted by: Simon J Gerraty Discussed on: freebsd-arch Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Jun 26 22:16:53 2012 (r237611) +++ head/share/mk/bsd.own.mk Tue Jun 26 23:15:55 2012 (r237612) @@ -427,6 +427,7 @@ __DEFAULT_NO_OPTIONS = \ HESIOD \ ICONV \ IDEA \ + INSTALL_AS_USER \ LIBCPLUSPLUS \ NAND \ OFED \ @@ -645,6 +646,17 @@ CTFCONVERT_CMD= CTFCONVERT_CMD= @: .endif +.if ${MK_INSTALL_AS_USER} != "no" +_uid!= id -un +.if ${_uid} != 0 +_gid!= id -gn +.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE +$xOWN= ${_uid} +$xGRP= ${_gid} +.endfor +.endif +.endif + .endif # !_WITHOUT_SRCCONF .endif # !target(____) From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 23:17:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE2A8106566C; Tue, 26 Jun 2012 23:17:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B66AB8FC20; Tue, 26 Jun 2012 23:17:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QNHXSC068028; Tue, 26 Jun 2012 23:17:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QNHXa2068014; Tue, 26 Jun 2012 23:17:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206262317.q5QNHXa2068014@svn.freebsd.org> From: Xin LI Date: Tue, 26 Jun 2012 23:17: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: r237613 - in head: contrib/less usr.bin/less X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 23:17:33 -0000 Author: delphij Date: Tue Jun 26 23:17:33 2012 New Revision: 237613 URL: http://svn.freebsd.org/changeset/base/237613 Log: MFV: less v449. Modified: head/contrib/less/LICENSE head/contrib/less/Makefile.aut head/contrib/less/NEWS head/contrib/less/README head/contrib/less/brac.c head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/charset.h head/contrib/less/cmd.h head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/configure head/contrib/less/configure.ac head/contrib/less/cvt.c head/contrib/less/decode.c head/contrib/less/defines.ds head/contrib/less/defines.h.in head/contrib/less/defines.o2 head/contrib/less/defines.o9 head/contrib/less/defines.wn head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/forwback.c head/contrib/less/help.c head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/less.hlp head/contrib/less/less.man head/contrib/less/less.nro head/contrib/less/lessecho.c head/contrib/less/lessecho.man head/contrib/less/lessecho.nro head/contrib/less/lesskey.c head/contrib/less/lesskey.h head/contrib/less/lesskey.man head/contrib/less/lesskey.nro head/contrib/less/lglob.h head/contrib/less/line.c head/contrib/less/linenum.c head/contrib/less/lsystem.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkhelp.c head/contrib/less/optfunc.c head/contrib/less/option.c head/contrib/less/option.h head/contrib/less/opttbl.c head/contrib/less/os.c head/contrib/less/output.c head/contrib/less/pattern.c head/contrib/less/pattern.h head/contrib/less/pckeys.h head/contrib/less/position.c head/contrib/less/position.h head/contrib/less/prompt.c head/contrib/less/screen.c head/contrib/less/scrsize.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ttyin.c head/contrib/less/version.c head/usr.bin/less/defines.h Directory Properties: head/contrib/less/ (props changed) Modified: head/contrib/less/LICENSE ============================================================================== --- head/contrib/less/LICENSE Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/LICENSE Tue Jun 26 23:17:33 2012 (r237613) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2011 Mark Nudelman +Copyright (C) 1984-2012 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: head/contrib/less/Makefile.aut ============================================================================== --- head/contrib/less/Makefile.aut Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/Makefile.aut Tue Jun 26 23:17:33 2012 (r237613) @@ -1,6 +1,6 @@ # Makefile for authoring less. -EMAIL = markn@greenwoodsoftware.com +EMAIL = bug-less@gnu.org HOMEPAGE = http://www.greenwoodsoftware.com/less SHELL = /bin/sh RCS = rcs @@ -112,8 +112,7 @@ dist: ${DISTFILES} echo "Preparing $$REL"; \ rm -rf $$REL; mkdir $$REL; \ for file in ${DISTFILES}; do \ - cp -p $$file $$REL; \ - chmod -w $$REL/$$file; \ + ./add_copyright $$file $$REL; \ done; \ cd $$REL; chmod +w ${DISTFILES_W}; cd ..; \ echo "Creating release/$$REL/$$REL.tar.gz"; \ Modified: head/contrib/less/NEWS ============================================================================== --- head/contrib/less/NEWS Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/NEWS Tue Jun 26 23:17:33 2012 (r237613) @@ -7,8 +7,34 @@ http://www.greenwoodsoftware.com/less You can also download the latest version of less from there. - To report bugs, suggestions or comments, send email to - bug-less@gnu.org or markn@greenwoodsoftware.com. + To report bugs, suggestions or comments, send email to bug-less@gnu.org. + +====================================================================== + + Major changes between "less" versions 444 and 449 + +* Add ESC-F command to keep reading data until a pattern is found. + +* Use exit code of LESSOPEN script if LESSOPEN starts with "||". + +* When up/down arrow is used on the command line immediately after + typing text, the next command starting with that text is found. + +* Add support for GNU regex. + +* Add configure option --with-regex=none and fix compile errors + when compiling with no regex library. + +* Fix bugs handling SGR sequences in Win32. + +* Fix possible crashes caused by malformed LESSOPEN or + LESSCLOSE variables. + +* Fix bug highlighting text which is discontiguous in the file + due to backspace processing. + +* Fix bug in displaying status column when scrolling backwards + with -J and -S in effect. ====================================================================== Modified: head/contrib/less/README ============================================================================== --- head/contrib/less/README Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/README Tue Jun 26 23:17:33 2012 (r237613) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 444 + Less, version 449 - This is the distribution of less, version 444, released 09 Jun 2011. + This is the distribution of less, version 449, released 26 Jun 2012. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -21,7 +21,7 @@ or 2. The Less License, in the file LICENSE. - Please report any problems to bug-less@gnu.org or markn@greenwoodsoftware.com. + Please report any problems to bug-less@gnu.org. See http://www.greenwoodsoftware.com/less for the latest info. ========================================================================= @@ -60,10 +60,11 @@ INSTALLATION (Unix systems only): regcomp Use the V8-compatible regcomp. regcomp-local Use Henry Spencer's V8-compatible regcomp (source is supplied with less). + none No regular expressions, only simple string matching. --with-secure Builds a "secure" version of less, with some features disabled - to prevent users from viewing other files, accessing shell - commands, etc. + to prevent users from viewing other files, accessing shell + commands, etc. 3. It is a good idea to look over the generated Makefile and defines.h @@ -96,7 +97,7 @@ INSTALLATION (Unix systems only): bindir and/or mandir to the appropriate directories. If you have any problems building or running "less", suggestions, -complaints, etc., you may mail to the author at markn@greenwoodsoftware.com. +complaints, etc., you may mail to bug-less@gnu.org. Note to hackers: comments noting possible improvements are enclosed in double curly brackets {{ like this }}. Modified: head/contrib/less/brac.c ============================================================================== --- head/contrib/less/brac.c Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/brac.c Tue Jun 26 23:17:33 2012 (r237613) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/ch.c ============================================================================== --- head/contrib/less/ch.c Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/ch.c Tue Jun 26 23:17:33 2012 (r237613) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -582,6 +581,8 @@ ch_length() return (NULL_POSITION); if (ch_flags & CH_HELPFILE) return (size_helpdata); + if (ch_flags & CH_NODATA) + return (0); return (ch_fsize); } Modified: head/contrib/less/charset.c ============================================================================== --- head/contrib/less/charset.c Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/charset.c Tue Jun 26 23:17:33 2012 (r237613) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/charset.h ============================================================================== --- head/contrib/less/charset.h Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/charset.h Tue Jun 26 23:17:33 2012 (r237613) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 2005-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #define IS_ASCII_OCTET(c) (((c) & 0x80) == 0) #define IS_UTF8_TRAIL(c) (((c) & 0xC0) == 0x80) Modified: head/contrib/less/cmd.h ============================================================================== --- head/contrib/less/cmd.h Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/cmd.h Tue Jun 26 23:17:33 2012 (r237613) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #define MAX_USERCMD 500 @@ -66,6 +65,7 @@ #define A_NEXT_TAG 53 #define A_PREV_TAG 54 #define A_FILTER 55 +#define A_F_UNTIL_HILITE 56 #define A_INVALID 100 #define A_NOACTION 101 @@ -78,7 +78,7 @@ #define A_EXTRA 0200 -/* Line editting characters */ +/* Line editing characters */ #define EC_BACKSPACE 1 #define EC_LINEKILL 2 Modified: head/contrib/less/cmdbuf.c ============================================================================== --- head/contrib/less/cmdbuf.c Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/cmdbuf.c Tue Jun 26 23:17:33 2012 (r237613) @@ -1,12 +1,11 @@ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -30,6 +29,7 @@ static int prompt_col; /* Column of cur static char *cp; /* Pointer into cmdbuf */ static int cmd_offset; /* Index into cmdbuf of first displayed char */ static int literal; /* Next input char should not be interpreted */ +static int updown_match = -1; /* Prefix length in up/down movement */ #if TAB_COMPLETE_FILENAME static int cmd_complete(); @@ -122,6 +122,7 @@ cmd_reset() cmd_offset = 0; literal = 0; cmd_mbc_buf_len = 0; + updown_match = -1; } /* @@ -132,6 +133,7 @@ clear_cmd() { cmd_col = prompt_col = 0; cmd_mbc_buf_len = 0; + updown_match = -1; } /* @@ -504,6 +506,7 @@ cmd_ichar(cs, clen) /* * Reprint the tail of the line from the inserted char. */ + updown_match = -1; cmd_repaint(cp); cmd_right(); return (CC_OK); @@ -547,6 +550,7 @@ cmd_erase() /* * Repaint the buffer after the erased char. */ + updown_match = -1; cmd_repaint(cp); /* @@ -643,6 +647,7 @@ cmd_kill() cmd_offset = 0; cmd_home(); *cp = '\0'; + updown_match = -1; cmd_repaint(cp); /* @@ -675,12 +680,15 @@ set_mlist(mlist, cmdflags) #if CMD_HISTORY /* * Move up or down in the currently selected command history list. + * Only consider entries whose first updown_match chars are equal to + * cmdbuf's corresponding chars. */ static int cmd_updown(action) int action; { char *s; + struct mlist *ml; if (curr_mlist == NULL) { @@ -690,24 +698,47 @@ cmd_updown(action) bell(); return (CC_OK); } - cmd_home(); - clear_eol(); + + if (updown_match < 0) + { + updown_match = cp - cmdbuf; + } + /* - * Move curr_mp to the next/prev entry. + * Find the next history entry which matches. */ - if (action == EC_UP) - curr_mlist->curr_mp = curr_mlist->curr_mp->prev; - else - curr_mlist->curr_mp = curr_mlist->curr_mp->next; - /* - * Copy the entry into cmdbuf and echo it on the screen. - */ - s = curr_mlist->curr_mp->string; - if (s == NULL) - s = ""; - strcpy(cmdbuf, s); - for (cp = cmdbuf; *cp != '\0'; ) - cmd_right(); + for (ml = curr_mlist->curr_mp;;) + { + ml = (action == EC_UP) ? ml->prev : ml->next; + if (ml == curr_mlist) + { + /* + * We reached the end (or beginning) of the list. + */ + break; + } + if (strncmp(cmdbuf, ml->string, updown_match) == 0) + { + /* + * This entry matches; stop here. + * Copy the entry into cmdbuf and echo it on the screen. + */ + curr_mlist->curr_mp = ml; + s = ml->string; + if (s == NULL) + s = ""; + strcpy(cmdbuf, s); + cmd_home(); + clear_eol(); + for (cp = cmdbuf; *cp != '\0'; ) + cmd_right(); + return (CC_OK); + } + } + /* + * We didn't find a history entry that matches. + */ + bell(); return (CC_OK); } #endif @@ -1457,9 +1488,6 @@ save_cmdhist() FILE *f; int modified = 0; - filename = histfile_name(); - if (filename == NULL) - return; if (mlist_search.modified) modified = 1; #if SHELL_ESCAPE || PIPEC @@ -1468,6 +1496,9 @@ save_cmdhist() #endif if (!modified) return; + filename = histfile_name(); + if (filename == NULL) + return; f = fopen(filename, "w"); free(filename); if (f == NULL) Modified: head/contrib/less/command.c ============================================================================== --- head/contrib/less/command.c Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/command.c Tue Jun 26 23:17:33 2012 (r237613) @@ -1,13 +1,12 @@ /* $FreeBSD$ */ -/* - * Copyright (C) 1984-2011 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information about less, or for information on how to - * contact the author, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -38,6 +37,7 @@ extern int secure; extern int hshift; extern int show_attn; extern int less_is_more; +extern POSITION highest_hilite; extern char *every_first_cmd; extern char *curr_altfilename; extern char version[]; @@ -104,8 +104,8 @@ cmd_exec() static void start_mca(action, prompt, mlist, cmdflags) int action; - char *prompt; - void constant *mlist; + constant char *prompt; + constant void *mlist; int cmdflags; { mca = action; @@ -686,7 +686,7 @@ make_display() static void prompt() { - register char constant *p; + register constant char *p; if (ungot != NULL) { @@ -962,6 +962,44 @@ multi_search(pattern, n) } /* + * Forward forever, or until a highlighted line appears. + */ + static int +forw_loop(until_hilite) + int until_hilite; +{ + POSITION curr_len; + + if (ch_getflags() & CH_HELPFILE) + return (A_NOACTION); + + cmd_exec(); + jump_forw(); + curr_len = ch_length(); + highest_hilite = until_hilite ? curr_len : NULL_POSITION; + ignore_eoi = 1; + while (!sigs) + { + if (until_hilite && highest_hilite > curr_len) + { + bell(); + break; + } + make_display(); + forward(1, 0, 0); + } + ignore_eoi = 0; + + /* + * This gets us back in "F mode" after processing + * a non-abort signal (e.g. window-change). + */ + if (sigs && !ABORT_SIGS()) + return (A_F_FOREVER); + return (A_NOACTION); +} + +/* * Main command processor. * Accept and execute commands until a quit command. */ @@ -979,6 +1017,7 @@ commands() IFILE old_ifile; IFILE new_ifile; char *tagfile; + int until_hilite = 0; search_type = SRCH_FORW; wscroll = (sc_height + 1) / 2; @@ -1206,23 +1245,11 @@ commands() /* * Forward forever, ignoring EOF. */ - if (ch_getflags() & CH_HELPFILE) - break; - cmd_exec(); - jump_forw(); - ignore_eoi = 1; - while (!sigs) - { - make_display(); - forward(1, 0, 0); - } - ignore_eoi = 0; - /* - * This gets us back in "F mode" after processing - * a non-abort signal (e.g. window-change). - */ - if (sigs && !ABORT_SIGS()) - newaction = A_F_FOREVER; + newaction = forw_loop(0); + break; + + case A_F_UNTIL_HILITE: + newaction = forw_loop(1); break; case A_F_SCROLL: Modified: head/contrib/less/configure ============================================================================== --- head/contrib/less/configure Tue Jun 26 23:15:55 2012 (r237612) +++ head/contrib/less/configure Tue Jun 26 23:17:33 2012 (r237613) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for less 1. +# Generated by GNU Autoconf 2.68 for less 1. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -89,6 +89,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -214,11 +215,18 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -1067,7 +1075,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1281,7 +1289,7 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-secure Compile in secure mode --with-no-float Do not use floating point - --with-regex={auto,pcre,posix,regcmp,re_comp,regcomp,regcomp-local} Select a regular expression library auto + --with-regex={auto,gnu,pcre,posix,regcmp,re_comp,regcomp,regcomp-local,none} Select a regular expression library auto --with-editor=PROGRAM use PROGRAM as the default editor vi Some influential environment variables: @@ -1361,7 +1369,7 @@ test -n "$ac_init_help" && exit $ac_stat if $ac_init_version; then cat <<\_ACEOF less configure 1 -generated by GNU Autoconf 2.67 +generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1407,7 +1415,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1453,7 +1461,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1490,7 +1498,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1532,7 +1540,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1545,10 +1553,10 @@ fi ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1611,7 +1619,7 @@ $as_echo "$as_me: WARNING: $2: proceedin esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1620,7 +1628,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -1633,7 +1641,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1651,7 +1659,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1664,7 +1672,7 @@ ac_fn_c_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -1705,7 +1713,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -1717,7 +1725,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1772,7 +1780,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF @@ -1780,7 +1788,7 @@ This file contains any messages produced running configure, to aid debugging if configure makes a mistake. It was created by less $as_me 1, which was -generated by GNU Autoconf 2.67. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2142,7 +2150,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2182,7 +2190,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2235,7 +2243,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2275,7 +2283,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2334,7 +2342,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2378,7 +2386,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2661,7 +2669,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_ex ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2712,7 +2720,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2749,7 +2757,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -2827,7 +2835,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -2925,7 +2933,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } -if test "${ac_cv_search_strerror+set}" = set; then : +if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -2959,11 +2967,11 @@ for ac_lib in '' cposix; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_strerror+set}" = set; then : + if ${ac_cv_search_strerror+:} false; then : break fi done -if test "${ac_cv_search_strerror+set}" = set; then : +if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no @@ -2991,7 +2999,7 @@ if test -n "$CPP" && test -d "$CPP"; the CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -3119,7 +3127,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -3182,7 +3190,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -3250,7 +3258,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } -if test "${ac_cv_prog_gcc_traditional+set}" = set; then : +if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" @@ -3335,7 +3343,7 @@ ac_configure="$SHELL $ac_aux_dir/configu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3422,7 +3430,7 @@ if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then : +if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no @@ -3473,7 +3481,7 @@ $as_echo "$ac_cv_sys_largefile_CC" >&6; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then : +if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -3542,7 +3550,7 @@ rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then : +if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -3615,7 +3623,7 @@ fi # Checks for general libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgoto in -ltinfo" >&5 $as_echo_n "checking for tgoto in -ltinfo... " >&6; } -if test "${ac_cv_lib_tinfo_tgoto+set}" = set; then : +if ${ac_cv_lib_tinfo_tgoto+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3649,7 +3657,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgoto" >&5 $as_echo "$ac_cv_lib_tinfo_tgoto" >&6; } -if test "x$ac_cv_lib_tinfo_tgoto" = x""yes; then : +if test "x$ac_cv_lib_tinfo_tgoto" = xyes; then : have_tinfo=yes else have_tinfo=no @@ -3657,7 +3665,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lxcurses" >&5 $as_echo_n "checking for initscr in -lxcurses... " >&6; } -if test "${ac_cv_lib_xcurses_initscr+set}" = set; then : +if ${ac_cv_lib_xcurses_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3691,7 +3699,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xcurses_initscr" >&5 $as_echo "$ac_cv_lib_xcurses_initscr" >&6; } -if test "x$ac_cv_lib_xcurses_initscr" = x""yes; then : +if test "x$ac_cv_lib_xcurses_initscr" = xyes; then : have_xcurses=yes else have_xcurses=no @@ -3699,7 +3707,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncursesw" >&5 $as_echo_n "checking for initscr in -lncursesw... " >&6; } -if test "${ac_cv_lib_ncursesw_initscr+set}" = set; then : +if ${ac_cv_lib_ncursesw_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3733,7 +3741,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_initscr" >&5 $as_echo "$ac_cv_lib_ncursesw_initscr" >&6; } -if test "x$ac_cv_lib_ncursesw_initscr" = x""yes; then : +if test "x$ac_cv_lib_ncursesw_initscr" = xyes; then : have_ncursesw=yes else have_ncursesw=no @@ -3741,7 +3749,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 $as_echo_n "checking for initscr in -lncurses... " >&6; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jun 26 23:31:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEDAE106566B; Tue, 26 Jun 2012 23:31:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C82228FC14; Tue, 26 Jun 2012 23:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5QNVvEm068661; Tue, 26 Jun 2012 23:31:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5QNVv2c068658; Tue, 26 Jun 2012 23:31:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206262331.q5QNVv2c068658@svn.freebsd.org> From: Xin LI Date: Tue, 26 Jun 2012 23:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237614 - stable/8/contrib/netcat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2012 23:31:58 -0000 Author: delphij Date: Tue Jun 26 23:31:57 2012 New Revision: 237614 URL: http://svn.freebsd.org/changeset/base/237614 Log: MFC: netcat from OpenBSD 5.1. Modified: stable/8/contrib/netcat/nc.1 stable/8/contrib/netcat/netcat.c Directory Properties: stable/8/contrib/netcat/ (props changed) Modified: stable/8/contrib/netcat/nc.1 ============================================================================== --- stable/8/contrib/netcat/nc.1 Tue Jun 26 23:17:33 2012 (r237613) +++ stable/8/contrib/netcat/nc.1 Tue Jun 26 23:31:57 2012 (r237614) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.57 2011/01/09 22:16:46 jeremy Exp $ +.\" $OpenBSD: nc.1,v 1.60 2012/02/07 12:11:43 lum Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2011 +.Dd October 4, 2011 .Dt NC 1 .Os .Sh NAME @@ -45,7 +45,7 @@ .Op Fl P Ar proxy_username .Op Fl p Ar source_port .Op Fl s Ar source -.Op Fl T Ar ToS +.Op Fl T Ar toskeyword .Op Fl V Ar rtable .Op Fl w Ar timeout .Op Fl X Ar proxy_protocol @@ -186,14 +186,21 @@ to create and use so that datagrams can It is an error to use this option in conjunction with the .Fl l option. -.It Fl T Ar ToS -Specifies IP Type of Service (ToS) for the connection. -Valid values are the tokens -.Dq lowdelay , -.Dq throughput , -.Dq reliability , -or an 8-bit hexadecimal value preceded by -.Dq 0x . +.It Fl T Ar toskeyword +Change IPv4 TOS value. +.Ar toskeyword +may be one of +.Ar critical , +.Ar inetcontrol , +.Ar lowdelay , +.Ar netcontrol , +.Ar throughput , +.Ar reliability , +or one of the DiffServ Code Points: +.Ar ef , +.Ar af11 ... af43 , +.Ar cs0 ... cs7 ; +or a number in either hex or decimal. .It Fl t Causes .Nm @@ -227,9 +234,9 @@ Have .Nm give more verbose output. .It Fl w Ar timeout -If a connection and stdin are idle for more than +Connections which cannot be established or are idle timeout after .Ar timeout -seconds, then the connection is silently closed. +seconds. The .Fl w flag has no effect on the @@ -480,8 +487,15 @@ Original implementation by *Hobbit* Rewritten with IPv6 support by .An Eric Jackson Aq ericj@monkey.org . .Sh CAVEATS -UDP port scans will always succeed -(i.e. report the port as open), -rendering the +UDP port scans using the .Fl uz -combination of flags relatively useless. +combination of flags will always report success irrespective of +the target machine's state. +However, +in conjunction with a traffic sniffer either on the target machine +or an intermediary device, +the +.Fl uz +combination could be useful for communications diagnostics. +Note that the amount of UDP traffic generated may be limited either +due to hardware resources and/or configuration settings. Modified: stable/8/contrib/netcat/netcat.c ============================================================================== --- stable/8/contrib/netcat/netcat.c Tue Jun 26 23:17:33 2012 (r237613) +++ stable/8/contrib/netcat/netcat.c Tue Jun 26 23:31:57 2012 (r237614) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.100 2011/01/09 22:16:46 jeremy Exp $ */ +/* $OpenBSD: netcat.c,v 1.105 2012/02/09 06:25:35 lum Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -107,6 +107,7 @@ void help(void); int local_listen(char *, char *, struct addrinfo); void readwrite(int); int remote_connect(const char *, const char *, struct addrinfo); +int timeout_connect(int, const struct sockaddr *, socklen_t); int socks_connect(const char *, const char *, struct addrinfo, const char *, const char *, struct addrinfo, int, const char *); int udptest(int); @@ -114,7 +115,7 @@ int unix_bind(char *); int unix_connect(char *); int unix_listen(char *); void set_common_sockopts(int); -int parse_iptos(char *); +int map_tos(char *, int *); void usage(int); #ifdef IPSEC @@ -281,7 +282,18 @@ main(int argc, char *argv[]) Sflag = 1; break; case 'T': - Tflag = parse_iptos(optarg); + errstr = NULL; + errno = 0; + if (map_tos(optarg, &Tflag)) + break; + if (strlen(optarg) > 1 && optarg[0] == '0' && + optarg[1] == 'x') + Tflag = (int)strtol(optarg, NULL, 16); + else + Tflag = (int)strtonum(optarg, 0, 255, + &errstr); + if (Tflag < 0 || Tflag > 255 || errstr || errno) + errx(1, "illegal tos value %s", optarg); break; default: usage(1); @@ -633,7 +645,7 @@ remote_connect(const char *host, const c set_common_sockopts(s); - if (connect(s, res0->ai_addr, res0->ai_addrlen) == 0) + if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0) break; else if (vflag) warn("connect to %s port %s (%s) failed", host, port, @@ -648,6 +660,43 @@ remote_connect(const char *host, const c return (s); } +int +timeout_connect(int s, const struct sockaddr *name, socklen_t namelen) +{ + struct pollfd pfd; + socklen_t optlen; + int flags, optval; + int ret; + + if (timeout != -1) { + flags = fcntl(s, F_GETFL, 0); + if (fcntl(s, F_SETFL, flags | O_NONBLOCK) == -1) + err(1, "set non-blocking mode"); + } + + if ((ret = connect(s, name, namelen)) != 0 && errno == EINPROGRESS) { + pfd.fd = s; + pfd.events = POLLOUT; + if ((ret = poll(&pfd, 1, timeout)) == 1) { + optlen = sizeof(optval); + if ((ret = getsockopt(s, SOL_SOCKET, SO_ERROR, + &optval, &optlen)) == 0) { + errno = optval; + ret = optval == 0 ? 0 : -1; + } + } else if (ret == 0) { + errno = ETIMEDOUT; + ret = -1; + } else + err(1, "poll failed"); + } + + if (timeout != -1 && fcntl(s, F_SETFL, flags) == -1) + err(1, "restoring flags"); + + return (ret); +} + /* * local_listen() * Returns a socket listening on a local port, binds to specified source @@ -818,7 +867,7 @@ atelnet(int nfd, unsigned char *buf, uns /* * build_ports() - * Build an array or ports in portlist[], listing each port + * Build an array of ports in portlist[], listing each port * that we should try to connect to. */ void @@ -830,9 +879,6 @@ build_ports(char *p) int x = 0; if ((n = strchr(p, '-')) != NULL) { - if (lflag) - errx(1, "Cannot use -l with multiple ports!"); - *n = '\0'; n++; @@ -884,8 +930,7 @@ build_ports(char *p) /* * udptest() * Do a few writes to see if the UDP port is there. - * XXX - Better way of doing this? Doesn't work for IPv6. - * Also fails after around 100 ports checked. + * Fails once PF state table is full. */ int udptest(int s) @@ -946,20 +991,51 @@ set_common_sockopts(int s) } int -parse_iptos(char *s) +map_tos(char *s, int *val) { - int tos = -1; + /* DiffServ Codepoints and other TOS mappings */ + const struct toskeywords { + const char *keyword; + int val; + } *t, toskeywords[] = { + { "af11", IPTOS_DSCP_AF11 }, + { "af12", IPTOS_DSCP_AF12 }, + { "af13", IPTOS_DSCP_AF13 }, + { "af21", IPTOS_DSCP_AF21 }, + { "af22", IPTOS_DSCP_AF22 }, + { "af23", IPTOS_DSCP_AF23 }, + { "af31", IPTOS_DSCP_AF31 }, + { "af32", IPTOS_DSCP_AF32 }, + { "af33", IPTOS_DSCP_AF33 }, + { "af41", IPTOS_DSCP_AF41 }, + { "af42", IPTOS_DSCP_AF42 }, + { "af43", IPTOS_DSCP_AF43 }, + { "critical", IPTOS_PREC_CRITIC_ECP }, + { "cs0", IPTOS_DSCP_CS0 }, + { "cs1", IPTOS_DSCP_CS1 }, + { "cs2", IPTOS_DSCP_CS2 }, + { "cs3", IPTOS_DSCP_CS3 }, + { "cs4", IPTOS_DSCP_CS4 }, + { "cs5", IPTOS_DSCP_CS5 }, + { "cs6", IPTOS_DSCP_CS6 }, + { "cs7", IPTOS_DSCP_CS7 }, + { "ef", IPTOS_DSCP_EF }, + { "inetcontrol", IPTOS_PREC_INTERNETCONTROL }, + { "lowdelay", IPTOS_LOWDELAY }, + { "netcontrol", IPTOS_PREC_NETCONTROL }, + { "reliability", IPTOS_RELIABILITY }, + { "throughput", IPTOS_THROUGHPUT }, + { NULL, -1 }, + }; + + for (t = toskeywords; t->keyword != NULL; t++) { + if (strcmp(s, t->keyword) == 0) { + *val = t->val; + return (1); + } + } - if (strcmp(s, "lowdelay") == 0) - return (IPTOS_LOWDELAY); - if (strcmp(s, "throughput") == 0) - return (IPTOS_THROUGHPUT); - if (strcmp(s, "reliability") == 0) - return (IPTOS_RELIABILITY); - - if (sscanf(s, "0x%x", &tos) != 1 || tos < 0 || tos > 0xff) - errx(1, "invalid IP Type of Service"); - return (tos); + return (0); } void @@ -990,7 +1066,7 @@ help(void) \t-r Randomize remote ports\n\ \t-S Enable the TCP MD5 signature option\n\ \t-s addr\t Local source address\n\ - \t-T ToS\t Set IP Type of Service\n\ + \t-T toskeyword\tSet IP Type of Service\n\ \t-t Answer TELNET negotiation\n\ \t-U Use UNIX domain socket\n\ \t-u UDP mode\n\ From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 00:31:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40550106566B; Wed, 27 Jun 2012 00:31:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 105F28FC1A; Wed, 27 Jun 2012 00:31:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R0VUrT071079; Wed, 27 Jun 2012 00:31:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R0VU2U071077; Wed, 27 Jun 2012 00:31:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206270031.q5R0VU2U071077@svn.freebsd.org> From: Xin LI Date: Wed, 27 Jun 2012 00:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237615 - stable/9/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 00:31:31 -0000 Author: delphij Date: Wed Jun 27 00:31:30 2012 New Revision: 237615 URL: http://svn.freebsd.org/changeset/base/237615 Log: MFC r237339: Polish previous revision: if the fts_* routines have lstat()'ed the directory entry then use the struct stat from that instead of doing it again, and skip the rm_overwrite() call if fts_read() indicated that the entry couldn't be a regular file. Obtained from: OpenBSD MFC r237284 (kevlo): Fix potential symlink race condition in "rm -P" by adding a check that the file we have opened is the one we expected. Also open in non-blocking mode to avoid a potential hang with FIFOs. Obtained from: NetBSD via OpenBSD Modified: stable/9/bin/rm/rm.c Directory Properties: stable/9/bin/rm/ (props changed) Modified: stable/9/bin/rm/rm.c ============================================================================== --- stable/9/bin/rm/rm.c Tue Jun 26 23:31:57 2012 (r237614) +++ stable/9/bin/rm/rm.c Wed Jun 27 00:31:30 2012 (r237615) @@ -301,10 +301,16 @@ rm_tree(char **argv) if (fflag) continue; /* FALLTHROUGH */ - default: + + case FTS_F: + case FTS_NSOK: if (Pflag) - if (!rm_overwrite(p->fts_accpath, NULL)) + if (!rm_overwrite(p->fts_accpath, p->fts_info == + FTS_NSOK ? NULL : p->fts_statp)) continue; + /* FALLTHROUGH */ + + default: rval = unlink(p->fts_accpath); if (rval == 0 || (fflag && errno == ENOENT)) { if (rval == 0 && vflag) @@ -408,7 +414,7 @@ rm_file(char **argv) int rm_overwrite(char *file, struct stat *sbp) { - struct stat sb; + struct stat sb, sb2; struct statfs fsb; off_t len; int bsize, fd, wlen; @@ -427,8 +433,15 @@ rm_overwrite(char *file, struct stat *sb file, sbp->st_ino); return (0); } - if ((fd = open(file, O_WRONLY, 0)) == -1) + if ((fd = open(file, O_WRONLY|O_NONBLOCK|O_NOFOLLOW, 0)) == -1) + goto err; + if (fstat(fd, &sb2)) goto err; + if (sb2.st_dev != sbp->st_dev || sb2.st_ino != sbp->st_ino || + !S_ISREG(sb2.st_mode)) { + errno = EPERM; + goto err; + } if (fstatfs(fd, &fsb) == -1) goto err; bsize = MAX(fsb.f_iosize, 1024); From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 00:34:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 680FB106566C; Wed, 27 Jun 2012 00:34:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 389148FC0A; Wed, 27 Jun 2012 00:34:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R0Y7A8071239; Wed, 27 Jun 2012 00:34:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R0Y78A071237; Wed, 27 Jun 2012 00:34:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206270034.q5R0Y78A071237@svn.freebsd.org> From: Xin LI Date: Wed, 27 Jun 2012 00:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237616 - stable/8/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 00:34:07 -0000 Author: delphij Date: Wed Jun 27 00:34:06 2012 New Revision: 237616 URL: http://svn.freebsd.org/changeset/base/237616 Log: MFC r237339: Polish previous revision: if the fts_* routines have lstat()'ed the directory entry then use the struct stat from that instead of doing it again, and skip the rm_overwrite() call if fts_read() indicated that the entry couldn't be a regular file. Obtained from: OpenBSD MFC r237284 (kevlo): Fix potential symlink race condition in "rm -P" by adding a check that the file we have opened is the one we expected. Also open in non-blocking mode to avoid a potential hang with FIFOs. Obtained from: NetBSD via OpenBSD Modified: stable/8/bin/rm/rm.c Directory Properties: stable/8/bin/rm/ (props changed) Modified: stable/8/bin/rm/rm.c ============================================================================== --- stable/8/bin/rm/rm.c Wed Jun 27 00:31:30 2012 (r237615) +++ stable/8/bin/rm/rm.c Wed Jun 27 00:34:06 2012 (r237616) @@ -301,10 +301,16 @@ rm_tree(char **argv) if (fflag) continue; /* FALLTHROUGH */ - default: + + case FTS_F: + case FTS_NSOK: if (Pflag) - if (!rm_overwrite(p->fts_accpath, NULL)) + if (!rm_overwrite(p->fts_accpath, p->fts_info == + FTS_NSOK ? NULL : p->fts_statp)) continue; + /* FALLTHROUGH */ + + default: rval = unlink(p->fts_accpath); if (rval == 0 || (fflag && errno == ENOENT)) { if (rval == 0 && vflag) @@ -408,7 +414,7 @@ rm_file(char **argv) int rm_overwrite(char *file, struct stat *sbp) { - struct stat sb; + struct stat sb, sb2; struct statfs fsb; off_t len; int bsize, fd, wlen; @@ -427,8 +433,15 @@ rm_overwrite(char *file, struct stat *sb file, sbp->st_ino); return (0); } - if ((fd = open(file, O_WRONLY, 0)) == -1) + if ((fd = open(file, O_WRONLY|O_NONBLOCK|O_NOFOLLOW, 0)) == -1) + goto err; + if (fstat(fd, &sb2)) goto err; + if (sb2.st_dev != sbp->st_dev || sb2.st_ino != sbp->st_ino || + !S_ISREG(sb2.st_mode)) { + errno = EPERM; + goto err; + } if (fstatfs(fd, &fsb) == -1) goto err; bsize = MAX(fsb.f_iosize, 1024); From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 00:37:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9A071065672; Wed, 27 Jun 2012 00:37:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99D908FC15; Wed, 27 Jun 2012 00:37:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R0bMRO071415; Wed, 27 Jun 2012 00:37:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R0bMCm071413; Wed, 27 Jun 2012 00:37:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206270037.q5R0bMCm071413@svn.freebsd.org> From: Xin LI Date: Wed, 27 Jun 2012 00:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237617 - stable/7/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 00:37:22 -0000 Author: delphij Date: Wed Jun 27 00:37:22 2012 New Revision: 237617 URL: http://svn.freebsd.org/changeset/base/237617 Log: MFC r237339: Polish previous revision: if the fts_* routines have lstat()'ed the directory entry then use the struct stat from that instead of doing it again, and skip the rm_overwrite() call if fts_read() indicated that the entry couldn't be a regular file. Obtained from: OpenBSD MFC r237284 (kevlo): Fix potential symlink race condition in "rm -P" by adding a check that the file we have opened is the one we expected. Also open in non-blocking mode to avoid a potential hang with FIFOs. Obtained from: NetBSD via OpenBSD Modified: stable/7/bin/rm/rm.c Directory Properties: stable/7/bin/rm/ (props changed) Modified: stable/7/bin/rm/rm.c ============================================================================== --- stable/7/bin/rm/rm.c Wed Jun 27 00:34:06 2012 (r237616) +++ stable/7/bin/rm/rm.c Wed Jun 27 00:37:22 2012 (r237617) @@ -288,10 +288,16 @@ rm_tree(char **argv) if (fflag) continue; /* FALLTHROUGH */ - default: + + case FTS_F: + case FTS_NSOK: if (Pflag) - if (!rm_overwrite(p->fts_accpath, NULL)) + if (!rm_overwrite(p->fts_accpath, p->fts_info == + FTS_NSOK ? NULL : p->fts_statp)) continue; + /* FALLTHROUGH */ + + default: rval = unlink(p->fts_accpath); if (rval == 0 || (fflag && errno == ENOENT)) { if (rval == 0 && vflag) @@ -386,7 +392,7 @@ rm_file(char **argv) int rm_overwrite(char *file, struct stat *sbp) { - struct stat sb; + struct stat sb, sb2; struct statfs fsb; off_t len; int bsize, fd, wlen; @@ -405,8 +411,15 @@ rm_overwrite(char *file, struct stat *sb file, sbp->st_ino); return (0); } - if ((fd = open(file, O_WRONLY, 0)) == -1) + if ((fd = open(file, O_WRONLY|O_NONBLOCK|O_NOFOLLOW, 0)) == -1) + goto err; + if (fstat(fd, &sb2)) goto err; + if (sb2.st_dev != sbp->st_dev || sb2.st_ino != sbp->st_ino || + !S_ISREG(sb2.st_mode)) { + errno = EPERM; + goto err; + } if (fstatfs(fd, &fsb) == -1) goto err; bsize = MAX(fsb.f_iosize, 1024); From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 00:50:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB3EF1065672; Wed, 27 Jun 2012 00:50:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABC858FC0A; Wed, 27 Jun 2012 00:50:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R0oPsw071968; Wed, 27 Jun 2012 00:50:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R0oPas071965; Wed, 27 Jun 2012 00:50:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206270050.q5R0oPas071965@svn.freebsd.org> From: Xin LI Date: Wed, 27 Jun 2012 00:50: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: r237618 - head/usr.bin/killall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 00:50:26 -0000 Author: delphij Date: Wed Jun 27 00:50:25 2012 New Revision: 237618 URL: http://svn.freebsd.org/changeset/base/237618 Log: Add a -I flag which requests confirmation before action, like what is done in pkill(1). MFC after: 2 weeks Modified: head/usr.bin/killall/killall.1 head/usr.bin/killall/killall.c Modified: head/usr.bin/killall/killall.1 ============================================================================== --- head/usr.bin/killall/killall.1 Wed Jun 27 00:37:22 2012 (r237617) +++ head/usr.bin/killall/killall.1 Wed Jun 27 00:50:25 2012 (r237618) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2009 +.Dd June 27, 2012 .Dt KILLALL 1 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nm .Op Fl delmsvz .Op Fl help +.Op Fl I .Op Fl j Ar jail .Op Fl u Ar user .Op Fl t Ar tty @@ -71,6 +72,9 @@ processes specified with the option. .It Fl help Give a help on the command usage and exit. +.It Fl I +Request confirmation before attempting to signal each +process. .It Fl l List the names of the available signals and exit, like in .Xr kill 1 . Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Wed Jun 27 00:37:22 2012 (r237617) +++ head/usr.bin/killall/killall.c Wed Jun 27 00:50:25 2012 (r237618) @@ -53,7 +53,7 @@ static void __dead2 usage(void) { - fprintf(stderr, "usage: killall [-delmsvz] [-help] [-j jail]\n"); + fprintf(stderr, "usage: killall [-delmsvz] [-help] [-I] [-j jail]\n"); fprintf(stderr, " [-u user] [-t tty] [-c cmd] [-SIGNAL] [cmd]...\n"); fprintf(stderr, "At least one option or argument to specify processes must be given.\n"); @@ -95,8 +95,9 @@ main(int ac, char **av) struct passwd *pw; regex_t rgx; regmatch_t pmatch; - int i, j; + int i, j, ch; char buf[256]; + char first; char *user = NULL; char *tty = NULL; char *cmd = NULL; @@ -104,6 +105,7 @@ main(int ac, char **av) int sflag = 0; int dflag = 0; int eflag = 0; + int Iflag = 0; int jflag = 0; int mflag = 0; int zflag = 0; @@ -141,6 +143,9 @@ main(int ac, char **av) if (**av == '-') { ++*av; switch (**av) { + case 'I': + Iflag = 1; + break; case 'j': ++*av; if (**av == '\0') { @@ -382,6 +387,16 @@ main(int ac, char **av) if (matched) break; } + if (matched != 0 && Iflag) { + printf("Send signal %d to %s (pid %d uid %d)? ", + sig, thiscmd, thispid, thisuid); + fflush(stdout); + first = ch = getchar(); + while (ch != '\n' && ch != EOF) + ch = getchar(); + if (first != 'y' && first != 'Y') + matched = 0; + } if (matched == 0) continue; if (dflag) From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 01:13:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9738106564A; Wed, 27 Jun 2012 01:13:37 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B98B98FC18; Wed, 27 Jun 2012 01:13:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R1Dbwn073009; Wed, 27 Jun 2012 01:13:37 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R1DbZ2073007; Wed, 27 Jun 2012 01:13:37 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201206270113.q5R1DbZ2073007@svn.freebsd.org> From: Julian Elischer Date: Wed, 27 Jun 2012 01:13: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: r237619 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 01:13:38 -0000 Author: julian Date: Wed Jun 27 01:13:37 2012 New Revision: 237619 URL: http://svn.freebsd.org/changeset/base/237619 Log: Try clean up some of my original text and neaten a table. MFC after: 1 week Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Wed Jun 27 00:50:25 2012 (r237618) +++ head/share/man/man9/locking.9 Wed Jun 27 01:13:37 2012 (r237619) @@ -37,11 +37,19 @@ kernel is written to run across multiple several different synchronization primitives to allow the developers to safely access and manipulate the many data types required. .Ss Mutexes -Mutexes (also called "sleep mutexes") are the most commonly used +Mutexes (also erroneously called "sleep mutexes") are the most commonly used synchronization primitive in the kernel. -Thread acquires (locks) a mutex before accessing data shared with other +A thread acquires (locks) a mutex before accessing data shared with other threads (including interrupt threads), and releases (unlocks) it afterwards. -If the mutex cannot be acquired, the thread requesting it will sleep. +If the mutex cannot be acquired, the thread requesting it will wait. +Mutexes are by default adaptive, meaning that +if the owner of a contended mutex is currently running on another CPU, +then a thread attempting to acquire the mutex will briefly spin +in the hope that the owner is only briefly holding it, +and might release it shortly. +If the owner does not do so, the waiting thread proceeds to yield the processor, +allowing other threads to run. +If the owner is not currently actually running then the spin step is skipped. Mutexes fully support priority propagation. .Pp See @@ -49,9 +57,10 @@ See for details. .Ss Spin mutexes Spin mutexes are variation of basic mutexes; the main difference between -the two is that spin mutexes never sleep - instead, they spin, waiting -for the thread holding the lock, which runs on another CPU, to release it. -Differently from ordinary mutex, spin mutexes disable interrupts when acquired. +the two is that spin mutexes never yield the processor - instead, they spin, +waiting for the thread holding the lock, +(which must be running on another CPU), to release it. +Spin mutexes disable interrupts while the held so as to not get pre-empted. Since disabling interrupts is expensive, they are also generally slower. Spin mutexes should be used only when necessary, e.g. to protect data shared with interrupt filter code (see @@ -122,7 +131,7 @@ and read-mostly locks. They don't support priority propagation. They should be considered to be closely related to .Xr sleep 9 . -In fact it could in some cases be +They could in some cases be considered a conditional sleep. .Pp See @@ -146,8 +155,8 @@ A thread must hold the mutex before call .Fn cv_wait* , functions. When a thread waits on a condition, the mutex -is atomically released before the thread is blocked, then reacquired -before the function call returns. +is atomically released before the thread thread yields the processor, +then reacquired before the function call returns. .Pp See .Xr condvar 9 @@ -255,14 +264,14 @@ Many of these rules are checked using th .Xr witness 4 code. .Ss Bounded vs. unbounded sleep -The following primitives perform bounded sleep: mutexes, pool mutexes, -reader/writer locks and read-mostly locks. +The following primitives perform bounded sleep: + mutexes, pool mutexes, reader/writer locks and read-mostly locks. .Pp -The following primitives block (perform unbounded sleep): shared/exclusive locks, -counting semaphores, condition variables, sleep/wakeup and lockmanager locks. +The following primitives may perform an unbounded sleep: +shared/exclusive locks, counting semaphores, condition variables, sleep/wakeup and lockmanager locks. .Pp -It is an error to do any operation that could result in any kind of sleep while -holding spin mutex. +It is an error to do any operation that could result in yielding the processor +while holding a spin mutex. .Pp As a general rule, it is an error to do any operation that could result in unbounded sleep while holding any primitive from the 'bounded sleep' group. @@ -284,21 +293,22 @@ Because the lock gets dropped during sle the assumptions that were made before, all the way up the call graph to the place where the lock was acquired. .Pp -It is an error to do any operation that could result in any kind of sleep when -running inside an interrupt filter. +It is an error to do any operation that could result in yielding of +the processor when running inside an interrupt filter. .Pp It is an error to do any operation that could result in unbounded sleep when running inside an interrupt thread. .Ss Interaction table The following table shows what you can and can not do while holding one of the synchronization primitives discussed: -.Bl -column ".Ic xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXX" -offset indent -.It Em "You have: You want:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep +.Bl -column ".Ic xxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXX" -offset indent +.It Em " You want:" Ta spin-mtx Ta mutex Ta rwlock Ta rmlock Ta sx Ta sleep +.It Em "You have: " Ta ------ Ta ------ Ta ------ Ta ------ Ta ------ Ta ------ .It spin mtx Ta \&ok-1 Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no-3 -.It mutex Ta \&ok Ta \&ok-1 Ta \&no Ta \&ok Ta \&ok Ta \&no-3 -.It sx Ta \&ok Ta \&ok Ta \&ok-2 Ta \&ok Ta \&ok Ta \&ok-4 -.It rwlock Ta \&ok Ta \&ok Ta \&no Ta \&ok-2 Ta \&ok Ta \&no-3 -.It rmlock Ta \&ok Ta \&ok Ta \&no-5 Ta \&ok Ta \&ok-2 Ta \&no-5 +.It mutex Ta \&ok Ta \&ok-1 Ta \&ok Ta \&ok Ta \&no Ta \&no-3 +.It rwlock Ta \&ok Ta \&ok Ta \&ok-2 Ta \&ok Ta \&no Ta \&no-3 +.It rmlock Ta \&ok Ta \&ok Ta \&ok Ta \&ok-2 Ta \&no-5 Ta \&no-5 +.It sx Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&no-2 Ta \&ok-4 .El .Pp .Em *1 From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 01:44:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72F9D106566C; Wed, 27 Jun 2012 01:44:49 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C0F88FC0A; Wed, 27 Jun 2012 01:44:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R1inl1074279; Wed, 27 Jun 2012 01:44:49 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R1inn7074277; Wed, 27 Jun 2012 01:44:49 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206270144.q5R1inn7074277@svn.freebsd.org> From: Warren Block Date: Wed, 27 Jun 2012 01:44: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: r237620 - head/sbin/geom/class/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 01:44:49 -0000 Author: wblock (doc committer) Date: Wed Jun 27 01:44:48 2012 New Revision: 237620 URL: http://svn.freebsd.org/changeset/base/237620 Log: Use possessive "its", no apostrophe. MFC after: 1 day Modified: head/sbin/geom/class/raid/graid.8 Modified: head/sbin/geom/class/raid/graid.8 ============================================================================== --- head/sbin/geom/class/raid/graid.8 Wed Jun 27 01:13:37 2012 (r237619) +++ head/sbin/geom/class/raid/graid.8 Wed Jun 27 01:44:48 2012 (r237620) @@ -85,7 +85,7 @@ utility is used to manage software RAID GEOM RAID class. GEOM RAID class uses on-disk metadata to provide access to software-RAID volumes defined by different RAID BIOSes. -Depending on RAID BIOS type and it's metadata format, different subsets of +Depending on RAID BIOS type and its metadata format, different subsets of configurations and features are supported. To allow booting from RAID volume, the metadata format should match the RAID BIOS type and its capabilities. From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 03:00:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B875A106564A; Wed, 27 Jun 2012 03:00:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8974D8FC12; Wed, 27 Jun 2012 03:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R30U9P077384; Wed, 27 Jun 2012 03:00:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R30Uph077382; Wed, 27 Jun 2012 03:00:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206270300.q5R30Uph077382@svn.freebsd.org> From: Adrian Chadd Date: Wed, 27 Jun 2012 03:00: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: r237621 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 03:00:30 -0000 Author: adrian Date: Wed Jun 27 03:00:29 2012 New Revision: 237621 URL: http://svn.freebsd.org/changeset/base/237621 Log: Remove duplicate entries. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.h Wed Jun 27 01:44:48 2012 (r237620) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.h Wed Jun 27 03:00:29 2012 (r237621) @@ -28,37 +28,4 @@ #define AR5416_STOMP_ALL_FORCE_WLAN_WGHT 0xffff // Stomp BT even when WLAN is idle #define AR5416_STOMP_LOW_FORCE_WLAN_WGHT 0xaaaa // Stomp BT even when WLAN is idle -#define AR9300_BT_WGHT 0xcccc4444 -#define AR9300_STOMP_ALL_WLAN_WGHT0 0xfffffff0 -#define AR9300_STOMP_ALL_WLAN_WGHT1 0xfffffff0 -#define AR9300_STOMP_LOW_WLAN_WGHT0 0x88888880 -#define AR9300_STOMP_LOW_WLAN_WGHT1 0x88888880 -#define AR9300_STOMP_NONE_WLAN_WGHT0 0x00000000 -#define AR9300_STOMP_NONE_WLAN_WGHT1 0x00000000 -#define AR9300_STOMP_ALL_FORCE_WLAN_WGHT0 0xffffffff // Stomp BT even when WLAN is idle -#define AR9300_STOMP_ALL_FORCE_WLAN_WGHT1 0xffffffff -#define AR9300_STOMP_LOW_FORCE_WLAN_WGHT0 0x88888888 // Stomp BT even when WLAN is idle -#define AR9300_STOMP_LOW_FORCE_WLAN_WGHT1 0x88888888 - -#define JUPITER_STOMP_ALL_WLAN_WGHT0 0x00007d00 -#define JUPITER_STOMP_ALL_WLAN_WGHT1 0x7d7d7d00 -#define JUPITER_STOMP_ALL_WLAN_WGHT2 0x7d7d7d00 -#define JUPITER_STOMP_ALL_WLAN_WGHT3 0x7d7d7d7d -#define JUPITER_STOMP_LOW_WLAN_WGHT0 0x00007d00 -#define JUPITER_STOMP_LOW_WLAN_WGHT1 0x7d3b3b00 -#define JUPITER_STOMP_LOW_WLAN_WGHT2 0x3b3b3b00 -#define JUPITER_STOMP_LOW_WLAN_WGHT3 0x3b3b3b3b -#define JUPITER_STOMP_NONE_WLAN_WGHT0 0x00007d00 -#define JUPITER_STOMP_NONE_WLAN_WGHT1 0x7d000000 -#define JUPITER_STOMP_NONE_WLAN_WGHT2 0x00000000 -#define JUPITER_STOMP_NONE_WLAN_WGHT3 0x00000000 -#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT0 0x00007d7d -#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT1 0x7d7d7d00 -#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT2 0x7d7d7d7d -#define JUPITER_STOMP_ALL_FORCE_WLAN_WGHT3 0x7d7d7d7d -#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT0 0x00003b3b -#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT1 0x3b3b3b00 -#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT2 0x3b3b3b3b -#define JUPITER_STOMP_LOW_FORCE_WLAN_WGHT3 0x3b3b3b3b - #endif /* __ATH_AR5416_BTCOEX_H__ */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 03:24:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86BB91065674; Wed, 27 Jun 2012 03:24:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 716748FC16; Wed, 27 Jun 2012 03:24:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R3OSPl078634; Wed, 27 Jun 2012 03:24:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R3OS4F078632; Wed, 27 Jun 2012 03:24:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206270324.q5R3OS4F078632@svn.freebsd.org> From: Adrian Chadd Date: Wed, 27 Jun 2012 03:24: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: r237622 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 03:24:28 -0000 Author: adrian Date: Wed Jun 27 03:24:27 2012 New Revision: 237622 URL: http://svn.freebsd.org/changeset/base/237622 Log: Bring over some new typedefs as part of the AR9300 HAL import. Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Wed Jun 27 03:00:29 2012 (r237621) +++ head/sys/dev/ath/ath_hal/ah.h Wed Jun 27 03:24:27 2012 (r237622) @@ -420,6 +420,30 @@ typedef enum { | HAL_INT_GPIO, } HAL_INT; +/* + * MSI vector assignments + */ +typedef enum { + HAL_MSIVEC_MISC = 0, + HAL_MSIVEC_TX = 1, + HAL_MSIVEC_RXLP = 2, + HAL_MSIVEC_RXHP = 3, +} HAL_MSIVEC; + +typedef enum { + HAL_INT_LINE = 0, + HAL_INT_MSI = 1, +} HAL_INT_TYPE; + +/* For interrupt mitigation registers */ +typedef enum { + HAL_INT_RX_FIRSTPKT=0, + HAL_INT_RX_LASTPKT, + HAL_INT_TX_FIRSTPKT, + HAL_INT_TX_LASTPKT, + HAL_INT_THRESHOLD +} HAL_INT_MITIGATION; + typedef enum { HAL_GPIO_OUTPUT_MUX_AS_OUTPUT = 0, HAL_GPIO_OUTPUT_MUX_PCIE_ATTENTION_LED = 1, From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 03:45:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1EC6106566B; Wed, 27 Jun 2012 03:45:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D16F98FC19; Wed, 27 Jun 2012 03:45:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R3jP4C079507; Wed, 27 Jun 2012 03:45:25 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R3jPxP079500; Wed, 27 Jun 2012 03:45:25 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201206270345.q5R3jPxP079500@svn.freebsd.org> From: Alan Cox Date: Wed, 27 Jun 2012 03:45: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: r237623 - in head/sys: amd64/amd64 i386/i386 kern sparc64/sparc64 vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 03:45:26 -0000 Author: alc Date: Wed Jun 27 03:45:25 2012 New Revision: 237623 URL: http://svn.freebsd.org/changeset/base/237623 Log: Add new pmap layer locks to the predefined lock order. Change the names of a few existing VM locks to follow a consistent naming scheme. Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/kern/subr_witness.c head/sys/sparc64/sparc64/pmap.c head/sys/vm/vm_map.c head/sys/vm/vm_page.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jun 27 03:24:27 2012 (r237622) +++ head/sys/amd64/amd64/pmap.c Wed Jun 27 03:45:25 2012 (r237623) @@ -642,7 +642,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* * Initialize the global pv list lock. */ - rw_init(&pvh_global_lock, "pvh global"); + rw_init(&pvh_global_lock, "pmap pv global"); /* * Reserve some special page table entries/VA space for temporary @@ -810,13 +810,13 @@ pmap_init(void) /* * Initialize the pv chunk list mutex. */ - mtx_init(&pv_chunks_mutex, "pv chunk list", NULL, MTX_DEF); + mtx_init(&pv_chunks_mutex, "pmap pv chunk list", NULL, MTX_DEF); /* * Initialize the pool of pv list locks. */ for (i = 0; i < NPV_LIST_LOCKS; i++) - rw_init(&pv_list_locks[i], "pv list"); + rw_init(&pv_list_locks[i], "pmap pv list"); /* * Calculate the size of the pv head table for superpages. Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Jun 27 03:24:27 2012 (r237622) +++ head/sys/i386/i386/pmap.c Wed Jun 27 03:45:25 2012 (r237623) @@ -409,7 +409,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * Initialize the global pv list lock. */ - rw_init(&pvh_global_lock, "pvh global"); + rw_init(&pvh_global_lock, "pmap pv global"); LIST_INIT(&allpmaps); Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Jun 27 03:24:27 2012 (r237622) +++ head/sys/kern/subr_witness.c Wed Jun 27 03:45:25 2012 (r237623) @@ -593,19 +593,22 @@ static struct witness_order_list_entry o /* * CDEV */ - { "system map", &lock_class_mtx_sleep }, - { "vm page queue mutex", &lock_class_mtx_sleep }, + { "vm map (system)", &lock_class_mtx_sleep }, + { "vm page queue", &lock_class_mtx_sleep }, { "vnode interlock", &lock_class_mtx_sleep }, { "cdev", &lock_class_mtx_sleep }, { NULL, NULL }, /* * VM - * */ + { "vm map (user)", &lock_class_sx }, { "vm object", &lock_class_mtx_sleep }, - { "page lock", &lock_class_mtx_sleep }, - { "vm page queue mutex", &lock_class_mtx_sleep }, + { "vm page", &lock_class_mtx_sleep }, + { "vm page queue", &lock_class_mtx_sleep }, + { "pmap pv global", &lock_class_rw }, { "pmap", &lock_class_mtx_sleep }, + { "pmap pv list", &lock_class_rw }, + { "vm page free queue", &lock_class_mtx_sleep }, { NULL, NULL }, /* * kqueue/VFS interaction Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Wed Jun 27 03:24:27 2012 (r237622) +++ head/sys/sparc64/sparc64/pmap.c Wed Jun 27 03:45:25 2012 (r237623) @@ -673,9 +673,10 @@ pmap_bootstrap(u_int cpu_impl) CPU_FILL(&pm->pm_active); /* - * Initialize the global tte list lock. + * Initialize the global tte list lock, which is more commonly + * known as the pmap pv global lock. */ - rw_init(&tte_list_global_lock, "tte list global"); + rw_init(&tte_list_global_lock, "pmap pv global"); /* * Flush all non-locked TLB entries possibly left over by the Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Jun 27 03:24:27 2012 (r237622) +++ head/sys/vm/vm_map.c Wed Jun 27 03:45:25 2012 (r237623) @@ -241,8 +241,8 @@ vm_map_zinit(void *mem, int size, int fl map = (vm_map_t)mem; map->nentries = 0; map->size = 0; - mtx_init(&map->system_mtx, "system map", NULL, MTX_DEF | MTX_DUPOK); - sx_init(&map->lock, "user map"); + mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | MTX_DUPOK); + sx_init(&map->lock, "vm map (user)"); return (0); } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Jun 27 03:24:27 2012 (r237622) +++ head/sys/vm/vm_page.c Wed Jun 27 03:45:25 2012 (r237623) @@ -292,16 +292,13 @@ vm_page_startup(vm_offset_t vaddr) end = phys_avail[biggestone+1]; /* - * Initialize the locks. + * Initialize the page and queue locks. */ - mtx_init(&vm_page_queue_mtx, "vm page queue mutex", NULL, MTX_DEF | + mtx_init(&vm_page_queue_mtx, "vm page queue", NULL, MTX_DEF | MTX_RECURSE); - mtx_init(&vm_page_queue_free_mtx, "vm page queue free mutex", NULL, - MTX_DEF); - - /* Setup page locks. */ + mtx_init(&vm_page_queue_free_mtx, "vm page free queue", NULL, MTX_DEF); for (i = 0; i < PA_LOCK_COUNT; i++) - mtx_init(&pa_lock[i].data, "page lock", NULL, MTX_DEF); + mtx_init(&pa_lock[i].data, "vm page", NULL, MTX_DEF); /* * Initialize the queue headers for the hold queue, the active queue, From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 04:39:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86E87106566B; Wed, 27 Jun 2012 04:39:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C0F78FC08; Wed, 27 Jun 2012 04:39:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R4dVMT081771; Wed, 27 Jun 2012 04:39:31 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R4dU0n081732; Wed, 27 Jun 2012 04:39:30 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206270439.q5R4dU0n081732@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 27 Jun 2012 04: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: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 04:39:31 -0000 Author: pfg Date: Wed Jun 27 04:39:30 2012 New Revision: 237624 URL: http://svn.freebsd.org/changeset/base/237624 Log: Bring llquantize support into Dtrace. Bryan Cantrill implemented the equivalent of semi-log graph paper for Dtrace so llquantize will use one logarithmic and one linear scale. Special thanks to Mark Peek for providing fix to an assertion and to Fabian Keill for testing the port. Illumos Revision: 13355:15b74a2a9a9d Reference: https://www.illumos/issues/905 Obtained from: Illumos Tested by: Fabian Keill, mp MFC after: 4 days Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.normal.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.range.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.range.d.out (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.steps.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d (contents, props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out (contents, props changed) Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, 0, 10, 25); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, 0, 10, 30); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, 0, 10, 10); + @ = llquantize(0, 3, 0, 10, 81); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, 0, 10, 7); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 1, 0, 10, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + this->doogle = 10; + @ = llquantize(0, this->doogle, 0, 10, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 65537, 0, 10, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, 0, 10, 10); + @ = llquantize(0, 10, 0, 11, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + this->doogle = 10; + @ = llquantize(0, 10, 0, this->doogle, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, 0, -1, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, 0, 10, 10); + @ = llquantize(0, 10, 1, 10, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + this->doogle = 0; + @ = llquantize(0, 10, this->doogle, 10, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, -1, 10, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, 10, 0, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, 0, 100, 10); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(0, 10, 0, 10, 10); + @ = llquantize(0, 10, 0, 10, 100); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + this->doogle = 10; + @ = llquantize(0, 10, 0, 10, this->doogle); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + @ = llquantize(123, 10, 0, 10, 123456); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet + +tick-1ms +/i++ <= 100/ +{ + @two = llquantize(i, 2, 0, 6, 2); + @three = llquantize(i, 3, 0, 1, 9); + @four = llquantize(i, 4, 0, 1, 4); + @five = llquantize(i, 5, 0, 1, 25); + @six = llquantize(i, 6, 0, 3, 12); + @seven = llquantize(i, 7, 0, 1, 7); + @eight = llquantize(i, 8, 0, 1, 16); + @nine = llquantize(i, 9, 0, 1, 9); + @ten = llquantize(i, 10, 0, 1, 10); +} + +tick-1ms +/i > 100/ +{ + exit(0); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,177 @@ + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 1 + 2 |@ 2 + 4 |@@ 4 + 8 |@@@ 8 + 16 |@@@@@@ 16 + 32 |@@@@@@@@@@@@@ 32 + 64 |@@@@@@@@@@@@@@@ 38 + >= 128 | 0 + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 1 + 2 | 1 + 3 | 1 + 4 | 1 + 5 | 1 + 6 | 1 + 7 | 1 + 8 | 1 + >= 9 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 93 + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 1 + 2 | 1 + 3 | 1 + 4 |@@ 4 + 8 |@@ 4 + 12 |@@ 4 + >= 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 86 + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 1 + 2 | 1 + 3 | 1 + 4 | 1 + 5 | 1 + 6 | 1 + 7 | 1 + 8 | 1 + 9 | 1 + 10 | 1 + 11 | 1 + 12 | 1 + 13 | 1 + 14 | 1 + 15 | 1 + 16 | 1 + 17 | 1 + 18 | 1 + 19 | 1 + 20 | 1 + 21 | 1 + 22 | 1 + 23 | 1 + 24 | 1 + >= 25 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 77 + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 1 + 2 | 1 + 3 | 1 + 4 | 1 + 5 | 1 + 6 |@ 3 + 9 |@ 3 + 12 |@ 3 + 15 |@ 3 + 18 |@ 3 + 21 |@ 3 + 24 |@ 3 + 27 |@ 3 + 30 |@ 3 + 33 |@ 3 + 36 |@@@@@@@ 18 + 54 |@@@@@@@ 18 + 72 |@@@@@@@ 18 + 90 |@@@@@ 12 + 108 | 0 + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 1 + 2 | 1 + 3 | 1 + 4 | 1 + 5 | 1 + 6 | 1 + 7 |@@@ 7 + 14 |@@@ 7 + 21 |@@@ 7 + 28 |@@@ 7 + 35 |@@@ 7 + 42 |@@@ 7 + >= 49 |@@@@@@@@@@@@@@@@@@@@@ 53 + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 1 + 2 | 1 + 3 | 1 + 4 | 1 + 5 | 1 + 6 | 1 + 7 | 1 + 8 |@@ 4 + 12 |@@ 4 + 16 |@@ 4 + 20 |@@ 4 + 24 |@@ 4 + 28 |@@ 4 + 32 |@@ 4 + 36 |@@ 4 + 40 |@@ 4 + 44 |@@ 4 + 48 |@@ 4 + 52 |@@ 4 + 56 |@@ 4 + 60 |@@ 4 + >= 64 |@@@@@@@@@@@@@@@ 38 + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 1 + 2 | 1 + 3 | 1 + 4 | 1 + 5 | 1 + 6 | 1 + 7 | 1 + 8 | 1 + 9 |@@@@ 9 + 18 |@@@@ 9 + 27 |@@@@ 9 + 36 |@@@@ 9 + 45 |@@@@ 9 + 54 |@@@@ 9 + 63 |@@@@ 9 + 72 |@@@@ 9 + >= 81 |@@@@@@@@ 21 + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 1 + 2 | 1 + 3 | 1 + 4 | 1 + 5 | 1 + 6 | 1 + 7 | 1 + 8 | 1 + 9 | 1 + 10 |@@@@ 10 + 20 |@@@@ 10 + 30 |@@@@ 10 + 40 |@@@@ 10 + 50 |@@@@ 10 + 60 |@@@@ 10 + 70 |@@@@ 10 + 80 |@@@@ 10 + 90 |@@@@ 10 + >= 100 |@ 2 + Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet + +tick-1ms +/i++ <= 100/ +{ + @ = llquantize(i, 10, 0, 10, 10); +} + +tick-1ms +/i > 100/ +{ + exit(0); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,25 @@ + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 1 + 2 | 1 + 3 | 1 + 4 | 1 + 5 | 1 + 6 | 1 + 7 | 1 + 8 | 1 + 9 | 1 + 10 |@@@@ 10 + 20 |@@@@ 10 + 30 |@@@@ 10 + 40 |@@@@ 10 + 50 |@@@@ 10 + 60 |@@@@ 10 + 70 |@@@@ 10 + 80 |@@@@ 10 + 90 |@@@@ 10 + 100 |@ 2 + 200 | 0 + Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,62 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet + +BEGIN +{ + a = 7; + b = 13; + val = (-a * b) + a; +} + +tick-1ms +{ + incr = val % b; + val += a; +} + +tick-1ms +/val == 0/ +{ + val += a; +} + +tick-1ms +/incr != 0/ +{ + i++; + @llquanty[i] = llquantize(1, 10, 0, 10, 10, incr); +} + +tick-1ms +/incr == 0/ +{ + printf("Ordering of llquantize() with some negative weights:\n"); + printa(@llquanty); + printf("\n"); + + exit(0); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out Wed Jun 27 04:39:30 2012 (r237624) @@ -0,0 +1,148 @@ +Ordering of llquantize() with some negative weights: + + 2 + value ------------- Distribution ------------- count + < 1 | 0 + 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12 + 2 | 0 + + 4 + value ------------- Distribution ------------- count + < 1 | 0 + 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11 + 2 | 0 + + 6 + value ------------- Distribution ------------- count + < 1 | 0 + 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10 + 2 | 0 + + 8 + value ------------- Distribution ------------- count + < 1 | 0 + 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9 + 2 | 0 + + 10 + value ------------- Distribution ------------- count + < 1 | 0 + 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8 + 2 | 0 + + 12 + value ------------- Distribution ------------- count + < 1 | 0 + 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7 + 2 | 0 + + 1 + value ------------- Distribution ------------- count + < 1 | 0 + 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6 + 2 | 0 + + 3 + value ------------- Distribution ------------- count + < 1 | 0 + 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5 + 2 | 0 + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 04:39:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96C79106566C; Wed, 27 Jun 2012 04:39:31 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 804BD8FC0A; Wed, 27 Jun 2012 04:39:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R4dVfk081772; Wed, 27 Jun 2012 04:39:31 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R4dVc8081763; Wed, 27 Jun 2012 04:39:31 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206270439.q5R4dVc8081763@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 27 Jun 2012 04:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237625 - in head/usr.sbin/crunch: crunchgen crunchide X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 04:39:31 -0000 Author: obrien Date: Wed Jun 27 04:39:30 2012 New Revision: 237625 URL: http://svn.freebsd.org/changeset/base/237625 Log: Some amount of style(9) -- function definitions, header ordering, and $FreeBSD$. Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c head/usr.sbin/crunch/crunchgen/crunchgen.c head/usr.sbin/crunch/crunchide/crunchide.c Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunched_main.c Wed Jun 27 04:39:30 2012 (r237624) +++ head/usr.sbin/crunch/crunchgen/crunched_main.c Wed Jun 27 04:39:30 2012 (r237625) @@ -22,8 +22,6 @@ * Author: James da Silva, Systems Design and Analysis Group * Computer Science Department * University of Maryland at College Park - * - * $FreeBSD$ */ /* * crunched_main.c - main program for crunched binaries, it branches to a @@ -33,6 +31,10 @@ * or calls one of them based on argv[1]. This allows the testing of * the crunched binary without creating all the links. */ + +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -45,7 +47,8 @@ struct stub { extern char *__progname; extern struct stub entry_points[]; -int main(int argc, char **argv, char **envp) +int +main(int argc, char **argv, char **envp) { char *slash, *basename; struct stub *ep; @@ -68,7 +71,8 @@ int main(int argc, char **argv, char **e } -int crunched_here(char *path) +int +crunched_here(char *path) { char *slash, *basename; struct stub *ep; @@ -83,7 +87,8 @@ int crunched_here(char *path) } -int crunched_main(int argc, char **argv, char **envp) +int +crunched_main(int argc, char **argv, char **envp) { char *slash; struct stub *ep; @@ -99,7 +104,8 @@ int crunched_main(int argc, char **argv, } -int crunched_usage() +int +crunched_usage() { int columns, len; struct stub *ep; @@ -122,4 +128,3 @@ int crunched_usage() } /* end of crunched_main.c */ - Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Wed Jun 27 04:39:30 2012 (r237624) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Wed Jun 27 04:39:30 2012 (r237625) @@ -22,8 +22,6 @@ * Author: James da Silva, Systems Design and Analysis Group * Computer Science Department * University of Maryland at College Park - * - * $FreeBSD$ */ /* * ======================================================================== @@ -32,9 +30,12 @@ * Generates a Makefile and main C file for a crunched executable, * from specs given in a .conf file. */ -#include -#include + +#include +__FBSDID("$FreeBSD$"); + #include +#include #include #include @@ -119,7 +120,8 @@ void parse_conf_file(void); void gen_outputs(void); -int main(int argc, char **argv) +int +main(int argc, char **argv) { char *p; int optc; @@ -223,7 +225,8 @@ int main(int argc, char **argv) } -void usage(void) +void +usage(void) { fprintf(stderr, "%s%s\n\t%s%s\n", "usage: crunchgen [-foq] ", "[-h ] [-m ]", @@ -255,7 +258,8 @@ prog_t *find_prog(char *str); void add_prog(char *progname); -void parse_conf_file(void) +void +parse_conf_file(void) { if (!is_nonempty_file(infilename)) errx(1, "fatal: input file \"%s\" not found", infilename); @@ -268,7 +272,8 @@ void parse_conf_file(void) } -void parse_one_file(char *filename) +void +parse_one_file(char *filename) { char *fieldv[MAXFIELDS]; int fieldc; @@ -334,7 +339,8 @@ void parse_one_file(char *filename) } -void parse_line(char *line, int *fc, char **fv, int nf) +void +parse_line(char *line, int *fc, char **fv, int nf) { char *p; @@ -365,7 +371,8 @@ void parse_line(char *line, int *fc, cha } -void add_srcdirs(int argc, char **argv) +void +add_srcdirs(int argc, char **argv) { int i; @@ -381,7 +388,8 @@ void add_srcdirs(int argc, char **argv) } -void add_progs(int argc, char **argv) +void +add_progs(int argc, char **argv) { int i; @@ -390,7 +398,8 @@ void add_progs(int argc, char **argv) } -void add_prog(char *progname) +void +add_prog(char *progname) { prog_t *p1, *p2; @@ -431,7 +440,8 @@ void add_prog(char *progname) } -void add_link(int argc, char **argv) +void +add_link(int argc, char **argv) { int i; prog_t *p = find_prog(argv[1]); @@ -452,7 +462,8 @@ void add_link(int argc, char **argv) } -void add_libs(int argc, char **argv) +void +add_libs(int argc, char **argv) { int i; @@ -466,7 +477,8 @@ void add_libs(int argc, char **argv) } -void add_libs_so(int argc, char **argv) +void +add_libs_so(int argc, char **argv) { int i; @@ -480,7 +492,8 @@ void add_libs_so(int argc, char **argv) } -void add_buildopts(int argc, char **argv) +void +add_buildopts(int argc, char **argv) { int i; @@ -489,7 +502,8 @@ void add_buildopts(int argc, char **argv } -void add_special(int argc, char **argv) +void +add_special(int argc, char **argv) { int i; prog_t *p = find_prog(argv[1]); @@ -591,7 +605,8 @@ char *genident(char *str); char *dir_search(char *progname); -void gen_outputs(void) +void +gen_outputs(void) { prog_t *p; @@ -611,7 +626,8 @@ void gen_outputs(void) /* * run the makefile for the program to find which objects are necessary */ -void fillin_program(prog_t *p) +void +fillin_program(prog_t *p) { char path[MAXPATHLEN]; char line[MAXLINELEN]; @@ -686,7 +702,8 @@ void fillin_program(prog_t *p) p->goterror = 1; } -void fillin_program_objs(prog_t *p, char *path) +void +fillin_program_objs(prog_t *p, char *path) { char *obj, *cp; int fd, rc; @@ -773,7 +790,8 @@ void fillin_program_objs(prog_t *p, char unlink(tempfname); } -void remove_error_progs(void) +void +remove_error_progs(void) { prog_t *p1, *p2; @@ -794,7 +812,8 @@ void remove_error_progs(void) } } -void gen_specials_cache(void) +void +gen_specials_cache(void) { FILE *cachef; prog_t *p; @@ -834,7 +853,8 @@ void gen_specials_cache(void) } -void gen_output_makefile(void) +void +gen_output_makefile(void) { prog_t *p; FILE *outmk; @@ -864,7 +884,8 @@ void gen_output_makefile(void) } -void gen_output_cfile(void) +void +gen_output_cfile(void) { extern char *crunched_skel[]; char **cp; @@ -952,7 +973,8 @@ char *dir_search(char *progname) } -void top_makefile_rules(FILE *outmk) +void +top_makefile_rules(FILE *outmk) { prog_t *p; @@ -1010,7 +1032,8 @@ void top_makefile_rules(FILE *outmk) } -void prog_makefile_rules(FILE *outmk, prog_t *p) +void +prog_makefile_rules(FILE *outmk, prog_t *p) { strlst_t *lst; @@ -1095,7 +1118,8 @@ void prog_makefile_rules(FILE *outmk, pr fprintf(outmk, "%s.lo\n", p->name); } -void output_strlst(FILE *outf, strlst_t *lst) +void +output_strlst(FILE *outf, strlst_t *lst) { for (; lst != NULL; lst = lst->next) if ( strlen(lst->str) ) @@ -1110,7 +1134,8 @@ void output_strlst(FILE *outf, strlst_t * */ -void status(char *str) +void +status(char *str) { static int lastlen = 0; int len, spaces; @@ -1129,13 +1154,15 @@ void status(char *str) } -void out_of_memory(void) +void +out_of_memory(void) { err(1, "%s: %d: out of memory, stopping", infilename, linenum); } -void add_string(strlst_t **listp, char *str) +void +add_string(strlst_t **listp, char *str) { strlst_t *p1, *p2; @@ -1159,7 +1186,8 @@ void add_string(strlst_t **listp, char * p1->next = p2; } -int subtract_strlst(strlst_t **lista, strlst_t **listb) +int +subtract_strlst(strlst_t **lista, strlst_t **listb) { int subtract_count = 0; strlst_t *p1; @@ -1172,7 +1200,8 @@ int subtract_strlst(strlst_t **lista, st return subtract_count; } -int in_list(strlst_t **listp, char *str) +int +in_list(strlst_t **listp, char *str) { strlst_t *p1; for (p1 = *listp; p1 != NULL; p1 = p1->next) @@ -1181,7 +1210,8 @@ int in_list(strlst_t **listp, char *str) return 0; } -int is_dir(char *pathname) +int +is_dir(char *pathname) { struct stat buf; @@ -1191,7 +1221,8 @@ int is_dir(char *pathname) return S_ISDIR(buf.st_mode); } -int is_nonempty_file(char *pathname) +int +is_nonempty_file(char *pathname) { struct stat buf; Modified: head/usr.sbin/crunch/crunchide/crunchide.c ============================================================================== --- head/usr.sbin/crunch/crunchide/crunchide.c Wed Jun 27 04:39:30 2012 (r237624) +++ head/usr.sbin/crunch/crunchide/crunchide.c Wed Jun 27 04:39:30 2012 (r237625) @@ -1,5 +1,4 @@ /* $NetBSD: crunchide.c,v 1.8 1997/11/01 06:51:45 lukem Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1997 Christopher G. Demetriou. All rights reserved. * Copyright (c) 1994 University of Maryland @@ -59,20 +58,22 @@ * that the final crunched binary BSS size is the max of all the * component programs' BSS sizes, rather than their sum. */ + #include #ifndef lint __RCSID("$NetBSD: crunchide.c,v 1.8 1997/11/01 06:51:45 lukem Exp $"); #endif +__FBSDID("$FreeBSD$"); +#include +#include +#include #include #include #include #include #include #include -#include -#include -#include #include "extern.h" @@ -89,9 +90,8 @@ int verbose; int main(int, char *[]); -int main(argc, argv) -int argc; -char **argv; +int +main(int argc, char **argv) { int ch, errors; @@ -127,7 +127,8 @@ char **argv; return errors; } -void usage(void) +void +usage(void) { fprintf(stderr, "usage: %s [-k ] [-f ] ...\n", @@ -142,7 +143,8 @@ struct keep { char *sym; } *keep_list; -void add_to_keep_list(char *symbol) +void +add_to_keep_list(char *symbol) { struct keep *newp, *prevp, *curp; int cmp; @@ -167,7 +169,8 @@ void add_to_keep_list(char *symbol) else keep_list = newp; } -int in_keep_list(const char *symbol) +int +in_keep_list(const char *symbol) { struct keep *curp; int cmp; @@ -180,7 +183,8 @@ int in_keep_list(const char *symbol) return curp && cmp == 0; } -void add_file_to_keep_list(char *filename) +void +add_file_to_keep_list(char *filename) { FILE *keepf; char symbol[1024]; @@ -222,7 +226,8 @@ struct { #endif }; -int hide_syms(const char *filename) +int +hide_syms(const char *filename) { int fd, i, n, rv; From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 05:23:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24553106564A; Wed, 27 Jun 2012 05:23:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA0F68FC08; Wed, 27 Jun 2012 05:23:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R5NX0d083705; Wed, 27 Jun 2012 05:23:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R5NXMO083703; Wed, 27 Jun 2012 05:23:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206270523.q5R5NXMO083703@svn.freebsd.org> From: Adrian Chadd Date: Wed, 27 Jun 2012 05:23: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: r237626 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 05:23:34 -0000 Author: adrian Date: Wed Jun 27 05:23:33 2012 New Revision: 237626 URL: http://svn.freebsd.org/changeset/base/237626 Log: Fix a subtle corner case surrounding the handling of OFDM restart along with AMPDU aggregate delimiters. If there's an OFDM restart during an aggregate, the hardware ACKs the previous frame, but communicates the RXed frame to the hardware as having had CRC delimiter error + OFDM_RESTART phy error. The frame however didn't have a CRC error and since the hardware ACKed the aggregate to the sender, it thinks the frame was received. Since I have no idea how often this occurs in the real world, add a debug statement so trigger whenever this occurs. I'd appreciate an email if someone finds this particular situation is triggered. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Wed Jun 27 04:39:30 2012 (r237625) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Wed Jun 27 05:23:33 2012 (r237626) @@ -240,11 +240,25 @@ ar5416ProcRxDesc(struct ath_hal *ah, str if (ads->ds_rxstatus8 & AR_PHYErr) { u_int phyerr; - rs->rs_status |= HAL_RXERR_PHY; + /* + * Packets with OFDM_RESTART on post delimiter are CRC OK and + * usable and MAC ACKs them. + * To avoid packet from being lost, we remove the PHY Err flag + * so that driver layer does not drop them. + */ phyerr = MS(ads->ds_rxstatus8, AR_PHYErrCode); - rs->rs_phyerr = phyerr; - } + if ((phyerr == HAL_PHYERR_OFDM_RESTART) && + (ads->ds_rxstatus8 & AR_PostDelimCRCErr)) { + ath_hal_printf(ah, + "%s: OFDM_RESTART on post-delim CRC error\n", + __func__); + rs->rs_phyerr = 0; + } else { + rs->rs_status |= HAL_RXERR_PHY; + rs->rs_phyerr = phyerr; + } + } if (ads->ds_rxstatus8 & AR_CRCErr) rs->rs_status |= HAL_RXERR_CRC; else if (ads->ds_rxstatus8 & AR_DecryptCRCErr) From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 05:38:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 400E5106566C; Wed, 27 Jun 2012 05:38:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 287918FC0C; Wed, 27 Jun 2012 05:38:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R5ceAl084332; Wed, 27 Jun 2012 05:38:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R5cdjZ084328; Wed, 27 Jun 2012 05:38:39 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201206270538.q5R5cdjZ084328@svn.freebsd.org> From: Alan Cox Date: Wed, 27 Jun 2012 05:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237627 - in stable/9/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 05:38:40 -0000 Author: alc Date: Wed Jun 27 05:38:39 2012 New Revision: 237627 URL: http://svn.freebsd.org/changeset/base/237627 Log: MFC r236214 Replace all uses of the vm page queues lock by a r/w lock that is private to this pmap.c. Modified: stable/9/sys/sparc64/include/pmap.h stable/9/sys/sparc64/sparc64/pmap.c stable/9/sys/sparc64/sparc64/tsb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/include/pmap.h ============================================================================== --- stable/9/sys/sparc64/include/pmap.h Wed Jun 27 05:23:33 2012 (r237626) +++ stable/9/sys/sparc64/include/pmap.h Wed Jun 27 05:38:39 2012 (r237627) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -101,6 +102,7 @@ void pmap_set_kctx(void); extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) +extern struct rwlock tte_list_global_lock; extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; Modified: stable/9/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/9/sys/sparc64/sparc64/pmap.c Wed Jun 27 05:23:33 2012 (r237626) +++ stable/9/sys/sparc64/sparc64/pmap.c Wed Jun 27 05:38:39 2012 (r237627) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -134,6 +135,11 @@ vm_offset_t vm_max_kernel_address; struct pmap kernel_pmap_store; /* + * Global tte list lock + */ +struct rwlock tte_list_global_lock; + +/* * Allocate physical memory for use in pmap_bootstrap. */ static vm_paddr_t pmap_bootstrap_alloc(vm_size_t size, uint32_t colors); @@ -666,6 +672,11 @@ pmap_bootstrap(u_int cpu_impl) pm->pm_context[i] = TLB_CTX_KERNEL; CPU_FILL(&pm->pm_active); + /* + * Initialize the global tte list lock. + */ + rw_init(&tte_list_global_lock, "tte list global"); + /* * Flush all non-locked TLB entries possibly left over by the * firmware. @@ -876,7 +887,7 @@ pmap_cache_enter(vm_page_t m, vm_offset_ struct tte *tp; int color; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); KASSERT((m->flags & PG_FICTITIOUS) == 0, ("pmap_cache_enter: fake page")); PMAP_STATS_INC(pmap_ncache_enter); @@ -951,7 +962,7 @@ pmap_cache_remove(vm_page_t m, vm_offset struct tte *tp; int color; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); CTR3(KTR_PMAP, "pmap_cache_remove: m=%p va=%#lx c=%d", m, va, m->md.colors[DCACHE_COLOR(va)]); KASSERT((m->flags & PG_FICTITIOUS) == 0, @@ -1026,7 +1037,7 @@ pmap_kenter(vm_offset_t va, vm_page_t m) vm_page_t om; u_long data; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); PMAP_STATS_INC(pmap_nkenter); tp = tsb_kvtotte(va); CTR4(KTR_PMAP, "pmap_kenter: va=%#lx pa=%#lx tp=%p data=%#lx", @@ -1088,7 +1099,7 @@ pmap_kremove(vm_offset_t va) struct tte *tp; vm_page_t m; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); PMAP_STATS_INC(pmap_nkremove); tp = tsb_kvtotte(va); CTR3(KTR_PMAP, "pmap_kremove: va=%#lx tp=%p data=%#lx", va, tp, @@ -1139,19 +1150,16 @@ void pmap_qenter(vm_offset_t sva, vm_page_t *m, int count) { vm_offset_t va; - int locked; PMAP_STATS_INC(pmap_nqenter); va = sva; - if (!(locked = mtx_owned(&vm_page_queue_mtx))) - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); while (count-- > 0) { pmap_kenter(va, *m); va += PAGE_SIZE; m++; } - if (!locked) - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); tlb_range_demap(kernel_pmap, sva, va); } @@ -1163,18 +1171,15 @@ void pmap_qremove(vm_offset_t sva, int count) { vm_offset_t va; - int locked; PMAP_STATS_INC(pmap_nqremove); va = sva; - if (!(locked = mtx_owned(&vm_page_queue_mtx))) - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); while (count-- > 0) { pmap_kremove(va); va += PAGE_SIZE; } - if (!locked) - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); tlb_range_demap(kernel_pmap, sva, va); } @@ -1322,7 +1327,7 @@ pmap_remove_tte(struct pmap *pm, struct vm_page_t m; u_long data; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); data = atomic_readandclear_long(&tp->tte_data); if ((data & TD_FAKE) == 0) { m = PHYS_TO_VM_PAGE(TD_PA(data)); @@ -1359,7 +1364,7 @@ pmap_remove(pmap_t pm, vm_offset_t start pm->pm_context[curcpu], start, end); if (PMAP_REMOVE_DONE(pm)) return; - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); PMAP_LOCK(pm); if (end - start > PMAP_TSB_THRESH) { tsb_foreach(pm, NULL, start, end, pmap_remove_tte); @@ -1372,7 +1377,7 @@ pmap_remove(pmap_t pm, vm_offset_t start tlb_range_demap(pm, start, end - 1); } PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); } void @@ -1385,7 +1390,7 @@ pmap_remove_all(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); for (tp = TAILQ_FIRST(&m->md.tte_list); tp != NULL; tp = tpn) { tpn = TAILQ_NEXT(tp, tte_link); if ((tp->tte_data & TD_PV) == 0) @@ -1408,7 +1413,7 @@ pmap_remove_all(vm_page_t m) PMAP_UNLOCK(pm); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); } static int @@ -1470,10 +1475,10 @@ pmap_enter(pmap_t pm, vm_offset_t va, vm vm_prot_t prot, boolean_t wired) { - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); PMAP_LOCK(pm); pmap_enter_locked(pm, va, m, prot, wired); - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); PMAP_UNLOCK(pm); } @@ -1493,7 +1498,7 @@ pmap_enter_locked(pmap_t pm, vm_offset_t vm_page_t real; u_long data; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pm, MA_OWNED); KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || VM_OBJECT_LOCKED(m->object), @@ -1636,14 +1641,14 @@ pmap_enter_object(pmap_t pm, vm_offset_t psize = atop(end - start); m = m_start; - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); 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(); + rw_wunlock(&tte_list_global_lock); PMAP_UNLOCK(pm); } @@ -1651,11 +1656,11 @@ void pmap_enter_quick(pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot) { - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); PMAP_LOCK(pm); pmap_enter_locked(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); PMAP_UNLOCK(pm); } @@ -1721,7 +1726,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm if (dst_addr != src_addr) return; - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); if (dst_pmap < src_pmap) { PMAP_LOCK(dst_pmap); PMAP_LOCK(src_pmap); @@ -1739,7 +1744,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm pmap_copy_tte(src_pmap, dst_pmap, tp, va); tlb_range_demap(dst_pmap, src_addr, src_addr + len - 1); } - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); PMAP_UNLOCK(src_pmap); PMAP_UNLOCK(dst_pmap); } @@ -1938,7 +1943,7 @@ pmap_page_exists_quick(pmap_t pm, vm_pag ("pmap_page_exists_quick: page %p is not managed", m)); loops = 0; rv = FALSE; - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { if ((tp->tte_data & TD_PV) == 0) continue; @@ -1949,7 +1954,7 @@ pmap_page_exists_quick(pmap_t pm, vm_pag if (++loops >= 16) break; } - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); return (rv); } @@ -1966,11 +1971,11 @@ pmap_page_wired_mappings(vm_page_t m) count = 0; if ((m->oflags & VPO_UNMANAGED) != 0) return (count); - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) if ((tp->tte_data & (TD_PV | TD_WIRED)) == (TD_PV | TD_WIRED)) count++; - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); return (count); } @@ -1997,13 +2002,13 @@ pmap_page_is_mapped(vm_page_t m) rv = FALSE; if ((m->oflags & VPO_UNMANAGED) != 0) return (rv); - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) if ((tp->tte_data & TD_PV) != 0) { rv = TRUE; break; } - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); return (rv); } @@ -2029,7 +2034,7 @@ pmap_ts_referenced(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); count = 0; - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); if ((tp = TAILQ_FIRST(&m->md.tte_list)) != NULL) { tpf = tp; do { @@ -2043,7 +2048,7 @@ pmap_ts_referenced(vm_page_t m) break; } while ((tp = tpn) != NULL && tp != tpf); } - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); return (count); } @@ -2066,7 +2071,7 @@ pmap_is_modified(vm_page_t m) if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return (rv); - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { if ((tp->tte_data & TD_PV) == 0) continue; @@ -2075,7 +2080,7 @@ pmap_is_modified(vm_page_t m) break; } } - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); return (rv); } @@ -2109,7 +2114,7 @@ pmap_is_referenced(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); rv = FALSE; - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { if ((tp->tte_data & TD_PV) == 0) continue; @@ -2118,7 +2123,7 @@ pmap_is_referenced(vm_page_t m) break; } } - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); return (rv); } @@ -2141,7 +2146,7 @@ pmap_clear_modify(vm_page_t m) */ if ((m->aflags & PGA_WRITEABLE) == 0) return; - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { if ((tp->tte_data & TD_PV) == 0) continue; @@ -2149,7 +2154,7 @@ pmap_clear_modify(vm_page_t m) if ((data & TD_W) != 0) tlb_page_demap(TTE_GET_PMAP(tp), TTE_GET_VA(tp)); } - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); } void @@ -2160,7 +2165,7 @@ pmap_clear_reference(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { if ((tp->tte_data & TD_PV) == 0) continue; @@ -2168,7 +2173,7 @@ pmap_clear_reference(vm_page_t m) if ((data & TD_REF) != 0) tlb_page_demap(TTE_GET_PMAP(tp), TTE_GET_VA(tp)); } - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); } void @@ -2189,7 +2194,7 @@ pmap_remove_write(vm_page_t m) if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return; - vm_page_lock_queues(); + rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { if ((tp->tte_data & TD_PV) == 0) continue; @@ -2200,7 +2205,7 @@ pmap_remove_write(vm_page_t m) } } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&tte_list_global_lock); } int Modified: stable/9/sys/sparc64/sparc64/tsb.c ============================================================================== --- stable/9/sys/sparc64/sparc64/tsb.c Wed Jun 27 05:23:33 2012 (r237626) +++ stable/9/sys/sparc64/sparc64/tsb.c Wed Jun 27 05:38:39 2012 (r237627) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -131,7 +132,7 @@ tsb_tte_enter(pmap_t pm, vm_page_t m, vm PMAP_STATS_INC(tsb_nenter_u_oc); } - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&tte_list_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pm, MA_OWNED); if (pm == kernel_pmap) { PMAP_STATS_INC(tsb_nenter_k); From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 05:50:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44E24106564A; Wed, 27 Jun 2012 05:50:16 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 301C58FC1A; Wed, 27 Jun 2012 05:50:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R5oG3b084851; Wed, 27 Jun 2012 05:50:16 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R5oFnE084849; Wed, 27 Jun 2012 05:50:15 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201206270550.q5R5oFnE084849@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 27 Jun 2012 05:50: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: r237628 - head/usr.bin/sort X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 05:50:16 -0000 Author: gabor Date: Wed Jun 27 05:50:15 2012 New Revision: 237628 URL: http://svn.freebsd.org/changeset/base/237628 Log: - Disable threaded sort by default - Fix typo in the NLS support Modified: head/usr.bin/sort/Makefile Modified: head/usr.bin/sort/Makefile ============================================================================== --- head/usr.bin/sort/Makefile Wed Jun 27 05:38:39 2012 (r237627) +++ head/usr.bin/sort/Makefile Wed Jun 27 05:50:15 2012 (r237628) @@ -21,7 +21,7 @@ sort.1: sort.1.in CLEANFILES+= sort.1 -.if !defined(WITHOUT_THREADS) +.if defined(WITH_THREADS) CFLAGS+= -DSORT_THREADS LDFLAGS+= -lpthread -lmd MAN_SUB+= -e 's|%%THREADS%%||g' @@ -39,7 +39,7 @@ NLSSRCDIR_${lang}= ${.CURDIR}/nls .endfor .else CFLAGS+= -DWITHOUT_NLS -MAN_SUB+= -e 's|%%THREADS%%|\.\\"|g' +MAN_SUB+= -e 's|%%NLS%%|\.\\"|g' .endif .include From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 05:59:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12A991065675; Wed, 27 Jun 2012 05:59:02 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D79F78FC27; Wed, 27 Jun 2012 05:59:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R5x11m085274; Wed, 27 Jun 2012 05:59:01 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R5x1sH085269; Wed, 27 Jun 2012 05:59:01 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201206270559.q5R5x1sH085269@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 27 Jun 2012 05:59: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: r237629 - in head: gnu/usr.bin/sort share/mk tools/build/options usr.bin/sort X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 05:59:02 -0000 Author: gabor Date: Wed Jun 27 05:59:01 2012 New Revision: 237629 URL: http://svn.freebsd.org/changeset/base/237629 Log: - Switch to BSD sort as default sort. GNU sort will still be installed as "gnusort". Most of the BSD sort development work was done by Oleg Moskalenko . - GNU grep can be set to default by setting WITH_GNU_GREP. It will cause BSD sort to be installed as "bsdsort". Portbuild tested by: linimon Added: head/tools/build/options/WITH_GNU_SORT (contents, props changed) Deleted: head/tools/build/options/WITH_BSD_SORT Modified: head/gnu/usr.bin/sort/Makefile head/share/mk/bsd.own.mk head/usr.bin/sort/Makefile Modified: head/gnu/usr.bin/sort/Makefile ============================================================================== --- head/gnu/usr.bin/sort/Makefile Wed Jun 27 05:50:15 2012 (r237628) +++ head/gnu/usr.bin/sort/Makefile Wed Jun 27 05:59:01 2012 (r237629) @@ -5,7 +5,7 @@ SORTDIR= ${.CURDIR}/../../../contrib/gnu .include -.if ${MK_BSD_SORT} != "yes" +.if ${MK_GNU_SORT} == "yes" PROG= sort .else PROG= gnusort Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Jun 27 05:50:15 2012 (r237628) +++ head/share/mk/bsd.own.mk Wed Jun 27 05:59:01 2012 (r237629) @@ -415,7 +415,6 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ - BSD_SORT \ BIND_IDN \ BIND_LARGE_FILE \ BIND_LIBS \ @@ -424,6 +423,7 @@ __DEFAULT_NO_OPTIONS = \ CLANG_EXTRAS \ CLANG_IS_CC \ CTF \ + GNU_SORT \ HESIOD \ ICONV \ IDEA \ Added: head/tools/build/options/WITH_GNU_SORT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GNU_SORT Wed Jun 27 05:59:01 2012 (r237629) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Install GNU-licensed sort as 'sort' instead of BSD sort. Modified: head/usr.bin/sort/Makefile ============================================================================== --- head/usr.bin/sort/Makefile Wed Jun 27 05:50:15 2012 (r237628) +++ head/usr.bin/sort/Makefile Wed Jun 27 05:59:01 2012 (r237629) @@ -2,7 +2,7 @@ .include -.if ${MK_BSD_SORT} == "yes" +.if ${MK_GNU_SORT} != "yes" PROG= sort .else PROG= bsdsort From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 06:00:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55045106568B; Wed, 27 Jun 2012 06:00:59 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE888FC1F; Wed, 27 Jun 2012 06:00:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R60xqJ085410; Wed, 27 Jun 2012 06:00:59 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R60xnw085408; Wed, 27 Jun 2012 06:00:59 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201206270600.q5R60xnw085408@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 27 Jun 2012 06:00: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: r237630 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 06:00:59 -0000 Author: gabor Date: Wed Jun 27 06:00:58 2012 New Revision: 237630 URL: http://svn.freebsd.org/changeset/base/237630 Log: - Regen after BSD sort change Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jun 27 05:59:01 2012 (r237629) +++ head/share/man/man5/src.conf.5 Wed Jun 27 06:00:58 2012 (r237630) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd May 29, 2012 +.Dd June 27, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -227,9 +227,6 @@ Set to not build the BSD licensed versio .It Va WITH_BSD_GREP .\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien Install BSD-licensed grep as '[ef]grep' instead of GNU grep. -.It Va WITH_BSD_SORT -.\" from FreeBSD: head/tools/build/options/WITH_BSD_SORT 235268 2012-05-11 12:47:21Z gabor -Install BSD-licensed sort as 'sort' instead of GNU sort. .It Va WITHOUT_BSNMP .\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam Set to not build or install @@ -440,6 +437,9 @@ When set, it also enforces the following .It .Va WITHOUT_GNU_SUPPORT .El +.It Va WITH_GNU_SORT +.\" from FreeBSD: head/tools/build/options/WITH_GNU_SORT 237629 2012-06-27 05:59:01Z gabor +Install GNU-licensed sort as 'sort' instead of BSD sort. .It Va WITHOUT_GNU_SUPPORT .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without optional GNU support. From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 06:08:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CCBE1065674; Wed, 27 Jun 2012 06:08:03 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67DF38FC16; Wed, 27 Jun 2012 06:08:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R683WZ085744; Wed, 27 Jun 2012 06:08:03 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R683EX085742; Wed, 27 Jun 2012 06:08:03 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201206270608.q5R683EX085742@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 27 Jun 2012 06:08: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: r237631 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 06:08:03 -0000 Author: gabor Date: Wed Jun 27 06:08:02 2012 New Revision: 237631 URL: http://svn.freebsd.org/changeset/base/237631 Log: - Bump __FreeBSD_version: default sort is BSD sort Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Jun 27 06:00:58 2012 (r237630) +++ head/sys/sys/param.h Wed Jun 27 06:08:02 2012 (r237631) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000013 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000014 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 06:41:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63E61106566C; Wed, 27 Jun 2012 06:41:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9AA8FC08; Wed, 27 Jun 2012 06:41:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R6f073087560; Wed, 27 Jun 2012 06:41:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R6f0Vb087557; Wed, 27 Jun 2012 06:41:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206270641.q5R6f0Vb087557@svn.freebsd.org> From: Eitan Adler Date: Wed, 27 Jun 2012 06:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237632 - stable/9/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 06:41:00 -0000 Author: eadler Date: Wed Jun 27 06:40:59 2012 New Revision: 237632 URL: http://svn.freebsd.org/changeset/base/237632 Log: MFC r237286, r237523: Don't close an uninitialized descriptor. PR: bin/167302 Approved by: cperciva (implicit) Modified: stable/9/lib/libc/gen/syslog.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/syslog.c ============================================================================== --- stable/9/lib/libc/gen/syslog.c Wed Jun 27 06:08:02 2012 (r237631) +++ stable/9/lib/libc/gen/syslog.c Wed Jun 27 06:40:59 2012 (r237632) @@ -413,8 +413,10 @@ void closelog(void) { THREAD_LOCK(); - (void)_close(LogFile); - LogFile = -1; + if (LogFile != -1) { + (void)_close(LogFile); + LogFile = -1; + } LogTag = NULL; status = NOCONN; THREAD_UNLOCK(); From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 06:41:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F58410657E6; Wed, 27 Jun 2012 06:41:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 699D78FC14; Wed, 27 Jun 2012 06:41:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R6fBGl087639; Wed, 27 Jun 2012 06:41:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R6fBpq087637; Wed, 27 Jun 2012 06:41:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206270641.q5R6fBpq087637@svn.freebsd.org> From: Eitan Adler Date: Wed, 27 Jun 2012 06:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237633 - stable/7/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 06:41:11 -0000 Author: eadler Date: Wed Jun 27 06:41:10 2012 New Revision: 237633 URL: http://svn.freebsd.org/changeset/base/237633 Log: MFC r237286, r237523: Don't close an uninitialized descriptor. PR: bin/167302 Approved by: cperciva (implicit) Modified: stable/7/lib/libc/gen/syslog.c Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/gen/syslog.c ============================================================================== --- stable/7/lib/libc/gen/syslog.c Wed Jun 27 06:40:59 2012 (r237632) +++ stable/7/lib/libc/gen/syslog.c Wed Jun 27 06:41:10 2012 (r237633) @@ -413,8 +413,10 @@ void closelog(void) { THREAD_LOCK(); - (void)_close(LogFile); - LogFile = -1; + if (LogFile != -1) { + (void)_close(LogFile); + LogFile = -1; + } LogTag = NULL; status = NOCONN; THREAD_UNLOCK(); From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 06:41:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 360D510657E5; Wed, 27 Jun 2012 06:41:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20CFD8FC16; Wed, 27 Jun 2012 06:41:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R6fEZ6087684; Wed, 27 Jun 2012 06:41:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R6fEAh087682; Wed, 27 Jun 2012 06:41:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206270641.q5R6fEAh087682@svn.freebsd.org> From: Eitan Adler Date: Wed, 27 Jun 2012 06:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237634 - stable/8/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 06:41:15 -0000 Author: eadler Date: Wed Jun 27 06:41:14 2012 New Revision: 237634 URL: http://svn.freebsd.org/changeset/base/237634 Log: MFC r237286, r237523: Don't close an uninitialized descriptor. PR: bin/167302 Approved by: cperciva (implicit) Modified: stable/8/lib/libc/gen/syslog.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/syslog.c ============================================================================== --- stable/8/lib/libc/gen/syslog.c Wed Jun 27 06:41:10 2012 (r237633) +++ stable/8/lib/libc/gen/syslog.c Wed Jun 27 06:41:14 2012 (r237634) @@ -413,8 +413,10 @@ void closelog(void) { THREAD_LOCK(); - (void)_close(LogFile); - LogFile = -1; + if (LogFile != -1) { + (void)_close(LogFile); + LogFile = -1; + } LogTag = NULL; status = NOCONN; THREAD_UNLOCK(); From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 06:43:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D04D1065670 for ; Wed, 27 Jun 2012 06:43:26 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C9D0E8FC15 for ; Wed, 27 Jun 2012 06:43:25 +0000 (UTC) Received: by obbun3 with SMTP id un3so1318466obb.13 for ; Tue, 26 Jun 2012 23:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=bqfAN8BoMlLUpbxDfuW+RzwSNdywBROTmAPRcJRdXfk=; b=GpphY9tYnUjkHcJr+X8DIJ4npcOzsdDMaH7pG1DTHtBjPkjt/qE5iX5+OPXVPTqLOb Y7yBy9/v+85mNBrs6xtZJAgBVE0mkKW29C32FvR8sG14VLAgqbJ7AE8YVhE/2t4urYay gsxGik942vScNk/GqikNVVaaBJikGrqDAVn5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding:x-gm-message-state; bh=bqfAN8BoMlLUpbxDfuW+RzwSNdywBROTmAPRcJRdXfk=; b=cGGq7fe4MJo2Xc1O9pcFNIvC6S0ruTDs/dpbWuWh+4dHUEGcUZLlKagv7HEkrn1w9U 7dhAstHCdqfH7mzt/QfFv7MVlkEU9OQ+J8Awe7ExFddyuCqSQWuLRmOJiE90mcX52UY9 qA7BI3u3ltinh85EHKG7QUvCX8HA3vDp+gbSPwih4Y5oTp2L1pJCCvqi25bCp8gYSI2J 04mSUWbbzHzpa+Ox8NLuuUIBvVWfysZTbSxXEg7eFqrFTbCngIMhrju/DZQu7tMD7kxj vdw6tIVnsZM1irhF8Lf4kEL5YzL5XWqzS8WUzqw7QE5GINoMSrZk2n+hfnTUsDRSaJdA 72PA== Received: by 10.60.168.230 with SMTP id zz6mr12996474oeb.11.1340779405104; Tue, 26 Jun 2012 23:43:25 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.182.125.70 with HTTP; Tue, 26 Jun 2012 23:42:54 -0700 (PDT) In-Reply-To: <201206270641.q5R6f0Vb087557@svn.freebsd.org> References: <201206270641.q5R6f0Vb087557@svn.freebsd.org> From: Eitan Adler Date: Tue, 26 Jun 2012 23:42:54 -0700 X-Google-Sender-Auth: ChXdSav3XO-UpoGI2NGal-B6q1o Message-ID: To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQkzrmJobZITNjG5oZ0VjTK2zPWtxevSo+FiQEbwkCOwKLF6QRR/Wobyfig5b1g5qR/cUXqr Cc: Subject: Re: svn commit: r237632 - stable/9/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 06:43:26 -0000 On 26 June 2012 23:41, Eitan Adler wrote: > Author: eadler > Date: Wed Jun 27 06:40:59 2012 > New Revision: 237632 > URL: http://svn.freebsd.org/changeset/base/237632 > > Log: > =C2=A0MFC r237286, r237523: > =C2=A0 =C2=A0 =C2=A0 =C2=A0Don't close an uninitialized descriptor. > > =C2=A0PR: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bin/167302 > =C2=A0Approved by: =C2=A0cperciva (implicit) These were supposed to be PR 139080 - I'll fix the PRs --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 06:49:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F73F10657B0 for ; Wed, 27 Jun 2012 06:49:17 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id BA6848FC1A for ; Wed, 27 Jun 2012 06:49:16 +0000 (UTC) Received: by obbun3 with SMTP id un3so1327506obb.13 for ; Tue, 26 Jun 2012 23:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Lce6Z3of1cGFWMyBLO0RpgeRFv1u87j2jt0rauX4r5s=; b=g0qjzHEZWcohYfVy8VZGH1p7r5nJJfrx14zHiar/DfhmbwBn2hn0bv3cuJKUmyubUQ glw7UWEzh1wqtuMUXAz28LzBlU7dRwBxL9r+Is92BXVRTnMrYRcbaC5vlnaMdOgEVID5 7a7K+V06DgBWKnmdW4LCy3/6BhvwExLYlS5yA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=Lce6Z3of1cGFWMyBLO0RpgeRFv1u87j2jt0rauX4r5s=; b=JSF8euh0xhB9+qt42QNXiUElHO+yGk3uMHvM/BZB5S5j+cYnInnxanBDDk+1GpjQlY 0qlC1Wqaucaypw39RnD03lJKPyCNWFaRpEse7TcPBj1NPX0fDYX6M9WH1HTOlRcD5zeR j0ajiMsX+hFHzVXBFr6/pOBW2HWqv33WjpHvn2kK1Jjaw+5awNgMP195Idc+RXVLMfaO 4xvJOd2vVDFcyd5BheSbmym9w0t9kwrkEW1qUAu1tzA21fL3bJdbxyfRuc1TbKt7w9g9 cOXJ4rZcQHwOBpnSbnbAiHW2Aq+T2GBFp7e1OXtyeEeuwMARDiAnMiBw9vGTelsra60k rkGw== Received: by 10.60.14.68 with SMTP id n4mr19106345oec.24.1340779756360; Tue, 26 Jun 2012 23:49:16 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.182.125.70 with HTTP; Tue, 26 Jun 2012 23:48:46 -0700 (PDT) In-Reply-To: <201206270550.q5R5oFnE084849@svn.freebsd.org> References: <201206270550.q5R5oFnE084849@svn.freebsd.org> From: Eitan Adler Date: Tue, 26 Jun 2012 23:48:46 -0700 X-Google-Sender-Auth: UuHzNpcJg39S6z6aYSfVbUe32OE Message-ID: To: Gabor Kovesdan Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQm64wkNkH3ODiTF2BMj+afw2H5au2D0FAtqdOc9HWhrQY/j1+amtDzFu/UgfEdKUn5zrLlE Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237628 - head/usr.bin/sort X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 06:49:17 -0000 On 26 June 2012 22:50, Gabor Kovesdan wrote: > Author: gabor > Date: Wed Jun 27 05:50:15 2012 > New Revision: 237628 > URL: http://svn.freebsd.org/changeset/base/237628 > > Log: > =C2=A0- Disable threaded sort by default Curious, why? > =C2=A0- Fix typo in the NLS support --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 07:41:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC9621065670; Wed, 27 Jun 2012 07:41:21 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 950958FC0C; Wed, 27 Jun 2012 07:41:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5R7fLeF090352; Wed, 27 Jun 2012 07:41:21 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R7fL9R090350; Wed, 27 Jun 2012 07:41:21 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206270741.q5R7fL9R090350@svn.freebsd.org> From: Joel Dahl Date: Wed, 27 Jun 2012 07:41: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: r237635 - head/contrib/traceroute X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 07:41:21 -0000 Author: joel (doc committer) Date: Wed Jun 27 07:41:21 2012 New Revision: 237635 URL: http://svn.freebsd.org/changeset/base/237635 Log: mdocify and update the traceroute(8) manual page. Reviewed by: brueffer No objection: ru, uqs Modified: head/contrib/traceroute/traceroute.8 Modified: head/contrib/traceroute/traceroute.8 ============================================================================== --- head/contrib/traceroute/traceroute.8 Wed Jun 27 06:41:14 2012 (r237634) +++ head/contrib/traceroute/traceroute.8 Wed Jun 27 07:41:21 2012 (r237635) @@ -16,113 +16,64 @@ .\" $Id: traceroute.8,v 1.19 2000/09/21 08:44:19 leres Exp $ .\" $FreeBSD$ .\" -.TH TRACEROUTE 8 "19 February 2008" -.UC 6 -.SH NAME -traceroute \- print the route packets take to network host -.SH SYNOPSIS -.na -.B traceroute -[ -.B \-adDeFISnrvx -] [ -.B \-f -.I first_ttl -] [ -.B \-g -.I gateway -] -.br -.ti +8 -[ -.B \-i -.I iface -] [ -.B \-M -.I first_ttl -] -.br -.ti +8 -[ -.B \-m -.I max_ttl -] [ -.B \-P -.I proto -] [ -.B \-p -.I port -] -.br -.ti +8 -[ -.B \-q -.I nqueries -] [ -.B \-s -.I src_addr -] [ -.B \-t -.I tos -] -.br -.ti +8 -[ -.B \-w -.I waittime -] [ -.B \-A -.I as_server -] [ -.B \-z -.I pausemsecs -] -.br -.ti +8 -.I host -[ -.I packetlen -] -.ad -.SH DESCRIPTION +.Dd June 19, 2012 +.Dt TRACEROUTE 8 +.Os +.Sh NAME +.Nm traceroute +.Nd "print the route packets take to network host" +.Sh SYNOPSIS +.Nm +.Bk -words +.Op Fl adDeFISnrvx +.Op Fl f Ar first_ttl +.Op Fl g Ar gateway +.Op Fl M Ar first_ttl +.Op Fl m Ar max_ttl +.Op Fl P Ar proto +.Op Fl p Ar port +.Op Fl q Ar nqueries +.Op Fl s Ar src_addr +.Op Fl t Ar tos +.Op Fl w Ar waittime +.Op Fl A Ar as_server +.Op Fl z Ar pausemsecs +.Ar host +.Op Ar packetlen +.Ek +.Sh DESCRIPTION The Internet is a large and complex aggregation of network hardware, connected together by gateways. Tracking the route one's packets follow (or finding the miscreant gateway that's discarding your packets) can be difficult. -.I Traceroute +.Nm utilizes the IP protocol `time to live' field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to some host. -.PP +.Pp The only mandatory parameter is the destination host name or IP number. The default probe datagram length is 40 bytes, but this may be increased by specifying a packet length (in bytes) after the destination host name. -.PP +.Pp Other options are: -.TP -.B \-a +.Bl -tag -width Ds +.It Fl a Turn on AS# lookups for each hop encountered. -.TP -.B -A +.It Fl A Ar as_server Turn on AS# lookups and use the given server instead of the default. -.TP -.B \-e +.It Fl e Firewall evasion mode. Use fixed destination ports for UDP and TCP probes. The destination port does NOT increment with each packet sent. -.TP -.B \-f +.It Fl f Ar first_ttl Set the initial time-to-live used in the first outgoing probe packet. -.TP -.B \-F +.It Fl F Set the "don't fragment" bit. -.TP -.B \-d +.It Fl d Enable socket level debugging. -.TP -.B \-D +.It Fl D When an ICMP response to our probe datagram is received, print the differences between the transmitted packet and the packet quoted by the ICMP response. @@ -133,74 +84,66 @@ Bytes that are unchanged in the quoted p Note, the IP checksum and the TTL of the quoted packet are not expected to match. By default, only one probe per hop is sent with this option. -.TP -.B \-g +.It Fl g Ar gateway Specify a loose source route gateway (8 maximum). -.TP -.B \-i +.It Fl i Ar iface Specify a network interface to obtain the source IP address for outgoing probe packets. This is normally only useful on a multi-homed host. (See the -.B \-s +.Fl s flag for another way to do this.) -.TP -.B \-I +.It Fl I Use ICMP ECHO instead of UDP datagrams. (A synonym for "-P icmp"). -.TP -.B \-M +.It Fl M Ar first_ttl Set the initial time-to-live value used in outgoing probe packets. The default is 1, i.e., start with the first hop. -.TP -.B \-m +.It Fl m Ar max_ttl Set the max time-to-live (max number of hops) used in outgoing probe -packets. The default is -.I net.inet.ip.ttl -hops (the same default used for TCP +packets. The default is the value of the +.Va net.inet.ip.ttl +.Xr sysctl 8 +(the same default used for TCP connections). -.TP -.B \-n +.It Fl n Print hop addresses numerically rather than symbolically and numerically (saves a nameserver address-to-name lookup for each gateway found on the path). -.TP -.B \-P +.It Fl P Ar proto Send packets of specified IP protocol. The currently supported protocols are: UDP, TCP, GRE and ICMP. Other protocols may also be specified (either by name or by number), though -.I traceroute +.Nm does not implement any special knowledge of their packet formats. This option is useful for determining which router along a path may be blocking packets based on IP protocol number. But see BUGS below. -.TP -.B \-p +.It Fl p Ar port Protocol specific. For UDP and TCP, sets -the base port number used in probes (default is 33434). +the base +.Ar port +number used in probes (default is 33434). Traceroute hopes that nothing is listening on UDP ports -.I base +.Em base to -.I base + nhops * nprobes - 1 +.Em base + nhops * nprobes - 1 at the destination host (so an ICMP PORT_UNREACHABLE message will be returned to terminate the route tracing). If something is listening on a port in the default range, this option can be used to pick an unused port range. -.TP -.B \-q +.It Fl q Ar nqueries Set the number of probes per hop (default is 3, unless -.B -D +.Fl D is specified, when it is 1). -.TP -.B \-r +.It Fl r Bypass the normal routing tables and send directly to a host on an attached network. If the host is not on a directly-attached network, an error is returned. This option can be used to ping a local host through an interface that has no route through it (e.g., after the interface was dropped by -.IR routed (8C)). -.TP -.B \-s +.Xr routed 8 . +.It Fl s Ar src_addr Use the following IP address (which usually is given as an IP number, not a hostname) as the source address in outgoing probe packets. On multi-homed hosts (those with more than one IP @@ -209,15 +152,13 @@ force the source address to be something of the interface the probe packet is sent on. If the IP address is not one of this machine's interface addresses, an error is returned and nothing is sent. (See the -.B \-i +.Fl i flag for another way to do this.) -.TP -.B \-S +.It Fl S Print a summary of how many probes were not answered for each hop. -.TP -.B \-t +.It Fl t Ar tos Set the -.I type-of-service +.Em type-of-service in probe packets to the following value (default zero). The value must be a decimal integer in the range 0 to 255. This option can be used to see if different types-of-service result in different paths. (If you @@ -226,72 +167,69 @@ services like telnet and ftp don't let y Not all values of TOS are legal or meaningful \- see the IP spec for definitions. Useful values are probably -.RB ` -t -.IR 16 ' +.Fl t Ar 16 (low delay) and -.RB ` -t -.IR 8 ' +.Fl t Ar 8 (high throughput). -.TP -.B \-v -Verbose output. Received ICMP packets other than TIME_EXCEEDED and -UNREACHABLEs are listed. -.TP -.B \-w +.It Fl v +Verbose output. Received ICMP packets other than +.Dv TIME_EXCEEDED +and +.Dv UNREACHABLE Ns s +are listed. +.It Fl w Ar waittime Set the time (in seconds) to wait for a response to a probe (default 5 sec.). -.TP -.B \-x +.It Fl x Toggle ip checksums. Normally, this prevents traceroute from calculating ip checksums. In some cases, the operating system can overwrite parts of the outgoing packet but not recalculate the checksum (so in some cases the default is to not calculate checksums and using -.B \-x +.Fl x causes them to be calculated). Note that checksums are usually required for the last hop when using ICMP ECHO probes -.RB ( \-I ). +.Pq Fl I . So they are always calculated when using ICMP. -.TP -.B \-z +.It Fl z Ar pausemsecs Set the time (in milliseconds) to pause between probes (default 0). Some systems such as Solaris and routers such as Ciscos rate limit icmp messages. A good value to use with this this is 500 (e.g. 1/2 second). -.PP +.El +.Pp This program attempts to trace the route an IP packet would follow to some internet host by launching UDP probe packets with a small ttl (time to live) then listening for an ICMP "time exceeded" reply from a gateway. We start our probes with a ttl of one and increase by one until we get an ICMP "port unreachable" (which means we got to "host") or hit a max (which -defaults to -.I net.inet.ip.ttl -hops & can be changed with the -.B \-m +defaults to the amount of hops specified by the +.Va net.inet.ip.ttl +.Xr sysctl 8 +and can be changed with the +.Fl m flag). Three probes (change with -.B \-q +.Fl q flag) are sent at each ttl setting and a line is printed showing the ttl, address of the gateway and round trip time of each probe. If the probe answers come from different gateways, the address of each responding system will be printed. If there is no response within a 5 sec. timeout interval (changed with the -.B \-w +.Fl w flag), a "*" is printed for that probe. -.PP +.Pp We don't want the destination host to process the UDP probe packets so the destination port is set to an unlikely value (if some clod on the destination is using that value, it can be changed with the -.B \-p +.Fl p flag). -.PP +.Pp A sample use and output might be: - -.RS -.nf -[yak 71]% traceroute nis.nsf.net. +.Bd -literal -offset 4n +% traceroute nis.nsf.net. traceroute to nis.nsf.net (35.1.1.48), 64 hops max, 38 byte packet 1 helios.ee.lbl.gov (128.3.112.1) 19 ms 19 ms 0 ms 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms @@ -304,21 +242,18 @@ traceroute to nis.nsf.net (35.1.1.48), 6 9 129.140.71.6 (129.140.71.6) 139 ms 239 ms 319 ms 10 129.140.81.7 (129.140.81.7) 220 ms 199 ms 199 ms 11 nic.merit.edu (35.1.1.48) 239 ms 239 ms 239 ms -.fi -.RE - +.Ed +.Pp Note that lines 2 & 3 are the same. This is due to a buggy kernel on the 2nd hop system \- lilac-dmc.Berkeley.EDU \- that forwards packets with a zero ttl (a bug in the distributed version of 4.3BSD). Note that you have to guess what path the packets are taking cross-country since the NSFNet (129.140) doesn't supply address-to-name translations for its NSSes. -.PP +.Pp A more interesting example is: - -.RS -.nf -[yak 72]% traceroute allspice.lcs.mit.edu. +.Bd -literal -offset 4n +% traceroute allspice.lcs.mit.edu. traceroute to allspice.lcs.mit.edu (18.26.0.115), 64 hops max 1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 19 ms 19 ms @@ -338,15 +273,14 @@ traceroute to allspice.lcs.mit.edu (18.2 16 * * * 17 * * * 18 ALLSPICE.LCS.MIT.EDU (18.26.0.115) 339 ms 279 ms 279 ms -.fi -.RE - +.Ed +.Pp Note that the gateways 12, 14, 15, 16 & 17 hops away either don't send ICMP "time exceeded" messages or send them with a ttl too small to reach us. 14 \- 17 are running the MIT C Gateway code that doesn't send "time exceeded"s. God only knows what's going on with 12. -.PP +.Pp The silent gateway 12 in the above may be the result of a bug in the 4.[23]BSD network code (and its derivatives): 4.x (x <= 3) sends an unreachable message using whatever ttl remains in the @@ -354,9 +288,7 @@ original datagram. Since, for gateways, zero, the ICMP "time exceeded" is guaranteed to not make it back to us. The behavior of this bug is slightly more interesting when it appears on the destination system: - -.RS -.nf +.Bd -literal -offset 4n 1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 19 ms 39 ms 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 39 ms 19 ms @@ -370,9 +302,8 @@ when it appears on the destination syste 11 * * * 12 * * * 13 rip.Berkeley.EDU (128.32.131.22) 59 ms ! 39 ms ! 39 ms ! -.fi -.RE - +.Ed +.Pp Notice that there are 12 "gateways" (13 is the final destination) and exactly the last half of them are "missing". What's really happening is that rip (a Sun-3 running Sun OS3.5) @@ -383,77 +314,82 @@ ICMP's) until we probe with a ttl that's length. I.e., rip is really only 7 hops away. A reply that returns with a ttl of 1 is a clue this problem exists. Traceroute prints a "!" after the time if the ttl is <= 1. -Since vendors ship a lot of obsolete (DEC's Ultrix, Sun 3.x) or -non-standard (HPUX) software, expect to see this problem +Since vendors ship a lot of obsolete +.Pf ( Tn DEC Ns \'s +Ultrix, Sun 3.x) or +non-standard +.Pq Tn HP-UX +software, expect to see this problem frequently and/or take care picking the target host of your probes. - -Other possible annotations after the time are -.BR !H , -.BR !N , -or -.B !P -(host, network or protocol unreachable), -.B !S -(source route failed), -.B !F\- -(fragmentation needed \- the RFC1191 Path MTU Discovery value is displayed), -.B !U -or -.B !W -(destination network/host unknown), -.B !I -(source host is isolated), -.B !A -(communication with destination network administratively prohibited), -.B !Z -(communication with destination host administratively prohibited), -.B !Q -(for this ToS the destination network is unreachable), -.B !T -(for this ToS the destination host is unreachable), -.B !X -(communication administratively prohibited), -.B !V -(host precedence violation), -.B !C -(precedence cutoff in effect), or -.B ! -(ICMP unreachable code ). +.Pp +Other possible annotations after the time are: +.Bl -hang -offset indent -width 12n +.It Sy !H +Host unreachable. +.It Sy !N +Network unreachable. +.It Sy !P +Protocol unreachable. +.It Sy !S +Source route failed. +.It Sy !F\- +Fragmentation needed. +The RFC1191 Path MTU Discovery value is displayed. +.It Sy !U +Destination network unknown. +.It Sy !W +Destination host unknown. +.It Sy !I +Source host is isolated. +.It Sy !A +Communication with destination network administratively prohibited. +.It Sy !Z +Communication with destination host administratively prohibited. +.It Sy !Q +For this ToS the destination network is unreachable. +.It Sy !T +For this ToS the destination host is unreachable. +.It Sy !X +Communication administratively prohibited. +.It Sy !V +Host precedence violation. +.It Sy !C +Precedence cutoff in effect. +.It Sy ! +ICMP unreachable code . +.El +.Pp These are defined by RFC1812 (which supersedes RFC1716). -If almost all the probes result in some kind of unreachable, traceroute +If almost all the probes result in some kind of unreachable, +.Nm will give up and exit. -.PP +.Pp This program is intended for use in network testing, measurement and management. It should be used primarily for manual fault isolation. Because of the load it could impose on the network, it is unwise to use -.I traceroute +.Nm during normal operations or from automated scripts. -.SH SEE ALSO -pathchar(8), netstat(1), ping(8) -.SH AUTHOR +.Sh SEE ALSO +.Xr netstat 1 , +.Xr ping 8 , +.Xr ping6 8 , +.Xr traceroute6 8 . +.Sh AUTHORS Implemented by Van Jacobson from a suggestion by Steve Deering. Debugged by a cast of thousands with particularly cogent suggestions or fixes from C. Philip Wood, Tim Seaver and Ken Adelman. -.LP -The current version is available via anonymous ftp: -.LP -.RS -.I ftp://ftp.ee.lbl.gov/traceroute.tar.gz -.RE -.SH BUGS +.Sh BUGS When using protocols other than UDP, functionality is reduced. In particular, the last packet will often appear to be lost, because even though it reaches the destination host, there's no way to know that because no ICMP message is sent back. In the TCP case, -.I traceroute +.Nm should listen for a RST from the destination host (or an intermediate router that's filtering packets), but this is not implemented yet. -.PP -Please send bug reports to traceroute@ee.lbl.gov. -.PP +.Pp The AS number capability reports information that may sometimes be inaccurate due to discrepancies between the contents of the routing database server and the current state of the Internet. From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 10:07:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C528106566B; Wed, 27 Jun 2012 10:07:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55CED8FC18; Wed, 27 Jun 2012 10:07:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RA7URD096455; Wed, 27 Jun 2012 10:07:30 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RA7UW2096452; Wed, 27 Jun 2012 10:07:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206271007.q5RA7UW2096452@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 27 Jun 2012 10:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237636 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 10:07:30 -0000 Author: trasz Date: Wed Jun 27 10:07:29 2012 New Revision: 237636 URL: http://svn.freebsd.org/changeset/base/237636 Log: Add manual page for bxe(4). Reviewed by: davidch (earlier version) MFC after: 1 week Added: head/share/man/man4/bxe.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Jun 27 07:41:21 2012 (r237635) +++ head/share/man/man4/Makefile Wed Jun 27 10:07:29 2012 (r237636) @@ -36,6 +36,7 @@ MAN= aac.4 \ ${_amdsbwd.4} \ ${_amdsmb.4} \ ${_amdtemp.4} \ + ${_bxe.4} \ amr.4 \ an.4 \ ${_apic.4} \ @@ -562,6 +563,7 @@ MLINKS+=bktr.4 brooktree.4 MLINKS+=bridge.4 if_bridge.4 MLINKS+=bwi.4 if_bwi.4 MLINKS+=bwn.4 if_bwn.4 +MLINKS+=${_bxe.4} ${_if_bxe.4} MLINKS+=cas.4 if_cas.4 MLINKS+=cdce.4 if_cdce.4 MLINKS+=crypto.4 cryptodev.4 @@ -714,6 +716,7 @@ _amdsmb.4= amdsmb.4 _amdtemp.4= amdtemp.4 _asmc.4= asmc.4 _atp.4= atp.4 +_bxe.4= bxe.4 _coretemp.4= coretemp.4 _cpuctl.4= cpuctl.4 _dpms.4= dpms.4 @@ -723,6 +726,7 @@ _hptmv.4= hptmv.4 _hptrr.4= hptrr.4 _i8254.4= i8254.4 _ichwd.4= ichwd.4 +_if_bxe.4= if_bxe.4 _if_ndis.4= if_ndis.4 _if_nfe.4= if_nfe.4 _if_nve.4= if_nve.4 Added: head/share/man/man4/bxe.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/bxe.4 Wed Jun 27 10:07:29 2012 (r237636) @@ -0,0 +1,138 @@ +.\" Copyright (c) 2012 Edward Tomasz Napierala +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 25, 2012 +.Dt BXE 4 +.Os +.Sh NAME +.Nm bxe +.Nd "Broadcom BCM57710/BCM57711/BCM57711E 10Gb Ethernet adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device bxe" +.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 +if_bxe_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for PCIe 10GbE Ethernet adapters based on +BCM5771x chips. +The driver supports Jumbo Frames, VLAN tagging, IP, UDP and TCP checksum +offload, MSI-X, TCP Segmentation Offload (TSO), Large Receive Offload (LRO), +and Receive Side Steering (RSS). +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver provides support for various NICs based on the Broadcom BCM5771x +family of 10GbE Ethernet controller chips, including the +following: +.Pp +.Bl -bullet -compact +.It +Broadcom NetXtreme II BCM57710 10GbE +.It +Broadcom NetXtreme II BCM57711 10GbE +.It +Broadcom NetXtreme II BCM57711E 10GbE +.El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va hw.bxe.dcc_enable +Enable HP Flex-10 support. +Allowed values are 0 to disable and 1 to enable. +The default value is 0. +.It Va hw.bxe.tso_enable +Enable TCP Segmentation Offload. +The default value is 1. +.It Va hw.bxe.int_mode +Set interrupt mode. +Allowed values are 0 for IRQ, 1 for MSI/IRQ and 2 for MSI-X/MSI/IRQ. +The default value is 2. +.It Va hw.bxe.queue_count +Specify the number of queues that will be used when a multi-queue +RSS mode is selected using bxe_multi_mode. +Allowed values are 0 for Auto or 1 to 16 for fixed number of queues. +The default value is 0. +.It Va hw.bxe.multi_mode +Enable Receive Side Steering. +Allowed values are 0, which disables all multi-queue/packet sorting +algorithms, and 1, which assigns incoming frames to receive queues +according to RSS. +The default value is 0. +.It Va hw.bxe.rx_ticks +Control interrupt coalescing for received frames. +The first frame always causes an interrupt, but subsequent frames +are coalesced until the RX/TX ticks timer value expires and another +interrupt occurs. +The default value is 25. +.It Va hw.bxe.tx_ticks +Control interrupt coalescing for trasmitted frames. +The first frame always causes an interrupt, but subsequent frames +are coalesced until the RX/TX ticks timer value expires and another +interrupt occurs. +The default value is 50. +.It Va hw.bxe.mrrs +Allows to set the PCIe maximum read request size. +Allowed values are -1 for Auto, 0 for 128B, 1 for 256B, 2 for 512B, +and 3 for 1kB. +The default value is -1. +.El +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.0 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Gary Zambrano Aq zambrano@broadcom.com +and +.An David Christensen Aq davidch@broadcom.com . From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 10:56:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0AEA106566B for ; Wed, 27 Jun 2012 10:56:03 +0000 (UTC) (envelope-from f0andrey@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 95D418FC15 for ; Wed, 27 Jun 2012 10:56:03 +0000 (UTC) Received: by obbun3 with SMTP id un3so1697505obb.13 for ; Wed, 27 Jun 2012 03:56:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=adRhGOWkXcm3Po+OUhblii2wswJiM97MvdnUQUPkR3g=; b=dKCj1hT+OGh1wQuz2bFkSN/ER0wQwtjzUSx6TQk+4VCNtzSsid/Iy9ESaD6AzaVRpw YD0JJAEjR+vC8OaA5DHkqojbVKcKtkytSGSTwZoelBHpXvohMug+T0708lf80g1FbvWR l6UmGsfGWZHFadffuO6SfLyGo2Y9zUx5Hf4pXNdOKpUQMQOSzuzHezxsHG5dMiqINVeg WQmRblkUaR2dMUVHQPXTjkATzD5yKUQ7aWfLMsmVdytcHo2TgirrMkQ4Eolgf7RAOOM/ hm2SqfpliE0OIJBPj4q1eSce02t34kOPdU0ZHJGE9XBuGRM2vI5v/08+CIG3uTlRBP0X akCg== MIME-Version: 1.0 Received: by 10.182.47.66 with SMTP id b2mr19785713obn.2.1340794562242; Wed, 27 Jun 2012 03:56:02 -0700 (PDT) Received: by 10.60.14.42 with HTTP; Wed, 27 Jun 2012 03:56:02 -0700 (PDT) Date: Wed, 27 Jun 2012 14:56:02 +0400 Message-ID: From: Andrey Fesenko To: svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r237412 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/components/disa... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 10:56:03 -0000 On 2012-06-25 23:37, Jung-uk Kim wrote: ... > I submitted this patch and I am waiting for confirmation: > > http://people.freebsd.org/~jkim/evxfgpe.diff http://lists.freebsd.org/pipermail/freebsd-current/2012-June/034848.html Lenovo Thinkpad X220 I've tested your diff, and it made the panic disappear for me. =C2=A0Thanks= ! From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 11:02:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA5431065674; Wed, 27 Jun 2012 11:02:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A47458FC19; Wed, 27 Jun 2012 11:02:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RB2Zts006380; Wed, 27 Jun 2012 11:02:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RB2ZLE006378; Wed, 27 Jun 2012 11:02:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206271102.q5RB2ZLE006378@svn.freebsd.org> From: Alexander Motin Date: Wed, 27 Jun 2012 11:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237637 - stable/9/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 11:02:35 -0000 Author: mav Date: Wed Jun 27 11:02:35 2012 New Revision: 237637 URL: http://svn.freebsd.org/changeset/base/237637 Log: MFC r237398: In camisr() clear CAM_SIM_ON_DONEQ flag after camisr_runqueue() purged SIM done queue. Clearing it before caused extra SIM queueing in some cases. It was invisible during normal operation, but during USB device unplug and respective SIM destruction it could keep pointer on SIM without having counted reference and as result crash the system by use afer free. PR: usb/168743 Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Jun 27 10:07:29 2012 (r237636) +++ stable/9/sys/cam/cam_xpt.c Wed Jun 27 11:02:35 2012 (r237637) @@ -4990,8 +4990,8 @@ camisr(void *dummy) while ((sim = TAILQ_FIRST(&queue)) != NULL) { TAILQ_REMOVE(&queue, sim, links); CAM_SIM_LOCK(sim); - sim->flags &= ~CAM_SIM_ON_DONEQ; camisr_runqueue(&sim->sim_doneq); + sim->flags &= ~CAM_SIM_ON_DONEQ; CAM_SIM_UNLOCK(sim); } mtx_lock(&cam_simq_lock); From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 11:04:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8BC01065673; Wed, 27 Jun 2012 11:04:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 941158FC18; Wed, 27 Jun 2012 11:04:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RB44fs006491; Wed, 27 Jun 2012 11:04:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RB447N006489; Wed, 27 Jun 2012 11:04:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206271104.q5RB447N006489@svn.freebsd.org> From: Alexander Motin Date: Wed, 27 Jun 2012 11:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237638 - stable/8/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 11:04:04 -0000 Author: mav Date: Wed Jun 27 11:04:04 2012 New Revision: 237638 URL: http://svn.freebsd.org/changeset/base/237638 Log: MFC r237398: In camisr() clear CAM_SIM_ON_DONEQ flag after camisr_runqueue() purged SIM done queue. Clearing it before caused extra SIM queueing in some cases. It was invisible during normal operation, but during USB device unplug and respective SIM destruction it could keep pointer on SIM without having counted reference and as result crash the system by use afer free. PR: usb/168743 Modified: stable/8/sys/cam/cam_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Jun 27 11:02:35 2012 (r237637) +++ stable/8/sys/cam/cam_xpt.c Wed Jun 27 11:04:04 2012 (r237638) @@ -4944,8 +4944,8 @@ camisr(void *dummy) while ((sim = TAILQ_FIRST(&queue)) != NULL) { TAILQ_REMOVE(&queue, sim, links); CAM_SIM_LOCK(sim); - sim->flags &= ~CAM_SIM_ON_DONEQ; camisr_runqueue(&sim->sim_doneq); + sim->flags &= ~CAM_SIM_ON_DONEQ; CAM_SIM_UNLOCK(sim); } mtx_lock(&cam_simq_lock); From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 11:07:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29A93106566C; Wed, 27 Jun 2012 11:07:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14C558FC0A; Wed, 27 Jun 2012 11:07:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RB71dp006676; Wed, 27 Jun 2012 11:07:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RB71nK006674; Wed, 27 Jun 2012 11:07:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206271107.q5RB71nK006674@svn.freebsd.org> From: Alexander Motin Date: Wed, 27 Jun 2012 11:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237639 - stable/9/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 11:07:02 -0000 Author: mav Date: Wed Jun 27 11:07:01 2012 New Revision: 237639 URL: http://svn.freebsd.org/changeset/base/237639 Log: MFC r237401: Make cam_periph_hold() behavior consistent: drop taken reference and return ENXIO if periph was invalidated while we were waiting for it. Modified: stable/9/sys/cam/cam_periph.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Wed Jun 27 11:04:04 2012 (r237638) +++ stable/9/sys/cam/cam_periph.c Wed Jun 27 11:07:01 2012 (r237639) @@ -440,6 +440,10 @@ cam_periph_hold(struct cam_periph *perip cam_periph_release_locked(periph); return (error); } + if (periph->flags & CAM_PERIPH_INVALID) { + cam_periph_release_locked(periph); + return (ENXIO); + } } periph->flags |= CAM_PERIPH_LOCKED; From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 11:08:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08B00106564A; Wed, 27 Jun 2012 11:08:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E70CC8FC0C; Wed, 27 Jun 2012 11:08:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RB837X006770; Wed, 27 Jun 2012 11:08:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RB83Y4006768; Wed, 27 Jun 2012 11:08:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206271108.q5RB83Y4006768@svn.freebsd.org> From: Alexander Motin Date: Wed, 27 Jun 2012 11:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237640 - stable/8/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 11:08:04 -0000 Author: mav Date: Wed Jun 27 11:08:03 2012 New Revision: 237640 URL: http://svn.freebsd.org/changeset/base/237640 Log: MFC r237401: Make cam_periph_hold() behavior consistent: drop taken reference and return ENXIO if periph was invalidated while we were waiting for it. Modified: stable/8/sys/cam/cam_periph.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/cam_periph.c ============================================================================== --- stable/8/sys/cam/cam_periph.c Wed Jun 27 11:07:01 2012 (r237639) +++ stable/8/sys/cam/cam_periph.c Wed Jun 27 11:08:03 2012 (r237640) @@ -390,6 +390,10 @@ cam_periph_hold(struct cam_periph *perip cam_periph_release_locked(periph); return (error); } + if (periph->flags & CAM_PERIPH_INVALID) { + cam_periph_release_locked(periph); + return (ENXIO); + } } periph->flags |= CAM_PERIPH_LOCKED; From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 11:59:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4C1E106564A; Wed, 27 Jun 2012 11:59:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85A1B8FC0A; Wed, 27 Jun 2012 11:59:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RBxv12008988; Wed, 27 Jun 2012 11:59:57 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RBxv6D008986; Wed, 27 Jun 2012 11:59:57 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206271159.q5RBxv6D008986@svn.freebsd.org> From: Martin Matuska Date: Wed, 27 Jun 2012 11:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237643 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 11:59:57 -0000 Author: mm Date: Wed Jun 27 11:59:57 2012 New Revision: 237643 URL: http://svn.freebsd.org/changeset/base/237643 Log: MFC r236823 (pjd): ds_guid of 0 is special, as it is used by snapshot receive code to differentiate between an incremental and full stream. Be sure not to generate guid equal to 0. Reported by: someone who saw 0 being generated as 64bit random guid Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Jun 27 11:36:33 2012 (r237642) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Jun 27 11:59:57 2012 (r237643) @@ -809,8 +809,10 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dsphys->ds_dir_obj = dd->dd_object; dsphys->ds_flags = flags; dsphys->ds_fsid_guid = unique_create(); - (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, - sizeof (dsphys->ds_guid)); + do { + (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, + sizeof (dsphys->ds_guid)); + } while (dsphys->ds_guid == 0); dsphys->ds_snapnames_zapobj = zap_create_norm(mos, U8_TEXTPREP_TOUPPER, DMU_OT_DSL_DS_SNAP_MAP, DMU_OT_NONE, 0, tx); @@ -2082,8 +2084,10 @@ dsl_dataset_snapshot_sync(void *arg1, vo bzero(dsphys, sizeof (dsl_dataset_phys_t)); dsphys->ds_dir_obj = ds->ds_dir->dd_object; dsphys->ds_fsid_guid = unique_create(); - (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, - sizeof (dsphys->ds_guid)); + do { + (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, + sizeof (dsphys->ds_guid)); + } while (dsphys->ds_guid == 0); dsphys->ds_prev_snap_obj = ds->ds_phys->ds_prev_snap_obj; dsphys->ds_prev_snap_txg = ds->ds_phys->ds_prev_snap_txg; dsphys->ds_next_snap_obj = ds->ds_object; From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 12:00:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB9301065850; Wed, 27 Jun 2012 12:00:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BF2C8FC1B; Wed, 27 Jun 2012 12:00:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RC0Z66009071; Wed, 27 Jun 2012 12:00:35 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RC0ZBZ009069; Wed, 27 Jun 2012 12:00:35 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206271200.q5RC0ZBZ009069@svn.freebsd.org> From: Martin Matuska Date: Wed, 27 Jun 2012 12:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237644 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 12:00:35 -0000 Author: mm Date: Wed Jun 27 12:00:35 2012 New Revision: 237644 URL: http://svn.freebsd.org/changeset/base/237644 Log: MFC r236823 (pjd): ds_guid of 0 is special, as it is used by snapshot receive code to differentiate between an incremental and full stream. Be sure not to generate guid equal to 0. Reported by: someone who saw 0 being generated as 64bit random guid Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Jun 27 11:59:57 2012 (r237643) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Jun 27 12:00:35 2012 (r237644) @@ -809,8 +809,10 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dsphys->ds_dir_obj = dd->dd_object; dsphys->ds_flags = flags; dsphys->ds_fsid_guid = unique_create(); - (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, - sizeof (dsphys->ds_guid)); + do { + (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, + sizeof (dsphys->ds_guid)); + } while (dsphys->ds_guid == 0); dsphys->ds_snapnames_zapobj = zap_create_norm(mos, U8_TEXTPREP_TOUPPER, DMU_OT_DSL_DS_SNAP_MAP, DMU_OT_NONE, 0, tx); @@ -2082,8 +2084,10 @@ dsl_dataset_snapshot_sync(void *arg1, vo bzero(dsphys, sizeof (dsl_dataset_phys_t)); dsphys->ds_dir_obj = ds->ds_dir->dd_object; dsphys->ds_fsid_guid = unique_create(); - (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, - sizeof (dsphys->ds_guid)); + do { + (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, + sizeof (dsphys->ds_guid)); + } while (dsphys->ds_guid == 0); dsphys->ds_prev_snap_obj = ds->ds_phys->ds_prev_snap_obj; dsphys->ds_prev_snap_txg = ds->ds_phys->ds_prev_snap_txg; dsphys->ds_next_snap_obj = ds->ds_object; From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 12:19:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D84D21065670; Wed, 27 Jun 2012 12:19:28 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2FB28FC17; Wed, 27 Jun 2012 12:19:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RCJS7t009954; Wed, 27 Jun 2012 12:19:28 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RCJSHD009952; Wed, 27 Jun 2012 12:19:28 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201206271219.q5RCJSHD009952@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 27 Jun 2012 12:19: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: r237645 - head/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 12:19:28 -0000 Author: gavin Date: Wed Jun 27 12:19:28 2012 New Revision: 237645 URL: http://svn.freebsd.org/changeset/base/237645 Log: The -S option, to specify the sector size, has been usable on all types of memory disks since r135340. Update the man page to reflect this. Noticed by: avg MFC after: 3 days Modified: head/sbin/mdconfig/mdconfig.8 Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Wed Jun 27 12:00:35 2012 (r237644) +++ head/sbin/mdconfig/mdconfig.8 Wed Jun 27 12:19:28 2012 (r237645) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2012 +.Dd June 27, 2012 .Dt MDCONFIG 8 .Os .Sh NAME @@ -148,7 +148,7 @@ and .Fl t Ar swap options are implied if not specified. .It Fl S Ar sectorsize -Sectorsize to use for malloc backed device. +Sectorsize to use for the memory disk, in bytes. .It Fl x Ar sectors/track See the description of the .Fl y From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 12:22:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC4C010657AB; Wed, 27 Jun 2012 12:22:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id BD9EB8FC12; Wed, 27 Jun 2012 12:22:48 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C3090B922; Wed, 27 Jun 2012 08:22:47 -0400 (EDT) From: John Baldwin To: Marius Strobl Date: Wed, 27 Jun 2012 07:47:37 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201206131504.q5DF4opt031336@svn.freebsd.org> <201206251424.24621.jhb@freebsd.org> <20120626211445.GB63893@alchemy.franken.de> In-Reply-To: <20120626211445.GB63893@alchemy.franken.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201206270747.37859.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 27 Jun 2012 08:22:47 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237008 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 12:22:49 -0000 On Tuesday, June 26, 2012 5:14:45 pm Marius Strobl wrote: > Yes, it does but switching to positive decoding nevertheless is > problematic in this case. According to the PCI 2.3 specification, > a child wanting its addresses to be decoded subtractively needs > to provide special DEVSEL# behavior. It seems that it should work > for a bridge to actually positively decoding such transactions, > but I'm not familiar with the physical layer of PCI and thus not > sure. On the other hand, both the PCI-ISA and PCI-PCI bridges > in question are ALi/ULi crap and based on fun I had with their > chips in the past, I also wouldn't be surprised their again being > a magic bit in the configuration space needing to be set to make > this work. Unfortunately, I don't have a datasheet for this > M5249 PCI-PCI bridge. If we'd implement a tunable for changing > the decoding of subtractive bridges, the way to go would seem to > be to have it off by default in order to preserve pre-NEW_PCIB/ > r237008 as at this time it's unknown how many bridges are > affected. If you'd want to keep the new/current behavior by > default, introducing something like a PCIB_SUBTRACTIVE_FORCED > flag along a PCI_QUIRK_SUB_FORCED quirk in addition to a > tuneable defaulting to on probably would be a good idea. Hmm. I'm fine with your original change going in then. I am not really sure what the right way to handle this is, and just leaving the windows alone on subtractive bridges is probably safest. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 12:30:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04BAC106566B; Wed, 27 Jun 2012 12:30:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E392F8FC22; Wed, 27 Jun 2012 12:30:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RCUuu0010450; Wed, 27 Jun 2012 12:30:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RCUuwf010448; Wed, 27 Jun 2012 12:30:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206271230.q5RCUuwf010448@svn.freebsd.org> From: John Baldwin Date: Wed, 27 Jun 2012 12:30: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: r237646 - head/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 12:30:57 -0000 Author: jhb Date: Wed Jun 27 12:30:56 2012 New Revision: 237646 URL: http://svn.freebsd.org/changeset/base/237646 Log: Clarify that the cached file data pages included in the "Wired" count in top are the BIO-level cached data (i.e. "Buf"), since the previous phrase was a bit ambiguous with the "Cache" count. MFC after: 3 days Modified: head/usr.bin/top/top.local.1 Modified: head/usr.bin/top/top.local.1 ============================================================================== --- head/usr.bin/top/top.local.1 Wed Jun 27 12:19:28 2012 (r237645) +++ head/usr.bin/top/top.local.1 Wed Jun 27 12:30:56 2012 (r237646) @@ -24,7 +24,7 @@ number of bytes active number of bytes inactive .TP .B Wired: -number of bytes wired down, including cached file data pages +number of bytes wired down, including BIO-level cached file data pages .TP .B Cache: number of clean bytes caching data that are available for From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 15:55:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E85C106572D; Wed, 27 Jun 2012 15:55:34 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE8F18FC14; Wed, 27 Jun 2012 15:55:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RFtY4u018894; Wed, 27 Jun 2012 15:55:34 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RFtY1V018892; Wed, 27 Jun 2012 15:55:34 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201206271555.q5RFtY1V018892@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 27 Jun 2012 15:55: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: r237647 - head/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 15:55:35 -0000 Author: bschmidt Date: Wed Jun 27 15:55:34 2012 New Revision: 237647 URL: http://svn.freebsd.org/changeset/base/237647 Log: Fix a TX aggregation issue, if after the last compressed BA notification the TX queue is empty, there won't be a TX done notification, effectly resulting in an mbuf leak. The correct way to handle this is to free up mbufs on both BA and TX done notifications up to the last sent seqno. Tested by: osa@ MFC after: 3 days Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Wed Jun 27 12:30:56 2012 (r237646) +++ head/sys/dev/iwn/if_iwn.c Wed Jun 27 15:55:34 2012 (r237647) @@ -2437,18 +2437,43 @@ iwn_rx_compressed_ba(struct iwn_softc *s struct ieee80211_node *ni; struct iwn_compressed_ba *ba = (struct iwn_compressed_ba *)(desc + 1); struct iwn_tx_ring *txq; + struct iwn_tx_data *txdata; struct ieee80211_tx_ampdu *tap; + struct mbuf *m; uint64_t bitmap; uint8_t tid; - int ackfailcnt = 0, i, shift; + int ackfailcnt = 0, i, lastidx, qid, shift; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - txq = &sc->txq[le16toh(ba->qid)]; - tap = sc->qid2tap[le16toh(ba->qid)]; + qid = le16toh(ba->qid); + txq = &sc->txq[ba->qid]; + tap = sc->qid2tap[ba->qid]; tid = tap->txa_tid; - ni = tap->txa_ni; - wn = (void *)ni; + wn = (void *)tap->txa_ni; + + for (lastidx = le16toh(ba->ssn) & 0xff; txq->read != lastidx;) { + txdata = &txq->data[txq->read]; + + /* Unmap and free mbuf. */ + bus_dmamap_sync(txq->data_dmat, txdata->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->data_dmat, txdata->map); + m = txdata->m, txdata->m = NULL; + ni = txdata->ni, txdata->ni = NULL; + + KASSERT(ni != NULL, ("no node")); + KASSERT(m != NULL, ("no mbuf")); + + if (m->m_flags & M_TXCB) + ieee80211_process_callback(ni, m, 1); + + m_freem(m); + ieee80211_free_node(ni); + + txq->queued--; + txq->read = (txq->read + 1) % IWN_TX_RING_COUNT; + } if (wn->agg[tid].bitmap == 0) return; @@ -2460,6 +2485,7 @@ iwn_rx_compressed_ba(struct iwn_softc *s if (wn->agg[tid].nframes > (64 - shift)) return; + ni = tap->txa_ni; bitmap = (le64toh(ba->bitmap) >> shift) & wn->agg[tid].bitmap; for (i = 0; bitmap; i++) { if ((bitmap & 1) == 0) { @@ -2815,8 +2841,6 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, for (lastidx = (seqno & 0xff); ring->read != lastidx;) { data = &ring->data[ring->read]; - KASSERT(data->ni != NULL, ("no node")); - /* Unmap and free mbuf. */ bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTWRITE); @@ -2824,6 +2848,9 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, m = data->m, data->m = NULL; ni = data->ni, data->ni = NULL; + KASSERT(ni != NULL, ("no node")); + KASSERT(m != NULL, ("no mbuf")); + if (m->m_flags & M_TXCB) ieee80211_process_callback(ni, m, 1); From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 16:05:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90A3D106564A; Wed, 27 Jun 2012 16:05:10 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3278FC14; Wed, 27 Jun 2012 16:05:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RG5Asv019342; Wed, 27 Jun 2012 16:05:10 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RG5AqG019340; Wed, 27 Jun 2012 16:05:10 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206271605.q5RG5AqG019340@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 27 Jun 2012 16:05: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: r237648 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 16:05:10 -0000 Author: ken Date: Wed Jun 27 16:05:09 2012 New Revision: 237648 URL: http://svn.freebsd.org/changeset/base/237648 Log: In g_disk_providergone(), don't continue if the softc is NULL. This may be the case if we've already gone through g_disk_destroy(). Reported by: Michael Butler MFC after: 3 days Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Wed Jun 27 15:55:34 2012 (r237647) +++ head/sys/geom/geom_disk.c Wed Jun 27 16:05:09 2012 (r237648) @@ -502,6 +502,14 @@ g_disk_providergone(struct g_provider *p struct g_disk_softc *sc; sc = (struct g_disk_softc *)pp->geom->softc; + + /* + * If the softc is already NULL, then we've probably been through + * g_disk_destroy already; there is nothing for us to do anyway. + */ + if (sc == NULL) + return; + dp = sc->dp; if (dp->d_gone != NULL) From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 16:07:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D439E10657B6; Wed, 27 Jun 2012 16:07:01 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF7858FC16; Wed, 27 Jun 2012 16:07:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RG71pH019451; Wed, 27 Jun 2012 16:07:01 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RG71Jg019449; Wed, 27 Jun 2012 16:07:01 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201206271607.q5RG71Jg019449@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 27 Jun 2012 16:07: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: r237649 - head/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 16:07:01 -0000 Author: bschmidt Date: Wed Jun 27 16:07:01 2012 New Revision: 237649 URL: http://svn.freebsd.org/changeset/base/237649 Log: We need to defer passing the DELBA request to the firmware until the aggr queue is empty or the firmware will go nuts. PR: kern/167806 Tested by: osa@, Brandon Gooch (earlier version), Bojan Petrovic (earlier version) MFC after: 3 days Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Wed Jun 27 16:05:09 2012 (r237648) +++ head/sys/dev/iwn/if_iwn.c Wed Jun 27 16:07:01 2012 (r237649) @@ -2432,6 +2432,7 @@ static void iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { + struct iwn_ops *ops = &sc->ops; struct ifnet *ifp = sc->sc_ifp; struct iwn_node *wn; struct ieee80211_node *ni; @@ -2441,8 +2442,9 @@ iwn_rx_compressed_ba(struct iwn_softc *s struct ieee80211_tx_ampdu *tap; struct mbuf *m; uint64_t bitmap; + uint16_t ssn; uint8_t tid; - int ackfailcnt = 0, i, lastidx, qid, shift; + int ackfailcnt = 0, i, lastidx, qid, *res, shift; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); @@ -2452,6 +2454,13 @@ iwn_rx_compressed_ba(struct iwn_softc *s tid = tap->txa_tid; wn = (void *)tap->txa_ni; + res = NULL; + ssn = 0; + if (!IEEE80211_AMPDU_RUNNING(tap)) { + res = tap->txa_private; + ssn = tap->txa_start & 0xfff; + } + for (lastidx = le16toh(ba->ssn) & 0xff; txq->read != lastidx;) { txdata = &txq->data[txq->read]; @@ -2475,6 +2484,15 @@ iwn_rx_compressed_ba(struct iwn_softc *s txq->read = (txq->read + 1) % IWN_TX_RING_COUNT; } + if (txq->queued == 0 && res != NULL) { + iwn_nic_lock(sc); + ops->ampdu_tx_stop(sc, qid, tid, ssn); + iwn_nic_unlock(sc); + sc->qid2tap[qid] = NULL; + free(res, M_DEVBUF); + return; + } + if (wn->agg[tid].bitmap == 0) return; @@ -2785,6 +2803,7 @@ static void iwn_ampdu_tx_done(struct iwn_softc *sc, int qid, int idx, int nframes, void *stat) { + struct iwn_ops *ops = &sc->ops; struct ifnet *ifp = sc->sc_ifp; struct iwn_tx_ring *ring = &sc->txq[qid]; struct iwn_tx_data *data; @@ -2795,8 +2814,9 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, uint64_t bitmap; uint32_t *status = stat; uint16_t *aggstatus = stat; + uint16_t ssn; uint8_t tid; - int bit, i, lastidx, seqno, shift, start; + int bit, i, lastidx, *res, seqno, shift, start; #ifdef NOT_YET if (nframes == 1) { @@ -2829,12 +2849,17 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, bitmap |= 1ULL << bit; } tap = sc->qid2tap[qid]; - if (tap != NULL) { - tid = tap->txa_tid; - wn = (void *)tap->txa_ni; - wn->agg[tid].bitmap = bitmap; - wn->agg[tid].startidx = start; - wn->agg[tid].nframes = nframes; + tid = tap->txa_tid; + wn = (void *)tap->txa_ni; + wn->agg[tid].bitmap = bitmap; + wn->agg[tid].startidx = start; + wn->agg[tid].nframes = nframes; + + res = NULL; + ssn = 0; + if (!IEEE80211_AMPDU_RUNNING(tap)) { + res = tap->txa_private; + ssn = tap->txa_start & 0xfff; } seqno = le32toh(*(status + nframes)) & 0xfff; @@ -2861,6 +2886,15 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, ring->read = (ring->read + 1) % IWN_TX_RING_COUNT; } + if (ring->queued == 0 && res != NULL) { + iwn_nic_lock(sc); + ops->ampdu_tx_stop(sc, qid, tid, ssn); + iwn_nic_unlock(sc); + sc->qid2tap[qid] = NULL; + free(res, M_DEVBUF); + return; + } + sc->sc_tx_timer = 0; if (ring->queued < IWN_TX_RING_LOMARK) { sc->qfullmsk &= ~(1 << ring->qid); @@ -5661,6 +5695,8 @@ iwn_ampdu_tx_start(struct ieee80211com * if ((error = iwn_nic_lock(sc)) != 0) return 0; qid = *(int *)tap->txa_private; + DPRINTF(sc, IWN_DEBUG_XMIT, "%s: ra=%d tid=%d ssn=%d qid=%d\n", + __func__, wn->id, tid, tap->txa_start, qid); ops->ampdu_tx_start(sc, ni, qid, tid, tap->txa_start & 0xfff); iwn_nic_unlock(sc); @@ -5676,10 +5712,14 @@ iwn_ampdu_tx_stop(struct ieee80211_node uint8_t tid = tap->txa_tid; int qid; + sc->sc_addba_stop(ni, tap); + if (tap->txa_private == NULL) return; qid = *(int *)tap->txa_private; + if (sc->txq[qid].queued != 0) + return; if (iwn_nic_lock(sc) != 0) return; ops->ampdu_tx_stop(sc, qid, tid, tap->txa_start & 0xfff); @@ -5687,7 +5727,6 @@ iwn_ampdu_tx_stop(struct ieee80211_node sc->qid2tap[qid] = NULL; free(tap->txa_private, M_DEVBUF); tap->txa_private = NULL; - sc->sc_addba_stop(ni, tap); } static void From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 16:07:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 704311065673; Wed, 27 Jun 2012 16:07:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4250A8FC14; Wed, 27 Jun 2012 16:07:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RG7xl5019521; Wed, 27 Jun 2012 16:07:59 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RG7xlN019519; Wed, 27 Jun 2012 16:07:59 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206271607.q5RG7xlN019519@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 27 Jun 2012 16:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237650 - vendor-sys/acpica/dist/source/components/events X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 16:07:59 -0000 Author: jkim Date: Wed Jun 27 16:07:58 2012 New Revision: 237650 URL: http://svn.freebsd.org/changeset/base/237650 Log: Do not malloc(9) while holding a spin lock, to avoid panic. Note it was submitted upstream and it should be fixed in the next ACPICA release. Discussed with: Moore, Robert (robert dot moore at intel dot com) Modified: vendor-sys/acpica/dist/source/components/events/evxfgpe.c Modified: vendor-sys/acpica/dist/source/components/events/evxfgpe.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evxfgpe.c Wed Jun 27 16:07:01 2012 (r237649) +++ vendor-sys/acpica/dist/source/components/events/evxfgpe.c Wed Jun 27 16:07:58 2012 (r237650) @@ -298,7 +298,7 @@ AcpiSetupGpeForWake ( ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_NAMESPACE_NODE *DeviceNode; - ACPI_GPE_NOTIFY_INFO *Notify; + ACPI_GPE_NOTIFY_INFO *NewNotify, *Notify; ACPI_CPU_FLAGS Flags; @@ -334,6 +334,12 @@ AcpiSetupGpeForWake ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + NewNotify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); + if (!NewNotify) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); /* Ensure that we have a valid GPE number */ @@ -384,16 +390,10 @@ AcpiSetupGpeForWake ( /* Add this device to the notify list for this GPE */ - Notify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); - if (!Notify) - { - Status = AE_NO_MEMORY; - goto UnlockAndExit; - } - - Notify->DeviceNode = DeviceNode; - Notify->Next = GpeEventInfo->Dispatch.NotifyList; - GpeEventInfo->Dispatch.NotifyList = Notify; + NewNotify->DeviceNode = DeviceNode; + NewNotify->Next = GpeEventInfo->Dispatch.NotifyList; + GpeEventInfo->Dispatch.NotifyList = NewNotify; + NewNotify = NULL; } /* Mark the GPE as a possible wake event */ @@ -403,6 +403,10 @@ AcpiSetupGpeForWake ( UnlockAndExit: AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + if (NewNotify) + { + ACPI_FREE (NewNotify); + } return_ACPI_STATUS (Status); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 16:14:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35198106566C; Wed, 27 Jun 2012 16:14:29 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E9578FC16; Wed, 27 Jun 2012 16:14:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RGETUb019834; Wed, 27 Jun 2012 16:14:29 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RGESrB019831; Wed, 27 Jun 2012 16:14:28 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201206271614.q5RGESrB019831@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 27 Jun 2012 16:14: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: r237651 - head/sys/contrib/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 16:14:29 -0000 Author: bschmidt Date: Wed Jun 27 16:14:28 2012 New Revision: 237651 URL: http://svn.freebsd.org/changeset/base/237651 Log: Add new firmware for the g2a (6205) and g2b (623x) devices. MFC after: 3 days Added: head/sys/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.3.fw.uu head/sys/contrib/dev/iwn/iwlwifi-6000g2b-18.168.6.1.fw.uu Added: head/sys/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.3.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.3.fw.uu Wed Jun 27 16:14:28 2012 (r237651) @@ -0,0 +1,7833 @@ +Copyright (c) 2006-2011, Intel Corporation. +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. +* Neither the name of Intel Corporation nor the names of its suppliers + may be used to endorse or promote products derived from this software + without specific prior written permission. +* No reverse engineering, decompilation, or disassembly of this software + is permitted. + +Limited patent license. Intel Corporation grants a world-wide, +royalty-free, non-exclusive license under patents it now or hereafter +owns or controls to make, have made, use, import, offer to sell and +sell ("Utilize") this software, but solely to the extent that any +such patent is necessary to Utilize the software alone, or in +combination with an operating system licensed under an approved Open +Source license as listed by the Open Source Initiative at +http://opensource.org/licenses. The patent license shall not apply to +any other combinations which include this software. No hardware per +se is licensed hereunder. + +DISCLAIMER. 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. +begin-base64 644 iwlwifi-6000g2a.17.168.5.3.fw.uu +AAAAAElXTAo2MDAwZzJhIGZ3IHYxNy4xNjguNS4zIGJ1aWxkIDQyMzAxCgAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAwWoET2lAAABAAAAAAAAAAEAAAAASAIAICCADwAAQABpIAAAaSBAAGkg +AABpIEAAICCADwAA6ABpIAAAaSBAAGkgAABpIEAAICCADwAApPZpIAAAaSBAAGkgAABKIAAASiEA +AEoiAABKIwAASiQAAEolAABKJgAASicAAEogABBKIQAQSiIAEEojABBKJAAQSiUAEEomABBKJwAQ +SiAAIEohACBKIgAgSiMAIEokACBKJQAgSiYAIEonACBKIAAwSiEAMAokgD+BAABAQSycMEAsnDBC +JBw0CiKAP4AAWG8KIwA3xgpAB0omAHBpIEAASiYAcEomAHBKJgBwSiYAcAAWAHCAAFQcQHggIECH +AAAAAAAAAAAAAPwciLb8HEi2/BwItvwcyLX8HIi1/BxItfwcCLX8HMi0/ByItPwcSLT8HAi0/BzI +s/wciLP8HEiz4H7geATcON018OB4BNw03TPw4HgE3DDdMfDgeATcLN0v8OB4BNwo3S3w4HgE3CTd +K/DgeATcIN0p8OB4BNwc3Sfw4HgE3BjdJfDgeATcFN0j8OB4BNwQ3SHw4HgE3AzdH/DgeATcCN0c +8OB4BNwE3RnwNBQaMDAUGTAsFBgwKBQXMCQUFjAgFBUwHBQUMBgUEzAUFBIwEBQRMAwUEDACxwHG +sCRNM7AkHzPgfvHATg/P/89xoACsLxiBz3WgAMgfIN6auBihBdjQpUMdGBAA2DYI4BGNuNGljQfP +//HAHg/P/89xoACsLxiBz3WgAMgfIN6zuLq4GKFk2NClQx0YEADYBgjgEY240aVdB8//4HjgfuB4 +4H7geOB+4HjgfuB4CiJAgADZ7gABAC8mAPBKJkAATgAGAE8AIACKJf8P4HgKIkCAANnOAAEAbAAk +AC8mAPBcAAUAKwg1CEomQAAIcQDYAiG+gOAgxQdCeQHgAiG+gOAgxQdCeesH7/8B4C8tAQBAJUUA +AiZ88QAAIAAAKEAB6CBiAy8gAIAvIUsAAiG+gMAghgHCIYYA4H4RACAASiAAEEogQBAOIkIALyAL +Es4gRYCKJf8PCAAFAC8tAQBAJUUAAiZ88QAAIAAAKEABSiZAAOggIgMvIACALyFLAAIhvoDAIIYB +wiGGAEomAABCIP6QziCCAUQgfpDOIYIB4H65AAAA4HgKJIDwBSBEAOAgwQdEJP6AQSrEAIQAAgAv +JALxQiEBAUIgAwHoIKIEBBEEAgQRBQIEEQYCBBEHAgQbCAEEG0gBBBuIAQQbyAEsACUARCI+gTwA +IgBEIvyAQCHBAOAgwQdAI8MAqCCAAQERhAIBGwoBICDABwQRBAIEEQUCBBsIAdQH4f8EG0gBRCL8 +gAQRBALJB+//BBsIAUIhQQBCIEMAqCCAAQERhAIBGwoBICDABwomAPCKIL8PyiBkAOB/LyADAOB/ +iiD/D/wciLH8HEix/BwIseHD4cLhweHAB8AcHMAx4cDgfwHA8cDhxc9wgADIHU2Az3WAAEiaIIW3 +uri6BCGBDwMAAAAHuUV5LaBqC6ARANgAhc9xgAAQyVEggILPcIAA+LJMiBVqx3CAABDGYIBWeUGB +BvKVu2Cgq7oF8LW7YKCLuguNQaGjuAkF7/8LreB4osHxwIYMz/9Fwc91gADIHSeFMHAI9DCVFBQO +MTB2BPRZHYIQz3GAABwjMYEwcA70z3GAACwjPJEUFA0xMHUG9M9xgACUI0mpgOIM9M91gABIB8GN +gOYA2cogQQAl8iGtjuIE9AHYIfBBKA0CB31BKAEEp3nPd4AASAegj1MlRRFMJQCExrmN9gohwA/r +cs9wAADNG5/bOQQgAYokgw9RJYCRBvIA2AzcSwTP/892gACQyBYmTRGnjaCvyXUWJU0RAKUUFAAx +Rq3HcYAAkMUCtQCJB60AGUIBABtCAcTx4HgIyM9yoADIHw4aGIAJyA8aGIAKyBAaGIALEgE2Asgk +eBEaGIAMyC0aGIDgfvHA4cUB2M9xoADIHxOhGIGswUnAGYHPdYAAmKXPcYAAsCBKwACBobgAoQiF +4LgK8lEgwIEG9B4JwAVmD2AHFtiLcalwGgqgDiTaz3CAAOwHIIACiYDgE/QEiVEgAIAP8gvIBCCA +D/7//wMLGhgwC8iGuIy4j7iQuArwC8gFIIAPAQAA/AsaGDALyKy4CxoYMEYPz/+LcDDZkNoe23YJ +4A0YuyjAgeDKIcIPyiLCB8oggg8AAOocyiOCDwAA9wDKJCIAAAMiAcolIgDGCsAFgOAH9B4O4AAA +2AIJIA4G2BkD7/+swM9xgADsbuB/CGHgePHAngnABc9xgAAYGPAhAABAeIDZz3CgANAbMKDRwOB+ +8cByCu//D9nPdYAAoM4AFgBAABYAQFUlThQApd4O4BAEbclwmg7gECKVHpXPcYAA7AfaYNhgARCF +AEwlAIBAoRP0AoXwuMohwQ/KIsEHyiCBDwAA6RzKI4EPAAC8AFQCIQHKJGEAeQLP/+B4gOHKJE1w +4HjoIC0Cz3GgAFAMJYEBGFIA4H7gePHA5gnP/89wgADIHQOAGBCFAEwlAIEM9AohwA/rcoogTQNc +2wUCIAFKJAAAiiAHDr4IIAcA2c92gAC8pS2OgOEE8gyOEHEM9qYIIAeKIIcNiiCHDZoIIAcsjmTw +z3CgALAfG4DPd4AAmJcCp4ogSQZ+CCAHbtmKIAkGdgggByKHTI4Njs9xgAAQzmiRQKdwcM91gABw +sAGni/YIsQDZTR1CEAHZLKU1hTBww/cVpRCOBKURjoDgBPKA4gTyANgL8M9wgADIHQOACYBRIICA ++PMB2AKliiBJBhYIIAeO2YogCQYOCCAHIocChSCHgODKIGIAGLgFeQSFCiIAgIogCQbKImIAELrq +D+AGRXkMjoDgBfQChYDgeAhBBe4MYAcC2C0Bz/+iwfHAvgjv/5hyRcFBKAECB3lBKAIEJ3rGus91 +gACQxUll57ldZRP0FBQOMc9zgACQyGhyNnrggvFwBfTiktF3B/Iniue5p2r18wDYKPDGioDmB/SA +389wgABIB+Goz3eAABweBY8QdgT0gNgFrwrwz3eAAJQjCY8QdgT0gNgJr8aKNnsAHIADB4qHuQCt +z3CAAEgHQIggqAHYR6sM3I8Az//geKHB8cADEgI313IAAABAAdrCIooAF7rHcgAOAACDuuxzQKPs +cgCi+gugBChw0cDgf6HA4Hil4B/yCfaD4BXyhOAX8oXgG/TgfwHYveAP8gb2reAV9OB/AtjM4A/y +jCBDhw304H8G2OB/ANjgfwPY4H8E2OB/BdjgfwfYCNjgfuB48cDhxYogUg6eDuAGrdnPdYAA4DKp +cEAlgRtmDmAOLtoB2PUHr/9hHQIQ4HjxwG4Pj/+C4Ah2jfcKIcAP63L92Iu4c9tKJAAAmQfgALhz +z3eAAOAyF4cQdgf0z3CAAEAzyGCA4G3yGgsgCAXYGnCKIBIONg7gBslxRC6+GwAnQB5AkCGQCLpF +ec9ypAC4PZsaWAAikMoaWAAjkMsaWAAkkMQaWAAlkMYaWAAmkMcaWAAnkMIaWAAokMMaWAApkMUa +WAAqkKMaWADPcYAAyB0jgSiBUSEAgM9xpAC0RQDdDPJskEuQe3tlelMZmIBNkFQZmIAG8FMZWINU +GViDTpBWGZiAT5BYGZiAUJBVGZiAUZBXGZiAUpBaGZiAU5BcGZiAVJBZGZiAFZBbGRiAegkgCApw +16cAJoAfgABAM6CowQaP/+B48cDuC+//4cUOCoAEz3CAAMgdA4AYiIHgLfTPcYAAoM7PcoAAVFsA +gmCBYKAAghzbYKgEaQGiz3CAABQIA6FVIUAEA6IY2AKiVSHABQWiAYEA3VoZRAMEogKBrbgODqAF +AqGA4Af0ZgngAKlwSgzgDQbYYQaP/+B4huDxwADYD/TPcIAA2KXWC+//BtnPcYAAeKYAgYK4AKEB +2NHA4H7geIPg8cAA2An0z3CAANClrgvv/wPZAdjRwOB+4HjxwIHg4cUA2An0z3CAANOlAd2OC+// +qXGpcP0Fj//gePHAluDhxQDYjPfPdYAASJqpcG4L7/8E2QuNg7gLrQHY1QWP//HAmuDhxQDYjPfP +dYAASJoEbUoL7/8E2QuNgrgLrQHYsQWP//HApMGQ4ADZyiBCABP0i3AmC+//ENkAFAAxhODMIGKB +CPTPcIAAbLIfgPW4AvJMcAHYpMDRwOB+8cD6DI//CHfPcIAAyB0DgBiIhOAacUnyhOcA3YwAJQDK +IEUDz3aAALylQCYAE9IK7/8E2S6OsK5TIQAAEa5BKMAgoLkwcGIAJQACIEIAY7/xclYABgCA4g7y +z3GgANAPEBEAhmG6WGAQGRiAJREAhg94A/APjgDZUyCCIA8hgQAkeC8mB/DPcZ8AuP8QrhiBzyDi +B9Ag4QcYoRiBnrgYoRiBvrgYoQHYtQSP//HATgyP/xpwTCAAoaHBugAlAADYi3AE3ToK7/+pcQDA +z3agANAP13CaCVBvRfQX8CUWA5YlFgKWLyTHACUWAJZPfw99TCQAgwi9pX8L8hAWAJb9YfhgEB4Y +kCNtEnHq9yjwgufMJ+KTzCcil8olQhAg9M91gADYpUetJRYClgitSa0lFgKWZq2P50qtomkJ9M9w +gADjpb4J7/8N2Q3lnOcI9M9wgADwpaoJ7/8N2Q3lAiBBIwPwQiABIRAWAJY4YBAeGJAB2O0Dr/+h +wOHE/BzIvvwcSL7hwOHB4cLhw/wcCLH8HEix/ByIsfwcyLH8HAiy/BxIsvwciLL8HMiy/BwIv2ok +gBDhxGokwBDhxPHAz3CgANAbFIDPcYAASAYEIICPz1EE4QChEfL2uC8pAQAF8i8pgQ9AAAAAz3CA +AJwt8CBAAEB4Zg+P/9HAwcRrJMAQwcRrJIAQwcSfdAQUCzQEFAo0BBQJNAQUCDQEFAc0BBQGNAQU +BTQEFAQ0wcPBwsHBwcDBxEUsfhAKJkB+wcRrJIAUwcQgIECH4HiMIFyCAdjgf8IgCwDxwK4Kr/9K +JEAAz3aAAMgdFSYDEKCDQCYAFRB1wiQCAfAmDhGKIBUFJOYwJgUQTCUAgAryCiHAD+tyjtiNuLEC +4ABz2x5lyYa4YMV5KaBggwbYMCOBDwAAeAVGeGh0gCQVHiR40g5gEQCksQKP/+B48cA6Cq//iiAM +Cc91gABsBiSFMgnABgSFgOBF9M92gADYqBEWApYA34QqCAgAIYB/gADcoAKlJIgB24Dh66VspSHy +Gx7YkwwQBQAEJYEPwP8AAEEpBAbPcYAAEM4UEQYABS4+AQAhhH8/AP//BCRBARweWJAgkIwhgoYB +2cIhTgAqpeelJIDPdoAAFKXAuSa2z3aAAPQoKK5ArgKIZKUBrh/wBIWB4B305gzACADYBKUChSSI +gOET9CeFHOA2eCSIz3CAALwgGogQcQHZwHnPcIAA8CggoALYAvAB2AOlxQGv/wHY8cBWCa//iiAM +CqPBz3WAAGwGJIVKCOAGAN4EhYDgJ/SqC0AAAdgEpQKFBIiA4F4CAQDPcIAA8CgAgIDgTgICAM9w +oAAsIAOAz3KAADilIYIZYc9wgADgKACAOGBqCaAPAKKA4CYCAQB78ASFguBC9AqFgOAP9AwVBBAQ +FQUQCiHAD+tyz3AAAIoMEQHgAIojTgkihUeFQCEAB1Z4RohgwkaIARyCMEaIAhyCMEeIYcJHiAUc +gjAHiAYcAjCKIFMBng+gBqgRAQAChYtx2g+gDagQAADPcKAALCAjgM9wgAD0KCGg6grgAMWlA9gE +pc/wBIWD4Dn0QoUnhUAiAAc2eAWIUSBAgRLyA5LPcaAALCAjgc9zgAD0KGGDCrhieTBwBPcJ2Aul +i/AFhYDgDPQEioDgrfLPcIAAOKWOCKAPAICA4KXyBYWA4AXyBdgLpQHYCPDPcIAA8CgAgIDgl/QA +2LIOAAeT8ASFgeBs9M4NAAMihUeFQCEAB1Z4RYjguhjyg7pFqM9zgACQOsmDz3KAALyk2qL5g8WD +/mbboviDxIP+Ztyiw4N3g35m3aIFiFEgQIAs8pIOQA+A4BH0CiHADwKF63IcFQUQBBCEAM9wAACL +DMkHoACKI88Nhg5gDwLYEg5gDwjYIoUEiYLgCfQB2AClANgOpf4NYA9a2CKFBImB4AT0AdgBpQeF +HOEWeQWJhiD/jMoggg8AADBDxAtiBMohIgAChSeFHOA2eAWIhiD+hwXyAtgEpSnwBNgEpSfwJIWE +4QHYI/QPpc93oADIHzyHz3CAAPQoIaAGDqAGiiAMCs9wgAD0KAzZddoe234NYA0YuxWHz3GAAOgo +dgpgASCBBqXEpQTYA6UB2DEHb/+jwOB48cDGDm//iiCMCc91gABsBiSFug2ABgSFgOBA9CKFR4VA +IQAHVnhEiM9wgAC4BgCQEHIB3g70z3CAALoGQJDPcIAAFKUGkBByBPTEpQDYUfAEiYDgH/LPcIAA +8CgAgIDgGfTPcIAAOKUhgM9wgADkKACAhghgBjhggOAN9IogTA1KDaAGiiENBfYMIAcA2AHYL/DE +pQHYLfAEhYHgK/QChc9ygADIHSOCZIBooSOCZYAc4GmhJ4U2eCSIA4IA3jSwAtgE2VYL7//Jcs9z +gAAUpUKFB4VAIgEHFnkGkySJRILGDiAMyXPEpQPYA6UB2EUGT/8MFQQQEBUFEAohwA/rcs9wAACJ +DAEGoACKI80O4HjxwLINT//PdoAAbAYEhoDgocE69CSGpgygBoogjArPcYAA8CgB2AChANgPpgCm +AaaKIJMBhgygBoohGQMC3alw1gmgBAHZz3eAAMgdI4cwIYAPAAB0BSh0gCQVHQDZprgApKlwpgrv +/wTa4gsgEalwI4dIgTSRUyIAAB4OIAwB26SmaPAEhoLgMvQkhi4MoAaKIIwKz3GAALgGiiCMDB4M +oAYgkc9xgAC6BoogzAwODKAGIJEChgSIgOAY8gmGgOAU9M9ygAA4pQSCI4IOIIMPBwAgoTBzSPcH +2AumAdgMpgmmBPA4YAOiA9gz8ASGg+AP9CSGxgugBoogjAoLyAQggA////8DCxoYMATYIfAEhoTg +IvQkhqYLoAaKIIwKUyDAQM9xgADEW/4OIAAAoc9wgAC8pDiAz3CAAPSihCkICDAgQA5RIECABdjK +IKEBBKYB2CDwBIaF4AHfH/TPdYAAvKQYhQTZmdoe20DAi3DaCmANGLsYhemmhCgICAAhgH+AAMyi +KoChuSqgBtgEpgDYiQRv/6HABIaG4Nz1BtgDpgDY1/HxwA4MT//PdYAAbAYEhYDgpMEN9CSFAgug +BoogjAgChQSIgOAX9ALYBKUEhYHgT/QFhYDgP/TPcKAAsB8bgM9xgAB8XRILYA8ggYDgLvQA2DLw +AN7Fpc93oADIHxWHz3GAAOQoRg8gASCBz3GAAHxdBNrJcwChpBcHEM9wAAAUc0DABdhBwAHfQsdD +xslwBtmYdrh2ACeHDwcAIKF2CaAE2HbkpelwMfBWCaAEBdgE2ALwBdiA4AHaA/QB2CXwKYWB4RDy +TKULpQzwBIWC4Bz0JIVGCqAGiiCMCAmFgeAE9AHYD/CA4Ov1AoX6DmAEA4AIcc9wgAAkWdILAA8A +2E4IwAbd8QDYcQNv/6TA8cACC2//iiBMCc91gABsBiSF+gmgBqTBBIWA4Kn0AoVHhSSAVnjPcoAA +vCAEIYEPAAYAAIDhAdl6iiAQjgDAeXB2CfTPd4AAFKXml9iK8XYD8gDeBfDWitFx/fUB3oDmz3GA +APAowKEV9M9xgAC4BiCRMHMP9M9xgAC6BiCReIowcwn0z3GAALwGIIlWijByA/IA2QLwAdmA4WPy +HBAEAM9wgAA4pQQYAAHPcIAAmJcEEAUAz3CAABDOBYAFKH4BQCmAcpBwyiLOB8ogjg8AAIgMyiOO +DwAA+AJsAq4AyiHOD89wgADkKACATgwgBoBwgOAF9NIPAA5P8AvIBCCAD////wMLGhgwz3CAAGRd +AIgA3oDgxaUK9M9woAAsIBCAx3AHACChEqVIFQcQz3AAAOByQMAF2EHAAd9Cx0PG6XAG2QTaANuY +c7hzvg9gBNhzz3CAAGRdwKjkpelwHvAA2M9xgABkXQCpAtkjpRbwBIWB4AHeEfQFhYDgHfTPcIAA +OKUhgM9wgADkKACAqgsgBjhggOAF8gHY0QFv/6TAz3CAAGRdwKhOD2AEBdgA2ASlovEF2Aulig6g +BslwANnPcIAAZF0gqOnx8cA2CU//z3aAAGwGBIaA4G30AoYEiIDgFPLPcIAA8CgAgIDgDvTPcIAA +OKV+CWAPAICA4Abywg/gBgDYTwMAAM91oADIHzyFz3CAAPQoAYBHhgJ5AoZWeAeAEHGF9wHYBKYr +AwAAAIaA4AvyUSNAwAfyAtgVHRiQXg8gDx7YFYXPdoAAbAb+DyAPJoaA4P4CAQAVhc9xgADoKD4M +IAEggQamAoYnhhzgNngFiIYg/4wJ8s9wAAAwQ89xgAAQKQoNAAQChieGHOA2eAWIUSBAgLoCAQAA +hoDgBfIfhYDgrgICAMoMAASnAgAABIaB4JP0JIZSD2AGiiBMCs9xoAAsICOBQg9gBoogTAoChieG +HOA2eAUQhgAA3VEmAICvpj7yz3KAAPQoz3CAAJA6eIAkgHlhz3OAALyk/IO4qlwQBAAMEAUAACUF +AXQTBADieQIlBQH6gyQQBAACJMSDe4MFgGJ4yidBEwTyAd/4qoDhD/JALIMAcHGF908ngBAF8IDg +BfJPJ0AQD38YqkEpwAA4YLBwRPeCv/iqUSZAgC3yAIaA4A7yz3GgACwgJoEOhiJ4z3GAAPQoBaGg +pgbwAYaA4ALyoabmCwAEVg4AD4LgEvLrdU4OAA8MFgQQuHDPcAAAjAwKIcAPqXKVB2AAiiPTCFIO +IA8A2AKGJ4Yc4DZ4BYiGIP+MBPIC2ASmwfAE2ASmvfAEhoLgDPTPcAAAMEPPcYAAECmiCwAEBNgE +pgSGhOCw9CSGDg5gBoogTArPcKAALCAjgM9wgAD0KEAgEAc3oPINYAaKIIwNIoYcFgQQQCEABxYg +AAEFiFEgAIAA3R7ySiTAcKlyqXOoIIAB8CDAIAHjGmID30okQHEA26gggAHwIMAjAecbY1BzyPfP +coAA9CgYioK4GKrPcIAAOKWjoEyRQCRAAFBwB6ZH94YRAAZRIECABvIB2C4N4AYMpl/wbgugBguG +C8gEIIAP////AwsaGDCqCaAIq6aKIEwNVg1gBoohVAsHhiKGFnmKIEwNQg1gBieBAtgDpgKGz3KA +APAoJIiA4Q/0J4Yc4DZ4JIjPcIAAvCAaiBBxAdjAeACiLPAggoDhBfIB2AOmJvAnhjZ4HBAEAM9w +gAA4pQQYAAHPcIAAmJcEEAUAz3CAABDOBYAFKH4BQCmAcpBwyiLOB8ogjg8AAI0MyiOODwAARQX8 +BW4AyiHOD6SmEQYv/wHYDBYEEBAWBRAKIcAP63LPcAAAjgzZBWAAiiOVA/HAz3CAAPAoAICA4Bby +z3CAABwuAICA4BT0ngoABoDgC8jFIIIPAQAA/Ar0BSCADwAAADwLGhgwC8iQuAsaGDBSDAAG0cDg +fvHARg0P/891oAA4LgeFz3EAABQsqLgHpfoI4AYN2M92gABcLzCGB4UleAeliiAVDB4MYAaKIYsK +iiAVDBIMYAYwhs9wgABoIyyQz3CAAMgdHpAA3xBxC8jwpgvyBSCADwAAANQLGhgwC8iQuAXwBSCA +DwEAAPwLGhgwJglP/0oL4AAC2CkFD//xwJoJwACG4BT0z3GAAJiliiCVB7ILYAYogc9wgAB0WuYM +wA4aC+AACNi2COAGCdjRwOB+8cBmCcAAiuAU9M9xgACYpYoglQd+C2AGKIHPcIAAdFqyDMAO5grg +AAnYggjgBgnY0cDgfvHAMgnAAIfgFPTPcYAAmKWKINUHSgtgBiiBz3CAAHRafgzADrIK4AAF2E4I +4AYJ2NHA4H7xwP4IwACL4BT0z3GAAJiliiDVBxYLYAYogc9wgAB0WkoMwA5+CuAAAtgaCOAGCdjR +wOB+8cBr2PIKYAaKIQcFCgigAATYCiUAgMohwg/KIsIHyiCCDwAA3w7KI4IPAADXAQQEYgDKJGIA +0cDgfuB48cCuCw//z3GAAPw8CYEB4Amhz3GAAHQcAIEB4IHgAKEQ9AHYz3WgAMgfUR0YkCDe0KVD +HRgQANiKDOAQjbjRpc9wwABHaM92oADsJwamz3GAAFQyBIGB4BH0BoHPd4AAVLBAeBiPgOAX9M9w +AQAGAQamz3ASAAYEFvAKIcAP63LPcAAAhxmKI0UASiQAAGkDYAAKJQABz3ABAAcBBqbPcBIABwQG +pmCHz3IAAAIzgOPPcQAAgkwDhxnyRCh+AwAhjX+AAOxmxtiSuAamz3A5AAIzBqbPcDkAgkwGps9w +OQACZgamx9iVuBLwRCh+AwAhjX+AAKRnx9iSuAamRqYmps9wAAACZgamxtiVuAamXg5ABwHYz3Gq +AOAHE6EYj7YJYA0gh89wEACHcgamAY0QuAUggA8AAEJyBqYFjRC4BSCADwAAQnAGpgSNELgFIIAP +AACCcAamA40QuAUggA8AAMJwBqYCjRC4BSCADwAAAnEGpgmNELgFIIAPAABCcQamCI0QuAUggA8A +AIJxBqYHjRC4BSCADwAAwnEGpgaNELgFIIAPAAACcgamC40QuAUggA8AAIJzBqYKjRC4BSCADwAA +xnMGps9wAQBGagamz3WgAMgfpBUQEM9wgAAGdAamz3CAAAd0BqbPcIAAxnMGps9wQABCdAamz3CA +AMdzBqbPcAIARmoGps9wEADGagamWI8AjySPgOIB2sB60ghgEHmPJNgY2cYK4BAz2oHgE/LPcIAA +/DwkEAQADBcFEAohwA/rcs9wAACKGa0BYACKI0YPz3AQAMdqBqbPcBAAhnIGpgoPQBAKDkAQJNgB +2X4K4BAz2oHgE/LPcIAA/DwkEAQADBcFEAohwA/rcs9wAACqKGUBYACKI4cCpBUAEM9xgAD8PAIg +AAQIoc9wAgBHagamz3BlAMJuBqbPcIAAdBwAgM9xgAB0HEIgQIAAoQX0ANhRHRiQPQEP/+B44cUB +289ygADIBX6y4HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB4 +4HjgeOB44HjgeOB44HjgeAa4RSDNAM9woADsJ6agCoAA2wCxfrLgf8HF4HjxwIogygZyDyAGANnm +DoACogjAEC4OgBCA2c9woADQGzCg0cDgfuB48cAyCA//OnAacUojQCCgkCfwinUl8BUhwCQAEBQB +AhASAUAjUyAMJICvAAD7/y8jyCRx9td1AAD//x7yTCAAoMwlgZ8AAP7/FvJMIECgzCWBnwAA/f8Q +8kwggKAI8s9wAAD7/xB12fUdAA//13UAAPz/9/XPdoAAdBwAhgHggeAAphL0AdnPd6AAyB9RH1iQ +INgQp0MfWBAA2L4I4BCNuCDYEadALIAhTyBBAEAqACQleM9xoADsJwahAIZCIECAAKbP9c9xoADI +HADYEaHJ8fHAz3CAANgxAICB4Mohwg/KIsIHyiCCDwAArxPKI4IPAADLAcokIgCQByIAyiUCARoI +AADRwOB+8cCOCwAQIg0ADdHA4H7gePHAFg/P/s9wgADIHQOAocEogM9wgABEp89yDwAA/MC5Nnhk +gCCACrvJuUR7JXvPcacAFEhtoWWAAYAKu8m4ZHpFeA6hz3KAANQ5DYqGIP8BO2jPcIAAXJQsqC6K +QCAVA4Yh/wFDuS2oL4qGIf8BQ7lKCGAHLqhAwM9xgAB0HACBAeCB4AChEfQB2M91oADIH1EdGJAg +3tClQx0YEADYog+gEI240aXPcAgAhxDPdaAA7CcGpUojwCBKIAAgCiIAJAohACQyJZQkTCQAoXoA +CgAA3hTwQCCAIRB4BriBuBC/5XgGpUAhgSEweQa5gblALQAEJXgGpQHmz3CAAFAuIIBgeQbYEHbM +AAYAESSAo/XzinAaDuAEyXHYcIpw7gzgBMlxmHBALkABEHgQuIG4h7iMuAalgOYX8oHmGfSKIcQG +iiCECBHwCiHAD+tyz3AAALATiiMJDQokAAUZBiAASiUAALbZvdgacTpwAN8E2Z9xuHeoIMALYbkA +IQMEcHsAFAYwQCwCAQa7gbtALoABGmI1esdygACApwKSHHgQuGV4BqUCksC4OHjleBB/Y5IAIUAE +EHgGuHx7gbgQu2V4BqUDksC4OHgFIEABLyUIAITxQiNTIEwjAKDsBu3/QCJSIM9wCACGEAalz3CA +AHQcAIDPcYAAdBxCIECAAKEG9M9xoADIHADYEaFdBe/+ocDgePHAatgiDCAG+tkA2I249g7gCwYa +GDAMzIYg/4oI8s9wgADoNwCIgODUDAIE0cDgfs9xAwBADc9woACoIC2gz3GAABAIQIEBagChz3Cg +ADguBYAEIIAPwAAAANdwwAAAAArySNjPcZ8AuP8aoVuhadgYuBmhz3KAACRWBYIDgCCAx3EAAIgT +VQWgDkhwCHLPc4AAPFYFgwOAIIDPcKAAsB8bgNW4GWEQ4WhwMQWgDkJ58cAIcc9wgAB8L1CIz3CA +ABYvRCo+CzIgQg7nugnyxroKus9wgABcWgINoA5ZYdHA4H7gePHA4cXPdYAApFoFhQOAIIDPcIAA +fC9wiFKIRCs+CwAhgH+AABgvVXhAkKlwCrrKDKAOWWGKIJUKCgsgBiKFdQTP/uB4z3CAAFQvUJDP +c4AAjFoig2hwCrqdBKAOWWHgePHA4cXPcIAAfC9QiDKIz3WAAKRaRCo+CwAhgH+AABgvNXhAkCKF +qXAKum4MoA5ZYYoglQquCiAGIoUZBM/+4HjxwI4Lz/7PcYAAuF4hgaPBQsHPcYAAyB0VIRAAABAA +ILYQDgaA5i8ogQNOII0HV/IVbQAgkQ+AABDGBhGAIM9xgACQyBZ5AIEikY7lCBxEMMogYQAF8oty +ggov/wLBgOA28gDYz3GAAOgGQIEPIEADLyIKIAQigKAAoQf0gOLIC6IHyiAiCK94bgsgBBDZAN8E +GcQjiiEIAAAZQCCpcOlxGgqgBg/aABACILYSAAYEIIAEthoYAM9wgAAQybZ44KDhoM9wgABwxbR4 +4LAQJk6TLyiBA04gjQes9RED7/6jwPHA4cUIdQTw+gqADl4LoA6pcIDg+vUdA8/+4HijwUDAQcEF +FIEwANiB4ULCDfKC4Qfyg+EN9CHBANgPIEAAAxSBMA8gQAACFIEwDyBAAAYUgTCB4Q7yguEH8oPh +D/QhwQPhDyBAAAMUgTAD4Q8gQAACFIEwA+EPIEAACRSBMIHhDvQCFIEwCrlPIQIEAxSBMAy5JXoh +wQ65RXkleCDBgeEI9AcUgTAiwga5CLpFeSV44H+jwKPB4cVCwQkUgTBDwoPhQcAA2Ar2gOHI9goU +gTCA4cT2g+HD9gHYBxSCMAYUgzBQcwbyIsEwc8wiQoAD9AHYIcWB5RD0ChSBMCPDcHFK9gsUgjBQ +ccwjqoCE9oDiyiBpAIHgDfSKIckPz3CAAEAHIKCB5f/ZyiEiACGgwcXgf6PA8cCGCc/+z3aAAMQH +ABYFEEwlQII8AAYAz3eAAMxbAIahhgi4IIcFfTB1CfIQuYogSwVeCCAGpXmgpyCGz3CAAIBq8CBA +AEB4gODr86EBz/4KIcAP63LPcAAAhidj220BIABKJIAA4HiiweHFQsFBKAICB3pBKAEER3nPcoAA +kMXGuSpi57oS9AgUAzHPdYAAkMipcVZ5QIFQcAX0QpFwcgbyR4nnuvfzgNgD8AaJwcXgf6LA8cDW +CO/+uHBKJEAAkODKIsoHyiCKDwAAzhvKI4oPAAD8APQAKgDKIcoPQC1DAcdzgAAQxsaLjCYCkADY +DfLPcIAAkMgWII0DoIWgoSaLNngCkACyiHDtAM/+4HjgfuB48cAIyJW4CBoYMAnIm7gJGhgwC8iK +uI24kLgLGhgwz3CAAMgdA4AYiIHgDPQLyM9xAABILqy4CxoYMAYMYAYP2GfYOg/gBYohCADRwOB+ +4HjxwOHFCHU+iM9wgADoE0CAQCUAFAO5NXlZYaIPYA0K2o4P7/+pcHUAz/7gePHA4cXPcoAATDmE +EgAAgBIBAM91oADIHyR4LykBAM9wAwBADUUdGBDwIkAAQHiA2BUdGJA5AM/+8cClwUHAQsEMHAAx +EBxAMc9xgAD8kjQZwA8wGQAPLBnADigZgA4kGUAOz3CAAPySIBhAC89wgAD8khwYAAvPcIAA/JIY +GMAKz3CAAPySFBiACs9wgAD8khAYwAjPcIAA/JIMGIAIz3CAAPySCBhACM9xgACAkoAZAAh8GcAH +eBmAB3QZQAdwGQAHbBkAB2gZgAZkGUAGYBkABlwZwAVYGYAFVBlABVAZAAVMGcAESBmABEQZQARA +GQAE76HOoa2hjKEsGcACKBmAAiQZQAIgGQACHBnAARgZgAEUGUABEBkAAWOhaiAAA9gZAABqIMAC +1BkAAGoggALQGQAAaiBAAcgZAABqIAABxBkAAGogwADAGQAAaiCAALwZAABqIEAAuBkAAGogAAC0 +GQAAaiCAAcwZAABAwwHAAsFTJ801DBQGMFMlxDVTJsU117qpcyoM4AUQFAcwANnPcKAAtA88oM9x +oADIOy6BXg3gBX3YugqAA9oO4AAA2AjYANlKDiAGmbnPdYAASC4ghWB5ANiO4AbyIIVgeQDYiuAJ +9M9w4ADEMQDZpg0gBpa5nQSADeB48cDPcYAAeCkAgddwAIAAAAX02gwAAtHA4H4AgddwAEAAAA30 +z3GgALAfO4HqDOAFiiBMDDYMAALv8e/x8cDWDY/+z3KAAHgpgOHPdYAAWF0O8gCiAIWA4BP01glg +Bg3Yhg5gBwjYAdgApQvwAN7AopoJYAYN2EYOYAcI2MClAQaP/uB4z3GAAHwtAIEc2s9zgABsBkCg +QoNVIsAJAaGgEgAAjbigGgAAz3CAACQIpBoAAJwSAAFngwShVSJADQOhQCIAB3Z4BYig4Az0z3CA +ALgGAJBIdIAkRBMArB7bA/AY22KhVSJADXhgBaFVBaAMKHDgePHAGg2P/s9wgABIBkCAz3aAAOAP +oIYEIoMPDwAA4AQjgA8BAAAAMmhkeSd9oKaYdQQijg8AAABAz3WAANwP4IUDvmR+HXjHf+ClBCEB +AQQigg8AAACARXgGI00AArgEI4MPAgAAAOR+BHvGfQYlwBAvKAEATiBBBM9wgACMb/AgQgDPcIAA +yB3wIIAAtRAABlMgQIAVGlgwAdop9IbhGfTPc4AAHLEJk4DgDPIVGpgwSHHPc4AAgDwXgwHgF6MX +8AyTgOAT8gTZFRpYMPPxhOHMIWKAC/TPcIAAHLEOkIDgBfIG2RUaWDDl8c91oAAUBCqlz3OAAGwH +YIuB4wDYBfRphbjjgvcB2IDgCPTPcKAAiCA1eECgE/DmDaALBhqYMJoPQAWA4Av0ANmRuc9woADQ +GzGgVg3gDgHYSQSP/uB48cDaC4/+FRoYMM91oADUBxodGJAfFQCWAd4BGhgwBBKFMEwlAIfKIcIP +yiLCB8oggg8AAOscyiOCDwAAZAHgA+L/yiSCAxkVAZYD2CAdGJAUHZiTDxUDlgAWAEAAFgBAABYC +QQAWAEEAFg9ADx3YkPS/ViIAAhB4A/IC4BB4A+AEIIAPAAD8/xBx0PcWCIAFgOAq8s9woACwHx2A +1bjXcAAAABRAAA0ADxUBlkDhHh1YkB0VAJYeHViQrbgdHRiQ4g9ABYDgBfLODU//DPALyAUggA8B +AAD8CxoYMAvIrLgLGhgw2gygCwYamDNVA6/+ANjgePHA4cXPcIAASAaggGvYBCWNHw8AAODaCeAF +iiEHAS8oQQPuDu//TiBABAolAIDKIcIPyiLCB8oggg8AAN4OyiOCDwAAyQHkAuL/yiRiAH/YCrjP +caAA0BsToX/YEKEBA4/+4HjxwHoKj/4IduyICJDPcoAA4Ae1bwhzhiPzD0IrEQLHdYAAEMZghe27 +SHED8iRq67iKIMMvA/QeFpAQTY5RIgCAo/LjuDz067sU8v/YB61KJABxANqoIEADSGEAIoMPgACQ +zfZ7BKtIYQHiT3oAq17wTCEAoY/2CiHAD+tyz3AAAC0liiMLBEokQAA9Au//CiVABO64B40yIUEE +ACGCL4AAkM32egjyJKoE2QApQQQleAetPvAgqg8gQARk8EwgAKSV9owgw6/KIcIPyiLCB8oggg8A +AC4lyiOCDwAA5ALKJGIA5AHi/8olAgR6Ce//yXAIlu64BPICjgmtBPABjgitAIXruBfyANpHrUok +AHHPcYAAkM2oIIACOGL2eAQYAgQAGAIEAeJPegGOCK0CjgmtK/BMIQChyiHKD8ogig8AAC8lyiOK +DwAAAQM+B+r/yiLKBwiWACGBL4AAkM3uuAeN9nkK8gQZAgQE2QApQQQmeAet3vEAGQIEANkPIUEE +JngHrQGOCK1VAY/+4HjxwPYIj/7Pc4AABAdhg3lhz3OgAFAMYIPHcwAAACAie8y7cHDE91EjAMD0 +81EjAMDKICIAHvSB4hv0z3WgANAPEBUDloDg0/fPcoAAHBWfcCOCqCAAAwKKJRUPlsG402jYfwHg +AqrneSOiEB3YkAHY7QCP/vHA4cWswc9xgAAEJgqBz3WAAJilobgKoQKVIZUQuAV5AhxEMDC5BBxE +MCiFAtjPcqAAyB8TohqCSMFJwBuCSsBKD6AFiiDVA89wgADsByCAiiDVAzYPoAUiiQiF4LgI8lEg +wIE8DCEGyiChBc9wgAB8LzCIz3CAABQvRCk+CzQgQA5RIACByiABB8ohIQzKIoEPAACQAMojoQd8 +DmEMwCshBlkAr/6swPHAqgkgAAHYz3CAAGQuIIDruQ/yz3CAAMgdAIC6EAAGUSBAgQXyUSGAggfY +AvIF2CoOAADRwOB+8cDhxQvIkLgLGhgw7guv/qTBz3CAAHRaJYAjgSCBx3EAAAAQOghADgDbz3WA +AGQuSB3YEM9wAABwHEDAAthBwAHYQsBDwwbZBNqYc7hz2HNWDaADiif/DwCFi7gApUILIAYJ2LUH +b/6kwOB48cDhxQvIkLgLGhgwgguv/qTBz3CAAHRaJYAjgSCBx3EAAAAQzg8ADgHZz3WAAGQuSB1Y +EM9wAADYHEDAAthBwELBANhDwA/ZBNoIc5hwuHDYcOoMoAOKJ/8PAIWruACl0gogBgnYSQdv/qTA +8cDhxc91gABkLgCF67gF8gGFguAK9AvIBSCADwAAADwLGhgw/gqP/s9zoAA4LgeDw7iP4A/yHBME +AAohwA/rcs9wAADBG4ojxA3FBq//SiUAAM9wgABcIxSIieAN9DYLQAWA4Anyz3CAAKRaBYADgACA +KgjAAAGFguAL9M9wgAB0WpIOAA7GDCAAANgE8DoKIAYJ2K0GT/7xwCoOb/6KIhUFOnCB4M93gADI +HSCHAd3CJUETgeAk4QHYRmHAeCGHRCa+kSThQ2EE9EQjvoES8gohwA/rckArDQTPcAAAyxuKI4YD +CiRABCUGr/8FJYUTz3GAAGgjXpcskVBxB/TPcoAAVLBBglBxGfIiCgAAwgkgAKlwggkAAPAnQBO6 +EAEGqXAlud4OoADAueYPgA4LyJC4CxoYMO4Jj/5+DSAQAdjPcIAAjG+goKKghgygCQDYfgygCQLY +z3agAMAvqRYAlqsWAZYA3SV4BCCAjw8AAPwadRjyLykBAE4hgwfPcaAADC3wIcEAANpRIQCCDyLC +AAP0RX0D8AUgkCAGIICA7PXPcIAAaCMskB6XEHEM9M9wgABkLgCAhiD/gQb0fg8ABYDgKfRMIUCg +CvSlFgGWTyAAIYa4BnmlHliQEPDPcIAAaCMskB6XEHEI8qUWAJZFJUERJnilHhiQTCFAoAjyz3CA +AGgjLJAelxBxBfKmCmAQBdhMIUCgCPRFJUARpRYBliV4NvBPIAAhz3KAAFwvMYKGuAV5ANgRogGH +thANBoDlLyhBA04gggcf8o7iyiQidMogIgDoIKIEACCPD4AAEMYQ53Vqb2eMJ8OfyiMiAM8jwgPG +IcIAAeAQJY2QLyhBA04gggfj9aUWAJYleKUeGJCRBE/+8cA2DE/+z3GgACwg5oGwgc92gABcLw6G +AiUCEA2GEHJE90J4BqEG8ArYBqEWCQAG7aZtBG/+rqbxwAIMb/4D2s91gADIHRV9AIXPcYAAeKZ+ +CyANgCADAYogUwLiCqAFiiEIAgDeC/CELgQflSDCDydwNgugDMlxAeaC5gCFtveAIAMEz3GAAJg6 +RgsgDXjaFQRP/vHA4cXPdYAAyB0VfSCFz3KAAHimSHCAIQMBIgsgDQPaIIXPcIAAmDqAIQMEDgsg +DXja6QNP/uB48cChwc9wgADAXgCAjg4gBkDAi3AE2b3aHtvmCWAMGLtGD+AFCdihwNHA4H7gfuB4 +z3CAAFwv4H8PgOB4z3CAAGwv4H7PcIAATAfgfwCA4HgVB+AFCdjgePHAEgtv/gDYSiSAcOB4qCAA +Cc92gABgMFDcAiYBE1NoVHpZYc91gAAMWwDbYKEF3+Shz3cBALDw46GloUImARg6YmCiBtkkos9x +AQBE8SOipaIB4CUDT/7xwLoKT/7PcIAATAfAgM93gADJWwCPz30QdQjyiiAVA6IJoAWpccCvz3CA +AEBi8CBAA0B47QJP/vHAUgzv/wDYz3CAAGQuAIBRIACAC9jKIKEA6ggAANHA4H7gePHA4cULyJC4 +CxoYMKoOb/6kwc9wgAB0WiWAI4EggcdxAAAAEPYKAA4C2c91gABkLkgdWBDPcAAApBxAwEHBAdhC +wADbQ8MG2QTamHO4c9hwEgigA04gBwAAhYC4AKX+DeAFCdhxAm/+pMDgePHA4cULyJC4CxoYMD4O +b/6kwc9wgAB0WiWAI4EggcdxAAAAEIoKAA4D2M91gABkLkgdGBDPcAAADB1AwALYQcAB2ELAANhD +wA/ZBNoIc5hwuHBKJkAAog9gA04mBwAAhaC4AKWKDeAFCdgBAm/+pMDxwIYJT/4Ids91gABMB4og +lQJ6CKAFIIWKINUCwKVuCKAFyXHNAU/+8cALyAUggA8AAADUCxoYMKINT/7PcYAAZC4Agee4B/Kn +uAChVgvgDQDYz3CAAFwjFIiJ4An0z3CAAKRaBYADgACA6gqAABIN4AUJ2NHA4H7xwAHZz3CAAFwv +KaDPc4AAjFoFgwOAIIDPcKAAsB9dgGhw1bqiCSAOWWHPcIAA7AcggASJoLgEqdHA4H7Pc4AAjFoF +gwOAIIDPcKAAsB9dgGhw1bpxASAOWWHgeOB+4HgocgkAIAAA2eHF4cZAKQ0CJX1ALQMUiOKlewh1 +kPdTJX6QBvIBHVIQYbr78UEqjgDBukImTpAEHdAQ/fWA4gryLySJcOB4qCCAAQEdUhDgeMHG4H/B +xeB48cDhxc91gAC0oCCNjCHDjwrygOAG8s9wgADsV34IAA7/2ACtz3CAAFygANk1oM9wgAAYFSCg +z3GAABwuAIGiuHoPYAkAoQDYOgqv/whxfQBP/uB48cDhxQDdz3CAAMwHoKDPcIAAHC6goM9wgABM +pal0nbAwvJ6wGg+gA6lwqXC2CiAIqXFFAE/+4HjxwMIPL/4G2BUSDjYBEhA2FRoYMM91oAAUBAql +CYWA4AcSDzYn8gPYEKUEpc9wgACg0HYKoA4DGhgwktkDyJC5oBhAAIoKoAMA2AmFgOAP8igVBBAk +FQUQHtgKIcAP63KMuKkHb/+KI4QEBxrYMwEaGDTKpbEHL/4VGpgz8cDhxQh1QgvgBRLYz3CAAMgd +AIC6EAAGJbiiDqAAwLjWD+AGBNjmCWAMqXBeDcALgg5ACYogCwAaDmAFqXGFBw/+4HjxwAoPD/6h +wQh1KHaKIEQP/g1gBalxguXI96lwyXH2Da//ANqA4AT0E92E8M9yoABQDAWCz3aAALylEq4FghOu +CZaMIIiAKm1F8hL2h+Ah8owgxIFo9ILhLPTPcoAASJqmDG/+QCIAAkhxIPCMIMiASvKMIBCAWPQF +gglpheAE8gDdU/BiDGAGANkIdU3wgeFI9M9ygABImm4Mb/5AIoACC4qBuAuq7vELiYC4C6nq8YHh +OPRSDG/+i3AgwM9xgABImlMgAgCGIH8PSKkceAmp7PGO4Sb0z3CAAMgdA4AYiIHgIPLPcoAAfJdI +cBoMb/4G2UAiAAISDG/+BtkMkoG4DLLA8YThDvTPcoAAfJdAIgAF9gtv/gTZDJKAuAyysvET3QPw +HN2KIEQP5gxgBSmWqXBFBi/+ocDxwM9wgAB8lwyQ4LgE8uoNQAMG8FEgQIAYD0IDz3CAAEiaC4iB +4AjyguAJ9PYNQATRwOB+Cg9ABPzx/PHxwJYND/62CgAFgODPdYAAZC4A2Q70BBUEEAohwA/rcs9w +AAC9G4DbrQVv/0olAAAAFQQQUSQAgsohwQ/KIsEHyiCBDwAAwxvKI4EPAACDAIQFYf/KJSEAUSRA +gs92gABcIzP0z3CAAHwvMKgB2lGoUqgK2LIdAhAC2LMdAhAUjrAdRBCH4MwgIoIM9IgVABd0uBB4 +tB0EEBTYuB0EEAfwZNi0HQQQuB1EELYdQhC6HYIQViWAFVUlwR1yDOAMC9oAhYm4AKUB2EoL7/8B +pa4Jz/8UjonghAhB/89ygADIHQCCiiEVBSTgIGCGIH+OC/QBgiTgIGCGIH+OkAqhDcogIQDPcaAA +OC4Hgai4B6EUjofgBfR2C8//B/CI4AX0ZgnP/6YLz//dBA/+4HgIczhg1bvVuTBzNrjE9wIjQgAK +8M9ygAAQzkWCAeDJuCJ6emIWuOB/RXjgePHAOgwv/phyCHXPdoAA1Jr0JkAQz3eAAFSaUSBAgsog +QQDKJCJ0yiAiAOggYgL0JgIQUSJAggPyAeCQ4EYABgAtu8C7z3KAAHDFtHpAK4UCYJIEvYYl+BOJ +vQ8jQwBgsgDaFn9Ap0Gnw7mleQUhQwEUfmC2z3GAAPSaFXkAGQABAvCA2B0ED/7gfuB48cDhxc9x +gABkn0GJz3WAABgVgOLPc4AAHC4ggwbyAdgApYK5IKMJ8ADaQKWiuYDgIKPkCkIJANimDW//CHGa +CaABANjhAw/+8cDhxZhwA8igkAGAQOX0uMAlohAD5c9zoADUBw8TAoYEJY0fAAD8/5BygHVH9xXI +FSIBMBYRAAYaYhkTAYYCJYAQMHDX94ohDwrPcqAAyB8+ohDZLqIB2RUaWIAE8FEjAMAP9M9xoADU +BxkRAYYwcDf3z3CgAJgDvqBlAw/+CiHAD+tyQ9iMuM9zAADEFR0Db/+4dfHAqgoP/qnBz3CAAJDO +ABAVAA3MAN3PdqAAyB9RIECAz3CAAJDOQYADyA/yoBYBEPgWAxBiegIhlwB2EAIBLyfIJTpiBPCE +EBcB4nI6GMQFH4YQcsX3UHheD6AFAtkB2c9woADUBzSgM6AD2S2gERAAhs9xoADUB0DAQOAPGRiA +FBlYgwPIpBABAFEhAIIG8rIKwAsDyATwRx5Yk89xoADUBw0RAoZALwEkUHpFebgQmAByEAIBeYAC +IhIGuhACAQQQGQBBws9ygABwsEaCABARAYHiAdrAegy6QsLPcqAA1AeIGsAApBACALmgt7qkGIAA +USGAtbgYQgO6GEQDCPLPcqAASAhAIQAjB/BAIQAhz3KgAEwIAcMCxwNw5XsFI1MAJ2jPcwAA/P8k +e89xgACQziOBCCNBAM93oADUBxWnABrABAIhgCQPpwIhwgBbpwPaUKfPcoAA8DcVEgM2AIJwcB7y +z3CgADguBYAEIIAPwAAAANdwwAAAAA7y9dgFuM93nwC4/xqne6dp2Bi4GacB2APwANiB4AL0YKIH +yAIlVSDPcYAANKcEIIAPAQAA8Cy4AxIPNgSxD4euqQChQBcAEQKxEI9gFw8RVGjDv+V6D6nPcIAA +kM4BgEaxz3eAAJixQCcEGXV/EHnPcoAAHLFph1YixQJ5YSmnpBYBEDhg+BYBECJ4Q8AB2M9xoADU +CxChQSlANcC4F7gAIIEPAA4AAM9wgACQzgKAArgr4AQggA8AAPz/JXjscQChARIBNuxwIKDPcIAA +kM4igOxwIKgVyBQiAQAwiexwIKjscKCwFcjwJQEA7HAgoBXI8CQBAOxwILDscKCw7HCgoOxwoKAH +EgE27HAgoAPIIJBUEAABELkleOxxAKEDEgM2AYNRIACBD/Iyi3CLz3CAABDIdngAiIYgfwwceAS4 +JXgC8IDY7HEAqQPIAN8wiDMQgAAEuQV57HAgqAPImnc8kOxwILADEgM2z3CAAIRbnBMBAW+DJrnA +ucC7DLkNu2V5IKAVEgE2GncAIYAPgABEsaCoz3CAAMiwNng0eqCyApDAGkQDFSRBAKCheBoEAM9w +gADIHQSAGpDQGkQDRMDPcIAAkM4igIDhqAMuAMolzhPpdul1TCAAoLjyAYDPcaAAyB+WIEEPHqEQ +2A6hAdgVGRiAFPDPcaAA/EQdgTmBBCGDjwAAAAgT9AQgvo8ABgAADfRRIwDAKfTPcKAA9AcHgP+4 +6vNKJgAALvAA2vq4yiKCDwAAAQLYcvm4yiaCDwAAAgL8uMomgg8AAAECgOMK8s9ygACAPGWCiiYI +AgHjZaKyCMAPEPAB2M9xgABQWzYOIA4Aoc9xgAD8PAKBiiYIAgHgAqEFJY2R7gICAM9xoADUBw+B +EHgZEQKGWOBQcNX3D4EQeBkRAoZY4FBwxfeEEQAAsuA29w+BEHgZEQKGWOBQcGgADQAeGZiDHREA +hgcaGDAdEQCGSMAdEQKGBMhAoB0RAoZBoB0RAoZCoB0RAoZDoB0RAoZEoFYmABIeGRiAHREAhkAv +ASQQegUiUwAEEgE2hiDzD4wgDIAAEREBBBEZAA7yGtgN8M9xgAAEPAGBiiYQEQHgRQIgAAGhINha +cANwEHhyGQQATCAAoAP0A8jH8FEhgLUI8s9woABICEAhASMH8EAhASHPcKAATAgDcUXAAcBGwQLB +JXgFIxMgBsAH4M9xgACQziOBBCCADwAA/P8IIFYADCZApVoALQBHwFEgQMMw8s9wgACQzgGAz3Gg +AMgfliBBDx6hENgOoQHYFRkYgKIOoA9B2FEgQMMc8gHZz3CAAFBbIKDKDCAOAdjPcYAA/DwCgQHg +AqGKJwgSN/DPcYAABDwAgYomEhAB4AChvPDPcaAA/EQdgTmBBCGCjwAAAAgH9AQgvo8ABgAAGfIA +3/q4yieCHwAAAQL5uMongh8AAAICgOIK8s9zgACAPEWDiicIEgHiRaPGDoAPB/AD2c9woAAUBCWg +AN8FJc2TivQB2M9xoADUBxQZGIBVJkAUDxkYgFEiAML+9QbAz3GgANQHFaEFwgIhgCQAGsAED6EH +wgImgCAboQPYEKEowJzgCMeW9APIqXHIuQIllSUIiAy4JXgDEgE3ELkleOxxAKFAJFQgARrYMwTI +AxIBNgDfQMYDGhgwBBpYMCGAAJAAxjS5wLk0eAPgQOYEIIAPAAD8/x5mFRIBNgbwFSJAMBYQAAYC +fhUiQDAWEAAGEHZ39wPMz3GfALj/GKHPcKAA/EQ9gAQhvo8ABgAAX/RMIACgC/IEyFCIUyLBAIYi +/gNEusQYggAwqM9woADUBxQY2IMHyM9xoABILB2hz3CAAJDOIoBAIFAgEnFoBM3/AN4E8ADfqXZT +Jn6Qg/RRIEDDUPLPcIAAkM4BgM9xoADIH5YgQQ8eoRDYDqEB2BUZGIDGDKAPQdhRIEDDOvIB2c9w +gABQWyCg6gogDgHYz3GAAPw8AoEB4AKhiiYIAlnwCiHAD+tyPNiMuM9zAAC0E0okQAC1Ay//uHdM +IACgiiUQEAn0B8jPcqAASCyKJQgQHaL6uc9xgAAEPAfyAoGAvQHgAqGx8QOBgb0B4AOhrfHPcaAA +/EQdgTmBBCGDjwAAAAgH9AQgvo8ABgAAGvIA2vq4yiKCDwAAAQLYcvm4yiaCDwAAAgKA4wnyz3KA +AIA8ZYKKJggCAeNloqoMgA8J8APZz3CgABQEJaBKJgAABSWNEYDlF/LhvQzyA8gpiAHhKajPcYAA +BDwDgQHgA6EK8OC9CPLPcYAABDwCgQHgAqGpdgPIqXHIuQiIDLgleAMSATcQuSV47HHJdIQkApEA +oUAkVCAV8s9xoADUB4AZQAUDzMlyyLoQuEV47HIAouyhAdgUGRiAhgygD0AkVCADEgI2khIAAeq4 +BBIBNgb0khEDAVEjgII28qq4khoEAJIRAAGquO4IoAiSGQQAENnPcKAA0A8QGFiAJBAChs9xgACg +1CWRUHoCuUV5DBhYgBTZEBhYgM9xgACg1GeRRpEY2RC7ZXoMGJiAEBhYgM9xgACg1GmRSJEQu2V6 +DBiYgAbwz3CAAKDU6qjPcqAA1AvwooDmXfIG8AjZ7HAgoEAkVCDPcIAAkM4CgJJwN/fPcIAANKck +kJThwCGGDwAAkwDPcKAAaCzwIEEAz3CAAIRbAIAleA2iA9jPcaAA1AcSoX4IgAtRJUCSBvIKDq// +AMAK8APZz3CgANQHExhYgBQY2INMIACgEvLPcKAALCAwgAPAMHAB2MogJgAEIIFPIAAAAIDgzCEh +gPHzz3AAKAgABhoYMATAdg1gBQDZUSZAkLTyz3CgACwg76Cu8M9wgADUORKIUSAAgBzyUSAAwxjy +z3GAAMgdI4HPcIAA1DkPiBC4MiGBDwAAsAKfuIDhAdnAeQ+5JXjPcaAA/EQNoUwlAKAM8s9woAD0 +B2AYQAXPcYAABDwAgQHgAKHPcIAANKckkJThwCGGDwAAkwDPcKAAaCzwIEAAz3GAAIRbIIEA2s92 +oADUByV4z3GgANQLDaFMpoogBAJ6D+AEqXGCCiAOBMAZFgCWwOCkAA4ADcxRIECATPID3SAeWJNK +JEAAFB4YkQQSATYAFgBABxoYMAAWBUABGlgxBMqc4MoiwgfKIIIPAADcDsojgg8AAMoKXAAi/8oh +wg8ocJ4M4A4O2Q8WAJYEEgE2tBkEABMeWJMQiVMgwgCGIP4DRLjEGQIAUKnPcBIgAADWD2ADFRIC +NgTIz3GgACwgsBAAAS+BZOAwcMoghQ8SKAgAhffPcAAoCAAGGhgwAN8NzAQggA8AAAIIguAJ9AQS +ATaKIAQAbgggCZgRAQAVEgE2z3CAACyxNHjgsAPIHgkgBxqQlQev/anA4HjxwHYPj/0Id89xgABI +DQCJAN6A4KnBQMZH9AHdoKnPcYAAgLzPcKAAzCstoADYj7gLGhwwFRqCM04O4AeLcNoIQATPcAEA +qBFBwIog1ABCwM9wgAAsYwCIZMUC3REcAjAAwBIcQjMTHAIwz3CAABA+RcDPcIAAfD1GwM9wgAC0 +WwCAQ8Yg2QHaR8BIx4HAPdt6DaALF7sI2OYOIAUB2c9wgABwKLmgOQev/anA8cDGDo/9CHUacc9w +gADIHfAgQQMA3s93oAC0DyKgI6Dcp0iBUyIAACILIAY0kU4KgASA4AT0RgnADQTwdgnADeoJQAeA +5WAMIQbKIGEAz3CAAHAoGYBRIICABfK2DEAKCvAA2Z65z3CgAPxEIaDgeMGg3KdMIACgwA0iAMog +YgDPdYAAYA4AjYDgBvSKDYAMAdgArZUGj/3xwDIOr/0Icc92gAB8LxGO8I4Qd3zyco7PdYAADC9A +JYITRC8+Gyd1dX1ujYHjEK5EKD4LUvQyIkMOAdoAIYB/gAAYL4HjwiKBAFKuVXhAkIDiFfKU4soh +yw/KIssHyiCLDwAA2xvKI4sPAAA3AcokKwAEBuv+yiULAYDiz3WAAKRaqXAL8s93gABcI/SPieci +9IHjA/QKullhVg5ADYoglQqaDOAEIoWKIJUKjgzgBCKFMI7PcIAAFC9EKT4LNCBADlEgQIHPcIAA +ZC4AgBvyhbga8Gq64fEvcAtiz3WAAKRax3CAABgvCiLAgMoiYgBSrlV4QJCA4qlw0fOB4831zfGl +uM9xgABkLgChz3CAAFwjFIiH4A3yiOAV9M9wgADIHQGAuhAABlEgQIEL8s9xgABkLgCB4rjPIOIA +0CDhAAChZg8AAFUFj/3geM9wgADIHQOAz3GkABxACIDAuBN4wbgSoeB+4HjhxQDaSiQAdM91gABU +ms9zgADMmkhwqCAAA0AjAQIUeUCxFiUBEEChQaEB4EokwHMA2aggQALPcIAAcMU0eECwAeHPcIAA +5AZBoM9wgAB8l0yw4H/BxeB4BfBCecdwQAAAAM9ygAAQzkWCUHE391MgQwVwccAgjQ9AAAAAwCCN +AOB/IngG8GJ5AiCAD0AAAADPcoAAEM5lgnBxN/dTIEIFOmJQc4P3OGAH8AIggA9AAAAAYng4YOB+ +4cXPcIAAHBUgiAHbgOFhqCDyz3KgALAfeaJ+gkKAo4BQdQDZGPTPcoAAMBVAioDiA/QB2grwQYAC +I40A13VMAEBLefchqChygeID9GGgIqjgf8HFoqDv8YDgAdjCIAwAz3KAABwVAKoB2AGqANgCqgGi +AqIDouB/JKLgePHAlguP/Qh1KHdIdoogRw2OCuAEiiGVDZDlifcO2Olxggov/wDagOAD9BPdLfDP +coAAvKVIcGIJ7/0M2c9xgAAcFQCJgOAP8s9wgABssgCQhiD8AIwgAoAF9AWSZJJneAOhQiUAExIJ +4AXJcQolAJAL9M9wgABssgCQhiD8AIwgAoAED8H/eQOv/alw8cAOC4/9z3WAAMgdAYW6EAAGUSBA +gQjyz3CAAFwjFIiI4AjyAIW6EAAGUSBAgaDyz3GAAGyymBGAAIwgAoCY8gOBrgnv/iSBgeAIdhH0 +hg9ABIDgDfLPcIAAXCMUiIjgB/QmDWANAdjuDUAFEfCA5g/0Yg9ABIDgCPLPcIAAXCMUiIfgAtgD +8gDY/gxADa4OgAzPcYAAEM4GgUUgQAEGoQOFGIiE4DXyz3CAALylV4jPcIAAvCAaiBByz3GAAAw7 +BvK+FQAWUSAAgBn0z3KAAAQHAIIB4ACiz3CAACxbANpAoM9wgADIWkCgz3CAAEwGQKARgQHgEaEE +8BCBAeAQoQCFuhAABlEgQIEcCML9z3GAABgVAIGA4AvyANgAoc9xgAAcLgCBorhKCeAIAKHPdYAA +SJoLjVEgwIDcDIL9C41RIICAsAnCA5YPQAP2DkAEgODYDSIFyiCiBc9wgADUORGIgODEDSIFyiDi +BA0Cj/3xwJYJr/3/2s9wgADYqBEYmIAaGJiAAN7PcYAAbAbDoc9wgADsKECgAdrPcIAA8ChAoMyh +0KHRoc+hwKHBoQLdyXfPcIAAzKKELwgYACBCDkqCJ3AAIZB/gADYokYiwgBKoIIJYA1AIAAhYb2A +5SAYgiMB5yf3AtgA2XoO7/0E2lYO4AQB2HUBj/3geOHFz3KAAPAVIIoA3eC5ZNjKIEED4bnPc6AA +wB0GognyDNgAowGCA6ICggSiBPCgo6OipKLPcIAAyB0DgAmAUSBAgdEhooAF8gCDgLgAo+B/wcXg +ePHA4cUA3c9woADAHaCgqXCmCCAAqXHPcIAA8BWjoKSgEQGv/aag4HjxwJIIr/0IcYYIAACA4D3y +IN3PdqAAyB+wpjLYQx4YEADYgglgD424saawph7YQx4YEADYbglgD424saZ/Fg+WiiATBkEvDRTE +vVIPoAT42YogEwZGD6AE6XGKIBMGPg+gBKlxz3GAAAwWAYkB2hB1wiKKAIDlQKnH9gDYDaaB4gP0 +BNgBqXUAj/3gePHAAgiP/Rpxz3eAAPAVII9RIQCASfLPcYAADBYgiYDhzCAhoEHygeAG9M9wgABU +sKGAA/AA3Y7lA/eA5QL0AN3PcYAAVLAYiYDgBPSA5QT0AN4E8KKBBN6KIBMGsg6gBKlxiiBTBqoO +oATJcc9wgADIHQOAGIiD4MwgIoHMIOKBzCAigswgYoIH8oogEwaCDqAEt9kJ8AqXEHUJ9AuXEHbM +ICGgA/QA2CDwAdjPcaAAyB8Noc9wgAAMFgGIy7eqtwS+ELjFfQV9iiATBkIOoATO2YogEwY6DqAE +qXHPcKAAyB9/GFiDAdh9B0/9gODPcYAA8BUE9EAhAAME8EAhAAQAgM9xoADAHVEgAIAAgc8g4gDQ +IOEAAKHgfuB44H7geOB/ANjgfuB44H7geOB+4HjgfuB44H7geM9xgACIOw+BAeAPoRXIx3CAADix +LIgB4S95LKjPcIAA8BUCiBBxyfaKIAgABhoYMIrYkLgH8IogEAAGGhgwQtiYuOB+4H7gePHAhg5v +/STaqcGLds9xgADMXpoIr/3JcM9zgABgMCwTgYDPcIAAFi9EKT4LMiBADs91gABkLlEgwIFaFQAW +FvKB4CTyTgggAADYjgggAAHfAIW23IHBQMeGuAClAiMAAwYNIAwg2gnwgOAQ8gCFAN9Ax6a4AKXJ +cCTZvNoe254MYAsYu1od2BNlBm/9qcDgeAzaz3GAAGAwAuAPeEsZAoAA2EwZAoAvEYCAShmCgCwR +goBNGQKAAeAPeC8ZAoDPcIAAFi9EKj4LMiBADuB/ThkCgOB43djPcYAAmC8MqROJB+APeA2pUNgO +qW/YD6ma2BCpCdjgfxGp8cB+DW/9JNqtwc9xgAC8X6IPb/2EwM9wgABcIxSIh+DMAgIAz3aAAGAw +LBaCkC4WgJDPc4AADC9AI5EDQCPBAkQqPgsncxV7DovPdYAAZC6B4JwCIgAA389wgABoI89zgADI +HX6TDJBwcAf0AIWGIP+BeAIBAEoiACBKcwzwRCo+CwAhgH+AABgvdXgAkAHjACISIEQqPgsyIVMO +cnOx9x4WgJCIFQEXLHgMIkCuCiBALs/3CiHAD+tyz3AAANgbx9sKJIAEDQWv/golAAQKcOoNb/1K +cYDhyiHCD8oggg8AANkbyiOCDwAAyADKIsIH6fVMI4CgyiHCD8oiwgfKIIIPAADaG8ojgg8AAM0A +yiTCBMAEov7KJSIAQg1AAwINYAOYcCCFAiAAAVEhwIBKuIr0AtjPd6AAyB8Tp1oVARaD4SwWgJC4 +cCP0RCg+Cy9wMiECIMdwgAAYLwohgIDKIWIAFSBDALYVARdgkzBzEfQB2YHiwiFBADV4IJC3FQAX +EHEH9BuHXBUBFhBxsPL/2AMcAjBELT4LMiFALi9xx3GAABgvgODKIGIAFXkAkQq4QcBAKoAiOodC +wAAhAAFDwMlxQCTAMIIhQgymCiAMDdrKDe//DdgKDs//AIW23IXBhrgApQHYRMACJgATggogDCDa +hMAk2bzaHtsqCmALGLsD2FodGBAsFoCQRCg+CzIhQi4vcMdwgAAYLwojgIDKI2IAFSDBACCRgeK2 +HVwQAdnCIUEANXgAkLcdHBAbh1wdGBBW8IDgpAAMAFJwAxzCMwDZivcCIIAEUnAB4S95fPcDHEIw +gODF9gHhAxxCMCwWgJBEKD4LMiFBLi9wx3CAABgvgOHKIWIANXgAkAq4QcBAKoAiQsDPcIAApFoC +gMlxgiFCDEPAQCTAMMYJIAwN2uoM7/8N2CoNz/8AhbbchcGGuAClAdhEwAImABOiCSAMINqEwCTZ +vNoe20oJYAsYuwLYWh0YEATwIgzP/+kCb/2twOB48cCaCk/9mBACAAQigQ8AAAAIO3kEIoMPAAAA +ECV7z3GAAMgdpIHpulUlzhhVJU8amBCBAAjyhiH/A0S5L2eJv+lxGfBRIgCCwBUCEQzywrmAJQIa +P2Xojz1lMI1lf/B/RXkJ8MO5PHk/Zj5mMI7oj0V5iBjAA2V5iQJv/YwYQADxwOHFA8ikEAEAmBAC +AFEhAIByEAEBSHAG8h4MYAIA2gh1B/AB4RIMYAIA2qxoog5ADc9yoADIH/gSAQADyM9zgAAQxhCI +BbgAY+24BvQB2BOieIJZggbwAtgTonqCW4ICJUAQeGAQc8AibQANcQChDXBAoAAWAEAAFgBAA8jP +cqAA9AdwEAEBaLknonAQAQFouTB5/QFv/XAYRADxwH4JT/3PdqAAyB+gFgQQ+BYDEITgAN8i9AMS +ATakEQAA9Lh2EQIBBvLPcIAAkM6hgATwghENAQ3MUSAAgYQRAAEJ8gIlwRACJEMACCMDAATwhhED +ARtjaHFx8IHgSvQNEgE3A8jkuXgQAgEh8lEhQIDPcYAAyB0kgVQRAQEJ8n4QDQEifWJ9AiRDAyvw +gBADAc91gADwxAAjRABwiHZ9YJUAIw0BhBADAbtjG/CkEAEA9LkI8nCIz3GAAPDEdnlgkQTwghAD +Ac9xgADIHSSBgBANAVQRAQE9ZbtjhBANAbtjgBANAblhfhANAUJ9J/CC4CH0AxINNg3MeBUCEVEg +AIHPcIAAyB0EgFQQAQEJ8oAVABEieGJ4AiQDAAfwghUDEYQVABE7YxtjgBUNEUJ9BfDpc+ly6XXp +cQ3MUSBAgAfyA8h2EAIBYro6YgvwgONiusn2z3CAAMgdBIBGEAABGmL4FgAQXWUCfR+GEHWL96DY +D6b/pl+mAtgVHhiQgNgOpmUAb/1wePHA9g8P/c9xgADIHfAhAgBVIsUICIJVIkQKUSDAgIogCADK +ICEAwBoEAEokAHIA2agggA/PdYAAcGT8ii5l5H4vKIEDTiCDB89wgABYZm9gACVDAOCrRBKPAOR+ +Ly6BE04mjxfuYMiryIJRJsCQD/Idiobh0yCmAC8oAQBOII0Hz3CAAJRiqGAQ8M92gACYZC5mzmW8 +isR9WBKOAMR9Ly1BE04ljhfIYBCrAeFKJAByANuoIIEA3IrPcYAANGZvYc91gABYZuR+LyiBA04g +jwfvZQAlwAD8qEQSjwDkfi8ugRNOJo8X7mUkGIIDyIJRJsCQD/I9ioDj0yGhAC8pQQBOIY0Hz3GA +AJRiqWER8IDjA/LJawLwaHbOYTyKxHlYEo4AxHkvKUEATiGOB8llLBhCAAHjSiQAcQDYqCBABc9x +gACQYn2KCWEAJAwAAeBkeS8pQQBOIYMHz3GAAJRiaWEgrP0GD/3geOHF4cbPc6QAtEUpEwCGz3GA +AJA6yBkAACsTAIbMGQAAz3ClAAgMA4DkGQAADhMAhhB6MLjUGQAA0BmAAA8TAIbYGQAAz3CAAKiy +1Ii2iOgZgAN4iOwZQAMNkPAZwAAs4AIgggP0GYAAAiBCA2J4+BmAAPwZAADBxuB/wcXPcIAAMFsF +gAOAIIDPcIAAQJTgfymg4HjhxeHGmHDPcoAAEBYFgiCCZoLIuBC4yLkFIQGAAYLIuxC7yLgFIwUA +Z4ICgsi7ELvIuAUjBwBoggOCyLvIuBC7BSMGACTyABQOAC8oQQBOIIMHANgPIMAAEn0EIEMBpH5l +fgAcgAPagqR+xXt6onmCBCCOAQQgwAGke8V7eaJ4gqR7BCFBg2V4GKLf9cHG4H/BxeB48cBeDQ/9 +OnAFgaCByLgQuMi9BSUNkAGBJoHIuMi5ELkFIRAAAd4b8gQlgJMU8i8oAQBOIIIH8CGBIIDhAN8P +J48QCfIEJwAUQiAAgGB5yiBiAOZ9gOXbfuj1ZQUP/eB44H8A2KHB8cD6DA/9o8EIdUjAz3aAABAW +Gob7hjyGBH8kf6d/QcfqC2AEiiDYBIog2ATeC2AEqXGA5xf0gOVs9PoI4AQH2IDgZvIKIcAP63LP +cAAAjROKI8YPSiQAAO0Eb/4KJQABBBQBMYDhGfIgFAAxCyBAgA3yz3CAACQuYIDPcQAAKFwM2GB7 +A9oJ8IDgB/TPcIAAIC4ggGB5DNgGFAExgOEZ8iIUADELIECADfLPcIAAJC5ggM9xAAAoXA3YYHsE +2gnwgOAH9M9wgAAgLiCAYHkN2AQnUJML8koI4AQH2IogGAgqC2AECnET8IDlEfSKINgEGgtgBIoh +xwoGCOAEB9iKIBgEBgtgBOlxYggAALymCNxTBC/9o8DxwOoLD/0IdgDdiiDYA+YKYATJcc9wgAAQ +FlqAO4BEeQDaDyKCAwQiQwBCIwOAyiNiAC8mx/AB38ogQQMH8hyAJHiqDu//RXjpcAkED/3gePHA +ocEB2MYMr/9AwM9wgAAQFgqAUSAAgMogAgfKISIByiKCDwAAZwDKI2IPAAoiC8Ar4gWhwNHA4H7g +ePHAWgsP/RpwKHVId2h2OGNm2T3aSgogCxe6geAJ9ApwIgogC6lx6XDyCSALyXGRAw/94HjxwCYL +D/2mwSh1GnJgwADYARwCMAHYAhwCMAMcAjCLcI4IIAeBwYDlBfIEwQpwYH0FwgPAgOAO9AohwA/r +cs9wAACME+7biiTDDyUDb/64c0B4OQMv/abA8cDKCg/9osEB3c92gAAQFjqGG4YkeDyGBCEQAL4J +YASKIJgDTCAAoFUmTxcs8gPwu30EIECj/vMvKAEATiCRB/AnQBRcHkAUgODKIcEPyiLBB8oggQ8A +AI8TyiOBDwAAGgLKJAEEsAJh/solQQRAeIogmANmCWAEKnEA2A8gQAQGIBAgTg3v/wpwiiCYA04J +YAQ8hpUCL/2iwOB44H7gePHAJgkABM9wAQDYPoDgCvLPcYAAEBa4GQAAG4GRuBuhz3ABAFA+gOAI +8s9xgAAQFh6hG4GBuBuhz3AAAPhegOAJ8s9xgAAQFpQZAAAbgYi4G6HRwOB+4HjxwOHFocHPcoAA +RKfPdYAAEBYXhQDZDyEBABiFJHhCIACAyiBiAIHgAdsA2Q/0CNhgwAEcQjACHMIwAxzCMItwBNk+ +Du//iiMIAAjYANlmDu//KHIA2P0BL/2hwPHAdgkv/QjZz3Kt3u++fg0gAjpwMg8gACpwg+BI8s9w +gABAlAOQTiDPAYfnUAAGAM9wgABIDroNYAD0IMADAN4A3QTYGnAqcOlxyXIKJIAPrd7vvjYNIAKp +c0YPIAAqcIPgJvJCIEAggOAB5Sz3AeaE5qj3AeeH57gHxf8qcM9yrd7vvgYNIAIQ2b4OIAAqcIPg +DvLPca3e777yDCACKnAGD+//KnCD4MogIgApAQ/98cDKCC/9A9qmwRpwWgjgC4PBA8HPcIAAlA8U +FAcwAN7wIEUAz3CAAKAP8CBGAM91gADwBw7YxKVAwATYQcDPcK3e775CwATCCnCA244MIAKYc9IJ +IAAKcIPgQPIDw89wgADED0KF8CDBAMClgOEMFRAQwaUI8s93gADQD/AnwBCA4Ab0wKXBpQDZGfCE +KgwDHghgAC9wDiCBDwAAAAEgpQPAhCgMI/AnARAGCGAAL3AOIIEPAAAAASGlBIWB4A30AIUReIwg +B43C98ClMXmMIQeNw/fBpQDYVQAv/abA4HjxwO4P7/wE2qbBfg+gC4txz3AAABvSAN2pcVoMYACp +cgDBz3AAABzSSgxgAKlyAMHPcIAAqA0BwhUgQQAAkQLBBboeDWAARXkDwIDg3AAFAM92gADwB9LY +CLgZ2RYMYAAA2s9wAAAi0kAmARIOCmAABNrPcAAAI9JAJgET/glgAADaz3AAACDShMHyCWAAANqF +x89wAAAh0ulx4glgAADaAoYX2V4JYAtAJgISA4YX2VIJYAtAJgITBMAX2UYJYAuEwgXAF9k+CWAL +6XIChgDZ/g4gAIu5AqYDhgDZ8g4gAIu5A6YEwADZCLjmDiAAi7kIdwXAANkIuNYOIACLuSKGMXkZ +4QUpfgAjhi9yUHcxeRnhBSl+AC9xzCBFgIb3A8AB5RB1MgfO/wPAEHXG9wHZz3CAAPAHJKAA2B0H +7/ymwPHAqg7v/AnaqcEacDoOoAuLcULYCgxgAAjZ/gsv/SHACHFC2PoLYAAFuQwUBDAAwQpwBsIK +JYAPrd7vvn4KIAICw+INIAAKcIPgNPIAwQXCz3CAADQOAN/wIEAABMEKugQigg8PAAD8yblFecYK +YADpciDez3WgAMgf0KUF2EMdGBAA2DoPoA6NuNGlIBQEMADBCnAGwgolgA+t3u++HgogAgfDHg7v +/wpwg+DKIMIDXQbv/KnA4HjxwNYN7/wC2qXBmnCCDaALg8HPcAAAEdIH2WIKYAAA2s9wAAAS0gDZ +UgpgAADaz3AAABPSANlGCmAAANrPcAAAFNIA2TYKYAAA2s9wAAABRAfZKgpgAADaz3CgALQPcBAX +AAHZz3CgALQPPKAg3c92oADIH7CmBdhDHhgQANiKDqAOjbixprzY3gpgAADZw9jWCmAAANmKIEQI +zgpgAADZiiAECsIKYAAA2bXYugpgAOHZiiCEBrIKYADh2QPYQMAE30HHz3Wt3u++QsWKcATBA8Ie +25hzSiUAAEomAAAmCSACSicAAGYO7/+KcIPgvPLPdoAA8AcIFhYQDBYTEA7YQMBBx0LFinAEwQPC +HtuYc0olAABKJgAA6gggAkonAAAqDu//inCD4J7yCBYQEAwWFRAO2EDAQcdCxYpwBMEDwuHbiiRD +CEolAABKJgAAtgggAkonAAD2De//inCD4ITyCBYREAwWEhAD2EDAQcdCxYpwBMEDwuHbiiRDCEol +AABKJgAAfgggAkonAAC+De//inCD4GjyIoajhs9yoAC0D+pwHKIEw89ygADEDwIhAKTPdoAArA91 +egCiAiJAJc9ygADQD3V6AKLD2nV+QKbPdoAAuA91fkCmD/QKIcAP63LPcAAArROKI8oFSiQAAE0E +L/4KJQABgODKIcEPyiCBDwAArhPKI4EPAACeAsoiwQft8wIggCUZYQIhQYQP8gIgQiQMerILIAAv +cATCAiABIM9wgACUD1V4IKACJcAkuWACIYGED/ICJYIkDHqKCyAAL3AEwgIlASDPcIAAoA9VeCCg +ANi5A+/8pcDgePHApg0gAADYz3AAAA3SANn+DyAAANrPcAAADNIA2fIPIAAA2s9wAAAV0s9x8w// +/N4PIAAA2s9wAAAb0gDZ0g8gAADaz3AAAALSoNmaucIPIAAA2gnYjLgA2bYPIAAA2hTYjLj/2aoP +IAAA2gDYjLj/2Z4PIAAA2hHYjLj/2ZIPIAAA2gLYjrgA2YYPIAAA2gHYjrjPcQAA//92DyAAANrP +cAAAC9IA2WYPIAAA2s9wAAAN0gHZWg8gAADaz3AAABLSANlKDyAAANrPcAAAE9IA2T4PIAAA2s9w +AAAU0gDZLg8gAADaANjRwOB+8cDhxa3Bi3EuCqALAdoA3QTY/g8gACzZDtj2DyAAqXG12O4PIADh +2YoghAbiDyAA4dkAwIDgzCCigMwg4oDKIUIDA/QC2YPgzCCigMwgYoAD9IK5L3m6DyAAD9gA2LkC +7/ytwPHA4cWhwYtxygmgCwHaz3WAAFiWABQEMM9wgABMDalxEtpaDiAAANsAFAQwz3CAAEoNViVB +EgHaQg4gAALbz3CAAHANVSXBFBzaSg4gAADDANhhAu/8ocDxwMoJ7/wD2qPBunBuCaALi3EBwc9w +gABADgDf9CBNAALBz3CAAFgOgOX0IFQAz3CAAPAH4KDhoMwlopDKJsITAvQA3oHlzCXikMomYRAO +Ds//qnDPcq3e776WDeABqXHmDu//qnCD4HPyAMCA4MwgooFP9IDlzCVikEv0AsCA4Ef0z3CAAJQP +1XhacOCgz3CAAKAP1Xh6cOCgz3CAAMQP1XgacOCgz3CAANAP1Xg6cOCgz3CAAKwP1XjgoM9wgAC4 +D9V44KCqcKlxz3Ot3u++Hg3gAclyGgvv/6pwg+A58gDBABIAIIbhAdnAeQO51XnHcYAARKcAoQAT +ACAEoQAQACAbeAihABEAIBt4DKGqcMlxqXIKJIAPrd7vvtIM4AGKc/YPr/+qcIPgE/IAwM9xgADw +B0CBBL0GuLhgFSAABcdwgACApyGBQrAjsADYzQDv/KPA8cCSCO/8BNqkwR4IoAuLcQDAAcEEuDV4 +z3aAALQNEGbeDSAAAsEAwAHBBLjPdYAA9A01eBBlyg0gAAPBAMABwQS4NXgAZgbgEHi2DSAAANkA +wAHBBLg1eABlBuAQeKINIAAA2QDYmQDv/KTA8cChwfoIIAKLcgDAocDRwOB+4HihweHF4ca4cM9w +gABUsBAQBgDPcIAA2DEFgJhxgOChwYYk9w9z8s9wgADYWwCA0HAN9M9wgADgWwCAsHAH9M9wgADc +WwCAkHBh8gAcQDEgwgEUgTDw3lMiwADEelMhxwAkflR6QC6NAbR9umIVes9xgABEqUhh1H4Ic4Yj +/Q97ezpiQYpleEhzhiP9D3t73WUVJc0RvmHCjmV6yXOGI/0Pe3u5YSOJZX4oc4Yj/Q9MJACAe3tl +eRPyz3WqAOAHc4VRIwCABvJIpQmlKqXLpRDwCKVJpcqlK6UK8Am6RXjPcqcAFEgDogm5JX7Eos9x +gADYWwAZgAHPcIAA4FsAGEABz3CAANxbABgAAaHAwcbBxeB/ocDxwPoOj/xmCYADgOBYCMECAN4W +8FDcAicAE7NutH0mD2AMuGBCJwAYGg9gDLhgANkAJoAfgADuLyCoAebPd4AAYDCLF4CQEHam989w +gABcWvIOQAzPcYAAZC4AgaG4BQev/ACh8cCaDo/8z3EAggEAz3CgAKwvPKDPcIAAaDgAgIDgBfT2 +D0ADF/D2DEAAagxgBW/YgOAR9CDez3WgAMgf0KUK2EMdGBAA2GIPYA6NuNGlzgxAALUGj/zgeM9y +gABoOCCCBnngfyCi4HjPcoAAaDgggiV44H8AouB4BCiADwAAL7pCKcJ0UHpEKv4CAiBADhB4gOAE +8gHiUHqD4ECxA/aA4AP0ANgC8IDY4H7geEEFT/7xwN4Nj/w6cM92gAB0HACGAeCB4ACmEfQB2M91 +oADIH1EdGJAg3/ClQx0YEADYyg5gDo248aWSCSAFB9gacM91oADsJ+uFAgqgBipwC6UAhkIgQIAA +pgf0z3GgAMgcANgRoY4IIAUKcNUFr/zpcOB48cBqDY/8OnAodRpySgkgBQfYUSCAoFpwBvIuDWAH +yNhQIJAgTCCAoBzyC/ZMIACgEvJMIECgI/QV2BO4DvBMIACkE/JMIACoGfQ+DCAEKnAApRDwKdgS +uPAgQAQApQrwK9gSuPrxz3CgAOwnGYAApQ4IIAVKcFEFj/wKIcAP63LPcAAAihN62wokQAQtBe/9 +CiUABPHA2gyP/Ah3OnGA4hpzAN7N90h19CeAExUhgSNSD+//CnJhvYDlAeY29xEFj/zgePHArgyP +/KHBCHeA4hpxAN7P90h19CeAEx4IIACLcQDAFCCMI2G9gOUAtAHmNPflBK/8ocDxwHIMj/yhwVpw +z3WAAHQcAIUB4IHgGnEApRH0AdjPdqAAyB9RHhiQIN/wpkMeGBAA2F4NYA6NuPGmJgggBQfYOnDP +cKAAwC8zgPq5DvL8EAUACiHAD+tyiiCMCYojhwVhBO/9iiTCCzCAUSEAgA/0/BAFAAohwA/rcoog +zAmKI8cFQQTv/YokwguLcR4Lr/1KcAAUATEAGEAgAIVCIECAAKUH9M9xoADIHADYEaHaDuAEKnAZ +BK/8ocDgeFEkwIDxwAXy2g7P/wPwyggAANHA4H7geFEjwIDxwAXy8g7P/wPw4ggAANHA4H7geAhx +juAB2MIgDQAB2qkH4ARIc+B48cByC4/8OnAodRpyUg/gBAfYTCCAoFpwH/IO9kwgAKAV8kwgQKAo +9BXYE7gVIEAEoKAd8EwgAKQV8kwgAKgc9CpwygogBKlxEfAp2BK4FSBABKCgC/Ar2BK4FSBABKCg +BfDPcKAA7Ce5oB4O4ARKcF0Dj/wKIcAP63LPcAAAiRNJ2wokQAQ9A+/9CiUABOB48cDmCo/8CHc6 +cYDiGnMA3s33SHX0J4AT8CGBI1YP7/8KcmG9gOUB5jb3HQOP/OB48cC6Co/8CHeA4hpxAN7N90h1 +9CeAExoIIAD0IIEjYb2A5QHmN/f5Ao/84HjxwIoKj/w6cM91gAB0HACFAeCB4BpxAKUQ9AHYz3ag +AMgfUR4YkCDf8KZDHhgQANhyC2AOjbjxpjoO4AQH2M9zoADALzOD+rkO8vwTBQAKIcAP63KKIIwJ +iiOHBXkC7/2KJIIEMINRIQCAD/T8EwUACiHAD+tyiiDMCYojxwVZAu/9iiSCBC8iCARAKYEhgbkQ +ukV5z3KgAOwnJqIghUIhQYAgpQb0z3KgAMgcANkxouoMwAQ1Ao/8z3GAAMgdI4HPcoAAhAcyIYMP +AAD6AgGiMiGBDwAA+AJhskhwILII2XPaHttBAKAKGLvgePHAz3CAAMgdA4AJgFEgQIHKIGIAjAki +/8ohIgDPcYAAuAaKIIwMigjgAyCRzg1v/gHY0cDgfuB48cByCY/8CHUodiCFQiEBgMohYgCA4QDY +BfKeCWAMqXAB2CSFgObQIWIAzyEiANAhIQDPIWEAgOAkpdQIYgzKIEIDnQGP/OB48cAmCa/8iiIE +Ds92gABkn891gADAIUAmABTo3OoPIAsCJQETAYbPd4AAyB0ihr4fGBC/H1gQIZYEIIAPAAYAABYd +QpAgjoDgAdjAeBQdQpASHQKQANnPcIAAeRwyD+/+IKjyDEADgOAJ8l4NQAOA4AX0Cg1v/gDYKPDP +caAAsB87ga4PoAOKIEwMiiCTAaIPoAOf2QLY9gygAQHZIg8gDgLYI4dIgTSRUyIAAF4JYAkB24og +jA56D6ADqdkA2Z65z3CAAHgpIKDFAI/88cCw4OHFCHWD9rnlzPYKIcAP63LPcAAAmiEi25h1gQDv +/bhzQiUAHKkAr/wPeOB48cAqCK/8mHBBgeS6sIk68nKJz3eAABDG1W3GZ1TK9r4IEYUASSDAAAfy +z3aAABDItn7BjgLwAN7HcIAAEMi2eASICCMDAAgjgwMAI0ABSSDDAxZtdXjPc4AAkMkDY89wgAAQ +ybZ4z3WAAMgdpIW4hQGApXgEIIAPAAAACAZ7A/Bjgei7mBnAAADYC/KkEQAAAN2XvZG4lLikGQAA +qXBRJACAHPLPdYAAyB3EhcC6yIYEJo4fAEAAAD6+HubYekV7/ruYGcAADfKkEQIAhSABBIy6kbqk +GYAAnBkAAB3w/7sS8qQRAgCFIAEElriYuI26kbqcGQAApBmAACSFEIGeuBChC/CUuJa4nBkAACSF +EIGeuJ+4EKF9B0/84HjxwAoPb/wD2M91gABILiCFQHmA4FTyIIVgeQTYgOBQ8iCFYHkA2IfgB/KI +4Cfyi+AM8gDYLPDPdoAAUC4ghmB5AdiA4BnyFPDPdoAAUC4ghmB5AdiB4BHyIIZgeQHYg+AL8iCG +YHkB2ILgB/IghmB5AdiB4N/1AdgK8M9wgABQLiCAYHkB2IXgAdjAeIHgGPIghet2YHkA2Bpwz3CA +AFAuIIBgeQHYuHA32AohwA/JcoojTQWdBq/9CiQABLEGT/zPcIAAmKUogM9ygABsBi94geAL9ADb +z3CgALQPfKAC2AOiZKID8AHYBaItBaADiiDMCOB4z3CAAJilKIDPcoAAbAYveIHgBfQC2ASiA/AB +2AWiBQWgA4ogzAjgePHA8g1P/M92gADIBwCGgeAO8gohwA/rcs9wAACHJ4ojBARKJAAAEQav/bhz +z3WAAMQHIIWC4cwh4oHKIcIPyiCCDwAAiCfKI4IPAAARAcoiwgfp9YLhHfTPcoAAaLRCilEiAIAI +8s9ygACYpSASggCB4l30GLkQuAV5hSEMAH4MoAOKIIsAA9gApQDYTvDPcIAAmKUgEIAAgeAn9L4M +oAcA389wgACQBwCAIIZRIACAAIUQuRi4BXkH9M9wgABotASAgOAK9Ii5MgygA4ogiwAB2ACl4KYr +8Iu5IgygA4ogiwAI2PfxNgpAA4DgC8jFIIIPAQAA/Ar0BSCADwAAADwLGhgwC8iQuAsaGDAAhUCG +QCgBBhC6CLhFeQV5iiCLANoLoAOBuQLYAKYxBU/84HjPcIAAuKAogM9ygABsBi94geAF9ATYBKID +8AHYBaKtA6ADiiDMCOB48cCaDE/8z3CAAMQHABAEAM92gADIBwAWBRBMJACBzCVhgMoiwgfKIIIP +AACJJ8ojgg8AAEwBqASi/cohwg/PdYAAnAcAhQDZz3eAAES0DyEBAM9wgACYB0CAJnogF4EQgeFA +oBH0QCwBBkAtAAQleEAsAQIFeYogiwAqC6ADRSFBAQXYI/DC4c9ygAC0OAmCDPKMIcKBB/KMIYKC +BvKAuAbwRSDAAATwRSBAAQmiQCwABkAtAQQFeUAsAAIFeYogiwDiCqADgbkC2ACmiiBLBNIKoAMg +hYogSwTKCqADKIchBE/88cDPcAAACBxyC+ADocH/uA3yz3CgACwgEIAE2XzaPdtAwItwJgpgChe7 +ocDRwOB+gOAA2soggQAN8gHbz3KgALAfeaJ+ggIjQgBwccIibQBCeOB+FcjHcIAAOLE0iAHhL3mE +4TSoAxICNoz2z3ADAIQAoBoAAIogCAAGGhgwC/CKIBAABhoYMM9wAgGEAKAaAACKIAQAKQKgAwDZ +AdrPc6AAsB9Zo36DgOAF8iJ7cHCD9wDYAvBIcOB+4HjPcqAALCBwgoDgCvICI0IA13IAgAAABvdQ +cIb3ANgF8HBwfvcB2OB+8cDSCm/8mHClwSh3uHMA3gQjgA//AAAAGLoFem95CLn/2Ai4ZHgouAV5 +RXkI3fQkgAMneETAVghgDBAUADESFAIxYb1AKAEEBXlHeUTBEBQCMRQkgDOA5UCwAeYp91MlwgVA +pwAUDQEH2QfwEH0UJ0wQALRhuRQkQDC7e0+9AJCle4HhcHt4YDL3BCCADwAAAP8QuAV6QKehAm/8 +pcDgePHANggAAOoIAAD+CAAA0cDgfuB4z3GAAPQoQCEAA1UhwgVQcEb3ANkEGFAAUHC99+B+4Hjx +wFYLIAYA2F4Ob/0A2M9wgADsWjIPT/3PcIAAzFoqD0/9Fg2P/pIMAAgB2ADZugogA4DaSggADKoL +gAJWCkAMXgyAAaYPwAIA2LIJ7/4Icc9wgADwFQCIUSCAgAfyz3GgAMAdAIGguAChJg2ACuoPwAJ+ +D2AB/9hyD0AB0cDgfvHAgglv/Iog/w/PdaAAOC7HhQelz3CgAFQuC4DTuAYmAHAPAP//mgxgDRbZ +MgvAAcelvQFP/OB48cCeCiAGAdimDW/9AdhaDgAO0cDgfuB48cDhxQDdz3CAAOgGoKDPcIAAfJes +sAYJYAypcCYMT/1uDWALqXAWDsADQgkP/u4OQAGOCa/8qXBaCY/8aQFP/ADZz3CgAOwnK6DgfvHA +5ghv/APZz3aAAPAVYg1gDclwoI5EJUARheAN9AohwA/rcoogRw1620okQAD5AK/9QC0FEgGOg+DE +9mO4Aa5eDAABDQFP/PHAocGLcCINYA0B2UoMAAGhwNHA4H7gePHAgghv/ATZpMEGDWANi3DPdoAA +dBwAhgHggeAAphH0AdjPdaAAyB9RHRiQIN/wpUMdGBAA2F4JIA6NuPGlAIZCIECAAKYH9ADZz3Cg +AMgcMaDuCwABlQBv/KTA8cChwYtwrgxgDQHZ1gsAAaHA0cDgfuB48cChwYtwWgxgDQTZAMBRIECA +eA4iBsogogAAwFEggIA4DwILAMBRIMCApAqCBgDAUSAAgWwOQgYiD2AMAdjPcYCu4AHscCCgAcjs +cQChz3KAAICUiiSBfQDZqCAAAvAiQwDscGCgAeGmCyABANihwNHA4H7xwOHFo8EB2EDAz3WAABAW +qXDaC2ANXNk6hRuFJHg8hQR5gcB+CS//QcEBwDuFBHlBwXIOYAOKIFgEVSVAH/oJL/+pcc9wgACI +F+4JL/9AJQEbi3AGCiABBNlCCi//AcCyCM/+AIWA4AX0BYWA4JQLAf+hBy/8o8DxwCYPD/yhwc92 +gAAYHMlwAd2eC2ANqXGKIBcKDg5gAwESATZAjoogFwohjhC6/g1gA0V5QMWLcKoJIAEE2VUHL/yh +wPHA4cWhwYtwYgtgDQHZIMDPdYAAHBwApYogFwrKDWADARIBNoogFwq+DWADIIVA2c9wgAD0lvoK +YA1AwV4KAAGmD8AGEQcv/KHA4HjxwJYOD/zPdYAAQBwChSOFAd4QccB+qXAGC2ANA9kyCgABgOYD +8gKFAvAAhdUGL/wDpeB48cDhxc91gABgHKlwogpgDRDZABUEEEwkQIAO8kwkwIAR8gohwA/rco/Y +jbiP23UGb/24cwGFDLgEIIAPAQAA8AGlA8zXcAAAAEAB2MIgCgAXuMdwAA4AAIO4nbifuOxxAKEB +EgE27HAgoPYJIAEB2GUGD/zxwADYz3GAAAAAAKEBoQKhz3DQ/gAABKEAFgBAABYAQAAWAEAAFgBA +A8zXcAAAAEAB2MIgCgAXuMdwAA4AAIO4nbifuOxxAKEBEgE27HAgoJoJIAEC2O4PgALRwOB+4Hjx +wAAWAkChwUDCARSAMFEgAIAG8s9xgADclgXwz3GAAMSmQKFgiQHaB/AAFgBAFSGMAACkAeJ9eBBy ++fdRIwCACfIAFgBBA/AA2BUhjAAApAHiheK69wPM13AAAABAAdjCIAoAF7jHcAAOAACDuJ24n7js +cgCiARICNuxwQKA+CSABAomhwNHA4H7gePHA4cXPdYAABAipcEIJYA0I2QCFz3GgALgeAqEBhQOh +mggAAVEFD/yRAAAB8cCkwYtwHglgDRDZA8zXcAAAAEAB2MIgCgAXuMdwAA4AAIO4nbifuOxxAKEB +EgE27HAgoADAUSAAgAPABvQCwa4OIAEA2gXwKg1gAgHBhggAAaTA0cDgfgkAAAAFAAAA8cAuCAAB +9QIAC+B48cBmDC/8ANnPcKAA0A81oAAWAkEAFgFB6boDzBby13AAAABAAdjCIAoAF7gAII0PAA4A +AEAhAwPPcAAA/P9keKV4nbifuBPw13AAAABAAd3CJUoTF73HdQAOAABAIQMDz3AAAPz/ZHileOxz +AKMByOxzAKPscCCw7HMA2ACz6LpC8gNp47oEIIAPAAD8/wDbCfLPdaAAOAQA22itAdthuBB45LoM +8qFrCL1lfc92oAAQBLi2AuNve2K4EHgA3RTww2sYvuJr738Qv+V+4Wvvfwi/5X5lfs93oAAUBMun +BONvewHl2mjRdaz3AN4I8M91oAA4BGitAeNvewHmUyBNALF2t/flugjyAdvPcKAA0A8RGNiA5roJ +8gPYz3OgABQEEKMB2ASj47oG8gAWg0DscGCoYbnkugnygeHH9wAWA0HscGCwYrlEIoOBQSmAABX0 +AN4L8M91oAAABOyNABaNQOx14K0B5rJosXZH9+e69PUAFo9A9vGC4xT0ANsK8M91oADUA9yVABYN +Qex1wLUB4xt9sXNG9+e68/UAFg5B9/HiuhXygODKJA1w4HjoIO0D57oJ8s9woACYA32AABYAQAPw +ABYDQOxwYKAA2gbwABaDQOxwYKgB4lMhQAAQcrn3tg7gAAHYANjPcaAA0A8RGRiAz3GgABQEBKHP +cIAAcCgZgM9xoADQDyK4wLgVocECD/zgePHAVgoP/AAWhUAAFoBAABaAQAAWgEBMJQCEzPYKIcAP +63KKIN8EXdttAm/9SiRAAADZTCUAgM92gAB8HCmm0/cocgAWg0AVa891gAAQxgBlUSBAggv0AeKw +cg8hwQApprH3rg3AAF0CD/wKIcAP63KKIB8Fa9tKJAAAHQJv/QolAAHgePHA4cW0wYt1qXBSDiAN +FNkAwIHgBvSWDiADqXCYcB3wguAH9PoMIAOpcJhwFfCD4Ab0vgsgA6lwmHAP8ITgB/SmDCADqXCY +cAfwhuAf9DIMIAOpcJhwA8zXcAAAAEAB2MIgCgAXuMdwAA4AAIO4nbifuOxxAKEBEgE27HAgoFIN +4ACIcMEBL/y0wAohwA/rcnzYjbiKIx0PSiQAAHUBb/0KJQAB8cDhxaLBi3WpcK4NIA0C2UYOIAOp +cNIMwACJAS/8osDxwAYJD/wAFhBAocFMIICgyiHGD8oixgfKIIYPAACPDMojhg8AAIMFyiQGBCAB +Zv3KJSYAABwANIt1qXCOC+AABNmKIMwKzg8gAwpxhCgIKC93ACeOH4AA2KL6COALBG7PcIAAvKQY +gBJwEfIgFoAQgOAk8qlwBNmZ2h7bIg/gCRi7ANggHgIQGPDHd4AAzKIKh4G4CqfPcIAAbAYvgIDh +AdoF8kSgBNgG8ADZLKBJoCSgBdh2DUADsQAv/KHA4HjxwOHFz3GgALAfO4FGDyADiiDMDc9wgAB4 +KQCABCC+jwDAAAAI9M9wgAC0oACIjCDDjwXyxg+v/QHYz3WAAGSfqXCWDCANUtmeCwAHo4WKIEwO +Ag8gA6lxrgvAAIogjA7yDiADZNmCCyABqXAIcc9wgADsV5IIwAv+2c9wgAC0oEEAL/wgqOB48cDP +cIAATKVGDCANDdlyC8AA5grABdHA4H7gePHAkg/v+4ogzA6iwaIOIAOKIYUEi3AeDCANAtkDFJEw +TCGAoI/2BBSFMAohwA/rcs9wAACEDIojBQixBy/9CiRABAIUgDDPdoAAbAaEKQgoL3cgHgIQz3CA +APCi+WAoiUAgEgKA4QAUFDEAINMDHPKKIEwNOg4gA4ohhQqKIEwNLg4gAypx/glgAUIkgCEB2BG2 +/9ghHgIQQCYAGMoJ4AAE2WrwANgRtiEeQhTPdYAA3KBAJRAS/WWLcKlxgg6gCgLaQCUAEjILIA1C +JIEhACeAH4AA3KAIEAUAz3CAABDOBYBTJUEFEHHKIcYPyiLGB8oghg8AAIUMyiOGDwAAfgHoBib9 +yiRGBH4LIAcqcEokgHAA2aggQASEKQgIL3AyIgIggOII8ggVBRAwIAQgDCRAgSXyAeFAJgAYLgng +AATZAdkIG0IghhUAFoC4hh0YEJIKYAMocIogTA1WDSADHHmKIEwNSg0gAyKFiiBMDUINIAMqcXEG +7/uiwAohwA/rcs9wAACGDGUGL/2KI4YD4HgAFgBAzQHAAPHA4cXPdYAAOLOpcI4KIA0D2QGFz3Gg +AIAlDKEChQ2hAI1RIACAANiOuATyD6ED8BChmgnAAFEGz/vgePHAzg3v+wTZo8EA30LHAgsgDYtw +PtjGDCADARIBNj7YugwgAwQUATE+2LIMIAMGFAExA8zXcAAAAEAB2MIgCgAXuAAggQ8ADgAABhQA +MRt4E+AEIIAPAAD8/yV4nbifuOxxAKEBEgE27HAgoADB7HAgoAQUATHscCCwBhQBMexwILAGFAQx +USQAgA3yARIFNgohwA/rcs9wAABPJnkFL/1W2wHdz3EAACIiMgwgAz7YGg2gA6lwAsEleELAAMBR +IACAyiWiEMohgg8AADMzDAwiA8ogog/PcKAALCBAEBAAAvAB5wYUADEQd4AACgCC5QQUADGCxhb0 +G3gQeMlxPg6gA6ly7HEAqQQUADHJcRt4AeAQeCYOoAOpcuxxAKkI8MlxGg6gA6ly7HEAsQQUADFA +IEUAz3CgACwgEIAvJUgBAiAABNdwAQCghpoH5f8EHEQxCBQEMAohwA/rcs9wAABQJrUEL/1521IM +gAPPcKAALCAwgD7YZgsgAwIhAQQ/2FoLIAMCwU4I4AACwKUE7/ujwOB48cAAFoVApsFMJUCFABxC +MUT2TCUAgk32CiHAD+tyz3AAAGYZettdBC/9SiRAAAAWgEABHAIwABaAQAIcAjAAFoBAAxwCMItw +egngBYHBAsKA4g/0ABSFMAohwA/rcs9wAABnGYTbHQQv/Yokww8EwGB6BcEDwYDhC/QKIcAP63IA +FIUwz3AAAGgZiNvt8QHAgODiIEIAZg+AAKbA0cDgfvHAogvv+wnZz3aAAAg3HgggDclwAJbPdYAA +cLBRIACACPIB2EwdAhCWD2ADGNgJ8EwVgBCB4AX0AthMHQIQAJYihiK4wLhNHQIQz3CAAFQ3IKDP +caAALCBQgXKFAiLAAP+4A/RSpRCBA6XPcIAA5FkAgEIgAIDKIGIAgOAI9M9wgACUNwCAgOBsCYIC +CIaA4AX0z3CAABDOCJAVpQCWJbjAuEYPL/4D2bIOgABhA8/78cDuCu/7B9nPd4AAlDduD+AM6XAI +FwQQRiT+gwvyCiHAD+tyiiBNC3fbCQMv/UolAACgh+G9FvIUFwUQxofgvcwlIoDMJiKQDPQKIcAP +63IQvYogjQuC29kCL/0AJYQTz3AAADCnEqcA2FElAJETpyOHDvIOpwGHj+Avpwvyz3ABACjbEqcB +2BOnBfAup//YD6fmDEANFg6AAL0Cz/vgePHApcGLcNYO4AwF2QDAUSAAgBXyz3CAAMgdA4AYiIHg +DfQA2Jq4z3GgAMgfD6EBwKQZAADD2Bq4DqHSDYAApcDRwOB+5QOgBQDY4HjxwOHFABYAQILgz3WA +ANwHAKUH9ADZz3CfALj/PaCiDYAAIIWE4T4ADQAzJkFwgAA0XkAngHI0eAB4jglgA1TYUSBAgA/y +z3GAAGg4AIGBuIYPYA0AoQfw/glAAwPw+g5ABBkCz/vgePHACghACFINgADRwOB+4HjxwLYNoAgA +2M9xgAC8IBqJRghgDTiJ0cDgfuB48cDhxc91gADIHQCFuhAABlEgQIEN8gohwA/rcoXYjbiKI9wI +SiRAAIkBL/24c9IMAAoqCeALAdjPcIAAXCMUiIfgHvQBhboQAAZRIECBGPLyDU/9z3GAABDOBJAl +gQq4MHAO8gohwA/rcobYjbiKI5wLSiQAAD0BL/24cwYMz/xODeAKANi6DgADogyAAFkBz/vgePHA +eg6gCADYYggP/c9xgAC8IBqJkg8gDTiJ0cDgfuB48cCiwYtwBg3gDAjZAMCA4M9xgACoOAChB/IG +FAAxA7EEFAAxArFSDIAAosDRwOB+8cCCCO/7gdihwWDAANgBHAIwA8zPdYAAxAcCHAQwiiCLB3IP +4AJf2YogiwdmD+ACIIWKIIsHz3aAAMgHVg/gAiCGz3CgACwgQBARAACFgOAP8s9xgACQBwCBgbgA +oc9xgAC0OAOBAeADoQHYAvAC2BpwAMD6D+/7CnHPd4AAtDgDEgE3XpeB2GCFDgmgDQokAATPcKAA +LCAQgEAfQBRMIICgEadIHwAUWPLPd4AABDkAh4wgw48a8oogCwDWDuACiNnPcIAAFFoKCIALIIVA +hv/YAKcYuRC6iiCLALYO4AJFeQDYAKUApgCFheAD8gDYBfAAhoTg/fUB2C8mB/AP8r4LYAMS2IDg +CfTPcIAA/FklgCOBIIEyCIALAIWA4ATyANgG8ACGgOD89QHYLyYH8AX0fguAAoDgEPKKIAsAVg7g +ApfZz3CAAJAHAIAvKAEA8g9v/U4gwAeJB6/7ocDgePHAJg+v+4DYocEDEgE3YMDPc4AAxAdgg891 +gAC0OAIcRDAvpShySiAAIAEcAjQKCKANCiQABM9wgABwKGQQBQBRJYCADPQAFAQwCiHAD+tyz3AA +AHYnGQfv/I/bz3CAAMQHAICA4DICAgCWCAAKgOAmAgIAz3CAAJQ3AIBRIACBFgICAIogCg+qDeAC +ARIBNtoMQAnPd4AAaLTpcN4K4AyKIQsPBZeGIH8MHHhTIICAB/TPcYAAjAcBgYa4AaECj1EgQIBc +9M92gABguPzcAiYAE6oK4AwY2a6XQiUEFowkB4HN9wohwA/rcs9wAACBJ7jbfQbv/IolBwHA3AIm +ABN6CuAMiHHA3EAWhZDPcIAAjAdMJQCAAiYBEyWgDPIKIcAP63LPcAAAdye920EG7/yKJIMPQRaN +kEAlhRBMJYCIQCWBHziozfcKIcAP63LPcAAAeCfD2xkG7/yKJIMPwNwCJgATz3GAACC0ogxgCqhy +LpfPcIAAjAcgsBjwHBcEEYwkCIDM9wohwA/rcs9wAACLJ8zb2QXv/IolCADPcIAAZLfaCeAMiHED +j4DgaAAuAADZz3OAALS6z3WAADS7z3aAAFS5ABYCQEAjAAw1eECgABYCQUAlABw0eECwABaAQFJp +VHraYhCqEaoSqgAWgEAUqhWqFqoAFgBBz3KAAHC7NXoasgAWAEEB4RuyA48QcbQHxf/PcYAA5LrP +coAAZLuKCuAG6XAmCWADEtjWDWAEBNgByM9xgABkvM91gADIB8AZAIDPcIAAxAcghQCAELkYuAV5 +iLneC+ACiiCLAAHZz3CAAMQHIKAAHQAUogzv+wDAggmAAoDgwAmCDQMSATfPc4AAxAdgg4DYKHKq +DWANSiRAACLwBIUB4ASlz3CgANQDHJBiD8AAAMBmDO/7AtkDEgE3z3OAAMQHYIOA2Chydg1gDUok +gAAiD6AJAtiKIEoPYgvgAgDZsQSv+6HA4HjxwAohwA/rcs9wAAAwJYojjAeKJIMPeQTv/EolAADg +ePHA4cUg289xoADIHGmhABYAQM9yoAAQFAyiABYFQAHdTCUAgMohwQ/KIsEHyiCBDwAALCXKI4EP +AAAJATAE4fzKJEEDGBpAAWgZQAED2A+iuaFqoZIPQABJBI/78cDhxa3Bi3WpcFII4AwN2QDAHXhT +IAEARCk+DalwACGBf4AAiMRCC2AKDdpeD0AAFQSv+63A4HiBBmANANjgePHA4cWswYogkg2OCuAC +vtmLcAoI4AwM2QAUADGA4BT0QCSAMM91gADgMqlxQgpgCi7aAdhgHQIQF4WA4OAL4fvKICEAABQA +MYHgGPSKININRgrgAs/ZQCSAMM91gADgMkAlgRsKCmAKLtoB2DeFYR0CEIHhqAvB+9IOQACJA6/7 +rMDgePHA+gqv+xfZt8GOD6AMi3AjwEojQCBTINEAhiD+A0whAKRCKBIBDBxCNI/2CiHAD+tyctiN +uIojTg8KJMAEEQPv/AolQAQSwc92gAAQxkEpQANTIBAAIMBAKU0hUSAAgKBm3WWGIPcPX/SA4An0 +CiHAD+tyc9iNuIojDwHf8c9ygAAENMASAAa/4Ev3iiOPAfJo9H9fZ2CnBB9AFCKnAeDFuMAaGAAB +wALBKnLWDa/7Zm2A4DTyCnDiDyANKnENFIAwhSDBAA0cAjCKIP8PU8AAham4AKUSwIYg+w8ouA2t +SiQAdADYqCDAAv/a22BAKUEhEOM7Y0CrAeAqcA4PIA2Lcc9wgADIHfAgAQS2EQAGDyBABLYZGAAB +3wPwAt/CCyACKnAG8IDgyifBFMonIhKB57D0IIXPcIAAyB0DgBiIKHaB4IYm+x8R8ooOQAKA4CCF +GvLPcIAAXCMUiIfgFPRBKUADUSAAgA7yE8DouBLCCvKGIvsPQSoEAk2NkHIE8qi4U8ATwBLCBnlE +eCV4gOYApYYg+w8L8oDgyiBBBMohIQCICGEDyiLhAwwdghQA2M9xgAAQyRYhQQRAhQCh9boBoQX0 +ANiLuAGh9roF8gGBhSABDgGhtg7v/ItwDRSAMFEgQIEN8lgUADEFtYDgyiBCBMohIgA0CGIDyiLi +Aw0UgDBRIECAGvJQFAAxgOACtRTyAN4Q2BpwApURIICDyiBCBMohggMECGIDyiKCA0IgQCCA4AHm +MfcNFIAwUSAAgQbyKnAiCeAAVRSBMA0UgDBRIMCAG/I1wVYUAjEqcHYMb/0Sw4wgAoC4cA30CiHA +D+tydNiNuIojkgHVAO/8SiRAAFElwIHKJyIRyg8gDSpwA8zXcAAAAEAB2MIgCgAXuMdwAA4AAIO4 +nbifuOxxAKEBEgE27HAgoFIMYADpcJUAr/u3wPHANgiP+892gAAENMAWABa/4KTBSveKIlILMmg0 +edlhQKEA2kGhQqEB4MW4wB4YEEojQCCBwJ4MoAxqcQDYavCCwJIMoAwC2QLAi3I6D6/7A8EEIMAE +LyMHoFryAMLPd4AAEMY1aiFnLblTIRIAwBYBFgDYv+EPIIAAS/eKI1IOsmm0fd1lYKVBpQgdgBQB +4cW5wB5YEM9xgADoBkCBLyEKIAQhgKAAoQb0gOJECGIEyiAiCCDA7g+gABDZAMAA3YoiCAA1aPlh +orFAoalxmg4gAw/aAMCA2jVoP2fPcYAAyB1Ir/AhgwRJr7YTAQYEIUEEthtYAM9xgAAQyRZ5oKGh +oc9xgABwxRR5oLFAIEAgGnAhwBJwLAfN/wPM13AAAABAAdjCIAoAF7jHcAAOAACDuJ24n7jscQCh +ARIBNuxwIKA2C2AAanBFB2/7pMDgePHAz3KAAAQ0wBIBBr/hS/eKI9MGEmkUeFhgYKAA22GgYqAB +acW4agpgCsAaGACGCkAA0cDgfuB48cDhxQAWDUADzAHa13AAAABAAcjCIooAF7rHcgAOAABmC2AK +UyUBEFElQJDPcYAAkDoB2MogIQD9Bm/7AKHgePHAocGLcAYLoAwB2QAUBTBMJQCADPQKIcAP63KJ +2I24iiNfCp0Gr/xKJEAAz3CAAAyxCgpgAAMYQgGhwNHA4H7xwCYKgAbPcIAAyB0sEIQATCQAgQj0 +DoBRIECBBPKaCcABEfBMJECAC/LPcIAAXCMUEIUATCXAgcwlYoIF9KoPj/vRwOB+CiHAD+tyz3AA +AOwcMQav/F/b8cDODU/7ABYSQQAWAEHPcYAAEMZAKkAhMCEFAKLBTCIApEEtQANTIBEAj/cKIcAP +63J12I24iiOVDEokQADtBa/8SiUAAFElQIIN8gohwA/rcnbYjbiKI9UM0QWv/AokgATPcIAAEMgW +IIAEGnAGCqAMAtnPcIAA8MQWIIAE9gmgDALZQCqVIQAlgC+AAJDJ4gmgDBDZi3DaCaAMAdkAJYAv +gACQyd4P4AUQ2QEQgCCQ4I/2CiHAD+tyd9iNuIojFgVKJEAAZQWv/AolgAQA3xDYenAVJcAjz3GA +AJDJMCEUAAQkgq8AAAABBBwANUfyIcHPcIAA8GEuYAQkgC8GAAAAMbig4d1g0SThojLygOID8oHm +CvYEJIQvAAAAJAwkgI8AAAAkJvKC4EgADQCC4AX0gOIe8oLmHPSA4gPyzOEY9s9wgABQLiCAYHkG +2BB2EPdRJMCiEPLPcIAAyB3wIEAEuRAABgQgvo8ABgAABPQA2QPwAdkveQPwAd2pcQQkgC8BAADA +LrjPcoAANG4IYhB1AdjCIA0AgOHMICKAGPJCI0AggOAuB+3/AecCEIAgz3GAAOhhCGGB4BzyCiHA +D+tyediNuIojlgo58QohwA/PcIAAyB3wIEAE63KKI9YJuRAEBnjYjbhBBK/8CiUABQMQgCAIYYLg +CfIKIcAP63J62I24iiMWCxnxJgsgDUpwz3CAAPDEFiCABECQz3EAABgVCSJBAH4PIAAgsPEDb/ui +wOB48cAAFoFAz3CAAKRbIKgAFoRAABaBQM9wgACtWyCoABaAQFAkvoHKIcIPyiLCB8oggg8AANoU +yiOCDwAAaAe4A6L8yiUiAM9wgAC4BgCQgOAF8hoJwAwaCMAMFg8AANHA4H7geIkDYAwA2OB48cBK +C2/7ANlKJABy4HioIIACABYCQBUiQDAWGJgAAeEAFg1AABYOQHIIgAzPcKAAFASsoM9woADUC9yg +xg4AAHUDT/vxwP4Kb/sI2aLBARIONs91oAA4LhwVEBA6D2AMi3AAFAQwAN8EJL6P8P8AAMohwg/K +IsIHyiCCDwAApijKI4IPAABEBgADovzKJcIAUSRAgsohwg/KIsIHyiCCDwAApyjKI4IPAABHBtwC +ovzKJcIA56V6CGANP9gAwAQUATEHpcINYAyCuRwdABQ2DiAAARqYM9ECb/uiwPHAANieDSAABBKB +MAQShTAKIcAP63I42IojzwyRAq/8SiQAAPHA4cWhwYtwjg5gDATZAg8AAoDgB/LPcIAAXCMUiIng +DvIKIcAP63LPcAAA1Btb20okAABVAq/8CiUAAc91gADIHQGFuhAABlEgQIHKIcEPyiCBDwAA1hvK +I4EPAABcAMoiwQfm8wAUADGA4MP2juDJ9gohwA/rcs9wAADXG13b2PGiDs/8guAn9ACFuhAABs9y +gABoI1EgQIEK8j6VDJIwcBvyABQAMTBwF/IAFAAxDLIB2MoKr/0IcQvIkLgLGhgwC8gFIIAPAAAA +1AsaGDDODU/7DvALyK64r7gLGhgwvg1P+wAUATHPcIAAaCMssBINAADJAW/7ocDgePHASglP+892 +gABkLgCGz3WAAHwvUSBAgiT0ANgQrQHYEa1WJoAVsg1gDAvZViaAFVUmwR2uCCAKC9oQjc93gAAM +L0QoPgtAJ4ATMiBADoHgAdjCIAEAEq0Ahom4AKYV8BCNMY0wcAb0TiBBAC95Ma3Pd4AADC9WJoAV +RCk+CydwVg1gDAvZcY1AJ8ASRCs+CzIgQA6K4MohyQ/KIIkPAADRG8ojiQ8AAPsAogApAMoiyQeC +4Mohyw/KIIsPAADSG8ojiw8AAP0AggArAMoiyweB4AHZ0fZCIHwA4HioIEADRCs+CwAnQB41eE6I +CogQciXyAeEveR4NAAKA4Bvyz3CAAFwjFIiJ4BX0Hg3P/IXgCfIWDc/8guAF8g4Nz/yB4An0z3CA +AKRaBYADgACA7gmP/dYLAAB9AE/7CiHAD+tyz3AAANMbiiOEAEokAABBAK/8CiUAAeB4zQEgBQHY +4HgVBCAIAdjgePHA4g8P+892gADIHQGGuhAABlEgQIEP8gohwA/rcs9wAAC+G4ojBAlKJAAA+Qdv +/Lhzz3WAAGQuAIXPd4AAYDD03Ii4AKUCJwATJgxgDAXZHxeBkM9woADIHBqACrnKuBV4OGCZIAoA +TR0YEM9wgABcIxSIh+Ad9ACGuhAABlEgQIEX8ogVABfPcYAAEM4lgQq4MHDKIcIPyiCCDwAAvxvK +I4IPAAAyAcoiwge+9cYKgAkeDyALAtg+Ck/8hgtgCgDY8gyAAtoKAACBBw/74HixBCAIAdjgeEUH +IAwB2OB47QEgDQHY4HjxwKHBANlAwQAWAkAAFgBAgeIa8gPM13AAAABAAdjCIAoAF7jHcAAOAABF +IAADnbifuOxyAKIBEgI27HBAoOxwIKAf8MYNYAWLcAPMAdnXcAAAAEAB2MIgCgAXuMdwAA4AAIS4 +nbifuOxyAKIBEgI27HBAoOxwIKAAwuxwQKB+CiAAKHChwNHA4H7gePHAbg4v+wLZz3eAAMBbngtg +DOlwQIfPdqAA7CfPdYAAUC7gukvyK4ZEIoAAhiL/DiK6obkUurS5BSCDAGV5K6YEIIAPEAACAAQi +gg8QAAIAz3GAAMgFRXgLoSCFBN5geclwh+AL8iCFYHnJcIbgB/IghWB5AdiB4BH0AIfPcaAAyBxR +IECAB/IB2B6h7g6ABQXwANgeodYLQAUghWB5AdiF4DX0AIdRIMCAMfLPcKAARB3FoMOgxKAp8M9w +oADIHAHZPqALhoG4C6ayDoAFIIVgeQHYheAT9M9wgADIHQOACIBRIACAC/IA2ZS5z3CAAMgFK6AL +hpS4CPDPcIAAyAUA2SugC4a0uAumIgkAAMkFD/vgePHAz3CAAPATjgpgDALZCgkAANHA4H7gePHA +Rg0v+wDaCHUods9woADUCziAQiEBCIDhyiGMAEAmABIQcbAPxQwDzNdwAAAAQAHYwiAKABe4ACCB +DwAOAAAHbgQggA8AAPz/JXiduJ+47HEAoQESATbscCCgIr4G8OxxAKEE5WG+geYAhTr31ggAAEEF +D/vgePHA4cXPcqAA1AsD3bGiANtwogMSAjfXcgAAAEAB2sIiigAXusdyAA4AAEUiAgadup+67HNA +owLaFBqCMAUSAzbscmCiCxICNwHiCxqcMOxyAKIBEgI27HBAoOxwIKAB2M9xoADIHxOhWIHscECg +GYFaCAAAz3GgAMg7DoGIuA6hwQQP+wPM13AAAABAAdjCIAoAF7jHcAAOAABPIIEAnbmfuexwIKDP +cKAAFAQD2SWgARICNs9woADUC02gz3CgAEQdNaDgfuB4A9rPcaAAFARFoc9xoADUCw2hz3CgAEQd +VaDgfgPaz3GgABQERaHPcaAA1AsNoeB+A9rPcaAAFARFoc9xoAD8Cwypz3CgAEQdVaDgfuB+4Hjg +fuB44H7geOB+4HjgfuB44H7geOB+4HjgfuB44H7geM9zoACoIDGDz3KAAPQoA4I4YAOiAdgSo+B+ +4HjxwHILL/u4cc9wgAC8pGAQBABKIAAgTCSAgMoixgfKIIYPAACRDMojhg8AAK0HjANm/Mohxg/P +cIAAbAYHgIQsCAgAIYF/gADcoEwlAIAWeceBPvTPcIAAfCl2Cu/8iiEPD89wgAAQKWYK7/wg2c9w +pQAIDKCAUyVNkBPygeUT8oLlFPIKIcAP63LPcAAAkgyKIx8FmHUlA2/8CiUABP/YBvD/2Ai4BPD/ +2BC4z3GAAMgFDKGtoc6hANmRuc9woADQGzGgIgxgCwHYH/DPc4AAyAUOg4DgG/TPcYAAUGPPcoAA +fCnPdYAA9CiKJMN/CnCoIMACD2EVJcMT54PwIg4AAeD+Zsej0QIP+zgTBAAKIcAP63LPcAAAkwyK +I58JnQJv/AolAATgeOHF4cbPcKAAFAQD2SOgFcjPcoAALLJhks9xgAAcscSKFCENAGi1ACCDD4AA +PLE44cCrYoIVeQaSYKEDEgM2wB0EEASCoBMBAIYhww8leKAbAADBxuB/wcXxwPoJD/sIdrYO4AEo +dYDg0SVikwHYA/QA2AS4z3WAADDOFHgJZYHhHWUK9DYIYAupcK4Kr/0BjQDYAK0BhSkCL/sApvHA +qgkP+6LBFRICNs92oAC8Lc9wgADIHU6mJIAA3UYREQENEhA3VSFGCkYgwCADEgM2DRocMKQTAACE +uKQbAAABk1UhSAmA4FUhxwiGG0QDCPLPcIAAHLL0IIAAgOAJ8gGD7rgF9FAgACAvIAggUyB+oFQD +AQDPcIAAkDpmEAAGz3GAAJA6AeBmGRgABBIBNqQZQAMBk4DgRfLPcIAAHLFUeIAQDweA5z300BAO +AVMmzpAV9HITDgHgk8J/uBOOAMJ/8H/gGMQDpBMOAIYm858F8mi/8H/gGMQD4BAOAXATAAHhkwJ+ +EHbCII4DwicOEHQTAAG4E44A+GDYYBB4kBkEAL4ZBAB0GUQDoLEQiwDeEKkBgwGhCIsIqRKLEqmW +vjDwD4b3uP/zz4b2vlMmwBIo8o7gTvfPcIAAkDqcEAAGtr7Pc4AAkDoB4JwbGAAa8GS4EHiQGQQA +BCaAHwAAAPAsuBCpdBlEA6CxobG+GUQDAYOoqYYg/w2EuAGhEosSqfa+RAIBAADY9b6WuKQZAAAS +8voPb/4A2AQSATakEQAABCCDDwIAAAAtuwUjAgQvIIggPvABgVEgAIFQ8nCJz3eAABDGFWsAZ096 +9rjSiUkiwgAI8s9wgAAQyHZ4AYgD8ADYx3KAABDIdnpEiggmjhAIJgAQSSDCAxZrVXjPcoAAkMkC +Ys9wgAAQyXZ4z3OAAMgdZIN4gwGAZXgEIIAPAAAACAZ6ANiWuJgZgAD0uEGBhiL/DSDygOJT8pgR +ggBAJwAJSmDPc4AA3KZAwiDAw7gcePQjAABX8AohwA/rcjTYjLjPcwAArQuKJIMPiQcv/EolAACY +EQMA6bucGUADJPKA4oC4pBkAACvymBGAAIYg/wNEuDImAgDPcIAAyB0DgIm6QMIgwxSAZHiGI/8D +hiD/DkS7eGAPeM9zgABwYvQjAAAh8FEjAIIJ8oDiCfKYEYIAQCcACUpgDPCA4gT0ANgIchHwmBGA +AMO4HHgyIAIQQMIgwM9zgACEpsO4HHj0IwAAhBkEAJgRAACIGYAAkBEBAb4IIAAA2gQSAzYDEg02 +z3agAMgfhBMBAYIbBAAZYTB5sBtEAPgWAhCwFQARQngAIE8Ez3CAAMgdRIBUEgABH2c/Z6AWDhDw +f9F3OgANAFCCmBUOEAsigIMX9HCLUI1wctEmIpIa8pgVjhDPc4AA8GHLY4Hj0vYFus9zgAAQxkJj +8boK8s9xgACQOq0RAAYB4K0ZGAAQ8DhgEHiGHQQQz3GAAJA6ZxEABg0aHDQB4GcZGABFBu/6osDg +eKHB8cDWDc/6CHVHwOi9KHDiACEASHYDuEAgkQUnwc9wgADwYQQlkh8GAAAAQSpCJCtgBCWAH8AA +AAA2uKl3emLPc4AAAG7GvwhjSmMaYkEtgBJSIAAAwLgDuBjgheLKII0PAQCJDdUgjgAvIAggBCWC +HwAAABjPcIAAAGXXcgAAAAgeACIA8CDAA6DhEgABAM9xQnvQXgUofgAKIMAOKnEFKT4ACiDADkwi +AKAkuAHgBPJTIAEAOGDtvQIogSPPcoAAyB1EglYSAgER8s9zgAA8ZmCTBSs+AAAhgH8AAP8/Lrg4 +YJUAIABYYBV5jQAgAFhhUSVAklIAIQAnxbflIgALADNoUyUCEM9wgAC4YvAggAAFKT4ACiDADgHg +BvCK5cAo4QDAKKIAz3GAAMgdI4HA2jSBpHmGIf8OIrk6etp6OQAgAFhgM2hTJcAQHHjPcoAAgGbw +IgAAFuEFKT4ACiDADs9xgADIHSSBAeBWEQEBFXkU2Np4OGAQeAjcuwTP+s9xoACwHzuBQSiCBdW4 +QSmDBdW5AnnPcIAAEM5iegWAyboFKL4AJ3HPcIAA7FoDgACA4H84YOB4z3GgALAfO4FBKIMF1bhB +KYIF1bkQcVtjSffPcoAAEM5FgllhAnkB4wLwAnlAK4AFmQfv/yV44HjxwOIOz/ruC+/6UNlFwEog +ACD+DS/+hsVMIAClBBUBFE73BcDXca3e774VIAAEIKBAIFAg8vUk3B8Ez/oKIcAP63LPcAAAixOK +IwcHmHPtAy/8CiUABOB48cCeC+/6mHCC4LhxyfcKIcAP63J92I24yQMv/Orbz3CAAMgd8CABAUwl +AIAocIAgCwlAIA8GM/RIgQDbQKBJgUokgHBBoFyJSKhdiUmoKhGCAEqoKxGCAEuoLBGCAEyoTZFH +sFeRSLBIgQQigg8ABgAAgOIB2sB6UqhbgaMYmACoIAADtJGEKwQPACBCDgHjtqqogcC9tKor8Ewl +QIAr9ECAAN1IoUGAAt5JoUiIXKlJiF2pSogqGYIAS4grGYIATIgsGYIAVohUsUeQTbFIkFexoxAA +BhuhhC0EHwAnQB4uCiAJqXFhvoDmAeU29xkDz/oKIcAP63KQ2I245QIv/IojhAfxwJoKz/rPdoAA +ZC5dFgEWXhYCFjBypMFI96wWABACIYMAeGCsHgAQgOEO8oDiDPRfFgAWOGBfHhgQYBYAFjhgYB4Y +EM93gABQBgCHgOAA3QPyYB5YE2AWABZDwkDAXxYAFkLBENm+2kHAi3Ae28II4AgYu14eWBNdHlgT +oKeFAu/6pMDgfuB48cAIcRYJIAKKIFkBQgqP/NHA4H7xwOoJz/qhwTpwKHVIdppzCiMAIQoiQCHI +dwogwCGKIBkC5gggAgvBLMCA4CgUBTAJ8ipwqXHJcgpz7g3gCJh3EPAAHEAxKnCpcclyinMKJMAE +CiWABNh3GgqgCQonAATdAe/6ocDgePHAjgnP+jpwz3aAAHQcAIYB4IHgz3WgAMgfAKYN9AHYUR0Y +kCDf8KVDHRgQANh6CqAMjbjxpaQVEBDPcIAAVDIGgM93gABUsEB4AYeA4CryJNgY2XoKoAwz2oHg +DvIEFwUQCiHAD+tyz3AAAHQZmttpAS/8CiRABCTYAdlSCqAMM9qB4A7yBBcFEAohwA/rcs9wAACr +KJ/bQQEv/AokQASkFQEQiiAYD/YP4AECIQEEAIZCIECAAKYE9ADYUR0YkC0Bz/rxwNYI7/qKIBgO +z3aAAAA4yg/gATKGz3CAAFQyBICA4An0z3EAAK0Lsg/gAYogGA498DKG5OHX9s91gADUWwCF2uBR +9oogWA6SD+ABBNlAhTKGiiCYDhC6gg/gAUV5BNga8NrhRgAKAM91gADUWwCF5ODd9oogWA5iD+AB +iiE/D0CFMoaKIJgOELpSD+ABRXmKID8PCg1ADCCFSBYAERC5ng7v/yV4EoYApZkAz/rgeM9wgADo +N0CI4LoI8s9xoACsLxmBirgZoVEiQIAH8s9xoACsLxmBjrgZoeB+z3GgAMg7HYGA4AjygtgUoc9w +AIARFA6h4H7geM9wgAD4siyIz3KAAHyXjCECgAqSQSgDAwvy67gJ9AW5x3GAABDGApEPIMAAArEA +2OB/DLLxwKYPr/pUaIYi+ANPIkMCUyHCAAUixADPcoAAcMUUeo/hiiMPDMogKQAJ9gCSAN0PJU0Q +iiPPD6Z4ALIA2UokAHTPdoAAVJrPcoAAzJrPdYAA0JqoIMAEFCJAAOSQZH+Qdwz0AN/ksBYmQBDg +oOGgQCUAGTV44KAB4ZUHj/rgePHAKg+P+kh2gOAB3UT2iiX/HxN4gOFE9rN9M3kUIQAAUgjv+jt5 +rHgAHkAeaQev+gHY4HjxwOHFCHIB3YDhyiHBD8oiwQfKIIEPAACbE8ojgQ8AAEgAyiQhABAH4fvK +JQEBgOJE9lN6iiX/H4DhRPYzebN9FCGAAPoPr/o7eax4HQev+i9w4HjxwOHFz3WAAHyXz3CAAMgd +I4BAhQCBEHIe9AKRQpUQchr0AoVeDe/7I4WMIAKAFPLPcoAA5AYhggDbDyMDAAW4ZnkhogAggQ+A +ABDGAIGquIi4AKEA2MEGr/oMtfHARg6v+oogSQZCDeABiiFECIoPAAzPdoAAcLAIcYTgzCEighH0 +z3CgACwgEIAA2kKmA6bPcIAAmJcCgNW4x3AAAIgTCaYNhoDgyiEiAQDdNglgDKlwhOAD9K2mQPAC +hoDgz3aAAAQ0HfKKIIkJiiXFEdoM4AGpccAWARa/4QXaS/cSaRR42GDPc4AAUAdgg6CgYaBCoAFp +xbjAHhgQBdgc8IogSQeKJQUTogzgAalxwBYAFr/gAtpL9zJoNHnZYc9zgABQB2CDoKFhoUKhAeDF +uMAeGBAC2KYJwAPVBY/68cDhxc9wAAD//891gACYlwOlz3CAAFRZkg1ACs9wgABsWYoNQAoA2SCl +BdgBpSKlLglgAgLYpQWP+uB4B9nPcqAA1AcaGliAgOAO8hkSAYYJIEMADxIBhgIgwIB5YQ8aWID2 +9eB+4HjxwOHFCHUVEgE2z3CAAByxNHgRiIDgEvIDyAGA7bgO8s9wgACMb/AgQADPcYAAAB0UeQCR +EOAAsVYMgAvCC+AFFcgDyAHZoBhAAM9xDwD//8YIIACpcB0Fj/rgePHAmgyv+gPaz3OgANQHExuY +gA8TDYYAFgBAABYBQKLBQMEgwJzgD/IKIcAP63I12Iy4z3MAAMQMmHOpBO/7SiUAAAAWDkDQfgAW +EEBWJgASUSAApcAgogAD4AQggA8AAPz/GRMOhkIgDwTRdzv3HWUPG1iDIBuYgBkTAIaI4JP3HxMA +hkHAIcCc4Mohwg/KIsIHNtjKI4IPAADhDM8gIgPM9QYL4AHa2AQggC8AAABATQSv+qLA4HjxwN4L +r/rI2oIkAzIIdSh2z3GAAPRe9g2v+otwAdrPcKAAFAREoM9ygACIOxWCANkB4OK9FaLKIEIgBfQO +D8//GnAVyM9xoABkLs9yoAA4LvAhAAAngtO4JHgEIJEDsPDqDs//z3aAAKDUGnDJcBIKIASLcQoK +oAzJcKLwA9/PcKAAFATwoOSgABYAQAcaGDAAFgVAARpYMQTKnOAe9Itw0g+gCw7ZJMHhvlMhwACG +If4DRLnEHEIwZMBEJo0UG/KO2FEmAJGQuKAcADBv8obYkLigHAAwa/AKIcAP63LPcAAA3A7PcwAA +ygpBA+/7SiRAAEwgAKAH8ozYkLigHAAwVfAFuMdwgAAQxkCASHSEJAyQDvJRIkCCB/KL2JC4oBwA +MAHdQ/CI2JC4+/FMiFBxyiCCDwAAkQDPICIE8fUBwfq5CPIB3ZDYkLigHAAwL/AikDMUgDARIQCA +FfIHyAQggA8AwAAA13AAwAAAC/QiwIDgyiCJDwAAjQCmB+n/zyApBArBjCH/jxHyz3CgACwgEIAi +eNdwAIAAAMoghQ8AAIcAfgfl/88gJQRMIACgzCUhkFj1z3CgABQE46BMIACgqXZe9VMmfpAH8s9w +oAAUBAmAgOBU9eG+M/JMIQCgAdoq8ipxLyhBAE4ggweU48olxRCF92h1gCXCFM9woABoLPAgQAOU +4w94yifFEIT3aHeAJ8IRz3WgABgs8CXNE7FwyiIiAIDiCvIA2A8gwAAGIQGA2vUB2APwANiA4CDz +AQKv+oAkAzLgePHAmgmP+hpwWgkgAjDYmHApuFEgAIDKIcIPyiLCB8oggg8AAOkUyiOCDwAAxwC0 +AeL7yiUiACzYbgkgAkAogSAB34ogDwoacBoJIAIw2JhwKbhRIACAF/KMJw+aMfIg3c92oADIH7Cm +AdhDHhgQANg+CmAMjbixpkIgQCCA4AHnI/fiCCACNNhPIAEFlbkaCSACNNjOCCACLNgIdcYIIAI0 +2PW4uHAY8gohwA/rcs9wAADrFOPbLQHv+0okAAAKIcAP63LPcAAA6hTU2xUB7/tKJQAAKQGv+kEt +ABTxwL4Ij/oIdwDeyXCaC2AEyXED2Ml1gOcacAryz3GAAExYE20UeOYIYAo4YIDnCvLPcYAA3FgT +bRR40ghgCjhgQiBAIIDgAeUn989wgABMpcl0nbAwvJ6wz3CAAMwHzg+gBcCgvQCP+vHAIg1AAYDg +EPLPcIAAZC4AgFEggIIK8s9wgABEWoYIQApiD+AJANjRwOB+8cCiCW/94cXPc4AAkDrPcYAATFtA +gfQTDQBQdQDYivf4EwEAMHIG9/wTAQAwcsP3Adh1AI/64HjxwM9xgABIBnzY9g6gASCBCiHAD+ty +z3AAANsO8NtKJAAAGQDv+wolAAHgePHAkgxAAYDgMPLPcIAAZC4AgFEggIIq8s9wgAB8L3CIUohE +Kz4LACGAf4AADC9VeA6IgeAA2Rr0z3KAAERaBYIDgGCAAoJieIDgyiBLAAXZC7kwcEr2BYIDgCCA +x3EAAAAoJghgCkhw0cDgfvHAWg9P+q7Bz3agANQHA90THliTDxYQlhkWAJbA4L73ABYAQAAWD0Dv +eJzgyiHCD8oiwgfKIIIPAABAAM8gIgPKI4IPAABlDMokwgBUB6L7yiUiAItwlgugCw7ZBhQBMQAU +ADFRIQCBwCCiAAPgC8MEIIAPAAD8/4DjViABAg7yz3KfALj/eqIsw3uiAsN+os9zAGwEAHmiGRYC +llBwPvcAIQAEDx4YkCAeWJPg2LoNoAHpcQHABCCADwAAAEABB2/6rsDxwJIOT/oIds9woABkLvAg +gAPPd6AAwC9TINAEFRIRNhUamDP12AW4eg7gAclxFcjPdaAAFAQKpQmFgOAAD8L/URcAlgsgAIT4 +9c9wAABkHg4OwAERIICD8PMJhYDg7vUVGlg09dgFuDoO4AEqcRXICqWBBk/64HjxwBYOT/rPcKAA +VC4rgAfd07kvKEEATiCPB89woADAL6UQEoYUEBGGz3agABQEqqayDCAIgNjz2AW4gNnuDeABn7kV +EhA29dgFuOIN4AGpcaqmFRpYMwTwA9gFpqmGgOUb8oDl+vNBLYCQCvIvJAlw4HioIIABABYAQOB4 +UyVNkAnyLyRJc+B4qCBAAQAWgEDgeKmG5/Hz2E4N4AEFuP+44fX12AW4hg3gAQpxKB4AFJTnFRoY +NMohxQOF9+lxgCHCAc9woAAYLPAgQgCU58ohxQOF9+lxgCHCBM9woABoLDV4BL9AoMd3gADMwhWH +NocFeReHuIcleAUlDZDKIcIPyiLCB8oggg8AAMIhyiOCDwAAywbKJEIDTAWi+8olIgCA2c9woADQ +GzCgz3CgAMAvpRiYhBQYWIQ5BU/68cDWDE/6osGkEQAAKHVRIACACtjKICEEmBUBEAQhvo8BAADA +dh0EEDH06LlBwRfyIcLPcIAA8GFKYAQhgA8GAAAAMbhYYAQhgg8CAAAB13ICAAAByiChAALwAdiB +4BDyguAJ8oPgANjKIOEBwCihAwrwz3CAAAyxAoAG8M9wgAAMsQGABXmYHUAQnhUAEZQdQBCSHQQQ +EI3PdqAA1AdAwIIVABGyHQQQANiAHQQQfh0EEAPIQZCA4pAVExEJ8hXIz3GAAByy9CEAAIDgEvIZ +FgCWuOBO9w3Mz3GAAIg7RiCAAg0aHDAXgQHg6QMgABehDxYQloDiCvIVyM9xgAAcsvQhAACA4AXy +SiFAIAbwA9gTHhiQSiEAIAcSDzYBEhI2ABYAQAcaGDAAFgVAARpYMQTKnODKIcIPyiCCDwAA3A7K +I4IPAADKCsoiwgdL9KlwIgigCw7ZTCFAoBD0BMgBkIDgIvLPcYAA/DwPgQHgD6ERgQHgEaEY8API +AZCA4BTyFcjPcYAA7LH0IQAAUyDAgAr0z3GAAPw8D4EB4A+hEIEB4BChAxIBNgGB7rgM8lQRAAFT +IMCACPTPcYAA/DwOgQHgDqECFQURTCUAgA/yAYXuuA3yCiHAD+tyLtiMuIoj3gZJA6/7SiRAAACV +sHDKIcwPyiLMBy/YyiOMDwAAngfPICwD7/YwjVMhwAAQrYYh/gOkFQAQRLn2uMQdQhAk9AcSATYC +IcIDgeIA2AbyAidCEIwiw48D9AHYgOAU9A3Mz3GAAIg7RiCAAg0aHDAWgQHgFqEPHhiUBxrYM3UC +IAABGpg0BxrYMwEamDQA2HQdBBBmC2AAqXDPcYAACG4KYXQVAREAIkYAz3GAABBu8CEBAC8miAGk +FQAQdB2EEQV5pB1AEATIAZCA4BXyTCFAoA70QZW4FYAQwHJglRpiUHq+HYQQwHMAIwUADvC+FQIR +CfBAlbgVgBDAchpiUHq+HYQQuHKQHYQQDCNAocohwg/KIsIHyiAiDM8gIgPKI4IPAADcByQCovvK +JMIEAMAQFYQQkHAM8gohwA/rcjHYjLiKI58HBQKv+wAUBTAPFgCW+Lm0HQQQB/K2FQARDx4YkJ3w +ABYPQfy1ABYAQUQnBxMdtQAWCEBMJwCBPB0AEgAWAEFAHQQQABYAQBGlABYAQUgdBBAa8hjYch0E +EAAWAEBMJwCCE6UAFgBBUB0EEAAWAEFUHQQQCPTpcIYg8w+MIAyADvIY2BbwENhyHQQQANvPcIAA +LLJnsBDYDPAe2HIdBBAAFgNAdqUAFgNBXB3EELh3hiX9DIwlAoIJ9ALgEHhyHQQQABYDQQLwANvh +uGAdxBAE8gAWA0EodIQkDJAE9ADbJPBMJwCAGfRRIACQ0SEighXyqLnPc4AAEMakHUAQQCxEATAj +AwH+uwXyi7mkHUAQANt6pXul5PEAFgNAeqUAFgNAe6UI2wIiggECemJ6uBWDEJi5pB1AEHhgEHhy +HQQQuhUAEWJ6UHpwHYQQ5XgctQ8WAJa2HQQQpBUAEAh0hCQakCTyUSBAgh/yA8gBkIDgG/IVyM9x +gAAcsRR5gBEAB4DgEfTQEQABahWPEAHgw7j4YA94ah0CEKoP4ACpcGodwhME8J4P4ACpcA8eGJRd +AG/6osDgePHAAghP+hpwKHXQiQDYpBkAAM93gADIHSSHEKEHyAQggA8AwAAA13AAwAAAFvQVyM9x +gAAcsRR5EYmA4A70z3CAAPDE1ngiiAiNEHHG9gpwlg+v/alxz/BRIACgevIEFQQQUSQAgTvyFcjP +coAAHLEUehEShQDPc4AAEMZVbkJjD3j2ujKNSSDAAAjyz3KAABDI1npBigPwANrHcIAAEMjWeASI +CCEBAAghgQCgcUkhwQMWbjV4RIfPcYAAkMkBYc9wgAAQydZ4WIIBgEV4BCCADwAAAAgGeQLwI4WY +HUAQBIcIgAQggA8AQAAAQSiCB1MkAAAe4lh4JXj+uJgdABAK8qQVABCMuKQdABBQ2JwdABBx8P+4 +EfKkFQAQjbikHQAQz3BAAVAAnB0AECSHEIGeuBChX/AA2KQdABAF2BS4nB0AECSHEIGeuJ+4EKFT +8FEgQKdC8gGFUSAAgTPyEo1UEoIwSSLCADVuz3OAABDGIWP2uQfyz3GAABDI1nkhiQLwANnHcoAA +EMjWekSKCCCAAAggQABJIMEDFm41eESHz3GAAJDJAWHPcIAAEMnWeFiCAYBFeAQggA8AAAAIBnkC +8COFmB1AEBXIz3KAAFSxFXogogDYBPAF2BS4nB0AEFEgAKUA2M8gYgTKICEApB0AEAPIAYDPcaAA +wB3suACB0CDiAM8g4QAAoQDYdB0EEO4OIACpcM9xgAAIbgphdBUBEVlhMHl0HUQQz3GAABBu8CEA +AKQVARAleJgVARBRIUCCpB0AEAvyCtl2HUQQeB1EEIC4pB0AEBLwENp2HYQQI4cogVEhwIAI8grZ +eB1EEIO4pB0AEATweB2EEPoK7/ypcKQVAhBEIn6CjBWBEBbyA4cUgCR4hiH/A0S5hiD/Djhgz3GA +AJhi9CESAM9xgABwYvQhEQAO8MO5z3CAALSmPHn0IFIAz3CAAISm9CBRAJgVBRDgusogQgQW9IgV +gBBRJQCCw7gceNEiIoUH8s9xgADcpvQhAAAG8M9xgACEpvQhAAAhhVEhwIDKICEAUSUAgoQdBBAk +8pgVgRDPcIAA8GF1bilgBCWADwYAAAAxuBlhz3CAABDGYGD7uBHyl7qkHYAQBNi4HQIQANiPuLod +BBDPcAxAqP4ZpQPwAdkDEgc2AhcAAYDgJPIVyM9zgAAcsvQjAwCA4wL0YZW4FYYQdBUEEQQlvo8B +AADAACYAAXhgEHi+HQQQDvQKIcAP63Is2Iy4iiOaAKkEb/uKJIMPYJXm8YHhHfKC4cwh4oDKIcIP +yiLCB8ogYgvPICIDyiOCDwAAkwbKJCIAeARi+8olAgHPcIAAEMjWeAOIBvDPcIAAEMjWeAKIjBUB +EA64JXiMHQAQBIcbgIDgCPTPcIAArFsAiIDgYfIVEgM2huNd8gCVr+DPcYAAgDyqAAwAz3CAAByx +dHgRiIDgS/SkFwAA7LhF9FEiAIA/9FEgAKA78p4VABHPcoAA6DyKuJ4dBBAA2BuhAJIB4BB4ALIB +yBmhmBUAEK64r7iwuJgdABAkh1uBLyqBAE4igQcjuQ7hDyBAAKQVARCYHQAQtLmkHUAQnhUBEae5 +nh1EEM9xgACgWwChqLiruJgdABAN2JgdAhAL8BDYCPAI2AbwBNgE8ALYAvAB2BuhmBUAEL4VARFO +DS//ANqkFQIQBCK+jwAAADCCHQQQUvKMFQEQnBUAEZQdQBCSHQQQ7LqAHUQUAxIDNgzyFNiQHQQQ +fh2EFHgTDgECIoAjEHgN8A7YkB0EEADYfh0EEHgTDgECIYAjEHiyHQQQz3CAAMiwAICGIH+PDvSY +FQ4QUSZAkgj0YZOA4wb0kbqSuqQdgBAQuAV6pB2AEAQhgQ8AAAAQRIdSIQEDEIIFeTCiRIcQggQg +gQ8AAAAQPXkleBCiFfCYFQEQsh0EEJQdQBCeFQERkh1EEL4VARGQHUQQANmAHUQQfh1EEIAVABF+ +FQIRghUBERpihBUAEVlhOGAQeIkCL/qwHQQQ4HjxwKIL7/zhxc9ygAC8WiCCg+FKAA0AMyZBcIAA +GF5AJ4ByNHgAeBIJIAoD2J4IIApA2ADZz3CAAAw7OaAP8M9zoACoIDGDAoIA3aKiOGDPcYAADDsZ +oQHYEqMB2c9wgAAMO0UCL/o4oPHAygkv+rhxz3KAABDGBbkwIkQAUSRAg6LBBvLPc4AA5CMF8M9z +gABoHkAjAgZAIwEHUSRAgsoiwgfKIIIPAADLIsojgg8AANsDwAFi+8ohwg/PdoAAkMlALY0Bpmbo +vkDGIMUE8sK9qmEP8FEmQJIH8kQlARxEuSpiiboF8FMlwRA8eSpjz3GAABDIFiFBASKJDrlFeSCg +nQEv+qLA4HjxwJhwuHEUec9wgADgYShghODKIsEHyiCBDwAArBPKI4EPAAAGA0QBYfvKIcEP0cDg +fuB48cD2CC/6B9jPcaAA1AcaGRiADhEChhUaGDDPcKAASCxeoB8RAIYHGpgwARoYMATKnODMIIKP +AACRAAbyABYAQAAWAEADzM9xnwC4/xihiiBGBKoPIAEBEgE2z3OAAAQ0wBMABgESAja/4AcSATZJ +93/esmi0fX1lwKVBpSKlAeDFuMAbGADdAC/6BMrxwLhxz3KAABDGBbkwIkQAUSRAgsoiwgfKIIIP +AADLIsojgg8AAMIDgABi+8ohwg9ALYEBz3KAAJDJIWJRIUCCiiIIBcoiYQPPcYAAEMgWIUEBIokO +uUV5IKDRwOB+4HgUeDhgz3GAAPBu4H8IYeB44H8B2M9wgAAgVuB/AIDgeM9xgAAwOeB/8CEAAPHA +mHAKIcAP63IKJcAHz3AAAJ8ZCQBv+0Pb4HjPcYAADDngf/AhAADxwJhwCiHAD+tyCiXAB83YBbjl +By/7TNvPcYAARDngf/AhAADxwJhwCiHAD+tyCiXAB89wAAChGb0HL/tV2+B4z3GAAIxaBYEDgM9z +gABkLkCAAoFCeEggAgDPcIAAfC9HEwEGAogieIgTAQdhuAUpPgBAKYBy4H9YYOB4z3GAAKRaBYED +gECAAoFCeOB/SCAAAOB4z3GAAPQGI4HgfyCgEYjgf8K44HjPcYAA7FpGgYDiiiH/DyCgBfIigiCg +AdgC8ALY4H7geIoh/w8goM9zgADsWkaDgOIS8iSCUSFAgAvyz3GAAIRZMHIH8s9xgACcWTByBvRA +glBz8fUC2AXwIoIgoAHY4H7xwLYLwACA4PAOYgnKICIA0cDgfvHAz3CAAHwvUIgyiEQqPgsAIYB/ +gAAMLzV4DoiB4Br0ZgvAAIDgFvLPcoAAyB0AgoohFQUk4CBghiB/jgr0AYIk4CBghiB/jkQMYQnK +ICEA0cDgfvHANg7P+c92gAA0p0SWlOLAIoYPAACTAM9xoABoLPAhkQCA4FXyL47PcIAAEMjPdYAA +yB02eCKIA4UA389yoAAsIDQQEAE8EhIADo6A4IQAKQDKIKkAjCIBpHgAJQAE2OWiUNhFIUECGNqC +CSAMINv4uAjYLvQD2M9xoAD0BwWhhNoNcECwQiIAKA1yALJAhg1wQKBClg1wQLADhUCADXBAoAOF +QpANcECwBpZAKQIlw7gMuIK4BXoNcECg5KEOjgHgDq6SDyAKCnAB2BXwANgA2s9xoADELEehSKGm +lgy9n70FJUMUZqFOrs9ygACIOzuCAeE7op0Fz/ngePHAQg3P+RpwhCgICAAhgX+AANyghhENBs9w +gABsBgKAoL2GGVgDBIiA4BHyA4GA4A30CiHAD+tyydgEuIojHAwKJAAERQUv+7h1AoGA4Bv0z3KA +ANioERIAhowgw48K8s9woACwHxuAAqEaGhiEFvDPcIAA7CgAGAAEHgpgCQDYDPBiCA//hCgIKAhx +ACGAf4AA3KJuDYAJDQXP+fHApgzP+RpwiiBMC6YLIAEKcUwgwKDPdoAATKWT9x6WOhYFEQohwA/r +chC4BSUFAM9wAACDDIojBQ+1BC/7CiQABEAoDyHfZyWXBJcQuSV4gOA58s9wgAAUb/AgAQRAKM0g +tH0AJYAfgACgWCCgI5cClxC50g/v/iV4CHEAJYAfgACUWOIMgAnPcIAACG/wIAEEACWAH4AAEFhH +lyCgI5cClxC6ELkleCaXng+v+0V5lg/P/ghxACWAH4AABFiqDIAJXpYdlgDZDyEBBBC6RXgGIECA +Ad0dtjC4HrYY9M9xgAAcLgCBoLgqCyAFAKHPcKAAsB87gM9wgACMpaKgltohoAzZHts6CuAHGLsQ +2s9xgADMBwCBACoCBEZ47QPv+QCh4HjxwIYLz/kA3892gABMpT6WDycPEB2WELkleAYg/oNA9M9x +gAAcLgCBgLgAoc9wgAC4Bs9xgAC8IACQWokQchv0z3CAALoGAJBYiRByE/TPcIAAvAYAiDaJEHEN +9AvIBCCAD/7//wMLGhgwC8iHuAsaGDDPcKAAsB87gM9wgACMpQDdoqAgoAzZltoe244J4AcYuwHY +qXHaC6AAgNo+lh2WELkleOV4HbYwuEUD7/ketvHA4cW6DKAAKHWA4MogQQOoDaEDyiFhADUDz/k1 +B8//8cC6Cs/5z3aAAMwHAN0L8BDYuHgLIQCA9A3i/8ogQgMB5YPlIIa294DhyiAhAGwNoQPKIQEA +8QLP+eB48cB6Cs/5ugjgCADez3CgANAbEYDvuAvyrgkgCgHYz3GAAIA8HYEB4B2hBshRIACAAxIN +NhvypBUAEPK4F/LPcYAACDkAgYDgEfLAoVEhgMX+889woADELMuA39gmCSAByXH+vlMmgRQe9AMS +ATagEQAA8LgA3b3yiiAIAAwaHDD62AIJIAGgEQEAAxIDNqQTAQD4uRDythMBAc9woACYAz6g2vCA +4ePzmBUAEOoL7/4A2t3xABYCQVyzABYAQR2zABYAQJhwD6MAFgBBQBsEAAAWAEARowAWAEFIGwQA +RCIAA4TgGfIY3nIbhAMAFg5AiODTowAWDkFQG4QDABYOQVQbhAMH9Eh2hibzH4wmDJAL8hjeE/AQ +3nIbhAPPd4AALLKntwvwHt5yG4QDABYPQPajABYPQVwbxANId4Yn/RyMJwKSCvQC5tB+chuEAwAW +D0FgG8QDBPBgG0QD4b4E8gAWD0EodIQkDJAE9ADYIfCA4Bj0USQAgNEhIoIS8vCLqLnPcIAAEMak +G0AABb/gYP64BfKLuaQbQAC6o7uj6PEAFgBAGqMAFgBAG6MI2HQTDQG+Ew8Bon8CJ40TAn24E4AA +mLkCfdhgEHhyGwQAsH26EwABcBtEA6QbQAAFelyzz3CgAJgDHoC2GwQANPD0uCHyB8jwiQDaMxGN +AAQggA8BAADwQSgOA89xoAA4LgeBDyKCAwHcRngHoRXIRg6gCwAsABDHdYAAEMYFvxDl/WXArQMS +ATaKIBAABhoYMPvYQg/gAKARAQADyKAQgADE4DAJgQsD2c9woAAUBCOghQDP+eB48cAWCM/5z3WA +AEiaAYXPcoAAEMlEIASDz3CAAPiyDIjVaMd2gAAQxmCGFnrhghTyUCOBBSCmTCQAgYYnAR7hogT0 +kbkgpgXwsbu2u2CmEg9ACwfwlrtgpoUnAR7hoguNorgdAO/5C63hxeHGz3CAAPiyDIiMIAKAz3KA +AEiaF/LKis9xgAAQybVox3WAABDGFnmA5gCFYYEF8pW4AKWruwTwtbgApYu7YaEA2Auqwcbgf8HF +ocHxwOHFUSAAggh1qAAhAELAIsPPcIAA8GEEJYIfBgAAADG6a2AEJYAfwAAAADa4emLPc4AAAG4I +Y0pjQS2DElIjAwDAuwO7GmIY44XiyiONDwEAiQ3VI44AcHFSACUAANjtvRgAIQACIcAAz3EcR8dx +BSh+AAogwA4D8CK4QS1BE8C5BLk0ealyxrpJIsIFVHnrvc9ygACgZDJiBfJBKgEBFCGCAAUqPgBB +KQByCNwrB4/5CiHAD+tyO9iMuAnbCbtKJAAA4Qbv+golAAHgePHAkg6P+c9wgAD4sgyIjCACgCry +NWjHcYAAEMbAgc9ygAAQyc93gABImuSXFnphglAmjRWGJ7sfoKGMJ0SQhiMBDmGiBPSRvaChDPCx +voHntr7AoQb0lr7AoYUjAQ5honoNQAsA2c9wgABImo0Gr/krqOB48cCKIE8LIg3gAIohBAM2CQAA +0cDgfuB48cAGDo/5z3WAAHwcSYWA4i/yB4WB4C/0Fo0A2WqFy4UPIQEAJHpCIgKAJHvKImIAgOMB +2yR+wHuA5gHe7IXAfuR5gOEB2cB5gOLMIyKAzCYikMwhIoAH8hWtANlmD6AHJ6UWjQHgD3iQ4Bat +A/QA2Bat/QWP+eB48cCODY/5z3aAAJilCIbguKzBTPJRIMCBSPRKC6//AN2OCWABFtiLcclwRgxg +CCTaAdjPcaAAyB8ToRiBz3eAAHwcScAZgZDaSsAGhzDZHttLwItwzgugBxi7obaopqGmvK6jp34M +IAAC2M9wgAAQzgWQgODE9qqnracF8B4O4AipcEaHAdnPc4AAvBwAg4HiwHmA4jhgAKMB2M9ygAC0 +HCCCwHg4YACiTQWv+azA4HjxwAvIBSCADwEAAPwLGhgwJgnP+cYIYAEI2BoMIAAA2NHA4H7PcIAA +fBzgfwiA4HjxwAHYz3GAAHwcA6HPcKAALCADgAShAoGB4NAMQfvRwOB+4HjxwIoMj/kAFgBAz3CA +ALAgBYBRIECBDfQKIcAP63KKIF8EkNuKJMMPpQTv+rhzABYAQM91gACgzgCl5G3pcNoI4AoP2VUl +ThTJcJII4AoilfYPT/4IFQUQUSUAhAv0CiHAD+tyiiCfBJjbZQTv+kokQADPcIAAVFsggECFQKEg +gBzaQKnPcYAAHAgjpRjZIqBVJcEVJaDhoCGFw6AkoADYWh0EEAKFrbjyC6//AqWA4Bf0z3CAABDO +JZCA4YogjwvH9tIK4ACr2TIJAAAG8MYK4ACw2b4IAAAOCuAHDdgVBI/54HjxwIogTwyqCuAAkNm+ +Ds//0cDgfvHAz3CAAOhiz3GAAHwcZgpgCDja2gngBwDY0cDgfuB48cC6Ds//ANmC4MwgYoDKIEIA +A/QB2A940cDgfs9xgAB8HAqBgOAF9A2BgOAD8gDYBfAGgYHg/fMB2OB/D3jgePHAz3CAAHwcIBAF +AEwlwICL9wohwA/rcoogXwVX21kD7/pKJIAAz3CAACBj8CBAAUB40cDgfuB48cD6Co/5z3CgALAf +u4AA3pa+BCWNH8D/AADdZRTlACWPH4AAAAByDq/+qXAIcc9wgAAUV4ILQAleDq/+2GUIcc9wgAAs +V3ILQAlODq/+6XAIcc9wgAD8Vl4LQAnPcIAAfBwBA6/54KDxwI4Kj/nPcKAAsB/7gADdlr0EJ48f +wP8AAL9nEOcAJ5AfgAAAAAoOr/7pcAhxz3CAAERXGgtgCb9nz3aAABDOBZYlhgq4+WHmDa/+DiBA +AAhxz3CAALRW9gpACdINr/7pcAhxz3CAAFxX5gpgCb9nBYYfZwWWCri2Da/+DiDAAwhxz3CAAMxW +xgpgCQJ1og2v/gpwCHHPcIAApFeyCkAJz3GAAHwcABkABAWWJYYKuLlhfg2v/g4gQAAIcc9wgADk +Vo4KQAktAo/54HjxwMYJj/nPdoAAfByghgDflr/9ZU4Nr/6pcAhxz3CAALxXYgpgCf1lOg2v/qlw +CHHPcIAAdFdOCkAJ9QGv+aCm8cCGCY/5z3CAAHwcwIAA35a//mYODa/+yXAIcc9wgADUVyIKYAn+ +Zs91gAAQzgWVJYUKuNlh7gyv/g4gQACYcM9wgACEVv4JYAmIcdYMr/7JcJhwz3CAAIxX6glgCYhx +z3CAAHwcwKAFhf5mHmYFlQq4sgyv/g4ggAMIcc9wgACcVsIJQAlpAY/54HjxwPoIr/kA2EokwHPg +eKggQAc1aMdxgAAQxuCBz3WAAHwcAN4PJg4QQS8DElEjAIBshQX0xntspQbwCyOAgwT0qL/goQHg +HQGP+eB48cCyCI/5CHXPdoAAfByKIE8Kpg+gACiGCIYQdUX3gOXKJQIQAvSopoogjwqKD6AAqXHt +AI/54HjxwHoIj/m6C8//geAM8gohwA/rcoognwWi24okww+dAO/6uHPPdYAAfBwjhYHhAoUP9IHg +ANkF8hSNgOAF8q4K7/8mpQzwI6UB2AalCPCA4Ab0Ad7WCqAHxqXCpc9wgAAQzgWQgOAYD8n/fQCP ++eB48cDhxUoL7/8Idc9xgAAQziWRgOFgAAwAgOAu8s9wgAD4skyIANnPc4AAfBwMgw8hgQALIECA +IPSMIgKAHPKGJfwQjCUCkA7yjCUClAfyiiDPDr4OoACu2Q7wDYMleA2jC4MFeSujNWrHcYAAEMYA +gai4AKEJAI/54cVKJMBzANuoIAAGAN3PcYAAfBwMgQ8lzRALIECDDfQLgQsgQIMJ9BVrx3CAABDG +IICIuSCgAePgf8HF8cCqC4/54HjgeOB44HhpIIABbyE/AGkgAAD38c9zgAAcLkCDgOFFeACjGvLP +cYAAvCDPcIAAuAYAkFqJEHIb9M9wgAC6BgCQWIkQchP0z3CAALwGAIg2iRBxDfQLyAQggA/+//8D +CxoYMAvIh7gLGhgw4H7xwM9wgADEBwCAgOAK8s9xgAC0OAuBAeALoX4PL/sC2NHA4H7xwM9zgADg +B2hwhgwgAATZBGt+DCAABNnRwOB+4cUA2UokwHXPc4AAOBXPcoAATDmoIIACFiNAAKGAAIAB4RUi +AACgoOB/wcUA2M9xgABsBwGpDQMgCwCp8cDhxQYO7/ww2LRo/g3v/DfYBX0YvZG9z3CAAGheNgxg +CJK9KLileM9xgAC0W60Gb/kAoeHFNWjPcoAAEMYhYs9ygADIHS25wLnwIkMAKINRIQCAz3GAAAyx +QYEI8jyLgOHFIoEPAAAKAgTyRSJCA0okAHQA26ggwAI2aHV5ACGND4AAkMlApQHjAN3Pc4AAEMgW +IwIAoKqhqgHZIqoD2SOqSiQAcalxqCCAAXphFnqkqgHh4H/BxeHFSiQAeADYqCAACADbz3WAAAAA +QIUPIwMACyLAgA/yQYULIsCAQNrPIuIHyiKBDwAA0ADPIuEHAvAA2s9zgABoExV7QKMB4OB/wcXP +cIAAMFsFgAOAIIDPcIAAQJQpoGEBb/wR2OB48cBCDW/5AdnPcIAAcCg5oIogxQ/PdaAAyB8ZHRiQ +KHAocihzpg/gAJhxPg7v+wDez3egANAP1afPdqAAwC96FgCWibiLuHoeGJD6D8AB4gqP/koPgAdA +2c9wnwC4/zKgNgqACoDZz3CgABQELKAdH1iQFg9ACcYNAAm2DGAJANimC8ADB9hIHRiQCg0ABu4J +wAHPdYAASC4ghWB5ANiL4AfyIIVgeQDYh+BUDoIBvgpAAOoKgAP2D4AHFYZSIAAAwLgghRt+YHkA *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 16:15:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66085106564A; Wed, 27 Jun 2012 16:15:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37ACA8FC17; Wed, 27 Jun 2012 16:15:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RGFEH4019906; Wed, 27 Jun 2012 16:15:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RGFEIs019904; Wed, 27 Jun 2012 16:15:14 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206271615.q5RGFEIs019904@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 27 Jun 2012 16:15: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: r237652 - head/sys/contrib/dev/acpica/components/events X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 16:15:14 -0000 Author: jkim Date: Wed Jun 27 16:15:13 2012 New Revision: 237652 URL: http://svn.freebsd.org/changeset/base/237652 Log: MFV: r237650 Do not malloc(9) while holding a spin lock, to avoid panic. Reported by: kib (and many others) Tested by: kib (and many others) Modified: head/sys/contrib/dev/acpica/components/events/evxfgpe.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/components/events/evxfgpe.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evxfgpe.c Wed Jun 27 16:14:28 2012 (r237651) +++ head/sys/contrib/dev/acpica/components/events/evxfgpe.c Wed Jun 27 16:15:13 2012 (r237652) @@ -298,7 +298,7 @@ AcpiSetupGpeForWake ( ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_NAMESPACE_NODE *DeviceNode; - ACPI_GPE_NOTIFY_INFO *Notify; + ACPI_GPE_NOTIFY_INFO *NewNotify, *Notify; ACPI_CPU_FLAGS Flags; @@ -334,6 +334,12 @@ AcpiSetupGpeForWake ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + NewNotify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); + if (!NewNotify) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); /* Ensure that we have a valid GPE number */ @@ -384,16 +390,10 @@ AcpiSetupGpeForWake ( /* Add this device to the notify list for this GPE */ - Notify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); - if (!Notify) - { - Status = AE_NO_MEMORY; - goto UnlockAndExit; - } - - Notify->DeviceNode = DeviceNode; - Notify->Next = GpeEventInfo->Dispatch.NotifyList; - GpeEventInfo->Dispatch.NotifyList = Notify; + NewNotify->DeviceNode = DeviceNode; + NewNotify->Next = GpeEventInfo->Dispatch.NotifyList; + GpeEventInfo->Dispatch.NotifyList = NewNotify; + NewNotify = NULL; } /* Mark the GPE as a possible wake event */ @@ -403,6 +403,10 @@ AcpiSetupGpeForWake ( UnlockAndExit: AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + if (NewNotify) + { + ACPI_FREE (NewNotify); + } return_ACPI_STATUS (Status); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 16:44:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F12F106566C; Wed, 27 Jun 2012 16:44:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55DD18FC08; Wed, 27 Jun 2012 16:44:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RGixpH021233; Wed, 27 Jun 2012 16:44:59 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RGixtZ021221; Wed, 27 Jun 2012 16:44:59 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206271644.q5RGixtZ021221@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 27 Jun 2012 16:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237653 - in vendor-crypto/openssl/dist: . apps crypto crypto/asn1 crypto/bio crypto/bn crypto/bn/asm crypto/buffer crypto/cms crypto/comp crypto/conf crypto/ec crypto/ecdsa crypto/evp ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 16:44:59 -0000 Author: jkim Date: Wed Jun 27 16:44:58 2012 New Revision: 237653 URL: http://svn.freebsd.org/changeset/base/237653 Log: Import OpenSSL 0.9.8x. Modified: vendor-crypto/openssl/dist/CHANGES vendor-crypto/openssl/dist/Configure vendor-crypto/openssl/dist/FAQ vendor-crypto/openssl/dist/FREEBSD-Xlist vendor-crypto/openssl/dist/FREEBSD-upgrade vendor-crypto/openssl/dist/LICENSE vendor-crypto/openssl/dist/Makefile vendor-crypto/openssl/dist/NEWS vendor-crypto/openssl/dist/README vendor-crypto/openssl/dist/apps/Makefile vendor-crypto/openssl/dist/apps/asn1pars.c vendor-crypto/openssl/dist/apps/cms.c vendor-crypto/openssl/dist/apps/openssl.cnf vendor-crypto/openssl/dist/apps/pkcs12.c vendor-crypto/openssl/dist/apps/s_client.c vendor-crypto/openssl/dist/apps/s_server.c vendor-crypto/openssl/dist/apps/x509.c vendor-crypto/openssl/dist/config vendor-crypto/openssl/dist/crypto/asn1/a_d2i_fp.c vendor-crypto/openssl/dist/crypto/asn1/a_object.c vendor-crypto/openssl/dist/crypto/asn1/a_strex.c vendor-crypto/openssl/dist/crypto/asn1/a_strnid.c vendor-crypto/openssl/dist/crypto/asn1/asn1.h vendor-crypto/openssl/dist/crypto/asn1/asn_mime.c vendor-crypto/openssl/dist/crypto/asn1/x_name.c vendor-crypto/openssl/dist/crypto/asn1/x_pubkey.c vendor-crypto/openssl/dist/crypto/bio/bf_buff.c vendor-crypto/openssl/dist/crypto/bio/bio.h vendor-crypto/openssl/dist/crypto/bio/bss_dgram.c vendor-crypto/openssl/dist/crypto/bn/asm/mo-586.pl vendor-crypto/openssl/dist/crypto/bn/asm/ppc.pl vendor-crypto/openssl/dist/crypto/bn/bn_blind.c vendor-crypto/openssl/dist/crypto/bn/bn_gf2m.c vendor-crypto/openssl/dist/crypto/buffer/buffer.c vendor-crypto/openssl/dist/crypto/cms/cms.h vendor-crypto/openssl/dist/crypto/cms/cms_enc.c vendor-crypto/openssl/dist/crypto/cms/cms_env.c vendor-crypto/openssl/dist/crypto/cms/cms_io.c vendor-crypto/openssl/dist/crypto/cms/cms_lcl.h vendor-crypto/openssl/dist/crypto/cms/cms_smime.c vendor-crypto/openssl/dist/crypto/comp/c_rle.c vendor-crypto/openssl/dist/crypto/conf/conf_api.c vendor-crypto/openssl/dist/crypto/cryptlib.c vendor-crypto/openssl/dist/crypto/crypto.h vendor-crypto/openssl/dist/crypto/ec/ec2_smpl.c vendor-crypto/openssl/dist/crypto/ec/ec_key.c vendor-crypto/openssl/dist/crypto/ec/ecp_smpl.c vendor-crypto/openssl/dist/crypto/ecdsa/ecdsatest.c vendor-crypto/openssl/dist/crypto/ecdsa/ecs_ossl.c vendor-crypto/openssl/dist/crypto/evp/evp_test.c vendor-crypto/openssl/dist/crypto/mem.c vendor-crypto/openssl/dist/crypto/ocsp/ocsp_lib.c vendor-crypto/openssl/dist/crypto/opensslv.h vendor-crypto/openssl/dist/crypto/perlasm/cbc.pl vendor-crypto/openssl/dist/crypto/pkcs7/pk7_doit.c vendor-crypto/openssl/dist/crypto/pkcs7/pk7_smime.c vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-x86_64.pl vendor-crypto/openssl/dist/crypto/rc4/rc4_skey.c vendor-crypto/openssl/dist/crypto/rsa/rsa_eay.c vendor-crypto/openssl/dist/crypto/x509/x509_vfy.c vendor-crypto/openssl/dist/crypto/x509v3/pcy_map.c vendor-crypto/openssl/dist/crypto/x509v3/pcy_tree.c vendor-crypto/openssl/dist/crypto/x509v3/v3_addr.c vendor-crypto/openssl/dist/crypto/x509v3/v3_asid.c vendor-crypto/openssl/dist/doc/HOWTO/proxy_certificates.txt vendor-crypto/openssl/dist/doc/ssl/SSL_clear.pod vendor-crypto/openssl/dist/engines/e_capi.c vendor-crypto/openssl/dist/engines/e_capi_err.h vendor-crypto/openssl/dist/fips/fips_canister.c vendor-crypto/openssl/dist/openssl.spec vendor-crypto/openssl/dist/ssl/bio_ssl.c vendor-crypto/openssl/dist/ssl/d1_both.c vendor-crypto/openssl/dist/ssl/d1_clnt.c vendor-crypto/openssl/dist/ssl/d1_enc.c vendor-crypto/openssl/dist/ssl/d1_lib.c vendor-crypto/openssl/dist/ssl/d1_pkt.c vendor-crypto/openssl/dist/ssl/d1_srvr.c vendor-crypto/openssl/dist/ssl/s2_srvr.c vendor-crypto/openssl/dist/ssl/s3_clnt.c vendor-crypto/openssl/dist/ssl/s3_enc.c vendor-crypto/openssl/dist/ssl/s3_lib.c vendor-crypto/openssl/dist/ssl/s3_srvr.c vendor-crypto/openssl/dist/ssl/ssl.h vendor-crypto/openssl/dist/ssl/ssl3.h vendor-crypto/openssl/dist/ssl/ssl_ciph.c vendor-crypto/openssl/dist/ssl/ssl_err.c vendor-crypto/openssl/dist/ssl/ssl_lib.c vendor-crypto/openssl/dist/ssl/ssl_locl.h vendor-crypto/openssl/dist/ssl/t1_lib.c vendor-crypto/openssl/dist/util/fipslink.pl vendor-crypto/openssl/dist/util/mkerr.pl vendor-crypto/openssl/dist/util/pl/VC-32.pl Modified: vendor-crypto/openssl/dist/CHANGES ============================================================================== --- vendor-crypto/openssl/dist/CHANGES Wed Jun 27 16:15:13 2012 (r237652) +++ vendor-crypto/openssl/dist/CHANGES Wed Jun 27 16:44:58 2012 (r237653) @@ -2,6 +2,142 @@ OpenSSL CHANGES _______________ + Changes between 0.9.8w and 0.9.8x [10 May 2012] + + *) Sanity check record length before skipping explicit IV in DTLS + to fix DoS attack. + + Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic + fuzzing as a service testing platform. + (CVE-2012-2333) + [Steve Henson] + + *) Initialise tkeylen properly when encrypting CMS messages. + Thanks to Solar Designer of Openwall for reporting this issue. + [Steve Henson] + + Changes between 0.9.8v and 0.9.8w [23 Apr 2012] + + *) The fix for CVE-2012-2110 did not take into account that the + 'len' argument to BUF_MEM_grow and BUF_MEM_grow_clean is an + int in OpenSSL 0.9.8, making it still vulnerable. Fix by + rejecting negative len parameter. (CVE-2012-2131) + [Tomas Hoger ] + + Changes between 0.9.8u and 0.9.8v [19 Apr 2012] + + *) Check for potentially exploitable overflows in asn1_d2i_read_bio + BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer + in CRYPTO_realloc_clean. + + Thanks to Tavis Ormandy, Google Security Team, for discovering this + issue and to Adam Langley for fixing it. + (CVE-2012-2110) + [Adam Langley (Google), Tavis Ormandy, Google Security Team] + + Changes between 0.9.8t and 0.9.8u [12 Mar 2012] + + *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness + in CMS and PKCS7 code. When RSA decryption fails use a random key for + content decryption and always return the same error. Note: this attack + needs on average 2^20 messages so it only affects automated senders. The + old behaviour can be reenabled in the CMS code by setting the + CMS_DEBUG_DECRYPT flag: this is useful for debugging and testing where + an MMA defence is not necessary. + Thanks to Ivan Nestlerode for discovering + this issue. (CVE-2012-0884) + [Steve Henson] + + *) Fix CVE-2011-4619: make sure we really are receiving a + client hello before rejecting multiple SGC restarts. Thanks to + Ivan Nestlerode for discovering this bug. + [Steve Henson] + + Changes between 0.9.8s and 0.9.8t [18 Jan 2012] + + *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109. + Thanks to Antonio Martin, Enterprise Secure Access Research and + Development, Cisco Systems, Inc. for discovering this bug and + preparing a fix. (CVE-2012-0050) + [Antonio Martin] + + Changes between 0.9.8r and 0.9.8s [4 Jan 2012] + + *) Nadhem Alfardan and Kenny Paterson have discovered an extension + of the Vaudenay padding oracle attack on CBC mode encryption + which enables an efficient plaintext recovery attack against + the OpenSSL implementation of DTLS. Their attack exploits timing + differences arising during decryption processing. A research + paper describing this attack can be found at: + http://www.isg.rhul.ac.uk/~kp/dtls.pdf + Thanks go to Nadhem Alfardan and Kenny Paterson of the Information + Security Group at Royal Holloway, University of London + (www.isg.rhul.ac.uk) for discovering this flaw and to Robin Seggelmann + and Michael Tuexen + for preparing the fix. (CVE-2011-4108) + [Robin Seggelmann, Michael Tuexen] + + *) Stop policy check failure freeing same buffer twice. (CVE-2011-4109) + [Ben Laurie, Kasper ] + + *) Clear bytes used for block padding of SSL 3.0 records. + (CVE-2011-4576) + [Adam Langley (Google)] + + *) Only allow one SGC handshake restart for SSL/TLS. Thanks to George + Kadianakis for discovering this issue and + Adam Langley for preparing the fix. (CVE-2011-4619) + [Adam Langley (Google)] + + *) Prevent malformed RFC3779 data triggering an assertion failure. + Thanks to Andrew Chi, BBN Technologies, for discovering the flaw + and Rob Austein for fixing it. (CVE-2011-4577) + [Rob Austein ] + + *) Fix ssl_ciph.c set-up race. + [Adam Langley (Google)] + + *) Fix spurious failures in ecdsatest.c. + [Emilia Käsper (Google)] + + *) Fix the BIO_f_buffer() implementation (which was mixing different + interpretations of the '..._len' fields). + [Adam Langley (Google)] + + *) Fix handling of BN_BLINDING: now BN_BLINDING_invert_ex (rather than + BN_BLINDING_invert_ex) calls BN_BLINDING_update, ensuring that concurrent + threads won't reuse the same blinding coefficients. + + This also avoids the need to obtain the CRYPTO_LOCK_RSA_BLINDING + lock to call BN_BLINDING_invert_ex, and avoids one use of + BN_BLINDING_update for each BN_BLINDING structure (previously, + the last update always remained unused). + [Emilia Käsper (Google)] + + *) Fix SSL memory handling for (EC)DH ciphersuites, in particular + for multi-threaded use of ECDH. + [Adam Langley (Google)] + + *) Fix x509_name_ex_d2i memory leak on bad inputs. + [Bodo Moeller] + + *) Add protection against ECDSA timing attacks as mentioned in the paper + by Billy Bob Brumley and Nicola Tuveri, see: + + http://eprint.iacr.org/2011/232.pdf + + [Billy Bob Brumley and Nicola Tuveri] + + Changes between 0.9.8q and 0.9.8r [8 Feb 2011] + + *) Fix parsing of OCSP stapling ClientHello extension. CVE-2011-0014 + [Neel Mehta, Adam Langley, Bodo Moeller (Google)] + + *) Fix bug in string printing code: if *any* escaping is enabled we must + escape the escape character (backslash) or the resulting string is + ambiguous. + [Steve Henson] + Changes between 0.9.8p and 0.9.8q [2 Dec 2010] *) Disable code workaround for ancient and obsolete Netscape browsers Modified: vendor-crypto/openssl/dist/Configure ============================================================================== --- vendor-crypto/openssl/dist/Configure Wed Jun 27 16:15:13 2012 (r237652) +++ vendor-crypto/openssl/dist/Configure Wed Jun 27 16:44:58 2012 (r237653) @@ -371,6 +371,9 @@ my %table=( "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", +# Android: Linux but without -DTERMIO and pointers to headers and libs. +"android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + #### *BSD [do see comment about ${BSDthreads} above!] "BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", Modified: vendor-crypto/openssl/dist/FAQ ============================================================================== --- vendor-crypto/openssl/dist/FAQ Wed Jun 27 16:15:13 2012 (r237652) +++ vendor-crypto/openssl/dist/FAQ Wed Jun 27 16:44:58 2012 (r237653) @@ -10,6 +10,7 @@ OpenSSL - Frequently Asked Questions * Why aren't tools like 'autoconf' and 'libtool' used? * What is an 'engine' version? * How do I check the authenticity of the OpenSSL distribution? +* How does the versioning scheme work? [LEGAL] Legal questions @@ -82,7 +83,7 @@ OpenSSL - Frequently Asked Questions * Which is the current version of OpenSSL? The current version is available from . -OpenSSL 1.0.0c was released on Dec 2nd, 2010. +OpenSSL 1.0.1c was released on May 10th, 2012. In addition to the current stable release, you can also access daily snapshots of the OpenSSL development version at . Note that the online documents refer to the very latest development versions of OpenSSL and may include features not present in released versions. If in doubt refer to the documentation -that came with the version of OpenSSL you are using. +that came with the version of OpenSSL you are using. The pod format +documentation is included in each OpenSSL distribution under the docs +directory. For information on parts of libcrypto that are not yet documented, you might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's @@ -173,6 +176,19 @@ just do: pgp TARBALL.asc +* How does the versioning scheme work? + +After the release of OpenSSL 1.0.0 the versioning scheme changed. Letter +releases (e.g. 1.0.1a) can only contain bug and security fixes and no +new features. Minor releases change the last number (e.g. 1.0.2) and +can contain new features that retain binary compatibility. Changes to +the middle number are considered major releases and neither source nor +binary compatibility is guaranteed. + +Therefore the answer to the common question "when will feature X be +backported to OpenSSL 1.0.0/0.9.8?" is "never" but it could appear +in the next minor release. + [LEGAL] ======================================================================= * Do I need patent licenses to use OpenSSL? @@ -284,7 +300,7 @@ current directory in this case, but this Check out the CA.pl(1) manual page. This provides a simple wrapper round the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check out the manual pages for the individual utilities and the certificate -extensions documentation (currently in doc/openssl.txt). +extensions documentation (in ca(1), req(1), x509v3_config(5) ) * Why can't I create certificate requests? Modified: vendor-crypto/openssl/dist/FREEBSD-Xlist ============================================================================== --- vendor-crypto/openssl/dist/FREEBSD-Xlist Wed Jun 27 16:15:13 2012 (r237652) +++ vendor-crypto/openssl/dist/FREEBSD-Xlist Wed Jun 27 16:44:58 2012 (r237653) @@ -28,6 +28,7 @@ openssl-*/demos/engines/rsaref openssl-*/ms openssl-*/op openssl-*/os2 +openssl-*/perl openssl-*/shlib/Makefile.hpux10-cc openssl-*/shlib/hpux10-cc.sh openssl-*/shlib/irix.sh Modified: vendor-crypto/openssl/dist/FREEBSD-upgrade ============================================================================== --- vendor-crypto/openssl/dist/FREEBSD-upgrade Wed Jun 27 16:15:13 2012 (r237652) +++ vendor-crypto/openssl/dist/FREEBSD-upgrade Wed Jun 27 16:44:58 2012 (r237653) @@ -11,8 +11,8 @@ First, read http://wiki.freebsd.org/Subv # Xlist setenv XLIST /FreeBSD/work/openssl/svn-FREEBSD-files/FREEBSD-Xlist setenv FSVN "svn+ssh://svn.freebsd.org/base" -setenv OSSLVER 0.9.8k -# OSSLTAG format: v0_9_8k +setenv OSSLVER 0.9.8x +# OSSLTAG format: v0_9_8x ###setenv OSSLTAG v`echo ${OSSLVER} | tr . _` @@ -25,13 +25,12 @@ svn co $FSVN/vendor-crypto/openssl/dist tar -x -X $XLIST -f openssl-${OSSLVER}.tar.gz cd dist -svn list -R | grep -v '/$' | sort >../old +svn list -R | egrep -v -e '/$' -e '^FREEBSD-(Xlist|upgrade)$' | sort >../old cd ../openssl-${OSSLVER} find . -type f -or -type l | cut -c 3- | sort >../new cd .. # See that files to remove makes sense -# FREEBSD-Xlist FREEBSD-upgrade will show up - ignore that. comm -23 old new # See that files to add makes sense comm -13 old new @@ -41,30 +40,43 @@ cd dist comm -23 ../old ../new | xargs svn rm comm -13 ../old ../new | xargs svn --parents add +svn stat svn ci -echo svn cp $FSVN/vendor-crypto/openssl/dist $FSVN/vendor-crypto/openssl/$OSSLVER +svn cp $FSVN/vendor-crypto/openssl/dist $FSVN/vendor-crypto/openssl/$OSSLVER -# XXX, below this point it's very WIP. +# Merge to head +mkdir ../head +cd ../head +svn co $FSVN/head/crypto/openssl crypto/openssl +svn merge $FSVN/vendor-crypto/openssl/dist crypto/openssl # Resolve conflicts manually -cd src/crypto/openssl -cvs ci -m "Resolve conflicts after import of OpenSSL ${OSSLVER}." -cd ../../secure -# Do something so it actually compiles... -# Update version number in lib/libcrypto/Makefile.inc -cd lib/libcrypto +svn co $FSVN/head/secure/lib/libcrypto secure/lib/libcrypto +svn co $FSVN/head/secure/lib/libssl secure/lib/libssl +svn co $FSVN/head/secure/usr.bin/openssl secure/usr.bin/openssl + +cd secure/lib/libcrypto + +# Update version number and release date in Makefile.inc +# Update all opensslconf-${MACHINE_CPUARCH}.h + +# Regen assembly files if necessary +make -f Makefile.asm all +mv *.[Ss] ${MACHINE_CPUARCH} +make -f Makefile.asm clean + +# Regen manual pages make man-makefile-update && make man-update cd ../libssl make man-makefile-update && make man-update cd ../../usr.bin/openssl make man-makefile-update && make man-update -cd ../.. -cvs add lib/libcrypto/man/*.3 lib/libssl/man/*.3 usr.bin/openssl/man/*.1 -cvs update -# check for files not added -cvs ci -m "Upgrade to OpenSSL ${OSSLVER}." +cd ../../.. + +# Commit! +svn ci crypto/openssl secure/lib/libcrypto secure/lib/libssl secure/usr.bin/openssl - -- simon@ + -- simon@, jkim@ $FreeBSD$ Modified: vendor-crypto/openssl/dist/LICENSE ============================================================================== --- vendor-crypto/openssl/dist/LICENSE Wed Jun 27 16:15:13 2012 (r237652) +++ vendor-crypto/openssl/dist/LICENSE Wed Jun 27 16:44:58 2012 (r237653) @@ -12,7 +12,7 @@ --------------- /* ==================================================================== - * Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: vendor-crypto/openssl/dist/Makefile ============================================================================== --- vendor-crypto/openssl/dist/Makefile Wed Jun 27 16:15:13 2012 (r237652) +++ vendor-crypto/openssl/dist/Makefile Wed Jun 27 16:44:58 2012 (r237653) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=0.9.8q +VERSION=0.9.8x MAJOR=0 MINOR=9.8 SHLIB_VERSION_NUMBER=0.9.8 Modified: vendor-crypto/openssl/dist/NEWS ============================================================================== --- vendor-crypto/openssl/dist/NEWS Wed Jun 27 16:15:13 2012 (r237652) +++ vendor-crypto/openssl/dist/NEWS Wed Jun 27 16:44:58 2012 (r237653) @@ -5,6 +5,40 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 0.9.8w and OpenSSL 0.9.8x: + + o Fix DTLS record length checking bug CVE-2012-2333 + + Major changes between OpenSSL 0.9.8v and OpenSSL 0.9.8w: + + o Fix for CVE-2012-2131 (corrected fix for 0.9.8 and CVE-2012-2110) + + Major changes between OpenSSL 0.9.8u and OpenSSL 0.9.8v: + + o Fix for ASN1 overflow bug CVE-2012-2110 + + Major changes between OpenSSL 0.9.8t and OpenSSL 0.9.8u: + + o Fix for CMS/PKCS#7 MMA CVE-2012-0884 + o Corrected fix for CVE-2011-4619 + o Various DTLS fixes. + + Major changes between OpenSSL 0.9.8s and OpenSSL 0.9.8t: + + o Fix for DTLS DoS issue CVE-2012-0050 + + Major changes between OpenSSL 0.9.8r and OpenSSL 0.9.8s: + + o Fix for DTLS plaintext recovery attack CVE-2011-4108 + o Fix policy check double free error CVE-2011-4109 + o Clear block padding bytes of SSL 3.0 records CVE-2011-4576 + o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619 + o Check for malformed RFC3779 data CVE-2011-4577 + + Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r: + + o Fix for security issue CVE-2011-0014 + Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q: o Fix for security issue CVE-2010-4180 @@ -181,6 +215,11 @@ o Added initial support for Win64. o Added alternate pkg-config files. + Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m: + + o FIPS 1.1.1 module linking. + o Various ciphersuite selection fixes. + Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l: o Introduce limits to prevent malicious key DoS (CVE-2006-2940) Modified: vendor-crypto/openssl/dist/README ============================================================================== --- vendor-crypto/openssl/dist/README Wed Jun 27 16:15:13 2012 (r237652) +++ vendor-crypto/openssl/dist/README Wed Jun 27 16:44:58 2012 (r237653) @@ -1,7 +1,7 @@ - OpenSSL 0.9.8q 2 Dec 2010 + OpenSSL 0.9.8x 10 May 2012 - Copyright (c) 1998-2009 The OpenSSL Project + Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson All rights reserved. Modified: vendor-crypto/openssl/dist/apps/Makefile ============================================================================== --- vendor-crypto/openssl/dist/apps/Makefile Wed Jun 27 16:15:13 2012 (r237652) +++ vendor-crypto/openssl/dist/apps/Makefile Wed Jun 27 16:44:58 2012 (r237653) @@ -176,720 +176,703 @@ progs.h: progs.pl app_rand.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h app_rand.o: ../include/openssl/buffer.h ../include/openssl/conf.h app_rand.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -app_rand.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -app_rand.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -app_rand.o: ../include/openssl/evp.h ../include/openssl/fips.h -app_rand.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -app_rand.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -app_rand.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -app_rand.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h -app_rand.o: ../include/openssl/rand.h ../include/openssl/safestack.h -app_rand.o: ../include/openssl/sha.h ../include/openssl/stack.h -app_rand.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -app_rand.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -app_rand.o: ../include/openssl/x509v3.h app_rand.c apps.h +app_rand.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +app_rand.o: ../include/openssl/engine.h ../include/openssl/evp.h +app_rand.o: ../include/openssl/fips.h ../include/openssl/lhash.h +app_rand.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +app_rand.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +app_rand.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +app_rand.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h +app_rand.o: ../include/openssl/safestack.h ../include/openssl/sha.h +app_rand.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +app_rand.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +app_rand.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h +app_rand.o: app_rand.c apps.h apps.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h apps.o: ../include/openssl/bn.h ../include/openssl/buffer.h apps.o: ../include/openssl/conf.h ../include/openssl/crypto.h apps.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -apps.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -apps.o: ../include/openssl/engine.h ../include/openssl/err.h -apps.o: ../include/openssl/evp.h ../include/openssl/fips.h -apps.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -apps.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -apps.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -apps.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -apps.o: ../include/openssl/pem2.h ../include/openssl/pkcs12.h -apps.o: ../include/openssl/pkcs7.h ../include/openssl/rsa.h -apps.o: ../include/openssl/safestack.h ../include/openssl/sha.h -apps.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -apps.o: ../include/openssl/txt_db.h ../include/openssl/ui.h -apps.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -apps.o: ../include/openssl/x509v3.h apps.c apps.h +apps.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +apps.o: ../include/openssl/err.h ../include/openssl/evp.h +apps.o: ../include/openssl/fips.h ../include/openssl/lhash.h +apps.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +apps.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +apps.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +apps.o: ../include/openssl/pem.h ../include/openssl/pem2.h +apps.o: ../include/openssl/pkcs12.h ../include/openssl/pkcs7.h +apps.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +apps.o: ../include/openssl/sha.h ../include/openssl/stack.h +apps.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +apps.o: ../include/openssl/ui.h ../include/openssl/x509.h +apps.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.c apps.h asn1pars.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h asn1pars.o: ../include/openssl/buffer.h ../include/openssl/conf.h asn1pars.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -asn1pars.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -asn1pars.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -asn1pars.o: ../include/openssl/err.h ../include/openssl/evp.h -asn1pars.o: ../include/openssl/fips.h ../include/openssl/lhash.h -asn1pars.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -asn1pars.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -asn1pars.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -asn1pars.o: ../include/openssl/pem.h ../include/openssl/pem2.h -asn1pars.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -asn1pars.o: ../include/openssl/sha.h ../include/openssl/stack.h -asn1pars.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -asn1pars.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -asn1pars.o: ../include/openssl/x509v3.h apps.h asn1pars.c +asn1pars.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +asn1pars.o: ../include/openssl/engine.h ../include/openssl/err.h +asn1pars.o: ../include/openssl/evp.h ../include/openssl/fips.h +asn1pars.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +asn1pars.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +asn1pars.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +asn1pars.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +asn1pars.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +asn1pars.o: ../include/openssl/safestack.h ../include/openssl/sha.h +asn1pars.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +asn1pars.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +asn1pars.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +asn1pars.o: asn1pars.c ca.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ca.o: ../include/openssl/bn.h ../include/openssl/buffer.h ca.o: ../include/openssl/conf.h ../include/openssl/crypto.h ca.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ca.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -ca.o: ../include/openssl/engine.h ../include/openssl/err.h -ca.o: ../include/openssl/evp.h ../include/openssl/fips.h -ca.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ca.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -ca.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ca.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ca.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ca.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ca.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ca.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -ca.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ca.c +ca.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +ca.o: ../include/openssl/err.h ../include/openssl/evp.h +ca.o: ../include/openssl/fips.h ../include/openssl/lhash.h +ca.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ca.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +ca.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ca.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ca.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +ca.o: ../include/openssl/sha.h ../include/openssl/stack.h +ca.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +ca.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ca.o: ../include/openssl/x509v3.h apps.h ca.c ciphers.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ciphers.o: ../include/openssl/bn.h ../include/openssl/buffer.h ciphers.o: ../include/openssl/comp.h ../include/openssl/conf.h ciphers.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h ciphers.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ciphers.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -ciphers.o: ../include/openssl/engine.h ../include/openssl/err.h -ciphers.o: ../include/openssl/evp.h ../include/openssl/fips.h -ciphers.o: ../include/openssl/hmac.h ../include/openssl/kssl.h -ciphers.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ciphers.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -ciphers.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ciphers.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ciphers.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ciphers.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h -ciphers.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ciphers.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ciphers.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -ciphers.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ciphers.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h -ciphers.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ciphers.o: ../include/openssl/x509v3.h apps.h ciphers.c +ciphers.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +ciphers.o: ../include/openssl/err.h ../include/openssl/evp.h +ciphers.o: ../include/openssl/fips.h ../include/openssl/hmac.h +ciphers.o: ../include/openssl/kssl.h ../include/openssl/lhash.h +ciphers.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ciphers.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +ciphers.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ciphers.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ciphers.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h +ciphers.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h +ciphers.o: ../include/openssl/sha.h ../include/openssl/ssl.h +ciphers.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +ciphers.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +ciphers.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +ciphers.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +ciphers.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +ciphers.o: ciphers.c cms.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h cms.o: ../include/openssl/buffer.h ../include/openssl/conf.h cms.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -cms.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -cms.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -cms.o: ../include/openssl/evp.h ../include/openssl/fips.h -cms.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -cms.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -cms.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -cms.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h -cms.o: ../include/openssl/safestack.h ../include/openssl/sha.h -cms.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -cms.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -cms.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h cms.c +cms.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +cms.o: ../include/openssl/engine.h ../include/openssl/evp.h +cms.o: ../include/openssl/fips.h ../include/openssl/lhash.h +cms.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +cms.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +cms.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +cms.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +cms.o: ../include/openssl/sha.h ../include/openssl/stack.h +cms.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +cms.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +cms.o: ../include/openssl/x509v3.h apps.h cms.c crl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h crl.o: ../include/openssl/buffer.h ../include/openssl/conf.h crl.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -crl.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -crl.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -crl.o: ../include/openssl/err.h ../include/openssl/evp.h -crl.o: ../include/openssl/fips.h ../include/openssl/lhash.h -crl.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -crl.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -crl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -crl.o: ../include/openssl/pem.h ../include/openssl/pem2.h -crl.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -crl.o: ../include/openssl/sha.h ../include/openssl/stack.h -crl.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -crl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -crl.o: ../include/openssl/x509v3.h apps.h crl.c +crl.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +crl.o: ../include/openssl/engine.h ../include/openssl/err.h +crl.o: ../include/openssl/evp.h ../include/openssl/fips.h +crl.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +crl.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +crl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +crl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +crl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +crl.o: ../include/openssl/safestack.h ../include/openssl/sha.h +crl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +crl.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +crl.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h crl.c crl2p7.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h crl2p7.o: ../include/openssl/buffer.h ../include/openssl/conf.h crl2p7.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -crl2p7.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -crl2p7.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -crl2p7.o: ../include/openssl/err.h ../include/openssl/evp.h -crl2p7.o: ../include/openssl/fips.h ../include/openssl/lhash.h -crl2p7.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -crl2p7.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -crl2p7.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -crl2p7.o: ../include/openssl/pem.h ../include/openssl/pem2.h -crl2p7.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -crl2p7.o: ../include/openssl/sha.h ../include/openssl/stack.h -crl2p7.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -crl2p7.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -crl2p7.o: ../include/openssl/x509v3.h apps.h crl2p7.c +crl2p7.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +crl2p7.o: ../include/openssl/engine.h ../include/openssl/err.h +crl2p7.o: ../include/openssl/evp.h ../include/openssl/fips.h +crl2p7.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +crl2p7.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +crl2p7.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +crl2p7.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +crl2p7.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +crl2p7.o: ../include/openssl/safestack.h ../include/openssl/sha.h +crl2p7.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +crl2p7.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +crl2p7.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +crl2p7.o: crl2p7.c dgst.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dgst.o: ../include/openssl/buffer.h ../include/openssl/conf.h dgst.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -dgst.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -dgst.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -dgst.o: ../include/openssl/err.h ../include/openssl/evp.h -dgst.o: ../include/openssl/fips.h ../include/openssl/hmac.h -dgst.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -dgst.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -dgst.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -dgst.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -dgst.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -dgst.o: ../include/openssl/safestack.h ../include/openssl/sha.h -dgst.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -dgst.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -dgst.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h dgst.c +dgst.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +dgst.o: ../include/openssl/engine.h ../include/openssl/err.h +dgst.o: ../include/openssl/evp.h ../include/openssl/fips.h +dgst.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +dgst.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +dgst.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +dgst.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +dgst.o: ../include/openssl/pem.h ../include/openssl/pem2.h +dgst.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +dgst.o: ../include/openssl/sha.h ../include/openssl/stack.h +dgst.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +dgst.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +dgst.o: ../include/openssl/x509v3.h apps.h dgst.c dh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dh.o: ../include/openssl/bn.h ../include/openssl/buffer.h dh.o: ../include/openssl/conf.h ../include/openssl/crypto.h dh.o: ../include/openssl/dh.h ../include/openssl/e_os2.h -dh.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -dh.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -dh.o: ../include/openssl/err.h ../include/openssl/evp.h -dh.o: ../include/openssl/fips.h ../include/openssl/lhash.h -dh.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -dh.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -dh.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -dh.o: ../include/openssl/pem.h ../include/openssl/pem2.h -dh.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -dh.o: ../include/openssl/sha.h ../include/openssl/stack.h -dh.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -dh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -dh.o: ../include/openssl/x509v3.h apps.h dh.c +dh.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +dh.o: ../include/openssl/engine.h ../include/openssl/err.h +dh.o: ../include/openssl/evp.h ../include/openssl/fips.h +dh.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +dh.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +dh.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +dh.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +dh.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +dh.o: ../include/openssl/safestack.h ../include/openssl/sha.h +dh.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +dh.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +dh.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h dh.c dsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h dsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h dsa.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h -dsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -dsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -dsa.o: ../include/openssl/err.h ../include/openssl/evp.h -dsa.o: ../include/openssl/fips.h ../include/openssl/lhash.h -dsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -dsa.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -dsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -dsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h -dsa.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -dsa.o: ../include/openssl/sha.h ../include/openssl/stack.h -dsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -dsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -dsa.o: ../include/openssl/x509v3.h apps.h dsa.c +dsa.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +dsa.o: ../include/openssl/engine.h ../include/openssl/err.h +dsa.o: ../include/openssl/evp.h ../include/openssl/fips.h +dsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +dsa.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +dsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +dsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +dsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +dsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h +dsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +dsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +dsa.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h dsa.c dsaparam.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dsaparam.o: ../include/openssl/bn.h ../include/openssl/buffer.h dsaparam.o: ../include/openssl/conf.h ../include/openssl/crypto.h dsaparam.o: ../include/openssl/dh.h ../include/openssl/dsa.h dsaparam.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -dsaparam.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -dsaparam.o: ../include/openssl/engine.h ../include/openssl/err.h -dsaparam.o: ../include/openssl/evp.h ../include/openssl/fips.h -dsaparam.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -dsaparam.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -dsaparam.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -dsaparam.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -dsaparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -dsaparam.o: ../include/openssl/rand.h ../include/openssl/rsa.h -dsaparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h -dsaparam.o: ../include/openssl/stack.h ../include/openssl/store.h -dsaparam.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -dsaparam.o: ../include/openssl/ui.h ../include/openssl/x509.h -dsaparam.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -dsaparam.o: dsaparam.c +dsaparam.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +dsaparam.o: ../include/openssl/err.h ../include/openssl/evp.h +dsaparam.o: ../include/openssl/fips.h ../include/openssl/lhash.h +dsaparam.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +dsaparam.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +dsaparam.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +dsaparam.o: ../include/openssl/pem.h ../include/openssl/pem2.h +dsaparam.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h +dsaparam.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +dsaparam.o: ../include/openssl/sha.h ../include/openssl/stack.h +dsaparam.o: ../include/openssl/store.h ../include/openssl/symhacks.h +dsaparam.o: ../include/openssl/txt_db.h ../include/openssl/ui.h +dsaparam.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +dsaparam.o: ../include/openssl/x509v3.h apps.h dsaparam.c ec.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ec.o: ../include/openssl/buffer.h ../include/openssl/conf.h ec.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -ec.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ec.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -ec.o: ../include/openssl/err.h ../include/openssl/evp.h -ec.o: ../include/openssl/fips.h ../include/openssl/lhash.h -ec.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -ec.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -ec.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ec.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ec.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -ec.o: ../include/openssl/sha.h ../include/openssl/stack.h -ec.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -ec.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ec.o: ../include/openssl/x509v3.h apps.h ec.c +ec.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +ec.o: ../include/openssl/engine.h ../include/openssl/err.h +ec.o: ../include/openssl/evp.h ../include/openssl/fips.h +ec.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +ec.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +ec.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ec.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ec.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ec.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ec.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ec.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +ec.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ec.c ecparam.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ecparam.o: ../include/openssl/bn.h ../include/openssl/buffer.h ecparam.o: ../include/openssl/conf.h ../include/openssl/crypto.h ecparam.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ecparam.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -ecparam.o: ../include/openssl/engine.h ../include/openssl/err.h -ecparam.o: ../include/openssl/evp.h ../include/openssl/fips.h -ecparam.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ecparam.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -ecparam.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ecparam.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ecparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ecparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ecparam.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ecparam.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -ecparam.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -ecparam.o: ecparam.c +ecparam.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +ecparam.o: ../include/openssl/err.h ../include/openssl/evp.h +ecparam.o: ../include/openssl/fips.h ../include/openssl/lhash.h +ecparam.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ecparam.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +ecparam.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ecparam.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ecparam.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +ecparam.o: ../include/openssl/sha.h ../include/openssl/stack.h +ecparam.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +ecparam.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ecparam.o: ../include/openssl/x509v3.h apps.h ecparam.c enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h enc.o: ../include/openssl/buffer.h ../include/openssl/conf.h enc.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -enc.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -enc.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -enc.o: ../include/openssl/err.h ../include/openssl/evp.h -enc.o: ../include/openssl/fips.h ../include/openssl/lhash.h -enc.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -enc.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -enc.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h -enc.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h -enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h -enc.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -enc.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -enc.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h enc.c +enc.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +enc.o: ../include/openssl/engine.h ../include/openssl/err.h +enc.o: ../include/openssl/evp.h ../include/openssl/fips.h +enc.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +enc.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +enc.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +enc.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +enc.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +enc.o: ../include/openssl/rand.h ../include/openssl/safestack.h +enc.o: ../include/openssl/sha.h ../include/openssl/stack.h +enc.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +enc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +enc.o: ../include/openssl/x509v3.h apps.h enc.c engine.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h engine.o: ../include/openssl/bn.h ../include/openssl/buffer.h engine.o: ../include/openssl/comp.h ../include/openssl/conf.h engine.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h engine.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -engine.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -engine.o: ../include/openssl/engine.h ../include/openssl/err.h -engine.o: ../include/openssl/evp.h ../include/openssl/fips.h -engine.o: ../include/openssl/hmac.h ../include/openssl/kssl.h -engine.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -engine.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -engine.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -engine.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -engine.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -engine.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h -engine.o: ../include/openssl/safestack.h ../include/openssl/sha.h -engine.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -engine.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -engine.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -engine.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h -engine.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -engine.o: ../include/openssl/x509v3.h apps.h engine.c +engine.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +engine.o: ../include/openssl/err.h ../include/openssl/evp.h +engine.o: ../include/openssl/fips.h ../include/openssl/hmac.h +engine.o: ../include/openssl/kssl.h ../include/openssl/lhash.h +engine.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +engine.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +engine.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +engine.o: ../include/openssl/pem.h ../include/openssl/pem2.h +engine.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h +engine.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h +engine.o: ../include/openssl/sha.h ../include/openssl/ssl.h +engine.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +engine.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +engine.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +engine.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +engine.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +engine.o: engine.c errstr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h errstr.o: ../include/openssl/bn.h ../include/openssl/buffer.h errstr.o: ../include/openssl/comp.h ../include/openssl/conf.h errstr.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h errstr.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -errstr.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -errstr.o: ../include/openssl/engine.h ../include/openssl/err.h -errstr.o: ../include/openssl/evp.h ../include/openssl/fips.h -errstr.o: ../include/openssl/hmac.h ../include/openssl/kssl.h -errstr.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -errstr.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -errstr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -errstr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -errstr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -errstr.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h -errstr.o: ../include/openssl/safestack.h ../include/openssl/sha.h -errstr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -errstr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -errstr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -errstr.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h -errstr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -errstr.o: ../include/openssl/x509v3.h apps.h errstr.c +errstr.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +errstr.o: ../include/openssl/err.h ../include/openssl/evp.h +errstr.o: ../include/openssl/fips.h ../include/openssl/hmac.h +errstr.o: ../include/openssl/kssl.h ../include/openssl/lhash.h +errstr.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +errstr.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +errstr.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +errstr.o: ../include/openssl/pem.h ../include/openssl/pem2.h +errstr.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h +errstr.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h +errstr.o: ../include/openssl/sha.h ../include/openssl/ssl.h +errstr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +errstr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +errstr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +errstr.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +errstr.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +errstr.o: errstr.c gendh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h gendh.o: ../include/openssl/bn.h ../include/openssl/buffer.h gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h gendh.o: ../include/openssl/dh.h ../include/openssl/dsa.h gendh.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -gendh.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -gendh.o: ../include/openssl/engine.h ../include/openssl/err.h -gendh.o: ../include/openssl/evp.h ../include/openssl/fips.h -gendh.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -gendh.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -gendh.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -gendh.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -gendh.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -gendh.o: ../include/openssl/rand.h ../include/openssl/rsa.h -gendh.o: ../include/openssl/safestack.h ../include/openssl/sha.h -gendh.o: ../include/openssl/stack.h ../include/openssl/store.h -gendh.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -gendh.o: ../include/openssl/ui.h ../include/openssl/x509.h -gendh.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -gendh.o: gendh.c +gendh.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +gendh.o: ../include/openssl/err.h ../include/openssl/evp.h +gendh.o: ../include/openssl/fips.h ../include/openssl/lhash.h +gendh.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +gendh.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +gendh.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +gendh.o: ../include/openssl/pem.h ../include/openssl/pem2.h +gendh.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h +gendh.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +gendh.o: ../include/openssl/sha.h ../include/openssl/stack.h +gendh.o: ../include/openssl/store.h ../include/openssl/symhacks.h +gendh.o: ../include/openssl/txt_db.h ../include/openssl/ui.h +gendh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +gendh.o: ../include/openssl/x509v3.h apps.h gendh.c gendsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h gendsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h gendsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h gendsa.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h -gendsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -gendsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -gendsa.o: ../include/openssl/err.h ../include/openssl/evp.h -gendsa.o: ../include/openssl/fips.h ../include/openssl/lhash.h -gendsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -gendsa.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -gendsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -gendsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h -gendsa.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -gendsa.o: ../include/openssl/sha.h ../include/openssl/stack.h -gendsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -gendsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -gendsa.o: ../include/openssl/x509v3.h apps.h gendsa.c +gendsa.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +gendsa.o: ../include/openssl/engine.h ../include/openssl/err.h +gendsa.o: ../include/openssl/evp.h ../include/openssl/fips.h +gendsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +gendsa.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +gendsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +gendsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +gendsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +gendsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h +gendsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +gendsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +gendsa.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +gendsa.o: gendsa.c genrsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h genrsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h genrsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h genrsa.o: ../include/openssl/dh.h ../include/openssl/dsa.h genrsa.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -genrsa.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -genrsa.o: ../include/openssl/engine.h ../include/openssl/err.h -genrsa.o: ../include/openssl/evp.h ../include/openssl/fips.h -genrsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -genrsa.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -genrsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 16:46:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DB84106566B; Wed, 27 Jun 2012 16:46:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F8978FC1A; Wed, 27 Jun 2012 16:46:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RGk3cw021325; Wed, 27 Jun 2012 16:46:03 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RGk3fN021324; Wed, 27 Jun 2012 16:46:03 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206271646.q5RGk3fN021324@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 27 Jun 2012 16:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237654 - vendor-crypto/openssl/0.9.8x X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 16:46:03 -0000 Author: jkim Date: Wed Jun 27 16:46:02 2012 New Revision: 237654 URL: http://svn.freebsd.org/changeset/base/237654 Log: Tag OpenSSL 0.9.8x. Added: vendor-crypto/openssl/0.9.8x/ - copied from r237653, vendor-crypto/openssl/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 17:51:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4575B106564A; Wed, 27 Jun 2012 17:51:10 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30B518FC1B; Wed, 27 Jun 2012 17:51:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RHpAwp024013; Wed, 27 Jun 2012 17:51:10 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RHp9ej024011; Wed, 27 Jun 2012 17:51:09 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206271751.q5RHp9ej024011@svn.freebsd.org> From: Warren Block Date: Wed, 27 Jun 2012 17:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237655 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 17:51:10 -0000 Author: wblock (doc committer) Date: Wed Jun 27 17:51:09 2012 New Revision: 237655 URL: http://svn.freebsd.org/changeset/base/237655 Log: Point out that /usr/src, /usr/doc, and /usr/ports may be empty or not exist until populated with csup(1) or svn(1). PR: 169487 Submitted by: Moritz Wilhelmy MFC after: 1 day Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Wed Jun 27 16:46:02 2012 (r237654) +++ head/share/man/man7/build.7 Wed Jun 27 17:51:09 2012 (r237655) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 29, 2011 +.Dd June 27, 2012 .Dt BUILD 7 .Os .Sh NAME @@ -39,6 +39,10 @@ normally .Pa /usr/doc , and .Pa /usr/ports . +These directories may be initially empty or non-existent until updated with +.Xr csup 1 +or +.Xr svn 1 . Directory .Pa /usr/src contains the @@ -489,7 +493,7 @@ on built objects. .It Va NO_SHARE If set, the build does not descend into the .Pa /usr/src/share -subdirectory (i.e. manpages, locale data files, timezone data files and +subdirectory (i.e., manpages, locale data files, timezone data files and other .Pa /usr/src/share files will not be rebuild from their sources). @@ -594,8 +598,10 @@ make TARGET=sparc64 DESTDIR=/clients/spa .Ed .Sh SEE ALSO .Xr cc 1 , +.Xr csup 1 , .Xr install 1 , .Xr make 1 , +.Xr svn 1 , .Xr make.conf 5 , .Xr src.conf 5 , .Xr ports 7 , From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 18:08:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 296B7106566B; Wed, 27 Jun 2012 18:08:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 142208FC1C; Wed, 27 Jun 2012 18:08:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RI8mbm024860; Wed, 27 Jun 2012 18:08:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RI8m0d024853; Wed, 27 Jun 2012 18:08:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206271808.q5RI8m0d024853@svn.freebsd.org> From: John Baldwin Date: Wed, 27 Jun 2012 18:08: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: r237656 - in head: contrib/top usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 18:08:49 -0000 Author: jhb Date: Wed Jun 27 18:08:48 2012 New Revision: 237656 URL: http://svn.freebsd.org/changeset/base/237656 Log: Add a new line to top that provides a brief summary of the ZFS ARC memory usage on hosts using ZFS. The new line displays the total amount of RAM used by the ARC along with the size of MFU, MRU, anonymous (in flight), headers, and other (miscellaneous) sub-categories. The line is not displayed on systems that are not using ZFS. Reviewed by: avg, fs@ MFC after: 3 days Modified: head/contrib/top/display.c head/contrib/top/layout.h head/contrib/top/machine.h head/contrib/top/top.c head/usr.bin/top/machine.c head/usr.bin/top/top.local.1 Modified: head/contrib/top/display.c ============================================================================== --- head/contrib/top/display.c Wed Jun 27 17:51:09 2012 (r237655) +++ head/contrib/top/display.c Wed Jun 27 18:08:48 2012 (r237656) @@ -66,6 +66,7 @@ char *screenbuf = NULL; static char **procstate_names; static char **cpustate_names; static char **memory_names; +static char **arc_names; static char **swap_names; static int num_procstates; @@ -100,6 +101,8 @@ int x_brkdn = 15; int y_brkdn = 1; int x_mem = 5; int y_mem = 3; +int x_arc = 5; +int y_arc = 4; int x_swap = 6; int y_swap = 4; int y_message = 5; @@ -216,6 +219,8 @@ struct statics *statics; num_memory = string_count(memory_names); lmemory = (int *)malloc(num_memory * sizeof(int)); + arc_names = statics->arc_names; + /* calculate starting columns where needed */ cpustate_total_length = 0; pp = cpustate_names; @@ -627,6 +632,46 @@ int *stats; } /* + * *_arc(stats) - print "ARC: " followed by the ARC summary string + * + * Assumptions: cursor is on "lastline" + * for i_arc ONLY: cursor is on the previous line + */ +char arc_buffer[MAX_COLS]; + +i_arc(stats) + +int *stats; + +{ + if (arc_names == NULL) + return (0); + + fputs("\nARC: ", stdout); + lastline++; + + /* format and print the memory summary */ + summary_format(arc_buffer, stats, arc_names); + fputs(arc_buffer, stdout); +} + +u_arc(stats) + +int *stats; + +{ + static char new[MAX_COLS]; + + if (arc_names == NULL) + return (0); + + /* format the new line */ + summary_format(new, stats, arc_names); + line_update(arc_buffer, new, x_arc, y_arc); +} + + +/* * *_swap(stats) - print "Swap: " followed by the swap summary string * * Assumptions: cursor is on "lastline" Modified: head/contrib/top/layout.h ============================================================================== --- head/contrib/top/layout.h Wed Jun 27 17:51:09 2012 (r237655) +++ head/contrib/top/layout.h Wed Jun 27 18:08:48 2012 (r237656) @@ -19,6 +19,8 @@ extern int x_brkdn; /* 15 */ extern int y_brkdn; /* 1 */ extern int x_mem; /* 5 */ extern int y_mem; /* 3 */ +extern int x_arc; /* 5 */ +extern int y_arc; /* 4 */ extern int x_swap; /* 6 */ extern int y_swap; /* 4 */ extern int y_message; /* 5 */ Modified: head/contrib/top/machine.h ============================================================================== --- head/contrib/top/machine.h Wed Jun 27 17:51:09 2012 (r237655) +++ head/contrib/top/machine.h Wed Jun 27 18:08:48 2012 (r237656) @@ -16,6 +16,7 @@ struct statics char **procstate_names; char **cpustate_names; char **memory_names; + char **arc_names; char **swap_names; #ifdef ORDER char **order_names; @@ -42,6 +43,7 @@ struct system_info int *procstates; int *cpustates; int *memory; + int *arc; int *swap; struct timeval boottime; int ncpus; Modified: head/contrib/top/top.c ============================================================================== --- head/contrib/top/top.c Wed Jun 27 17:51:09 2012 (r237655) +++ head/contrib/top/top.c Wed Jun 27 18:08:48 2012 (r237656) @@ -121,6 +121,8 @@ int i_cpustates(); int u_cpustates(); int i_memory(); int u_memory(); +int i_arc(); +int u_arc(); int i_swap(); int u_swap(); int i_message(); @@ -135,6 +137,7 @@ int (*d_loadave)() = i_loadave; int (*d_procstates)() = i_procstates; int (*d_cpustates)() = i_cpustates; int (*d_memory)() = i_memory; +int (*d_arc)() = i_arc; int (*d_swap)() = i_swap; int (*d_message)() = i_message; int (*d_header)() = i_header; @@ -647,6 +650,7 @@ restart: /* display memory stats */ (*d_memory)(system_info.memory); + (*d_arc)(system_info.arc); /* display swap stats */ (*d_swap)(system_info.swap); @@ -712,6 +716,7 @@ restart: d_procstates = u_procstates; d_cpustates = u_cpustates; d_memory = u_memory; + d_arc = u_arc; d_swap = u_swap; d_message = u_message; d_header = u_header; @@ -1129,6 +1134,7 @@ reset_display() d_procstates = i_procstates; d_cpustates = i_cpustates; d_memory = i_memory; + d_arc = i_arc; d_swap = i_swap; d_message = i_message; d_header = i_header; Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Jun 27 17:51:09 2012 (r237655) +++ head/usr.bin/top/machine.c Wed Jun 27 18:08:48 2012 (r237656) @@ -176,6 +176,12 @@ char *memorynames[] = { "K Free", NULL }; +int arc_stats[7]; +char *arcnames[] = { + "K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K Other", + NULL +}; + int swap_stats[7]; char *swapnames[] = { "K Total, ", "K Used, ", "K Free, ", "% Inuse, ", "K In, ", "K Out", @@ -194,6 +200,7 @@ static struct kinfo_proc *previous_procs static struct kinfo_proc **previous_pref; static int previous_proc_count = 0; static int previous_proc_count_max = 0; +static int arc_enabled; /* total number of io operations */ static long total_inblock; @@ -239,6 +246,7 @@ static int compare_tid(const void *a, co static const char *format_nice(const struct kinfo_proc *pp); static void getsysctl(const char *name, void *ptr, size_t len); static int swapmode(int *retavail, int *retfree); +static void update_layout(void); void toggle_pcpustats(void) @@ -246,24 +254,30 @@ toggle_pcpustats(void) if (ncpus == 1) return; + update_layout(); +} + +/* Adjust display based on ncpus and the ARC state. */ +static void +update_layout(void) +{ + + y_mem = 3; + y_swap = 4 + arc_enabled; + y_idlecursor = 5 + arc_enabled; + y_message = 5 + arc_enabled; + y_header = 6 + arc_enabled; + y_procs = 7 + arc_enabled; + Header_lines = 7 + arc_enabled; - /* Adjust display based on ncpus */ if (pcpu_stats) { - y_mem += ncpus - 1; /* 3 */ - y_swap += ncpus - 1; /* 4 */ - y_idlecursor += ncpus - 1; /* 5 */ - y_message += ncpus - 1; /* 5 */ - y_header += ncpus - 1; /* 6 */ - y_procs += ncpus - 1; /* 7 */ - Header_lines += ncpus - 1; /* 7 */ - } else { - y_mem = 3; - y_swap = 4; - y_idlecursor = 5; - y_message = 5; - y_header = 6; - y_procs = 7; - Header_lines = 7; + y_mem = ncpus - 1; + y_swap += ncpus - 1; + y_idlecursor += ncpus - 1; + y_message += ncpus - 1; + y_header += ncpus - 1; + y_procs += ncpus - 1; + Header_lines += ncpus - 1; } } @@ -271,6 +285,7 @@ int machine_init(struct statics *statics, char do_unames) { int i, j, empty, pagesize; + uint64_t arc_size; size_t size; struct passwd *pw; @@ -282,6 +297,11 @@ machine_init(struct statics *statics, ch size != sizeof(smpmode)) smpmode = 0; + size = sizeof(arc_size); + if (sysctlbyname("kstat.zfs.misc.arcstats.size", &arc_size, &size, + NULL, 0) == 0 && arc_size != 0) + arc_enabled = 1; + if (do_unames) { while ((pw = getpwent()) != NULL) { if (strlen(pw->pw_name) > namelength) @@ -322,6 +342,10 @@ machine_init(struct statics *statics, ch statics->procstate_names = procstatenames; statics->cpustate_names = cpustatenames; statics->memory_names = memorynames; + if (arc_enabled) + statics->arc_names = arcnames; + else + statics->arc_names = NULL; statics->swap_names = swapnames; #ifdef ORDER statics->order_names = ordernames; @@ -356,8 +380,7 @@ machine_init(struct statics *statics, ch pcpu_cpu_states = calloc(1, size); statics->ncpus = ncpus; - if (pcpu_stats) - toggle_pcpustats(); + update_layout(); /* all done! */ return (0); @@ -408,7 +431,7 @@ get_system_info(struct system_info *si) struct loadavg sysload; int mib[2]; struct timeval boottime; - size_t bt_size; + uint64_t arc_stat, arc_stat2; int i, j; size_t size; @@ -487,6 +510,23 @@ get_system_info(struct system_info *si) swap_stats[6] = -1; } + if (arc_enabled) { + GETSYSCTL("kstat.zfs.misc.arcstats.size", arc_stat); + arc_stats[0] = arc_stat >> 10; + GETSYSCTL("vfs.zfs.mfu_size", arc_stat); + arc_stats[1] = arc_stat >> 10; + GETSYSCTL("vfs.zfs.mru_size", arc_stat); + arc_stats[2] = arc_stat >> 10; + GETSYSCTL("vfs.zfs.anon_size", arc_stat); + arc_stats[3] = arc_stat >> 10; + GETSYSCTL("kstat.zfs.misc.arcstats.hdr_size", arc_stat); + GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", arc_stat2); + arc_stats[4] = arc_stat + arc_stat2 >> 10; + GETSYSCTL("kstat.zfs.misc.arcstats.other_size", arc_stat); + arc_stats[5] = arc_stat >> 10; + si->arc = arc_stats; + } + /* set arrays and strings */ if (pcpu_stats) { si->cpustates = pcpu_cpu_states; @@ -511,8 +551,8 @@ get_system_info(struct system_info *si) */ mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; - bt_size = sizeof(boottime); - if (sysctl(mib, 2, &boottime, &bt_size, NULL, 0) != -1 && + size = sizeof(boottime); + if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) { si->boottime = boottime; } else { Modified: head/usr.bin/top/top.local.1 ============================================================================== --- head/usr.bin/top/top.local.1 Wed Jun 27 17:51:09 2012 (r237655) +++ head/usr.bin/top/top.local.1 Wed Jun 27 18:08:48 2012 (r237656) @@ -3,6 +3,7 @@ .SH DESCRIPTION OF MEMORY Mem: 9220K Active, 1M Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free +ARC: 2048K Total, 342K MRU, 760K MFU, 272K Anon, 232K Header, 442K Other Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out .TP .B K: @@ -16,6 +17,7 @@ Gigabyte .TP .B %: 1/100 +.SS Physical Memory Stats .TP .B Active: number of bytes active @@ -35,6 +37,27 @@ number of bytes used for BIO-level disk .TP .B Free: number of bytes free +.SS ZFS ARC Stats +These stats are only displayed when the ARC is in use. +.TP +.B Total: +number of wired bytes used for the ZFS ARC +.TP +.B MRU: +number of ARC bytes holding most recently used data +.TP +.B MFU: +number of ARC bytes holding most frequently used data +.TP +.B Anon: +number of ARC bytes holding in flight data +.TP +.B Header: +number of ARC bytes holding headers +.TP +.B Other +miscellaneous ARC bytes +.SS Swap Stats .TP .B Total: total available swap usage From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 18:44:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ADF3106564A; Wed, 27 Jun 2012 18:44:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 012B78FC12; Wed, 27 Jun 2012 18:44:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RIibnj026467; Wed, 27 Jun 2012 18:44:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RIibeP026457; Wed, 27 Jun 2012 18:44:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206271844.q5RIibeP026457@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 27 Jun 2012 18:44: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: r237657 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 18:44:38 -0000 Author: jkim Date: Wed Jun 27 18:44:36 2012 New Revision: 237657 URL: http://svn.freebsd.org/changeset/base/237657 Log: Merge OpenSSL 0.9.8x. Reviewed by: stas Approved by: benl (maintainer) MFC after: 3 days Modified: head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/FAQ head/crypto/openssl/LICENSE head/crypto/openssl/Makefile head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/Makefile head/crypto/openssl/apps/asn1pars.c head/crypto/openssl/apps/cms.c head/crypto/openssl/apps/openssl.cnf head/crypto/openssl/apps/pkcs12.c head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/apps/x509.c head/crypto/openssl/config head/crypto/openssl/crypto/asn1/a_object.c head/crypto/openssl/crypto/asn1/a_strex.c head/crypto/openssl/crypto/asn1/a_strnid.c head/crypto/openssl/crypto/asn1/asn1.h head/crypto/openssl/crypto/asn1/asn_mime.c head/crypto/openssl/crypto/asn1/x_name.c head/crypto/openssl/crypto/asn1/x_pubkey.c head/crypto/openssl/crypto/bio/bf_buff.c head/crypto/openssl/crypto/bio/bio.h head/crypto/openssl/crypto/bio/bss_dgram.c head/crypto/openssl/crypto/bn/asm/mo-586.pl head/crypto/openssl/crypto/bn/asm/ppc.pl head/crypto/openssl/crypto/bn/bn_blind.c head/crypto/openssl/crypto/bn/bn_gf2m.c head/crypto/openssl/crypto/cms/cms.h head/crypto/openssl/crypto/cms/cms_enc.c head/crypto/openssl/crypto/cms/cms_env.c head/crypto/openssl/crypto/cms/cms_io.c head/crypto/openssl/crypto/cms/cms_lcl.h head/crypto/openssl/crypto/cms/cms_smime.c head/crypto/openssl/crypto/comp/c_rle.c head/crypto/openssl/crypto/conf/conf_api.c head/crypto/openssl/crypto/cryptlib.c head/crypto/openssl/crypto/crypto.h head/crypto/openssl/crypto/ec/ec2_smpl.c head/crypto/openssl/crypto/ec/ec_key.c head/crypto/openssl/crypto/ec/ecp_smpl.c head/crypto/openssl/crypto/ecdsa/ecdsatest.c head/crypto/openssl/crypto/ecdsa/ecs_ossl.c head/crypto/openssl/crypto/evp/evp_test.c head/crypto/openssl/crypto/ocsp/ocsp_lib.c head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/perlasm/cbc.pl head/crypto/openssl/crypto/pkcs7/pk7_smime.c head/crypto/openssl/crypto/rc4/asm/rc4-x86_64.pl head/crypto/openssl/crypto/rc4/rc4_skey.c head/crypto/openssl/crypto/rsa/rsa_eay.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/crypto/x509v3/v3_addr.c head/crypto/openssl/crypto/x509v3/v3_asid.c head/crypto/openssl/doc/HOWTO/proxy_certificates.txt head/crypto/openssl/doc/ssl/SSL_clear.pod head/crypto/openssl/engines/e_capi.c head/crypto/openssl/engines/e_capi_err.h head/crypto/openssl/fips/fips_canister.c head/crypto/openssl/openssl.spec head/crypto/openssl/ssl/bio_ssl.c head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/d1_clnt.c head/crypto/openssl/ssl/d1_enc.c head/crypto/openssl/ssl/d1_lib.c head/crypto/openssl/ssl/d1_pkt.c head/crypto/openssl/ssl/d1_srvr.c head/crypto/openssl/ssl/s2_srvr.c head/crypto/openssl/ssl/s3_clnt.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_srvr.c head/crypto/openssl/ssl/ssl.h head/crypto/openssl/ssl/ssl_ciph.c head/crypto/openssl/ssl/ssl_err.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/util/fipslink.pl head/crypto/openssl/util/mkerr.pl head/crypto/openssl/util/pl/VC-32.pl head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/bio.3 head/secure/lib/libcrypto/man/blowfish.3 head/secure/lib/libcrypto/man/bn.3 head/secure/lib/libcrypto/man/bn_internal.3 head/secure/lib/libcrypto/man/buffer.3 head/secure/lib/libcrypto/man/crypto.3 head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 head/secure/lib/libcrypto/man/d2i_X509_CRL.3 head/secure/lib/libcrypto/man/d2i_X509_NAME.3 head/secure/lib/libcrypto/man/d2i_X509_REQ.3 head/secure/lib/libcrypto/man/d2i_X509_SIG.3 head/secure/lib/libcrypto/man/des.3 head/secure/lib/libcrypto/man/dh.3 head/secure/lib/libcrypto/man/dsa.3 head/secure/lib/libcrypto/man/ecdsa.3 head/secure/lib/libcrypto/man/engine.3 head/secure/lib/libcrypto/man/err.3 head/secure/lib/libcrypto/man/evp.3 head/secure/lib/libcrypto/man/hmac.3 head/secure/lib/libcrypto/man/lh_stats.3 head/secure/lib/libcrypto/man/lhash.3 head/secure/lib/libcrypto/man/md5.3 head/secure/lib/libcrypto/man/mdc2.3 head/secure/lib/libcrypto/man/pem.3 head/secure/lib/libcrypto/man/rand.3 head/secure/lib/libcrypto/man/rc4.3 head/secure/lib/libcrypto/man/ripemd.3 head/secure/lib/libcrypto/man/rsa.3 head/secure/lib/libcrypto/man/sha.3 head/secure/lib/libcrypto/man/threads.3 head/secure/lib/libcrypto/man/ui.3 head/secure/lib/libcrypto/man/ui_compat.3 head/secure/lib/libcrypto/man/x509.3 head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_session.3 head/secure/lib/libssl/man/SSL_CTX_ctrl.3 head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 head/secure/lib/libssl/man/SSL_CTX_free.3 head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libssl/man/SSL_CTX_new.3 head/secure/lib/libssl/man/SSL_CTX_sess_number.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libssl/man/SSL_CTX_sessions.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libssl/man/SSL_CTX_set_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_options.3 head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_verify.3 head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 head/secure/lib/libssl/man/SSL_SESSION_free.3 head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_SESSION_get_time.3 head/secure/lib/libssl/man/SSL_accept.3 head/secure/lib/libssl/man/SSL_alert_type_string.3 head/secure/lib/libssl/man/SSL_clear.3 head/secure/lib/libssl/man/SSL_connect.3 head/secure/lib/libssl/man/SSL_do_handshake.3 head/secure/lib/libssl/man/SSL_free.3 head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 head/secure/lib/libssl/man/SSL_get_ciphers.3 head/secure/lib/libssl/man/SSL_get_client_CA_list.3 head/secure/lib/libssl/man/SSL_get_current_cipher.3 head/secure/lib/libssl/man/SSL_get_default_timeout.3 head/secure/lib/libssl/man/SSL_get_error.3 head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 head/secure/lib/libssl/man/SSL_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_get_fd.3 head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 head/secure/lib/libssl/man/SSL_get_peer_certificate.3 head/secure/lib/libssl/man/SSL_get_rbio.3 head/secure/lib/libssl/man/SSL_get_session.3 head/secure/lib/libssl/man/SSL_get_verify_result.3 head/secure/lib/libssl/man/SSL_get_version.3 head/secure/lib/libssl/man/SSL_library_init.3 head/secure/lib/libssl/man/SSL_load_client_CA_file.3 head/secure/lib/libssl/man/SSL_new.3 head/secure/lib/libssl/man/SSL_pending.3 head/secure/lib/libssl/man/SSL_read.3 head/secure/lib/libssl/man/SSL_rstate_string.3 head/secure/lib/libssl/man/SSL_session_reused.3 head/secure/lib/libssl/man/SSL_set_bio.3 head/secure/lib/libssl/man/SSL_set_connect_state.3 head/secure/lib/libssl/man/SSL_set_fd.3 head/secure/lib/libssl/man/SSL_set_session.3 head/secure/lib/libssl/man/SSL_set_shutdown.3 head/secure/lib/libssl/man/SSL_set_verify_result.3 head/secure/lib/libssl/man/SSL_shutdown.3 head/secure/lib/libssl/man/SSL_state_string.3 head/secure/lib/libssl/man/SSL_want.3 head/secure/lib/libssl/man/SSL_write.3 head/secure/lib/libssl/man/d2i_SSL_SESSION.3 head/secure/lib/libssl/man/ssl.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 head/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: head/crypto/openssl/ (props changed) Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Wed Jun 27 18:08:48 2012 (r237656) +++ head/crypto/openssl/CHANGES Wed Jun 27 18:44:36 2012 (r237657) @@ -2,6 +2,142 @@ OpenSSL CHANGES _______________ + Changes between 0.9.8w and 0.9.8x [10 May 2012] + + *) Sanity check record length before skipping explicit IV in DTLS + to fix DoS attack. + + Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic + fuzzing as a service testing platform. + (CVE-2012-2333) + [Steve Henson] + + *) Initialise tkeylen properly when encrypting CMS messages. + Thanks to Solar Designer of Openwall for reporting this issue. + [Steve Henson] + + Changes between 0.9.8v and 0.9.8w [23 Apr 2012] + + *) The fix for CVE-2012-2110 did not take into account that the + 'len' argument to BUF_MEM_grow and BUF_MEM_grow_clean is an + int in OpenSSL 0.9.8, making it still vulnerable. Fix by + rejecting negative len parameter. (CVE-2012-2131) + [Tomas Hoger ] + + Changes between 0.9.8u and 0.9.8v [19 Apr 2012] + + *) Check for potentially exploitable overflows in asn1_d2i_read_bio + BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer + in CRYPTO_realloc_clean. + + Thanks to Tavis Ormandy, Google Security Team, for discovering this + issue and to Adam Langley for fixing it. + (CVE-2012-2110) + [Adam Langley (Google), Tavis Ormandy, Google Security Team] + + Changes between 0.9.8t and 0.9.8u [12 Mar 2012] + + *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness + in CMS and PKCS7 code. When RSA decryption fails use a random key for + content decryption and always return the same error. Note: this attack + needs on average 2^20 messages so it only affects automated senders. The + old behaviour can be reenabled in the CMS code by setting the + CMS_DEBUG_DECRYPT flag: this is useful for debugging and testing where + an MMA defence is not necessary. + Thanks to Ivan Nestlerode for discovering + this issue. (CVE-2012-0884) + [Steve Henson] + + *) Fix CVE-2011-4619: make sure we really are receiving a + client hello before rejecting multiple SGC restarts. Thanks to + Ivan Nestlerode for discovering this bug. + [Steve Henson] + + Changes between 0.9.8s and 0.9.8t [18 Jan 2012] + + *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109. + Thanks to Antonio Martin, Enterprise Secure Access Research and + Development, Cisco Systems, Inc. for discovering this bug and + preparing a fix. (CVE-2012-0050) + [Antonio Martin] + + Changes between 0.9.8r and 0.9.8s [4 Jan 2012] + + *) Nadhem Alfardan and Kenny Paterson have discovered an extension + of the Vaudenay padding oracle attack on CBC mode encryption + which enables an efficient plaintext recovery attack against + the OpenSSL implementation of DTLS. Their attack exploits timing + differences arising during decryption processing. A research + paper describing this attack can be found at: + http://www.isg.rhul.ac.uk/~kp/dtls.pdf + Thanks go to Nadhem Alfardan and Kenny Paterson of the Information + Security Group at Royal Holloway, University of London + (www.isg.rhul.ac.uk) for discovering this flaw and to Robin Seggelmann + and Michael Tuexen + for preparing the fix. (CVE-2011-4108) + [Robin Seggelmann, Michael Tuexen] + + *) Stop policy check failure freeing same buffer twice. (CVE-2011-4109) + [Ben Laurie, Kasper ] + + *) Clear bytes used for block padding of SSL 3.0 records. + (CVE-2011-4576) + [Adam Langley (Google)] + + *) Only allow one SGC handshake restart for SSL/TLS. Thanks to George + Kadianakis for discovering this issue and + Adam Langley for preparing the fix. (CVE-2011-4619) + [Adam Langley (Google)] + + *) Prevent malformed RFC3779 data triggering an assertion failure. + Thanks to Andrew Chi, BBN Technologies, for discovering the flaw + and Rob Austein for fixing it. (CVE-2011-4577) + [Rob Austein ] + + *) Fix ssl_ciph.c set-up race. + [Adam Langley (Google)] + + *) Fix spurious failures in ecdsatest.c. + [Emilia Käsper (Google)] + + *) Fix the BIO_f_buffer() implementation (which was mixing different + interpretations of the '..._len' fields). + [Adam Langley (Google)] + + *) Fix handling of BN_BLINDING: now BN_BLINDING_invert_ex (rather than + BN_BLINDING_invert_ex) calls BN_BLINDING_update, ensuring that concurrent + threads won't reuse the same blinding coefficients. + + This also avoids the need to obtain the CRYPTO_LOCK_RSA_BLINDING + lock to call BN_BLINDING_invert_ex, and avoids one use of + BN_BLINDING_update for each BN_BLINDING structure (previously, + the last update always remained unused). + [Emilia Käsper (Google)] + + *) Fix SSL memory handling for (EC)DH ciphersuites, in particular + for multi-threaded use of ECDH. + [Adam Langley (Google)] + + *) Fix x509_name_ex_d2i memory leak on bad inputs. + [Bodo Moeller] + + *) Add protection against ECDSA timing attacks as mentioned in the paper + by Billy Bob Brumley and Nicola Tuveri, see: + + http://eprint.iacr.org/2011/232.pdf + + [Billy Bob Brumley and Nicola Tuveri] + + Changes between 0.9.8q and 0.9.8r [8 Feb 2011] + + *) Fix parsing of OCSP stapling ClientHello extension. CVE-2011-0014 + [Neel Mehta, Adam Langley, Bodo Moeller (Google)] + + *) Fix bug in string printing code: if *any* escaping is enabled we must + escape the escape character (backslash) or the resulting string is + ambiguous. + [Steve Henson] + Changes between 0.9.8p and 0.9.8q [2 Dec 2010] *) Disable code workaround for ancient and obsolete Netscape browsers Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Wed Jun 27 18:08:48 2012 (r237656) +++ head/crypto/openssl/Configure Wed Jun 27 18:44:36 2012 (r237657) @@ -371,6 +371,9 @@ my %table=( "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", +# Android: Linux but without -DTERMIO and pointers to headers and libs. +"android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + #### *BSD [do see comment about ${BSDthreads} above!] "BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", Modified: head/crypto/openssl/FAQ ============================================================================== --- head/crypto/openssl/FAQ Wed Jun 27 18:08:48 2012 (r237656) +++ head/crypto/openssl/FAQ Wed Jun 27 18:44:36 2012 (r237657) @@ -10,6 +10,7 @@ OpenSSL - Frequently Asked Questions * Why aren't tools like 'autoconf' and 'libtool' used? * What is an 'engine' version? * How do I check the authenticity of the OpenSSL distribution? +* How does the versioning scheme work? [LEGAL] Legal questions @@ -82,7 +83,7 @@ OpenSSL - Frequently Asked Questions * Which is the current version of OpenSSL? The current version is available from . -OpenSSL 1.0.0c was released on Dec 2nd, 2010. +OpenSSL 1.0.1c was released on May 10th, 2012. In addition to the current stable release, you can also access daily snapshots of the OpenSSL development version at . Note that the online documents refer to the very latest development versions of OpenSSL and may include features not present in released versions. If in doubt refer to the documentation -that came with the version of OpenSSL you are using. +that came with the version of OpenSSL you are using. The pod format +documentation is included in each OpenSSL distribution under the docs +directory. For information on parts of libcrypto that are not yet documented, you might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's @@ -173,6 +176,19 @@ just do: pgp TARBALL.asc +* How does the versioning scheme work? + +After the release of OpenSSL 1.0.0 the versioning scheme changed. Letter +releases (e.g. 1.0.1a) can only contain bug and security fixes and no +new features. Minor releases change the last number (e.g. 1.0.2) and +can contain new features that retain binary compatibility. Changes to +the middle number are considered major releases and neither source nor +binary compatibility is guaranteed. + +Therefore the answer to the common question "when will feature X be +backported to OpenSSL 1.0.0/0.9.8?" is "never" but it could appear +in the next minor release. + [LEGAL] ======================================================================= * Do I need patent licenses to use OpenSSL? @@ -284,7 +300,7 @@ current directory in this case, but this Check out the CA.pl(1) manual page. This provides a simple wrapper round the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check out the manual pages for the individual utilities and the certificate -extensions documentation (currently in doc/openssl.txt). +extensions documentation (in ca(1), req(1), x509v3_config(5) ) * Why can't I create certificate requests? Modified: head/crypto/openssl/LICENSE ============================================================================== --- head/crypto/openssl/LICENSE Wed Jun 27 18:08:48 2012 (r237656) +++ head/crypto/openssl/LICENSE Wed Jun 27 18:44:36 2012 (r237657) @@ -12,7 +12,7 @@ --------------- /* ==================================================================== - * Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/crypto/openssl/Makefile ============================================================================== --- head/crypto/openssl/Makefile Wed Jun 27 18:08:48 2012 (r237656) +++ head/crypto/openssl/Makefile Wed Jun 27 18:44:36 2012 (r237657) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=0.9.8q +VERSION=0.9.8x MAJOR=0 MINOR=9.8 SHLIB_VERSION_NUMBER=0.9.8 Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Wed Jun 27 18:08:48 2012 (r237656) +++ head/crypto/openssl/NEWS Wed Jun 27 18:44:36 2012 (r237657) @@ -5,6 +5,40 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 0.9.8w and OpenSSL 0.9.8x: + + o Fix DTLS record length checking bug CVE-2012-2333 + + Major changes between OpenSSL 0.9.8v and OpenSSL 0.9.8w: + + o Fix for CVE-2012-2131 (corrected fix for 0.9.8 and CVE-2012-2110) + + Major changes between OpenSSL 0.9.8u and OpenSSL 0.9.8v: + + o Fix for ASN1 overflow bug CVE-2012-2110 + + Major changes between OpenSSL 0.9.8t and OpenSSL 0.9.8u: + + o Fix for CMS/PKCS#7 MMA CVE-2012-0884 + o Corrected fix for CVE-2011-4619 + o Various DTLS fixes. + + Major changes between OpenSSL 0.9.8s and OpenSSL 0.9.8t: + + o Fix for DTLS DoS issue CVE-2012-0050 + + Major changes between OpenSSL 0.9.8r and OpenSSL 0.9.8s: + + o Fix for DTLS plaintext recovery attack CVE-2011-4108 + o Fix policy check double free error CVE-2011-4109 + o Clear block padding bytes of SSL 3.0 records CVE-2011-4576 + o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619 + o Check for malformed RFC3779 data CVE-2011-4577 + + Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r: + + o Fix for security issue CVE-2011-0014 + Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q: o Fix for security issue CVE-2010-4180 @@ -181,6 +215,11 @@ o Added initial support for Win64. o Added alternate pkg-config files. + Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m: + + o FIPS 1.1.1 module linking. + o Various ciphersuite selection fixes. + Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l: o Introduce limits to prevent malicious key DoS (CVE-2006-2940) Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Wed Jun 27 18:08:48 2012 (r237656) +++ head/crypto/openssl/README Wed Jun 27 18:44:36 2012 (r237657) @@ -1,7 +1,7 @@ - OpenSSL 0.9.8q 2 Dec 2010 + OpenSSL 0.9.8x 10 May 2012 - Copyright (c) 1998-2009 The OpenSSL Project + Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson All rights reserved. Modified: head/crypto/openssl/apps/Makefile ============================================================================== --- head/crypto/openssl/apps/Makefile Wed Jun 27 18:08:48 2012 (r237656) +++ head/crypto/openssl/apps/Makefile Wed Jun 27 18:44:36 2012 (r237657) @@ -176,720 +176,703 @@ progs.h: progs.pl app_rand.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h app_rand.o: ../include/openssl/buffer.h ../include/openssl/conf.h app_rand.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -app_rand.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -app_rand.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -app_rand.o: ../include/openssl/evp.h ../include/openssl/fips.h -app_rand.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -app_rand.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -app_rand.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -app_rand.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h -app_rand.o: ../include/openssl/rand.h ../include/openssl/safestack.h -app_rand.o: ../include/openssl/sha.h ../include/openssl/stack.h -app_rand.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -app_rand.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -app_rand.o: ../include/openssl/x509v3.h app_rand.c apps.h +app_rand.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +app_rand.o: ../include/openssl/engine.h ../include/openssl/evp.h +app_rand.o: ../include/openssl/fips.h ../include/openssl/lhash.h +app_rand.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +app_rand.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +app_rand.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +app_rand.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h +app_rand.o: ../include/openssl/safestack.h ../include/openssl/sha.h +app_rand.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +app_rand.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +app_rand.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h +app_rand.o: app_rand.c apps.h apps.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h apps.o: ../include/openssl/bn.h ../include/openssl/buffer.h apps.o: ../include/openssl/conf.h ../include/openssl/crypto.h apps.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -apps.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -apps.o: ../include/openssl/engine.h ../include/openssl/err.h -apps.o: ../include/openssl/evp.h ../include/openssl/fips.h -apps.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -apps.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -apps.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -apps.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -apps.o: ../include/openssl/pem2.h ../include/openssl/pkcs12.h -apps.o: ../include/openssl/pkcs7.h ../include/openssl/rsa.h -apps.o: ../include/openssl/safestack.h ../include/openssl/sha.h -apps.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -apps.o: ../include/openssl/txt_db.h ../include/openssl/ui.h -apps.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -apps.o: ../include/openssl/x509v3.h apps.c apps.h +apps.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +apps.o: ../include/openssl/err.h ../include/openssl/evp.h +apps.o: ../include/openssl/fips.h ../include/openssl/lhash.h +apps.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +apps.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +apps.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +apps.o: ../include/openssl/pem.h ../include/openssl/pem2.h +apps.o: ../include/openssl/pkcs12.h ../include/openssl/pkcs7.h +apps.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +apps.o: ../include/openssl/sha.h ../include/openssl/stack.h +apps.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +apps.o: ../include/openssl/ui.h ../include/openssl/x509.h +apps.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.c apps.h asn1pars.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h asn1pars.o: ../include/openssl/buffer.h ../include/openssl/conf.h asn1pars.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -asn1pars.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -asn1pars.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -asn1pars.o: ../include/openssl/err.h ../include/openssl/evp.h -asn1pars.o: ../include/openssl/fips.h ../include/openssl/lhash.h -asn1pars.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -asn1pars.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -asn1pars.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -asn1pars.o: ../include/openssl/pem.h ../include/openssl/pem2.h -asn1pars.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -asn1pars.o: ../include/openssl/sha.h ../include/openssl/stack.h -asn1pars.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -asn1pars.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -asn1pars.o: ../include/openssl/x509v3.h apps.h asn1pars.c +asn1pars.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +asn1pars.o: ../include/openssl/engine.h ../include/openssl/err.h +asn1pars.o: ../include/openssl/evp.h ../include/openssl/fips.h +asn1pars.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +asn1pars.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +asn1pars.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +asn1pars.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +asn1pars.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +asn1pars.o: ../include/openssl/safestack.h ../include/openssl/sha.h +asn1pars.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +asn1pars.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +asn1pars.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +asn1pars.o: asn1pars.c ca.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ca.o: ../include/openssl/bn.h ../include/openssl/buffer.h ca.o: ../include/openssl/conf.h ../include/openssl/crypto.h ca.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ca.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -ca.o: ../include/openssl/engine.h ../include/openssl/err.h -ca.o: ../include/openssl/evp.h ../include/openssl/fips.h -ca.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ca.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -ca.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ca.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ca.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ca.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ca.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ca.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -ca.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ca.c +ca.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +ca.o: ../include/openssl/err.h ../include/openssl/evp.h +ca.o: ../include/openssl/fips.h ../include/openssl/lhash.h +ca.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ca.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +ca.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ca.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ca.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +ca.o: ../include/openssl/sha.h ../include/openssl/stack.h +ca.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +ca.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ca.o: ../include/openssl/x509v3.h apps.h ca.c ciphers.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ciphers.o: ../include/openssl/bn.h ../include/openssl/buffer.h ciphers.o: ../include/openssl/comp.h ../include/openssl/conf.h ciphers.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h ciphers.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ciphers.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -ciphers.o: ../include/openssl/engine.h ../include/openssl/err.h -ciphers.o: ../include/openssl/evp.h ../include/openssl/fips.h -ciphers.o: ../include/openssl/hmac.h ../include/openssl/kssl.h -ciphers.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ciphers.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -ciphers.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ciphers.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ciphers.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ciphers.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h -ciphers.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ciphers.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ciphers.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -ciphers.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ciphers.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h -ciphers.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ciphers.o: ../include/openssl/x509v3.h apps.h ciphers.c +ciphers.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +ciphers.o: ../include/openssl/err.h ../include/openssl/evp.h +ciphers.o: ../include/openssl/fips.h ../include/openssl/hmac.h +ciphers.o: ../include/openssl/kssl.h ../include/openssl/lhash.h +ciphers.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ciphers.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +ciphers.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ciphers.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ciphers.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h +ciphers.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h +ciphers.o: ../include/openssl/sha.h ../include/openssl/ssl.h +ciphers.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +ciphers.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +ciphers.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +ciphers.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +ciphers.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +ciphers.o: ciphers.c cms.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h cms.o: ../include/openssl/buffer.h ../include/openssl/conf.h cms.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -cms.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -cms.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -cms.o: ../include/openssl/evp.h ../include/openssl/fips.h -cms.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -cms.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -cms.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -cms.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h -cms.o: ../include/openssl/safestack.h ../include/openssl/sha.h -cms.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -cms.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -cms.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h cms.c +cms.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +cms.o: ../include/openssl/engine.h ../include/openssl/evp.h +cms.o: ../include/openssl/fips.h ../include/openssl/lhash.h +cms.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +cms.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +cms.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +cms.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +cms.o: ../include/openssl/sha.h ../include/openssl/stack.h +cms.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +cms.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +cms.o: ../include/openssl/x509v3.h apps.h cms.c crl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h crl.o: ../include/openssl/buffer.h ../include/openssl/conf.h crl.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -crl.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -crl.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -crl.o: ../include/openssl/err.h ../include/openssl/evp.h -crl.o: ../include/openssl/fips.h ../include/openssl/lhash.h -crl.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -crl.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -crl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -crl.o: ../include/openssl/pem.h ../include/openssl/pem2.h -crl.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -crl.o: ../include/openssl/sha.h ../include/openssl/stack.h -crl.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -crl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -crl.o: ../include/openssl/x509v3.h apps.h crl.c +crl.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +crl.o: ../include/openssl/engine.h ../include/openssl/err.h +crl.o: ../include/openssl/evp.h ../include/openssl/fips.h +crl.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +crl.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +crl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +crl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +crl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +crl.o: ../include/openssl/safestack.h ../include/openssl/sha.h +crl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +crl.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +crl.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h crl.c crl2p7.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h crl2p7.o: ../include/openssl/buffer.h ../include/openssl/conf.h crl2p7.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -crl2p7.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -crl2p7.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -crl2p7.o: ../include/openssl/err.h ../include/openssl/evp.h -crl2p7.o: ../include/openssl/fips.h ../include/openssl/lhash.h -crl2p7.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -crl2p7.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -crl2p7.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -crl2p7.o: ../include/openssl/pem.h ../include/openssl/pem2.h -crl2p7.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -crl2p7.o: ../include/openssl/sha.h ../include/openssl/stack.h -crl2p7.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -crl2p7.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -crl2p7.o: ../include/openssl/x509v3.h apps.h crl2p7.c +crl2p7.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +crl2p7.o: ../include/openssl/engine.h ../include/openssl/err.h +crl2p7.o: ../include/openssl/evp.h ../include/openssl/fips.h +crl2p7.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +crl2p7.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +crl2p7.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +crl2p7.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +crl2p7.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +crl2p7.o: ../include/openssl/safestack.h ../include/openssl/sha.h +crl2p7.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +crl2p7.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +crl2p7.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +crl2p7.o: crl2p7.c dgst.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dgst.o: ../include/openssl/buffer.h ../include/openssl/conf.h dgst.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -dgst.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -dgst.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -dgst.o: ../include/openssl/err.h ../include/openssl/evp.h -dgst.o: ../include/openssl/fips.h ../include/openssl/hmac.h -dgst.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -dgst.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -dgst.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -dgst.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -dgst.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -dgst.o: ../include/openssl/safestack.h ../include/openssl/sha.h -dgst.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -dgst.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -dgst.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h dgst.c +dgst.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +dgst.o: ../include/openssl/engine.h ../include/openssl/err.h +dgst.o: ../include/openssl/evp.h ../include/openssl/fips.h +dgst.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +dgst.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +dgst.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +dgst.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +dgst.o: ../include/openssl/pem.h ../include/openssl/pem2.h +dgst.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +dgst.o: ../include/openssl/sha.h ../include/openssl/stack.h +dgst.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +dgst.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +dgst.o: ../include/openssl/x509v3.h apps.h dgst.c dh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dh.o: ../include/openssl/bn.h ../include/openssl/buffer.h dh.o: ../include/openssl/conf.h ../include/openssl/crypto.h dh.o: ../include/openssl/dh.h ../include/openssl/e_os2.h -dh.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -dh.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -dh.o: ../include/openssl/err.h ../include/openssl/evp.h -dh.o: ../include/openssl/fips.h ../include/openssl/lhash.h -dh.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -dh.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -dh.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -dh.o: ../include/openssl/pem.h ../include/openssl/pem2.h -dh.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -dh.o: ../include/openssl/sha.h ../include/openssl/stack.h -dh.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -dh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -dh.o: ../include/openssl/x509v3.h apps.h dh.c +dh.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +dh.o: ../include/openssl/engine.h ../include/openssl/err.h +dh.o: ../include/openssl/evp.h ../include/openssl/fips.h +dh.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +dh.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +dh.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +dh.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +dh.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +dh.o: ../include/openssl/safestack.h ../include/openssl/sha.h +dh.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +dh.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +dh.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h dh.c dsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h dsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h dsa.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h -dsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -dsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -dsa.o: ../include/openssl/err.h ../include/openssl/evp.h -dsa.o: ../include/openssl/fips.h ../include/openssl/lhash.h -dsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -dsa.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -dsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -dsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h -dsa.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -dsa.o: ../include/openssl/sha.h ../include/openssl/stack.h -dsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -dsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -dsa.o: ../include/openssl/x509v3.h apps.h dsa.c +dsa.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +dsa.o: ../include/openssl/engine.h ../include/openssl/err.h +dsa.o: ../include/openssl/evp.h ../include/openssl/fips.h +dsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +dsa.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +dsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +dsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +dsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +dsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h +dsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +dsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +dsa.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h dsa.c dsaparam.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dsaparam.o: ../include/openssl/bn.h ../include/openssl/buffer.h dsaparam.o: ../include/openssl/conf.h ../include/openssl/crypto.h dsaparam.o: ../include/openssl/dh.h ../include/openssl/dsa.h dsaparam.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -dsaparam.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -dsaparam.o: ../include/openssl/engine.h ../include/openssl/err.h -dsaparam.o: ../include/openssl/evp.h ../include/openssl/fips.h -dsaparam.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -dsaparam.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -dsaparam.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -dsaparam.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -dsaparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -dsaparam.o: ../include/openssl/rand.h ../include/openssl/rsa.h -dsaparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h -dsaparam.o: ../include/openssl/stack.h ../include/openssl/store.h -dsaparam.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -dsaparam.o: ../include/openssl/ui.h ../include/openssl/x509.h -dsaparam.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -dsaparam.o: dsaparam.c +dsaparam.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +dsaparam.o: ../include/openssl/err.h ../include/openssl/evp.h +dsaparam.o: ../include/openssl/fips.h ../include/openssl/lhash.h +dsaparam.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +dsaparam.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +dsaparam.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +dsaparam.o: ../include/openssl/pem.h ../include/openssl/pem2.h +dsaparam.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h +dsaparam.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +dsaparam.o: ../include/openssl/sha.h ../include/openssl/stack.h +dsaparam.o: ../include/openssl/store.h ../include/openssl/symhacks.h +dsaparam.o: ../include/openssl/txt_db.h ../include/openssl/ui.h +dsaparam.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +dsaparam.o: ../include/openssl/x509v3.h apps.h dsaparam.c ec.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ec.o: ../include/openssl/buffer.h ../include/openssl/conf.h ec.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -ec.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ec.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -ec.o: ../include/openssl/err.h ../include/openssl/evp.h -ec.o: ../include/openssl/fips.h ../include/openssl/lhash.h -ec.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -ec.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -ec.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ec.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ec.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -ec.o: ../include/openssl/sha.h ../include/openssl/stack.h -ec.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -ec.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ec.o: ../include/openssl/x509v3.h apps.h ec.c +ec.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +ec.o: ../include/openssl/engine.h ../include/openssl/err.h +ec.o: ../include/openssl/evp.h ../include/openssl/fips.h +ec.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +ec.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +ec.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ec.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ec.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ec.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ec.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ec.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +ec.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ec.c ecparam.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ecparam.o: ../include/openssl/bn.h ../include/openssl/buffer.h ecparam.o: ../include/openssl/conf.h ../include/openssl/crypto.h ecparam.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ecparam.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -ecparam.o: ../include/openssl/engine.h ../include/openssl/err.h -ecparam.o: ../include/openssl/evp.h ../include/openssl/fips.h -ecparam.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ecparam.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -ecparam.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ecparam.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ecparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ecparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ecparam.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ecparam.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -ecparam.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -ecparam.o: ecparam.c +ecparam.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +ecparam.o: ../include/openssl/err.h ../include/openssl/evp.h +ecparam.o: ../include/openssl/fips.h ../include/openssl/lhash.h +ecparam.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ecparam.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +ecparam.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ecparam.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ecparam.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +ecparam.o: ../include/openssl/sha.h ../include/openssl/stack.h +ecparam.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +ecparam.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ecparam.o: ../include/openssl/x509v3.h apps.h ecparam.c enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h enc.o: ../include/openssl/buffer.h ../include/openssl/conf.h enc.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -enc.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -enc.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -enc.o: ../include/openssl/err.h ../include/openssl/evp.h -enc.o: ../include/openssl/fips.h ../include/openssl/lhash.h -enc.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -enc.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -enc.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h -enc.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h -enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h -enc.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -enc.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -enc.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h enc.c +enc.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +enc.o: ../include/openssl/engine.h ../include/openssl/err.h +enc.o: ../include/openssl/evp.h ../include/openssl/fips.h +enc.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +enc.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +enc.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +enc.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +enc.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +enc.o: ../include/openssl/rand.h ../include/openssl/safestack.h +enc.o: ../include/openssl/sha.h ../include/openssl/stack.h +enc.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +enc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +enc.o: ../include/openssl/x509v3.h apps.h enc.c engine.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h engine.o: ../include/openssl/bn.h ../include/openssl/buffer.h engine.o: ../include/openssl/comp.h ../include/openssl/conf.h engine.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h engine.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -engine.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -engine.o: ../include/openssl/engine.h ../include/openssl/err.h -engine.o: ../include/openssl/evp.h ../include/openssl/fips.h -engine.o: ../include/openssl/hmac.h ../include/openssl/kssl.h -engine.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -engine.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -engine.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -engine.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -engine.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -engine.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h -engine.o: ../include/openssl/safestack.h ../include/openssl/sha.h -engine.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -engine.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -engine.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -engine.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h -engine.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -engine.o: ../include/openssl/x509v3.h apps.h engine.c +engine.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +engine.o: ../include/openssl/err.h ../include/openssl/evp.h +engine.o: ../include/openssl/fips.h ../include/openssl/hmac.h +engine.o: ../include/openssl/kssl.h ../include/openssl/lhash.h +engine.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +engine.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +engine.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +engine.o: ../include/openssl/pem.h ../include/openssl/pem2.h +engine.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h +engine.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h +engine.o: ../include/openssl/sha.h ../include/openssl/ssl.h +engine.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +engine.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +engine.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +engine.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +engine.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +engine.o: engine.c errstr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h errstr.o: ../include/openssl/bn.h ../include/openssl/buffer.h errstr.o: ../include/openssl/comp.h ../include/openssl/conf.h errstr.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h errstr.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -errstr.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -errstr.o: ../include/openssl/engine.h ../include/openssl/err.h -errstr.o: ../include/openssl/evp.h ../include/openssl/fips.h -errstr.o: ../include/openssl/hmac.h ../include/openssl/kssl.h -errstr.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -errstr.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -errstr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -errstr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -errstr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -errstr.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h -errstr.o: ../include/openssl/safestack.h ../include/openssl/sha.h -errstr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -errstr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -errstr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -errstr.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h -errstr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -errstr.o: ../include/openssl/x509v3.h apps.h errstr.c +errstr.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +errstr.o: ../include/openssl/err.h ../include/openssl/evp.h +errstr.o: ../include/openssl/fips.h ../include/openssl/hmac.h +errstr.o: ../include/openssl/kssl.h ../include/openssl/lhash.h +errstr.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +errstr.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +errstr.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +errstr.o: ../include/openssl/pem.h ../include/openssl/pem2.h +errstr.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h +errstr.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h +errstr.o: ../include/openssl/sha.h ../include/openssl/ssl.h +errstr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +errstr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +errstr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +errstr.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +errstr.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +errstr.o: errstr.c gendh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h gendh.o: ../include/openssl/bn.h ../include/openssl/buffer.h gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h gendh.o: ../include/openssl/dh.h ../include/openssl/dsa.h gendh.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -gendh.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -gendh.o: ../include/openssl/engine.h ../include/openssl/err.h -gendh.o: ../include/openssl/evp.h ../include/openssl/fips.h -gendh.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -gendh.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -gendh.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -gendh.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -gendh.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -gendh.o: ../include/openssl/rand.h ../include/openssl/rsa.h -gendh.o: ../include/openssl/safestack.h ../include/openssl/sha.h -gendh.o: ../include/openssl/stack.h ../include/openssl/store.h -gendh.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -gendh.o: ../include/openssl/ui.h ../include/openssl/x509.h -gendh.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -gendh.o: gendh.c +gendh.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +gendh.o: ../include/openssl/err.h ../include/openssl/evp.h +gendh.o: ../include/openssl/fips.h ../include/openssl/lhash.h +gendh.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +gendh.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +gendh.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +gendh.o: ../include/openssl/pem.h ../include/openssl/pem2.h +gendh.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h +gendh.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +gendh.o: ../include/openssl/sha.h ../include/openssl/stack.h +gendh.o: ../include/openssl/store.h ../include/openssl/symhacks.h +gendh.o: ../include/openssl/txt_db.h ../include/openssl/ui.h +gendh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +gendh.o: ../include/openssl/x509v3.h apps.h gendh.c gendsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h gendsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h gendsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h gendsa.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h -gendsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -gendsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -gendsa.o: ../include/openssl/err.h ../include/openssl/evp.h -gendsa.o: ../include/openssl/fips.h ../include/openssl/lhash.h -gendsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -gendsa.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -gendsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -gendsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h -gendsa.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -gendsa.o: ../include/openssl/sha.h ../include/openssl/stack.h -gendsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -gendsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -gendsa.o: ../include/openssl/x509v3.h apps.h gendsa.c +gendsa.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +gendsa.o: ../include/openssl/engine.h ../include/openssl/err.h +gendsa.o: ../include/openssl/evp.h ../include/openssl/fips.h +gendsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +gendsa.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +gendsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +gendsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +gendsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +gendsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h +gendsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +gendsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +gendsa.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +gendsa.o: gendsa.c genrsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h genrsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h genrsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h genrsa.o: ../include/openssl/dh.h ../include/openssl/dsa.h genrsa.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -genrsa.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -genrsa.o: ../include/openssl/engine.h ../include/openssl/err.h -genrsa.o: ../include/openssl/evp.h ../include/openssl/fips.h -genrsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -genrsa.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -genrsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -genrsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -genrsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -genrsa.o: ../include/openssl/rand.h ../include/openssl/rsa.h -genrsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h -genrsa.o: ../include/openssl/stack.h ../include/openssl/store.h -genrsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -genrsa.o: ../include/openssl/ui.h ../include/openssl/x509.h -genrsa.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -genrsa.o: genrsa.c +genrsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +genrsa.o: ../include/openssl/err.h ../include/openssl/evp.h +genrsa.o: ../include/openssl/fips.h ../include/openssl/lhash.h +genrsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +genrsa.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +genrsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +genrsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h +genrsa.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h +genrsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +genrsa.o: ../include/openssl/sha.h ../include/openssl/stack.h +genrsa.o: ../include/openssl/store.h ../include/openssl/symhacks.h +genrsa.o: ../include/openssl/txt_db.h ../include/openssl/ui.h +genrsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +genrsa.o: ../include/openssl/x509v3.h apps.h genrsa.c nseq.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h nseq.o: ../include/openssl/buffer.h ../include/openssl/conf.h nseq.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -nseq.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -nseq.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -nseq.o: ../include/openssl/err.h ../include/openssl/evp.h -nseq.o: ../include/openssl/fips.h ../include/openssl/lhash.h -nseq.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -nseq.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -nseq.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -nseq.o: ../include/openssl/pem.h ../include/openssl/pem2.h -nseq.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -nseq.o: ../include/openssl/sha.h ../include/openssl/stack.h -nseq.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -nseq.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -nseq.o: ../include/openssl/x509v3.h apps.h nseq.c +nseq.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h +nseq.o: ../include/openssl/engine.h ../include/openssl/err.h +nseq.o: ../include/openssl/evp.h ../include/openssl/fips.h +nseq.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +nseq.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +nseq.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +nseq.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +nseq.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +nseq.o: ../include/openssl/safestack.h ../include/openssl/sha.h +nseq.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +nseq.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +nseq.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h nseq.c ocsp.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ocsp.o: ../include/openssl/bn.h ../include/openssl/buffer.h ocsp.o: ../include/openssl/comp.h ../include/openssl/conf.h ocsp.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h ocsp.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ocsp.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -ocsp.o: ../include/openssl/engine.h ../include/openssl/err.h -ocsp.o: ../include/openssl/evp.h ../include/openssl/fips.h -ocsp.o: ../include/openssl/hmac.h ../include/openssl/kssl.h -ocsp.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ocsp.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -ocsp.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ocsp.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ocsp.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ocsp.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h -ocsp.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ocsp.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ocsp.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -ocsp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ocsp.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h -ocsp.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ocsp.o: ../include/openssl/x509v3.h apps.h ocsp.c +ocsp.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +ocsp.o: ../include/openssl/err.h ../include/openssl/evp.h +ocsp.o: ../include/openssl/fips.h ../include/openssl/hmac.h +ocsp.o: ../include/openssl/kssl.h ../include/openssl/lhash.h +ocsp.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ocsp.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +ocsp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ocsp.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ocsp.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h +ocsp.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h +ocsp.o: ../include/openssl/sha.h ../include/openssl/ssl.h +ocsp.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +ocsp.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +ocsp.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +ocsp.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +ocsp.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ocsp.c openssl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h openssl.o: ../include/openssl/bn.h ../include/openssl/buffer.h openssl.o: ../include/openssl/comp.h ../include/openssl/conf.h openssl.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h openssl.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -openssl.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -openssl.o: ../include/openssl/engine.h ../include/openssl/err.h *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 19:02:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E62F106566C; Wed, 27 Jun 2012 19:02:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 214EC8FC16; Wed, 27 Jun 2012 19:02:33 +0000 (UTC) Message-ID: <4FEB58C8.6060001@FreeBSD.org> Date: Wed, 27 Jun 2012 15:02:32 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120626 Thunderbird/13.0.1 MIME-Version: 1.0 To: Jung-uk Kim References: <201206271844.q5RIibeP026457@svn.freebsd.org> In-Reply-To: <201206271844.q5RIibeP026457@svn.freebsd.org> X-Enigmail-Version: 1.4.2 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: r237657 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 19:02:33 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-06-27 14:44:37 -0400, Jung-uk Kim wrote: > Author: jkim Date: Wed Jun 27 18:44:36 2012 New Revision: 237657 > URL: http://svn.freebsd.org/changeset/base/237657 > > Log: Merge OpenSSL 0.9.8x. > > Reviewed by: stas Approved by: benl (maintainer) MFC after: 3 days Please note I didn't regenerate i386 asm files on purpose. They are seriously out-dated (generated 8 years ago with GCC 2.x). I'll prepare for a separate patch for them (and amd64 asm files). Cheers, Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/rWMgACgkQmlay1b9qnVOdoQCgmSGvKOUV3kz6yHmwv6z2ehR4 29YAn20OdcJPG6D3ViZLP6ILNl/VwU8Z =VR4S -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 19:17:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B787A106566B; Wed, 27 Jun 2012 19:17:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5EB8FC0A; Wed, 27 Jun 2012 19:17:45 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0CEB4B944; Wed, 27 Jun 2012 15:17:45 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Wed, 27 Jun 2012 15:17:26 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201206271808.q5RI8m0d024853@svn.freebsd.org> In-Reply-To: <201206271808.q5RI8m0d024853@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201206271517.26128.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 27 Jun 2012 15:17:45 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r237656 - in head: contrib/top usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 19:17:45 -0000 On Wednesday, June 27, 2012 2:08:48 pm John Baldwin wrote: > Author: jhb > Date: Wed Jun 27 18:08:48 2012 > New Revision: 237656 > URL: http://svn.freebsd.org/changeset/base/237656 > > Log: > Add a new line to top that provides a brief summary of the ZFS ARC memory > usage on hosts using ZFS. The new line displays the total amount of RAM > used by the ARC along with the size of MFU, MRU, anonymous (in flight), > headers, and other (miscellaneous) sub-categories. The line is not > displayed on systems that are not using ZFS. > > Reviewed by: avg, fs@ > MFC after: 3 days FYI, sample output: CPU: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle Mem: 1252M Active, 1422M Inact, 23G Wired, 331M Buf, 21G Free ARC: 21G Total, 1354M MRU, 19G MFU, 272K Anon, 243M Header, 447M Other Swap: 8192M Total, 8192M Free -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 19:23:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 944CA106566C; Wed, 27 Jun 2012 19:23:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65E3D8FC17; Wed, 27 Jun 2012 19:23:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RJNU2S028155; Wed, 27 Jun 2012 19:23:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RJNUDj028151; Wed, 27 Jun 2012 19:23:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206271923.q5RJNUDj028151@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 27 Jun 2012 19:23: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: r237658 - in head/crypto/openssl/doc: apps crypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 19:23:30 -0000 Author: jkim Date: Wed Jun 27 19:23:29 2012 New Revision: 237658 URL: http://svn.freebsd.org/changeset/base/237658 Log: Partially redo r226436, i. e., change "the the" to "the". ca(1), dgst(1), and engine(3) are generated from these pod files during merge process and we do not want to re-apply these changes over and over again. Approved by: benl (maintainer, implicit) Modified: head/crypto/openssl/doc/apps/ca.pod head/crypto/openssl/doc/apps/dgst.pod head/crypto/openssl/doc/crypto/engine.pod Modified: head/crypto/openssl/doc/apps/ca.pod ============================================================================== --- head/crypto/openssl/doc/apps/ca.pod Wed Jun 27 18:44:36 2012 (r237657) +++ head/crypto/openssl/doc/apps/ca.pod Wed Jun 27 19:23:29 2012 (r237658) @@ -88,7 +88,7 @@ section for information on the required =item B<-infiles> if present this should be the last option, all subsequent arguments -are assumed to the the names of files containing certificate requests. +are assumed to be the names of files containing certificate requests. =item B<-out filename> Modified: head/crypto/openssl/doc/apps/dgst.pod ============================================================================== --- head/crypto/openssl/doc/apps/dgst.pod Wed Jun 27 18:44:36 2012 (r237657) +++ head/crypto/openssl/doc/apps/dgst.pod Wed Jun 27 19:23:29 2012 (r237658) @@ -68,7 +68,7 @@ see the B section =item B<-verify filename> -verify the signature using the the public key in "filename". +verify the signature using the public key in "filename". The output is either "Verification OK" or "Verification Failure". =item B<-prverify filename> Modified: head/crypto/openssl/doc/crypto/engine.pod ============================================================================== --- head/crypto/openssl/doc/crypto/engine.pod Wed Jun 27 18:44:36 2012 (r237657) +++ head/crypto/openssl/doc/crypto/engine.pod Wed Jun 27 19:23:29 2012 (r237658) @@ -517,7 +517,7 @@ implemented by ENGINEs should be numbere this symbol is considered a "generic" command is handled directly by the OpenSSL core routines. -It is using these "core" control commands that one can discover the the control +It is using these "core" control commands that one can discover the control commands implemented by a given ENGINE, specifically the commands; #define ENGINE_HAS_CTRL_FUNCTION 10 From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 20:20:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CC771065673; Wed, 27 Jun 2012 20:20:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 98A9A8FC15; Wed, 27 Jun 2012 20:20:33 +0000 (UTC) Message-ID: <4FEB6B11.8080309@FreeBSD.org> Date: Wed, 27 Jun 2012 16:20:33 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120626 Thunderbird/13.0.1 MIME-Version: 1.0 To: src-committers@freebsd.org References: <201206271844.q5RIibeP026457@svn.freebsd.org> <4FEB58C8.6060001@FreeBSD.org> In-Reply-To: <4FEB58C8.6060001@FreeBSD.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r237657 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 20:20:34 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-06-27 15:02:32 -0400, Jung-uk Kim wrote: > On 2012-06-27 14:44:37 -0400, Jung-uk Kim wrote: >> Author: jkim Date: Wed Jun 27 18:44:36 2012 New Revision: 237657 >> URL: http://svn.freebsd.org/changeset/base/237657 > >> Log: Merge OpenSSL 0.9.8x. > >> Reviewed by: stas Approved by: benl (maintainer) MFC after: 3 >> days > > Please note I didn't regenerate i386 asm files on purpose. They > are seriously out-dated (generated 8 years ago with GCC 2.x). > I'll prepare for a separate patch for them (and amd64 asm files). FYI, the patch is available from here: http://people.freebsd.org/~jkim/openssl-asm.diff Waiting for maintainer's approval... ;-) Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/raxEACgkQmlay1b9qnVNQlACfXyP+U5C6nDSe09mubS1j611+ Q/4AniJsKobRrvRkPtekL/+hzce88L/T =P0WV -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 20:24:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97865106564A; Wed, 27 Jun 2012 20:24:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54DBE8FC16; Wed, 27 Jun 2012 20:24:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RKOQZ4030763; Wed, 27 Jun 2012 20:24:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RKOQRU030761; Wed, 27 Jun 2012 20:24:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206272024.q5RKOQRU030761@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 27 Jun 2012 20:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237659 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 20:24:26 -0000 Author: kib Date: Wed Jun 27 20:24:25 2012 New Revision: 237659 URL: http://svn.freebsd.org/changeset/base/237659 Log: Ensure that for the object which is a dependency for some filtee, relocations are performed before the object's initializer is called. When dlopen()ing an object, relocate the whole DAG rooted in the object instead of only relocating the object itself and list of newly loaded dependencies. Reversed sequence currently can occur if the same object is a dependency for both filtee and filter, since filtees are loaded typically during the relocation processing, when some filter dependencies might be already loaded but not relocated yet. Reported and tested by: swills Reviewed by: kan MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Jun 27 19:23:29 2012 (r237658) +++ head/libexec/rtld-elf/rtld.c Wed Jun 27 20:24:25 2012 (r237659) @@ -117,6 +117,10 @@ static void objlist_push_head(Objlist *, static void objlist_push_tail(Objlist *, Obj_Entry *); static void objlist_remove(Objlist *, Obj_Entry *); static void *path_enumerate(const char *, path_enum_proc, void *); +static int relocate_object_dag(Obj_Entry *root, bool bind_now, + Obj_Entry *rtldobj, int flags, RtldLockState *lockstate); +static int relocate_object(Obj_Entry *obj, bool bind_now, Obj_Entry *rtldobj, + int flags, RtldLockState *lockstate); static int relocate_objects(Obj_Entry *, bool, Obj_Entry *, int, RtldLockState *); static int resolve_objects_ifunc(Obj_Entry *first, bool bind_now, @@ -2217,52 +2221,70 @@ objlist_remove(Objlist *list, Obj_Entry } /* - * Relocate newly-loaded shared objects. The argument is a pointer to - * the Obj_Entry for the first such object. All objects from the first - * to the end of the list of objects are relocated. Returns 0 on success, - * or -1 on failure. + * Relocate dag rooted in the specified object. + * Returns 0 on success, or -1 on failure. */ + static int -relocate_objects(Obj_Entry *first, bool bind_now, Obj_Entry *rtldobj, +relocate_object_dag(Obj_Entry *root, bool bind_now, Obj_Entry *rtldobj, + int flags, RtldLockState *lockstate) +{ + Objlist_Entry *elm; + int error; + + error = 0; + STAILQ_FOREACH(elm, &root->dagmembers, link) { + error = relocate_object(elm->obj, bind_now, rtldobj, flags, + lockstate); + if (error == -1) + break; + } + return (error); +} + +/* + * Relocate single object. + * Returns 0 on success, or -1 on failure. + */ +static int +relocate_object(Obj_Entry *obj, bool bind_now, Obj_Entry *rtldobj, int flags, RtldLockState *lockstate) { - Obj_Entry *obj; - for (obj = first; obj != NULL; obj = obj->next) { if (obj->relocated) - continue; + return (0); obj->relocated = true; if (obj != rtldobj) - dbg("relocating \"%s\"", obj->path); + dbg("relocating \"%s\"", obj->path); if (obj->symtab == NULL || obj->strtab == NULL || - !(obj->valid_hash_sysv || obj->valid_hash_gnu)) { - _rtld_error("%s: Shared object has no run-time symbol table", - obj->path); - return -1; + !(obj->valid_hash_sysv || obj->valid_hash_gnu)) { + _rtld_error("%s: Shared object has no run-time symbol table", + obj->path); + return (-1); } if (obj->textrel) { - /* There are relocations to the write-protected text segment. */ - if (mprotect(obj->mapbase, obj->textsize, - PROT_READ|PROT_WRITE|PROT_EXEC) == -1) { - _rtld_error("%s: Cannot write-enable text segment: %s", - obj->path, rtld_strerror(errno)); - return -1; - } + /* There are relocations to the write-protected text segment. */ + if (mprotect(obj->mapbase, obj->textsize, + PROT_READ|PROT_WRITE|PROT_EXEC) == -1) { + _rtld_error("%s: Cannot write-enable text segment: %s", + obj->path, rtld_strerror(errno)); + return (-1); + } } /* Process the non-PLT relocations. */ if (reloc_non_plt(obj, rtldobj, flags, lockstate)) - return -1; + return (-1); if (obj->textrel) { /* Re-protected the text segment. */ - if (mprotect(obj->mapbase, obj->textsize, - PROT_READ|PROT_EXEC) == -1) { - _rtld_error("%s: Cannot write-protect text segment: %s", - obj->path, rtld_strerror(errno)); - return -1; - } + if (mprotect(obj->mapbase, obj->textsize, + PROT_READ|PROT_EXEC) == -1) { + _rtld_error("%s: Cannot write-protect text segment: %s", + obj->path, rtld_strerror(errno)); + return (-1); + } } @@ -2271,18 +2293,19 @@ relocate_objects(Obj_Entry *first, bool /* Process the PLT relocations. */ if (reloc_plt(obj) == -1) - return -1; + return (-1); /* Relocate the jump slots if we are doing immediate binding. */ if (obj->bind_now || bind_now) - if (reloc_jmpslots(obj, flags, lockstate) == -1) - return -1; + if (reloc_jmpslots(obj, flags, lockstate) == -1) + return (-1); if (obj->relro_size > 0) { - if (mprotect(obj->relro_page, obj->relro_size, PROT_READ) == -1) { - _rtld_error("%s: Cannot enforce relro protection: %s", - obj->path, rtld_strerror(errno)); - return -1; - } + if (mprotect(obj->relro_page, obj->relro_size, + PROT_READ) == -1) { + _rtld_error("%s: Cannot enforce relro protection: %s", + obj->path, rtld_strerror(errno)); + return (-1); + } } /* @@ -2292,9 +2315,30 @@ relocate_objects(Obj_Entry *first, bool */ obj->magic = RTLD_MAGIC; obj->version = RTLD_VERSION; - } - return (0); + return (0); +} + +/* + * Relocate newly-loaded shared objects. The argument is a pointer to + * the Obj_Entry for the first such object. All objects from the first + * to the end of the list of objects are relocated. Returns 0 on success, + * or -1 on failure. + */ +static int +relocate_objects(Obj_Entry *first, bool bind_now, Obj_Entry *rtldobj, + int flags, RtldLockState *lockstate) +{ + Obj_Entry *obj; + int error; + + for (error = 0, obj = first; obj != NULL; obj = obj->next) { + error = relocate_object(obj, bind_now, rtldobj, flags, + lockstate); + if (error == -1) + break; + } + return (error); } /* @@ -2614,10 +2658,10 @@ dlopen_object(const char *name, int fd, result = rtld_verify_versions(&obj->dagmembers); if (result != -1 && ld_tracing) goto trace; - if (result == -1 || (relocate_objects(obj, - (mode & RTLD_MODEMASK) == RTLD_NOW, &obj_rtld, + if (result == -1 || relocate_object_dag(obj, + (mode & RTLD_MODEMASK) == RTLD_NOW, &obj_rtld, (lo_flags & RTLD_LO_EARLY) ? SYMLOOK_EARLY : 0, - lockstate)) == -1) { + lockstate) == -1) { dlopen_cleanup(obj); obj = NULL; } else if (lo_flags & RTLD_LO_EARLY) { From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 20:32:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28779106566C; Wed, 27 Jun 2012 20:32:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 136548FC21; Wed, 27 Jun 2012 20:32:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RKWjii031176; Wed, 27 Jun 2012 20:32:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RKWjvt031174; Wed, 27 Jun 2012 20:32:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206272032.q5RKWjvt031174@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 27 Jun 2012 20:32: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: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 20:32:46 -0000 Author: kib Date: Wed Jun 27 20:32:45 2012 New Revision: 237660 URL: http://svn.freebsd.org/changeset/base/237660 Log: Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPU value if present. MFC after: 1 week Modified: head/lib/libc/gen/sysconf.c Modified: head/lib/libc/gen/sysconf.c ============================================================================== --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 (r237659) +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 (r237660) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include "../stdlib/atexit.h" #include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ +#include "libc_private.h" #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ @@ -585,6 +587,8 @@ yesno: case _SC_NPROCESSORS_CONF: case _SC_NPROCESSORS_ONLN: + if (_elf_aux_info(AT_NCPUS, &value, sizeof(value)) == 0) + return ((long)value); mib[0] = CTL_HW; mib[1] = HW_NCPU; break; From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 20:34:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84CC1106566C; Wed, 27 Jun 2012 20:34:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FF248FC1E; Wed, 27 Jun 2012 20:34:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RKYUu2031298; Wed, 27 Jun 2012 20:34:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RKYUrN031296; Wed, 27 Jun 2012 20:34:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206272034.q5RKYUrN031296@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 27 Jun 2012 20:34: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: r237661 - head/tools/test/auxinfo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 20:34:30 -0000 Author: kib Date: Wed Jun 27 20:34:29 2012 New Revision: 237661 URL: http://svn.freebsd.org/changeset/base/237661 Log: Add a test for number of CPUs configured/online. MFC after: 1 week Modified: head/tools/test/auxinfo/auxinfo.c Modified: head/tools/test/auxinfo/auxinfo.c ============================================================================== --- head/tools/test/auxinfo/auxinfo.c Wed Jun 27 20:32:45 2012 (r237660) +++ head/tools/test/auxinfo/auxinfo.c Wed Jun 27 20:34:29 2012 (r237661) @@ -47,6 +47,13 @@ test_osreldate(void) printf("OSRELDATE: %d\n", getosreldate()); } +static void +test_ncpus(void) +{ + + printf("NCPUs: %ld\n", sysconf(_SC_NPROCESSORS_CONF)); +} + int main(int argc __unused, char *argv[] __unused) { @@ -54,5 +61,6 @@ main(int argc __unused, char *argv[] __u test_pagesizes(); test_pagesize(); test_osreldate(); + test_ncpus(); return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 20:38:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D17951065676; Wed, 27 Jun 2012 20:38:02 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 77CA08FC1A; Wed, 27 Jun 2012 20:38:02 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 9F51A14E7ADA; Wed, 27 Jun 2012 22:38:01 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id S2QguTl-kANI; Wed, 27 Jun 2012 22:38:01 +0200 (CEST) Received: from [192.168.1.117] (catv-80-98-232-12.catv.broadband.hu [80.98.232.12]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 1EECF14E7AD6; Wed, 27 Jun 2012 22:38:01 +0200 (CEST) Message-ID: <4FEB6F27.4060906@FreeBSD.org> Date: Wed, 27 Jun 2012 22:37:59 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120604 Thunderbird/14.0a2 MIME-Version: 1.0 To: Eitan Adler References: <201206270550.q5R5oFnE084849@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237628 - head/usr.bin/sort X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 20:38:02 -0000 On 2012.06.27. 8:48, Eitan Adler wrote: >> >Log: >> > - Disable threaded sort by default > Curious, why? > We just want to test it a bit more before we enable it. Gabor From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 21:05:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85FEF10656A6; Wed, 27 Jun 2012 21:05:21 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7095A8FC15; Wed, 27 Jun 2012 21:05:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RL5L0I032628; Wed, 27 Jun 2012 21:05:21 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RL5LEr032626; Wed, 27 Jun 2012 21:05:21 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201206272105.q5RL5LEr032626@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 27 Jun 2012 21:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237662 - stable/9/sys/dev/drm2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 21:05:21 -0000 Author: gavin Date: Wed Jun 27 21:05:21 2012 New Revision: 237662 URL: http://svn.freebsd.org/changeset/base/237662 Log: Merge r237411 from head (originally by emast): Add PCI IDs for Ivy Bridge Requested by: emaste Modified: stable/9/sys/dev/drm2/drm_pciids.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/drm_pciids.h ============================================================================== --- stable/9/sys/dev/drm2/drm_pciids.h Wed Jun 27 20:34:29 2012 (r237661) +++ stable/9/sys/dev/drm2/drm_pciids.h Wed Jun 27 21:05:21 2012 (r237662) @@ -566,6 +566,12 @@ {0x8086, 0x0116, CHIP_I9XX|CHIP_I915, "Intel SandyBridge (M)"}, \ {0x8086, 0x0126, CHIP_I9XX|CHIP_I915, "Intel SandyBridge (M)"}, \ {0x8086, 0x010A, CHIP_I9XX|CHIP_I915, "Intel SandyBridge (M)"}, \ + {0x8086, 0x0152, CHIP_I9XX|CHIP_I915, "Intel IvyBridge"}, \ + {0x8086, 0x0162, CHIP_I9XX|CHIP_I915, "Intel IvyBridge"}, \ + {0x8086, 0x0156, CHIP_I9XX|CHIP_I915, "Intel IvyBridge (M)"}, \ + {0x8086, 0x0166, CHIP_I9XX|CHIP_I915, "Intel IvyBridge (M)"}, \ + {0x8086, 0x015A, CHIP_I9XX|CHIP_I915, "Intel IvyBridge (S)"}, \ + {0x8086, 0x016A, CHIP_I9XX|CHIP_I915, "Intel IvyBridge (S)"}, \ {0x8086, 0xA001, CHIP_I9XX|CHIP_I965, "Intel Pineview"}, \ {0x8086, 0xA011, CHIP_I9XX|CHIP_I965, "Intel Pineview (M)"}, \ {0, 0, 0, NULL} From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 21:12:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E994310657A5; Wed, 27 Jun 2012 21:12:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC02E8FC14; Wed, 27 Jun 2012 21:12:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RLCGsX032960; Wed, 27 Jun 2012 21:12:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RLCGPK032949; Wed, 27 Jun 2012 21:12:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206272112.q5RLCGPK032949@svn.freebsd.org> From: John Baldwin Date: Wed, 27 Jun 2012 21:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237663 - in stable/9: sys/kern sys/sys sys/vm usr.bin/kdump usr.bin/ktrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 21:12:17 -0000 Author: jhb Date: Wed Jun 27 21:12:15 2012 New Revision: 237663 URL: http://svn.freebsd.org/changeset/base/237663 Log: MFC 233925,236357: Add new ktrace records for the start and end of VM faults. This gives a pair of records similar to syscall entry and return that a user can use to determine how long page faults take. The new ktrace records are enabled via the 'p' trace type, but are not enabled in the default set of trace points. Modified: stable/9/sys/kern/kern_ktrace.c stable/9/sys/sys/ktrace.h stable/9/sys/vm/vm_fault.c stable/9/usr.bin/kdump/kdump.1 stable/9/usr.bin/kdump/kdump.c stable/9/usr.bin/kdump/kdump_subr.h stable/9/usr.bin/kdump/mksubr stable/9/usr.bin/ktrace/ktrace.1 stable/9/usr.bin/ktrace/ktrace.h stable/9/usr.bin/ktrace/subr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/usr.bin/kdump/ (props changed) stable/9/usr.bin/ktrace/ (props changed) Modified: stable/9/sys/kern/kern_ktrace.c ============================================================================== --- stable/9/sys/kern/kern_ktrace.c Wed Jun 27 21:05:21 2012 (r237662) +++ stable/9/sys/kern/kern_ktrace.c Wed Jun 27 21:12:15 2012 (r237663) @@ -100,6 +100,8 @@ struct ktr_request { struct ktr_genio ktr_genio; struct ktr_psig ktr_psig; struct ktr_csw ktr_csw; + struct ktr_fault ktr_fault; + struct ktr_faultend ktr_faultend; } ktr_data; STAILQ_ENTRY(ktr_request) ktr_list; }; @@ -117,6 +119,8 @@ static int data_lengths[] = { 0, /* KTR_SYSCTL */ sizeof(struct ktr_proc_ctor), /* KTR_PROCCTOR */ 0, /* KTR_PROCDTOR */ + sizeof(struct ktr_fault), /* KTR_FAULT */ + sizeof(struct ktr_faultend), /* KTR_FAULTEND */ }; static STAILQ_HEAD(, ktr_request) ktr_free; @@ -768,6 +772,42 @@ ktrstruct(name, data, datalen) req->ktr_header.ktr_len = buflen; ktr_submitrequest(curthread, req); } + +void +ktrfault(vaddr, type) + vm_offset_t vaddr; + int type; +{ + struct thread *td = curthread; + struct ktr_request *req; + struct ktr_fault *kf; + + req = ktr_getrequest(KTR_FAULT); + if (req == NULL) + return; + kf = &req->ktr_data.ktr_fault; + kf->vaddr = vaddr; + kf->type = type; + ktr_enqueuerequest(td, req); + ktrace_exit(td); +} + +void +ktrfaultend(result) + int result; +{ + struct thread *td = curthread; + struct ktr_request *req; + struct ktr_faultend *kf; + + req = ktr_getrequest(KTR_FAULTEND); + if (req == NULL) + return; + kf = &req->ktr_data.ktr_faultend; + kf->result = result; + ktr_enqueuerequest(td, req); + ktrace_exit(td); +} #endif /* KTRACE */ /* Interface and common routines */ Modified: stable/9/sys/sys/ktrace.h ============================================================================== --- stable/9/sys/sys/ktrace.h Wed Jun 27 21:05:21 2012 (r237662) +++ stable/9/sys/sys/ktrace.h Wed Jun 27 21:12:15 2012 (r237663) @@ -178,6 +178,23 @@ struct ktr_proc_ctor { #define KTR_PROCDTOR 11 /* + * KTR_FAULT - page fault record + */ +#define KTR_FAULT 13 +struct ktr_fault { + vm_offset_t vaddr; + int type; +}; + +/* + * KTR_FAULTEND - end of page fault record + */ +#define KTR_FAULTEND 14 +struct ktr_faultend { + int result; +}; + +/* * KTR_DROP - If this bit is set in ktr_type, then at least one event * between the previous record and this record was dropped. */ @@ -198,6 +215,8 @@ struct ktr_proc_ctor { #define KTRFAC_SYSCTL (1< __FBSDID("$FreeBSD$"); +#include "opt_ktrace.h" #include "opt_vm.h" #include @@ -86,6 +87,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef KTRACE +#include +#endif #include #include @@ -212,10 +216,23 @@ int vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, int fault_flags) { + struct thread *td; + int result; - if ((curthread->td_pflags & TDP_NOFAULTING) != 0) + td = curthread; + if ((td->td_pflags & TDP_NOFAULTING) != 0) return (KERN_PROTECTION_FAILURE); - return (vm_fault_hold(map, vaddr, fault_type, fault_flags, NULL)); +#ifdef KTRACE + if (map != kernel_map && KTRPOINT(td, KTR_FAULT)) + ktrfault(vaddr, fault_type); +#endif + result = vm_fault_hold(map, trunc_page(vaddr), fault_type, fault_flags, + NULL); +#ifdef KTRACE + if (map != kernel_map && KTRPOINT(td, KTR_FAULTEND)) + ktrfaultend(result); +#endif + return (result); } int Modified: stable/9/usr.bin/kdump/kdump.1 ============================================================================== --- stable/9/usr.bin/kdump/kdump.1 Wed Jun 27 21:05:21 2012 (r237662) +++ stable/9/usr.bin/kdump/kdump.1 Wed Jun 27 21:12:15 2012 (r237663) @@ -28,7 +28,7 @@ .\" @(#)kdump.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 23, 2008 +.Dd April 5, 2012 .Dt KDUMP 1 .Os .Sh NAME @@ -171,6 +171,8 @@ The possible operations are: .It Li USER Ta data from user process Ta the data .It Li STRU Ta various syscalls Ta structure .It Li SCTL Ta Xr sysctl 3 requests Ta MIB name +.It Li PFLT Ta enter page fault Ta fault address and type +.It Li PRET Ta return from page fault Ta fault result .El .Sh SEE ALSO .Xr ktrace 1 Modified: stable/9/usr.bin/kdump/kdump.c ============================================================================== --- stable/9/usr.bin/kdump/kdump.c Wed Jun 27 21:05:21 2012 (r237662) +++ stable/9/usr.bin/kdump/kdump.c Wed Jun 27 21:12:15 2012 (r237663) @@ -99,6 +99,8 @@ void ktruser(int, unsigned char *); void ktrsockaddr(struct sockaddr *); void ktrstat(struct stat *); void ktrstruct(char *, size_t); +void ktrfault(struct ktr_fault *); +void ktrfaultend(struct ktr_faultend *); void usage(void); void sockfamilyname(int); const char *ioctlname(u_long); @@ -302,6 +304,12 @@ main(int argc, char *argv[]) case KTR_STRUCT: ktrstruct(m, ktrlen); break; + case KTR_FAULT: + ktrfault((struct ktr_fault *)m); + break; + case KTR_FAULTEND: + ktrfaultend((struct ktr_faultend *)m); + break; default: printf("\n"); break; @@ -441,6 +449,12 @@ dumpheader(struct ktr_header *kth) /* FALLTHROUGH */ case KTR_PROCDTOR: return; + case KTR_FAULT: + type = "PFLT"; + break; + case KTR_FAULTEND: + type = "PRET"; + break; default: (void)sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type); type = unknown; @@ -1512,6 +1526,23 @@ invalid: printf("invalid record\n"); } +void +ktrfault(struct ktr_fault *ktr) +{ + + printf("0x%jx ", ktr->vaddr); + vmprotname(ktr->type); + printf("\n"); +} + +void +ktrfaultend(struct ktr_faultend *ktr) +{ + + vmresultname(ktr->result); + printf("\n"); +} + #if defined(__amd64__) || defined(__i386__) void linux_ktrsyscall(struct ktr_syscall *ktr) Modified: stable/9/usr.bin/kdump/kdump_subr.h ============================================================================== --- stable/9/usr.bin/kdump/kdump_subr.h Wed Jun 27 21:05:21 2012 (r237662) +++ stable/9/usr.bin/kdump/kdump_subr.h Wed Jun 27 21:12:15 2012 (r237663) @@ -46,3 +46,5 @@ void lio_listioname (int); void minheritname (int); void quotactlname (int); void ptraceopname (int); +void vmprotname (int); +void vmresultname (int); Modified: stable/9/usr.bin/kdump/mksubr ============================================================================== --- stable/9/usr.bin/kdump/mksubr Wed Jun 27 21:05:21 2012 (r237662) +++ stable/9/usr.bin/kdump/mksubr Wed Jun 27 21:12:15 2012 (r237663) @@ -185,6 +185,8 @@ cat <<_EOF_ #include #include #include +#include +#include #include "kdump_subr.h" @@ -329,6 +331,26 @@ sockoptlevelname (int level, int decimal } } +/* + * MANUAL + * + * Used for page fault type. Cannot use auto_or_type since the macro + * values contain a cast. Also, VM_PROT_NONE has to be handled specially. + */ +void +vmprotname (int type) +{ + int or = 0; + + if (type == VM_PROT_NONE) { + (void)printf("VM_PROT_NONE"); + return; + } + if_print_or(type, VM_PROT_READ, or); + if_print_or(type, VM_PROT_WRITE, or); + if_print_or(type, VM_PROT_EXECUTE, or); + if_print_or(type, VM_PROT_COPY, or); +} _EOF_ auto_or_type "modename" "S_[A-Z]+[[:space:]]+[0-6]{7}" "sys/stat.h" @@ -370,6 +392,7 @@ auto_if_type "sockipprotoname" "IPPROTO_ auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" auto_switch_type "ptraceopname" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" +auto_switch_type "vmresultname" "KERN_[A-Z]+[[:space:]]+[0-9]+" "vm/vm_param.h" cat <<_EOF_ /* Modified: stable/9/usr.bin/ktrace/ktrace.1 ============================================================================== --- stable/9/usr.bin/ktrace/ktrace.1 Wed Jun 27 21:05:21 2012 (r237662) +++ stable/9/usr.bin/ktrace/ktrace.1 Wed Jun 27 21:12:15 2012 (r237663) @@ -28,7 +28,7 @@ .\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 23, 2008 +.Dd May 31, 2012 .Dt KTRACE 1 .Os .Sh NAME @@ -108,6 +108,8 @@ The following table equates the letters .Bl -tag -width flag -compact .It Cm c trace system calls +.It Cm f +trace page faults .It Cm i trace .Tn I/O Modified: stable/9/usr.bin/ktrace/ktrace.h ============================================================================== --- stable/9/usr.bin/ktrace/ktrace.h Wed Jun 27 21:05:21 2012 (r237662) +++ stable/9/usr.bin/ktrace/ktrace.h Wed Jun 27 21:12:15 2012 (r237663) @@ -36,7 +36,8 @@ #define PROC_ABI_POINTS (KTRFAC_PROCCTOR | KTRFAC_PROCDTOR) -#define ALL_POINTS (DEF_POINTS | KTRFAC_CSW | PROC_ABI_POINTS) +#define ALL_POINTS (DEF_POINTS | KTRFAC_CSW | PROC_ABI_POINTS | \ + KTRFAC_FAULT | KTRFAC_FAULTEND) #define DEF_TRACEFILE "ktrace.out" Modified: stable/9/usr.bin/ktrace/subr.c ============================================================================== --- stable/9/usr.bin/ktrace/subr.c Wed Jun 27 21:05:21 2012 (r237662) +++ stable/9/usr.bin/ktrace/subr.c Wed Jun 27 21:12:15 2012 (r237663) @@ -61,6 +61,9 @@ getpoints(char *s) case 'c': facs |= KTRFAC_SYSCALL | KTRFAC_SYSRET; break; + case 'f': + facs |= KTRFAC_FAULT | KTRFAC_FAULTEND; + break; case 'n': facs |= KTRFAC_NAMEI; break; From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 21:13:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 194C5106564A; Wed, 27 Jun 2012 21:13:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 014B78FC0C; Wed, 27 Jun 2012 21:13:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RLD0di033037; Wed, 27 Jun 2012 21:13:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RLD0fO033026; Wed, 27 Jun 2012 21:13:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206272113.q5RLD0fO033026@svn.freebsd.org> From: John Baldwin Date: Wed, 27 Jun 2012 21:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237664 - in stable/8: sys/kern sys/sys sys/vm usr.bin/kdump usr.bin/ktrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 21:13:01 -0000 Author: jhb Date: Wed Jun 27 21:13:00 2012 New Revision: 237664 URL: http://svn.freebsd.org/changeset/base/237664 Log: MFC 233925,236357: Add new ktrace records for the start and end of VM faults. This gives a pair of records similar to syscall entry and return that a user can use to determine how long page faults take. The new ktrace records are enabled via the 'p' trace type, but are not enabled in the default set of trace points. Modified: stable/8/sys/kern/kern_ktrace.c stable/8/sys/sys/ktrace.h stable/8/sys/vm/vm_fault.c stable/8/usr.bin/kdump/kdump.1 stable/8/usr.bin/kdump/kdump.c stable/8/usr.bin/kdump/kdump_subr.h stable/8/usr.bin/kdump/mksubr stable/8/usr.bin/ktrace/ktrace.1 stable/8/usr.bin/ktrace/ktrace.h stable/8/usr.bin/ktrace/subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/ktrace/ (props changed) Modified: stable/8/sys/kern/kern_ktrace.c ============================================================================== --- stable/8/sys/kern/kern_ktrace.c Wed Jun 27 21:12:15 2012 (r237663) +++ stable/8/sys/kern/kern_ktrace.c Wed Jun 27 21:13:00 2012 (r237664) @@ -98,6 +98,8 @@ struct ktr_request { struct ktr_genio ktr_genio; struct ktr_psig ktr_psig; struct ktr_csw ktr_csw; + struct ktr_fault ktr_fault; + struct ktr_faultend ktr_faultend; } ktr_data; STAILQ_ENTRY(ktr_request) ktr_list; }; @@ -115,6 +117,8 @@ static int data_lengths[] = { 0, /* KTR_SYSCTL */ sizeof(struct ktr_proc_ctor), /* KTR_PROCCTOR */ 0, /* KTR_PROCDTOR */ + sizeof(struct ktr_fault), /* KTR_FAULT */ + sizeof(struct ktr_faultend), /* KTR_FAULTEND */ }; static STAILQ_HEAD(, ktr_request) ktr_free; @@ -767,6 +771,42 @@ ktrstruct(name, namelen, data, datalen) req->ktr_header.ktr_len = buflen; ktr_submitrequest(curthread, req); } + +void +ktrfault(vaddr, type) + vm_offset_t vaddr; + int type; +{ + struct thread *td = curthread; + struct ktr_request *req; + struct ktr_fault *kf; + + req = ktr_getrequest(KTR_FAULT); + if (req == NULL) + return; + kf = &req->ktr_data.ktr_fault; + kf->vaddr = vaddr; + kf->type = type; + ktr_enqueuerequest(td, req); + ktrace_exit(td); +} + +void +ktrfaultend(result) + int result; +{ + struct thread *td = curthread; + struct ktr_request *req; + struct ktr_faultend *kf; + + req = ktr_getrequest(KTR_FAULTEND); + if (req == NULL) + return; + kf = &req->ktr_data.ktr_faultend; + kf->result = result; + ktr_enqueuerequest(td, req); + ktrace_exit(td); +} #endif /* KTRACE */ /* Interface and common routines */ Modified: stable/8/sys/sys/ktrace.h ============================================================================== --- stable/8/sys/sys/ktrace.h Wed Jun 27 21:12:15 2012 (r237663) +++ stable/8/sys/sys/ktrace.h Wed Jun 27 21:13:00 2012 (r237664) @@ -178,6 +178,23 @@ struct ktr_proc_ctor { #define KTR_PROCDTOR 11 /* + * KTR_FAULT - page fault record + */ +#define KTR_FAULT 13 +struct ktr_fault { + vm_offset_t vaddr; + int type; +}; + +/* + * KTR_FAULTEND - end of page fault record + */ +#define KTR_FAULTEND 14 +struct ktr_faultend { + int result; +}; + +/* * KTR_DROP - If this bit is set in ktr_type, then at least one event * between the previous record and this record was dropped. */ @@ -198,6 +215,8 @@ struct ktr_proc_ctor { #define KTRFAC_SYSCTL (1< __FBSDID("$FreeBSD$"); +#include "opt_ktrace.h" #include "opt_vm.h" #include @@ -86,6 +87,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef KTRACE +#include +#endif #include #include @@ -114,6 +118,9 @@ static int prefault_pageorder[] = { static int vm_fault_additional_pages(vm_page_t, int, int, vm_page_t *, int *); static void vm_fault_prefault(pmap_t, vm_offset_t, vm_map_entry_t); +#ifdef KTRACE +static int vm_fault_traced(vm_map_t, vm_offset_t, vm_prot_t, int); +#endif #define VM_FAULT_READ_AHEAD 8 #define VM_FAULT_READ_BEHIND 7 @@ -209,6 +216,24 @@ unlock_and_deallocate(struct faultstate int vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, int fault_flags) +#ifdef KTRACE +{ + struct thread *td; + int result; + + td = curthread; + if (map != kernel_map && KTRPOINT(td, KTR_FAULT)) + ktrfault(vaddr, fault_type); + result = vm_fault_traced(map, vaddr, fault_type, fault_flags); + if (map != kernel_map && KTRPOINT(td, KTR_FAULTEND)) + ktrfaultend(result); + return (result); +} + +int +vm_fault_traced(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, + int fault_flags) +#endif { vm_prot_t prot; int is_first_object_locked, result; Modified: stable/8/usr.bin/kdump/kdump.1 ============================================================================== --- stable/8/usr.bin/kdump/kdump.1 Wed Jun 27 21:12:15 2012 (r237663) +++ stable/8/usr.bin/kdump/kdump.1 Wed Jun 27 21:13:00 2012 (r237664) @@ -32,7 +32,7 @@ .\" @(#)kdump.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 23, 2008 +.Dd April 5, 2012 .Dt KDUMP 1 .Os .Sh NAME @@ -175,6 +175,8 @@ The possible operations are: .It Li USER Ta data from user process Ta the data .It Li STRU Ta various syscalls Ta structure .It Li SCTL Ta Xr sysctl 3 requests Ta MIB name +.It Li PFLT Ta enter page fault Ta fault address and type +.It Li PRET Ta return from page fault Ta fault result .El .Sh SEE ALSO .Xr ktrace 1 Modified: stable/8/usr.bin/kdump/kdump.c ============================================================================== --- stable/8/usr.bin/kdump/kdump.c Wed Jun 27 21:12:15 2012 (r237663) +++ stable/8/usr.bin/kdump/kdump.c Wed Jun 27 21:13:00 2012 (r237664) @@ -103,6 +103,8 @@ void ktruser(int, unsigned char *); void ktrsockaddr(struct sockaddr *); void ktrstat(struct stat *); void ktrstruct(char *, size_t); +void ktrfault(struct ktr_fault *); +void ktrfaultend(struct ktr_faultend *); void usage(void); void sockfamilyname(int); const char *ioctlname(u_long); @@ -306,6 +308,12 @@ main(int argc, char *argv[]) case KTR_STRUCT: ktrstruct(m, ktrlen); break; + case KTR_FAULT: + ktrfault((struct ktr_fault *)m); + break; + case KTR_FAULTEND: + ktrfaultend((struct ktr_faultend *)m); + break; default: printf("\n"); break; @@ -445,6 +453,12 @@ dumpheader(struct ktr_header *kth) /* FALLTHROUGH */ case KTR_PROCDTOR: return; + case KTR_FAULT: + type = "PFLT"; + break; + case KTR_FAULTEND: + type = "PRET"; + break; default: (void)sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type); type = unknown; @@ -1513,6 +1527,23 @@ invalid: printf("invalid record\n"); } +void +ktrfault(struct ktr_fault *ktr) +{ + + printf("0x%jx ", ktr->vaddr); + vmprotname(ktr->type); + printf("\n"); +} + +void +ktrfaultend(struct ktr_faultend *ktr) +{ + + vmresultname(ktr->result); + printf("\n"); +} + #if defined(__amd64__) || defined(__i386__) void linux_ktrsyscall(struct ktr_syscall *ktr) Modified: stable/8/usr.bin/kdump/kdump_subr.h ============================================================================== --- stable/8/usr.bin/kdump/kdump_subr.h Wed Jun 27 21:12:15 2012 (r237663) +++ stable/8/usr.bin/kdump/kdump_subr.h Wed Jun 27 21:13:00 2012 (r237664) @@ -46,3 +46,5 @@ void lio_listioname (int); void minheritname (int); void quotactlname (int); void ptraceopname (int); +void vmprotname (int); +void vmresultname (int); Modified: stable/8/usr.bin/kdump/mksubr ============================================================================== --- stable/8/usr.bin/kdump/mksubr Wed Jun 27 21:12:15 2012 (r237663) +++ stable/8/usr.bin/kdump/mksubr Wed Jun 27 21:13:00 2012 (r237664) @@ -183,6 +183,8 @@ cat <<_EOF_ #include #include #include +#include +#include #include "kdump_subr.h" @@ -327,6 +329,26 @@ sockoptlevelname (int level, int decimal } } +/* + * MANUAL + * + * Used for page fault type. Cannot use auto_or_type since the macro + * values contain a cast. Also, VM_PROT_NONE has to be handled specially. + */ +void +vmprotname (int type) +{ + int or = 0; + + if (type == VM_PROT_NONE) { + (void)printf("VM_PROT_NONE"); + return; + } + if_print_or(type, VM_PROT_READ, or); + if_print_or(type, VM_PROT_WRITE, or); + if_print_or(type, VM_PROT_EXECUTE, or); + if_print_or(type, VM_PROT_OVERRIDE_WRITE, or); +} _EOF_ auto_or_type "modename" "S_[A-Z]+[[:space:]]+[0-6]{7}" "sys/stat.h" @@ -368,6 +390,7 @@ auto_if_type "sockipprotoname" "IPPROTO_ auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" auto_switch_type "ptraceopname" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" +auto_switch_type "vmresultname" "KERN_[A-Z]+[[:space:]]+[0-9]+" "vm/vm_param.h" cat <<_EOF_ /* Modified: stable/8/usr.bin/ktrace/ktrace.1 ============================================================================== --- stable/8/usr.bin/ktrace/ktrace.1 Wed Jun 27 21:12:15 2012 (r237663) +++ stable/8/usr.bin/ktrace/ktrace.1 Wed Jun 27 21:13:00 2012 (r237664) @@ -32,7 +32,7 @@ .\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 23, 2008 +.Dd May 31, 2012 .Dt KTRACE 1 .Os .Sh NAME @@ -112,6 +112,8 @@ The following table equates the letters .Bl -tag -width flag -compact .It Cm c trace system calls +.It Cm f +trace page faults .It Cm i trace .Tn I/O Modified: stable/8/usr.bin/ktrace/ktrace.h ============================================================================== --- stable/8/usr.bin/ktrace/ktrace.h Wed Jun 27 21:12:15 2012 (r237663) +++ stable/8/usr.bin/ktrace/ktrace.h Wed Jun 27 21:13:00 2012 (r237664) @@ -40,7 +40,8 @@ #define PROC_ABI_POINTS (KTRFAC_PROCCTOR | KTRFAC_PROCDTOR) -#define ALL_POINTS (DEF_POINTS | KTRFAC_CSW | PROC_ABI_POINTS) +#define ALL_POINTS (DEF_POINTS | KTRFAC_CSW | PROC_ABI_POINTS | \ + KTRFAC_FAULT | KTRFAC_FAULTEND) #define DEF_TRACEFILE "ktrace.out" Modified: stable/8/usr.bin/ktrace/subr.c ============================================================================== --- stable/8/usr.bin/ktrace/subr.c Wed Jun 27 21:12:15 2012 (r237663) +++ stable/8/usr.bin/ktrace/subr.c Wed Jun 27 21:13:00 2012 (r237664) @@ -65,6 +65,9 @@ getpoints(char *s) case 'c': facs |= KTRFAC_SYSCALL | KTRFAC_SYSRET; break; + case 'f': + facs |= KTRFAC_FAULT | KTRFAC_FAULTEND; + break; case 'n': facs |= KTRFAC_NAMEI; break; From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 21:18:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 225DD106566C; Wed, 27 Jun 2012 21:18:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6AD8FC0C; Wed, 27 Jun 2012 21:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RLIl26033353; Wed, 27 Jun 2012 21:18:47 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RLIlqO033351; Wed, 27 Jun 2012 21:18:47 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206272118.q5RLIlqO033351@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 27 Jun 2012 21:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237665 - stable/9/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 21:18:48 -0000 Author: jkim Date: Wed Jun 27 21:18:47 2012 New Revision: 237665 URL: http://svn.freebsd.org/changeset/base/237665 Log: MFC: r237025 Add a convenience macro for the fastcall attribute. Modified: stable/9/sys/sys/cdefs.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/cdefs.h ============================================================================== --- stable/9/sys/sys/cdefs.h Wed Jun 27 21:13:00 2012 (r237664) +++ stable/9/sys/sys/cdefs.h Wed Jun 27 21:18:47 2012 (r237665) @@ -293,6 +293,12 @@ #define __nonnull(x) #endif +#if __GNUC_PREREQ__(3, 4) +#define __fastcall __attribute__((__fastcall__)) +#else +#define __fastcall +#endif + #if __GNUC_PREREQ__(4, 1) #define __returns_twice __attribute__((__returns_twice__)) #else From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 21:35:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C93CB1065670; Wed, 27 Jun 2012 21:35:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B44058FC08; Wed, 27 Jun 2012 21:35:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RLZjZg034078; Wed, 27 Jun 2012 21:35:45 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RLZjn2034076; Wed, 27 Jun 2012 21:35:45 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206272135.q5RLZjn2034076@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 27 Jun 2012 21:35: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: r237666 - head/secure/usr.bin/openssl/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 21:35:45 -0000 Author: jkim Date: Wed Jun 27 21:35:45 2012 New Revision: 237666 URL: http://svn.freebsd.org/changeset/base/237666 Log: Regen ca(1) for r237658. This re-applies r227458, i.e., add a missing "be". Modified: head/secure/usr.bin/openssl/man/ca.1 Modified: head/secure/usr.bin/openssl/man/ca.1 ============================================================================== --- head/secure/usr.bin/openssl/man/ca.1 Wed Jun 27 21:18:47 2012 (r237665) +++ head/secure/usr.bin/openssl/man/ca.1 Wed Jun 27 21:35:45 2012 (r237666) @@ -205,7 +205,7 @@ section for information on the required .IP "\fB\-infiles\fR" 4 .IX Item "-infiles" if present this should be the last option, all subsequent arguments -are assumed to the names of files containing certificate requests. +are assumed to be the names of files containing certificate requests. .IP "\fB\-out filename\fR" 4 .IX Item "-out filename" the output file to output certificates to. The default is standard From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 22:06:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E64B1065672; Wed, 27 Jun 2012 22:06:43 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57A238FC12; Wed, 27 Jun 2012 22:06:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RM6hfm035443; Wed, 27 Jun 2012 22:06:43 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RM6hVT035441; Wed, 27 Jun 2012 22:06:43 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201206272206.q5RM6hVT035441@svn.freebsd.org> From: Andrew Thompson Date: Wed, 27 Jun 2012 22:06:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237669 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 22:06:43 -0000 Author: thompsa Date: Wed Jun 27 22:06:42 2012 New Revision: 237669 URL: http://svn.freebsd.org/changeset/base/237669 Log: MFC r236062 Turn LACP debugging from a compile time option to a sysctl, it is very handy to be able to turn it on when negotiation to a switch misbehaves. Modified: stable/9/sys/net/ieee8023ad_lacp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/9/sys/net/ieee8023ad_lacp.c Wed Jun 27 21:48:56 2012 (r237668) +++ stable/9/sys/net/ieee8023ad_lacp.c Wed Jun 27 22:06:42 2012 (r237669) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include /* hz */ #include /* for net/if.h */ #include +#include #include #include #include @@ -168,7 +169,8 @@ static void lacp_enable_distributing(str static int lacp_xmit_lacpdu(struct lacp_port *); static int lacp_xmit_marker(struct lacp_port *); -#if defined(LACP_DEBUG) +/* Debugging */ + static void lacp_dump_lacpdu(const struct lacpdu *); static const char *lacp_format_partner(const struct lacp_peerinfo *, char *, size_t); @@ -184,10 +186,14 @@ static const char *lacp_format_portid(co size_t); static void lacp_dprintf(const struct lacp_port *, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -#define LACP_DPRINTF(a) lacp_dprintf a -#else -#define LACP_DPRINTF(a) /* nothing */ -#endif + +static int lacp_debug = 0; +SYSCTL_INT(_net, OID_AUTO, lacp_debug, CTLFLAG_RW | CTLFLAG_TUN, + &lacp_debug, 0, "Enable LACP debug logging (1=debug, 2=trace)"); +TUNABLE_INT("net.lacp_debug", &lacp_debug); + +#define LACP_DPRINTF(a) if (lacp_debug > 0) { lacp_dprintf a ; } +#define LACP_TRACE(a) if (lacp_debug > 1) { lacp_dprintf(a,"%s\n",__func__); } /* * partner administration variables. @@ -290,10 +296,10 @@ lacp_pdu_input(struct lacp_port *lp, str goto bad; } -#if defined(LACP_DEBUG) - LACP_DPRINTF((lp, "lacpdu receive\n")); - lacp_dump_lacpdu(du); -#endif /* defined(LACP_DEBUG) */ + if (lacp_debug > 0) { + lacp_dprintf(lp, "lacpdu receive\n"); + lacp_dump_lacpdu(du); + } LACP_LOCK(lsc); lacp_sm_rx(lp, du); @@ -370,10 +376,10 @@ lacp_xmit_lacpdu(struct lacp_port *lp) sizeof(du->ldu_collector)); du->ldu_collector.lci_maxdelay = 0; -#if defined(LACP_DEBUG) - LACP_DPRINTF((lp, "lacpdu transmit\n")); - lacp_dump_lacpdu(du); -#endif /* defined(LACP_DEBUG) */ + if (lacp_debug > 0) { + lacp_dprintf(lp, "lacpdu transmit\n"); + lacp_dump_lacpdu(du); + } m->m_flags |= M_MCAST; @@ -647,9 +653,7 @@ lacp_disable_distributing(struct lacp_po { struct lacp_aggregator *la = lp->lp_aggregator; struct lacp_softc *lsc = lp->lp_lsc; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif /* defined(LACP_DEBUG) */ LACP_LOCK_ASSERT(lsc); @@ -684,9 +688,7 @@ lacp_enable_distributing(struct lacp_por { struct lacp_aggregator *la = lp->lp_aggregator; struct lacp_softc *lsc = lp->lp_lsc; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif /* defined(LACP_DEBUG) */ LACP_LOCK_ASSERT(lsc); @@ -720,7 +722,8 @@ lacp_transit_expire(void *vp) LACP_LOCK_ASSERT(lsc); - LACP_DPRINTF((NULL, "%s\n", __func__)); + LACP_TRACE(NULL); + lsc->lsc_suppress_distributing = FALSE; } @@ -838,7 +841,8 @@ lacp_suppress_distributing(struct lacp_s return; } - LACP_DPRINTF((NULL, "%s\n", __func__)); + LACP_TRACE(NULL); + lsc->lsc_suppress_distributing = TRUE; /* send a marker frame down each port to verify the queues are empty */ @@ -908,11 +912,9 @@ lacp_select_active_aggregator(struct lac struct lacp_aggregator *la; struct lacp_aggregator *best_la = NULL; uint64_t best_speed = 0; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif /* defined(LACP_DEBUG) */ - LACP_DPRINTF((NULL, "%s:\n", __func__)); + LACP_TRACE(NULL); TAILQ_FOREACH(la, &lsc->lsc_aggregators, la_q) { uint64_t speed; @@ -946,7 +948,6 @@ lacp_select_active_aggregator(struct lac KASSERT(best_la == NULL || !TAILQ_EMPTY(&best_la->la_ports), ("invalid aggregator list")); -#if defined(LACP_DEBUG) if (lsc->lsc_active_aggregator != best_la) { LACP_DPRINTF((NULL, "active aggregator changed\n")); LACP_DPRINTF((NULL, "old %s\n", @@ -957,7 +958,6 @@ lacp_select_active_aggregator(struct lac } LACP_DPRINTF((NULL, "new %s\n", lacp_format_lagid_aggregator(best_la, buf, sizeof(buf)))); -#endif /* defined(LACP_DEBUG) */ if (lsc->lsc_active_aggregator != best_la) { sc->sc_ifp->if_baudrate = best_speed; @@ -1040,9 +1040,7 @@ lacp_compose_key(struct lacp_port *lp) static void lacp_aggregator_addref(struct lacp_softc *lsc, struct lacp_aggregator *la) { -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif LACP_DPRINTF((NULL, "%s: lagid=%s, refcnt %d -> %d\n", __func__, @@ -1058,9 +1056,7 @@ lacp_aggregator_addref(struct lacp_softc static void lacp_aggregator_delref(struct lacp_softc *lsc, struct lacp_aggregator *la) { -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif LACP_DPRINTF((NULL, "%s: lagid=%s, refcnt %d -> %d\n", __func__, @@ -1195,9 +1191,7 @@ lacp_select(struct lacp_port *lp) { struct lacp_softc *lsc = lp->lp_lsc; struct lacp_aggregator *la; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif if (lp->lp_aggregator) { return; @@ -1278,7 +1272,8 @@ lacp_sm_mux(struct lacp_port *lp) enum lacp_selected selected = lp->lp_selected; struct lacp_aggregator *la; - /* LACP_DPRINTF((lp, "%s: state %d\n", __func__, lp->lp_mux_state)); */ + if (lacp_debug > 1) + lacp_dprintf(lp, "%s: state %d\n", __func__, lp->lp_mux_state); re_eval: la = lp->lp_aggregator; @@ -1387,9 +1382,7 @@ static void lacp_sm_mux_timer(struct lacp_port *lp) { struct lacp_aggregator *la = lp->lp_aggregator; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif KASSERT(la->la_pending > 0, ("no pending event")); @@ -1537,11 +1530,9 @@ lacp_sm_rx_record_pdu(struct lacp_port * { boolean_t active; uint8_t oldpstate; -#if defined(LACP_DEBUG) char buf[LACP_STATESTR_MAX+1]; -#endif - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + LACP_TRACE(lp); oldpstate = lp->lp_partner.lip_state; @@ -1576,7 +1567,8 @@ lacp_sm_rx_record_pdu(struct lacp_port * static void lacp_sm_rx_update_ntt(struct lacp_port *lp, const struct lacpdu *du) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); if (lacp_compare_peerinfo(&lp->lp_actor, &du->ldu_partner) || !LACP_STATE_EQ(lp->lp_state, du->ldu_partner.lip_state, @@ -1591,7 +1583,7 @@ lacp_sm_rx_record_default(struct lacp_po { uint8_t oldpstate; - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + LACP_TRACE(lp); oldpstate = lp->lp_partner.lip_state; lp->lp_partner = lacp_partner_admin; @@ -1603,7 +1595,8 @@ static void lacp_sm_rx_update_selected_from_peerinfo(struct lacp_port *lp, const struct lacp_peerinfo *info) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); if (lacp_compare_peerinfo(&lp->lp_partner, info) || !LACP_STATE_EQ(lp->lp_partner.lip_state, info->lip_state, @@ -1616,7 +1609,8 @@ lacp_sm_rx_update_selected_from_peerinfo static void lacp_sm_rx_update_selected(struct lacp_port *lp, const struct lacpdu *du) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); lacp_sm_rx_update_selected_from_peerinfo(lp, &du->ldu_actor); } @@ -1624,7 +1618,8 @@ lacp_sm_rx_update_selected(struct lacp_p static void lacp_sm_rx_update_default_selected(struct lacp_port *lp) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); lacp_sm_rx_update_selected_from_peerinfo(lp, &lacp_partner_admin); } @@ -1812,7 +1807,7 @@ tlv_check(const void *p, size_t size, co return (0); } -#if defined(LACP_DEBUG) +/* Debugging */ const char * lacp_format_mac(const uint8_t *mac, char *buf, size_t buflen) { @@ -1942,4 +1937,3 @@ lacp_dprintf(const struct lacp_port *lp, vprintf(fmt, va); va_end(va); } -#endif From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 22:09:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 085231065676; Wed, 27 Jun 2012 22:09:05 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE1488FC0A; Wed, 27 Jun 2012 22:09:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RM94ES035570; Wed, 27 Jun 2012 22:09:04 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RM94nk035567; Wed, 27 Jun 2012 22:09:04 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201206272209.q5RM94nk035567@svn.freebsd.org> From: Andrew Thompson Date: Wed, 27 Jun 2012 22:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237670 - in stable/9: sbin/ifconfig sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 22:09:05 -0000 Author: thompsa Date: Wed Jun 27 22:09:04 2012 New Revision: 237670 URL: http://svn.freebsd.org/changeset/base/237670 Log: MFC r236178 if_lagg: allow to invoke SIOCSLAGGPORT multiple times in a row Modified: stable/9/sbin/ifconfig/iflagg.c stable/9/sys/net/if_lagg.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sbin/ifconfig/iflagg.c ============================================================================== --- stable/9/sbin/ifconfig/iflagg.c Wed Jun 27 22:06:42 2012 (r237669) +++ stable/9/sbin/ifconfig/iflagg.c Wed Jun 27 22:09:04 2012 (r237670) @@ -40,7 +40,8 @@ setlaggport(const char *val, int d, int strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname)); strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname)); - if (ioctl(s, SIOCSLAGGPORT, &rp)) + /* Don't choke if the port is already in this lagg. */ + if (ioctl(s, SIOCSLAGGPORT, &rp) && errno != EEXIST) err(1, "SIOCSLAGGPORT"); } Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Wed Jun 27 22:06:42 2012 (r237669) +++ stable/9/sys/net/if_lagg.c Wed Jun 27 22:09:04 2012 (r237670) @@ -516,8 +516,13 @@ lagg_port_create(struct lagg_softc *sc, return (ENOSPC); /* Check if port has already been associated to a lagg */ - if (ifp->if_lagg != NULL) + if (ifp->if_lagg != NULL) { + /* Port is already in the current lagg? */ + lp = (struct lagg_port *)ifp->if_lagg; + if (lp->lp_softc == sc) + return (EEXIST); return (EBUSY); + } /* XXX Disallow non-ethernet interfaces (this should be any of 802) */ if (ifp->if_type != IFT_ETHER) From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 22:11:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A7E0106566B; Wed, 27 Jun 2012 22:11:32 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E97728FC16; Wed, 27 Jun 2012 22:11:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RMBVUq035787; Wed, 27 Jun 2012 22:11:31 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RMBVV0035784; Wed, 27 Jun 2012 22:11:31 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201206272211.q5RMBVV0035784@svn.freebsd.org> From: Andrew Thompson Date: Wed, 27 Jun 2012 22:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237671 - stable/9/usr.bin/sockstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 22:11:32 -0000 Author: thompsa Date: Wed Jun 27 22:11:31 2012 New Revision: 237671 URL: http://svn.freebsd.org/changeset/base/237671 Log: MFC r235870 Allow the socket list to be limited to a specific jail id. Modified: stable/9/usr.bin/sockstat/sockstat.1 stable/9/usr.bin/sockstat/sockstat.c Directory Properties: stable/9/usr.bin/sockstat/ (props changed) Modified: stable/9/usr.bin/sockstat/sockstat.1 ============================================================================== --- stable/9/usr.bin/sockstat/sockstat.1 Wed Jun 27 22:09:04 2012 (r237670) +++ stable/9/usr.bin/sockstat/sockstat.1 Wed Jun 27 22:11:31 2012 (r237671) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2012 +.Dd May 16, 2012 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Sh SYNOPSIS .Nm .Op Fl 46cLlu +.Op Fl j Ar jid .Op Fl p Ar ports .Op Fl P Ar protocols .Sh DESCRIPTION @@ -57,6 +58,8 @@ Show (IPv6) sockets. .It Fl c Show connected sockets. +.It Fl j Ar jid +Show only sockets belonging to the specified jail ID. .It Fl L Only show Internet sockets if the local or foreign addresses are not in the loopback network prefix Modified: stable/9/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/9/usr.bin/sockstat/sockstat.c Wed Jun 27 22:09:04 2012 (r237670) +++ stable/9/usr.bin/sockstat/sockstat.c Wed Jun 27 22:11:31 2012 (r237671) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); static int opt_4; /* Show IPv4 sockets */ static int opt_6; /* Show IPv6 sockets */ static int opt_c; /* Show connected sockets */ +static int opt_j; /* Show specified jail */ static int opt_L; /* Don't show IPv4 or IPv6 loopback sockets */ static int opt_l; /* Show listening sockets */ static int opt_u; /* Show Unix domain sockets */ @@ -549,6 +550,27 @@ getprocname(pid_t pid) } static int +getprocjid(pid_t pid) +{ + static struct kinfo_proc proc; + size_t len; + int mib[4]; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID; + mib[3] = (int)pid; + len = sizeof proc; + if (sysctl(mib, 4, &proc, &len, NULL, 0) == -1) { + /* Do not warn if the process exits before we get its jid. */ + if (errno != ESRCH) + warn("sysctl()"); + return (-1); + } + return (proc.ki_jid); +} + +static int check_ports(struct sock *s) { int port; @@ -643,6 +665,8 @@ display(void) for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) { if (xf->xf_data == NULL) continue; + if (opt_j >= 0 && opt_j != getprocjid(xf->xf_pid)) + continue; hash = (int)((uintptr_t)xf->xf_data % HASHSIZE); for (s = sockhash[hash]; s != NULL; s = s->next) if ((void *)s->socket == xf->xf_data) @@ -668,6 +692,8 @@ display(void) pos += xprintf("%d ", xf->xf_fd); displaysock(s, pos); } + if (opt_j >= 0) + return; for (hash = 0; hash < HASHSIZE; hash++) { for (s = sockhash[hash]; s != NULL; s = s->next) { if (s->shown) @@ -716,7 +742,8 @@ main(int argc, char *argv[]) int protos_defined = -1; int o, i; - while ((o = getopt(argc, argv, "46cLlp:P:uv")) != -1) + opt_j = -1; + while ((o = getopt(argc, argv, "46cj:Llp:P:uv")) != -1) switch (o) { case '4': opt_4 = 1; @@ -727,6 +754,9 @@ main(int argc, char *argv[]) case 'c': opt_c = 1; break; + case 'j': + opt_j = atoi(optarg); + break; case 'L': opt_L = 1; break; From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 22:13:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8682E106566B; Wed, 27 Jun 2012 22:13:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7025A8FC18; Wed, 27 Jun 2012 22:13:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RMDfWa035910; Wed, 27 Jun 2012 22:13:41 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RMDfxt035907; Wed, 27 Jun 2012 22:13:41 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201206272213.q5RMDfxt035907@svn.freebsd.org> From: Andrew Thompson Date: Wed, 27 Jun 2012 22:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237672 - stable/8/usr.bin/sockstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 22:13:41 -0000 Author: thompsa Date: Wed Jun 27 22:13:40 2012 New Revision: 237672 URL: http://svn.freebsd.org/changeset/base/237672 Log: MFC r235870 Allow the socket list to be limited to a specific jail id. Modified: stable/8/usr.bin/sockstat/sockstat.1 stable/8/usr.bin/sockstat/sockstat.c Directory Properties: stable/8/usr.bin/sockstat/ (props changed) Modified: stable/8/usr.bin/sockstat/sockstat.1 ============================================================================== --- stable/8/usr.bin/sockstat/sockstat.1 Wed Jun 27 22:11:31 2012 (r237671) +++ stable/8/usr.bin/sockstat/sockstat.1 Wed Jun 27 22:13:40 2012 (r237672) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2012 +.Dd May 16, 2012 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Sh SYNOPSIS .Nm .Op Fl 46cLlu +.Op Fl j Ar jid .Op Fl p Ar ports .Op Fl P Ar protocols .Sh DESCRIPTION @@ -57,6 +58,8 @@ Show (IPv6) sockets. .It Fl c Show connected sockets. +.It Fl j Ar jid +Show only sockets belonging to the specified jail ID. .It Fl L Only show Internet sockets if the local or foreign addresses are not in the loopback network prefix Modified: stable/8/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/8/usr.bin/sockstat/sockstat.c Wed Jun 27 22:11:31 2012 (r237671) +++ stable/8/usr.bin/sockstat/sockstat.c Wed Jun 27 22:13:40 2012 (r237672) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); static int opt_4; /* Show IPv4 sockets */ static int opt_6; /* Show IPv6 sockets */ static int opt_c; /* Show connected sockets */ +static int opt_j; /* Show specified jail */ static int opt_L; /* Don't show IPv4 or IPv6 loopback sockets */ static int opt_l; /* Show listening sockets */ static int opt_u; /* Show Unix domain sockets */ @@ -549,6 +550,27 @@ getprocname(pid_t pid) } static int +getprocjid(pid_t pid) +{ + static struct kinfo_proc proc; + size_t len; + int mib[4]; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID; + mib[3] = (int)pid; + len = sizeof proc; + if (sysctl(mib, 4, &proc, &len, NULL, 0) == -1) { + /* Do not warn if the process exits before we get its jid. */ + if (errno != ESRCH) + warn("sysctl()"); + return (-1); + } + return (proc.ki_jid); +} + +static int check_ports(struct sock *s) { int port; @@ -643,6 +665,8 @@ display(void) for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) { if (xf->xf_data == NULL) continue; + if (opt_j >= 0 && opt_j != getprocjid(xf->xf_pid)) + continue; hash = (int)((uintptr_t)xf->xf_data % HASHSIZE); for (s = sockhash[hash]; s != NULL; s = s->next) if ((void *)s->socket == xf->xf_data) @@ -668,6 +692,8 @@ display(void) pos += xprintf("%d ", xf->xf_fd); displaysock(s, pos); } + if (opt_j >= 0) + return; for (hash = 0; hash < HASHSIZE; hash++) { for (s = sockhash[hash]; s != NULL; s = s->next) { if (s->shown) @@ -716,7 +742,8 @@ main(int argc, char *argv[]) int protos_defined = -1; int o, i; - while ((o = getopt(argc, argv, "46cLlp:P:uv")) != -1) + opt_j = -1; + while ((o = getopt(argc, argv, "46cj:Llp:P:uv")) != -1) switch (o) { case '4': opt_4 = 1; @@ -727,6 +754,9 @@ main(int argc, char *argv[]) case 'c': opt_c = 1; break; + case 'j': + opt_j = atoi(optarg); + break; case 'L': opt_L = 1; break; From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 22:17:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C95D210657A7; Wed, 27 Jun 2012 22:17:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4078FC08; Wed, 27 Jun 2012 22:17:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RMHr9P036183; Wed, 27 Jun 2012 22:17:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RMHrHT036181; Wed, 27 Jun 2012 22:17:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206272217.q5RMHrHT036181@svn.freebsd.org> From: Marius Strobl Date: Wed, 27 Jun 2012 22:17: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: r237673 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 22:17:54 -0000 Author: marius Date: Wed Jun 27 22:17:52 2012 New Revision: 237673 URL: http://svn.freebsd.org/changeset/base/237673 Log: For subtractively decoding bridges, don't try to grow windows but pass the request up the tree in order to be on the safe side. Growing windows in this case would mean to switch resources to positive decoding and it's unclear how to correctly handle this. At least with ALi/ULi M5249 PCI-PCI bridges, this also just doesn't work out of the box. Reviewed by: jhb MFC after: 3 days Modified: head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Wed Jun 27 22:13:40 2012 (r237672) +++ head/sys/dev/pci/pci_pci.c Wed Jun 27 22:17:52 2012 (r237673) @@ -1038,7 +1038,7 @@ pcib_alloc_resource(device_t dev, device case SYS_RES_IOPORT: r = pcib_suballoc_resource(sc, &sc->io, child, type, rid, start, end, count, flags); - if (r != NULL) + if (r != NULL || (sc->flags & PCIB_SUBTRACTIVE) != 0) break; if (pcib_grow_window(sc, &sc->io, type, start, end, count, flags) == 0) @@ -1062,7 +1062,7 @@ pcib_alloc_resource(device_t dev, device } r = pcib_suballoc_resource(sc, &sc->mem, child, type, rid, start, end, count, flags); - if (r != NULL) + if (r != NULL || (sc->flags & PCIB_SUBTRACTIVE) != 0) break; if (flags & RF_PREFETCHABLE) { if (pcib_grow_window(sc, &sc->pmem, type, start, end, From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 23:16:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AFB651065670 for ; Wed, 27 Jun 2012 23:16:54 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-yw0-f49.google.com (mail-yw0-f49.google.com [209.85.213.49]) by mx1.freebsd.org (Postfix) with ESMTP id 554B38FC16 for ; Wed, 27 Jun 2012 23:16:54 +0000 (UTC) Received: by yhjj52 with SMTP id j52so1860301yhj.36 for ; Wed, 27 Jun 2012 16:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=rsa; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=Sp2zpQUGedtS5DW+7PUiPqZsh0hzsQs6PxpZt1rIawg=; b=GFkB59RLrgeBAQpfs3dnQnEKOApXiZ+crrxf4h8WFC0ibcoIBMQ09SZKjZC6HBzQmd /j9FrsY/u4a1thpw09d4yAH95mEyNuPN6rOhPpJjB6+EzBkG6E3779lLTG8VLfwBJQfz h2TqxuFe3+J7uR/HnuN37OQywfq7vLiqQx1EQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-gm-message-state; bh=Sp2zpQUGedtS5DW+7PUiPqZsh0hzsQs6PxpZt1rIawg=; b=OSUOuKEIfz3csPX/lV1Hpi9UozkUcQ8016IwGKqU804EhFVhLBuH4ah3BKMY4x7n24 dBe2tsA7mbR/5581vJI3QrEiSjR4dhzI6xvzr7Hr2JLXWkjPrAF4GOHmhK6+CAdZOLOE sB9v0YF8pbS777q0fna20gko7g7IV5p33Q5qR8k0pcIh0j4BZDfd9iCz3AHdO7l2CVl7 ckm3yr9aWytobpiPG7pthraiqWaQWkFSO/Ur6yPksD12JwX5G8aZHZh8DOOxHx7Ce7CL Y/BCRig+ZiCYD+A0TT+Z1EmtxRwy+rPeNiaAMGynvfACKbgCXO/Pu2fObve72EDtyRoH SxJw== Received: by 10.236.177.104 with SMTP id c68mr23155843yhm.76.1340839013639; Wed, 27 Jun 2012 16:16:53 -0700 (PDT) Received: from DataIX.net (75-128-120-86.dhcp.aldl.mi.charter.com. [75.128.120.86]) by mx.google.com with ESMTPS id k67sm30865716yhj.18.2012.06.27.16.16.52 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jun 2012 16:16:53 -0700 (PDT) Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q5RNGoc5012238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Jun 2012 19:16:50 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Received: (from jh@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q5RNGoGI012237; Wed, 27 Jun 2012 19:16:50 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Date: Wed, 27 Jun 2012 19:16:50 -0400 From: Jason Hellenthal To: Andrew Thompson Message-ID: <20120627231650.GA7853@DataIX.net> References: <201206272213.q5RMDfxt035907@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201206272213.q5RMDfxt035907@svn.freebsd.org> X-Gm-Message-State: ALoCoQl1gIAf9JUt7NK7Pw/FP2w9UQrrKAW5MiY4yHv1HFfEMXFpPOucp8CoURKYnxOgH2wiYKWy Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r237672 - stable/8/usr.bin/sockstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 23:16:54 -0000 The usage information never got updated from this change... $ sockstat --help sockstat: illegal option -- - Usage: sockstat [-46cLlu] [-p ports] [-P protocols] On Wed, Jun 27, 2012 at 10:13:41PM +0000, Andrew Thompson wrote: > Author: thompsa > Date: Wed Jun 27 22:13:40 2012 > New Revision: 237672 > URL: http://svn.freebsd.org/changeset/base/237672 > > Log: > MFC r235870 > > Allow the socket list to be limited to a specific jail id. > > Modified: > stable/8/usr.bin/sockstat/sockstat.1 > stable/8/usr.bin/sockstat/sockstat.c > Directory Properties: > stable/8/usr.bin/sockstat/ (props changed) > > Modified: stable/8/usr.bin/sockstat/sockstat.1 > ============================================================================== > --- stable/8/usr.bin/sockstat/sockstat.1 Wed Jun 27 22:11:31 2012 (r237671) > +++ stable/8/usr.bin/sockstat/sockstat.1 Wed Jun 27 22:13:40 2012 (r237672) > @@ -27,7 +27,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 24, 2012 > +.Dd May 16, 2012 > .Dt SOCKSTAT 1 > .Os > .Sh NAME > @@ -36,6 +36,7 @@ > .Sh SYNOPSIS > .Nm > .Op Fl 46cLlu > +.Op Fl j Ar jid > .Op Fl p Ar ports > .Op Fl P Ar protocols > .Sh DESCRIPTION > @@ -57,6 +58,8 @@ Show > (IPv6) sockets. > .It Fl c > Show connected sockets. > +.It Fl j Ar jid > +Show only sockets belonging to the specified jail ID. > .It Fl L > Only show Internet sockets if the local or foreign addresses are not > in the loopback network prefix > > Modified: stable/8/usr.bin/sockstat/sockstat.c > ============================================================================== > --- stable/8/usr.bin/sockstat/sockstat.c Wed Jun 27 22:11:31 2012 (r237671) > +++ stable/8/usr.bin/sockstat/sockstat.c Wed Jun 27 22:13:40 2012 (r237672) > @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); > static int opt_4; /* Show IPv4 sockets */ > static int opt_6; /* Show IPv6 sockets */ > static int opt_c; /* Show connected sockets */ > +static int opt_j; /* Show specified jail */ > static int opt_L; /* Don't show IPv4 or IPv6 loopback sockets */ > static int opt_l; /* Show listening sockets */ > static int opt_u; /* Show Unix domain sockets */ > @@ -549,6 +550,27 @@ getprocname(pid_t pid) > } > > static int > +getprocjid(pid_t pid) > +{ > + static struct kinfo_proc proc; > + size_t len; > + int mib[4]; > + > + mib[0] = CTL_KERN; > + mib[1] = KERN_PROC; > + mib[2] = KERN_PROC_PID; > + mib[3] = (int)pid; > + len = sizeof proc; > + if (sysctl(mib, 4, &proc, &len, NULL, 0) == -1) { > + /* Do not warn if the process exits before we get its jid. */ > + if (errno != ESRCH) > + warn("sysctl()"); > + return (-1); > + } > + return (proc.ki_jid); > +} > + > +static int > check_ports(struct sock *s) > { > int port; > @@ -643,6 +665,8 @@ display(void) > for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) { > if (xf->xf_data == NULL) > continue; > + if (opt_j >= 0 && opt_j != getprocjid(xf->xf_pid)) > + continue; > hash = (int)((uintptr_t)xf->xf_data % HASHSIZE); > for (s = sockhash[hash]; s != NULL; s = s->next) > if ((void *)s->socket == xf->xf_data) > @@ -668,6 +692,8 @@ display(void) > pos += xprintf("%d ", xf->xf_fd); > displaysock(s, pos); > } > + if (opt_j >= 0) > + return; > for (hash = 0; hash < HASHSIZE; hash++) { > for (s = sockhash[hash]; s != NULL; s = s->next) { > if (s->shown) > @@ -716,7 +742,8 @@ main(int argc, char *argv[]) > int protos_defined = -1; > int o, i; > > - while ((o = getopt(argc, argv, "46cLlp:P:uv")) != -1) > + opt_j = -1; > + while ((o = getopt(argc, argv, "46cj:Llp:P:uv")) != -1) > switch (o) { > case '4': > opt_4 = 1; > @@ -727,6 +754,9 @@ main(int argc, char *argv[]) > case 'c': > opt_c = 1; > break; > + case 'j': > + opt_j = atoi(optarg); > + break; > case 'L': > opt_L = 1; > break; > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" -- - (2^(N-1)) From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 23:26:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5FBCD106566C; Wed, 27 Jun 2012 23:26:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AEC98FC08; Wed, 27 Jun 2012 23:26:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RNQXPs039012; Wed, 27 Jun 2012 23:26:33 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RNQX96039010; Wed, 27 Jun 2012 23:26:33 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201206272326.q5RNQX96039010@svn.freebsd.org> From: Andrew Thompson Date: Wed, 27 Jun 2012 23:26: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: r237674 - head/usr.bin/sockstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 23:26:33 -0000 Author: thompsa Date: Wed Jun 27 23:26:32 2012 New Revision: 237674 URL: http://svn.freebsd.org/changeset/base/237674 Log: Update the usage with the new jail option. Spotted by: Jason Hellenthal MFC after: 3 days Modified: head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Wed Jun 27 22:17:52 2012 (r237673) +++ head/usr.bin/sockstat/sockstat.c Wed Jun 27 23:26:32 2012 (r237674) @@ -733,7 +733,7 @@ static void usage(void) { fprintf(stderr, - "Usage: sockstat [-46cLlu] [-p ports] [-P protocols]\n"); + "Usage: sockstat [-46cLlu] [-j jid] [-p ports] [-P protocols]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 23:58:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E998E1065670; Wed, 27 Jun 2012 23:58:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D56138FC16; Wed, 27 Jun 2012 23:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RNwqgg040371; Wed, 27 Jun 2012 23:58:52 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RNwqhn040369; Wed, 27 Jun 2012 23:58:52 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201206272358.q5RNwqhn040369@svn.freebsd.org> From: Glen Barber Date: Wed, 27 Jun 2012 23:58: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: r237675 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 23:58:53 -0000 Author: gjb (doc,ports committer) Date: Wed Jun 27 23:58:52 2012 New Revision: 237675 URL: http://svn.freebsd.org/changeset/base/237675 Log: Add my entry to committers-ports.dot. Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Wed Jun 27 23:26:32 2012 (r237674) +++ head/share/misc/committers-ports.dot Wed Jun 27 23:58:52 2012 (r237675) @@ -93,6 +93,7 @@ gabor [label="Gabor Kovesdan\ngabor@Free gahr [label="Pietro Cerutti\ngahr@FreeBSD.org\n2008/02/20"] garga [label="Renato Botelho\ngarga@FreeBSD.org\n2005/07/11"] gerald [label="Gerald Pfeifer\ngerald@FreeBSD.org\n2002/04/03"] +gjb [label="Glen Barber\ngjb@FreeBSD.org\n2012/06/19"] glarkin [label="Greg Larkin\nglarkin@FreeBSD.org\n2008/07/17"] glewis [label="Greg Lewis\nglewis@FreeBSD.org\n2002/04/08"] hq [label="Herve Quiroz\nhq@FreeBSD.org\n2004/08/05"] @@ -245,6 +246,7 @@ clement -> lawrance clsung -> lwhsu clsung -> tabthorpe +crees -> gjb crees -> jgh crees -> madpilot @@ -260,6 +262,7 @@ delphij -> rafan demon -> mat eadler -> ak +eadler -> gjb eadler -> tj edwin -> cperciva From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 00:03:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2334A106564A; Thu, 28 Jun 2012 00:03:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EA6C8FC08; Thu, 28 Jun 2012 00:03:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S03b4r040623; Thu, 28 Jun 2012 00:03:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S03bDY040620; Thu, 28 Jun 2012 00:03:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201206280003.q5S03bDY040620@svn.freebsd.org> From: Glen Barber Date: Thu, 28 Jun 2012 00:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237676 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 00:03:38 -0000 Author: gjb (doc,ports committer) Date: Thu Jun 28 00:03:37 2012 New Revision: 237676 URL: http://svn.freebsd.org/changeset/base/237676 Log: Update organization.dot to reflect current doceng@. While here, sort line by last name. Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Wed Jun 27 23:58:52 2012 (r237675) +++ head/share/misc/organization.dot Thu Jun 28 00:03:37 2012 (r237676) @@ -28,7 +28,7 @@ _misc [label="Miscellaneous Hats"] core [label="Core Team\ncore@FreeBSD.org\nwilko, brooks, keramida, imp,\ngnn, wes, hrs, murray,\nrwatson"] coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\njoel"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] -doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nnik, blackend, hrs,\nkeramida"] +doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor,\nhrs"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nmarcus, kris, erwin,\nlinimon, pav, krion"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nerwin"] From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 00:17:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5C77106566B; Thu, 28 Jun 2012 00:17:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0CBB8FC15; Thu, 28 Jun 2012 00:17:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S0HjKU041324; Thu, 28 Jun 2012 00:17:45 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S0HjmW041322; Thu, 28 Jun 2012 00:17:45 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201206280017.q5S0HjmW041322@svn.freebsd.org> From: Glen Barber Date: Thu, 28 Jun 2012 00:17: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: r237677 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 00:17:45 -0000 Author: gjb (doc,ports committer) Date: Thu Jun 28 00:17:45 2012 New Revision: 237677 URL: http://svn.freebsd.org/changeset/base/237677 Log: Remove a '\n' that crept in accidentally. Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Thu Jun 28 00:03:37 2012 (r237676) +++ head/share/misc/organization.dot Thu Jun 28 00:17:45 2012 (r237677) @@ -28,7 +28,7 @@ _misc [label="Miscellaneous Hats"] core [label="Core Team\ncore@FreeBSD.org\nwilko, brooks, keramida, imp,\ngnn, wes, hrs, murray,\nrwatson"] coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\njoel"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] -doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor,\nhrs"] +doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nmarcus, kris, erwin,\nlinimon, pav, krion"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nerwin"] From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 01:02:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CABF7106564A; Thu, 28 Jun 2012 01:02:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB2D08FC08; Thu, 28 Jun 2012 01:02:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S12osc043151; Thu, 28 Jun 2012 01:02:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S12oC3043145; Thu, 28 Jun 2012 01:02:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206280102.q5S12oC3043145@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 28 Jun 2012 01:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237678 - stable/9/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 01:02:50 -0000 Author: pfg Date: Thu Jun 28 01:02:50 2012 New Revision: 237678 URL: http://svn.freebsd.org/changeset/base/237678 Log: MFC r237406: Bring a couple of fixes for gcc optimizations. The GCC4.3 branch contains some optimization fixes that were not considered regressions and therefore were never backported. We are bringing a couple of them that are under GPLv2 since they were made before the license switch upstream. Modified: stable/9/contrib/gcc/ChangeLog.gcc43 stable/9/contrib/gcc/fold-const.c stable/9/contrib/gcc/gimplify.c stable/9/contrib/gcc/tree-ssa-ccp.c stable/9/contrib/gcc/tree-ssa-pre.c Directory Properties: stable/9/contrib/gcc/ (props changed) Modified: stable/9/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/9/contrib/gcc/ChangeLog.gcc43 Thu Jun 28 00:17:45 2012 (r237677) +++ stable/9/contrib/gcc/ChangeLog.gcc43 Thu Jun 28 01:02:50 2012 (r237678) @@ -5,6 +5,18 @@ with SSE3 instruction set support. * doc/invoke.texi: Likewise. +2007-04-12 Richard Guenther (r123736) + + PR tree-optimization/24689 + PR tree-optimization/31307 + * fold-const.c (operand_equal_p): Compare INTEGER_CST array + indices by value. + * gimplify.c (canonicalize_addr_expr): To be consistent with + gimplify_compound_lval only set operands two and three of + ARRAY_REFs if they are not gimple_min_invariant. This makes + it never at this place. + * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise. + 2007-04-07 H.J. Lu (r123639) * config/i386/i386.c (ix86_handle_option): Handle SSSE3. @@ -96,7 +108,7 @@ * doc/invoke.texi: Add entry about geode processor. -2006-10-24 Richard Guenther +2006-10-24 Richard Guenther (r118001) PR middle-end/28796 * builtins.c (fold_builtin_classify): Use HONOR_INFINITIES @@ -170,7 +182,13 @@ * doc/invoke.texi: Document -mssse3/-mno-ssse3 switches. -2006-10-21 Richard Guenther +2006-10-21 Richard Guenther (r117932) + + PR tree-optimization/3511 + * tree-ssa-pre.c (phi_translate): Fold CALL_EXPRs that + got new invariant arguments during PHI translation. + +2006-10-21 Richard Guenther (r117929) * builtins.c (fold_builtin_classify): Fix typo. Modified: stable/9/contrib/gcc/fold-const.c ============================================================================== --- stable/9/contrib/gcc/fold-const.c Thu Jun 28 00:17:45 2012 (r237677) +++ stable/9/contrib/gcc/fold-const.c Thu Jun 28 01:02:50 2012 (r237678) @@ -2802,9 +2802,13 @@ operand_equal_p (tree arg0, tree arg1, u case ARRAY_REF: case ARRAY_RANGE_REF: - /* Operands 2 and 3 may be null. */ + /* Operands 2 and 3 may be null. + Compare the array index by value if it is constant first as we + may have different types but same value here. */ return (OP_SAME (0) - && OP_SAME (1) + && (tree_int_cst_equal (TREE_OPERAND (arg0, 1), + TREE_OPERAND (arg1, 1)) + || OP_SAME (1)) && OP_SAME_WITH_NULL (2) && OP_SAME_WITH_NULL (3)); Modified: stable/9/contrib/gcc/gimplify.c ============================================================================== --- stable/9/contrib/gcc/gimplify.c Thu Jun 28 00:17:45 2012 (r237677) +++ stable/9/contrib/gcc/gimplify.c Thu Jun 28 01:02:50 2012 (r237678) @@ -1600,9 +1600,7 @@ canonicalize_addr_expr (tree *expr_p) /* All checks succeeded. Build a new node to merge the cast. */ *expr_p = build4 (ARRAY_REF, dctype, obj_expr, TYPE_MIN_VALUE (TYPE_DOMAIN (datype)), - TYPE_MIN_VALUE (TYPE_DOMAIN (datype)), - size_binop (EXACT_DIV_EXPR, TYPE_SIZE_UNIT (dctype), - size_int (TYPE_ALIGN_UNIT (dctype)))); + NULL_TREE, NULL_TREE); *expr_p = build1 (ADDR_EXPR, ctype, *expr_p); } Modified: stable/9/contrib/gcc/tree-ssa-ccp.c ============================================================================== --- stable/9/contrib/gcc/tree-ssa-ccp.c Thu Jun 28 00:17:45 2012 (r237677) +++ stable/9/contrib/gcc/tree-ssa-ccp.c Thu Jun 28 01:02:50 2012 (r237678) @@ -1621,9 +1621,7 @@ maybe_fold_offset_to_array_ref (tree bas if (!integer_zerop (elt_offset)) idx = int_const_binop (PLUS_EXPR, idx, elt_offset, 0); - return build4 (ARRAY_REF, orig_type, base, idx, min_idx, - size_int (tree_low_cst (elt_size, 1) - / (TYPE_ALIGN_UNIT (elt_type)))); + return build4 (ARRAY_REF, orig_type, base, idx, NULL_TREE, NULL_TREE); } Modified: stable/9/contrib/gcc/tree-ssa-pre.c ============================================================================== --- stable/9/contrib/gcc/tree-ssa-pre.c Thu Jun 28 00:17:45 2012 (r237677) +++ stable/9/contrib/gcc/tree-ssa-pre.c Thu Jun 28 01:02:50 2012 (r237678) @@ -1076,6 +1076,7 @@ phi_translate (tree expr, value_set_t se tree newexpr; tree vh = get_value_handle (expr); bool listchanged = false; + bool invariantarg = false; VEC (tree, gc) *vuses = VALUE_HANDLE_VUSES (vh); VEC (tree, gc) *tvuses; @@ -1134,10 +1135,26 @@ phi_translate (tree expr, value_set_t se if (newval != oldval) { listchanged = true; + invariantarg |= is_gimple_min_invariant (newval); TREE_VALUE (newwalker) = get_value_handle (newval); } } } + + /* In case of new invariant args we might try to fold the call + again. */ + if (invariantarg) + { + tree tmp = fold_ternary (CALL_EXPR, TREE_TYPE (expr), + newop0, newarglist, newop2); + if (tmp) + { + STRIP_TYPE_NOPS (tmp); + if (is_gimple_min_invariant (tmp)) + return tmp; + } + } + if (listchanged) vn_lookup_or_add (newarglist, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 01:05:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94C76106566C; Thu, 28 Jun 2012 01:05:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73DBE8FC08; Thu, 28 Jun 2012 01:05:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S150QQ043285; Thu, 28 Jun 2012 01:05:00 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S150sL043279; Thu, 28 Jun 2012 01:05:00 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206280105.q5S150sL043279@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 28 Jun 2012 01:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237679 - stable/8/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 01:05:00 -0000 Author: pfg Date: Thu Jun 28 01:04:59 2012 New Revision: 237679 URL: http://svn.freebsd.org/changeset/base/237679 Log: MFC r237406: Bring a couple of fixes for gcc optimizations. The GCC4.3 branch contains some optimization fixes that were not considered regressions and therefore were never backported. We are bringing a couple of them that are under GPLv2 since they were made before the license switch upstream. Modified: stable/8/contrib/gcc/ChangeLog.gcc43 stable/8/contrib/gcc/fold-const.c stable/8/contrib/gcc/gimplify.c stable/8/contrib/gcc/tree-ssa-ccp.c stable/8/contrib/gcc/tree-ssa-pre.c Directory Properties: stable/8/contrib/gcc/ (props changed) Modified: stable/8/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/8/contrib/gcc/ChangeLog.gcc43 Thu Jun 28 01:02:50 2012 (r237678) +++ stable/8/contrib/gcc/ChangeLog.gcc43 Thu Jun 28 01:04:59 2012 (r237679) @@ -5,6 +5,18 @@ with SSE3 instruction set support. * doc/invoke.texi: Likewise. +2007-04-12 Richard Guenther (r123736) + + PR tree-optimization/24689 + PR tree-optimization/31307 + * fold-const.c (operand_equal_p): Compare INTEGER_CST array + indices by value. + * gimplify.c (canonicalize_addr_expr): To be consistent with + gimplify_compound_lval only set operands two and three of + ARRAY_REFs if they are not gimple_min_invariant. This makes + it never at this place. + * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise. + 2007-04-07 H.J. Lu (r123639) * config/i386/i386.c (ix86_handle_option): Handle SSSE3. @@ -96,7 +108,7 @@ * doc/invoke.texi: Add entry about geode processor. -2006-10-24 Richard Guenther +2006-10-24 Richard Guenther (r118001) PR middle-end/28796 * builtins.c (fold_builtin_classify): Use HONOR_INFINITIES @@ -170,7 +182,13 @@ * doc/invoke.texi: Document -mssse3/-mno-ssse3 switches. -2006-10-21 Richard Guenther +2006-10-21 Richard Guenther (r117932) + + PR tree-optimization/3511 + * tree-ssa-pre.c (phi_translate): Fold CALL_EXPRs that + got new invariant arguments during PHI translation. + +2006-10-21 Richard Guenther (r117929) * builtins.c (fold_builtin_classify): Fix typo. Modified: stable/8/contrib/gcc/fold-const.c ============================================================================== --- stable/8/contrib/gcc/fold-const.c Thu Jun 28 01:02:50 2012 (r237678) +++ stable/8/contrib/gcc/fold-const.c Thu Jun 28 01:04:59 2012 (r237679) @@ -2802,9 +2802,13 @@ operand_equal_p (tree arg0, tree arg1, u case ARRAY_REF: case ARRAY_RANGE_REF: - /* Operands 2 and 3 may be null. */ + /* Operands 2 and 3 may be null. + Compare the array index by value if it is constant first as we + may have different types but same value here. */ return (OP_SAME (0) - && OP_SAME (1) + && (tree_int_cst_equal (TREE_OPERAND (arg0, 1), + TREE_OPERAND (arg1, 1)) + || OP_SAME (1)) && OP_SAME_WITH_NULL (2) && OP_SAME_WITH_NULL (3)); Modified: stable/8/contrib/gcc/gimplify.c ============================================================================== --- stable/8/contrib/gcc/gimplify.c Thu Jun 28 01:02:50 2012 (r237678) +++ stable/8/contrib/gcc/gimplify.c Thu Jun 28 01:04:59 2012 (r237679) @@ -1600,9 +1600,7 @@ canonicalize_addr_expr (tree *expr_p) /* All checks succeeded. Build a new node to merge the cast. */ *expr_p = build4 (ARRAY_REF, dctype, obj_expr, TYPE_MIN_VALUE (TYPE_DOMAIN (datype)), - TYPE_MIN_VALUE (TYPE_DOMAIN (datype)), - size_binop (EXACT_DIV_EXPR, TYPE_SIZE_UNIT (dctype), - size_int (TYPE_ALIGN_UNIT (dctype)))); + NULL_TREE, NULL_TREE); *expr_p = build1 (ADDR_EXPR, ctype, *expr_p); } Modified: stable/8/contrib/gcc/tree-ssa-ccp.c ============================================================================== --- stable/8/contrib/gcc/tree-ssa-ccp.c Thu Jun 28 01:02:50 2012 (r237678) +++ stable/8/contrib/gcc/tree-ssa-ccp.c Thu Jun 28 01:04:59 2012 (r237679) @@ -1621,9 +1621,7 @@ maybe_fold_offset_to_array_ref (tree bas if (!integer_zerop (elt_offset)) idx = int_const_binop (PLUS_EXPR, idx, elt_offset, 0); - return build4 (ARRAY_REF, orig_type, base, idx, min_idx, - size_int (tree_low_cst (elt_size, 1) - / (TYPE_ALIGN_UNIT (elt_type)))); + return build4 (ARRAY_REF, orig_type, base, idx, NULL_TREE, NULL_TREE); } Modified: stable/8/contrib/gcc/tree-ssa-pre.c ============================================================================== --- stable/8/contrib/gcc/tree-ssa-pre.c Thu Jun 28 01:02:50 2012 (r237678) +++ stable/8/contrib/gcc/tree-ssa-pre.c Thu Jun 28 01:04:59 2012 (r237679) @@ -1076,6 +1076,7 @@ phi_translate (tree expr, value_set_t se tree newexpr; tree vh = get_value_handle (expr); bool listchanged = false; + bool invariantarg = false; VEC (tree, gc) *vuses = VALUE_HANDLE_VUSES (vh); VEC (tree, gc) *tvuses; @@ -1134,10 +1135,26 @@ phi_translate (tree expr, value_set_t se if (newval != oldval) { listchanged = true; + invariantarg |= is_gimple_min_invariant (newval); TREE_VALUE (newwalker) = get_value_handle (newval); } } } + + /* In case of new invariant args we might try to fold the call + again. */ + if (invariantarg) + { + tree tmp = fold_ternary (CALL_EXPR, TREE_TYPE (expr), + newop0, newarglist, newop2); + if (tmp) + { + STRIP_TYPE_NOPS (tmp); + if (is_gimple_min_invariant (tmp)) + return tmp; + } + } + if (listchanged) vn_lookup_or_add (newarglist, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 01:52:15 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CBC2106564A; Thu, 28 Jun 2012 01:52:15 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 554788FC0A; Thu, 28 Jun 2012 01:52:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5S1qDoo024638; Thu, 28 Jun 2012 01:52:13 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4FEBB8C9.8070006@gmail.com> Date: Thu, 28 Jun 2012 09:52:09 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Konstantin Belousov References: <201206272032.q5RKWjvt031174@svn.freebsd.org> In-Reply-To: <201206272032.q5RKWjvt031174@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 01:52:15 -0000 On 2012/6/28 4:32, Konstantin Belousov wrote: > Author: kib > Date: Wed Jun 27 20:32:45 2012 > New Revision: 237660 > URL: http://svn.freebsd.org/changeset/base/237660 > > Log: > Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPU > value if present. > > MFC after: 1 week > > Modified: > head/lib/libc/gen/sysconf.c > > Modified: head/lib/libc/gen/sysconf.c > ============================================================================== > --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 (r237659) > +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 (r237660) > @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > #include > #include > #include > @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); > > #include "../stdlib/atexit.h" > #include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ > +#include "libc_private.h" > > #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ > > @@ -585,6 +587,8 @@ yesno: > > case _SC_NPROCESSORS_CONF: > case _SC_NPROCESSORS_ONLN: > + if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) == 0) > + return ((long)value); > mib[0] = CTL_HW; > mib[1] = HW_NCPU; > break; > Will this make controlling the number of CPU online or CPU hotplug be impossible on FreeBSD ? Regards, David Xu From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 02:21:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30BB3106566B; Thu, 28 Jun 2012 02:21:47 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7516A8FC16; Thu, 28 Jun 2012 02:21:46 +0000 (UTC) Received: by vbmv11 with SMTP id v11so1439372vbm.13 for ; Wed, 27 Jun 2012 19:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=FH3CysvK5j3+PgKdeGNPwpb67nRbGLfuGVUZ4D0yvlg=; b=ppmDC8wOZDPmDeOZzuemi0muKnqDubP9NqIPYa2zeSLmy+PE5tif5FlT/5CGubbQmH ek11ABE43pExTCiLoYp5DgooAdkIQm9OjqpuFzIbIZjhNchnEWArCtS3T8AsoHADuQau /5V0yhUpd1QCAhcIES1e5EFpw90MFziJX2Tomlqc6iLfVWhvhLuhHq9DvG1BDoHY5ygb GutAmu7KBZLkfMBCitw+Y5FvHO8RGXSqSTad4rUp4RLbWfK+f3DkvzIKVUaGQAKE9JdQ nCXPQuxbZ2IXccfXYhsnm4hud5Lv01JUNrNbSSv2WHSMJBUH5vQeVXrobIs7mjs7wQh1 aU/g== MIME-Version: 1.0 Received: by 10.52.97.230 with SMTP id ed6mr63724vdb.65.1340850105663; Wed, 27 Jun 2012 19:21:45 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.220.36.193 with HTTP; Wed, 27 Jun 2012 19:21:45 -0700 (PDT) In-Reply-To: <4FEBB8C9.8070006@gmail.com> References: <201206272032.q5RKWjvt031174@svn.freebsd.org> <4FEBB8C9.8070006@gmail.com> Date: Thu, 28 Jun 2012 03:21:45 +0100 X-Google-Sender-Auth: BES44ClnC_Vv_GOBUWTDEpcruK8 Message-ID: From: Attilio Rao To: davidxu@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 02:21:47 -0000 2012/6/28, David Xu : > On 2012/6/28 4:32, Konstantin Belousov wrote: >> Author: kib >> Date: Wed Jun 27 20:32:45 2012 >> New Revision: 237660 >> URL: http://svn.freebsd.org/changeset/base/237660 >> >> Log: >> Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPU >> value if present. >> >> MFC after: 1 week >> >> Modified: >> head/lib/libc/gen/sysconf.c >> >> Modified: head/lib/libc/gen/sysconf.c >> ============================================================================== >> --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 (r237659) >> +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 (r237660) >> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> >> +#include >> #include >> #include >> #include >> @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); >> >> #include "../stdlib/atexit.h" >> #include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ >> +#include "libc_private.h" >> >> #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ >> >> @@ -585,6 +587,8 @@ yesno: >> >> case _SC_NPROCESSORS_CONF: >> case _SC_NPROCESSORS_ONLN: >> + if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) == 0) >> + return ((long)value); >> mib[0] = CTL_HW; >> mib[1] = HW_NCPU; >> break; >> > Will this make controlling the number of CPU online or CPU hotplug > be impossible on FreeBSD ? If I think about hotplug CPUs I can think of other 1000 problems/races/bad situations to be fixed before this one, really. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 02:25:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C1BF106564A; Thu, 28 Jun 2012 02:25:45 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CD3148FC08; Thu, 28 Jun 2012 02:25:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5S2PgwK052028; Thu, 28 Jun 2012 02:25:43 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4FEBC0A2.3010708@gmail.com> Date: Thu, 28 Jun 2012 10:25:38 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Attilio Rao References: <201206272032.q5RKWjvt031174@svn.freebsd.org> <4FEBB8C9.8070006@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , davidxu@freebsd.org Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 02:25:45 -0000 On 2012/6/28 10:21, Attilio Rao wrote: > 2012/6/28, David Xu: >> On 2012/6/28 4:32, Konstantin Belousov wrote: >>> Author: kib >>> Date: Wed Jun 27 20:32:45 2012 >>> New Revision: 237660 >>> URL: http://svn.freebsd.org/changeset/base/237660 >>> >>> Log: >>> Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPU >>> value if present. >>> >>> MFC after: 1 week >>> >>> Modified: >>> head/lib/libc/gen/sysconf.c >>> >>> Modified: head/lib/libc/gen/sysconf.c >>> ============================================================================== >>> --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 (r237659) >>> +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 (r237660) >>> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #include >>> >>> +#include >>> #include >>> #include >>> #include >>> @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); >>> >>> #include "../stdlib/atexit.h" >>> #include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ >>> +#include "libc_private.h" >>> >>> #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ >>> >>> @@ -585,6 +587,8 @@ yesno: >>> >>> case _SC_NPROCESSORS_CONF: >>> case _SC_NPROCESSORS_ONLN: >>> + if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) == 0) >>> + return ((long)value); >>> mib[0] = CTL_HW; >>> mib[1] = HW_NCPU; >>> break; >>> >> Will this make controlling the number of CPU online or CPU hotplug >> be impossible on FreeBSD ? > If I think about hotplug CPUs I can think of other 1000 > problems/races/bad situations to be fixed before this one, really. These are problems only in kernel, but kib's change is about ABI between userland and kernel, I hope we don't introduce an ABI which is not extendable road stone. > Attilio > > From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 02:32:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A6A31065670; Thu, 28 Jun 2012 02:32:47 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 75A468FC08; Thu, 28 Jun 2012 02:32:46 +0000 (UTC) Received: by vcbfy7 with SMTP id fy7so1450021vcb.13 for ; Wed, 27 Jun 2012 19:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=rVwVhHEuCvaT5pqKv9ZtYxKM8t/BsqREtK6z7tzRd0w=; b=DF5XD3/Is5bT0zK69C39ACnvNeIn0T4J3eq6Gl7XTnhj/ExeDxs+Mhc2w6Oi7bP2Yy YDzYSo+cj0rHPne2gDmcpFO5E897Pz1GA//N9mtUUMQ9z+FksHPSWoFkepBoDxUHRkB5 iREauh2hc/Fot7iRfAjR2UUozsXNuE6EE5mmKs/z2qwFQjAs3EXN91xBXNtcQpP1u8in ZdzewtPidDKgbbnyn2PgugcUXqDGQET2iL8bmLHkG9eVKJ+3RznQ6i4MhmSCJHPMVF8u JNElAmiF0dFOtYLGClMatu09dkx+r2+xqTARrRms1sz1bAKt+oEPurv6A4P5df3RVn4c AvNQ== MIME-Version: 1.0 Received: by 10.221.1.5 with SMTP id no5mr56635vcb.67.1340850760715; Wed, 27 Jun 2012 19:32:40 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.220.36.193 with HTTP; Wed, 27 Jun 2012 19:32:40 -0700 (PDT) In-Reply-To: <4FEBC0A2.3010708@gmail.com> References: <201206272032.q5RKWjvt031174@svn.freebsd.org> <4FEBB8C9.8070006@gmail.com> <4FEBC0A2.3010708@gmail.com> Date: Thu, 28 Jun 2012 03:32:40 +0100 X-Google-Sender-Auth: EKdAwr1O-DCetCMK2FInZsEnk78 Message-ID: From: Attilio Rao To: davidxu@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 02:32:47 -0000 2012/6/28, David Xu : > On 2012/6/28 10:21, Attilio Rao wrote: >> 2012/6/28, David Xu: >>> On 2012/6/28 4:32, Konstantin Belousov wrote: >>>> Author: kib >>>> Date: Wed Jun 27 20:32:45 2012 >>>> New Revision: 237660 >>>> URL: http://svn.freebsd.org/changeset/base/237660 >>>> >>>> Log: >>>> Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPU >>>> value if present. >>>> >>>> MFC after: 1 week >>>> >>>> Modified: >>>> head/lib/libc/gen/sysconf.c >>>> >>>> Modified: head/lib/libc/gen/sysconf.c >>>> ============================================================================== >>>> --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 (r237659) >>>> +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 (r237660) >>>> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); >>>> #include >>>> #include >>>> >>>> +#include >>>> #include >>>> #include >>>> #include >>>> @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); >>>> >>>> #include "../stdlib/atexit.h" >>>> #include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ >>>> +#include "libc_private.h" >>>> >>>> #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ >>>> >>>> @@ -585,6 +587,8 @@ yesno: >>>> >>>> case _SC_NPROCESSORS_CONF: >>>> case _SC_NPROCESSORS_ONLN: >>>> + if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) == 0) >>>> + return ((long)value); >>>> mib[0] = CTL_HW; >>>> mib[1] = HW_NCPU; >>>> break; >>>> >>> Will this make controlling the number of CPU online or CPU hotplug >>> be impossible on FreeBSD ? >> If I think about hotplug CPUs I can think of other 1000 >> problems/races/bad situations to be fixed before this one, really. > These are problems only in kernel, but kib's change is about ABI > between userland and kernel, I hope we don't introduce an ABI which > is not extendable road stone. I'm not entirely sure I see the ABI breakage here. If the AT_NCPUS becames unconvenient and not correct at some point we can just fix sysconf() to not look into the aux vector anymoe. Please note that AT_NCPUS is already exported nowadays. I think this is instead a clever optimization to avoid the sysctl() (usual way to retrieve the number of CPUs). Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 02:53:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B322106566C; Thu, 28 Jun 2012 02:53:09 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4BBA18FC0C; Thu, 28 Jun 2012 02:53:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5S2r6pc080072; Thu, 28 Jun 2012 02:53:07 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4FEBC70F.40408@gmail.com> Date: Thu, 28 Jun 2012 10:53:03 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Attilio Rao References: <201206272032.q5RKWjvt031174@svn.freebsd.org> <4FEBB8C9.8070006@gmail.com> <4FEBC0A2.3010708@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , davidxu@freebsd.org Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 02:53:09 -0000 On 2012/6/28 10:32, Attilio Rao wrote: > 2012/6/28, David Xu: >> On 2012/6/28 10:21, Attilio Rao wrote: >>> 2012/6/28, David Xu: >>>> On 2012/6/28 4:32, Konstantin Belousov wrote: >>>>> Author: kib >>>>> Date: Wed Jun 27 20:32:45 2012 >>>>> New Revision: 237660 >>>>> URL: http://svn.freebsd.org/changeset/base/237660 >>>>> >>>>> Log: >>>>> Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPU >>>>> value if present. >>>>> >>>>> MFC after: 1 week >>>>> >>>>> Modified: >>>>> head/lib/libc/gen/sysconf.c >>>>> >>>>> Modified: head/lib/libc/gen/sysconf.c >>>>> ============================================================================== >>>>> --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 (r237659) >>>>> +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 (r237660) >>>>> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); >>>>> #include >>>>> #include >>>>> >>>>> +#include >>>>> #include >>>>> #include >>>>> #include >>>>> @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); >>>>> >>>>> #include "../stdlib/atexit.h" >>>>> #include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ >>>>> +#include "libc_private.h" >>>>> >>>>> #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ >>>>> >>>>> @@ -585,6 +587,8 @@ yesno: >>>>> >>>>> case _SC_NPROCESSORS_CONF: >>>>> case _SC_NPROCESSORS_ONLN: >>>>> + if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) == 0) >>>>> + return ((long)value); >>>>> mib[0] = CTL_HW; >>>>> mib[1] = HW_NCPU; >>>>> break; >>>>> >>>> Will this make controlling the number of CPU online or CPU hotplug >>>> be impossible on FreeBSD ? >>> If I think about hotplug CPUs I can think of other 1000 >>> problems/races/bad situations to be fixed before this one, really. >> These are problems only in kernel, but kib's change is about ABI >> between userland and kernel, I hope we don't introduce an ABI which >> is not extendable road stone. > I'm not entirely sure I see the ABI breakage here. It is not breakage, it is the ABI thinks number of online cpu is fixed, obviously, it is not the case in future unless FreeBSD won't support dynamic number of online cpus. > If the AT_NCPUS > becames unconvenient and not correct at some point we can just fix > sysconf() to not look into the aux vector anymoe. If you already know this will be a problem, why do you introduce it and later need to fix it ? > Please note that > AT_NCPUS is already exported nowadays. I think this is instead a > clever optimization to avoid the sysctl() (usual way to retrieve the > number of CPUs). But why don't you cache it in libc ? following code is enough: static int online_cpu; if (online_cpu == 0) online_cpu = sysctl return online_cpu; > Attilio > > From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 03:27:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7AAB7106566B; Thu, 28 Jun 2012 03:27:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AB148FC12; Thu, 28 Jun 2012 03:27:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S3RalM049337; Thu, 28 Jun 2012 03:27:36 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S3Rael049335; Thu, 28 Jun 2012 03:27:36 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201206280327.q5S3Rael049335@svn.freebsd.org> From: Glen Barber Date: Thu, 28 Jun 2012 03:27: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: r237680 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 03:27:36 -0000 Author: gjb (doc,ports committer) Date: Thu Jun 28 03:27:35 2012 New Revision: 237680 URL: http://svn.freebsd.org/changeset/base/237680 Log: Update entries in organization.dot for the following groups: coresecretary, portmgr, portmgrsecretary, secteam Sort entries by last name. Note: core is left as-is intentionally for now. Submitted by: bcr, rpaulo Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Thu Jun 28 01:04:59 2012 (r237679) +++ head/share/misc/organization.dot Thu Jun 28 03:27:35 2012 (r237680) @@ -26,12 +26,12 @@ _misc [label="Miscellaneous Hats"] # Development teams go here alphabetically sorted core [label="Core Team\ncore@FreeBSD.org\nwilko, brooks, keramida, imp,\ngnn, wes, hrs, murray,\nrwatson"] -coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\njoel"] +coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\ngavin"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] -portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nmarcus, kris, erwin,\nlinimon, pav, krion"] -portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nerwin"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\ntabthorpe, marcus, bapt, beat,\nerwin, linimon, pav,\nitetcu, flz, miwi"] +portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\ntabthorpe"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nmux, bmah, hrs, kensmith,\nmurray, rwatson, dwhite"] realpha [label="FreeBSD/alpha Release Engineering Team\nre-alpha@FreeBSD.org\nwilko, murray, rwatson"] reamd64 [label="FreeBSD/amd64 Release Engineering Team\nre-amd64@FreeBSD.org\nobrien"] @@ -40,7 +40,7 @@ reia64 [label="FreeBSD/ia64 Release Engi repc98 [label="FreeBSD/pc98 Release Engineering Team\nre-pc98@FreeBSD.org\nnyan"] reppc [label="FreeBSD/ppc Release Engineering Team\nre-ppc@FreeBSD.org\ngrehan"] resparc64 [label="FreeBSD/sparc64 Release Engineering Team\nre-sparc64@FreeBSD.org\njake, phk, tmm, obrien,\nkensmith, murray, rwatson"] -secteam [label="Security Team\nsecteam@FreeBSD.org\nmnag, remko, gnn, simon, philip,\ncperciva, csjp, des,\nnectar, rwatson"] +secteam [label="Security Team\nsecteam@FreeBSD.org\nsimon, qingli, delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ncperciva, simon, nectar"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"] From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 03:30:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9387106566C; Thu, 28 Jun 2012 03:30:17 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3F428FC12; Thu, 28 Jun 2012 03:30:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S3UHIV049485; Thu, 28 Jun 2012 03:30:17 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S3UH8m049482; Thu, 28 Jun 2012 03:30:17 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201206280330.q5S3UH8m049482@svn.freebsd.org> From: Rui Paulo Date: Thu, 28 Jun 2012 03:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237681 - head/share/examples/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 03:30:17 -0000 Author: rpaulo Date: Thu Jun 28 03:30:17 2012 New Revision: 237681 URL: http://svn.freebsd.org/changeset/base/237681 Log: Add the 'inet' keyword after the nat rule to avoid interfering with IPv6. Modified: head/share/examples/pf/faq-example1 head/share/examples/pf/pf.conf Modified: head/share/examples/pf/faq-example1 ============================================================================== --- head/share/examples/pf/faq-example1 Thu Jun 28 03:27:35 2012 (r237680) +++ head/share/examples/pf/faq-example1 Thu Jun 28 03:30:17 2012 (r237681) @@ -26,7 +26,7 @@ set skip on lo scrub in # nat/rdr -nat on $ext_if from !($ext_if) -> ($ext_if:0) +nat on $ext_if inet from !($ext_if) -> ($ext_if:0) nat-anchor "ftp-proxy/*" rdr-anchor "ftp-proxy/*" Modified: head/share/examples/pf/pf.conf ============================================================================== --- head/share/examples/pf/pf.conf Thu Jun 28 03:27:35 2012 (r237680) +++ head/share/examples/pf/pf.conf Thu Jun 28 03:30:17 2012 (r237681) @@ -16,7 +16,7 @@ #nat-anchor "ftp-proxy/*" #rdr-anchor "ftp-proxy/*" -#nat on $ext_if from !($ext_if) -> ($ext_if:0) +#nat on $ext_if inet from !($ext_if) -> ($ext_if:0) #rdr pass on $int_if proto tcp to port ftp -> 127.0.0.1 port 8021 #no rdr on $ext_if proto tcp from to any port smtp #rdr pass on $ext_if proto tcp from any to any port smtp \ From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 03:36:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AB4A1065670; Thu, 28 Jun 2012 03:36:14 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 050C58FC0C; Thu, 28 Jun 2012 03:36:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S3aDrC049771; Thu, 28 Jun 2012 03:36:13 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S3aD9b049769; Thu, 28 Jun 2012 03:36:13 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206280336.q5S3aD9b049769@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 28 Jun 2012 03:36: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: r237682 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 03:36:14 -0000 Author: ken Date: Thu Jun 28 03:36:13 2012 New Revision: 237682 URL: http://svn.freebsd.org/changeset/base/237682 Log: Fix a typo in a panic() call. PR: kern/169497 Submitted by: Steven Hartland MFC after: 3 days Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Thu Jun 28 03:30:17 2012 (r237681) +++ head/sys/cam/cam_periph.c Thu Jun 28 03:36:13 2012 (r237682) @@ -273,7 +273,7 @@ failure: /* No cleanup to perform. */ break; default: - panic("cam_periph_alloc: Unkown init level"); + panic("%s: Unknown init level", __func__); } return(status); } From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 03:48:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 677EF106566B; Thu, 28 Jun 2012 03:48:55 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F9B78FC12; Thu, 28 Jun 2012 03:48:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S3mtTG050316; Thu, 28 Jun 2012 03:48:55 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S3ms6C050301; Thu, 28 Jun 2012 03:48:54 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206280348.q5S3ms6C050301@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 28 Jun 2012 03: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: r237683 - in head/sys/dev/mps: . mpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 03:48:55 -0000 Author: ken Date: Thu Jun 28 03:48:54 2012 New Revision: 237683 URL: http://svn.freebsd.org/changeset/base/237683 Log: Bring in LSI's latest mps(4) 6Gb SAS and WarpDrive driver, version 14.00.00.01-fbsd. Their description of the changes is as follows: 1. Copyright contents has been changed in all respective .c and .h files 2. Support for WRITE12 and READ12 for direct-io (warpdrive only) has been added. 3. Driver has added checks to see if Drive has READ_CAP_16 support before sending it down to the device. If SPC3_SID_PROTECT flag is set in the inquiry data, the device supports protection information, and must support the 16 byte read capacity command, otherwise continue without sending read cap 16. This will optimize driver performance, since it will not send READ_CAP_16 to the drive which does not have support of READ_CAP_16. 4. With new approach, "MPTIOCTL_RESET_ADAPTER" IOCTL will not use DELAY() which is busy loop implementation. It will use (Better way to sleep without busy loop). Also from the HBA reset code path and some other places, DELAY() is replaced with msleep() or "pause()", which is based on sleep/wakeup style calls. Driver use msleep()/pause() instead of DELAY based on CAN_SLEEP/NO_SLEEP flags to avoid busy loop which is not required all the time.e.a a. While driver is getting loaded, driver calls most of the commands with NO_SLEEP. b. When Driver is functional and it needs Reinit of HBA, CAN_SLEEP flag is used. 5. driver is not Endian safe. It will not work on Big Endian machines like Sparc and PowerPC platforms because it assumes it is running on a Little Endian machine. Driver code is modified such way that it does not assume CPU arch is Little Endian. a. All places where Driver interacts from HBA to Host, it converts Little Endian format to CPU format. b. All places where Driver interacts from Host to HBA, it converts CPU format to Little Endian. 6. Findout memory leaks in FreeBSD Driver and resolve those, such as memory leak in targ's luns creation/deletion. Also added additional checks to see memory allocation success/fail. 7. Add loginfo prints as debug message, i.e. When FW sends any loginfo, Driver should print those as debug message. This will help for debugging purpose. 8. There is possibility to get config request timeout. Current driver is able to detect config request timetout, but it does not do anything on config_request timeout. Driver should call mps_reinit() if any request_poll (which is called as part of config_request) is time out. 9. cdb length check is required for 32 byte CDB. Add correct mpi control value for 32 bit CDB as below while submitting SCSI IO Request to controller. mpi_control |= 4 << MPI2_SCSIIO_CONTROL_ADDCDBLEN_SHIFT; 10. Check the actual status of Message unit reset (mps_message_unit_reset).Previously FreeBSD Driver just writes MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET and never check the ack (it just wait for 50 millisecond). So, Driver now check the status of "MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET" after writing it to the FW. Now it also checking for whether doorbell ack uses msleep with proper sleep flags, instead of . 11. Previously CAM does not detect Multi-Lun Devices. In order to detect Multi-Lun Devices by CAM the driver needs following change set: a. There is "max_lun" field which Driver need to set based on hw/fw support. Currently LSI released driver does not set this field. b. Default of "max_lun" should not be 0 in OS, but it is currently set to 0 in CAM layer. c. Export max_lun capacity to 255 12. Driver will not reset target info after port enable complete and also do Device removal when Device remove from FW. The detail description is as follows a. When Driver receive WD PD add events, it will add all information in driver local data structure. b. Only for WD, we have below checks after port enable completes, where driver clear off all information retrieved at #1. if ((sc->WD_available && (sc->WD_hide_expose == MPS_WD_HIDE_ALWAYS)) || (sc->WD_valid_config && (sc->WD_hide_expose == MPS_WD_HIDE_IF_VOLUME)) { // clear off target data structure. } It is mainly not to attach PDs to OS. FreeBSD does bus rescan as older Parallel scsi style. So Driver needs to handle which Drive is visible to OS. That is a reason we have to clear off targ information for PDs. Again, above logic was implemented long time ago. Similar concept we have for non-wd also. For that, LSI have introduced different logic to hide PDs. Eventually, because of above gap, when Phy goes offline, we observe below failure. That is what Driver is not doing complete removal of device with FW. (which was pointed by Scott) Apr 5 02:39:24 Freebsd7 kernel: mpslsi0: mpssas_prepare_remove Apr 5 02:39:24 Freebsd7 kernel: mpssas_prepare_remove 497 : invalid handle 0xe Now Driver will not reset target info after port enable complete and also will do Device removal when Device remove from FW. 13. Returning "CAM_SEL_TIMEOUT" instead of "CAM_TID_INVALID" error code on request to the Target IDs that have no devices conected at that moment. As if "CAM_TID_INVALID" error code is returned to the CAM Layaer then it results in a huge chain of errors in verbose kernel messages on boot and every hot-plug event. Submitted by: Sreekanth Reddy MFC after: 3 days Modified: head/sys/dev/mps/mpi/mpi2.h head/sys/dev/mps/mpi/mpi2_cnfg.h head/sys/dev/mps/mpi/mpi2_hbd.h head/sys/dev/mps/mpi/mpi2_history.txt head/sys/dev/mps/mpi/mpi2_init.h head/sys/dev/mps/mpi/mpi2_ioc.h head/sys/dev/mps/mpi/mpi2_ra.h head/sys/dev/mps/mpi/mpi2_raid.h head/sys/dev/mps/mpi/mpi2_sas.h head/sys/dev/mps/mpi/mpi2_targ.h head/sys/dev/mps/mpi/mpi2_tool.h head/sys/dev/mps/mpi/mpi2_type.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_config.c head/sys/dev/mps/mps_ioctl.h head/sys/dev/mps/mps_mapping.c head/sys/dev/mps/mps_mapping.h head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas.h head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mpi/mpi2.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2000-2011 LSI Corporation. + * Copyright (c) 2000-2012 LSI Corporation. * * * Name: mpi2.h Modified: head/sys/dev/mps/mpi/mpi2_cnfg.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_cnfg.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_cnfg.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2000-2011 LSI Corporation. + * Copyright (c) 2000-2012 LSI Corporation. * * * Name: mpi2_cnfg.h Modified: head/sys/dev/mps/mpi/mpi2_hbd.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_hbd.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_hbd.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2009-2011 LSI Corporation. + * Copyright (c) 2009-2012 LSI Corporation. * * * Name: mpi2_hbd.h Modified: head/sys/dev/mps/mpi/mpi2_history.txt ============================================================================== --- head/sys/dev/mps/mpi/mpi2_history.txt Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_history.txt Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ Fusion-MPT MPI 2.0 Header File Change History ============================== - Copyright (c) 2000-2011 LSI Corporation. + Copyright (c) 2000-2012 LSI Corporation. --------------------------------------- Header Set Release Version: 02.00.18 Modified: head/sys/dev/mps/mpi/mpi2_init.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_init.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_init.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2000-2011 LSI Corporation. + * Copyright (c) 2000-2012 LSI Corporation. * * * Name: mpi2_init.h Modified: head/sys/dev/mps/mpi/mpi2_ioc.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_ioc.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_ioc.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2000-2011 LSI Corporation. + * Copyright (c) 2000-2012 LSI Corporation. * * * Name: mpi2_ioc.h Modified: head/sys/dev/mps/mpi/mpi2_ra.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_ra.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_ra.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2011 LSI Corporation. + * Copyright (c) 2012 LSI Corporation. * * * Name: mpi2_ra.h Modified: head/sys/dev/mps/mpi/mpi2_raid.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_raid.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_raid.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2000-2011 LSI Corporation. + * Copyright (c) 2000-2012 LSI Corporation. * * * Name: mpi2_raid.h Modified: head/sys/dev/mps/mpi/mpi2_sas.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_sas.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_sas.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2000-2011 LSI Corporation. + * Copyright (c) 2000-2012 LSI Corporation. * * * Name: mpi2_sas.h Modified: head/sys/dev/mps/mpi/mpi2_targ.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_targ.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_targ.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2000-2011 LSI Corporation. + * Copyright (c) 2000-2012 LSI Corporation. * * * Name: mpi2_targ.h Modified: head/sys/dev/mps/mpi/mpi2_tool.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_tool.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_tool.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2000-2011 LSI Corporation. + * Copyright (c) 2000-2012 LSI Corporation. * * * Name: mpi2_tool.h Modified: head/sys/dev/mps/mpi/mpi2_type.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_type.h Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mpi/mpi2_type.h Thu Jun 28 03:48:54 2012 (r237683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ */ /* - * Copyright (c) 2000-2011 LSI Corporation. + * Copyright (c) 2000-2012 LSI Corporation. * * * Name: mpi2_type.h Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Thu Jun 28 03:36:13 2012 (r237682) +++ head/sys/dev/mps/mps.c Thu Jun 28 03:48:54 2012 (r237683) @@ -1,31 +1,6 @@ /*- * Copyright (c) 2009 Yahoo! Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE 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. - * - */ -/*- - * Copyright (c) 2011 LSI Corp. + * Copyright (c) 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -82,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -98,9 +74,9 @@ __FBSDID("$FreeBSD$"); #include #include -static int mps_diag_reset(struct mps_softc *sc); +static int mps_diag_reset(struct mps_softc *sc, int sleep_flag); static int mps_init_queues(struct mps_softc *sc); -static int mps_message_unit_reset(struct mps_softc *sc); +static int mps_message_unit_reset(struct mps_softc *sc, int sleep_flag); static int mps_transition_operational(struct mps_softc *sc); static void mps_startup(void *arg); static int mps_send_iocinit(struct mps_softc *sc); @@ -112,7 +88,7 @@ static void mps_config_complete(struct m static void mps_periodic(void *); static int mps_reregister_events(struct mps_softc *sc); static void mps_enqueue_request(struct mps_softc *sc, struct mps_command *cm); - +static int mps_wait_db_ack(struct mps_softc *sc, int timeout, int sleep_flag); SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD, 0, "MPS Driver Parameters"); MALLOC_DEFINE(M_MPT2, "mps", "mpt2 driver memory"); @@ -123,8 +99,32 @@ MALLOC_DEFINE(M_MPT2, "mps", "mpt2 drive */ static char mpt2_reset_magic[] = { 0x00, 0x0f, 0x04, 0x0b, 0x02, 0x07, 0x0d }; +/* Added this union to smoothly convert le64toh cm->cm_desc.Words. + * Compiler only support unint64_t to be passed as argument. + * Otherwise it will through below error + * "aggregate value used where an integer was expected" + */ + +typedef union _reply_descriptor { + u64 word; + struct { + u32 low; + u32 high; + } u; +}reply_descriptor,address_descriptor; + +/* + * sleep_flag can be either CAN_SLEEP or NO_SLEEP. + * If this function is called from process context, it can sleep + * and there is no harm to sleep, in case if this fuction is called + * from Interrupt handler, we can not sleep and need NO_SLEEP flag set. + * based on sleep flags driver will call either msleep, pause or DELAY. + * msleep and pause are of same variant, but pause is used when mps_mtx + * is not hold by driver. + * + */ static int -mps_diag_reset(struct mps_softc *sc) +mps_diag_reset(struct mps_softc *sc,int sleep_flag) { uint32_t reg; int i, error, tries = 0; @@ -134,14 +134,25 @@ mps_diag_reset(struct mps_softc *sc) /* Clear any pending interrupts */ mps_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); + /*Force NO_SLEEP for threads prohibited to sleep + * e.a Thread from interrupt handler are prohibited to sleep. + */ + if(curthread->td_pflags & TDP_NOSLEEPING) + sleep_flag = NO_SLEEP; + /* Push the magic sequence */ error = ETIMEDOUT; while (tries++ < 20) { for (i = 0; i < sizeof(mpt2_reset_magic); i++) mps_regwrite(sc, MPI2_WRITE_SEQUENCE_OFFSET, mpt2_reset_magic[i]); - - DELAY(100 * 1000); + /* wait 100 msec */ + if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) + msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, "mpsdiag", hz/10); + else if (sleep_flag == CAN_SLEEP) + pause("mpsdiag", hz/10); + else + DELAY(100 * 1000); reg = mps_regread(sc, MPI2_HOST_DIAGNOSTIC_OFFSET); if (reg & MPI2_DIAG_DIAG_WRITE_ENABLE) { @@ -159,7 +170,13 @@ mps_diag_reset(struct mps_softc *sc) /* Wait up to 300 seconds in 50ms intervals */ error = ETIMEDOUT; for (i = 0; i < 60000; i++) { - DELAY(50000); + /* wait 50 msec */ + if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) + msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, "mpsdiag", hz/20); + else if (sleep_flag == CAN_SLEEP) + pause("mpsdiag", hz/20); + else + DELAY(50 * 1000); reg = mps_regread(sc, MPI2_DOORBELL_OFFSET); if ((reg & MPI2_IOC_STATE_MASK) != MPI2_IOC_STATE_RESET) { error = 0; @@ -175,7 +192,7 @@ mps_diag_reset(struct mps_softc *sc) } static int -mps_message_unit_reset(struct mps_softc *sc) +mps_message_unit_reset(struct mps_softc *sc, int sleep_flag) { mps_dprint(sc, MPS_TRACE, "%s\n", __func__); @@ -183,7 +200,12 @@ mps_message_unit_reset(struct mps_softc mps_regwrite(sc, MPI2_DOORBELL_OFFSET, MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET << MPI2_DOORBELL_FUNCTION_SHIFT); - DELAY(50000); + + if (mps_wait_db_ack(sc, 5, sleep_flag) != 0) { + mps_dprint(sc, MPS_FAULT, "Doorbell handshake failed : <%s>\n", + __func__); + return (ETIMEDOUT); + } return (0); } @@ -193,9 +215,12 @@ mps_transition_ready(struct mps_softc *s { uint32_t reg, state; int error, tries = 0; + int sleep_flags; mps_dprint(sc, MPS_TRACE, "%s\n", __func__); - + /* If we are in attach call, do not sleep */ + sleep_flags = (sc->mps_flags & MPS_FLAGS_ATTACH_DONE) + ? CAN_SLEEP:NO_SLEEP; error = 0; while (tries++ < 5) { reg = mps_regread(sc, MPI2_DOORBELL_OFFSET); @@ -206,7 +231,7 @@ mps_transition_ready(struct mps_softc *s * resetting it. */ if (reg & MPI2_DOORBELL_USED) { - mps_diag_reset(sc); + mps_diag_reset(sc, sleep_flags); DELAY(50000); continue; } @@ -227,10 +252,10 @@ mps_transition_ready(struct mps_softc *s } else if (state == MPI2_IOC_STATE_FAULT) { mps_dprint(sc, MPS_INFO, "IOC in fault state 0x%x\n", state & MPI2_DOORBELL_FAULT_CODE_MASK); - mps_diag_reset(sc); + mps_diag_reset(sc, sleep_flags); } else if (state == MPI2_IOC_STATE_OPERATIONAL) { /* Need to take ownership */ - mps_message_unit_reset(sc); + mps_message_unit_reset(sc, sleep_flags); } else if (state == MPI2_IOC_STATE_RESET) { /* Wait a bit, IOC might be in transition */ mps_dprint(sc, MPS_FAULT, @@ -310,7 +335,7 @@ mps_reinit(struct mps_softc *sc) mps_printf(sc, "%s mask interrupts\n", __func__); mps_mask_intr(sc); - error = mps_diag_reset(sc); + error = mps_diag_reset(sc, CAN_SLEEP); if (error != 0) { panic("%s hard reset failed with error %d\n", __func__, error); @@ -368,19 +393,56 @@ mps_reinit(struct mps_softc *sc) return 0; } -/* Wait for the chip to ACK a word that we've put into its FIFO */ +/* Wait for the chip to ACK a word that we've put into its FIFO + * Wait for seconds. In single loop wait for busy loop + * for 500 microseconds. + * Total is [ 0.5 * (2000 * ) ] in miliseconds. + * */ static int -mps_wait_db_ack(struct mps_softc *sc) +mps_wait_db_ack(struct mps_softc *sc, int timeout, int sleep_flag) { - int retry; - for (retry = 0; retry < MPS_DB_MAX_WAIT; retry++) { - if ((mps_regread(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET) & - MPI2_HIS_SYS2IOC_DB_STATUS) == 0) - return (0); - DELAY(2000); - } + u32 cntdn, count; + u32 int_status; + u32 doorbell; + + count = 0; + cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout; + do { + int_status = mps_regread(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET); + if (!(int_status & MPI2_HIS_SYS2IOC_DB_STATUS)) { + mps_dprint(sc, MPS_INFO, + "%s: successfull count(%d), timeout(%d)\n", + __func__, count, timeout); + return 0; + } else if (int_status & MPI2_HIS_IOC2SYS_DB_STATUS) { + doorbell = mps_regread(sc, MPI2_DOORBELL_OFFSET); + if ((doorbell & MPI2_IOC_STATE_MASK) == + MPI2_IOC_STATE_FAULT) { + mps_dprint(sc, MPS_FAULT, + "fault_state(0x%04x)!\n", doorbell); + return (EFAULT); + } + } else if (int_status == 0xFFFFFFFF) + goto out; + + /* If it can sleep, sleep for 1 milisecond, else busy loop for + * 0.5 milisecond */ + if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) + msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, + "mpsdba", hz/1000); + else if (sleep_flag == CAN_SLEEP) + pause("mpsdba", hz/1000); + else + DELAY(500); + count++; + } while (--cntdn); + + out: + mps_dprint(sc, MPS_FAULT, "%s: failed due to timeout count(%d), " + "int_status(%x)!\n", __func__, count, int_status); return (ETIMEDOUT); + } /* Wait for the chip to signal that the next word in its FIFO can be fetched */ @@ -406,6 +468,10 @@ mps_request_sync(struct mps_softc *sc, v uint32_t *data32; uint16_t *data16; int i, count, ioc_sz, residual; + int sleep_flags = CAN_SLEEP; + + if(curthread->td_pflags & TDP_NOSLEEPING) + sleep_flags = NO_SLEEP; /* Step 1 */ mps_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); @@ -430,7 +496,7 @@ mps_request_sync(struct mps_softc *sc, v return (ENXIO); } mps_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); - if (mps_wait_db_ack(sc) != 0) { + if (mps_wait_db_ack(sc, 5, sleep_flags) != 0) { mps_dprint(sc, MPS_FAULT, "Doorbell handshake failed\n"); return (ENXIO); } @@ -439,8 +505,8 @@ mps_request_sync(struct mps_softc *sc, v /* Clock out the message data synchronously in 32-bit dwords*/ data32 = (uint32_t *)req; for (i = 0; i < count; i++) { - mps_regwrite(sc, MPI2_DOORBELL_OFFSET, data32[i]); - if (mps_wait_db_ack(sc) != 0) { + mps_regwrite(sc, MPI2_DOORBELL_OFFSET, htole32(data32[i])); + if (mps_wait_db_ack(sc, 5, sleep_flags) != 0) { mps_dprint(sc, MPS_FAULT, "Timeout while writing doorbell\n"); return (ENXIO); @@ -525,7 +591,7 @@ mps_request_sync(struct mps_softc *sc, v static void mps_enqueue_request(struct mps_softc *sc, struct mps_command *cm) { - + reply_descriptor rd; mps_dprint(sc, MPS_TRACE, "%s SMID %u cm %p ccb %p\n", __func__, cm->cm_desc.Default.SMID, cm, cm->cm_ccb); @@ -534,11 +600,14 @@ mps_enqueue_request(struct mps_softc *sc if (++sc->io_cmds_active > sc->io_cmds_highwater) sc->io_cmds_highwater++; - + rd.u.low = cm->cm_desc.Words.Low; + rd.u.high = cm->cm_desc.Words.High; + rd.word = htole64(rd.word); + /* TODO-We may need to make below regwrite atomic */ mps_regwrite(sc, MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET, - cm->cm_desc.Words.Low); + rd.u.low); mps_regwrite(sc, MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET, - cm->cm_desc.Words.High); + rd.u.high); } /* @@ -622,21 +691,21 @@ mps_send_iocinit(struct mps_softc *sc) */ init.Function = MPI2_FUNCTION_IOC_INIT; init.WhoInit = MPI2_WHOINIT_HOST_DRIVER; - init.MsgVersion = MPI2_VERSION; - init.HeaderVersion = MPI2_HEADER_VERSION; - init.SystemRequestFrameSize = sc->facts->IOCRequestFrameSize; - init.ReplyDescriptorPostQueueDepth = sc->pqdepth; - init.ReplyFreeQueueDepth = sc->fqdepth; + init.MsgVersion = htole16(MPI2_VERSION); + init.HeaderVersion = htole16(MPI2_HEADER_VERSION); + init.SystemRequestFrameSize = htole16(sc->facts->IOCRequestFrameSize); + init.ReplyDescriptorPostQueueDepth = htole16(sc->pqdepth); + init.ReplyFreeQueueDepth = htole16(sc->fqdepth); init.SenseBufferAddressHigh = 0; init.SystemReplyAddressHigh = 0; init.SystemRequestFrameBaseAddress.High = 0; - init.SystemRequestFrameBaseAddress.Low = (uint32_t)sc->req_busaddr; + init.SystemRequestFrameBaseAddress.Low = htole32((uint32_t)sc->req_busaddr); init.ReplyDescriptorPostQueueAddress.High = 0; - init.ReplyDescriptorPostQueueAddress.Low = (uint32_t)sc->post_busaddr; + init.ReplyDescriptorPostQueueAddress.Low = htole32((uint32_t)sc->post_busaddr); init.ReplyFreeQueueAddress.High = 0; - init.ReplyFreeQueueAddress.Low = (uint32_t)sc->free_busaddr; + init.ReplyFreeQueueAddress.Low = htole32((uint32_t)sc->free_busaddr); init.TimeStamp.High = 0; - init.TimeStamp.Low = (uint32_t)time_uptime; + init.TimeStamp.Low = htole32((uint32_t)time_uptime); error = mps_request_sync(sc, &init, &reply, req_sz, reply_sz, 5); if ((reply.IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) @@ -830,6 +899,12 @@ mps_alloc_requests(struct mps_softc *sc) sc->chains = malloc(sizeof(struct mps_chain) * sc->max_chains, M_MPT2, M_WAITOK | M_ZERO); + if(!sc->chains) { + device_printf(sc->mps_dev, + "Cannot allocate chains memory %s %d\n", + __func__, __LINE__); + return (ENOMEM); + } for (i = 0; i < sc->max_chains; i++) { chain = &sc->chains[i]; chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames + @@ -864,6 +939,11 @@ mps_alloc_requests(struct mps_softc *sc) */ sc->commands = malloc(sizeof(struct mps_command) * sc->num_reqs, M_MPT2, M_WAITOK | M_ZERO); + if(!sc->commands) { + device_printf(sc->mps_dev, "Cannot allocate memory %s %d\n", + __func__, __LINE__); + return (ENOMEM); + } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; cm->cm_req = sc->req_frames + @@ -1056,6 +1136,11 @@ mps_attach(struct mps_softc *sc) sc->facts = malloc(sizeof(MPI2_IOC_FACTS_REPLY), M_MPT2, M_ZERO|M_NOWAIT); + if(!sc->facts) { + device_printf(sc->mps_dev, "Cannot allocate memory %s %d\n", + __func__, __LINE__); + return (ENOMEM); + } if ((error = mps_get_iocfacts(sc, sc->facts)) != 0) return (error); @@ -1083,7 +1168,7 @@ mps_attach(struct mps_softc *sc) */ if ((sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY) == 0) { - mps_diag_reset(sc); + mps_diag_reset(sc, NO_SLEEP); if ((error = mps_transition_ready(sc)) != 0) return (error); } @@ -1163,6 +1248,11 @@ mps_attach(struct mps_softc *sc) sc->pfacts = malloc(sizeof(MPI2_PORT_FACTS_REPLY) * sc->facts->NumberOfPorts, M_MPT2, M_ZERO|M_WAITOK); + if(!sc->pfacts) { + device_printf(sc->mps_dev, "Cannot allocate memory %s %d\n", + __func__, __LINE__); + return (ENOMEM); + } for (i = 0; i < sc->facts->NumberOfPorts; i++) { if ((error = mps_get_portfacts(sc, &sc->pfacts[i], i)) != 0) { mps_printf(sc, "%s failed to get portfacts for port %d\n", @@ -1293,7 +1383,7 @@ mps_log_evt_handler(struct mps_softc *sc static int mps_attach_log(struct mps_softc *sc) { - uint8_t events[16]; + u32 events[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS]; bzero(events, 16); setbit(events, MPI2_EVENT_LOG_DATA); @@ -1441,6 +1531,64 @@ mps_complete_command(struct mps_command } } + +static void +mps_sas_log_info(struct mps_softc *sc , u32 log_info) +{ + union loginfo_type { + u32 loginfo; + struct { + u32 subcode:16; + u32 code:8; + u32 originator:4; + u32 bus_type:4; + } dw; + }; + union loginfo_type sas_loginfo; + char *originator_str = NULL; + + sas_loginfo.loginfo = log_info; + if (sas_loginfo.dw.bus_type != 3 /*SAS*/) + return; + + /* each nexus loss loginfo */ + if (log_info == 0x31170000) + return; + + /* eat the loginfos associated with task aborts */ + if ((log_info == 30050000 || log_info == + 0x31140000 || log_info == 0x31130000)) + return; + + switch (sas_loginfo.dw.originator) { + case 0: + originator_str = "IOP"; + break; + case 1: + originator_str = "PL"; + break; + case 2: + originator_str = "IR"; + break; +} + + mps_dprint(sc, MPS_INFO, "log_info(0x%08x): originator(%s), " + "code(0x%02x), sub_code(0x%04x)\n", log_info, + originator_str, sas_loginfo.dw.code, + sas_loginfo.dw.subcode); +} + +static void +mps_display_reply_info(struct mps_softc *sc, uint8_t *reply) +{ + MPI2DefaultReply_t *mpi_reply; + u16 sc_status; + + mpi_reply = (MPI2DefaultReply_t*)reply; + sc_status = le16toh(mpi_reply->IOCStatus); + if (sc_status & MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) + mps_sas_log_info(sc, le32toh(mpi_reply->IOCLogInfo)); +} void mps_intr(void *data) { @@ -1508,7 +1656,7 @@ mps_intr_locked(void *data) flags = desc->Default.ReplyFlags & MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK; if ((flags == MPI2_RPY_DESCRIPT_FLAGS_UNUSED) - || (desc->Words.High == 0xffffffff)) + || (le32toh(desc->Words.High) == 0xffffffff)) break; /* increment the replypostindex now, so that event handlers @@ -1523,7 +1671,7 @@ mps_intr_locked(void *data) switch (flags) { case MPI2_RPY_DESCRIPT_FLAGS_SCSI_IO_SUCCESS: - cm = &sc->commands[desc->SCSIIOSuccess.SMID]; + cm = &sc->commands[le16toh(desc->SCSIIOSuccess.SMID)]; cm->cm_reply = NULL; break; case MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY: @@ -1559,9 +1707,10 @@ mps_intr_locked(void *data) sc->reply_frames, sc->fqdepth, sc->facts->ReplyFrameSize * 4); printf("%s: baddr %#x,\n", __func__, baddr); + /* LSI-TODO. See Linux Code. Need Gracefull exit*/ panic("Reply address out of range"); } - if (desc->AddressReply.SMID == 0) { + if (le16toh(desc->AddressReply.SMID) == 0) { if (((MPI2_DEFAULT_REPLY *)reply)->Function == MPI2_FUNCTION_DIAG_BUFFER_POST) { /* @@ -1573,7 +1722,7 @@ mps_intr_locked(void *data) */ rel_rep = (MPI2_DIAG_RELEASE_REPLY *)reply; - if (rel_rep->IOCStatus == + if (le16toh(rel_rep->IOCStatus) == MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED) { pBuffer = @@ -1589,10 +1738,10 @@ mps_intr_locked(void *data) (MPI2_EVENT_NOTIFICATION_REPLY *) reply); } else { - cm = &sc->commands[desc->AddressReply.SMID]; + cm = &sc->commands[le16toh(desc->AddressReply.SMID)]; cm->cm_reply = reply; cm->cm_reply_data = - desc->AddressReply.ReplyFrameAddress; + le32toh(desc->AddressReply.ReplyFrameAddress); } break; } @@ -1606,9 +1755,14 @@ mps_intr_locked(void *data) cm = NULL; break; } + - if (cm != NULL) + if (cm != NULL) { + // Print Error reply frame + if (cm->cm_reply) + mps_display_reply_info(sc,cm->cm_reply); mps_complete_command(cm); + } desc->Words.Low = 0xffffffff; desc->Words.High = 0xffffffff; @@ -1631,7 +1785,7 @@ mps_dispatch_event(struct mps_softc *sc, struct mps_event_handle *eh; int event, handled = 0; - event = reply->Event; + event = le16toh(reply->Event); TAILQ_FOREACH(eh, &sc->event_list, eh_list) { if (isset(eh->mask, event)) { eh->callback(sc, data, reply); @@ -1640,7 +1794,7 @@ mps_dispatch_event(struct mps_softc *sc, } if (handled == 0) - device_printf(sc->mps_dev, "Unhandled event 0x%x\n", event); + device_printf(sc->mps_dev, "Unhandled event 0x%x\n", le16toh(event)); /* * This is the only place that the event/reply should be freed. @@ -1671,13 +1825,18 @@ mps_reregister_events_complete(struct mp * suitable for the controller. */ int -mps_register_events(struct mps_softc *sc, uint8_t *mask, +mps_register_events(struct mps_softc *sc, u32 *mask, mps_evt_callback_t *cb, void *data, struct mps_event_handle **handle) { struct mps_event_handle *eh; int error = 0; eh = malloc(sizeof(struct mps_event_handle), M_MPT2, M_WAITOK|M_ZERO); + if(!eh) { + device_printf(sc->mps_dev, "Cannot allocate memory %s %d\n", + __func__, __LINE__); + return (ENOMEM); + } eh->callback = cb; eh->data = data; TAILQ_INSERT_TAIL(&sc->event_list, eh, eh_list); @@ -1690,24 +1849,25 @@ mps_register_events(struct mps_softc *sc int mps_update_events(struct mps_softc *sc, struct mps_event_handle *handle, - uint8_t *mask) + u32 *mask) { MPI2_EVENT_NOTIFICATION_REQUEST *evtreq; MPI2_EVENT_NOTIFICATION_REPLY *reply; struct mps_command *cm; - struct mps_event_handle *eh; int error, i; mps_dprint(sc, MPS_TRACE, "%s\n", __func__); if ((mask != NULL) && (handle != NULL)) - bcopy(mask, &handle->mask[0], 16); - memset(sc->event_mask, 0xff, 16); + bcopy(mask, &handle->mask[0], sizeof(u32) * + MPI2_EVENT_NOTIFY_EVENTMASK_WORDS); + + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + sc->event_mask[i] = -1; + + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + sc->event_mask[i] &= ~handle->mask[i]; - TAILQ_FOREACH(eh, &sc->event_list, eh_list) { - for (i = 0; i < 16; i++) - sc->event_mask[i] &= ~eh->mask[i]; - } if ((cm = mps_alloc_command(sc)) == NULL) return (EBUSY); @@ -1719,10 +1879,13 @@ mps_update_events(struct mps_softc *sc, { u_char fullmask[16]; memset(fullmask, 0x00, 16); - bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); + bcopy(fullmask, &evtreq->EventMasks[0], sizeof(u32) * + MPI2_EVENT_NOTIFY_EVENTMASK_WORDS); } #else - bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, 16); + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + evtreq->EventMasks[i] = + htole32(sc->event_mask[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -1751,10 +1914,11 @@ mps_reregister_events(struct mps_softc * /* first, reregister events */ - memset(sc->event_mask, 0xff, 16); + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + sc->event_mask[i] = -1; TAILQ_FOREACH(eh, &sc->event_list, eh_list) { - for (i = 0; i < 16; i++) + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) sc->event_mask[i] &= ~eh->mask[i]; } @@ -1768,10 +1932,13 @@ mps_reregister_events(struct mps_softc * { u_char fullmask[16]; memset(fullmask, 0x00, 16); - bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); + bcopy(fullmask, &evtreq->EventMasks[0], sizeof(u32) * + MPI2_EVENT_NOTIFY_EVENTMASK_WORDS); } #else - bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, 16); + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + evtreq->EventMasks[i] = + htole32(sc->event_mask[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -1783,13 +1950,12 @@ mps_reregister_events(struct mps_softc * return (error); } -int +void mps_deregister_events(struct mps_softc *sc, struct mps_event_handle *handle) { TAILQ_REMOVE(&sc->event_list, handle, eh_list); free(handle, M_MPT2); - return (mps_update_events(sc, NULL, NULL)); } /* @@ -1819,10 +1985,16 @@ mps_add_chain(struct mps_command *cm) TAILQ_INSERT_TAIL(&cm->cm_chain_list, chain, chain_link); sgc = (MPI2_SGE_CHAIN32 *)&cm->cm_sge->MpiChain; - sgc->Length = space; + sgc->Length = htole16(space); sgc->NextChainOffset = 0; + /* TODO Looks like bug in Setting sgc->Flags. + * sgc->Flags = ( MPI2_SGE_FLAGS_CHAIN_ELEMENT | MPI2_SGE_FLAGS_64_BIT_ADDRESSING | + * MPI2_SGE_FLAGS_SYSTEM_ADDRESS) << MPI2_SGE_FLAGS_SHIFT + * This is fine.. because we are not using simple element. In case of + * MPI2_SGE_CHAIN32, we have seperate Length and Flags feild. + */ sgc->Flags = MPI2_SGE_FLAGS_CHAIN_ELEMENT; - sgc->Address = chain->chain_busaddr; + sgc->Address = htole32(chain->chain_busaddr); cm->cm_sge = (MPI2_SGE_IO_UNION *)&chain->chain->MpiSimple; cm->cm_sglsize = space; @@ -1842,6 +2014,7 @@ mps_push_sge(struct mps_command *cm, voi MPI2_SGE_SIMPLE64 *sge = sgep; int error, type; uint32_t saved_buf_len, saved_address_low, saved_address_high; + u32 sge_flags; type = (tc->Flags & MPI2_SGE_FLAGS_ELEMENT_MASK); @@ -1910,6 +2083,11 @@ mps_push_sge(struct mps_command *cm, voi * understanding the code. */ cm->cm_sglsize -= len; + /* Endian Safe code */ + sge_flags = sge->FlagsLength; + sge->FlagsLength = htole32(sge_flags); + sge->Address.High = htole32(sge->Address.High); + sge->Address.Low = htole32(sge->Address.Low); bcopy(sgep, cm->cm_sge, len); cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); return (mps_add_chain(cm)); @@ -1960,6 +2138,11 @@ mps_push_sge(struct mps_command *cm, voi MPI2_SGE_FLAGS_64_BIT_ADDRESSING) << MPI2_SGE_FLAGS_SHIFT); cm->cm_sglsize -= len; + /* Endian Safe code */ + sge_flags = sge->FlagsLength; + sge->FlagsLength = htole32(sge_flags); + sge->Address.High = htole32(sge->Address.High); + sge->Address.Low = htole32(sge->Address.Low); bcopy(sgep, cm->cm_sge, len); cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); @@ -1985,6 +2168,11 @@ mps_push_sge(struct mps_command *cm, voi } cm->cm_sglsize -= len; + /* Endian Safe code */ + sge_flags = sge->FlagsLength; + sge->FlagsLength = htole32(sge_flags); + sge->Address.High = htole32(sge->Address.High); + sge->Address.Low = htole32(sge->Address.Low); bcopy(sgep, cm->cm_sge, len); cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); return (0); @@ -2004,6 +2192,7 @@ mps_add_dmaseg(struct mps_command *cm, v */ flags |= MPI2_SGE_FLAGS_SIMPLE_ELEMENT | MPI2_SGE_FLAGS_64_BIT_ADDRESSING; + /* Set Endian safe macro in mps_push_sge */ sge.FlagsLength = len | (flags << MPI2_SGE_FLAGS_SHIFT); mps_from_u64(pa, &sge.Address); @@ -2114,11 +2303,11 @@ mps_map_command(struct mps_softc *sc, st /* Add a zero-length element as needed */ if (cm->cm_sge != NULL) { sge = (MPI2_SGE_SIMPLE32 *)cm->cm_sge; - sge->FlagsLength = (MPI2_SGE_FLAGS_LAST_ELEMENT | + sge->FlagsLength = htole32((MPI2_SGE_FLAGS_LAST_ELEMENT | MPI2_SGE_FLAGS_END_OF_BUFFER | MPI2_SGE_FLAGS_END_OF_LIST | MPI2_SGE_FLAGS_SIMPLE_ELEMENT) << - MPI2_SGE_FLAGS_SHIFT; + MPI2_SGE_FLAGS_SHIFT); sge->Address = 0; } mps_enqueue_request(sc, cm); @@ -2135,9 +2324,12 @@ mps_map_command(struct mps_softc *sc, st int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 05:42:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F2041065670; Thu, 28 Jun 2012 05:42:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E48B58FC12; Thu, 28 Jun 2012 05:42:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S5g4HA054954; Thu, 28 Jun 2012 05:42:04 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S5g4Bw054952; Thu, 28 Jun 2012 05:42:04 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201206280542.q5S5g4Bw054952@svn.freebsd.org> From: Alan Cox Date: Thu, 28 Jun 2012 05:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237684 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 05:42:05 -0000 Author: alc Date: Thu Jun 28 05:42:04 2012 New Revision: 237684 URL: http://svn.freebsd.org/changeset/base/237684 Log: Optimize pmap_pv_demote_pde(). Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jun 28 03:48:54 2012 (r237683) +++ head/sys/amd64/amd64/pmap.c Thu Jun 28 05:42:04 2012 (r237684) @@ -2469,11 +2469,14 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse struct rwlock **lockp) { struct md_page *pvh; + struct pv_chunk *pc; pv_entry_t pv; vm_offset_t va_last; vm_page_t m; + int bit, field; rw_assert(&pvh_global_lock, RA_LOCKED); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_demote_pde: pa is not 2mpage aligned")); reserve_pv_entries(pmap, NPTEPG - 1, lockp); @@ -2481,7 +2484,8 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse /* * Transfer the 2mpage's pv entry for this mapping to the first - * page's pv list. + * page's pv list. Once this transfer begins, the pv list lock + * must not be released until the last pv entry is reinstantiated. */ pvh = pa_to_pvh(pa); va = trunc_2mpage(va); @@ -2490,16 +2494,37 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse m = PHYS_TO_VM_PAGE(pa); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); /* Instantiate the remaining NPTEPG - 1 pv entries. */ + PV_STAT(atomic_add_long(&pv_entry_allocs, NPTEPG - 1)); va_last = va + NBPDR - PAGE_SIZE; - do { - m++; - KASSERT((m->oflags & VPO_UNMANAGED) == 0, - ("pmap_pv_demote_pde: page %p is not managed", m)); - va += PAGE_SIZE; - pv = get_pv_entry(pmap, TRUE); - pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); - } while (va < va_last); + for (;;) { + pc = TAILQ_FIRST(&pmap->pm_pvchunk); + KASSERT(pc->pc_map[0] != 0 || pc->pc_map[1] != 0 || + pc->pc_map[2] != 0, ("pmap_pv_demote_pde: missing spare")); + for (field = 0; field < _NPCM; field++) { + while (pc->pc_map[field]) { + bit = bsfq(pc->pc_map[field]); + pc->pc_map[field] &= ~(1ul << bit); + pv = &pc->pc_pventry[field * 64 + bit]; + va += PAGE_SIZE; + pv->pv_va = va; + m++; + KASSERT((m->oflags & VPO_UNMANAGED) == 0, + ("pmap_pv_demote_pde: page %p is not managed", m)); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + if (va == va_last) + goto out; + } + } + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + } +out: + if (pc->pc_map[0] == 0 && pc->pc_map[1] == 0 && pc->pc_map[2] == 0) { + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + } + PV_STAT(atomic_add_long(&pv_entry_count, NPTEPG - 1)); + PV_STAT(atomic_subtract_int(&pv_entry_spare, NPTEPG - 1)); } /* From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 06:49:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B916F106566C; Thu, 28 Jun 2012 06:49:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A463D8FC12; Thu, 28 Jun 2012 06:49:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S6n4va057840; Thu, 28 Jun 2012 06:49:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S6n4OK057838; Thu, 28 Jun 2012 06:49:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206280649.q5S6n4OK057838@svn.freebsd.org> From: Warner Losh Date: Thu, 28 Jun 2012 06:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237687 - head/sys/mips/cavium X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 06:49:05 -0000 Author: imp Date: Thu Jun 28 06:49:04 2012 New Revision: 237687 URL: http://svn.freebsd.org/changeset/base/237687 Log: octeon_uart_class was removed some time ago everywhere but here. Modified: head/sys/mips/cavium/uart_bus_octeonusart.c Modified: head/sys/mips/cavium/uart_bus_octeonusart.c ============================================================================== --- head/sys/mips/cavium/uart_bus_octeonusart.c Thu Jun 28 06:13:52 2012 (r237686) +++ head/sys/mips/cavium/uart_bus_octeonusart.c Thu Jun 28 06:49:04 2012 (r237687) @@ -61,11 +61,8 @@ __FBSDID("$FreeBSD$"); extern struct uart_class uart_oct16550_class; - static int uart_octeon_probe(device_t dev); -extern struct uart_class octeon_uart_class; - static device_method_t uart_octeon_methods[] = { /* Device interface */ DEVMETHOD(device_probe, uart_octeon_probe), From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 07:01:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D2C8106566B; Thu, 28 Jun 2012 07:01:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8098FC0C; Thu, 28 Jun 2012 07:01:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S71nta058438; Thu, 28 Jun 2012 07:01:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S71nQk058436; Thu, 28 Jun 2012 07:01:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206280701.q5S71nQk058436@svn.freebsd.org> From: Warner Losh Date: Thu, 28 Jun 2012 07:01: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: r237689 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 07:01:49 -0000 Author: imp Date: Thu Jun 28 07:01:48 2012 New Revision: 237689 URL: http://svn.freebsd.org/changeset/base/237689 Log: Add a sysctl to set the cdrom timeout. Data recovery operations from a CD or DVD drive with a damaged disc often benefit from a shorter timeout. Also, when retries are set to 0, an application is expecting errors and recovering them so do not print the error into the log. The number of expected errors can literally be in the hundreds of thousands which significantly slows data recovery. Reviewed by: ken@ (but quite some time ago). Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Thu Jun 28 06:58:12 2012 (r237688) +++ head/sys/cam/scsi/scsi_cd.c Thu Jun 28 07:01:48 2012 (r237689) @@ -293,6 +293,9 @@ PERIPHDRIVER_DECLARE(cd, cddriver); #ifndef CD_DEFAULT_RETRY #define CD_DEFAULT_RETRY 4 #endif +#ifndef CD_DEFAULT_TIMEOUT +#define CD_DEFAULT_TIMEOUT 30000 +#endif #ifndef CHANGER_MIN_BUSY_SECONDS #define CHANGER_MIN_BUSY_SECONDS 5 #endif @@ -301,6 +304,7 @@ PERIPHDRIVER_DECLARE(cd, cddriver); #endif static int cd_retry_count = CD_DEFAULT_RETRY; +static int cd_timeout = CD_DEFAULT_TIMEOUT; static int changer_min_busy_seconds = CHANGER_MIN_BUSY_SECONDS; static int changer_max_busy_seconds = CHANGER_MAX_BUSY_SECONDS; @@ -310,6 +314,9 @@ static SYSCTL_NODE(_kern_cam_cd, OID_AUT SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RW, &cd_retry_count, 0, "Normal I/O retry count"); TUNABLE_INT("kern.cam.cd.retry_count", &cd_retry_count); +SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RW, + &cd_timeout, 0, "Timeout, in us, for read operations"); +TUNABLE_INT("kern.cam.cd.timeout", &cd_timeout); SYSCTL_INT(_kern_cam_cd_changer, OID_AUTO, min_busy_seconds, CTLFLAG_RW, &changer_min_busy_seconds, 0, "Minimum changer scheduling quantum"); TUNABLE_INT("kern.cam.cd.changer.min_busy_seconds", &changer_min_busy_seconds); @@ -1509,8 +1516,9 @@ cdstart(struct cam_periph *periph, union bp->bio_bcount / softc->params.blksize, /* data_ptr */ bp->bio_data, /* dxfer_len */ bp->bio_bcount, - /* sense_len */ SSD_FULL_SIZE, - /* timeout */ 30000); + /* sense_len */ cd_retry_count ? + SSD_FULL_SIZE : SF_NO_PRINT, + /* timeout */ cd_timeout); /* Use READ CD command for audio tracks. */ if (softc->params.blksize == 2352) { start_ccb->csio.cdb_io.cdb_bytes[0] = READ_CD; From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 07:08:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A52E106566C; Thu, 28 Jun 2012 07:08:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 602B38FC15; Thu, 28 Jun 2012 07:08:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S78nqK058814; Thu, 28 Jun 2012 07:08:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S78nZR058799; Thu, 28 Jun 2012 07:08:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206280708.q5S78nZR058799@svn.freebsd.org> From: Xin LI Date: Thu, 28 Jun 2012 07:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237691 - in stable/9: lib/libstand lib/libz lib/libz/contrib lib/libz/contrib/asm686 lib/libz/contrib/gcc_gvmat64 lib/libz/doc lib/libz/test sys/boot/userboot/libstand usr.bin/minigzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 07:08:49 -0000 Author: delphij Date: Thu Jun 28 07:08:48 2012 New Revision: 237691 URL: http://svn.freebsd.org/changeset/base/237691 Log: MFC r237410: zlib 1.2.7. Added: stable/9/lib/libz/test/ - copied from r237677, head/lib/libz/test/ Deleted: stable/9/lib/libz/example.c stable/9/lib/libz/minigzip.c Modified: stable/9/lib/libstand/Makefile stable/9/lib/libz/ChangeLog stable/9/lib/libz/FAQ stable/9/lib/libz/FREEBSD-upgrade (contents, props changed) stable/9/lib/libz/Makefile (contents, props changed) stable/9/lib/libz/README stable/9/lib/libz/Symbol.map (contents, props changed) stable/9/lib/libz/Versions.def (contents, props changed) stable/9/lib/libz/adler32.c stable/9/lib/libz/contrib/asm686/match.S (contents, props changed) stable/9/lib/libz/crc32.c stable/9/lib/libz/crc32.h stable/9/lib/libz/deflate.c stable/9/lib/libz/deflate.h stable/9/lib/libz/doc/algorithm.txt (contents, props changed) stable/9/lib/libz/gzguts.h (contents, props changed) stable/9/lib/libz/gzlib.c stable/9/lib/libz/gzread.c stable/9/lib/libz/gzwrite.c stable/9/lib/libz/infback.c stable/9/lib/libz/inffixed.h stable/9/lib/libz/inflate.c stable/9/lib/libz/inftrees.c stable/9/lib/libz/trees.c stable/9/lib/libz/zconf.h stable/9/lib/libz/zlib.3 stable/9/lib/libz/zlib.h stable/9/lib/libz/zopen.c (contents, props changed) stable/9/lib/libz/zutil.c stable/9/lib/libz/zutil.h stable/9/sys/boot/userboot/libstand/Makefile stable/9/usr.bin/minigzip/Makefile Directory Properties: stable/9/lib/libstand/ (props changed) stable/9/lib/libz/ (props changed) stable/9/lib/libz/contrib/ (props changed) stable/9/lib/libz/contrib/README.contrib (props changed) stable/9/lib/libz/contrib/asm686/ (props changed) stable/9/lib/libz/contrib/asm686/README.686 (props changed) stable/9/lib/libz/contrib/gcc_gvmat64/ (props changed) stable/9/lib/libz/contrib/gcc_gvmat64/gvmat64.S (props changed) stable/9/lib/libz/doc/ (props changed) stable/9/lib/libz/doc/rfc1950.txt (props changed) stable/9/lib/libz/doc/rfc1951.txt (props changed) stable/9/lib/libz/doc/rfc1952.txt (props changed) stable/9/lib/libz/doc/txtvsbin.txt (props changed) stable/9/lib/libz/gzclose.c (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/usr.bin/minigzip/ (props changed) Modified: stable/9/lib/libstand/Makefile ============================================================================== --- stable/9/lib/libstand/Makefile Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libstand/Makefile Thu Jun 28 07:08:48 2012 (r237691) @@ -38,7 +38,7 @@ CFLAGS+= -msoft-float -D_STANDALONE .endif # standalone components and stuff we have modified locally -SRCS+= zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ +SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \ sbrk.c twiddle.c zalloc.c zalloc_malloc.c @@ -119,23 +119,29 @@ libstand_bzlib_private.h: bzlib_private. # decompression functionality from libz .PATH: ${.CURDIR}/../libz CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz -SRCS+= adler32.c crc32.c libstand_zutil.h +SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h .for file in infback.c inffast.c inflate.c inftrees.c zutil.c SRCS+= _${file} CLEANFILES+= _${file} _${file}: ${file} - sed "s|zutil\.h|libstand_zutil.h|" ${.ALLSRC} > ${.TARGET} + sed -e "s|zutil\.h|libstand_zutil.h|" \ + -e "s|gzguts\.h|libstand_gzguts.h|" \ + ${.ALLSRC} > ${.TARGET} .endfor # depend on stand.h being able to be included multiple times -CLEANFILES+= libstand_zutil.h -libstand_zutil.h: zutil.h - sed -e 's||"stand.h"|' \ +.for file in zutil.h gzguts.h +CLEANFILES+= libstand_${file} +libstand_${file}: ${file} + sed -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ -e 's||"stand.h"|' \ ${.ALLSRC} > ${.TARGET} +.endfor # io routines SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ Modified: stable/9/lib/libz/ChangeLog ============================================================================== --- stable/9/lib/libz/ChangeLog Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/ChangeLog Thu Jun 28 07:08:48 2012 (r237691) @@ -1,12 +1,213 @@ ChangeLog file for zlib +Changes in 1.2.7 (2 May 2012) +- Replace use of memmove() with a simple copy for portability +- Test for existence of strerror +- Restore gzgetc_ for backward compatibility with 1.2.6 +- Fix build with non-GNU make on Solaris +- Require gcc 4.0 or later on Mac OS X to use the hidden attribute +- Include unistd.h for Watcom C +- Use __WATCOMC__ instead of __WATCOM__ +- Do not use the visibility attribute if NO_VIZ defined +- Improve the detection of no hidden visibility attribute +- Avoid using __int64 for gcc or solo compilation +- Cast to char * in gzprintf to avoid warnings [Zinser] +- Fix make_vms.com for VAX [Zinser] +- Don't use library or built-in byte swaps +- Simplify test and use of gcc hidden attribute +- Fix bug in gzclose_w() when gzwrite() fails to allocate memory +- Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen() +- Fix bug in test/minigzip.c for configure --solo +- Fix contrib/vstudio project link errors [Mohanathas] +- Add ability to choose the builder in make_vms.com [Schweda] +- Add DESTDIR support to mingw32 win32/Makefile.gcc +- Fix comments in win32/Makefile.gcc for proper usage +- Allow overriding the default install locations for cmake +- Generate and install the pkg-config file with cmake +- Build both a static and a shared version of zlib with cmake +- Include version symbols for cmake builds +- If using cmake with MSVC, add the source directory to the includes +- Remove unneeded EXTRA_CFLAGS from win32/Makefile.gcc [Truta] +- Move obsolete emx makefile to old [Truta] +- Allow the use of -Wundef when compiling or using zlib +- Avoid the use of the -u option with mktemp +- Improve inflate() documentation on the use of Z_FINISH +- Recognize clang as gcc +- Add gzopen_w() in Windows for wide character path names +- Rename zconf.h in CMakeLists.txt to move it out of the way +- Add source directory in CMakeLists.txt for building examples +- Look in build directory for zlib.pc in CMakeLists.txt +- Remove gzflags from zlibvc.def in vc9 and vc10 +- Fix contrib/minizip compilation in the MinGW environment +- Update ./configure for Solaris, support --64 [Mooney] +- Remove -R. from Solaris shared build (possible security issue) +- Avoid race condition for parallel make (-j) running example +- Fix type mismatch between get_crc_table() and crc_table +- Fix parsing of version with "-" in CMakeLists.txt [Snider, Ziegler] +- Fix the path to zlib.map in CMakeLists.txt +- Force the native libtool in Mac OS X to avoid GNU libtool [Beebe] +- Add instructions to win32/Makefile.gcc for shared install [Torri] + +Changes in 1.2.6.1 (12 Feb 2012) +- Avoid the use of the Objective-C reserved name "id" +- Include io.h in gzguts.h for Microsoft compilers +- Fix problem with ./configure --prefix and gzgetc macro +- Include gz_header definition when compiling zlib solo +- Put gzflags() functionality back in zutil.c +- Avoid library header include in crc32.c for Z_SOLO +- Use name in GCC_CLASSIC as C compiler for coverage testing, if set +- Minor cleanup in contrib/minizip/zip.c [Vollant] +- Update make_vms.com [Zinser] +- Remove unnecessary gzgetc_ function +- Use optimized byte swap operations for Microsoft and GNU [Snyder] +- Fix minor typo in zlib.h comments [Rzesniowiecki] + +Changes in 1.2.6 (29 Jan 2012) +- Update the Pascal interface in contrib/pascal +- Fix function numbers for gzgetc_ in zlibvc.def files +- Fix configure.ac for contrib/minizip [Schiffer] +- Fix large-entry detection in minizip on 64-bit systems [Schiffer] +- Have ./configure use the compiler return code for error indication +- Fix CMakeLists.txt for cross compilation [McClure] +- Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes] +- Fix compilation of contrib/minizip on FreeBSD [Marquez] +- Correct suggested usages in win32/Makefile.msc [Shachar, Horvath] +- Include io.h for Turbo C / Borland C on all platforms [Truta] +- Make version explicit in contrib/minizip/configure.ac [Bosmans] +- Avoid warning for no encryption in contrib/minizip/zip.c [Vollant] +- Minor cleanup up contrib/minizip/unzip.c [Vollant] +- Fix bug when compiling minizip with C++ [Vollant] +- Protect for long name and extra fields in contrib/minizip [Vollant] +- Avoid some warnings in contrib/minizip [Vollant] +- Add -I../.. -L../.. to CFLAGS for minizip and miniunzip +- Add missing libs to minizip linker command +- Add support for VPATH builds in contrib/minizip +- Add an --enable-demos option to contrib/minizip/configure +- Add the generation of configure.log by ./configure +- Exit when required parameters not provided to win32/Makefile.gcc +- Have gzputc return the character written instead of the argument +- Use the -m option on ldconfig for BSD systems [Tobias] +- Correct in zlib.map when deflateResetKeep was added + +Changes in 1.2.5.3 (15 Jan 2012) +- Restore gzgetc function for binary compatibility +- Do not use _lseeki64 under Borland C++ [Truta] +- Update win32/Makefile.msc to build test/*.c [Truta] +- Remove old/visualc6 given CMakefile and other alternatives +- Update AS400 build files and documentation [Monnerat] +- Update win32/Makefile.gcc to build test/*.c [Truta] +- Permit stronger flushes after Z_BLOCK flushes +- Avoid extraneous empty blocks when doing empty flushes +- Permit Z_NULL arguments to deflatePending +- Allow deflatePrime() to insert bits in the middle of a stream +- Remove second empty static block for Z_PARTIAL_FLUSH +- Write out all of the available bits when using Z_BLOCK +- Insert the first two strings in the hash table after a flush + +Changes in 1.2.5.2 (17 Dec 2011) +- fix ld error: unable to find version dependency 'ZLIB_1.2.5' +- use relative symlinks for shared libs +- Avoid searching past window for Z_RLE strategy +- Assure that high-water mark initialization is always applied in deflate +- Add assertions to fill_window() in deflate.c to match comments +- Update python link in README +- Correct spelling error in gzread.c +- Fix bug in gzgets() for a concatenated empty gzip stream +- Correct error in comment for gz_make() +- Change gzread() and related to ignore junk after gzip streams +- Allow gzread() and related to continue after gzclearerr() +- Allow gzrewind() and gzseek() after a premature end-of-file +- Simplify gzseek() now that raw after gzip is ignored +- Change gzgetc() to a macro for speed (~40% speedup in testing) +- Fix gzclose() to return the actual error last encountered +- Always add large file support for windows +- Include zconf.h for windows large file support +- Include zconf.h.cmakein for windows large file support +- Update zconf.h.cmakein on make distclean +- Merge vestigial vsnprintf determination from zutil.h to gzguts.h +- Clarify how gzopen() appends in zlib.h comments +- Correct documentation of gzdirect() since junk at end now ignored +- Add a transparent write mode to gzopen() when 'T' is in the mode +- Update python link in zlib man page +- Get inffixed.h and MAKEFIXED result to match +- Add a ./config --solo option to make zlib subset with no libary use +- Add undocumented inflateResetKeep() function for CAB file decoding +- Add --cover option to ./configure for gcc coverage testing +- Add #define ZLIB_CONST option to use const in the z_stream interface +- Add comment to gzdopen() in zlib.h to use dup() when using fileno() +- Note behavior of uncompress() to provide as much data as it can +- Add files in contrib/minizip to aid in building libminizip +- Split off AR options in Makefile.in and configure +- Change ON macro to Z_ARG to avoid application conflicts +- Facilitate compilation with Borland C++ for pragmas and vsnprintf +- Include io.h for Turbo C / Borland C++ +- Move example.c and minigzip.c to test/ +- Simplify incomplete code table filling in inflate_table() +- Remove code from inflate.c and infback.c that is impossible to execute +- Test the inflate code with full coverage +- Allow deflateSetDictionary, inflateSetDictionary at any time (in raw) +- Add deflateResetKeep and fix inflateResetKeep to retain dictionary +- Fix gzwrite.c to accommodate reduced memory zlib compilation +- Have inflate() with Z_FINISH avoid the allocation of a window +- Do not set strm->adler when doing raw inflate +- Fix gzeof() to behave just like feof() when read is not past end of file +- Fix bug in gzread.c when end-of-file is reached +- Avoid use of Z_BUF_ERROR in gz* functions except for premature EOF +- Document gzread() capability to read concurrently written files +- Remove hard-coding of resource compiler in CMakeLists.txt [Blammo] + +Changes in 1.2.5.1 (10 Sep 2011) +- Update FAQ entry on shared builds (#13) +- Avoid symbolic argument to chmod in Makefile.in +- Fix bug and add consts in contrib/puff [Oberhumer] +- Update contrib/puff/zeros.raw test file to have all block types +- Add full coverage test for puff in contrib/puff/Makefile +- Fix static-only-build install in Makefile.in +- Fix bug in unzGetCurrentFileInfo() in contrib/minizip [Kuno] +- Add libz.a dependency to shared in Makefile.in for parallel builds +- Spell out "number" (instead of "nb") in zlib.h for total_in, total_out +- Replace $(...) with `...` in configure for non-bash sh [Bowler] +- Add darwin* to Darwin* and solaris* to SunOS\ 5* in configure [Groffen] +- Add solaris* to Linux* in configure to allow gcc use [Groffen] +- Add *bsd* to Linux* case in configure [Bar-Lev] +- Add inffast.obj to dependencies in win32/Makefile.msc +- Correct spelling error in deflate.h [Kohler] +- Change libzdll.a again to libz.dll.a (!) in win32/Makefile.gcc +- Add test to configure for GNU C looking for gcc in output of $cc -v +- Add zlib.pc generation to win32/Makefile.gcc [Weigelt] +- Fix bug in zlib.h for _FILE_OFFSET_BITS set and _LARGEFILE64_SOURCE not +- Add comment in zlib.h that adler32_combine with len2 < 0 makes no sense +- Make NO_DIVIDE option in adler32.c much faster (thanks to John Reiser) +- Make stronger test in zconf.h to include unistd.h for LFS +- Apply Darwin patches for 64-bit file offsets to contrib/minizip [Slack] +- Fix zlib.h LFS support when Z_PREFIX used +- Add updated as400 support (removed from old) [Monnerat] +- Avoid deflate sensitivity to volatile input data +- Avoid division in adler32_combine for NO_DIVIDE +- Clarify the use of Z_FINISH with deflateBound() amount of space +- Set binary for output file in puff.c +- Use u4 type for crc_table to avoid conversion warnings +- Apply casts in zlib.h to avoid conversion warnings +- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller] +- Improve inflateSync() documentation to note indeterminancy +- Add deflatePending() function to return the amount of pending output +- Correct the spelling of "specification" in FAQ [Randers-Pehrson] +- Add a check in configure for stdarg.h, use for gzprintf() +- Check that pointers fit in ints when gzprint() compiled old style +- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler] +- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt] +- Add debug records in assmebler code [Londer] +- Update RFC references to use http://tools.ietf.org/html/... [Li] +- Add --archs option, use of libtool to configure for Mac OS X [Borstel] + Changes in 1.2.5 (19 Apr 2010) - Disable visibility attribute in win32/Makefile.gcc [Bar-Lev] - Default to libdir as sharedlibdir in configure [Nieder] - Update copyright dates on modified source files - Update trees.c to be able to generate modified trees.h - Exit configure for MinGW, suggesting win32/Makefile.gcc +- Check for NULL path in gz_open [Homurlu] Changes in 1.2.4.5 (18 Apr 2010) - Set sharedlibdir in configure [Torok] @@ -261,7 +462,7 @@ Changes in 1.2.3.4 (21 Dec 2009) - Clear bytes after deflate lookahead to avoid use of uninitialized data - Change a limit in inftrees.c to be more transparent to Coverity Prevent - Update win32/zlib.def with exported symbols from zlib.h -- Correct spelling error in zlib.h [Willem] +- Correct spelling errors in zlib.h [Willem, Sobrado] - Allow Z_BLOCK for deflate() to force a new block - Allow negative bits in inflatePrime() to delete existing bit buffer - Add Z_TREES flush option to inflate() to return at end of trees Modified: stable/9/lib/libz/FAQ ============================================================================== --- stable/9/lib/libz/FAQ Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/FAQ Thu Jun 28 07:08:48 2012 (r237691) @@ -44,8 +44,8 @@ The lastest zlib FAQ is at http://zlib.n 6. Where's the zlib documentation (man pages, etc.)? - It's in zlib.h . Examples of zlib usage are in the files example.c and - minigzip.c, with more in examples/ . + It's in zlib.h . Examples of zlib usage are in the files test/example.c + and test/minigzip.c, with more in examples/ . 7. Why don't you use GNU autoconf or libtool or ...? @@ -84,8 +84,10 @@ The lastest zlib FAQ is at http://zlib.n 13. How can I make a Unix shared library? - make clean - ./configure -s + By default a shared (and a static) library is built for Unix. So: + + make distclean + ./configure make 14. How do I install a shared zlib library on Unix? @@ -325,7 +327,7 @@ The lastest zlib FAQ is at http://zlib.n correctly points to the zlib specification in RFC 1950 for the "deflate" transfer encoding, there have been reports of servers and browsers that incorrectly produce or expect raw deflate data per the deflate - specficiation in RFC 1951, most notably Microsoft. So even though the + specification in RFC 1951, most notably Microsoft. So even though the "deflate" transfer encoding using the zlib format would be the more efficient approach (and in fact exactly what the zlib format was designed for), using the "gzip" transfer encoding is probably more reliable due to Modified: stable/9/lib/libz/FREEBSD-upgrade ============================================================================== --- stable/9/lib/libz/FREEBSD-upgrade Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/FREEBSD-upgrade Thu Jun 28 07:08:48 2012 (r237691) @@ -1,4 +1,4 @@ -$FreeBSD$ +$FreeBSD: stable/9/lib/libz/FREEBSD-upgrade 146082 2005-05-11 03:50:50Z kientzle $ ZLib 1.2.2 Modified: stable/9/lib/libz/Makefile ============================================================================== --- stable/9/lib/libz/Makefile Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/Makefile Thu Jun 28 07:08:48 2012 (r237691) @@ -1,5 +1,5 @@ # -# $FreeBSD$ +# $FreeBSD: stable/9/lib/libz/Makefile 232930 2012-03-13 18:39:57Z dim $ # LIB= z @@ -35,12 +35,12 @@ SRCS+= uncompr.c SRCS+= zopen.c SRCS+= zutil.c -.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*} -.PATH: ${.CURDIR}/contrib/asm686 -SRCS+= match.S -CFLAGS+= -DASMV -DNO_UNDERLINE -ACFLAGS+= -Wa,--noexecstack -.endif +#.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*} +#.PATH: ${.CURDIR}/contrib/asm686 +#SRCS+= match.S +#CFLAGS+= -DASMV -DNO_UNDERLINE +#ACFLAGS+= -Wa,--noexecstack +#.endif #.if ${MACHINE_ARCH} == "amd64" #.PATH: ${.CURDIR}/contrib/gcc_gvmat64 Modified: stable/9/lib/libz/README ============================================================================== --- stable/9/lib/libz/README Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/README Thu Jun 28 07:08:48 2012 (r237691) @@ -1,22 +1,22 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.5 is a general purpose data compression library. All the code is +zlib 1.2.7 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files -http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) -and rfc1952.txt (gzip format). +http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and +rfc1952 (gzip format). All functions of the compression library are documented in the file zlib.h (volunteer to write man pages welcome, contact zlib@gzip.org). A usage example -of the library is given in the file example.c which also tests that the library -is working correctly. Another example is given in the file minigzip.c. The -compression library itself is composed of all source files except example.c and -minigzip.c. +of the library is given in the file test/example.c which also tests that +the library is working correctly. Another example is given in the file +test/minigzip.c. The compression library itself is composed of all source +files in the root directory. To compile all files and run the test program, follow the instructions given at the top of Makefile.in. In short "./configure; make test", and if that goes -well, "make install" should work for most flavors of Unix. For Windows, use one -of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use +well, "make install" should work for most flavors of Unix. For Windows, use +one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use make_vms.com. Questions about zlib should be sent to , or to Gilles Vollant @@ -31,7 +31,7 @@ Mark Nelson wrote an ar issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.5 are documented in the file ChangeLog. +The changes made in version 1.2.7 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . @@ -44,7 +44,7 @@ http://search.cpan.org/~pmqs/IO-Compress A Python interface to zlib written by A.M. Kuchling is available in Python 1.5 and later versions, see -http://www.python.org/doc/lib/module-zlib.html . +http://docs.python.org/library/zlib.html . zlib is built into tcl: http://wiki.tcl.tk/4610 . @@ -84,7 +84,7 @@ Acknowledgments: Copyright notice: - (C) 1995-2010 Jean-loup Gailly and Mark Adler + (C) 1995-2012 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages Modified: stable/9/lib/libz/Symbol.map ============================================================================== --- stable/9/lib/libz/Symbol.map Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/Symbol.map Thu Jun 28 07:08:48 2012 (r237691) @@ -1,7 +1,14 @@ /* - * $FreeBSD$ + * $FreeBSD: stable/9/lib/libz/Symbol.map 206709 2010-04-16 20:07:24Z delphij $ */ +ZLIB_1.2.7.0 { + deflatePending; + deflateResetKeep; + gzgetc_; + inflateResetKeep; +}; + ZLIB_1.2.4.0 { adler32; adler32_combine; Modified: stable/9/lib/libz/Versions.def ============================================================================== --- stable/9/lib/libz/Versions.def Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/Versions.def Thu Jun 28 07:08:48 2012 (r237691) @@ -1,8 +1,11 @@ -# $FreeBSD$ +# $FreeBSD: stable/9/lib/libz/Versions.def 205486 2010-03-22 22:12:27Z delphij $ ZLIB_1.2.4.0 { }; +ZLIB_1.2.7.0 { +} ZLIB_1.2.4.0; + FBSD_1.2 { } ZLIB_1.2.4.0; Modified: stable/9/lib/libz/adler32.c ============================================================================== --- stable/9/lib/libz/adler32.c Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/adler32.c Thu Jun 28 07:08:48 2012 (r237691) @@ -1,5 +1,5 @@ /* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2007 Mark Adler + * Copyright (C) 1995-2011 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,9 +9,9 @@ #define local static -local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2); +local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); -#define BASE 65521UL /* largest prime smaller than 65536 */ +#define BASE 65521 /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ @@ -21,39 +21,44 @@ local uLong adler32_combine_(uLong adler #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); #define DO16(buf) DO8(buf,0); DO8(buf,8); -/* use NO_DIVIDE if your processor does not do division in hardware */ +/* use NO_DIVIDE if your processor does not do division in hardware -- + try it both ways to see which is faster */ #ifdef NO_DIVIDE -# define MOD(a) \ +/* note that this assumes BASE is 65521, where 65536 % 65521 == 15 + (thank you to John Reiser for pointing this out) */ +# define CHOP(a) \ + do { \ + unsigned long tmp = a >> 16; \ + a &= 0xffffUL; \ + a += (tmp << 4) - tmp; \ + } while (0) +# define MOD28(a) \ do { \ - if (a >= (BASE << 16)) a -= (BASE << 16); \ - if (a >= (BASE << 15)) a -= (BASE << 15); \ - if (a >= (BASE << 14)) a -= (BASE << 14); \ - if (a >= (BASE << 13)) a -= (BASE << 13); \ - if (a >= (BASE << 12)) a -= (BASE << 12); \ - if (a >= (BASE << 11)) a -= (BASE << 11); \ - if (a >= (BASE << 10)) a -= (BASE << 10); \ - if (a >= (BASE << 9)) a -= (BASE << 9); \ - if (a >= (BASE << 8)) a -= (BASE << 8); \ - if (a >= (BASE << 7)) a -= (BASE << 7); \ - if (a >= (BASE << 6)) a -= (BASE << 6); \ - if (a >= (BASE << 5)) a -= (BASE << 5); \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ + CHOP(a); \ if (a >= BASE) a -= BASE; \ } while (0) -# define MOD4(a) \ +# define MOD(a) \ do { \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ + CHOP(a); \ + MOD28(a); \ + } while (0) +# define MOD63(a) \ + do { /* this assumes a is not negative */ \ + z_off64_t tmp = a >> 32; \ + a &= 0xffffffffL; \ + a += (tmp << 8) - (tmp << 5) + tmp; \ + tmp = a >> 16; \ + a &= 0xffffL; \ + a += (tmp << 4) - tmp; \ + tmp = a >> 16; \ + a &= 0xffffL; \ + a += (tmp << 4) - tmp; \ if (a >= BASE) a -= BASE; \ } while (0) #else # define MOD(a) a %= BASE -# define MOD4(a) a %= BASE +# define MOD28(a) a %= BASE +# define MOD63(a) a %= BASE #endif /* ========================================================================= */ @@ -92,7 +97,7 @@ uLong ZEXPORT adler32(adler, buf, len) } if (adler >= BASE) adler -= BASE; - MOD4(sum2); /* only added so many BASE's */ + MOD28(sum2); /* only added so many BASE's */ return adler | (sum2 << 16); } @@ -137,8 +142,13 @@ local uLong adler32_combine_(adler1, adl unsigned long sum2; unsigned rem; + /* for negative len, return invalid adler32 as a clue for debugging */ + if (len2 < 0) + return 0xffffffffUL; + /* the derivation of this formula is left as an exercise for the reader */ - rem = (unsigned)(len2 % BASE); + MOD63(len2); /* assumes len2 >= 0 */ + rem = (unsigned)len2; sum1 = adler1 & 0xffff; sum2 = rem * sum1; MOD(sum2); Modified: stable/9/lib/libz/contrib/asm686/match.S ============================================================================== --- stable/9/lib/libz/contrib/asm686/match.S Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/contrib/asm686/match.S Thu Jun 28 07:08:48 2012 (r237691) @@ -83,17 +83,25 @@ .text /* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ +.cfi_sections .debug_frame longest_match: +.cfi_startproc /* Save registers that the compiler may be using, and adjust %esp to */ /* make room for our stack frame. */ pushl %ebp + .cfi_def_cfa_offset 8 + .cfi_offset ebp, -8 pushl %edi + .cfi_def_cfa_offset 12 pushl %esi + .cfi_def_cfa_offset 16 pushl %ebx + .cfi_def_cfa_offset 20 subl $LocalVarsSize, %esp + .cfi_def_cfa_offset LocalVarsSize+20 /* Retrieve the function arguments. %ecx will hold cur_match */ /* throughout the entire function. %edx will hold the pointer to the */ @@ -108,7 +116,7 @@ longest_match: /* if (s->prev_length >= s->good_match) { */ /* chain_length >>= 2; */ /* } */ - + movl dsPrevLen(%edx), %eax movl dsGoodMatch(%edx), %ebx cmpl %ebx, %eax @@ -336,8 +344,14 @@ LookaheadRet: /* Restore the stack and return from whence we came. */ addl $LocalVarsSize, %esp + .cfi_def_cfa_offset 20 popl %ebx + .cfi_def_cfa_offset 16 popl %esi + .cfi_def_cfa_offset 12 popl %edi + .cfi_def_cfa_offset 8 popl %ebp + .cfi_def_cfa_offset 4 +.cfi_endproc match_init: ret Modified: stable/9/lib/libz/crc32.c ============================================================================== --- stable/9/lib/libz/crc32.c Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/crc32.c Thu Jun 28 07:08:48 2012 (r237691) @@ -1,5 +1,5 @@ /* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-2006, 2010 Mark Adler + * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h * * Thanks to Rodney Brown for his contribution of faster @@ -17,6 +17,8 @@ of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should first call get_crc_table() to initialize the tables before allowing more than one thread to use crc32(). + + DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h. */ #ifdef MAKECRCH @@ -30,31 +32,11 @@ #define local static -/* Find a four-byte integer type for crc32_little() and crc32_big(). */ -#ifndef NOBYFOUR -# ifdef STDC /* need ANSI C limits.h to determine sizes */ -# include -# define BYFOUR -# if (UINT_MAX == 0xffffffffUL) - typedef unsigned int u4; -# else -# if (ULONG_MAX == 0xffffffffUL) - typedef unsigned long u4; -# else -# if (USHRT_MAX == 0xffffffffUL) - typedef unsigned short u4; -# else -# undef BYFOUR /* can't find a four-byte integer type! */ -# endif -# endif -# endif -# endif /* STDC */ -#endif /* !NOBYFOUR */ - /* Definitions for doing the crc four data bytes at a time. */ +#if !defined(NOBYFOUR) && defined(Z_U4) +# define BYFOUR +#endif #ifdef BYFOUR -# define REV(w) ((((w)>>24)&0xff)+(((w)>>8)&0xff00)+ \ - (((w)&0xff00)<<8)+(((w)&0xff)<<24)) local unsigned long crc32_little OF((unsigned long, const unsigned char FAR *, unsigned)); local unsigned long crc32_big OF((unsigned long, @@ -68,16 +50,16 @@ local unsigned long gf2_matrix_times OF((unsigned long *mat, unsigned long vec)); local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); -local uLong crc32_combine_(uLong crc1, uLong crc2, z_off64_t len2); +local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2)); #ifdef DYNAMIC_CRC_TABLE local volatile int crc_table_empty = 1; -local unsigned long FAR crc_table[TBLS][256]; +local z_crc_t FAR crc_table[TBLS][256]; local void make_crc_table OF((void)); #ifdef MAKECRCH - local void write_table OF((FILE *, const unsigned long FAR *)); + local void write_table OF((FILE *, const z_crc_t FAR *)); #endif /* MAKECRCH */ /* Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: @@ -107,9 +89,9 @@ local void make_crc_table OF((void)); */ local void make_crc_table() { - unsigned long c; + z_crc_t c; int n, k; - unsigned long poly; /* polynomial exclusive-or pattern */ + z_crc_t poly; /* polynomial exclusive-or pattern */ /* terms of polynomial defining this crc (except x^32): */ static volatile int first = 1; /* flag to limit concurrent making */ static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; @@ -121,13 +103,13 @@ local void make_crc_table() first = 0; /* make exclusive-or pattern from polynomial (0xedb88320UL) */ - poly = 0UL; - for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) - poly |= 1UL << (31 - p[n]); + poly = 0; + for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++) + poly |= (z_crc_t)1 << (31 - p[n]); /* generate a crc for every 8-bit value */ for (n = 0; n < 256; n++) { - c = (unsigned long)n; + c = (z_crc_t)n; for (k = 0; k < 8; k++) c = c & 1 ? poly ^ (c >> 1) : c >> 1; crc_table[0][n] = c; @@ -138,11 +120,11 @@ local void make_crc_table() and then the byte reversal of those as well as the first table */ for (n = 0; n < 256; n++) { c = crc_table[0][n]; - crc_table[4][n] = REV(c); + crc_table[4][n] = ZSWAP32(c); for (k = 1; k < 4; k++) { c = crc_table[0][c & 0xff] ^ (c >> 8); crc_table[k][n] = c; - crc_table[k + 4][n] = REV(c); + crc_table[k + 4][n] = ZSWAP32(c); } } #endif /* BYFOUR */ @@ -164,7 +146,7 @@ local void make_crc_table() if (out == NULL) return; fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); - fprintf(out, "local const unsigned long FAR "); + fprintf(out, "local const z_crc_t FAR "); fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); write_table(out, crc_table[0]); # ifdef BYFOUR @@ -184,12 +166,13 @@ local void make_crc_table() #ifdef MAKECRCH local void write_table(out, table) FILE *out; - const unsigned long FAR *table; + const z_crc_t FAR *table; { int n; for (n = 0; n < 256; n++) - fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n], + fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", + (unsigned long)(table[n]), n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", ")); } #endif /* MAKECRCH */ @@ -204,13 +187,13 @@ local void write_table(out, table) /* ========================================================================= * This function can be used by asm versions of crc32() */ -const unsigned long FAR * ZEXPORT get_crc_table() +const z_crc_t FAR * ZEXPORT get_crc_table() { #ifdef DYNAMIC_CRC_TABLE if (crc_table_empty) make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ - return (const unsigned long FAR *)crc_table; + return (const z_crc_t FAR *)crc_table; } /* ========================================================================= */ @@ -232,7 +215,7 @@ unsigned long ZEXPORT crc32(crc, buf, le #ifdef BYFOUR if (sizeof(void *) == sizeof(ptrdiff_t)) { - u4 endian; + z_crc_t endian; endian = 1; if (*((unsigned char *)(&endian))) @@ -266,17 +249,17 @@ local unsigned long crc32_little(crc, bu const unsigned char FAR *buf; unsigned len; { - register u4 c; - register const u4 FAR *buf4; + register z_crc_t c; + register const z_crc_t FAR *buf4; - c = (u4)crc; + c = (z_crc_t)crc; c = ~c; while (len && ((ptrdiff_t)buf & 3)) { c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); len--; } - buf4 = (const u4 FAR *)(const void FAR *)buf; + buf4 = (const z_crc_t FAR *)(const void FAR *)buf; while (len >= 32) { DOLIT32; len -= 32; @@ -306,17 +289,17 @@ local unsigned long crc32_big(crc, buf, const unsigned char FAR *buf; unsigned len; { - register u4 c; - register const u4 FAR *buf4; + register z_crc_t c; + register const z_crc_t FAR *buf4; - c = REV((u4)crc); + c = ZSWAP32((z_crc_t)crc); c = ~c; while (len && ((ptrdiff_t)buf & 3)) { c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); len--; } - buf4 = (const u4 FAR *)(const void FAR *)buf; + buf4 = (const z_crc_t FAR *)(const void FAR *)buf; buf4--; while (len >= 32) { DOBIG32; @@ -333,7 +316,7 @@ local unsigned long crc32_big(crc, buf, c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); } while (--len); c = ~c; - return (unsigned long)(REV(c)); + return (unsigned long)(ZSWAP32(c)); } #endif /* BYFOUR */ Modified: stable/9/lib/libz/crc32.h ============================================================================== --- stable/9/lib/libz/crc32.h Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/crc32.h Thu Jun 28 07:08:48 2012 (r237691) @@ -2,7 +2,7 @@ * Generated automatically by crc32.c */ -local const unsigned long FAR crc_table[TBLS][256] = +local const z_crc_t FAR crc_table[TBLS][256] = { { 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, Modified: stable/9/lib/libz/deflate.c ============================================================================== --- stable/9/lib/libz/deflate.c Thu Jun 28 07:02:15 2012 (r237690) +++ stable/9/lib/libz/deflate.c Thu Jun 28 07:08:48 2012 (r237691) @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -37,7 +37,7 @@ * REFERENCES * * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification". - * Available in http://www.ietf.org/rfc/rfc1951.txt + * Available in http://tools.ietf.org/html/rfc1951 * * A description of the Rabin and Karp algorithm is given in the book * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.7 Copyright 1995-2012 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -155,6 +155,9 @@ local const config configuration_table[1 struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ #endif +/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */ +#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0)) + /* =========================================================================== * Update a hash value with the given input byte * IN assertion: all calls to to UPDATE_HASH are made with consecutive @@ -235,10 +238,19 @@ int ZEXPORT deflateInit2_(strm, level, m strm->msg = Z_NULL; if (strm->zalloc == (alloc_func)0) { +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else strm->zalloc = zcalloc; strm->opaque = (voidpf)0; +#endif } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; + if (strm->zfree == (free_func)0) +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else + strm->zfree = zcfree; +#endif #ifdef FASTEST if (level != 0) level = 1; @@ -314,43 +326,70 @@ int ZEXPORT deflateSetDictionary (strm, uInt dictLength; { deflate_state *s; - uInt length = dictLength; - uInt n; - IPos hash_head = 0; - - if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL || - strm->state->wrap == 2 || - (strm->state->wrap == 1 && strm->state->status != INIT_STATE)) - return Z_STREAM_ERROR; + uInt str, n; + int wrap; + unsigned avail; + unsigned char *next; + if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL) + return Z_STREAM_ERROR; s = strm->state; - if (s->wrap) + wrap = s->wrap; + if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead) + return Z_STREAM_ERROR; + + /* when using zlib wrappers, compute Adler-32 for provided dictionary */ + if (wrap == 1) strm->adler = adler32(strm->adler, dictionary, dictLength); + s->wrap = 0; /* avoid computing Adler-32 in read_buf */ - if (length < MIN_MATCH) return Z_OK; - if (length > s->w_size) { - length = s->w_size; - dictionary += dictLength - length; /* use the tail of the dictionary */ - } - zmemcpy(s->window, dictionary, length); - s->strstart = length; - s->block_start = (long)length; - - /* Insert all strings in the hash table (except for the last two bytes). - * s->lookahead stays null, so s->ins_h will be recomputed at the next - * call of fill_window. - */ - s->ins_h = s->window[0]; - UPDATE_HASH(s, s->ins_h, s->window[1]); - for (n = 0; n <= length - MIN_MATCH; n++) { - INSERT_STRING(s, n, hash_head); - } - if (hash_head) hash_head = 0; /* to make compiler happy */ + /* if dictionary would fill window, just replace the history */ + if (dictLength >= s->w_size) { + if (wrap == 0) { /* already empty otherwise */ + CLEAR_HASH(s); + s->strstart = 0; + s->block_start = 0L; + s->insert = 0; + } + dictionary += dictLength - s->w_size; /* use the tail */ + dictLength = s->w_size; + } + + /* insert dictionary into window and hash */ + avail = strm->avail_in; + next = strm->next_in; + strm->avail_in = dictLength; + strm->next_in = (Bytef *)dictionary; + fill_window(s); + while (s->lookahead >= MIN_MATCH) { + str = s->strstart; + n = s->lookahead - (MIN_MATCH-1); + do { + UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); +#ifndef FASTEST + s->prev[str & s->w_mask] = s->head[s->ins_h]; +#endif + s->head[s->ins_h] = (Pos)str; + str++; + } while (--n); + s->strstart = str; + s->lookahead = MIN_MATCH-1; + fill_window(s); + } + s->strstart += s->lookahead; + s->block_start = (long)s->strstart; + s->insert = s->lookahead; + s->lookahead = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + strm->next_in = next; + strm->avail_in = avail; + s->wrap = wrap; return Z_OK; } /* ========================================================================= */ -int ZEXPORT deflateReset (strm) +int ZEXPORT deflateResetKeep (strm) z_streamp strm; { deflate_state *s; @@ -380,12 +419,23 @@ int ZEXPORT deflateReset (strm) s->last_flush = Z_NO_FLUSH; _tr_init(s); - lm_init(s); return Z_OK; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 07:26:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A4A51065673; Thu, 28 Jun 2012 07:26:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BDB48FC08; Thu, 28 Jun 2012 07:26:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S7Qi29059572; Thu, 28 Jun 2012 07:26:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S7QihI059569; Thu, 28 Jun 2012 07:26:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206280726.q5S7QihI059569@svn.freebsd.org> From: Warner Losh Date: Thu, 28 Jun 2012 07: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: r237692 - head/sys/dev/pccard X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 07:26:45 -0000 Author: imp Date: Thu Jun 28 07:26:44 2012 New Revision: 237692 URL: http://svn.freebsd.org/changeset/base/237692 Log: Simplify resource activation a bit. Modified: head/sys/dev/pccard/pccard.c head/sys/dev/pccard/pccardvarp.h Modified: head/sys/dev/pccard/pccard.c ============================================================================== --- head/sys/dev/pccard/pccard.c Thu Jun 28 07:08:48 2012 (r237691) +++ head/sys/dev/pccard/pccard.c Thu Jun 28 07:26:44 2012 (r237692) @@ -473,6 +473,8 @@ pccard_function_init(struct pccard_funct struct resource_list *rl = &devi->resources; struct resource_list_entry *rle; struct resource *r = 0; + struct pccard_ce_iospace *ios; + struct pccard_ce_memspace *mems; device_t bus; u_long start, end, len; int i, rid, spaces; @@ -501,44 +503,50 @@ pccard_function_init(struct pccard_funct continue; spaces = 0; for (i = 0; i < cfe->num_iospace; i++) { - start = cfe->iospace[i].start; + ios = cfe->iospace + i; + start = ios->start; if (start) - end = start + cfe->iospace[i].length - 1; + end = start + ios->length - 1; else end = ~0UL; DEVPRINTF((bus, "I/O rid %d start %#lx end %#lx\n", i, start, end)); rid = i; - len = cfe->iospace[i].length; + len = ios->length; r = bus_alloc_resource(bus, SYS_RES_IOPORT, &rid, start, end, len, rman_make_alignment_flags(len)); - if (r == NULL) + if (r == NULL) { + DEVPRINTF((bus, "I/O rid %d failed\n", i)); goto not_this_one; + } rle = resource_list_add(rl, SYS_RES_IOPORT, - rid, rman_get_start(r), rman_get_end(r), - cfe->iospace[i].length); + rid, rman_get_start(r), rman_get_end(r), len); if (rle == NULL) panic("Cannot add resource rid %d IOPORT", rid); rle->res = r; spaces++; } for (i = 0; i < cfe->num_memspace; i++) { - start = cfe->memspace[i].hostaddr; + mems = cfe->memspace + i; + start = mems->cardaddr + mems->hostaddr; if (start) - end = start + cfe->memspace[i].length - 1; + end = start + mems->length - 1; else end = ~0UL; - DEVPRINTF((bus, "Memory rid %d start %#lx end %#lx\n", - i, start, end)); + DEVPRINTF((bus, "Memory rid %d start %#lx end %#lx\ncardaddr %#lx hostaddr %#lx length %#lx\n", + i, start, end, mems->cardaddr, mems->hostaddr, + mems->length)); rid = i; - len = cfe->memspace[i].length; + len = mems->length; r = bus_alloc_resource(bus, SYS_RES_MEMORY, &rid, start, end, len, rman_make_alignment_flags(len)); - if (r == NULL) - goto not_this_one; + if (r == NULL) { + DEVPRINTF((bus, "Memory rid %d failed\n", i)); +// goto not_this_one; + continue; + } rle = resource_list_add(rl, SYS_RES_MEMORY, - rid, rman_get_start(r), rman_get_end(r), - cfe->memspace[i].length); + rid, rman_get_start(r), rman_get_end(r), len); if (rle == NULL) panic("Cannot add resource rid %d MEM", rid); rle->res = r; @@ -552,8 +560,10 @@ pccard_function_init(struct pccard_funct rid = 0; r = bus_alloc_resource_any(bus, SYS_RES_IRQ, &rid, RF_SHAREABLE); - if (r == NULL) + if (r == NULL) { + DEVPRINTF((bus, "IRQ rid %d failed\n", rid)); goto not_this_one; + } rle = resource_list_add(rl, SYS_RES_IRQ, rid, rman_get_start(r), rman_get_end(r), 1); if (rle == NULL) Modified: head/sys/dev/pccard/pccardvarp.h ============================================================================== --- head/sys/dev/pccard/pccardvarp.h Thu Jun 28 07:08:48 2012 (r237691) +++ head/sys/dev/pccard/pccardvarp.h Thu Jun 28 07:26:44 2012 (r237692) @@ -47,29 +47,32 @@ #define PCCARD_CFE_READONLY 0x0400 #define PCCARD_CFE_AUDIO 0x0800 +struct pccard_ce_iospace { + u_long length; + u_long start; +}; + +struct pccard_ce_memspace { + u_long length; + u_long cardaddr; + u_long hostaddr; +}; + struct pccard_config_entry { int number; uint32_t flags; int iftype; int num_iospace; - /* * The card will only decode this mask in any case, so we can * do dynamic allocation with this in mind, in case the suggestions * below are no good. */ u_long iomask; - struct { - u_long length; - u_long start; - } iospace[4]; /* XXX this could be as high as 16 */ + struct pccard_ce_iospace iospace[4]; /* XXX up to 16 */ uint16_t irqmask; int num_memspace; - struct { - u_long length; - u_long cardaddr; - u_long hostaddr; - } memspace[2]; /* XXX this could be as high as 8 */ + struct pccard_ce_memspace memspace[2]; /* XXX up to 8 */ int maxtwins; STAILQ_ENTRY(pccard_config_entry) cfe_list; }; From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 07:28:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8F9F106566B; Thu, 28 Jun 2012 07:28:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C49CD8FC14; Thu, 28 Jun 2012 07:28:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S7SdYZ059680; Thu, 28 Jun 2012 07:28:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S7SdG6059678; Thu, 28 Jun 2012 07:28:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206280728.q5S7SdG6059678@svn.freebsd.org> From: Warner Losh Date: Thu, 28 Jun 2012 07:28: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: r237693 - head/sys/dev/sio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 07:28:40 -0000 Author: imp Date: Thu Jun 28 07:28:39 2012 New Revision: 237693 URL: http://svn.freebsd.org/changeset/base/237693 Log: Document some MP assumptions for sio. Submitted by: bde (years ago) Modified: head/sys/dev/sio/sio.c Modified: head/sys/dev/sio/sio.c ============================================================================== --- head/sys/dev/sio/sio.c Thu Jun 28 07:26:44 2012 (r237692) +++ head/sys/dev/sio/sio.c Thu Jun 28 07:28:39 2012 (r237693) @@ -278,6 +278,11 @@ static int sio_inited; /* table and macro for fast conversion from a unit number to its com struct */ devclass_t sio_devclass; +/* + * XXX Assmues that devclass_get_device, devclass_get_softc and + * device_get_softc are fast interrupt safe. The current implementation + * of these functions are. + */ #define com_addr(unit) ((struct com_s *) \ devclass_get_softc(sio_devclass, unit)) /* XXX */ From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 07:33:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 14D18106564A; Thu, 28 Jun 2012 07:33:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA6B28FC0C; Thu, 28 Jun 2012 07:33:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S7XhY8059932; Thu, 28 Jun 2012 07:33:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S7XhOK059928; Thu, 28 Jun 2012 07:33:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206280733.q5S7XhOK059928@svn.freebsd.org> From: Warner Losh Date: Thu, 28 Jun 2012 07:33: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: r237694 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 07:33:44 -0000 Author: imp Date: Thu Jun 28 07:33:43 2012 New Revision: 237694 URL: http://svn.freebsd.org/changeset/base/237694 Log: Remove an old hack I noticed years ago, but never committed. Modified: head/sys/kern/imgact_aout.c head/sys/kern/imgact_gzip.c head/sys/sys/imgact_aout.h Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Thu Jun 28 07:28:39 2012 (r237693) +++ head/sys/kern/imgact_aout.c Thu Jun 28 07:33:43 2012 (r237694) @@ -174,9 +174,9 @@ exec_aout_imgact(struct image_params *im * 0x64 for Linux, 0x86 for *BSD, 0x00 for BSDI. * NetBSD is in network byte order.. ugh. */ - if (((a_out->a_magic >> 16) & 0xff) != 0x86 && - ((a_out->a_magic >> 16) & 0xff) != 0 && - ((((int)ntohl(a_out->a_magic)) >> 16) & 0xff) != 0x86) + if (((a_out->a_midmag >> 16) & 0xff) != 0x86 && + ((a_out->a_midmag >> 16) & 0xff) != 0 && + ((((int)ntohl(a_out->a_midmag)) >> 16) & 0xff) != 0x86) return -1; /* @@ -184,7 +184,7 @@ exec_aout_imgact(struct image_params *im * We do two cases: host byte order and network byte order * (for NetBSD compatibility) */ - switch ((int)(a_out->a_magic & 0xffff)) { + switch ((int)(a_out->a_midmag & 0xffff)) { case ZMAGIC: virtual_offset = 0; if (a_out->a_text) { @@ -203,7 +203,7 @@ exec_aout_imgact(struct image_params *im break; default: /* NetBSD compatibility */ - switch ((int)(ntohl(a_out->a_magic) & 0xffff)) { + switch ((int)(ntohl(a_out->a_midmag) & 0xffff)) { case ZMAGIC: case QMAGIC: virtual_offset = PAGE_SIZE; Modified: head/sys/kern/imgact_gzip.c ============================================================================== --- head/sys/kern/imgact_gzip.c Thu Jun 28 07:28:39 2012 (r237693) +++ head/sys/kern/imgact_gzip.c Thu Jun 28 07:33:43 2012 (r237694) @@ -161,7 +161,7 @@ do_aout_hdr(struct imgact_gzip * gz) * Set file/virtual offset based on a.out variant. We do two cases: * host byte order and network byte order (for NetBSD compatibility) */ - switch ((int) (gz->a_out.a_magic & 0xffff)) { + switch ((int) (gz->a_out.a_midmag & 0xffff)) { case ZMAGIC: gz->virtual_offset = 0; if (gz->a_out.a_text) { @@ -177,7 +177,7 @@ do_aout_hdr(struct imgact_gzip * gz) break; default: /* NetBSD compatibility */ - switch ((int) (ntohl(gz->a_out.a_magic) & 0xffff)) { + switch ((int) (ntohl(gz->a_out.a_midmag) & 0xffff)) { case ZMAGIC: case QMAGIC: gz->virtual_offset = PAGE_SIZE; Modified: head/sys/sys/imgact_aout.h ============================================================================== --- head/sys/sys/imgact_aout.h Thu Jun 28 07:28:39 2012 (r237693) +++ head/sys/sys/imgact_aout.h Thu Jun 28 07:33:43 2012 (r237694) @@ -119,7 +119,6 @@ struct exec { uint32_t a_trsize; /* text relocation size */ uint32_t a_drsize; /* data relocation size */ }; -#define a_magic a_midmag /* XXX Hack to work with imgact_{aout,gzip}.c */ /* a_magic */ #define OMAGIC 0407 /* old impure format */ From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 07:37:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E89C21065670; Thu, 28 Jun 2012 07:37:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1CAC8FC08; Thu, 28 Jun 2012 07:37:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S7bk2U060140; Thu, 28 Jun 2012 07:37:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S7bkEE060138; Thu, 28 Jun 2012 07:37:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206280737.q5S7bkEE060138@svn.freebsd.org> From: Warner Losh Date: Thu, 28 Jun 2012 07:37:46 +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: r237695 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 07:37:47 -0000 Author: imp Date: Thu Jun 28 07:37:46 2012 New Revision: 237695 URL: http://svn.freebsd.org/changeset/base/237695 Log: Turns out the emulators still need/want a_magic, so put it back here. Modified: head/sys/sys/imgact_aout.h Modified: head/sys/sys/imgact_aout.h ============================================================================== --- head/sys/sys/imgact_aout.h Thu Jun 28 07:33:43 2012 (r237694) +++ head/sys/sys/imgact_aout.h Thu Jun 28 07:37:46 2012 (r237695) @@ -119,6 +119,7 @@ struct exec { uint32_t a_trsize; /* text relocation size */ uint32_t a_drsize; /* data relocation size */ }; +#define a_magic a_midmag /* Hack for emulators */ /* a_magic */ #define OMAGIC 0407 /* old impure format */ From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 07:53:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AA191065673; Thu, 28 Jun 2012 07:53:10 +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 A79D18FC08; Thu, 28 Jun 2012 07:53:09 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q5S7r2dh036045; Thu, 28 Jun 2012 10:53:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q5S7r22R099779; Thu, 28 Jun 2012 10:53:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q5S7r2QR099778; Thu, 28 Jun 2012 10:53: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: Thu, 28 Jun 2012 10:53:01 +0300 From: Konstantin Belousov To: davidxu@freebsd.org Message-ID: <20120628075301.GS2337@deviant.kiev.zoral.com.ua> References: <201206272032.q5RKWjvt031174@svn.freebsd.org> <4FEBB8C9.8070006@gmail.com> <4FEBC0A2.3010708@gmail.com> <4FEBC70F.40408@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YD+BIkcXU0IoTTos" Content-Disposition: inline In-Reply-To: <4FEBC70F.40408@gmail.com> 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=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Attilio Rao , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 07:53:10 -0000 --YD+BIkcXU0IoTTos Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 28, 2012 at 10:53:03AM +0800, David Xu wrote: > On 2012/6/28 10:32, Attilio Rao wrote: > >2012/6/28, David Xu: > >>On 2012/6/28 10:21, Attilio Rao wrote: > >>>2012/6/28, David Xu: > >>>>On 2012/6/28 4:32, Konstantin Belousov wrote: > >>>>>Author: kib > >>>>>Date: Wed Jun 27 20:32:45 2012 > >>>>>New Revision: 237660 > >>>>>URL: http://svn.freebsd.org/changeset/base/237660 > >>>>> > >>>>>Log: > >>>>> Optimize the handling of SC_NPROCESSORS_CONF, by using auxv=20 > >>>>> AT_NCPU > >>>>> value if present. > >>>>> > >>>>> MFC after: 1 week > >>>>> > >>>>>Modified: > >>>>> head/lib/libc/gen/sysconf.c > >>>>> > >>>>>Modified: head/lib/libc/gen/sysconf.c > >>>>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > >>>>>--- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 (r237659) > >>>>>+++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 (r237660) > >>>>>@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); > >>>>> #include > >>>>> #include > >>>>> > >>>>>+#include > >>>>> #include > >>>>> #include > >>>>> #include > >>>>>@@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); > >>>>> > >>>>> #include "../stdlib/atexit.h" > >>>>> #include "tzfile.h" /* from=20 > >>>>> ../../../contrib/tzcode/stdtime */ > >>>>>+#include "libc_private.h" > >>>>> > >>>>> #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ > >>>>> > >>>>>@@ -585,6 +587,8 @@ yesno: > >>>>> > >>>>> case _SC_NPROCESSORS_CONF: > >>>>> case _SC_NPROCESSORS_ONLN: > >>>>>+ if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) =3D=3D 0) > >>>>>+ return ((long)value); > >>>>> mib[0] =3D CTL_HW; > >>>>> mib[1] =3D HW_NCPU; > >>>>> break; > >>>>> > >>>>Will this make controlling the number of CPU online or CPU hotplug > >>>>be impossible on FreeBSD ? > >>>If I think about hotplug CPUs I can think of other 1000 > >>>problems/races/bad situations to be fixed before this one, really. > >>These are problems only in kernel, but kib's change is about ABI > >>between userland and kernel, I hope we don't introduce an ABI which > >>is not extendable road stone. > >I'm not entirely sure I see the ABI breakage here. > It is not breakage, it is the ABI thinks number of online cpu is fixed, > obviously, it is not the case in future unless FreeBSD won't support > dynamic number of online cpus. >=20 >=20 > >If the AT_NCPUS > >becames unconvenient and not correct at some point we can just fix > >sysconf() to not look into the aux vector anymoe. > If you already know this will be a problem, why do you introduce it > and later need to fix it ? >=20 > > Please note that > >AT_NCPUS is already exported nowadays. I think this is instead a > >clever optimization to avoid the sysctl() (usual way to retrieve the > >number of CPUs). > But why don't you cache it in libc ? following code is enough: >=20 > static int online_cpu; > if (online_cpu =3D=3D 0) > online_cpu =3D sysctl > return online_cpu; >=20 Thread did evolved somewhat while I was AFK. First, please note that the ABI which I designed there is fixable: if kernel does not export AT_NCPUS at all, then auxv correctly handles the situation returning an error, and libc falls back to sysctl(2). Second, sysconf(3) is very weird API. Note the following statement from SUSv4: "The value shall not change during the lifetime of the calling process, [XSI] [Option Start] except that sysconf(_SC_OPEN_MAX) may return different values before and after a call to setrlimit() which changes the RLIMIT_NOFILE soft limit." Corresponding comment is also present in sysconf.c. So I do not see an issue there, esp. for advisory value which NCPUS is anyway. --YD+BIkcXU0IoTTos Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/sDV0ACgkQC3+MBN1Mb4jAxwCeOOJVbcfvLsTXSgOupccMhLDZ OmgAnie0Etxxw62u1QPnCI0lCNYFOKez =jhGE -----END PGP SIGNATURE----- --YD+BIkcXU0IoTTos-- From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 08:22:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD32B106564A; Thu, 28 Jun 2012 08:22:00 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9801C8FC0A; Thu, 28 Jun 2012 08:22:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S8M05R062087; Thu, 28 Jun 2012 08:22:00 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S8M0st062083; Thu, 28 Jun 2012 08:22:00 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201206280822.q5S8M0st062083@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 28 Jun 2012 08:22: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: r237696 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 08:22:00 -0000 Author: gabor Date: Thu Jun 28 08:22:00 2012 New Revision: 237696 URL: http://svn.freebsd.org/changeset/base/237696 Log: - Add UPDATING entry for BSD sort Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jun 28 07:37:46 2012 (r237695) +++ head/UPDATING Thu Jun 28 08:22:00 2012 (r237696) @@ -24,6 +24,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20120628: + The sort utility has been replaced with BSD sort. For now, GNU sort + is also available as "gnusort" or the default can be set back to + GNU sort by setting WITH_GNU_SORT. In this case, BSD sort will be + installed as "bsdsort". + 20120611: A new version of ZFS (pool version 5000) has been merged to -HEAD. Starting with this version the old system of ZFS pool versioning From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 08:25:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C94321065673; Thu, 28 Jun 2012 08:25:19 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B43E18FC17; Thu, 28 Jun 2012 08:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S8PJqb062327; Thu, 28 Jun 2012 08:25:19 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S8PJG2062325; Thu, 28 Jun 2012 08:25:19 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201206280825.q5S8PJG2062325@svn.freebsd.org> From: Maxim Konovalov Date: Thu, 28 Jun 2012 08:25: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: r237697 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 08:25:19 -0000 Author: maxim Date: Thu Jun 28 08:25:19 2012 New Revision: 237697 URL: http://svn.freebsd.org/changeset/base/237697 Log: o Restore -u getopt(3) flag somehow killed in r234712. PR: bin/169490 Submitted by: amdmi3 MFC after: 2 weeks Modified: head/usr.sbin/jail/jail.c Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Thu Jun 28 08:22:00 2012 (r237696) +++ head/usr.sbin/jail/jail.c Thu Jun 28 08:25:19 2012 (r237697) @@ -145,7 +145,7 @@ main(int argc, char **argv) cfname = CONF_FILE; JidFile = NULL; - while ((ch = getopt(argc, argv, "cdf:hiJ:lmn:p:qrRs:U:v")) != -1) { + while ((ch = getopt(argc, argv, "cdf:hiJ:lmn:p:qrRs:u:U:v")) != -1) { switch (ch) { case 'c': op |= JF_START; From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 08:49:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC02D1065686; Thu, 28 Jun 2012 08:49:52 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9C8BA8FC18; Thu, 28 Jun 2012 08:49:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5S8nnLY017411; Thu, 28 Jun 2012 08:49:50 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4FEC1AAB.6070408@gmail.com> Date: Thu, 28 Jun 2012 16:49:47 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Konstantin Belousov References: <201206272032.q5RKWjvt031174@svn.freebsd.org> <4FEBB8C9.8070006@gmail.com> <4FEBC0A2.3010708@gmail.com> <4FEBC70F.40408@gmail.com> <20120628075301.GS2337@deviant.kiev.zoral.com.ua> In-Reply-To: <20120628075301.GS2337@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Attilio Rao , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, davidxu@freebsd.org Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 08:49:52 -0000 On 2012/6/28 15:53, Konstantin Belousov wrote: > On Thu, Jun 28, 2012 at 10:53:03AM +0800, David Xu wrote: >> On 2012/6/28 10:32, Attilio Rao wrote: >>> 2012/6/28, David Xu: >>>> On 2012/6/28 10:21, Attilio Rao wrote: >>>>> 2012/6/28, David Xu: >>>>>> On 2012/6/28 4:32, Konstantin Belousov wrote: >>>>>>> Author: kib >>>>>>> Date: Wed Jun 27 20:32:45 2012 >>>>>>> New Revision: 237660 >>>>>>> URL: http://svn.freebsd.org/changeset/base/237660 >>>>>>> >>>>>>> Log: >>>>>>> Optimize the handling of SC_NPROCESSORS_CONF, by using auxv >>>>>>> AT_NCPU >>>>>>> value if present. >>>>>>> >>>>>>> MFC after: 1 week >>>>>>> >>>>>>> Modified: >>>>>>> head/lib/libc/gen/sysconf.c >>>>>>> >>>>>>> Modified: head/lib/libc/gen/sysconf.c >>>>>>> ============================================================================== >>>>>>> --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 (r237659) >>>>>>> +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 (r237660) >>>>>>> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); >>>>>>> #include >>>>>>> #include >>>>>>> >>>>>>> +#include >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); >>>>>>> >>>>>>> #include "../stdlib/atexit.h" >>>>>>> #include "tzfile.h" /* from >>>>>>> ../../../contrib/tzcode/stdtime */ >>>>>>> +#include "libc_private.h" >>>>>>> >>>>>>> #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ >>>>>>> >>>>>>> @@ -585,6 +587,8 @@ yesno: >>>>>>> >>>>>>> case _SC_NPROCESSORS_CONF: >>>>>>> case _SC_NPROCESSORS_ONLN: >>>>>>> + if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) == 0) >>>>>>> + return ((long)value); >>>>>>> mib[0] = CTL_HW; >>>>>>> mib[1] = HW_NCPU; >>>>>>> break; >>>>>>> >>>>>> Will this make controlling the number of CPU online or CPU hotplug >>>>>> be impossible on FreeBSD ? >>>>> If I think about hotplug CPUs I can think of other 1000 >>>>> problems/races/bad situations to be fixed before this one, really. >>>> These are problems only in kernel, but kib's change is about ABI >>>> between userland and kernel, I hope we don't introduce an ABI which >>>> is not extendable road stone. >>> I'm not entirely sure I see the ABI breakage here. >> It is not breakage, it is the ABI thinks number of online cpu is fixed, >> obviously, it is not the case in future unless FreeBSD won't support >> dynamic number of online cpus. >> >> >>> If the AT_NCPUS >>> becames unconvenient and not correct at some point we can just fix >>> sysconf() to not look into the aux vector anymoe. >> If you already know this will be a problem, why do you introduce it >> and later need to fix it ? >> >>> Please note that >>> AT_NCPUS is already exported nowadays. I think this is instead a >>> clever optimization to avoid the sysctl() (usual way to retrieve the >>> number of CPUs). >> But why don't you cache it in libc ? following code is enough: >> >> static int online_cpu; >> if (online_cpu == 0) >> online_cpu = sysctl >> return online_cpu; >> > Thread did evolved somewhat while I was AFK. > > First, please note that the ABI which I designed there is fixable: > if kernel does not export AT_NCPUS at all, then auxv correctly handles > the situation returning an error, and libc falls back to sysctl(2). Do we really want to bypass sysctl and instead passing all info via auxv vector ? I found the sysconf() is a bunch of switch-case, which is already slow, before _SC_NPROCESSES_ONLN, it has already a quite number of case branches, and in your code, it calls _elf_aux_info() which also has some switch-cases branch, if you cache smp_cpus in libc, the call for _elf_aux_info is not needed, and you don't need code in kernel to passing it either, in any case, the code to call sysctl is still needed, so why don't we just use sysctl instead and cache the result in libc ? this at least can generate small code and a bit faster after first call to sysconf(_SC_NPROCESSES_ONLN). > Second, sysconf(3) is very weird API. Note the following statement from > SUSv4: "The value shall not change during the lifetime of the calling > process, [XSI] [Option Start] except that sysconf(_SC_OPEN_MAX) may > return different values before and after a call to setrlimit() which > changes the RLIMIT_NOFILE soft limit." Corresponding comment is also > present in sysconf.c. So it declares the number of cpu is static and can not be changed. > So I do not see an issue there, esp. for advisory value which NCPUS is > anyway. From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 09:18:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D12C1065672; Thu, 28 Jun 2012 09:18:12 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E2648FC0A; Thu, 28 Jun 2012 09:18:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S9IBwA064630; Thu, 28 Jun 2012 09:18:11 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S9IBuu064627; Thu, 28 Jun 2012 09:18:11 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201206280918.q5S9IBuu064627@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 28 Jun 2012 09:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237698 - stable/9/lib/libkiconv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 09:18:12 -0000 Author: gabor Date: Thu Jun 28 09:18:11 2012 New Revision: 237698 URL: http://svn.freebsd.org/changeset/base/237698 Log: MFC 236028, 236185, 236972 - Add support for BSD iconv when it is built into libc Modified: stable/9/lib/libkiconv/Makefile stable/9/lib/libkiconv/xlat16_iconv.c Directory Properties: stable/9/lib/libkiconv/ (props changed) Modified: stable/9/lib/libkiconv/Makefile ============================================================================== --- stable/9/lib/libkiconv/Makefile Thu Jun 28 08:25:19 2012 (r237697) +++ stable/9/lib/libkiconv/Makefile Thu Jun 28 09:18:11 2012 (r237698) @@ -1,7 +1,10 @@ # $FreeBSD$ -LIB= kiconv SHLIBDIR?= /lib + +.include + +LIB= kiconv SRCS= kiconv_sysctl.c xlat16_iconv.c xlat16_sysctl.c SRCS+= quirks.c @@ -17,4 +20,8 @@ CFLAGS+= -I${.CURDIR}/../../sys WARNS?= 1 +.if ${MK_ICONV} == "no" +CFLAGS+= -DICONV_DLOPEN +.endif + .include Modified: stable/9/lib/libkiconv/xlat16_iconv.c ============================================================================== --- stable/9/lib/libkiconv/xlat16_iconv.c Thu Jun 28 08:25:19 2012 (r237697) +++ stable/9/lib/libkiconv/xlat16_iconv.c Thu Jun 28 09:18:11 2012 (r237698) @@ -60,10 +60,18 @@ struct xlat16_table { static struct xlat16_table kiconv_xlat16_open(const char *, const char *, int); static int chklocale(int, const char *); +#ifdef ICONV_DLOPEN static int my_iconv_init(void); static iconv_t (*my_iconv_open)(const char *, const char *); static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *); static int (*my_iconv_close)(iconv_t); +#else +#include +#define my_iconv_init() 0 +#define my_iconv_open iconv_open +#define my_iconv iconv +#define my_iconv_close iconv_close +#endif static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, size_t *); int @@ -310,6 +318,7 @@ chklocale(int category, const char *code return (error); } +#ifdef ICONV_DLOPEN static int my_iconv_init(void) { @@ -327,6 +336,7 @@ my_iconv_init(void) return (0); } +#endif static size_t my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf, From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 10:05:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A3461065676; Thu, 28 Jun 2012 10:05:46 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 536848FC14; Thu, 28 Jun 2012 10:05:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SA5kNg066633; Thu, 28 Jun 2012 10:05:46 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SA5kui066627; Thu, 28 Jun 2012 10:05:46 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201206281005.q5SA5kui066627@svn.freebsd.org> From: Isabell Long Date: Thu, 28 Jun 2012 10:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237699 - stable/9/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 10:05:46 -0000 Author: issyl0 (doc committer) Date: Thu Jun 28 10:05:45 2012 New Revision: 237699 URL: http://svn.freebsd.org/changeset/base/237699 Log: Merge head revisions 237393, 237409: Locale-specific man page edits: - libc/string/strcoll.3 - libc/string/strstr.3 - libc/string/strxfrm.3 - libc/string/strcasecmp.3 - libc/string/Makefile.inc Approved by: gabor (mentor) Modified: stable/9/lib/libc/string/Makefile.inc stable/9/lib/libc/string/strcasecmp.3 stable/9/lib/libc/string/strcoll.3 stable/9/lib/libc/string/strstr.3 stable/9/lib/libc/string/strxfrm.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/string/Makefile.inc ============================================================================== --- stable/9/lib/libc/string/Makefile.inc Thu Jun 28 09:18:11 2012 (r237698) +++ stable/9/lib/libc/string/Makefile.inc Thu Jun 28 10:05:45 2012 (r237699) @@ -42,10 +42,13 @@ MLINKS+=ffs.3 ffsl.3 \ ffs.3 flsll.3 MLINKS+=index.3 rindex.3 MLINKS+=memchr.3 memrchr.3 -MLINKS+=strcasecmp.3 strncasecmp.3 +MLINKS+=strcasecmp.3 strncasecmp.3 \ + strcasecmp.3 strcasecmp_l.3 \ + strcasecmp.3 strncasecmp_l.3 MLINKS+=strcat.3 strncat.3 MLINKS+=strchr.3 strrchr.3 MLINKS+=strcmp.3 strncmp.3 +MLINKS+=strcoll.3 strcoll_l.3 MLINKS+=strcpy.3 stpcpy.3 \ strcpy.3 stpncpy.3 \ strcpy.3 strncpy.3 @@ -57,8 +60,10 @@ MLINKS+=strerror.3 perror.3 \ MLINKS+=strlcpy.3 strlcat.3 MLINKS+=strlen.3 strnlen.3 MLINKS+=strstr.3 strcasestr.3 \ - strstr.3 strnstr.3 + strstr.3 strnstr.3 \ + strstr.3 strcasestr_l.3 MLINKS+=strtok.3 strtok_r.3 +MLINKS+=strxfrm.3 strxfrm_l.3 MLINKS+=wmemchr.3 wcpcpy.3 \ wmemchr.3 wcpncpy.3 \ wmemchr.3 wcscasecmp.3 \ Modified: stable/9/lib/libc/string/strcasecmp.3 ============================================================================== --- stable/9/lib/libc/string/strcasecmp.3 Thu Jun 28 09:18:11 2012 (r237698) +++ stable/9/lib/libc/string/strcasecmp.3 Thu Jun 28 10:05:45 2012 (r237699) @@ -45,6 +45,12 @@ .Fn strcasecmp "const char *s1" "const char *s2" .Ft int .Fn strncasecmp "const char *s1" "const char *s2" "size_t len" +.In string.h +.In xlocale.h +.Ft int +.Fn strcasecmp_l "const char *s1" "const char *s2" "locale_t loc" +.Ft int +.Fn strncasecmp_l "const char *s1" "const char *s2" "site_t len" "locale_t loc" .Sh DESCRIPTION The .Fn strcasecmp @@ -58,16 +64,22 @@ and .Pp The .Fn strncasecmp -compares at most +function compares at most .Fa len characters. -.Sh RETURN VALUES The +.Fn strcasecmp_l +and +.Fn strncasecmp_l +functions do the same as their non-locale versions above, but take an +explicit locale rather than using the current locale. +.Sh RETURN VALUES +The functions .Fn strcasecmp and .Fn strncasecmp return an integer greater than, equal to, or less than 0, -according as +depending on whether .Fa s1 is lexicographically greater than, equal to, or less than .Fa s2 @@ -77,6 +89,11 @@ The comparison is done using unsigned ch .Sq Li \e200 is greater than .Ql \e0 . +The functions +.Fn strcasecmp_l +and +.Fn strncasecmp_l +do the same but take explicit locales. .Sh SEE ALSO .Xr bcmp 3 , .Xr memcmp 3 , Modified: stable/9/lib/libc/string/strcoll.3 ============================================================================== --- stable/9/lib/libc/string/strcoll.3 Thu Jun 28 09:18:11 2012 (r237698) +++ stable/9/lib/libc/string/strcoll.3 Thu Jun 28 10:05:45 2012 (r237699) @@ -44,6 +44,8 @@ .In string.h .Ft int .Fn strcoll "const char *s1" "const char *s2" +.Ft int +.Fn strcoll_l "const char *s1" "const char *s2" "locale_t loc" .Sh DESCRIPTION The .Fn strcoll @@ -54,7 +56,7 @@ and .Fa s2 according to the current locale collation and returns an integer greater than, equal to, or less than 0, -according as +depending on whether .Fa s1 is greater than, equal to, or less than .Fa s2 . @@ -62,6 +64,9 @@ If information about the current locale the value of .Fn strcmp s1 s2 is returned. +The +.Fn strcoll_l +function uses an explicit locale argument rather than the system locale. .Sh SEE ALSO .Xr setlocale 3 , .Xr strcmp 3 , @@ -70,6 +75,9 @@ is returned. .Sh STANDARDS The .Fn strcoll -function -conforms to +function conforms to .St -isoC . +The +.Fn strcoll_l +function conforms to +.St -p1003.1-2008 . Modified: stable/9/lib/libc/string/strstr.3 ============================================================================== --- stable/9/lib/libc/string/strstr.3 Thu Jun 28 09:18:11 2012 (r237698) +++ stable/9/lib/libc/string/strstr.3 Thu Jun 28 10:05:45 2012 (r237699) @@ -49,6 +49,10 @@ .Fn strcasestr "const char *big" "const char *little" .Ft char * .Fn strnstr "const char *big" "const char *little" "size_t len" +.In string.h +.In xlocale.h +.Ft char * +.Fn strcasestr_l "const char *big" "const char *little" "locale_t loc" .Sh DESCRIPTION The .Fn strstr @@ -65,6 +69,12 @@ function is similar to but ignores the case of both strings. .Pp The +.Fn strcasestr_l +function does the same as +.Fn strcasestr +but takes an explicit locale rather than using the current locale. +.Pp +The .Fn strnstr function locates the first occurrence of the null-terminated string Modified: stable/9/lib/libc/string/strxfrm.3 ============================================================================== --- stable/9/lib/libc/string/strxfrm.3 Thu Jun 28 09:18:11 2012 (r237698) +++ stable/9/lib/libc/string/strxfrm.3 Thu Jun 28 10:05:45 2012 (r237699) @@ -44,6 +44,8 @@ .In string.h .Ft size_t .Fn strxfrm "char * restrict dst" "const char * restrict src" "size_t n" +.Ft size_t +.Fn strxfrm_l "char * restrict dst" "const char *restrict src" "size_t n" "locale_t loc" .Sh DESCRIPTION The .Fn strxfrm @@ -73,10 +75,16 @@ after is equal to comparing two original strings with .Fn strcoll . +.Pp +.Fn strxfrm_l +does the same, however takes an explicit locale rather than the global +locale. .Sh RETURN VALUES Upon successful completion, .Fn strxfrm -returns the length of the transformed string not including +and +.Fn strxfrm_l +return the length of the transformed string not including the terminating null character. If this value is .Fa n @@ -94,3 +102,7 @@ The function conforms to .St -isoC . +The +.Fn strxfrm_l +function conforms to +.St -p1003.1-2008 . From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 10:12:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D15E2106564A; Thu, 28 Jun 2012 10:12:46 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB9D28FC1F; Thu, 28 Jun 2012 10:12:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SACker066979; Thu, 28 Jun 2012 10:12:46 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SACkmC066976; Thu, 28 Jun 2012 10:12:46 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201206281012.q5SACkmC066976@svn.freebsd.org> From: Christian Brueffer Date: Thu, 28 Jun 2012 10:12:46 +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: r237700 - in head/release/doc: en_US.ISO8859-1/hardware share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 10:12:47 -0000 Author: brueffer Date: Thu Jun 28 10:12:46 2012 New Revision: 237700 URL: http://svn.freebsd.org/changeset/base/237700 Log: Automatically generate hardware notes for bxe(4). Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml head/release/doc/share/misc/dev.archlist.txt Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Thu Jun 28 10:05:45 2012 (r237699) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Thu Jun 28 10:12:46 2012 (r237700) @@ -898,6 +898,8 @@ &hwlist.bge; + &hwlist.bxe; + &hwlist.cas; &hwlist.cdce; Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Thu Jun 28 10:05:45 2012 (r237699) +++ head/release/doc/share/misc/dev.archlist.txt Thu Jun 28 10:12:46 2012 (r237700) @@ -52,6 +52,7 @@ bce i386,amd64 bge i386,pc98,sparc64,ia64,amd64 bktr i386,pc98 bt i386,amd64 +bxe i386,amd64 cdce i386,pc98,ia64,amd64,powerpc ciss i386,ia64,amd64 ce i386,pc98 From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 10:21:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C5D21065674; Thu, 28 Jun 2012 10:21:26 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 261A98FC0C; Thu, 28 Jun 2012 10:21:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SALQER067354; Thu, 28 Jun 2012 10:21:26 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SALPWp067352; Thu, 28 Jun 2012 10:21:25 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201206281021.q5SALPWp067352@svn.freebsd.org> From: Christian Brueffer Date: Thu, 28 Jun 2012 10:21: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: r237701 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 10:21:26 -0000 Author: brueffer Date: Thu Jun 28 10:21:25 2012 New Revision: 237701 URL: http://svn.freebsd.org/changeset/base/237701 Log: Automatically generate hardware notes for bwn(4). 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 Thu Jun 28 10:12:46 2012 (r237700) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Thu Jun 28 10:21:25 2012 (r237701) @@ -1059,6 +1059,8 @@ &hwlist.bwi; + &hwlist.bwn; + [&arch.i386;, &arch.amd64;] Intel PRO/Wireless 2100 MiniPCI network adapter (&man.ipw.4; driver) From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 11:15:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F17D1065673; Thu, 28 Jun 2012 11:15:49 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4C928FC0C; Thu, 28 Jun 2012 11:15:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SBFmlM072727; Thu, 28 Jun 2012 11:15:48 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SBFm20072724; Thu, 28 Jun 2012 11:15:48 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201206281115.q5SBFm20072724@svn.freebsd.org> From: Max Khon Date: Thu, 28 Jun 2012 11:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237703 - stable/9/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 11:15:49 -0000 Author: fjoe Date: Thu Jun 28 11:15:48 2012 New Revision: 237703 URL: http://svn.freebsd.org/changeset/base/237703 Log: MFC: r237350, r237357 Add support for the following Moxa PCIe multiport serial boards: - CP102E - CP102EL - CP114EL - CP118EL-A - CP168EL-A Modified: stable/9/sys/dev/puc/puc_cfg.h stable/9/sys/dev/puc/pucdata.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/puc/puc_cfg.h ============================================================================== --- stable/9/sys/dev/puc/puc_cfg.h Thu Jun 28 10:40:57 2012 (r237702) +++ stable/9/sys/dev/puc/puc_cfg.h Thu Jun 28 11:15:48 2012 (r237703) @@ -79,7 +79,7 @@ struct puc_cfg { int8_t ports; int8_t rid; /* Rid of first port */ int8_t d_rid; /* Delta rid of next ports */ - int8_t d_ofs; /* Delta offset of next ports */ + int16_t d_ofs; /* Delta offset of next ports */ puc_config_f *config_function; }; Modified: stable/9/sys/dev/puc/pucdata.c ============================================================================== --- stable/9/sys/dev/puc/pucdata.c Thu Jun 28 10:40:57 2012 (r237702) +++ stable/9/sys/dev/puc/pucdata.c Thu Jun 28 11:15:48 2012 (r237703) @@ -507,6 +507,18 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_quatech }, + { 0x1393, 0x1024, 0xffff, 0, + "Moxa Technologies, Smartio CP-102E/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x14, 0, 0x200 + }, + + { 0x1393, 0x1025, 0xffff, 0, + "Moxa Technologies, Smartio CP-102EL/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x14, 0, 0x200, + }, + { 0x1393, 0x1040, 0xffff, 0, "Moxa Technologies, Smartio C104H/PCI", DEFAULT_RCLK * 8, @@ -550,6 +562,19 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1144, 0xffff, 0, + "Moxa Technologies, Smartio CP-114EL/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x14, 0, -1, + .config_function = puc_config_moxa + }, + + { 0x1393, 0x1182, 0xffff, 0, + "Moxa Technologies, Smartio CP-118EL-A/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x14, 0, 0x200, + }, + { 0x1393, 0x1680, 0xffff, 0, "Moxa Technologies, C168H/PCI", DEFAULT_RCLK * 8, @@ -568,6 +593,12 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_8S, 0x18, 0, 8, }, + { 0x1393, 0x1683, 0xffff, 0, + "Moxa Technologies, Smartio CP-168EL-A/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x14, 0, 0x200, + }, + { 0x13a8, 0x0152, 0xffff, 0, "Exar XR17C/D152", DEFAULT_RCLK * 8, @@ -1121,9 +1152,7 @@ static int puc_config_moxa(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { - const struct puc_cfg *cfg = sc->sc_cfg; - - if (cmd == PUC_CFG_GET_OFS && cfg->device == 0x1045) { + if (cmd == PUC_CFG_GET_OFS) { *res = ((port == 3) ? 7 : port) * 0x200; return 0; } From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 13:00:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5388E1065670; Thu, 28 Jun 2012 13:00:54 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 339328FC12; Thu, 28 Jun 2012 13:00:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5SD0pJS055734; Thu, 28 Jun 2012 13:00:52 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4FEC557F.4080807@gmail.com> Date: Thu, 28 Jun 2012 21:00:47 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: davidxu@freebsd.org References: <201206272032.q5RKWjvt031174@svn.freebsd.org> <4FEBB8C9.8070006@gmail.com> <4FEBC0A2.3010708@gmail.com> <4FEBC70F.40408@gmail.com> <20120628075301.GS2337@deviant.kiev.zoral.com.ua> <4FEC1AAB.6070408@gmail.com> In-Reply-To: <4FEC1AAB.6070408@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , Attilio Rao , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 13:00:54 -0000 On 2012/6/28 16:49, David Xu wrote: > On 2012/6/28 15:53, Konstantin Belousov wrote: >> On Thu, Jun 28, 2012 at 10:53:03AM +0800, David Xu wrote: >>> On 2012/6/28 10:32, Attilio Rao wrote: >>>> 2012/6/28, David Xu: >>>>> On 2012/6/28 10:21, Attilio Rao wrote: >>>>>> 2012/6/28, David Xu: >>>>>>> On 2012/6/28 4:32, Konstantin Belousov wrote: >>>>>>>> Author: kib >>>>>>>> Date: Wed Jun 27 20:32:45 2012 >>>>>>>> New Revision: 237660 >>>>>>>> URL: http://svn.freebsd.org/changeset/base/237660 >>>>>>>> >>>>>>>> Log: >>>>>>>> Optimize the handling of SC_NPROCESSORS_CONF, by using auxv >>>>>>>> AT_NCPU >>>>>>>> value if present. >>>>>>>> >>>>>>>> MFC after: 1 week >>>>>>>> >>>>>>>> Modified: >>>>>>>> head/lib/libc/gen/sysconf.c >>>>>>>> >>>>>>>> Modified: head/lib/libc/gen/sysconf.c >>>>>>>> ============================================================================== >>>>>>>> >>>>>>>> --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 >>>>>>>> (r237659) >>>>>>>> +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 >>>>>>>> (r237660) >>>>>>>> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); >>>>>>>> #include >>>>>>>> #include >>>>>>>> >>>>>>>> +#include >>>>>>>> #include >>>>>>>> #include >>>>>>>> #include >>>>>>>> @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); >>>>>>>> >>>>>>>> #include "../stdlib/atexit.h" >>>>>>>> #include "tzfile.h" /* from >>>>>>>> ../../../contrib/tzcode/stdtime */ >>>>>>>> +#include "libc_private.h" >>>>>>>> >>>>>>>> #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ >>>>>>>> >>>>>>>> @@ -585,6 +587,8 @@ yesno: >>>>>>>> >>>>>>>> case _SC_NPROCESSORS_CONF: >>>>>>>> case _SC_NPROCESSORS_ONLN: >>>>>>>> + if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) == 0) >>>>>>>> + return ((long)value); >>>>>>>> mib[0] = CTL_HW; >>>>>>>> mib[1] = HW_NCPU; >>>>>>>> break; >>>>>>>> >>>>>>> Will this make controlling the number of CPU online or CPU hotplug >>>>>>> be impossible on FreeBSD ? >>>>>> If I think about hotplug CPUs I can think of other 1000 >>>>>> problems/races/bad situations to be fixed before this one, really. >>>>> These are problems only in kernel, but kib's change is about ABI >>>>> between userland and kernel, I hope we don't introduce an ABI which >>>>> is not extendable road stone. >>>> I'm not entirely sure I see the ABI breakage here. >>> It is not breakage, it is the ABI thinks number of online cpu is fixed, >>> obviously, it is not the case in future unless FreeBSD won't support >>> dynamic number of online cpus. >>> >>> >>>> If the AT_NCPUS >>>> becames unconvenient and not correct at some point we can just fix >>>> sysconf() to not look into the aux vector anymoe. >>> If you already know this will be a problem, why do you introduce it >>> and later need to fix it ? >>> >>>> Please note that >>>> AT_NCPUS is already exported nowadays. I think this is instead a >>>> clever optimization to avoid the sysctl() (usual way to retrieve the >>>> number of CPUs). >>> But why don't you cache it in libc ? following code is enough: >>> >>> static int online_cpu; >>> if (online_cpu == 0) >>> online_cpu = sysctl >>> return online_cpu; >>> >> Thread did evolved somewhat while I was AFK. >> >> First, please note that the ABI which I designed there is fixable: >> if kernel does not export AT_NCPUS at all, then auxv correctly handles >> the situation returning an error, and libc falls back to sysctl(2). > > Do we really want to bypass sysctl and instead passing all info via > auxv vector ? > I found the sysconf() is a bunch of switch-case, which is already > slow, before > _SC_NPROCESSES_ONLN, it has already a quite number of case branches, > and in your code, it calls _elf_aux_info() which also has some > switch-cases branch, > if you cache smp_cpus in libc, the call for _elf_aux_info is not > needed, and you > don't need code in kernel to passing it either, in any case, the code > to call > sysctl is still needed, so why don't we just use sysctl instead and cache > the result in libc ? this at least can generate small code and a bit > faster after > first call to sysconf(_SC_NPROCESSES_ONLN). And as a side note, I think we should not put non-critical code into fork/exec path, these two functions are rather critical path for any UNIX like system, anything slowing down these two functions will affect overall performance, so we should not waste cpu cycle trying to push data to user mode via auxv or other ways and yet the data is not used by user code in most time, such as the number of online cpu. And in rtld-elf or libc, we should not waste too much time before executing main(). Regards, David Xu From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 13:04:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 299081065673; Thu, 28 Jun 2012 13:04:56 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 143688FC1C; Thu, 28 Jun 2012 13:04:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SD4tVU077420; Thu, 28 Jun 2012 13:04:55 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SD4tJa077418; Thu, 28 Jun 2012 13:04:55 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206281304.q5SD4tJa077418@svn.freebsd.org> From: Warren Block Date: Thu, 28 Jun 2012 13:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237706 - stable/9/sbin/geom/class/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 13:04:56 -0000 Author: wblock (doc committer) Date: Thu Jun 28 13:04:55 2012 New Revision: 237706 URL: http://svn.freebsd.org/changeset/base/237706 Log: MFC r237620: Use possessive "its", no apostrophe. Modified: stable/9/sbin/geom/class/raid/graid.8 Directory Properties: stable/9/sbin/geom/class/raid/ (props changed) Modified: stable/9/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/9/sbin/geom/class/raid/graid.8 Thu Jun 28 11:58:10 2012 (r237705) +++ stable/9/sbin/geom/class/raid/graid.8 Thu Jun 28 13:04:55 2012 (r237706) @@ -85,7 +85,7 @@ utility is used to manage software RAID GEOM RAID class. GEOM RAID class uses on-disk metadata to provide access to software-RAID volumes defined by different RAID BIOSes. -Depending on RAID BIOS type and it's metadata format, different subsets of +Depending on RAID BIOS type and its metadata format, different subsets of configurations and features are supported. To allow booting from RAID volume, the metadata format should match the RAID BIOS type and its capabilities. From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 13:05:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F9F6106564A; Thu, 28 Jun 2012 13:05:57 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A2A08FC26; Thu, 28 Jun 2012 13:05:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SD5v8u077495; Thu, 28 Jun 2012 13:05:57 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SD5vOI077493; Thu, 28 Jun 2012 13:05:57 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206281305.q5SD5vOI077493@svn.freebsd.org> From: Warren Block Date: Thu, 28 Jun 2012 13:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237707 - stable/8/sbin/geom/class/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 13:05:57 -0000 Author: wblock (doc committer) Date: Thu Jun 28 13:05:56 2012 New Revision: 237707 URL: http://svn.freebsd.org/changeset/base/237707 Log: MFC r237620: Use possessive "its", no apostrophe. Modified: stable/8/sbin/geom/class/raid/graid.8 Directory Properties: stable/8/sbin/geom/class/raid/ (props changed) Modified: stable/8/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/8/sbin/geom/class/raid/graid.8 Thu Jun 28 13:04:55 2012 (r237706) +++ stable/8/sbin/geom/class/raid/graid.8 Thu Jun 28 13:05:56 2012 (r237707) @@ -85,7 +85,7 @@ utility is used to manage software RAID GEOM RAID class. GEOM RAID class uses on-disk metadata to provide access to software-RAID volumes defined by different RAID BIOSes. -Depending on RAID BIOS type and it's metadata format, different subsets of +Depending on RAID BIOS type and its metadata format, different subsets of configurations and features are supported. To allow booting from RAID volume, the metadata format should match the RAID BIOS type and its capabilities. From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 13:10:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D848C106566C; Thu, 28 Jun 2012 13:10:36 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C37AB8FC1B; Thu, 28 Jun 2012 13:10:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SDAald077811; Thu, 28 Jun 2012 13:10:36 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SDAaFo077809; Thu, 28 Jun 2012 13:10:36 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206281310.q5SDAaFo077809@svn.freebsd.org> From: Warren Block Date: Thu, 28 Jun 2012 13:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237708 - stable/9/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 13:10:37 -0000 Author: wblock (doc committer) Date: Thu Jun 28 13:10:36 2012 New Revision: 237708 URL: http://svn.freebsd.org/changeset/base/237708 Log: MFC r237655: Point out that /usr/src, /usr/doc, and /usr/ports may be empty or not exist until populated with csup(1) or svn(1). PR: 169487 Submitted by: Moritz Wilhelmy Modified: stable/9/share/man/man7/build.7 Directory Properties: stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/build.7 ============================================================================== --- stable/9/share/man/man7/build.7 Thu Jun 28 13:05:56 2012 (r237707) +++ stable/9/share/man/man7/build.7 Thu Jun 28 13:10:36 2012 (r237708) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 29, 2011 +.Dd June 27, 2012 .Dt BUILD 7 .Os .Sh NAME @@ -39,6 +39,10 @@ normally .Pa /usr/doc , and .Pa /usr/ports . +These directories may be initially empty or non-existent until updated with +.Xr csup 1 +or +.Xr svn 1 . Directory .Pa /usr/src contains the @@ -489,7 +493,7 @@ on built objects. .It Va NO_SHARE If set, the build does not descend into the .Pa /usr/src/share -subdirectory (i.e. manpages, locale data files, timezone data files and +subdirectory (i.e., manpages, locale data files, timezone data files and other .Pa /usr/src/share files will not be rebuild from their sources). @@ -594,8 +598,10 @@ make TARGET=sparc64 DESTDIR=/clients/spa .Ed .Sh SEE ALSO .Xr cc 1 , +.Xr csup 1 , .Xr install 1 , .Xr make 1 , +.Xr svn 1 , .Xr make.conf 5 , .Xr src.conf 5 , .Xr ports 7 , From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 13:11:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30E53106566C; Thu, 28 Jun 2012 13:11:35 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AFFB8FC1A; Thu, 28 Jun 2012 13:11:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SDBY15077895; Thu, 28 Jun 2012 13:11:34 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SDBYBs077893; Thu, 28 Jun 2012 13:11:34 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206281311.q5SDBYBs077893@svn.freebsd.org> From: Warren Block Date: Thu, 28 Jun 2012 13:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237709 - stable/8/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 13:11:35 -0000 Author: wblock (doc committer) Date: Thu Jun 28 13:11:34 2012 New Revision: 237709 URL: http://svn.freebsd.org/changeset/base/237709 Log: MFC r237655: Point out that /usr/src, /usr/doc, and /usr/ports may be empty or not exist until populated with csup(1) or svn(1). PR: 169487 Submitted by: Moritz Wilhelmy Modified: stable/8/share/man/man7/build.7 Directory Properties: stable/8/share/man/man7/ (props changed) Modified: stable/8/share/man/man7/build.7 ============================================================================== --- stable/8/share/man/man7/build.7 Thu Jun 28 13:10:36 2012 (r237708) +++ stable/8/share/man/man7/build.7 Thu Jun 28 13:11:34 2012 (r237709) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 29, 2011 +.Dd June 27, 2012 .Dt BUILD 7 .Os .Sh NAME @@ -39,6 +39,10 @@ normally .Pa /usr/doc , and .Pa /usr/ports . +These directories may be initially empty or non-existent until updated with +.Xr csup 1 +or +.Xr svn 1 . Directory .Pa /usr/src contains the @@ -455,7 +459,7 @@ on built objects. .It Va NO_SHARE If set, the build does not descend into the .Pa /usr/src/share -subdirectory (i.e. manpages, locale data files, timezone data files and +subdirectory (i.e., manpages, locale data files, timezone data files and other .Pa /usr/src/share files will not be rebuild from their sources). @@ -556,8 +560,10 @@ make TARGET=sparc64 DESTDIR=/clients/spa .Ed .Sh SEE ALSO .Xr cc 1 , +.Xr csup 1 , .Xr install 1 , .Xr make 1 , +.Xr svn 1 , .Xr make.conf 5 , .Xr src.conf 5 , .Xr ports 7 , From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 13:12:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DD2B106566C; Thu, 28 Jun 2012 13:12:35 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 075948FC1B; Thu, 28 Jun 2012 13:12:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SDCY6W077977; Thu, 28 Jun 2012 13:12:34 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SDCYS4077975; Thu, 28 Jun 2012 13:12:34 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206281312.q5SDCYS4077975@svn.freebsd.org> From: Warren Block Date: Thu, 28 Jun 2012 13:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237710 - stable/7/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 13:12:35 -0000 Author: wblock (doc committer) Date: Thu Jun 28 13:12:34 2012 New Revision: 237710 URL: http://svn.freebsd.org/changeset/base/237710 Log: MFC r237655: Point out that /usr/src, /usr/doc, and /usr/ports may be empty or not exist until populated with csup(1) or svn(1). PR: 169487 Submitted by: Moritz Wilhelmy Modified: stable/7/share/man/man7/build.7 Directory Properties: stable/7/share/man/man7/ (props changed) Modified: stable/7/share/man/man7/build.7 ============================================================================== --- stable/7/share/man/man7/build.7 Thu Jun 28 13:11:34 2012 (r237709) +++ stable/7/share/man/man7/build.7 Thu Jun 28 13:12:34 2012 (r237710) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 29, 2011 +.Dd June 27, 2012 .Dt BUILD 7 .Os .Sh NAME @@ -39,6 +39,10 @@ normally .Pa /usr/doc , and .Pa /usr/ports . +These directories may be initially empty or non-existent until updated with +.Xr csup 1 +or +.Xr svn 1 . Directory .Pa /usr/src contains the @@ -422,7 +426,7 @@ on built objects. .It Va NO_SHARE If set, the build does not descend into the .Pa /usr/src/share -subdirectory (i.e. manpages, locale data files, timezone data files and +subdirectory (i.e., manpages, locale data files, timezone data files and other .Pa /usr/src/share files will not be rebuild from their sources). @@ -494,8 +498,10 @@ make TARGET_ARCH=sparc64 DESTDIR=/client .Ed .Sh SEE ALSO .Xr cc 1 , +.Xr csup 1 , .Xr install 1 , .Xr make 1 , +.Xr svn 1 , .Xr make.conf 5 , .Xr src.conf 5 , .Xr ports 7 , From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 13:52:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD3D91065673; Thu, 28 Jun 2012 13:52:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 749E68FC0C; Thu, 28 Jun 2012 13:52:51 +0000 (UTC) Received: by bkwj5 with SMTP id j5so592280bkw.13 for ; Thu, 28 Jun 2012 06:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=w7+k37PzZz5xlnNJFcLjPNytDPmZ3jGTOFKJJf4hlrc=; b=DJCE/42jZfnOtgi6uNNebjhI9zsXrAj0ygIDGUehTRP3tiKiF1kqcjV7u+NCp8Smn4 IyX0DKcsVs/QR7UpMI1QddCyZa5e0yI+J6ZJkE0o8gBwIgdCsnNmbGW0R/eOfJmxaPW7 Rg/O4df3+hPJsOwk/bq1hhpuuS1HQYaTBp/jyjQlpN2oFq+OAzF7SPEvBHv54t6ym9Ax OON/9Zp/SwIrJ+ytrN/OhFIYuTW7ZNyJFOJz+JkP9SpgPvkq1IeS+hk6IUUP252iscmq RJyVOJdxJZDMPZT4qPRWk3XS89bYlP0U+5PyBqwV21Wi4PS4efYedTZG88z1V/m0ZdDV MGqg== MIME-Version: 1.0 Received: by 10.152.144.168 with SMTP id sn8mr2338079lab.1.1340891570434; Thu, 28 Jun 2012 06:52:50 -0700 (PDT) Received: by 10.112.98.65 with HTTP; Thu, 28 Jun 2012 06:52:50 -0700 (PDT) In-Reply-To: <4FEC557F.4080807@gmail.com> References: <201206272032.q5RKWjvt031174@svn.freebsd.org> <4FEBB8C9.8070006@gmail.com> <4FEBC0A2.3010708@gmail.com> <4FEBC70F.40408@gmail.com> <20120628075301.GS2337@deviant.kiev.zoral.com.ua> <4FEC1AAB.6070408@gmail.com> <4FEC557F.4080807@gmail.com> Date: Thu, 28 Jun 2012 16:52:50 +0300 Message-ID: From: Kostik Belousov To: davidxu@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Attilio Rao , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 13:52:52 -0000 On Thu, Jun 28, 2012 at 4:00 PM, David Xu wrote: > On 2012/6/28 16:49, David Xu wrote: >> >> On 2012/6/28 15:53, Konstantin Belousov wrote: >>> >>> On Thu, Jun 28, 2012 at 10:53:03AM +0800, David Xu wrote: >>>> >>>> On 2012/6/28 10:32, Attilio Rao wrote: >>>>> >>>>> 2012/6/28, David Xu: >>>>>> >>>>>> On 2012/6/28 10:21, Attilio Rao wrote: >>>>>>> >>>>>>> 2012/6/28, David Xu: >>>>>>>> >>>>>>>> On 2012/6/28 4:32, Konstantin Belousov wrote: >>>>>>>>> >>>>>>>>> Author: kib >>>>>>>>> Date: Wed Jun 27 20:32:45 2012 >>>>>>>>> New Revision: 237660 >>>>>>>>> URL: http://svn.freebsd.org/changeset/base/237660 >>>>>>>>> >>>>>>>>> Log: >>>>>>>>> =A0 =A0 Optimize the handling of SC_NPROCESSORS_CONF, by using au= xv >>>>>>>>> =A0 =A0 AT_NCPU >>>>>>>>> =A0 =A0 value if present. >>>>>>>>> >>>>>>>>> =A0 =A0 MFC after: =A0 =A01 week >>>>>>>>> >>>>>>>>> Modified: >>>>>>>>> =A0 =A0 head/lib/libc/gen/sysconf.c >>>>>>>>> >>>>>>>>> Modified: head/lib/libc/gen/sysconf.c >>>>>>>>> >>>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >>>>>>>>> --- head/lib/libc/gen/sysconf.c =A0 =A0Wed Jun 27 20:24:25 2012 >>>>>>>>> (r237659) >>>>>>>>> +++ head/lib/libc/gen/sysconf.c =A0 =A0Wed Jun 27 20:32:45 2012 >>>>>>>>> (r237660) >>>>>>>>> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); >>>>>>>>> =A0 =A0#include >>>>>>>>> =A0 =A0#include >>>>>>>>> >>>>>>>>> +#include >>>>>>>>> =A0 =A0#include >>>>>>>>> =A0 =A0#include >>>>>>>>> =A0 =A0#include >>>>>>>>> @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); >>>>>>>>> >>>>>>>>> =A0 =A0#include "../stdlib/atexit.h" >>>>>>>>> =A0 =A0#include "tzfile.h" =A0 =A0 =A0 =A0/* from >>>>>>>>> =A0 =A0../../../contrib/tzcode/stdtime */ >>>>>>>>> +#include "libc_private.h" >>>>>>>>> >>>>>>>>> =A0 =A0#define =A0 =A0_PATH_ZONEINFO =A0 =A0TZDIR =A0 =A0/* from = tzfile.h */ >>>>>>>>> >>>>>>>>> @@ -585,6 +587,8 @@ yesno: >>>>>>>>> >>>>>>>>> =A0 =A0 =A0 =A0case _SC_NPROCESSORS_CONF: >>>>>>>>> =A0 =A0 =A0 =A0case _SC_NPROCESSORS_ONLN: >>>>>>>>> + =A0 =A0 =A0 =A0if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)= ) =3D=3D 0) >>>>>>>>> + =A0 =A0 =A0 =A0 =A0 =A0return ((long)value); >>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0mib[0] =3D CTL_HW; >>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0mib[1] =3D HW_NCPU; >>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0break; >>>>>>>>> >>>>>>>> Will this make controlling the number of CPU online or CPU hotplug >>>>>>>> be impossible on FreeBSD ? >>>>>>> >>>>>>> If I think about hotplug CPUs I can think of other 1000 >>>>>>> problems/races/bad situations to be fixed before this one, really. >>>>>> >>>>>> These are problems only in kernel, but kib's change is about ABI >>>>>> between userland and kernel, I hope we don't introduce an ABI which >>>>>> is not extendable road stone. >>>>> >>>>> I'm not entirely sure I see the ABI breakage here. >>>> >>>> It is not breakage, it is the ABI thinks number of online cpu is fixed= , >>>> obviously, it is not the case in future unless FreeBSD won't support >>>> dynamic number of online cpus. >>>> >>>> >>>>> If the AT_NCPUS >>>>> becames unconvenient and not correct at some point we can just fix >>>>> sysconf() to not look into the aux vector anymoe. >>>> >>>> If you already know this will be a problem, why do you introduce it >>>> and later need to fix it ? >>>> >>>>> =A0Please note that >>>>> AT_NCPUS is already exported nowadays. I think this is instead a >>>>> clever optimization to avoid the sysctl() (usual way to retrieve the >>>>> number of CPUs). >>>> >>>> But why don't you cache it in libc ? following code is enough: >>>> >>>> static int online_cpu; >>>> if (online_cpu =3D=3D 0) >>>> =A0 =A0 online_cpu =3D sysctl >>>> return online_cpu; >>>> >>> Thread did evolved somewhat while I was AFK. >>> >>> First, please note that the ABI which I designed there is fixable: >>> if kernel does not export AT_NCPUS at all, then auxv correctly handles >>> the situation returning an error, and libc falls back to sysctl(2). >> >> >> Do we really want to bypass sysctl and instead passing all info via auxv >> vector ? >> I found the sysconf() is a bunch of switch-case, which is already slow, >> before >> _SC_NPROCESSES_ONLN, =A0it has already a quite number of case branches, >> and in your code, it calls _elf_aux_info() which also has some >> switch-cases branch, >> if you cache smp_cpus in libc, the call for _elf_aux_info is not needed, >> and you >> don't need code in kernel to passing it either, in any case, the code to >> call >> sysctl is still needed, so why don't we just use sysctl instead and cach= e >> the result in libc ? this at least can generate small code and a bit >> faster after >> first call to sysconf(_SC_NPROCESSES_ONLN). > > > And as a side note, I think we should not put non-critical code into > fork/exec > path, =A0these two functions are rather critical path for any UNIX like > system, > anything slowing down these two functions will affect overall performance= , > so we should not waste cpu cycle trying to push data to user mode via aux= v > or other ways and yet the data is not used by user code in most time, > such as the number of online cpu. And in rtld-elf or libc, we should not > waste > too much time before executing main(). My motivation for extending auxv vector and to develop auxv.c was exactly to shave around dozen of syscalls from the application startup sequence. If you look at the ktrace output of the binary startup on RELENG_8 libc, you should note exactly the sysctls to request ncpus, pagesizes, canary and so on. In RELENG_9 and HEAD, there are no sysctls in the trace, because the data is already pre-filled by kernel for libc consumption. The sysconf(3) commit you are commenting on was caused by jemalloc(3) initialization starting using _sysconf(3) to query ncpu (for older version, which used sysctl directly, I direct auxv call). So HEAD has temporary +1 sysctl syscall done on app startup, now it should be back to zero. In other words, 'we should not put non-critical code into fork/exec path' exactly contradicts with proposal to remove auxv, since exec would need to call sysctls to fetch the same data. From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 14:13:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C6F51065676; Thu, 28 Jun 2012 14:13:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA14A8FC14; Thu, 28 Jun 2012 14:13:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SEDjgX080541; Thu, 28 Jun 2012 14:13:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SEDjXI080538; Thu, 28 Jun 2012 14:13:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206281413.q5SEDjXI080538@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 28 Jun 2012 14:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237712 - stable/9/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 14:13:46 -0000 Author: kib Date: Thu Jun 28 14:13:45 2012 New Revision: 237712 URL: http://svn.freebsd.org/changeset/base/237712 Log: MFC r237058: Eliminate the static buffer used to read the first page of the mapped object, and eliminate the pread(2) call as well. Mmap the first page of the object temporaly, and unmap it on error or last use. Potentially, this leaves one-page gap between succeeding dlopen(3), but there are other mmap(2) consumers as well. Fix several cases were the whole mapping of the object leaked on error. Use MAP_PREFAULT_READ for mmap(2) calls which map real object pages Modified: stable/9/libexec/rtld-elf/map_object.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/map_object.c ============================================================================== --- stable/9/libexec/rtld-elf/map_object.c Thu Jun 28 13:47:07 2012 (r237711) +++ stable/9/libexec/rtld-elf/map_object.c Thu Jun 28 14:13:45 2012 (r237712) @@ -38,7 +38,7 @@ #include "debug.h" #include "rtld.h" -static Elf_Ehdr *get_elf_header (int, const char *); +static Elf_Ehdr *get_elf_header(int, const char *); static int convert_prot(int); /* Elf flags -> mmap protection */ static int convert_flags(int); /* Elf flags -> mmap flags */ @@ -121,7 +121,7 @@ map_object(int fd, const char *path, con if ((segs[nsegs]->p_align & (PAGE_SIZE - 1)) != 0) { _rtld_error("%s: PT_LOAD segment %d not page-aligned", path, nsegs); - return NULL; + goto error; } break; @@ -161,12 +161,12 @@ map_object(int fd, const char *path, con } if (phdyn == NULL) { _rtld_error("%s: object is not dynamically-linked", path); - return NULL; + goto error; } if (nsegs < 0) { _rtld_error("%s: too few PT_LOAD segments", path); - return NULL; + goto error; } /* @@ -183,13 +183,12 @@ map_object(int fd, const char *path, con if (mapbase == (caddr_t) -1) { _rtld_error("%s: mmap of entire address space failed: %s", path, rtld_strerror(errno)); - return NULL; + goto error; } if (base_addr != NULL && mapbase != base_addr) { _rtld_error("%s: mmap returned wrong address: wanted %p, got %p", path, base_addr, mapbase); - munmap(mapbase, mapsize); - return NULL; + goto error1; } for (i = 0; i <= nsegs; i++) { @@ -201,10 +200,10 @@ map_object(int fd, const char *path, con data_prot = convert_prot(segs[i]->p_flags); data_flags = convert_flags(segs[i]->p_flags) | MAP_FIXED; if (mmap(data_addr, data_vlimit - data_vaddr, data_prot, - data_flags, fd, data_offset) == (caddr_t) -1) { + data_flags | MAP_PREFAULT_READ, fd, data_offset) == (caddr_t) -1) { _rtld_error("%s: mmap of data failed: %s", path, rtld_strerror(errno)); - return NULL; + goto error1; } /* Do BSS setup */ @@ -221,7 +220,7 @@ map_object(int fd, const char *path, con mprotect(clear_page, PAGE_SIZE, data_prot|PROT_WRITE)) { _rtld_error("%s: mprotect failed: %s", path, rtld_strerror(errno)); - return NULL; + goto error1; } memset(clear_addr, 0, nclear); @@ -240,7 +239,7 @@ map_object(int fd, const char *path, con data_flags | MAP_ANON, -1, 0) == (caddr_t)-1) { _rtld_error("%s: mmap of bss failed: %s", path, rtld_strerror(errno)); - return NULL; + goto error1; } } } @@ -273,7 +272,7 @@ map_object(int fd, const char *path, con if (obj->phdr == NULL) { obj_free(obj); _rtld_error("%s: cannot allocate program header", path); - return NULL; + goto error1; } memcpy((char *)obj->phdr, (char *)hdr + hdr->e_phoff, phsize); obj->phdr_alloc = true; @@ -293,63 +292,72 @@ map_object(int fd, const char *path, con obj->relro_page = obj->relocbase + trunc_page(relro_page); obj->relro_size = round_page(relro_size); - return obj; + munmap(hdr, PAGE_SIZE); + return (obj); + +error1: + munmap(mapbase, mapsize); +error: + munmap(hdr, PAGE_SIZE); + return (NULL); } static Elf_Ehdr * -get_elf_header (int fd, const char *path) +get_elf_header(int fd, const char *path) { - static union { - Elf_Ehdr hdr; - char buf[PAGE_SIZE]; - } u; - ssize_t nbytes; - - if ((nbytes = pread(fd, u.buf, PAGE_SIZE, 0)) == -1) { - _rtld_error("%s: read error: %s", path, rtld_strerror(errno)); - return NULL; - } - - /* Make sure the file is valid */ - if (nbytes < (ssize_t)sizeof(Elf_Ehdr) || !IS_ELF(u.hdr)) { - _rtld_error("%s: invalid file format", path); - return NULL; - } - if (u.hdr.e_ident[EI_CLASS] != ELF_TARG_CLASS - || u.hdr.e_ident[EI_DATA] != ELF_TARG_DATA) { - _rtld_error("%s: unsupported file layout", path); - return NULL; - } - if (u.hdr.e_ident[EI_VERSION] != EV_CURRENT - || u.hdr.e_version != EV_CURRENT) { - _rtld_error("%s: unsupported file version", path); - return NULL; - } - if (u.hdr.e_type != ET_EXEC && u.hdr.e_type != ET_DYN) { - _rtld_error("%s: unsupported file type", path); - return NULL; - } - if (u.hdr.e_machine != ELF_TARG_MACH) { - _rtld_error("%s: unsupported machine", path); - return NULL; - } + Elf_Ehdr *hdr; - /* - * We rely on the program header being in the first page. This is - * not strictly required by the ABI specification, but it seems to - * always true in practice. And, it simplifies things considerably. - */ - if (u.hdr.e_phentsize != sizeof(Elf_Phdr)) { - _rtld_error( - "%s: invalid shared object: e_phentsize != sizeof(Elf_Phdr)", path); - return NULL; - } - if (u.hdr.e_phoff + u.hdr.e_phnum * sizeof(Elf_Phdr) > (size_t)nbytes) { - _rtld_error("%s: program header too large", path); - return NULL; - } + hdr = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE | MAP_PREFAULT_READ, + fd, 0); + if (hdr == (Elf_Ehdr *)MAP_FAILED) { + _rtld_error("%s: read error: %s", path, rtld_strerror(errno)); + return (NULL); + } + + /* Make sure the file is valid */ + if (!IS_ELF(*hdr)) { + _rtld_error("%s: invalid file format", path); + goto error; + } + if (hdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || + hdr->e_ident[EI_DATA] != ELF_TARG_DATA) { + _rtld_error("%s: unsupported file layout", path); + goto error; + } + if (hdr->e_ident[EI_VERSION] != EV_CURRENT || + hdr->e_version != EV_CURRENT) { + _rtld_error("%s: unsupported file version", path); + goto error; + } + if (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN) { + _rtld_error("%s: unsupported file type", path); + goto error; + } + if (hdr->e_machine != ELF_TARG_MACH) { + _rtld_error("%s: unsupported machine", path); + goto error; + } - return (&u.hdr); + /* + * We rely on the program header being in the first page. This is + * not strictly required by the ABI specification, but it seems to + * always true in practice. And, it simplifies things considerably. + */ + if (hdr->e_phentsize != sizeof(Elf_Phdr)) { + _rtld_error( + "%s: invalid shared object: e_phentsize != sizeof(Elf_Phdr)", path); + goto error; + } + if (hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr) > + (size_t)PAGE_SIZE) { + _rtld_error("%s: program header too large", path); + goto error; + } + return (hdr); + +error: + munmap(hdr, PAGE_SIZE); + return (NULL); } void From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 14:26:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5EB66106566B; Thu, 28 Jun 2012 14:26:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FD4E8FC19; Thu, 28 Jun 2012 14:26:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SEQuq6081214; Thu, 28 Jun 2012 14:26:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SEQtwV081212; Thu, 28 Jun 2012 14:26:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206281426.q5SEQtwV081212@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 28 Jun 2012 14:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237713 - stable/9/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 14:26:56 -0000 Author: kib Date: Thu Jun 28 14:26:55 2012 New Revision: 237713 URL: http://svn.freebsd.org/changeset/base/237713 Log: Fix unbounded-length malloc, controlled from usermode. The added check is performed before exact size of the buffer is calculated, but the buffer cannot have size greater then the total space allocated for extended attributes. The existing check is executing with precise size, but it is too late, since buffer needs to be allocated in advance. Also, adapt to uio_resid being of ssize_t type. Use lblktosize instead of multiplying by fs block size by hand as well. Modified: stable/9/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vnops.c Thu Jun 28 14:13:45 2012 (r237712) +++ stable/9/sys/ufs/ffs/ffs_vnops.c Thu Jun 28 14:26:55 2012 (r237713) @@ -1649,7 +1649,8 @@ vop_setextattr { struct inode *ip; struct fs *fs; uint32_t ealength, ul; - int ealen, olen, eapad1, eapad2, error, i, easize; + ssize_t ealen; + int olen, eapad1, eapad2, error, i, easize; u_char *eae, *p; ip = VTOI(ap->a_vp); @@ -1668,6 +1669,10 @@ vop_setextattr { if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); + ealen = ap->a_uio->uio_resid; + if (ealen < 0 || ealen > lblktosize(fs, NXADDR)) + return (EINVAL); + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { @@ -1685,7 +1690,6 @@ vop_setextattr { if (error) return (error); - ealen = ap->a_uio->uio_resid; ealength = sizeof(uint32_t) + 3 + strlen(ap->a_name); eapad1 = 8 - (ealength % 8); if (eapad1 == 8) @@ -1713,7 +1717,7 @@ vop_setextattr { easize += (ealength - ul); } } - if (easize > NXADDR * fs->fs_bsize) { + if (easize > lblktosize(fs, NXADDR)) { free(eae, M_TEMP); ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 15:38:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E6477106566B; Thu, 28 Jun 2012 15:38:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D080D8FC1A; Thu, 28 Jun 2012 15:38:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SFcEub084118; Thu, 28 Jun 2012 15:38:14 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SFcE4h084116; Thu, 28 Jun 2012 15:38:14 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206281538.q5SFcE4h084116@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 28 Jun 2012 15:38: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: r237714 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 15:38:15 -0000 Author: pfg Date: Thu Jun 28 15:38:14 2012 New Revision: 237714 URL: http://svn.freebsd.org/changeset/base/237714 Log: Fix build with Clang. error: format specifies type 'long long' but the argument has type 'int64_t' (aka 'long') Reported by: Ed Maste Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Thu Jun 28 14:26:55 2012 (r237713) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Thu Jun 28 15:38:14 2012 (r237714) @@ -761,7 +761,7 @@ dt_print_llquantize(dtrace_hdl_t *dtp, F step = next > nsteps ? next / nsteps : 1; if (first_bin == 0) { - (void) snprintf(c, sizeof (c), "< %lld", value); + (void) snprintf(c, sizeof (c), "< %ld", value); if (dt_printf(dtp, fp, "%16s ", c) < 0) return (-1); From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 16:01:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D769C106564A; Thu, 28 Jun 2012 16:01:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0CC58FC17; Thu, 28 Jun 2012 16:01:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SG18UZ085093; Thu, 28 Jun 2012 16:01:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SG18ud085084; Thu, 28 Jun 2012 16:01:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201206281601.q5SG18ud085084@svn.freebsd.org> From: Michael Tuexen Date: Thu, 28 Jun 2012 16:01: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: r237715 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 16:01:08 -0000 Author: tuexen Date: Thu Jun 28 16:01:08 2012 New Revision: 237715 URL: http://svn.freebsd.org/changeset/base/237715 Log: Pass the src and dst address of a received packet explicitly around. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_asconf.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_input.h head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Jun 28 15:38:14 2012 (r237714) +++ head/sys/netinet/sctp_asconf.c Thu Jun 28 16:01:08 2012 (r237715) @@ -50,59 +50,8 @@ __FBSDID("$FreeBSD$"); */ -static void -sctp_asconf_get_source_ip(struct mbuf *m, struct sockaddr *sa) -{ - struct ip *iph; - -#ifdef INET - struct sockaddr_in *sin; - -#endif -#ifdef INET6 - struct sockaddr_in6 *sin6; - -#endif - - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - { - /* IPv4 source */ - sin = (struct sockaddr_in *)sa; - bzero(sin, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(struct sockaddr_in); - sin->sin_port = 0; - sin->sin_addr.s_addr = iph->ip_src.s_addr; - break; - } -#endif -#ifdef INET6 - case (IPV6_VERSION >> 4): - { - /* IPv6 source */ - struct ip6_hdr *ip6; - - sin6 = (struct sockaddr_in6 *)sa; - bzero(sin6, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_len = sizeof(struct sockaddr_in6); - sin6->sin6_port = 0; - ip6 = mtod(m, struct ip6_hdr *); - sin6->sin6_addr = ip6->ip6_src; - break; - } -#endif /* INET6 */ - default: - break; - } - return; -} - /* - * draft-ietf-tsvwg-addip-sctp + * RFC 5061 * * An ASCONF parameter queue exists per asoc which holds the pending address * operations. Lists are updated upon receipt of ASCONF-ACK. @@ -194,12 +143,12 @@ sctp_asconf_error_response(uint32_t id, } static struct mbuf * -sctp_process_asconf_add_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, +sctp_process_asconf_add_ip(struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int send_hb, int response_required) { struct sctp_nets *net; struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -279,11 +228,10 @@ sctp_process_asconf_add_ip(struct mbuf * /* if 0.0.0.0/::0, add the source address instead */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - sa = (struct sockaddr *)&sa_source; - sctp_asconf_get_source_ip(m, sa); + sa = src; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: using source addr "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } /* add the address */ if (bad_address) { @@ -343,11 +291,12 @@ sctp_asconf_del_remote_addrs_except(stru } static struct mbuf * -sctp_process_asconf_delete_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, +sctp_process_asconf_delete_ip(struct sockaddr *src, + struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -365,9 +314,6 @@ sctp_process_asconf_delete_ip(struct mbu #endif - /* get the source IP address for src and 0.0.0.0/::0 delete checks */ - sctp_asconf_get_source_ip(m, (struct sockaddr *)&sa_source); - aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); @@ -424,7 +370,7 @@ sctp_process_asconf_delete_ip(struct mbu } /* make sure the source address is not being deleted */ - if (sctp_cmpaddr(sa, (struct sockaddr *)&sa_source)) { + if (sctp_cmpaddr(sa, src)) { /* trying to delete the source address! */ SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: tried to delete source addr\n"); m_reply = sctp_asconf_error_response(aph->correlation_id, @@ -434,8 +380,7 @@ sctp_process_asconf_delete_ip(struct mbu } /* if deleting 0.0.0.0/::0, delete all addresses except src addr */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - result = sctp_asconf_del_remote_addrs_except(stcb, - (struct sockaddr *)&sa_source); + result = sctp_asconf_del_remote_addrs_except(stcb, src); if (result) { /* src address did not exist? */ @@ -475,12 +420,12 @@ sctp_process_asconf_delete_ip(struct mbu } static struct mbuf * -sctp_process_asconf_set_primary(struct mbuf *m, +sctp_process_asconf_set_primary(struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -550,11 +495,10 @@ sctp_process_asconf_set_primary(struct m /* if 0.0.0.0/::0, use the source address instead */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - sa = (struct sockaddr *)&sa_source; - sctp_asconf_get_source_ip(m, sa); + sa = src; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_set_primary: using source addr "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } /* set the primary address */ if (sctp_set_primary_addr(stcb, sa, NULL) == 0) { @@ -626,6 +570,7 @@ sctp_process_asconf_set_primary(struct m */ void sctp_handle_asconf(struct mbuf *m, unsigned int offset, + struct sockaddr *src, struct sctp_asconf_chunk *cp, struct sctp_tcb *stcb, int first) { @@ -762,13 +707,13 @@ sctp_handle_asconf(struct mbuf *m, unsig switch (param_type) { case SCTP_ADD_IP_ADDRESS: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_add_ip(m, aph, stcb, + m_result = sctp_process_asconf_add_ip(src, aph, stcb, (cnt < SCTP_BASE_SYSCTL(sctp_hb_maxburst)), error); cnt++; break; case SCTP_DEL_IP_ADDRESS: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_delete_ip(m, aph, stcb, + m_result = sctp_process_asconf_delete_ip(src, aph, stcb, error); break; case SCTP_ERROR_CAUSE_IND: @@ -776,7 +721,7 @@ sctp_handle_asconf(struct mbuf *m, unsig break; case SCTP_SET_PRIM_ADDR: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_set_primary(m, aph, + m_result = sctp_process_asconf_set_primary(src, aph, stcb, error); break; case SCTP_NAT_VTAGS: @@ -856,11 +801,7 @@ send_reply: * this could happen if the source address was just newly * added */ - struct sockaddr_storage addr; - struct sockaddr *src = (struct sockaddr *)&addr; - SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n"); - sctp_asconf_get_source_ip(m, src); SCTPDBG(SCTP_DEBUG_ASCONF1, "Looking for IP source: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); /* look up the from address */ Modified: head/sys/netinet/sctp_asconf.h ============================================================================== --- head/sys/netinet/sctp_asconf.h Thu Jun 28 15:38:14 2012 (r237714) +++ head/sys/netinet/sctp_asconf.h Thu Jun 28 16:01:08 2012 (r237715) @@ -46,8 +46,8 @@ extern void sctp_asconf_cleanup(struct s extern struct mbuf *sctp_compose_asconf(struct sctp_tcb *, int *, int); extern void -sctp_handle_asconf(struct mbuf *, unsigned int, struct sctp_asconf_chunk *, - struct sctp_tcb *, int i); +sctp_handle_asconf(struct mbuf *, unsigned int, struct sockaddr *, + struct sctp_asconf_chunk *, struct sctp_tcb *, int); extern void sctp_handle_asconf_ack(struct mbuf *, int, struct sctp_asconf_ack_chunk *, Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Jun 28 15:38:14 2012 (r237714) +++ head/sys/netinet/sctp_indata.c Thu Jun 28 16:01:08 2012 (r237715) @@ -2516,6 +2516,7 @@ doit_again: int sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t * high_tsn, uint8_t use_mflowid, uint32_t mflowid, @@ -2626,8 +2627,8 @@ sctp_process_data(struct mbuf **mm, int } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; - sctp_abort_association(inp, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); return (2); @@ -2695,6 +2696,7 @@ sctp_process_data(struct mbuf **mm, int op_err = sctp_generate_invmanparam(SCTP_CAUSE_PROTOCOL_VIOLATION); sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); Modified: head/sys/netinet/sctp_indata.h ============================================================================== --- head/sys/netinet/sctp_indata.h Thu Jun 28 15:38:14 2012 (r237714) +++ head/sys/netinet/sctp_indata.h Thu Jun 28 16:01:08 2012 (r237715) @@ -111,7 +111,9 @@ void sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, int *); int -sctp_process_data(struct mbuf **, int, int *, int, struct sctphdr *, +sctp_process_data(struct mbuf **, int, int *, int, + struct sockaddr *src, struct sockaddr *dst, + struct sctphdr *, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint32_t *, uint8_t, uint32_t, Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Jun 28 15:38:14 2012 (r237714) +++ head/sys/netinet/sctp_input.c Thu Jun 28 16:01:08 2012 (r237715) @@ -80,7 +80,8 @@ sctp_stop_all_cookie_timers(struct sctp_ /* INIT handler */ static void -sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_handle_init(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *cp, struct sctp_inpcb *inp, struct sctp_tcb *stcb, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -97,7 +98,7 @@ sctp_handle_init(struct mbuf *m, int iph /* validate length */ if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -109,7 +110,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->initiate_tag == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -119,7 +120,7 @@ sctp_handle_init(struct mbuf *m, int iph if (ntohl(init->a_rwnd) < SCTP_MIN_RWND) { /* invalid parameter... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -129,7 +130,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->num_inbound_streams == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -139,7 +140,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->num_outbound_streams == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -149,7 +150,7 @@ sctp_handle_init(struct mbuf *m, int iph if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ - sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -178,7 +179,7 @@ sctp_handle_init(struct mbuf *m, int iph * state :-) */ if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { - sctp_send_abort(m, iphlen, sh, 0, NULL, + sctp_send_abort(m, iphlen, src, dst, sh, 0, NULL, use_mflowid, mflowid, vrf_id, port); } @@ -191,7 +192,8 @@ sctp_handle_init(struct mbuf *m, int iph sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); } else { SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, + sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, src, dst, + sh, cp, use_mflowid, mflowid, vrf_id, port, ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); @@ -419,7 +421,8 @@ sctp_process_init(struct sctp_init_chunk * INIT-ACK message processing/consumption returns value < 0 on error */ static int -sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -454,13 +457,14 @@ sctp_process_init_ack(struct mbuf *m, in initack_limit = offset + ntohs(cp->ch.chunk_length); /* load all addresses */ if ((retval = sctp_load_addresses_from_init(stcb, m, - (offset + sizeof(struct sctp_init_chunk)), initack_limit, sh, - NULL))) { + (offset + sizeof(struct sctp_init_chunk)), initack_limit, + src, dst, NULL))) { /* Huh, we should abort */ SCTPDBG(SCTP_DEBUG_INPUT1, "Load addresses from INIT causes an abort %d\n", retval); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, NULL, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -536,7 +540,7 @@ sctp_process_init_ack(struct mbuf *m, in mp->resv = 0; } sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1278,7 +1282,8 @@ sctp_handle_error(struct sctp_chunkhdr * } static int -sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -1298,8 +1303,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_ack_chunk)) { /* Invalid length */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1310,8 +1315,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->initiate_tag == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1320,8 +1325,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (ntohl(init_ack->a_rwnd) < SCTP_MIN_RWND) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1330,8 +1335,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->num_inbound_streams == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1340,8 +1345,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->num_outbound_streams == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1365,7 +1370,7 @@ sctp_handle_init_ack(struct mbuf *m, int sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, stcb, 0, (void *)stcb->asoc.primary_destination, SCTP_SO_NOT_LOCKED); } - if (sctp_process_init_ack(m, iphlen, offset, sh, cp, stcb, + if (sctp_process_init_ack(m, iphlen, offset, src, dst, sh, cp, stcb, net, abort_no_unlock, use_mflowid, mflowid, vrf_id) < 0) { @@ -1419,6 +1424,7 @@ sctp_handle_init_ack(struct mbuf *m, int static struct sctp_tcb * sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -1435,6 +1441,7 @@ sctp_process_cookie_new(struct mbuf *m, */ static struct sctp_tcb * sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -1477,7 +1484,7 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_COOKIE_IN_SHUTDOWN); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, use_mflowid, mflowid, vrf_id, net->port); if (how_indx < sizeof(asoc->cookie_how)) @@ -1642,7 +1649,7 @@ sctp_process_cookie_existing(struct mbuf */ if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 4; return (NULL); @@ -1703,7 +1710,7 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_NAT_COLLIDING_STATE); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_abort(m, iphlen, sh, 0, op_err, + sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -1786,7 +1793,7 @@ sctp_process_cookie_existing(struct mbuf } if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 10; return (NULL); @@ -1867,7 +1874,8 @@ sctp_process_cookie_existing(struct mbuf * cookie_new code since we are allowing a duplicate * association. I hope this works... */ - return (sctp_process_cookie_new(m, iphlen, offset, sh, cookie, cookie_len, + return (sctp_process_cookie_new(m, iphlen, offset, src, dst, + sh, cookie, cookie_len, inp, netp, init_src, notification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, @@ -1972,7 +1980,7 @@ sctp_process_cookie_existing(struct mbuf if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 14; @@ -2003,6 +2011,7 @@ sctp_process_cookie_existing(struct mbuf */ static struct sctp_tcb * sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -2102,7 +2111,7 @@ sctp_process_cookie_new(struct mbuf *m, op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -2130,7 +2139,7 @@ sctp_process_cookie_new(struct mbuf *m, atomic_add_int(&stcb->asoc.refcnt, 1); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -2179,8 +2188,8 @@ sctp_process_cookie_new(struct mbuf *m, } /* load all addresses */ if (sctp_load_addresses_from_init(stcb, m, - init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, - init_src)) { + init_offset + sizeof(struct sctp_init_chunk), initack_offset, + src, dst, init_src)) { atomic_add_int(&stcb->asoc.refcnt, 1); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); @@ -2376,6 +2385,7 @@ sctp_process_cookie_new(struct mbuf *m, */ static struct mbuf * sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_cookie_echo_chunk *cp, struct sctp_inpcb **inp_p, struct sctp_tcb **stcb, struct sctp_nets **netp, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, @@ -2396,9 +2406,6 @@ sctp_handle_cookie_echo(struct mbuf *m, unsigned int cookie_len; struct timeval now; struct timeval time_expires; - struct sockaddr_storage dest_store; - struct sockaddr *localep_sa = (struct sockaddr *)&dest_store; - struct ip *iph; int notification = 0; struct sctp_nets *netl; int had_a_existing_tcb = 0; @@ -2419,45 +2426,6 @@ sctp_handle_cookie_echo(struct mbuf *m, if (inp_p == NULL) { return (NULL); } - /* First get the destination address setup too. */ - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - { - /* its IPv4 */ - struct sockaddr_in *lsin; - - lsin = (struct sockaddr_in *)(localep_sa); - memset(lsin, 0, sizeof(*lsin)); - lsin->sin_family = AF_INET; - lsin->sin_len = sizeof(*lsin); - lsin->sin_port = sh->dest_port; - lsin->sin_addr.s_addr = iph->ip_dst.s_addr; - break; - } -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - { - /* its IPv6 */ - struct ip6_hdr *ip6; - struct sockaddr_in6 *lsin6; - - lsin6 = (struct sockaddr_in6 *)(localep_sa); - memset(lsin6, 0, sizeof(*lsin6)); - lsin6->sin6_family = AF_INET6; - lsin6->sin6_len = sizeof(struct sockaddr_in6); - ip6 = mtod(m, struct ip6_hdr *); - lsin6->sin6_port = sh->dest_port; - lsin6->sin6_addr = ip6->ip6_dst; - break; - } -#endif - default: - return (NULL); - } - cookie = &cp->cookie; cookie_offset = offset + sizeof(struct sctp_chunkhdr); cookie_len = ntohs(cp->ch.chunk_length); @@ -2608,7 +2576,7 @@ sctp_handle_cookie_echo(struct mbuf *m, if (tim == 0) tim = now.tv_usec - cookie->time_entered.tv_usec; scm->time_usec = htonl(tim); - sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -2652,7 +2620,7 @@ sctp_handle_cookie_echo(struct mbuf *m, } if ((*stcb == NULL) && to) { /* Yep, lets check */ - *stcb = sctp_findassociation_ep_addr(inp_p, to, netp, localep_sa, NULL); + *stcb = sctp_findassociation_ep_addr(inp_p, to, netp, dst, NULL); if (*stcb == NULL) { /* * We should have only got back the same inp. If we @@ -2695,15 +2663,17 @@ sctp_handle_cookie_echo(struct mbuf *m, cookie_len -= SCTP_SIGNATURE_SIZE; if (*stcb == NULL) { /* this is the "normal" case... get a new TCB */ - *stcb = sctp_process_cookie_new(m, iphlen, offset, sh, cookie, - cookie_len, *inp_p, netp, to, ¬ification, + *stcb = sctp_process_cookie_new(m, iphlen, offset, src, dst, sh, + cookie, cookie_len, *inp_p, + netp, to, ¬ification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, vrf_id, port); } else { /* this is abnormal... cookie-echo on existing TCB */ had_a_existing_tcb = 1; - *stcb = sctp_process_cookie_existing(m, iphlen, offset, sh, + *stcb = sctp_process_cookie_existing(m, iphlen, offset, + src, dst, sh, cookie, cookie_len, *inp_p, *stcb, netp, to, ¬ification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, @@ -2788,7 +2758,7 @@ sctp_handle_cookie_echo(struct mbuf *m, SCTPDBG(SCTP_DEBUG_INPUT1, "process_cookie_new: no room for another socket!\n"); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(*inp_p, NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -4404,6 +4374,7 @@ __attribute__((noinline)) #endif static struct sctp_tcb * sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, int *fwd_tsn_seen, uint8_t use_mflowid, uint32_t mflowid, @@ -4520,7 +4491,9 @@ __attribute__((noinline)) if (asconf_len < sizeof(struct sctp_asconf_paramhdr)) break; stcb = sctp_findassociation_ep_asconf(m, - *offset, sh, &inp, netp, vrf_id); + *offset, + dst, + sh, &inp, netp, vrf_id); if (stcb != NULL) break; asconf_offset += SCTP_SIZE32(asconf_len); @@ -4562,7 +4535,7 @@ __attribute__((noinline)) } if (stcb == NULL) { /* no association, so it's out of the blue... */ - sctp_handle_ootb(m, iphlen, *offset, sh, inp, + sctp_handle_ootb(m, iphlen, *offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); *offset = length; @@ -4600,7 +4573,8 @@ __attribute__((noinline)) if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); } - sctp_handle_ootb(m, iphlen, *offset, sh, inp, + sctp_handle_ootb(m, iphlen, *offset, src, dst, + sh, inp, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -4742,8 +4716,8 @@ process_control_chunks: /* The INIT chunk must be the only chunk. */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { - sctp_abort_association(inp, stcb, m, - iphlen, sh, NULL, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, port); *offset = length; @@ -4754,14 +4728,14 @@ process_control_chunks: struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); *offset = length; return (NULL); } - sctp_handle_init(m, iphlen, *offset, sh, + sctp_handle_init(m, iphlen, *offset, src, dst, sh, (struct sctp_init_chunk *)ch, inp, stcb, &abort_no_unlock, use_mflowid, mflowid, @@ -4813,7 +4787,8 @@ process_control_chunks: return (NULL); } if ((netp) && (*netp)) { - ret = sctp_handle_init_ack(m, iphlen, *offset, sh, + ret = sctp_handle_init_ack(m, iphlen, *offset, + src, dst, sh, (struct sctp_init_ack_chunk *)ch, stcb, *netp, &abort_no_unlock, @@ -5123,8 +5098,8 @@ process_control_chunks: struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); } @@ -5151,7 +5126,9 @@ process_control_chunks: if (netp) { ret_buf = sctp_handle_cookie_echo(m, iphlen, - *offset, sh, + *offset, + src, dst, + sh, (struct sctp_cookie_echo_chunk *)ch, &inp, &stcb, netp, auth_skipped, @@ -5314,7 +5291,7 @@ process_control_chunks: __LINE__); } stcb->asoc.overall_error_count = 0; - sctp_handle_asconf(m, *offset, + sctp_handle_asconf(m, *offset, src, (struct sctp_asconf_chunk *)ch, stcb, asconf_cnt == 0); asconf_cnt++; } @@ -5610,8 +5587,9 @@ __attribute__((noinline)) * common input chunk processing (v4 and v6) */ void -sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, - int length, struct sctphdr *sh, struct sctp_chunkhdr *ch, +sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, + struct sockaddr *src, struct sockaddr *dst, + struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint8_t ecn_bits, uint8_t use_mflowid, uint32_t mflowid, @@ -5650,7 +5628,7 @@ sctp_common_input_processing(struct mbuf * NOT respond to any packet.. its OOTB. */ SCTP_TCB_UNLOCK(stcb); - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); goto out_now; @@ -5659,7 +5637,8 @@ sctp_common_input_processing(struct mbuf if (IS_SCTP_CONTROL(ch)) { /* process the control portion of the SCTP packet */ /* sa_ignore NO_NULL_CHK */ - stcb = sctp_process_control(m, iphlen, &offset, length, sh, ch, + stcb = sctp_process_control(m, iphlen, &offset, length, + src, dst, sh, ch, inp, stcb, &net, &fwd_tsn_seen, use_mflowid, mflowid, vrf_id, port); @@ -5697,7 +5676,7 @@ sctp_common_input_processing(struct mbuf } if (stcb == NULL) { /* out of the blue DATA chunk */ - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); goto out_now; @@ -5767,7 +5746,7 @@ sctp_common_input_processing(struct mbuf /* * We consider OOTB any data sent during asoc setup. */ - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); SCTP_TCB_UNLOCK(stcb); @@ -5788,7 +5767,8 @@ sctp_common_input_processing(struct mbuf break; } /* plow through the data chunks while length > offset */ - retval = sctp_process_data(mm, iphlen, &offset, length, sh, + retval = sctp_process_data(mm, iphlen, &offset, length, + src, dst, sh, inp, stcb, net, &high_tsn, use_mflowid, mflowid, vrf_id, port); @@ -5883,6 +5863,7 @@ sctp_input_with_port(struct mbuf *i_pak, int iphlen; uint32_t vrf_id = 0; uint8_t ecn_bits; + struct sockaddr_in src, dst; struct ip *ip; struct sctphdr *sh; struct sctp_chunkhdr *ch; @@ -5932,18 +5913,27 @@ sctp_input_with_port(struct mbuf *i_pak, SCTP_STAT_INCR(sctps_recvpackets); SCTP_STAT_INCR_COUNTER64(sctps_inpackets); /* Get IP, SCTP, and first chunk header together in the first mbuf. */ - ip = mtod(m, struct ip *); offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { + if ((m = m_pullup(m, offset)) == NULL) { SCTP_STAT_INCR(sctps_hdrops); return; } - ip = mtod(m, struct ip *); } + ip = mtod(m, struct ip *); sh = (struct sctphdr *)((caddr_t)ip + iphlen); ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); offset -= sizeof(struct sctp_chunkhdr); + memset(&src, 0, sizeof(struct sockaddr_in)); + src.sin_family = AF_INET; + src.sin_len = sizeof(struct sockaddr_in); + src.sin_port = sh->src_port; + src.sin_addr = ip->ip_src; + memset(&dst, 0, sizeof(struct sockaddr_in)); + dst.sin_family = AF_INET; + dst.sin_len = sizeof(struct sockaddr_in); + dst.sin_port = sh->dest_port; + dst.sin_addr = ip->ip_dst; length = ip->ip_len + iphlen; /* Validate mbuf chain length with IP payload length. */ if (SCTP_HEADER_LEN(i_pak) != length) { @@ -5953,10 +5943,10 @@ sctp_input_with_port(struct mbuf *i_pak, goto bad; } /* SCTP does not allow broadcasts or multicasts */ - if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { + if (IN_MULTICAST(ntohl(dst.sin_addr.s_addr))) { goto bad; } - if (SCTP_IS_IT_BROADCAST(ip->ip_dst, m)) { + if (SCTP_IS_IT_BROADCAST(dst.sin_addr, m)) { goto bad; } SCTPDBG(SCTP_DEBUG_INPUT1, @@ -5982,6 +5972,8 @@ sctp_input_with_port(struct mbuf *i_pak, SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", calc_check, check, m, length, iphlen); stcb = sctp_findassociation_addr(m, offset, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6013,6 +6005,8 @@ sctp_skip_csum: goto bad; } stcb = sctp_findassociation_addr(m, offset, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6031,7 +6025,9 @@ sctp_skip_csum: if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) goto bad; if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2(m, sh, + sctp_send_shutdown_complete2((struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, use_mflowid, mflowid, vrf_id, port); goto bad; @@ -6043,7 +6039,10 @@ sctp_skip_csum: if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, sh, 0, NULL, + sctp_send_abort(m, iphlen, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, 0, NULL, use_mflowid, mflowid, vrf_id, port); } @@ -6066,8 +6065,10 @@ sctp_skip_csum: ecn_bits = ip->ip_tos; /* sa_ignore NO_NULL_CHK */ - sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, - inp, stcb, net, ecn_bits, + sctp_common_input_processing(&m, iphlen, offset, length, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, ch, inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); if (m) { @@ -6119,15 +6120,14 @@ sctp_input(struct mbuf *m, int off) * No flow id built by lower layers fix it so we * create one. */ - ip = mtod(m, struct ip *); - offset = off + sizeof(*sh); + offset = off + sizeof(struct sctphdr); if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { + if ((m = m_pullup(m, offset)) == NULL) { SCTP_STAT_INCR(sctps_hdrops); return; } - ip = mtod(m, struct ip *); } + ip = mtod(m, struct ip *); sh = (struct sctphdr *)((caddr_t)ip + off); tag = htonl(sh->v_tag); flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); Modified: head/sys/netinet/sctp_input.h ============================================================================== --- head/sys/netinet/sctp_input.h Thu Jun 28 15:38:14 2012 (r237714) +++ head/sys/netinet/sctp_input.h Thu Jun 28 16:01:08 2012 (r237715) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) || defined(__Userspace__) void sctp_common_input_processing(struct mbuf **, int, int, int, + struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint8_t, Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Thu Jun 28 15:38:14 2012 (r237714) +++ head/sys/netinet/sctp_os_bsd.h Thu Jun 28 16:01:08 2012 (r237715) @@ -177,18 +177,9 @@ MALLOC_DECLARE(SCTP_M_MCORE); } \ } while (0); \ } -#define SCTPDBG_PKT(level, iph, sh) \ -{ \ - do { \ - if (SCTP_BASE_SYSCTL(sctp_debug_on) & level) { \ - sctp_print_address_pkt(iph, sh); \ - } \ - } while (0); \ -} #else #define SCTPDBG(level, params...) #define SCTPDBG_ADDR(level, addr) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 16:44:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FA9D1065672; Thu, 28 Jun 2012 16:44:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A1718FC08; Thu, 28 Jun 2012 16:44:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SGiUQf086829; Thu, 28 Jun 2012 16:44:30 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SGiUQd086827; Thu, 28 Jun 2012 16:44:30 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206281644.q5SGiUQd086827@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 28 Jun 2012 16:44: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: r237716 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 16:44:30 -0000 Author: pfg Date: Thu Jun 28 16:44:29 2012 New Revision: 237716 URL: http://svn.freebsd.org/changeset/base/237716 Log: Safer fix for building with Clang. error: format specifies type 'long long' but the argument has type 'int64_t' (aka 'long') Reported by: Ed Maste Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Thu Jun 28 16:01:08 2012 (r237715) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Thu Jun 28 16:44:29 2012 (r237716) @@ -761,7 +761,7 @@ dt_print_llquantize(dtrace_hdl_t *dtp, F step = next > nsteps ? next / nsteps : 1; if (first_bin == 0) { - (void) snprintf(c, sizeof (c), "< %ld", value); + (void) snprintf(c, sizeof (c), "< %lld", (long long)value); if (dt_printf(dtp, fp, "%16s ", c) < 0) return (-1); From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 16:54:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1A91106566C; Thu, 28 Jun 2012 16:54:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83A838FC12; Thu, 28 Jun 2012 16:54:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SGsBGb087254; Thu, 28 Jun 2012 16:54:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SGsBoc087252; Thu, 28 Jun 2012 16:54:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206281654.q5SGsBoc087252@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 28 Jun 2012 16:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237717 - stable/8/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 16:54:11 -0000 Author: kib Date: Thu Jun 28 16:54:10 2012 New Revision: 237717 URL: http://svn.freebsd.org/changeset/base/237717 Log: MFC r237366: Fix unbounded-length malloc, controlled from usermode. The added check is performed before exact size of the buffer is calculated, but the buffer cannot have size greater then the total space allocated for extended attributes. The existing check is executing with precise size, but it is too late, since buffer needs to be allocated in advance. Also, adapt to uio_resid being of ssize_t type. Use lblktosize instead of multiplying by fs block size by hand as well. Modified: stable/8/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_vnops.c Thu Jun 28 16:44:29 2012 (r237716) +++ stable/8/sys/ufs/ffs/ffs_vnops.c Thu Jun 28 16:54:10 2012 (r237717) @@ -1648,7 +1648,8 @@ vop_setextattr { struct inode *ip; struct fs *fs; uint32_t ealength, ul; - int ealen, olen, eapad1, eapad2, error, i, easize; + ssize_t ealen; + int olen, eapad1, eapad2, error, i, easize; u_char *eae, *p; ip = VTOI(ap->a_vp); @@ -1667,6 +1668,10 @@ vop_setextattr { if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); + ealen = ap->a_uio->uio_resid; + if (ealen < 0 || ealen > lblktosize(fs, NXADDR)) + return (EINVAL); + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { @@ -1684,7 +1689,6 @@ vop_setextattr { if (error) return (error); - ealen = ap->a_uio->uio_resid; ealength = sizeof(uint32_t) + 3 + strlen(ap->a_name); eapad1 = 8 - (ealength % 8); if (eapad1 == 8) @@ -1712,7 +1716,7 @@ vop_setextattr { easize += (ealength - ul); } } - if (easize > NXADDR * fs->fs_bsize) { + if (easize > lblktosize(fs, NXADDR)) { free(eae, M_TEMP); ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 17:15:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E18A106566C; Thu, 28 Jun 2012 17:15:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 391508FC12; Thu, 28 Jun 2012 17:15:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SHFHX5088259; Thu, 28 Jun 2012 17:15:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SHFHu4088257; Thu, 28 Jun 2012 17:15:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206281715.q5SHFHu4088257@svn.freebsd.org> From: Alexander Motin Date: Thu, 28 Jun 2012 17:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237718 - head/sys/dev/drm2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 17:15:17 -0000 Author: mav Date: Thu Jun 28 17:15:16 2012 New Revision: 237718 URL: http://svn.freebsd.org/changeset/base/237718 Log: Fix millisecond to ticks conversion in drm_msleep(). On systems with HZ=100 it caused Intel eDP video output initialization (and Xorg startup) to take several minutes instead of several seconds. Reviewed by: kib MFC after: 3 days Modified: head/sys/dev/drm2/drmP.h Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Thu Jun 28 16:54:10 2012 (r237717) +++ head/sys/dev/drm2/drmP.h Thu Jun 28 17:15:16 2012 (r237718) @@ -250,7 +250,7 @@ enum { #define msecs_to_jiffies(x) (((int64_t)(x)) * hz / 1000) #define time_after(a,b) ((long)(b) - (long)(a) < 0) #define time_after_eq(a,b) ((long)(b) - (long)(a) <= 0) -#define drm_msleep(x, msg) pause((msg), ((int64_t)(x)) * 1000 / hz) +#define drm_msleep(x, msg) pause((msg), ((int64_t)(x)) * hz / 1000) typedef vm_paddr_t dma_addr_t; typedef uint64_t u64; From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 18:38:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB5081065670; Thu, 28 Jun 2012 18:38:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A231B8FC08; Thu, 28 Jun 2012 18:38:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SIcP9E092029; Thu, 28 Jun 2012 18:38:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SIcP9Z092021; Thu, 28 Jun 2012 18:38:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206281838.q5SIcP9Z092021@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Jun 2012 18:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237719 - in stable/9: sys/kern sys/sys usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 18:38:25 -0000 Author: jhb Date: Thu Jun 28 18:38:24 2012 New Revision: 237719 URL: http://svn.freebsd.org/changeset/base/237719 Log: MFC 234494: Include the associated wait channel message for context switch ktrace records. kdump supports both the old and new messages. Modified: stable/9/sys/kern/kern_condvar.c stable/9/sys/kern/kern_ktrace.c stable/9/sys/kern/kern_synch.c stable/9/sys/kern/subr_trap.c stable/9/sys/sys/ktrace.h stable/9/usr.bin/kdump/kdump.1 stable/9/usr.bin/kdump/kdump.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/usr.bin/kdump/ (props changed) Modified: stable/9/sys/kern/kern_condvar.c ============================================================================== --- stable/9/sys/kern/kern_condvar.c Thu Jun 28 17:15:16 2012 (r237718) +++ stable/9/sys/kern/kern_condvar.c Thu Jun 28 18:38:24 2012 (r237719) @@ -103,7 +103,7 @@ _cv_wait(struct cv *cvp, struct lock_obj lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -140,7 +140,7 @@ _cv_wait(struct cv *cvp, struct lock_obj #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -162,7 +162,7 @@ _cv_wait_unlock(struct cv *cvp, struct l td = curthread; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -197,7 +197,7 @@ _cv_wait_unlock(struct cv *cvp, struct l #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); } @@ -220,7 +220,7 @@ _cv_wait_sig(struct cv *cvp, struct lock lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -258,7 +258,7 @@ _cv_wait_sig(struct cv *cvp, struct lock #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -286,7 +286,7 @@ _cv_timedwait(struct cv *cvp, struct loc lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -324,7 +324,7 @@ _cv_timedwait(struct cv *cvp, struct loc #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -353,7 +353,7 @@ _cv_timedwait_sig(struct cv *cvp, struct lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -392,7 +392,7 @@ _cv_timedwait_sig(struct cv *cvp, struct #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { Modified: stable/9/sys/kern/kern_ktrace.c ============================================================================== --- stable/9/sys/kern/kern_ktrace.c Thu Jun 28 17:15:16 2012 (r237718) +++ stable/9/sys/kern/kern_ktrace.c Thu Jun 28 18:38:24 2012 (r237719) @@ -731,8 +731,9 @@ ktrpsig(sig, action, mask, code) } void -ktrcsw(out, user) +ktrcsw(out, user, wmesg) int out, user; + const char *wmesg; { struct thread *td = curthread; struct ktr_request *req; @@ -744,6 +745,10 @@ ktrcsw(out, user) kc = &req->ktr_data.ktr_csw; kc->out = out; kc->user = user; + if (wmesg != NULL) + strlcpy(kc->wmesg, wmesg, sizeof(kc->wmesg)); + else + bzero(kc->wmesg, sizeof(kc->wmesg)); ktr_enqueuerequest(td, req); ktrace_exit(td); } Modified: stable/9/sys/kern/kern_synch.c ============================================================================== --- stable/9/sys/kern/kern_synch.c Thu Jun 28 17:15:16 2012 (r237718) +++ stable/9/sys/kern/kern_synch.c Thu Jun 28 18:38:24 2012 (r237719) @@ -158,7 +158,7 @@ _sleep(void *ident, struct lock_object * p = td->td_proc; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, wmesg); #endif WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Sleeping on \"%s\"", wmesg); @@ -252,7 +252,7 @@ _sleep(void *ident, struct lock_object * } #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != NULL && lock != &Giant.lock_object && !(priority & PDROP)) { @@ -314,7 +314,7 @@ msleep_spin(void *ident, struct mtx *mtx #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) { sleepq_release(ident); - ktrcsw(1, 0); + ktrcsw(1, 0, wmesg); sleepq_lock(ident); } #endif @@ -332,7 +332,7 @@ msleep_spin(void *ident, struct mtx *mtx } #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); mtx_lock_spin(mtx); Modified: stable/9/sys/kern/subr_trap.c ============================================================================== --- stable/9/sys/kern/subr_trap.c Thu Jun 28 17:15:16 2012 (r237718) +++ stable/9/sys/kern/subr_trap.c Thu Jun 28 18:38:24 2012 (r237719) @@ -219,7 +219,7 @@ ast(struct trapframe *framep) if (flags & TDF_NEEDRESCHED) { #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 1); + ktrcsw(1, 1, __func__); #endif thread_lock(td); sched_prio(td, td->td_user_pri); @@ -227,7 +227,7 @@ ast(struct trapframe *framep) thread_unlock(td); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 1); + ktrcsw(0, 1, __func__); #endif } Modified: stable/9/sys/sys/ktrace.h ============================================================================== --- stable/9/sys/sys/ktrace.h Thu Jun 28 17:15:16 2012 (r237718) +++ stable/9/sys/sys/ktrace.h Thu Jun 28 18:38:24 2012 (r237719) @@ -135,9 +135,15 @@ struct ktr_psig { * KTR_CSW - trace context switches */ #define KTR_CSW 6 +struct ktr_csw_old { + int out; /* 1 if switch out, 0 if switch in */ + int user; /* 1 if usermode (ivcsw), 0 if kernel (vcsw) */ +}; + struct ktr_csw { int out; /* 1 if switch out, 0 if switch in */ int user; /* 1 if usermode (ivcsw), 0 if kernel (vcsw) */ + char wmesg[8]; }; /* @@ -227,7 +233,7 @@ struct ktr_faultend { #ifdef _KERNEL void ktrnamei(char *); -void ktrcsw(int, int); +void ktrcsw(int, int, const char *); void ktrpsig(int, sig_t, sigset_t *, int); void ktrfault(vm_offset_t, int); void ktrfaultend(int); Modified: stable/9/usr.bin/kdump/kdump.1 ============================================================================== --- stable/9/usr.bin/kdump/kdump.1 Thu Jun 28 17:15:16 2012 (r237718) +++ stable/9/usr.bin/kdump/kdump.1 Thu Jun 28 18:38:24 2012 (r237719) @@ -28,7 +28,7 @@ .\" @(#)kdump.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 5, 2012 +.Dd April 20, 2012 .Dt KDUMP 1 .Os .Sh NAME @@ -167,7 +167,7 @@ The possible operations are: .It Li NAMI Ta file name lookup Ta path to file .It Li GIO Ta general I/O Ta fd, read/write, number of bytes .It Li PSIG Ta signal Ta signal name, handler, mask, code -.It Li CSW Ta context switch Ta stop/resume user/kernel +.It Li CSW Ta context switch Ta stop/resume user/kernel wmesg .It Li USER Ta data from user process Ta the data .It Li STRU Ta various syscalls Ta structure .It Li SCTL Ta Xr sysctl 3 requests Ta MIB name Modified: stable/9/usr.bin/kdump/kdump.c ============================================================================== --- stable/9/usr.bin/kdump/kdump.c Thu Jun 28 17:15:16 2012 (r237718) +++ stable/9/usr.bin/kdump/kdump.c Thu Jun 28 18:38:24 2012 (r237719) @@ -95,6 +95,7 @@ void visdump(char *, int, int); void ktrgenio(struct ktr_genio *, int); void ktrpsig(struct ktr_psig *); void ktrcsw(struct ktr_csw *); +void ktrcsw_old(struct ktr_csw_old *); void ktruser(int, unsigned char *); void ktrsockaddr(struct sockaddr *); void ktrstat(struct stat *); @@ -296,7 +297,10 @@ main(int argc, char *argv[]) ktrpsig((struct ktr_psig *)m); break; case KTR_CSW: - ktrcsw((struct ktr_csw *)m); + if (ktrlen == sizeof(struct ktr_csw_old)) + ktrcsw_old((struct ktr_csw_old *)m); + else + ktrcsw((struct ktr_csw *)m); break; case KTR_USER: ktruser(ktrlen, m); @@ -1164,12 +1168,19 @@ ktrpsig(struct ktr_psig *psig) } void -ktrcsw(struct ktr_csw *cs) +ktrcsw_old(struct ktr_csw_old *cs) { (void)printf("%s %s\n", cs->out ? "stop" : "resume", cs->user ? "user" : "kernel"); } +void +ktrcsw(struct ktr_csw *cs) +{ + printf("%s %s \"%s\"\n", cs->out ? "stop" : "resume", + cs->user ? "user" : "kernel", cs->wmesg); +} + #define UTRACE_DLOPEN_START 1 #define UTRACE_DLOPEN_STOP 2 #define UTRACE_DLCLOSE_START 3 From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 18:38:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B33E1065670; Thu, 28 Jun 2012 18:38:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34BAF8FC1B; Thu, 28 Jun 2012 18:38:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SIcpUq092086; Thu, 28 Jun 2012 18:38:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SIco0T092077; Thu, 28 Jun 2012 18:38:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206281838.q5SIco0T092077@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Jun 2012 18:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237720 - in stable/8: sys/kern sys/sys usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 18:38:51 -0000 Author: jhb Date: Thu Jun 28 18:38:50 2012 New Revision: 237720 URL: http://svn.freebsd.org/changeset/base/237720 Log: MFC 234494: Include the associated wait channel message for context switch ktrace records. kdump supports both the old and new messages. Modified: stable/8/sys/kern/kern_condvar.c stable/8/sys/kern/kern_ktrace.c stable/8/sys/kern/kern_synch.c stable/8/sys/kern/subr_trap.c stable/8/sys/sys/ktrace.h stable/8/usr.bin/kdump/kdump.1 stable/8/usr.bin/kdump/kdump.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/usr.bin/kdump/ (props changed) Modified: stable/8/sys/kern/kern_condvar.c ============================================================================== --- stable/8/sys/kern/kern_condvar.c Thu Jun 28 18:38:24 2012 (r237719) +++ stable/8/sys/kern/kern_condvar.c Thu Jun 28 18:38:50 2012 (r237720) @@ -103,7 +103,7 @@ _cv_wait(struct cv *cvp, struct lock_obj lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -140,7 +140,7 @@ _cv_wait(struct cv *cvp, struct lock_obj #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -162,7 +162,7 @@ _cv_wait_unlock(struct cv *cvp, struct l td = curthread; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -197,7 +197,7 @@ _cv_wait_unlock(struct cv *cvp, struct l #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); } @@ -220,7 +220,7 @@ _cv_wait_sig(struct cv *cvp, struct lock lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -258,7 +258,7 @@ _cv_wait_sig(struct cv *cvp, struct lock #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -286,7 +286,7 @@ _cv_timedwait(struct cv *cvp, struct loc lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -324,7 +324,7 @@ _cv_timedwait(struct cv *cvp, struct loc #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -353,7 +353,7 @@ _cv_timedwait_sig(struct cv *cvp, struct lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -392,7 +392,7 @@ _cv_timedwait_sig(struct cv *cvp, struct #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { Modified: stable/8/sys/kern/kern_ktrace.c ============================================================================== --- stable/8/sys/kern/kern_ktrace.c Thu Jun 28 18:38:24 2012 (r237719) +++ stable/8/sys/kern/kern_ktrace.c Thu Jun 28 18:38:50 2012 (r237720) @@ -728,8 +728,9 @@ ktrpsig(sig, action, mask, code) } void -ktrcsw(out, user) +ktrcsw(out, user, wmesg) int out, user; + const char *wmesg; { struct thread *td = curthread; struct ktr_request *req; @@ -741,6 +742,10 @@ ktrcsw(out, user) kc = &req->ktr_data.ktr_csw; kc->out = out; kc->user = user; + if (wmesg != NULL) + strlcpy(kc->wmesg, wmesg, sizeof(kc->wmesg)); + else + bzero(kc->wmesg, sizeof(kc->wmesg)); ktr_enqueuerequest(td, req); ktrace_exit(td); } Modified: stable/8/sys/kern/kern_synch.c ============================================================================== --- stable/8/sys/kern/kern_synch.c Thu Jun 28 18:38:24 2012 (r237719) +++ stable/8/sys/kern/kern_synch.c Thu Jun 28 18:38:50 2012 (r237720) @@ -158,7 +158,7 @@ _sleep(void *ident, struct lock_object * p = td->td_proc; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, wmesg); #endif WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Sleeping on \"%s\"", wmesg); @@ -252,7 +252,7 @@ _sleep(void *ident, struct lock_object * } #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != NULL && lock != &Giant.lock_object && !(priority & PDROP)) { @@ -314,7 +314,7 @@ msleep_spin(void *ident, struct mtx *mtx #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) { sleepq_release(ident); - ktrcsw(1, 0); + ktrcsw(1, 0, wmesg); sleepq_lock(ident); } #endif @@ -332,7 +332,7 @@ msleep_spin(void *ident, struct mtx *mtx } #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); mtx_lock_spin(mtx); Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Thu Jun 28 18:38:24 2012 (r237719) +++ stable/8/sys/kern/subr_trap.c Thu Jun 28 18:38:50 2012 (r237720) @@ -207,7 +207,7 @@ ast(struct trapframe *framep) if (flags & TDF_NEEDRESCHED) { #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 1); + ktrcsw(1, 1, __func__); #endif thread_lock(td); sched_prio(td, td->td_user_pri); @@ -215,7 +215,7 @@ ast(struct trapframe *framep) thread_unlock(td); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 1); + ktrcsw(0, 1, __func__); #endif } Modified: stable/8/sys/sys/ktrace.h ============================================================================== --- stable/8/sys/sys/ktrace.h Thu Jun 28 18:38:24 2012 (r237719) +++ stable/8/sys/sys/ktrace.h Thu Jun 28 18:38:50 2012 (r237720) @@ -139,9 +139,15 @@ struct ktr_psig { * KTR_CSW - trace context switches */ #define KTR_CSW 6 +struct ktr_csw_old { + int out; /* 1 if switch out, 0 if switch in */ + int user; /* 1 if usermode (ivcsw), 0 if kernel (vcsw) */ +}; + struct ktr_csw { int out; /* 1 if switch out, 0 if switch in */ int user; /* 1 if usermode (ivcsw), 0 if kernel (vcsw) */ + char wmesg[8]; }; /* @@ -227,7 +233,7 @@ struct ktr_faultend { #ifdef _KERNEL void ktrnamei(char *); -void ktrcsw(int, int); +void ktrcsw(int, int, const char *); void ktrpsig(int, sig_t, sigset_t *, int); void ktrfault(vm_offset_t, int); void ktrfaultend(int); Modified: stable/8/usr.bin/kdump/kdump.1 ============================================================================== --- stable/8/usr.bin/kdump/kdump.1 Thu Jun 28 18:38:24 2012 (r237719) +++ stable/8/usr.bin/kdump/kdump.1 Thu Jun 28 18:38:50 2012 (r237720) @@ -32,7 +32,7 @@ .\" @(#)kdump.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 5, 2012 +.Dd April 20, 2012 .Dt KDUMP 1 .Os .Sh NAME @@ -171,7 +171,7 @@ The possible operations are: .It Li NAMI Ta file name lookup Ta path to file .It Li GIO Ta general I/O Ta fd, read/write, number of bytes .It Li PSIG Ta signal Ta signal name, handler, mask, code -.It Li CSW Ta context switch Ta stop/resume user/kernel +.It Li CSW Ta context switch Ta stop/resume user/kernel wmesg .It Li USER Ta data from user process Ta the data .It Li STRU Ta various syscalls Ta structure .It Li SCTL Ta Xr sysctl 3 requests Ta MIB name Modified: stable/8/usr.bin/kdump/kdump.c ============================================================================== --- stable/8/usr.bin/kdump/kdump.c Thu Jun 28 18:38:24 2012 (r237719) +++ stable/8/usr.bin/kdump/kdump.c Thu Jun 28 18:38:50 2012 (r237720) @@ -99,6 +99,7 @@ void visdump(char *, int, int); void ktrgenio(struct ktr_genio *, int); void ktrpsig(struct ktr_psig *); void ktrcsw(struct ktr_csw *); +void ktrcsw_old(struct ktr_csw_old *); void ktruser(int, unsigned char *); void ktrsockaddr(struct sockaddr *); void ktrstat(struct stat *); @@ -300,7 +301,10 @@ main(int argc, char *argv[]) ktrpsig((struct ktr_psig *)m); break; case KTR_CSW: - ktrcsw((struct ktr_csw *)m); + if (ktrlen == sizeof(struct ktr_csw_old)) + ktrcsw_old((struct ktr_csw_old *)m); + else + ktrcsw((struct ktr_csw *)m); break; case KTR_USER: ktruser(ktrlen, m); @@ -1168,12 +1172,19 @@ ktrpsig(struct ktr_psig *psig) } void -ktrcsw(struct ktr_csw *cs) +ktrcsw_old(struct ktr_csw_old *cs) { (void)printf("%s %s\n", cs->out ? "stop" : "resume", cs->user ? "user" : "kernel"); } +void +ktrcsw(struct ktr_csw *cs) +{ + printf("%s %s \"%s\"\n", cs->out ? "stop" : "resume", + cs->user ? "user" : "kernel", cs->wmesg); +} + #define UTRACE_DLOPEN_START 1 #define UTRACE_DLOPEN_STOP 2 #define UTRACE_DLCLOSE_START 3 From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 18:52:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D352B1065673; Thu, 28 Jun 2012 18:52:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDB088FC0A; Thu, 28 Jun 2012 18:52:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SIqXjc092766; Thu, 28 Jun 2012 18:52:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SIqXvN092764; Thu, 28 Jun 2012 18:52:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206281852.q5SIqXvN092764@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Jun 2012 18:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237721 - stable/9/etc/periodic/daily X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 18:52:33 -0000 Author: jhb Date: Thu Jun 28 18:52:33 2012 New Revision: 237721 URL: http://svn.freebsd.org/changeset/base/237721 Log: MFC 235132: Display dropped transmit packets in the daily network interface output. Modified: stable/9/etc/periodic/daily/420.status-network Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/periodic/daily/420.status-network ============================================================================== --- stable/9/etc/periodic/daily/420.status-network Thu Jun 28 18:38:50 2012 (r237720) +++ stable/9/etc/periodic/daily/420.status-network Thu Jun 28 18:52:33 2012 (r237721) @@ -18,9 +18,9 @@ case "$daily_status_network_enable" in case "$daily_status_network_usedns" in [Yy][Ee][Ss]) - netstat -i && rc=0 || rc=3;; + netstat -id && rc=0 || rc=3;; *) - netstat -in && rc=0 || rc=3;; + netstat -idn && rc=0 || rc=3;; esac;; *) rc=0;; From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 18:52:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4530910657D0; Thu, 28 Jun 2012 18:52:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F1888FC0C; Thu, 28 Jun 2012 18:52:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SIqfrH092807; Thu, 28 Jun 2012 18:52:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SIqeTY092805; Thu, 28 Jun 2012 18:52:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206281852.q5SIqeTY092805@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Jun 2012 18:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237722 - stable/8/etc/periodic/daily X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 18:52:41 -0000 Author: jhb Date: Thu Jun 28 18:52:40 2012 New Revision: 237722 URL: http://svn.freebsd.org/changeset/base/237722 Log: MFC 235132: Display dropped transmit packets in the daily network interface output. Modified: stable/8/etc/periodic/daily/420.status-network Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/periodic/daily/420.status-network ============================================================================== --- stable/8/etc/periodic/daily/420.status-network Thu Jun 28 18:52:33 2012 (r237721) +++ stable/8/etc/periodic/daily/420.status-network Thu Jun 28 18:52:40 2012 (r237722) @@ -18,9 +18,9 @@ case "$daily_status_network_enable" in case "$daily_status_network_usedns" in [Yy][Ee][Ss]) - netstat -i && rc=0 || rc=3;; + netstat -id && rc=0 || rc=3;; *) - netstat -in && rc=0 || rc=3;; + netstat -idn && rc=0 || rc=3;; esac;; *) rc=0;; From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 19:34:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 547B81065670; Thu, 28 Jun 2012 19:34:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2490B8FC08; Thu, 28 Jun 2012 19:34:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SJYOK2094598; Thu, 28 Jun 2012 19:34:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SJYNHn094596; Thu, 28 Jun 2012 19:34:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206281934.q5SJYNHn094596@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Jun 2012 19:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237725 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 19:34:24 -0000 Author: jhb Date: Thu Jun 28 19:34:23 2012 New Revision: 237725 URL: http://svn.freebsd.org/changeset/base/237725 Log: MFC 236404: Extend VERBOSE_SYSINIT to also print out the name of variables passed to SYSINIT routines if they can be resolved via symbol look up in DDB. To avoid false positives, only honor a name if the symbol resolves exactly to the pointer value (no offset). Modified: stable/9/sys/kern/init_main.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/kern/init_main.c ============================================================================== --- stable/9/sys/kern/init_main.c Thu Jun 28 19:27:54 2012 (r237724) +++ stable/9/sys/kern/init_main.c Thu Jun 28 19:34:23 2012 (r237725) @@ -158,6 +158,24 @@ sysinit_add(struct sysinit **set, struct newsysinit_end = newset + count; } +#if defined (DDB) && defined(VERBOSE_SYSINIT) +static const char * +symbol_name(vm_offset_t va, db_strategy_t strategy) +{ + const char *name; + c_db_sym_t sym; + db_expr_t offset; + + if (va == 0) + return (NULL); + sym = db_search_symbol(va, strategy, &offset); + if (offset != 0) + return (NULL); + db_symbol_values(sym, &name, NULL); + return (name); +} +#endif + /* * System startup; initialize the world, create process 0, mount root * filesystem, and fork to create init and pagedaemon. Most of the @@ -238,15 +256,16 @@ restart: } if (verbose) { #if defined(DDB) - const char *name; - c_db_sym_t sym; - db_expr_t offset; - - sym = db_search_symbol((vm_offset_t)(*sipp)->func, - DB_STGY_PROC, &offset); - db_symbol_values(sym, &name, NULL); - if (name != NULL) - printf(" %s(%p)... ", name, (*sipp)->udata); + const char *func, *data; + + func = symbol_name((vm_offset_t)(*sipp)->func, + DB_STGY_PROC); + data = symbol_name((vm_offset_t)(*sipp)->udata, + DB_STGY_ANY); + if (func != NULL && data != NULL) + printf(" %s(&%s)... ", func, data); + else if (func != NULL) + printf(" %s(%p)... ", func, (*sipp)->udata); else #endif printf(" %p(%p)... ", (*sipp)->func, From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 19:39:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A91A1106564A; Thu, 28 Jun 2012 19:39:31 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88E6E8FC0C; Thu, 28 Jun 2012 19:39:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SJdV91094856; Thu, 28 Jun 2012 19:39:31 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SJdVJn094850; Thu, 28 Jun 2012 19:39:31 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206281939.q5SJdVJn094850@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 28 Jun 2012 19:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237726 - head/sys/cam/ctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 19:39:31 -0000 Author: ken Date: Thu Jun 28 19:39:30 2012 New Revision: 237726 URL: http://svn.freebsd.org/changeset/base/237726 Log: Add a loader tunable, kern.cam.ctl.disable, that will disable loading CTL. This may be useful in very low memory installations. MFC after: 3 days Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend.c head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_internal.c head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Jun 28 19:34:23 2012 (r237725) +++ head/sys/cam/ctl/ctl.c Thu Jun 28 19:39:30 2012 (r237726) @@ -308,7 +308,6 @@ static struct scsi_control_page control_ /*aen_holdoff_period*/{0, 0} }; -SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); /* * XXX KDM move these into the softc. @@ -318,7 +317,12 @@ static int persis_offset; static uint8_t ctl_pause_rtr; static int ctl_is_single; static int index_to_aps_page; +int ctl_disable = 0; +SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, disable, CTLFLAG_RDTUN, &ctl_disable, 0, + "Disable CTL"); +TUNABLE_INT("kern.cam.ctl.disable", &ctl_disable); /* * Serial number (0x80), device id (0x83), and supported pages (0x00) @@ -949,6 +953,10 @@ ctl_init(void) ctl_pause_rtr = 0; rcv_sync_msg = 0; + /* If we're disabled, don't initialize. */ + if (ctl_disable != 0) + return; + control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK); softc = control_softc; Modified: head/sys/cam/ctl/ctl_backend.c ============================================================================== --- head/sys/cam/ctl/ctl_backend.c Thu Jun 28 19:34:23 2012 (r237725) +++ head/sys/cam/ctl/ctl_backend.c Thu Jun 28 19:39:30 2012 (r237726) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include extern struct ctl_softc *control_softc; +extern int ctl_disable; int ctl_backend_register(struct ctl_backend_driver *be) @@ -71,6 +72,10 @@ ctl_backend_register(struct ctl_backend_ ctl_softc = control_softc; + /* Don't continue if CTL is disabled */ + if (ctl_disable != 0) + return (0); + mtx_lock(&ctl_softc->ctl_lock); /* * Sanity check, make sure this isn't a duplicate registration. Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Jun 28 19:34:23 2012 (r237725) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Jun 28 19:39:30 2012 (r237726) @@ -119,6 +119,7 @@ struct cfcs_softc cfcs_softc; * amount of SCSI sense data that we will report to CAM. */ static int cfcs_max_sense = sizeof(struct scsi_sense_data); +extern int ctl_disable; SYSINIT(cfcs_init, SI_SUB_CONFIGURE, SI_ORDER_FOURTH, cfcs_init, NULL); SYSCTL_NODE(_kern_cam, OID_AUTO, ctl2cam, CTLFLAG_RD, 0, @@ -138,6 +139,10 @@ cfcs_init(void) #endif int retval; + /* Don't continue if CTL is disabled */ + if (ctl_disable != 0) + return (0); + softc = &cfcs_softc; retval = 0; bzero(softc, sizeof(*softc)); Modified: head/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_internal.c Thu Jun 28 19:34:23 2012 (r237725) +++ head/sys/cam/ctl/ctl_frontend_internal.c Thu Jun 28 19:39:30 2012 (r237726) @@ -187,6 +187,7 @@ struct cfi_softc { MALLOC_DEFINE(M_CTL_CFI, "ctlcfi", "CTL CFI"); static struct cfi_softc fetd_internal_softc; +extern int ctl_disable; void cfi_init(void); void cfi_shutdown(void) __unused; @@ -231,6 +232,10 @@ cfi_init(void) retval = 0; + /* If we're disabled, don't initialize */ + if (ctl_disable != 0) + return; + if (sizeof(struct cfi_lun_io) > CTL_PORT_PRIV_SIZE) { printf("%s: size of struct cfi_lun_io %zd > " "CTL_PORT_PRIV_SIZE %d\n", __func__, Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Thu Jun 28 19:34:23 2012 (r237725) +++ head/sys/cam/ctl/scsi_ctl.c Thu Jun 28 19:39:30 2012 (r237726) @@ -227,12 +227,17 @@ static struct periph_driver ctlfe_driver PERIPHDRIVER_DECLARE(ctl, ctlfe_driver); extern struct ctl_softc *control_softc; +extern int ctl_disable; int ctlfeinitialize(void) { cam_status status; + /* Don't initialize if we're disabled */ + if (ctl_disable != 0) + return (0); + STAILQ_INIT(&ctlfe_softc_list); mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); @@ -263,6 +268,10 @@ ctlfeinit(void) { cam_status status; + /* Don't initialize if we're disabled */ + if (ctl_disable != 0) + return; + STAILQ_INIT(&ctlfe_softc_list); mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 19:55:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB54B10656EB; Thu, 28 Jun 2012 19:55:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 950648FC18; Thu, 28 Jun 2012 19:55:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SJtQt4095538; Thu, 28 Jun 2012 19:55:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SJtQN8095536; Thu, 28 Jun 2012 19:55:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206281955.q5SJtQN8095536@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Jun 2012 19:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237727 - stable/9/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 19:55:26 -0000 Author: jhb Date: Thu Jun 28 19:55:26 2012 New Revision: 237727 URL: http://svn.freebsd.org/changeset/base/237727 Log: MFC 236405: Remove unnecessary initializations. The BSS of boot2 is in fact zero'd when boot2 begins execution by the _start() routine in btxcsu.S. Modified: stable/9/sys/boot/i386/boot2/boot2.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/i386/boot2/boot2.c Thu Jun 28 19:39:30 2012 (r237726) +++ stable/9/sys/boot/i386/boot2/boot2.c Thu Jun 28 19:55:26 2012 (r237727) @@ -129,8 +129,8 @@ static struct dsk { int init; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; -static const char *kname = NULL; -static uint32_t opts = 0; +static const char *kname; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 19:55:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66040106568D; Thu, 28 Jun 2012 19:55:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5046F8FC0A; Thu, 28 Jun 2012 19:55:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SJtlLP095591; Thu, 28 Jun 2012 19:55:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SJtlpq095589; Thu, 28 Jun 2012 19:55:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206281955.q5SJtlpq095589@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Jun 2012 19:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237728 - stable/8/sys/boot/i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 19:55:47 -0000 Author: jhb Date: Thu Jun 28 19:55:46 2012 New Revision: 237728 URL: http://svn.freebsd.org/changeset/base/237728 Log: MFC 236405: Remove unnecessary initializations. The BSS of boot2 is in fact zero'd when boot2 begins execution by the _start() routine in btxcsu.S. Modified: stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Thu Jun 28 19:55:26 2012 (r237727) +++ stable/8/sys/boot/i386/boot2/boot2.c Thu Jun 28 19:55:46 2012 (r237728) @@ -129,8 +129,8 @@ static struct dsk { int init; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; -static const char *kname = NULL; -static uint32_t opts = 0; +static const char *kname; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 20:10:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 284D61065675; Thu, 28 Jun 2012 20:10:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 136628FC1D; Thu, 28 Jun 2012 20:10:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SKAh3x096247; Thu, 28 Jun 2012 20:10:43 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SKAhTN096244; Thu, 28 Jun 2012 20:10:43 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201206282010.q5SKAhTN096244@svn.freebsd.org> From: Ed Maste Date: Thu, 28 Jun 2012 20:10: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: r237729 - head/tools/tools/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 20:10:44 -0000 Author: emaste Date: Thu Jun 28 20:10:43 2012 New Revision: 237729 URL: http://svn.freebsd.org/changeset/base/237729 Log: Fix ioctl type for compiling with clang Modified: head/tools/tools/netmap/bridge.c head/tools/tools/netmap/pcap.c Modified: head/tools/tools/netmap/bridge.c ============================================================================== --- head/tools/tools/netmap/bridge.c Thu Jun 28 19:55:46 2012 (r237728) +++ head/tools/tools/netmap/bridge.c Thu Jun 28 20:10:43 2012 (r237729) @@ -79,7 +79,7 @@ sigint_h(__unused int sig) static int -do_ioctl(struct my_ring *me, int what) +do_ioctl(struct my_ring *me, unsigned long what) { struct ifreq ifr; int error; @@ -98,7 +98,7 @@ do_ioctl(struct my_ring *me, int what) } error = ioctl(me->fd, what, &ifr); if (error) { - D("ioctl error %d", what); + D("ioctl error 0x%lx", what); return error; } switch (what) { Modified: head/tools/tools/netmap/pcap.c ============================================================================== --- head/tools/tools/netmap/pcap.c Thu Jun 28 19:55:46 2012 (r237728) +++ head/tools/tools/netmap/pcap.c Thu Jun 28 20:10:43 2012 (r237729) @@ -201,7 +201,7 @@ struct my_ring { static int -do_ioctl(struct my_ring *me, int what) +do_ioctl(struct my_ring *me, unsigned long what) { struct ifreq ifr; int error; @@ -221,7 +221,7 @@ do_ioctl(struct my_ring *me, int what) } error = ioctl(me->fd, what, &ifr); if (error) { - D("ioctl 0x%x error %d", what, error); + D("ioctl 0x%lx error %d", what, error); return error; } switch (what) { From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 20:48:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BB0B106564A; Thu, 28 Jun 2012 20:48:25 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 269A48FC15; Thu, 28 Jun 2012 20:48:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SKmP9t097817; Thu, 28 Jun 2012 20:48:25 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SKmOON097814; Thu, 28 Jun 2012 20:48:24 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206282048.q5SKmOON097814@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 28 Jun 2012 20:48: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: r237730 - in head/sys: powerpc/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 20:48:25 -0000 Author: ken Date: Thu Jun 28 20:48:24 2012 New Revision: 237730 URL: http://svn.freebsd.org/changeset/base/237730 Log: Now that the mps(4) driver is endian-safe, add it to the powerpc and sparc64 GENERIC config files. MFC after: 3 days Modified: head/sys/powerpc/conf/GENERIC64 head/sys/sparc64/conf/GENERIC Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu Jun 28 20:10:43 2012 (r237729) +++ head/sys/powerpc/conf/GENERIC64 Thu Jun 28 20:48:24 2012 (r237730) @@ -102,6 +102,7 @@ options AHC_REG_PRETTY_PRINT # Print re device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters device mpt # LSI-Logic MPT-Fusion +device mps # LSI-Logic MPT-Fusion 2 device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D # ATA/SCSI peripherals Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Thu Jun 28 20:10:43 2012 (r237729) +++ head/sys/sparc64/conf/GENERIC Thu Jun 28 20:48:24 2012 (r237730) @@ -109,6 +109,7 @@ device esp # AMD Am53C974, Sun ESP and device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters device mpt # LSI-Logic MPT-Fusion +device mps # LSI-Logic MPT-Fusion 2 device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D # ATA/SCSI peripherals From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 21:24:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D83061065670; Thu, 28 Jun 2012 21:24:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C094B8FC0A; Thu, 28 Jun 2012 21:24:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SLO9se099400; Thu, 28 Jun 2012 21:24:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SLO9kC099391; Thu, 28 Jun 2012 21:24:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206282124.q5SLO9kC099391@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Jun 2012 21:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237731 - in stable/9: sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 21:24:09 -0000 Author: jhb Date: Thu Jun 28 21:24:09 2012 New Revision: 237731 URL: http://svn.freebsd.org/changeset/base/237731 Log: MFC 228161,230774,230822,236415: Add a new -e flag to pciconf(8)'s list mode to display PCI error details. Currently this dumps the status of any error bits in the PCI status register and PCI-express device status register. It also lists any errors indicated by version 1 of PCI-express Advanced Error Reporting (AER). Added: stable/9/usr.sbin/pciconf/err.c - copied unchanged from r236415, head/usr.sbin/pciconf/err.c Modified: stable/9/sys/dev/pci/pcireg.h stable/9/usr.sbin/pciconf/Makefile stable/9/usr.sbin/pciconf/cap.c stable/9/usr.sbin/pciconf/pciconf.8 stable/9/usr.sbin/pciconf/pciconf.c stable/9/usr.sbin/pciconf/pciconf.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/9/sys/dev/pci/pcireg.h ============================================================================== --- stable/9/sys/dev/pci/pcireg.h Thu Jun 28 20:48:24 2012 (r237730) +++ stable/9/sys/dev/pci/pcireg.h Thu Jun 28 21:24:09 2012 (r237731) @@ -697,6 +697,7 @@ #define PCIR_AER_UC_STATUS 0x04 #define PCIM_AER_UC_TRAINING_ERROR 0x00000001 #define PCIM_AER_UC_DL_PROTOCOL_ERROR 0x00000010 +#define PCIM_AER_UC_SURPRISE_LINK_DOWN 0x00000020 #define PCIM_AER_UC_POISONED_TLP 0x00001000 #define PCIM_AER_UC_FC_PROTOCOL_ERROR 0x00002000 #define PCIM_AER_UC_COMPLETION_TIMEOUT 0x00004000 @@ -715,6 +716,7 @@ #define PCIM_AER_COR_BAD_DLLP 0x00000080 #define PCIM_AER_COR_REPLAY_ROLLOVER 0x00000100 #define PCIM_AER_COR_REPLAY_TIMEOUT 0x00001000 +#define PCIM_AER_COR_ADVISORY_NF_ERROR 0x00002000 #define PCIR_AER_COR_MASK 0x14 /* Shares bits with COR_STATUS */ #define PCIR_AER_CAP_CONTROL 0x18 #define PCIM_AER_FIRST_ERROR_PTR 0x0000001f Modified: stable/9/usr.sbin/pciconf/Makefile ============================================================================== --- stable/9/usr.sbin/pciconf/Makefile Thu Jun 28 20:48:24 2012 (r237730) +++ stable/9/usr.sbin/pciconf/Makefile Thu Jun 28 21:24:09 2012 (r237731) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= pciconf -SRCS= pciconf.c cap.c +SRCS= pciconf.c cap.c err.c MAN= pciconf.8 CFLAGS+= -I${.CURDIR}/../../sys Modified: stable/9/usr.sbin/pciconf/cap.c ============================================================================== --- stable/9/usr.sbin/pciconf/cap.c Thu Jun 28 20:48:24 2012 (r237730) +++ stable/9/usr.sbin/pciconf/cap.c Thu Jun 28 21:24:09 2012 (r237731) @@ -630,3 +630,59 @@ list_ecaps(int fd, struct pci_conf *p) ecap = read_config(fd, &p->pc_sel, ptr, 4); } } + +/* Find offset of a specific capability. Returns 0 on failure. */ +uint8_t +pci_find_cap(int fd, struct pci_conf *p, uint8_t id) +{ + uint16_t sta; + uint8_t ptr, cap; + + /* Are capabilities present for this device? */ + sta = read_config(fd, &p->pc_sel, PCIR_STATUS, 2); + if (!(sta & PCIM_STATUS_CAPPRESENT)) + return (0); + + switch (p->pc_hdr & PCIM_HDRTYPE) { + case PCIM_HDRTYPE_NORMAL: + case PCIM_HDRTYPE_BRIDGE: + ptr = PCIR_CAP_PTR; + break; + case PCIM_HDRTYPE_CARDBUS: + ptr = PCIR_CAP_PTR_2; + break; + default: + return (0); + } + + ptr = read_config(fd, &p->pc_sel, ptr, 1); + while (ptr != 0 && ptr != 0xff) { + cap = read_config(fd, &p->pc_sel, ptr + PCICAP_ID, 1); + if (cap == id) + return (ptr); + ptr = read_config(fd, &p->pc_sel, ptr + PCICAP_NEXTPTR, 1); + } + return (0); +} + +/* Find offset of a specific extended capability. Returns 0 on failure. */ +uint16_t +pcie_find_cap(int fd, struct pci_conf *p, uint16_t id) +{ + uint32_t ecap; + uint16_t ptr; + + ptr = PCIR_EXTCAP; + ecap = read_config(fd, &p->pc_sel, ptr, 4); + if (ecap == 0xffffffff || ecap == 0) + return (0); + for (;;) { + if (PCI_EXTCAP_ID(ecap) == id) + return (ptr); + ptr = PCI_EXTCAP_NEXTPTR(ecap); + if (ptr == 0) + break; + ecap = read_config(fd, &p->pc_sel, ptr, 4); + } + return (0); +} Copied: stable/9/usr.sbin/pciconf/err.c (from r236415, head/usr.sbin/pciconf/err.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/pciconf/err.c Thu Jun 28 21:24:09 2012 (r237731, copy of r236415, head/usr.sbin/pciconf/err.c) @@ -0,0 +1,167 @@ +/*- + * Copyright (c) 2012 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif /* not lint */ + +#include +#include + +#include +#include + +#include + +#include "pciconf.h" + +struct bit_table { + uint32_t mask; + const char *desc; +}; + +/* Error indicators in the PCI status register (PCIR_STATUS). */ +static struct bit_table pci_status[] = { + { PCIM_STATUS_MDPERR, "Master Data Parity Error" }, + { PCIM_STATUS_STABORT, "Sent Target-Abort" }, + { PCIM_STATUS_RTABORT, "Received Target-Abort" }, + { PCIM_STATUS_RMABORT, "Received Master-Abort" }, + { PCIM_STATUS_SERR, "Signalled System Error" }, + { PCIM_STATUS_PERR, "Detected Parity Error" }, + { 0, NULL }, +}; + +/* Valid error indicator bits in PCIR_STATUS. */ +#define PCI_ERRORS (PCIM_STATUS_MDPERR | PCIM_STATUS_STABORT | \ + PCIM_STATUS_RTABORT | PCIM_STATUS_RMABORT | \ + PCIM_STATUS_SERR | PCIM_STATUS_PERR) + +/* Error indicators in the PCI-Express device status register. */ +static struct bit_table pcie_device_status[] = { + { PCIM_EXP_STA_CORRECTABLE_ERROR, "Correctable Error Detected" }, + { PCIM_EXP_STA_NON_FATAL_ERROR, "Non-Fatal Error Detected" }, + { PCIM_EXP_STA_FATAL_ERROR, "Fatal Error Detected" }, + { PCIM_EXP_STA_UNSUPPORTED_REQ, "Unsupported Request Detected" }, + { 0, NULL }, +}; + +/* Valid error indicator bits in the PCI-Express device status register. */ +#define PCIE_ERRORS (PCIM_EXP_STA_CORRECTABLE_ERROR | \ + PCIM_EXP_STA_NON_FATAL_ERROR | \ + PCIM_EXP_STA_FATAL_ERROR | \ + PCIM_EXP_STA_UNSUPPORTED_REQ) + +/* AER Uncorrected errors. */ +static struct bit_table aer_uc[] = { + { PCIM_AER_UC_TRAINING_ERROR, "Link Training Error" }, + { PCIM_AER_UC_DL_PROTOCOL_ERROR, "Data Link Protocol Error" }, + { PCIM_AER_UC_SURPRISE_LINK_DOWN, "Surprise Link Down Error" }, + { PCIM_AER_UC_POISONED_TLP, "Poisoned TLP" }, + { PCIM_AER_UC_FC_PROTOCOL_ERROR, "Flow Control Protocol Error" }, + { PCIM_AER_UC_COMPLETION_TIMEOUT, "Completion Timeout" }, + { PCIM_AER_UC_COMPLETER_ABORT, "Completer Abort" }, + { PCIM_AER_UC_UNEXPECTED_COMPLETION, "Unexpected Completion" }, + { PCIM_AER_UC_RECEIVER_OVERFLOW, "Receiver Overflow Error" }, + { PCIM_AER_UC_MALFORMED_TLP, "Malformed TLP" }, + { PCIM_AER_UC_ECRC_ERROR, "ECRC Error" }, + { PCIM_AER_UC_UNSUPPORTED_REQUEST, "Unsupported Request" }, + { PCIM_AER_UC_ACS_VIOLATION, "ACS Violation" }, + { 0, NULL }, +}; + +/* AER Corrected errors. */ +static struct bit_table aer_cor[] = { + { PCIM_AER_COR_RECEIVER_ERROR, "Receiver Error" }, + { PCIM_AER_COR_BAD_TLP, "Bad TLP" }, + { PCIM_AER_COR_BAD_DLLP, "Bad DLLP" }, + { PCIM_AER_COR_REPLAY_ROLLOVER, "REPLAY_NUM Rollover" }, + { PCIM_AER_COR_REPLAY_TIMEOUT, "Replay Timer Timeout" }, + { PCIM_AER_COR_ADVISORY_NF_ERROR, "Advisory Non-Fatal Error" }, + { 0, NULL }, +}; + +static void +print_bits(const char *header, struct bit_table *table, uint32_t mask) +{ + int first; + + first = 1; + for (; table->desc != NULL; table++) + if (mask & table->mask) { + if (first) { + printf("%14s = ", header); + first = 0; + } else + printf(" "); + printf("%s\n", table->desc); + mask &= ~table->mask; + } + if (mask != 0) { + if (first) + printf("%14s = ", header); + else + printf(" "); + printf("Unknown: 0x%08x\n", mask); + } +} + +void +list_errors(int fd, struct pci_conf *p) +{ + uint32_t mask, severity; + uint16_t sta, aer; + uint8_t pcie; + + /* First check for standard PCI errors. */ + sta = read_config(fd, &p->pc_sel, PCIR_STATUS, 2); + print_bits("PCI errors", pci_status, sta & PCI_ERRORS); + + /* See if this is a PCI-express device. */ + pcie = pci_find_cap(fd, p, PCIY_EXPRESS); + if (pcie == 0) + return; + + /* Check for PCI-e errors. */ + sta = read_config(fd, &p->pc_sel, pcie + PCIR_EXPRESS_DEVICE_STA, 2); + print_bits("PCI-e errors", pcie_device_status, sta & PCIE_ERRORS); + + /* See if this device supports AER. */ + aer = pcie_find_cap(fd, p, PCIZ_AER); + if (aer == 0) + return; + + /* Check for uncorrected errors. */ + mask = read_config(fd, &p->pc_sel, aer + PCIR_AER_UC_STATUS, 4); + severity = read_config(fd, &p->pc_sel, aer + PCIR_AER_UC_SEVERITY, 4); + print_bits("Fatal", aer_uc, mask & severity); + print_bits("Non-fatal", aer_uc, mask & ~severity); + + /* Check for corrected errors. */ + mask = read_config(fd, &p->pc_sel, aer + PCIR_AER_COR_STATUS, 4); + print_bits("Corrected", aer_cor, mask); +} Modified: stable/9/usr.sbin/pciconf/pciconf.8 ============================================================================== --- stable/9/usr.sbin/pciconf/pciconf.8 Thu Jun 28 20:48:24 2012 (r237730) +++ stable/9/usr.sbin/pciconf/pciconf.8 Thu Jun 28 21:24:09 2012 (r237731) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2007 +.Dd June 1, 2012 .Dt PCICONF 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd diagnostic utility for the PCI bus .Sh SYNOPSIS .Nm -.Fl l Op Fl bcv +.Fl l Op Fl bcev .Nm .Fl a Ar selector .Nm @@ -167,6 +167,15 @@ capability in config space in hexadecima The format of the text after the equals sign is capability-specific. .Pp If the +.Fl e +option is supplied, +.Nm +will list any errors reported for this device in standard PCI error registers. +Errors are checked for in the PCI status register, +the PCI-express device status register, +and the Advanced Error Reporting status registers. +.Pp +If the .Fl v option is supplied, .Nm Modified: stable/9/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/9/usr.sbin/pciconf/pciconf.c Thu Jun 28 20:48:24 2012 (r237730) +++ stable/9/usr.sbin/pciconf/pciconf.c Thu Jun 28 21:24:09 2012 (r237731) @@ -68,7 +68,7 @@ struct pci_vendor_info TAILQ_HEAD(,pci_vendor_info) pci_vendors; static void list_bars(int fd, struct pci_conf *p); -static void list_devs(int verbose, int bars, int caps); +static void list_devs(int verbose, int bars, int caps, int errors); static void list_verbose(struct pci_conf *p); static const char *guess_class(struct pci_conf *p); static const char *guess_subclass(struct pci_conf *p); @@ -83,7 +83,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: pciconf -l [-bcv]", + "usage: pciconf -l [-bcev]", " pciconf -a selector", " pciconf -r [-b | -h] selector addr[:addr2]", " pciconf -w [-b | -h] selector addr value"); @@ -94,12 +94,14 @@ int main(int argc, char **argv) { int c; - int listmode, readmode, writemode, attachedmode, bars, caps, verbose; + int listmode, readmode, writemode, attachedmode; + int bars, caps, errors, verbose; int byte, isshort; - listmode = readmode = writemode = attachedmode = bars = caps = verbose = byte = isshort = 0; + listmode = readmode = writemode = attachedmode = 0; + bars = caps = errors = verbose = byte = isshort = 0; - while ((c = getopt(argc, argv, "abchlrwv")) != -1) { + while ((c = getopt(argc, argv, "abcehlrwv")) != -1) { switch(c) { case 'a': attachedmode = 1; @@ -114,6 +116,10 @@ main(int argc, char **argv) caps = 1; break; + case 'e': + errors = 1; + break; + case 'h': isshort = 1; break; @@ -146,7 +152,7 @@ main(int argc, char **argv) usage(); if (listmode) { - list_devs(verbose, bars, caps); + list_devs(verbose, bars, caps, errors); } else if (attachedmode) { chkattached(argv[optind]); } else if (readmode) { @@ -163,7 +169,7 @@ main(int argc, char **argv) } static void -list_devs(int verbose, int bars, int caps) +list_devs(int verbose, int bars, int caps, int errors) { int fd; struct pci_conf_io pc; @@ -173,7 +179,7 @@ list_devs(int verbose, int bars, int cap if (verbose) load_vendors(); - fd = open(_PATH_DEVPCI, caps ? O_RDWR : O_RDONLY, 0); + fd = open(_PATH_DEVPCI, (caps || errors) ? O_RDWR : O_RDONLY, 0); if (fd < 0) err(1, "%s", _PATH_DEVPCI); @@ -223,6 +229,8 @@ list_devs(int verbose, int bars, int cap list_bars(fd, p); if (caps) list_caps(fd, p); + if (errors) + list_errors(fd, p); } } while (pc.status == PCI_GETCONF_MORE_DEVS); Modified: stable/9/usr.sbin/pciconf/pciconf.h ============================================================================== --- stable/9/usr.sbin/pciconf/pciconf.h Thu Jun 28 20:48:24 2012 (r237730) +++ stable/9/usr.sbin/pciconf/pciconf.h Thu Jun 28 21:24:09 2012 (r237731) @@ -34,6 +34,9 @@ #define __PCICONF_H__ void list_caps(int fd, struct pci_conf *p); +void list_errors(int fd, struct pci_conf *p); +uint8_t pci_find_cap(int fd, struct pci_conf *p, uint8_t id); +uint16_t pcie_find_cap(int fd, struct pci_conf *p, uint16_t id); uint32_t read_config(int fd, struct pcisel *sel, long reg, int width); #endif From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 21:24:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0451B106564A; Thu, 28 Jun 2012 21:24:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E13038FC1F; Thu, 28 Jun 2012 21:24:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SLOu7O099470; Thu, 28 Jun 2012 21:24:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SLOu28099462; Thu, 28 Jun 2012 21:24:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206282124.q5SLOu28099462@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Jun 2012 21:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237732 - in stable/8: sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 21:24:57 -0000 Author: jhb Date: Thu Jun 28 21:24:56 2012 New Revision: 237732 URL: http://svn.freebsd.org/changeset/base/237732 Log: MFC 228161,230774,230822,236415: Add a new -e flag to pciconf(8)'s list mode to display PCI error details. Currently this dumps the status of any error bits in the PCI status register and PCI-express device status register. It also lists any errors indicated by version 1 of PCI-express Advanced Error Reporting (AER). Added: stable/8/usr.sbin/pciconf/err.c - copied unchanged from r236415, head/usr.sbin/pciconf/err.c Modified: stable/8/sys/dev/pci/pcireg.h stable/8/usr.sbin/pciconf/Makefile stable/8/usr.sbin/pciconf/cap.c stable/8/usr.sbin/pciconf/pciconf.8 stable/8/usr.sbin/pciconf/pciconf.c stable/8/usr.sbin/pciconf/pciconf.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) Modified: stable/8/sys/dev/pci/pcireg.h ============================================================================== --- stable/8/sys/dev/pci/pcireg.h Thu Jun 28 21:24:09 2012 (r237731) +++ stable/8/sys/dev/pci/pcireg.h Thu Jun 28 21:24:56 2012 (r237732) @@ -693,6 +693,7 @@ #define PCIR_AER_UC_STATUS 0x04 #define PCIM_AER_UC_TRAINING_ERROR 0x00000001 #define PCIM_AER_UC_DL_PROTOCOL_ERROR 0x00000010 +#define PCIM_AER_UC_SURPRISE_LINK_DOWN 0x00000020 #define PCIM_AER_UC_POISONED_TLP 0x00001000 #define PCIM_AER_UC_FC_PROTOCOL_ERROR 0x00002000 #define PCIM_AER_UC_COMPLETION_TIMEOUT 0x00004000 @@ -711,6 +712,7 @@ #define PCIM_AER_COR_BAD_DLLP 0x00000080 #define PCIM_AER_COR_REPLAY_ROLLOVER 0x00000100 #define PCIM_AER_COR_REPLAY_TIMEOUT 0x00001000 +#define PCIM_AER_COR_ADVISORY_NF_ERROR 0x00002000 #define PCIR_AER_COR_MASK 0x14 /* Shares bits with COR_STATUS */ #define PCIR_AER_CAP_CONTROL 0x18 #define PCIM_AER_FIRST_ERROR_PTR 0x0000001f Modified: stable/8/usr.sbin/pciconf/Makefile ============================================================================== --- stable/8/usr.sbin/pciconf/Makefile Thu Jun 28 21:24:09 2012 (r237731) +++ stable/8/usr.sbin/pciconf/Makefile Thu Jun 28 21:24:56 2012 (r237732) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= pciconf -SRCS= pciconf.c cap.c +SRCS= pciconf.c cap.c err.c MAN= pciconf.8 CFLAGS+= -I${.CURDIR}/../../sys Modified: stable/8/usr.sbin/pciconf/cap.c ============================================================================== --- stable/8/usr.sbin/pciconf/cap.c Thu Jun 28 21:24:09 2012 (r237731) +++ stable/8/usr.sbin/pciconf/cap.c Thu Jun 28 21:24:56 2012 (r237732) @@ -630,3 +630,59 @@ list_ecaps(int fd, struct pci_conf *p) ecap = read_config(fd, &p->pc_sel, ptr, 4); } } + +/* Find offset of a specific capability. Returns 0 on failure. */ +uint8_t +pci_find_cap(int fd, struct pci_conf *p, uint8_t id) +{ + uint16_t sta; + uint8_t ptr, cap; + + /* Are capabilities present for this device? */ + sta = read_config(fd, &p->pc_sel, PCIR_STATUS, 2); + if (!(sta & PCIM_STATUS_CAPPRESENT)) + return (0); + + switch (p->pc_hdr & PCIM_HDRTYPE) { + case PCIM_HDRTYPE_NORMAL: + case PCIM_HDRTYPE_BRIDGE: + ptr = PCIR_CAP_PTR; + break; + case PCIM_HDRTYPE_CARDBUS: + ptr = PCIR_CAP_PTR_2; + break; + default: + return (0); + } + + ptr = read_config(fd, &p->pc_sel, ptr, 1); + while (ptr != 0 && ptr != 0xff) { + cap = read_config(fd, &p->pc_sel, ptr + PCICAP_ID, 1); + if (cap == id) + return (ptr); + ptr = read_config(fd, &p->pc_sel, ptr + PCICAP_NEXTPTR, 1); + } + return (0); +} + +/* Find offset of a specific extended capability. Returns 0 on failure. */ +uint16_t +pcie_find_cap(int fd, struct pci_conf *p, uint16_t id) +{ + uint32_t ecap; + uint16_t ptr; + + ptr = PCIR_EXTCAP; + ecap = read_config(fd, &p->pc_sel, ptr, 4); + if (ecap == 0xffffffff || ecap == 0) + return (0); + for (;;) { + if (PCI_EXTCAP_ID(ecap) == id) + return (ptr); + ptr = PCI_EXTCAP_NEXTPTR(ecap); + if (ptr == 0) + break; + ecap = read_config(fd, &p->pc_sel, ptr, 4); + } + return (0); +} Copied: stable/8/usr.sbin/pciconf/err.c (from r236415, head/usr.sbin/pciconf/err.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/pciconf/err.c Thu Jun 28 21:24:56 2012 (r237732, copy of r236415, head/usr.sbin/pciconf/err.c) @@ -0,0 +1,167 @@ +/*- + * Copyright (c) 2012 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif /* not lint */ + +#include +#include + +#include +#include + +#include + +#include "pciconf.h" + +struct bit_table { + uint32_t mask; + const char *desc; +}; + +/* Error indicators in the PCI status register (PCIR_STATUS). */ +static struct bit_table pci_status[] = { + { PCIM_STATUS_MDPERR, "Master Data Parity Error" }, + { PCIM_STATUS_STABORT, "Sent Target-Abort" }, + { PCIM_STATUS_RTABORT, "Received Target-Abort" }, + { PCIM_STATUS_RMABORT, "Received Master-Abort" }, + { PCIM_STATUS_SERR, "Signalled System Error" }, + { PCIM_STATUS_PERR, "Detected Parity Error" }, + { 0, NULL }, +}; + +/* Valid error indicator bits in PCIR_STATUS. */ +#define PCI_ERRORS (PCIM_STATUS_MDPERR | PCIM_STATUS_STABORT | \ + PCIM_STATUS_RTABORT | PCIM_STATUS_RMABORT | \ + PCIM_STATUS_SERR | PCIM_STATUS_PERR) + +/* Error indicators in the PCI-Express device status register. */ +static struct bit_table pcie_device_status[] = { + { PCIM_EXP_STA_CORRECTABLE_ERROR, "Correctable Error Detected" }, + { PCIM_EXP_STA_NON_FATAL_ERROR, "Non-Fatal Error Detected" }, + { PCIM_EXP_STA_FATAL_ERROR, "Fatal Error Detected" }, + { PCIM_EXP_STA_UNSUPPORTED_REQ, "Unsupported Request Detected" }, + { 0, NULL }, +}; + +/* Valid error indicator bits in the PCI-Express device status register. */ +#define PCIE_ERRORS (PCIM_EXP_STA_CORRECTABLE_ERROR | \ + PCIM_EXP_STA_NON_FATAL_ERROR | \ + PCIM_EXP_STA_FATAL_ERROR | \ + PCIM_EXP_STA_UNSUPPORTED_REQ) + +/* AER Uncorrected errors. */ +static struct bit_table aer_uc[] = { + { PCIM_AER_UC_TRAINING_ERROR, "Link Training Error" }, + { PCIM_AER_UC_DL_PROTOCOL_ERROR, "Data Link Protocol Error" }, + { PCIM_AER_UC_SURPRISE_LINK_DOWN, "Surprise Link Down Error" }, + { PCIM_AER_UC_POISONED_TLP, "Poisoned TLP" }, + { PCIM_AER_UC_FC_PROTOCOL_ERROR, "Flow Control Protocol Error" }, + { PCIM_AER_UC_COMPLETION_TIMEOUT, "Completion Timeout" }, + { PCIM_AER_UC_COMPLETER_ABORT, "Completer Abort" }, + { PCIM_AER_UC_UNEXPECTED_COMPLETION, "Unexpected Completion" }, + { PCIM_AER_UC_RECEIVER_OVERFLOW, "Receiver Overflow Error" }, + { PCIM_AER_UC_MALFORMED_TLP, "Malformed TLP" }, + { PCIM_AER_UC_ECRC_ERROR, "ECRC Error" }, + { PCIM_AER_UC_UNSUPPORTED_REQUEST, "Unsupported Request" }, + { PCIM_AER_UC_ACS_VIOLATION, "ACS Violation" }, + { 0, NULL }, +}; + +/* AER Corrected errors. */ +static struct bit_table aer_cor[] = { + { PCIM_AER_COR_RECEIVER_ERROR, "Receiver Error" }, + { PCIM_AER_COR_BAD_TLP, "Bad TLP" }, + { PCIM_AER_COR_BAD_DLLP, "Bad DLLP" }, + { PCIM_AER_COR_REPLAY_ROLLOVER, "REPLAY_NUM Rollover" }, + { PCIM_AER_COR_REPLAY_TIMEOUT, "Replay Timer Timeout" }, + { PCIM_AER_COR_ADVISORY_NF_ERROR, "Advisory Non-Fatal Error" }, + { 0, NULL }, +}; + +static void +print_bits(const char *header, struct bit_table *table, uint32_t mask) +{ + int first; + + first = 1; + for (; table->desc != NULL; table++) + if (mask & table->mask) { + if (first) { + printf("%14s = ", header); + first = 0; + } else + printf(" "); + printf("%s\n", table->desc); + mask &= ~table->mask; + } + if (mask != 0) { + if (first) + printf("%14s = ", header); + else + printf(" "); + printf("Unknown: 0x%08x\n", mask); + } +} + +void +list_errors(int fd, struct pci_conf *p) +{ + uint32_t mask, severity; + uint16_t sta, aer; + uint8_t pcie; + + /* First check for standard PCI errors. */ + sta = read_config(fd, &p->pc_sel, PCIR_STATUS, 2); + print_bits("PCI errors", pci_status, sta & PCI_ERRORS); + + /* See if this is a PCI-express device. */ + pcie = pci_find_cap(fd, p, PCIY_EXPRESS); + if (pcie == 0) + return; + + /* Check for PCI-e errors. */ + sta = read_config(fd, &p->pc_sel, pcie + PCIR_EXPRESS_DEVICE_STA, 2); + print_bits("PCI-e errors", pcie_device_status, sta & PCIE_ERRORS); + + /* See if this device supports AER. */ + aer = pcie_find_cap(fd, p, PCIZ_AER); + if (aer == 0) + return; + + /* Check for uncorrected errors. */ + mask = read_config(fd, &p->pc_sel, aer + PCIR_AER_UC_STATUS, 4); + severity = read_config(fd, &p->pc_sel, aer + PCIR_AER_UC_SEVERITY, 4); + print_bits("Fatal", aer_uc, mask & severity); + print_bits("Non-fatal", aer_uc, mask & ~severity); + + /* Check for corrected errors. */ + mask = read_config(fd, &p->pc_sel, aer + PCIR_AER_COR_STATUS, 4); + print_bits("Corrected", aer_cor, mask); +} Modified: stable/8/usr.sbin/pciconf/pciconf.8 ============================================================================== --- stable/8/usr.sbin/pciconf/pciconf.8 Thu Jun 28 21:24:09 2012 (r237731) +++ stable/8/usr.sbin/pciconf/pciconf.8 Thu Jun 28 21:24:56 2012 (r237732) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2007 +.Dd June 1, 2012 .Dt PCICONF 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd diagnostic utility for the PCI bus .Sh SYNOPSIS .Nm -.Fl l Op Fl bcv +.Fl l Op Fl bcev .Nm .Fl a Ar selector .Nm @@ -155,6 +155,15 @@ in config space in hexadecimal. The format of the text after the equals sign is capability-specific. .Pp If the +.Fl e +option is supplied, +.Nm +will list any errors reported for this device in standard PCI error registers. +Errors are checked for in the PCI status register, +the PCI-express device status register, +and the Advanced Error Reporting status registers. +.Pp +If the .Fl v option is supplied, .Nm Modified: stable/8/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/8/usr.sbin/pciconf/pciconf.c Thu Jun 28 21:24:09 2012 (r237731) +++ stable/8/usr.sbin/pciconf/pciconf.c Thu Jun 28 21:24:56 2012 (r237732) @@ -68,7 +68,7 @@ struct pci_vendor_info TAILQ_HEAD(,pci_vendor_info) pci_vendors; static void list_bars(int fd, struct pci_conf *p); -static void list_devs(int verbose, int bars, int caps); +static void list_devs(int verbose, int bars, int caps, int errors); static void list_verbose(struct pci_conf *p); static const char *guess_class(struct pci_conf *p); static const char *guess_subclass(struct pci_conf *p); @@ -83,7 +83,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: pciconf -l [-bcv]", + "usage: pciconf -l [-bcev]", " pciconf -a selector", " pciconf -r [-b | -h] selector addr[:addr2]", " pciconf -w [-b | -h] selector addr value"); @@ -94,12 +94,14 @@ int main(int argc, char **argv) { int c; - int listmode, readmode, writemode, attachedmode, bars, caps, verbose; + int listmode, readmode, writemode, attachedmode; + int bars, caps, errors, verbose; int byte, isshort; - listmode = readmode = writemode = attachedmode = bars = caps = verbose = byte = isshort = 0; + listmode = readmode = writemode = attachedmode = 0; + bars = caps = errors = verbose = byte = isshort = 0; - while ((c = getopt(argc, argv, "abchlrwv")) != -1) { + while ((c = getopt(argc, argv, "abcehlrwv")) != -1) { switch(c) { case 'a': attachedmode = 1; @@ -114,6 +116,10 @@ main(int argc, char **argv) caps = 1; break; + case 'e': + errors = 1; + break; + case 'h': isshort = 1; break; @@ -146,7 +152,7 @@ main(int argc, char **argv) usage(); if (listmode) { - list_devs(verbose, bars, caps); + list_devs(verbose, bars, caps, errors); } else if (attachedmode) { chkattached(argv[optind]); } else if (readmode) { @@ -163,7 +169,7 @@ main(int argc, char **argv) } static void -list_devs(int verbose, int bars, int caps) +list_devs(int verbose, int bars, int caps, int errors) { int fd; struct pci_conf_io pc; @@ -173,7 +179,7 @@ list_devs(int verbose, int bars, int cap if (verbose) load_vendors(); - fd = open(_PATH_DEVPCI, caps ? O_RDWR : O_RDONLY, 0); + fd = open(_PATH_DEVPCI, (caps || errors) ? O_RDWR : O_RDONLY, 0); if (fd < 0) err(1, "%s", _PATH_DEVPCI); @@ -223,6 +229,8 @@ list_devs(int verbose, int bars, int cap list_bars(fd, p); if (caps) list_caps(fd, p); + if (errors) + list_errors(fd, p); } } while (pc.status == PCI_GETCONF_MORE_DEVS); Modified: stable/8/usr.sbin/pciconf/pciconf.h ============================================================================== --- stable/8/usr.sbin/pciconf/pciconf.h Thu Jun 28 21:24:09 2012 (r237731) +++ stable/8/usr.sbin/pciconf/pciconf.h Thu Jun 28 21:24:56 2012 (r237732) @@ -34,6 +34,9 @@ #define __PCICONF_H__ void list_caps(int fd, struct pci_conf *p); +void list_errors(int fd, struct pci_conf *p); +uint8_t pci_find_cap(int fd, struct pci_conf *p, uint8_t id); +uint16_t pcie_find_cap(int fd, struct pci_conf *p, uint16_t id); uint32_t read_config(int fd, struct pcisel *sel, long reg, int width); #endif From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 21:36:42 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E54EB106566C; Thu, 28 Jun 2012 21:36:42 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id 728D48FC14; Thu, 28 Jun 2012 21:36:41 +0000 (UTC) Received: from server.rulingia.com (c220-239-248-69.belrs5.nsw.optusnet.com.au [220.239.248.69]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q5SLaYg0081317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 29 Jun 2012 07:36:34 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q5SLaRsJ023285 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 29 Jun 2012 07:36:27 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q5SLaQN8023284; Fri, 29 Jun 2012 07:36:26 +1000 (EST) (envelope-from peter) Date: Fri, 29 Jun 2012 07:36:26 +1000 From: Peter Jeremy To: Jung-uk Kim Message-ID: <20120628213626.GA23256@server.rulingia.com> References: <201204162122.q3GLM23E051048@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: <201204162122.q3GLM23E051048@svn.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r234352 - in head/sys: amd64/linux32 compat/linux i386/linux kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 21:36:43 -0000 --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2012-Apr-16 21:22:02 +0000, Jung-uk Kim wrote: >Log: > - Implement pipe2 syscall for Linuxulator. This syscall appeared in 2.6= =2E27 > but GNU libc used it without checking its kernel version, e. g., Fedora = 10. Recent versions of flash are complaining about the lack of pipe2(). Do you have any plans to MFC this? I've had a quick look but there are non-trivial conflicts in kern/sys_pipe.c on both 8.x & 9.x and I don't want to spend time resolving them if you have already done so. --=20 Peter Jeremy --9jxsPFA5p3P2qPhR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/szloACgkQ/opHv/APuIdMoQCeJlg3+EvlaYuBCn25QljDGMtm wEIAoK7cfdePTMWqBTdKff1c3tFjMimp =CWMS -----END PGP SIGNATURE----- --9jxsPFA5p3P2qPhR-- From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 22:03:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A41AD106566C; Thu, 28 Jun 2012 22:03:59 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E92E8FC0A; Thu, 28 Jun 2012 22:03:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SM3xC9001237; Thu, 28 Jun 2012 22:03:59 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SM3xjj001235; Thu, 28 Jun 2012 22:03:59 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201206282203.q5SM3xjj001235@svn.freebsd.org> From: Alan Cox Date: Thu, 28 Jun 2012 22:03: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: r237733 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 22:03:59 -0000 Author: alc Date: Thu Jun 28 22:03:59 2012 New Revision: 237733 URL: http://svn.freebsd.org/changeset/base/237733 Log: Avoid some unnecessary PV list locking in pmap_enter(). Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jun 28 21:24:56 2012 (r237732) +++ head/sys/amd64/amd64/pmap.c Thu Jun 28 22:03:59 2012 (r237733) @@ -3570,7 +3570,7 @@ validate: if ((newpte & PG_RW) == 0) invlva = TRUE; } - if ((origpte & PG_MANAGED) != 0) { + if ((om->aflags & PGA_WRITEABLE) != 0) { CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, om); if (TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 23:11:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3CC11065693; Thu, 28 Jun 2012 23:11:25 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A320B8FC08; Thu, 28 Jun 2012 23:11:25 +0000 (UTC) Received: from xp5k.my.domain (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5SNBNOD022590; Thu, 28 Jun 2012 23:11:23 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4FECE494.5020005@gmail.com> Date: Fri, 29 Jun 2012 07:11:16 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: Kostik Belousov References: <201206272032.q5RKWjvt031174@svn.freebsd.org> <4FEBB8C9.8070006@gmail.com> <4FEBC0A2.3010708@gmail.com> <4FEBC70F.40408@gmail.com> <20120628075301.GS2337@deviant.kiev.zoral.com.ua> <4FEC1AAB.6070408@gmail.com> <4FEC557F.4080807@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Attilio Rao , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, davidxu@freebsd.org Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 23:11:25 -0000 On 2012/06/28 21:52, Kostik Belousov wrote: > On Thu, Jun 28, 2012 at 4:00 PM, David Xu wrote: >> On 2012/6/28 16:49, David Xu wrote: >>> On 2012/6/28 15:53, Konstantin Belousov wrote: >>>> On Thu, Jun 28, 2012 at 10:53:03AM +0800, David Xu wrote: >>>>> On 2012/6/28 10:32, Attilio Rao wrote: >>>>>> 2012/6/28, David Xu: >>>>>>> On 2012/6/28 10:21, Attilio Rao wrote: >>>>>>>> 2012/6/28, David Xu: >>>>>>>>> On 2012/6/28 4:32, Konstantin Belousov wrote: >>>>>>>>>> Author: kib >>>>>>>>>> Date: Wed Jun 27 20:32:45 2012 >>>>>>>>>> New Revision: 237660 >>>>>>>>>> URL: http://svn.freebsd.org/changeset/base/237660 >>>>>>>>>> >>>>>>>>>> Log: >>>>>>>>>> Optimize the handling of SC_NPROCESSORS_CONF, by using auxv >>>>>>>>>> AT_NCPU >>>>>>>>>> value if present. >>>>>>>>>> >>>>>>>>>> MFC after: 1 week >>>>>>>>>> >>>>>>>>>> Modified: >>>>>>>>>> head/lib/libc/gen/sysconf.c >>>>>>>>>> >>>>>>>>>> Modified: head/lib/libc/gen/sysconf.c >>>>>>>>>> >>>>>>>>>> ============================================================================== >>>>>>>>>> --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 >>>>>>>>>> (r237659) >>>>>>>>>> +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 >>>>>>>>>> (r237660) >>>>>>>>>> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); >>>>>>>>>> #include >>>>>>>>>> #include >>>>>>>>>> >>>>>>>>>> +#include >>>>>>>>>> #include >>>>>>>>>> #include >>>>>>>>>> #include >>>>>>>>>> @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); >>>>>>>>>> >>>>>>>>>> #include "../stdlib/atexit.h" >>>>>>>>>> #include "tzfile.h" /* from >>>>>>>>>> ../../../contrib/tzcode/stdtime */ >>>>>>>>>> +#include "libc_private.h" >>>>>>>>>> >>>>>>>>>> #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ >>>>>>>>>> >>>>>>>>>> @@ -585,6 +587,8 @@ yesno: >>>>>>>>>> >>>>>>>>>> case _SC_NPROCESSORS_CONF: >>>>>>>>>> case _SC_NPROCESSORS_ONLN: >>>>>>>>>> + if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) == 0) >>>>>>>>>> + return ((long)value); >>>>>>>>>> mib[0] = CTL_HW; >>>>>>>>>> mib[1] = HW_NCPU; >>>>>>>>>> break; >>>>>>>>>> >>>>>>>>> Will this make controlling the number of CPU online or CPU hotplug >>>>>>>>> be impossible on FreeBSD ? >>>>>>>> If I think about hotplug CPUs I can think of other 1000 >>>>>>>> problems/races/bad situations to be fixed before this one, really. >>>>>>> These are problems only in kernel, but kib's change is about ABI >>>>>>> between userland and kernel, I hope we don't introduce an ABI which >>>>>>> is not extendable road stone. >>>>>> I'm not entirely sure I see the ABI breakage here. >>>>> It is not breakage, it is the ABI thinks number of online cpu is fixed, >>>>> obviously, it is not the case in future unless FreeBSD won't support >>>>> dynamic number of online cpus. >>>>> >>>>> >>>>>> If the AT_NCPUS >>>>>> becames unconvenient and not correct at some point we can just fix >>>>>> sysconf() to not look into the aux vector anymoe. >>>>> If you already know this will be a problem, why do you introduce it >>>>> and later need to fix it ? >>>>> >>>>>> Please note that >>>>>> AT_NCPUS is already exported nowadays. I think this is instead a >>>>>> clever optimization to avoid the sysctl() (usual way to retrieve the >>>>>> number of CPUs). >>>>> But why don't you cache it in libc ? following code is enough: >>>>> >>>>> static int online_cpu; >>>>> if (online_cpu == 0) >>>>> online_cpu = sysctl >>>>> return online_cpu; >>>>> >>>> Thread did evolved somewhat while I was AFK. >>>> >>>> First, please note that the ABI which I designed there is fixable: >>>> if kernel does not export AT_NCPUS at all, then auxv correctly handles >>>> the situation returning an error, and libc falls back to sysctl(2). >>> >>> Do we really want to bypass sysctl and instead passing all info via auxv >>> vector ? >>> I found the sysconf() is a bunch of switch-case, which is already slow, >>> before >>> _SC_NPROCESSES_ONLN, it has already a quite number of case branches, >>> and in your code, it calls _elf_aux_info() which also has some >>> switch-cases branch, >>> if you cache smp_cpus in libc, the call for _elf_aux_info is not needed, >>> and you >>> don't need code in kernel to passing it either, in any case, the code to >>> call >>> sysctl is still needed, so why don't we just use sysctl instead and cache >>> the result in libc ? this at least can generate small code and a bit >>> faster after >>> first call to sysconf(_SC_NPROCESSES_ONLN). >> >> And as a side note, I think we should not put non-critical code into >> fork/exec >> path, these two functions are rather critical path for any UNIX like >> system, >> anything slowing down these two functions will affect overall performance, >> so we should not waste cpu cycle trying to push data to user mode via auxv >> or other ways and yet the data is not used by user code in most time, >> such as the number of online cpu. And in rtld-elf or libc, we should not >> waste >> too much time before executing main(). > My motivation for extending auxv vector and to develop auxv.c was > exactly to shave around dozen > of syscalls from the application startup sequence. If you look at the > ktrace output of the binary startup > on RELENG_8 libc, you should note exactly the sysctls to request > ncpus, pagesizes, canary and so on. > In RELENG_9 and HEAD, there are no sysctls in the trace, because the > data is already pre-filled by > kernel for libc consumption. > The sysconf(3) commit you are commenting on was caused by jemalloc(3) > initialization starting using > _sysconf(3) to query ncpu (for older version, which used sysctl > directly, I direct auxv call). So HEAD > has temporary +1 sysctl syscall done on app startup, now it should be > back to zero. This is a bug of jemalloc, in case __isthreaded is zero, it should not call sysctl to get number of cpu. I think it has already bypassed pthread_mutex_lock/unlock if __isthreaded is zero. > > In other words, 'we should not put non-critical code into fork/exec > path' exactly contradicts with > proposal to remove auxv, since exec would need to call sysctls to > fetch the same data. > From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 23:44:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA799106564A; Thu, 28 Jun 2012 23:44:47 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 963878FC0C; Thu, 28 Jun 2012 23:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SNil0X005451; Thu, 28 Jun 2012 23:44:47 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SNilfT005449; Thu, 28 Jun 2012 23:44:47 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201206282344.q5SNilfT005449@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 28 Jun 2012 23:44: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: r237734 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 23:44:47 -0000 Author: bms Date: Thu Jun 28 23:44:47 2012 New Revision: 237734 URL: http://svn.freebsd.org/changeset/base/237734 Log: In MLDv2 general query processing, do not enforce the strict check on query origins. Submitted by: Gu Yong MFC after: 3 days Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Jun 28 22:03:59 2012 (r237733) +++ head/sys/netinet6/mld6.c Thu Jun 28 23:44:47 2012 (r237734) @@ -867,16 +867,10 @@ mld_v2_input_query(struct ifnet *ifp, co */ if (IN6_IS_ADDR_UNSPECIFIED(&mld->mld_addr)) { /* - * General Queries SHOULD be directed to ff02::1. * A general query with a source list has undefined * behaviour; discard it. */ - struct in6_addr dst; - - dst = ip6->ip6_dst; - in6_clearscope(&dst); - if (!IN6_ARE_ADDR_EQUAL(&dst, &in6addr_linklocal_allnodes) || - nsrc > 0) + if (nsrc > 0) return (EINVAL); is_general_query = 1; } else { From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 23:45:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8F1A106564A; Thu, 28 Jun 2012 23:45:37 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A470E8FC12; Thu, 28 Jun 2012 23:45:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SNjbnr005526; Thu, 28 Jun 2012 23:45:37 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SNjbjL005524; Thu, 28 Jun 2012 23:45:37 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201206282345.q5SNjbjL005524@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 28 Jun 2012 23:45: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: r237735 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 23:45:37 -0000 Author: bms Date: Thu Jun 28 23:45:37 2012 New Revision: 237735 URL: http://svn.freebsd.org/changeset/base/237735 Log: Fix a typo in MLD query exponent processing. Submitted by: rpaulo@ MFC after: 3 days Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Jun 28 23:44:47 2012 (r237734) +++ head/sys/netinet6/mld6.c Thu Jun 28 23:45:37 2012 (r237735) @@ -833,7 +833,7 @@ mld_v2_input_query(struct ifnet *ifp, co mld = (struct mldv2_query *)(mtod(m, uint8_t *) + off); maxdelay = ntohs(mld->mld_maxdelay); /* in 1/10ths of a second */ - if (maxdelay >= 32678) { + if (maxdelay >= 32768) { maxdelay = (MLD_MRC_MANT(maxdelay) | 0x1000) << (MLD_MRC_EXP(maxdelay) + 3); } From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 23:48:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 316B4106566B; Thu, 28 Jun 2012 23:48:41 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2C88FC12; Thu, 28 Jun 2012 23:48:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SNmehd005681; Thu, 28 Jun 2012 23:48:40 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SNmeup005678; Thu, 28 Jun 2012 23:48:40 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201206282348.q5SNmeup005678@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 28 Jun 2012 23:48: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: r237736 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 23:48:41 -0000 Author: bms Date: Thu Jun 28 23:48:40 2012 New Revision: 237736 URL: http://svn.freebsd.org/changeset/base/237736 Log: Kick the current-state report timer when a V1 group report would be triggered. Submitted by: rpaulo@ MFC after: 3 days Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Jun 28 23:45:37 2012 (r237735) +++ head/sys/netinet6/mld6.c Thu Jun 28 23:48:40 2012 (r237736) @@ -2197,6 +2197,7 @@ mld_final_leave(struct in6_multi *inm, s #endif mld_v1_transmit_report(inm, MLD_LISTENER_DONE); inm->in6m_state = MLD_NOT_MEMBER; + V_current_state_timers_running6 = 1; } else if (mli->mli_version == MLD_VERSION_2) { /* * Stop group timer and all pending reports. From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 01:55:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66B3A106564A; Fri, 29 Jun 2012 01:55:21 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51B0C8FC08; Fri, 29 Jun 2012 01:55:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T1tLtL011839; Fri, 29 Jun 2012 01:55:21 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T1tLBO011836; Fri, 29 Jun 2012 01:55:21 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201206290155.q5T1tLBO011836@svn.freebsd.org> From: Rui Paulo Date: Fri, 29 Jun 2012 01:55: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: r237737 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 01:55:21 -0000 Author: rpaulo Date: Fri Jun 29 01:55:20 2012 New Revision: 237737 URL: http://svn.freebsd.org/changeset/base/237737 Log: The `end' symbol doesn't match the end of the kernel image because it's relative to the start address (unless the start address is 0, which is not the case). This is currently not a problem because all powerpc architectures are using loader(8) which passes metadata to the kernel including the correct `endkernel' address. If we don't use loader(8), register 4 and 5 will have the size of the kernel ELF file, not its end address. We fix that simply by adding `kernel_text' to `end' to compute `endkernel'. Discussed with: nathanw Modified: head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/locore64.S Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Thu Jun 28 23:48:40 2012 (r237736) +++ head/sys/powerpc/aim/locore32.S Fri Jun 29 01:55:20 2012 (r237737) @@ -164,13 +164,14 @@ __start: bl OF_initial_setup + lis 3,kernel_text@ha + addi 3,3,kernel_text@l + lis 4,end@ha addi 4,4,end@l + add 4,4,3 mr 5,4 - lis 3,kernel_text@ha - addi 3,3,kernel_text@l - /* Restore the argument pointer and length */ mr 6,20 mr 7,21 Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Thu Jun 28 23:48:40 2012 (r237736) +++ head/sys/powerpc/aim/locore64.S Fri Jun 29 01:55:20 2012 (r237737) @@ -164,13 +164,14 @@ ASENTRY_NOPROF(__start) bl OF_initial_setup nop + lis 3,kernbase@ha + addi 3,3,kernbase@l + lis 4,end@ha addi 4,4,end@l + add 4,4,3 mr 5,4 - lis 3,kernbase@ha - addi 3,3,kernbase@l - /* Restore the argument pointer and length */ mr 6,20 mr 7,21 From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 03:01:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8CAD106566C; Fri, 29 Jun 2012 03:01:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A853A8FC0A; Fri, 29 Jun 2012 03:01:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T31dbW014675; Fri, 29 Jun 2012 03:01:39 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T31d3S014661; Fri, 29 Jun 2012 03:01:39 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206290301.q5T31d3S014661@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 29 Jun 2012 03:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237738 - stable/9/lib/libedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 03:01:39 -0000 Author: pfg Date: Fri Jun 29 03:01:38 2012 New Revision: 237738 URL: http://svn.freebsd.org/changeset/base/237738 Log: MFC r237448: Merge changes from upstream libedit. Here we update most of the files to at least match the version available in NetBSD's snapshot of 20091228. This version was chosen because it still doesn't include wide character support (UTF-8), which involves many changes and new files. Modified: stable/9/lib/libedit/common.c stable/9/lib/libedit/editline.3 stable/9/lib/libedit/editrc.5 stable/9/lib/libedit/el.c stable/9/lib/libedit/el.h stable/9/lib/libedit/histedit.h stable/9/lib/libedit/history.c stable/9/lib/libedit/key.c stable/9/lib/libedit/key.h stable/9/lib/libedit/prompt.c stable/9/lib/libedit/prompt.h stable/9/lib/libedit/read.c stable/9/lib/libedit/refresh.c stable/9/lib/libedit/search.c stable/9/lib/libedit/sig.c stable/9/lib/libedit/sig.h stable/9/lib/libedit/term.c stable/9/lib/libedit/term.h stable/9/lib/libedit/tty.c stable/9/lib/libedit/vi.c Directory Properties: stable/9/lib/libedit/ (props changed) Modified: stable/9/lib/libedit/common.c ============================================================================== --- stable/9/lib/libedit/common.c Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/common.c Fri Jun 29 03:01:38 2012 (r237738) @@ -905,7 +905,7 @@ ed_command(EditLine *el, int c __unused) int tmplen; tmplen = c_gets(el, tmpbuf, "\n: "); - term__putc('\n'); + term__putc(el, '\n'); if (tmplen < 0 || (tmpbuf[tmplen] = 0, parse_line(el, tmpbuf)) == -1) term_beep(el); Modified: stable/9/lib/libedit/editline.3 ============================================================================== --- stable/9/lib/libedit/editline.3 Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/editline.3 Fri Jun 29 03:01:38 2012 (r237738) @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.55 2007/01/12 16:31:13 christos Exp $ +.\" $NetBSD: editline.3,v 1.70 2009/07/05 21:55:24 perry Exp $ .\" .\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2007 +.Dd July 5, 2009 .Dt EDITLINE 3 .Os .Sh NAME @@ -162,6 +162,14 @@ is modified to contain the number of cha Returns the line read if successful, or .Dv NULL if no characters were read or if an error occurred. +If an error occurred, +.Fa count +is set to \-1 and +.Dv errno +contains the error code that caused it. +The return value may not remain valid across calls to +.Fn el_gets +and must be copied if the data is to be retained. .It Fn el_getc Read a character from the tty. .Fa ch @@ -222,10 +230,30 @@ are supported, along with the required a Define prompt printing function as .Fa f , which is to return a string that contains the prompt. +.It Dv EL_PROMPT_ESC , Fa "char *(*f)(EditLine *)" , Fa "char c" +Same as +.Dv EL_PROMPT , +but the +.Fa c +argument indicates the start/stop literal prompt character. +.Pp +If a start/stop literal character is found in the prompt, the +character itself +is not printed, but characters after it are printed directly to the +terminal without affecting the state of the current line. +A subsequent second start/stop literal character ends this behavior. +This is typically used to embed literal escape sequences that change the +color/style of the terminal in the prompt. +.Dv 0 +unsets it. +.It Dv EL_REFRESH +Re-display the current line on the next terminal line. .It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)" Define right side prompt printing function as .Fa f , which is to return a string that contains the prompt. +.It Dv EL_RPROMPT_ESC , Fa "char *(*f)(EditLine *)" , Fa "char c" +Define the right prompt printing function but with a literal escape character. .It Dv EL_TERMINAL , Fa "const char *type" Define terminal type of the tty to be .Fa type , @@ -259,66 +287,43 @@ reading command input: and .Dv SIGWINCH . Otherwise, the current signal handlers will be used. -.It Dv EL_BIND , Xo -.Fa "const char *" , -.Fa "..." , -.Dv NULL -.Xc +.It Dv EL_BIND , Fa "const char *" , Fa "..." , Dv NULL Perform the .Ic bind builtin command. Refer to .Xr editrc 5 for more information. -.It Dv EL_ECHOTC , Xo -.Fa "const char *" , -.Fa "..." , -.Dv NULL -.Xc +.It Dv EL_ECHOTC , Fa "const char *" , Fa "..." , Dv NULL Perform the .Ic echotc builtin command. Refer to .Xr editrc 5 for more information. -.It Dv EL_SETTC , Xo -.Fa "const char *" , -.Fa "..." , -.Dv NULL -.Xc +.It Dv EL_SETTC , Fa "const char *" , Fa "..." , Dv NULL Perform the .Ic settc builtin command. Refer to .Xr editrc 5 for more information. -.It Dv EL_SETTY , Xo -.Fa "const char *" , -.Fa "..." , -.Dv NULL -.Xc +.It Dv EL_SETTY , Fa "const char *" , Fa "..." , Dv NULL Perform the .Ic setty builtin command. Refer to .Xr editrc 5 for more information. -.It Dv EL_TELLTC , Xo -.Fa "const char *" , -.Fa "..." , -.Dv NULL -.Xc +.It Dv EL_TELLTC , Fa "const char *" , Fa "..." , Dv NULL Perform the .Ic telltc builtin command. Refer to .Xr editrc 5 for more information. -.It Dv EL_ADDFN , Xo -.Fa "const char *name" , -.Fa "const char *help" , -.Fa "unsigned char (*func)(EditLine *e, int ch)" -.Xc +.It Dv EL_ADDFN , Fa "const char *name" , Fa "const char *help" , \ +Fa "unsigned char (*func)(EditLine *e, int ch)" Add a user defined function, .Fn func , referred to as @@ -360,10 +365,8 @@ Beep, and flush tty. .It Dv CC_FATAL Fatal error, reset tty to known state. .El -.It Dv EL_HIST , Xo -.Fa "History *(*func)(History *, int op, ...)" , -.Fa "const char *ptr" -.Xc +.It Dv EL_HIST , Fa "History *(*func)(History *, int op, ...)" , \ +Fa "const char *ptr" Defines which history function to use, which is usually .Fn history . .Fa ptr @@ -435,10 +438,22 @@ The following values for are supported, along with actual type of .Fa result : .Bl -tag -width 4n -.It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)" -Return a pointer to the function that displays the prompt. -.It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)" -Return a pointer to the function that displays the rightside prompt. +.It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)" , Fa "char *c" +Return a pointer to the function that displays the prompt in +.Fa f . +If +.Fa c +is not +.Dv NULL , +return the start/stop literal prompt character in it. +.It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)" , Fa "char *c" +Return a pointer to the function that displays the prompt in +.Fa f . +If +.Fa c +is not +.Dv NULL , +return the start/stop literal prompt character in it. .It Dv EL_EDITOR , Fa "const char *" Return the name of the editor, which will be one of .Dq emacs @@ -603,18 +618,11 @@ assumed to be created with .Fn history_init . .It Dv H_CLEAR Clear the history. -.It Dv H_FUNC , Xo -.Fa "void *ptr" , -.Fa "history_gfun_t first" , -.Fa "history_gfun_t next" , -.Fa "history_gfun_t last" , -.Fa "history_gfun_t prev" , -.Fa "history_gfun_t curr" , -.Fa "history_sfun_t set" , -.Fa "history_vfun_t clear" , -.Fa "history_efun_t enter" , -.Fa "history_efun_t add" -.Xc +.It Dv H_FUNC , Fa "void *ptr" , Fa "history_gfun_t first" , \ +Fa "history_gfun_t next" , Fa "history_gfun_t last" , \ +Fa "history_gfun_t prev" , Fa "history_gfun_t curr" , \ +Fa "history_sfun_t set" , Fa "history_vfun_t clear" , \ +Fa "history_efun_t enter" , Fa "history_efun_t add" Define functions to perform various history operations. .Fa ptr is the argument given to a function when it is invoked. Modified: stable/9/lib/libedit/editrc.5 ============================================================================== --- stable/9/lib/libedit/editrc.5 Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/editrc.5 Fri Jun 29 03:01:38 2012 (r237738) @@ -1,4 +1,4 @@ -.\" $NetBSD: editrc.5,v 1.20 2006/08/21 12:45:30 christos Exp $ +.\" $NetBSD: editrc.5,v 1.24 2009/04/11 22:17:52 wiz Exp $ .\" .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -89,16 +89,8 @@ shell. .Pp The following builtin commands are available: .Bl -tag -width 4n -.It Ic bind Xo -.Op Fl a -.Op Fl e -.Op Fl k -.Op Fl l -.Op Fl r -.Op Fl s -.Op Fl v -.Op Ar key Op Ar command -.Xc +.It Ic bind Oo Fl a Oc Oo Fl e Oc Oo Fl k Oc Oo Fl l Oc Oo Fl r Oc \ +Oo Fl s Oc Oo Fl v Oc Oo Ar key Oo Ar command Oc Oc Without options, list all bound keys, and the editor command to which each is bound. If @@ -192,11 +184,7 @@ if it has any, notably .Sq \e and .Sq ^ . -.It Ic echotc Xo -.Op Fl sv -.Ar arg -.Ar ... -.Xc +.It Ic echotc Oo Fl sv Oc Ar arg Ar ... Exercise terminal capabilities given in .Ar arg Ar ... . If @@ -252,16 +240,8 @@ to as defined in .Xr termcap 5 . No sanity checking is done. -.It Ic setty Xo -.Op Fl a -.Op Fl d -.Op Fl q -.Op Fl x -.Op Ar +mode -.Op Ar -mode -.Op Ar mode -.Op Ar char=c -.Xc +.It Ic setty Oo Fl a Oc Oo Fl d Oc Oo Fl q Oc Oo Fl x Oc Oo Ar +mode Oc \ +Oo Ar -mode Oc Oo Ar mode Oc Oo Ar char=c Oc Control which tty modes that .Nm will not allow the user to change. Modified: stable/9/lib/libedit/el.c ============================================================================== --- stable/9/lib/libedit/el.c Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/el.c Fri Jun 29 03:01:38 2012 (r237738) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: el.c,v 1.44 2006/12/15 22:13:33 christos Exp $ + * $NetBSD: el.c,v 1.55 2009/07/25 21:19:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "el.h" #define HAVE_ISSETUGID @@ -156,9 +157,21 @@ el_set(EditLine *el, int op, ...) switch (op) { case EL_PROMPT: - case EL_RPROMPT: - rv = prompt_set(el, va_arg(ap, el_pfunc_t), op); + case EL_RPROMPT: { + el_pfunc_t p = va_arg(ap, el_pfunc_t); + + rv = prompt_set(el, p, 0, op); break; + } + + case EL_PROMPT_ESC: + case EL_RPROMPT_ESC: { + el_pfunc_t p = va_arg(ap, el_pfunc_t); + char c = va_arg(ap, int); + + rv = prompt_set(el, p, c, op); + break; + } case EL_TERMINAL: rv = term_set(el, va_arg(ap, char *)); @@ -309,6 +322,12 @@ el_set(EditLine *el, int op, ...) break; } + case EL_REFRESH: + re_clear_display(el); + re_refresh(el); + term__flush(el); + break; + default: rv = -1; break; @@ -335,9 +354,13 @@ el_get(EditLine *el, int op, ...) switch (op) { case EL_PROMPT: - case EL_RPROMPT: - rv = prompt_get(el, va_arg(ap, el_pfunc_t *), op); + case EL_RPROMPT: { + el_pfunc_t *p = va_arg(ap, el_pfunc_t *); + char *c = va_arg(ap, char *); + + rv = prompt_get(el, p, c, op); break; + } case EL_EDITOR: rv = map_get_editor(el, va_arg(ap, const char **)); @@ -364,7 +387,7 @@ el_get(EditLine *el, int op, ...) char *argv[20]; int i; - for (i = 1; i < sizeof(argv) / sizeof(argv[0]); i++) + for (i = 1; i < (int)(sizeof(argv) / sizeof(argv[0])); i++) if ((argv[i] = va_arg(ap, char *)) == NULL) break; @@ -495,12 +518,14 @@ el_source(EditLine *el, const char *fnam FILE *fp; size_t len; char *ptr; +#ifdef HAVE_ISSETUGID + char path[MAXPATHLEN]; +#endif fp = NULL; if (fname == NULL) { #ifdef HAVE_ISSETUGID static const char elpath[] = "/.editrc"; - char path[MAXPATHLEN]; if (issetugid()) return (-1); @@ -529,6 +554,13 @@ el_source(EditLine *el, const char *fnam if (len > 0 && ptr[len - 1] == '\n') --len; ptr[len] = '\0'; + + /* loop until first non-space char or EOL */ + while (*ptr != '\0' && isspace((unsigned char)*ptr)) + ptr++; + if (*ptr == '#') + continue; /* ignore, this is a comment line */ + if (parse_line(el, ptr) == -1) { (void) fclose(fp); return (-1); Modified: stable/9/lib/libedit/el.h ============================================================================== --- stable/9/lib/libedit/el.h Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/el.h Fri Jun 29 03:01:38 2012 (r237738) @@ -115,6 +115,7 @@ struct editline { FILE *el_errfile; /* Stdio stuff */ int el_infd; /* Input file descriptor */ int el_flags; /* Various flags. */ + int el_errno; /* Local copy of errno */ coord_t el_cursor; /* Cursor location */ char **el_display; /* Real screen image = what is there */ char **el_vdisplay; /* Virtual screen image = what we see */ Modified: stable/9/lib/libedit/histedit.h ============================================================================== --- stable/9/lib/libedit/histedit.h Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/histedit.h Fri Jun 29 03:01:38 2012 (r237738) @@ -131,10 +131,10 @@ unsigned char _el_fn_sh_complete(EditLin #define EL_GETCFN 13 /* , el_rfunc_t); */ #define EL_CLIENTDATA 14 /* , void *); */ #define EL_UNBUFFERED 15 /* , int); */ -#define EL_PREP_TERM 16 /* , int); */ +#define EL_PREP_TERM 16 /* , int); */ #define EL_GETTC 17 /* , const char *, ..., NULL); */ -#define EL_GETFP 18 /* , int, FILE **) */ -#define EL_SETFP 19 /* , int, FILE *) */ +#define EL_GETFP 18 /* , int, FILE **); */ +#define EL_SETFP 19 /* , int, FILE *); */ #define EL_REFRESH 20 /* , void); set */ #define EL_PROMPT_ESC 21 /* , prompt_func, Char); set/get */ #define EL_RPROMPT_ESC 22 /* , prompt_func, Char); set/get */ Modified: stable/9/lib/libedit/history.c ============================================================================== --- stable/9/lib/libedit/history.c Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/history.c Fri Jun 29 03:01:38 2012 (r237738) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: history.c,v 1.32 2006/09/28 13:52:51 christos Exp $ + * $NetBSD: history.c,v 1.34 2009/09/07 21:24:33 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -116,6 +116,7 @@ private int history_prev_string(History */ typedef struct hentry_t { HistEvent ev; /* What we return */ + void *data; /* data */ struct hentry_t *next; /* Next entry */ struct hentry_t *prev; /* Previous entry */ } hentry_t; @@ -145,6 +146,9 @@ private int history_def_init(ptr_t *, Hi private int history_def_insert(history_t *, HistEvent *, const char *); private void history_def_delete(history_t *, HistEvent *, hentry_t *); +private int history_deldata_nth(history_t *, HistEvent *, int, void **); +private int history_set_nth(ptr_t, HistEvent *, int); + #define history_def_setsize(p, num)(void) (((history_t *)p)->max = (num)) #define history_def_getsize(p) (((history_t *)p)->cur) #define history_def_getunique(p) (((((history_t *)p)->flags) & H_UNIQUE) != 0) @@ -335,6 +339,31 @@ history_def_set(ptr_t p, HistEvent *ev, } +/* history_set_nth(): + * Default function to set the current event in the history to the + * n-th one. + */ +private int +history_set_nth(ptr_t p, HistEvent *ev, int n) +{ + history_t *h = (history_t *) p; + + if (h->cur == 0) { + he_seterrev(ev, _HE_EMPTY_LIST); + return (-1); + } + for (h->cursor = h->list.prev; h->cursor != &h->list; + h->cursor = h->cursor->prev) + if (n-- <= 0) + break; + if (h->cursor == &h->list) { + he_seterrev(ev, _HE_NOT_FOUND); + return (-1); + } + return (0); +} + + /* history_def_add(): * Append string to element */ @@ -363,6 +392,24 @@ history_def_add(ptr_t p, HistEvent *ev, } +private int +history_deldata_nth(history_t *h, HistEvent *ev, + int num, void **data) +{ + if (history_set_nth(h, ev, num) != 0) + return (-1); + /* magic value to skip delete (just set to n-th history) */ + if (data == (void **)-1) + return (0); + ev->str = strdup(h->cursor->ev.str); + ev->num = h->cursor->ev.num; + if (data) + *data = h->cursor->data; + history_def_delete(h, ev, h->cursor); + return (0); +} + + /* history_def_del(): * Delete element hp of the h list */ @@ -392,8 +439,11 @@ history_def_delete(history_t *h, HistEventPrivate *evp = (void *)&hp->ev; if (hp == &h->list) abort(); - if (h->cursor == hp) + if (h->cursor == hp) { h->cursor = hp->prev; + if (h->cursor == &h->list) + h->cursor = hp->next; + } hp->prev->next = hp->next; hp->next->prev = hp->prev; h_free((ptr_t) evp->str); @@ -416,6 +466,7 @@ history_def_insert(history_t *h, HistEve h_free((ptr_t)h->cursor); goto oomem; } + h->cursor->data = NULL; h->cursor->ev.num = ++h->eventid; h->cursor->next = h->list.next; h->cursor->prev = &h->list; @@ -711,8 +762,8 @@ history_load(History *h, const char *fna (void) strunvis(ptr, line); line[sz] = c; if (HENTER(h, &ev, ptr) == -1) { - h_free((ptr_t)ptr); - return -1; + i = -1; + goto oomem; } } oomem: @@ -787,6 +838,23 @@ history_prev_event(History *h, HistEvent } +private int +history_next_evdata(History *h, HistEvent *ev, int num, void **d) +{ + int retval; + + for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev)) + if (num-- <= 0) { + if (d) + *d = ((history_t *)h->h_ref)->cursor->data; + return (0); + } + + he_seterrev(ev, _HE_NOT_FOUND); + return (-1); +} + + /* history_next_event(): * Find the next event, with number given */ @@ -976,11 +1044,42 @@ history(History *h, HistEvent *ev, int f retval = 0; break; + case H_NEXT_EVDATA: + { + int num = va_arg(va, int); + void **d = va_arg(va, void **); + retval = history_next_evdata(h, ev, num, d); + break; + } + + case H_DELDATA: + { + int num = va_arg(va, int); + void **d = va_arg(va, void **); + retval = history_deldata_nth((history_t *)h->h_ref, ev, num, d); + break; + } + + case H_REPLACE: /* only use after H_NEXT_EVDATA */ + { + const char *line = va_arg(va, const char *); + void *d = va_arg(va, void *); + const char *s; + if(!line || !(s = strdup(line))) { + retval = -1; + break; + } + ((history_t *)h->h_ref)->cursor->ev.str = s; + ((history_t *)h->h_ref)->cursor->data = d; + retval = 0; + break; + } + default: retval = -1; he_seterrev(ev, _HE_UNKNOWN); break; } va_end(va); - return (retval); + return retval; } Modified: stable/9/lib/libedit/key.c ============================================================================== --- stable/9/lib/libedit/key.c Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/key.c Fri Jun 29 03:01:38 2012 (r237738) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: key.c,v 1.19 2006/03/23 20:22:51 christos Exp $ + * $NetBSD: key.c,v 1.20 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -86,8 +86,8 @@ private void node__free(key_node_t *); private void node__put(EditLine *, key_node_t *); private int node__delete(EditLine *, key_node_t **, const char *); private int node_lookup(EditLine *, const char *, key_node_t *, - int); -private int node_enum(EditLine *, key_node_t *, int); + size_t); +private int node_enum(EditLine *, key_node_t *, size_t); #define KEY_BUFSIZ EL_BUFSIZ @@ -478,9 +478,9 @@ node__free(key_node_t *k) * Print if last node */ private int -node_lookup(EditLine *el, const char *str, key_node_t *ptr, int cnt) +node_lookup(EditLine *el, const char *str, key_node_t *ptr, size_t cnt) { - int ncnt; + size_t ncnt; if (ptr == NULL) return (-1); /* cannot have null ptr */ @@ -493,7 +493,8 @@ node_lookup(EditLine *el, const char *st /* If match put this char into el->el_key.buf. Recurse */ if (ptr->ch == *str) { /* match found */ - ncnt = key__decode_char(el->el_key.buf, KEY_BUFSIZ, cnt, + ncnt = key__decode_char(el->el_key.buf, + (size_t)KEY_BUFSIZ, cnt, (unsigned char) ptr->ch); if (ptr->next != NULL) /* not yet at leaf */ @@ -527,9 +528,9 @@ node_lookup(EditLine *el, const char *st * Traverse the node printing the characters it is bound in buffer */ private int -node_enum(EditLine *el, key_node_t *ptr, int cnt) +node_enum(EditLine *el, key_node_t *ptr, size_t cnt) { - int ncnt; + size_t ncnt; if (cnt >= KEY_BUFSIZ - 5) { /* buffer too small */ el->el_key.buf[++cnt] = '"'; @@ -547,7 +548,7 @@ node_enum(EditLine *el, key_node_t *ptr, return (-1); } /* put this char at end of str */ - ncnt = key__decode_char(el->el_key.buf, KEY_BUFSIZ, cnt, + ncnt = key__decode_char(el->el_key.buf, (size_t)KEY_BUFSIZ, cnt, (unsigned char)ptr->ch); if (ptr->next == NULL) { /* print this key and function */ @@ -615,8 +616,8 @@ key_kprint(EditLine *el, const char *key /* key__decode_char(): * Put a printable form of char in buf. */ -protected int -key__decode_char(char *buf, int cnt, int off, int ch) +protected size_t +key__decode_char(char *buf, size_t cnt, size_t off, int ch) { char *sb = buf + off; char *eb = buf + cnt; @@ -626,7 +627,7 @@ key__decode_char(char *buf, int cnt, int if (ch == 0) { ADDC('^'); ADDC('@'); - return b - sb; + return (int)(b - sb); } if (iscntrl(ch)) { ADDC('^'); @@ -648,15 +649,15 @@ key__decode_char(char *buf, int cnt, int ADDC((((unsigned int) ch >> 3) & 7) + '0'); ADDC((ch & 7) + '0'); } - return b - sb; + return (size_t)(b - sb); } /* key__decode_str(): * Make a printable version of the ey */ -protected int -key__decode_str(const char *str, char *buf, int len, const char *sep) +protected size_t +key__decode_str(const char *str, char *buf, size_t len, const char *sep) { char *b = buf, *eb = b + len; const char *p; @@ -699,7 +700,7 @@ key__decode_str(const char *str, char *b } done: ADDC('\0'); - if (b - buf >= len) + if ((size_t)(b - buf) >= len) buf[len - 1] = '\0'; - return b - buf; + return (size_t)(b - buf); } Modified: stable/9/lib/libedit/key.h ============================================================================== --- stable/9/lib/libedit/key.h Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/key.h Fri Jun 29 03:01:38 2012 (r237738) @@ -76,8 +76,8 @@ protected int key_delete(EditLine *, c protected void key_print(EditLine *, const char *); protected void key_kprint(EditLine *, const char *, key_value_t *, int); -protected int key__decode_str(const char *, char *, int, +protected size_t key__decode_str(const char *, char *, size_t, const char *); -protected int key__decode_char(char *, int, int, int); +protected size_t key__decode_char(char *, size_t, size_t, int); #endif /* _h_el_key */ Modified: stable/9/lib/libedit/prompt.c ============================================================================== --- stable/9/lib/libedit/prompt.c Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/prompt.c Fri Jun 29 03:01:38 2012 (r237738) @@ -85,14 +85,23 @@ prompt_print(EditLine *el, int op) { el_prompt_t *elp; char *p; + int ignore = 0; if (op == EL_PROMPT) elp = &el->el_prompt; else elp = &el->el_rprompt; - p = (elp->p_func) (el); - while (*p) - re_putc(el, *p++, 1); + + for (p = (*elp->p_func)(el); *p; p++) { + if (elp->p_ignore == *p) { + ignore = !ignore; + continue; + } + if (ignore) + term__putc(el, *p); + else + re_putc(el, *p, 1); + } elp->p_pos.v = el->el_refresh.r_cursor.v; elp->p_pos.h = el->el_refresh.r_cursor.h; @@ -109,10 +118,12 @@ prompt_init(EditLine *el) el->el_prompt.p_func = prompt_default; el->el_prompt.p_pos.v = 0; el->el_prompt.p_pos.h = 0; + el->el_prompt.p_ignore = '\0'; el->el_rprompt.p_func = prompt_default_r; el->el_rprompt.p_pos.v = 0; el->el_rprompt.p_pos.h = 0; - return (0); + el->el_rprompt.p_ignore = '\0'; + return 0; } @@ -130,24 +141,29 @@ prompt_end(EditLine *el __unused) * Install a prompt printing function */ protected int -prompt_set(EditLine *el, el_pfunc_t prf, int op) +prompt_set(EditLine *el, el_pfunc_t prf, char c, int op) { el_prompt_t *p; - if (op == EL_PROMPT) + if (op == EL_PROMPT || op == EL_PROMPT_ESC) p = &el->el_prompt; else p = &el->el_rprompt; + if (prf == NULL) { - if (op == EL_PROMPT) + if (op == EL_PROMPT || op == EL_PROMPT_ESC) p->p_func = prompt_default; else p->p_func = prompt_default_r; } else p->p_func = prf; + + p->p_ignore = c; + p->p_pos.v = 0; p->p_pos.h = 0; - return (0); + + return 0; } @@ -155,14 +171,22 @@ prompt_set(EditLine *el, el_pfunc_t prf, * Retrieve the prompt printing function */ protected int -prompt_get(EditLine *el, el_pfunc_t *prf, int op) +prompt_get(EditLine *el, el_pfunc_t *prf, char *c, int op) { + el_prompt_t *p; if (prf == NULL) - return (-1); + return -1; + if (op == EL_PROMPT) - *prf = el->el_prompt.p_func; + p = &el->el_prompt; else - *prf = el->el_rprompt.p_func; - return (0); + p = &el->el_rprompt; + + *prf = el->el_rprompt.p_func; + + if (c) + *c = p->p_ignore; + + return 0; } Modified: stable/9/lib/libedit/prompt.h ============================================================================== --- stable/9/lib/libedit/prompt.h Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/prompt.h Fri Jun 29 03:01:38 2012 (r237738) @@ -47,11 +47,13 @@ typedef char * (*el_pfunc_t)(EditLine*); typedef struct el_prompt_t { el_pfunc_t p_func; /* Function to return the prompt */ coord_t p_pos; /* position in the line after prompt */ + char p_ignore; /* character to start/end literal +*/ } el_prompt_t; protected void prompt_print(EditLine *, int); -protected int prompt_set(EditLine *, el_pfunc_t, int); -protected int prompt_get(EditLine *, el_pfunc_t *, int); +protected int prompt_set(EditLine *, el_pfunc_t, char, int); +protected int prompt_get(EditLine *, el_pfunc_t *, char *, int); protected int prompt_init(EditLine *); protected void prompt_end(EditLine *); Modified: stable/9/lib/libedit/read.c ============================================================================== --- stable/9/lib/libedit/read.c Fri Jun 29 01:55:20 2012 (r237737) +++ stable/9/lib/libedit/read.c Fri Jun 29 03:01:38 2012 (r237738) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: read.c,v 1.40 2007/03/01 21:41:45 christos Exp $ + * $NetBSD: read.c,v 1.52 2009/07/22 15:57:00 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include "el.h" -#define OKCMD -1 +#define OKCMD -1 /* must be -1! */ private int read__fixio(int, int); private int read_preread(EditLine *); @@ -170,7 +170,7 @@ read__fixio(int fd __unused, int e) return (e ? 0 : -1); case EINTR: - return (0); + return (-1); default: return (-1); @@ -222,7 +222,7 @@ el_push(EditLine *el, const char *str) ma->level--; } term_beep(el); - term__flush(); + term__flush(el); } @@ -235,9 +235,12 @@ read_getcmd(EditLine *el, el_action_t *c el_action_t cmd; int num; + el->el_errno = 0; do { - if ((num = el_getc(el, ch)) != 1) /* if EOF or error */ + if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */ + el->el_errno = num == 0 ? 0 : errno; return (num); + } #ifdef KANJI if ((*ch & 0200)) { @@ -286,18 +289,25 @@ read_getcmd(EditLine *el, el_action_t *c private int read_char(EditLine *el, char *cp) { - int num_read; + ssize_t num_read; int tried = 0; - while ((num_read = read(el->el_infd, cp, 1)) == -1) + again: + el->el_signal->sig_no = 0; + while ((num_read = read(el->el_infd, cp, 1)) == -1) { + if (el->el_signal->sig_no == SIGCONT) { + sig_set(el); + el_set(el, EL_REFRESH); + goto again; + } if (!tried && read__fixio(el->el_infd, errno) == 0) tried = 1; else { *cp = '\0'; return (-1); } - - return (num_read); + } + return (int)num_read; } /* read_pop(): @@ -309,8 +319,9 @@ read_pop(c_macro_t *ma) int i; el_free(ma->macro[0]); - for (i = ma->level--; i > 0; i--) - ma->macro[i - 1] = ma->macro[i]; + for (i = 0; i < ma->level; i++) + ma->macro[i] = ma->macro[i + 1]; + ma->level--; ma->offset = 0; } @@ -323,7 +334,7 @@ el_getc(EditLine *el, char *cp) int num_read; c_macro_t *ma = &el->el_chared.c_macro; - term__flush(); + term__flush(el); for (;;) { if (ma->level < 0) { if (!read_preread(el)) @@ -382,7 +393,7 @@ read_prepare(EditLine *el) re_refresh(el); /* print the prompt */ if (el->el_flags & UNBUFFERED) - term__flush(); + term__flush(el); } protected void @@ -402,15 +413,20 @@ el_gets(EditLine *el, int *nread) int num; /* how many chars we have read at NL */ char ch; int crlf = 0; + int nrb; #ifdef FIONREAD c_macro_t *ma = &el->el_chared.c_macro; #endif /* FIONREAD */ + if (nread == NULL) + nread = &nrb; + *nread = 0; + if (el->el_flags & NO_TTY) { char *cp = el->el_line.buffer; size_t idx; - while ((*el->el_read.read_char)(el, cp) == 1) { + while ((num = (*el->el_read.read_char)(el, cp)) == 1) { /* make sure there is space for next character */ if (cp + 1 >= el->el_line.limit) { idx = (cp - el->el_line.buffer); @@ -424,12 +440,16 @@ el_gets(EditLine *el, int *nread) if (cp[-1] == '\r' || cp[-1] == '\n') break; } + if (num == -1) { + if (errno == EINTR) + cp = el->el_line.buffer; + el->el_errno = errno; + } el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = el->el_line.cursor - el->el_line.buffer; - return (el->el_line.buffer); + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + goto done; } @@ -440,8 +460,8 @@ el_gets(EditLine *el, int *nread) (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 03:03:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DD57106566C; Fri, 29 Jun 2012 03:03:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6538C8FC1B; Fri, 29 Jun 2012 03:03:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T33hUa014802; Fri, 29 Jun 2012 03:03:43 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T33hK2014788; Fri, 29 Jun 2012 03:03:43 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206290303.q5T33hK2014788@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 29 Jun 2012 03:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237739 - stable/8/lib/libedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 03:03:43 -0000 Author: pfg Date: Fri Jun 29 03:03:42 2012 New Revision: 237739 URL: http://svn.freebsd.org/changeset/base/237739 Log: MFC r237448: Merge changes from upstream libedit. Here we update most of the files to at least match the version available in NetBSD's snapshot of 20091228. This version was chosen because it still doesn't include wide character support (UTF-8), which involves many changes and new files. Modified: stable/8/lib/libedit/common.c stable/8/lib/libedit/editline.3 stable/8/lib/libedit/editrc.5 stable/8/lib/libedit/el.c stable/8/lib/libedit/el.h stable/8/lib/libedit/histedit.h stable/8/lib/libedit/history.c stable/8/lib/libedit/key.c stable/8/lib/libedit/key.h stable/8/lib/libedit/prompt.c stable/8/lib/libedit/prompt.h stable/8/lib/libedit/read.c stable/8/lib/libedit/refresh.c stable/8/lib/libedit/search.c stable/8/lib/libedit/sig.c stable/8/lib/libedit/sig.h stable/8/lib/libedit/term.c stable/8/lib/libedit/term.h stable/8/lib/libedit/tty.c stable/8/lib/libedit/vi.c Directory Properties: stable/8/lib/libedit/ (props changed) Modified: stable/8/lib/libedit/common.c ============================================================================== --- stable/8/lib/libedit/common.c Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/common.c Fri Jun 29 03:03:42 2012 (r237739) @@ -908,7 +908,7 @@ ed_command(EditLine *el, int c __unused) int tmplen; tmplen = c_gets(el, tmpbuf, "\n: "); - term__putc('\n'); + term__putc(el, '\n'); if (tmplen < 0 || (tmpbuf[tmplen] = 0, parse_line(el, tmpbuf)) == -1) term_beep(el); Modified: stable/8/lib/libedit/editline.3 ============================================================================== --- stable/8/lib/libedit/editline.3 Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/editline.3 Fri Jun 29 03:03:42 2012 (r237739) @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.55 2007/01/12 16:31:13 christos Exp $ +.\" $NetBSD: editline.3,v 1.70 2009/07/05 21:55:24 perry Exp $ .\" .\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2007 +.Dd July 5, 2009 .Dt EDITLINE 3 .Os .Sh NAME @@ -165,6 +165,14 @@ is modified to contain the number of cha Returns the line read if successful, or .Dv NULL if no characters were read or if an error occurred. +If an error occurred, +.Fa count +is set to \-1 and +.Dv errno +contains the error code that caused it. +The return value may not remain valid across calls to +.Fn el_gets +and must be copied if the data is to be retained. .It Fn el_getc Read a character from the tty. .Fa ch @@ -225,10 +233,30 @@ are supported, along with the required a Define prompt printing function as .Fa f , which is to return a string that contains the prompt. +.It Dv EL_PROMPT_ESC , Fa "char *(*f)(EditLine *)" , Fa "char c" +Same as +.Dv EL_PROMPT , +but the +.Fa c +argument indicates the start/stop literal prompt character. +.Pp +If a start/stop literal character is found in the prompt, the +character itself +is not printed, but characters after it are printed directly to the +terminal without affecting the state of the current line. +A subsequent second start/stop literal character ends this behavior. +This is typically used to embed literal escape sequences that change the +color/style of the terminal in the prompt. +.Dv 0 +unsets it. +.It Dv EL_REFRESH +Re-display the current line on the next terminal line. .It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)" Define right side prompt printing function as .Fa f , which is to return a string that contains the prompt. +.It Dv EL_RPROMPT_ESC , Fa "char *(*f)(EditLine *)" , Fa "char c" +Define the right prompt printing function but with a literal escape character. .It Dv EL_TERMINAL , Fa "const char *type" Define terminal type of the tty to be .Fa type , @@ -262,66 +290,43 @@ reading command input: and .Dv SIGWINCH . Otherwise, the current signal handlers will be used. -.It Dv EL_BIND , Xo -.Fa "const char *" , -.Fa "..." , -.Dv NULL -.Xc +.It Dv EL_BIND , Fa "const char *" , Fa "..." , Dv NULL Perform the .Ic bind builtin command. Refer to .Xr editrc 5 for more information. -.It Dv EL_ECHOTC , Xo -.Fa "const char *" , -.Fa "..." , -.Dv NULL -.Xc +.It Dv EL_ECHOTC , Fa "const char *" , Fa "..." , Dv NULL Perform the .Ic echotc builtin command. Refer to .Xr editrc 5 for more information. -.It Dv EL_SETTC , Xo -.Fa "const char *" , -.Fa "..." , -.Dv NULL -.Xc +.It Dv EL_SETTC , Fa "const char *" , Fa "..." , Dv NULL Perform the .Ic settc builtin command. Refer to .Xr editrc 5 for more information. -.It Dv EL_SETTY , Xo -.Fa "const char *" , -.Fa "..." , -.Dv NULL -.Xc +.It Dv EL_SETTY , Fa "const char *" , Fa "..." , Dv NULL Perform the .Ic setty builtin command. Refer to .Xr editrc 5 for more information. -.It Dv EL_TELLTC , Xo -.Fa "const char *" , -.Fa "..." , -.Dv NULL -.Xc +.It Dv EL_TELLTC , Fa "const char *" , Fa "..." , Dv NULL Perform the .Ic telltc builtin command. Refer to .Xr editrc 5 for more information. -.It Dv EL_ADDFN , Xo -.Fa "const char *name" , -.Fa "const char *help" , -.Fa "unsigned char (*func)(EditLine *e, int ch)" -.Xc +.It Dv EL_ADDFN , Fa "const char *name" , Fa "const char *help" , \ +Fa "unsigned char (*func)(EditLine *e, int ch)" Add a user defined function, .Fn func , referred to as @@ -363,10 +368,8 @@ Beep, and flush tty. .It Dv CC_FATAL Fatal error, reset tty to known state. .El -.It Dv EL_HIST , Xo -.Fa "History *(*func)(History *, int op, ...)" , -.Fa "const char *ptr" -.Xc +.It Dv EL_HIST , Fa "History *(*func)(History *, int op, ...)" , \ +Fa "const char *ptr" Defines which history function to use, which is usually .Fn history . .Fa ptr @@ -438,10 +441,22 @@ The following values for are supported, along with actual type of .Fa result : .Bl -tag -width 4n -.It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)" -Return a pointer to the function that displays the prompt. -.It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)" -Return a pointer to the function that displays the rightside prompt. +.It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)" , Fa "char *c" +Return a pointer to the function that displays the prompt in +.Fa f . +If +.Fa c +is not +.Dv NULL , +return the start/stop literal prompt character in it. +.It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)" , Fa "char *c" +Return a pointer to the function that displays the prompt in +.Fa f . +If +.Fa c +is not +.Dv NULL , +return the start/stop literal prompt character in it. .It Dv EL_EDITOR , Fa "const char *" Return the name of the editor, which will be one of .Dq emacs @@ -606,18 +621,11 @@ assumed to be created with .Fn history_init . .It Dv H_CLEAR Clear the history. -.It Dv H_FUNC , Xo -.Fa "void *ptr" , -.Fa "history_gfun_t first" , -.Fa "history_gfun_t next" , -.Fa "history_gfun_t last" , -.Fa "history_gfun_t prev" , -.Fa "history_gfun_t curr" , -.Fa "history_sfun_t set" , -.Fa "history_vfun_t clear" , -.Fa "history_efun_t enter" , -.Fa "history_efun_t add" -.Xc +.It Dv H_FUNC , Fa "void *ptr" , Fa "history_gfun_t first" , \ +Fa "history_gfun_t next" , Fa "history_gfun_t last" , \ +Fa "history_gfun_t prev" , Fa "history_gfun_t curr" , \ +Fa "history_sfun_t set" , Fa "history_vfun_t clear" , \ +Fa "history_efun_t enter" , Fa "history_efun_t add" Define functions to perform various history operations. .Fa ptr is the argument given to a function when it is invoked. Modified: stable/8/lib/libedit/editrc.5 ============================================================================== --- stable/8/lib/libedit/editrc.5 Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/editrc.5 Fri Jun 29 03:03:42 2012 (r237739) @@ -1,4 +1,4 @@ -.\" $NetBSD: editrc.5,v 1.20 2006/08/21 12:45:30 christos Exp $ +.\" $NetBSD: editrc.5,v 1.24 2009/04/11 22:17:52 wiz Exp $ .\" .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -92,16 +92,8 @@ shell. .Pp The following builtin commands are available: .Bl -tag -width 4n -.It Ic bind Xo -.Op Fl a -.Op Fl e -.Op Fl k -.Op Fl l -.Op Fl r -.Op Fl s -.Op Fl v -.Op Ar key Op Ar command -.Xc +.It Ic bind Oo Fl a Oc Oo Fl e Oc Oo Fl k Oc Oo Fl l Oc Oo Fl r Oc \ +Oo Fl s Oc Oo Fl v Oc Oo Ar key Oo Ar command Oc Oc Without options, list all bound keys, and the editor command to which each is bound. If @@ -195,11 +187,7 @@ if it has any, notably .Sq \e and .Sq ^ . -.It Ic echotc Xo -.Op Fl sv -.Ar arg -.Ar ... -.Xc +.It Ic echotc Oo Fl sv Oc Ar arg Ar ... Exercise terminal capabilities given in .Ar arg Ar ... . If @@ -255,16 +243,8 @@ to as defined in .Xr termcap 5 . No sanity checking is done. -.It Ic setty Xo -.Op Fl a -.Op Fl d -.Op Fl q -.Op Fl x -.Op Ar +mode -.Op Ar -mode -.Op Ar mode -.Op Ar char=c -.Xc +.It Ic setty Oo Fl a Oc Oo Fl d Oc Oo Fl q Oc Oo Fl x Oc Oo Ar +mode Oc \ +Oo Ar -mode Oc Oo Ar mode Oc Oo Ar char=c Oc Control which tty modes that .Nm will not allow the user to change. Modified: stable/8/lib/libedit/el.c ============================================================================== --- stable/8/lib/libedit/el.c Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/el.c Fri Jun 29 03:03:42 2012 (r237739) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: el.c,v 1.44 2006/12/15 22:13:33 christos Exp $ + * $NetBSD: el.c,v 1.55 2009/07/25 21:19:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "el.h" #define HAVE_ISSETUGID @@ -156,9 +157,21 @@ el_set(EditLine *el, int op, ...) switch (op) { case EL_PROMPT: - case EL_RPROMPT: - rv = prompt_set(el, va_arg(ap, el_pfunc_t), op); + case EL_RPROMPT: { + el_pfunc_t p = va_arg(ap, el_pfunc_t); + + rv = prompt_set(el, p, 0, op); break; + } + + case EL_PROMPT_ESC: + case EL_RPROMPT_ESC: { + el_pfunc_t p = va_arg(ap, el_pfunc_t); + char c = va_arg(ap, int); + + rv = prompt_set(el, p, c, op); + break; + } case EL_TERMINAL: rv = term_set(el, va_arg(ap, char *)); @@ -309,6 +322,12 @@ el_set(EditLine *el, int op, ...) break; } + case EL_REFRESH: + re_clear_display(el); + re_refresh(el); + term__flush(el); + break; + default: rv = -1; break; @@ -335,9 +354,13 @@ el_get(EditLine *el, int op, ...) switch (op) { case EL_PROMPT: - case EL_RPROMPT: - rv = prompt_get(el, va_arg(ap, el_pfunc_t *), op); + case EL_RPROMPT: { + el_pfunc_t *p = va_arg(ap, el_pfunc_t *); + char *c = va_arg(ap, char *); + + rv = prompt_get(el, p, c, op); break; + } case EL_EDITOR: rv = map_get_editor(el, va_arg(ap, const char **)); @@ -364,7 +387,7 @@ el_get(EditLine *el, int op, ...) char *argv[20]; int i; - for (i = 1; i < sizeof(argv) / sizeof(argv[0]); i++) + for (i = 1; i < (int)(sizeof(argv) / sizeof(argv[0])); i++) if ((argv[i] = va_arg(ap, char *)) == NULL) break; @@ -495,12 +518,14 @@ el_source(EditLine *el, const char *fnam FILE *fp; size_t len; char *ptr; +#ifdef HAVE_ISSETUGID + char path[MAXPATHLEN]; +#endif fp = NULL; if (fname == NULL) { #ifdef HAVE_ISSETUGID static const char elpath[] = "/.editrc"; - char path[MAXPATHLEN]; if (issetugid()) return (-1); @@ -529,6 +554,13 @@ el_source(EditLine *el, const char *fnam if (len > 0 && ptr[len - 1] == '\n') --len; ptr[len] = '\0'; + + /* loop until first non-space char or EOL */ + while (*ptr != '\0' && isspace((unsigned char)*ptr)) + ptr++; + if (*ptr == '#') + continue; /* ignore, this is a comment line */ + if (parse_line(el, ptr) == -1) { (void) fclose(fp); return (-1); Modified: stable/8/lib/libedit/el.h ============================================================================== --- stable/8/lib/libedit/el.h Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/el.h Fri Jun 29 03:03:42 2012 (r237739) @@ -115,6 +115,7 @@ struct editline { FILE *el_errfile; /* Stdio stuff */ int el_infd; /* Input file descriptor */ int el_flags; /* Various flags. */ + int el_errno; /* Local copy of errno */ coord_t el_cursor; /* Cursor location */ char **el_display; /* Real screen image = what is there */ char **el_vdisplay; /* Virtual screen image = what we see */ Modified: stable/8/lib/libedit/histedit.h ============================================================================== --- stable/8/lib/libedit/histedit.h Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/histedit.h Fri Jun 29 03:03:42 2012 (r237739) @@ -131,10 +131,10 @@ unsigned char _el_fn_sh_complete(EditLin #define EL_GETCFN 13 /* , el_rfunc_t); */ #define EL_CLIENTDATA 14 /* , void *); */ #define EL_UNBUFFERED 15 /* , int); */ -#define EL_PREP_TERM 16 /* , int); */ +#define EL_PREP_TERM 16 /* , int); */ #define EL_GETTC 17 /* , const char *, ..., NULL); */ -#define EL_GETFP 18 /* , int, FILE **) */ -#define EL_SETFP 19 /* , int, FILE *) */ +#define EL_GETFP 18 /* , int, FILE **); */ +#define EL_SETFP 19 /* , int, FILE *); */ #define EL_REFRESH 20 /* , void); set */ #define EL_PROMPT_ESC 21 /* , prompt_func, Char); set/get */ #define EL_RPROMPT_ESC 22 /* , prompt_func, Char); set/get */ Modified: stable/8/lib/libedit/history.c ============================================================================== --- stable/8/lib/libedit/history.c Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/history.c Fri Jun 29 03:03:42 2012 (r237739) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: history.c,v 1.32 2006/09/28 13:52:51 christos Exp $ + * $NetBSD: history.c,v 1.34 2009/09/07 21:24:33 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -116,6 +116,7 @@ private int history_prev_string(History */ typedef struct hentry_t { HistEvent ev; /* What we return */ + void *data; /* data */ struct hentry_t *next; /* Next entry */ struct hentry_t *prev; /* Previous entry */ } hentry_t; @@ -145,6 +146,9 @@ private int history_def_init(ptr_t *, Hi private int history_def_insert(history_t *, HistEvent *, const char *); private void history_def_delete(history_t *, HistEvent *, hentry_t *); +private int history_deldata_nth(history_t *, HistEvent *, int, void **); +private int history_set_nth(ptr_t, HistEvent *, int); + #define history_def_setsize(p, num)(void) (((history_t *)p)->max = (num)) #define history_def_getsize(p) (((history_t *)p)->cur) #define history_def_getunique(p) (((((history_t *)p)->flags) & H_UNIQUE) != 0) @@ -335,6 +339,31 @@ history_def_set(ptr_t p, HistEvent *ev, } +/* history_set_nth(): + * Default function to set the current event in the history to the + * n-th one. + */ +private int +history_set_nth(ptr_t p, HistEvent *ev, int n) +{ + history_t *h = (history_t *) p; + + if (h->cur == 0) { + he_seterrev(ev, _HE_EMPTY_LIST); + return (-1); + } + for (h->cursor = h->list.prev; h->cursor != &h->list; + h->cursor = h->cursor->prev) + if (n-- <= 0) + break; + if (h->cursor == &h->list) { + he_seterrev(ev, _HE_NOT_FOUND); + return (-1); + } + return (0); +} + + /* history_def_add(): * Append string to element */ @@ -363,6 +392,24 @@ history_def_add(ptr_t p, HistEvent *ev, } +private int +history_deldata_nth(history_t *h, HistEvent *ev, + int num, void **data) +{ + if (history_set_nth(h, ev, num) != 0) + return (-1); + /* magic value to skip delete (just set to n-th history) */ + if (data == (void **)-1) + return (0); + ev->str = strdup(h->cursor->ev.str); + ev->num = h->cursor->ev.num; + if (data) + *data = h->cursor->data; + history_def_delete(h, ev, h->cursor); + return (0); +} + + /* history_def_del(): * Delete element hp of the h list */ @@ -392,8 +439,11 @@ history_def_delete(history_t *h, HistEventPrivate *evp = (void *)&hp->ev; if (hp == &h->list) abort(); - if (h->cursor == hp) + if (h->cursor == hp) { h->cursor = hp->prev; + if (h->cursor == &h->list) + h->cursor = hp->next; + } hp->prev->next = hp->next; hp->next->prev = hp->prev; h_free((ptr_t) evp->str); @@ -416,6 +466,7 @@ history_def_insert(history_t *h, HistEve h_free((ptr_t)h->cursor); goto oomem; } + h->cursor->data = NULL; h->cursor->ev.num = ++h->eventid; h->cursor->next = h->list.next; h->cursor->prev = &h->list; @@ -711,8 +762,8 @@ history_load(History *h, const char *fna (void) strunvis(ptr, line); line[sz] = c; if (HENTER(h, &ev, ptr) == -1) { - h_free((ptr_t)ptr); - return -1; + i = -1; + goto oomem; } } oomem: @@ -787,6 +838,23 @@ history_prev_event(History *h, HistEvent } +private int +history_next_evdata(History *h, HistEvent *ev, int num, void **d) +{ + int retval; + + for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev)) + if (num-- <= 0) { + if (d) + *d = ((history_t *)h->h_ref)->cursor->data; + return (0); + } + + he_seterrev(ev, _HE_NOT_FOUND); + return (-1); +} + + /* history_next_event(): * Find the next event, with number given */ @@ -976,11 +1044,42 @@ history(History *h, HistEvent *ev, int f retval = 0; break; + case H_NEXT_EVDATA: + { + int num = va_arg(va, int); + void **d = va_arg(va, void **); + retval = history_next_evdata(h, ev, num, d); + break; + } + + case H_DELDATA: + { + int num = va_arg(va, int); + void **d = va_arg(va, void **); + retval = history_deldata_nth((history_t *)h->h_ref, ev, num, d); + break; + } + + case H_REPLACE: /* only use after H_NEXT_EVDATA */ + { + const char *line = va_arg(va, const char *); + void *d = va_arg(va, void *); + const char *s; + if(!line || !(s = strdup(line))) { + retval = -1; + break; + } + ((history_t *)h->h_ref)->cursor->ev.str = s; + ((history_t *)h->h_ref)->cursor->data = d; + retval = 0; + break; + } + default: retval = -1; he_seterrev(ev, _HE_UNKNOWN); break; } va_end(va); - return (retval); + return retval; } Modified: stable/8/lib/libedit/key.c ============================================================================== --- stable/8/lib/libedit/key.c Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/key.c Fri Jun 29 03:03:42 2012 (r237739) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: key.c,v 1.19 2006/03/23 20:22:51 christos Exp $ + * $NetBSD: key.c,v 1.20 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -86,8 +86,8 @@ private void node__free(key_node_t *); private void node__put(EditLine *, key_node_t *); private int node__delete(EditLine *, key_node_t **, const char *); private int node_lookup(EditLine *, const char *, key_node_t *, - int); -private int node_enum(EditLine *, key_node_t *, int); + size_t); +private int node_enum(EditLine *, key_node_t *, size_t); #define KEY_BUFSIZ EL_BUFSIZ @@ -478,9 +478,9 @@ node__free(key_node_t *k) * Print if last node */ private int -node_lookup(EditLine *el, const char *str, key_node_t *ptr, int cnt) +node_lookup(EditLine *el, const char *str, key_node_t *ptr, size_t cnt) { - int ncnt; + size_t ncnt; if (ptr == NULL) return (-1); /* cannot have null ptr */ @@ -493,7 +493,8 @@ node_lookup(EditLine *el, const char *st /* If match put this char into el->el_key.buf. Recurse */ if (ptr->ch == *str) { /* match found */ - ncnt = key__decode_char(el->el_key.buf, KEY_BUFSIZ, cnt, + ncnt = key__decode_char(el->el_key.buf, + (size_t)KEY_BUFSIZ, cnt, (unsigned char) ptr->ch); if (ptr->next != NULL) /* not yet at leaf */ @@ -527,9 +528,9 @@ node_lookup(EditLine *el, const char *st * Traverse the node printing the characters it is bound in buffer */ private int -node_enum(EditLine *el, key_node_t *ptr, int cnt) +node_enum(EditLine *el, key_node_t *ptr, size_t cnt) { - int ncnt; + size_t ncnt; if (cnt >= KEY_BUFSIZ - 5) { /* buffer too small */ el->el_key.buf[++cnt] = '"'; @@ -547,7 +548,7 @@ node_enum(EditLine *el, key_node_t *ptr, return (-1); } /* put this char at end of str */ - ncnt = key__decode_char(el->el_key.buf, KEY_BUFSIZ, cnt, + ncnt = key__decode_char(el->el_key.buf, (size_t)KEY_BUFSIZ, cnt, (unsigned char)ptr->ch); if (ptr->next == NULL) { /* print this key and function */ @@ -615,8 +616,8 @@ key_kprint(EditLine *el, const char *key /* key__decode_char(): * Put a printable form of char in buf. */ -protected int -key__decode_char(char *buf, int cnt, int off, int ch) +protected size_t +key__decode_char(char *buf, size_t cnt, size_t off, int ch) { char *sb = buf + off; char *eb = buf + cnt; @@ -626,7 +627,7 @@ key__decode_char(char *buf, int cnt, int if (ch == 0) { ADDC('^'); ADDC('@'); - return b - sb; + return (int)(b - sb); } if (iscntrl(ch)) { ADDC('^'); @@ -648,15 +649,15 @@ key__decode_char(char *buf, int cnt, int ADDC((((unsigned int) ch >> 3) & 7) + '0'); ADDC((ch & 7) + '0'); } - return b - sb; + return (size_t)(b - sb); } /* key__decode_str(): * Make a printable version of the ey */ -protected int -key__decode_str(const char *str, char *buf, int len, const char *sep) +protected size_t +key__decode_str(const char *str, char *buf, size_t len, const char *sep) { char *b = buf, *eb = b + len; const char *p; @@ -699,7 +700,7 @@ key__decode_str(const char *str, char *b } done: ADDC('\0'); - if (b - buf >= len) + if ((size_t)(b - buf) >= len) buf[len - 1] = '\0'; - return b - buf; + return (size_t)(b - buf); } Modified: stable/8/lib/libedit/key.h ============================================================================== --- stable/8/lib/libedit/key.h Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/key.h Fri Jun 29 03:03:42 2012 (r237739) @@ -76,8 +76,8 @@ protected int key_delete(EditLine *, c protected void key_print(EditLine *, const char *); protected void key_kprint(EditLine *, const char *, key_value_t *, int); -protected int key__decode_str(const char *, char *, int, +protected size_t key__decode_str(const char *, char *, size_t, const char *); -protected int key__decode_char(char *, int, int, int); +protected size_t key__decode_char(char *, size_t, size_t, int); #endif /* _h_el_key */ Modified: stable/8/lib/libedit/prompt.c ============================================================================== --- stable/8/lib/libedit/prompt.c Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/prompt.c Fri Jun 29 03:03:42 2012 (r237739) @@ -85,14 +85,23 @@ prompt_print(EditLine *el, int op) { el_prompt_t *elp; char *p; + int ignore = 0; if (op == EL_PROMPT) elp = &el->el_prompt; else elp = &el->el_rprompt; - p = (elp->p_func) (el); - while (*p) - re_putc(el, *p++, 1); + + for (p = (*elp->p_func)(el); *p; p++) { + if (elp->p_ignore == *p) { + ignore = !ignore; + continue; + } + if (ignore) + term__putc(el, *p); + else + re_putc(el, *p, 1); + } elp->p_pos.v = el->el_refresh.r_cursor.v; elp->p_pos.h = el->el_refresh.r_cursor.h; @@ -109,10 +118,12 @@ prompt_init(EditLine *el) el->el_prompt.p_func = prompt_default; el->el_prompt.p_pos.v = 0; el->el_prompt.p_pos.h = 0; + el->el_prompt.p_ignore = '\0'; el->el_rprompt.p_func = prompt_default_r; el->el_rprompt.p_pos.v = 0; el->el_rprompt.p_pos.h = 0; - return (0); + el->el_rprompt.p_ignore = '\0'; + return 0; } @@ -130,24 +141,29 @@ prompt_end(EditLine *el __unused) * Install a prompt printing function */ protected int -prompt_set(EditLine *el, el_pfunc_t prf, int op) +prompt_set(EditLine *el, el_pfunc_t prf, char c, int op) { el_prompt_t *p; - if (op == EL_PROMPT) + if (op == EL_PROMPT || op == EL_PROMPT_ESC) p = &el->el_prompt; else p = &el->el_rprompt; + if (prf == NULL) { - if (op == EL_PROMPT) + if (op == EL_PROMPT || op == EL_PROMPT_ESC) p->p_func = prompt_default; else p->p_func = prompt_default_r; } else p->p_func = prf; + + p->p_ignore = c; + p->p_pos.v = 0; p->p_pos.h = 0; - return (0); + + return 0; } @@ -155,14 +171,22 @@ prompt_set(EditLine *el, el_pfunc_t prf, * Retrieve the prompt printing function */ protected int -prompt_get(EditLine *el, el_pfunc_t *prf, int op) +prompt_get(EditLine *el, el_pfunc_t *prf, char *c, int op) { + el_prompt_t *p; if (prf == NULL) - return (-1); + return -1; + if (op == EL_PROMPT) - *prf = el->el_prompt.p_func; + p = &el->el_prompt; else - *prf = el->el_rprompt.p_func; - return (0); + p = &el->el_rprompt; + + *prf = el->el_rprompt.p_func; + + if (c) + *c = p->p_ignore; + + return 0; } Modified: stable/8/lib/libedit/prompt.h ============================================================================== --- stable/8/lib/libedit/prompt.h Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/prompt.h Fri Jun 29 03:03:42 2012 (r237739) @@ -47,11 +47,13 @@ typedef char * (*el_pfunc_t)(EditLine*); typedef struct el_prompt_t { el_pfunc_t p_func; /* Function to return the prompt */ coord_t p_pos; /* position in the line after prompt */ + char p_ignore; /* character to start/end literal +*/ } el_prompt_t; protected void prompt_print(EditLine *, int); -protected int prompt_set(EditLine *, el_pfunc_t, int); -protected int prompt_get(EditLine *, el_pfunc_t *, int); +protected int prompt_set(EditLine *, el_pfunc_t, char, int); +protected int prompt_get(EditLine *, el_pfunc_t *, char *, int); protected int prompt_init(EditLine *); protected void prompt_end(EditLine *); Modified: stable/8/lib/libedit/read.c ============================================================================== --- stable/8/lib/libedit/read.c Fri Jun 29 03:01:38 2012 (r237738) +++ stable/8/lib/libedit/read.c Fri Jun 29 03:03:42 2012 (r237739) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: read.c,v 1.40 2007/03/01 21:41:45 christos Exp $ + * $NetBSD: read.c,v 1.52 2009/07/22 15:57:00 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include "el.h" -#define OKCMD -1 +#define OKCMD -1 /* must be -1! */ private int read__fixio(int, int); private int read_preread(EditLine *); @@ -170,7 +170,7 @@ read__fixio(int fd __unused, int e) return (e ? 0 : -1); case EINTR: - return (0); + return (-1); default: return (-1); @@ -222,7 +222,7 @@ el_push(EditLine *el, const char *str) ma->level--; } term_beep(el); - term__flush(); + term__flush(el); } @@ -235,9 +235,12 @@ read_getcmd(EditLine *el, el_action_t *c el_action_t cmd; int num; + el->el_errno = 0; do { - if ((num = el_getc(el, ch)) != 1) /* if EOF or error */ + if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */ + el->el_errno = num == 0 ? 0 : errno; return (num); + } #ifdef KANJI if ((*ch & 0200)) { @@ -286,18 +289,25 @@ read_getcmd(EditLine *el, el_action_t *c private int read_char(EditLine *el, char *cp) { - int num_read; + ssize_t num_read; int tried = 0; - while ((num_read = read(el->el_infd, cp, 1)) == -1) + again: + el->el_signal->sig_no = 0; + while ((num_read = read(el->el_infd, cp, 1)) == -1) { + if (el->el_signal->sig_no == SIGCONT) { + sig_set(el); + el_set(el, EL_REFRESH); + goto again; + } if (!tried && read__fixio(el->el_infd, errno) == 0) tried = 1; else { *cp = '\0'; return (-1); } - - return (num_read); + } + return (int)num_read; } /* read_pop(): @@ -309,8 +319,9 @@ read_pop(c_macro_t *ma) int i; el_free(ma->macro[0]); - for (i = ma->level--; i > 0; i--) - ma->macro[i - 1] = ma->macro[i]; + for (i = 0; i < ma->level; i++) + ma->macro[i] = ma->macro[i + 1]; + ma->level--; ma->offset = 0; } @@ -323,7 +334,7 @@ el_getc(EditLine *el, char *cp) int num_read; c_macro_t *ma = &el->el_chared.c_macro; - term__flush(); + term__flush(el); for (;;) { if (ma->level < 0) { if (!read_preread(el)) @@ -382,7 +393,7 @@ read_prepare(EditLine *el) re_refresh(el); /* print the prompt */ if (el->el_flags & UNBUFFERED) - term__flush(); + term__flush(el); } protected void @@ -402,15 +413,20 @@ el_gets(EditLine *el, int *nread) int num; /* how many chars we have read at NL */ char ch; int crlf = 0; + int nrb; #ifdef FIONREAD c_macro_t *ma = &el->el_chared.c_macro; #endif /* FIONREAD */ + if (nread == NULL) + nread = &nrb; + *nread = 0; + if (el->el_flags & NO_TTY) { char *cp = el->el_line.buffer; size_t idx; - while ((*el->el_read.read_char)(el, cp) == 1) { + while ((num = (*el->el_read.read_char)(el, cp)) == 1) { /* make sure there is space for next character */ if (cp + 1 >= el->el_line.limit) { idx = (cp - el->el_line.buffer); @@ -424,12 +440,16 @@ el_gets(EditLine *el, int *nread) if (cp[-1] == '\r' || cp[-1] == '\n') break; } + if (num == -1) { + if (errno == EINTR) + cp = el->el_line.buffer; + el->el_errno = errno; + } el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = el->el_line.cursor - el->el_line.buffer; - return (el->el_line.buffer); + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + goto done; } @@ -440,8 +460,8 @@ el_gets(EditLine *el, int *nread) (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 03:37:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 095D0106566C; Fri, 29 Jun 2012 03:37:24 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E55E98FC18; Fri, 29 Jun 2012 03:37:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T3bNx1016349; Fri, 29 Jun 2012 03:37:23 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T3bN7E016339; Fri, 29 Jun 2012 03:37:23 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201206290337.q5T3bN7E016339@svn.freebsd.org> From: Scott Long Date: Fri, 29 Jun 2012 03:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237740 - stable/9/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 03:37:24 -0000 Author: scottl Date: Fri Jun 29 03:37:23 2012 New Revision: 237740 URL: http://svn.freebsd.org/changeset/base/237740 Log: Merge the firmware download functionality into camcontrol, as well as several other minor code changes. Obtained from: Netflix, Inc. Added: stable/9/sbin/camcontrol/fwdownload.c - copied, changed from r227961, head/sbin/camcontrol/fwdownload.c stable/9/sbin/camcontrol/progress.c - copied unchanged from r237285, head/sbin/camcontrol/progress.c stable/9/sbin/camcontrol/progress.h - copied unchanged from r237285, head/sbin/camcontrol/progress.h Modified: stable/9/sbin/camcontrol/Makefile stable/9/sbin/camcontrol/camcontrol.8 stable/9/sbin/camcontrol/camcontrol.c stable/9/sbin/camcontrol/camcontrol.h stable/9/sbin/camcontrol/modeedit.c stable/9/sbin/camcontrol/util.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/Makefile ============================================================================== --- stable/9/sbin/camcontrol/Makefile Fri Jun 29 03:03:42 2012 (r237739) +++ stable/9/sbin/camcontrol/Makefile Fri Jun 29 03:37:23 2012 (r237740) @@ -3,7 +3,7 @@ PROG= camcontrol SRCS= camcontrol.c util.c .if !defined(RELEASE_CRUNCH) -SRCS+= modeedit.c +SRCS+= fwdownload.c modeedit.c progress.c .else CFLAGS+= -DMINIMALISTIC .endif Modified: stable/9/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.8 Fri Jun 29 03:03:42 2012 (r237739) +++ stable/9/sbin/camcontrol/camcontrol.8 Fri Jun 29 03:37:23 2012 (r237740) @@ -221,6 +221,13 @@ .Op device id .Op generic args .Nm +.Ic fwdownload +.Op device id +.Op generic args +.Aq Fl f Ar fw_image +.Op Fl y +.Op Fl s +.Nm .Ic help .Sh DESCRIPTION The @@ -1063,6 +1070,54 @@ specifies automatic standby timer value .It Ic sleep Put ATA device into SLEEP state. Note that the only way get device out of this state may be reset. +.It Ic fwdownload +Program firmware of the named SCSI device using the image file provided. +.Pp +Current list of supported vendors: +.Bl -bullet -offset indent -compact +.It +HITACHI +.It +HP +.It +IBM +.It +PLEXTOR +.It +QUANTUM +.It +SEAGATE +.El +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +Little testing has been done to make sure that different device models from +each vendor work correctly with the fwdownload command. +A vendor name appearing in the supported list means only that firmware of at +least one device type from that vendor has successfully been programmed with +the fwdownload command. +Extra caution should be taken when using this command since there is no +guarantee it will not break a device from the listed vendors. +Ensure that you have a recent backup of the data on the device before +performing a firmware update. +.Bl -tag -width 11n +.It Fl f Ar fw_image +Path to the firmware image file to be downloaded to the specified device. +.It Fl y +Do not ask for confirmation. +.It Fl s +Run in simulation mode. +Packet sizes that will be sent are shown, but no actual packet is sent to the +device. +No confimation is asked in simulation mode. +.It Fl v +Besides showing sense information in case of a failure, the verbose option +causes +.Nm +to output a line for every firmware segment that is sent to the device by the +fwdownload command +-- the same as the ones shown in simulation mode. +.El .It Ic help Print out verbose usage information. .El @@ -1176,7 +1231,6 @@ camcontrol negotiate -n da -u 3 -R 20.00 Negotiate a sync rate of 20MHz and an offset of 15 with da3. Then send a Test Unit Ready command to make the settings take effect. -.Pp .Bd -literal -offset indent camcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1" .Ed Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Fri Jun 29 03:03:42 2012 (r237739) +++ stable/9/sbin/camcontrol/camcontrol.c Fri Jun 29 03:37:23 2012 (r237740) @@ -86,7 +86,8 @@ typedef enum { CAM_CMD_SMP_RG = 0x00000018, CAM_CMD_SMP_PC = 0x00000019, CAM_CMD_SMP_PHYLIST = 0x0000001a, - CAM_CMD_SMP_MANINFO = 0x0000001b + CAM_CMD_SMP_MANINFO = 0x0000001b, + CAM_CMD_DOWNLOAD_FW = 0x0000001c } cam_cmdmask; typedef enum { @@ -181,6 +182,7 @@ struct camcontrol_opts option_table[] = {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, + {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:ys"}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -223,8 +225,6 @@ static int testunitready(struct cam_devi int timeout, int quiet); static int scsistart(struct cam_device *device, int startstop, int loadeject, int retry_count, int timeout); -static int scsidoinquiry(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); static int scsiinquiry(struct cam_device *device, int retry_count, int timeout); static int scsiserial(struct cam_device *device, int retry_count, int timeout); static int camxferrate(struct cam_device *device); @@ -703,7 +703,7 @@ scsistart(struct cam_device *device, int return(error); } -static int +int scsidoinquiry(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout) { @@ -3071,6 +3071,26 @@ get_cgd_bailout: return(retval); } +/* return the type of disk (really the command type) */ +static const char * +get_disk_type(struct cam_device *device) +{ + struct ccb_getdev cgd; + + (void) memset(&cgd, 0x0, sizeof(cgd)); + get_cgd(device, &cgd); + switch(cgd.protocol) { + case PROTO_SCSI: + return "scsi"; + case PROTO_ATA: + case PROTO_ATAPI: + case PROTO_SATAPM: + return "ata"; + default: + return "unknown"; + } +} + static void cpi_print(struct ccb_pathinq *cpi) { @@ -3644,7 +3664,7 @@ scsiformat(struct cam_device *device, in union ccb *ccb; int c; int ycount = 0, quiet = 0; - int error = 0, response = 0, retval = 0; + int error = 0, retval = 0; int use_timeout = 10800 * 1000; int immediate = 1; struct format_defect_list_header fh; @@ -3698,27 +3718,7 @@ scsiformat(struct cam_device *device, in } if (ycount == 0) { - - do { - char str[1024]; - - fprintf(stdout, "Are you SURE you want to do " - "this? (yes/no) "); - - if (fgets(str, sizeof(str), stdin) != NULL) { - - if (strncasecmp(str, "yes", 3) == 0) - response = 1; - else if (strncasecmp(str, "no", 2) == 0) - response = -1; - else { - fprintf(stdout, "Please answer" - " \"yes\" or \"no\"\n"); - } - } - } while (response == 0); - - if (response == -1) { + if (!get_confirmation()) { error = 1; goto scsiformat_bailout; } @@ -5765,6 +5765,7 @@ usage(int verbose) " camcontrol idle [dev_id][generic args][-t time]\n" " camcontrol standby [dev_id][generic args][-t time]\n" " camcontrol sleep [dev_id][generic args]\n" +" camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-y][-s]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); if (!verbose) @@ -5800,6 +5801,7 @@ usage(int verbose) "idle send the ATA IDLE command to the named device\n" "standby send the ATA STANDBY command to the named device\n" "sleep send the ATA SLEEP command to the named device\n" +"fwdownload program firmware of the named device with the given image" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -5891,7 +5893,12 @@ usage(int verbose) "-w don't send immediate format command\n" "-y don't ask any questions\n" "idle/standby arguments:\n" -"-t number of seconds before respective state.\n"); +"-t number of seconds before respective state.\n" +"fwdownload arguments:\n" +"-f fw_image path to firmware image file\n" +"-y don't ask any questions\n" +"-s run in simulation mode\n" +"-v print info for every firmware segment sent to device\n"); #endif /* MINIMALISTIC */ } @@ -6207,6 +6214,11 @@ main(int argc, char **argv) combinedopt, retry_count, timeout); break; + case CAM_CMD_DOWNLOAD_FW: + error = fwdownload(cam_dev, argc, argv, combinedopt, + arglist & CAM_ARG_VERBOSE, retry_count, timeout, + get_disk_type(cam_dev)); + break; #endif /* MINIMALISTIC */ case CAM_CMD_USAGE: usage(1); Modified: stable/9/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.h Fri Jun 29 03:03:42 2012 (r237739) +++ stable/9/sbin/camcontrol/camcontrol.h Fri Jun 29 03:37:23 2012 (r237740) @@ -40,6 +40,9 @@ struct get_hook int got; }; +int fwdownload(struct cam_device *device, int argc, char **argv, + char *combinedopt, int verbose, int retry_count, int timeout, + const char */*type*/); void mode_sense(struct cam_device *device, int mode_page, int page_control, int dbd, int retry_count, int timeout, u_int8_t *data, int datalen); @@ -49,8 +52,11 @@ void mode_edit(struct cam_device *device int edit, int binary, int retry_count, int timeout); void mode_list(struct cam_device *device, int page_control, int dbd, int retry_count, int timeout); +int scsidoinquiry(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); char *cget(void *hook, char *name); int iget(void *hook, char *name); void arg_put(void *hook, int letter, void *arg, int count, char *name); +int get_confirmation(void); void usage(int verbose); #endif /* _CAMCONTROL_H */ Copied and modified: stable/9/sbin/camcontrol/fwdownload.c (from r227961, head/sbin/camcontrol/fwdownload.c) ============================================================================== --- head/sbin/camcontrol/fwdownload.c Fri Nov 25 04:03:37 2011 (r227961, copy source) +++ stable/9/sbin/camcontrol/fwdownload.c Fri Jun 29 03:37:23 2012 (r237740) @@ -26,6 +26,15 @@ */ /* + * This software is derived from Andre Albsmeier's fwprog.c which contained + * the following note: + * + * Many thanks goes to Marc Frajola from + * TeraSolutions for the initial idea and his programme for upgrading + * the firmware of I*M DDYS drives. + */ + +/* * BEWARE: * * The fact that you see your favorite vendor listed below does not @@ -55,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "progress.h" + #include "camcontrol.h" #define CMD_TIMEOUT 50000 /* 50 seconds */ @@ -64,6 +75,7 @@ typedef enum { VENDOR_HP, VENDOR_IBM, VENDOR_PLEXTOR, + VENDOR_QUALSTAR, VENDOR_QUANTUM, VENDOR_SEAGATE, VENDOR_UNKNOWN @@ -79,32 +91,58 @@ struct fw_vendor { int inc_cdb_offset; }; -struct fw_vendor vendors_list[] = { +static const struct fw_vendor vendors_list[] = { {VENDOR_HITACHI, "HITACHI", 0x8000, 0x05, 0x05, 1, 0}, {VENDOR_HP, "HP", 0x8000, 0x07, 0x07, 0, 1}, {VENDOR_IBM, "IBM", 0x8000, 0x05, 0x05, 1, 0}, {VENDOR_PLEXTOR, "PLEXTOR", 0x2000, 0x04, 0x05, 0, 1}, + {VENDOR_QUALSTAR, "QUALSTAR", 0x2030, 0x05, 0x05, 0, 0}, {VENDOR_QUANTUM, "QUANTUM", 0x2000, 0x04, 0x05, 0, 1}, {VENDOR_SEAGATE, "SEAGATE", 0x8000, 0x07, 0x07, 0, 1}, + /* the next 2 are SATA disks going through SAS HBA */ + {VENDOR_SEAGATE, "ATA ST", 0x8000, 0x07, 0x07, 0, 1}, + {VENDOR_HITACHI, "ATA HDS", 0x8000, 0x05, 0x05, 1, 0}, {VENDOR_UNKNOWN, NULL, 0x0000, 0x00, 0x00, 0, 0} }; -static struct fw_vendor *fw_get_vendor(struct cam_device *cam_dev); -static char *fw_read_img(char *fw_img_path, struct fw_vendor *vp, - int *num_bytes); +#ifndef ATA_DOWNLOAD_MICROCODE +#define ATA_DOWNLOAD_MICROCODE 0x92 +#endif + +#define USE_OFFSETS_FEATURE 0x3 + +#ifndef LOW_SECTOR_SIZE +#define LOW_SECTOR_SIZE 512 +#endif + +#define ATA_MAKE_LBA(o, p) \ + ((((((o) / LOW_SECTOR_SIZE) >> 8) & 0xff) << 16) | \ + ((((o) / LOW_SECTOR_SIZE) & 0xff) << 8) | \ + ((((p) / LOW_SECTOR_SIZE) >> 8) & 0xff)) + +#define ATA_MAKE_SECTORS(p) (((p) / 512) & 0xff) + +#ifndef UNKNOWN_MAX_PKT_SIZE +#define UNKNOWN_MAX_PKT_SIZE 0x8000 +#endif + +static const struct fw_vendor *fw_get_vendor(struct cam_device *cam_dev); +static char *fw_read_img(const char *fw_img_path, + const struct fw_vendor *vp, int *num_bytes); static int fw_download_img(struct cam_device *cam_dev, - struct fw_vendor *vp, char *buf, int img_size, - int sim_mode, int verbose, int retry_count, int timeout); + const struct fw_vendor *vp, char *buf, int img_size, + int sim_mode, int verbose, int retry_count, int timeout, + const char */*name*/, const char */*type*/); /* * Find entry in vendors list that belongs to * the vendor of given cam device. */ -static struct fw_vendor * +static const struct fw_vendor * fw_get_vendor(struct cam_device *cam_dev) { char vendor[SID_VENDOR_SIZE + 1]; - struct fw_vendor *vp; + const struct fw_vendor *vp; if (cam_dev == NULL) return (NULL); @@ -124,7 +162,7 @@ fw_get_vendor(struct cam_device *cam_dev * in num_bytes. */ static char * -fw_read_img(char *fw_img_path, struct fw_vendor *vp, int *num_bytes) +fw_read_img(const char *fw_img_path, const struct fw_vendor *vp, int *num_bytes) { int fd; struct stat stbuf; @@ -164,6 +202,9 @@ fw_read_img(char *fw_img_path, struct fw (img_size % 512 == 80)) skip_bytes = 80; break; + case VENDOR_QUALSTAR: + skip_bytes = img_size % 1030; + break; default: break; } @@ -196,28 +237,59 @@ bailout1: * device but do not sent any actual packets */ static int -fw_download_img(struct cam_device *cam_dev, struct fw_vendor *vp, +fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, char *buf, int img_size, int sim_mode, int verbose, int retry_count, - int timeout) + int timeout, const char *imgname, const char *type) { struct scsi_write_buffer cdb; + progress_t progress; + int size; union ccb *ccb; int pkt_count = 0; + int max_pkt_size; u_int32_t pkt_size = 0; char *pkt_ptr = buf; u_int32_t offset; int last_pkt = 0; + int16_t *ptr; if ((ccb = cam_getccb(cam_dev)) == NULL) { warnx("Could not allocate CCB"); return (1); } - scsi_test_unit_ready(&ccb->csio, 0, NULL, MSG_SIMPLE_Q_TAG, - SSD_FULL_SIZE, 5000); + if (strcmp(type, "scsi") == 0) { + scsi_test_unit_ready(&ccb->csio, 0, NULL, MSG_SIMPLE_Q_TAG, + SSD_FULL_SIZE, 5000); + } else if (strcmp(type, "ata") == 0) { + /* cam_getccb cleans up the header, caller has to zero the payload */ + bzero(&(&ccb->ccb_h)[1], + sizeof(struct ccb_ataio) - sizeof(struct ccb_hdr)); + + ptr = (uint16_t *)malloc(sizeof(struct ata_params)); + + if (ptr == NULL) { + cam_freeccb(ccb); + warnx("can't malloc memory for identify\n"); + return(1); + } + bzero(ptr, sizeof(struct ata_params)); + cam_fill_ataio(&ccb->ataio, + 1, + NULL, + /*flags*/CAM_DIR_IN, + MSG_SIMPLE_Q_TAG, + /*data_ptr*/(uint8_t *)ptr, + /*dxfer_len*/sizeof(struct ata_params), + timeout ? timeout : 30 * 1000); + ata_28bit_cmd(&ccb->ataio, ATA_ATA_IDENTIFY, 0, 0, 0); + } else { + warnx("weird disk type '%s'", type); + return 1; + } /* Disable freezing the device queue. */ ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; if (cam_send_ccb(cam_dev, ccb) < 0) { - warnx("Error sending test unit ready"); + warnx("Error sending identify/test unit ready"); if (verbose) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); @@ -232,85 +304,104 @@ fw_download_img(struct cam_device *cam_d cam_freeccb(ccb); return (1); } - pkt_size = vp->max_pkt_size; - if (verbose || sim_mode) { - fprintf(stdout, - "--------------------------------------------------\n"); - fprintf(stdout, - "PktNo. PktSize BytesRemaining LastPkt\n"); - fprintf(stdout, - "--------------------------------------------------\n"); + max_pkt_size = vp->max_pkt_size; + if (vp->max_pkt_size == 0 && strcmp(type, "ata") == 0) { + max_pkt_size = UNKNOWN_MAX_PKT_SIZE; } + pkt_size = vp->max_pkt_size; + progress_init(&progress, imgname, size = img_size); /* Download single fw packets. */ do { - if (img_size <= vp->max_pkt_size) { + if (img_size <= max_pkt_size) { last_pkt = 1; pkt_size = img_size; } - if (verbose || sim_mode) - fprintf(stdout, "%3u %5u (0x%05X) %7u (0x%06X) " - "%d\n", pkt_count, pkt_size, pkt_size, - img_size - pkt_size, img_size - pkt_size, - last_pkt); + progress_update(&progress, size - img_size); + progress_draw(&progress); bzero(&cdb, sizeof(cdb)); - cdb.opcode = WRITE_BUFFER; - cdb.control = 0; - /* Parameter list length. */ - scsi_ulto3b(pkt_size, &cdb.length[0]); - offset = vp->inc_cdb_offset ? (pkt_ptr - buf) : 0; - scsi_ulto3b(offset, &cdb.offset[0]); - cdb.byte2 = last_pkt ? vp->cdb_byte2_last : vp->cdb_byte2; - cdb.buffer_id = vp->inc_cdb_buffer_id ? pkt_count : 0; - /* Zero out payload of ccb union after ccb header. */ - bzero((u_char *)ccb + sizeof(struct ccb_hdr), - sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); - /* Copy previously constructed cdb into ccb_scsiio struct. */ - bcopy(&cdb, &ccb->csio.cdb_io.cdb_bytes[0], - sizeof(struct scsi_write_buffer)); - /* Fill rest of ccb_scsiio struct. */ + if (strcmp(type, "scsi") == 0) { + cdb.opcode = WRITE_BUFFER; + cdb.control = 0; + /* Parameter list length. */ + scsi_ulto3b(pkt_size, &cdb.length[0]); + offset = vp->inc_cdb_offset ? (pkt_ptr - buf) : 0; + scsi_ulto3b(offset, &cdb.offset[0]); + cdb.byte2 = last_pkt ? vp->cdb_byte2_last : vp->cdb_byte2; + cdb.buffer_id = vp->inc_cdb_buffer_id ? pkt_count : 0; + /* Zero out payload of ccb union after ccb header. */ + bzero((u_char *)ccb + sizeof(struct ccb_hdr), + sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + /* Copy previously constructed cdb into ccb_scsiio struct. */ + bcopy(&cdb, &ccb->csio.cdb_io.cdb_bytes[0], + sizeof(struct scsi_write_buffer)); + /* Fill rest of ccb_scsiio struct. */ + if (!sim_mode) { + cam_fill_csio(&ccb->csio, /* ccb_scsiio */ + retry_count, /* retries */ + NULL, /* cbfcnp */ + CAM_DIR_OUT | CAM_DEV_QFRZDIS, /* flags */ + CAM_TAG_ACTION_NONE, /* tag_action */ + (u_char *)pkt_ptr, /* data_ptr */ + pkt_size, /* dxfer_len */ + SSD_FULL_SIZE, /* sense_len */ + sizeof(struct scsi_write_buffer), /* cdb_len */ + timeout ? timeout : CMD_TIMEOUT); /* timeout */ + } + } else if (strcmp(type, "ata") == 0) { + bzero(&(&ccb->ccb_h)[1], + sizeof(struct ccb_ataio) - sizeof(struct ccb_hdr)); + if (!sim_mode) { + uint32_t off; + + cam_fill_ataio(&ccb->ataio, + (last_pkt) ? 256 : retry_count, + NULL, + /*flags*/CAM_DIR_OUT | CAM_DEV_QFRZDIS, + CAM_TAG_ACTION_NONE, + /*data_ptr*/(uint8_t *)pkt_ptr, + /*dxfer_len*/pkt_size, + timeout ? timeout : 30 * 1000); + off = (uint32_t)(pkt_ptr - buf); + ata_28bit_cmd(&ccb->ataio, ATA_DOWNLOAD_MICROCODE, + USE_OFFSETS_FEATURE, + ATA_MAKE_LBA(off, pkt_size), + ATA_MAKE_SECTORS(pkt_size)); + } + } if (!sim_mode) { - cam_fill_csio(&ccb->csio, /* ccb_scsiio */ - retry_count, /* retries */ - NULL, /* cbfcnp */ - CAM_DIR_OUT | CAM_DEV_QFRZDIS, /* flags */ - CAM_TAG_ACTION_NONE, /* tag_action */ - (u_char *)pkt_ptr, /* data_ptr */ - pkt_size, /* dxfer_len */ - SSD_FULL_SIZE, /* sense_len */ - sizeof(struct scsi_write_buffer), /* cdb_len */ - timeout ? timeout : CMD_TIMEOUT); /* timeout */ /* Execute the command. */ if (cam_send_ccb(cam_dev, ccb) < 0) { warnx("Error writing image to device"); if (verbose) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); + CAM_EPF_ALL, stderr); goto bailout; } + if (ccb->ataio.res.status != 0 /*&& !last_pkt*/) { + cam_error_print(cam_dev, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } } /* Prepare next round. */ pkt_count++; pkt_ptr += pkt_size; img_size -= pkt_size; } while(!last_pkt); - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (verbose) - cam_error_print(cam_dev, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - goto bailout; - } + progress_complete(&progress, size - img_size); cam_freeccb(ccb); return (0); bailout: + progress_complete(&progress, size - img_size); cam_freeccb(ccb); return (1); } int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int verbose, int retry_count, int timeout) + char *combinedopt, int verbose, int retry_count, int timeout, + const char *type) { - struct fw_vendor *vp; + const struct fw_vendor *vp; char *fw_img_path = NULL; char *buf; int img_size; @@ -336,12 +427,13 @@ fwdownload(struct cam_device *device, in } if (fw_img_path == NULL) - errx(1, - "you must specify a firmware image file using -f option"); + errx(1, "you must specify a firmware image file using -f option"); vp = fw_get_vendor(device); - if (vp == NULL || vp->type == VENDOR_UNKNOWN) - errx(1, "Unsupported device"); + if (vp == NULL) + errx(1, "NULL vendor"); + if (vp->type == VENDOR_UNKNOWN) + warnx("Unsupported device - flashing through an HBA?"); buf = fw_read_img(fw_img_path, vp, &img_size); if (buf == NULL) @@ -351,11 +443,6 @@ fwdownload(struct cam_device *device, in fprintf(stdout, "You are about to download firmware image (%s)" " into the following device:\n", fw_img_path); - if (scsidoinquiry(device, argc, argv, combinedopt, 0, - 5000) != 0) { - warnx("Error sending inquiry"); - goto fail; - } fprintf(stdout, "\nIt may damage your drive. "); if (!get_confirmation()) goto fail; @@ -364,10 +451,11 @@ fwdownload(struct cam_device *device, in fprintf(stdout, "Running in simulation mode\n"); if (fw_download_img(device, vp, buf, img_size, sim_mode, verbose, - retry_count, timeout) != 0) { + retry_count, timeout, fw_img_path, type) != 0) { fprintf(stderr, "Firmware download failed\n"); goto fail; - } else + } + else fprintf(stdout, "Firmware download successful\n"); free(buf); Modified: stable/9/sbin/camcontrol/modeedit.c ============================================================================== --- stable/9/sbin/camcontrol/modeedit.c Fri Jun 29 03:03:42 2012 (r237739) +++ stable/9/sbin/camcontrol/modeedit.c Fri Jun 29 03:37:23 2012 (r237740) @@ -83,15 +83,15 @@ struct editentry { char *svalue; } value; }; -STAILQ_HEAD(, editentry) editlist; /* List of page entries. */ -int editlist_changed = 0; /* Whether any entries were changed. */ +static STAILQ_HEAD(, editentry) editlist; /* List of page entries. */ +static int editlist_changed = 0; /* Whether any entries were changed. */ struct pagename { SLIST_ENTRY(pagename) link; int pagenum; char *name; }; -SLIST_HEAD(, pagename) namelist; /* Page number to name mappings. */ +static SLIST_HEAD(, pagename) namelist; /* Page number to name mappings. */ static char format[MAX_FORMAT_SPEC]; /* Buffer for scsi cdb format def. */ Copied: stable/9/sbin/camcontrol/progress.c (from r237285, head/sbin/camcontrol/progress.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/camcontrol/progress.c Fri Jun 29 03:37:23 2012 (r237740, copy of r237285, head/sbin/camcontrol/progress.c) @@ -0,0 +1,186 @@ +/* $NetBSD: progressbar.c,v 1.21 2009/04/12 10:18:52 lukem Exp $ */ + +/*- + * Copyright (c) 1997-2009 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Luke Mewburn. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +__FBSDID("$FreeBSD$"); + +#include "progress.h" + +static const char * const suffixes[] = { + "", /* 2^0 (byte) */ + "KiB", /* 2^10 Kibibyte */ + "MiB", /* 2^20 Mebibyte */ + "GiB", /* 2^30 Gibibyte */ + "TiB", /* 2^40 Tebibyte */ + "PiB", /* 2^50 Pebibyte */ + "EiB", /* 2^60 Exbibyte */ +}; + +#define NSUFFIXES (sizeof(suffixes) / sizeof(suffixes[0])) +#define SECSPERHOUR (60 * 60) +#define DEFAULT_TTYWIDTH 80 + +/* initialise progress meter structure */ +int +progress_init(progress_t *prog, const char *prefix, uint64_t total) +{ + struct winsize winsize; + int oerrno = errno; + + (void) memset(prog, 0x0, sizeof(*prog)); + prog->size = total; + prog->prefix = strdup(prefix); + prog->start = time(NULL); + if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &winsize) != -1 && + winsize.ws_col != 0) { + prog->ttywidth = winsize.ws_col; + } else { + prog->ttywidth = DEFAULT_TTYWIDTH; + } + errno = oerrno; + return 1; +} + +/* update the values in the progress meter */ +int +progress_update(progress_t *prog, uint64_t done) +{ + prog->done = done; + prog->percent = (prog->done * 100) / prog->size; + prog->now = time(NULL); + prog->elapsed = prog->now - prog->start; + if (done == 0 || prog->elapsed == 0 || prog->done / prog->elapsed == 0) { + prog->eta = 0; + } else { + prog->eta = prog->size / (prog->done / prog->elapsed) - prog->elapsed; + } + return 1; +} + +/* update the values in the progress meter */ +int +progress_reset_size(progress_t *prog, uint64_t size) +{ + prog->size = size; + return 1; +} + +/* make it look pretty at the end - display done bytes (usually total) */ +int +progress_complete(progress_t *prog, uint64_t done) +{ + progress_update(prog, done); + progress_draw(prog); + printf("\n"); + return 1; +} + +/* draw the progress meter */ +int +progress_draw(progress_t *prog) +{ +#define BAROVERHEAD 45 /* non `*' portion of progress bar */ + /* + * stars should contain at least + * sizeof(buf) - BAROVERHEAD entries + */ + static const char stars[] = +"*****************************************************************************" +"*****************************************************************************" +"*****************************************************************************"; + unsigned bytesabbrev; + unsigned bpsabbrev; + int64_t secs; + uint64_t bytespersec; + uint64_t abbrevsize; + int64_t secsleft; + size_t barlength; + size_t starc; + char hours[12]; + char buf[256]; + int len; + + barlength = MIN(sizeof(buf) - 1, (unsigned)prog->ttywidth) - BAROVERHEAD - strlen(prog->prefix); + starc = (barlength * prog->percent) / 100; + abbrevsize = prog->done; + for (bytesabbrev = 0; abbrevsize >= 100000 && bytesabbrev < NSUFFIXES; bytesabbrev++) { + abbrevsize >>= 10; + } + if (bytesabbrev == NSUFFIXES) { + bytesabbrev--; + } + bytespersec = 0; + if (prog->done > 0) { + bytespersec = prog->done; + if (prog->elapsed > 0) { + bytespersec /= prog->elapsed; + } + } + for (bpsabbrev = 1; bytespersec >= 1024000 && bpsabbrev < NSUFFIXES; bpsabbrev++) { + bytespersec >>= 10; + } + if (prog->done == 0 || prog->elapsed <= 0 || prog->done > prog->size) { + secsleft = 0; + } else { + secsleft = prog->eta; + } + if ((secs = secsleft / SECSPERHOUR) > 0) { + (void) snprintf(hours, sizeof(hours), "%2lld:", (long long)secs); + } else { + (void) snprintf(hours, sizeof(hours), " "); + } + secs = secsleft % SECSPERHOUR; + len = snprintf(buf, sizeof(buf), + "\r%s %3lld%% |%.*s%*s| %5lld %-3s %3lld.%02d %.2sB/s %s%02d:%02d ETA", + (prog->prefix) ? prog->prefix : "", + (long long)prog->percent, + (int)starc, stars, (int)(barlength - starc), "", + (long long)abbrevsize, + suffixes[bytesabbrev], + (long long)(bytespersec / 1024), + (int)((bytespersec % 1024) * 100 / 1024), + suffixes[bpsabbrev], + hours, + (int)secs / 60, (int)secs % 60); + return (int)write(STDOUT_FILENO, buf, len); +} Copied: stable/9/sbin/camcontrol/progress.h (from r237285, head/sbin/camcontrol/progress.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/camcontrol/progress.h Fri Jun 29 03:37:23 2012 (r237740, copy of r237285, head/sbin/camcontrol/progress.h) @@ -0,0 +1,60 @@ +/* $NetBSD: progressbar.c,v 1.21 2009/04/12 10:18:52 lukem Exp $ */ + +/*- + * Copyright (c) 1997-2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Luke Mewburn. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef PROGRESS_H_ +#define PROGRESS_H_ 20100228 + +#include + +#include + +/* structure used to display a progress meter */ +typedef struct progress_t { + char *prefix; /* any prefix explanation */ + uint64_t size; /* total of bytes/units to be counted */ + uint64_t done; /* number of units counted to date */ + uint64_t percent; /* cache the percentage complete */ + time_t start; /* time we started this */ + time_t now; /* time now */ + time_t eta; /* estimated # of secs until completion */ + int64_t elapsed; /* cached # of elapsed seconds */ + int32_t ttywidth; /* width of tty in columns */ +} progress_t; + +int progress_init(progress_t */*meter*/, const char */*prefix*/, uint64_t /*size*/); +int progress_update(progress_t */*meter*/, uint64_t /*done*/); +int progress_draw(progress_t */*meter*/); +int progress_reset_size(progress_t */*meter*/, uint64_t /*size*/); +int progress_complete(progress_t */*meter*/, uint64_t /*done*/); + +#endif Modified: stable/9/sbin/camcontrol/util.c ============================================================================== --- stable/9/sbin/camcontrol/util.c Fri Jun 29 03:03:42 2012 (r237739) +++ stable/9/sbin/camcontrol/util.c Fri Jun 29 03:37:23 2012 (r237740) @@ -154,3 +154,31 @@ arg_put(void *hook __unused, int letter, if (verbose) putchar('\n'); } + +/* + * Get confirmation from user + * Return values: + * 1: confirmed + * 0: unconfirmed + */ +int +get_confirmation(void) +{ + char str[1024]; + int response = -1; + + do { + fprintf(stdout, "Are you SURE you want to do this? (yes/no) "); + if (fgets(str, sizeof(str), stdin) != NULL) { + if (strncasecmp(str, "yes", 3) == 0) + response = 1; + else if (strncasecmp(str, "no", 2) == 0) + response = 0; + else + fprintf(stdout, + "Please answer \"yes\" or \"no\"\n"); + } else + response = 0; + } while (response == -1); + return (response); +} From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 04:13:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9801B106564A; Fri, 29 Jun 2012 04:13:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 699398FC08; Fri, 29 Jun 2012 04:13:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T4DWOI017838; Fri, 29 Jun 2012 04:13:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T4DWmm017836; Fri, 29 Jun 2012 04:13:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206290413.q5T4DWmm017836@svn.freebsd.org> From: Warner Losh Date: Fri, 29 Jun 2012 04:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237741 - head/sys/arm/xscale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 04:13:32 -0000 Author: imp Date: Fri Jun 29 04:13:31 2012 New Revision: 237741 URL: http://svn.freebsd.org/changeset/base/237741 Log: All xscale ports are armeb, so mark it here. This should reduce universe times a little. Modified: head/sys/arm/xscale/std.xscale Modified: head/sys/arm/xscale/std.xscale ============================================================================== --- head/sys/arm/xscale/std.xscale Fri Jun 29 03:37:23 2012 (r237740) +++ head/sys/arm/xscale/std.xscale Fri Jun 29 04:13:31 2012 (r237741) @@ -1,2 +1,3 @@ # $FreeBSD$ +machine arm armeb options ARM_CACHE_LOCK_ENABLE From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 04:18:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F048F106566B; Fri, 29 Jun 2012 04:18:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8DB68FC0A; Fri, 29 Jun 2012 04:18:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T4IqTa018105; Fri, 29 Jun 2012 04:18:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T4IqpX018099; Fri, 29 Jun 2012 04:18:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206290418.q5T4IqpX018099@svn.freebsd.org> From: Warner Losh Date: Fri, 29 Jun 2012 04:18: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: r237742 - in head/sys/arm: at91 conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 04:18:53 -0000 Author: imp Date: Fri Jun 29 04:18:52 2012 New Revision: 237742 URL: http://svn.freebsd.org/changeset/base/237742 Log: Initital support for AT91SAM9X25 SoC and the SAM9X25-EK evaluation board. Much work remains. Added: head/sys/arm/at91/at91sam9x25.c (contents, props changed) head/sys/arm/at91/at91sam9x25reg.h (contents, props changed) head/sys/arm/at91/board_sam9x25ek.c (contents, props changed) head/sys/arm/at91/std.sam9x25ek (contents, props changed) head/sys/arm/conf/SAM9X25EK (contents, props changed) head/sys/arm/conf/SAM9X25EK.hints (contents, props changed) Added: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91sam9x25.c Fri Jun 29 04:18:52 2012 (r237742) @@ -0,0 +1,343 @@ +/*- + * Copyright (c) 2005 Olivier Houchard. All rights reserved. + * Copyright (c) 2010 Greg Ansley. All rights reserved. + * Copyright (c) 2012 M. Warner Losh.. 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 AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +struct at91sam9x25_softc { + device_t dev; + bus_space_tag_t sc_st; + bus_space_handle_t sc_sh; + bus_space_handle_t sc_sys_sh; + bus_space_handle_t sc_aic_sh; + bus_space_handle_t sc_dbg_sh; + bus_space_handle_t sc_matrix_sh; +}; + +/* + * Standard priority levels for the system. 0 is lowest and 7 is highest. + * These values are the ones Atmel uses for its Linux port + */ +static const int at91_irq_prio[32] = +{ + 7, /* Advanced Interrupt Controller */ + 7, /* System Peripherals */ + 1, /* Parallel IO Controller A */ + 1, /* Parallel IO Controller B */ + 1, /* Parallel IO Controller C */ + 0, /* Analog-to-Digital Converter */ + 5, /* USART 0 */ + 5, /* USART 1 */ + 5, /* USART 2 */ + 0, /* Multimedia Card Interface */ + 2, /* USB Device Port */ + 6, /* Two-Wire Interface */ + 5, /* Serial Peripheral Interface 0 */ + 5, /* Serial Peripheral Interface 1 */ + 5, /* Serial Synchronous Controller */ + 0, /* (reserved) */ + 0, /* (reserved) */ + 0, /* Timer Counter 0 */ + 0, /* Timer Counter 1 */ + 0, /* Timer Counter 2 */ + 2, /* USB Host port */ + 3, /* Ethernet */ + 0, /* Image Sensor Interface */ + 5, /* USART 3 */ + 5, /* USART 4 */ + 5, /* USART 5 */ + 0, /* Timer Counter 3 */ + 0, /* Timer Counter 4 */ + 0, /* Timer Counter 5 */ + 0, /* Advanced Interrupt Controller IRQ0 */ + 0, /* Advanced Interrupt Controller IRQ1 */ + 0, /* Advanced Interrupt Controller IRQ2 */ +}; + +#define DEVICE(_name, _id, _unit) \ + { \ + _name, _unit, \ + AT91SAM9X25_ ## _id ##_BASE, \ + AT91SAM9X25_ ## _id ## _SIZE, \ + AT91SAM9X25_IRQ_ ## _id \ + } + +static const struct cpu_devs at91_devs[] = +{ + DEVICE("at91_pmc", PMC, 0), + DEVICE("at91_wdt", WDT, 0), + DEVICE("at91_rst", RSTC, 0), + DEVICE("at91_pit", PIT, 0), + DEVICE("at91_pio", PIOA, 0), + DEVICE("at91_pio", PIOB, 1), + DEVICE("at91_pio", PIOC, 2), + DEVICE("at91_twi", TWI0, 0), + DEVICE("at91_twi", TWI1, 1), + DEVICE("at91_twi", TWI2, 2), + DEVICE("at91_mci", HSMCI0, 0), + DEVICE("at91_mci", HSMCI1, 1), + DEVICE("uart", DBGU, 0), + DEVICE("uart", USART0, 1), + DEVICE("uart", USART1, 2), + DEVICE("uart", USART2, 3), + DEVICE("uart", USART3, 4), + DEVICE("spi", SPI0, 0), + DEVICE("spi", SPI1, 1), + DEVICE("macb", EMAC0, 0), + DEVICE("macb", EMAC1, 0), + DEVICE("nand", NAND, 0), + DEVICE("ohci", OHCI, 0), + DEVICE("ehci", EHCI, 0), + { 0, 0, 0, 0, 0 } +}; + +static void +at91_add_child(device_t dev, int prio, const char *name, int unit, + bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2) +{ + device_t kid; + struct at91_ivar *ivar; + + kid = device_add_child_ordered(dev, prio, name, unit); + if (kid == NULL) { + printf("Can't add child %s%d ordered\n", name, unit); + return; + } + ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); + if (ivar == NULL) { + device_delete_child(dev, kid); + printf("Can't add alloc ivar\n"); + return; + } + device_set_ivars(kid, ivar); + resource_list_init(&ivar->resources); + if (irq0 != -1) { + bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); + if (irq0 != AT91SAM9X25_IRQ_SYSTEM) + at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); + } + if (irq1 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); + if (irq2 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); + if (addr != 0 && addr < AT91SAM9X25_BASE) + addr += AT91SAM9X25_BASE; + if (addr != 0) + bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); +} + +static void +at91_cpu_add_builtin_children(device_t dev) +{ + int i; + const struct cpu_devs *walker; + + for (i = 1, walker = at91_devs; walker->name; i++, walker++) { + at91_add_child(dev, i, walker->name, walker->unit, + walker->mem_base, walker->mem_len, walker->irq0, + walker->irq1, walker->irq2); + } +} + +static uint32_t +at91_pll_outa(int freq) +{ + + switch (freq / 10000000) { + case 747 ... 801: return ((1 << 29) | (0 << 14)); + case 697 ... 746: return ((1 << 29) | (1 << 14)); + case 647 ... 696: return ((1 << 29) | (2 << 14)); + case 597 ... 646: return ((1 << 29) | (3 << 14)); + case 547 ... 596: return ((1 << 29) | (1 << 14)); + case 497 ... 546: return ((1 << 29) | (2 << 14)); + case 447 ... 496: return ((1 << 29) | (3 << 14)); + case 397 ... 446: return ((1 << 29) | (4 << 14)); + default: return (1 << 29); + } +} + +static uint32_t +at91_pll_outb(int freq) +{ + + return (0); +} + +static void +at91_identify(driver_t *drv, device_t parent) +{ + + if (soc_data.type == AT91_T_SAM9X5 && soc_data.subtype == AT91_ST_SAM9X25) { + at91_add_child(parent, 0, "at91sam9x25", 0, 0, 0, -1, 0, 0); + at91_cpu_add_builtin_children(parent); + } +} + +static int +at91_probe(device_t dev) +{ + + device_set_desc(dev, "AT91SAM9X25"); + return (0); +} + +static int +at91_attach(device_t dev) +{ + struct at91_pmc_clock *clk; + struct at91sam9x25_softc *sc = device_get_softc(dev); + int i; + + struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); + + sc->sc_st = at91sc->sc_st; + sc->sc_sh = at91sc->sc_sh; + sc->dev = dev; + + /* + * XXX These values work for the RM9200, SAM926[01], and SAM9X25 + * will have to fix this when we want to support anything else. XXX + */ + if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_SYS_BASE, + AT91SAM9X25_SYS_SIZE, &sc->sc_sys_sh) != 0) + panic("Enable to map system registers"); + + if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_DBGU_BASE, + AT91SAM9X25_DBGU_SIZE, &sc->sc_dbg_sh) != 0) + panic("Enable to map DBGU registers"); + + if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_AIC_BASE, + AT91SAM9X25_AIC_SIZE, &sc->sc_aic_sh) != 0) + panic("Enable to map system registers"); + + /* XXX Hack to tell atmelarm about the AIC */ + at91sc->sc_aic_sh = sc->sc_aic_sh; + at91sc->sc_irq_system = AT91SAM9X25_IRQ_SYSTEM; + + for (i = 0; i < 32; i++) { + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + + i * 4, i); + /* Priority. */ + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, + at91_irq_prio[i]); + if (i < 8) + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, + 1); + } + + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); + /* No debug. */ + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); + /* Disable and clear all interrupts. */ + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); + + /* Disable all interrupts for DBGU */ + bus_space_write_4(sc->sc_st, sc->sc_dbg_sh, 0x0c, 0xffffffff); + + if (bus_space_subregion(sc->sc_st, sc->sc_sh, + AT91SAM9X25_MATRIX_BASE, AT91SAM9X25_MATRIX_SIZE, + &sc->sc_matrix_sh) != 0) + panic("Enable to map matrix registers"); + +#if 0 /* wrong, placeholder */ + /* activate NAND*/ + i = bus_space_read_4(sc->sc_st, sc->sc_matrix_sh, + AT91SAM9X25_EBICSA); + bus_space_write_4(sc->sc_st, sc->sc_matrix_sh, + AT91SAM9X25_EBICSA, + i | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); +#endif + + /* Update USB device port clock info */ + clk = at91_pmc_clock_ref("udpck"); + clk->pmc_mask = PMC_SCER_UDP_SAM9; + at91_pmc_clock_deref(clk); + + /* Update USB host port clock info */ + clk = at91_pmc_clock_ref("uhpck"); + clk->pmc_mask = PMC_SCER_UHP_SAM9; + at91_pmc_clock_deref(clk); + + /* Each SOC has different PLL contraints */ + clk = at91_pmc_clock_ref("plla"); + clk->pll_min_in = SAM9X25_PLL_A_MIN_IN_FREQ; /* 2 MHz */ + clk->pll_max_in = SAM9X25_PLL_A_MAX_IN_FREQ; /* 32 MHz */ + clk->pll_min_out = SAM9X25_PLL_A_MIN_OUT_FREQ; /* 400 MHz */ + clk->pll_max_out = SAM9X25_PLL_A_MAX_OUT_FREQ; /* 800 MHz */ + clk->pll_mul_shift = SAM9X25_PLL_A_MUL_SHIFT; + clk->pll_mul_mask = SAM9X25_PLL_A_MUL_MASK; + clk->pll_div_shift = SAM9X25_PLL_A_DIV_SHIFT; + clk->pll_div_mask = SAM9X25_PLL_A_DIV_MASK; + clk->set_outb = at91_pll_outa; + at91_pmc_clock_deref(clk); + + clk = at91_pmc_clock_ref("pllb"); + clk->pll_min_in = SAM9X25_PLL_B_MIN_IN_FREQ; /* 2 MHz */ + clk->pll_max_in = SAM9X25_PLL_B_MAX_IN_FREQ; /* 32 MHz */ + clk->pll_min_out = SAM9X25_PLL_B_MIN_OUT_FREQ; /* 30 MHz */ + clk->pll_max_out = SAM9X25_PLL_B_MAX_OUT_FREQ; /* 100 MHz */ + clk->pll_mul_shift = SAM9X25_PLL_B_MUL_SHIFT; + clk->pll_mul_mask = SAM9X25_PLL_B_MUL_MASK; + clk->pll_div_shift = SAM9X25_PLL_B_DIV_SHIFT; + clk->pll_div_mask = SAM9X25_PLL_B_DIV_MASK; + clk->set_outb = at91_pll_outb; + at91_pmc_clock_deref(clk); + return (0); +} + +static device_method_t at91sam9x25_methods[] = { + DEVMETHOD(device_probe, at91_probe), + DEVMETHOD(device_attach, at91_attach), + DEVMETHOD(device_identify, at91_identify), + {0, 0}, +}; + +static driver_t at91sam9x25_driver = { + "at91sam9x25", + at91sam9x25_methods, + sizeof(struct at91sam9x25_softc), +}; + +static devclass_t at91sam9x25_devclass; + +DRIVER_MODULE(at91sam9x25, atmelarm, at91sam9x25_driver, at91sam9x25_devclass, 0, 0); Added: head/sys/arm/at91/at91sam9x25reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91sam9x25reg.h Fri Jun 29 04:18:52 2012 (r237742) @@ -0,0 +1,316 @@ +/*- + * Copyright (c) 2009 Sylvestre Gallon. All rights reserved. + * Copyright (c) 2010 Greg Ansley. All rights reserved. + * Copyright (c) 2012 M. Warener Losh. 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 AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef AT91SAM9X25REG_H_ +#define AT91SAM9X25REG_H_ + +#ifndef AT91SAM9X25_MASTER_CLOCK +#define AT91SAM9X25_MASTER_CLOCK ((18432000 * 43)/6) +#endif + +/* Chip Specific limits */ +#define SAM9X25_PLL_A_MIN_IN_FREQ 2000000 /* 2 Mhz */ +#define SAM9X25_PLL_A_MAX_IN_FREQ 32000000 /* 32 Mhz */ +#define SAM9X25_PLL_A_MIN_OUT_FREQ 400000000 /* 400 Mhz */ +#define SAM9X25_PLL_A_MAX_OUT_FREQ 800000000 /* 800 Mhz */ +#define SAM9X25_PLL_A_MUL_SHIFT 16 +#define SAM9X25_PLL_A_MUL_MASK 0xFF +#define SAM9X25_PLL_A_DIV_SHIFT 0 +#define SAM9X25_PLL_A_DIV_MASK 0xFF + +#define SAM9X25_PLL_B_MIN_IN_FREQ 2000000 /* 2 Mhz */ +#define SAM9X25_PLL_B_MAX_IN_FREQ 32000000 /* 32 Mhz */ +#define SAM9X25_PLL_B_MIN_OUT_FREQ 30000000 /* 30 Mhz */ +#define SAM9X25_PLL_B_MAX_OUT_FREQ 100000000 /* 100 Mhz */ +#define SAM9X25_PLL_B_MUL_SHIFT 16 +#define SAM9X25_PLL_B_MUL_MASK 0x3F +#define SAM9X25_PLL_B_DIV_SHIFT 0 +#define SAM9X25_PLL_B_DIV_MASK 0xFF + +/* + * Memory map, from datasheet : + * 0x00000000 - 0x0ffffffff : Internal Memories + * 0x10000000 - 0x1ffffffff : Chip Select 0 + * 0x20000000 - 0x2ffffffff : Chip Select 1 DDR2/LPDDR/SDR/LPSDR + * 0x30000000 - 0x3ffffffff : Chip Select 2 + * 0x40000000 - 0x4ffffffff : Chip Select 3 NAND Flash + * 0x50000000 - 0x5ffffffff : Chip Select 4 + * 0x60000000 - 0x6ffffffff : Chip Select 5 + * 0x70000000 - 0xeffffffff : Undefined (Abort) + * 0xf0000000 - 0xfffffffff : Peripherals + */ + +#define AT91_CHIPSELECT_0 0x10000000 +#define AT91_CHIPSELECT_1 0x20000000 +#define AT91_CHIPSELECT_2 0x30000000 +#define AT91_CHIPSELECT_3 0x40000000 +#define AT91_CHIPSELECT_4 0x50000000 +#define AT91_CHIPSELECT_5 0x60000000 + +#define AT91SAM9X25_BASE 0xd0000000 + +#define AT91SAM9X25_EMAC_SIZE 0x4000 +#define AT91SAM9X25_EMAC0_BASE 0x802c000 +#define AT91SAM9X25_EMAC0_SIZE AT91SAM9X25_EMAC_SIZE +#define AT91SAM9X25_EMAC1_BASE 0x8030000 +#define AT91SAM9X25_EMAC1_SIZE AT91SAM9X25_EMAC_SIZE + +#define AT91SAM9X25_RSTC_BASE 0xffffe00 +#define AT91SAM9X25_RSTC_SIZE 0x10 + +/* USART*/ + +#define AT91SAM9X25_USART_SIZE 0x4000 +#define AT91SAM9X25_USART0_BASE 0x801c000 +#define AT91SAM9X25_USART0_PDC 0x801c100 +#define AT91SAM9X25_USART0_SIZE AT91SAM9X25_USART_SIZE +#define AT91SAM9X25_USART1_BASE 0x8020000 +#define AT91SAM9X25_USART1_PDC 0x8020100 +#define AT91SAM9X25_USART1_SIZE AT91SAM9X25_USART_SIZE +#define AT91SAM9X25_USART2_BASE 0x8024000 +#define AT91SAM9X25_USART2_PDC 0x8024100 +#define AT91SAM9X25_USART2_SIZE AT91SAM9X25_USART_SIZE +#define AT91SAM9X25_USART3_BASE 0x8028000 +#define AT91SAM9X25_USART3_PDC 0x8028100 +#define AT91SAM9X25_USART3_SIZE AT91SAM9X25_USART_SIZE + +/*TC*/ +#define AT91SAM9X25_TC0_BASE 0x8008000 +#define AT91SAM9X25_TC0_SIZE 0x4000 +#define AT91SAM9X25_TC0C0_BASE 0x8008000 +#define AT91SAM9X25_TC0C1_BASE 0x8008040 +#define AT91SAM9X25_TC0C2_BASE 0x8008080 + +#define AT91SAM9X25_TC1_BASE 0x800c000 +#define AT91SAM9X25_TC1_SIZE 0x4000 + +/*SPI*/ + +#define AT91SAM9X25_SPI0_BASE 0x0000000 + +#define AT91SAM9X25_SPI0_SIZE 0x4000 + +#define AT91SAM9X25_SPI1_BASE 0x0004000 +#define AT91SAM9X25_SPI1_SIZE 0x4000 + +/* System Registers */ +#define AT91SAM9X25_SYS_BASE 0xffff000 +#define AT91SAM9X25_SYS_SIZE 0x1000 + +#define AT91SAM9X25_MATRIX_BASE 0xfffde00 +#define AT91SAM9X25_MATRIX_SIZE 0x200 + +#define AT91SAM9X25_DBGU_BASE 0xffff200 +#define AT91SAM9X25_DBGU_SIZE 0x200 + +/* + * PIO + */ +#define AT91SAM9X25_PIOA_BASE 0xffff400 +#define AT91SAM9X25_PIOA_SIZE 0x200 +#define AT91SAM9X25_PIOB_BASE 0xffff600 +#define AT91SAM9X25_PIOB_SIZE 0x200 +#define AT91SAM9X25_PIOC_BASE 0xffff800 +#define AT91SAM9X25_PIOC_SIZE 0x200 + +#define AT91RM92_PMC_BASE 0xffffc00 +#define AT91RM92_PMC_SIZE 0x100 +/* IRQs : */ +/*XXX FIXME XXX + * 0: AIC + * 1: System peripheral (System timer, RTC, DBGU) + * 2: PIO Controller A,B + * 3: PIO Controller C,D + * 4: SMD Soft Modem + * 5: USART 0 + * 6: USART 1 + * 7: USART 2 + * 8: USART 3 + * 9: Two-wirte interface + * 10: Two-wirte interface + * 11: Two-wirte interface + * 12: HSMCI Interface + * 13: SPI 0 + * 14: SPI 1 + * 15: UART0 + * 16: UART1 + * 17: Timer Counter 0,1 + * 18: PWM + * 19: ADC + * 20: DMAC 0 + * 21: DMAC 1 + * 22: UHPHS - USB Host controller + * 23: UDPHS - USB Device Controller + * 24: EMAC0 + * 25: Reserved + * 26: HSMCI1 + * 27: EMAC1 + * 28: SSC + * 29: CAN0 + * 30: CAN1 + * 31: AIC IRQ + */ + +#define AT91SAM9X25_IRQ_AIC 0 +#define AT91SAM9X25_IRQ_SYSTEM 1 +#define AT91SAM9X25_IRQ_PIOAB 2 +#define AT91SAM9X25_IRQ_PIOCD 3 +#define AT91SAM9X25_IRQ_SMD 4 +#define AT91SAM9X25_IRQ_USART0 5 +#define AT91SAM9X25_IRQ_USART1 6 +#define AT91SAM9X25_IRQ_USART2 7 +#define AT91SAM9X25_IRQ_USART3 8 +#define AT91SAM9X25_IRQ_TWI0 9 +#define AT91SAM9X25_IRQ_TWI1 10 +#define AT91SAM9X25_IRQ_TWI2 11 +#define AT91SAM9X25_IRQ_HSMCI0 12 +#define AT91SAM9X25_IRQ_SPI0 13 +#define AT91SAM9X25_IRQ_SPI1 14 +#define AT91SAM9X25_IRQ_UART0 15 +#define AT91SAM9X25_IRQ_UART1 16 +#define AT91SAM9X25_IRQ_TC01 17 +#define AT91SAM9X25_IRQ_PWM 18 +#define AT91SAM9X25_IRQ_ADC 19 +#define AT91SAM9X25_IRQ_DMAC0 20 +#define AT91SAM9X25_IRQ_DMAC1 21 +#define AT91SAM9X25_IRQ_UHPHS 22 +#define AT91SAM9X25_IRQ_UDPHS 23 +#define AT91SAM9X25_IRQ_EMAC0 24 +#define AT91SAM9X25_IRQ_HSMCI1 26 +#define AT91SAM9X25_IRQ_EMAC1 27 +#define AT91SAM9X25_IRQ_SSC 28 +#define AT91SAM9X25_IRQ_CAN0 29 +#define AT91SAM9X25_IRQ_CAN1 30 +#define AT91SAM9X25_IRQ_AICBASE 31 + +/* Alias */ +#define AT91SAM9X25_IRQ_DBGU AT91SAM9X25_IRQ_SYSTEM +#define AT91SAM9X25_IRQ_PMC AT91SAM9X25_IRQ_SYSTEM +#define AT91SAM9X25_IRQ_WDT AT91SAM9X25_IRQ_SYSTEM +#define AT91SAM9X25_IRQ_PIT AT91SAM9X25_IRQ_SYSTEM +#define AT91SAM9X25_IRQ_RSTC AT91SAM9X25_IRQ_SYSTEM +#define AT91SAM9X25_IRQ_OHCI AT91SAM9X25_IRQ_UHPHS +#define AT91SAM9X25_IRQ_EHCI AT91SAM9X25_IRQ_UHPHS +#define AT91SAM9X25_IRQ_PIOA AT91SAM9X25_IRQ_PIOAB +#define AT91SAM9X25_IRQ_PIOB AT91SAM9X25_IRQ_PIOAB +#define AT91SAM9X25_IRQ_PIOC AT91SAM9X25_IRQ_PIOCD +#define AT91SAM9X25_IRQ_NAND (-1) + +#define AT91SAM9X25_AIC_BASE 0xffff000 +#define AT91SAM9X25_AIC_SIZE 0x200 + +/* Timer */ + +#define AT91SAM9X25_WDT_BASE 0xffffd40 +#define AT91SAM9X25_WDT_SIZE 0x10 + +#define AT91SAM9X25_PIT_BASE 0xffffd30 +#define AT91SAM9X25_PIT_SIZE 0x10 + +#define AT91SAM9X25_SMC_BASE 0xfffea00 +#define AT91SAM9X25_SMC_SIZE 0x200 + +#define AT91SAM9X25_PMC_BASE 0xffffc00 +#define AT91SAM9X25_PMC_SIZE 0x100 + +#define AT91SAM9X25_UDPHS_BASE 0x803c000 +#define AT91SAM9X25_UDPHS_SIZE 0x4000 + +#define AT91SAM9X25_HSMCI_SIZE 0x4000 +#define AT91SAM9X25_HSMCI0_BASE 0x0008000 +#define AT91SAM9X25_HSMCI0_SIZE AT91SAM9X25_HSMCI_SIZE +#define AT91SAM9X25_HSMCI1_BASE 0x000c000 +#define AT91SAM9X25_HSMCI1_SIZE AT91SAM9X25_HSMCI_SIZE + +#define AT91SAM9X25_TWI_SIZE 0x4000 +#define AT91SAM9X25_TWI0_BASE 0xffaC000 +#define AT91SAM9X25_TWI0_SIZE AT91SAM9X25_TWI_SIZE +#define AT91SAM9X25_TWI1_BASE 0xffaC000 +#define AT91SAM9X25_TWI1_SIZE AT91SAM9X25_TWI_SIZE +#define AT91SAM9X25_TWI2_BASE 0xffaC000 +#define AT91SAM9X25_TWI2_SIZE AT91SAM9X25_TWI_SIZE + +/* XXX Needs to be carfully coordinated with + * other * soc's so phyical and vm address + * mapping are unique. XXX + */ +#define AT91SAM9X25_OHCI_BASE 0xdfc00000 /* SAME as 9c40 */ +#define AT91SAM9X25_OHCI_PA_BASE 0x00600000 +#define AT91SAM9X25_OHCI_SIZE 0x00100000 + +#define AT91SAM9X25_EHCI_BASE 0xdfd00000 +#define AT91SAM9X25_EHCI_PA_BASE 0x00700000 +#define AT91SAM9X25_EHCI_SIZE 0x00100000 + +#define AT91SAM9X25_NAND_BASE 0xe0000000 +#define AT91SAM9X25_NAND_PA_BASE 0x40000000 +#define AT91SAM9X25_NAND_SIZE 0x10000000 + + +/* SDRAMC */ +#define AT91SAM9X25_SDRAMC_BASE 0xfffea00 /* SAME as SMC? */ +#define AT91SAM9X25_SDRAMC_MR 0x00 +#define AT91SAM9X25_SDRAMC_MR_MODE_NORMAL 0 +#define AT91SAM9X25_SDRAMC_MR_MODE_NOP 1 +#define AT91SAM9X25_SDRAMC_MR_MODE_PRECHARGE 2 +#define AT91SAM9X25_SDRAMC_MR_MODE_LOAD_MODE_REGISTER 3 +#define AT91SAM9X25_SDRAMC_MR_MODE_REFRESH 4 +#define AT91SAM9X25_SDRAMC_TR 0x04 +#define AT91SAM9X25_SDRAMC_CR 0x08 +#define AT91SAM9X25_SDRAMC_CR_NC_8 0x0 +#define AT91SAM9X25_SDRAMC_CR_NC_9 0x1 +#define AT91SAM9X25_SDRAMC_CR_NC_10 0x2 +#define AT91SAM9X25_SDRAMC_CR_NC_11 0x3 +#define AT91SAM9X25_SDRAMC_CR_NC_MASK 0x00000003 +#define AT91SAM9X25_SDRAMC_CR_NR_11 0x0 +#define AT91SAM9X25_SDRAMC_CR_NR_12 0x4 +#define AT91SAM9X25_SDRAMC_CR_NR_13 0x8 +#define AT91SAM9X25_SDRAMC_CR_NR_RES 0xc +#define AT91SAM9X25_SDRAMC_CR_NR_MASK 0x0000000c +#define AT91SAM9X25_SDRAMC_CR_NB_2 0x00 +#define AT91SAM9X25_SDRAMC_CR_NB_4 0x10 +#define AT91SAM9X25_SDRAMC_CR_DBW_16 0x80 +#define AT91SAM9X25_SDRAMC_CR_NB_MASK 0x00000010 +#define AT91SAM9X25_SDRAMC_CR_NCAS_MASK 0x00000060 +#define AT91SAM9X25_SDRAMC_CR_TWR_MASK 0x00000780 +#define AT91SAM9X25_SDRAMC_CR_TRC_MASK 0x00007800 +#define AT91SAM9X25_SDRAMC_CR_TRP_MASK 0x00078000 +#define AT91SAM9X25_SDRAMC_CR_TRCD_MASK 0x00780000 +#define AT91SAM9X25_SDRAMC_CR_TRAS_MASK 0x07800000 +#define AT91SAM9X25_SDRAMC_CR_TXSR_MASK 0x78000000 +#define AT91SAM9X25_SDRAMC_HSR 0x0c +#define AT91SAM9X25_SDRAMC_LPR 0x10 +#define AT91SAM9X25_SDRAMC_IER 0x14 +#define AT91SAM9X25_SDRAMC_IDR 0x18 +#define AT91SAM9X25_SDRAMC_IMR 0x1c +#define AT91SAM9X25_SDRAMC_ISR 0x20 +#define AT91SAM9X25_SDRAMC_MDR 0x24 + +#endif /* AT91SAM9X25REG_H_*/ + Added: head/sys/arm/at91/board_sam9x25ek.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/board_sam9x25ek.c Fri Jun 29 04:18:52 2012 (r237742) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2009 Greg Ansley. 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 AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * This board file can be used for both: + * SAM9X26EK board + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include + +#include +#include +#include +#include +#include +#include +//#include + +long +board_init(void) +{ +#if 0 + /* PIOB's A periph: Turn USART 0's TX/RX pins */ + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB14_DRXD, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB15_DTXD, 1); + + /* PIOB's A periph: Turn USART 0's TX/RX pins */ + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB4_TXD0, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB5_RXD0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB22_DSR0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB23_DCD0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB24_DTR0, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB25_RI0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB26_RTS0, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB27_CTS0, 0); + + /* PIOB's A periph: Turn USART 1's TX/RX pins */ + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB6_TXD1, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB7_RXD1, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB28_RTS1, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB29_CTS1, 0); + + /* TWI Two-wire Serial Data */ + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA23_TWD, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA24_TWCK, 1); + +#if 1 + /* + * Turn off Clock to DataFlash, conflicts with MCI clock. + */ + at91_pio_use_gpio(AT91SAM9G20_PIOA_BASE,AT91C_PIO_PA2); + at91_pio_gpio_input(AT91SAM9G20_PIOA_BASE,AT91C_PIO_PA2); + + /* Turn off chip select to DataFlash */ + at91_pio_gpio_output(AT91SAM9G20_PIOC_BASE,AT91C_PIO_PC11, 0); + at91_pio_gpio_set(AT91SAM9G20_PIOC_BASE,AT91C_PIO_PC11); + at91_pio_use_gpio(AT91SAM9G20_PIOC_BASE,AT91C_PIO_PC11); + + /* Multimedia Card */ + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA0_MCDB0, 1); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA1_MCCDB, 1); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA3_MCDB3, 1); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA4_MCDB2, 1); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA5_MCDB1, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA8_MCCK, 1); + at91_pio_use_gpio(AT91SAM9G20_PIOC_BASE, AT91C_PIO_PC9); +#else + /* SPI0 to DataFlash */ + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE, AT91C_PIO_PA0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE, AT91C_PIO_PA1, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE, AT91C_PIO_PA2, 0); + at91_pio_use_periph_b(AT91SAM9G20_PIOC_BASE, AT91C_PIO_PC11,0); + + at91_pio_gpio_input(AT91SAM9G20_PIOA_BASE,AT91C_PIO_PA8); + at91_pio_use_gpio(AT91SAM9G20_PIOA_BASE,AT91C_PIO_PA8); +#endif + + /* EMAC */ + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA12_ETX0 , 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA13_ETX1, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA14_ERX0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA15_ERX1, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA16_ETXEN, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA17_ERXDV, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA18_ERXER, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA19_ETXCK, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA20_EMDC, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA21_EMDIO, 0); + + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA10_ETX2_0, 0); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA11_ETX3_0, 0); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA22_ETXER, 0); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA25_ERX2, 0); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA26_ERX3, 0); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA27_ERXCK, 0); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA28_ECRS, 0); + at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA29_ECOL, 0); +#endif + return (at91_ramsize()); +} Added: head/sys/arm/at91/std.sam9x25ek ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/std.sam9x25ek Fri Jun 29 04:18:52 2012 (r237742) @@ -0,0 +1,12 @@ +#$FreeBSD$ +include "../at91/std.at91sam9" + +options STARTUP_PAGETABLE_ADDR=0x20800000 +makeoptions KERNPHYSADDR=0x20000000 +makeoptions KERNVIRTADDR=0xc0000000 +options KERNPHYSADDR=0x20000000 +options KERNVIRTADDR=0xc0000000 + +device at91_board_sam9x25ek +nodevice at91sam9g20 +nodevice at91sam9260 Added: head/sys/arm/conf/SAM9X25EK ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/SAM9X25EK Fri Jun 29 04:18:52 2012 (r237742) @@ -0,0 +1,154 @@ +# Kernel configuration for Atmel AT91SAM9G20EK Rev B. development card +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +# NOUNIVERSE: disable building in make universe +ident SAM9X25EK + +include "../at91/std.sam9x25ek" + +#To statically compile in device wiring instead of /boot/device.hints +hints "SAM9G20EK.hints" +makeoptions MODULES_OVERRIDE="" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +#options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +#options MD_ROOT #MD is a potential root device +#options MD_ROOT_SIZE=4096 # 3MB ram disk +options NFSCL #New Network Filesystem Client +#options NFSD #New Network Filesystem Server +#options NFSLOCKD #Network Lock Manager +#options NFS_ROOT #NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ate0 +#options BOOTP_COMPAT + +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" + +options ALT_BREAK_TO_DEBUGGER + +#options MSDOSFS #MSDOS Filesystem +#options CD9660 #ISO 9660 Filesystem +#options PROCFS #Process filesystem (requires PSEUDOFS) +#options PSEUDOFS #Pseudo-filesystem framework +#options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +#options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +#options SYSCTL_OMIT_DESCR +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING + +# Debugging for use in -current +#options INVARIANTS #Enable calls of extra sanity checking +#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +device random +device pty +device loop +device bpf +device ether +device md + +device uart # Serial Ports + +# Ethernet +#device ate # Ethernet Driver +device macb # Alternate Ethernet driver +device mii +option AT91_ATE_USE_RMII + +#device at91_twi # TWI: Two Wire Interface (EEPROM) +device at91_wdt # WDT: Watchdog timer + +# NOTE: SPI DataFlash and mci/mmc/mmcsd have hardware +# confilict on this card. Use one or the other. +# see board_sam9g20ek.c + +# SPI: Data Flash +#device at91_spi # SPI: +#device spibus +#device at45d # at45db642 and maybe others + +# MMC/SD +device at91_mci +device mmc +device mmcsd +#option AT91_MCI_SLOT_B +option AT91_MCI_HAS_4WIRE + +# iic +device iic +device iicbus +device icee + +# SCSI peripherals +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct SCSI access) + +# USB support +#device ohci # OHCI localbus->USB interface +#device usb # USB Bus (required) +#device umass # Disks/Mass storage - Requires scbus and da +#device uhid # "Human Interface Devices" +#device ulpt # Printer +#device udbp # USB Double Bulk Pipe devices + +# USB Ethernet, requires miibus +device miibus +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB + +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs +#device uath # Atheros AR5523 wireless NICs +#device ural # Ralink Technology RT2500USB wireless NICs +#device zyd # ZyDAS zd1211/zd1211b wireless NICs + +# Wireless NIC cards +#device wlan # 802.11 support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm + Added: head/sys/arm/conf/SAM9X25EK.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/SAM9X25EK.hints Fri Jun 29 04:18:52 2012 (r237742) @@ -0,0 +1,10 @@ +# $FreeBSD$ +# + +# EEPROM +hint.icee.0.at="iicbus0" +hint.icee.0.addr=0xa0 +hint.icee.0.type=16 +hint.icee.0.size=65536 +hint.icee.0.rd_sz=256 +hint.icee.0.wr_sz=256 From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 04:49:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0CC0106566C; Fri, 29 Jun 2012 04:49:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C23E78FC08; Fri, 29 Jun 2012 04:49:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T4no6X019369; Fri, 29 Jun 2012 04:49:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T4noUX019367; Fri, 29 Jun 2012 04:49:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206290449.q5T4noUX019367@svn.freebsd.org> From: Warner Losh Date: Fri, 29 Jun 2012 04:49: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: r237743 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 04:49:51 -0000 Author: imp Date: Fri Jun 29 04:49:50 2012 New Revision: 237743 URL: http://svn.freebsd.org/changeset/base/237743 Log: Ooops, replaced the at91sam9g20 interrupt list with the at91sam9x25 ones. Modified: head/sys/arm/at91/at91sam9x25.c Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Fri Jun 29 04:18:52 2012 (r237742) +++ head/sys/arm/at91/at91sam9x25.c Fri Jun 29 04:49:50 2012 (r237743) @@ -59,38 +59,38 @@ struct at91sam9x25_softc { */ static const int at91_irq_prio[32] = { - 7, /* Advanced Interrupt Controller */ + 7, /* Advanced Interrupt Controller (FIQ) */ 7, /* System Peripherals */ - 1, /* Parallel IO Controller A */ - 1, /* Parallel IO Controller B */ - 1, /* Parallel IO Controller C */ - 0, /* Analog-to-Digital Converter */ + 1, /* Parallel IO Controller A and B */ + 1, /* Parallel IO Controller C and D */ + 4, /* Soft Modem */ 5, /* USART 0 */ 5, /* USART 1 */ 5, /* USART 2 */ - 0, /* Multimedia Card Interface */ - 2, /* USB Device Port */ - 6, /* Two-Wire Interface */ + 5, /* USART 3 */ + 6, /* Two-Wire Interface 0 */ + 6, /* Two-Wire Interface 1 */ + 6, /* Two-Wire Interface 2 */ + 0, /* Multimedia Card Interface 0 */ 5, /* Serial Peripheral Interface 0 */ 5, /* Serial Peripheral Interface 1 */ - 5, /* Serial Synchronous Controller */ - 0, /* (reserved) */ - 0, /* (reserved) */ - 0, /* Timer Counter 0 */ - 0, /* Timer Counter 1 */ - 0, /* Timer Counter 2 */ - 2, /* USB Host port */ - 3, /* Ethernet */ - 0, /* Image Sensor Interface */ - 5, /* USART 3 */ - 5, /* USART 4 */ - 5, /* USART 5 */ - 0, /* Timer Counter 3 */ - 0, /* Timer Counter 4 */ - 0, /* Timer Counter 5 */ - 0, /* Advanced Interrupt Controller IRQ0 */ - 0, /* Advanced Interrupt Controller IRQ1 */ - 0, /* Advanced Interrupt Controller IRQ2 */ + 5, /* UART 0 */ + 5, /* UART 1 */ + 0, /* Timer Counter 0, 1, 2, 3, 4 and 5 */ + 0, /* Pulse Width Modulation Controller */ + 0, /* ADC Controller */ + 0, /* DMA Controller 0 */ + 0, /* DMA Controller 1 */ + 2, /* USB Host High Speed port */ + 2, /* USB Device High speed port */ + 3, /* Ethernet MAC 0 */ + 3, /* LDC Controller or Image Sensor Interface */ + 0, /* Multimedia Card Interface 1 */ + 3, /* Ethernet MAC 1 */ + 4, /* Synchronous Serial Interface */ + 4, /* CAN Controller 0 */ + 4, /* CAN Controller 1 */ + 0, /* Advanced Interrupt Controller (IRQ0) */ }; #define DEVICE(_name, _id, _unit) \ From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 04:49:58 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE9CF1065730; Fri, 29 Jun 2012 04:49:57 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 8FC848FC0C; Fri, 29 Jun 2012 04:49:51 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id q5T4npSY054800; Fri, 29 Jun 2012 04:49:51 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id mkid99a5getb6spxz29hzfcsp6; Fri, 29 Jun 2012 04:49:51 +0000 (UTC) (envelope-from tim@kientzle.com) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <201206281310.q5SDAaFo077809@svn.freebsd.org> Date: Thu, 28 Jun 2012 21:49:50 -0700 Content-Transfer-Encoding: 7bit Message-Id: <3B21BB89-B719-4CB9-8821-C27500C8D259@kientzle.com> References: <201206281310.q5SDAaFo077809@svn.freebsd.org> To: Warren Block X-Mailer: Apple Mail (2.1278) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org Subject: Re: svn commit: r237708 - stable/9/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 04:49:58 -0000 On Jun 28, 2012, at 6:10 AM, Warren Block wrote: > Author: wblock (doc committer) > Date: Thu Jun 28 13:10:36 2012 > New Revision: 237708 > URL: http://svn.freebsd.org/changeset/base/237708 > > Log: > MFC r237655: > > Point out that /usr/src, /usr/doc, and /usr/ports may be empty or not > exist until populated with csup(1) or svn(1). > > PR: 169487 Probably should also cross-reference portsnap(8) here. Tim From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 06:05:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F21A106566B; Fri, 29 Jun 2012 06:05:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D52EB8FC14; Fri, 29 Jun 2012 06:05:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T65iQl022482; Fri, 29 Jun 2012 06:05:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T65iSa022478; Fri, 29 Jun 2012 06:05:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206290605.q5T65iSa022478@svn.freebsd.org> From: Warner Losh Date: Fri, 29 Jun 2012 06:05: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: r237744 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 06:05:45 -0000 Author: imp Date: Fri Jun 29 06:05:44 2012 New Revision: 237744 URL: http://svn.freebsd.org/changeset/base/237744 Log: Add PIOD, make at91sam9x25 a standard SoC, tweak some comments. Modified: head/sys/arm/at91/at91sam9x25.c head/sys/arm/at91/at91sam9x25reg.h head/sys/arm/at91/std.at91sam9 Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Fri Jun 29 04:49:50 2012 (r237743) +++ head/sys/arm/at91/at91sam9x25.c Fri Jun 29 06:05:44 2012 (r237744) @@ -110,6 +110,7 @@ static const struct cpu_devs at91_devs[] DEVICE("at91_pio", PIOA, 0), DEVICE("at91_pio", PIOB, 1), DEVICE("at91_pio", PIOC, 2), + DEVICE("at91_pio", PIOD, 3), DEVICE("at91_twi", TWI0, 0), DEVICE("at91_twi", TWI1, 1), DEVICE("at91_twi", TWI2, 2), Modified: head/sys/arm/at91/at91sam9x25reg.h ============================================================================== --- head/sys/arm/at91/at91sam9x25reg.h Fri Jun 29 04:49:50 2012 (r237743) +++ head/sys/arm/at91/at91sam9x25reg.h Fri Jun 29 06:05:44 2012 (r237744) @@ -138,11 +138,12 @@ #define AT91SAM9X25_PIOB_SIZE 0x200 #define AT91SAM9X25_PIOC_BASE 0xffff800 #define AT91SAM9X25_PIOC_SIZE 0x200 +#define AT91SAM9X25_PIOD_BASE 0xffffa00 +#define AT91SAM9X25_PIOD_SIZE 0x200 #define AT91RM92_PMC_BASE 0xffffc00 #define AT91RM92_PMC_SIZE 0x100 -/* IRQs : */ -/*XXX FIXME XXX +/* IRQs : * 0: AIC * 1: System peripheral (System timer, RTC, DBGU) * 2: PIO Controller A,B @@ -168,13 +169,13 @@ * 22: UHPHS - USB Host controller * 23: UDPHS - USB Device Controller * 24: EMAC0 - * 25: Reserved + * 25: LCD controller or Image Sensor Interface * 26: HSMCI1 * 27: EMAC1 * 28: SSC * 29: CAN0 * 30: CAN1 - * 31: AIC IRQ + * 31: AIC IRQ0 */ #define AT91SAM9X25_IRQ_AIC 0 @@ -220,6 +221,7 @@ #define AT91SAM9X25_IRQ_PIOA AT91SAM9X25_IRQ_PIOAB #define AT91SAM9X25_IRQ_PIOB AT91SAM9X25_IRQ_PIOAB #define AT91SAM9X25_IRQ_PIOC AT91SAM9X25_IRQ_PIOCD +#define AT91SAM9X25_IRQ_PIOD AT91SAM9X25_IRQ_PIOCD #define AT91SAM9X25_IRQ_NAND (-1) #define AT91SAM9X25_AIC_BASE 0xffff000 Modified: head/sys/arm/at91/std.at91sam9 ============================================================================== --- head/sys/arm/at91/std.at91sam9 Fri Jun 29 04:49:50 2012 (r237743) +++ head/sys/arm/at91/std.at91sam9 Fri Jun 29 06:05:44 2012 (r237744) @@ -10,3 +10,4 @@ device at91sam9 device at91sam9260 device at91sam9g20 +device at91sam9x25 From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 06:06:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ECDB106564A; Fri, 29 Jun 2012 06:06:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9BF8FC16; Fri, 29 Jun 2012 06:06:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T66KmX022545; Fri, 29 Jun 2012 06:06:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T66KkD022543; Fri, 29 Jun 2012 06:06:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201206290606.q5T66KkD022543@svn.freebsd.org> From: Warner Losh Date: Fri, 29 Jun 2012 06:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237745 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 06:06:20 -0000 Author: imp Date: Fri Jun 29 06:06:19 2012 New Revision: 237745 URL: http://svn.freebsd.org/changeset/base/237745 Log: Tweak comment. Modified: head/sys/arm/at91/at91_pmcvar.h Modified: head/sys/arm/at91/at91_pmcvar.h ============================================================================== --- head/sys/arm/at91/at91_pmcvar.h Fri Jun 29 06:05:44 2012 (r237744) +++ head/sys/arm/at91/at91_pmcvar.h Fri Jun 29 06:06:19 2012 (r237745) @@ -55,7 +55,7 @@ struct at91_pmc_clock uint32_t (*set_outb)(int); }; -struct at91_pmc_clock * at91_pmc_clock_add(const char *name, uint32_t irq, +struct at91_pmc_clock *at91_pmc_clock_add(const char *name, uint32_t irq, struct at91_pmc_clock *parent); struct at91_pmc_clock *at91_pmc_clock_ref(const char *name); void at91_pmc_clock_deref(struct at91_pmc_clock *); From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 06:41:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C6EC106566C; Fri, 29 Jun 2012 06:41:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0668F8FC12; Fri, 29 Jun 2012 06:41:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T6f3OY024044; Fri, 29 Jun 2012 06:41:03 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T6f3uj024042; Fri, 29 Jun 2012 06:41:03 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206290641.q5T6f3uj024042@svn.freebsd.org> From: Martin Matuska Date: Fri, 29 Jun 2012 06:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237746 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 06:41:04 -0000 Author: mm Date: Fri Jun 29 06:41:03 2012 New Revision: 237746 URL: http://svn.freebsd.org/changeset/base/237746 Log: MFC r237458: Import Illumos revision 13736:9f1d48e1681f 2901 ZFS receive fails for exabyte sparse files References: https://www.illumos.org/issues/2901 Obtained from: illumos (issue #2901) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Jun 29 06:06:19 2012 (r237745) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Jun 29 06:41:03 2012 (r237746) @@ -96,6 +96,9 @@ dump_free(dmu_sendarg_t *dsp, uint64_t o { struct drr_free *drrf = &(dsp->dsa_drr->drr_u.drr_free); + if (length != -1ULL && offset + length < offset) + length = -1ULL; + /* * If there is a pending op, but it's not PENDING_FREE, push it out, * since free block aggregation can only be done for blocks of the From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 06:41:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A89C1065672; Fri, 29 Jun 2012 06:41:20 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 748588FC08; Fri, 29 Jun 2012 06:41:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T6fKLs024090; Fri, 29 Jun 2012 06:41:20 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T6fKE1024088; Fri, 29 Jun 2012 06:41:20 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206290641.q5T6fKE1024088@svn.freebsd.org> From: Martin Matuska Date: Fri, 29 Jun 2012 06:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237747 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 06:41:20 -0000 Author: mm Date: Fri Jun 29 06:41:19 2012 New Revision: 237747 URL: http://svn.freebsd.org/changeset/base/237747 Log: MFC r237458: Import Illumos revision 13736:9f1d48e1681f 2901 ZFS receive fails for exabyte sparse files References: https://www.illumos.org/issues/2901 Obtained from: illumos (issue #2901) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Jun 29 06:41:03 2012 (r237746) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Jun 29 06:41:19 2012 (r237747) @@ -96,6 +96,9 @@ dump_free(dmu_sendarg_t *dsp, uint64_t o { struct drr_free *drrf = &(dsp->dsa_drr->drr_u.drr_free); + if (length != -1ULL && offset + length < offset) + length = -1ULL; + /* * If there is a pending op, but it's not PENDING_FREE, push it out, * since free block aggregation can only be done for blocks of the From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 07:35:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44731106564A; Fri, 29 Jun 2012 07:35:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16BDF8FC15; Fri, 29 Jun 2012 07:35:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T7ZbJQ026315; Fri, 29 Jun 2012 07:35:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T7ZbSk026312; Fri, 29 Jun 2012 07:35:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206290735.q5T7ZbSk026312@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 07:35: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: r237748 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 07:35:38 -0000 Author: avg Date: Fri Jun 29 07:35:37 2012 New Revision: 237748 URL: http://svn.freebsd.org/changeset/base/237748 Log: dtrace instruction decoder: add 0x0f 0x1f NOP opcode support According to the AMD manual the whole range from 0x09 to 0x1f are NOPs. Intel manual mentions only 0x1f. Use only Intel one for now, it seems to be the one actually generated by compilers. Use gdb mnemonic for the operation: "nopw". [1] AMD64 Architecture Programmer's Manual Volume 3: General-Purpose and System Instructions [2] Software Optimization Guide for AMD Family 10h Processors [3] Intel(R) 64 and IA-32 Architectures Software Developer’s Manual Volume 2 (2A, 2B & 2C): Instruction Set Reference, A-Z Tested by: Fabian Keil (earlier version) MFC after: 3 days Modified: head/sys/cddl/dev/dtrace/amd64/dis_tables.c head/sys/cddl/dev/dtrace/i386/dis_tables.c Modified: head/sys/cddl/dev/dtrace/amd64/dis_tables.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Jun 29 06:41:19 2012 (r237747) +++ head/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Jun 29 07:35:37 2012 (r237748) @@ -815,7 +815,7 @@ const instable_t dis_op0F[16][16] = { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), /* [18] */ IND(dis_op0F18), INVALID, INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, TNS("nopw", M), }, { /* [20] */ TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), /* [24] */ TSx("mov",SREG), INVALID, TSx("mov",SREG), INVALID, Modified: head/sys/cddl/dev/dtrace/i386/dis_tables.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dis_tables.c Fri Jun 29 06:41:19 2012 (r237747) +++ head/sys/cddl/dev/dtrace/i386/dis_tables.c Fri Jun 29 07:35:37 2012 (r237748) @@ -815,7 +815,7 @@ const instable_t dis_op0F[16][16] = { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), /* [18] */ IND(dis_op0F18), INVALID, INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, TNS("nopw", M), }, { /* [20] */ TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), /* [24] */ TSx("mov",SREG), INVALID, TSx("mov",SREG), INVALID, From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 07:42:13 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8BD90106566B; Fri, 29 Jun 2012 07:42:13 +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 771618FC12; Fri, 29 Jun 2012 07:42:12 +0000 (UTC) Received: from porto.starpoint.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 KAA05023; Fri, 29 Jun 2012 10:42:11 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1SkVqE-0004Of-Vc; Fri, 29 Jun 2012 10:42:11 +0300 Message-ID: <4FED5C51.9060603@FreeBSD.org> Date: Fri, 29 Jun 2012 10:42:09 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120620 Thunderbird/13.0.1 MIME-Version: 1.0 To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201206290735.q5T7ZbSk026312@svn.freebsd.org> In-Reply-To: <201206290735.q5T7ZbSk026312@svn.freebsd.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r237748 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 07:42:13 -0000 on 29/06/2012 10:35 Andriy Gapon said the following: > Author: avg > Date: Fri Jun 29 07:35:37 2012 > New Revision: 237748 > URL: http://svn.freebsd.org/changeset/base/237748 > > Log: > dtrace instruction decoder: add 0x0f 0x1f NOP opcode support > > According to the AMD manual the whole range from 0x09 to 0x1f are NOPs. > Intel manual mentions only 0x1f. Use only Intel one for now, it seems > to be the one actually generated by compilers. > Use gdb mnemonic for the operation: "nopw". BTW, here I have a patch that brings our copy of dtrace dis_tables.c to the latest version available in OpenSolaris code: http://people.freebsd.org/~avg/dtrace-disassm-osol.diff I haven't studied at all what the newer code brings in, but it must be some fixes and improvements, I guess :-) The change is mostly a mechanical merge, plus some changes on top to get the code to compile. I've been using the code for a few weeks and haven't run into any problems. Should I put this change into the tree? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 09:17:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 554C1106564A; Fri, 29 Jun 2012 09:17:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 357818FC12; Fri, 29 Jun 2012 09:17:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T9HoYR030644; Fri, 29 Jun 2012 09:17:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T9HnsR030640; Fri, 29 Jun 2012 09:17:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206290917.q5T9HnsR030640@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 09:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237752 - in stable/9/sys/boot: common i386/efi sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 09:17:50 -0000 Author: avg Date: Fri Jun 29 09:17:49 2012 New Revision: 237752 URL: http://svn.freebsd.org/changeset/base/237752 Log: MFC r235153: sys/boot: add common CTASSERT definition Modified: stable/9/sys/boot/common/bootstrap.h stable/9/sys/boot/i386/efi/reloc.c stable/9/sys/boot/sparc64/loader/main.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/common/bootstrap.h ============================================================================== --- stable/9/sys/boot/common/bootstrap.h Fri Jun 29 09:03:47 2012 (r237751) +++ stable/9/sys/boot/common/bootstrap.h Fri Jun 29 09:17:49 2012 (r237752) @@ -327,4 +327,10 @@ void dev_cleanup(void); time_t time(time_t *tloc); +#ifndef CTASSERT /* Allow lint to override */ +#define CTASSERT(x) _CTASSERT(x, __LINE__) +#define _CTASSERT(x, y) __CTASSERT(x, y) +#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] +#endif + #endif /* !_BOOTSTRAP_H_ */ Modified: stable/9/sys/boot/i386/efi/reloc.c ============================================================================== --- stable/9/sys/boot/i386/efi/reloc.c Fri Jun 29 09:03:47 2012 (r237751) +++ stable/9/sys/boot/i386/efi/reloc.c Fri Jun 29 09:17:49 2012 (r237752) @@ -30,16 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include - -/* - * XXX: we can't include sys/systm.h. - */ -#ifndef CTASSERT /* Allow lint to override */ -#define CTASSERT(x) _CTASSERT(x, __LINE__) -#define _CTASSERT(x, y) __CTASSERT(x, y) -#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] -#endif - +#include /* * A simple relocator for IA32 EFI binaries. Modified: stable/9/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/9/sys/boot/sparc64/loader/main.c Fri Jun 29 09:03:47 2012 (r237751) +++ stable/9/sys/boot/sparc64/loader/main.c Fri Jun 29 09:17:49 2012 (r237752) @@ -74,12 +74,6 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" -#ifndef CTASSERT -#define CTASSERT(x) _CTASSERT(x, __LINE__) -#define _CTASSERT(x, y) __CTASSERT(x, y) -#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] -#endif - extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; enum { From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 09:41:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6231106564A; Fri, 29 Jun 2012 09:41:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6BC58FC15; Fri, 29 Jun 2012 09:41:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T9f9ZD031621; Fri, 29 Jun 2012 09:41:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T9f9es031613; Fri, 29 Jun 2012 09:41:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206290941.q5T9f9es031613@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 29 Jun 2012 09:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237753 - in stable/9/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 09:41:10 -0000 Author: kib Date: Fri Jun 29 09:41:09 2012 New Revision: 237753 URL: http://svn.freebsd.org/changeset/base/237753 Log: MFC r237430: Reserve AT_TIMEKEEP auxv entry for providing usermode the pointer to timekeeping information. Modified: stable/9/sys/amd64/include/elf.h stable/9/sys/arm/include/elf.h stable/9/sys/i386/include/elf.h stable/9/sys/ia64/include/elf.h stable/9/sys/mips/include/elf.h stable/9/sys/powerpc/include/elf.h stable/9/sys/sparc64/include/elf.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/elf.h ============================================================================== --- stable/9/sys/amd64/include/elf.h Fri Jun 29 09:17:49 2012 (r237752) +++ stable/9/sys/amd64/include/elf.h Fri Jun 29 09:41:09 2012 (r237753) @@ -94,6 +94,7 @@ __ElfType(Auxinfo); #define AT_NCPUS 19 /* Number of CPUs. */ #define AT_PAGESIZES 20 /* Pagesizes. */ #define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ +#define AT_TIMEKEEP 22 /* Pointer to timehands. */ #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_COUNT 24 /* Count of defined aux entry types. */ Modified: stable/9/sys/arm/include/elf.h ============================================================================== --- stable/9/sys/arm/include/elf.h Fri Jun 29 09:17:49 2012 (r237752) +++ stable/9/sys/arm/include/elf.h Fri Jun 29 09:41:09 2012 (r237753) @@ -82,6 +82,7 @@ __ElfType(Auxinfo); #define AT_NCPUS 19 /* Number of CPUs. */ #define AT_PAGESIZES 20 /* Pagesizes. */ #define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ +#define AT_TIMEKEEP 22 /* Pointer to timehands. */ #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_COUNT 24 /* Count of defined aux entry types. */ Modified: stable/9/sys/i386/include/elf.h ============================================================================== --- stable/9/sys/i386/include/elf.h Fri Jun 29 09:17:49 2012 (r237752) +++ stable/9/sys/i386/include/elf.h Fri Jun 29 09:41:09 2012 (r237753) @@ -96,6 +96,7 @@ __ElfType(Auxinfo); #define AT_NCPUS 19 /* Number of CPUs. */ #define AT_PAGESIZES 20 /* Pagesizes. */ #define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ +#define AT_TIMEKEEP 22 /* Pointer to timehands. */ #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_COUNT 24 /* Count of defined aux entry types. */ Modified: stable/9/sys/ia64/include/elf.h ============================================================================== --- stable/9/sys/ia64/include/elf.h Fri Jun 29 09:17:49 2012 (r237752) +++ stable/9/sys/ia64/include/elf.h Fri Jun 29 09:41:09 2012 (r237753) @@ -95,6 +95,7 @@ __ElfType(Auxinfo); #define AT_NCPUS 19 /* Number of CPUs. */ #define AT_PAGESIZES 20 /* Pagesizes. */ #define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ +#define AT_TIMEKEEP 22 /* Pointer to timehands. */ #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_COUNT 24 /* Count of defined aux entry types. */ Modified: stable/9/sys/mips/include/elf.h ============================================================================== --- stable/9/sys/mips/include/elf.h Fri Jun 29 09:17:49 2012 (r237752) +++ stable/9/sys/mips/include/elf.h Fri Jun 29 09:41:09 2012 (r237753) @@ -257,6 +257,7 @@ __ElfType(Auxinfo); #define AT_NCPUS 19 /* Number of CPUs. */ #define AT_PAGESIZES 20 /* Pagesizes. */ #define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ +#define AT_TIMEKEEP 22 /* Pointer to timehands. */ #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_COUNT 24 /* Count of defined aux entry types. */ Modified: stable/9/sys/powerpc/include/elf.h ============================================================================== --- stable/9/sys/powerpc/include/elf.h Fri Jun 29 09:17:49 2012 (r237752) +++ stable/9/sys/powerpc/include/elf.h Fri Jun 29 09:41:09 2012 (r237753) @@ -106,8 +106,9 @@ __ElfType(Auxinfo); #define AT_PAGESIZES 18 /* Pagesizes. */ #define AT_PAGESIZESLEN 19 /* Number of pagesizes. */ #define AT_STACKPROT 21 /* Initial stack protection. */ +#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_COUNT 22 /* Count of defined aux entry types. */ +#define AT_COUNT 23 /* Count of defined aux entry types. */ /* * Relocation types. Modified: stable/9/sys/sparc64/include/elf.h ============================================================================== --- stable/9/sys/sparc64/include/elf.h Fri Jun 29 09:17:49 2012 (r237752) +++ stable/9/sys/sparc64/include/elf.h Fri Jun 29 09:41:09 2012 (r237753) @@ -90,6 +90,7 @@ __ElfType(Auxinfo); #define AT_NCPUS 19 /* Number of CPUs. */ #define AT_PAGESIZES 20 /* Pagesizes. */ #define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ +#define AT_TIMEKEEP 22 /* Pointer to timehands. */ #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_COUNT 24 /* Count of defined aux entry types. */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 09:56:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 620D11065813; Fri, 29 Jun 2012 09:56:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C7C18FC0A; Fri, 29 Jun 2012 09:56:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5T9uNsk032260; Fri, 29 Jun 2012 09:56:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5T9uNJg032257; Fri, 29 Jun 2012 09:56:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206290956.q5T9uNJg032257@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 09:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237754 - in stable/8/sys/boot: common sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 09:56:23 -0000 Author: avg Date: Fri Jun 29 09:56:22 2012 New Revision: 237754 URL: http://svn.freebsd.org/changeset/base/237754 Log: MFC r235153: sys/boot: add common CTASSERT definition Modified: stable/8/sys/boot/common/bootstrap.h stable/8/sys/boot/sparc64/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/common/bootstrap.h ============================================================================== --- stable/8/sys/boot/common/bootstrap.h Fri Jun 29 09:41:09 2012 (r237753) +++ stable/8/sys/boot/common/bootstrap.h Fri Jun 29 09:56:22 2012 (r237754) @@ -311,4 +311,10 @@ void dev_cleanup(void); time_t time(time_t *tloc); +#ifndef CTASSERT /* Allow lint to override */ +#define CTASSERT(x) _CTASSERT(x, __LINE__) +#define _CTASSERT(x, y) __CTASSERT(x, y) +#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] +#endif + #endif /* !_BOOTSTRAP_H_ */ Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Fri Jun 29 09:41:09 2012 (r237753) +++ stable/8/sys/boot/sparc64/loader/main.c Fri Jun 29 09:56:22 2012 (r237754) @@ -74,12 +74,6 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" -#ifndef CTASSERT -#define CTASSERT(x) _CTASSERT(x, __LINE__) -#define _CTASSERT(x, y) __CTASSERT(x, y) -#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] -#endif - extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; enum { From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:01:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C651B106566C; Fri, 29 Jun 2012 10:01:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE2F08FC23; Fri, 29 Jun 2012 10:01:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TA1qFN032657; Fri, 29 Jun 2012 10:01:52 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TA1qsJ032647; Fri, 29 Jun 2012 10:01:52 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291001.q5TA1qsJ032647@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237755 - in stable/8/sys/boot/i386: btx/btx btx/btxldr btx/lib common loader zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:01:52 -0000 Author: avg Date: Fri Jun 29 10:01:52 2012 New Revision: 237755 URL: http://svn.freebsd.org/changeset/base/237755 Log: MFC r235154,r235158: btxldr: future-proof argument passing from boot1/2-ish to loader Added: stable/8/sys/boot/i386/btx/lib/btxcsu.S - copied unchanged from r235154, head/sys/boot/i386/btx/lib/btxcsu.S stable/8/sys/boot/i386/common/bootargs.h - copied unchanged from r235154, head/sys/boot/i386/common/bootargs.h Deleted: stable/8/sys/boot/i386/btx/lib/btxcsu.s Modified: stable/8/sys/boot/i386/btx/btx/Makefile stable/8/sys/boot/i386/btx/btx/btx.S stable/8/sys/boot/i386/btx/btxldr/Makefile stable/8/sys/boot/i386/btx/btxldr/btxldr.S stable/8/sys/boot/i386/btx/lib/Makefile stable/8/sys/boot/i386/loader/main.c stable/8/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/i386/btx/btx/Makefile ============================================================================== --- stable/8/sys/boot/i386/btx/btx/Makefile Fri Jun 29 09:56:22 2012 (r237754) +++ stable/8/sys/boot/i386/btx/btx/Makefile Fri Jun 29 10:01:52 2012 (r237755) @@ -12,6 +12,7 @@ BOOT_BTX_FLAGS=0x0 .endif CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} +CFLAGS+=-I${.CURDIR}/../../common .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x3f8 Modified: stable/8/sys/boot/i386/btx/btx/btx.S ============================================================================== --- stable/8/sys/boot/i386/btx/btx/btx.S Fri Jun 29 09:56:22 2012 (r237754) +++ stable/8/sys/boot/i386/btx/btx/btx.S Fri Jun 29 10:01:52 2012 (r237755) @@ -15,6 +15,8 @@ * $FreeBSD$ */ +#include + /* * Memory layout. */ @@ -205,7 +207,7 @@ init.8: xorl %ecx,%ecx # Zero movl $MEM_USR,%edx # User base address movzwl %ss:BDA_MEM,%eax # Get free memory shll $0xa,%eax # To bytes - subl $0x1000,%eax # Less arg space + subl $ARGSPACE,%eax # Less arg space subl %edx,%eax # Less base movb $SEL_UDATA,%cl # User data selector pushl %ecx # Set SS Modified: stable/8/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- stable/8/sys/boot/i386/btx/btxldr/Makefile Fri Jun 29 09:56:22 2012 (r237754) +++ stable/8/sys/boot/i386/btx/btxldr/Makefile Fri Jun 29 10:01:52 2012 (r237755) @@ -6,6 +6,7 @@ NO_MAN= SRCS= btxldr.S CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS} +CFLAGS+=-I${.CURDIR}/../../common .if defined(BTXLDR_VERBOSE) CFLAGS+=-DBTXLDR_VERBOSE Modified: stable/8/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- stable/8/sys/boot/i386/btx/btxldr/btxldr.S Fri Jun 29 09:56:22 2012 (r237754) +++ stable/8/sys/boot/i386/btx/btxldr/btxldr.S Fri Jun 29 10:01:52 2012 (r237755) @@ -15,6 +15,8 @@ * $FreeBSD$ */ +#include + #define RBX_MUTE 0x10 /* -m */ #define OPT_SET(opt) (1 << (opt)) @@ -89,7 +91,7 @@ start: cld # String ops inc call hexout # stack call putstr # pointer movl $m_args,%esi # Format string - leal 0x4(%esp,1),%ebx # First argument + leal 0x4(%esp),%ebx # First argument movl $0x6,%ecx # Count start.1: movl (%ebx),%eax # Get argument and addl $0x4,%ebx # bump pointer @@ -97,24 +99,28 @@ start.1: movl (%ebx),%eax # Get argumen loop start.1 # Till done call putstr # End message #endif - movl $0x48,%ecx # Allocate space - subl %ecx,%ebp # for bootinfo - movl 0x18(%esp,1),%esi # Source: bootinfo + movl BA_BOOTINFO+4(%esp),%esi # Source: bootinfo cmpl $0x0, %esi # If the bootinfo pointer je start_null_bi # is null, don't copy it + movl BI_SIZE(%esi),%ecx # Allocate space + subl %ecx,%ebp # for bootinfo movl %ebp,%edi # Destination rep # Copy movsb # it - movl %ebp,0x18(%esp,1) # Update pointer + movl %ebp,BA_BOOTINFO+4(%esp) # Update pointer + movl %edi,%ebp # Restore base pointer #ifdef BTXLDR_VERBOSE movl $m_rel_bi,%esi # Display movl %ebp,%eax # bootinfo call hexout # relocation call putstr # message #endif -start_null_bi: movl $0x18,%ecx # Allocate space - subl %ecx,%ebp # for arguments - leal 0x4(%esp,1),%esi # Source +start_null_bi: movl $BOOTARGS_SIZE,%ecx # Fixed size of arguments + testl $KARGS_FLAGS_EXTARG, BA_BOOTFLAGS+4(%esp) # Check for extra data + jz start_fixed # Skip if the flag is not set + addl BOOTARGS_SIZE+4(%esp),%ecx # Add size of variable args +start_fixed: subl $ARGOFF,%ebp # Place args at fixed offset + leal 0x4(%esp),%esi # Source movl %ebp,%edi # Destination rep # Copy movsb # them Modified: stable/8/sys/boot/i386/btx/lib/Makefile ============================================================================== --- stable/8/sys/boot/i386/btx/lib/Makefile Fri Jun 29 09:56:22 2012 (r237754) +++ stable/8/sys/boot/i386/btx/lib/Makefile Fri Jun 29 10:01:52 2012 (r237755) @@ -3,7 +3,8 @@ PROG= crt0.o INTERNALPROG= NO_MAN= -SRCS= btxcsu.s btxsys.s btxv86.s +SRCS= btxcsu.S btxsys.s btxv86.s +CFLAGS+=-I${.CURDIR}/../../common LDFLAGS=-Wl,-r .include Copied: stable/8/sys/boot/i386/btx/lib/btxcsu.S (from r235154, head/sys/boot/i386/btx/lib/btxcsu.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/i386/btx/lib/btxcsu.S Fri Jun 29 10:01:52 2012 (r237755, copy of r235154, head/sys/boot/i386/btx/lib/btxcsu.S) @@ -0,0 +1,49 @@ +# +# Copyright (c) 1998 Robert Nordier +# All rights reserved. +# +# Redistribution and use in source and binary forms are freely +# permitted provided that the above copyright notice and this +# paragraph and the following disclaimer are duplicated in all +# such forms. +# +# This software is provided "AS IS" and without any express or +# implied warranties, including, without limitation, the implied +# warranties of merchantability and fitness for a particular +# purpose. +# + +# $FreeBSD$ + +#include + +# +# BTX C startup code (ELF). +# + +# +# Globals. +# + .global _start +# +# Client entry point. +# +_start: cld + pushl %eax + movl $_edata,%edi + movl $_end,%ecx + subl %edi, %ecx + xorb %al, %al + rep + stosb + popl __base + movl %esp,%eax # Set + addl $ARGADJ,%eax # argument + movl %eax,__args # pointer + call main # Invoke client main() + call exit # Invoke client exit() +# +# Data. +# + .comm __base,4 # Client base address + .comm __args,4 # Client arguments Copied: stable/8/sys/boot/i386/common/bootargs.h (from r235154, head/sys/boot/i386/common/bootargs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/i386/common/bootargs.h Fri Jun 29 10:01:52 2012 (r237755, copy of r235154, head/sys/boot/i386/common/bootargs.h) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2012 Andriy Gapon + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD$ + */ + +#ifndef _BOOT_I386_ARGS_H_ +#define _BOOT_I386_ARGS_H_ + +#define KARGS_FLAGS_CD 0x1 +#define KARGS_FLAGS_PXE 0x2 +#define KARGS_FLAGS_ZFS 0x4 +#define KARGS_FLAGS_EXTARG 0x8 /* variably sized extended argument */ + +#define BOOTARGS_SIZE 24 /* sizeof(struct bootargs) */ +#define BA_BOOTFLAGS 8 /* offsetof(struct bootargs, bootflags) */ +#define BA_BOOTINFO 20 /* offsetof(struct bootargs, bootinfo) */ +#define BI_SIZE 48 /* offsetof(struct bootinfo, bi_size) */ + +/* + * We reserve some space above BTX allocated stack for the arguments + * and certain data that could hang off them. Currently only struct bootinfo + * is supported in that category. The bootinfo is placed at the top + * of the arguments area and the actual arguments are placed at ARGOFF offset + * from the top and grow towards the top. Hopefully we have enough space + * for bootinfo and the arguments to not run into each other. + * Arguments area below ARGOFF is reserved for future use. + */ +#define ARGSPACE 0x1000 /* total size of the BTX args area */ +#define ARGOFF 0x800 /* actual args offset within the args area */ +#define ARGADJ (ARGSPACE - ARGOFF) + +#ifndef __ASSEMBLER__ + +struct bootargs +{ + uint32_t howto; + uint32_t bootdev; + uint32_t bootflags; + union { + struct { + uint32_t pxeinfo; + uint32_t reserved; + }; + uint64_t zfspool; + }; + uint32_t bootinfo; + + /* + * If KARGS_FLAGS_EXTARG is set in bootflags, then the above fields + * are followed by a uint32_t field that specifies a size of the + * extended arguments (including the size field). + */ +}; + +#endif /*__ASSEMBLER__*/ + +#endif /* !_BOOT_I386_ARGS_H_ */ Modified: stable/8/sys/boot/i386/loader/main.c ============================================================================== --- stable/8/sys/boot/i386/loader/main.c Fri Jun 29 09:56:22 2012 (r237754) +++ stable/8/sys/boot/i386/loader/main.c Fri Jun 29 10:01:52 2012 (r237755) @@ -33,34 +33,24 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include #include #include "bootstrap.h" +#include "common/bootargs.h" #include "libi386/libi386.h" #include "btxv86.h" -#define KARGS_FLAGS_CD 0x1 -#define KARGS_FLAGS_PXE 0x2 -#define KARGS_FLAGS_ZFS 0x4 +CTASSERT(sizeof(struct bootargs) == BOOTARGS_SIZE); +CTASSERT(offsetof(struct bootargs, bootinfo) == BA_BOOTINFO); +CTASSERT(offsetof(struct bootargs, bootflags) == BA_BOOTFLAGS); +CTASSERT(offsetof(struct bootinfo, bi_size) == BI_SIZE); /* Arguments passed in from the boot1/boot2 loader */ -static struct -{ - u_int32_t howto; - u_int32_t bootdev; - u_int32_t bootflags; - union { - struct { - u_int32_t pxeinfo; - u_int32_t res2; - }; - uint64_t zfspool; - }; - u_int32_t bootinfo; -} *kargs; +static struct bootargs *kargs; static u_int32_t initial_howto; static u_int32_t initial_bootdev; Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 09:56:22 2012 (r237754) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:01:52 2012 (r237755) @@ -41,9 +41,7 @@ __FBSDID("$FreeBSD$"); #include "drv.h" #include "util.h" #include "cons.h" - -/* Hint to loader that we came from ZFS */ -#define KARGS_FLAGS_ZFS 0x4 +#include "bootargs.h" #define PATH_DOTCONFIG "/boot.config" #define PATH_CONFIG "/boot/config" From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:01:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F0A61065672; Fri, 29 Jun 2012 10:01:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3787D8FC0A; Fri, 29 Jun 2012 10:01:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TA1vgU032703; Fri, 29 Jun 2012 10:01:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TA1uBd032693; Fri, 29 Jun 2012 10:01:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291001.q5TA1uBd032693@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237756 - in stable/9/sys/boot/i386: btx/btx btx/btxldr btx/lib common loader zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:01:57 -0000 Author: avg Date: Fri Jun 29 10:01:56 2012 New Revision: 237756 URL: http://svn.freebsd.org/changeset/base/237756 Log: MFC r235154,r235158: btxldr: future-proof argument passing from boot1/2-ish to loader Added: stable/9/sys/boot/i386/btx/lib/btxcsu.S - copied unchanged from r235154, head/sys/boot/i386/btx/lib/btxcsu.S stable/9/sys/boot/i386/common/bootargs.h - copied unchanged from r235154, head/sys/boot/i386/common/bootargs.h Deleted: stable/9/sys/boot/i386/btx/lib/btxcsu.s Modified: stable/9/sys/boot/i386/btx/btx/Makefile stable/9/sys/boot/i386/btx/btx/btx.S stable/9/sys/boot/i386/btx/btxldr/Makefile stable/9/sys/boot/i386/btx/btxldr/btxldr.S stable/9/sys/boot/i386/btx/lib/Makefile stable/9/sys/boot/i386/loader/main.c stable/9/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) Modified: stable/9/sys/boot/i386/btx/btx/Makefile ============================================================================== --- stable/9/sys/boot/i386/btx/btx/Makefile Fri Jun 29 10:01:52 2012 (r237755) +++ stable/9/sys/boot/i386/btx/btx/Makefile Fri Jun 29 10:01:56 2012 (r237756) @@ -12,6 +12,7 @@ BOOT_BTX_FLAGS=0x0 .endif CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} +CFLAGS+=-I${.CURDIR}/../../common .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x3f8 Modified: stable/9/sys/boot/i386/btx/btx/btx.S ============================================================================== --- stable/9/sys/boot/i386/btx/btx/btx.S Fri Jun 29 10:01:52 2012 (r237755) +++ stable/9/sys/boot/i386/btx/btx/btx.S Fri Jun 29 10:01:56 2012 (r237756) @@ -15,6 +15,8 @@ * $FreeBSD$ */ +#include + /* * Memory layout. */ @@ -205,7 +207,7 @@ init.8: xorl %ecx,%ecx # Zero movl $MEM_USR,%edx # User base address movzwl %ss:BDA_MEM,%eax # Get free memory shll $0xa,%eax # To bytes - subl $0x1000,%eax # Less arg space + subl $ARGSPACE,%eax # Less arg space subl %edx,%eax # Less base movb $SEL_UDATA,%cl # User data selector pushl %ecx # Set SS Modified: stable/9/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- stable/9/sys/boot/i386/btx/btxldr/Makefile Fri Jun 29 10:01:52 2012 (r237755) +++ stable/9/sys/boot/i386/btx/btxldr/Makefile Fri Jun 29 10:01:56 2012 (r237756) @@ -6,6 +6,7 @@ NO_MAN= SRCS= btxldr.S CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS} +CFLAGS+=-I${.CURDIR}/../../common .if defined(BTXLDR_VERBOSE) CFLAGS+=-DBTXLDR_VERBOSE Modified: stable/9/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- stable/9/sys/boot/i386/btx/btxldr/btxldr.S Fri Jun 29 10:01:52 2012 (r237755) +++ stable/9/sys/boot/i386/btx/btxldr/btxldr.S Fri Jun 29 10:01:56 2012 (r237756) @@ -15,6 +15,8 @@ * $FreeBSD$ */ +#include + #define RBX_MUTE 0x10 /* -m */ #define OPT_SET(opt) (1 << (opt)) @@ -89,7 +91,7 @@ start: cld # String ops inc call hexout # stack call putstr # pointer movl $m_args,%esi # Format string - leal 0x4(%esp,1),%ebx # First argument + leal 0x4(%esp),%ebx # First argument movl $0x6,%ecx # Count start.1: movl (%ebx),%eax # Get argument and addl $0x4,%ebx # bump pointer @@ -97,24 +99,28 @@ start.1: movl (%ebx),%eax # Get argumen loop start.1 # Till done call putstr # End message #endif - movl $0x48,%ecx # Allocate space - subl %ecx,%ebp # for bootinfo - movl 0x18(%esp,1),%esi # Source: bootinfo + movl BA_BOOTINFO+4(%esp),%esi # Source: bootinfo cmpl $0x0, %esi # If the bootinfo pointer je start_null_bi # is null, don't copy it + movl BI_SIZE(%esi),%ecx # Allocate space + subl %ecx,%ebp # for bootinfo movl %ebp,%edi # Destination rep # Copy movsb # it - movl %ebp,0x18(%esp,1) # Update pointer + movl %ebp,BA_BOOTINFO+4(%esp) # Update pointer + movl %edi,%ebp # Restore base pointer #ifdef BTXLDR_VERBOSE movl $m_rel_bi,%esi # Display movl %ebp,%eax # bootinfo call hexout # relocation call putstr # message #endif -start_null_bi: movl $0x18,%ecx # Allocate space - subl %ecx,%ebp # for arguments - leal 0x4(%esp,1),%esi # Source +start_null_bi: movl $BOOTARGS_SIZE,%ecx # Fixed size of arguments + testl $KARGS_FLAGS_EXTARG, BA_BOOTFLAGS+4(%esp) # Check for extra data + jz start_fixed # Skip if the flag is not set + addl BOOTARGS_SIZE+4(%esp),%ecx # Add size of variable args +start_fixed: subl $ARGOFF,%ebp # Place args at fixed offset + leal 0x4(%esp),%esi # Source movl %ebp,%edi # Destination rep # Copy movsb # them Modified: stable/9/sys/boot/i386/btx/lib/Makefile ============================================================================== --- stable/9/sys/boot/i386/btx/lib/Makefile Fri Jun 29 10:01:52 2012 (r237755) +++ stable/9/sys/boot/i386/btx/lib/Makefile Fri Jun 29 10:01:56 2012 (r237756) @@ -3,7 +3,8 @@ PROG= crt0.o INTERNALPROG= NO_MAN= -SRCS= btxcsu.s btxsys.s btxv86.s +SRCS= btxcsu.S btxsys.s btxv86.s +CFLAGS+=-I${.CURDIR}/../../common LDFLAGS=-Wl,-r .include Copied: stable/9/sys/boot/i386/btx/lib/btxcsu.S (from r235154, head/sys/boot/i386/btx/lib/btxcsu.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/boot/i386/btx/lib/btxcsu.S Fri Jun 29 10:01:56 2012 (r237756, copy of r235154, head/sys/boot/i386/btx/lib/btxcsu.S) @@ -0,0 +1,49 @@ +# +# Copyright (c) 1998 Robert Nordier +# All rights reserved. +# +# Redistribution and use in source and binary forms are freely +# permitted provided that the above copyright notice and this +# paragraph and the following disclaimer are duplicated in all +# such forms. +# +# This software is provided "AS IS" and without any express or +# implied warranties, including, without limitation, the implied +# warranties of merchantability and fitness for a particular +# purpose. +# + +# $FreeBSD$ + +#include + +# +# BTX C startup code (ELF). +# + +# +# Globals. +# + .global _start +# +# Client entry point. +# +_start: cld + pushl %eax + movl $_edata,%edi + movl $_end,%ecx + subl %edi, %ecx + xorb %al, %al + rep + stosb + popl __base + movl %esp,%eax # Set + addl $ARGADJ,%eax # argument + movl %eax,__args # pointer + call main # Invoke client main() + call exit # Invoke client exit() +# +# Data. +# + .comm __base,4 # Client base address + .comm __args,4 # Client arguments Copied: stable/9/sys/boot/i386/common/bootargs.h (from r235154, head/sys/boot/i386/common/bootargs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/boot/i386/common/bootargs.h Fri Jun 29 10:01:56 2012 (r237756, copy of r235154, head/sys/boot/i386/common/bootargs.h) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2012 Andriy Gapon + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD$ + */ + +#ifndef _BOOT_I386_ARGS_H_ +#define _BOOT_I386_ARGS_H_ + +#define KARGS_FLAGS_CD 0x1 +#define KARGS_FLAGS_PXE 0x2 +#define KARGS_FLAGS_ZFS 0x4 +#define KARGS_FLAGS_EXTARG 0x8 /* variably sized extended argument */ + +#define BOOTARGS_SIZE 24 /* sizeof(struct bootargs) */ +#define BA_BOOTFLAGS 8 /* offsetof(struct bootargs, bootflags) */ +#define BA_BOOTINFO 20 /* offsetof(struct bootargs, bootinfo) */ +#define BI_SIZE 48 /* offsetof(struct bootinfo, bi_size) */ + +/* + * We reserve some space above BTX allocated stack for the arguments + * and certain data that could hang off them. Currently only struct bootinfo + * is supported in that category. The bootinfo is placed at the top + * of the arguments area and the actual arguments are placed at ARGOFF offset + * from the top and grow towards the top. Hopefully we have enough space + * for bootinfo and the arguments to not run into each other. + * Arguments area below ARGOFF is reserved for future use. + */ +#define ARGSPACE 0x1000 /* total size of the BTX args area */ +#define ARGOFF 0x800 /* actual args offset within the args area */ +#define ARGADJ (ARGSPACE - ARGOFF) + +#ifndef __ASSEMBLER__ + +struct bootargs +{ + uint32_t howto; + uint32_t bootdev; + uint32_t bootflags; + union { + struct { + uint32_t pxeinfo; + uint32_t reserved; + }; + uint64_t zfspool; + }; + uint32_t bootinfo; + + /* + * If KARGS_FLAGS_EXTARG is set in bootflags, then the above fields + * are followed by a uint32_t field that specifies a size of the + * extended arguments (including the size field). + */ +}; + +#endif /*__ASSEMBLER__*/ + +#endif /* !_BOOT_I386_ARGS_H_ */ Modified: stable/9/sys/boot/i386/loader/main.c ============================================================================== --- stable/9/sys/boot/i386/loader/main.c Fri Jun 29 10:01:52 2012 (r237755) +++ stable/9/sys/boot/i386/loader/main.c Fri Jun 29 10:01:56 2012 (r237756) @@ -33,34 +33,24 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include #include #include "bootstrap.h" +#include "common/bootargs.h" #include "libi386/libi386.h" #include "btxv86.h" -#define KARGS_FLAGS_CD 0x1 -#define KARGS_FLAGS_PXE 0x2 -#define KARGS_FLAGS_ZFS 0x4 +CTASSERT(sizeof(struct bootargs) == BOOTARGS_SIZE); +CTASSERT(offsetof(struct bootargs, bootinfo) == BA_BOOTINFO); +CTASSERT(offsetof(struct bootargs, bootflags) == BA_BOOTFLAGS); +CTASSERT(offsetof(struct bootinfo, bi_size) == BI_SIZE); /* Arguments passed in from the boot1/boot2 loader */ -static struct -{ - u_int32_t howto; - u_int32_t bootdev; - u_int32_t bootflags; - union { - struct { - u_int32_t pxeinfo; - u_int32_t res2; - }; - uint64_t zfspool; - }; - u_int32_t bootinfo; -} *kargs; +static struct bootargs *kargs; static u_int32_t initial_howto; static u_int32_t initial_bootdev; Modified: stable/9/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/9/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:01:52 2012 (r237755) +++ stable/9/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:01:56 2012 (r237756) @@ -41,9 +41,7 @@ __FBSDID("$FreeBSD$"); #include "drv.h" #include "util.h" #include "cons.h" - -/* Hint to loader that we came from ZFS */ -#define KARGS_FLAGS_ZFS 0x4 +#include "bootargs.h" #define PATH_DOTCONFIG "/boot.config" #define PATH_CONFIG "/boot/config" From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:04:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5995E106576E; Fri, 29 Jun 2012 10:04:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29C228FC0A; Fri, 29 Jun 2012 10:04:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TA4Oib032876; Fri, 29 Jun 2012 10:04:24 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TA4NeV032871; Fri, 29 Jun 2012 10:04:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291004.q5TA4NeV032871@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237757 - in stable/8/sys/boot: i386/libi386 i386/zfsboot pc98/libpc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:04:24 -0000 Author: avg Date: Fri Jun 29 10:04:23 2012 New Revision: 237757 URL: http://svn.freebsd.org/changeset/base/237757 Log: MFC r235155: i386 boot: consolidate MAXBDDEV definition Modified: stable/8/sys/boot/i386/libi386/biosdisk.c stable/8/sys/boot/i386/libi386/libi386.h stable/8/sys/boot/i386/zfsboot/zfsboot.c stable/8/sys/boot/pc98/libpc98/biosdisk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/8/sys/boot/i386/libi386/biosdisk.c Fri Jun 29 10:01:56 2012 (r237756) +++ stable/8/sys/boot/i386/libi386/biosdisk.c Fri Jun 29 10:04:23 2012 (r237757) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #define BIOS_NUMDRIVES 0x475 #define BIOSDISK_SECSIZE 512 #define BUFSIZE (1 * BIOSDISK_SECSIZE) -#define MAXBDDEV MAXDEV #define DT_ATAPI 0x10 /* disk type for ATAPI floppies */ #define WDMAJOR 0 /* major numbers for devices we frontend for */ Modified: stable/8/sys/boot/i386/libi386/libi386.h ============================================================================== --- stable/8/sys/boot/i386/libi386/libi386.h Fri Jun 29 10:01:56 2012 (r237756) +++ stable/8/sys/boot/i386/libi386/libi386.h Fri Jun 29 10:04:23 2012 (r237757) @@ -58,7 +58,8 @@ int i386_setcurrdev(struct env_var *ev, extern struct devdesc currdev; /* our current device */ -#define MAXDEV 31 /* maximum number of distinct devices */ +#define MAXDEV 31 /* maximum number of distinct devices */ +#define MAXBDDEV MAXDEV /* exported devices XXX rename? */ extern struct devsw bioscd; Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:01:56 2012 (r237756) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:04:23 2012 (r237757) @@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$"); #define TYPE_MAXHARD TYPE_DA #define TYPE_FD 2 -#define MAXBDDEV 31 - extern uint32_t _end; #ifdef GPT Modified: stable/8/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- stable/8/sys/boot/pc98/libpc98/biosdisk.c Fri Jun 29 10:01:56 2012 (r237756) +++ stable/8/sys/boot/pc98/libpc98/biosdisk.c Fri Jun 29 10:04:23 2012 (r237757) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #define BIOS_NUMDRIVES 0x475 #define BIOSDISK_SECSIZE 512 #define BUFSIZE (1 * BIOSDISK_SECSIZE) -#define MAXBDDEV MAXDEV #define DT_ATAPI 0x10 /* disk type for ATAPI floppies */ #define WDMAJOR 0 /* major numbers for devices we frontend for */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:06:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2ED91065679; Fri, 29 Jun 2012 10:06:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCC1B8FC1B; Fri, 29 Jun 2012 10:06:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TA6bPJ033026; Fri, 29 Jun 2012 10:06:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TA6bO9033020; Fri, 29 Jun 2012 10:06:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291006.q5TA6bO9033020@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237758 - in stable/9/sys/boot: i386/libi386 i386/zfsboot pc98/libpc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:06:38 -0000 Author: avg Date: Fri Jun 29 10:06:37 2012 New Revision: 237758 URL: http://svn.freebsd.org/changeset/base/237758 Log: MFC r235155: i386 boot: consolidate MAXBDDEV definition Modified: stable/9/sys/boot/i386/libi386/biosdisk.c stable/9/sys/boot/i386/libi386/libi386.h stable/9/sys/boot/i386/zfsboot/zfsboot.c stable/9/sys/boot/pc98/libpc98/biosdisk.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/9/sys/boot/i386/libi386/biosdisk.c Fri Jun 29 10:04:23 2012 (r237757) +++ stable/9/sys/boot/i386/libi386/biosdisk.c Fri Jun 29 10:06:37 2012 (r237758) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #define BIOS_NUMDRIVES 0x475 #define BIOSDISK_SECSIZE 512 #define BUFSIZE (1 * BIOSDISK_SECSIZE) -#define MAXBDDEV MAXDEV #define DT_ATAPI 0x10 /* disk type for ATAPI floppies */ #define WDMAJOR 0 /* major numbers for devices we frontend for */ Modified: stable/9/sys/boot/i386/libi386/libi386.h ============================================================================== --- stable/9/sys/boot/i386/libi386/libi386.h Fri Jun 29 10:04:23 2012 (r237757) +++ stable/9/sys/boot/i386/libi386/libi386.h Fri Jun 29 10:06:37 2012 (r237758) @@ -58,7 +58,8 @@ int i386_setcurrdev(struct env_var *ev, extern struct devdesc currdev; /* our current device */ -#define MAXDEV 31 /* maximum number of distinct devices */ +#define MAXDEV 31 /* maximum number of distinct devices */ +#define MAXBDDEV MAXDEV /* exported devices XXX rename? */ extern struct devsw bioscd; Modified: stable/9/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/9/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:04:23 2012 (r237757) +++ stable/9/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:06:37 2012 (r237758) @@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$"); #define TYPE_MAXHARD TYPE_DA #define TYPE_FD 2 -#define MAXBDDEV 31 - extern uint32_t _end; #ifdef GPT Modified: stable/9/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- stable/9/sys/boot/pc98/libpc98/biosdisk.c Fri Jun 29 10:04:23 2012 (r237757) +++ stable/9/sys/boot/pc98/libpc98/biosdisk.c Fri Jun 29 10:06:37 2012 (r237758) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #define BIOS_NUMDRIVES 0x475 #define BIOSDISK_SECSIZE 512 #define BUFSIZE (1 * BIOSDISK_SECSIZE) -#define MAXBDDEV MAXDEV #define DT_ATAPI 0x10 /* disk type for ATAPI floppies */ #define WDMAJOR 0 /* major numbers for devices we frontend for */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:07:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19B12106566C; Fri, 29 Jun 2012 10:07:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04DD18FC0A; Fri, 29 Jun 2012 10:07:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TA7GbA033087; Fri, 29 Jun 2012 10:07:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TA7Gi7033085; Fri, 29 Jun 2012 10:07:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291007.q5TA7Gi7033085@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237759 - stable/8/sys/boot/i386/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:07:17 -0000 Author: avg Date: Fri Jun 29 10:07:16 2012 New Revision: 237759 URL: http://svn.freebsd.org/changeset/base/237759 Log: MFC r235156: i386 zfsloader: rename LIBZFS to LIBZFSBOOT Modified: stable/8/sys/boot/i386/loader/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/i386/loader/Makefile ============================================================================== --- stable/8/sys/boot/i386/loader/Makefile Fri Jun 29 10:06:37 2012 (r237758) +++ stable/8/sys/boot/i386/loader/Makefile Fri Jun 29 10:07:16 2012 (r237759) @@ -20,9 +20,7 @@ LIBFIREWIRE= ${.OBJDIR}/../libfirewire/l # Set by zfsloader Makefile .if defined(LOADER_ZFS_SUPPORT) CFLAGS+= -DLOADER_ZFS_SUPPORT -LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a -.else -LIBZFS= +LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif # Enable PXE TFTP or NFS support, not both. @@ -114,8 +112,8 @@ FILES+= loader.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} -lstand +DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} -lstand .include From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:08:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2172D1065670; Fri, 29 Jun 2012 10:08:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E70088FC08; Fri, 29 Jun 2012 10:08:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TA8Vbr033189; Fri, 29 Jun 2012 10:08:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TA8VeD033187; Fri, 29 Jun 2012 10:08:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291008.q5TA8VeD033187@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237760 - stable/9/sys/boot/i386/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:08:32 -0000 Author: avg Date: Fri Jun 29 10:08:31 2012 New Revision: 237760 URL: http://svn.freebsd.org/changeset/base/237760 Log: MFC r235156: i386 zfsloader: rename LIBZFS to LIBZFSBOOT Modified: stable/9/sys/boot/i386/loader/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/i386/loader/Makefile ============================================================================== --- stable/9/sys/boot/i386/loader/Makefile Fri Jun 29 10:07:16 2012 (r237759) +++ stable/9/sys/boot/i386/loader/Makefile Fri Jun 29 10:08:31 2012 (r237760) @@ -20,9 +20,7 @@ LIBFIREWIRE= ${.OBJDIR}/../libfirewire/l # Set by zfsloader Makefile .if defined(LOADER_ZFS_SUPPORT) CFLAGS+= -DLOADER_ZFS_SUPPORT -LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a -.else -LIBZFS= +LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif # Enable PXE TFTP or NFS support, not both. @@ -119,8 +117,8 @@ FILES+= menu.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSTAND} .include From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:10:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84539106566C; Fri, 29 Jun 2012 10:10:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DAFC8FC15; Fri, 29 Jun 2012 10:10:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TAAHbS033465; Fri, 29 Jun 2012 10:10:17 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TAAH0F033457; Fri, 29 Jun 2012 10:10:17 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291010.q5TAAH0F033457@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237761 - in stable/9/sys/boot/i386: cdboot pxeldr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:10:17 -0000 Author: avg Date: Fri Jun 29 10:10:16 2012 New Revision: 237761 URL: http://svn.freebsd.org/changeset/base/237761 Log: MFC r235219: cdboot, pxeldr: make use of bootargs.h instead of redefining flag constants Added: stable/9/sys/boot/i386/cdboot/cdboot.S - copied unchanged from r235219, head/sys/boot/i386/cdboot/cdboot.S Deleted: stable/9/sys/boot/i386/cdboot/cdboot.s Modified: stable/9/sys/boot/i386/cdboot/Makefile stable/9/sys/boot/i386/pxeldr/Makefile stable/9/sys/boot/i386/pxeldr/pxeldr.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/i386/cdboot/Makefile ============================================================================== --- stable/9/sys/boot/i386/cdboot/Makefile Fri Jun 29 10:08:31 2012 (r237760) +++ stable/9/sys/boot/i386/cdboot/Makefile Fri Jun 29 10:10:16 2012 (r237761) @@ -4,7 +4,9 @@ PROG= cdboot STRIP= BINMODE=${NOBINMODE} NO_MAN= -SRCS= ${PROG}.s +SRCS= ${PROG}.S + +CFLAGS+=-I${.CURDIR}/../common ORG= 0x7c00 Copied: stable/9/sys/boot/i386/cdboot/cdboot.S (from r235219, head/sys/boot/i386/cdboot/cdboot.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/boot/i386/cdboot/cdboot.S Fri Jun 29 10:10:16 2012 (r237761, copy of r235219, head/sys/boot/i386/cdboot/cdboot.S) @@ -0,0 +1,597 @@ +# +# Copyright (c) 2001 John Baldwin +# 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. +# 3. Neither the name of the author nor the names of any co-contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# 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 program is a freestanding boot program to load an a.out binary +# from a CD-ROM booted with no emulation mode as described by the El +# Torito standard. Due to broken BIOSen that do not load the desired +# number of sectors, we try to fit this in as small a space as possible. +# +# Basically, we first create a set of boot arguments to pass to the loaded +# binary. Then we attempt to load /boot/loader from the CD we were booted +# off of. +# + +#include + +# +# Memory locations. +# + .set MEM_PAGE_SIZE,0x1000 # memory page size, 4k + .set MEM_ARG,0x900 # Arguments at start + .set MEM_ARG_BTX,0xa100 # Where we move them to so the + # BTX client can see them + .set MEM_ARG_SIZE,0x18 # Size of the arguments + .set MEM_BTX_ADDRESS,0x9000 # where BTX lives + .set MEM_BTX_ENTRY,0x9010 # where BTX starts to execute + .set MEM_BTX_OFFSET,MEM_PAGE_SIZE # offset of BTX in the loader + .set MEM_BTX_CLIENT,0xa000 # where BTX clients live +# +# a.out header fields +# + .set AOUT_TEXT,0x04 # text segment size + .set AOUT_DATA,0x08 # data segment size + .set AOUT_BSS,0x0c # zero'd BSS size + .set AOUT_SYMBOLS,0x10 # symbol table + .set AOUT_ENTRY,0x14 # entry point + .set AOUT_HEADER,MEM_PAGE_SIZE # size of the a.out header +# +# Segment selectors. +# + .set SEL_SDATA,0x8 # Supervisor data + .set SEL_RDATA,0x10 # Real mode data + .set SEL_SCODE,0x18 # PM-32 code + .set SEL_SCODE16,0x20 # PM-16 code +# +# BTX constants +# + .set INT_SYS,0x30 # BTX syscall interrupt +# +# Constants for reading from the CD. +# + .set ERROR_TIMEOUT,0x80 # BIOS timeout on read + .set NUM_RETRIES,3 # Num times to retry + .set SECTOR_SIZE,0x800 # size of a sector + .set SECTOR_SHIFT,11 # number of place to shift + .set BUFFER_LEN,0x100 # number of sectors in buffer + .set MAX_READ,0x10000 # max we can read at a time + .set MAX_READ_SEC,MAX_READ >> SECTOR_SHIFT + .set MEM_READ_BUFFER,0x9000 # buffer to read from CD + .set MEM_VOLDESC,MEM_READ_BUFFER # volume descriptor + .set MEM_DIR,MEM_VOLDESC+SECTOR_SIZE # Lookup buffer + .set VOLDESC_LBA,0x10 # LBA of vol descriptor + .set VD_PRIMARY,1 # Primary VD + .set VD_END,255 # VD Terminator + .set VD_ROOTDIR,156 # Offset of Root Dir Record + .set DIR_LEN,0 # Offset of Dir Record length + .set DIR_EA_LEN,1 # Offset of EA length + .set DIR_EXTENT,2 # Offset of 64-bit LBA + .set DIR_SIZE,10 # Offset of 64-bit length + .set DIR_NAMELEN,32 # Offset of 8-bit name len + .set DIR_NAME,33 # Offset of dir name +# +# We expect to be loaded by the BIOS at 0x7c00 (standard boot loader entry +# point) +# + .code16 + .globl start + .org 0x0, 0x0 +# +# Program start. +# +start: cld # string ops inc + xor %ax,%ax # zero %ax + mov %ax,%ss # setup the + mov $start,%sp # stack + mov %ax,%ds # setup the + mov %ax,%es # data segments + mov %dl,drive # Save BIOS boot device + mov $msg_welcome,%si # %ds:(%si) -> welcome message + call putstr # display the welcome message +# +# Setup the arguments that the loader is expecting from boot[12] +# + mov $msg_bootinfo,%si # %ds:(%si) -> boot args message + call putstr # display the message + mov $MEM_ARG,%bx # %ds:(%bx) -> boot args + mov %bx,%di # %es:(%di) -> boot args + xor %eax,%eax # zero %eax + mov $(MEM_ARG_SIZE/4),%cx # Size of arguments in 32-bit + # dwords + rep # Clear the arguments + stosl # to zero + mov drive,%dl # Store BIOS boot device + mov %dl,0x4(%bx) # in kargs->bootdev + or $KARGS_FLAGS_CD,0x8(%bx) # kargs->bootflags |= + # KARGS_FLAGS_CD +# +# Load Volume Descriptor +# + mov $VOLDESC_LBA,%eax # Set LBA of first VD +load_vd: push %eax # Save %eax + mov $1,%dh # One sector + mov $MEM_VOLDESC,%ebx # Destination + call read # Read it in + cmpb $VD_PRIMARY,(%bx) # Primary VD? + je have_vd # Yes + pop %eax # Prepare to + inc %eax # try next + cmpb $VD_END,(%bx) # Last VD? + jne load_vd # No, read next + mov $msg_novd,%si # No VD + jmp error # Halt +have_vd: # Have Primary VD +# +# Try to look up the loader binary using the paths in the loader_paths +# array. +# + mov $loader_paths,%si # Point to start of array +lookup_path: push %si # Save file name pointer + call lookup # Try to find file + pop %di # Restore file name pointer + jnc lookup_found # Found this file + xor %al,%al # Look for next + mov $0xffff,%cx # path name by + repnz # scanning for + scasb # nul char + mov %di,%si # Point %si at next path + mov (%si),%al # Get first char of next path + or %al,%al # Is it double nul? + jnz lookup_path # No, try it. + mov $msg_failed,%si # Failed message + jmp error # Halt +lookup_found: # Found a loader file +# +# Load the binary into the buffer. Due to real mode addressing limitations +# we have to read it in 64k chunks. +# + mov DIR_SIZE(%bx),%eax # Read file length + add $SECTOR_SIZE-1,%eax # Convert length to sectors + shr $SECTOR_SHIFT,%eax + cmp $BUFFER_LEN,%eax + jbe load_sizeok + mov $msg_load2big,%si # Error message + call error +load_sizeok: movzbw %al,%cx # Num sectors to read + mov DIR_EXTENT(%bx),%eax # Load extent + xor %edx,%edx + mov DIR_EA_LEN(%bx),%dl + add %edx,%eax # Skip extended + mov $MEM_READ_BUFFER,%ebx # Read into the buffer +load_loop: mov %cl,%dh + cmp $MAX_READ_SEC,%cl # Truncate to max read size + jbe load_notrunc + mov $MAX_READ_SEC,%dh +load_notrunc: sub %dh,%cl # Update count + push %eax # Save + call read # Read it in + pop %eax # Restore + add $MAX_READ_SEC,%eax # Update LBA + add $MAX_READ,%ebx # Update dest addr + jcxz load_done # Done? + jmp load_loop # Keep going +load_done: +# +# Turn on the A20 address line +# + call seta20 # Turn A20 on +# +# Relocate the loader and BTX using a very lazy protected mode +# + mov $msg_relocate,%si # Display the + call putstr # relocation message + mov MEM_READ_BUFFER+AOUT_ENTRY,%edi # %edi is the destination + mov $(MEM_READ_BUFFER+AOUT_HEADER),%esi # %esi is + # the start of the text + # segment + mov MEM_READ_BUFFER+AOUT_TEXT,%ecx # %ecx = length of the text + # segment + push %edi # Save entry point for later + lgdt gdtdesc # setup our own gdt + cli # turn off interrupts + mov %cr0,%eax # Turn on + or $0x1,%al # protected + mov %eax,%cr0 # mode + ljmp $SEL_SCODE,$pm_start # long jump to clear the + # instruction pre-fetch queue + .code32 +pm_start: mov $SEL_SDATA,%ax # Initialize + mov %ax,%ds # %ds and + mov %ax,%es # %es to a flat selector + rep # Relocate the + movsb # text segment + add $(MEM_PAGE_SIZE - 1),%edi # pad %edi out to a new page + and $~(MEM_PAGE_SIZE - 1),%edi # for the data segment + mov MEM_READ_BUFFER+AOUT_DATA,%ecx # size of the data segment + rep # Relocate the + movsb # data segment + mov MEM_READ_BUFFER+AOUT_BSS,%ecx # size of the bss + xor %eax,%eax # zero %eax + add $3,%cl # round %ecx up to + shr $2,%ecx # a multiple of 4 + rep # zero the + stosl # bss + mov MEM_READ_BUFFER+AOUT_ENTRY,%esi # %esi -> relocated loader + add $MEM_BTX_OFFSET,%esi # %esi -> BTX in the loader + mov $MEM_BTX_ADDRESS,%edi # %edi -> where BTX needs to go + movzwl 0xa(%esi),%ecx # %ecx -> length of BTX + rep # Relocate + movsb # BTX + ljmp $SEL_SCODE16,$pm_16 # Jump to 16-bit PM + .code16 +pm_16: mov $SEL_RDATA,%ax # Initialize + mov %ax,%ds # %ds and + mov %ax,%es # %es to a real mode selector + mov %cr0,%eax # Turn off + and $~0x1,%al # protected + mov %eax,%cr0 # mode + ljmp $0,$pm_end # Long jump to clear the + # instruction pre-fetch queue +pm_end: sti # Turn interrupts back on now +# +# Copy the BTX client to MEM_BTX_CLIENT +# + xor %ax,%ax # zero %ax and set + mov %ax,%ds # %ds and %es + mov %ax,%es # to segment 0 + mov $MEM_BTX_CLIENT,%di # Prepare to relocate + mov $btx_client,%si # the simple btx client + mov $(btx_client_end-btx_client),%cx # length of btx client + rep # Relocate the + movsb # simple BTX client +# +# Copy the boot[12] args to where the BTX client can see them +# + mov $MEM_ARG,%si # where the args are at now + mov $MEM_ARG_BTX,%di # where the args are moving to + mov $(MEM_ARG_SIZE/4),%cx # size of the arguments in longs + rep # Relocate + movsl # the words +# +# Save the entry point so the client can get to it later on +# + pop %eax # Restore saved entry point + stosl # and add it to the end of + # the arguments +# +# Now we just start up BTX and let it do the rest +# + mov $msg_jump,%si # Display the + call putstr # jump message + ljmp $0,$MEM_BTX_ENTRY # Jump to the BTX entry point + +# +# Lookup the file in the path at [SI] from the root directory. +# +# Trashes: All but BX +# Returns: CF = 0 (success), BX = pointer to record +# CF = 1 (not found) +# +lookup: mov $VD_ROOTDIR+MEM_VOLDESC,%bx # Root directory record + push %si + mov $msg_lookup,%si # Display lookup message + call putstr + pop %si + push %si + call putstr + mov $msg_lookup2,%si + call putstr + pop %si +lookup_dir: lodsb # Get first char of path + cmp $0,%al # Are we done? + je lookup_done # Yes + cmp $'/',%al # Skip path separator. + je lookup_dir + dec %si # Undo lodsb side effect + call find_file # Lookup first path item + jnc lookup_dir # Try next component + mov $msg_lookupfail,%si # Not found message + call putstr + stc # Set carry + ret + jmp error +lookup_done: mov $msg_lookupok,%si # Success message + call putstr + clc # Clear carry + ret + +# +# Lookup file at [SI] in directory whose record is at [BX]. +# +# Trashes: All but returns +# Returns: CF = 0 (success), BX = pointer to record, SI = next path item +# CF = 1 (not found), SI = preserved +# +find_file: mov DIR_EXTENT(%bx),%eax # Load extent + xor %edx,%edx + mov DIR_EA_LEN(%bx),%dl + add %edx,%eax # Skip extended attributes + mov %eax,rec_lba # Save LBA + mov DIR_SIZE(%bx),%eax # Save size + mov %eax,rec_size + xor %cl,%cl # Zero length + push %si # Save +ff.namelen: inc %cl # Update length + lodsb # Read char + cmp $0,%al # Nul? + je ff.namedone # Yes + cmp $'/',%al # Path separator? + jnz ff.namelen # No, keep going +ff.namedone: dec %cl # Adjust length and save + mov %cl,name_len + pop %si # Restore +ff.load: mov rec_lba,%eax # Load LBA + mov $MEM_DIR,%ebx # Address buffer + mov $1,%dh # One sector + call read # Read directory block + incl rec_lba # Update LBA to next block +ff.scan: mov %ebx,%edx # Check for EOF + sub $MEM_DIR,%edx + cmp %edx,rec_size + ja ff.scan.1 + stc # EOF reached + ret +ff.scan.1: cmpb $0,DIR_LEN(%bx) # Last record in block? + je ff.nextblock + push %si # Save + movzbw DIR_NAMELEN(%bx),%si # Find end of string +ff.checkver: cmpb $'0',DIR_NAME-1(%bx,%si) # Less than '0'? + jb ff.checkver.1 + cmpb $'9',DIR_NAME-1(%bx,%si) # Greater than '9'? + ja ff.checkver.1 + dec %si # Next char + jnz ff.checkver + jmp ff.checklen # All numbers in name, so + # no version +ff.checkver.1: movzbw DIR_NAMELEN(%bx),%cx + cmp %cx,%si # Did we find any digits? + je ff.checkdot # No + cmpb $';',DIR_NAME-1(%bx,%si) # Check for semicolon + jne ff.checkver.2 + dec %si # Skip semicolon + mov %si,%cx + mov %cl,DIR_NAMELEN(%bx) # Adjust length + jmp ff.checkdot +ff.checkver.2: mov %cx,%si # Restore %si to end of string +ff.checkdot: cmpb $'.',DIR_NAME-1(%bx,%si) # Trailing dot? + jne ff.checklen # No + decb DIR_NAMELEN(%bx) # Adjust length +ff.checklen: pop %si # Restore + movzbw name_len,%cx # Load length of name + cmp %cl,DIR_NAMELEN(%bx) # Does length match? + je ff.checkname # Yes, check name +ff.nextrec: add DIR_LEN(%bx),%bl # Next record + adc $0,%bh + jmp ff.scan +ff.nextblock: subl $SECTOR_SIZE,rec_size # Adjust size + jnc ff.load # If subtract ok, keep going + ret # End of file, so not found +ff.checkname: lea DIR_NAME(%bx),%di # Address name in record + push %si # Save + repe cmpsb # Compare name + je ff.match # We have a winner! + pop %si # Restore + jmp ff.nextrec # Keep looking. +ff.match: add $2,%sp # Discard saved %si + clc # Clear carry + ret + +# +# Load DH sectors starting at LBA EAX into [EBX]. +# +# Trashes: EAX +# +read: push %si # Save + push %cx # Save since some BIOSs trash + mov %eax,edd_lba # LBA to read from + mov %ebx,%eax # Convert address + shr $4,%eax # to segment + mov %ax,edd_addr+0x2 # and store +read.retry: call twiddle # Entertain the user + push %dx # Save + mov $edd_packet,%si # Address Packet + mov %dh,edd_len # Set length + mov drive,%dl # BIOS Device + mov $0x42,%ah # BIOS: Extended Read + int $0x13 # Call BIOS + pop %dx # Restore + jc read.fail # Worked? + pop %cx # Restore + pop %si + ret # Return +read.fail: cmp $ERROR_TIMEOUT,%ah # Timeout? + je read.retry # Yes, Retry. +read.error: mov %ah,%al # Save error + mov $hex_error,%di # Format it + call hex8 # as hex + mov $msg_badread,%si # Display Read error message + +# +# Display error message at [SI] and halt. +# +error: call putstr # Display message +halt: hlt + jmp halt # Spin + +# +# Display a null-terminated string. +# +# Trashes: AX, SI +# +putstr: push %bx # Save +putstr.load: lodsb # load %al from %ds:(%si) + test %al,%al # stop at null + jnz putstr.putc # if the char != null, output it + pop %bx # Restore + ret # return when null is hit +putstr.putc: call putc # output char + jmp putstr.load # next char + +# +# Display a single char. +# +putc: mov $0x7,%bx # attribute for output + mov $0xe,%ah # BIOS: put_char + int $0x10 # call BIOS, print char in %al + ret # Return to caller + +# +# Output the "twiddle" +# +twiddle: push %ax # Save + push %bx # Save + mov twiddle_index,%al # Load index + mov $twiddle_chars,%bx # Address table + inc %al # Next + and $3,%al # char + mov %al,twiddle_index # Save index for next call + xlat # Get char + call putc # Output it + mov $8,%al # Backspace + call putc # Output it + pop %bx # Restore + pop %ax # Restore + ret + +# +# Enable A20. Put an upper limit on the amount of time we wait for the +# keyboard controller to get ready (65K x ISA access time). If +# we wait more than that amount, the hardware is probably +# legacy-free and simply doesn't have a keyboard controller. +# Thus, the A20 line is already enabled. +# +seta20: cli # Disable interrupts + xor %cx,%cx # Clear +seta20.1: inc %cx # Increment, overflow? + jz seta20.3 # Yes + in $0x64,%al # Get status + test $0x2,%al # Busy? + jnz seta20.1 # Yes + mov $0xd1,%al # Command: Write + out %al,$0x64 # output port +seta20.2: in $0x64,%al # Get status + test $0x2,%al # Busy? + jnz seta20.2 # Yes + mov $0xdf,%al # Enable + out %al,$0x60 # A20 +seta20.3: sti # Enable interrupts + ret # To caller + +# +# Convert AL to hex, saving the result to [EDI]. +# +hex8: pushl %eax # Save + shrb $0x4,%al # Do upper + call hex8.1 # 4 + popl %eax # Restore +hex8.1: andb $0xf,%al # Get lower 4 + cmpb $0xa,%al # Convert + sbbb $0x69,%al # to hex + das # digit + orb $0x20,%al # To lower case + stosb # Save char + ret # (Recursive) + +# +# BTX client to start btxldr +# + .code32 +btx_client: mov $(MEM_ARG_BTX-MEM_BTX_CLIENT+MEM_ARG_SIZE-4), %esi + # %ds:(%esi) -> end + # of boot[12] args + mov $(MEM_ARG_SIZE/4),%ecx # Number of words to push + std # Go backwards +push_arg: lodsl # Read argument + push %eax # Push it onto the stack + loop push_arg # Push all of the arguments + cld # In case anyone depends on this + pushl MEM_ARG_BTX-MEM_BTX_CLIENT+MEM_ARG_SIZE # Entry point of + # the loader + push %eax # Emulate a near call + mov $0x1,%eax # 'exec' system call + int $INT_SYS # BTX system call +btx_client_end: + .code16 + + .p2align 4 +# +# Global descriptor table. +# +gdt: .word 0x0,0x0,0x0,0x0 # Null entry + .word 0xffff,0x0,0x9200,0xcf # SEL_SDATA + .word 0xffff,0x0,0x9200,0x0 # SEL_RDATA + .word 0xffff,0x0,0x9a00,0xcf # SEL_SCODE (32-bit) + .word 0xffff,0x0,0x9a00,0x8f # SEL_SCODE16 (16-bit) +gdt.1: +# +# Pseudo-descriptors. +# +gdtdesc: .word gdt.1-gdt-1 # Limit + .long gdt # Base +# +# EDD Packet +# +edd_packet: .byte 0x10 # Length + .byte 0 # Reserved +edd_len: .byte 0x0 # Num to read + .byte 0 # Reserved +edd_addr: .word 0x0,0x0 # Seg:Off +edd_lba: .quad 0x0 # LBA + +drive: .byte 0 + +# +# State for searching dir +# +rec_lba: .long 0x0 # LBA (adjusted for EA) +rec_size: .long 0x0 # File size +name_len: .byte 0x0 # Length of current name + +twiddle_index: .byte 0x0 + +msg_welcome: .asciz "CD Loader 1.2\r\n\n" +msg_bootinfo: .asciz "Building the boot loader arguments\r\n" +msg_relocate: .asciz "Relocating the loader and the BTX\r\n" +msg_jump: .asciz "Starting the BTX loader\r\n" +msg_badread: .ascii "Read Error: 0x" +hex_error: .asciz "00\r\n" +msg_novd: .asciz "Could not find Primary Volume Descriptor\r\n" +msg_lookup: .asciz "Looking up " +msg_lookup2: .asciz "... " +msg_lookupok: .asciz "Found\r\n" +msg_lookupfail: .asciz "File not found\r\n" +msg_load2big: .asciz "File too big\r\n" +msg_failed: .asciz "Boot failed\r\n" +twiddle_chars: .ascii "|/-\\" +loader_paths: .asciz "/BOOT/LOADER" + .asciz "/boot/loader" + .byte 0 + Modified: stable/9/sys/boot/i386/pxeldr/Makefile ============================================================================== --- stable/9/sys/boot/i386/pxeldr/Makefile Fri Jun 29 10:08:31 2012 (r237760) +++ stable/9/sys/boot/i386/pxeldr/Makefile Fri Jun 29 10:10:16 2012 (r237761) @@ -23,6 +23,8 @@ CFLAGS+=-DPROBE_KEYBOARD CFLAGS+=-DALWAYS_SERIAL .endif +CFLAGS+=-I${.CURDIR}/../common + LOADERBIN= ${.OBJDIR}/../loader/loader.bin CLEANFILES+= ${BOOT}.tmp Modified: stable/9/sys/boot/i386/pxeldr/pxeldr.S ============================================================================== --- stable/9/sys/boot/i386/pxeldr/pxeldr.S Fri Jun 29 10:08:31 2012 (r237760) +++ stable/9/sys/boot/i386/pxeldr/pxeldr.S Fri Jun 29 10:10:16 2012 (r237761) @@ -26,6 +26,7 @@ */ #include +#include /* * Memory locations. @@ -50,11 +51,6 @@ .set AOUT_ENTRY,0x14 # entry point .set AOUT_HEADER,MEM_PAGE_SIZE # size of the a.out header /* - * Flags for kargs->bootflags - */ - .set KARGS_FLAGS_PXE,0x2 # flag to indicate booting from - # PXE loader -/* * Segment selectors. */ .set SEL_SDATA,0x8 # Supervisor data From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:10:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D0F37106564A; Fri, 29 Jun 2012 10:10:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B965A8FC08; Fri, 29 Jun 2012 10:10:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TAAhRk038686; Fri, 29 Jun 2012 10:10:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TAAh4j038681; Fri, 29 Jun 2012 10:10:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291010.q5TAAh4j038681@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237762 - in stable/8/sys/boot/i386: cdboot pxeldr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:10:44 -0000 Author: avg Date: Fri Jun 29 10:10:43 2012 New Revision: 237762 URL: http://svn.freebsd.org/changeset/base/237762 Log: MFC r235219: cdboot, pxeldr: make use of bootargs.h instead of redefining flag constants Added: stable/8/sys/boot/i386/cdboot/cdboot.S - copied unchanged from r235219, head/sys/boot/i386/cdboot/cdboot.S Deleted: stable/8/sys/boot/i386/cdboot/cdboot.s Modified: stable/8/sys/boot/i386/cdboot/Makefile stable/8/sys/boot/i386/pxeldr/Makefile stable/8/sys/boot/i386/pxeldr/pxeldr.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/i386/cdboot/Makefile ============================================================================== --- stable/8/sys/boot/i386/cdboot/Makefile Fri Jun 29 10:10:16 2012 (r237761) +++ stable/8/sys/boot/i386/cdboot/Makefile Fri Jun 29 10:10:43 2012 (r237762) @@ -4,7 +4,9 @@ PROG= cdboot STRIP= BINMODE=${NOBINMODE} NO_MAN= -SRCS= ${PROG}.s +SRCS= ${PROG}.S + +CFLAGS+=-I${.CURDIR}/../common ORG= 0x7c00 Copied: stable/8/sys/boot/i386/cdboot/cdboot.S (from r235219, head/sys/boot/i386/cdboot/cdboot.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/i386/cdboot/cdboot.S Fri Jun 29 10:10:43 2012 (r237762, copy of r235219, head/sys/boot/i386/cdboot/cdboot.S) @@ -0,0 +1,597 @@ +# +# Copyright (c) 2001 John Baldwin +# 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. +# 3. Neither the name of the author nor the names of any co-contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# 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 program is a freestanding boot program to load an a.out binary +# from a CD-ROM booted with no emulation mode as described by the El +# Torito standard. Due to broken BIOSen that do not load the desired +# number of sectors, we try to fit this in as small a space as possible. +# +# Basically, we first create a set of boot arguments to pass to the loaded +# binary. Then we attempt to load /boot/loader from the CD we were booted +# off of. +# + +#include + +# +# Memory locations. +# + .set MEM_PAGE_SIZE,0x1000 # memory page size, 4k + .set MEM_ARG,0x900 # Arguments at start + .set MEM_ARG_BTX,0xa100 # Where we move them to so the + # BTX client can see them + .set MEM_ARG_SIZE,0x18 # Size of the arguments + .set MEM_BTX_ADDRESS,0x9000 # where BTX lives + .set MEM_BTX_ENTRY,0x9010 # where BTX starts to execute + .set MEM_BTX_OFFSET,MEM_PAGE_SIZE # offset of BTX in the loader + .set MEM_BTX_CLIENT,0xa000 # where BTX clients live +# +# a.out header fields +# + .set AOUT_TEXT,0x04 # text segment size + .set AOUT_DATA,0x08 # data segment size + .set AOUT_BSS,0x0c # zero'd BSS size + .set AOUT_SYMBOLS,0x10 # symbol table + .set AOUT_ENTRY,0x14 # entry point + .set AOUT_HEADER,MEM_PAGE_SIZE # size of the a.out header +# +# Segment selectors. +# + .set SEL_SDATA,0x8 # Supervisor data + .set SEL_RDATA,0x10 # Real mode data + .set SEL_SCODE,0x18 # PM-32 code + .set SEL_SCODE16,0x20 # PM-16 code +# +# BTX constants +# + .set INT_SYS,0x30 # BTX syscall interrupt +# +# Constants for reading from the CD. +# + .set ERROR_TIMEOUT,0x80 # BIOS timeout on read + .set NUM_RETRIES,3 # Num times to retry + .set SECTOR_SIZE,0x800 # size of a sector + .set SECTOR_SHIFT,11 # number of place to shift + .set BUFFER_LEN,0x100 # number of sectors in buffer + .set MAX_READ,0x10000 # max we can read at a time + .set MAX_READ_SEC,MAX_READ >> SECTOR_SHIFT + .set MEM_READ_BUFFER,0x9000 # buffer to read from CD + .set MEM_VOLDESC,MEM_READ_BUFFER # volume descriptor + .set MEM_DIR,MEM_VOLDESC+SECTOR_SIZE # Lookup buffer + .set VOLDESC_LBA,0x10 # LBA of vol descriptor + .set VD_PRIMARY,1 # Primary VD + .set VD_END,255 # VD Terminator + .set VD_ROOTDIR,156 # Offset of Root Dir Record + .set DIR_LEN,0 # Offset of Dir Record length + .set DIR_EA_LEN,1 # Offset of EA length + .set DIR_EXTENT,2 # Offset of 64-bit LBA + .set DIR_SIZE,10 # Offset of 64-bit length + .set DIR_NAMELEN,32 # Offset of 8-bit name len + .set DIR_NAME,33 # Offset of dir name +# +# We expect to be loaded by the BIOS at 0x7c00 (standard boot loader entry +# point) +# + .code16 + .globl start + .org 0x0, 0x0 +# +# Program start. +# +start: cld # string ops inc + xor %ax,%ax # zero %ax + mov %ax,%ss # setup the + mov $start,%sp # stack + mov %ax,%ds # setup the + mov %ax,%es # data segments + mov %dl,drive # Save BIOS boot device + mov $msg_welcome,%si # %ds:(%si) -> welcome message + call putstr # display the welcome message +# +# Setup the arguments that the loader is expecting from boot[12] +# + mov $msg_bootinfo,%si # %ds:(%si) -> boot args message + call putstr # display the message + mov $MEM_ARG,%bx # %ds:(%bx) -> boot args + mov %bx,%di # %es:(%di) -> boot args + xor %eax,%eax # zero %eax + mov $(MEM_ARG_SIZE/4),%cx # Size of arguments in 32-bit + # dwords + rep # Clear the arguments + stosl # to zero + mov drive,%dl # Store BIOS boot device + mov %dl,0x4(%bx) # in kargs->bootdev + or $KARGS_FLAGS_CD,0x8(%bx) # kargs->bootflags |= + # KARGS_FLAGS_CD +# +# Load Volume Descriptor +# + mov $VOLDESC_LBA,%eax # Set LBA of first VD +load_vd: push %eax # Save %eax + mov $1,%dh # One sector + mov $MEM_VOLDESC,%ebx # Destination + call read # Read it in + cmpb $VD_PRIMARY,(%bx) # Primary VD? + je have_vd # Yes + pop %eax # Prepare to + inc %eax # try next + cmpb $VD_END,(%bx) # Last VD? + jne load_vd # No, read next + mov $msg_novd,%si # No VD + jmp error # Halt +have_vd: # Have Primary VD +# +# Try to look up the loader binary using the paths in the loader_paths +# array. +# + mov $loader_paths,%si # Point to start of array +lookup_path: push %si # Save file name pointer + call lookup # Try to find file + pop %di # Restore file name pointer + jnc lookup_found # Found this file + xor %al,%al # Look for next + mov $0xffff,%cx # path name by + repnz # scanning for + scasb # nul char + mov %di,%si # Point %si at next path + mov (%si),%al # Get first char of next path + or %al,%al # Is it double nul? + jnz lookup_path # No, try it. + mov $msg_failed,%si # Failed message + jmp error # Halt +lookup_found: # Found a loader file +# +# Load the binary into the buffer. Due to real mode addressing limitations +# we have to read it in 64k chunks. +# + mov DIR_SIZE(%bx),%eax # Read file length + add $SECTOR_SIZE-1,%eax # Convert length to sectors + shr $SECTOR_SHIFT,%eax + cmp $BUFFER_LEN,%eax + jbe load_sizeok + mov $msg_load2big,%si # Error message + call error +load_sizeok: movzbw %al,%cx # Num sectors to read + mov DIR_EXTENT(%bx),%eax # Load extent + xor %edx,%edx + mov DIR_EA_LEN(%bx),%dl + add %edx,%eax # Skip extended + mov $MEM_READ_BUFFER,%ebx # Read into the buffer +load_loop: mov %cl,%dh + cmp $MAX_READ_SEC,%cl # Truncate to max read size + jbe load_notrunc + mov $MAX_READ_SEC,%dh +load_notrunc: sub %dh,%cl # Update count + push %eax # Save + call read # Read it in + pop %eax # Restore + add $MAX_READ_SEC,%eax # Update LBA + add $MAX_READ,%ebx # Update dest addr + jcxz load_done # Done? + jmp load_loop # Keep going +load_done: +# +# Turn on the A20 address line +# + call seta20 # Turn A20 on +# +# Relocate the loader and BTX using a very lazy protected mode +# + mov $msg_relocate,%si # Display the + call putstr # relocation message + mov MEM_READ_BUFFER+AOUT_ENTRY,%edi # %edi is the destination + mov $(MEM_READ_BUFFER+AOUT_HEADER),%esi # %esi is + # the start of the text + # segment + mov MEM_READ_BUFFER+AOUT_TEXT,%ecx # %ecx = length of the text + # segment + push %edi # Save entry point for later + lgdt gdtdesc # setup our own gdt + cli # turn off interrupts + mov %cr0,%eax # Turn on + or $0x1,%al # protected + mov %eax,%cr0 # mode + ljmp $SEL_SCODE,$pm_start # long jump to clear the + # instruction pre-fetch queue + .code32 +pm_start: mov $SEL_SDATA,%ax # Initialize + mov %ax,%ds # %ds and + mov %ax,%es # %es to a flat selector + rep # Relocate the + movsb # text segment + add $(MEM_PAGE_SIZE - 1),%edi # pad %edi out to a new page + and $~(MEM_PAGE_SIZE - 1),%edi # for the data segment + mov MEM_READ_BUFFER+AOUT_DATA,%ecx # size of the data segment + rep # Relocate the + movsb # data segment + mov MEM_READ_BUFFER+AOUT_BSS,%ecx # size of the bss + xor %eax,%eax # zero %eax + add $3,%cl # round %ecx up to + shr $2,%ecx # a multiple of 4 + rep # zero the + stosl # bss + mov MEM_READ_BUFFER+AOUT_ENTRY,%esi # %esi -> relocated loader + add $MEM_BTX_OFFSET,%esi # %esi -> BTX in the loader + mov $MEM_BTX_ADDRESS,%edi # %edi -> where BTX needs to go + movzwl 0xa(%esi),%ecx # %ecx -> length of BTX + rep # Relocate + movsb # BTX + ljmp $SEL_SCODE16,$pm_16 # Jump to 16-bit PM + .code16 +pm_16: mov $SEL_RDATA,%ax # Initialize + mov %ax,%ds # %ds and + mov %ax,%es # %es to a real mode selector + mov %cr0,%eax # Turn off + and $~0x1,%al # protected + mov %eax,%cr0 # mode + ljmp $0,$pm_end # Long jump to clear the + # instruction pre-fetch queue +pm_end: sti # Turn interrupts back on now +# +# Copy the BTX client to MEM_BTX_CLIENT +# + xor %ax,%ax # zero %ax and set + mov %ax,%ds # %ds and %es + mov %ax,%es # to segment 0 + mov $MEM_BTX_CLIENT,%di # Prepare to relocate + mov $btx_client,%si # the simple btx client + mov $(btx_client_end-btx_client),%cx # length of btx client + rep # Relocate the + movsb # simple BTX client +# +# Copy the boot[12] args to where the BTX client can see them +# + mov $MEM_ARG,%si # where the args are at now + mov $MEM_ARG_BTX,%di # where the args are moving to + mov $(MEM_ARG_SIZE/4),%cx # size of the arguments in longs + rep # Relocate + movsl # the words +# +# Save the entry point so the client can get to it later on +# + pop %eax # Restore saved entry point + stosl # and add it to the end of + # the arguments +# +# Now we just start up BTX and let it do the rest +# + mov $msg_jump,%si # Display the + call putstr # jump message + ljmp $0,$MEM_BTX_ENTRY # Jump to the BTX entry point + +# +# Lookup the file in the path at [SI] from the root directory. +# +# Trashes: All but BX +# Returns: CF = 0 (success), BX = pointer to record +# CF = 1 (not found) +# +lookup: mov $VD_ROOTDIR+MEM_VOLDESC,%bx # Root directory record + push %si + mov $msg_lookup,%si # Display lookup message + call putstr + pop %si + push %si + call putstr + mov $msg_lookup2,%si + call putstr + pop %si +lookup_dir: lodsb # Get first char of path + cmp $0,%al # Are we done? + je lookup_done # Yes + cmp $'/',%al # Skip path separator. + je lookup_dir + dec %si # Undo lodsb side effect + call find_file # Lookup first path item + jnc lookup_dir # Try next component + mov $msg_lookupfail,%si # Not found message + call putstr + stc # Set carry + ret + jmp error +lookup_done: mov $msg_lookupok,%si # Success message + call putstr + clc # Clear carry + ret + +# +# Lookup file at [SI] in directory whose record is at [BX]. +# +# Trashes: All but returns +# Returns: CF = 0 (success), BX = pointer to record, SI = next path item +# CF = 1 (not found), SI = preserved +# +find_file: mov DIR_EXTENT(%bx),%eax # Load extent + xor %edx,%edx + mov DIR_EA_LEN(%bx),%dl + add %edx,%eax # Skip extended attributes + mov %eax,rec_lba # Save LBA + mov DIR_SIZE(%bx),%eax # Save size + mov %eax,rec_size + xor %cl,%cl # Zero length + push %si # Save +ff.namelen: inc %cl # Update length + lodsb # Read char + cmp $0,%al # Nul? + je ff.namedone # Yes + cmp $'/',%al # Path separator? + jnz ff.namelen # No, keep going +ff.namedone: dec %cl # Adjust length and save + mov %cl,name_len + pop %si # Restore +ff.load: mov rec_lba,%eax # Load LBA + mov $MEM_DIR,%ebx # Address buffer + mov $1,%dh # One sector + call read # Read directory block + incl rec_lba # Update LBA to next block +ff.scan: mov %ebx,%edx # Check for EOF + sub $MEM_DIR,%edx + cmp %edx,rec_size + ja ff.scan.1 + stc # EOF reached + ret +ff.scan.1: cmpb $0,DIR_LEN(%bx) # Last record in block? + je ff.nextblock + push %si # Save + movzbw DIR_NAMELEN(%bx),%si # Find end of string +ff.checkver: cmpb $'0',DIR_NAME-1(%bx,%si) # Less than '0'? + jb ff.checkver.1 + cmpb $'9',DIR_NAME-1(%bx,%si) # Greater than '9'? + ja ff.checkver.1 + dec %si # Next char + jnz ff.checkver + jmp ff.checklen # All numbers in name, so + # no version +ff.checkver.1: movzbw DIR_NAMELEN(%bx),%cx + cmp %cx,%si # Did we find any digits? + je ff.checkdot # No + cmpb $';',DIR_NAME-1(%bx,%si) # Check for semicolon + jne ff.checkver.2 + dec %si # Skip semicolon + mov %si,%cx + mov %cl,DIR_NAMELEN(%bx) # Adjust length + jmp ff.checkdot +ff.checkver.2: mov %cx,%si # Restore %si to end of string +ff.checkdot: cmpb $'.',DIR_NAME-1(%bx,%si) # Trailing dot? + jne ff.checklen # No + decb DIR_NAMELEN(%bx) # Adjust length +ff.checklen: pop %si # Restore + movzbw name_len,%cx # Load length of name + cmp %cl,DIR_NAMELEN(%bx) # Does length match? + je ff.checkname # Yes, check name +ff.nextrec: add DIR_LEN(%bx),%bl # Next record + adc $0,%bh + jmp ff.scan +ff.nextblock: subl $SECTOR_SIZE,rec_size # Adjust size + jnc ff.load # If subtract ok, keep going + ret # End of file, so not found +ff.checkname: lea DIR_NAME(%bx),%di # Address name in record + push %si # Save + repe cmpsb # Compare name + je ff.match # We have a winner! + pop %si # Restore + jmp ff.nextrec # Keep looking. +ff.match: add $2,%sp # Discard saved %si + clc # Clear carry + ret + +# +# Load DH sectors starting at LBA EAX into [EBX]. +# +# Trashes: EAX +# +read: push %si # Save + push %cx # Save since some BIOSs trash + mov %eax,edd_lba # LBA to read from + mov %ebx,%eax # Convert address + shr $4,%eax # to segment + mov %ax,edd_addr+0x2 # and store +read.retry: call twiddle # Entertain the user + push %dx # Save + mov $edd_packet,%si # Address Packet + mov %dh,edd_len # Set length + mov drive,%dl # BIOS Device + mov $0x42,%ah # BIOS: Extended Read + int $0x13 # Call BIOS + pop %dx # Restore + jc read.fail # Worked? + pop %cx # Restore + pop %si + ret # Return +read.fail: cmp $ERROR_TIMEOUT,%ah # Timeout? + je read.retry # Yes, Retry. +read.error: mov %ah,%al # Save error + mov $hex_error,%di # Format it + call hex8 # as hex + mov $msg_badread,%si # Display Read error message + +# +# Display error message at [SI] and halt. +# +error: call putstr # Display message +halt: hlt + jmp halt # Spin + +# +# Display a null-terminated string. +# +# Trashes: AX, SI +# +putstr: push %bx # Save +putstr.load: lodsb # load %al from %ds:(%si) + test %al,%al # stop at null + jnz putstr.putc # if the char != null, output it + pop %bx # Restore + ret # return when null is hit +putstr.putc: call putc # output char + jmp putstr.load # next char + +# +# Display a single char. +# +putc: mov $0x7,%bx # attribute for output + mov $0xe,%ah # BIOS: put_char + int $0x10 # call BIOS, print char in %al + ret # Return to caller + +# +# Output the "twiddle" +# +twiddle: push %ax # Save + push %bx # Save + mov twiddle_index,%al # Load index + mov $twiddle_chars,%bx # Address table + inc %al # Next + and $3,%al # char + mov %al,twiddle_index # Save index for next call + xlat # Get char + call putc # Output it + mov $8,%al # Backspace + call putc # Output it + pop %bx # Restore + pop %ax # Restore + ret + +# +# Enable A20. Put an upper limit on the amount of time we wait for the +# keyboard controller to get ready (65K x ISA access time). If +# we wait more than that amount, the hardware is probably +# legacy-free and simply doesn't have a keyboard controller. +# Thus, the A20 line is already enabled. +# +seta20: cli # Disable interrupts + xor %cx,%cx # Clear +seta20.1: inc %cx # Increment, overflow? + jz seta20.3 # Yes + in $0x64,%al # Get status + test $0x2,%al # Busy? + jnz seta20.1 # Yes + mov $0xd1,%al # Command: Write + out %al,$0x64 # output port +seta20.2: in $0x64,%al # Get status + test $0x2,%al # Busy? + jnz seta20.2 # Yes + mov $0xdf,%al # Enable + out %al,$0x60 # A20 +seta20.3: sti # Enable interrupts + ret # To caller + +# +# Convert AL to hex, saving the result to [EDI]. +# +hex8: pushl %eax # Save + shrb $0x4,%al # Do upper + call hex8.1 # 4 + popl %eax # Restore +hex8.1: andb $0xf,%al # Get lower 4 + cmpb $0xa,%al # Convert + sbbb $0x69,%al # to hex + das # digit + orb $0x20,%al # To lower case + stosb # Save char + ret # (Recursive) + +# +# BTX client to start btxldr +# + .code32 +btx_client: mov $(MEM_ARG_BTX-MEM_BTX_CLIENT+MEM_ARG_SIZE-4), %esi + # %ds:(%esi) -> end + # of boot[12] args + mov $(MEM_ARG_SIZE/4),%ecx # Number of words to push + std # Go backwards +push_arg: lodsl # Read argument + push %eax # Push it onto the stack + loop push_arg # Push all of the arguments + cld # In case anyone depends on this + pushl MEM_ARG_BTX-MEM_BTX_CLIENT+MEM_ARG_SIZE # Entry point of + # the loader + push %eax # Emulate a near call + mov $0x1,%eax # 'exec' system call + int $INT_SYS # BTX system call +btx_client_end: + .code16 + + .p2align 4 +# +# Global descriptor table. +# +gdt: .word 0x0,0x0,0x0,0x0 # Null entry + .word 0xffff,0x0,0x9200,0xcf # SEL_SDATA + .word 0xffff,0x0,0x9200,0x0 # SEL_RDATA + .word 0xffff,0x0,0x9a00,0xcf # SEL_SCODE (32-bit) + .word 0xffff,0x0,0x9a00,0x8f # SEL_SCODE16 (16-bit) +gdt.1: +# +# Pseudo-descriptors. +# +gdtdesc: .word gdt.1-gdt-1 # Limit + .long gdt # Base +# +# EDD Packet +# +edd_packet: .byte 0x10 # Length + .byte 0 # Reserved +edd_len: .byte 0x0 # Num to read + .byte 0 # Reserved +edd_addr: .word 0x0,0x0 # Seg:Off +edd_lba: .quad 0x0 # LBA + +drive: .byte 0 + +# +# State for searching dir +# +rec_lba: .long 0x0 # LBA (adjusted for EA) +rec_size: .long 0x0 # File size +name_len: .byte 0x0 # Length of current name + +twiddle_index: .byte 0x0 + +msg_welcome: .asciz "CD Loader 1.2\r\n\n" +msg_bootinfo: .asciz "Building the boot loader arguments\r\n" +msg_relocate: .asciz "Relocating the loader and the BTX\r\n" +msg_jump: .asciz "Starting the BTX loader\r\n" +msg_badread: .ascii "Read Error: 0x" +hex_error: .asciz "00\r\n" +msg_novd: .asciz "Could not find Primary Volume Descriptor\r\n" +msg_lookup: .asciz "Looking up " +msg_lookup2: .asciz "... " +msg_lookupok: .asciz "Found\r\n" +msg_lookupfail: .asciz "File not found\r\n" +msg_load2big: .asciz "File too big\r\n" +msg_failed: .asciz "Boot failed\r\n" +twiddle_chars: .ascii "|/-\\" +loader_paths: .asciz "/BOOT/LOADER" + .asciz "/boot/loader" + .byte 0 + Modified: stable/8/sys/boot/i386/pxeldr/Makefile ============================================================================== --- stable/8/sys/boot/i386/pxeldr/Makefile Fri Jun 29 10:10:16 2012 (r237761) +++ stable/8/sys/boot/i386/pxeldr/Makefile Fri Jun 29 10:10:43 2012 (r237762) @@ -23,6 +23,8 @@ CFLAGS+=-DPROBE_KEYBOARD CFLAGS+=-DALWAYS_SERIAL .endif +CFLAGS+=-I${.CURDIR}/../common + LOADERBIN= ${.OBJDIR}/../loader/loader.bin CLEANFILES+= ${BOOT}.tmp Modified: stable/8/sys/boot/i386/pxeldr/pxeldr.S ============================================================================== --- stable/8/sys/boot/i386/pxeldr/pxeldr.S Fri Jun 29 10:10:16 2012 (r237761) +++ stable/8/sys/boot/i386/pxeldr/pxeldr.S Fri Jun 29 10:10:43 2012 (r237762) @@ -26,6 +26,7 @@ */ #include +#include /* * Memory locations. @@ -50,11 +51,6 @@ .set AOUT_ENTRY,0x14 # entry point .set AOUT_HEADER,MEM_PAGE_SIZE # size of the a.out header /* - * Flags for kargs->bootflags - */ - .set KARGS_FLAGS_PXE,0x2 # flag to indicate booting from - # PXE loader -/* * Segment selectors. */ .set SEL_SDATA,0x8 # Supervisor data From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:12:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF28A1065673; Fri, 29 Jun 2012 10:12:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C63498FC18; Fri, 29 Jun 2012 10:12:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TACI6x038842; Fri, 29 Jun 2012 10:12:18 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TACIxk038832; Fri, 29 Jun 2012 10:12:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291012.q5TACIxk038832@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237763 - in stable/9/sys/boot/pc98: btx/btx btx/btxldr btx/lib cdboot loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:12:19 -0000 Author: avg Date: Fri Jun 29 10:12:18 2012 New Revision: 237763 URL: http://svn.freebsd.org/changeset/base/237763 Log: MFC r235264: MFi386: improve argument passing via btxldr Added: stable/9/sys/boot/pc98/btx/lib/btxcsu.S - copied unchanged from r235264, head/sys/boot/pc98/btx/lib/btxcsu.S stable/9/sys/boot/pc98/cdboot/cdboot.S - copied unchanged from r235264, head/sys/boot/pc98/cdboot/cdboot.S Deleted: stable/9/sys/boot/pc98/btx/lib/btxcsu.s stable/9/sys/boot/pc98/cdboot/cdboot.s Modified: stable/9/sys/boot/pc98/btx/btx/Makefile stable/9/sys/boot/pc98/btx/btx/btx.S stable/9/sys/boot/pc98/btx/btxldr/Makefile stable/9/sys/boot/pc98/btx/btxldr/btxldr.S stable/9/sys/boot/pc98/btx/lib/Makefile stable/9/sys/boot/pc98/cdboot/Makefile stable/9/sys/boot/pc98/loader/main.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/pc98/btx/btx/Makefile ============================================================================== --- stable/9/sys/boot/pc98/btx/btx/Makefile Fri Jun 29 10:10:43 2012 (r237762) +++ stable/9/sys/boot/pc98/btx/btx/Makefile Fri Jun 29 10:12:18 2012 (r237763) @@ -12,6 +12,7 @@ BOOT_BTX_FLAGS=0x0 .endif CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} +CFLAGS+=-I${.CURDIR}/../../../i386/common .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x238 Modified: stable/9/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/9/sys/boot/pc98/btx/btx/btx.S Fri Jun 29 10:10:43 2012 (r237762) +++ stable/9/sys/boot/pc98/btx/btx/btx.S Fri Jun 29 10:12:18 2012 (r237763) @@ -15,6 +15,8 @@ * $FreeBSD$ */ +#include + /* * Memory layout. */ @@ -205,7 +207,7 @@ init.8: xorl %ecx,%ecx # Zero andl $0x7,%eax incl %eax shll $0x11,%eax # To bytes - subl $0x1000,%eax # Less arg space + subl $ARGSPACE,%eax # Less arg space subl %edx,%eax # Less base movb $SEL_UDATA,%cl # User data selector pushl %ecx # Set SS Modified: stable/9/sys/boot/pc98/btx/btxldr/Makefile ============================================================================== --- stable/9/sys/boot/pc98/btx/btxldr/Makefile Fri Jun 29 10:10:43 2012 (r237762) +++ stable/9/sys/boot/pc98/btx/btxldr/Makefile Fri Jun 29 10:12:18 2012 (r237763) @@ -6,6 +6,7 @@ NO_MAN= SRCS= btxldr.S CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS} +CFLAGS+=-I${.CURDIR}/../../../i386/common .if defined(BTXLDR_VERBOSE) CFLAGS+=-DBTXLDR_VERBOSE Modified: stable/9/sys/boot/pc98/btx/btxldr/btxldr.S ============================================================================== --- stable/9/sys/boot/pc98/btx/btxldr/btxldr.S Fri Jun 29 10:10:43 2012 (r237762) +++ stable/9/sys/boot/pc98/btx/btxldr/btxldr.S Fri Jun 29 10:12:18 2012 (r237763) @@ -20,6 +20,8 @@ * real thing should probably be more flexible, and in C. */ +#include + /* * Memory locations. */ @@ -105,7 +107,7 @@ gdcwait.2: inb $0x60,%al call hexout # stack call putstr # pointer movl $m_args,%esi # Format string - leal 0x4(%esp,1),%ebx # First argument + leal 0x4(%esp),%ebx # First argument movl $0x6,%ecx # Count start.1: movl (%ebx),%eax # Get argument and addl $0x4,%ebx # bump pointer @@ -113,24 +115,28 @@ start.1: movl (%ebx),%eax # Get argumen loop start.1 # Till done call putstr # End message #endif - movl $0x48,%ecx # Allocate space - subl %ecx,%ebp # for bootinfo - movl 0x18(%esp,1),%esi # Source: bootinfo + movl BA_BOOTINFO+4(%esp),%esi # Source: bootinfo cmpl $0x0, %esi # If the bootinfo pointer je start_null_bi # is null, don't copy it + movl BI_SIZE(%esi),%ecx # Allocate space + subl %ecx,%ebp # for bootinfo movl %ebp,%edi # Destination rep # Copy movsb # it - movl %ebp,0x18(%esp,1) # Update pointer + movl %ebp,BA_BOOTINFO+4(%esp) # Update pointer + movl %edi,%ebp # Restore base pointer #ifdef BTXLDR_VERBOSE movl $m_rel_bi,%esi # Display movl %ebp,%eax # bootinfo call hexout # relocation call putstr # message #endif -start_null_bi: movl $0x18,%ecx # Allocate space - subl %ecx,%ebp # for arguments - leal 0x4(%esp,1),%esi # Source +start_null_bi: movl $BOOTARGS_SIZE,%ecx # Fixed size of arguments + testl $KARGS_FLAGS_EXTARG, BA_BOOTFLAGS+4(%esp) # Check for extra data + jz start_fixed # Skip if the flag is not set + addl BOOTARGS_SIZE+4(%esp),%ecx # Add size of variable args +start_fixed: subl $ARGOFF,%ebp # Place args at fixed offset + leal 0x4(%esp),%esi # Source movl %ebp,%edi # Destination rep # Copy movsb # them Modified: stable/9/sys/boot/pc98/btx/lib/Makefile ============================================================================== --- stable/9/sys/boot/pc98/btx/lib/Makefile Fri Jun 29 10:10:43 2012 (r237762) +++ stable/9/sys/boot/pc98/btx/lib/Makefile Fri Jun 29 10:12:18 2012 (r237763) @@ -3,7 +3,8 @@ PROG= crt0.o INTERNALPROG= NO_MAN= -SRCS= btxcsu.s btxsys.s btxv86.s +SRCS= btxcsu.S btxsys.s btxv86.s +CFLAGS+=-I${.CURDIR}/../../../i386/common LDFLAGS=-Wl,-r .include Copied: stable/9/sys/boot/pc98/btx/lib/btxcsu.S (from r235264, head/sys/boot/pc98/btx/lib/btxcsu.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/boot/pc98/btx/lib/btxcsu.S Fri Jun 29 10:12:18 2012 (r237763, copy of r235264, head/sys/boot/pc98/btx/lib/btxcsu.S) @@ -0,0 +1,49 @@ +# +# Copyright (c) 1998 Robert Nordier +# All rights reserved. +# +# Redistribution and use in source and binary forms are freely +# permitted provided that the above copyright notice and this +# paragraph and the following disclaimer are duplicated in all +# such forms. +# +# This software is provided "AS IS" and without any express or +# implied warranties, including, without limitation, the implied +# warranties of merchantability and fitness for a particular +# purpose. +# + +# $FreeBSD$ + +# +# BTX C startup code (ELF). +# + +#include + +# +# Globals. +# + .global _start +# +# Client entry point. +# +_start: cld + pushl %eax + movl $_edata,%edi + movl $_end,%ecx + subl %edi, %ecx + xorb %al, %al + rep + stosb + popl __base + movl %esp,%eax # Set + addl $ARGADJ,%eax # argument + movl %eax,__args # pointer + call main # Invoke client main() + call exit # Invoke client exit() +# +# Data. +# + .comm __base,4 # Client base address + .comm __args,4 # Client arguments Modified: stable/9/sys/boot/pc98/cdboot/Makefile ============================================================================== --- stable/9/sys/boot/pc98/cdboot/Makefile Fri Jun 29 10:10:43 2012 (r237762) +++ stable/9/sys/boot/pc98/cdboot/Makefile Fri Jun 29 10:12:18 2012 (r237763) @@ -4,7 +4,9 @@ PROG= cdboot STRIP= BINMODE=${NOBINMODE} NO_MAN= -SRCS= ${PROG}.s +SRCS= ${PROG}.S + +CFLAGS+=-I${.CURDIR}/../../i386/common ORG= 0x0000 Copied: stable/9/sys/boot/pc98/cdboot/cdboot.S (from r235264, head/sys/boot/pc98/cdboot/cdboot.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/boot/pc98/cdboot/cdboot.S Fri Jun 29 10:12:18 2012 (r237763, copy of r235264, head/sys/boot/pc98/cdboot/cdboot.S) @@ -0,0 +1,808 @@ +# +# Copyright (c) 2006 TAKAHASHI Yoshihiro +# Copyright (c) 2001 John Baldwin +# 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. +# 3. Neither the name of the author nor the names of any co-contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# $FreeBSD$ + +#include + +# +# Basically, we first create a set of boot arguments to pass to the loaded +# binary. Then we attempt to load /boot/loader from the CD we were booted +# off of. +# + +# +# Memory locations. +# + .set STACK_OFF,0x6000 # Stack offset + .set LOAD_SEG,0x0700 # Load segment + .set LOAD_SIZE,2048 # Load size + .set DAUA,0x0584 # DA/UA + + .set MEM_PAGE_SIZE,0x1000 # memory page size, 4k + .set MEM_ARG,0x900 # Arguments at start + .set MEM_ARG_BTX,0xa100 # Where we move them to so the + # BTX client can see them + .set MEM_ARG_SIZE,0x18 # Size of the arguments + .set MEM_BTX_ADDRESS,0x9000 # where BTX lives + .set MEM_BTX_ENTRY,0x9010 # where BTX starts to execute + .set MEM_BTX_OFFSET,MEM_PAGE_SIZE # offset of BTX in the loader + .set MEM_BTX_CLIENT,0xa000 # where BTX clients live +# +# PC98 machine type from sys/pc98/pc98/pc98_machdep.h +# + .set MEM_SYS, 0xa100 # System common area segment + .set PC98_MACHINE_TYPE, 0x0620 # PC98 machine type + .set EPSON_ID, 0x0624 # EPSON machine id + + .set M_NEC_PC98, 0x0001 + .set M_EPSON_PC98, 0x0002 + .set M_NOT_H98, 0x0010 + .set M_H98, 0x0020 + .set M_NOTE, 0x0040 + .set M_NORMAL, 0x1000 + .set M_8M, 0x8000 +# +# Signature Constants +# + .set SIG1_OFF,0x1fe # Signature offset + .set SIG2_OFF,0x7fe # Signature offset +# +# a.out header fields +# + .set AOUT_TEXT,0x04 # text segment size + .set AOUT_DATA,0x08 # data segment size + .set AOUT_BSS,0x0c # zero'd BSS size + .set AOUT_SYMBOLS,0x10 # symbol table + .set AOUT_ENTRY,0x14 # entry point + .set AOUT_HEADER,MEM_PAGE_SIZE # size of the a.out header +# +# Segment selectors. +# + .set SEL_SDATA,0x8 # Supervisor data + .set SEL_RDATA,0x10 # Real mode data + .set SEL_SCODE,0x18 # PM-32 code + .set SEL_SCODE16,0x20 # PM-16 code +# +# BTX constants +# + .set INT_SYS,0x30 # BTX syscall interrupt +# +# Constants for reading from the CD. +# + .set ERROR_TIMEOUT,0x90 # BIOS timeout on read + .set NUM_RETRIES,3 # Num times to retry + .set SECTOR_SIZE,0x800 # size of a sector + .set SECTOR_SHIFT,11 # number of place to shift + .set BUFFER_LEN,0x100 # number of sectors in buffer + .set MAX_READ,0xf800 # max we can read at a time + .set MAX_READ_SEC,MAX_READ >> SECTOR_SHIFT + .set MEM_READ_BUFFER,0x9000 # buffer to read from CD + .set MEM_VOLDESC,MEM_READ_BUFFER # volume descriptor + .set MEM_DIR,MEM_VOLDESC+SECTOR_SIZE # Lookup buffer + .set VOLDESC_LBA,0x10 # LBA of vol descriptor + .set VD_PRIMARY,1 # Primary VD + .set VD_END,255 # VD Terminator + .set VD_ROOTDIR,156 # Offset of Root Dir Record + .set DIR_LEN,0 # Offset of Dir Record length + .set DIR_EA_LEN,1 # Offset of EA length + .set DIR_EXTENT,2 # Offset of 64-bit LBA + .set DIR_SIZE,10 # Offset of 64-bit length + .set DIR_NAMELEN,32 # Offset of 8-bit name len + .set DIR_NAME,33 # Offset of dir name + +# +# Program start. +# + .code16 + .globl start + +start: jmp main + + .org 4 + .ascii "IPL1 " + +main: cld + + /* Setup the stack */ + xor %ax,%ax + mov %ax,%ss + mov $STACK_OFF,%sp + + push %ecx + + /* Setup graphic screen */ + mov $0x42,%ah # 640x400 + mov $0xc0,%ch + int $0x18 + mov $0x40,%ah # graph on + int $0x18 + + /* Setup text screen */ + mov $0x0a00,%ax # 80x25 + int $0x18 + mov $0x0c,%ah # text on + int $0x18 + mov $0x13,%ah # cursor home + xor %dx,%dx + int $0x18 + mov $0x11,%ah # cursor on + int $0x18 + + /* Setup keyboard */ + mov $0x03,%ah + int $0x18 + + /* Transfer PC-9801 system common area */ + xor %ax,%ax + mov %ax,%si + mov %ax,%ds + mov %ax,%di + mov $MEM_SYS,%ax + mov %ax,%es + mov $0x0600,%cx + rep + movsb + + /* Transfer EPSON machine type */ + mov $0xfd00,%ax + mov %ax,%ds + mov (0x804),%eax + and $0x00ffffff,%eax + mov %eax,%es:(EPSON_ID) + + /* Set machine type to PC98_SYSTEM_PARAMETER */ + call machine_check + + /* Load cdboot */ + xor %ax,%ax + mov %ax,%ds + mov $0x06,%ah /* Read data */ + mov (DAUA),%al /* Read drive */ + pop %ecx /* cylinder */ + xor %dx,%dx /* head / sector */ + mov $LOAD_SEG,%bx /* Load address */ + mov %bx,%es + xor %bp,%bp + mov $LOAD_SIZE,%bx /* Load size */ + int $0x1b + mov $msg_readerr,%si + jc error + + /* Jump to cdboot */ + ljmp $LOAD_SEG,$cdboot + +# +# Set machine type to PC98_SYSTEM_PARAMETER. +# +machine_check: xor %edx,%edx + mov %dx,%ds + mov $MEM_SYS,%ax + mov %ax,%es + + /* Wait V-SYNC */ +vsync.1: inb $0x60,%al + test $0x20,%al + jnz vsync.1 +vsync.2: inb $0x60,%al + test $0x20,%al + jz vsync.2 + + /* ANK 'A' font */ + xor %al,%al + outb %al,$0xa1 + mov $0x41,%al + outb %al,$0xa3 + + /* Get 'A' font from CG window */ + push %ds + mov $0xa400,%ax + mov %ax,%ds + xor %eax,%eax + xor %bx,%bx + mov $4,%cx +font.1: add (%bx),%eax + add $4,%bx + loop font.1 + pop %ds + cmp $0x6efc58fc,%eax + jnz m_epson + +m_pc98: or $M_NEC_PC98,%edx + mov $0x0458,%bx + mov (%bx),%al + test $0x80,%al + jz m_not_h98 + or $M_H98,%edx + jmp 1f +m_epson: or $M_EPSON_PC98,%edx +m_not_h98: or $M_NOT_H98,%edx + +1: inb $0x42,%al + test $0x20,%al + jz 1f + or $M_8M,%edx + +1: mov $0x0400,%bx + mov (%bx),%al + test $0x80,%al + jz 1f + or $M_NOTE,%edx + +1: mov $PC98_MACHINE_TYPE,%bx + mov %edx,%es:(%bx) + ret + +# +# Print out the error message at [SI], wait for a keypress, and then +# reboot the machine. +# +error: call putstr + mov $msg_keypress,%si + call putstr + xor %ax,%ax # Get keypress + int $0x18 + xor %ax,%ax # CPU reset + outb %al,$0xf0 +halt: hlt + jmp halt # Spin + +# +# Display a null-terminated string at [SI]. +# +# Trashes: AX, BX, CX, DX, SI, DI +# +putstr: push %ds + push %es + mov %cs,%ax + mov %ax,%ds + mov $0xa000,%ax + mov %ax,%es + mov cursor,%di + mov $0x00e1,%bx # Attribute + mov $160,%cx +putstr.0: lodsb + testb %al,%al + jz putstr.done + cmp $0x0d,%al + jz putstr.cr + cmp $0x0a,%al + jz putstr.lf + mov %bl,%es:0x2000(%di) + stosb + inc %di + jmp putstr.move +putstr.cr: xor %dx,%dx + mov %di,%ax + div %cx + sub %dx,%di + jmp putstr.move +putstr.lf: add %cx,%di +putstr.move: mov %di,%dx + mov $0x13,%ah # Move cursor + int $0x18 + jmp putstr.0 +putstr.done: mov %di,cursor + pop %es + pop %ds + ret + +# +# Display a single char at [AL], but don't move a cursor. +# +putc: push %es + push %di + push %bx + mov $0xa000,%bx + mov %bx,%es + mov cursor,%di + mov $0xe1,%bl # Attribute + mov %bl,%es:0x2000(%di) + stosb + pop %bx + pop %di + pop %es + ret + +msg_readerr: .asciz "Read Error\r\n" +msg_keypress: .asciz "\r\nPress any key to reboot\r\n" + +/* Boot signature */ + + .org SIG1_OFF,0x90 + + .word 0xaa55 # Magic number + +# +# cdboot +# +cdboot: mov %cs,%ax + mov %ax,%ds + xor %ax,%ax + mov %ax,%es + mov %es:(DAUA),%al # Save BIOS boot device + mov %al,drive + mov %cx,cylinder # Save BIOS boot cylinder + + mov $msg_welcome,%si # %ds:(%si) -> welcome message + call putstr # display the welcome message +# +# Setup the arguments that the loader is expecting from boot[12] +# + mov $msg_bootinfo,%si # %ds:(%si) -> boot args message + call putstr # display the message + mov $MEM_ARG,%bx # %ds:(%bx) -> boot args + mov %bx,%di # %es:(%di) -> boot args + xor %eax,%eax # zero %eax + mov $(MEM_ARG_SIZE/4),%cx # Size of arguments in 32-bit + # dwords + rep # Clear the arguments + stosl # to zero + mov drive,%dl # Store BIOS boot device + mov %dl,%es:0x4(%bx) # in kargs->bootdev + or $KARGS_FLAGS_CD,%es:0x8(%bx) # kargs->bootflags |= + # KARGS_FLAGS_CD +# +# Load Volume Descriptor +# + mov $VOLDESC_LBA,%eax # Set LBA of first VD +load_vd: push %eax # Save %eax + mov $1,%dh # One sector + mov $MEM_VOLDESC,%ebx # Destination + call read # Read it in + cmpb $VD_PRIMARY,%es:(%bx) # Primary VD? + je have_vd # Yes + pop %eax # Prepare to + inc %eax # try next + cmpb $VD_END,%es:(%bx) # Last VD? + jne load_vd # No, read next + mov $msg_novd,%si # No VD + jmp error # Halt +have_vd: # Have Primary VD +# +# Try to look up the loader binary using the paths in the loader_paths +# array. +# + mov $loader_paths,%si # Point to start of array +lookup_path: push %si # Save file name pointer + call lookup # Try to find file + pop %di # Restore file name pointer + jnc lookup_found # Found this file + push %es + mov %cs,%ax + mov %ax,%es + xor %al,%al # Look for next + mov $0xffff,%cx # path name by + repnz # scanning for + scasb # nul char + pop %es + mov %di,%si # Point %si at next path + mov (%si),%al # Get first char of next path + or %al,%al # Is it double nul? + jnz lookup_path # No, try it. + mov $msg_failed,%si # Failed message + jmp error # Halt +lookup_found: # Found a loader file +# +# Load the binary into the buffer. Due to real mode addressing limitations +# we have to read it in 64k chunks. +# + mov %es:DIR_SIZE(%bx),%eax # Read file length + add $SECTOR_SIZE-1,%eax # Convert length to sectors + shr $SECTOR_SHIFT,%eax + cmp $BUFFER_LEN,%eax + jbe load_sizeok + mov $msg_load2big,%si # Error message + jmp error +load_sizeok: movzbw %al,%cx # Num sectors to read + mov %es:DIR_EXTENT(%bx),%eax # Load extent + xor %edx,%edx + mov %es:DIR_EA_LEN(%bx),%dl + add %edx,%eax # Skip extended + mov $MEM_READ_BUFFER,%ebx # Read into the buffer +load_loop: mov %cl,%dh + cmp $MAX_READ_SEC,%cl # Truncate to max read size + jbe load_notrunc + mov $MAX_READ_SEC,%dh +load_notrunc: sub %dh,%cl # Update count + push %eax # Save + call read # Read it in + pop %eax # Restore + add $MAX_READ_SEC,%eax # Update LBA + add $MAX_READ,%ebx # Update dest addr + jcxz load_done # Done? + jmp load_loop # Keep going +load_done: +# +# Turn on the A20 address line +# + xor %ax,%ax # Turn A20 on + outb %al,$0xf2 + mov $0x02,%al + outb %al,$0xf6 +# +# Relocate the loader and BTX using a very lazy protected mode +# + mov $msg_relocate,%si # Display the + call putstr # relocation message + mov %es:(MEM_READ_BUFFER+AOUT_ENTRY),%edi # %edi is the destination + mov $(MEM_READ_BUFFER+AOUT_HEADER),%esi # %esi is + # the start of the text + # segment + mov %es:(MEM_READ_BUFFER+AOUT_TEXT),%ecx # %ecx = length of the text + # segment + push %edi # Save entry point for later + lgdt gdtdesc # setup our own gdt + cli # turn off interrupts + mov %cr0,%eax # Turn on + or $0x1,%al # protected + mov %eax,%cr0 # mode + ljmp $SEL_SCODE,$pm_start # long jump to clear the + # instruction pre-fetch queue + .code32 +pm_start: mov $SEL_SDATA,%ax # Initialize + mov %ax,%ds # %ds and + mov %ax,%es # %es to a flat selector + rep # Relocate the + movsb # text segment + add $(MEM_PAGE_SIZE - 1),%edi # pad %edi out to a new page + and $~(MEM_PAGE_SIZE - 1),%edi # for the data segment + mov MEM_READ_BUFFER+AOUT_DATA,%ecx # size of the data segment + rep # Relocate the + movsb # data segment + mov MEM_READ_BUFFER+AOUT_BSS,%ecx # size of the bss + xor %eax,%eax # zero %eax + add $3,%cl # round %ecx up to + shr $2,%ecx # a multiple of 4 + rep # zero the + stosl # bss + mov MEM_READ_BUFFER+AOUT_ENTRY,%esi # %esi -> relocated loader + add $MEM_BTX_OFFSET,%esi # %esi -> BTX in the loader + mov $MEM_BTX_ADDRESS,%edi # %edi -> where BTX needs to go + movzwl 0xa(%esi),%ecx # %ecx -> length of BTX + rep # Relocate + movsb # BTX + ljmp $SEL_SCODE16,$pm_16 # Jump to 16-bit PM + .code16 +pm_16: mov $SEL_RDATA,%ax # Initialize + mov %ax,%ds # %ds and + mov %ax,%es # %es to a real mode selector + mov %cr0,%eax # Turn off + and $~0x1,%al # protected + mov %eax,%cr0 # mode + ljmp $LOAD_SEG,$pm_end # Long jump to clear the + # instruction pre-fetch queue +pm_end: sti # Turn interrupts back on now +# +# Copy the BTX client to MEM_BTX_CLIENT +# + mov %cs,%ax + mov %ax,%ds + xor %ax,%ax + mov %ax,%es + mov $MEM_BTX_CLIENT,%di # Prepare to relocate + mov $btx_client,%si # the simple btx client + mov $(btx_client_end-btx_client),%cx # length of btx client + rep # Relocate the + movsb # simple BTX client +# +# Copy the boot[12] args to where the BTX client can see them +# + xor %ax,%ax + mov %ax,%ds + mov $MEM_ARG,%si # where the args are at now + mov $MEM_ARG_BTX,%di # where the args are moving to + mov $(MEM_ARG_SIZE/4),%cx # size of the arguments in longs + rep # Relocate + movsl # the words +# +# Save the entry point so the client can get to it later on +# + pop %eax # Restore saved entry point + stosl # and add it to the end of + # the arguments +# +# Now we just start up BTX and let it do the rest +# + mov $msg_jump,%si # Display the + call putstr # jump message + ljmp $0,$MEM_BTX_ENTRY # Jump to the BTX entry point + +# +# Lookup the file in the path at [SI] from the root directory. +# +# Trashes: All but BX +# Returns: CF = 0 (success), BX = pointer to record +# CF = 1 (not found) +# +lookup: mov $VD_ROOTDIR+MEM_VOLDESC,%bx # Root directory record + push %bx + push %si + mov $msg_lookup,%si # Display lookup message + call putstr + pop %si + push %si + call putstr + mov $msg_lookup2,%si + call putstr + pop %si + pop %bx +lookup_dir: lodsb # Get first char of path + cmp $0,%al # Are we done? + je lookup_done # Yes + cmp $'/',%al # Skip path separator. + je lookup_dir + dec %si # Undo lodsb side effect + call find_file # Lookup first path item + jnc lookup_dir # Try next component + mov $msg_lookupfail,%si # Not found message + push %bx + call putstr + pop %bx + stc # Set carry + ret +lookup_done: mov $msg_lookupok,%si # Success message + push %bx + call putstr + pop %bx + clc # Clear carry + ret + +# +# Lookup file at [SI] in directory whose record is at [BX]. +# +# Trashes: All but returns +# Returns: CF = 0 (success), BX = pointer to record, SI = next path item +# CF = 1 (not found), SI = preserved +# +find_file: mov %es:DIR_EXTENT(%bx),%eax # Load extent + xor %edx,%edx + mov %es:DIR_EA_LEN(%bx),%dl + add %edx,%eax # Skip extended attributes + mov %eax,rec_lba # Save LBA + mov %es:DIR_SIZE(%bx),%eax # Save size + mov %eax,rec_size + xor %cl,%cl # Zero length + push %si # Save +ff.namelen: inc %cl # Update length + lodsb # Read char + cmp $0,%al # Nul? + je ff.namedone # Yes + cmp $'/',%al # Path separator? + jnz ff.namelen # No, keep going +ff.namedone: dec %cl # Adjust length and save + mov %cl,name_len + pop %si # Restore +ff.load: mov rec_lba,%eax # Load LBA + mov $MEM_DIR,%ebx # Address buffer + mov $1,%dh # One sector + call read # Read directory block + incl rec_lba # Update LBA to next block +ff.scan: mov %ebx,%edx # Check for EOF + sub $MEM_DIR,%edx + cmp %edx,rec_size + ja ff.scan.1 + stc # EOF reached + ret +ff.scan.1: cmpb $0,%es:DIR_LEN(%bx) # Last record in block? + je ff.nextblock + push %si # Save + movzbw %es:DIR_NAMELEN(%bx),%si # Find end of string +ff.checkver: cmpb $'0',%es:DIR_NAME-1(%bx,%si) # Less than '0'? + jb ff.checkver.1 + cmpb $'9',%es:DIR_NAME-1(%bx,%si) # Greater than '9'? + ja ff.checkver.1 + dec %si # Next char + jnz ff.checkver + jmp ff.checklen # All numbers in name, so + # no version +ff.checkver.1: movzbw %es:DIR_NAMELEN(%bx),%cx + cmp %cx,%si # Did we find any digits? + je ff.checkdot # No + cmpb $';',%es:DIR_NAME-1(%bx,%si) # Check for semicolon + jne ff.checkver.2 + dec %si # Skip semicolon + mov %si,%cx + mov %cl,%es:DIR_NAMELEN(%bx) # Adjust length + jmp ff.checkdot +ff.checkver.2: mov %cx,%si # Restore %si to end of string +ff.checkdot: cmpb $'.',%es:DIR_NAME-1(%bx,%si) # Trailing dot? + jne ff.checklen # No + decb %es:DIR_NAMELEN(%bx) # Adjust length +ff.checklen: pop %si # Restore + movzbw name_len,%cx # Load length of name + cmp %cl,%es:DIR_NAMELEN(%bx) # Does length match? + je ff.checkname # Yes, check name +ff.nextrec: add %es:DIR_LEN(%bx),%bl # Next record + adc $0,%bh + jmp ff.scan +ff.nextblock: subl $SECTOR_SIZE,rec_size # Adjust size + jnc ff.load # If subtract ok, keep going + ret # End of file, so not found +ff.checkname: lea DIR_NAME(%bx),%di # Address name in record + push %si # Save + repe cmpsb # Compare name + je ff.match # We have a winner! + pop %si # Restore + jmp ff.nextrec # Keep looking. +ff.match: add $2,%sp # Discard saved %si + clc # Clear carry + ret + +# +# Load DH sectors starting at LBA EAX into [EBX]. +# +# Trashes: EAX +# +read: push %es # Save + push %bp + push %dx + push %cx + push %ebx + mov %bx,%bp # Set destination address + and $0x000f,%bp + shr $4,%ebx + mov %bx,%es + xor %bx,%bx # Set read bytes + mov %dh,%bl + shl $SECTOR_SHIFT,%bx # 2048 bytes/sec + mov %ax,%cx # Set LBA + shr $16,%eax + mov %ax,%dx +read.retry: mov $0x06,%ah # BIOS device read + mov drive,%al + and $0x7f,%al + call twiddle # Entertain the user + int $0x1b # Call BIOS + jc read.fail # Worked? + pop %ebx # Restore + pop %cx + pop %dx + pop %bp + pop %es + ret # Return +read.fail: cmp $ERROR_TIMEOUT,%ah # Timeout? + je read.retry # Yes, Retry. +read.error: mov %ah,%al # Save error + mov $hex_error,%di # Format it + call hex8 # as hex + mov $msg_badread,%si # Display Read error message + jmp error + +# +# Output the "twiddle" +# +twiddle: push %ax # Save + push %bx # Save + mov twiddle_index,%al # Load index + mov $twiddle_chars,%bx # Address table + inc %al # Next + and $3,%al # char + mov %al,twiddle_index # Save index for next call + xlat # Get char + call putc # Output it + pop %bx # Restore + pop %ax # Restore + ret + +# +# Convert AL to hex, saving the result to [EDI]. +# +hex8: pushl %eax # Save + shrb $0x4,%al # Do upper + call hex8.1 # 4 + popl %eax # Restore +hex8.1: andb $0xf,%al # Get lower 4 + cmpb $0xa,%al # Convert + sbbb $0x69,%al # to hex + das # digit + orb $0x20,%al # To lower case + mov %al,(%di) # Save char + inc %di + ret # (Recursive) + +# +# BTX client to start btxldr +# + .code32 +btx_client: mov $(MEM_ARG_BTX-MEM_BTX_CLIENT+MEM_ARG_SIZE-4), %esi + # %ds:(%esi) -> end + # of boot[12] args + mov $(MEM_ARG_SIZE/4),%ecx # Number of words to push + std # Go backwards +push_arg: lodsl # Read argument + push %eax # Push it onto the stack + loop push_arg # Push all of the arguments + cld # In case anyone depends on this + pushl MEM_ARG_BTX-MEM_BTX_CLIENT+MEM_ARG_SIZE # Entry point of + # the loader + push %eax # Emulate a near call + mov $0x1,%eax # 'exec' system call + int $INT_SYS # BTX system call +btx_client_end: + .code16 + + .p2align 4 +# +# Global descriptor table. +# +gdt: .word 0x0,0x0,0x0,0x0 # Null entry + .word 0xffff,0x0000,0x9200,0x00cf # SEL_SDATA + .word 0xffff,0x0000,0x9200,0x0000 # SEL_RDATA + .word 0xffff,LOAD_SEG<<4,0x9a00,0x00cf # SEL_SCODE (32-bit) + .word 0xffff,LOAD_SEG<<4,0x9a00,0x008f # SEL_SCODE16 (16-bit) +gdt.1: +# +# Pseudo-descriptors. +# +gdtdesc: .word gdt.1-gdt-1 # Limit + .long LOAD_SEG<<4 + gdt # Base + +# +# BOOT device +# +drive: .byte 0 +cylinder: .word 0 + +# +# State for searching dir +# +rec_lba: .long 0x0 # LBA (adjusted for EA) +rec_size: .long 0x0 # File size +name_len: .byte 0x0 # Length of current name + +cursor: .word 0 +twiddle_index: .byte 0x0 + +msg_welcome: .asciz "CD Loader 1.2\r\n\n" +msg_bootinfo: .asciz "Building the boot loader arguments\r\n" +msg_relocate: .asciz "Relocating the loader and the BTX\r\n" +msg_jump: .asciz "Starting the BTX loader\r\n" +msg_badread: .ascii "Read Error: 0x" +hex_error: .asciz "00\r\n" +msg_novd: .asciz "Could not find Primary Volume Descriptor\r\n" +msg_lookup: .asciz "Looking up " +msg_lookup2: .asciz "... " +msg_lookupok: .asciz "Found\r\n" +msg_lookupfail: .asciz "File not found\r\n" +msg_load2big: .asciz "File too big\r\n" +msg_failed: .asciz "Boot failed\r\n" +twiddle_chars: .ascii "|/-\\" +loader_paths: .asciz "/BOOT.PC98/LOADER" + .asciz "/boot.pc98/loader" + .asciz "/BOOT/LOADER" + .asciz "/boot/loader" + .byte 0 + +/* Boot signature */ + + .org SIG2_OFF,0x90 + + .word 0xaa55 # Magic number Modified: stable/9/sys/boot/pc98/loader/main.c ============================================================================== --- stable/9/sys/boot/pc98/loader/main.c Fri Jun 29 10:10:43 2012 (r237762) +++ stable/9/sys/boot/pc98/loader/main.c Fri Jun 29 10:12:18 2012 (r237763) @@ -33,29 +33,25 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include #include #include "bootstrap.h" +#include "common/bootargs.h" #include "libi386/libi386.h" #include "libpc98/libpc98.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:12:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51E34106584A; Fri, 29 Jun 2012 10:12:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE8768FC08; Fri, 29 Jun 2012 10:12:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TACRIv038891; Fri, 29 Jun 2012 10:12:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TACR9T038881; Fri, 29 Jun 2012 10:12:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291012.q5TACR9T038881@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237764 - in stable/8/sys/boot/pc98: btx/btx btx/btxldr btx/lib cdboot loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:12:28 -0000 Author: avg Date: Fri Jun 29 10:12:27 2012 New Revision: 237764 URL: http://svn.freebsd.org/changeset/base/237764 Log: MFC r235264: MFi386: improve argument passing via btxldr Added: stable/8/sys/boot/pc98/btx/lib/btxcsu.S - copied unchanged from r235264, head/sys/boot/pc98/btx/lib/btxcsu.S stable/8/sys/boot/pc98/cdboot/cdboot.S - copied unchanged from r235264, head/sys/boot/pc98/cdboot/cdboot.S Deleted: stable/8/sys/boot/pc98/btx/lib/btxcsu.s stable/8/sys/boot/pc98/cdboot/cdboot.s Modified: stable/8/sys/boot/pc98/btx/btx/Makefile stable/8/sys/boot/pc98/btx/btx/btx.S stable/8/sys/boot/pc98/btx/btxldr/Makefile stable/8/sys/boot/pc98/btx/btxldr/btxldr.S stable/8/sys/boot/pc98/btx/lib/Makefile stable/8/sys/boot/pc98/cdboot/Makefile stable/8/sys/boot/pc98/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/pc98/btx/btx/Makefile ============================================================================== --- stable/8/sys/boot/pc98/btx/btx/Makefile Fri Jun 29 10:12:18 2012 (r237763) +++ stable/8/sys/boot/pc98/btx/btx/Makefile Fri Jun 29 10:12:27 2012 (r237764) @@ -12,6 +12,7 @@ BOOT_BTX_FLAGS=0x0 .endif CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} +CFLAGS+=-I${.CURDIR}/../../../i386/common .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x238 Modified: stable/8/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/8/sys/boot/pc98/btx/btx/btx.S Fri Jun 29 10:12:18 2012 (r237763) +++ stable/8/sys/boot/pc98/btx/btx/btx.S Fri Jun 29 10:12:27 2012 (r237764) @@ -15,6 +15,8 @@ * $FreeBSD$ */ +#include + /* * Memory layout. */ @@ -205,7 +207,7 @@ init.8: xorl %ecx,%ecx # Zero andl $0x7,%eax incl %eax shll $0x11,%eax # To bytes - subl $0x1000,%eax # Less arg space + subl $ARGSPACE,%eax # Less arg space subl %edx,%eax # Less base movb $SEL_UDATA,%cl # User data selector pushl %ecx # Set SS Modified: stable/8/sys/boot/pc98/btx/btxldr/Makefile ============================================================================== --- stable/8/sys/boot/pc98/btx/btxldr/Makefile Fri Jun 29 10:12:18 2012 (r237763) +++ stable/8/sys/boot/pc98/btx/btxldr/Makefile Fri Jun 29 10:12:27 2012 (r237764) @@ -6,6 +6,7 @@ NO_MAN= SRCS= btxldr.S CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS} +CFLAGS+=-I${.CURDIR}/../../../i386/common .if defined(BTXLDR_VERBOSE) CFLAGS+=-DBTXLDR_VERBOSE Modified: stable/8/sys/boot/pc98/btx/btxldr/btxldr.S ============================================================================== --- stable/8/sys/boot/pc98/btx/btxldr/btxldr.S Fri Jun 29 10:12:18 2012 (r237763) +++ stable/8/sys/boot/pc98/btx/btxldr/btxldr.S Fri Jun 29 10:12:27 2012 (r237764) @@ -20,6 +20,8 @@ * real thing should probably be more flexible, and in C. */ +#include + /* * Memory locations. */ @@ -105,7 +107,7 @@ gdcwait.2: inb $0x60,%al call hexout # stack call putstr # pointer movl $m_args,%esi # Format string - leal 0x4(%esp,1),%ebx # First argument + leal 0x4(%esp),%ebx # First argument movl $0x6,%ecx # Count start.1: movl (%ebx),%eax # Get argument and addl $0x4,%ebx # bump pointer @@ -113,24 +115,28 @@ start.1: movl (%ebx),%eax # Get argumen loop start.1 # Till done call putstr # End message #endif - movl $0x48,%ecx # Allocate space - subl %ecx,%ebp # for bootinfo - movl 0x18(%esp,1),%esi # Source: bootinfo + movl BA_BOOTINFO+4(%esp),%esi # Source: bootinfo cmpl $0x0, %esi # If the bootinfo pointer je start_null_bi # is null, don't copy it + movl BI_SIZE(%esi),%ecx # Allocate space + subl %ecx,%ebp # for bootinfo movl %ebp,%edi # Destination rep # Copy movsb # it - movl %ebp,0x18(%esp,1) # Update pointer + movl %ebp,BA_BOOTINFO+4(%esp) # Update pointer + movl %edi,%ebp # Restore base pointer #ifdef BTXLDR_VERBOSE movl $m_rel_bi,%esi # Display movl %ebp,%eax # bootinfo call hexout # relocation call putstr # message #endif -start_null_bi: movl $0x18,%ecx # Allocate space - subl %ecx,%ebp # for arguments - leal 0x4(%esp,1),%esi # Source +start_null_bi: movl $BOOTARGS_SIZE,%ecx # Fixed size of arguments + testl $KARGS_FLAGS_EXTARG, BA_BOOTFLAGS+4(%esp) # Check for extra data + jz start_fixed # Skip if the flag is not set + addl BOOTARGS_SIZE+4(%esp),%ecx # Add size of variable args +start_fixed: subl $ARGOFF,%ebp # Place args at fixed offset + leal 0x4(%esp),%esi # Source movl %ebp,%edi # Destination rep # Copy movsb # them Modified: stable/8/sys/boot/pc98/btx/lib/Makefile ============================================================================== --- stable/8/sys/boot/pc98/btx/lib/Makefile Fri Jun 29 10:12:18 2012 (r237763) +++ stable/8/sys/boot/pc98/btx/lib/Makefile Fri Jun 29 10:12:27 2012 (r237764) @@ -3,7 +3,8 @@ PROG= crt0.o INTERNALPROG= NO_MAN= -SRCS= btxcsu.s btxsys.s btxv86.s +SRCS= btxcsu.S btxsys.s btxv86.s +CFLAGS+=-I${.CURDIR}/../../../i386/common LDFLAGS=-Wl,-r .include Copied: stable/8/sys/boot/pc98/btx/lib/btxcsu.S (from r235264, head/sys/boot/pc98/btx/lib/btxcsu.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/pc98/btx/lib/btxcsu.S Fri Jun 29 10:12:27 2012 (r237764, copy of r235264, head/sys/boot/pc98/btx/lib/btxcsu.S) @@ -0,0 +1,49 @@ +# +# Copyright (c) 1998 Robert Nordier +# All rights reserved. +# +# Redistribution and use in source and binary forms are freely +# permitted provided that the above copyright notice and this +# paragraph and the following disclaimer are duplicated in all +# such forms. +# +# This software is provided "AS IS" and without any express or +# implied warranties, including, without limitation, the implied +# warranties of merchantability and fitness for a particular +# purpose. +# + +# $FreeBSD$ + +# +# BTX C startup code (ELF). +# + +#include + +# +# Globals. +# + .global _start +# +# Client entry point. +# +_start: cld + pushl %eax + movl $_edata,%edi + movl $_end,%ecx + subl %edi, %ecx + xorb %al, %al + rep + stosb + popl __base + movl %esp,%eax # Set + addl $ARGADJ,%eax # argument + movl %eax,__args # pointer + call main # Invoke client main() + call exit # Invoke client exit() +# +# Data. +# + .comm __base,4 # Client base address + .comm __args,4 # Client arguments Modified: stable/8/sys/boot/pc98/cdboot/Makefile ============================================================================== --- stable/8/sys/boot/pc98/cdboot/Makefile Fri Jun 29 10:12:18 2012 (r237763) +++ stable/8/sys/boot/pc98/cdboot/Makefile Fri Jun 29 10:12:27 2012 (r237764) @@ -4,7 +4,9 @@ PROG= cdboot STRIP= BINMODE=${NOBINMODE} NO_MAN= -SRCS= ${PROG}.s +SRCS= ${PROG}.S + +CFLAGS+=-I${.CURDIR}/../../i386/common ORG= 0x0000 Copied: stable/8/sys/boot/pc98/cdboot/cdboot.S (from r235264, head/sys/boot/pc98/cdboot/cdboot.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/pc98/cdboot/cdboot.S Fri Jun 29 10:12:27 2012 (r237764, copy of r235264, head/sys/boot/pc98/cdboot/cdboot.S) @@ -0,0 +1,808 @@ +# +# Copyright (c) 2006 TAKAHASHI Yoshihiro +# Copyright (c) 2001 John Baldwin +# 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. +# 3. Neither the name of the author nor the names of any co-contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# $FreeBSD$ + +#include + +# +# Basically, we first create a set of boot arguments to pass to the loaded +# binary. Then we attempt to load /boot/loader from the CD we were booted +# off of. +# + +# +# Memory locations. +# + .set STACK_OFF,0x6000 # Stack offset + .set LOAD_SEG,0x0700 # Load segment + .set LOAD_SIZE,2048 # Load size + .set DAUA,0x0584 # DA/UA + + .set MEM_PAGE_SIZE,0x1000 # memory page size, 4k + .set MEM_ARG,0x900 # Arguments at start + .set MEM_ARG_BTX,0xa100 # Where we move them to so the + # BTX client can see them + .set MEM_ARG_SIZE,0x18 # Size of the arguments + .set MEM_BTX_ADDRESS,0x9000 # where BTX lives + .set MEM_BTX_ENTRY,0x9010 # where BTX starts to execute + .set MEM_BTX_OFFSET,MEM_PAGE_SIZE # offset of BTX in the loader + .set MEM_BTX_CLIENT,0xa000 # where BTX clients live +# +# PC98 machine type from sys/pc98/pc98/pc98_machdep.h +# + .set MEM_SYS, 0xa100 # System common area segment + .set PC98_MACHINE_TYPE, 0x0620 # PC98 machine type + .set EPSON_ID, 0x0624 # EPSON machine id + + .set M_NEC_PC98, 0x0001 + .set M_EPSON_PC98, 0x0002 + .set M_NOT_H98, 0x0010 + .set M_H98, 0x0020 + .set M_NOTE, 0x0040 + .set M_NORMAL, 0x1000 + .set M_8M, 0x8000 +# +# Signature Constants +# + .set SIG1_OFF,0x1fe # Signature offset + .set SIG2_OFF,0x7fe # Signature offset +# +# a.out header fields +# + .set AOUT_TEXT,0x04 # text segment size + .set AOUT_DATA,0x08 # data segment size + .set AOUT_BSS,0x0c # zero'd BSS size + .set AOUT_SYMBOLS,0x10 # symbol table + .set AOUT_ENTRY,0x14 # entry point + .set AOUT_HEADER,MEM_PAGE_SIZE # size of the a.out header +# +# Segment selectors. +# + .set SEL_SDATA,0x8 # Supervisor data + .set SEL_RDATA,0x10 # Real mode data + .set SEL_SCODE,0x18 # PM-32 code + .set SEL_SCODE16,0x20 # PM-16 code +# +# BTX constants +# + .set INT_SYS,0x30 # BTX syscall interrupt +# +# Constants for reading from the CD. +# + .set ERROR_TIMEOUT,0x90 # BIOS timeout on read + .set NUM_RETRIES,3 # Num times to retry + .set SECTOR_SIZE,0x800 # size of a sector + .set SECTOR_SHIFT,11 # number of place to shift + .set BUFFER_LEN,0x100 # number of sectors in buffer + .set MAX_READ,0xf800 # max we can read at a time + .set MAX_READ_SEC,MAX_READ >> SECTOR_SHIFT + .set MEM_READ_BUFFER,0x9000 # buffer to read from CD + .set MEM_VOLDESC,MEM_READ_BUFFER # volume descriptor + .set MEM_DIR,MEM_VOLDESC+SECTOR_SIZE # Lookup buffer + .set VOLDESC_LBA,0x10 # LBA of vol descriptor + .set VD_PRIMARY,1 # Primary VD + .set VD_END,255 # VD Terminator + .set VD_ROOTDIR,156 # Offset of Root Dir Record + .set DIR_LEN,0 # Offset of Dir Record length + .set DIR_EA_LEN,1 # Offset of EA length + .set DIR_EXTENT,2 # Offset of 64-bit LBA + .set DIR_SIZE,10 # Offset of 64-bit length + .set DIR_NAMELEN,32 # Offset of 8-bit name len + .set DIR_NAME,33 # Offset of dir name + +# +# Program start. +# + .code16 + .globl start + +start: jmp main + + .org 4 + .ascii "IPL1 " + +main: cld + + /* Setup the stack */ + xor %ax,%ax + mov %ax,%ss + mov $STACK_OFF,%sp + + push %ecx + + /* Setup graphic screen */ + mov $0x42,%ah # 640x400 + mov $0xc0,%ch + int $0x18 + mov $0x40,%ah # graph on + int $0x18 + + /* Setup text screen */ + mov $0x0a00,%ax # 80x25 + int $0x18 + mov $0x0c,%ah # text on + int $0x18 + mov $0x13,%ah # cursor home + xor %dx,%dx + int $0x18 + mov $0x11,%ah # cursor on + int $0x18 + + /* Setup keyboard */ + mov $0x03,%ah + int $0x18 + + /* Transfer PC-9801 system common area */ + xor %ax,%ax + mov %ax,%si + mov %ax,%ds + mov %ax,%di + mov $MEM_SYS,%ax + mov %ax,%es + mov $0x0600,%cx + rep + movsb + + /* Transfer EPSON machine type */ + mov $0xfd00,%ax + mov %ax,%ds + mov (0x804),%eax + and $0x00ffffff,%eax + mov %eax,%es:(EPSON_ID) + + /* Set machine type to PC98_SYSTEM_PARAMETER */ + call machine_check + + /* Load cdboot */ + xor %ax,%ax + mov %ax,%ds + mov $0x06,%ah /* Read data */ + mov (DAUA),%al /* Read drive */ + pop %ecx /* cylinder */ + xor %dx,%dx /* head / sector */ + mov $LOAD_SEG,%bx /* Load address */ + mov %bx,%es + xor %bp,%bp + mov $LOAD_SIZE,%bx /* Load size */ + int $0x1b + mov $msg_readerr,%si + jc error + + /* Jump to cdboot */ + ljmp $LOAD_SEG,$cdboot + +# +# Set machine type to PC98_SYSTEM_PARAMETER. +# +machine_check: xor %edx,%edx + mov %dx,%ds + mov $MEM_SYS,%ax + mov %ax,%es + + /* Wait V-SYNC */ +vsync.1: inb $0x60,%al + test $0x20,%al + jnz vsync.1 +vsync.2: inb $0x60,%al + test $0x20,%al + jz vsync.2 + + /* ANK 'A' font */ + xor %al,%al + outb %al,$0xa1 + mov $0x41,%al + outb %al,$0xa3 + + /* Get 'A' font from CG window */ + push %ds + mov $0xa400,%ax + mov %ax,%ds + xor %eax,%eax + xor %bx,%bx + mov $4,%cx +font.1: add (%bx),%eax + add $4,%bx + loop font.1 + pop %ds + cmp $0x6efc58fc,%eax + jnz m_epson + +m_pc98: or $M_NEC_PC98,%edx + mov $0x0458,%bx + mov (%bx),%al + test $0x80,%al + jz m_not_h98 + or $M_H98,%edx + jmp 1f +m_epson: or $M_EPSON_PC98,%edx +m_not_h98: or $M_NOT_H98,%edx + +1: inb $0x42,%al + test $0x20,%al + jz 1f + or $M_8M,%edx + +1: mov $0x0400,%bx + mov (%bx),%al + test $0x80,%al + jz 1f + or $M_NOTE,%edx + +1: mov $PC98_MACHINE_TYPE,%bx + mov %edx,%es:(%bx) + ret + +# +# Print out the error message at [SI], wait for a keypress, and then +# reboot the machine. +# +error: call putstr + mov $msg_keypress,%si + call putstr + xor %ax,%ax # Get keypress + int $0x18 + xor %ax,%ax # CPU reset + outb %al,$0xf0 +halt: hlt + jmp halt # Spin + +# +# Display a null-terminated string at [SI]. +# +# Trashes: AX, BX, CX, DX, SI, DI +# +putstr: push %ds + push %es + mov %cs,%ax + mov %ax,%ds + mov $0xa000,%ax + mov %ax,%es + mov cursor,%di + mov $0x00e1,%bx # Attribute + mov $160,%cx +putstr.0: lodsb + testb %al,%al + jz putstr.done + cmp $0x0d,%al + jz putstr.cr + cmp $0x0a,%al + jz putstr.lf + mov %bl,%es:0x2000(%di) + stosb + inc %di + jmp putstr.move +putstr.cr: xor %dx,%dx + mov %di,%ax + div %cx + sub %dx,%di + jmp putstr.move +putstr.lf: add %cx,%di +putstr.move: mov %di,%dx + mov $0x13,%ah # Move cursor + int $0x18 + jmp putstr.0 +putstr.done: mov %di,cursor + pop %es + pop %ds + ret + +# +# Display a single char at [AL], but don't move a cursor. +# +putc: push %es + push %di + push %bx + mov $0xa000,%bx + mov %bx,%es + mov cursor,%di + mov $0xe1,%bl # Attribute + mov %bl,%es:0x2000(%di) + stosb + pop %bx + pop %di + pop %es + ret + +msg_readerr: .asciz "Read Error\r\n" +msg_keypress: .asciz "\r\nPress any key to reboot\r\n" + +/* Boot signature */ + + .org SIG1_OFF,0x90 + + .word 0xaa55 # Magic number + +# +# cdboot +# +cdboot: mov %cs,%ax + mov %ax,%ds + xor %ax,%ax + mov %ax,%es + mov %es:(DAUA),%al # Save BIOS boot device + mov %al,drive + mov %cx,cylinder # Save BIOS boot cylinder + + mov $msg_welcome,%si # %ds:(%si) -> welcome message + call putstr # display the welcome message +# +# Setup the arguments that the loader is expecting from boot[12] +# + mov $msg_bootinfo,%si # %ds:(%si) -> boot args message + call putstr # display the message + mov $MEM_ARG,%bx # %ds:(%bx) -> boot args + mov %bx,%di # %es:(%di) -> boot args + xor %eax,%eax # zero %eax + mov $(MEM_ARG_SIZE/4),%cx # Size of arguments in 32-bit + # dwords + rep # Clear the arguments + stosl # to zero + mov drive,%dl # Store BIOS boot device + mov %dl,%es:0x4(%bx) # in kargs->bootdev + or $KARGS_FLAGS_CD,%es:0x8(%bx) # kargs->bootflags |= + # KARGS_FLAGS_CD +# +# Load Volume Descriptor +# + mov $VOLDESC_LBA,%eax # Set LBA of first VD +load_vd: push %eax # Save %eax + mov $1,%dh # One sector + mov $MEM_VOLDESC,%ebx # Destination + call read # Read it in + cmpb $VD_PRIMARY,%es:(%bx) # Primary VD? + je have_vd # Yes + pop %eax # Prepare to + inc %eax # try next + cmpb $VD_END,%es:(%bx) # Last VD? + jne load_vd # No, read next + mov $msg_novd,%si # No VD + jmp error # Halt +have_vd: # Have Primary VD +# +# Try to look up the loader binary using the paths in the loader_paths +# array. +# + mov $loader_paths,%si # Point to start of array +lookup_path: push %si # Save file name pointer + call lookup # Try to find file + pop %di # Restore file name pointer + jnc lookup_found # Found this file + push %es + mov %cs,%ax + mov %ax,%es + xor %al,%al # Look for next + mov $0xffff,%cx # path name by + repnz # scanning for + scasb # nul char + pop %es + mov %di,%si # Point %si at next path + mov (%si),%al # Get first char of next path + or %al,%al # Is it double nul? + jnz lookup_path # No, try it. + mov $msg_failed,%si # Failed message + jmp error # Halt +lookup_found: # Found a loader file +# +# Load the binary into the buffer. Due to real mode addressing limitations +# we have to read it in 64k chunks. +# + mov %es:DIR_SIZE(%bx),%eax # Read file length + add $SECTOR_SIZE-1,%eax # Convert length to sectors + shr $SECTOR_SHIFT,%eax + cmp $BUFFER_LEN,%eax + jbe load_sizeok + mov $msg_load2big,%si # Error message + jmp error +load_sizeok: movzbw %al,%cx # Num sectors to read + mov %es:DIR_EXTENT(%bx),%eax # Load extent + xor %edx,%edx + mov %es:DIR_EA_LEN(%bx),%dl + add %edx,%eax # Skip extended + mov $MEM_READ_BUFFER,%ebx # Read into the buffer +load_loop: mov %cl,%dh + cmp $MAX_READ_SEC,%cl # Truncate to max read size + jbe load_notrunc + mov $MAX_READ_SEC,%dh +load_notrunc: sub %dh,%cl # Update count + push %eax # Save + call read # Read it in + pop %eax # Restore + add $MAX_READ_SEC,%eax # Update LBA + add $MAX_READ,%ebx # Update dest addr + jcxz load_done # Done? + jmp load_loop # Keep going +load_done: +# +# Turn on the A20 address line +# + xor %ax,%ax # Turn A20 on + outb %al,$0xf2 + mov $0x02,%al + outb %al,$0xf6 +# +# Relocate the loader and BTX using a very lazy protected mode +# + mov $msg_relocate,%si # Display the + call putstr # relocation message + mov %es:(MEM_READ_BUFFER+AOUT_ENTRY),%edi # %edi is the destination + mov $(MEM_READ_BUFFER+AOUT_HEADER),%esi # %esi is + # the start of the text + # segment + mov %es:(MEM_READ_BUFFER+AOUT_TEXT),%ecx # %ecx = length of the text + # segment + push %edi # Save entry point for later + lgdt gdtdesc # setup our own gdt + cli # turn off interrupts + mov %cr0,%eax # Turn on + or $0x1,%al # protected + mov %eax,%cr0 # mode + ljmp $SEL_SCODE,$pm_start # long jump to clear the + # instruction pre-fetch queue + .code32 +pm_start: mov $SEL_SDATA,%ax # Initialize + mov %ax,%ds # %ds and + mov %ax,%es # %es to a flat selector + rep # Relocate the + movsb # text segment + add $(MEM_PAGE_SIZE - 1),%edi # pad %edi out to a new page + and $~(MEM_PAGE_SIZE - 1),%edi # for the data segment + mov MEM_READ_BUFFER+AOUT_DATA,%ecx # size of the data segment + rep # Relocate the + movsb # data segment + mov MEM_READ_BUFFER+AOUT_BSS,%ecx # size of the bss + xor %eax,%eax # zero %eax + add $3,%cl # round %ecx up to + shr $2,%ecx # a multiple of 4 + rep # zero the + stosl # bss + mov MEM_READ_BUFFER+AOUT_ENTRY,%esi # %esi -> relocated loader + add $MEM_BTX_OFFSET,%esi # %esi -> BTX in the loader + mov $MEM_BTX_ADDRESS,%edi # %edi -> where BTX needs to go + movzwl 0xa(%esi),%ecx # %ecx -> length of BTX + rep # Relocate + movsb # BTX + ljmp $SEL_SCODE16,$pm_16 # Jump to 16-bit PM + .code16 +pm_16: mov $SEL_RDATA,%ax # Initialize + mov %ax,%ds # %ds and + mov %ax,%es # %es to a real mode selector + mov %cr0,%eax # Turn off + and $~0x1,%al # protected + mov %eax,%cr0 # mode + ljmp $LOAD_SEG,$pm_end # Long jump to clear the + # instruction pre-fetch queue +pm_end: sti # Turn interrupts back on now +# +# Copy the BTX client to MEM_BTX_CLIENT +# + mov %cs,%ax + mov %ax,%ds + xor %ax,%ax + mov %ax,%es + mov $MEM_BTX_CLIENT,%di # Prepare to relocate + mov $btx_client,%si # the simple btx client + mov $(btx_client_end-btx_client),%cx # length of btx client + rep # Relocate the + movsb # simple BTX client +# +# Copy the boot[12] args to where the BTX client can see them +# + xor %ax,%ax + mov %ax,%ds + mov $MEM_ARG,%si # where the args are at now + mov $MEM_ARG_BTX,%di # where the args are moving to + mov $(MEM_ARG_SIZE/4),%cx # size of the arguments in longs + rep # Relocate + movsl # the words +# +# Save the entry point so the client can get to it later on +# + pop %eax # Restore saved entry point + stosl # and add it to the end of + # the arguments +# +# Now we just start up BTX and let it do the rest +# + mov $msg_jump,%si # Display the + call putstr # jump message + ljmp $0,$MEM_BTX_ENTRY # Jump to the BTX entry point + +# +# Lookup the file in the path at [SI] from the root directory. +# +# Trashes: All but BX +# Returns: CF = 0 (success), BX = pointer to record +# CF = 1 (not found) +# +lookup: mov $VD_ROOTDIR+MEM_VOLDESC,%bx # Root directory record + push %bx + push %si + mov $msg_lookup,%si # Display lookup message + call putstr + pop %si + push %si + call putstr + mov $msg_lookup2,%si + call putstr + pop %si + pop %bx +lookup_dir: lodsb # Get first char of path + cmp $0,%al # Are we done? + je lookup_done # Yes + cmp $'/',%al # Skip path separator. + je lookup_dir + dec %si # Undo lodsb side effect + call find_file # Lookup first path item + jnc lookup_dir # Try next component + mov $msg_lookupfail,%si # Not found message + push %bx + call putstr + pop %bx + stc # Set carry + ret +lookup_done: mov $msg_lookupok,%si # Success message + push %bx + call putstr + pop %bx + clc # Clear carry + ret + +# +# Lookup file at [SI] in directory whose record is at [BX]. +# +# Trashes: All but returns +# Returns: CF = 0 (success), BX = pointer to record, SI = next path item +# CF = 1 (not found), SI = preserved +# +find_file: mov %es:DIR_EXTENT(%bx),%eax # Load extent + xor %edx,%edx + mov %es:DIR_EA_LEN(%bx),%dl + add %edx,%eax # Skip extended attributes + mov %eax,rec_lba # Save LBA + mov %es:DIR_SIZE(%bx),%eax # Save size + mov %eax,rec_size + xor %cl,%cl # Zero length + push %si # Save +ff.namelen: inc %cl # Update length + lodsb # Read char + cmp $0,%al # Nul? + je ff.namedone # Yes + cmp $'/',%al # Path separator? + jnz ff.namelen # No, keep going +ff.namedone: dec %cl # Adjust length and save + mov %cl,name_len + pop %si # Restore +ff.load: mov rec_lba,%eax # Load LBA + mov $MEM_DIR,%ebx # Address buffer + mov $1,%dh # One sector + call read # Read directory block + incl rec_lba # Update LBA to next block +ff.scan: mov %ebx,%edx # Check for EOF + sub $MEM_DIR,%edx + cmp %edx,rec_size + ja ff.scan.1 + stc # EOF reached + ret +ff.scan.1: cmpb $0,%es:DIR_LEN(%bx) # Last record in block? + je ff.nextblock + push %si # Save + movzbw %es:DIR_NAMELEN(%bx),%si # Find end of string +ff.checkver: cmpb $'0',%es:DIR_NAME-1(%bx,%si) # Less than '0'? + jb ff.checkver.1 + cmpb $'9',%es:DIR_NAME-1(%bx,%si) # Greater than '9'? + ja ff.checkver.1 + dec %si # Next char + jnz ff.checkver + jmp ff.checklen # All numbers in name, so + # no version +ff.checkver.1: movzbw %es:DIR_NAMELEN(%bx),%cx + cmp %cx,%si # Did we find any digits? + je ff.checkdot # No + cmpb $';',%es:DIR_NAME-1(%bx,%si) # Check for semicolon + jne ff.checkver.2 + dec %si # Skip semicolon + mov %si,%cx + mov %cl,%es:DIR_NAMELEN(%bx) # Adjust length + jmp ff.checkdot +ff.checkver.2: mov %cx,%si # Restore %si to end of string +ff.checkdot: cmpb $'.',%es:DIR_NAME-1(%bx,%si) # Trailing dot? + jne ff.checklen # No + decb %es:DIR_NAMELEN(%bx) # Adjust length +ff.checklen: pop %si # Restore + movzbw name_len,%cx # Load length of name + cmp %cl,%es:DIR_NAMELEN(%bx) # Does length match? + je ff.checkname # Yes, check name +ff.nextrec: add %es:DIR_LEN(%bx),%bl # Next record + adc $0,%bh + jmp ff.scan +ff.nextblock: subl $SECTOR_SIZE,rec_size # Adjust size + jnc ff.load # If subtract ok, keep going + ret # End of file, so not found +ff.checkname: lea DIR_NAME(%bx),%di # Address name in record + push %si # Save + repe cmpsb # Compare name + je ff.match # We have a winner! + pop %si # Restore + jmp ff.nextrec # Keep looking. +ff.match: add $2,%sp # Discard saved %si + clc # Clear carry + ret + +# +# Load DH sectors starting at LBA EAX into [EBX]. +# +# Trashes: EAX +# +read: push %es # Save + push %bp + push %dx + push %cx + push %ebx + mov %bx,%bp # Set destination address + and $0x000f,%bp + shr $4,%ebx + mov %bx,%es + xor %bx,%bx # Set read bytes + mov %dh,%bl + shl $SECTOR_SHIFT,%bx # 2048 bytes/sec + mov %ax,%cx # Set LBA + shr $16,%eax + mov %ax,%dx +read.retry: mov $0x06,%ah # BIOS device read + mov drive,%al + and $0x7f,%al + call twiddle # Entertain the user + int $0x1b # Call BIOS + jc read.fail # Worked? + pop %ebx # Restore + pop %cx + pop %dx + pop %bp + pop %es + ret # Return +read.fail: cmp $ERROR_TIMEOUT,%ah # Timeout? + je read.retry # Yes, Retry. +read.error: mov %ah,%al # Save error + mov $hex_error,%di # Format it + call hex8 # as hex + mov $msg_badread,%si # Display Read error message + jmp error + +# +# Output the "twiddle" +# +twiddle: push %ax # Save + push %bx # Save + mov twiddle_index,%al # Load index + mov $twiddle_chars,%bx # Address table + inc %al # Next + and $3,%al # char + mov %al,twiddle_index # Save index for next call + xlat # Get char + call putc # Output it + pop %bx # Restore + pop %ax # Restore + ret + +# +# Convert AL to hex, saving the result to [EDI]. +# +hex8: pushl %eax # Save + shrb $0x4,%al # Do upper + call hex8.1 # 4 + popl %eax # Restore +hex8.1: andb $0xf,%al # Get lower 4 + cmpb $0xa,%al # Convert + sbbb $0x69,%al # to hex + das # digit + orb $0x20,%al # To lower case + mov %al,(%di) # Save char + inc %di + ret # (Recursive) + +# +# BTX client to start btxldr +# + .code32 +btx_client: mov $(MEM_ARG_BTX-MEM_BTX_CLIENT+MEM_ARG_SIZE-4), %esi + # %ds:(%esi) -> end + # of boot[12] args + mov $(MEM_ARG_SIZE/4),%ecx # Number of words to push + std # Go backwards +push_arg: lodsl # Read argument + push %eax # Push it onto the stack + loop push_arg # Push all of the arguments + cld # In case anyone depends on this + pushl MEM_ARG_BTX-MEM_BTX_CLIENT+MEM_ARG_SIZE # Entry point of + # the loader + push %eax # Emulate a near call + mov $0x1,%eax # 'exec' system call + int $INT_SYS # BTX system call +btx_client_end: + .code16 + + .p2align 4 +# +# Global descriptor table. +# +gdt: .word 0x0,0x0,0x0,0x0 # Null entry + .word 0xffff,0x0000,0x9200,0x00cf # SEL_SDATA + .word 0xffff,0x0000,0x9200,0x0000 # SEL_RDATA + .word 0xffff,LOAD_SEG<<4,0x9a00,0x00cf # SEL_SCODE (32-bit) + .word 0xffff,LOAD_SEG<<4,0x9a00,0x008f # SEL_SCODE16 (16-bit) +gdt.1: +# +# Pseudo-descriptors. +# +gdtdesc: .word gdt.1-gdt-1 # Limit + .long LOAD_SEG<<4 + gdt # Base + +# +# BOOT device +# +drive: .byte 0 +cylinder: .word 0 + +# +# State for searching dir +# +rec_lba: .long 0x0 # LBA (adjusted for EA) +rec_size: .long 0x0 # File size +name_len: .byte 0x0 # Length of current name + +cursor: .word 0 +twiddle_index: .byte 0x0 + +msg_welcome: .asciz "CD Loader 1.2\r\n\n" +msg_bootinfo: .asciz "Building the boot loader arguments\r\n" +msg_relocate: .asciz "Relocating the loader and the BTX\r\n" +msg_jump: .asciz "Starting the BTX loader\r\n" +msg_badread: .ascii "Read Error: 0x" +hex_error: .asciz "00\r\n" +msg_novd: .asciz "Could not find Primary Volume Descriptor\r\n" +msg_lookup: .asciz "Looking up " +msg_lookup2: .asciz "... " +msg_lookupok: .asciz "Found\r\n" +msg_lookupfail: .asciz "File not found\r\n" +msg_load2big: .asciz "File too big\r\n" +msg_failed: .asciz "Boot failed\r\n" +twiddle_chars: .ascii "|/-\\" +loader_paths: .asciz "/BOOT.PC98/LOADER" + .asciz "/boot.pc98/loader" + .asciz "/BOOT/LOADER" + .asciz "/boot/loader" + .byte 0 + +/* Boot signature */ + + .org SIG2_OFF,0x90 + + .word 0xaa55 # Magic number Modified: stable/8/sys/boot/pc98/loader/main.c ============================================================================== --- stable/8/sys/boot/pc98/loader/main.c Fri Jun 29 10:12:18 2012 (r237763) +++ stable/8/sys/boot/pc98/loader/main.c Fri Jun 29 10:12:27 2012 (r237764) @@ -33,28 +33,24 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include #include "bootstrap.h" +#include "common/bootargs.h" #include "libi386/libi386.h" #include "libpc98/libpc98.h" #include "btxv86.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:18:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 214DD106566C; Fri, 29 Jun 2012 10:18:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 083F68FC1B; Fri, 29 Jun 2012 10:18:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TAIapA039339; Fri, 29 Jun 2012 10:18:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TAIaIL039322; Fri, 29 Jun 2012 10:18:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291018.q5TAIaIL039322@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237765 - in stable/8/sys: boot/common boot/i386/libi386 boot/i386/loader boot/i386/zfsboot boot/ofw/libofw boot/sparc64/loader boot/zfs cddl/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:18:37 -0000 Author: avg Date: Fri Jun 29 10:18:36 2012 New Revision: 237765 URL: http://svn.freebsd.org/changeset/base/237765 Log: MFC r235329,235343,235361,235364: zfsboot/zfsloader: support accessing filesystems within a pool Added: stable/8/sys/boot/zfs/devicename_stubs.c - copied unchanged from r235329, head/sys/boot/zfs/devicename_stubs.c stable/8/sys/boot/zfs/libzfs.h - copied unchanged from r235329, head/sys/boot/zfs/libzfs.h Modified: stable/8/sys/boot/common/bootstrap.h stable/8/sys/boot/i386/libi386/Makefile stable/8/sys/boot/i386/libi386/devicename.c stable/8/sys/boot/i386/libi386/libi386.h stable/8/sys/boot/i386/loader/conf.c stable/8/sys/boot/i386/loader/main.c stable/8/sys/boot/i386/zfsboot/zfsboot.c stable/8/sys/boot/ofw/libofw/Makefile stable/8/sys/boot/ofw/libofw/devicename.c stable/8/sys/boot/ofw/libofw/libofw.h stable/8/sys/boot/sparc64/loader/Makefile stable/8/sys/boot/sparc64/loader/main.c stable/8/sys/boot/zfs/zfs.c stable/8/sys/boot/zfs/zfsimpl.c stable/8/sys/cddl/boot/zfs/zfsimpl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/common/bootstrap.h ============================================================================== --- stable/8/sys/boot/common/bootstrap.h Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/common/bootstrap.h Fri Jun 29 10:18:36 2012 (r237765) @@ -301,6 +301,9 @@ struct arch_switch void (*arch_isaoutb)(int port, int value); /* Pass in initial kernel memory size */ void (*arch_maphint)(vm_offset_t va, size_t len); + + /* Probe ZFS pool(s), if needed. */ + void (*arch_zfs_probe)(void); }; extern struct arch_switch archsw; Modified: stable/8/sys/boot/i386/libi386/Makefile ============================================================================== --- stable/8/sys/boot/i386/libi386/Makefile Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/i386/libi386/Makefile Fri Jun 29 10:18:36 2012 (r237765) @@ -9,6 +9,8 @@ SRCS= biosacpi.c bioscd.c biosdisk.c bio elf64_freebsd.c \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ smbios.c time.c vidconsole.c amd64_tramp.S +.PATH: ${.CURDIR}/../../zfs +SRCS+= devicename_stubs.c # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) Modified: stable/8/sys/boot/i386/libi386/devicename.c ============================================================================== --- stable/8/sys/boot/i386/libi386/devicename.c Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/i386/libi386/devicename.c Fri Jun 29 10:18:36 2012 (r237765) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" #include "libi386.h" +#include "../zfs/libzfs.h" static int i386_parsedev(struct i386_devdesc **dev, const char *devspec, const char **path); @@ -171,7 +172,6 @@ i386_parsedev(struct i386_devdesc **dev, case DEVT_CD: case DEVT_NET: - case DEVT_ZFS: unit = 0; if (*np && (*np != ':')) { @@ -192,7 +192,11 @@ i386_parsedev(struct i386_devdesc **dev, if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; break; - + case DEVT_ZFS: + err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); + if (err != 0) + goto fail; + break; default: err = EINVAL; goto fail; @@ -247,9 +251,10 @@ i386_fmtdev(void *vdev) break; case DEVT_NET: - case DEVT_ZFS: sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); break; + case DEVT_ZFS: + return(zfs_fmtdev(vdev)); } return(buf); } Modified: stable/8/sys/boot/i386/libi386/libi386.h ============================================================================== --- stable/8/sys/boot/i386/libi386/libi386.h Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/i386/libi386/libi386.h Fri Jun 29 10:18:36 2012 (r237765) @@ -30,7 +30,8 @@ /* * i386 fully-qualified device descriptor. * Note, this must match the 'struct devdesc' declaration - * in bootstrap.h. + * in bootstrap.h and also with struct zfs_devdesc for zfs + * support. */ struct i386_devdesc { @@ -49,6 +50,12 @@ struct i386_devdesc { void *data; } bioscd; + struct + { + void *data; + uint64_t pool_guid; + uint64_t root_guid; + } zfs; } d_kind; }; Modified: stable/8/sys/boot/i386/loader/conf.c ============================================================================== --- stable/8/sys/boot/i386/loader/conf.c Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/i386/loader/conf.c Fri Jun 29 10:18:36 2012 (r237765) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include #include #include "libi386/libi386.h" +#if defined(LOADER_ZFS_SUPPORT) +#include "../zfs/libzfs.h" +#endif /* * We could use linker sets for some or all of these, but @@ -50,10 +53,6 @@ __FBSDID("$FreeBSD$"); extern struct devsw fwohci; #endif -#if defined(LOADER_ZFS_SUPPORT) -extern struct devsw zfs_dev; -#endif - /* Exported for libstand */ struct devsw *devsw[] = { &bioscd, @@ -70,10 +69,6 @@ struct devsw *devsw[] = { NULL }; -#if defined(LOADER_ZFS_SUPPORT) -extern struct fs_ops zfs_fsops; -#endif - struct fs_ops *file_system[] = { &ufs_fsops, &ext2fs_fsops, Modified: stable/8/sys/boot/i386/loader/main.c ============================================================================== --- stable/8/sys/boot/i386/loader/main.c Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/i386/loader/main.c Fri Jun 29 10:18:36 2012 (r237765) @@ -44,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include "libi386/libi386.h" #include "btxv86.h" +#ifdef LOADER_ZFS_SUPPORT +#include "../zfs/libzfs.h" +#endif + CTASSERT(sizeof(struct bootargs) == BOOTARGS_SIZE); CTASSERT(offsetof(struct bootargs, bootinfo) == BA_BOOTINFO); CTASSERT(offsetof(struct bootargs, bootflags) == BA_BOOTFLAGS); @@ -62,6 +66,9 @@ static void extract_currdev(void); static int isa_inb(int port); static void isa_outb(int port, int value); void exit(int code); +#ifdef LOADER_ZFS_SUPPORT +static void i386_zfs_probe(void); +#endif /* from vers.c */ extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; @@ -153,6 +160,9 @@ main(void) archsw.arch_readin = i386_readin; archsw.arch_isainb = isa_inb; archsw.arch_isaoutb = isa_outb; +#ifdef LOADER_ZFS_SUPPORT + archsw.arch_zfs_probe = i386_zfs_probe; +#endif /* * March through the device switch probing for things. @@ -196,8 +206,11 @@ main(void) static void extract_currdev(void) { - struct i386_devdesc new_currdev; - int biosdev = -1; + struct i386_devdesc new_currdev; +#ifdef LOADER_ZFS_SUPPORT + struct zfs_boot_args *zargs; +#endif + int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ new_currdev.d_dev = &biosdisk; @@ -218,6 +231,24 @@ extract_currdev(void) new_currdev.d_kind.biosdisk.partition = 0; biosdev = -1; } +#ifdef LOADER_ZFS_SUPPORT + } else if ((kargs->bootflags & KARGS_FLAGS_ZFS) != 0) { + zargs = NULL; + /* check for new style extended argument */ + if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0) + zargs = (struct zfs_boot_args *)(kargs + 1); + + if (zargs != NULL && zargs->size >= sizeof(*zargs)) { + /* sufficient data is provided */ + new_currdev.d_kind.zfs.pool_guid = zargs->pool; + new_currdev.d_kind.zfs.root_guid = zargs->root; + } else { + /* old style zfsboot block */ + new_currdev.d_kind.zfs.pool_guid = kargs->zfspool; + new_currdev.d_kind.zfs.root_guid = 0; + } + new_currdev.d_dev = &zfs_dev; +#endif } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) { /* The passed-in boot device is bad */ new_currdev.d_kind.biosdisk.slice = -1; @@ -238,7 +269,7 @@ extract_currdev(void) biosdev = 0x80 + B_UNIT(initial_bootdev); /* assume harddisk */ } new_currdev.d_type = new_currdev.d_dev->dv_type; - + /* * If we are booting off of a BIOS disk and we didn't succeed in determining * which one we booted off of, just use disk0: as a reasonable default. @@ -249,33 +280,11 @@ extract_currdev(void) "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev); new_currdev.d_unit = 0; } + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, env_nounset); - -#ifdef LOADER_ZFS_SUPPORT - /* - * If we were started from a ZFS-aware boot2, we can work out - * which ZFS pool we are booting from. - */ - if (kargs->bootflags & KARGS_FLAGS_ZFS) { - /* - * Dig out the pool guid and convert it to a 'unit number' - */ - uint64_t guid; - int unit; - char devname[32]; - extern int zfs_guid_to_unit(uint64_t); - - guid = kargs->zfspool; - unit = zfs_guid_to_unit(guid); - if (unit >= 0) { - sprintf(devname, "zfs%d", unit); - setenv("currdev", devname, 1); - } - } -#endif } COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); @@ -342,3 +351,30 @@ isa_outb(int port, int value) } } +#ifdef LOADER_ZFS_SUPPORT +static void +i386_zfs_probe(void) +{ + char devname[32]; + int unit, slice; + + /* + * Open all the disks we can find and see if we can reconstruct + * ZFS pools from them. Bogusly assumes that the disks are named + * diskN, diskNpM or diskNsM. + */ + for (unit = 0; unit < MAXBDDEV; unit++) { + sprintf(devname, "disk%d:", unit); + if (zfs_probe_dev(devname, NULL) == ENXIO) + continue; + for (slice = 1; slice <= 128; slice++) { + sprintf(devname, "disk%dp%d:", unit, slice); + zfs_probe_dev(devname, NULL); + } + for (slice = 1; slice <= 4; slice++) { + sprintf(devname, "disk%ds%d:", unit, slice); + zfs_probe_dev(devname, NULL); + } + } +} +#endif Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:18:36 2012 (r237765) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include "cons.h" #include "bootargs.h" +#include "libzfs.h" + #define PATH_DOTCONFIG "/boot.config" #define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/zfsloader" @@ -91,9 +93,12 @@ static const unsigned char dev_maj[NDEV] static char cmd[512]; static char cmddup[512]; static char kname[1024]; +static char rootname[256]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint32_t bootdev; +static struct zfs_boot_args zfsargs; +static struct zfsmount zfsmount; vm_offset_t high_heap_base; uint32_t bios_basemem, bios_extmem, high_heap_size; @@ -170,7 +175,7 @@ zfs_read(spa_t *spa, const dnode_phys_t /* * Current ZFS pool */ -spa_t *spa; +static spa_t *spa; /* * A wrapper for dskread that doesn't have to worry about whether the @@ -209,7 +214,7 @@ static int xfsread(const dnode_phys_t *dnode, off_t *offp, void *buf, size_t nbyte) { if ((size_t)zfs_read(spa, dnode, offp, buf, nbyte) != nbyte) { - printf("Invalid %s\n", "format"); + printf("Invalid format\n"); return -1; } return 0; @@ -524,10 +529,12 @@ main(void) } } - zfs_mount_pool(spa); - - if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0 || - zfs_lookup(spa, PATH_DOTCONFIG, &dn) == 0) { + if (zfs_spa_init(spa) != 0 || zfs_mount(spa, 0, &zfsmount) != 0) { + printf("%s: failed to mount default pool %s\n", + BOOTPROG, spa->spa_name); + autoboot = 0; + } else if (zfs_lookup(&zfsmount, PATH_CONFIG, &dn) == 0 || + zfs_lookup(&zfsmount, PATH_DOTCONFIG, &dn) == 0) { off = 0; zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); } @@ -562,11 +569,17 @@ main(void) /* Present the user with the boot2 prompt. */ for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) - printf("\nFreeBSD/x86 boot\n" - "Default: %s:%s\n" - "boot: ", - spa->spa_name, kname); + if (!autoboot || !OPT_CHECK(RBX_QUIET)) { + printf("\nFreeBSD/x86 boot\n"); + if (zfs_rlookup(spa, zfsmount.rootobj, rootname) != 0) + printf("Default: %s:<0x%llx>:%s\n" + "boot: ", + spa->spa_name, zfsmount.rootobj, kname); + else + printf("Default: %s:%s:%s\n" + "boot: ", + spa->spa_name, rootname, kname); + } if (ioctrl & IO_SERIAL) sio_flush(); if (!autoboot || keyhit(5)) @@ -602,7 +615,8 @@ load(void) uint32_t addr, x; int fmt, i, j; - if (zfs_lookup(spa, kname, &dn)) { + if (zfs_lookup(&zfsmount, kname, &dn)) { + printf("\nCan't find %s\n", kname); return; } off = 0; @@ -676,12 +690,16 @@ load(void) } bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); + zfsargs.size = sizeof(zfsargs); + zfsargs.pool = zfsmount.spa->spa_guid; + zfsargs.root = zfsmount.rootobj; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), bootdev, - KARGS_FLAGS_ZFS, + KARGS_FLAGS_ZFS | KARGS_FLAGS_EXTARG, (uint32_t) spa->spa_guid, (uint32_t) (spa->spa_guid >> 32), - VTOP(&bootinfo)); + VTOP(&bootinfo), + zfsargs); } static int @@ -733,7 +751,7 @@ parse(void) } if (c == '?') { dnode_phys_t dn; - if (zfs_lookup(spa, arg, &dn) == 0) { + if (zfs_lookup(&zfsmount, arg, &dn) == 0) { zap_list(spa, &dn); } return -1; @@ -755,17 +773,32 @@ parse(void) q = (char *) strchr(arg, ':'); if (q) { spa_t *newspa; + uint64_t newroot; *q++ = 0; newspa = spa_find_by_name(arg); if (newspa) { + arg = q; spa = newspa; - zfs_mount_pool(spa); + newroot = 0; + q = (char *) strchr(arg, ':'); + if (q) { + *q++ = 0; + if (zfs_lookup_dataset(spa, arg, &newroot)) { + printf("\nCan't find dataset %s in ZFS pool %s\n", + arg, spa->spa_name); + return -1; + } + arg = q; + } + if (zfs_mount(spa, newroot, &zfsmount)) { + printf("\nCan't mount ZFS dataset\n"); + return -1; + } } else { printf("\nCan't find ZFS pool %s\n", arg); return -1; } - arg = q; } if ((i = ep - arg)) { if ((size_t)i >= sizeof(kname)) Modified: stable/8/sys/boot/ofw/libofw/Makefile ============================================================================== --- stable/8/sys/boot/ofw/libofw/Makefile Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/ofw/libofw/Makefile Fri Jun 29 10:18:36 2012 (r237765) @@ -6,6 +6,8 @@ INTERNALLIB= SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \ ofw_time.c openfirm.c +.PATH: ${.CURDIR}/../../zfs +SRCS+= devicename_stubs.c CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ Modified: stable/8/sys/boot/ofw/libofw/devicename.c ============================================================================== --- stable/8/sys/boot/ofw/libofw/devicename.c Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/ofw/libofw/devicename.c Fri Jun 29 10:18:36 2012 (r237765) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libofw.h" +#include "../zfs/libzfs.h" static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); @@ -81,6 +82,7 @@ ofw_parsedev(struct ofw_devdesc **dev, c char *ep; char name[256]; char type[64]; + int err; int len; int i; @@ -114,14 +116,11 @@ found: idev->d_dev = dv; idev->d_type = dv->dv_type; if (idev->d_type == DEVT_ZFS) { - idev->d_unit = 0; - p = name + strlen(dv->dv_name); - if (*p && (*p != ':')) { - idev->d_unit = strtol(p, &ep, 0); - if (ep == p) { - free(idev); - return (EUNIT); - } + p = devspec + strlen(dv->dv_name); + err = zfs_parsedev((struct zfs_devdesc *)idev, p, path); + if (err != 0) { + free(idev); + return (err); } } Modified: stable/8/sys/boot/ofw/libofw/libofw.h ============================================================================== --- stable/8/sys/boot/ofw/libofw/libofw.h Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/ofw/libofw/libofw.h Fri Jun 29 10:18:36 2012 (r237765) @@ -33,7 +33,13 @@ struct ofw_devdesc { int d_type; int d_unit; ihandle_t d_handle; - char d_path[256]; + union { + char d_path[256]; + struct { + uint64_t pool_guid; + uint64_t root_guid; + }; + }; }; extern int ofw_getdev(void **vdev, const char *devspec, const char **path); Modified: stable/8/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/8/sys/boot/sparc64/loader/Makefile Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/sparc64/loader/Makefile Fri Jun 29 10:18:36 2012 (r237765) @@ -37,6 +37,7 @@ CFLAGS+= -DLOADER_CD9660_SUPPORT CFLAGS+= -DLOADER_ZFS_SUPPORT CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif .if ${LOADER_GZIP_SUPPORT} == "yes" CFLAGS+= -DLOADER_GZIP_SUPPORT @@ -83,8 +84,8 @@ CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ # where to get libstand from CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} -lstand +DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/sparc64/loader/main.c Fri Jun 29 10:18:36 2012 (r237765) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef LOADER_ZFS_SUPPORT #include +#include "../zfs/libzfs.h" #endif #include @@ -74,6 +75,8 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" +#define MAXDEV 31 + extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; enum { @@ -154,11 +157,6 @@ static vm_offset_t heapva; static phandle_t root; -#ifdef LOADER_ZFS_SUPPORT -static int zfs_dev_init(void); -#include "zfs.c" -#endif - /* * Machine dependent structures that the machine independent * loader part uses. @@ -838,39 +836,20 @@ tlb_init_sun4v(void) } #ifdef LOADER_ZFS_SUPPORT - -static int -zfs_dev_init(void) +static void +sparc64_zfs_probe(void) { struct vtoc8 vtoc; - char devname[512]; - spa_t *spa; - vdev_t *vdev; + struct zfs_devdesc zfs_currdev; + char devname[32]; uint64_t guid; int fd, part, unit; - zfs_init(); - - guid = 0; /* Get the GUID of the ZFS pool on the boot device. */ - fd = open(getenv("currdev"), O_RDONLY); - if (fd != -1) { - if (vdev_probe(vdev_read, (void *)(uintptr_t) fd, &spa) == 0) - guid = spa->spa_guid; - close(fd); - } - - /* Clean up the environment to let ZFS work. */ - while ((vdev = STAILQ_FIRST(&zfs_vdevs)) != NULL) { - STAILQ_REMOVE_HEAD(&zfs_vdevs, v_alllink); - free(vdev); - } - while ((spa = STAILQ_FIRST(&zfs_pools)) != NULL) { - STAILQ_REMOVE_HEAD(&zfs_pools, spa_link); - free(spa); - } + guid = 0; + zfs_probe_dev(getenv("currdev"), &guid); - for (unit = 0; unit < MAXBDDEV; unit++) { + for (unit = 0; unit < MAXDEV; unit++) { /* Find freebsd-zfs slices in the VTOC. */ sprintf(devname, "disk%d:", unit); fd = open(devname, O_RDONLY); @@ -888,29 +867,23 @@ zfs_dev_init(void) VTOC_TAG_FREEBSD_ZFS) continue; sprintf(devname, "disk%d:%c", unit, part + 'a'); - fd = open(devname, O_RDONLY); - if (fd == -1) + if (zfs_probe_dev(devname, NULL) == ENXIO) break; - - if (vdev_probe(vdev_read, (void*)(uintptr_t) fd, 0)) - close(fd); } } if (guid != 0) { - unit = zfs_guid_to_unit(guid); - if (unit >= 0) { - /* Update the environment for ZFS. */ - sprintf(devname, "zfs%d", unit); - env_setenv("currdev", EV_VOLATILE, devname, - ofw_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, - env_noset, env_nounset); - } + zfs_currdev.pool_guid = guid; + zfs_currdev.root_guid = 0; + zfs_currdev.d_dev = &zfs_dev; + zfs_currdev.d_type = zfs_currdev.d_dev->dv_type; + /* Update the environment for ZFS. */ + env_setenv("currdev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev), + ofw_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev), + env_noset, env_nounset); } - return (0); } - #endif /* LOADER_ZFS_SUPPORT */ int @@ -931,6 +904,9 @@ main(int (*openfirm)(void *)) archsw.arch_readin = sparc64_readin; archsw.arch_autoload = sparc64_autoload; archsw.arch_maphint = sparc64_maphint; +#ifdef LOADER_ZFS_SUPPORT + archsw.arch_zfs_probe = sparc64_zfs_probe; +#endif if (init_heap() == (vm_offset_t)-1) OF_exit(); Copied: stable/8/sys/boot/zfs/devicename_stubs.c (from r235329, head/sys/boot/zfs/devicename_stubs.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/zfs/devicename_stubs.c Fri Jun 29 10:18:36 2012 (r237765, copy of r235329, head/sys/boot/zfs/devicename_stubs.c) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2012 Andriy Gapon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include "libzfs.h" + +__attribute__((weak)) +int +zfs_parsedev(struct zfs_devdesc *dev, const char *devspec, const char **path) +{ + return (EINVAL); +} + +__attribute__((weak)) +char * +zfs_fmtdev(void *vdev) +{ + static char buf[128]; + + return (buf); +} Copied: stable/8/sys/boot/zfs/libzfs.h (from r235329, head/sys/boot/zfs/libzfs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/boot/zfs/libzfs.h Fri Jun 29 10:18:36 2012 (r237765, copy of r235329, head/sys/boot/zfs/libzfs.h) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2012 Andriy Gapon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _BOOT_LIBZFS_H_ +#define _BOOT_LIBZFS_H_ + +#define ZFS_MAXNAMELEN 256 + +/* + * ZFS fully-qualified device descriptor. + * Note, this must match the 'struct devdesc' declaration in bootstrap.h. + * Arch-specific device descriptors should be binary compatible with this + * structure if they are to support ZFS. + */ +struct zfs_devdesc +{ + struct devsw *d_dev; + int d_type; + int d_unit; + void *d_opendata; + uint64_t pool_guid; + uint64_t root_guid; +}; + +struct zfs_boot_args +{ + uint32_t size; + uint32_t reserved; + uint64_t pool; + uint64_t root; +}; + +int zfs_parsedev(struct zfs_devdesc *dev, const char *devspec, + const char **path); +char *zfs_fmtdev(void *vdev); +int zfs_probe_dev(const char *devname, uint64_t *pool_guid); + +extern struct devsw zfs_dev; +extern struct fs_ops zfs_fsops; + +#endif /*_BOOT_LIBZFS_H_*/ Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Fri Jun 29 10:12:27 2012 (r237764) +++ stable/8/sys/boot/zfs/zfs.c Fri Jun 29 10:18:36 2012 (r237765) @@ -43,9 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include "zfsimpl.c" +#include "libzfs.h" -#define MAXBDDEV 31 +#include "zfsimpl.c" static int zfs_open(const char *path, struct open_file *f); static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); @@ -56,6 +56,7 @@ static int zfs_stat(struct open_file *f, static int zfs_readdir(struct open_file *f, struct dirent *d); struct devsw zfs_dev; +struct devsw zfs_dev_compat; struct fs_ops zfs_fsops = { "zfs", @@ -85,35 +86,20 @@ struct file { static int zfs_open(const char *upath, struct open_file *f) { - spa_t *spa = (spa_t *) f->f_devdata; + struct zfsmount *mount = (struct zfsmount *)f->f_devdata; struct file *fp; int rc; - if (f->f_dev != &zfs_dev) + if (f->f_dev != &zfs_dev && f->f_dev != &zfs_dev_compat) return (EINVAL); - rc = zfs_mount_pool(spa); - if (rc) - return (rc); - /* allocate file system specific data structure */ fp = malloc(sizeof(struct file)); bzero(fp, sizeof(struct file)); f->f_fsdata = (void *)fp; - if (spa->spa_root_objset.os_type != DMU_OST_ZFS) { - printf("Unexpected object set type %llu\n", - spa->spa_root_objset.os_type); - rc = EIO; - goto out; - } - - rc = zfs_lookup(spa, upath, &fp->f_dnode); - if (rc) - goto out; - + rc = zfs_lookup(mount, upath, &fp->f_dnode); fp->f_seekp = 0; -out: if (rc) { f->f_fsdata = NULL; free(fp); @@ -142,7 +128,7 @@ zfs_close(struct open_file *f) static int zfs_read(struct open_file *f, void *start, size_t size, size_t *resid /* out */) { - spa_t *spa = (spa_t *) f->f_devdata; + spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; struct stat sb; size_t n; @@ -216,7 +202,7 @@ zfs_seek(struct open_file *f, off_t offs static int zfs_stat(struct open_file *f, struct stat *sb) { - spa_t *spa = (spa_t *) f->f_devdata; + spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; return (zfs_dnode_stat(spa, &fp->f_dnode, sb)); @@ -225,7 +211,7 @@ zfs_stat(struct open_file *f, struct sta static int zfs_readdir(struct open_file *f, struct dirent *d) { - spa_t *spa = (spa_t *) f->f_devdata; + spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; mzap_ent_phys_t mze; struct stat sb; @@ -381,68 +367,33 @@ vdev_read(vdev_t *vdev, void *priv, off_ } } -/* - * Convert a pool guid to a 'unit number' suitable for use with zfs_dev_open. - */ -int -zfs_guid_to_unit(uint64_t guid) +static int +zfs_dev_init(void) { - spa_t *spa; - int unit; - - unit = 0; - STAILQ_FOREACH(spa, &zfs_pools, spa_link) { - if (spa->spa_guid == guid) - return unit; - unit++; - } - return (-1); + zfs_init(); + if (archsw.arch_zfs_probe == NULL) + return (ENXIO); + archsw.arch_zfs_probe(); + return (0); } -#if defined(__amd64__) || defined(__i386__) -static int -zfs_dev_init(void) +int +zfs_probe_dev(const char *devname, uint64_t *pool_guid) { - char devname[512]; - int unit, slice; + spa_t *spa; int fd; + int ret; - /* - * Open all the disks we can find and see if we can reconstruct - * ZFS pools from them. Bogusly assumes that the disks are named - * diskN, diskNpM or diskNsM. - */ - zfs_init(); - for (unit = 0; unit < MAXBDDEV; unit++) { - sprintf(devname, "disk%d:", unit); - fd = open(devname, O_RDONLY); - if (fd == -1) - continue; - - /* - * If we find a vdev, the zfs code will eat the fd, otherwise - * we close it. - */ - if (vdev_probe(vdev_read, (void*) (uintptr_t) fd, 0)) - close(fd); - - for (slice = 1; slice <= 128; slice++) { - sprintf(devname, "disk%dp%d:", unit, slice); - fd = open(devname, O_RDONLY); - if (fd == -1) { - sprintf(devname, "disk%ds%d:", unit, slice); - fd = open(devname, O_RDONLY); - if (fd == -1) - continue; - } - if (vdev_probe(vdev_read, (void*) (uintptr_t) fd, 0)) - close(fd); - } - } - + fd = open(devname, O_RDONLY); + if (fd == -1) + return (ENXIO); + ret = vdev_probe(vdev_read, (void *)(uintptr_t)fd, &spa); + if (ret != 0) + close(fd); + else if (pool_guid != NULL) + *pool_guid = spa->spa_guid; return (0); } -#endif /* * Print information about ZFS pools @@ -452,54 +403,52 @@ zfs_dev_print(int verbose) { spa_t *spa; char line[80]; - int unit; if (verbose) { spa_all_status(); return; } - unit = 0; STAILQ_FOREACH(spa, &zfs_pools, spa_link) { - sprintf(line, " zfs%d: %s\n", unit, spa->spa_name); + sprintf(line, " zfs:%s\n", spa->spa_name); pager_output(line); - unit++; } } /* * Attempt to open the pool described by (dev) for use by (f). */ -static int +static int zfs_dev_open(struct open_file *f, ...) { va_list args; - struct devdesc *dev; - int unit, i; + struct zfs_devdesc *dev; + struct zfsmount *mount; spa_t *spa; + int rv; va_start(args, f); - dev = va_arg(args, struct devdesc*); + dev = va_arg(args, struct zfs_devdesc *); va_end(args); - /* - * We mostly ignore the stuff that devopen sends us. For now, - * use the unit to find a pool - later we will override the - * devname parsing so that we can name a pool and a fs within - * the pool. - */ - unit = dev->d_unit; - - i = 0; - STAILQ_FOREACH(spa, &zfs_pools, spa_link) { - if (i == unit) - break; - i++; - } - if (!spa) { + spa = spa_find_by_guid(dev->pool_guid); + if (!spa) return (ENXIO); + rv = zfs_spa_init(spa); + if (rv != 0) + return (rv); + mount = malloc(sizeof(*mount)); + rv = zfs_mount(spa, dev->root_guid, mount); + if (rv != 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:19:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0333B1065672; Fri, 29 Jun 2012 10:19:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE8498FC0A; Fri, 29 Jun 2012 10:19:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TAJFbZ039415; Fri, 29 Jun 2012 10:19:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TAJF75039397; Fri, 29 Jun 2012 10:19:15 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291019.q5TAJF75039397@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237766 - in stable/9/sys: boot boot/common boot/i386/libi386 boot/i386/loader boot/i386/zfsboot boot/ofw/libofw boot/sparc64/loader boot/zfs cddl/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:19:16 -0000 Author: avg Date: Fri Jun 29 10:19:15 2012 New Revision: 237766 URL: http://svn.freebsd.org/changeset/base/237766 Log: MFC r235329,235343,235361,235364: zfsboot/zfsloader: support accessing filesystems within a pool Added: stable/9/sys/boot/zfs/devicename_stubs.c - copied unchanged from r235329, head/sys/boot/zfs/devicename_stubs.c stable/9/sys/boot/zfs/libzfs.h - copied unchanged from r235329, head/sys/boot/zfs/libzfs.h Modified: stable/9/sys/boot/Makefile.sparc64 stable/9/sys/boot/common/bootstrap.h stable/9/sys/boot/i386/libi386/Makefile stable/9/sys/boot/i386/libi386/devicename.c stable/9/sys/boot/i386/libi386/libi386.h stable/9/sys/boot/i386/loader/conf.c stable/9/sys/boot/i386/loader/main.c stable/9/sys/boot/i386/zfsboot/zfsboot.c stable/9/sys/boot/ofw/libofw/Makefile stable/9/sys/boot/ofw/libofw/devicename.c stable/9/sys/boot/ofw/libofw/libofw.h stable/9/sys/boot/sparc64/loader/Makefile stable/9/sys/boot/sparc64/loader/main.c stable/9/sys/boot/zfs/zfs.c stable/9/sys/boot/zfs/zfsimpl.c stable/9/sys/cddl/boot/zfs/zfsimpl.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/Makefile.sparc64 ============================================================================== --- stable/9/sys/boot/Makefile.sparc64 Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/Makefile.sparc64 Fri Jun 29 10:19:15 2012 (r237766) @@ -1,3 +1,4 @@ # $FreeBSD$ SUBDIR+= ofw +SUBDIR+= zfs Modified: stable/9/sys/boot/common/bootstrap.h ============================================================================== --- stable/9/sys/boot/common/bootstrap.h Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/common/bootstrap.h Fri Jun 29 10:19:15 2012 (r237766) @@ -317,6 +317,9 @@ struct arch_switch #else void (*arch_loadseg)(void *eh, void *ph, uint64_t delta); #endif + + /* Probe ZFS pool(s), if needed. */ + void (*arch_zfs_probe)(void); }; extern struct arch_switch archsw; Modified: stable/9/sys/boot/i386/libi386/Makefile ============================================================================== --- stable/9/sys/boot/i386/libi386/Makefile Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/i386/libi386/Makefile Fri Jun 29 10:19:15 2012 (r237766) @@ -9,6 +9,8 @@ SRCS= biosacpi.c bioscd.c biosdisk.c bio elf64_freebsd.c \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c +.PATH: ${.CURDIR}/../../zfs +SRCS+= devicename_stubs.c # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) Modified: stable/9/sys/boot/i386/libi386/devicename.c ============================================================================== --- stable/9/sys/boot/i386/libi386/devicename.c Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/i386/libi386/devicename.c Fri Jun 29 10:19:15 2012 (r237766) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" #include "libi386.h" +#include "../zfs/libzfs.h" static int i386_parsedev(struct i386_devdesc **dev, const char *devspec, const char **path); @@ -171,7 +172,6 @@ i386_parsedev(struct i386_devdesc **dev, case DEVT_CD: case DEVT_NET: - case DEVT_ZFS: unit = 0; if (*np && (*np != ':')) { @@ -192,7 +192,11 @@ i386_parsedev(struct i386_devdesc **dev, if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; break; - + case DEVT_ZFS: + err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); + if (err != 0) + goto fail; + break; default: err = EINVAL; goto fail; @@ -247,9 +251,10 @@ i386_fmtdev(void *vdev) break; case DEVT_NET: - case DEVT_ZFS: sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); break; + case DEVT_ZFS: + return(zfs_fmtdev(vdev)); } return(buf); } Modified: stable/9/sys/boot/i386/libi386/libi386.h ============================================================================== --- stable/9/sys/boot/i386/libi386/libi386.h Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/i386/libi386/libi386.h Fri Jun 29 10:19:15 2012 (r237766) @@ -30,7 +30,8 @@ /* * i386 fully-qualified device descriptor. * Note, this must match the 'struct devdesc' declaration - * in bootstrap.h. + * in bootstrap.h and also with struct zfs_devdesc for zfs + * support. */ struct i386_devdesc { @@ -49,6 +50,12 @@ struct i386_devdesc { void *data; } bioscd; + struct + { + void *data; + uint64_t pool_guid; + uint64_t root_guid; + } zfs; } d_kind; }; Modified: stable/9/sys/boot/i386/loader/conf.c ============================================================================== --- stable/9/sys/boot/i386/loader/conf.c Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/i386/loader/conf.c Fri Jun 29 10:19:15 2012 (r237766) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include #include #include "libi386/libi386.h" +#if defined(LOADER_ZFS_SUPPORT) +#include "../zfs/libzfs.h" +#endif /* * We could use linker sets for some or all of these, but @@ -50,10 +53,6 @@ __FBSDID("$FreeBSD$"); extern struct devsw fwohci; #endif -#if defined(LOADER_ZFS_SUPPORT) -extern struct devsw zfs_dev; -#endif - /* Exported for libstand */ struct devsw *devsw[] = { &bioscd, @@ -70,10 +69,6 @@ struct devsw *devsw[] = { NULL }; -#if defined(LOADER_ZFS_SUPPORT) -extern struct fs_ops zfs_fsops; -#endif - struct fs_ops *file_system[] = { &ufs_fsops, &ext2fs_fsops, Modified: stable/9/sys/boot/i386/loader/main.c ============================================================================== --- stable/9/sys/boot/i386/loader/main.c Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/i386/loader/main.c Fri Jun 29 10:19:15 2012 (r237766) @@ -44,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include "libi386/libi386.h" #include "btxv86.h" +#ifdef LOADER_ZFS_SUPPORT +#include "../zfs/libzfs.h" +#endif + CTASSERT(sizeof(struct bootargs) == BOOTARGS_SIZE); CTASSERT(offsetof(struct bootargs, bootinfo) == BA_BOOTINFO); CTASSERT(offsetof(struct bootargs, bootflags) == BA_BOOTFLAGS); @@ -62,6 +66,9 @@ static void extract_currdev(void); static int isa_inb(int port); static void isa_outb(int port, int value); void exit(int code); +#ifdef LOADER_ZFS_SUPPORT +static void i386_zfs_probe(void); +#endif /* from vers.c */ extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; @@ -153,6 +160,9 @@ main(void) archsw.arch_readin = i386_readin; archsw.arch_isainb = isa_inb; archsw.arch_isaoutb = isa_outb; +#ifdef LOADER_ZFS_SUPPORT + archsw.arch_zfs_probe = i386_zfs_probe; +#endif /* * March through the device switch probing for things. @@ -196,8 +206,11 @@ main(void) static void extract_currdev(void) { - struct i386_devdesc new_currdev; - int biosdev = -1; + struct i386_devdesc new_currdev; +#ifdef LOADER_ZFS_SUPPORT + struct zfs_boot_args *zargs; +#endif + int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ new_currdev.d_dev = &biosdisk; @@ -218,6 +231,24 @@ extract_currdev(void) new_currdev.d_kind.biosdisk.partition = 0; biosdev = -1; } +#ifdef LOADER_ZFS_SUPPORT + } else if ((kargs->bootflags & KARGS_FLAGS_ZFS) != 0) { + zargs = NULL; + /* check for new style extended argument */ + if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0) + zargs = (struct zfs_boot_args *)(kargs + 1); + + if (zargs != NULL && zargs->size >= sizeof(*zargs)) { + /* sufficient data is provided */ + new_currdev.d_kind.zfs.pool_guid = zargs->pool; + new_currdev.d_kind.zfs.root_guid = zargs->root; + } else { + /* old style zfsboot block */ + new_currdev.d_kind.zfs.pool_guid = kargs->zfspool; + new_currdev.d_kind.zfs.root_guid = 0; + } + new_currdev.d_dev = &zfs_dev; +#endif } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) { /* The passed-in boot device is bad */ new_currdev.d_kind.biosdisk.slice = -1; @@ -238,7 +269,7 @@ extract_currdev(void) biosdev = 0x80 + B_UNIT(initial_bootdev); /* assume harddisk */ } new_currdev.d_type = new_currdev.d_dev->dv_type; - + /* * If we are booting off of a BIOS disk and we didn't succeed in determining * which one we booted off of, just use disk0: as a reasonable default. @@ -249,33 +280,11 @@ extract_currdev(void) "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev); new_currdev.d_unit = 0; } + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, env_nounset); - -#ifdef LOADER_ZFS_SUPPORT - /* - * If we were started from a ZFS-aware boot2, we can work out - * which ZFS pool we are booting from. - */ - if (kargs->bootflags & KARGS_FLAGS_ZFS) { - /* - * Dig out the pool guid and convert it to a 'unit number' - */ - uint64_t guid; - int unit; - char devname[32]; - extern int zfs_guid_to_unit(uint64_t); - - guid = kargs->zfspool; - unit = zfs_guid_to_unit(guid); - if (unit >= 0) { - sprintf(devname, "zfs%d", unit); - setenv("currdev", devname, 1); - } - } -#endif } COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); @@ -342,3 +351,30 @@ isa_outb(int port, int value) } } +#ifdef LOADER_ZFS_SUPPORT +static void +i386_zfs_probe(void) +{ + char devname[32]; + int unit, slice; + + /* + * Open all the disks we can find and see if we can reconstruct + * ZFS pools from them. Bogusly assumes that the disks are named + * diskN, diskNpM or diskNsM. + */ + for (unit = 0; unit < MAXBDDEV; unit++) { + sprintf(devname, "disk%d:", unit); + if (zfs_probe_dev(devname, NULL) == ENXIO) + continue; + for (slice = 1; slice <= 128; slice++) { + sprintf(devname, "disk%dp%d:", unit, slice); + zfs_probe_dev(devname, NULL); + } + for (slice = 1; slice <= 4; slice++) { + sprintf(devname, "disk%ds%d:", unit, slice); + zfs_probe_dev(devname, NULL); + } + } +} +#endif Modified: stable/9/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/9/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/i386/zfsboot/zfsboot.c Fri Jun 29 10:19:15 2012 (r237766) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include "cons.h" #include "bootargs.h" +#include "libzfs.h" + #define PATH_DOTCONFIG "/boot.config" #define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/zfsloader" @@ -91,9 +93,12 @@ static const unsigned char dev_maj[NDEV] static char cmd[512]; static char cmddup[512]; static char kname[1024]; +static char rootname[256]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint32_t bootdev; +static struct zfs_boot_args zfsargs; +static struct zfsmount zfsmount; vm_offset_t high_heap_base; uint32_t bios_basemem, bios_extmem, high_heap_size; @@ -170,7 +175,7 @@ zfs_read(spa_t *spa, const dnode_phys_t /* * Current ZFS pool */ -spa_t *spa; +static spa_t *spa; /* * A wrapper for dskread that doesn't have to worry about whether the @@ -209,7 +214,7 @@ static int xfsread(const dnode_phys_t *dnode, off_t *offp, void *buf, size_t nbyte) { if ((size_t)zfs_read(spa, dnode, offp, buf, nbyte) != nbyte) { - printf("Invalid %s\n", "format"); + printf("Invalid format\n"); return -1; } return 0; @@ -529,10 +534,12 @@ main(void) } } - zfs_mount_pool(spa); - - if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0 || - zfs_lookup(spa, PATH_DOTCONFIG, &dn) == 0) { + if (zfs_spa_init(spa) != 0 || zfs_mount(spa, 0, &zfsmount) != 0) { + printf("%s: failed to mount default pool %s\n", + BOOTPROG, spa->spa_name); + autoboot = 0; + } else if (zfs_lookup(&zfsmount, PATH_CONFIG, &dn) == 0 || + zfs_lookup(&zfsmount, PATH_DOTCONFIG, &dn) == 0) { off = 0; zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); } @@ -567,11 +574,17 @@ main(void) /* Present the user with the boot2 prompt. */ for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) - printf("\nFreeBSD/x86 boot\n" - "Default: %s:%s\n" - "boot: ", - spa->spa_name, kname); + if (!autoboot || !OPT_CHECK(RBX_QUIET)) { + printf("\nFreeBSD/x86 boot\n"); + if (zfs_rlookup(spa, zfsmount.rootobj, rootname) != 0) + printf("Default: %s:<0x%llx>:%s\n" + "boot: ", + spa->spa_name, zfsmount.rootobj, kname); + else + printf("Default: %s:%s:%s\n" + "boot: ", + spa->spa_name, rootname, kname); + } if (ioctrl & IO_SERIAL) sio_flush(); if (!autoboot || keyhit(5)) @@ -607,7 +620,8 @@ load(void) uint32_t addr, x; int fmt, i, j; - if (zfs_lookup(spa, kname, &dn)) { + if (zfs_lookup(&zfsmount, kname, &dn)) { + printf("\nCan't find %s\n", kname); return; } off = 0; @@ -681,12 +695,16 @@ load(void) } bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); + zfsargs.size = sizeof(zfsargs); + zfsargs.pool = zfsmount.spa->spa_guid; + zfsargs.root = zfsmount.rootobj; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), bootdev, - KARGS_FLAGS_ZFS, + KARGS_FLAGS_ZFS | KARGS_FLAGS_EXTARG, (uint32_t) spa->spa_guid, (uint32_t) (spa->spa_guid >> 32), - VTOP(&bootinfo)); + VTOP(&bootinfo), + zfsargs); } static int @@ -738,7 +756,7 @@ parse(void) } if (c == '?') { dnode_phys_t dn; - if (zfs_lookup(spa, arg, &dn) == 0) { + if (zfs_lookup(&zfsmount, arg, &dn) == 0) { zap_list(spa, &dn); } return -1; @@ -760,17 +778,32 @@ parse(void) q = (char *) strchr(arg, ':'); if (q) { spa_t *newspa; + uint64_t newroot; *q++ = 0; newspa = spa_find_by_name(arg); if (newspa) { + arg = q; spa = newspa; - zfs_mount_pool(spa); + newroot = 0; + q = (char *) strchr(arg, ':'); + if (q) { + *q++ = 0; + if (zfs_lookup_dataset(spa, arg, &newroot)) { + printf("\nCan't find dataset %s in ZFS pool %s\n", + arg, spa->spa_name); + return -1; + } + arg = q; + } + if (zfs_mount(spa, newroot, &zfsmount)) { + printf("\nCan't mount ZFS dataset\n"); + return -1; + } } else { printf("\nCan't find ZFS pool %s\n", arg); return -1; } - arg = q; } if ((i = ep - arg)) { if ((size_t)i >= sizeof(kname)) Modified: stable/9/sys/boot/ofw/libofw/Makefile ============================================================================== --- stable/9/sys/boot/ofw/libofw/Makefile Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/ofw/libofw/Makefile Fri Jun 29 10:19:15 2012 (r237766) @@ -6,6 +6,8 @@ INTERNALLIB= SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \ ofw_time.c openfirm.c +.PATH: ${.CURDIR}/../../zfs +SRCS+= devicename_stubs.c CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ Modified: stable/9/sys/boot/ofw/libofw/devicename.c ============================================================================== --- stable/9/sys/boot/ofw/libofw/devicename.c Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/ofw/libofw/devicename.c Fri Jun 29 10:19:15 2012 (r237766) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libofw.h" +#include "../zfs/libzfs.h" static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); @@ -81,6 +82,7 @@ ofw_parsedev(struct ofw_devdesc **dev, c char *ep; char name[256]; char type[64]; + int err; int len; int i; @@ -114,14 +116,11 @@ found: idev->d_dev = dv; idev->d_type = dv->dv_type; if (idev->d_type == DEVT_ZFS) { - idev->d_unit = 0; - p = name + strlen(dv->dv_name); - if (*p && (*p != ':')) { - idev->d_unit = strtol(p, &ep, 0); - if (ep == p) { - free(idev); - return (EUNIT); - } + p = devspec + strlen(dv->dv_name); + err = zfs_parsedev((struct zfs_devdesc *)idev, p, path); + if (err != 0) { + free(idev); + return (err); } } Modified: stable/9/sys/boot/ofw/libofw/libofw.h ============================================================================== --- stable/9/sys/boot/ofw/libofw/libofw.h Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/ofw/libofw/libofw.h Fri Jun 29 10:19:15 2012 (r237766) @@ -33,7 +33,13 @@ struct ofw_devdesc { int d_type; int d_unit; ihandle_t d_handle; - char d_path[256]; + union { + char d_path[256]; + struct { + uint64_t pool_guid; + uint64_t root_guid; + }; + }; }; extern int ofw_getdev(void **vdev, const char *devspec, const char **path); Modified: stable/9/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/9/sys/boot/sparc64/loader/Makefile Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/sparc64/loader/Makefile Fri Jun 29 10:19:15 2012 (r237766) @@ -37,6 +37,7 @@ CFLAGS+= -DLOADER_CD9660_SUPPORT CFLAGS+= -DLOADER_ZFS_SUPPORT CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif .if ${LOADER_GZIP_SUPPORT} == "yes" CFLAGS+= -DLOADER_GZIP_SUPPORT @@ -83,8 +84,8 @@ CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ # where to get libstand from CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} -lstand +DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ Modified: stable/9/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/9/sys/boot/sparc64/loader/main.c Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/sparc64/loader/main.c Fri Jun 29 10:19:15 2012 (r237766) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef LOADER_ZFS_SUPPORT #include +#include "../zfs/libzfs.h" #endif #include @@ -74,6 +75,8 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" +#define MAXDEV 31 + extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; enum { @@ -140,11 +143,6 @@ static vm_offset_t heapva; static phandle_t root; -#ifdef LOADER_ZFS_SUPPORT -static int zfs_dev_init(void); -#include "zfs.c" -#endif - /* * Machine dependent structures that the machine independent * loader part uses. @@ -731,39 +729,20 @@ tlb_init_sun4u(void) } #ifdef LOADER_ZFS_SUPPORT - -static int -zfs_dev_init(void) +static void +sparc64_zfs_probe(void) { struct vtoc8 vtoc; - char devname[512]; - spa_t *spa; - vdev_t *vdev; + struct zfs_devdesc zfs_currdev; + char devname[32]; uint64_t guid; int fd, part, unit; - zfs_init(); - - guid = 0; /* Get the GUID of the ZFS pool on the boot device. */ - fd = open(getenv("currdev"), O_RDONLY); - if (fd != -1) { - if (vdev_probe(vdev_read, (void *)(uintptr_t) fd, &spa) == 0) - guid = spa->spa_guid; - close(fd); - } - - /* Clean up the environment to let ZFS work. */ - while ((vdev = STAILQ_FIRST(&zfs_vdevs)) != NULL) { - STAILQ_REMOVE_HEAD(&zfs_vdevs, v_alllink); - free(vdev); - } - while ((spa = STAILQ_FIRST(&zfs_pools)) != NULL) { - STAILQ_REMOVE_HEAD(&zfs_pools, spa_link); - free(spa); - } + guid = 0; + zfs_probe_dev(getenv("currdev"), &guid); - for (unit = 0; unit < MAXBDDEV; unit++) { + for (unit = 0; unit < MAXDEV; unit++) { /* Find freebsd-zfs slices in the VTOC. */ sprintf(devname, "disk%d:", unit); fd = open(devname, O_RDONLY); @@ -781,29 +760,23 @@ zfs_dev_init(void) VTOC_TAG_FREEBSD_ZFS) continue; sprintf(devname, "disk%d:%c", unit, part + 'a'); - fd = open(devname, O_RDONLY); - if (fd == -1) + if (zfs_probe_dev(devname, NULL) == ENXIO) break; - - if (vdev_probe(vdev_read, (void*)(uintptr_t) fd, 0)) - close(fd); } } if (guid != 0) { - unit = zfs_guid_to_unit(guid); - if (unit >= 0) { - /* Update the environment for ZFS. */ - sprintf(devname, "zfs%d", unit); - env_setenv("currdev", EV_VOLATILE, devname, - ofw_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, - env_noset, env_nounset); - } + zfs_currdev.pool_guid = guid; + zfs_currdev.root_guid = 0; + zfs_currdev.d_dev = &zfs_dev; + zfs_currdev.d_type = zfs_currdev.d_dev->dv_type; + /* Update the environment for ZFS. */ + env_setenv("currdev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev), + ofw_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev), + env_noset, env_nounset); } - return (0); } - #endif /* LOADER_ZFS_SUPPORT */ int @@ -823,6 +796,9 @@ main(int (*openfirm)(void *)) archsw.arch_copyout = ofw_copyout; archsw.arch_readin = sparc64_readin; archsw.arch_autoload = sparc64_autoload; +#ifdef LOADER_ZFS_SUPPORT + archsw.arch_zfs_probe = sparc64_zfs_probe; +#endif if (init_heap() == (vm_offset_t)-1) OF_exit(); Copied: stable/9/sys/boot/zfs/devicename_stubs.c (from r235329, head/sys/boot/zfs/devicename_stubs.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/boot/zfs/devicename_stubs.c Fri Jun 29 10:19:15 2012 (r237766, copy of r235329, head/sys/boot/zfs/devicename_stubs.c) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2012 Andriy Gapon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include "libzfs.h" + +__attribute__((weak)) +int +zfs_parsedev(struct zfs_devdesc *dev, const char *devspec, const char **path) +{ + return (EINVAL); +} + +__attribute__((weak)) +char * +zfs_fmtdev(void *vdev) +{ + static char buf[128]; + + return (buf); +} Copied: stable/9/sys/boot/zfs/libzfs.h (from r235329, head/sys/boot/zfs/libzfs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/boot/zfs/libzfs.h Fri Jun 29 10:19:15 2012 (r237766, copy of r235329, head/sys/boot/zfs/libzfs.h) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2012 Andriy Gapon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _BOOT_LIBZFS_H_ +#define _BOOT_LIBZFS_H_ + +#define ZFS_MAXNAMELEN 256 + +/* + * ZFS fully-qualified device descriptor. + * Note, this must match the 'struct devdesc' declaration in bootstrap.h. + * Arch-specific device descriptors should be binary compatible with this + * structure if they are to support ZFS. + */ +struct zfs_devdesc +{ + struct devsw *d_dev; + int d_type; + int d_unit; + void *d_opendata; + uint64_t pool_guid; + uint64_t root_guid; +}; + +struct zfs_boot_args +{ + uint32_t size; + uint32_t reserved; + uint64_t pool; + uint64_t root; +}; + +int zfs_parsedev(struct zfs_devdesc *dev, const char *devspec, + const char **path); +char *zfs_fmtdev(void *vdev); +int zfs_probe_dev(const char *devname, uint64_t *pool_guid); + +extern struct devsw zfs_dev; +extern struct fs_ops zfs_fsops; + +#endif /*_BOOT_LIBZFS_H_*/ Modified: stable/9/sys/boot/zfs/zfs.c ============================================================================== --- stable/9/sys/boot/zfs/zfs.c Fri Jun 29 10:18:36 2012 (r237765) +++ stable/9/sys/boot/zfs/zfs.c Fri Jun 29 10:19:15 2012 (r237766) @@ -43,9 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include "zfsimpl.c" +#include "libzfs.h" -#define MAXBDDEV 31 +#include "zfsimpl.c" static int zfs_open(const char *path, struct open_file *f); static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); @@ -56,6 +56,7 @@ static int zfs_stat(struct open_file *f, static int zfs_readdir(struct open_file *f, struct dirent *d); struct devsw zfs_dev; +struct devsw zfs_dev_compat; struct fs_ops zfs_fsops = { "zfs", @@ -85,35 +86,20 @@ struct file { static int zfs_open(const char *upath, struct open_file *f) { - spa_t *spa = (spa_t *) f->f_devdata; + struct zfsmount *mount = (struct zfsmount *)f->f_devdata; struct file *fp; int rc; - if (f->f_dev != &zfs_dev) + if (f->f_dev != &zfs_dev && f->f_dev != &zfs_dev_compat) return (EINVAL); - rc = zfs_mount_pool(spa); - if (rc) - return (rc); - /* allocate file system specific data structure */ fp = malloc(sizeof(struct file)); bzero(fp, sizeof(struct file)); f->f_fsdata = (void *)fp; - if (spa->spa_root_objset.os_type != DMU_OST_ZFS) { - printf("Unexpected object set type %llu\n", - spa->spa_root_objset.os_type); - rc = EIO; - goto out; - } - - rc = zfs_lookup(spa, upath, &fp->f_dnode); - if (rc) - goto out; - + rc = zfs_lookup(mount, upath, &fp->f_dnode); fp->f_seekp = 0; -out: if (rc) { f->f_fsdata = NULL; free(fp); @@ -142,7 +128,7 @@ zfs_close(struct open_file *f) static int zfs_read(struct open_file *f, void *start, size_t size, size_t *resid /* out */) { - spa_t *spa = (spa_t *) f->f_devdata; + spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; struct stat sb; size_t n; @@ -216,7 +202,7 @@ zfs_seek(struct open_file *f, off_t offs static int zfs_stat(struct open_file *f, struct stat *sb) { - spa_t *spa = (spa_t *) f->f_devdata; + spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; return (zfs_dnode_stat(spa, &fp->f_dnode, sb)); @@ -225,7 +211,7 @@ zfs_stat(struct open_file *f, struct sta static int zfs_readdir(struct open_file *f, struct dirent *d) { - spa_t *spa = (spa_t *) f->f_devdata; + spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; mzap_ent_phys_t mze; struct stat sb; @@ -381,68 +367,33 @@ vdev_read(vdev_t *vdev, void *priv, off_ } } -/* - * Convert a pool guid to a 'unit number' suitable for use with zfs_dev_open. - */ -int -zfs_guid_to_unit(uint64_t guid) +static int +zfs_dev_init(void) { - spa_t *spa; - int unit; - - unit = 0; - STAILQ_FOREACH(spa, &zfs_pools, spa_link) { - if (spa->spa_guid == guid) - return unit; - unit++; - } - return (-1); + zfs_init(); + if (archsw.arch_zfs_probe == NULL) + return (ENXIO); + archsw.arch_zfs_probe(); + return (0); } -#if defined(__amd64__) || defined(__i386__) -static int -zfs_dev_init(void) +int +zfs_probe_dev(const char *devname, uint64_t *pool_guid) { - char devname[512]; - int unit, slice; + spa_t *spa; int fd; + int ret; - /* - * Open all the disks we can find and see if we can reconstruct - * ZFS pools from them. Bogusly assumes that the disks are named - * diskN, diskNpM or diskNsM. - */ - zfs_init(); - for (unit = 0; unit < MAXBDDEV; unit++) { - sprintf(devname, "disk%d:", unit); - fd = open(devname, O_RDONLY); - if (fd == -1) - continue; - - /* - * If we find a vdev, the zfs code will eat the fd, otherwise - * we close it. - */ - if (vdev_probe(vdev_read, (void*) (uintptr_t) fd, 0)) - close(fd); - - for (slice = 1; slice <= 128; slice++) { - sprintf(devname, "disk%dp%d:", unit, slice); - fd = open(devname, O_RDONLY); - if (fd == -1) { - sprintf(devname, "disk%ds%d:", unit, slice); - fd = open(devname, O_RDONLY); - if (fd == -1) - continue; - } - if (vdev_probe(vdev_read, (void*) (uintptr_t) fd, 0)) - close(fd); - } - } - + fd = open(devname, O_RDONLY); + if (fd == -1) + return (ENXIO); + ret = vdev_probe(vdev_read, (void *)(uintptr_t)fd, &spa); + if (ret != 0) + close(fd); + else if (pool_guid != NULL) + *pool_guid = spa->spa_guid; return (0); } -#endif /* * Print information about ZFS pools @@ -452,54 +403,52 @@ zfs_dev_print(int verbose) { spa_t *spa; char line[80]; - int unit; if (verbose) { spa_all_status(); return; } - unit = 0; STAILQ_FOREACH(spa, &zfs_pools, spa_link) { - sprintf(line, " zfs%d: %s\n", unit, spa->spa_name); + sprintf(line, " zfs:%s\n", spa->spa_name); pager_output(line); - unit++; } } /* * Attempt to open the pool described by (dev) for use by (f). */ -static int +static int zfs_dev_open(struct open_file *f, ...) { va_list args; - struct devdesc *dev; - int unit, i; + struct zfs_devdesc *dev; + struct zfsmount *mount; spa_t *spa; + int rv; va_start(args, f); - dev = va_arg(args, struct devdesc*); + dev = va_arg(args, struct zfs_devdesc *); va_end(args); - /* - * We mostly ignore the stuff that devopen sends us. For now, - * use the unit to find a pool - later we will override the - * devname parsing so that we can name a pool and a fs within - * the pool. - */ - unit = dev->d_unit; - - i = 0; - STAILQ_FOREACH(spa, &zfs_pools, spa_link) { - if (i == unit) - break; - i++; - } - if (!spa) { + spa = spa_find_by_guid(dev->pool_guid); + if (!spa) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:22:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C016106566B; Fri, 29 Jun 2012 10:22:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D5CB8FC1E; Fri, 29 Jun 2012 10:22:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TAMKKp039615; Fri, 29 Jun 2012 10:22:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TAMKpf039613; Fri, 29 Jun 2012 10:22:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291022.q5TAMKpf039613@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237767 - stable/9/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:22:21 -0000 Author: avg Date: Fri Jun 29 10:22:20 2012 New Revision: 237767 URL: http://svn.freebsd.org/changeset/base/237767 Log: MFC r235330: zfs boot: try to set vfs.root.mountfrom from currdev as a fallback Modified: stable/9/sys/boot/common/boot.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/common/boot.c ============================================================================== --- stable/9/sys/boot/common/boot.c Fri Jun 29 10:19:15 2012 (r237766) +++ stable/9/sys/boot/common/boot.c Fri Jun 29 10:22:20 2012 (r237767) @@ -311,12 +311,12 @@ getrootmount(char *rootdev) if (getenv("vfs.root.mountfrom") != NULL) return(0); + error = 1; sprintf(lbuf, "%s/etc/fstab", rootdev); if ((fd = open(lbuf, O_RDONLY)) < 0) - return(1); + goto notfound; /* loop reading lines from /etc/fstab What was that about sscanf again? */ - error = 1; while (fgetstr(lbuf, sizeof(lbuf), fd) >= 0) { if ((lbuf[0] == 0) || (lbuf[0] == '#')) continue; @@ -377,6 +377,20 @@ getrootmount(char *rootdev) break; } close(fd); + +notfound: + if (error) { + const char *currdev; + + currdev = getenv("currdev"); + if (currdev != NULL && strncmp("zfs:", currdev, 4) == 0) { + cp = strdup(currdev); + cp[strlen(cp) - 1] = '\0'; + setenv("vfs.root.mountfrom", cp, 0); + error = 0; + } + } + return(error); } From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:22:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43BA41065726; Fri, 29 Jun 2012 10:22:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF2C8FC08; Fri, 29 Jun 2012 10:22:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TAMa4h039661; Fri, 29 Jun 2012 10:22:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TAMZN4039659; Fri, 29 Jun 2012 10:22:35 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291022.q5TAMZN4039659@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237768 - stable/8/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:22:36 -0000 Author: avg Date: Fri Jun 29 10:22:35 2012 New Revision: 237768 URL: http://svn.freebsd.org/changeset/base/237768 Log: MFC r235330: zfs boot: try to set vfs.root.mountfrom from currdev as a fallback Modified: stable/8/sys/boot/common/boot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/common/boot.c ============================================================================== --- stable/8/sys/boot/common/boot.c Fri Jun 29 10:22:20 2012 (r237767) +++ stable/8/sys/boot/common/boot.c Fri Jun 29 10:22:35 2012 (r237768) @@ -311,12 +311,12 @@ getrootmount(char *rootdev) if (getenv("vfs.root.mountfrom") != NULL) return(0); + error = 1; sprintf(lbuf, "%s/etc/fstab", rootdev); if ((fd = open(lbuf, O_RDONLY)) < 0) - return(1); + goto notfound; /* loop reading lines from /etc/fstab What was that about sscanf again? */ - error = 1; while (fgetstr(lbuf, sizeof(lbuf), fd) >= 0) { if ((lbuf[0] == 0) || (lbuf[0] == '#')) continue; @@ -377,6 +377,20 @@ getrootmount(char *rootdev) break; } close(fd); + +notfound: + if (error) { + const char *currdev; + + currdev = getenv("currdev"); + if (currdev != NULL && strncmp("zfs:", currdev, 4) == 0) { + cp = strdup(currdev); + cp[strlen(cp) - 1] = '\0'; + setenv("vfs.root.mountfrom", cp, 0); + error = 0; + } + } + return(error); } From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:28:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D28A106566C; Fri, 29 Jun 2012 10:28:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45CA38FC1C; Fri, 29 Jun 2012 10:28:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TASfaa040031; Fri, 29 Jun 2012 10:28:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TASfx0040027; Fri, 29 Jun 2012 10:28:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291028.q5TASfx0040027@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237769 - in stable/8: sys/boot/pc98/libpc98 sys/boot/zfs tools/tools/ath/common tools/tools/termcap tools/tools/zfsboottest X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:28:41 -0000 Author: avg Date: Fri Jun 29 10:28:40 2012 New Revision: 237769 URL: http://svn.freebsd.org/changeset/base/237769 Log: MFC r235392,235394,235395: fixes and cleanups for zfs boot MFC Modified: stable/8/sys/boot/pc98/libpc98/Makefile stable/8/sys/boot/zfs/zfs.c stable/8/tools/tools/zfsboottest/zfsboottest.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/aac/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/cfi/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/tools/tools/iwi/ (props changed) stable/8/tools/tools/mctest/ (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) Modified: stable/8/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/8/sys/boot/pc98/libpc98/Makefile Fri Jun 29 10:22:35 2012 (r237768) +++ stable/8/sys/boot/pc98/libpc98/Makefile Fri Jun 29 10:28:40 2012 (r237769) @@ -10,6 +10,8 @@ SRCS= bioscd.c biosdisk.c biosmem.c bios comconsole.c devicename.c elf32_freebsd.c \ i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c +.PATH: ${.CURDIR}/../../zfs +SRCS+= devicename_stubs.c # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Fri Jun 29 10:22:35 2012 (r237768) +++ stable/8/sys/boot/zfs/zfs.c Fri Jun 29 10:28:40 2012 (r237769) @@ -56,7 +56,6 @@ static int zfs_stat(struct open_file *f, static int zfs_readdir(struct open_file *f, struct dirent *d); struct devsw zfs_dev; -struct devsw zfs_dev_compat; struct fs_ops zfs_fsops = { "zfs", @@ -90,7 +89,7 @@ zfs_open(const char *upath, struct open_ struct file *fp; int rc; - if (f->f_dev != &zfs_dev && f->f_dev != &zfs_dev_compat) + if (f->f_dev != &zfs_dev) return (EINVAL); /* allocate file system specific data structure */ Modified: stable/8/tools/tools/zfsboottest/zfsboottest.c ============================================================================== --- stable/8/tools/tools/zfsboottest/zfsboottest.c Fri Jun 29 10:22:35 2012 (r237768) +++ stable/8/tools/tools/zfsboottest/zfsboottest.c Fri Jun 29 10:28:40 2012 (r237769) @@ -89,7 +89,11 @@ main(int argc, char** argv) char buf[512], hash[33]; MD5_CTX ctx; struct stat sb; + struct zfsmount zfsmnt; dnode_phys_t dn; +#if 0 + uint64_t rootobj; +#endif spa_t *spa; off_t off; ssize_t n; @@ -138,14 +142,28 @@ main(int argc, char** argv) exit(1); } - if (zfs_mount_pool(spa)) { - fprintf(stderr, "can't mount pool\n"); + if (zfs_spa_init(spa)) { + fprintf(stderr, "can't init pool\n"); exit(1); } +#if 0 + if (zfs_get_root(spa, &rootobj)) { + fprintf(stderr, "can't get root\n"); + exit(1); + } + + if (zfs_mount(spa, rootobj, &zfsmnt)) { +#else + if (zfs_mount(spa, 0, &zfsmnt)) { + fprintf(stderr, "can't mount\n"); + exit(1); + } +#endif + printf("\n"); for (++i, failures = 0; i < argc; i++) { - if (zfs_lookup(spa, argv[i], &dn)) { + if (zfs_lookup(&zfsmnt, argv[i], &dn)) { fprintf(stderr, "%s: can't lookup\n", argv[i]); failures++; continue; From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:28:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 959A41065672; Fri, 29 Jun 2012 10:28:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF638FC15; Fri, 29 Jun 2012 10:28:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TASk0h040071; Fri, 29 Jun 2012 10:28:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TASkef040066; Fri, 29 Jun 2012 10:28:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291028.q5TASkef040066@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237770 - in stable/9: sys/boot/pc98/libpc98 sys/boot/zfs tools/tools/zfsboottest X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:28:46 -0000 Author: avg Date: Fri Jun 29 10:28:46 2012 New Revision: 237770 URL: http://svn.freebsd.org/changeset/base/237770 Log: MFC r235392,235394,235395: fixes and cleanups for zfs boot MFC Modified: stable/9/sys/boot/pc98/libpc98/Makefile stable/9/sys/boot/zfs/zfs.c stable/9/tools/tools/zfsboottest/zfsboottest.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/tools/tools/ (props changed) stable/9/tools/tools/ath/ (props changed) stable/9/tools/tools/ether_reflect/ (props changed) stable/9/tools/tools/nanobsd/ (props changed) stable/9/tools/tools/syscall_timing/ (props changed) stable/9/tools/tools/vimage/ (props changed) stable/9/tools/tools/zfsboottest/ (props changed) Modified: stable/9/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/9/sys/boot/pc98/libpc98/Makefile Fri Jun 29 10:28:40 2012 (r237769) +++ stable/9/sys/boot/pc98/libpc98/Makefile Fri Jun 29 10:28:46 2012 (r237770) @@ -10,6 +10,8 @@ SRCS= bioscd.c biosdisk.c biosmem.c bios comconsole.c devicename.c elf32_freebsd.c \ i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c +.PATH: ${.CURDIR}/../../zfs +SRCS+= devicename_stubs.c # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) Modified: stable/9/sys/boot/zfs/zfs.c ============================================================================== --- stable/9/sys/boot/zfs/zfs.c Fri Jun 29 10:28:40 2012 (r237769) +++ stable/9/sys/boot/zfs/zfs.c Fri Jun 29 10:28:46 2012 (r237770) @@ -56,7 +56,6 @@ static int zfs_stat(struct open_file *f, static int zfs_readdir(struct open_file *f, struct dirent *d); struct devsw zfs_dev; -struct devsw zfs_dev_compat; struct fs_ops zfs_fsops = { "zfs", @@ -90,7 +89,7 @@ zfs_open(const char *upath, struct open_ struct file *fp; int rc; - if (f->f_dev != &zfs_dev && f->f_dev != &zfs_dev_compat) + if (f->f_dev != &zfs_dev) return (EINVAL); /* allocate file system specific data structure */ Modified: stable/9/tools/tools/zfsboottest/zfsboottest.c ============================================================================== --- stable/9/tools/tools/zfsboottest/zfsboottest.c Fri Jun 29 10:28:40 2012 (r237769) +++ stable/9/tools/tools/zfsboottest/zfsboottest.c Fri Jun 29 10:28:46 2012 (r237770) @@ -89,7 +89,11 @@ main(int argc, char** argv) char buf[512], hash[33]; MD5_CTX ctx; struct stat sb; + struct zfsmount zfsmnt; dnode_phys_t dn; +#if 0 + uint64_t rootobj; +#endif spa_t *spa; off_t off; ssize_t n; @@ -138,14 +142,28 @@ main(int argc, char** argv) exit(1); } - if (zfs_mount_pool(spa)) { - fprintf(stderr, "can't mount pool\n"); + if (zfs_spa_init(spa)) { + fprintf(stderr, "can't init pool\n"); exit(1); } +#if 0 + if (zfs_get_root(spa, &rootobj)) { + fprintf(stderr, "can't get root\n"); + exit(1); + } + + if (zfs_mount(spa, rootobj, &zfsmnt)) { +#else + if (zfs_mount(spa, 0, &zfsmnt)) { + fprintf(stderr, "can't mount\n"); + exit(1); + } +#endif + printf("\n"); for (++i, failures = 0; i < argc; i++) { - if (zfs_lookup(spa, argv[i], &dn)) { + if (zfs_lookup(&zfsmnt, argv[i], &dn)) { fprintf(stderr, "%s: can't lookup\n", argv[i]); failures++; continue; From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:31:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424C6106566B; Fri, 29 Jun 2012 10:31:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1ECD88FC0A; Fri, 29 Jun 2012 10:31:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TAUxT1040238; Fri, 29 Jun 2012 10:30:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TAUxbE040235; Fri, 29 Jun 2012 10:30:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291030.q5TAUxbE040235@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237771 - stable/9/sys/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:31:00 -0000 Author: avg Date: Fri Jun 29 10:30:59 2012 New Revision: 237771 URL: http://svn.freebsd.org/changeset/base/237771 Log: MFC r235390: zfs boot code: mark spa_t arguments as const where they are used as such Modified: stable/9/sys/boot/zfs/zfs.c stable/9/sys/boot/zfs/zfsimpl.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/zfs/zfs.c ============================================================================== --- stable/9/sys/boot/zfs/zfs.c Fri Jun 29 10:28:46 2012 (r237770) +++ stable/9/sys/boot/zfs/zfs.c Fri Jun 29 10:30:59 2012 (r237771) @@ -127,7 +127,7 @@ zfs_close(struct open_file *f) static int zfs_read(struct open_file *f, void *start, size_t size, size_t *resid /* out */) { - spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; + const spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; struct stat sb; size_t n; @@ -201,7 +201,7 @@ zfs_seek(struct open_file *f, off_t offs static int zfs_stat(struct open_file *f, struct stat *sb) { - spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; + const spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; return (zfs_dnode_stat(spa, &fp->f_dnode, sb)); @@ -210,7 +210,7 @@ zfs_stat(struct open_file *f, struct sta static int zfs_readdir(struct open_file *f, struct dirent *d) { - spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; + const spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; mzap_ent_phys_t mze; struct stat sb; Modified: stable/9/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/9/sys/boot/zfs/zfsimpl.c Fri Jun 29 10:28:46 2012 (r237770) +++ stable/9/sys/boot/zfs/zfsimpl.c Fri Jun 29 10:30:59 2012 (r237771) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); struct zfsmount { - spa_t *spa; + const spa_t *spa; objset_phys_t objset; uint64_t rootobj; }; @@ -63,7 +63,7 @@ static char *zfs_temp_buf, *zfs_temp_end #define TEMP_SIZE (1024 * 1024) -static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf); +static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf); static void zfs_init(void) @@ -981,7 +981,7 @@ ilog2(int n) } static int -zio_read_gang(spa_t *spa, const blkptr_t *bp, void *buf) +zio_read_gang(const spa_t *spa, const blkptr_t *bp, void *buf) { blkptr_t gbh_bp; zio_gbh_phys_t zio_gb; @@ -1018,7 +1018,7 @@ zio_read_gang(spa_t *spa, const blkptr_t } static int -zio_read(spa_t *spa, const blkptr_t *bp, void *buf) +zio_read(const spa_t *spa, const blkptr_t *bp, void *buf) { int cpfunc = BP_GET_COMPRESS(bp); uint64_t align, size; @@ -1078,7 +1078,7 @@ zio_read(spa_t *spa, const blkptr_t *bp, } static int -dnode_read(spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf, size_t buflen) +dnode_read(const spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf, size_t buflen) { int ibshift = dnode->dn_indblkshift - SPA_BLKPTRSHIFT; int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; @@ -1141,7 +1141,7 @@ dnode_read(spa_t *spa, const dnode_phys_ * scratch buffer contains the directory contents. */ static int -mzap_lookup(spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +mzap_lookup(const dnode_phys_t *dnode, const char *name, uint64_t *value) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -1222,7 +1222,7 @@ fzap_leaf_value(const zap_leaf_t *zl, co * buffer contains the directory header. */ static int -fzap_lookup(spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1300,7 +1300,7 @@ fzap_lookup(spa_t *spa, const dnode_phys * Lookup a name in a zap object and return its value as a uint64_t. */ static int -zap_lookup(spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) { int rc; uint64_t zap_type; @@ -1312,7 +1312,7 @@ zap_lookup(spa_t *spa, const dnode_phys_ zap_type = *(uint64_t *) zap_scratch; if (zap_type == ZBT_MICRO) - return mzap_lookup(spa, dnode, name, value); + return mzap_lookup(dnode, name, value); else if (zap_type == ZBT_HEADER) return fzap_lookup(spa, dnode, name, value); printf("ZFS: invalid zap_type=%d\n", (int)zap_type); @@ -1326,7 +1326,7 @@ zap_lookup(spa_t *spa, const dnode_phys_ * the directory contents. */ static int -mzap_list(spa_t *spa, const dnode_phys_t *dnode) +mzap_list(const dnode_phys_t *dnode) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -1356,7 +1356,7 @@ mzap_list(spa_t *spa, const dnode_phys_t * the directory header. */ static int -fzap_list(spa_t *spa, const dnode_phys_t *dnode) +fzap_list(const spa_t *spa, const dnode_phys_t *dnode) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1395,7 +1395,7 @@ fzap_list(spa_t *spa, const dnode_phys_t namelen = zc->l_entry.le_name_length; if (namelen > sizeof(name)) namelen = sizeof(name); - + /* * Paste the name back together. */ @@ -1429,7 +1429,7 @@ fzap_list(spa_t *spa, const dnode_phys_t * List a zap directory. */ static int -zap_list(spa_t *spa, const dnode_phys_t *dnode) +zap_list(const spa_t *spa, const dnode_phys_t *dnode) { uint64_t zap_type; size_t size = dnode->dn_datablkszsec * 512; @@ -1439,7 +1439,7 @@ zap_list(spa_t *spa, const dnode_phys_t zap_type = *(uint64_t *) zap_scratch; if (zap_type == ZBT_MICRO) - return mzap_list(spa, dnode); + return mzap_list(dnode); else return fzap_list(spa, dnode); } @@ -1447,7 +1447,7 @@ zap_list(spa_t *spa, const dnode_phys_t #endif static int -objset_get_dnode(spa_t *spa, const objset_phys_t *os, uint64_t objnum, dnode_phys_t *dnode) +objset_get_dnode(const spa_t *spa, const objset_phys_t *os, uint64_t objnum, dnode_phys_t *dnode) { off_t offset; @@ -1457,7 +1457,7 @@ objset_get_dnode(spa_t *spa, const objse } static int -mzap_rlookup(spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +mzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -1510,7 +1510,7 @@ fzap_name_copy(const zap_leaf_t *zl, con } static int -fzap_rlookup(spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +fzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1585,7 +1585,7 @@ fzap_rlookup(spa_t *spa, const dnode_phy } static int -zap_rlookup(spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +zap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) { int rc; uint64_t zap_type; @@ -1603,7 +1603,7 @@ zap_rlookup(spa_t *spa, const dnode_phys } static int -zfs_rlookup(spa_t *spa, uint64_t objnum, char *result) +zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result) { char name[256]; char component[256]; @@ -1661,7 +1661,7 @@ zfs_rlookup(spa_t *spa, uint64_t objnum, } static int -zfs_lookup_dataset(spa_t *spa, const char *name, uint64_t *objnum) +zfs_lookup_dataset(const spa_t *spa, const char *name, uint64_t *objnum) { char element[256]; uint64_t dir_obj, child_dir_zapobj; @@ -1714,7 +1714,7 @@ zfs_lookup_dataset(spa_t *spa, const cha * and return its details in *objset */ static int -zfs_mount_dataset(spa_t *spa, uint64_t objnum, objset_phys_t *objset) +zfs_mount_dataset(const spa_t *spa, uint64_t objnum, objset_phys_t *objset) { dnode_phys_t dataset; dsl_dataset_phys_t *ds; @@ -1739,7 +1739,7 @@ zfs_mount_dataset(spa_t *spa, uint64_t o * dataset if there is none and return its details in *objset */ static int -zfs_get_root(spa_t *spa, uint64_t *objid) +zfs_get_root(const spa_t *spa, uint64_t *objid) { dnode_phys_t dir, propdir; uint64_t props, bootfs, root; @@ -1784,7 +1784,7 @@ zfs_get_root(spa_t *spa, uint64_t *objid } static int -zfs_mount(spa_t *spa, uint64_t rootobj, struct zfsmount *mount) +zfs_mount(const spa_t *spa, uint64_t rootobj, struct zfsmount *mount) { mount->spa = spa; @@ -1822,7 +1822,7 @@ zfs_spa_init(spa_t *spa) } static int -zfs_dnode_stat(spa_t *spa, dnode_phys_t *dn, struct stat *sb) +zfs_dnode_stat(const spa_t *spa, dnode_phys_t *dn, struct stat *sb) { if (dn->dn_bonustype != DMU_OT_SA) { @@ -1881,7 +1881,7 @@ zfs_lookup(const struct zfsmount *mount, { int rc; uint64_t objnum, rootnum, parentnum; - spa_t *spa; + const spa_t *spa; dnode_phys_t dn; const char *p, *q; char element[256]; From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:31:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F9A310657C1; Fri, 29 Jun 2012 10:31:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 393378FC1F; Fri, 29 Jun 2012 10:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TAVRq5040294; Fri, 29 Jun 2012 10:31:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TAVRNM040291; Fri, 29 Jun 2012 10:31:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291031.q5TAVRNM040291@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 10:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237772 - stable/8/sys/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:31:27 -0000 Author: avg Date: Fri Jun 29 10:31:26 2012 New Revision: 237772 URL: http://svn.freebsd.org/changeset/base/237772 Log: MFC r235390: zfs boot code: mark spa_t arguments as const where they are used as such Modified: stable/8/sys/boot/zfs/zfs.c stable/8/sys/boot/zfs/zfsimpl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Fri Jun 29 10:30:59 2012 (r237771) +++ stable/8/sys/boot/zfs/zfs.c Fri Jun 29 10:31:26 2012 (r237772) @@ -127,7 +127,7 @@ zfs_close(struct open_file *f) static int zfs_read(struct open_file *f, void *start, size_t size, size_t *resid /* out */) { - spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; + const spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; struct stat sb; size_t n; @@ -201,7 +201,7 @@ zfs_seek(struct open_file *f, off_t offs static int zfs_stat(struct open_file *f, struct stat *sb) { - spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; + const spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; return (zfs_dnode_stat(spa, &fp->f_dnode, sb)); @@ -210,7 +210,7 @@ zfs_stat(struct open_file *f, struct sta static int zfs_readdir(struct open_file *f, struct dirent *d) { - spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; + const spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; mzap_ent_phys_t mze; struct stat sb; Modified: stable/8/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/8/sys/boot/zfs/zfsimpl.c Fri Jun 29 10:30:59 2012 (r237771) +++ stable/8/sys/boot/zfs/zfsimpl.c Fri Jun 29 10:31:26 2012 (r237772) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); struct zfsmount { - spa_t *spa; + const spa_t *spa; objset_phys_t objset; uint64_t rootobj; }; @@ -63,7 +63,7 @@ static char *zfs_temp_buf, *zfs_temp_end #define TEMP_SIZE (1024 * 1024) -static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf); +static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf); static void zfs_init(void) @@ -981,7 +981,7 @@ ilog2(int n) } static int -zio_read_gang(spa_t *spa, const blkptr_t *bp, void *buf) +zio_read_gang(const spa_t *spa, const blkptr_t *bp, void *buf) { blkptr_t gbh_bp; zio_gbh_phys_t zio_gb; @@ -1018,7 +1018,7 @@ zio_read_gang(spa_t *spa, const blkptr_t } static int -zio_read(spa_t *spa, const blkptr_t *bp, void *buf) +zio_read(const spa_t *spa, const blkptr_t *bp, void *buf) { int cpfunc = BP_GET_COMPRESS(bp); uint64_t align, size; @@ -1078,7 +1078,7 @@ zio_read(spa_t *spa, const blkptr_t *bp, } static int -dnode_read(spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf, size_t buflen) +dnode_read(const spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf, size_t buflen) { int ibshift = dnode->dn_indblkshift - SPA_BLKPTRSHIFT; int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; @@ -1141,7 +1141,7 @@ dnode_read(spa_t *spa, const dnode_phys_ * scratch buffer contains the directory contents. */ static int -mzap_lookup(spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +mzap_lookup(const dnode_phys_t *dnode, const char *name, uint64_t *value) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -1222,7 +1222,7 @@ fzap_leaf_value(const zap_leaf_t *zl, co * buffer contains the directory header. */ static int -fzap_lookup(spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1300,7 +1300,7 @@ fzap_lookup(spa_t *spa, const dnode_phys * Lookup a name in a zap object and return its value as a uint64_t. */ static int -zap_lookup(spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) { int rc; uint64_t zap_type; @@ -1312,7 +1312,7 @@ zap_lookup(spa_t *spa, const dnode_phys_ zap_type = *(uint64_t *) zap_scratch; if (zap_type == ZBT_MICRO) - return mzap_lookup(spa, dnode, name, value); + return mzap_lookup(dnode, name, value); else if (zap_type == ZBT_HEADER) return fzap_lookup(spa, dnode, name, value); printf("ZFS: invalid zap_type=%d\n", (int)zap_type); @@ -1326,7 +1326,7 @@ zap_lookup(spa_t *spa, const dnode_phys_ * the directory contents. */ static int -mzap_list(spa_t *spa, const dnode_phys_t *dnode) +mzap_list(const dnode_phys_t *dnode) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -1356,7 +1356,7 @@ mzap_list(spa_t *spa, const dnode_phys_t * the directory header. */ static int -fzap_list(spa_t *spa, const dnode_phys_t *dnode) +fzap_list(const spa_t *spa, const dnode_phys_t *dnode) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1395,7 +1395,7 @@ fzap_list(spa_t *spa, const dnode_phys_t namelen = zc->l_entry.le_name_length; if (namelen > sizeof(name)) namelen = sizeof(name); - + /* * Paste the name back together. */ @@ -1429,7 +1429,7 @@ fzap_list(spa_t *spa, const dnode_phys_t * List a zap directory. */ static int -zap_list(spa_t *spa, const dnode_phys_t *dnode) +zap_list(const spa_t *spa, const dnode_phys_t *dnode) { uint64_t zap_type; size_t size = dnode->dn_datablkszsec * 512; @@ -1439,7 +1439,7 @@ zap_list(spa_t *spa, const dnode_phys_t zap_type = *(uint64_t *) zap_scratch; if (zap_type == ZBT_MICRO) - return mzap_list(spa, dnode); + return mzap_list(dnode); else return fzap_list(spa, dnode); } @@ -1447,7 +1447,7 @@ zap_list(spa_t *spa, const dnode_phys_t #endif static int -objset_get_dnode(spa_t *spa, const objset_phys_t *os, uint64_t objnum, dnode_phys_t *dnode) +objset_get_dnode(const spa_t *spa, const objset_phys_t *os, uint64_t objnum, dnode_phys_t *dnode) { off_t offset; @@ -1457,7 +1457,7 @@ objset_get_dnode(spa_t *spa, const objse } static int -mzap_rlookup(spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +mzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -1510,7 +1510,7 @@ fzap_name_copy(const zap_leaf_t *zl, con } static int -fzap_rlookup(spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +fzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1585,7 +1585,7 @@ fzap_rlookup(spa_t *spa, const dnode_phy } static int -zap_rlookup(spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +zap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) { int rc; uint64_t zap_type; @@ -1603,7 +1603,7 @@ zap_rlookup(spa_t *spa, const dnode_phys } static int -zfs_rlookup(spa_t *spa, uint64_t objnum, char *result) +zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result) { char name[256]; char component[256]; @@ -1661,7 +1661,7 @@ zfs_rlookup(spa_t *spa, uint64_t objnum, } static int -zfs_lookup_dataset(spa_t *spa, const char *name, uint64_t *objnum) +zfs_lookup_dataset(const spa_t *spa, const char *name, uint64_t *objnum) { char element[256]; uint64_t dir_obj, child_dir_zapobj; @@ -1714,7 +1714,7 @@ zfs_lookup_dataset(spa_t *spa, const cha * and return its details in *objset */ static int -zfs_mount_dataset(spa_t *spa, uint64_t objnum, objset_phys_t *objset) +zfs_mount_dataset(const spa_t *spa, uint64_t objnum, objset_phys_t *objset) { dnode_phys_t dataset; dsl_dataset_phys_t *ds; @@ -1739,7 +1739,7 @@ zfs_mount_dataset(spa_t *spa, uint64_t o * dataset if there is none and return its details in *objset */ static int -zfs_get_root(spa_t *spa, uint64_t *objid) +zfs_get_root(const spa_t *spa, uint64_t *objid) { dnode_phys_t dir, propdir; uint64_t props, bootfs, root; @@ -1784,7 +1784,7 @@ zfs_get_root(spa_t *spa, uint64_t *objid } static int -zfs_mount(spa_t *spa, uint64_t rootobj, struct zfsmount *mount) +zfs_mount(const spa_t *spa, uint64_t rootobj, struct zfsmount *mount) { mount->spa = spa; @@ -1822,7 +1822,7 @@ zfs_spa_init(spa_t *spa) } static int -zfs_dnode_stat(spa_t *spa, dnode_phys_t *dn, struct stat *sb) +zfs_dnode_stat(const spa_t *spa, dnode_phys_t *dn, struct stat *sb) { if (dn->dn_bonustype != DMU_OT_SA) { @@ -1881,7 +1881,7 @@ zfs_lookup(const struct zfsmount *mount, { int rc; uint64_t objnum, rootnum, parentnum; - spa_t *spa; + const spa_t *spa; dnode_phys_t dn; const char *p, *q; char element[256]; From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 10:39:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B119106566B; Fri, 29 Jun 2012 10:39:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 158DA8FC0A; Fri, 29 Jun 2012 10:39:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TAdg7G040674; Fri, 29 Jun 2012 10:39:42 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TAdgbA040672; Fri, 29 Jun 2012 10:39:42 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201206291039.q5TAdgbA040672@svn.freebsd.org> From: Justin Hibbits Date: Fri, 29 Jun 2012 10:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237773 - stable/9/sys/dev/adb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 10:39:43 -0000 Author: jhibbits Date: Fri Jun 29 10:39:42 2012 New Revision: 237773 URL: http://svn.freebsd.org/changeset/base/237773 Log: MFC r237480 Release the ADB keyboard mutex when handling the power button press/release. Found by WITNESS. Approved by: nwhitehorn (mentor) Modified: stable/9/sys/dev/adb/adb_kbd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/adb/adb_kbd.c ============================================================================== --- stable/9/sys/dev/adb/adb_kbd.c Fri Jun 29 10:31:26 2012 (r237772) +++ stable/9/sys/dev/adb/adb_kbd.c Fri Jun 29 10:39:42 2012 (r237773) @@ -426,8 +426,10 @@ adb_kbd_receive_packet(device_t dev, u_c /* 0x7f is always the power button */ if (data[0] == 0x7f && devctl_process_running()) { devctl_notify("PMU", "Button", "pressed", NULL); + mtx_unlock(&sc->sc_mutex); return (0); } else if (data[0] == 0xff) { + mtx_unlock(&sc->sc_mutex); return (0); /* Ignore power button release. */ } if ((data[0] & 0x7f) == 57 && sc->buffers < 7) { From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 12:05:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2413F1065675; Fri, 29 Jun 2012 12:05:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E73D8FC28; Fri, 29 Jun 2012 12:05:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TC5JIj044474; Fri, 29 Jun 2012 12:05:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TC5JIt044472; Fri, 29 Jun 2012 12:05:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206291205.q5TC5JIt044472@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 29 Jun 2012 12:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237774 - stable/9/usr.sbin/arp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 12:05:20 -0000 Author: glebius Date: Fri Jun 29 12:05:19 2012 New Revision: 237774 URL: http://svn.freebsd.org/changeset/base/237774 Log: Merge r233773 from head: Historically arp(8) did a route lookup for the entry it is about to add, and failed if it exist and had invalid data link type. Later on, in r201282, this check morphed to other code, but message "proxy entry exists for non 802 device" still left, and now it is printed in a case if route prefix found is equal to current address being added. In other words, when we are trying to add ARP entry for a network address. The message is absolutely unrelated and disappointing in this case. I don't see anything bad with setting ARP entries for network addresses. While useless in usual network, in a /31 RFC3021 it may be necessary. This, remove this code. Modified: stable/9/usr.sbin/arp/arp.c Directory Properties: stable/9/usr.sbin/arp/ (props changed) Modified: stable/9/usr.sbin/arp/arp.c ============================================================================== --- stable/9/usr.sbin/arp/arp.c Fri Jun 29 10:39:42 2012 (r237773) +++ stable/9/usr.sbin/arp/arp.c Fri Jun 29 12:05:19 2012 (r237774) @@ -387,10 +387,6 @@ set(int argc, char **argv) } addr = (struct sockaddr_inarp *)(rtm + 1); sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr); - if (addr->sin_addr.s_addr == dst->sin_addr.s_addr) { - printf("set: proxy entry exists for non 802 device\n"); - return (1); - } if ((sdl->sdl_family != AF_LINK) || (rtm->rtm_flags & RTF_GATEWAY) || From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 12:08:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A09E91065676; Fri, 29 Jun 2012 12:08:27 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81A658FC15; Fri, 29 Jun 2012 12:08:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TC8RVf044640; Fri, 29 Jun 2012 12:08:27 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TC8Rac044638; Fri, 29 Jun 2012 12:08:27 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201206291208.q5TC8Rac044638@svn.freebsd.org> From: Peter Holm Date: Fri, 29 Jun 2012 12:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237775 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 12:08:27 -0000 Author: pho Date: Fri Jun 29 12:08:26 2012 New Revision: 237775 URL: http://svn.freebsd.org/changeset/base/237775 Log: MFC: r237219 In tty_makedev() the following construction: dev = make_dev_cred(); dev->si_drv1 = tp; leaves a small window where the newly created device may be opened and si_drv1 is NULL. As this is a vary rare situation, using a lock to close the window seems overkill. Instead just wait for the assignment of si_drv1. Modified: stable/9/sys/kern/tty.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/tty.c ============================================================================== --- stable/9/sys/kern/tty.c Fri Jun 29 12:05:19 2012 (r237774) +++ stable/9/sys/kern/tty.c Fri Jun 29 12:08:26 2012 (r237775) @@ -219,9 +219,15 @@ ttydev_leave(struct tty *tp) static int ttydev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { - struct tty *tp = dev->si_drv1; + struct tty *tp; int error = 0; + while ((tp = dev->si_drv1) == NULL) { + error = tsleep(&dev->si_drv1, PCATCH, "ttdrv1", 1); + if (error != EWOULDBLOCK) + return (error); + } + tty_lock(tp); if (tty_gone(tp)) { /* Device is already gone. */ @@ -738,9 +744,14 @@ static struct cdevsw ttydev_cdevsw = { static int ttyil_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { - struct tty *tp = dev->si_drv1; + struct tty *tp; int error = 0; + while ((tp = dev->si_drv1) == NULL) { + error = tsleep(&dev->si_drv1, PCATCH, "ttdrv1", 1); + if (error != EWOULDBLOCK) + return (error); + } tty_lock(tp); if (tty_gone(tp)) error = ENODEV; @@ -1203,6 +1214,7 @@ tty_makedev(struct tty *tp, struct ucred dev = make_dev_cred(&ttydev_cdevsw, 0, cred, uid, gid, mode, "%s%s", prefix, name); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); tp->t_dev = dev; /* Slave call-in devices. */ @@ -1211,12 +1223,14 @@ tty_makedev(struct tty *tp, struct ucred uid, gid, mode, "%s%s.init", prefix, name); dev_depends(tp->t_dev, dev); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); dev->si_drv2 = &tp->t_termios_init_in; dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_LOCK, cred, uid, gid, mode, "%s%s.lock", prefix, name); dev_depends(tp->t_dev, dev); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); dev->si_drv2 = &tp->t_termios_lock_in; } @@ -1226,6 +1240,7 @@ tty_makedev(struct tty *tp, struct ucred UID_UUCP, GID_DIALER, 0660, "cua%s", name); dev_depends(tp->t_dev, dev); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); /* Slave call-out devices. */ if (tp->t_flags & TF_INITLOCK) { @@ -1234,6 +1249,7 @@ tty_makedev(struct tty *tp, struct ucred UID_UUCP, GID_DIALER, 0660, "cua%s.init", name); dev_depends(tp->t_dev, dev); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); dev->si_drv2 = &tp->t_termios_init_out; dev = make_dev_cred(&ttyil_cdevsw, @@ -1241,6 +1257,7 @@ tty_makedev(struct tty *tp, struct ucred UID_UUCP, GID_DIALER, 0660, "cua%s.lock", name); dev_depends(tp->t_dev, dev); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); dev->si_drv2 = &tp->t_termios_lock_out; } } From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 12:11:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD403106564A; Fri, 29 Jun 2012 12:11:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F5F58FC1A; Fri, 29 Jun 2012 12:11:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TCBWmF044845; Fri, 29 Jun 2012 12:11:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TCBWom044841; Fri, 29 Jun 2012 12:11:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206291211.q5TCBWom044841@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 29 Jun 2012 12:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237776 - stable/9/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 12:11:32 -0000 Author: glebius Date: Fri Jun 29 12:11:31 2012 New Revision: 237776 URL: http://svn.freebsd.org/changeset/base/237776 Log: Merge r236364 from head by eri@: Correct table counter functionality to not panic. This was caused by not proper initialization of necessary parameters. PR: 168200 Reviewed by: bz@, glebius@ MFC after: 1 week Modified: stable/9/sys/contrib/pf/net/pf_ioctl.c stable/9/sys/contrib/pf/net/pf_table.c stable/9/sys/contrib/pf/net/pfvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/contrib/pf/ (props changed) Modified: stable/9/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_ioctl.c Fri Jun 29 12:08:26 2012 (r237775) +++ stable/9/sys/contrib/pf/net/pf_ioctl.c Fri Jun 29 12:11:31 2012 (r237776) @@ -298,7 +298,7 @@ init_zone_var(void) V_pf_altq_pl = V_pf_pooladdr_pl = NULL; V_pf_frent_pl = V_pf_frag_pl = V_pf_cache_pl = V_pf_cent_pl = NULL; V_pf_state_scrub_pl = NULL; - V_pfr_ktable_pl = V_pfr_kentry_pl = NULL; + V_pfr_ktable_pl = V_pfr_kentry_pl = V_pfr_kcounters_pl = NULL; } void @@ -317,6 +317,7 @@ cleanup_pf_zone(void) UMA_DESTROY(V_pf_cent_pl); UMA_DESTROY(V_pfr_ktable_pl); UMA_DESTROY(V_pfr_kentry_pl); + UMA_DESTROY(V_pfr_kcounters_pl); UMA_DESTROY(V_pf_state_scrub_pl); UMA_DESTROY(V_pfi_addr_pl); } @@ -337,6 +338,7 @@ pfattach(void) UMA_CREATE(V_pf_pooladdr_pl, struct pf_pooladdr, "pfpooladdrpl"); UMA_CREATE(V_pfr_ktable_pl, struct pfr_ktable, "pfrktable"); UMA_CREATE(V_pfr_kentry_pl, struct pfr_kentry, "pfrkentry"); + UMA_CREATE(V_pfr_kcounters_pl, struct pfr_kcounters, "pfrkcounters"); UMA_CREATE(V_pf_frent_pl, struct pf_frent, "pffrent"); UMA_CREATE(V_pf_frag_pl, struct pf_fragment, "pffrag"); UMA_CREATE(V_pf_cache_pl, struct pf_fragment, "pffrcache"); Modified: stable/9/sys/contrib/pf/net/pf_table.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_table.c Fri Jun 29 12:08:26 2012 (r237775) +++ stable/9/sys/contrib/pf/net/pf_table.c Fri Jun 29 12:11:31 2012 (r237776) @@ -179,7 +179,6 @@ struct pfr_walktree { VNET_DEFINE(uma_zone_t, pfr_ktable_pl); VNET_DEFINE(uma_zone_t, pfr_kentry_pl); VNET_DEFINE(uma_zone_t, pfr_kcounters_pl); -#define V_pfr_kcounters_pl VNET(pfr_kcounters_pl) VNET_DEFINE(struct sockaddr_in, pfr_sin); #define V_pfr_sin VNET(pfr_sin) VNET_DEFINE(struct sockaddr_in6, pfr_sin6); Modified: stable/9/sys/contrib/pf/net/pfvar.h ============================================================================== --- stable/9/sys/contrib/pf/net/pfvar.h Fri Jun 29 12:08:26 2012 (r237775) +++ stable/9/sys/contrib/pf/net/pfvar.h Fri Jun 29 12:11:31 2012 (r237776) @@ -1868,6 +1868,8 @@ VNET_DECLARE(uma_zone_t, pfr_ktable_pl #define V_pfr_ktable_pl VNET(pfr_ktable_pl) VNET_DECLARE(uma_zone_t, pfr_kentry_pl); #define V_pfr_kentry_pl VNET(pfr_kentry_pl) +VNET_DECLARE(uma_zone_t, pfr_kcounters_pl); +#define V_pfr_kcounters_pl VNET(pfr_kcounters_pl) VNET_DECLARE(uma_zone_t, pf_cache_pl); #define V_pf_cache_pl VNET(pf_cache_pl) VNET_DECLARE(uma_zone_t, pf_cent_pl); From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 12:55:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0D851065672; Fri, 29 Jun 2012 12:55:36 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB7B48FC14; Fri, 29 Jun 2012 12:55:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TCtaCJ046797; Fri, 29 Jun 2012 12:55:36 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TCtax6046795; Fri, 29 Jun 2012 12:55:36 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201206291255.q5TCtax6046795@svn.freebsd.org> From: "Andrey A. Chernov" Date: Fri, 29 Jun 2012 12:55: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: r237777 - head/usr.sbin/vidcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 12:55:36 -0000 Author: ache Date: Fri Jun 29 12:55:36 2012 New Revision: 237777 URL: http://svn.freebsd.org/changeset/base/237777 Log: Call set_terminal_mode() after video mode change, not before, because video mode change always reset terminal mode to xterm. It allows things like 'vidcontrol -T cons25 80x30' works as supposed, and allows 'allscreens_flags="-T cons25 80x30"' in /etc/rc.conf too. MFC after: 1 week Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Fri Jun 29 12:11:31 2012 (r237776) +++ head/usr.sbin/vidcontrol/vidcontrol.c Fri Jun 29 12:55:36 2012 (r237777) @@ -1192,15 +1192,13 @@ set_terminal_mode(char *arg) fprintf(stderr, "\033[=T"); else if (strcmp(arg, "cons25") == 0) fprintf(stderr, "\033[=1T"); - else - usage(); } int main(int argc, char **argv) { - char *font, *type; + char *font, *type, *termmode; int dumpmod, dumpopt, opt; int reterr; @@ -1212,6 +1210,7 @@ main(int argc, char **argv) err(1, "must be on a virtual console"); dumpmod = 0; dumpopt = DUMP_FBF; + termmode = NULL; while ((opt = getopt(argc, argv, "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1) switch(opt) { @@ -1283,7 +1282,10 @@ main(int argc, char **argv) set_console(optarg); break; case 'T': - set_terminal_mode(optarg); + if (strcmp(optarg, "xterm") != 0 && + strcmp(optarg, "cons25") != 0) + usage(); + termmode = optarg; break; case 't': set_screensaver_timeout(optarg); @@ -1306,6 +1308,8 @@ main(int argc, char **argv) } video_mode(argc, argv, &optind); + if (termmode != NULL) + set_terminal_mode(termmode); get_normal_colors(argc, argv, &optind); From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 13:00:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C156106564A; Fri, 29 Jun 2012 13:00:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 664018FC0A; Fri, 29 Jun 2012 13:00:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TD0TnV047040; Fri, 29 Jun 2012 13:00:29 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TD0Tlg047038; Fri, 29 Jun 2012 13:00:29 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201206291300.q5TD0Tlg047038@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 29 Jun 2012 13:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237778 - stable/9/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 13:00:29 -0000 Author: bapt Date: Fri Jun 29 13:00:28 2012 New Revision: 237778 URL: http://svn.freebsd.org/changeset/base/237778 Log: MFC: r237268 early MFC to get this important bugfix into 9.1 Revert user comparison back to user names as some user can share uids (root/toor for example) get the username information from old_pw structures to still allow renaming of a user. Reported by: Claude Buisson Approved by: des (mentor) Modified: stable/9/lib/libutil/pw_util.c Directory Properties: stable/9/lib/libutil/ (props changed) Modified: stable/9/lib/libutil/pw_util.c ============================================================================== --- stable/9/lib/libutil/pw_util.c Fri Jun 29 12:55:36 2012 (r237777) +++ stable/9/lib/libutil/pw_util.c Fri Jun 29 13:00:28 2012 (r237778) @@ -436,14 +436,21 @@ pw_copy(int ffd, int tfd, const struct p size_t len; int eof, readlen; - spw = pw; + if (old_pw == NULL && pw == NULL) + return (-1); + + spw = old_pw; + /* deleting a user */ if (pw == NULL) { line = NULL; - if (old_pw == NULL) + } else { + if ((line = pw_make(pw)) == NULL) return (-1); - spw = old_pw; - } else if ((line = pw_make(pw)) == NULL) - return (-1); + } + + /* adding a user */ + if (spw == NULL) + spw = pw; eof = 0; len = 0; @@ -510,7 +517,7 @@ pw_copy(int ffd, int tfd, const struct p */ *q = t; - if (fpw == NULL || fpw->pw_uid != spw->pw_uid) { + if (fpw == NULL || strcmp(fpw->pw_name, spw->pw_name) != 0) { /* nope */ if (fpw != NULL) free(fpw); From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 13:02:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAF5F106566B; Fri, 29 Jun 2012 13:02:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4FF28FC0A; Fri, 29 Jun 2012 13:02:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TD2kML047172; Fri, 29 Jun 2012 13:02:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TD2krY047170; Fri, 29 Jun 2012 13:02:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206291302.q5TD2krY047170@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jun 2012 13:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237779 - stable/8/sys/boot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 13:02:46 -0000 Author: avg Date: Fri Jun 29 13:02:46 2012 New Revision: 237779 URL: http://svn.freebsd.org/changeset/base/237779 Log: fix a mismerge in r237765 sys/boot stable/8 doesn't have Makefile.spac64, instead it has spar64-specific blocks in Makefile. This is a direct commit. Pointyhat to: avg Modified: stable/8/sys/boot/Makefile Modified: stable/8/sys/boot/Makefile ============================================================================== --- stable/8/sys/boot/Makefile Fri Jun 29 13:00:28 2012 (r237778) +++ stable/8/sys/boot/Makefile Fri Jun 29 13:02:46 2012 (r237779) @@ -22,7 +22,7 @@ SUBDIR+= ofw SUBDIR+= uboot .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || ${MACHINE_ARCH} == "sparc64" SUBDIR+= zfs .endif From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 14:08:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93549106564A; Fri, 29 Jun 2012 14:08:08 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 3DD588FC0C; Fri, 29 Jun 2012 14:08:08 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 1883C87F; Fri, 29 Jun 2012 16:08:07 +0200 (CEST) Date: Fri, 29 Jun 2012 16:06:03 +0200 From: Pawel Jakub Dawidek To: John Baldwin Message-ID: <20120629140603.GA1389@garage.freebsd.pl> References: <201206271808.q5RI8m0d024853@svn.freebsd.org> <201206271517.26128.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline In-Reply-To: <201206271517.26128.jhb@freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237656 - in head: contrib/top usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 14:08:08 -0000 --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 27, 2012 at 03:17:26PM -0400, John Baldwin wrote: > On Wednesday, June 27, 2012 2:08:48 pm John Baldwin wrote: > > Author: jhb > > Date: Wed Jun 27 18:08:48 2012 > > New Revision: 237656 > > URL: http://svn.freebsd.org/changeset/base/237656 > >=20 > > Log: > > Add a new line to top that provides a brief summary of the ZFS ARC me= mory > > usage on hosts using ZFS. The new line displays the total amount of = RAM > > used by the ARC along with the size of MFU, MRU, anonymous (in flight= ), > > headers, and other (miscellaneous) sub-categories. The line is not > > displayed on systems that are not using ZFS. > > =20 > > Reviewed by: avg, fs@ > > MFC after: 3 days >=20 > FYI, sample output: >=20 > CPU: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle > Mem: 1252M Active, 1422M Inact, 23G Wired, 331M Buf, 21G Free > ARC: 21G Total, 1354M MRU, 19G MFU, 272K Anon, 243M Header, 447M Other > Swap: 8192M Total, 8192M Free Cool:) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --mP3DRpeJDSE+ciuQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/ttksACgkQForvXbEpPzSKiQCgxJlJHN1Vo5ex8ZvjQK9m/4M5 yLIAnjpwAxQSGIK4LXcYab7+EFtap2Xc =zgEf -----END PGP SIGNATURE----- --mP3DRpeJDSE+ciuQ-- From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 14:14:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5082D1065672; Fri, 29 Jun 2012 14:14:50 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 321CA8FC0C; Fri, 29 Jun 2012 14:14:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TEEogm050113; Fri, 29 Jun 2012 14:14:50 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TEEnnn050111; Fri, 29 Jun 2012 14:14:50 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201206291414.q5TEEnnn050111@svn.freebsd.org> From: Peter Holm Date: Fri, 29 Jun 2012 14:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237780 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 14:14:50 -0000 Author: pho Date: Fri Jun 29 14:14:49 2012 New Revision: 237780 URL: http://svn.freebsd.org/changeset/base/237780 Log: MFC: r237219 In tty_makedev() the following construction: dev = make_dev_cred(); dev->si_drv1 = tp; leaves a small window where the newly created device may be opened and si_drv1 is NULL. As this is a vary rare situation, using a lock to close the window seems overkill. Instead just wait for the assignment of si_drv1. Modified: stable/8/sys/kern/tty.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/tty.c ============================================================================== --- stable/8/sys/kern/tty.c Fri Jun 29 13:02:46 2012 (r237779) +++ stable/8/sys/kern/tty.c Fri Jun 29 14:14:49 2012 (r237780) @@ -216,9 +216,15 @@ ttydev_leave(struct tty *tp) static int ttydev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { - struct tty *tp = dev->si_drv1; + struct tty *tp; int error = 0; + while ((tp = dev->si_drv1) == NULL) { + error = tsleep(&dev->si_drv1, PCATCH, "ttdrv1", 1); + if (error != EWOULDBLOCK) + return (error); + } + tty_lock(tp); if (tty_gone(tp)) { /* Device is already gone. */ @@ -726,9 +732,14 @@ static struct cdevsw ttydev_cdevsw = { static int ttyil_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { - struct tty *tp = dev->si_drv1; + struct tty *tp; int error = 0; + while ((tp = dev->si_drv1) == NULL) { + error = tsleep(&dev->si_drv1, PCATCH, "ttdrv1", 1); + if (error != EWOULDBLOCK) + return (error); + } tty_lock(tp); if (tty_gone(tp)) error = ENODEV; @@ -1166,6 +1177,7 @@ tty_makedev(struct tty *tp, struct ucred dev = make_dev_cred(&ttydev_cdevsw, 0, cred, uid, gid, mode, "%s%s", prefix, name); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); tp->t_dev = dev; /* Slave call-in devices. */ @@ -1174,12 +1186,14 @@ tty_makedev(struct tty *tp, struct ucred uid, gid, mode, "%s%s.init", prefix, name); dev_depends(tp->t_dev, dev); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); dev->si_drv2 = &tp->t_termios_init_in; dev = make_dev_cred(&ttyil_cdevsw, 0, cred, uid, gid, mode, "%s%s.lock", prefix, name); dev_depends(tp->t_dev, dev); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); dev->si_drv2 = &tp->t_termios_lock_in; } @@ -1189,6 +1203,7 @@ tty_makedev(struct tty *tp, struct ucred UID_UUCP, GID_DIALER, 0660, "cua%s", name); dev_depends(tp->t_dev, dev); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); /* Slave call-out devices. */ if (tp->t_flags & TF_INITLOCK) { @@ -1196,12 +1211,14 @@ tty_makedev(struct tty *tp, struct ucred UID_UUCP, GID_DIALER, 0660, "cua%s.init", name); dev_depends(tp->t_dev, dev); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); dev->si_drv2 = &tp->t_termios_init_out; dev = make_dev_cred(&ttyil_cdevsw, 0, cred, UID_UUCP, GID_DIALER, 0660, "cua%s.lock", name); dev_depends(tp->t_dev, dev); dev->si_drv1 = tp; + wakeup(&dev->si_drv1); dev->si_drv2 = &tp->t_termios_lock_out; } } From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 15:21:10 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3D97106566B; Fri, 29 Jun 2012 15:21:10 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 844768FC12; Fri, 29 Jun 2012 15:21:10 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q5TFL9HF077956; Fri, 29 Jun 2012 08:21:10 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q5TFL9oY077954; Fri, 29 Jun 2012 08:21:09 -0700 (PDT) (envelope-from obrien) Date: Fri, 29 Jun 2012 08:21:09 -0700 From: "David O'Brien" To: "Pedro F. Giffuni" Message-ID: <20120629152109.GA70522@dragon.NUXI.org> References: <201206270439.q5R4dU0n081732@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201206270439.q5R4dU0n081732@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? 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: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 15:21:10 -0000 On Wed, Jun 27, 2012 at 04:39:30AM +0000, Pedro F. Giffuni wrote: > Log: > Bring llquantize support into Dtrace. > Bryan Cantrill implemented the equivalent of semi-log graph > paper for Dtrace so llquantize will use one logarithmic and > one linear scale. ... > Obtained from: Illumos ... > Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d Wed Jun 27 04:39:30 2012 (r237624) > @@ -0,0 +1,29 @@ > +/* > + * CDDL HEADER START > + * > + * The contents of this file are subject to the terms of the > + * Common Development and Distribution License (the "License"). > + * You may not use this file except in compliance with the License. ... > +/* > + * Copyright (c) 2011, Joyent, Inc. All rights reserved. > + */ Pedro, It looks like you simply 'svn add'ed this file, rather than importing it into '^/vendor/opensolaris/dist'. Please correct me if I am wrong. We've become rather sloppy in the past 1-2 years in our handling of 3rd-party externally developed code. Something we need to return to our older ways good ways of handling. This is something that is especially important with GPL, CDDL, and similar licenses. Commercial entities that base products on FreeBSD have to worry about code provenance for various intellectual property legal reasons and we muddy the waters when we make it harder to track who and where code came from. [Please see http://www.osgeo.org/incubator/process/codereview.html & http://wiki.osgeo.org/wiki/Code_Provenance_Review to better understand this issue.] Not following our established procedure also means that the average developer(committer) and commercial consumer will have their expectations fail. One expects to be able to find the stock vendor sources in ssh://svn.freebsd.org/base/vendor/ and to be able to find FreeBSD local changes to the sources thru 'svn diff' against 'ssh://svn.freebsd.org/base/head'. Please correct this by properly importing the sources, 'svn delete'ing the files you 'svn add'ed, and do an 'svn copy' of the new files. thanks, -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 15:21:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A28A41065670; Fri, 29 Jun 2012 15:21:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74F108FC0A; Fri, 29 Jun 2012 15:21:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TFLZRv053269; Fri, 29 Jun 2012 15:21:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TFLZe8053266; Fri, 29 Jun 2012 15:21:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291521.q5TFLZe8053266@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 15:21: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: r237787 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 15:21:35 -0000 Author: jhb Date: Fri Jun 29 15:21:34 2012 New Revision: 237787 URL: http://svn.freebsd.org/changeset/base/237787 Log: Hold GIF_LOCK() for almost all of gif_start(). It is required to be held across in_gif_output() and in6_gif_output() anyway, and once it is held across those it might as well be held for the entire loop. This simplifies the code and removes the need for the custom IFF_GIF_WANTED flag (which belonged in the softc and not as an IFF_* flag anyway). Tested by: Vincent Hoffman vince unsane co uk Modified: head/sys/net/if.h head/sys/net/if_gif.c Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Fri Jun 29 15:10:54 2012 (r237786) +++ head/sys/net/if.h Fri Jun 29 15:21:34 2012 (r237787) @@ -153,7 +153,6 @@ struct if_data { #define IFF_STATICARP 0x80000 /* (n) static ARP */ #define IFF_DYING 0x200000 /* (n) interface is winding down */ #define IFF_RENAMING 0x400000 /* (n) interface is being renamed */ -#define IFF_GIF_WANTED 0x1000000 /* (n) The gif tunnel is wanted */ /* * Old names for driver flags so that user space tools can continue to use * the old (portable) names. Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Fri Jun 29 15:10:54 2012 (r237786) +++ head/sys/net/if_gif.c Fri Jun 29 15:21:34 2012 (r237787) @@ -359,15 +359,7 @@ gif_start(struct ifnet *ifp) sc = ifp->if_softc; GIF_LOCK(sc); - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { - /* Already active */ - ifp->if_drv_flags |= IFF_GIF_WANTED; - GIF_UNLOCK(sc); - return; - } ifp->if_drv_flags |= IFF_DRV_OACTIVE; - GIF_UNLOCK(sc); -keep_going: while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m); @@ -424,16 +416,6 @@ keep_going: ifp->if_oerrors++; } - GIF_LOCK(sc); - if (ifp->if_drv_flags & IFF_GIF_WANTED) { - /* Someone did a start while - * we were unlocked and processing - * lets clear the flag and try again. - */ - ifp->if_drv_flags &= ~IFF_GIF_WANTED; - GIF_UNLOCK(sc); - goto keep_going; - } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; GIF_UNLOCK(sc); return; From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 15:24:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D38C1065672; Fri, 29 Jun 2012 15:24:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DF738FC0C; Fri, 29 Jun 2012 15:24:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TFOl8a053466; Fri, 29 Jun 2012 15:24:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TFOllL053463; Fri, 29 Jun 2012 15:24:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291524.q5TFOllL053463@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 15:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237789 - stable/9/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 15:24:47 -0000 Author: jhb Date: Fri Jun 29 15:24:46 2012 New Revision: 237789 URL: http://svn.freebsd.org/changeset/base/237789 Log: MFC 236577: Allow the -p argument to kdump to accept either a PID or a thread ID. Modified: stable/9/usr.bin/kdump/kdump.1 stable/9/usr.bin/kdump/kdump.c Directory Properties: stable/9/usr.bin/kdump/ (props changed) Modified: stable/9/usr.bin/kdump/kdump.1 ============================================================================== --- stable/9/usr.bin/kdump/kdump.1 Fri Jun 29 15:24:42 2012 (r237788) +++ stable/9/usr.bin/kdump/kdump.1 Fri Jun 29 15:24:46 2012 (r237789) @@ -28,7 +28,7 @@ .\" @(#)kdump.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 20, 2012 +.Dd June 4, 2012 .Dt KDUMP 1 .Os .Sh NAME @@ -86,9 +86,9 @@ string. Suppressing this feature yields a more consistent output format and is easily amenable to further processing. .It Fl p Ar pid -Display only trace events that correspond to the process +Display only trace events that correspond to the process or thread .Ar pid . -This may be useful when there are multiple processes recorded in the +This may be useful when there are multiple processes or threads recorded in the same trace file. .It Fl R Display relative timestamps (time since previous entry). Modified: stable/9/usr.bin/kdump/kdump.c ============================================================================== --- stable/9/usr.bin/kdump/kdump.c Fri Jun 29 15:24:42 2012 (r237788) +++ stable/9/usr.bin/kdump/kdump.c Fri Jun 29 15:24:46 2012 (r237789) @@ -249,7 +249,8 @@ main(int argc, char *argv[]) } } if (trpoints & (1< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 858E2106585F; Fri, 29 Jun 2012 15:24:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE8EF8FC15; Fri, 29 Jun 2012 15:24:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TFOtYe053511; Fri, 29 Jun 2012 15:24:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TFOtqL053508; Fri, 29 Jun 2012 15:24:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291524.q5TFOtqL053508@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 15:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237790 - stable/8/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 15:24:58 -0000 Author: jhb Date: Fri Jun 29 15:24:55 2012 New Revision: 237790 URL: http://svn.freebsd.org/changeset/base/237790 Log: MFC 236577: Allow the -p argument to kdump to accept either a PID or a thread ID. Modified: stable/8/usr.bin/kdump/kdump.1 stable/8/usr.bin/kdump/kdump.c Directory Properties: stable/8/usr.bin/kdump/ (props changed) Modified: stable/8/usr.bin/kdump/kdump.1 ============================================================================== --- stable/8/usr.bin/kdump/kdump.1 Fri Jun 29 15:24:46 2012 (r237789) +++ stable/8/usr.bin/kdump/kdump.1 Fri Jun 29 15:24:55 2012 (r237790) @@ -32,7 +32,7 @@ .\" @(#)kdump.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 20, 2012 +.Dd June 4, 2012 .Dt KDUMP 1 .Os .Sh NAME @@ -90,9 +90,9 @@ string. Suppressing this feature yields a more consistent output format and is easily amenable to further processing. .It Fl p Ar pid -Display only trace events that correspond to the process +Display only trace events that correspond to the process or thread .Ar pid . -This may be useful when there are multiple processes recorded in the +This may be useful when there are multiple processes or threads recorded in the same trace file. .It Fl R Display relative timestamps (time since previous entry). Modified: stable/8/usr.bin/kdump/kdump.c ============================================================================== --- stable/8/usr.bin/kdump/kdump.c Fri Jun 29 15:24:46 2012 (r237789) +++ stable/8/usr.bin/kdump/kdump.c Fri Jun 29 15:24:55 2012 (r237790) @@ -253,7 +253,8 @@ main(int argc, char *argv[]) } } if (trpoints & (1< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 648C0106564A; Fri, 29 Jun 2012 15:30:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EBBF8FC14; Fri, 29 Jun 2012 15:30:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TFUFV4053814; Fri, 29 Jun 2012 15:30:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TFUFNh053812; Fri, 29 Jun 2012 15:30:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291530.q5TFUFNh053812@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 15:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237792 - stable/9/lib/libprocstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 15:30:15 -0000 Author: jhb Date: Fri Jun 29 15:30:14 2012 New Revision: 237792 URL: http://svn.freebsd.org/changeset/base/237792 Log: MFC 236717: Teach procstat_get_shm_info_kvm() how to fetch the pathname of a SHM file descriptor from a core and set it in fts->fs_path. Modified: stable/9/lib/libprocstat/libprocstat.c Directory Properties: stable/9/lib/libprocstat/ (props changed) Modified: stable/9/lib/libprocstat/libprocstat.c ============================================================================== --- stable/9/lib/libprocstat/libprocstat.c Fri Jun 29 15:27:17 2012 (r237791) +++ stable/9/lib/libprocstat/libprocstat.c Fri Jun 29 15:30:14 2012 (r237792) @@ -881,6 +881,8 @@ procstat_get_shm_info_kvm(kvm_t *kd, str { struct shmfd shmfd; void *shmfdp; + char *path; + int i; assert(kd); assert(shm); @@ -896,6 +898,21 @@ procstat_get_shm_info_kvm(kvm_t *kd, str } shm->mode = S_IFREG | shmfd.shm_mode; shm->size = shmfd.shm_size; + if (fst->fs_path == NULL && shmfd.shm_path != NULL) { + path = malloc(MAXPATHLEN); + for (i = 0; i < MAXPATHLEN - 1; i++) { + if (!kvm_read_all(kd, (unsigned long)shmfd.shm_path + i, + path + i, 1)) + break; + if (path[i] == '\0') + break; + } + path[i] = '\0'; + if (i == 0) + free(path); + else + fst->fs_path = path; + } return (0); fail: From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 15:54:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A0031065670; Fri, 29 Jun 2012 15:54:08 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74E6B8FC17; Fri, 29 Jun 2012 15:54:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TFs8Uv054855; Fri, 29 Jun 2012 15:54:08 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TFs8NK054852; Fri, 29 Jun 2012 15:54:08 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206291554.q5TFs8NK054852@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 29 Jun 2012 15:54: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: r237794 - head/tools/regression/filemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 15:54:08 -0000 Author: obrien Date: Fri Jun 29 15:54:07 2012 New Revision: 237794 URL: http://svn.freebsd.org/changeset/base/237794 Log: Support also running a 32-bit test on 64-bit platforms. Modified: head/tools/regression/filemon/Makefile Modified: head/tools/regression/filemon/Makefile ============================================================================== --- head/tools/regression/filemon/Makefile Fri Jun 29 15:47:03 2012 (r237793) +++ head/tools/regression/filemon/Makefile Fri Jun 29 15:54:07 2012 (r237794) @@ -9,16 +9,18 @@ CFLAGS+= -I${.CURDIR}/../../../sys # Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in . test: ${PROG} clean-test +.for BIN in ${PROG} ${PROG}32 cd ${.CURDIR} ; \ for A in 1 2 3 4 5 6 7 8 9 0; do \ for B in 1 2 3 4 5 6 7 8 9 0; do \ for C in 1 2 3 4 5 6 7 8 9 0; do \ - ${.OBJDIR}/${PROG} ;\ + test -x ${BIN} && ${.OBJDIR}/${BIN} ;\ done ;\ done ;\ done @cd ${.CURDIR} ; set +e ; egrep '(Start|Stop) .*\.' filemon_log.* | \ grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || echo "Time stamp format OK" +.endfor clean-test: cd ${.CURDIR} ; rm -f filemon_log.* From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 15:57:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3F941065710; Fri, 29 Jun 2012 15:57:25 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89028FC18; Fri, 29 Jun 2012 15:57:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TFvP91055063; Fri, 29 Jun 2012 15:57:25 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TFvPLb055057; Fri, 29 Jun 2012 15:57:25 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206291557.q5TFvPLb055057@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 29 Jun 2012 15:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237795 - in stable/9: share/man/man4 sys/dev/filemon sys/modules sys/modules/filemon tools/regression/filemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 15:57:26 -0000 Author: obrien Date: Fri Jun 29 15:57:25 2012 New Revision: 237795 URL: http://svn.freebsd.org/changeset/base/237795 Log: MFC: r236592 r236593 r236594 r236620 r236621 r236622 r236637 r237794: filemon(4) Added: stable/9/share/man/man4/filemon.4 - copied, changed from r236593, head/share/man/man4/filemon.4 stable/9/sys/dev/filemon/ - copied from r236592, head/sys/dev/filemon/ stable/9/sys/modules/filemon/ - copied from r236592, head/sys/modules/filemon/ stable/9/tools/regression/filemon/ - copied from r236594, head/tools/regression/filemon/ Modified: stable/9/share/man/man4/Makefile stable/9/sys/modules/Makefile stable/9/tools/regression/filemon/Makefile stable/9/tools/regression/filemon/filemontest.c Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) stable/9/tools/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Fri Jun 29 15:54:07 2012 (r237794) +++ stable/9/share/man/man4/Makefile Fri Jun 29 15:57:25 2012 (r237795) @@ -126,6 +126,7 @@ MAN= aac.4 \ fdc.4 \ fdt.4 \ fdtbus.4 \ + filemon.4 \ firewire.4 \ fpa.4 \ fwe.4 \ Copied and modified: stable/9/share/man/man4/filemon.4 (from r236593, head/share/man/man4/filemon.4) ============================================================================== --- head/share/man/man4/filemon.4 Mon Jun 4 22:59:06 2012 (r236593, copy source) +++ stable/9/share/man/man4/filemon.4 Fri Jun 29 15:57:25 2012 (r237795) @@ -50,63 +50,74 @@ responds to two calls. .Pp System calls are denoted using the following single letters: +.Pp .Bl -tag -width indent -compact -.It Dq Li C +.It Ql C .Xr chdir 2 -.It Dq Li D +.It Ql D .Xr unlink 2 -.It Dq Li E +.It Ql E .Xr exec 2 -.It Dq Li F +.It Ql F .Xr fork 2 , .Xr vfork 2 -.It Dq Li L +.It Ql L .Xr link 2 , .Xr linkat 2 , .Xr symlink 2 , .Xr symlinkat 2 -.It Dq Li M +.It Ql M .Xr rename 2 -.It Dq Li R +.It Ql R .Xr open 2 for read -.It Dq Li S +.It Ql S .Xr stat 2 -.It Dq Li W +.It Ql W .Xr open 2 for write -.It Dq Li X +.It Ql X .Xr _exit 2 .El .Pp Note that -.Dq R +.Ql R following -.Dq W +.Ql W records can represent a single .Xr open 2 for R/W, or two seperate .Xr open 2 calls, one for -R +.Ql R and one for -W. +.Ql W . .Sh IOCTLS -User mode programs communicate with the filemon driver through a -number of ioctls which are described below. +User mode programs communicate with the +.Nm +driver through a number of ioctls which are described below. Each takes a single argument. -.Bl -tag -width FILEMON_SET_PID +.Bl -tag -width ".Dv FILEMON_SET_PID" .It Dv FILEMON_SET_FD Write the internal tracing buffer to the supplied open file descriptor. -.It Dv FILEMON_SET_PID . +.It Dv FILEMON_SET_PID Child process ID to trace. .El -.Pp .Sh RETURN VALUES -The ioctl returns zero on success and non-zero on failure. +.\" .Rv -std ioctl +The +.Fn ioctl +function returns the value 0 if successful; +otherwise the value \-1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh FILES +.Bl -tag -width ".Pa /dev/filemon" +.It Pa /dev/filemon +.El .Sh EXAMPLES -.Bd -literal -offset indent +.Bd -literal #include #include #include @@ -122,23 +133,24 @@ open_filemon(void) int fm_fd, fm_log; if ((fm_fd = open("/dev/filemon", O_RDWR)) == -1) - err(1, "open(\"/dev/filemon\", O_RDWR)"); + err(1, "open(\e"/dev/filemon\e", O_RDWR)"); if ((fm_log = open("filemon.out", O_CREAT | O_WRONLY | O_TRUNC, DEFFILEMODE)) == -1) err(1, "open(filemon.out)"); - if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0) + if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) == -1) err(1, "Cannot set filemon log file descriptor"); /* Set up these two fd's to close on exec. */ (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC); (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC); if ((child = fork()) == 0) { + child = getpid(); + if (ioctl(fm_fd, FILEMON_SET_PID, &child) == -1) + err(1, "Cannot set filemon PID"); /* Do something here. */ return 0; } else { - if (ioctl(fm_fd, FILEMON_SET_PID, &child) < 0) - err(1, "Cannot set filemon PID"); wait(&child); close(fm_fd); } @@ -150,11 +162,9 @@ Creates a file named .Pa filemon.out and configures the .Nm -device to write the filemon buffer contents to it. -.Sh FILES -.Bl -tag -width /dev/zero -.It Pa /dev/filemon -.El +device to write the +.Nm +buffer contents to it. .Sh SEE ALSO .Xr dtrace 1 , .Xr ktrace 1 , Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Fri Jun 29 15:54:07 2012 (r237794) +++ stable/9/sys/modules/Makefile Fri Jun 29 15:57:25 2012 (r237795) @@ -5,7 +5,8 @@ # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). -SUBDIR= ${_3dfx} \ +SUBDIR= \ + ${_3dfx} \ ${_3dfx_linux} \ ${_aac} \ accf_data \ @@ -102,6 +103,7 @@ SUBDIR= ${_3dfx} \ fdc \ fdescfs \ ${_fe} \ + ${_filemon} \ firewire \ firmware \ ${_fxp} \ @@ -352,6 +354,10 @@ SUBDIR= ${_3dfx} \ ${_zfs} \ zlib \ +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +_filemon= filemon +.endif + .if ${MACHINE_CPUARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm" && \ ${MACHINE_CPUARCH} != "mips" _syscons= syscons Modified: stable/9/tools/regression/filemon/Makefile ============================================================================== --- head/tools/regression/filemon/Makefile Mon Jun 4 22:59:33 2012 (r236594) +++ stable/9/tools/regression/filemon/Makefile Fri Jun 29 15:57:25 2012 (r237795) @@ -9,16 +9,18 @@ CFLAGS+= -I${.CURDIR}/../../../sys # Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in . test: ${PROG} clean-test +.for BIN in ${PROG} ${PROG}32 cd ${.CURDIR} ; \ for A in 1 2 3 4 5 6 7 8 9 0; do \ for B in 1 2 3 4 5 6 7 8 9 0; do \ for C in 1 2 3 4 5 6 7 8 9 0; do \ - ${.OBJDIR}/${PROG} ;\ + test -x ${BIN} && ${.OBJDIR}/${BIN} ;\ done ;\ done ;\ done @cd ${.CURDIR} ; set +e ; egrep '(Start|Stop) .*\.' filemon_log.* | \ grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || echo "Time stamp format OK" +.endfor clean-test: cd ${.CURDIR} ; rm -f filemon_log.* Modified: stable/9/tools/regression/filemon/filemontest.c ============================================================================== --- head/tools/regression/filemon/filemontest.c Mon Jun 4 22:59:33 2012 (r236594) +++ stable/9/tools/regression/filemon/filemontest.c Fri Jun 29 15:57:25 2012 (r237795) @@ -54,22 +54,27 @@ main(void) { if ((fm_log = mkstemp(log_name)) == -1) err(1, "mkstemp(%s)", log_name); - if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0) + if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) == -1) err(1, "Cannot set filemon log file descriptor"); /* Set up these two fd's to close on exec. */ (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC); (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC); - if ((child = fork()) == 0) { + switch (child = fork()) { + case 0: + child = getpid(); + if (ioctl(fm_fd, FILEMON_SET_PID, &child) == -1) + err(1, "Cannot set filemon PID to %d", child); system("./test_script.sh"); - return 0; - } else { - if (ioctl(fm_fd, FILEMON_SET_PID, &child) < 0) - err(1, "Cannot set filemon PID"); + break; + case -1: + err(1, "Cannot fork"); + default: wait(&child); close(fm_fd); // printf("Results in %s\n", log_name); + break; } return 0; } From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 16:21:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C23410656D7; Fri, 29 Jun 2012 16:21:20 +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 B95918FC19; Fri, 29 Jun 2012 16:21:19 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q5TGFQd4089721; Fri, 29 Jun 2012 18:15:26 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q5TGFQRm089720; Fri, 29 Jun 2012 18:15:26 +0200 (CEST) (envelope-from marius) Date: Fri, 29 Jun 2012 18:15:26 +0200 From: Marius Strobl To: "Kenneth D. Merry" Message-ID: <20120629161525.GK69382@alchemy.franken.de> References: <201206282048.q5SKmOON097814@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201206282048.q5SKmOON097814@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: r237730 - in head/sys: powerpc/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 16:21:20 -0000 On Thu, Jun 28, 2012 at 08:48:24PM +0000, Kenneth D. Merry wrote: > Author: ken > Date: Thu Jun 28 20:48:24 2012 > New Revision: 237730 > URL: http://svn.freebsd.org/changeset/base/237730 > > Log: > Now that the mps(4) driver is endian-safe, add it to the powerpc and > sparc64 GENERIC config files. > Thanks! Marius From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 16:29:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C9A6106566B; Fri, 29 Jun 2012 16:29:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D6EE8FC0C; Fri, 29 Jun 2012 16:29:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TGTcCb056431; Fri, 29 Jun 2012 16:29:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TGTcGc056429; Fri, 29 Jun 2012 16:29:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291629.q5TGTcGc056429@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 16:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237797 - stable/9/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 16:29:38 -0000 Author: jhb Date: Fri Jun 29 16:29:38 2012 New Revision: 237797 URL: http://svn.freebsd.org/changeset/base/237797 Log: MFC 237008,237271,237272,237673: - Fix a couple of bugs that prevented windows in PCI-PCI bridges from growing "downward" (moving the start address down). First, an off by one error caused the end address to be moved down an extra alignment chunk unnecessarily. Second, when aligning the new candidate starting address, the wrong bits were masked off. - Add a 'wmask' variable to hold the expression '(1ul << w->step) - 1' in pcib_grow_window(). - For subtractively decoding bridges, don't try to grow windows but pass the request up the tree in order to be on the safe side. Growing windows in this case would mean to switch resources to positive decoding and it's unclear how to correctly handle this. At least with ALi/ULi M5249 PCI-PCI bridges, this also just doesn't work out of the box. Modified: stable/9/sys/dev/pci/pci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/pci/pci_pci.c ============================================================================== --- stable/9/sys/dev/pci/pci_pci.c Fri Jun 29 16:06:06 2012 (r237796) +++ stable/9/sys/dev/pci/pci_pci.c Fri Jun 29 16:29:38 2012 (r237797) @@ -815,7 +815,7 @@ static int pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type, u_long start, u_long end, u_long count, u_int flags) { - u_long align, start_free, end_free, front, back; + u_long align, start_free, end_free, front, back, wmask; int error, rid; /* @@ -828,6 +828,7 @@ pcib_grow_window(struct pcib_softc *sc, end = w->rman.rm_end; if (start + count - 1 > end || start + count < start) return (EINVAL); + wmask = (1ul << w->step) - 1; /* * If there is no resource at all, just try to allocate enough @@ -838,8 +839,8 @@ pcib_grow_window(struct pcib_softc *sc, flags &= ~RF_ALIGNMENT_MASK; flags |= RF_ALIGNMENT_LOG2(w->step); } - start &= ~((1ul << w->step) - 1); - end |= ((1ul << w->step) - 1); + start &= ~wmask; + end |= wmask; count = roundup2(count, 1ul << w->step); rid = w->reg; w->res = bus_alloc_resource(sc->dev, type, &rid, start, end, @@ -893,9 +894,9 @@ pcib_grow_window(struct pcib_softc *sc, if (start < rman_get_start(w->res)) { if (rman_first_free_region(&w->rman, &start_free, &end_free) != 0 || start_free != rman_get_start(w->res)) - end_free = rman_get_start(w->res) - 1; + end_free = rman_get_start(w->res); if (end_free > end) - end_free = end; + end_free = end + 1; /* Move end_free down until it is properly aligned. */ end_free &= ~(align - 1); @@ -913,7 +914,7 @@ pcib_grow_window(struct pcib_softc *sc, if (bootverbose) printf("\tfront candidate range: %#lx-%#lx\n", front, end_free); - front &= (1ul << w->step) - 1; + front &= ~wmask; front = rman_get_start(w->res) - front; } else front = 0; @@ -941,7 +942,7 @@ pcib_grow_window(struct pcib_softc *sc, if (bootverbose) printf("\tback candidate range: %#lx-%#lx\n", start_free, back); - back = roundup2(back + 1, 1ul << w->step) - 1; + back |= wmask; back -= rman_get_end(w->res); } else back = 0; @@ -1000,10 +1001,8 @@ updatewin: /* Save the new window. */ w->base = rman_get_start(w->res); w->limit = rman_get_end(w->res); - KASSERT((w->base & ((1ul << w->step) - 1)) == 0, - ("start address is not aligned")); - KASSERT((w->limit & ((1ul << w->step) - 1)) == (1ul << w->step) - 1, - ("end address is not aligned")); + KASSERT((w->base & wmask) == 0, ("start address is not aligned")); + KASSERT((w->limit & wmask) == wmask, ("end address is not aligned")); pcib_write_windows(sc, w->mask); return (0); } @@ -1039,7 +1038,7 @@ pcib_alloc_resource(device_t dev, device case SYS_RES_IOPORT: r = pcib_suballoc_resource(sc, &sc->io, child, type, rid, start, end, count, flags); - if (r != NULL) + if (r != NULL || (sc->flags & PCIB_SUBTRACTIVE) != 0) break; if (pcib_grow_window(sc, &sc->io, type, start, end, count, flags) == 0) @@ -1063,7 +1062,7 @@ pcib_alloc_resource(device_t dev, device } r = pcib_suballoc_resource(sc, &sc->mem, child, type, rid, start, end, count, flags); - if (r != NULL) + if (r != NULL || (sc->flags & PCIB_SUBTRACTIVE) != 0) break; if (flags & RF_PREFETCHABLE) { if (pcib_grow_window(sc, &sc->pmem, type, start, end, From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 16:30:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8FC531065679; Fri, 29 Jun 2012 16:30:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FD7D8FC0A; Fri, 29 Jun 2012 16:30:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TGUGne056499; Fri, 29 Jun 2012 16:30:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TGUGse056497; Fri, 29 Jun 2012 16:30:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291630.q5TGUGse056497@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 16:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237798 - stable/8/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 16:30:16 -0000 Author: jhb Date: Fri Jun 29 16:30:15 2012 New Revision: 237798 URL: http://svn.freebsd.org/changeset/base/237798 Log: MFC 237008,237271,237272,237673: - Fix a couple of bugs that prevented windows in PCI-PCI bridges from growing "downward" (moving the start address down). First, an off by one error caused the end address to be moved down an extra alignment chunk unnecessarily. Second, when aligning the new candidate starting address, the wrong bits were masked off. - Add a 'wmask' variable to hold the expression '(1ul << w->step) - 1' in pcib_grow_window(). - For subtractively decoding bridges, don't try to grow windows but pass the request up the tree in order to be on the safe side. Growing windows in this case would mean to switch resources to positive decoding and it's unclear how to correctly handle this. At least with ALi/ULi M5249 PCI-PCI bridges, this also just doesn't work out of the box. Modified: stable/8/sys/dev/pci/pci_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/pci/pci_pci.c ============================================================================== --- stable/8/sys/dev/pci/pci_pci.c Fri Jun 29 16:29:38 2012 (r237797) +++ stable/8/sys/dev/pci/pci_pci.c Fri Jun 29 16:30:15 2012 (r237798) @@ -695,7 +695,7 @@ static int pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type, u_long start, u_long end, u_long count, u_int flags) { - u_long align, start_free, end_free, front, back; + u_long align, start_free, end_free, front, back, wmask; int error, rid; /* @@ -708,6 +708,7 @@ pcib_grow_window(struct pcib_softc *sc, end = w->rman.rm_end; if (start + count - 1 > end || start + count < start) return (EINVAL); + wmask = (1ul << w->step) - 1; /* * If there is no resource at all, just try to allocate enough @@ -718,8 +719,8 @@ pcib_grow_window(struct pcib_softc *sc, flags &= ~RF_ALIGNMENT_MASK; flags |= RF_ALIGNMENT_LOG2(w->step); } - start &= ~((1ul << w->step) - 1); - end |= ((1ul << w->step) - 1); + start &= ~wmask; + end |= wmask; count = roundup2(count, 1ul << w->step); rid = w->reg; w->res = bus_alloc_resource(sc->dev, type, &rid, start, end, @@ -773,9 +774,9 @@ pcib_grow_window(struct pcib_softc *sc, if (start < rman_get_start(w->res)) { if (rman_first_free_region(&w->rman, &start_free, &end_free) != 0 || start_free != rman_get_start(w->res)) - end_free = rman_get_start(w->res) - 1; + end_free = rman_get_start(w->res); if (end_free > end) - end_free = end; + end_free = end + 1; /* Move end_free down until it is properly aligned. */ end_free &= ~(align - 1); @@ -793,7 +794,7 @@ pcib_grow_window(struct pcib_softc *sc, if (bootverbose) printf("\tfront candidate range: %#lx-%#lx\n", front, end_free); - front &= (1ul << w->step) - 1; + front &= ~wmask; front = rman_get_start(w->res) - front; } else front = 0; @@ -821,7 +822,7 @@ pcib_grow_window(struct pcib_softc *sc, if (bootverbose) printf("\tback candidate range: %#lx-%#lx\n", start_free, back); - back = roundup2(back + 1, 1ul << w->step) - 1; + back |= wmask; back -= rman_get_end(w->res); } else back = 0; @@ -880,10 +881,8 @@ updatewin: /* Save the new window. */ w->base = rman_get_start(w->res); w->limit = rman_get_end(w->res); - KASSERT((w->base & ((1ul << w->step) - 1)) == 0, - ("start address is not aligned")); - KASSERT((w->limit & ((1ul << w->step) - 1)) == (1ul << w->step) - 1, - ("end address is not aligned")); + KASSERT((w->base & wmask) == 0, ("start address is not aligned")); + KASSERT((w->limit & wmask) == wmask, ("end address is not aligned")); pcib_write_windows(sc, w->mask); return (0); } @@ -919,7 +918,7 @@ pcib_alloc_resource(device_t dev, device case SYS_RES_IOPORT: r = pcib_suballoc_resource(sc, &sc->io, child, type, rid, start, end, count, flags); - if (r != NULL) + if (r != NULL || (sc->flags & PCIB_SUBTRACTIVE) != 0) break; if (pcib_grow_window(sc, &sc->io, type, start, end, count, flags) == 0) @@ -943,7 +942,7 @@ pcib_alloc_resource(device_t dev, device } r = pcib_suballoc_resource(sc, &sc->mem, child, type, rid, start, end, count, flags); - if (r != NULL) + if (r != NULL || (sc->flags & PCIB_SUBTRACTIVE) != 0) break; if (flags & RF_PREFETCHABLE) { if (pcib_grow_window(sc, &sc->pmem, type, start, end, From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 16:50:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7996E1065672; Fri, 29 Jun 2012 16:50:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0DC8FC15; Fri, 29 Jun 2012 16:50:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TGorkE057451; Fri, 29 Jun 2012 16:50:53 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TGorai057448; Fri, 29 Jun 2012 16:50:53 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201206291650.q5TGorai057448@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 29 Jun 2012 16:50: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: r237799 - head/sys/dev/cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 16:50:53 -0000 Author: np Date: Fri Jun 29 16:50:52 2012 New Revision: 237799 URL: http://svn.freebsd.org/changeset/base/237799 Log: cxgbe(4): support for IPv6 hardware checksumming (rx and tx). Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Jun 29 16:30:15 2012 (r237798) +++ head/sys/dev/cxgbe/t4_main.c Fri Jun 29 16:50:52 2012 (r237799) @@ -822,7 +822,7 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ - IFCAP_VLAN_HWTSO) + IFCAP_VLAN_HWTSO | IFCAP_HWCSUM_IPV6) #define T4_CAP_ENABLE (T4_CAP & ~IFCAP_TSO6) static int @@ -856,7 +856,8 @@ cxgbe_attach(device_t dev) ifp->if_capabilities |= IFCAP_TOE4; #endif ifp->if_capenable = T4_CAP_ENABLE; - ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO; + ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | + CSUM_UDP_IPV6 | CSUM_TCP_IPV6; /* Initialize ifmedia for this port */ ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change, @@ -1028,30 +1029,50 @@ fail: if (IFCAP_TSO & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { - ifp->if_capenable &= ~IFCAP_TSO; - ifp->if_hwassist &= ~CSUM_TSO; + ifp->if_capenable &= ~IFCAP_TSO4; if_printf(ifp, "tso disabled due to -txcsum.\n"); } } + if (mask & IFCAP_TXCSUM_IPV6) { + ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; + ifp->if_hwassist ^= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6); + + if (IFCAP_TSO6 & ifp->if_capenable && + !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + ifp->if_capenable &= ~IFCAP_TSO6; + if_printf(ifp, + "tso6 disabled due to -txcsum6.\n"); + } + } if (mask & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; + if (mask & IFCAP_RXCSUM_IPV6) + ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; + + /* + * Note that we leave CSUM_TSO alone (it is always set). The + * kernel takes both IFCAP_TSOx and CSUM_TSO into account before + * sending a TSO request our way, so it's sufficient to toggle + * IFCAP_TSOx only. + */ if (mask & IFCAP_TSO4) { + if (!(IFCAP_TSO4 & ifp->if_capenable) && + !(IFCAP_TXCSUM & ifp->if_capenable)) { + if_printf(ifp, "enable txcsum first.\n"); + rc = EAGAIN; + goto fail; + } ifp->if_capenable ^= IFCAP_TSO4; - - if (IFCAP_TSO & ifp->if_capenable) { - if (IFCAP_TXCSUM & ifp->if_capenable) - ifp->if_hwassist |= CSUM_TSO; - else { - ifp->if_capenable &= ~IFCAP_TSO; - ifp->if_hwassist &= ~CSUM_TSO; - if_printf(ifp, - "enable txcsum first.\n"); - rc = EAGAIN; - goto fail; - } - } else - ifp->if_hwassist &= ~CSUM_TSO; + } + if (mask & IFCAP_TSO6) { + if (!(IFCAP_TSO6 & ifp->if_capenable) && + !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + if_printf(ifp, "enable txcsum6 first.\n"); + rc = EAGAIN; + goto fail; + } + ifp->if_capenable ^= IFCAP_TSO6; } if (mask & IFCAP_LRO) { #ifdef INET Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Jun 29 16:30:15 2012 (r237798) +++ head/sys/dev/cxgbe/t4_sge.c Fri Jun 29 16:50:52 2012 (r237799) @@ -1054,15 +1054,23 @@ t4_eth_rx(struct sge_iq *iq, const struc m0->m_flags |= M_FLOWID; m0->m_pkthdr.flowid = rss->hash_val; - if (cpl->csum_calc && !cpl->err_vec && - ifp->if_capenable & IFCAP_RXCSUM) { - m0->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | - CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - if (cpl->ip_frag) + if (cpl->csum_calc && !cpl->err_vec) { + if (ifp->if_capenable & IFCAP_RXCSUM && + cpl->l2info & htobe32(F_RXF_IP)) { + m0->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | + CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + rxq->rxcsum++; + } else if (ifp->if_capenable & IFCAP_RXCSUM_IPV6 && + cpl->l2info & htobe32(F_RXF_IP6)) { + m0->m_pkthdr.csum_flags |= (CSUM_DATA_VALID_IPV6 | + CSUM_PSEUDO_HDR); + rxq->rxcsum++; + } + + if (__predict_false(cpl->ip_frag)) m0->m_pkthdr.csum_data = be16toh(cpl->csum); else m0->m_pkthdr.csum_data = 0xffff; - rxq->rxcsum++; } if (cpl->vlan_ex) { @@ -2827,9 +2835,11 @@ write_txpkt_wr(struct port_info *pi, str ctrl1 = 0; if (!(m->m_pkthdr.csum_flags & CSUM_IP)) ctrl1 |= F_TXPKT_IPCSUM_DIS; - if (!(m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP))) + if (!(m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 | + CSUM_TCP_IPV6))) ctrl1 |= F_TXPKT_L4CSUM_DIS; - if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP)) + if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP | + CSUM_UDP_IPV6 | CSUM_TCP_IPV6)) txq->txcsum++; /* some hardware assistance provided */ /* VLAN tag insertion */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:00:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DE50106564A; Fri, 29 Jun 2012 17:00:52 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 891258FC0A; Fri, 29 Jun 2012 17:00:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TH0qGC057892; Fri, 29 Jun 2012 17:00:52 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TH0q0U057890; Fri, 29 Jun 2012 17:00:52 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206291700.q5TH0q0U057890@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 29 Jun 2012 17:00: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: r237800 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:00:52 -0000 Author: ken Date: Fri Jun 29 17:00:52 2012 New Revision: 237800 URL: http://svn.freebsd.org/changeset/base/237800 Log: Change the mps(4) driver to only scan a target if that is what is needed instead of scanning the full bus every time. Submitted by: mav Discussed with: Sreekanth Reddy MFC after: 3 days Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Fri Jun 29 16:50:52 2012 (r237799) +++ head/sys/dev/mps/mps_sas.c Fri Jun 29 17:00:52 2012 (r237800) @@ -278,8 +278,11 @@ mpssas_rescan_target(struct mps_softc *s return; } - /* XXX Hardwired to scan the bus for now */ - ccb->ccb_h.func_code = XPT_SCAN_BUS; + if (targetid == CAM_TARGET_WILDCARD) + ccb->ccb_h.func_code = XPT_SCAN_BUS; + else + ccb->ccb_h.func_code = XPT_SCAN_TGT; + mps_dprint(sc, MPS_TRACE, "%s targetid %u\n", __func__, targetid); mpssas_rescan(sassc, ccb); } From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:09:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52D60106564A for ; Fri, 29 Jun 2012 17:09:15 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm15.bullet.mail.sp2.yahoo.com (nm15.bullet.mail.sp2.yahoo.com [98.139.91.85]) by mx1.freebsd.org (Postfix) with SMTP id 0D0E68FC16 for ; Fri, 29 Jun 2012 17:09:15 +0000 (UTC) Received: from [98.139.91.69] by nm15.bullet.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 17:09:09 -0000 Received: from [98.139.91.42] by tm9.bullet.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 17:09:09 -0000 Received: from [127.0.0.1] by omp1042.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 17:09:09 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 23340.50402.bm@omp1042.mail.sp2.yahoo.com Received: (qmail 74577 invoked by uid 60001); 29 Jun 2012 17:09:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1340989748; bh=UbCf8UXXvvWXgK70ZEdFIizRcSEsjw9ueKNQVIjceL4=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=LwN1Uyl3Wxwgu/AF30BGGDwVyuQEWMm5lQJZJSxepZrSYemh3UuByltY3LwlQ0P3LjN3G9rdjjE1fqQL1gWQGBuucmCl1l4MJWmNl7juRgZl9IfBZoFgIjce5lb3vQW1P8nHctuXaQbGs9fhAFgWPlHLBhX6xQYtJpYKEZcrzF0= X-YMail-OSG: mMhv.6IVM1lJX_9_6oGmO9svJ0DRx_uSOaLLp9qPtqoqedg _8wdpdfKZitlFUp4dpMsKg8hnoe6jN3GKFpK2lc41Ch72dywAluyGfPLk8sd vRzj8h5EDi.XPrBdgeGs6vEs6uYr9IWKCs8ZiTCuZoi7SQRgGVVk_f84VQbD iYAcW0ju86MQ7tTVqzZb1XiQaSlUoivAITfLRA1YOzBoXjKSzlLOaXpwcenp q42CujW57gPGbrleRmo4qx0rk1hDMtVoYjmp_p7vNhQ2zSwoJZh2BKOhK.a_ tcAakFrGMOb4Ks0b92x8BbaUsNMPKDNP5vqqu.ar24HQTPveJag.Y6uF9Zko dSe6WNwgZISJOYzJwdDDfy3OUVZPIopr.vn2WyFOI5q2K.H8ioZSsR.lI3Bh urMV9KKLBKB0Cl3KgIV_bMGEZ0_ecH5WdDYmMgGEBG3CTxBDLcjO4kWZtKen PfByQjhuli5I_ofAeLLlvh0VIklJ.IGXPobdXkbBEzGpGbipfCdxz6ZQDOBt p9JIyhQeAwCPRfeqyUamifI7j0XGBaEteBTVaKCaHcjFOmOsLaowa_gkkvky XFQLY3GFtaitK2saFj4o- Received: from [200.118.157.7] by web113504.mail.gq1.yahoo.com via HTTP; Fri, 29 Jun 2012 10:09:08 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.8 YahooMailWebService/0.8.118.349524 Message-ID: <1340989748.73663.YahooMailClassic@web113504.mail.gq1.yahoo.com> Date: Fri, 29 Jun 2012 10:09:08 -0700 (PDT) From: Pedro Giffuni To: obrien@FreeBSD.org In-Reply-To: <20120629152109.GA70522@dragon.NUXI.org> 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, src-committers@FreeBSD.org Subject: Re: svn commit: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:09:15 -0000 Hi David;=0A=0A--- Ven 29/6/12, David O'Brien ha scrit= to:=0A...=0A> ...=0A> > +/*=0A> > + * Copyright (c) 2011, Joyent, Inc. All = rights=0A> reserved.=0A> > + */=0A> =0A> Pedro,=0A> It looks like you simpl= y 'svn add'ed this file, rather than=0A> importing it into '^/vendor/openso= laris/dist'.=A0 =0A> Please correct me if I am wrong.=0A> =0A=0AYou are abs= olutely right. However I am not sure we should=0Abring Illumos enhancements= under the opensolaris vendor=0Abranch. The reason is that this files are C= DDL'd but are=0Athere was no property assignment done to the OpenSolaris=0A= copyright owner. [1]=0A=0AIf somehow Oracle decides to relicense Dtrace or = ZFS we=0Astill must keep these changes isolated from the code=0Aprovided in= the vendor branch.=0A=0A=0A> We've become rather sloppy in the past 1-2 ye= ars in our=0A> handling of 3rd-party externally developed code.=A0 Somethin= g=0A> we need to return to our older ways good ways of handling.=0A> =0A=0A= Yes, that is true.=0A=0AI think we have to decide if we are going to consid= er=0AIllumos a vendor on it's own. For ZFS it would seem=0Athe right thing = to do, for Dtrace I am not sure: at=0Aleast I am not considering bringing a= ny other feature=0Aat this time.=0A=0A=0AThank you for the links on Code Pr= ovenance Review.=0A=0A> =0A> Please correct this by properly importing the = sources, 'svn=0A> delete'ing the files you 'svn add'ed, and do an 'svn copy= '=0A> of the new files.=0A>=0A=0AI think the discussion is indeed important= enough to=0Asuspend the MFC I was planning and if desired I can=0Aalso rev= ert the commit.=0A=0APedro.=0A=0A=0A[1] http://smartos.org/2011/12/15/fork-= yeah-the-rise-and-development-of-illumos-2/ From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:12:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC32D106564A; Fri, 29 Jun 2012 17:12:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D72C8FC0C; Fri, 29 Jun 2012 17:12:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5THC4Kn058452; Fri, 29 Jun 2012 17:12:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5THC4sk058450; Fri, 29 Jun 2012 17:12:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291712.q5THC4sk058450@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 17:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237803 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:12:04 -0000 Author: jhb Date: Fri Jun 29 17:12:03 2012 New Revision: 237803 URL: http://svn.freebsd.org/changeset/base/237803 Log: MFC 237334: Move the per-thread deferred user map entries list into a private list in vm_map_process_deferred() which is then iterated to release map entries. This avoids having a nested vm map unlock operation called from the loop body attempt to recuse into vm_map_process_deferred(). This can happen if the vm_map_remove() triggers the OOM killer. Modified: stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Fri Jun 29 17:05:13 2012 (r237802) +++ stable/9/sys/vm/vm_map.c Fri Jun 29 17:12:03 2012 (r237803) @@ -475,12 +475,14 @@ static void vm_map_process_deferred(void) { struct thread *td; - vm_map_entry_t entry; + vm_map_entry_t entry, next; vm_object_t object; td = curthread; - while ((entry = td->td_map_def_user) != NULL) { - td->td_map_def_user = entry->next; + entry = td->td_map_def_user; + td->td_map_def_user = NULL; + while (entry != NULL) { + next = entry->next; if ((entry->eflags & MAP_ENTRY_VN_WRITECNT) != 0) { /* * Decrement the object's writemappings and @@ -494,6 +496,7 @@ vm_map_process_deferred(void) entry->end); } vm_map_entry_deallocate(entry, FALSE); + entry = next; } } From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:12:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC313106570F; Fri, 29 Jun 2012 17:12:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6B6F8FC16; Fri, 29 Jun 2012 17:12:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5THCQd1058503; Fri, 29 Jun 2012 17:12:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5THCQ9U058501; Fri, 29 Jun 2012 17:12:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291712.q5THCQ9U058501@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 17:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237804 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:12:26 -0000 Author: jhb Date: Fri Jun 29 17:12:26 2012 New Revision: 237804 URL: http://svn.freebsd.org/changeset/base/237804 Log: MFC 237334: Move the per-thread deferred user map entries list into a private list in vm_map_process_deferred() which is then iterated to release map entries. This avoids having a nested vm map unlock operation called from the loop body attempt to recuse into vm_map_process_deferred(). This can happen if the vm_map_remove() triggers the OOM killer. Modified: stable/8/sys/vm/vm_map.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/vm/vm_map.c ============================================================================== --- stable/8/sys/vm/vm_map.c Fri Jun 29 17:12:03 2012 (r237803) +++ stable/8/sys/vm/vm_map.c Fri Jun 29 17:12:26 2012 (r237804) @@ -457,13 +457,15 @@ static void vm_map_process_deferred(void) { struct thread *td; - vm_map_entry_t entry; + vm_map_entry_t entry, next; td = curthread; - - while ((entry = td->td_map_def_user) != NULL) { - td->td_map_def_user = entry->next; + entry = td->td_map_def_user; + td->td_map_def_user = NULL; + while (entry != NULL) { + next = entry->next; vm_map_entry_deallocate(entry, FALSE); + entry = next; } } From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:21:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D2571065672; Fri, 29 Jun 2012 17:21:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E9D88FC18; Fri, 29 Jun 2012 17:21:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5THLJmI058919; Fri, 29 Jun 2012 17:21:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5THLJ37058915; Fri, 29 Jun 2012 17:21:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291721.q5THLJ37058915@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 17:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237805 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:21:20 -0000 Author: jhb Date: Fri Jun 29 17:21:19 2012 New Revision: 237805 URL: http://svn.freebsd.org/changeset/base/237805 Log: MFC 233191: Fix madvise(MADV_WILLNEED) to properly handle individual mappings larger than 4GB. Specifically, the inlined version of 'ptoa' of the the 'int' count of pages overflowed on 64-bit platforms. While here, change vm_object_madvise() to accept two vm_pindex_t parameters (start and end) rather than a (start, count) tuple to match other VM APIs as suggested by alc@. Modified: stable/9/sys/vm/vm_map.c stable/9/sys/vm/vm_object.c stable/9/sys/vm/vm_object.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Fri Jun 29 17:12:26 2012 (r237804) +++ stable/9/sys/vm/vm_map.c Fri Jun 29 17:21:19 2012 (r237805) @@ -2105,8 +2105,7 @@ vm_map_madvise( } vm_map_unlock(map); } else { - vm_pindex_t pindex; - int count; + vm_pindex_t pstart, pend; /* * madvise behaviors that are implemented in the underlying @@ -2124,30 +2123,29 @@ vm_map_madvise( if (current->eflags & MAP_ENTRY_IS_SUB_MAP) continue; - pindex = OFF_TO_IDX(current->offset); - count = atop(current->end - current->start); + pstart = OFF_TO_IDX(current->offset); + pend = pstart + atop(current->end - current->start); useStart = current->start; if (current->start < start) { - pindex += atop(start - current->start); - count -= atop(start - current->start); + pstart += atop(start - current->start); useStart = start; } if (current->end > end) - count -= atop(current->end - end); + pend -= atop(current->end - end); - if (count <= 0) + if (pstart >= pend) continue; - vm_object_madvise(current->object.vm_object, - pindex, count, behav); + vm_object_madvise(current->object.vm_object, pstart, + pend, behav); if (behav == MADV_WILLNEED) { vm_map_pmap_enter(map, useStart, current->protection, current->object.vm_object, - pindex, - (count << PAGE_SHIFT), + pstart, + ptoa(pend - pstart), MAP_PREFAULT_MADVISE ); } Modified: stable/9/sys/vm/vm_object.c ============================================================================== --- stable/9/sys/vm/vm_object.c Fri Jun 29 17:12:26 2012 (r237804) +++ stable/9/sys/vm/vm_object.c Fri Jun 29 17:21:19 2012 (r237805) @@ -1064,16 +1064,16 @@ vm_object_sync(vm_object_t object, vm_oo * without I/O. */ void -vm_object_madvise(vm_object_t object, vm_pindex_t pindex, int count, int advise) +vm_object_madvise(vm_object_t object, vm_pindex_t pindex, vm_pindex_t end, + int advise) { - vm_pindex_t end, tpindex; + vm_pindex_t tpindex; vm_object_t backing_object, tobject; vm_page_t m; if (object == NULL) return; VM_OBJECT_LOCK(object); - end = pindex + count; /* * Locate and adjust resident pages */ Modified: stable/9/sys/vm/vm_object.h ============================================================================== --- stable/9/sys/vm/vm_object.h Fri Jun 29 17:12:26 2012 (r237804) +++ stable/9/sys/vm/vm_object.h Fri Jun 29 17:21:19 2012 (r237805) @@ -226,6 +226,7 @@ void vm_object_destroy (vm_object_t); void vm_object_terminate (vm_object_t); void vm_object_set_writeable_dirty (vm_object_t); void vm_object_init (void); +void vm_object_madvise(vm_object_t, vm_pindex_t, vm_pindex_t, int); void vm_object_page_cache(vm_object_t object, vm_pindex_t start, vm_pindex_t end); boolean_t vm_object_page_clean(vm_object_t object, vm_ooffset_t start, @@ -241,7 +242,6 @@ void vm_object_shadow (vm_object_t *, vm void vm_object_split(vm_map_entry_t); boolean_t vm_object_sync(vm_object_t, vm_ooffset_t, vm_size_t, boolean_t, boolean_t); -void vm_object_madvise (vm_object_t, vm_pindex_t, int, int); #endif /* _KERNEL */ #endif /* _VM_OBJECT_ */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:21:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 722211065687; Fri, 29 Jun 2012 17:21:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C82A8FC12; Fri, 29 Jun 2012 17:21:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5THLl0e058978; Fri, 29 Jun 2012 17:21:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5THLlG6058974; Fri, 29 Jun 2012 17:21:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291721.q5THLlG6058974@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 17:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237806 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:21:47 -0000 Author: jhb Date: Fri Jun 29 17:21:46 2012 New Revision: 237806 URL: http://svn.freebsd.org/changeset/base/237806 Log: MFC 233191: Fix madvise(MADV_WILLNEED) to properly handle individual mappings larger than 4GB. Specifically, the inlined version of 'ptoa' of the the 'int' count of pages overflowed on 64-bit platforms. While here, change vm_object_madvise() to accept two vm_pindex_t parameters (start and end) rather than a (start, count) tuple to match other VM APIs as suggested by alc@. Modified: stable/8/sys/vm/vm_map.c stable/8/sys/vm/vm_object.c stable/8/sys/vm/vm_object.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/vm/vm_map.c ============================================================================== --- stable/8/sys/vm/vm_map.c Fri Jun 29 17:21:19 2012 (r237805) +++ stable/8/sys/vm/vm_map.c Fri Jun 29 17:21:46 2012 (r237806) @@ -2085,8 +2085,7 @@ vm_map_madvise( } vm_map_unlock(map); } else { - vm_pindex_t pindex; - int count; + vm_pindex_t pstart, pend; /* * madvise behaviors that are implemented in the underlying @@ -2104,30 +2103,29 @@ vm_map_madvise( if (current->eflags & MAP_ENTRY_IS_SUB_MAP) continue; - pindex = OFF_TO_IDX(current->offset); - count = atop(current->end - current->start); + pstart = OFF_TO_IDX(current->offset); + pend = pstart + atop(current->end - current->start); useStart = current->start; if (current->start < start) { - pindex += atop(start - current->start); - count -= atop(start - current->start); + pstart += atop(start - current->start); useStart = start; } if (current->end > end) - count -= atop(current->end - end); + pend -= atop(current->end - end); - if (count <= 0) + if (pstart >= pend) continue; - vm_object_madvise(current->object.vm_object, - pindex, count, behav); + vm_object_madvise(current->object.vm_object, pstart, + pend, behav); if (behav == MADV_WILLNEED) { vm_map_pmap_enter(map, useStart, current->protection, current->object.vm_object, - pindex, - (count << PAGE_SHIFT), + pstart, + ptoa(pend - pstart), MAP_PREFAULT_MADVISE ); } Modified: stable/8/sys/vm/vm_object.c ============================================================================== --- stable/8/sys/vm/vm_object.c Fri Jun 29 17:21:19 2012 (r237805) +++ stable/8/sys/vm/vm_object.c Fri Jun 29 17:21:46 2012 (r237806) @@ -1056,16 +1056,16 @@ vm_object_sync(vm_object_t object, vm_oo * without I/O. */ void -vm_object_madvise(vm_object_t object, vm_pindex_t pindex, int count, int advise) +vm_object_madvise(vm_object_t object, vm_pindex_t pindex, vm_pindex_t end, + int advise) { - vm_pindex_t end, tpindex; + vm_pindex_t tpindex; vm_object_t backing_object, tobject; vm_page_t m; if (object == NULL) return; VM_OBJECT_LOCK(object); - end = pindex + count; /* * Locate and adjust resident pages */ Modified: stable/8/sys/vm/vm_object.h ============================================================================== --- stable/8/sys/vm/vm_object.h Fri Jun 29 17:21:19 2012 (r237805) +++ stable/8/sys/vm/vm_object.h Fri Jun 29 17:21:46 2012 (r237806) @@ -218,6 +218,7 @@ void vm_object_destroy (vm_object_t); void vm_object_terminate (vm_object_t); void vm_object_set_writeable_dirty (vm_object_t); void vm_object_init (void); +void vm_object_madvise(vm_object_t, vm_pindex_t, vm_pindex_t, int); void vm_object_page_cache(vm_object_t object, vm_pindex_t start, vm_pindex_t end); boolean_t vm_object_page_clean(vm_object_t, vm_pindex_t, vm_pindex_t, boolean_t); @@ -230,7 +231,6 @@ void vm_object_shadow (vm_object_t *, vm void vm_object_split(vm_map_entry_t); boolean_t vm_object_sync(vm_object_t, vm_ooffset_t, vm_size_t, boolean_t, boolean_t); -void vm_object_madvise (vm_object_t, vm_pindex_t, int, int); #endif /* _KERNEL */ #endif /* _VM_OBJECT_ */ From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:28:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21FA3106566C; Fri, 29 Jun 2012 17:28:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BFF38FC12; Fri, 29 Jun 2012 17:28:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5THS3Nf059369; Fri, 29 Jun 2012 17:28:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5THS3Vl059366; Fri, 29 Jun 2012 17:28:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291728.q5THS3Vl059366@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 17:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237808 - in stable/8/etc/periodic: daily security X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:28:04 -0000 Author: jhb Date: Fri Jun 29 17:28:03 2012 New Revision: 237808 URL: http://svn.freebsd.org/changeset/base/237808 Log: MFC 197552: Silence warning printed by getfsspec(3) when /etc/fstab does not exist fstab: /etc/fstab:0: No such file or directory and from dump(8) when setfsent(3) fails due to /etc/fstab not existing: DUMP: Can't open /etc/fstab for dump table information: No such... This makes daily and security periodic runs somewhat cleaner in jails which lack /etc/fstab files. Modified: stable/8/etc/periodic/daily/400.status-disks stable/8/etc/periodic/security/200.chkmounts Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/periodic/daily/400.status-disks ============================================================================== --- stable/8/etc/periodic/daily/400.status-disks Fri Jun 29 17:26:37 2012 (r237807) +++ stable/8/etc/periodic/daily/400.status-disks Fri Jun 29 17:28:03 2012 (r237808) @@ -19,6 +19,9 @@ case "$daily_status_disks_enable" in df $daily_status_disks_df_flags && rc=1 || rc=3 # display which filesystems need backing up + if ! [ -f /etc/fstab ]; then + export PATH_FSTAB=/dev/null + fi echo "" dump W || rc=3;; Modified: stable/8/etc/periodic/security/200.chkmounts ============================================================================== --- stable/8/etc/periodic/security/200.chkmounts Fri Jun 29 17:26:37 2012 (r237807) +++ stable/8/etc/periodic/security/200.chkmounts Fri Jun 29 17:28:03 2012 (r237808) @@ -50,6 +50,9 @@ case "$daily_status_security_chkmounts_e ignore="${ignore}|^amd:" esac [ -n "$ignore" ] && cmd="egrep -v ${ignore#|}" || cmd=cat + if ! [ -f /etc/fstab ]; then + export PATH_FSTAB=/dev/null + fi mount -p | sort | ${cmd} | check_diff mount - "${host} changes in mounted filesystems:" rc=$?;; From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:28:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E37B106564A; Fri, 29 Jun 2012 17:28:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 681758FC0C; Fri, 29 Jun 2012 17:28:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5THSn8r059457; Fri, 29 Jun 2012 17:28:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5THSnWi059455; Fri, 29 Jun 2012 17:28:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291728.q5THSnWi059455@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 17:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237809 - stable/9/etc/periodic/daily X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:28:49 -0000 Author: jhb Date: Fri Jun 29 17:28:48 2012 New Revision: 237809 URL: http://svn.freebsd.org/changeset/base/237809 Log: MFC 237337: Only output a list of file systems that need to be dumped if the system has a non-empty dumpdates file. Modified: stable/9/etc/periodic/daily/400.status-disks Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/periodic/daily/400.status-disks ============================================================================== --- stable/9/etc/periodic/daily/400.status-disks Fri Jun 29 17:28:03 2012 (r237808) +++ stable/9/etc/periodic/daily/400.status-disks Fri Jun 29 17:28:48 2012 (r237809) @@ -19,12 +19,15 @@ case "$daily_status_disks_enable" in df $daily_status_disks_df_flags && rc=1 || rc=3 # display which filesystems need backing up - if ! [ -f /etc/fstab ]; then - export PATH_FSTAB=/dev/null - fi + if [ -s /etc/dumpdates ]; then + if ! [ -f /etc/fstab ]; then + export PATH_FSTAB=/dev/null + fi - echo "" - dump W || rc=3;; + echo "" + dump W || rc=3 + fi + ;; *) rc=0;; esac From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:28:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45CB710657BB; Fri, 29 Jun 2012 17:28:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D5FC8FC1A; Fri, 29 Jun 2012 17:28:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5THSxK0059501; Fri, 29 Jun 2012 17:28:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5THSwnw059499; Fri, 29 Jun 2012 17:28:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206291728.q5THSwnw059499@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 17:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237810 - stable/8/etc/periodic/daily X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:28:59 -0000 Author: jhb Date: Fri Jun 29 17:28:58 2012 New Revision: 237810 URL: http://svn.freebsd.org/changeset/base/237810 Log: MFC 237337: Only output a list of file systems that need to be dumped if the system has a non-empty dumpdates file. Modified: stable/8/etc/periodic/daily/400.status-disks Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/periodic/daily/400.status-disks ============================================================================== --- stable/8/etc/periodic/daily/400.status-disks Fri Jun 29 17:28:48 2012 (r237809) +++ stable/8/etc/periodic/daily/400.status-disks Fri Jun 29 17:28:58 2012 (r237810) @@ -19,12 +19,15 @@ case "$daily_status_disks_enable" in df $daily_status_disks_df_flags && rc=1 || rc=3 # display which filesystems need backing up - if ! [ -f /etc/fstab ]; then - export PATH_FSTAB=/dev/null - fi + if [ -s /etc/dumpdates ]; then + if ! [ -f /etc/fstab ]; then + export PATH_FSTAB=/dev/null + fi - echo "" - dump W || rc=3;; + echo "" + dump W || rc=3 + fi + ;; *) rc=0;; esac From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:38:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1368106566B for ; Fri, 29 Jun 2012 17:38:37 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm8.bullet.mail.sp2.yahoo.com (nm8.bullet.mail.sp2.yahoo.com [98.139.91.78]) by mx1.freebsd.org (Postfix) with SMTP id 0FBC98FC15 for ; Fri, 29 Jun 2012 17:38:37 +0000 (UTC) Received: from [98.139.91.67] by nm8.bullet.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 17:36:00 -0000 Received: from [98.139.91.4] by tm7.bullet.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 17:36:00 -0000 Received: from [127.0.0.1] by omp1004.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 17:36:00 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 407275.39454.bm@omp1004.mail.sp2.yahoo.com Received: (qmail 71746 invoked by uid 60001); 29 Jun 2012 17:35:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1340991359; bh=e87NgSNbjzhVbxJKawDjb9K6C5JHE8ZQSZHA1yAqUlQ=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5khTvpvb5ZNTkfUqm2WoUVei3wdOex41ABhVFG3V8fIV76CyVOWONQgrwyuATiEIm1V4CPY0pK+7GiIACgmUma354r6zN1QOptEegnfWQAZ5sM5iBNWp/1V3JDr/TPJcPqp6UVmPYQPVOCN9IX5ZmdffwiS8ki7CMKnYvJgfSb0= X-YMail-OSG: f_fwSQUVM1nrp5k.49GZ9aOk0l6ag6GZeeyfemQHU5bWCPA szul7gdx2H3CVyFFh8l8S423LaK7MoeM.m2vKkFOCelBnzCbaQT0mBRt0rmQ 6Vp7j3KDl2SYXfXmu33UGKU7cdGZI.WYsRDcDE7UYXLp9po8HYp8A5YS8mRR n6mKd2RRu8du3tWTRunYq3VnsRnBSDpLFM1ThDDmKg6_wL7_QNwXooTdddjY SS_.oxyUEobXd51.VVzVq04aeOuZ72zns_UrLCzcMyazpjTIV6djBeFnM7wg b5WoP_HgQI2g4AtLPhFb5gMBnUjb1s6gKg23E8T4nleLDxc_aj_cLMQ_RexP c9y7ZLD_7V_HPpcQRcaG9QYgU1GFuifcLcj_Rt8oKUPMSdXl.l5_TKH_XidQ 29bQuy4OVRv5f6iRZbJqkptoi7M.hCgUxVfAnNmqANzLj4XzUzphYkMTH9nC gfVZ4RpZxSPSmYbmLeBaSOVmEvYR4OInHhnEYqFvo3j26YptenzVkFyiYNf9 23qjLG7N_iuDsNA8IXRrroOz29Zg40MKZA84- Received: from [200.118.157.7] by web113502.mail.gq1.yahoo.com via HTTP; Fri, 29 Jun 2012 10:35:59 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.8 YahooMailWebService/0.8.118.349524 Message-ID: <1340991359.60778.YahooMailClassic@web113502.mail.gq1.yahoo.com> Date: Fri, 29 Jun 2012 10:35:59 -0700 (PDT) From: Pedro Giffuni To: obrien@FreeBSD.org In-Reply-To: <20120629152109.GA70522@dragon.NUXI.org> 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, src-committers@FreeBSD.org Subject: Re: svn commit: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:38:37 -0000 (Sorry for top-posting]=0A=0AActually ...=0A=0ADavid pointed out a fundamen= tal flaw on my part.=0A=0AThese are new files under a non-BSD license. Even= when=0Athey are only scripts used for testing I shouldn't have=0Abrought t= hem in without -core approval.=0A=0AI will delete them right away and core = shall decide=0Aafterwards if and how they can be brought in.=0A=0APedro.=0A= =0A=0A--- Ven 29/6/12, David O'Brien ha scritto:=0A=0A= > Da: David O'Brien =0A> Oggetto: Re: svn commit: r2376= 24 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantiz= e cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolari= s/uts/common/dtrace sys/cddl/c...=0A> A: "Pedro F. Giffuni" =0A> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-hea= d@FreeBSD.org=0A> Data: Venerd=EC 29 giugno 2012, 10:21=0A> On Wed, Jun 27,= 2012 at 04:39:30AM=0A> +0000, Pedro F. Giffuni wrote:=0A> > Log:=0A> >=A0= =A0=A0Bring llquantize support into Dtrace.=0A> >=A0=A0=A0Bryan Cantrill im= plemented the=0A> equivalent of semi-log graph=0A> >=A0=A0=A0paper for Dtra= ce so llquantize will=0A> use one logarithmic and=0A> >=A0=A0=A0one linear = scale.=0A> ...=0A> >=A0=A0=A0Obtained from:=A0=A0=A0=0A> Illumos=0A> ...=0A= > > Added:=0A> head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llq= uantize/err.D_LLQUANT_FACTOREVEN.nodivide.d=0A> >=0A> =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A> > --- /= dev/null=A0=A0=A0 00:00:00=0A> 1970=A0=A0=A0 (empty, because file is newly = added)=0A> > +++=0A> head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/comm= on/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d=A0=A0=A0=0A> Wed Jun 27 0= 4:39:30 2012=A0=A0=A0 (r237624)=0A> > @@ -0,0 +1,29 @@=0A> > +/*=0A> > + * = CDDL HEADER START=0A> > + *=0A> > + * The contents of this file are subject= to the terms=0A> of the=0A> > + * Common Development and Distribution Lice= nse (the=0A> "License").=0A> > + * You may not use this file except in comp= liance with=0A> the License.=0A> ...=0A> > +/*=0A> > + * Copyright (c) 2011= , Joyent, Inc. All rights=0A> reserved.=0A> > + */=0A> =0A> Pedro,=0A> It l= ooks like you simply 'svn add'ed this file, rather than=0A> importing it=0A= > into '^/vendor/opensolaris/dist'.=A0 Please correct me if=0A> I am wrong.= =0A> =0A> We've become rather sloppy in the past 1-2 years in our=0A> handl= ing of=0A> 3rd-party externally developed code.=A0 Something we need=0A> to= return to=0A> our older ways good ways of handling.=0A> =0A> This is somet= hing that is especially important with GPL,=0A> CDDL, and=0A> similar licen= ses.=0A> =0A> Commercial entities that base products on FreeBSD have to=0A>= worry about=0A> code provenance for various intellectual property legal=0A= > reasons and we=0A> muddy the waters when we make it harder to track who a= nd=0A> where code came=0A> from.=0A> [Please see http://www.osgeo.org/incub= ator/process/codereview.html=0A> &=0A> http://wiki.osgeo.org/wiki/Code_Prov= enance_Review to=0A> better understand=0A> this issue.]=0A> =0A> Not follow= ing our established procedure also means that the=0A> average=0A> developer= (committer) and commercial consumer will have their=0A> expectations=0A> fa= il.=A0 One expects to be able to find the stock vendor=0A> sources in=0A> s= sh://svn.freebsd.org/base/vendor/ and to be able to find=0A> FreeBSD local= =0A> changes to the sources thru 'svn diff' against=0A> 'ssh://svn.freebsd.= org/base/head'.=0A> =0A> Please correct this by properly importing the sour= ces, 'svn=0A> delete'ing=0A> the files you 'svn add'ed, and do an 'svn copy= ' of the new=0A> files.=0A> =0A> thanks,=0A> -- =0A> -- David=A0 (obrien@Fr= eeBSD.org)=0A> From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:48:25 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5822106566C; Fri, 29 Jun 2012 17:48:25 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id B312D8FC18; Fri, 29 Jun 2012 17:48:25 +0000 (UTC) Received: from [209.249.190.124] (port=58940 helo=gnnmac.hudson-trading.com) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77) (envelope-from ) id 1SkfHi-0006Fw-1s; Fri, 29 Jun 2012 13:47:10 -0400 Mime-Version: 1.0 (Apple Message framework v1280) Content-Type: text/plain; charset=iso-8859-1 From: George Neville-Neil In-Reply-To: <1340991359.60778.YahooMailClassic@web113502.mail.gq1.yahoo.com> Date: Fri, 29 Jun 2012 13:47:00 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1340991359.60778.YahooMailClassic@web113502.mail.gq1.yahoo.com> To: pfg@freebsd.org X-Mailer: Apple Mail (2.1280) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, obrien@FreeBSD.org Subject: Re: svn commit: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:48:26 -0000 On Jun 29, 2012, at 13:35 , Pedro Giffuni wrote: > (Sorry for top-posting] >=20 > Actually ... >=20 > David pointed out a fundamental flaw on my part. >=20 > These are new files under a non-BSD license. Even when > they are only scripts used for testing I shouldn't have > brought them in without -core approval. >=20 > I will delete them right away and core shall decide > afterwards if and how they can be brought in. >=20 Are the files under a CDDL license? Since that's the point of where you = added them I don't think that that should be an issue. The issue comes when we = might ship CDDL code by default, but these are tests and so that should not be = a problem. If they're not CDDL then that is an issue. Best, George From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 17:51:52 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC900106564A; Fri, 29 Jun 2012 17:51:52 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id ABFF38FC12; Fri, 29 Jun 2012 17:51:52 +0000 (UTC) Received: from [209.249.190.124] (port=59017 helo=gnnmac.hudson-trading.com) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77) (envelope-from ) id 1SkfMG-0001Wo-C9; Fri, 29 Jun 2012 13:51:52 -0400 Mime-Version: 1.0 (Apple Message framework v1280) Content-Type: text/plain; charset=us-ascii From: George Neville-Neil In-Reply-To: <4FED5C51.9060603@FreeBSD.org> Date: Fri, 29 Jun 2012 13:51:52 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201206290735.q5T7ZbSk026312@svn.freebsd.org> <4FED5C51.9060603@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.1280) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237748 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 17:51:53 -0000 On Jun 29, 2012, at 03:42 , Andriy Gapon wrote: > on 29/06/2012 10:35 Andriy Gapon said the following: >> Author: avg >> Date: Fri Jun 29 07:35:37 2012 >> New Revision: 237748 >> URL: http://svn.freebsd.org/changeset/base/237748 >>=20 >> Log: >> dtrace instruction decoder: add 0x0f 0x1f NOP opcode support >>=20 >> According to the AMD manual the whole range from 0x09 to 0x1f are = NOPs. >> Intel manual mentions only 0x1f. Use only Intel one for now, it = seems >> to be the one actually generated by compilers. >> Use gdb mnemonic for the operation: "nopw". >=20 > BTW, here I have a patch that brings our copy of dtrace dis_tables.c = to the > latest version available in OpenSolaris code: > http://people.freebsd.org/~avg/dtrace-disassm-osol.diff >=20 > I haven't studied at all what the newer code brings in, but it must be = some > fixes and improvements, I guess :-) > The change is mostly a mechanical merge, plus some changes on top to = get the > code to compile. > I've been using the code for a few weeks and haven't run into any = problems. >=20 > Should I put this change into the tree? Have you tried running the DTrace test suite on it? We have the suite = in the tree. If the suite passes similarly with and without the patch I'd say just = put it in and we'll go from there. It's quite a large patch, but, yes, much of it is mechanical changes. Best, George From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 18:01:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 399991065791 for ; Fri, 29 Jun 2012 18:01:48 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm7.bullet.mail.sp2.yahoo.com (nm7.bullet.mail.sp2.yahoo.com [98.139.91.77]) by mx1.freebsd.org (Postfix) with SMTP id 0B9228FC14 for ; Fri, 29 Jun 2012 18:01:48 +0000 (UTC) Received: from [98.139.91.67] by nm7.bullet.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 17:58:53 -0000 Received: from [98.139.91.10] by tm7.bullet.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 17:58:53 -0000 Received: from [127.0.0.1] by omp1010.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 17:58:53 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 300124.2885.bm@omp1010.mail.sp2.yahoo.com Received: (qmail 19573 invoked by uid 60001); 29 Jun 2012 17:58:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1340992732; bh=+/DUDAo4zsbjXD2npi60yABYbPPS/PnDSHqKZ2oPgXc=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=WyLovxU3RECb8XMb6+rr6dwDO/GE/dTVo38cKrKMvZ71MBNlL4YqyVDZIV9ZDdl/+QzbVOmHi4AHSfXl2dfCDtJvr3wRzQ6N37l8si2g+RT+sEL9OCbqyAqLZOk3kVVDy4evvrzvbkTdzA7cKKg+LGywkjtbDnKroWO0P/zP8tw= X-YMail-OSG: dnx4GucVM1mSAZR7GON6RIVabfTltz2ijG_sTxj2w53bLau HsSBkpSoNoXFFVxI990YF9c7uWBgDwIuRnAh5zDKZ9OtmB2Fb3JFuQPT7kRI z5n7pTbdyWgvDHvbwClnk6enLmi4lCmggUi9Y9IGTeSG2qL7lBBwbFz3UDtk pE.FAuSoYowxTwY9nr.HNYIQl82sAU3rA2igqR0G.fGPZKxe5JflHlF53.P. vWTFQr0SD33deRWXScupGX_CTDXz_csMEvPC3r3eSW8hXW219r5QqdEVxXsj 3I_gEj0Sw.JZ6v.jeJDZ9MZHghvUqR2x.YerSCoU2L0xBKVITmlXWC0XBbn. xT9nPFyEIZPNDFcOCwPACD0w22izCz0WyEpiZNIMvq9aDArIhJxj7o5HA9Z4 9mwW_.nEVvWppqcvzrrGEOf8r_K1I8wZ2U1mroZo82FvCqPcos30h5f7OwS3 AH1yu Received: from [200.118.157.7] by web113501.mail.gq1.yahoo.com via HTTP; Fri, 29 Jun 2012 10:58:52 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.8 YahooMailWebService/0.8.118.349524 Message-ID: <1340992732.19144.YahooMailClassic@web113501.mail.gq1.yahoo.com> Date: Fri, 29 Jun 2012 10:58:52 -0700 (PDT) From: Pedro Giffuni To: George Neville-Neil In-Reply-To: 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, src-committers@FreeBSD.org, obrien@FreeBSD.org Subject: Re: svn commit: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 18:01:48 -0000 =0A=0A--- Ven 29/6/12, George Neville-Neil ha scritt= o:=0A=0A> Da: George Neville-Neil =0A> Oggetto: Re: s= vn commit: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/= common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/co= ntrib/opensolaris/uts/common/dtrace sys/cddl/c...=0A> A: pfg@freebsd.org=0A= > Cc: obrien@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.o= rg, svn-src-head@FreeBSD.org=0A> Data: Venerd=EC 29 giugno 2012, 12:47=0A> = =0A> On Jun 29, 2012, at 13:35 , Pedro Giffuni wrote:=0A> =0A> > (Sorry for= top-posting]=0A> > =0A> > Actually ...=0A> > =0A> > David pointed out a fu= ndamental flaw on my part.=0A> > =0A> > These are new files under a non-BSD= license. Even when=0A> > they are only scripts used for testing I shouldn'= t=0A> have=0A> > brought them in without -core approval.=0A> > =0A> > I wil= l delete them right away and core shall decide=0A> > afterwards if and how = they can be brought in.=0A> > =0A> =0A> Are the files under a CDDL license?= =A0 Since that's the=0A> point of where you added them I don't think that t= hat=0A> should be an issue.=A0 The issue comes when we might=0A> ship CDDL = code by default, but these are tests and so that=0A> should not be a proble= m.=0A> =0A=0AThey are under CDDL. I re-read the committer's guide and=0Athe= y are right where they are.=0A=0ANow .. David pointed out I am not respecti= ng the code=0Aprovenance since I didn't add them to the opensolaris=0Avendo= r area, but these files are copyrighted Joyent=0AInc (not even Illumos) so = I cannot put them there=0Aunless we create a new vendor for Joyent.=0A=0AAs= George notes, they are only test files so we can=0Alive without them if th= is is too much mess.=0A=0APedro. From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 18:09:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE1B41065670; Fri, 29 Jun 2012 18:09:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7A9A8FC12; Fri, 29 Jun 2012 18:09:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TI9d8O062065; Fri, 29 Jun 2012 18:09:39 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TI9dk1062063; Fri, 29 Jun 2012 18:09:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206291809.q5TI9dk1062063@svn.freebsd.org> From: Dimitry Andric Date: Fri, 29 Jun 2012 18:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237812 - stable/9/sys/boot/i386/cdboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 18:09:40 -0000 Author: dim Date: Fri Jun 29 18:09:39 2012 New Revision: 237812 URL: http://svn.freebsd.org/changeset/base/237812 Log: MFC r235281: Fix sys/boot/i386/cdboot/cdboot.S compilation with clang after r235219. This file uses .code16 directives, which are not yet supported by clang's integrated assembler. Modified: stable/9/sys/boot/i386/cdboot/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/cdboot/Makefile ============================================================================== --- stable/9/sys/boot/i386/cdboot/Makefile Fri Jun 29 17:39:40 2012 (r237811) +++ stable/9/sys/boot/i386/cdboot/Makefile Fri Jun 29 18:09:39 2012 (r237812) @@ -13,3 +13,7 @@ ORG= 0x7c00 LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.cdboot.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 18:15:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC27B106564A; Fri, 29 Jun 2012 18:15:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BD098FC12; Fri, 29 Jun 2012 18:15:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TIFvQX062704; Fri, 29 Jun 2012 18:15:57 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TIFv0A062702; Fri, 29 Jun 2012 18:15:57 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201206291815.q5TIFv0A062702@svn.freebsd.org> From: Alan Cox Date: Fri, 29 Jun 2012 18:15: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: r237813 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 18:15:57 -0000 Author: alc Date: Fri Jun 29 18:15:56 2012 New Revision: 237813 URL: http://svn.freebsd.org/changeset/base/237813 Log: In r237592, I forgot that pmap_enter() might already hold a PV list lock at the point that it calls get_pv_entry(). Thus, pmap_enter()'s PV list lock pointer must be passed to get_pv_entry() for those rare occasions when get_pv_entry() calls reclaim_pv_chunk(). Update some related comments. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Jun 29 18:09:39 2012 (r237812) +++ head/sys/amd64/amd64/pmap.c Fri Jun 29 18:15:56 2012 (r237813) @@ -264,7 +264,7 @@ static caddr_t crashdumpmap; static void free_pv_chunk(struct pv_chunk *pc); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); -static pv_entry_t get_pv_entry(pmap_t pmap, boolean_t try); +static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); static int popcnt_pc_map_elem(uint64_t elem); static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); static void reserve_pv_entries(pmap_t pmap, int needed, @@ -2102,6 +2102,8 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_ * drastic measures to free some pages so we can allocate * another pv entry chunk. * + * Returns NULL if PV entries were reclaimed from the specified pmap. + * * We do not, however, unmap 2mpages because subsequent accesses will * allocate per-page pv entries until repromotion occurs, thereby * exacerbating the shortage of free pv entries. @@ -2123,6 +2125,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); + KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL")); pmap = NULL; free = m_pc = NULL; TAILQ_INIT(&new_tail); @@ -2287,16 +2290,19 @@ free_pv_chunk(struct pv_chunk *pc) } /* - * get a new pv_entry, allocating a block from the system - * when needed. + * Returns a new PV entry, allocating a new PV chunk from the system when + * needed. If this PV chunk allocation fails and a PV list lock pointer was + * given, a PV chunk is reclaimed from an arbitrary pmap. Otherwise, NULL is + * returned. + * + * The given PV list lock may be released. */ static pv_entry_t -get_pv_entry(pmap_t pmap, boolean_t try) +get_pv_entry(pmap_t pmap, struct rwlock **lockp) { int bit, field; pv_entry_t pv; struct pv_chunk *pc; - struct rwlock *lock; vm_page_t m; rw_assert(&pvh_global_lock, RA_LOCKED); @@ -2330,14 +2336,11 @@ retry: m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (m == NULL) { - if (try) { + if (lockp == NULL) { PV_STAT(pc_chunk_tryfail++); return (NULL); } - lock = NULL; - m = reclaim_pv_chunk(pmap, &lock); - if (lock != NULL) - rw_wunlock(lock); + m = reclaim_pv_chunk(pmap, lockp); if (m == NULL) goto retry; } @@ -2380,6 +2383,8 @@ popcnt_pc_map_elem(uint64_t elem) /* * Ensure that the number of spare PV entries in the specified pmap meets or * exceeds the given count, "needed". + * + * The given PV list lock may be released. */ static void reserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp) @@ -2391,6 +2396,7 @@ reserve_pv_entries(pmap_t pmap, int need rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(lockp != NULL, ("reserve_pv_entries: lockp is NULL")); /* * Newly allocated PV chunks must be stored in a private list until @@ -2584,7 +2590,8 @@ pmap_pvh_free(struct md_page *pvh, pmap_ } /* - * Conditionally create a pv entry. + * Conditionally create the PV entry for a 4KB page mapping if the required + * memory can be allocated without resorting to reclamation. */ static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m, @@ -2594,7 +2601,8 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if ((pv = get_pv_entry(pmap, TRUE)) != NULL) { + /* Pass NULL instead of the lock pointer to disable reclamation. */ + if ((pv = get_pv_entry(pmap, NULL)) != NULL) { pv->pv_va = va; CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); @@ -2604,7 +2612,8 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm } /* - * Create the pv entry for a 2MB page mapping. + * Conditionally create the PV entry for a 2MB page mapping if the required + * memory can be allocated without resorting to reclamation. */ static boolean_t pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, @@ -2614,7 +2623,9 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse pv_entry_t pv; rw_assert(&pvh_global_lock, RA_LOCKED); - if ((pv = get_pv_entry(pmap, TRUE)) != NULL) { + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + /* Pass NULL instead of the lock pointer to disable reclamation. */ + if ((pv = get_pv_entry(pmap, NULL)) != NULL) { pv->pv_va = va; CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); pvh = pa_to_pvh(pa); @@ -3513,7 +3524,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); if (pv == NULL) - pv = get_pv_entry(pmap, FALSE); + pv = get_pv_entry(pmap, &lock); CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, m); pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); @@ -3785,6 +3796,10 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ mpte = PHYS_TO_VM_PAGE(*ptepa & PG_FRAME); mpte->wire_count++; } else { + /* + * Pass NULL instead of the PV list lock + * pointer, because we don't intend to sleep. + */ mpte = _pmap_allocpte(pmap, ptepindex, NULL); if (mpte == NULL) return (mpte); From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 18:18:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4F631065677; Fri, 29 Jun 2012 18:18:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF2EE8FC16; Fri, 29 Jun 2012 18:18:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TIIp2X063014; Fri, 29 Jun 2012 18:18:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TIIp6H063012; Fri, 29 Jun 2012 18:18:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201206291818.q5TIIp6H063012@svn.freebsd.org> From: Dimitry Andric Date: Fri, 29 Jun 2012 18:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237814 - stable/9/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 18:18:51 -0000 Author: dim Date: Fri Jun 29 18:18:51 2012 New Revision: 237814 URL: http://svn.freebsd.org/changeset/base/237814 Log: MFC r236810: Amend r227797 by also passing ${STATIC_CXXFLAGS} for the other supported C++ file extensions. Modified: stable/9/share/mk/bsd.lib.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.lib.mk ============================================================================== --- stable/9/share/mk/bsd.lib.mk Fri Jun 29 18:15:56 2012 (r237813) +++ stable/9/share/mk/bsd.lib.mk Fri Jun 29 18:18:51 2012 (r237814) @@ -85,7 +85,7 @@ PO_FLAG=-pg (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) -.cc.o: +.cc.o .C.o .cpp.o .cxx.o: ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .cc.po .C.po .cpp.po .cxx.po: From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 18:39:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E73B1065670; Fri, 29 Jun 2012 18:39:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68A7E8FC0C; Fri, 29 Jun 2012 18:39:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TIdN3G063898; Fri, 29 Jun 2012 18:39:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TIdN1G063896; Fri, 29 Jun 2012 18:39:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206291839.q5TIdN1G063896@svn.freebsd.org> From: Marius Strobl Date: Fri, 29 Jun 2012 18:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237815 - stable/9/sys/boot/sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 18:39:23 -0000 Author: marius Date: Fri Jun 29 18:39:22 2012 New Revision: 237815 URL: http://svn.freebsd.org/changeset/base/237815 Log: MFC: r236581 The loaddev environment variable is not modifiable once set, so it is not update for ZFS. It seems that this does not really affect anything except the help command. Nevertheless, rearrange things so loaddev is set only once in all cases in order to get it right. Pointed out by: avg Modified: stable/9/sys/boot/sparc64/loader/main.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/9/sys/boot/sparc64/loader/main.c Fri Jun 29 18:18:51 2012 (r237814) +++ stable/9/sys/boot/sparc64/loader/main.c Fri Jun 29 18:39:22 2012 (r237815) @@ -141,6 +141,7 @@ static u_int tlb_locked; static vm_offset_t curkva = 0; static vm_offset_t heapva; +static char bootpath[64]; static phandle_t root; /* @@ -740,7 +741,7 @@ sparc64_zfs_probe(void) /* Get the GUID of the ZFS pool on the boot device. */ guid = 0; - zfs_probe_dev(getenv("currdev"), &guid); + zfs_probe_dev(bootpath, &guid); for (unit = 0; unit < MAXDEV; unit++) { /* Find freebsd-zfs slices in the VTOC. */ @@ -757,7 +758,7 @@ sparc64_zfs_probe(void) for (part = 0; part < 8; part++) { if (part == 2 || vtoc.part[part].tag != - VTOC_TAG_FREEBSD_ZFS) + VTOC_TAG_FREEBSD_ZFS) continue; sprintf(devname, "disk%d:%c", unit, part + 'a'); if (zfs_probe_dev(devname, NULL) == ENXIO) @@ -770,11 +771,9 @@ sparc64_zfs_probe(void) zfs_currdev.root_guid = 0; zfs_currdev.d_dev = &zfs_dev; zfs_currdev.d_type = zfs_currdev.d_dev->dv_type; - /* Update the environment for ZFS. */ - env_setenv("currdev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev), - ofw_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev), - env_noset, env_nounset); + (void)strncpy(bootpath, zfs_fmtdev(&zfs_currdev), + sizeof(bootpath) - 1); + bootpath[sizeof(bootpath) - 1] = '\0'; } } #endif /* LOADER_ZFS_SUPPORT */ @@ -782,7 +781,6 @@ sparc64_zfs_probe(void) int main(int (*openfirm)(void *)) { - char bootpath[64]; char compatible[32]; struct devsw **dp; @@ -834,16 +832,11 @@ main(int (*openfirm)(void *)) */ if (bootpath[strlen(bootpath) - 2] == ':' && bootpath[strlen(bootpath) - 1] == 'f' && - strstr(bootpath, "cdrom")) { + strstr(bootpath, "cdrom") != NULL) { bootpath[strlen(bootpath) - 1] = 'a'; printf("Boot path set to %s\n", bootpath); } - env_setenv("currdev", EV_VOLATILE, bootpath, - ofw_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, bootpath, - env_noset, env_nounset); - /* * Initialize devices. */ @@ -851,6 +844,15 @@ main(int (*openfirm)(void *)) if ((*dp)->dv_init != 0) (*dp)->dv_init(); + /* + * Now that sparc64_zfs_probe() might have altered bootpath, + * export it. + */ + env_setenv("currdev", EV_VOLATILE, bootpath, + ofw_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, bootpath, + env_noset, env_nounset); + printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 18:39:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D72F1065744; Fri, 29 Jun 2012 18:39:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBE978FC1A; Fri, 29 Jun 2012 18:39:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TIdVki063940; Fri, 29 Jun 2012 18:39:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TIdVlT063938; Fri, 29 Jun 2012 18:39:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206291839.q5TIdVlT063938@svn.freebsd.org> From: Marius Strobl Date: Fri, 29 Jun 2012 18:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237816 - stable/8/sys/boot/sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 18:39:33 -0000 Author: marius Date: Fri Jun 29 18:39:31 2012 New Revision: 237816 URL: http://svn.freebsd.org/changeset/base/237816 Log: MFC: r236581 The loaddev environment variable is not modifiable once set, so it is not update for ZFS. It seems that this does not really affect anything except the help command. Nevertheless, rearrange things so loaddev is set only once in all cases in order to get it right. Pointed out by: avg Modified: stable/8/sys/boot/sparc64/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Fri Jun 29 18:39:22 2012 (r237815) +++ stable/8/sys/boot/sparc64/loader/main.c Fri Jun 29 18:39:31 2012 (r237816) @@ -155,6 +155,7 @@ static int is_sun4v = 0; static vm_offset_t curkva = 0; static vm_offset_t heapva; +static char bootpath[64]; static phandle_t root; /* @@ -847,7 +848,7 @@ sparc64_zfs_probe(void) /* Get the GUID of the ZFS pool on the boot device. */ guid = 0; - zfs_probe_dev(getenv("currdev"), &guid); + zfs_probe_dev(bootpath, &guid); for (unit = 0; unit < MAXDEV; unit++) { /* Find freebsd-zfs slices in the VTOC. */ @@ -864,7 +865,7 @@ sparc64_zfs_probe(void) for (part = 0; part < 8; part++) { if (part == 2 || vtoc.part[part].tag != - VTOC_TAG_FREEBSD_ZFS) + VTOC_TAG_FREEBSD_ZFS) continue; sprintf(devname, "disk%d:%c", unit, part + 'a'); if (zfs_probe_dev(devname, NULL) == ENXIO) @@ -877,11 +878,9 @@ sparc64_zfs_probe(void) zfs_currdev.root_guid = 0; zfs_currdev.d_dev = &zfs_dev; zfs_currdev.d_type = zfs_currdev.d_dev->dv_type; - /* Update the environment for ZFS. */ - env_setenv("currdev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev), - ofw_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev), - env_noset, env_nounset); + (void)strncpy(bootpath, zfs_fmtdev(&zfs_currdev), + sizeof(bootpath) - 1); + bootpath[sizeof(bootpath) - 1] = '\0'; } } #endif /* LOADER_ZFS_SUPPORT */ @@ -889,7 +888,6 @@ sparc64_zfs_probe(void) int main(int (*openfirm)(void *)) { - char bootpath[64]; char compatible[32]; struct devsw **dp; @@ -949,16 +947,11 @@ main(int (*openfirm)(void *)) */ if (bootpath[strlen(bootpath) - 2] == ':' && bootpath[strlen(bootpath) - 1] == 'f' && - strstr(bootpath, "cdrom")) { + strstr(bootpath, "cdrom") != NULL) { bootpath[strlen(bootpath) - 1] = 'a'; printf("Boot path set to %s\n", bootpath); } - env_setenv("currdev", EV_VOLATILE, bootpath, - ofw_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, bootpath, - env_noset, env_nounset); - /* * Initialize devices. */ @@ -966,6 +959,15 @@ main(int (*openfirm)(void *)) if ((*dp)->dv_init != 0) (*dp)->dv_init(); + /* + * Now that sparc64_zfs_probe() might have altered bootpath, + * export it. + */ + env_setenv("currdev", EV_VOLATILE, bootpath, + ofw_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, bootpath, + env_noset, env_nounset); + printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 18:49:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4E7511065688; Fri, 29 Jun 2012 18:49:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 396028FC14; Fri, 29 Jun 2012 18:49:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TInFXY064349; Fri, 29 Jun 2012 18:49:15 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TInFL3064347; Fri, 29 Jun 2012 18:49:15 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206291849.q5TInFL3064347@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 29 Jun 2012 18:49: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: r237817 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 18:49:15 -0000 Author: pfg Date: Fri Jun 29 18:49:14 2012 New Revision: 237817 URL: http://svn.freebsd.org/changeset/base/237817 Log: Bump dtrace_helper_actions_max from 32 to 128 Dave Pacheco from Joyent (and Dtrace.org) bumped the cap to 1024 but, according to his blog, 128 is the recommended minimum. For now bump it safely to 128 although we may have to bump it further if there is demand in the future. Reference: http://www.illumos.org/issues/2558 http://dtrace.org/blogs/dap/2012/01/50/where-does-your-node-program-spend-its-time/ Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jun 29 18:39:31 2012 (r237816) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jun 29 18:49:14 2012 (r237817) @@ -157,7 +157,7 @@ dtrace_optval_t dtrace_dof_maxsize = (25 size_t dtrace_global_maxsize = (16 * 1024); size_t dtrace_actions_max = (16 * 1024); size_t dtrace_retain_max = 1024; -dtrace_optval_t dtrace_helper_actions_max = 32; +dtrace_optval_t dtrace_helper_actions_max = 128; dtrace_optval_t dtrace_helper_providers_max = 32; dtrace_optval_t dtrace_dstate_defsize = (1 * 1024 * 1024); size_t dtrace_strsize_default = 256; From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 19:05:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56C42106566C; Fri, 29 Jun 2012 19:05:30 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 375F68FC19; Fri, 29 Jun 2012 19:05:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TJ5UVD065106; Fri, 29 Jun 2012 19:05:30 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TJ5TCd065103; Fri, 29 Jun 2012 19:05:30 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201206291905.q5TJ5TCd065103@svn.freebsd.org> From: Joel Dahl Date: Fri, 29 Jun 2012 19:05: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: r237818 - head/sys/powerpc/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 19:05:30 -0000 Author: joel (doc committer) Date: Fri Jun 29 19:05:29 2012 New Revision: 237818 URL: http://svn.freebsd.org/changeset/base/237818 Log: Reduce diffs between GENERIC and GENERIC64. Also fix a few whitespace nits while I'm here. No functional change. Modified: head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri Jun 29 18:49:14 2012 (r237817) +++ head/sys/powerpc/conf/GENERIC Fri Jun 29 19:05:29 2012 (r237818) @@ -21,14 +21,14 @@ cpu AIM ident GENERIC -machine powerpc powerpc +machine powerpc powerpc makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols # Platform support options POWERMAC #NewWorld Apple PowerMacs options PSIM #GDB PSIM ppc simulator -options MAMBO #IBM Mambo Full System Simulator +options MAMBO #IBM Mambo Full System Simulator options SCHED_ULE #ULE scheduler options PREEMPTION #Enable kernel thread preemption @@ -82,7 +82,7 @@ options WITNESS #Enable checks to det options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -# To make an SMP kernel, the next line is needed +# Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel # CPU frequency control Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri Jun 29 18:49:14 2012 (r237817) +++ head/sys/powerpc/conf/GENERIC64 Fri Jun 29 19:05:29 2012 (r237818) @@ -21,14 +21,14 @@ cpu AIM ident GENERIC -machine powerpc powerpc64 +machine powerpc powerpc64 makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols # Platform support options POWERMAC #NewWorld Apple PowerMacs -options PS3 #Sony Playstation 3 -options MAMBO #IBM Mambo Full System Simulator +options PS3 #Sony Playstation 3 +options MAMBO #IBM Mambo Full System Simulator options SCHED_ULE #ULE scheduler options PREEMPTION #Enable kernel thread preemption @@ -67,8 +67,11 @@ options AUDIT # Security event auditi options MAC # TrustedBSD MAC Framework options INCLUDE_CONFIG_FILE # Include this file in kernel -# Debugging for use in -current -options KDB #Enable the kernel debugger +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use this instead: options DDB #Support DDB #options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking @@ -171,8 +174,8 @@ device cue # CATC USB Ethernet device kue # Kawasaki LSI USB Ethernet # Wireless NIC cards -options IEEE80211_SUPPORT_MESH -options AH_SUPPORT_AR5416 +options IEEE80211_SUPPORT_MESH +options AH_SUPPORT_AR5416 # FireWire support device firewire # FireWire bus code From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 19:08:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47732106566B for ; Fri, 29 Jun 2012 19:08:04 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm24-vm0.bullet.mail.sp2.yahoo.com (nm24-vm0.bullet.mail.sp2.yahoo.com [98.139.91.226]) by mx1.freebsd.org (Postfix) with SMTP id 02EC58FC15 for ; Fri, 29 Jun 2012 19:08:04 +0000 (UTC) Received: from [98.139.91.67] by nm24.bullet.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 19:05:38 -0000 Received: from [98.139.91.34] by tm7.bullet.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 19:05:38 -0000 Received: from [127.0.0.1] by omp1034.mail.sp2.yahoo.com with NNFMP; 29 Jun 2012 19:05:38 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 670414.19973.bm@omp1034.mail.sp2.yahoo.com Received: (qmail 39651 invoked by uid 60001); 29 Jun 2012 19:05:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1340996738; bh=8CGhulhIzyyNfLmA6V0GNtyBZJ8em6tAa2A6OqDHoS0=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=yURbXE9anbhY14yLmn+dES/LZCPfZ17XV0LB7g97fNrvC5TZ6VS4WyWV5jOZRGZAT1nqXGkszkCHW4EWHe4Q3eNv0g2uTesYGfdbNUMjhBf72WGFJvhL1dTvApNuQiywS/UYzTiqZ92E5+J0Ek4tk4NNxsB12jE27WjVPvKRvUc= X-YMail-OSG: HhBgq_kVM1lAm.GqTLLss0TxvJxb.RlKCkmlKY.AwYXmL3c qOc.tqv0ybk1CSLnfAOWIy4JLhNltlji.L3oWpvH19oF7_TrLWgQ1boIhieO EHKtx4lttfX_.cxfryBoPjk9Dox8ohfTqaO5xQExrnoHtjc4Xs3L2HjQpWO3 K9qLmbEQOp_96Gv6TUX5auHY.DEdQb7ILYDNuS1WVrUZjzw2kIw5fihwB69a VnmA.hsrIHW8hIKIqdMDNb2tS6XsbMEZtAtUs9TMped82xGBX3dF1Osii8Ol ZrIoz9ox7dBB_RgPAupTlK9hJ5hUvZsFSQQOrjtLBe7__gkgTntC_kREBab0 c2fWFseAFTTB0tRjgjieaTNwnhp_3YzZRelF8jlMKsm2sgDjlkMJrfz3wXV5 JPM8UU_cC9NjqS54CBXCYKE9DtDbP1KVzNzyh.YdEWKfiHevYzboQr74f.IV ABA9ckntQtloT9ZzgeU3Kfr8YQqFpmR1iqwSjKFFV_r1n0jdvWfF2X49FPVK nndgipuDI441QL_HDFNvhCPmJwJRlqj.NhKdnGGm_WaJLckZXioo_95uOU2k - Received: from [200.118.157.7] by web113516.mail.gq1.yahoo.com via HTTP; Fri, 29 Jun 2012 12:05:38 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.8 YahooMailWebService/0.8.118.349524 Message-ID: <1340996738.9207.YahooMailClassic@web113516.mail.gq1.yahoo.com> Date: Fri, 29 Jun 2012 12:05:38 -0700 (PDT) From: Pedro Giffuni To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201206291849.q5TInFL3064347@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: R: svn commit: r237817 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 19:08:04 -0000 =0A--- Ven 29/6/12, Pedro F. Giffuni ha scritto:=0A...=0A> =0A> Log:=0A> = =A0 Bump dtrace_helper_actions_max from 32 to 128=0A> =A0 =0A> =A0 Dave Pac= heco from Joyent (and Dtrace.org) bumped the cap to 1024 but,=0A> =A0 accor= ding to his blog, 128 is the recommended minimum.=0A> =A0 =0A> =A0 For now = bump it safely to 128 although we may have to bump it further=0A> =A0 if th= ere is demand in the future.=0A> =A0 =0A> =A0 Reference:=0A> =A0 =0A> =A0 h= ttp://www.illumos.org/issues/2558=0A> =A0 http://dtrace.org/blogs/dap/2012/= 01/50/where-does-your-node-program-spend-its-time/=0A> =0A=0AThe correct UR= L is this:=0A=0Ahttp://dtrace.org/blogs/dap/2012/01/05/where-does-your-node= -program-spend-its-time/=0A=0AThis change won't make it into FreeBSD 9.1 bu= t the blog=0Aclaims that ustack helpers are broken in FreeBSD so it=0Awill = not be missed(?).=0A=0APedro.=0A From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 19:48:05 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5F618106566B; Fri, 29 Jun 2012 19:48:05 +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 DDBE48FC08; Fri, 29 Jun 2012 19:48:03 +0000 (UTC) Received: from porto.starpoint.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 WAA10174; Fri, 29 Jun 2012 22:48:02 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1SkhAg-0005Bo-0L; Fri, 29 Jun 2012 22:48:02 +0300 Message-ID: <4FEE0670.6000306@FreeBSD.org> Date: Fri, 29 Jun 2012 22:48:00 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120620 Thunderbird/13.0.1 MIME-Version: 1.0 To: Dimitry Andric References: <201206291809.q5TI9dk1062063@svn.freebsd.org> In-Reply-To: <201206291809.q5TI9dk1062063@svn.freebsd.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org Subject: Re: svn commit: r237812 - stable/9/sys/boot/i386/cdboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 19:48:05 -0000 on 29/06/2012 21:09 Dimitry Andric said the following: > Author: dim > Date: Fri Jun 29 18:09:39 2012 > New Revision: 237812 > URL: http://svn.freebsd.org/changeset/base/237812 > > Log: > MFC r235281: > > Fix sys/boot/i386/cdboot/cdboot.S compilation with clang after r235219. > This file uses .code16 directives, which are not yet supported by > clang's integrated assembler. Sorry and thank you again. I should have remembered this problem and this fix, but MFC timeout was too long for my memory. > Modified: > stable/9/sys/boot/i386/cdboot/Makefile > Directory Properties: > stable/9/sys/ (props changed) > stable/9/sys/boot/ (props changed) > > Modified: stable/9/sys/boot/i386/cdboot/Makefile > ============================================================================== > --- stable/9/sys/boot/i386/cdboot/Makefile Fri Jun 29 17:39:40 2012 (r237811) > +++ stable/9/sys/boot/i386/cdboot/Makefile Fri Jun 29 18:09:39 2012 (r237812) > @@ -13,3 +13,7 @@ ORG= 0x7c00 > LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary > > .include > + > +# XXX: clang integrated-as doesn't grok .codeNN directives yet > +CFLAGS.cdboot.S= ${CLANG_NO_IAS} > +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 19:51:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 788341065672; Fri, 29 Jun 2012 19:51:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62ABF8FC19; Fri, 29 Jun 2012 19:51:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TJp7w5066976; Fri, 29 Jun 2012 19:51:07 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TJp71W066970; Fri, 29 Jun 2012 19:51:07 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201206291951.q5TJp71W066970@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 29 Jun 2012 19:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237819 - in head/sys: dev/cxgbe modules/cxgbe/if_cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 19:51:07 -0000 Author: np Date: Fri Jun 29 19:51:06 2012 New Revision: 237819 URL: http://svn.freebsd.org/changeset/base/237819 Log: cxgbe(4): support for IPv6 TSO and LRO. Submitted by: bz (this is a modified version of that patch) Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/modules/cxgbe/if_cxgbe/Makefile Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Jun 29 19:05:29 2012 (r237818) +++ head/sys/dev/cxgbe/adapter.h Fri Jun 29 19:51:06 2012 (r237819) @@ -392,7 +392,7 @@ struct sge_txq { /* stats for common events first */ uint64_t txcsum; /* # of times hardware assisted with checksum */ - uint64_t tso_wrs; /* # of IPv4 TSO work requests */ + uint64_t tso_wrs; /* # of TSO work requests */ uint64_t vlan_insertion;/* # of times VLAN tag was inserted */ uint64_t imm_wrs; /* # of work requests with immediate data */ uint64_t sgl_wrs; /* # of work requests with direct SGL */ @@ -412,7 +412,7 @@ struct sge_rxq { struct sge_fl fl; /* MUST follow iq */ struct ifnet *ifp; /* the interface this rxq belongs to */ -#ifdef INET +#if defined(INET) || defined(INET6) struct lro_ctrl lro; /* LRO state */ #endif Modified: head/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.c Fri Jun 29 19:05:29 2012 (r237818) +++ head/sys/dev/cxgbe/t4_l2t.c Fri Jun 29 19:51:06 2012 (r237819) @@ -27,6 +27,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include #include Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Jun 29 19:05:29 2012 (r237818) +++ head/sys/dev/cxgbe/t4_main.c Fri Jun 29 19:51:06 2012 (r237819) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include #include @@ -823,7 +824,7 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_HWCSUM_IPV6) -#define T4_CAP_ENABLE (T4_CAP & ~IFCAP_TSO6) +#define T4_CAP_ENABLE (T4_CAP) static int cxgbe_attach(device_t dev) @@ -1075,7 +1076,7 @@ fail: ifp->if_capenable ^= IFCAP_TSO6; } if (mask & IFCAP_LRO) { -#ifdef INET +#if defined(INET) || defined(INET6) int i; struct sge_rxq *rxq; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Jun 29 19:05:29 2012 (r237818) +++ head/sys/dev/cxgbe/t4_sge.c Fri Jun 29 19:51:06 2012 (r237819) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include #include @@ -46,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "common/common.h" @@ -908,7 +910,7 @@ service_iq(struct sge_iq *iq, int budget STAILQ_INSERT_TAIL(&iql, q, link); } -#ifdef INET +#if defined(INET) || defined(INET6) if (iq->flags & IQ_LRO_ENABLED) { struct lro_ctrl *lro = &rxq->lro; struct lro_entry *l; @@ -1039,7 +1041,7 @@ t4_eth_rx(struct sge_iq *iq, const struc struct sge_rxq *rxq = iq_to_rxq(iq); struct ifnet *ifp = rxq->ifp; const struct cpl_rx_pkt *cpl = (const void *)(rss + 1); -#ifdef INET +#if defined(INET) || defined(INET6) struct lro_ctrl *lro = &rxq->lro; #endif @@ -1079,7 +1081,7 @@ t4_eth_rx(struct sge_iq *iq, const struc rxq->vlan_extraction++; } -#ifdef INET +#if defined(INET) || defined(INET6) if (cpl->l2info & htobe32(F_RXF_LRO) && iq->flags & IQ_LRO_ENABLED && tcp_lro_rx(lro, m0, 0) == 0) { @@ -1805,7 +1807,7 @@ alloc_rxq(struct port_info *pi, struct s refill_fl(pi->adapter, &rxq->fl, rxq->fl.needed / 8); FL_UNLOCK(&rxq->fl); -#ifdef INET +#if defined(INET) || defined(INET6) rc = tcp_lro_init(&rxq->lro); if (rc != 0) return (rc); @@ -1832,7 +1834,7 @@ alloc_rxq(struct port_info *pi, struct s SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cidx", CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.cidx, 0, sysctl_uint16, "I", "consumer index"); -#ifdef INET +#if defined(INET) || defined(INET6) SYSCTL_ADD_INT(&pi->ctx, children, OID_AUTO, "lro_queued", CTLFLAG_RD, &rxq->lro.lro_queued, 0, NULL); SYSCTL_ADD_INT(&pi->ctx, children, OID_AUTO, "lro_flushed", CTLFLAG_RD, @@ -1865,7 +1867,7 @@ free_rxq(struct port_info *pi, struct sg { int rc; -#ifdef INET +#if defined(INET) || defined(INET6) if (rxq->lro.ifp) { tcp_lro_free(&rxq->lro); rxq->lro.ifp = NULL; @@ -2273,7 +2275,7 @@ alloc_txq(struct port_info *pi, struct s CTLFLAG_RD, &txq->vlan_insertion, "# of times hardware inserted 802.1Q tag"); SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "tso_wrs", CTLFLAG_RD, - &txq->tso_wrs, "# of IPv4 TSO work requests"); + &txq->tso_wrs, "# of TSO work requests"); SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "imm_wrs", CTLFLAG_RD, &txq->imm_wrs, "# of work requests with immediate data"); SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "sgl_wrs", CTLFLAG_RD, @@ -2802,22 +2804,60 @@ write_txpkt_wr(struct port_info *pi, str if (m->m_pkthdr.tso_segsz) { struct cpl_tx_pkt_lso_core *lso = (void *)(wr + 1); struct ether_header *eh; - struct ip *ip; + void *l3hdr; +#if defined(INET) || defined(INET6) struct tcphdr *tcp; +#endif + uint16_t eh_type; ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | F_LSO_FIRST_SLICE | F_LSO_LAST_SLICE; eh = mtod(m, struct ether_header *); - if (eh->ether_type == htons(ETHERTYPE_VLAN)) { + eh_type = ntohs(eh->ether_type); + if (eh_type == ETHERTYPE_VLAN) { + struct ether_vlan_header *evh = (void *)eh; + ctrl |= V_LSO_ETHHDR_LEN(1); - ip = (void *)((struct ether_vlan_header *)eh + 1); + l3hdr = evh + 1; + eh_type = ntohs(evh->evl_proto); } else - ip = (void *)(eh + 1); + l3hdr = eh + 1; - tcp = (void *)((uintptr_t)ip + ip->ip_hl * 4); - ctrl |= V_LSO_IPHDR_LEN(ip->ip_hl) | - V_LSO_TCPHDR_LEN(tcp->th_off); + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + { + struct ip6_hdr *ip6 = l3hdr; + + /* + * XXX-BZ For now we do not pretend to support + * IPv6 extension headers. + */ + KASSERT(ip6->ip6_nxt == IPPROTO_TCP, ("%s: CSUM_TSO " + "with ip6_nxt != TCP: %u", __func__, ip6->ip6_nxt)); + tcp = (struct tcphdr *)(ip6 + 1); + ctrl |= F_LSO_IPV6; + ctrl |= V_LSO_IPHDR_LEN(sizeof(*ip6) >> 2) | + V_LSO_TCPHDR_LEN(tcp->th_off); + break; + } +#endif +#ifdef INET + case ETHERTYPE_IP: + { + struct ip *ip = l3hdr; + + tcp = (void *)((uintptr_t)ip + ip->ip_hl * 4); + ctrl |= V_LSO_IPHDR_LEN(ip->ip_hl) | + V_LSO_TCPHDR_LEN(tcp->th_off); + break; + } +#endif + default: + panic("%s: CSUM_TSO but no supported IP version " + "(0x%04x)", __func__, eh_type); + } lso->lso_ctrl = htobe32(ctrl); lso->ipid_ofst = htobe16(0); Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/if_cxgbe/Makefile Fri Jun 29 19:05:29 2012 (r237818) +++ head/sys/modules/cxgbe/if_cxgbe/Makefile Fri Jun 29 19:51:06 2012 (r237819) @@ -9,7 +9,7 @@ KMOD = if_cxgbe SRCS = t4_main.c t4_sge.c t4_l2t.c SRCS+= t4_hw.c SRCS+= device_if.h bus_if.h pci_if.h -SRCS+= opt_inet.h +SRCS+= opt_inet.h opt_inet6.h SRCS+= opt_ofed.h CFLAGS+= -I${CXGBE} From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 20:15:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1047B106566B; Fri, 29 Jun 2012 20:15:01 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB3138FC15; Fri, 29 Jun 2012 20:15:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TKF0S2068022; Fri, 29 Jun 2012 20:15:00 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TKF0bw068017; Fri, 29 Jun 2012 20:15:00 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201206292015.q5TKF0bw068017@svn.freebsd.org> From: Brooks Davis Date: Fri, 29 Jun 2012 20:15: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: r237820 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 20:15:01 -0000 Author: brooks Date: Fri Jun 29 20:15:00 2012 New Revision: 237820 URL: http://svn.freebsd.org/changeset/base/237820 Log: MFP4 #212266 Fix compile on MIPS64. Sponsored by: DARPA, AFRL Modified: head/sys/geom/geom_map.c Modified: head/sys/geom/geom_map.c ============================================================================== --- head/sys/geom/geom_map.c Fri Jun 29 19:51:06 2012 (r237819) +++ head/sys/geom/geom_map.c Fri Jun 29 20:15:00 2012 (r237820) @@ -119,13 +119,13 @@ g_map_dumpconf(struct sbuf *sb, const ch g_slice_dumpconf(sb, indent, gp, cp, pp); if (pp != NULL) { if (indent == NULL) { - sbuf_printf(sb, " entry %lld", sc->entry[pp->index]); - sbuf_printf(sb, " dsize %lld", sc->dsize[pp->index]); + sbuf_printf(sb, " entry %jd", (intmax_t)sc->entry[pp->index]); + sbuf_printf(sb, " dsize %jd", (intmax_t)sc->dsize[pp->index]); } else { - sbuf_printf(sb, "%s%lld\n", indent, - sc->entry[pp->index]); - sbuf_printf(sb, "%s%lld\n", indent, - sc->dsize[pp->index]); + sbuf_printf(sb, "%s%jd\n", indent, + (intmax_t)sc->entry[pp->index]); + sbuf_printf(sb, "%s%jd\n", indent, + (intmax_t)sc->dsize[pp->index]); } } } @@ -153,8 +153,8 @@ find_marker(struct g_consumer *cp, const return (1); if (bootverbose) { - printf("MAP: search key \"%s\" from 0x%llx, step 0x%llx\n", - search_key, search_start, search_step); + printf("MAP: search key \"%s\" from 0x%jx, step 0x%jx\n", + search_key, (intmax_t)search_start, (intmax_t)search_step); } /* error if search_key is empty */ @@ -321,9 +321,10 @@ g_map_parse_part(struct g_class *mp, str } if (bootverbose) { - printf("MAP: %llxx%llx, data=%llxx%llx " + printf("MAP: %lxx%lx, data=%lxx%lx " "\"/dev/map/%s\"\n", - start, size, offset, dsize, name); + (intmax_t)start, (intmax_t)size, (intmax_t)offset, + (intmax_t)dsize, name); } sc->offset[i] = start; From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 21:19:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E0C2106564A; Fri, 29 Jun 2012 21:19:25 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 669F18FC15; Fri, 29 Jun 2012 21:19:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TLJP5r070696; Fri, 29 Jun 2012 21:19:25 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TLJPrA070685; Fri, 29 Jun 2012 21:19:25 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206292119.q5TLJPrA070685@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 29 Jun 2012 21:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237821 - in stable/9: sys/cam/ctl usr.sbin/ctladm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 21:19:25 -0000 Author: ken Date: Fri Jun 29 21:19:24 2012 New Revision: 237821 URL: http://svn.freebsd.org/changeset/base/237821 Log: MFC r232604: r232604 | trasz | 2012-03-06 06:43:57 -0700 (Tue, 06 Mar 2012) | 6 lines Add LUN resizing to CTL. Also make it possible to explicitly set size when creating file-backed or device-backed LUN. Reviewed by: ken (earlier version) Sponsored by: The FreeBSD Foundation Modified: stable/9/sys/cam/ctl/ctl.c stable/9/sys/cam/ctl/ctl.h stable/9/sys/cam/ctl/ctl_backend.h stable/9/sys/cam/ctl/ctl_backend_block.c stable/9/sys/cam/ctl/ctl_backend_ramdisk.c stable/9/sys/cam/ctl/ctl_error.c stable/9/sys/cam/ctl/ctl_ioctl.h stable/9/usr.sbin/ctladm/Makefile stable/9/usr.sbin/ctladm/ctladm.8 stable/9/usr.sbin/ctladm/ctladm.c Directory Properties: stable/9/sys/ (props changed) stable/9/usr.sbin/ctladm/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Fri Jun 29 20:15:00 2012 (r237820) +++ stable/9/sys/cam/ctl/ctl.c Fri Jun 29 21:19:24 2012 (r237821) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003-2009 Silicon Graphics International Corp. + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -4797,6 +4801,25 @@ ctl_lun_power_lock(struct ctl_be_lun *be return (0); } +void +ctl_lun_capacity_changed(struct ctl_be_lun *be_lun) +{ + struct ctl_lun *lun; + struct ctl_softc *softc; + int i; + + softc = control_softc; + + mtx_lock(&softc->ctl_lock); + + lun = (struct ctl_lun *)be_lun->ctl_lun; + + for (i = 0; i < CTL_MAX_INITIATORS; i++) + lun->pending_sense[i].ua_pending |= CTL_UA_CAPACITY_CHANGED; + + mtx_unlock(&softc->ctl_lock); +} + /* * Backend "memory move is complete" callback for requests that never * make it down to say RAIDCore's configuration code. Modified: stable/9/sys/cam/ctl/ctl.h ============================================================================== --- stable/9/sys/cam/ctl/ctl.h Fri Jun 29 20:15:00 2012 (r237820) +++ stable/9/sys/cam/ctl/ctl.h Fri Jun 29 21:19:24 2012 (r237821) @@ -120,7 +120,8 @@ typedef enum { CTL_UA_RES_PREEMPT = 0x0200, CTL_UA_RES_RELEASE = 0x0400, CTL_UA_REG_PREEMPT = 0x0800, - CTL_UA_ASYM_ACC_CHANGE = 0x1000 + CTL_UA_ASYM_ACC_CHANGE = 0x1000, + CTL_UA_CAPACITY_CHANGED = 0x2000 } ctl_ua_type; #ifdef _KERNEL Modified: stable/9/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend.h Fri Jun 29 20:15:00 2012 (r237820) +++ stable/9/sys/cam/ctl/ctl_backend.h Fri Jun 29 21:19:24 2012 (r237821) @@ -280,6 +280,11 @@ int ctl_lun_power_lock(struct ctl_be_lun int ctl_lun_offline(struct ctl_be_lun *be_lun); int ctl_lun_online(struct ctl_be_lun *be_lun); +/* + * Let the backend notify the initiator about changed capacity. + */ +void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun); + #endif /* _KERNEL */ #endif /* _CTL_BACKEND_H_ */ Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Fri Jun 29 20:15:00 2012 (r237820) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Fri Jun 29 21:19:24 2012 (r237821) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2003 Silicon Graphics International Corp. * Copyright (c) 2009-2011 Spectra Logic Corporation + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -250,6 +254,12 @@ static int ctl_be_block_create(struct ct struct ctl_lun_req *req); static int ctl_be_block_rm(struct ctl_be_block_softc *softc, struct ctl_lun_req *req); +static int ctl_be_block_modify_file(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req); +static int ctl_be_block_modify_dev(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req); +static int ctl_be_block_modify(struct ctl_be_block_softc *softc, + struct ctl_lun_req *req); static void ctl_be_block_lun_shutdown(void *be_lun); static void ctl_be_block_lun_config_status(void *be_lun, ctl_lun_config_status status); @@ -1263,6 +1273,9 @@ ctl_be_block_ioctl(struct cdev *dev, u_l case CTL_LUNREQ_RM: error = ctl_be_block_rm(softc, lun_req); break; + case CTL_LUNREQ_MODIFY: + error = ctl_be_block_modify(softc, lun_req); + break; default: lun_req->status = CTL_LUN_ERROR; snprintf(lun_req->error_str, sizeof(lun_req->error_str), @@ -1321,7 +1334,10 @@ ctl_be_block_open_file(struct ctl_be_blo file_data->cred = crhold(curthread->td_ucred); - be_lun->size_bytes = vattr.va_size; + if (params->lun_size_bytes != 0) + be_lun->size_bytes = params->lun_size_bytes; + else + be_lun->size_bytes = vattr.va_size; /* * We set the multi thread flag for file operations because all * filesystems (in theory) are capable of allowing multiple readers @@ -1446,15 +1462,27 @@ ctl_be_block_open_dev(struct ctl_be_bloc curthread); if (error) { snprintf(req->error_str, sizeof(req->error_str), - "%s: error %d returned for DIOCGMEDIASIZE ioctl " - "on %s!", __func__, error, be_lun->dev_path); + "%s: error %d returned for DIOCGMEDIASIZE " + " ioctl on %s!", __func__, error, + be_lun->dev_path); return (error); } - return (0); + if (params->lun_size_bytes != 0) { + if (params->lun_size_bytes > be_lun->size_bytes) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: requested LUN size %ju > backing device " + "size %ju", __func__, + (uintmax_t)params->lun_size_bytes, + (uintmax_t)be_lun->size_bytes); + return (EINVAL); + } -} + be_lun->size_bytes = params->lun_size_bytes; + } + return (0); +} static int ctl_be_block_close(struct ctl_be_block_lun *be_lun) @@ -1599,7 +1627,6 @@ ctl_be_block_open(struct ctl_be_block_so be_lun->size_blocks = be_lun->size_bytes >> be_lun->blocksize_shift; return (0); - } static int @@ -2007,6 +2034,155 @@ bailout_error: return (0); } +static int +ctl_be_block_modify_file(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req) +{ + struct vattr vattr; + int error; + struct ctl_lun_modify_params *params; + + params = &req->reqdata.modify; + + if (params->lun_size_bytes != 0) { + be_lun->size_bytes = params->lun_size_bytes; + } else { + error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); + if (error != 0) { + snprintf(req->error_str, sizeof(req->error_str), + "error calling VOP_GETATTR() for file %s", + be_lun->dev_path); + return (error); + } + + be_lun->size_bytes = vattr.va_size; + } + + return (0); +} + +static int +ctl_be_block_modify_dev(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req) +{ + struct cdev *dev; + struct cdevsw *devsw; + int error; + struct ctl_lun_modify_params *params; + uint64_t size_bytes; + + params = &req->reqdata.modify; + + dev = be_lun->vn->v_rdev; + devsw = dev->si_devsw; + if (!devsw->d_ioctl) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: no d_ioctl for device %s!", __func__, + be_lun->dev_path); + return (ENODEV); + } + + error = devsw->d_ioctl(dev, DIOCGMEDIASIZE, + (caddr_t)&size_bytes, FREAD, + curthread); + if (error) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: error %d returned for DIOCGMEDIASIZE ioctl " + "on %s!", __func__, error, be_lun->dev_path); + return (error); + } + + if (params->lun_size_bytes != 0) { + if (params->lun_size_bytes > size_bytes) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: requested LUN size %ju > backing device " + "size %ju", __func__, + (uintmax_t)params->lun_size_bytes, + (uintmax_t)size_bytes); + return (EINVAL); + } + + be_lun->size_bytes = params->lun_size_bytes; + } else { + be_lun->size_bytes = size_bytes; + } + + return (0); +} + +static int +ctl_be_block_modify(struct ctl_be_block_softc *softc, struct ctl_lun_req *req) +{ + struct ctl_lun_modify_params *params; + struct ctl_be_block_lun *be_lun; + int vfs_is_locked, error; + + params = &req->reqdata.modify; + + mtx_lock(&softc->lock); + + be_lun = NULL; + + STAILQ_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->ctl_be_lun.lun_id == params->lun_id) + break; + } + mtx_unlock(&softc->lock); + + if (be_lun == NULL) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN %u is not managed by the block backend", + __func__, params->lun_id); + goto bailout_error; + } + + if (params->lun_size_bytes != 0) { + if (params->lun_size_bytes < be_lun->blocksize) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN size %ju < blocksize %u", __func__, + params->lun_size_bytes, be_lun->blocksize); + goto bailout_error; + } + } + + vfs_is_locked = VFS_LOCK_GIANT(be_lun->vn->v_mount); + vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); + + if (be_lun->vn->v_type == VREG) + error = ctl_be_block_modify_file(be_lun, req); + else + error = ctl_be_block_modify_dev(be_lun, req); + + VOP_UNLOCK(be_lun->vn, 0); + VFS_UNLOCK_GIANT(vfs_is_locked); + + if (error != 0) + goto bailout_error; + + be_lun->size_blocks = be_lun->size_bytes >> be_lun->blocksize_shift; + + /* + * The maximum LBA is the size - 1. + * + * XXX: Note that this field is being updated without locking, + * which might cause problems on 32-bit architectures. + */ + be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1; + ctl_lun_capacity_changed(&be_lun->ctl_be_lun); + + /* Tell the user the exact size we ended up using */ + params->lun_size_bytes = be_lun->size_bytes; + + req->status = CTL_LUN_OK; + + return (0); + +bailout_error: + req->status = CTL_LUN_ERROR; + + return (0); +} + static void ctl_be_block_lun_shutdown(void *be_lun) { Modified: stable/9/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_ramdisk.c Fri Jun 29 20:15:00 2012 (r237820) +++ stable/9/sys/cam/ctl/ctl_backend_ramdisk.c Fri Jun 29 21:19:24 2012 (r237821) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003, 2008 Silicon Graphics International Corp. + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -102,6 +106,8 @@ static int ctl_backend_ramdisk_rm(struct struct ctl_lun_req *req); static int ctl_backend_ramdisk_create(struct ctl_be_ramdisk_softc *softc, struct ctl_lun_req *req, int do_wait); +static int ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, + struct ctl_lun_req *req); static void ctl_backend_ramdisk_lun_shutdown(void *be_lun); static void ctl_backend_ramdisk_lun_config_status(void *be_lun, ctl_lun_config_status status); @@ -376,6 +382,9 @@ ctl_backend_ramdisk_ioctl(struct cdev *d case CTL_LUNREQ_RM: retval = ctl_backend_ramdisk_rm(softc, lun_req); break; + case CTL_LUNREQ_MODIFY: + retval = ctl_backend_ramdisk_modify(softc, lun_req); + break; default: lun_req->status = CTL_LUN_ERROR; snprintf(lun_req->error_str, sizeof(lun_req->error_str), @@ -666,6 +675,73 @@ bailout_error: return (retval); } +static int +ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, + struct ctl_lun_req *req) +{ + struct ctl_be_ramdisk_lun *be_lun; + struct ctl_lun_modify_params *params; + uint32_t blocksize; + + params = &req->reqdata.modify; + + be_lun = NULL; + + mtx_lock(&softc->lock); + STAILQ_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->ctl_be_lun.lun_id == params->lun_id) + break; + } + mtx_unlock(&softc->lock); + + if (be_lun == NULL) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN %u is not managed by the ramdisk backend", + __func__, params->lun_id); + goto bailout_error; + } + + if (params->lun_size_bytes == 0) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN size \"auto\" not supported " + "by the ramdisk backend", __func__); + goto bailout_error; + } + + blocksize = be_lun->ctl_be_lun.blocksize; + + if (params->lun_size_bytes < blocksize) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN size %ju < blocksize %u", __func__, + params->lun_size_bytes, blocksize); + goto bailout_error; + } + + be_lun->size_blocks = params->lun_size_bytes / blocksize; + be_lun->size_bytes = be_lun->size_blocks * blocksize; + + /* + * The maximum LBA is the size - 1. + * + * XXX: Note that this field is being updated without locking, + * which might cause problems on 32-bit architectures. + */ + be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1; + ctl_lun_capacity_changed(&be_lun->ctl_be_lun); + + /* Tell the user the exact size we ended up using */ + params->lun_size_bytes = be_lun->size_bytes; + + req->status = CTL_LUN_OK; + + return (0); + +bailout_error: + req->status = CTL_LUN_ERROR; + + return (0); +} + static void ctl_backend_ramdisk_lun_shutdown(void *be_lun) { Modified: stable/9/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_error.c Fri Jun 29 20:15:00 2012 (r237820) +++ stable/9/sys/cam/ctl/ctl_error.c Fri Jun 29 21:19:24 2012 (r237821) @@ -454,6 +454,11 @@ ctl_build_ua(ctl_ua_type ua_type, struct asc = 0x2A; ascq = 0x06; break; + case CTL_UA_CAPACITY_CHANGED: + /* 2Ah/09n CAPACITY DATA HAS CHANGED */ + asc = 0x2A; + ascq = 0x09; + break; default: ua_to_build = CTL_UA_NONE; return (ua_to_build); Modified: stable/9/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/9/sys/cam/ctl/ctl_ioctl.h Fri Jun 29 20:15:00 2012 (r237820) +++ stable/9/sys/cam/ctl/ctl_ioctl.h Fri Jun 29 21:19:24 2012 (r237821) @@ -397,7 +397,8 @@ struct ctl_be_arg { typedef enum { CTL_LUNREQ_CREATE, - CTL_LUNREQ_RM + CTL_LUNREQ_RM, + CTL_LUNREQ_MODIFY, } ctl_lunreq_type; @@ -471,12 +472,27 @@ struct ctl_lun_rm_params { }; /* + * LUN modification parameters: + * + * lun_id: The number of the LUN to modify. This must be set. + * The LUN must be backed by the given backend. + * + * lun_size_bytes: The size of the LUN in bytes. If zero, update + * the size using the backing file size, if possible. + */ +struct ctl_lun_modify_params { + uint32_t lun_id; + uint64_t lun_size_bytes; +}; + +/* * Union of request type data. Fill in the appropriate union member for * the request type. */ union ctl_lunreq_data { struct ctl_lun_create_params create; struct ctl_lun_rm_params rm; + struct ctl_lun_modify_params modify; }; /* Modified: stable/9/usr.sbin/ctladm/Makefile ============================================================================== --- stable/9/usr.sbin/ctladm/Makefile Fri Jun 29 20:15:00 2012 (r237820) +++ stable/9/usr.sbin/ctladm/Makefile Fri Jun 29 21:19:24 2012 (r237821) @@ -14,8 +14,8 @@ CFLAGS+= -I${SDIR} WARNS?= 3 .endif -DPADD= ${LIBCAM} ${LIBSBUF} -LDADD= -lcam -lsbuf -lbsdxml +DPADD= ${LIBCAM} ${LIBSBUF} ${LIBBSDXML} ${LIBUTIL} +LDADD= -lcam -lsbuf -lbsdxml -lutil MAN= ctladm.8 .include Modified: stable/9/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/9/usr.sbin/ctladm/ctladm.8 Fri Jun 29 20:15:00 2012 (r237820) +++ stable/9/usr.sbin/ctladm/ctladm.8 Fri Jun 29 21:19:24 2012 (r237821) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd July 8, 2011 +.Dd March 6, 2012 .Dt CTLADM 8 .Os .Sh NAME @@ -173,6 +173,11 @@ .Aq Fl l Ar lun_id .Op Fl o Ar name=value .Nm +.Ic modify +.Aq Fl b Ar backend +.Aq Fl l Ar lun_id +.Aq Fl s Ar size_bytes +.Nm .Ic devlist .Op Fl b Ar backend .Op Fl v @@ -830,6 +835,27 @@ Multiple arguments may be specified. Refer to the backend documentation for arguments that may be used. .El +.It Ic modify +Modify a LUN size. +The backend, the LUN number, and the size must be specified. +.Bl -tag -width 14n +.It Fl b Ar backend +Specify the backend that owns the LUN to be removed. +Examples are +.Dq ramdisk +and +.Dq block . +.It Fl l Ar lun_id +Specify the LUN number to remove. +.It Fl s Ar size_bytes +Specify the size of the LUN in bytes. +For the +.Dq block +backend, an +.Dq auto +keyword may be passed instead; this will make CTL use the size of backing +file or device. +.El .It Ic devlist Get a list of all configured LUNs. This also includes the LUN size and blocksize, serial number and device ID. Modified: stable/9/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/9/usr.sbin/ctladm/ctladm.c Fri Jun 29 20:15:00 2012 (r237820) +++ stable/9/usr.sbin/ctladm/ctladm.c Fri Jun 29 21:19:24 2012 (r237821) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2003, 2004 Silicon Graphics International Corp. * Copyright (c) 1997-2007 Kenneth D. Merry + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -68,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "ctladm.h" #ifdef min @@ -110,7 +115,8 @@ typedef enum { CTLADM_CMD_PRES_IN, CTLADM_CMD_PRES_OUT, CTLADM_CMD_INQ_VPD_DEVID, - CTLADM_CMD_RTPG + CTLADM_CMD_RTPG, + CTLADM_CMD_MODIFY } ctladm_cmdfunction; typedef enum { @@ -175,6 +181,7 @@ struct ctladm_opts option_table[] = { {"inquiry", CTLADM_CMD_INQUIRY, CTLADM_ARG_NEED_TL, NULL}, {"lunlist", CTLADM_CMD_LUNLIST, CTLADM_ARG_NONE, NULL}, {"modesense", CTLADM_CMD_MODESENSE, CTLADM_ARG_NEED_TL, "P:S:dlm:c:"}, + {"modify", CTLADM_CMD_MODIFY, CTLADM_ARG_NONE, "b:l:s:"}, {"port", CTLADM_CMD_PORT, CTLADM_ARG_NONE, "lo:p:qt:w:W:x"}, {"prin", CTLADM_CMD_PRES_IN, CTLADM_ARG_NEED_TL, "a:"}, {"prout", CTLADM_CMD_PRES_OUT, CTLADM_ARG_NEED_TL, "a:k:r:s:"}, @@ -249,6 +256,7 @@ static int cctl_create_lun(int fd, int a static int cctl_inquiry_vpd_devid(int fd, int target, int lun, int initiator); static int cctl_report_target_port_group(int fd, int target, int lun, int initiator); +static int cctl_modify_lun(int fd, int argc, char **argv, char *combinedopt); ctladm_optret getoption(struct ctladm_opts *table, char *arg, uint32_t *cmdnum, @@ -3043,7 +3051,15 @@ cctl_create_lun(int fd, int argc, char * break; } case 's': - lun_size = strtoull(optarg, NULL, 0); + if (strcasecmp(optarg, "auto") != 0) { + retval = expand_number(optarg, &lun_size); + if (retval != 0) { + warn("%s: invalid -s argument", + __func__); + retval = 1; + goto bailout; + } + } lun_size_set = 1; break; case 'S': @@ -3287,12 +3303,12 @@ cctl_rm_lun(int fd, int argc, char **arg } if (req.status == CTL_LUN_ERROR) { - warnx("%s: error returned from LUN creation request:\n%s", + warnx("%s: error returned from LUN removal request:\n%s", __func__, req.error_str); retval = 1; goto bailout; } else if (req.status != CTL_LUN_OK) { - warnx("%s: unknown LUN creation request status %d", + warnx("%s: unknown LUN removal request status %d", __func__, req.status); retval = 1; goto bailout; @@ -3304,6 +3320,84 @@ bailout: return (retval); } +static int +cctl_modify_lun(int fd, int argc, char **argv, char *combinedopt) +{ + struct ctl_lun_req req; + uint64_t lun_size = 0; + uint32_t lun_id = 0; + int lun_id_set = 0, lun_size_set = 0; + char *backend_name = NULL; + int retval = 0, c; + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'b': + backend_name = strdup(optarg); + break; + case 'l': + lun_id = strtoul(optarg, NULL, 0); + lun_id_set = 1; + break; + case 's': + if (strcasecmp(optarg, "auto") != 0) { + retval = expand_number(optarg, &lun_size); + if (retval != 0) { + warn("%s: invalid -s argument", + __func__); + retval = 1; + goto bailout; + } + } + lun_size_set = 1; + break; + default: + break; + } + } + + if (backend_name == NULL) + errx(1, "%s: backend name (-b) must be specified", __func__); + + if (lun_id_set == 0) + errx(1, "%s: LUN id (-l) must be specified", __func__); + + if (lun_size_set == 0) + errx(1, "%s: size (-s) must be specified", __func__); + + bzero(&req, sizeof(req)); + + strlcpy(req.backend, backend_name, sizeof(req.backend)); + req.reqtype = CTL_LUNREQ_MODIFY; + + req.reqdata.modify.lun_id = lun_id; + req.reqdata.modify.lun_size_bytes = lun_size; + + if (ioctl(fd, CTL_LUN_REQ, &req) == -1) { + warn("%s: error issuing CTL_LUN_REQ ioctl", __func__); + retval = 1; + goto bailout; + } + + if (req.status == CTL_LUN_ERROR) { + warnx("%s: error returned from LUN modification request:\n%s", + __func__, req.error_str); + retval = 1; + goto bailout; + } else if (req.status != CTL_LUN_OK) { + warnx("%s: unknown LUN modification request status %d", + __func__, req.status); + retval = 1; + goto bailout; + } + + printf("LUN %d modified successfully\n", lun_id); + +bailout: + return (retval); +} + + /* * Name/value pair used for per-LUN attributes. */ @@ -3599,6 +3693,7 @@ usage(int error) " [-l lun_id] [-o name=value] [-s size_bytes]\n" " [-S serial_num] [-t dev_type]\n" " ctladm remove <-b backend> <-l lun_id> [-o name=value]\n" +" ctladm modify <-b backend> <-l lun_id> <-s size_bytes>\n" " ctladm devlist [-b][-v][-x]\n" " ctladm shutdown\n" " ctladm startup\n" @@ -3983,6 +4078,9 @@ main(int argc, char **argv) case CTLADM_CMD_RTPG: retval = cctl_report_target_port_group(fd, target, lun, initid); break; + case CTLADM_CMD_MODIFY: + retval = cctl_modify_lun(fd, argc, argv, combinedopt); + break; case CTLADM_CMD_HELP: default: usage(retval); From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 21:24:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F869106566C; Fri, 29 Jun 2012 21:24:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76C7B8FC16; Fri, 29 Jun 2012 21:24:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TLOv01071047; Fri, 29 Jun 2012 21:24:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TLOvtW071039; Fri, 29 Jun 2012 21:24:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206292124.q5TLOvtW071039@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 21:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237822 - in stable/9: share/man/man4 sys/amd64/acpica sys/dev/acpica sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 21:24:57 -0000 Author: jhb Date: Fri Jun 29 21:24:56 2012 New Revision: 237822 URL: http://svn.freebsd.org/changeset/base/237822 Log: MFC 235024,235029,235556,235834,235845: Use MADT to match ACPI Processor objects to CPUs. MADT and DSDT/SSDTs may list CPUs in different orders, especially for disabled logical cores. Now we match ACPI IDs from the MADT with Processor objects, strictly order CPUs accordingly, and ignore disabled cores. This prevents us from executing methods for other CPUs, e. g., _PSS for disabled logical core, which may not exist. Unfortunately, it is known that there are a few systems with buggy BIOSes that do not have unique ACPI IDs for MADT and Processor objects. To work around these problems, 'debug.acpi.cpu_unordered' tunable is added. Set this to a non-zero value to restore the old behavior. Modified: stable/9/share/man/man4/acpi.4 stable/9/sys/amd64/acpica/acpi_machdep.c stable/9/sys/dev/acpica/acpi_cpu.c stable/9/sys/dev/acpica/acpi_ec.c stable/9/sys/dev/acpica/acpi_smbat.c stable/9/sys/dev/acpica/acpivar.h stable/9/sys/i386/acpica/acpi_machdep.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/share/man/man4/acpi.4 ============================================================================== --- stable/9/share/man/man4/acpi.4 Fri Jun 29 21:19:24 2012 (r237821) +++ stable/9/share/man/man4/acpi.4 Fri Jun 29 21:24:56 2012 (r237822) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2012 +.Dd May 4, 2012 .Dt ACPI 4 .Os .Sh NAME @@ -198,6 +198,11 @@ entry for access after boot. Enables loading of a custom ACPI DSDT. .It Va acpi_dsdt_name Name of the DSDT table to load, if loading is enabled. +.It Va debug.acpi.cpu_unordered +Do not use the MADT to match ACPI Processor objects to CPUs. +This is needed on a few systems with a buggy BIOS that does not use +consistent processor IDs. +Default is 0 (disabled). .It Va debug.acpi.disabled Selectively disables portions of ACPI for debugging purposes. .It Va debug.acpi.interpreter_slack Modified: stable/9/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- stable/9/sys/amd64/acpica/acpi_machdep.c Fri Jun 29 21:19:24 2012 (r237821) +++ stable/9/sys/amd64/acpica/acpi_machdep.c Fri Jun 29 21:24:56 2012 (r237822) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include -SYSCTL_DECL(_debug_acpi); - int acpi_resume_beep; TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, Modified: stable/9/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_cpu.c Fri Jun 29 21:19:24 2012 (r237821) +++ stable/9/sys/dev/acpica/acpi_cpu.c Fri Jun 29 21:24:56 2012 (r237822) @@ -124,6 +124,13 @@ struct acpi_cpu_device { #define PIIX4_STOP_BREAK_MASK (PIIX4_BRLD_EN_IRQ0 | PIIX4_BRLD_EN_IRQ | PIIX4_BRLD_EN_IRQ8) #define PIIX4_PCNTRL_BST_EN (1<<10) +/* Allow users to ignore processor orders in MADT. */ +static int cpu_unordered; +TUNABLE_INT("debug.acpi.cpu_unordered", &cpu_unordered); +SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_unordered, CTLFLAG_RDTUN, + &cpu_unordered, 0, + "Do not use the MADT to match ACPI Processor objects to CPUs."); + /* Platform hardware resource information. */ static uint32_t cpu_smi_cmd; /* Value to write to SMI_CMD. */ static uint8_t cpu_cst_cnt; /* Indicate we are _CST aware. */ @@ -148,7 +155,7 @@ static int acpi_cpu_probe(device_t dev); static int acpi_cpu_attach(device_t dev); static int acpi_cpu_suspend(device_t dev); static int acpi_cpu_resume(device_t dev); -static int acpi_pcpu_get_id(uint32_t idx, uint32_t *acpi_id, +static int acpi_pcpu_get_id(device_t dev, uint32_t *acpi_id, uint32_t *cpu_id); static struct resource_list *acpi_cpu_get_rlist(device_t dev, device_t child); static device_t acpi_cpu_add_child(device_t dev, u_int order, const char *name, @@ -245,7 +252,7 @@ acpi_cpu_probe(device_t dev) */ acpi_id = obj->Processor.ProcId; AcpiOsFree(obj); - if (acpi_pcpu_get_id(device_get_unit(dev), &acpi_id, &cpu_id) != 0) + if (acpi_pcpu_get_id(dev, &acpi_id, &cpu_id) != 0) return (ENXIO); /* @@ -436,36 +443,66 @@ acpi_cpu_resume(device_t dev) } /* - * Find the nth present CPU and return its pc_cpuid as well as set the - * pc_acpi_id from the most reliable source. + * Find the processor associated with a given ACPI ID. By default, + * use the MADT to map ACPI IDs to APIC IDs and use that to locate a + * processor. Some systems have inconsistent ASL and MADT however. + * For these systems the cpu_unordered tunable can be set in which + * case we assume that Processor objects are listed in the same order + * in both the MADT and ASL. */ static int -acpi_pcpu_get_id(uint32_t idx, uint32_t *acpi_id, uint32_t *cpu_id) +acpi_pcpu_get_id(device_t dev, uint32_t *acpi_id, uint32_t *cpu_id) { - struct pcpu *pcpu_data; - uint32_t i; + struct pcpu *pc; + uint32_t i, idx; KASSERT(acpi_id != NULL, ("Null acpi_id")); KASSERT(cpu_id != NULL, ("Null cpu_id")); + idx = device_get_unit(dev); + + /* + * If pc_acpi_id for CPU 0 is not initialized (e.g. a non-APIC + * UP box) use the ACPI ID from the first processor we find. + */ + if (idx == 0 && mp_ncpus == 1) { + pc = pcpu_find(0); + if (pc->pc_acpi_id == 0xffffffff) + pc->pc_acpi_id = *acpi_id; + *cpu_id = 0; + return (0); + } + CPU_FOREACH(i) { - pcpu_data = pcpu_find(i); - KASSERT(pcpu_data != NULL, ("no pcpu data for %d", i)); - if (idx-- == 0) { - /* - * If pc_acpi_id was not initialized (e.g., a non-APIC UP box) - * override it with the value from the ASL. Otherwise, if the - * two don't match, prefer the MADT-derived value. Finally, - * return the pc_cpuid to reference this processor. - */ - if (pcpu_data->pc_acpi_id == 0xffffffff) - pcpu_data->pc_acpi_id = *acpi_id; - else if (pcpu_data->pc_acpi_id != *acpi_id) - *acpi_id = pcpu_data->pc_acpi_id; - *cpu_id = pcpu_data->pc_cpuid; - return (0); + pc = pcpu_find(i); + KASSERT(pc != NULL, ("no pcpu data for %d", i)); + if (cpu_unordered) { + if (idx-- == 0) { + /* + * If pc_acpi_id doesn't match the ACPI ID from the + * ASL, prefer the MADT-derived value. + */ + if (pc->pc_acpi_id != *acpi_id) + *acpi_id = pc->pc_acpi_id; + *cpu_id = pc->pc_cpuid; + return (0); + } + } else { + if (pc->pc_acpi_id == *acpi_id) { + if (bootverbose) + device_printf(dev, + "Processor %s (ACPI ID %u) -> APIC ID %d\n", + acpi_name(acpi_get_handle(dev)), *acpi_id, + pc->pc_cpuid); + *cpu_id = pc->pc_cpuid; + return (0); + } } } + if (bootverbose) + printf("ACPI: Processor %s (ACPI ID %u) ignored\n", + acpi_name(acpi_get_handle(dev)), *acpi_id); + return (ESRCH); } Modified: stable/9/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_ec.c Fri Jun 29 21:19:24 2012 (r237821) +++ stable/9/sys/dev/acpica/acpi_ec.c Fri Jun 29 21:24:56 2012 (r237822) @@ -178,7 +178,6 @@ struct acpi_ec_softc { ACPI_SERIAL_DECL(ec, "ACPI embedded controller"); -SYSCTL_DECL(_debug_acpi); SYSCTL_NODE(_debug_acpi, OID_AUTO, ec, CTLFLAG_RD, NULL, "EC debugging"); static int ec_burst_mode; Modified: stable/9/sys/dev/acpica/acpi_smbat.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_smbat.c Fri Jun 29 21:19:24 2012 (r237821) +++ stable/9/sys/dev/acpica/acpi_smbat.c Fri Jun 29 21:24:56 2012 (r237822) @@ -62,7 +62,6 @@ static int acpi_smbat_get_bst(device_t d ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery"); -SYSCTL_DECL(_debug_acpi); SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, "Battery debugging"); /* On some laptops with smart batteries, enabling battery monitoring Modified: stable/9/sys/dev/acpica/acpivar.h ============================================================================== --- stable/9/sys/dev/acpica/acpivar.h Fri Jun 29 21:19:24 2012 (r237821) +++ stable/9/sys/dev/acpica/acpivar.h Fri Jun 29 21:24:56 2012 (r237822) @@ -487,5 +487,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL /* Use the device logging level for ktr(4). */ #define KTR_ACPI KTR_DEV +SYSCTL_DECL(_debug_acpi); + #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ Modified: stable/9/sys/i386/acpica/acpi_machdep.c ============================================================================== --- stable/9/sys/i386/acpica/acpi_machdep.c Fri Jun 29 21:19:24 2012 (r237821) +++ stable/9/sys/i386/acpica/acpi_machdep.c Fri Jun 29 21:24:56 2012 (r237822) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include -SYSCTL_DECL(_debug_acpi); - uint32_t acpi_resume_beep; TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); SYSCTL_UINT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 21:25:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00D4E1065740; Fri, 29 Jun 2012 21:25:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC7E98FC17; Fri, 29 Jun 2012 21:25:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TLPOiw071107; Fri, 29 Jun 2012 21:25:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TLPOid071099; Fri, 29 Jun 2012 21:25:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206292125.q5TLPOid071099@svn.freebsd.org> From: John Baldwin Date: Fri, 29 Jun 2012 21:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237823 - in stable/8: share/man/man4 sys/amd64/acpica sys/dev/acpica sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 21:25:25 -0000 Author: jhb Date: Fri Jun 29 21:25:24 2012 New Revision: 237823 URL: http://svn.freebsd.org/changeset/base/237823 Log: MFC 235024,235029,235556,235834,235845: Use MADT to match ACPI Processor objects to CPUs. MADT and DSDT/SSDTs may list CPUs in different orders, especially for disabled logical cores. Now we match ACPI IDs from the MADT with Processor objects, strictly order CPUs accordingly, and ignore disabled cores. This prevents us from executing methods for other CPUs, e. g., _PSS for disabled logical core, which may not exist. Unfortunately, it is known that there are a few systems with buggy BIOSes that do not have unique ACPI IDs for MADT and Processor objects. To work around these problems, 'debug.acpi.cpu_unordered' tunable is added. Set this to a non-zero value to restore the old behavior. Modified: stable/8/share/man/man4/acpi.4 stable/8/sys/amd64/acpica/acpi_machdep.c stable/8/sys/dev/acpica/acpi_cpu.c stable/8/sys/dev/acpica/acpi_ec.c stable/8/sys/dev/acpica/acpi_smbat.c stable/8/sys/dev/acpica/acpivar.h stable/8/sys/i386/acpica/acpi_machdep.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/share/man/man4/acpi.4 ============================================================================== --- stable/8/share/man/man4/acpi.4 Fri Jun 29 21:24:56 2012 (r237822) +++ stable/8/share/man/man4/acpi.4 Fri Jun 29 21:25:24 2012 (r237823) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2012 +.Dd May 4, 2012 .Dt ACPI 4 .Os .Sh NAME @@ -198,6 +198,11 @@ entry for access after boot. Enables loading of a custom ACPI DSDT. .It Va acpi_dsdt_name Name of the DSDT table to load, if loading is enabled. +.It Va debug.acpi.cpu_unordered +Do not use the MADT to match ACPI Processor objects to CPUs. +This is needed on a few systems with a buggy BIOS that does not use +consistent processor IDs. +Default is 0 (disabled). .It Va debug.acpi.disabled Selectively disables portions of ACPI for debugging purposes. .It Va debug.acpi.interpreter_slack Modified: stable/8/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- stable/8/sys/amd64/acpica/acpi_machdep.c Fri Jun 29 21:24:56 2012 (r237822) +++ stable/8/sys/amd64/acpica/acpi_machdep.c Fri Jun 29 21:25:24 2012 (r237823) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include -SYSCTL_DECL(_debug_acpi); - int acpi_resume_beep; TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Fri Jun 29 21:24:56 2012 (r237822) +++ stable/8/sys/dev/acpica/acpi_cpu.c Fri Jun 29 21:25:24 2012 (r237823) @@ -121,6 +121,13 @@ struct acpi_cpu_device { #define PIIX4_STOP_BREAK_MASK (PIIX4_BRLD_EN_IRQ0 | PIIX4_BRLD_EN_IRQ | PIIX4_BRLD_EN_IRQ8) #define PIIX4_PCNTRL_BST_EN (1<<10) +/* Allow users to ignore processor orders in MADT. */ +static int cpu_unordered; +TUNABLE_INT("debug.acpi.cpu_unordered", &cpu_unordered); +SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_unordered, CTLFLAG_RDTUN, + &cpu_unordered, 0, + "Do not use the MADT to match ACPI Processor objects to CPUs."); + /* Platform hardware resource information. */ static uint32_t cpu_smi_cmd; /* Value to write to SMI_CMD. */ static uint8_t cpu_cst_cnt; /* Indicate we are _CST aware. */ @@ -145,7 +152,7 @@ static int acpi_cpu_probe(device_t dev); static int acpi_cpu_attach(device_t dev); static int acpi_cpu_suspend(device_t dev); static int acpi_cpu_resume(device_t dev); -static int acpi_pcpu_get_id(uint32_t idx, uint32_t *acpi_id, +static int acpi_pcpu_get_id(device_t dev, uint32_t *acpi_id, uint32_t *cpu_id); static struct resource_list *acpi_cpu_get_rlist(device_t dev, device_t child); static device_t acpi_cpu_add_child(device_t dev, u_int order, const char *name, @@ -242,7 +249,7 @@ acpi_cpu_probe(device_t dev) */ acpi_id = obj->Processor.ProcId; AcpiOsFree(obj); - if (acpi_pcpu_get_id(device_get_unit(dev), &acpi_id, &cpu_id) != 0) + if (acpi_pcpu_get_id(dev, &acpi_id, &cpu_id) != 0) return (ENXIO); /* @@ -433,36 +440,66 @@ acpi_cpu_resume(device_t dev) } /* - * Find the nth present CPU and return its pc_cpuid as well as set the - * pc_acpi_id from the most reliable source. + * Find the processor associated with a given ACPI ID. By default, + * use the MADT to map ACPI IDs to APIC IDs and use that to locate a + * processor. Some systems have inconsistent ASL and MADT however. + * For these systems the cpu_unordered tunable can be set in which + * case we assume that Processor objects are listed in the same order + * in both the MADT and ASL. */ static int -acpi_pcpu_get_id(uint32_t idx, uint32_t *acpi_id, uint32_t *cpu_id) +acpi_pcpu_get_id(device_t dev, uint32_t *acpi_id, uint32_t *cpu_id) { - struct pcpu *pcpu_data; - uint32_t i; + struct pcpu *pc; + uint32_t i, idx; KASSERT(acpi_id != NULL, ("Null acpi_id")); KASSERT(cpu_id != NULL, ("Null cpu_id")); + idx = device_get_unit(dev); + + /* + * If pc_acpi_id for CPU 0 is not initialized (e.g. a non-APIC + * UP box) use the ACPI ID from the first processor we find. + */ + if (idx == 0 && mp_ncpus == 1) { + pc = pcpu_find(0); + if (pc->pc_acpi_id == 0xffffffff) + pc->pc_acpi_id = *acpi_id; + *cpu_id = 0; + return (0); + } + CPU_FOREACH(i) { - pcpu_data = pcpu_find(i); - KASSERT(pcpu_data != NULL, ("no pcpu data for %d", i)); - if (idx-- == 0) { - /* - * If pc_acpi_id was not initialized (e.g., a non-APIC UP box) - * override it with the value from the ASL. Otherwise, if the - * two don't match, prefer the MADT-derived value. Finally, - * return the pc_cpuid to reference this processor. - */ - if (pcpu_data->pc_acpi_id == 0xffffffff) - pcpu_data->pc_acpi_id = *acpi_id; - else if (pcpu_data->pc_acpi_id != *acpi_id) - *acpi_id = pcpu_data->pc_acpi_id; - *cpu_id = pcpu_data->pc_cpuid; - return (0); + pc = pcpu_find(i); + KASSERT(pc != NULL, ("no pcpu data for %d", i)); + if (cpu_unordered) { + if (idx-- == 0) { + /* + * If pc_acpi_id doesn't match the ACPI ID from the + * ASL, prefer the MADT-derived value. + */ + if (pc->pc_acpi_id != *acpi_id) + *acpi_id = pc->pc_acpi_id; + *cpu_id = pc->pc_cpuid; + return (0); + } + } else { + if (pc->pc_acpi_id == *acpi_id) { + if (bootverbose) + device_printf(dev, + "Processor %s (ACPI ID %u) -> APIC ID %d\n", + acpi_name(acpi_get_handle(dev)), *acpi_id, + pc->pc_cpuid); + *cpu_id = pc->pc_cpuid; + return (0); + } } } + if (bootverbose) + printf("ACPI: Processor %s (ACPI ID %u) ignored\n", + acpi_name(acpi_get_handle(dev)), *acpi_id); + return (ESRCH); } Modified: stable/8/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_ec.c Fri Jun 29 21:24:56 2012 (r237822) +++ stable/8/sys/dev/acpica/acpi_ec.c Fri Jun 29 21:25:24 2012 (r237823) @@ -178,7 +178,6 @@ struct acpi_ec_softc { ACPI_SERIAL_DECL(ec, "ACPI embedded controller"); -SYSCTL_DECL(_debug_acpi); SYSCTL_NODE(_debug_acpi, OID_AUTO, ec, CTLFLAG_RD, NULL, "EC debugging"); static int ec_burst_mode; Modified: stable/8/sys/dev/acpica/acpi_smbat.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_smbat.c Fri Jun 29 21:24:56 2012 (r237822) +++ stable/8/sys/dev/acpica/acpi_smbat.c Fri Jun 29 21:25:24 2012 (r237823) @@ -62,7 +62,6 @@ static int acpi_smbat_get_bst(device_t d ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery"); -SYSCTL_DECL(_debug_acpi); SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, "Battery debugging"); /* On some laptops with smart batteries, enabling battery monitoring Modified: stable/8/sys/dev/acpica/acpivar.h ============================================================================== --- stable/8/sys/dev/acpica/acpivar.h Fri Jun 29 21:24:56 2012 (r237822) +++ stable/8/sys/dev/acpica/acpivar.h Fri Jun 29 21:25:24 2012 (r237823) @@ -475,5 +475,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL /* Use the device logging level for ktr(4). */ #define KTR_ACPI KTR_DEV +SYSCTL_DECL(_debug_acpi); + #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ Modified: stable/8/sys/i386/acpica/acpi_machdep.c ============================================================================== --- stable/8/sys/i386/acpica/acpi_machdep.c Fri Jun 29 21:24:56 2012 (r237822) +++ stable/8/sys/i386/acpica/acpi_machdep.c Fri Jun 29 21:25:24 2012 (r237823) @@ -59,8 +59,6 @@ __FBSDID("$FreeBSD$"); #include -SYSCTL_DECL(_debug_acpi); - uint32_t acpi_resume_beep; TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); SYSCTL_UINT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 21:27:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A7FC106566C; Fri, 29 Jun 2012 21:27:38 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 739F28FC0A; Fri, 29 Jun 2012 21:27:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TLRcR8071250; Fri, 29 Jun 2012 21:27:38 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TLRcUN071241; Fri, 29 Jun 2012 21:27:38 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206292127.q5TLRcUN071241@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 29 Jun 2012 21:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237824 - stable/9/sys/cam/ctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 21:27:38 -0000 Author: ken Date: Fri Jun 29 21:27:37 2012 New Revision: 237824 URL: http://svn.freebsd.org/changeset/base/237824 Log: MFC r233963: r233963 | ken | 2012-04-06 16:23:13 -0600 (Fri, 06 Apr 2012) | 27 lines Change the SCSI INQUIRY peripheral qualifier that CTL reports for LUNs that don't exist. Anecdotal evidence indicates that it is better to return 011b (bad LUN) than 001b (LUN offline). However, this change also gives the user a sysctl/tunable, kern.cam.ctl.inquiry_pq_no_lun, to override the change and return to the previous behavior. (The previous behavior was to return 001b, or LUN offline.) ctl.c: Change the default inquiry peripheral qualifier to 011b, and add a sysctl and tunable to allow the user to change it back to 001b if needed. Don't insert a Copan copyright statement in the inquiry data. The copyright statements on the files are sufficient. ctl_private.h:Add sysctl variable context to the CTL softc. ctl_cmd_table.c, ctl_frontend_internal.c, ctl_frontend.c, ctl_backend.c, ctl_error.c: Include sys/sysctl.h. Modified: stable/9/sys/cam/ctl/ctl.c stable/9/sys/cam/ctl/ctl_backend.c stable/9/sys/cam/ctl/ctl_cmd_table.c stable/9/sys/cam/ctl/ctl_error.c stable/9/sys/cam/ctl/ctl_frontend.c stable/9/sys/cam/ctl/ctl_frontend_internal.c stable/9/sys/cam/ctl/ctl_private.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Fri Jun 29 21:25:24 2012 (r237823) +++ stable/9/sys/cam/ctl/ctl.c Fri Jun 29 21:27:37 2012 (r237824) @@ -959,6 +959,33 @@ ctl_init(void) softc->dev->si_drv1 = softc; + /* + * By default, return a "bad LUN" peripheral qualifier for unknown + * LUNs. The user can override this default using the tunable or + * sysctl. See the comment in ctl_inquiry_std() for more details. + */ + softc->inquiry_pq_no_lun = 1; + TUNABLE_INT_FETCH("kern.cam.ctl.inquiry_pq_no_lun", + &softc->inquiry_pq_no_lun); + sysctl_ctx_init(&softc->sysctl_ctx); + softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_kern_cam), OID_AUTO, "ctl", + CTLFLAG_RD, 0, "CAM Target Layer"); + + if (softc->sysctl_tree == NULL) { + printf("%s: unable to allocate sysctl tree\n", __func__); + destroy_dev(softc->dev); + free(control_softc, M_DEVBUF); + control_softc = NULL; + return; + } + + SYSCTL_ADD_INT(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, + "inquiry_pq_no_lun", CTLFLAG_RW, + &softc->inquiry_pq_no_lun, 0, + "Report no lun possible for invalid LUNs"); + mtx_init(&softc->ctl_lock, "CTL mutex", NULL, MTX_DEF); softc->open_count = 0; @@ -1150,6 +1177,11 @@ ctl_shutdown(void) destroy_dev(softc->dev); + sysctl_ctx_free(&softc->sysctl_ctx); + + free(control_softc, M_DEVBUF); + control_softc = NULL; + printf("ctl: CAM Target Layer unloaded\n"); } @@ -9369,15 +9401,55 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio memset(inq_ptr, 0, sizeof(*inq_ptr)); /* - * The control device is always connected. The disk device, on the - * other hand, may not be online all the time. If we don't have a - * LUN mapping, we'll just say it's offline. + * If we have a LUN configured, report it as connected. Otherwise, + * report that it is offline or no device is supported, depending + * on the value of inquiry_pq_no_lun. + * + * According to the spec (SPC-4 r34), the peripheral qualifier + * SID_QUAL_LU_OFFLINE (001b) is used in the following scenario: + * + * "A peripheral device having the specified peripheral device type + * is not connected to this logical unit. However, the device + * server is capable of supporting the specified peripheral device + * type on this logical unit." + * + * According to the same spec, the peripheral qualifier + * SID_QUAL_BAD_LU (011b) is used in this scenario: + * + * "The device server is not capable of supporting a peripheral + * device on this logical unit. For this peripheral qualifier the + * peripheral device type shall be set to 1Fh. All other peripheral + * device type values are reserved for this peripheral qualifier." + * + * Given the text, it would seem that we probably want to report that + * the LUN is offline here. There is no LUN connected, but we can + * support a LUN at the given LUN number. + * + * In the real world, though, it sounds like things are a little + * different: + * + * - Linux, when presented with a LUN with the offline peripheral + * qualifier, will create an sg driver instance for it. So when + * you attach it to CTL, you wind up with a ton of sg driver + * instances. (One for every LUN that Linux bothered to probe.) + * Linux does this despite the fact that it issues a REPORT LUNs + * to LUN 0 to get the inventory of supported LUNs. + * + * - There is other anecdotal evidence (from Emulex folks) about + * arrays that use the offline peripheral qualifier for LUNs that + * are on the "passive" path in an active/passive array. + * + * So the solution is provide a hopefully reasonable default + * (return bad/no LUN) and allow the user to change the behavior + * with a tunable/sysctl variable. */ if (lun != NULL) inq_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | lun->be_lun->lun_type; - else + else if (ctl_softc->inquiry_pq_no_lun == 0) inq_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; + else + inq_ptr->device = (SID_QUAL_BAD_LU << 5) | T_NODEVICE; /* RMB in byte 2 is 0 */ inq_ptr->version = SCSI_REV_SPC3; @@ -9491,8 +9563,6 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio break; } } - sprintf((char *)inq_ptr->vendor_specific1, "Copyright (C) 2004, COPAN " - "Systems, Inc. All Rights Reserved."); ctsio->scsi_status = SCSI_STATUS_OK; if (ctsio->kern_data_len > 0) { Modified: stable/9/sys/cam/ctl/ctl_backend.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend.c Fri Jun 29 21:25:24 2012 (r237823) +++ stable/9/sys/cam/ctl/ctl_backend.c Fri Jun 29 21:27:37 2012 (r237824) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: stable/9/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_cmd_table.c Fri Jun 29 21:25:24 2012 (r237823) +++ stable/9/sys/cam/ctl/ctl_cmd_table.c Fri Jun 29 21:27:37 2012 (r237824) @@ -44,6 +44,7 @@ #include #include #include +#include #include #include Modified: stable/9/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_error.c Fri Jun 29 21:25:24 2012 (r237823) +++ stable/9/sys/cam/ctl/ctl_error.c Fri Jun 29 21:27:37 2012 (r237824) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: stable/9/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend.c Fri Jun 29 21:25:24 2012 (r237823) +++ stable/9/sys/cam/ctl/ctl_frontend.c Fri Jun 29 21:27:37 2012 (r237824) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: stable/9/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_internal.c Fri Jun 29 21:25:24 2012 (r237823) +++ stable/9/sys/cam/ctl/ctl_frontend_internal.c Fri Jun 29 21:27:37 2012 (r237824) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/9/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/9/sys/cam/ctl/ctl_private.h Fri Jun 29 21:25:24 2012 (r237823) +++ stable/9/sys/cam/ctl/ctl_private.h Fri Jun 29 21:27:37 2012 (r237824) @@ -421,6 +421,9 @@ struct ctl_softc { int num_luns; ctl_gen_flags flags; ctl_ha_mode ha_mode; + int inquiry_pq_no_lun; + struct sysctl_ctx_list sysctl_ctx; + struct sysctl_oid *sysctl_tree; struct ctl_ioctl_info ioctl_info; struct ctl_lun lun; struct ctl_io_pool *internal_pool; From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 21:33:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FEA61065676; Fri, 29 Jun 2012 21:33:37 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 377C58FC1E; Fri, 29 Jun 2012 21:33:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TLXbGo071576; Fri, 29 Jun 2012 21:33:37 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TLXaP1071567; Fri, 29 Jun 2012 21:33:36 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206292133.q5TLXaP1071567@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 29 Jun 2012 21:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237825 - in stable/9: share/examples/scsi_target sys/cam/ctl sys/dev/aic7xxx sys/dev/firewire sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 21:33:37 -0000 Author: ken Date: Fri Jun 29 21:33:36 2012 New Revision: 237825 URL: http://svn.freebsd.org/changeset/base/237825 Log: MFC r237601: r237601 | ken | 2012-06-26 08:51:35 -0600 (Tue, 26 Jun 2012) | 38 lines Fix an issue that caused the kernel to panic inside CTL when trying to attach to target capable HBAs that implement the old immediate notify (XPT_IMMED_NOTIFY) and notify acknowledge (XPT_NOTIFY_ACK) CCBs. The new API has been in place since SVN change 196008 in 2009. The solution is two-fold: fix CTL to handle the responses from the HBAs, and convert the HBA drivers in question to use the new API. These drivers have not been tested with CTL, so how well they will interoperate with CTL is unknown. scsi_target.c:Update the userland target example code to use the new immediate notify API. scsi_ctl.c: Detect when an immediate notify CCB is returned with CAM_REQ_INVALID or CAM_PROVIDE_FAIL status, and just free it. Fix a duplicate assignment. aic79xx.c, aic79xx_osm.c:Update the aic79xx driver to use the new API. Target mode is not enabled on for this driver, so the changes will have no practical effect. aic7xxx.c, aic7xxx_osm.c:Update the aic7xxx driver to use the new API. sbp_targ.c: Update the firewire target code to work with the new API. mpt_cam.c: Update the mpt(4) driver to work with the new API. Target mode is only enabled for Fibre Channel mpt(4) devices. Modified: stable/9/share/examples/scsi_target/scsi_target.c stable/9/sys/cam/ctl/scsi_ctl.c stable/9/sys/dev/aic7xxx/aic79xx.c stable/9/sys/dev/aic7xxx/aic79xx_osm.c stable/9/sys/dev/aic7xxx/aic7xxx.c stable/9/sys/dev/aic7xxx/aic7xxx_osm.c stable/9/sys/dev/firewire/sbp_targ.c stable/9/sys/dev/mpt/mpt_cam.c Directory Properties: stable/9/share/examples/scsi_target/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/examples/scsi_target/scsi_target.c ============================================================================== --- stable/9/share/examples/scsi_target/scsi_target.c Fri Jun 29 21:27:37 2012 (r237824) +++ stable/9/share/examples/scsi_target/scsi_target.c Fri Jun 29 21:33:36 2012 (r237825) @@ -88,7 +88,7 @@ static void handle_read(void); /* static int work_atio(struct ccb_accept_tio *); */ static void queue_io(struct ccb_scsiio *); static int run_queue(struct ccb_accept_tio *); -static int work_inot(struct ccb_immed_notify *); +static int work_inot(struct ccb_immediate_notify *); static struct ccb_scsiio * get_ctio(void); /* static void free_ccb(union ccb *); */ @@ -393,7 +393,7 @@ init_ccbs() warn("malloc INOT"); return (-1); } - inot->ccb_h.func_code = XPT_IMMED_NOTIFY; + inot->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; send_ccb((union ccb *)inot, /*priority*/1); } @@ -501,8 +501,8 @@ request_loop() /* Start one more transfer. */ retval = work_atio(&ccb->atio); break; - case XPT_IMMED_NOTIFY: - retval = work_inot(&ccb->cin); + case XPT_IMMEDIATE_NOTIFY: + retval = work_inot(&ccb->cin1); break; default: warnx("Unhandled ccb type %#x on workq", @@ -657,7 +657,7 @@ work_atio(struct ccb_accept_tio *atio) warnx("ATIO with %u bytes sense received", atio->sense_len); } - sense = &atio->sense_data; + sense = (struct scsi_sense_data_fixed *)&atio->sense_data; tcmd_sense(ctio->init_id, ctio, sense->flags, sense->add_sense_code, sense->add_sense_code_qual); send_ccb((union ccb *)ctio, /*priority*/1); @@ -778,16 +778,14 @@ run_queue(struct ccb_accept_tio *atio) } static int -work_inot(struct ccb_immed_notify *inot) +work_inot(struct ccb_immediate_notify *inot) { cam_status status; - int sense; if (debug) warnx("Working on INOT %p", inot); status = inot->ccb_h.status; - sense = (status & CAM_AUTOSNS_VALID) != 0; status &= CAM_STATUS_MASK; switch (status) { @@ -800,7 +798,7 @@ work_inot(struct ccb_immed_notify *inot) abort_all_pending(); break; case CAM_MESSAGE_RECV: - switch (inot->message_args[0]) { + switch (inot->arg) { case MSG_TASK_COMPLETE: case MSG_INITIATOR_DET_ERR: case MSG_ABORT_TASK_SET: @@ -811,7 +809,7 @@ work_inot(struct ccb_immed_notify *inot) case MSG_ABORT_TASK: case MSG_CLEAR_TASK_SET: default: - warnx("INOT message %#x", inot->message_args[0]); + warnx("INOT message %#x", inot->arg); break; } break; @@ -823,17 +821,6 @@ work_inot(struct ccb_immed_notify *inot) break; } - /* If there is sense data, use it */ - if (sense != 0) { - struct scsi_sense_data_fixed *sense; - - sense = (struct scsi_sense_data_fixed *)&inot->sense_data; - tcmd_sense(inot->initiator_id, NULL, sense->flags, - sense->add_sense_code, sense->add_sense_code_qual); - if (debug) - warnx("INOT has sense: %#x", sense->flags); - } - /* Requeue on SIM */ TAILQ_REMOVE(&work_queue, &inot->ccb_h, periph_links.tqe); send_ccb((union ccb *)inot, /*priority*/1); Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Fri Jun 29 21:27:37 2012 (r237824) +++ stable/9/sys/cam/ctl/scsi_ctl.c Fri Jun 29 21:33:36 2012 (r237825) @@ -558,7 +558,6 @@ ctlferegister(struct cam_periph *periph, TAILQ_INIT(&softc->work_queue); softc->periph = periph; - softc->parent_softc = bus_softc; callout_init_mtx(&softc->dma_callout, sim->mtx, /*flags*/ 0); periph->softc = softc; @@ -628,12 +627,22 @@ ctlferegister(struct cam_periph *periph, xpt_action(new_ccb); softc->inots_sent++; status = new_ccb->ccb_h.status; - if (status != CAM_REQ_INPROG) { - free(new_ccb, M_CTLFE); + if ((status & CAM_STATUS_MASK) != CAM_REQ_INPROG) { + /* + * Note that we don't free the CCB here. If the + * status is not CAM_REQ_INPROG, then we're + * probably talking to a SIM that says it is + * target-capable but doesn't support the + * XPT_IMMEDIATE_NOTIFY CCB. i.e. it supports the + * older API. In that case, it'll call xpt_done() + * on the CCB, and we need to free it in our done + * routine as a result. + */ break; } } - if (i == 0) { + if ((i == 0) + || (status != CAM_REQ_INPROG)) { xpt_print(periph->path, "%s: could not allocate immediate " "notify CCBs, status 0x%x\n", __func__, status); return (CAM_REQ_CMP_ERR); @@ -1460,12 +1469,29 @@ ctlfedone(struct cam_periph *periph, uni */ send_ctl_io = 0; break; + case CAM_REQ_INVALID: + case CAM_PROVIDE_FAIL: default: - xpt_print(periph->path, "%s: " - "unsupported CAM status 0x%x\n", - __func__, status); - send_ctl_io = 0; - break; + /* + * We should only get here if we're talking + * to a talking to a SIM that is target + * capable but supports the old API. In + * that case, we need to just free the CCB. + * If we actually send a notify acknowledge, + * it will send that back with an error as + * well. + */ + + if ((status != CAM_REQ_INVALID) + && (status != CAM_PROVIDE_FAIL)) + xpt_print(periph->path, "%s: " + "unsupported CAM status " + "0x%x\n", __func__, status); + + ctl_free_io(io); + ctlfe_free_ccb(periph, done_ccb); + + return; } if (send_ctl_io != 0) { ctl_queue(io); Modified: stable/9/sys/dev/aic7xxx/aic79xx.c ============================================================================== --- stable/9/sys/dev/aic7xxx/aic79xx.c Fri Jun 29 21:27:37 2012 (r237824) +++ stable/9/sys/dev/aic7xxx/aic79xx.c Fri Jun 29 21:33:36 2012 (r237825) @@ -8561,7 +8561,7 @@ void ahd_send_lstate_events(struct ahd_softc *ahd, struct ahd_tmode_lstate *lstate) { struct ccb_hdr *ccbh; - struct ccb_immed_notify *inot; + struct ccb_immediate_notify *inot; while (lstate->event_r_idx != lstate->event_w_idx && (ccbh = SLIST_FIRST(&lstate->immed_notifies)) != NULL) { @@ -8569,19 +8569,18 @@ ahd_send_lstate_events(struct ahd_softc event = &lstate->event_buffer[lstate->event_r_idx]; SLIST_REMOVE_HEAD(&lstate->immed_notifies, sim_links.sle); - inot = (struct ccb_immed_notify *)ccbh; + inot = (struct ccb_immediate_notify *)ccbh; switch (event->event_type) { case EVENT_TYPE_BUS_RESET: ccbh->status = CAM_SCSI_BUS_RESET|CAM_DEV_QFRZN; break; default: ccbh->status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; - inot->message_args[0] = event->event_type; - inot->message_args[1] = event->event_arg; + inot->arg = event->event_type; + inot->seq_id = event->event_arg; break; } inot->initiator_id = event->initiator_id; - inot->sense_len = 0; xpt_done((union ccb *)inot); lstate->event_r_idx++; if (lstate->event_r_idx == AHD_TMODE_EVENT_BUFFER_SIZE) Modified: stable/9/sys/dev/aic7xxx/aic79xx_osm.c ============================================================================== --- stable/9/sys/dev/aic7xxx/aic79xx_osm.c Fri Jun 29 21:27:37 2012 (r237824) +++ stable/9/sys/dev/aic7xxx/aic79xx_osm.c Fri Jun 29 21:33:36 2012 (r237825) @@ -601,8 +601,8 @@ ahd_action(struct cam_sim *sim, union cc break; } #ifdef AHD_TARGET_MODE - case XPT_NOTIFY_ACK: - case XPT_IMMED_NOTIFY: + case XPT_NOTIFY_ACKNOWLEDGE: + case XPT_IMMEDIATE_NOTIFY: { struct ahd_tmode_tstate *tstate; struct ahd_tmode_lstate *lstate; @@ -1189,7 +1189,7 @@ ahd_abort_ccb(struct ahd_softc *ahd, str switch (abort_ccb->ccb_h.func_code) { #ifdef AHD_TARGET_MODE case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: + case XPT_IMMEDIATE_NOTIFY: case XPT_CONT_TARGET_IO: { struct ahd_tmode_tstate *tstate; @@ -1207,7 +1207,7 @@ ahd_abort_ccb(struct ahd_softc *ahd, str if (abort_ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) list = &lstate->accept_tios; - else if (abort_ccb->ccb_h.func_code == XPT_IMMED_NOTIFY) + else if (abort_ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) list = &lstate->immed_notifies; else list = NULL; Modified: stable/9/sys/dev/aic7xxx/aic7xxx.c ============================================================================== --- stable/9/sys/dev/aic7xxx/aic7xxx.c Fri Jun 29 21:27:37 2012 (r237824) +++ stable/9/sys/dev/aic7xxx/aic7xxx.c Fri Jun 29 21:33:36 2012 (r237825) @@ -6368,7 +6368,7 @@ void ahc_send_lstate_events(struct ahc_softc *ahc, struct ahc_tmode_lstate *lstate) { struct ccb_hdr *ccbh; - struct ccb_immed_notify *inot; + struct ccb_immediate_notify *inot; while (lstate->event_r_idx != lstate->event_w_idx && (ccbh = SLIST_FIRST(&lstate->immed_notifies)) != NULL) { @@ -6376,19 +6376,18 @@ ahc_send_lstate_events(struct ahc_softc event = &lstate->event_buffer[lstate->event_r_idx]; SLIST_REMOVE_HEAD(&lstate->immed_notifies, sim_links.sle); - inot = (struct ccb_immed_notify *)ccbh; + inot = (struct ccb_immediate_notify *)ccbh; switch (event->event_type) { case EVENT_TYPE_BUS_RESET: ccbh->status = CAM_SCSI_BUS_RESET|CAM_DEV_QFRZN; break; default: ccbh->status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; - inot->message_args[0] = event->event_type; - inot->message_args[1] = event->event_arg; + inot->arg = event->event_type; + inot->seq_id = event->event_arg; break; } inot->initiator_id = event->initiator_id; - inot->sense_len = 0; xpt_done((union ccb *)inot); lstate->event_r_idx++; if (lstate->event_r_idx == AHC_TMODE_EVENT_BUFFER_SIZE) Modified: stable/9/sys/dev/aic7xxx/aic7xxx_osm.c ============================================================================== --- stable/9/sys/dev/aic7xxx/aic7xxx_osm.c Fri Jun 29 21:27:37 2012 (r237824) +++ stable/9/sys/dev/aic7xxx/aic7xxx_osm.c Fri Jun 29 21:33:36 2012 (r237825) @@ -568,8 +568,8 @@ ahc_action(struct cam_sim *sim, union cc } break; } - case XPT_NOTIFY_ACK: - case XPT_IMMED_NOTIFY: + case XPT_NOTIFY_ACKNOWLEDGE: + case XPT_IMMEDIATE_NOTIFY: { struct ahc_tmode_tstate *tstate; struct ahc_tmode_lstate *lstate; @@ -1248,7 +1248,7 @@ ahc_abort_ccb(struct ahc_softc *ahc, str abort_ccb = ccb->cab.abort_ccb; switch (abort_ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: + case XPT_IMMEDIATE_NOTIFY: case XPT_CONT_TARGET_IO: { struct ahc_tmode_tstate *tstate; @@ -1266,7 +1266,7 @@ ahc_abort_ccb(struct ahc_softc *ahc, str if (abort_ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) list = &lstate->accept_tios; - else if (abort_ccb->ccb_h.func_code == XPT_IMMED_NOTIFY) + else if (abort_ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) list = &lstate->immed_notifies; else list = NULL; Modified: stable/9/sys/dev/firewire/sbp_targ.c ============================================================================== --- stable/9/sys/dev/firewire/sbp_targ.c Fri Jun 29 21:27:37 2012 (r237824) +++ stable/9/sys/dev/firewire/sbp_targ.c Fri Jun 29 21:33:36 2012 (r237825) @@ -488,7 +488,7 @@ sbp_targ_send_lstate_events(struct sbp_t { #if 0 struct ccb_hdr *ccbh; - struct ccb_immed_notify *inot; + struct ccb_immediate_notify *inot; printf("%s: not implemented yet\n", __func__); #endif @@ -822,7 +822,7 @@ sbp_targ_abort_ccb(struct sbp_targ_softc if (accb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) list = &lstate->accept_tios; - else if (accb->ccb_h.func_code == XPT_IMMED_NOTIFY) + else if (accb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) list = &lstate->immed_notifies; else return (CAM_UA_ABORT); @@ -1100,8 +1100,8 @@ sbp_targ_action1(struct cam_sim *sim, un } } break; - case XPT_NOTIFY_ACK: /* recycle notify ack */ - case XPT_IMMED_NOTIFY: /* Add Immediate Notify Resource */ + case XPT_NOTIFY_ACKNOWLEDGE: /* recycle notify ack */ + case XPT_IMMEDIATE_NOTIFY: /* Add Immediate Notify Resource */ if (status != CAM_REQ_CMP) { ccb->ccb_h.status = status; xpt_done(ccb); @@ -1147,7 +1147,7 @@ sbp_targ_action1(struct cam_sim *sim, un switch (accb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: + case XPT_IMMEDIATE_NOTIFY: ccb->ccb_h.status = sbp_targ_abort_ccb(sc, ccb); break; case XPT_CONT_TARGET_IO: Modified: stable/9/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_cam.c Fri Jun 29 21:27:37 2012 (r237824) +++ stable/9/sys/dev/mpt/mpt_cam.c Fri Jun 29 21:33:36 2012 (r237825) @@ -3411,7 +3411,7 @@ mpt_action(struct cam_sim *sim, union cc CAMLOCK_2_MPTLOCK(mpt); switch (accb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: + case XPT_IMMEDIATE_NOTIFY: ccb->ccb_h.status = mpt_abort_target_ccb(mpt, ccb); break; case XPT_CONT_TARGET_IO: @@ -3785,8 +3785,8 @@ mpt_action(struct cam_sim *sim, union cc } break; } - case XPT_NOTIFY_ACK: /* recycle notify ack */ - case XPT_IMMED_NOTIFY: /* Add Immediate Notify Resource */ + case XPT_NOTIFY_ACKNOWLEDGE: /* recycle notify ack */ + case XPT_IMMEDIATE_NOTIFY: /* Add Immediate Notify Resource */ case XPT_ACCEPT_TARGET_IO: /* Add Accept Target IO Resource */ { tgt_resource_t *trtp; @@ -3813,7 +3813,7 @@ mpt_action(struct cam_sim *sim, union cc "Put FREE ATIO %p lun %d\n", ccb, lun); STAILQ_INSERT_TAIL(&trtp->atios, &ccb->ccb_h, sim_links.stqe); - } else if (ccb->ccb_h.func_code == XPT_IMMED_NOTIFY) { + } else if (ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) { mpt_lprt(mpt, MPT_PRT_DEBUG1, "Put FREE INOT lun %d\n", lun); STAILQ_INSERT_TAIL(&trtp->inots, &ccb->ccb_h, @@ -4822,7 +4822,7 @@ mpt_abort_target_ccb(struct mpt_softc *m if (accb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { lp = &trtp->atios; - } else if (accb->ccb_h.func_code == XPT_IMMED_NOTIFY) { + } else if (accb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) { lp = &trtp->inots; } else { return (CAM_REQ_INVALID); @@ -5043,11 +5043,11 @@ static void mpt_scsi_tgt_tsk_mgmt(struct mpt_softc *mpt, request_t *req, mpt_task_mgmt_t fc, tgt_resource_t *trtp, int init_id) { - struct ccb_immed_notify *inot; + struct ccb_immediate_notify *inot; mpt_tgt_state_t *tgt; tgt = MPT_TGT_STATE(mpt, req); - inot = (struct ccb_immed_notify *) STAILQ_FIRST(&trtp->inots); + inot = (struct ccb_immediate_notify *) STAILQ_FIRST(&trtp->inots); if (inot == NULL) { mpt_lprt(mpt, MPT_PRT_WARN, "no INOTSs- sending back BSY\n"); mpt_scsi_tgt_status(mpt, NULL, req, SCSI_STATUS_BUSY, NULL); @@ -5057,35 +5057,35 @@ mpt_scsi_tgt_tsk_mgmt(struct mpt_softc * mpt_lprt(mpt, MPT_PRT_DEBUG1, "Get FREE INOT %p lun %d\n", inot, inot->ccb_h.target_lun); - memset(&inot->sense_data, 0, sizeof (inot->sense_data)); - inot->sense_len = 0; - memset(inot->message_args, 0, sizeof (inot->message_args)); inot->initiator_id = init_id; /* XXX */ - /* * This is a somewhat grotesque attempt to map from task management * to old style SCSI messages. God help us all. */ switch (fc) { case MPT_ABORT_TASK_SET: - inot->message_args[0] = MSG_ABORT_TAG; + inot->arg = MSG_ABORT_TAG; break; case MPT_CLEAR_TASK_SET: - inot->message_args[0] = MSG_CLEAR_TASK_SET; + inot->arg = MSG_CLEAR_TASK_SET; break; case MPT_TARGET_RESET: - inot->message_args[0] = MSG_TARGET_RESET; + inot->arg = MSG_TARGET_RESET; break; case MPT_CLEAR_ACA: - inot->message_args[0] = MSG_CLEAR_ACA; + inot->arg = MSG_CLEAR_ACA; break; case MPT_TERMINATE_TASK: - inot->message_args[0] = MSG_ABORT_TAG; + inot->arg = MSG_ABORT_TAG; break; default: - inot->message_args[0] = MSG_NOOP; + inot->arg = MSG_NOOP; break; } + /* + * XXX KDM we need the sequence/tag number for the target of the + * task management operation, especially if it is an abort. + */ tgt->ccb = (union ccb *) inot; inot->ccb_h.status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; MPTLOCK_2_CAMLOCK(mpt); From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 22:00:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6D8B106566C; Fri, 29 Jun 2012 22:00:30 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFF4E8FC14; Fri, 29 Jun 2012 22:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TM0Us0072726; Fri, 29 Jun 2012 22:00:30 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TM0Ub4072721; Fri, 29 Jun 2012 22:00:30 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206292200.q5TM0Ub4072721@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 29 Jun 2012 22:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237826 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 22:00:31 -0000 Author: ken Date: Fri Jun 29 22:00:30 2012 New Revision: 237826 URL: http://svn.freebsd.org/changeset/base/237826 Log: MFC r236138, with the exception of scsi_enc.c: r236138 | ken | 2012-05-27 00:11:09 -0600 (Sun, 27 May 2012) | 64 lines Work around a race condition in devfs by changing the way closes are handled in most CAM peripheral drivers that are not handled by GEOM's disk class. The usual character driver open and close semantics are that the driver gets N open calls, but only one close, when the last caller closes the device. CAM peripheral drivers expect that behavior to be honored to the letter, and the CAM peripheral driver code (specifically cam_periph_release_locked_busses()) panics if it is done incorrectly. Since devfs has to drop its locks while it calls a driver's close routine, and it does not have a way to delay or prevent open calls while it is calling the close routine, there is a race. The sequence of events, simplified a bit, is: - devfs acquires a lock - devfs checks the reference count, and if it is 1, continues to close. - devfs releases the lock - 2nd process open call on the device happens here - devfs calls the driver's close routine - devfs acquires a lock - devfs decrements the reference count - devfs releases the lock - 2nd process close call on the device happens here At the second close, we get a panic in cam_periph_release_locked_busses(), complaining that peripheral has been released when the reference count is already 0. This is because we have gotten two closes in a row, which should not happen. The fix is to add the D_TRACKCLOSE flag to the driver's cdevsw, so that we get a close() call for each open(). That does happen reliably, so we can make sure that our reference counts are correct. Note that the sa(4) and pt(4) drivers only allow one context through the open routine. So these drivers aren't exposed to the same race condition. scsi_ch.c, scsi_enc.c, scsi_enc_internal.h, scsi_pass.c, scsi_sg.c: For these drivers, change the open() routine to increment the reference count for every open, and just decrement the reference count in the close. Call cam_periph_release_locked() in some scenarios to avoid additional lock and unlock calls. scsi_pt.c: Call cam_periph_release_locked() in some scenarios to avoid additional lock and unlock calls. Modified: stable/9/sys/cam/scsi/scsi_ch.c stable/9/sys/cam/scsi/scsi_pass.c stable/9/sys/cam/scsi/scsi_pt.c stable/9/sys/cam/scsi/scsi_sg.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_ch.c Fri Jun 29 21:33:36 2012 (r237825) +++ stable/9/sys/cam/scsi/scsi_ch.c Fri Jun 29 22:00:30 2012 (r237826) @@ -107,8 +107,7 @@ static const u_int32_t CH_TIMEOUT_SEND_V static const u_int32_t CH_TIMEOUT_INITIALIZE_ELEMENT_STATUS = 500000; typedef enum { - CH_FLAG_INVALID = 0x001, - CH_FLAG_OPEN = 0x002 + CH_FLAG_INVALID = 0x001 } ch_flags; typedef enum { @@ -211,7 +210,7 @@ PERIPHDRIVER_DECLARE(ch, chdriver); static struct cdevsw ch_cdevsw = { .d_version = D_VERSION, - .d_flags = 0, + .d_flags = D_TRACKCLOSE, .d_open = chopen, .d_close = chclose, .d_ioctl = chioctl, @@ -404,16 +403,11 @@ chopen(struct cdev *dev, int flags, int cam_periph_lock(periph); if (softc->flags & CH_FLAG_INVALID) { + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return(ENXIO); } - if ((softc->flags & CH_FLAG_OPEN) == 0) - softc->flags |= CH_FLAG_OPEN; - else - cam_periph_release(periph); - if ((error = cam_periph_hold(periph, PRIBIO | PCATCH)) != 0) { cam_periph_unlock(periph); cam_periph_release(periph); @@ -424,9 +418,8 @@ chopen(struct cdev *dev, int flags, int * Load information about this changer device into the softc. */ if ((error = chgetparams(periph)) != 0) { - softc->flags &= ~CH_FLAG_OPEN; + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return(error); } @@ -451,11 +444,6 @@ chclose(struct cdev *dev, int flag, int softc = (struct ch_softc *)periph->softc; - cam_periph_lock(periph); - - softc->flags &= ~CH_FLAG_OPEN; - - cam_periph_unlock(periph); cam_periph_release(periph); return(0); Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Fri Jun 29 21:33:36 2012 (r237825) +++ stable/9/sys/cam/scsi/scsi_pass.c Fri Jun 29 22:00:30 2012 (r237826) @@ -111,7 +111,7 @@ PERIPHDRIVER_DECLARE(pass, passdriver); static struct cdevsw pass_cdevsw = { .d_version = D_VERSION, - .d_flags = 0, + .d_flags = D_TRACKCLOSE, .d_open = passopen, .d_close = passclose, .d_ioctl = passioctl, @@ -377,8 +377,8 @@ passopen(struct cdev *dev, int flags, in softc = (struct pass_softc *)periph->softc; if (softc->flags & PASS_FLAG_INVALID) { + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return(ENXIO); } @@ -387,8 +387,8 @@ passopen(struct cdev *dev, int flags, in */ error = securelevel_gt(td->td_ucred, 1); if (error) { + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return(error); } @@ -396,8 +396,8 @@ passopen(struct cdev *dev, int flags, in * Only allow read-write access. */ if (((flags & FWRITE) == 0) || ((flags & FREAD) == 0)) { + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return(EPERM); } @@ -406,19 +406,12 @@ passopen(struct cdev *dev, int flags, in */ if ((flags & O_NONBLOCK) != 0) { xpt_print(periph->path, "can't do nonblocking access\n"); + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return(EINVAL); } - if ((softc->flags & PASS_FLAG_OPEN) == 0) { - softc->flags |= PASS_FLAG_OPEN; - cam_periph_unlock(periph); - } else { - /* Device closes aren't symmertical, so fix up the refcount */ - cam_periph_unlock(periph); - cam_periph_release(periph); - } + cam_periph_unlock(periph); return (error); } @@ -427,18 +420,11 @@ static int passclose(struct cdev *dev, int flag, int fmt, struct thread *td) { struct cam_periph *periph; - struct pass_softc *softc; periph = (struct cam_periph *)dev->si_drv1; if (periph == NULL) return (ENXIO); - cam_periph_lock(periph); - - softc = (struct pass_softc *)periph->softc; - softc->flags &= ~PASS_FLAG_OPEN; - - cam_periph_unlock(periph); cam_periph_release(periph); return (0); Modified: stable/9/sys/cam/scsi/scsi_pt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pt.c Fri Jun 29 21:33:36 2012 (r237825) +++ stable/9/sys/cam/scsi/scsi_pt.c Fri Jun 29 22:00:30 2012 (r237826) @@ -148,8 +148,8 @@ ptopen(struct cdev *dev, int flags, int cam_periph_lock(periph); if (softc->flags & PT_FLAG_DEVICE_INVALID) { + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return(ENXIO); } @@ -182,8 +182,8 @@ ptclose(struct cdev *dev, int flag, int cam_periph_lock(periph); softc->flags &= ~PT_FLAG_OPEN; + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return (0); } Modified: stable/9/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sg.c Fri Jun 29 21:33:36 2012 (r237825) +++ stable/9/sys/cam/scsi/scsi_sg.c Fri Jun 29 22:00:30 2012 (r237826) @@ -61,9 +61,8 @@ __FBSDID("$FreeBSD$"); #include typedef enum { - SG_FLAG_OPEN = 0x01, - SG_FLAG_LOCKED = 0x02, - SG_FLAG_INVALID = 0x04 + SG_FLAG_LOCKED = 0x01, + SG_FLAG_INVALID = 0x02 } sg_flags; typedef enum { @@ -141,7 +140,7 @@ PERIPHDRIVER_DECLARE(sg, sgdriver); static struct cdevsw sg_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = D_NEEDGIANT | D_TRACKCLOSE, .d_open = sgopen, .d_close = sgclose, .d_ioctl = sgioctl, @@ -415,19 +414,12 @@ sgopen(struct cdev *dev, int flags, int softc = (struct sg_softc *)periph->softc; if (softc->flags & SG_FLAG_INVALID) { + cam_periph_release_locked(periph); cam_periph_unlock(periph); - cam_periph_release(periph); return (ENXIO); } - if ((softc->flags & SG_FLAG_OPEN) == 0) { - softc->flags |= SG_FLAG_OPEN; - cam_periph_unlock(periph); - } else { - /* Device closes aren't symmetrical, fix up the refcount. */ - cam_periph_unlock(periph); - cam_periph_release(periph); - } + cam_periph_unlock(periph); return (error); } @@ -436,18 +428,11 @@ static int sgclose(struct cdev *dev, int flag, int fmt, struct thread *td) { struct cam_periph *periph; - struct sg_softc *softc; periph = (struct cam_periph *)dev->si_drv1; if (periph == NULL) return (ENXIO); - cam_periph_lock(periph); - - softc = (struct sg_softc *)periph->softc; - softc->flags &= ~SG_FLAG_OPEN; - - cam_periph_unlock(periph); cam_periph_release(periph); return (0); From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 22:28:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B985D106564A; Fri, 29 Jun 2012 22:28:31 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1D288FC16; Fri, 29 Jun 2012 22:28:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TMSVtd074098; Fri, 29 Jun 2012 22:28:31 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TMSV7j074093; Fri, 29 Jun 2012 22:28:31 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206292228.q5TMSV7j074093@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 29 Jun 2012 22:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237827 - in stable/9/sys/cam: . scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 22:28:31 -0000 Author: ken Date: Fri Jun 29 22:28:31 2012 New Revision: 237827 URL: http://svn.freebsd.org/changeset/base/237827 Log: MFC r237328, except for the scsi_enc.c changes: r237328 | ken | 2012-06-20 11:08:00 -0600 (Wed, 20 Jun 2012) | 69 lines Fix several reference counting and object lifetime issues between the pass(4) and enc(4) drivers and devfs. The pass(4) driver uses the destroy_dev_sched() routine to schedule its device node for destruction in a separate thread context. It does this because the passcleanup() routine can get called indirectly from the passclose() routine, and that would cause a deadlock if the close routine tried to destroy its own device node. In any case, once a particular passthrough driver number, e.g. pass3, is destroyed, CAM considers that unit number (3 in this case) available for reuse. The problem is that devfs may not be done cleaning up the previous instance of pass3, and will panic if isn't done cleaning up the previous instance. The solution is to get a callback from devfs when the device node is removed, and make sure we hold a reference to the peripheral until that happens. Testing exposed some other cases where we have reference counting issues, and those were also fixed in the pass(4) driver. cam_periph.c: In camperiphfree(), reorder some of the operations. The peripheral destructor needs to be called before the peripheral is removed from the peripheral is removed from the list. This is because once we remove the peripheral from the list, and drop the topology lock, the peripheral number may be reused. But if the destructor hasn't been called yet, there may still be resources hanging around (like devfs nodes) that haven't been fully cleaned up. cam_xpt.c: Add an argument to xpt_remove_periph() to indicate whether the topology lock is already held. scsi_enc.c: Acquire an extra reference to the peripheral during registration, and release it once we get a callback from devfs indicating that the device node is gone. Call destroy_dev_sched_cb() in enc_oninvalidate() instead of calling destroy_dev() in the cleanup routine. scsi_pass.c: Add reference counting to handle peripheral and devfs object lifetime issues. Add a reference to the peripheral and the devfs node in the peripheral registration. Don't attempt to add a physical path alias if the peripheral has been marked invalid. Release the devfs reference once the initial physical path alias taskqueue run has completed. Schedule devfs node destruction in the passoninvalidate(), and release our peripheral reference in a new routine, passdevgonecb() once the devfs node is gone. This allows the peripheral to fully go away, and the peripheral destructor, passcleanup(), will get called. Sponsored by: Spectra Logic Modified: stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/cam_xpt_periph.h stable/9/sys/cam/scsi/scsi_pass.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Fri Jun 29 22:00:30 2012 (r237826) +++ stable/9/sys/cam/cam_periph.c Fri Jun 29 22:28:31 2012 (r237827) @@ -258,7 +258,7 @@ failure: break; case 3: CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); - xpt_remove_periph(periph); + xpt_remove_periph(periph, /*topology_lock_held*/ 0); /* FALLTHROUGH */ case 2: xpt_lock_buses(); @@ -614,13 +614,38 @@ camperiphfree(struct cam_periph *periph) return; } - TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links); - (*p_drv)->generation++; + /* + * The peripheral destructor semantics dictate calling with only the + * SIM mutex held. Since it might sleep, it should not be called + * with the topology lock held. + */ xpt_unlock_buses(); + /* + * We need to call the peripheral destructor prior to removing the + * peripheral from the list. Otherwise, we risk running into a + * scenario where the peripheral unit number may get reused + * (because it has been removed from the list), but some resources + * used by the peripheral are still hanging around. In particular, + * the devfs nodes used by some peripherals like the pass(4) driver + * aren't fully cleaned up until the destructor is run. If the + * unit number is reused before the devfs instance is fully gone, + * devfs will panic. + */ if (periph->periph_dtor != NULL) periph->periph_dtor(periph); - xpt_remove_periph(periph); + + /* + * The peripheral list is protected by the topology lock. + */ + xpt_lock_buses(); + + TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links); + (*p_drv)->generation++; + + xpt_remove_periph(periph, /*topology_lock_held*/ 1); + + xpt_unlock_buses(); CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Fri Jun 29 22:00:30 2012 (r237826) +++ stable/9/sys/cam/cam_xpt.c Fri Jun 29 22:28:31 2012 (r237827) @@ -1026,7 +1026,7 @@ xpt_add_periph(struct cam_periph *periph } void -xpt_remove_periph(struct cam_periph *periph) +xpt_remove_periph(struct cam_periph *periph, int topology_lock_held) { struct cam_ed *device; @@ -1047,9 +1047,13 @@ xpt_remove_periph(struct cam_periph *per SLIST_REMOVE(periph_head, periph, cam_periph, periph_links); } - mtx_lock(&xsoftc.xpt_topo_lock); + if (topology_lock_held == 0) + mtx_lock(&xsoftc.xpt_topo_lock); + xsoftc.xpt_generation++; - mtx_unlock(&xsoftc.xpt_topo_lock); + + if (topology_lock_held == 0) + mtx_unlock(&xsoftc.xpt_topo_lock); } Modified: stable/9/sys/cam/cam_xpt_periph.h ============================================================================== --- stable/9/sys/cam/cam_xpt_periph.h Fri Jun 29 22:00:30 2012 (r237826) +++ stable/9/sys/cam/cam_xpt_periph.h Fri Jun 29 22:28:31 2012 (r237827) @@ -42,7 +42,8 @@ void xpt_polled_action(union ccb *ccb); void xpt_release_ccb(union ccb *released_ccb); void xpt_schedule(struct cam_periph *perph, u_int32_t new_priority); int32_t xpt_add_periph(struct cam_periph *periph); -void xpt_remove_periph(struct cam_periph *periph); +void xpt_remove_periph(struct cam_periph *periph, + int topology_lock_held); void xpt_announce_periph(struct cam_periph *periph, char *announce_string); #endif Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Fri Jun 29 22:00:30 2012 (r237826) +++ stable/9/sys/cam/scsi/scsi_pass.c Fri Jun 29 22:28:31 2012 (r237827) @@ -55,7 +55,8 @@ __FBSDID("$FreeBSD$"); typedef enum { PASS_FLAG_OPEN = 0x01, PASS_FLAG_LOCKED = 0x02, - PASS_FLAG_INVALID = 0x04 + PASS_FLAG_INVALID = 0x04, + PASS_FLAG_INITIAL_PHYSPATH = 0x08 } pass_flags; typedef enum { @@ -133,7 +134,18 @@ passinit(void) printf("pass: Failed to attach master async callback " "due to status 0x%x!\n", status); } - + +} + +static void +passdevgonecb(void *arg) +{ + struct cam_periph *periph; + + periph = (struct cam_periph *)arg; + + xpt_print(periph->path, "%s: devfs entry is gone\n", __func__); + cam_periph_release(periph); } static void @@ -151,6 +163,12 @@ passoninvalidate(struct cam_periph *peri softc->flags |= PASS_FLAG_INVALID; /* + * Tell devfs this device has gone away, and ask for a callback + * when it has cleaned up its state. + */ + destroy_dev_sched_cb(softc->dev, passdevgonecb, periph); + + /* * XXX Return all queued I/O with ENXIO. * XXX Handle any transactions queued to the card * with XPT_ABORT_CCB. @@ -176,11 +194,6 @@ passcleanup(struct cam_periph *periph) cam_periph_unlock(periph); taskqueue_drain(taskqueue_thread, &softc->add_physpath_task); - /* - * passcleanup() is indirectly a d_close method via passclose, - * so using destroy_dev(9) directly can result in deadlock. - */ - destroy_dev_sched(softc->dev); cam_periph_lock(periph); free(softc, M_DEVBUF); @@ -199,6 +212,12 @@ pass_add_physpath(void *context, int pen */ periph = context; softc = periph->softc; + cam_periph_lock(periph); + if (periph->flags & CAM_PERIPH_INVALID) { + cam_periph_unlock(periph); + return; + } + cam_periph_unlock(periph); physpath = malloc(MAXPATHLEN, M_DEVBUF, M_WAITOK); if (xpt_getattr(physpath, MAXPATHLEN, "GEOM::physpath", periph->path) == 0 @@ -208,6 +227,19 @@ pass_add_physpath(void *context, int pen softc->dev, softc->alias_dev, physpath); } free(physpath, M_DEVBUF); + + /* + * Now that we've made our alias, we no longer have to have a + * reference to the device. + */ + cam_periph_lock(periph); + if ((softc->flags & PASS_FLAG_INITIAL_PHYSPATH) == 0) { + softc->flags |= PASS_FLAG_INITIAL_PHYSPATH; + cam_periph_unlock(periph); + dev_rel(softc->dev); + } + else + cam_periph_unlock(periph); } static void @@ -281,12 +313,12 @@ passregister(struct cam_periph *periph, cgd = (struct ccb_getdev *)arg; if (periph == NULL) { - printf("passregister: periph was NULL!!\n"); + printf("%s: periph was NULL!!\n", __func__); return(CAM_REQ_CMP_ERR); } if (cgd == NULL) { - printf("passregister: no getdev CCB, can't register device\n"); + printf("%s: no getdev CCB, can't register device\n", __func__); return(CAM_REQ_CMP_ERR); } @@ -294,8 +326,8 @@ passregister(struct cam_periph *periph, M_DEVBUF, M_NOWAIT); if (softc == NULL) { - printf("passregister: Unable to probe new device. " - "Unable to allocate softc\n"); + printf("%s: Unable to probe new device. " + "Unable to allocate softc\n", __func__); return(CAM_REQ_CMP_ERR); } @@ -331,10 +363,31 @@ passregister(struct cam_periph *periph, DEVSTAT_TYPE_PASS, DEVSTAT_PRIORITY_PASS); + /* + * Acquire a reference to the periph before we create the devfs + * instance for it. We'll release this reference once the devfs + * instance has been freed. + */ + if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + xpt_print(periph->path, "%s: lost periph during " + "registration!\n", __func__); + mtx_lock(periph->sim->mtx); + return (CAM_REQ_CMP_ERR); + } + /* Register the device */ softc->dev = make_dev(&pass_cdevsw, periph->unit_number, UID_ROOT, GID_OPERATOR, 0600, "%s%d", periph->periph_name, periph->unit_number); + + /* + * Now that we have made the devfs instance, hold a reference to it + * until the task queue has run to setup the physical path alias. + * That way devfs won't get rid of the device before we add our + * alias. + */ + dev_ref(softc->dev); + mtx_lock(periph->sim->mtx); softc->dev->si_drv1 = periph; From owner-svn-src-all@FreeBSD.ORG Fri Jun 29 22:33:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3D73106564A; Fri, 29 Jun 2012 22:33:48 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCC588FC17; Fri, 29 Jun 2012 22:33:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5TMXmTS074390; Fri, 29 Jun 2012 22:33:48 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5TMXm0c074386; Fri, 29 Jun 2012 22:33:48 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201206292233.q5TMXm0c074386@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 29 Jun 2012 22:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237828 - in stable/9: sbin/camcontrol sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2012 22:33:48 -0000 Author: ken Date: Fri Jun 29 22:33:48 2012 New Revision: 237828 URL: http://svn.freebsd.org/changeset/base/237828 Log: MFC r237452: r237452 | ken | 2012-06-22 12:57:06 -0600 (Fri, 22 Jun 2012) | 25 lines Change 'camcontrol defects' to first probe a drive to find out how much defect information it has before grabbing the full defect list. This works around a bug with some Hitachi drives that generate data overrun errors when they are asked for more defect data than they have. The change is done in a spec-compliant way, so it should have no negative impact on drives that don't have this issue. This is based on work originally done at Sandvine. scsi_da.h: Add a define for the maximum amount of data that can be contained in a defect list. camcontrol.c: Update the readdefects() function to issue an initial command to determine the length of the defect list, and then use that length in the request for the full defect list. camcontrol.8: Add a note that some drives will report 0 defects available if you don't request either the PLIST or GLIST. Submitted by: Mark Johnston (original version) Modified: stable/9/sbin/camcontrol/camcontrol.8 stable/9/sbin/camcontrol/camcontrol.c stable/9/sys/cam/scsi/scsi_da.h Directory Properties: stable/9/sbin/camcontrol/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.8 Fri Jun 29 22:28:31 2012 (r237827) +++ stable/9/sbin/camcontrol/camcontrol.8 Fri Jun 29 22:33:48 2012 (r237828) @@ -497,6 +497,8 @@ is specified, .Nm will print out the number of defects given in the READ DEFECT DATA header returned from the drive. +Some drives will report 0 defects if neither the primary or grown defect +lists are requested. .It Ic modepage Allows the user to display and optionally edit a SCSI mode page. The mode Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Fri Jun 29 22:28:31 2012 (r237827) +++ stable/9/sbin/camcontrol/camcontrol.c Fri Jun 29 22:33:48 2012 (r237828) @@ -1799,13 +1799,14 @@ readdefects(struct cam_device *device, i union ccb *ccb = NULL; struct scsi_read_defect_data_10 *rdd_cdb; u_int8_t *defect_list = NULL; - u_int32_t dlist_length = 65000; + u_int32_t max_dlist_length = SRDD10_MAX_LENGTH, dlist_length = 0; u_int32_t returned_length = 0; u_int32_t num_returned = 0; u_int8_t returned_format; unsigned int i; int c, error = 0; - int lists_specified = 0; + int lists_specified; + int get_length = 1; while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c){ @@ -1842,20 +1843,33 @@ readdefects(struct cam_device *device, i ccb = cam_getccb(device); /* - * Hopefully 65000 bytes is enough to hold the defect list. If it - * isn't, the disk is probably dead already. We'd have to go with - * 12 byte command (i.e. alloc_length is 32 bits instead of 16) - * to hold them all. + * Eventually we should probably support the 12 byte READ DEFECT + * DATA command. It supports a longer parameter list, which may be + * necessary on newer drives with lots of defects. According to + * the SBC-3 spec, drives are supposed to return an illegal request + * if they have more defect data than will fit in 64K. */ - defect_list = malloc(dlist_length); + defect_list = malloc(max_dlist_length); if (defect_list == NULL) { warnx("can't malloc memory for defect list"); error = 1; goto defect_bailout; } + /* + * We start off asking for just the header to determine how much + * defect data is available. Some Hitachi drives return an error + * if you ask for more data than the drive has. Once we know the + * length, we retry the command with the returned length. + */ + dlist_length = sizeof(struct scsi_read_defect_data_hdr_10); + rdd_cdb =(struct scsi_read_defect_data_10 *)&ccb->csio.cdb_io.cdb_bytes; +retry: + + lists_specified = 0; + /* * cam_getccb() zeros the CCB header only. So we need to zero the * payload portion of the ccb. @@ -1917,6 +1931,51 @@ readdefects(struct cam_device *device, i returned_length = scsi_2btoul(((struct scsi_read_defect_data_hdr_10 *)defect_list)->length); + if (get_length != 0) { + get_length = 0; + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) == + CAM_SCSI_STATUS_ERROR) { + struct scsi_sense_data *sense; + int error_code, sense_key, asc, ascq; + + sense = &ccb->csio.sense_data; + scsi_extract_sense_len(sense, ccb->csio.sense_len - + ccb->csio.sense_resid, &error_code, &sense_key, + &asc, &ascq, /*show_errors*/ 1); + + /* + * If the drive is reporting that it just doesn't + * support the defect list format, go ahead and use + * the length it reported. Otherwise, the length + * may not be valid, so use the maximum. + */ + if ((sense_key == SSD_KEY_RECOVERED_ERROR) + && (asc == 0x1c) && (ascq == 0x00) + && (returned_length > 0)) { + dlist_length = returned_length + + sizeof(struct scsi_read_defect_data_hdr_10); + dlist_length = min(dlist_length, + SRDD10_MAX_LENGTH); + } else + dlist_length = max_dlist_length; + } else if ((ccb->ccb_h.status & CAM_STATUS_MASK) != + CAM_REQ_CMP){ + error = 1; + warnx("Error reading defect header"); + if (arglist & CAM_ARG_VERBOSE) + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + goto defect_bailout; + } else { + dlist_length = returned_length + + sizeof(struct scsi_read_defect_data_hdr_10); + dlist_length = min(dlist_length, SRDD10_MAX_LENGTH); + } + + goto retry; + } + returned_format = ((struct scsi_read_defect_data_hdr_10 *) defect_list)->format; Modified: stable/9/sys/cam/scsi/scsi_da.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.h Fri Jun 29 22:28:31 2012 (r237827) +++ stable/9/sys/cam/scsi/scsi_da.h Fri Jun 29 22:33:48 2012 (r237828) @@ -111,6 +111,7 @@ struct scsi_read_defect_data_10 u_int8_t reserved[4]; u_int8_t alloc_length[2]; +#define SRDD10_MAX_LENGTH 0xffff u_int8_t control; }; From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 00:12:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73AA4106564A; Sat, 30 Jun 2012 00:12:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F6988FC08; Sat, 30 Jun 2012 00:12:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5U0CUTW079152; Sat, 30 Jun 2012 00:12:30 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5U0CUE4079150; Sat, 30 Jun 2012 00:12:30 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206300012.q5U0CUE4079150@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 30 Jun 2012 00:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237829 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 00:12:30 -0000 Author: bz Date: Sat Jun 30 00:12:29 2012 New Revision: 237829 URL: http://svn.freebsd.org/changeset/base/237829 Log: gnn to mentor davidcs. Thanks for helping out. Approved by: core Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Jun 29 22:33:48 2012 (r237828) +++ svnadmin/conf/mentors Sat Jun 30 00:12:29 2012 (r237829) @@ -15,7 +15,7 @@ art avg Co-mentor: marcel bapt des benl philip Co-mentor: simon bgray cognet -davidcs bz +davidcs gnn eadler cperciva eri mlaier Co-mentor: thompsa jceel wkoszek Co-mentor: cognet From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 01:40:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 342EF1065670; Sat, 30 Jun 2012 01:40:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EF408FC0A; Sat, 30 Jun 2012 01:40:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5U1eTfs082618; Sat, 30 Jun 2012 01:40:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5U1eTGI082616; Sat, 30 Jun 2012 01:40:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206300140.q5U1eTGI082616@svn.freebsd.org> From: Adrian Chadd Date: Sat, 30 Jun 2012 01:40: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: r237830 - head/tools/tools/ath/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 01:40:30 -0000 Author: adrian Date: Sat Jun 30 01:40:29 2012 New Revision: 237830 URL: http://svn.freebsd.org/changeset/base/237830 Log: Bump this up - that way the AR9300 and later MACs get covered (for now) by the AR5416 register map. Modified: head/tools/tools/ath/common/dumpregs_5416.c Modified: head/tools/tools/ath/common/dumpregs_5416.c ============================================================================== --- head/tools/tools/ath/common/dumpregs_5416.c Sat Jun 30 00:12:29 2012 (r237829) +++ head/tools/tools/ath/common/dumpregs_5416.c Sat Jun 30 01:40:29 2012 (r237830) @@ -39,7 +39,7 @@ #define N(a) (sizeof(a) / sizeof(a[0])) -#define MAC5416 SREV(13,8), SREV(0xff,0xff) /* XXX */ +#define MAC5416 SREV(13,8), SREV(0xffff,0xffff) /* XXX */ static struct dumpreg ar5416regs[] = { DEFBASIC(AR_CR, "CR"), From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 02:05:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E443106564A; Sat, 30 Jun 2012 02:05:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20B848FC08; Sat, 30 Jun 2012 02:05:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5U259VW083716; Sat, 30 Jun 2012 02:05:09 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5U2594k083713; Sat, 30 Jun 2012 02:05:09 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201206300205.q5U2594k083713@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 30 Jun 2012 02:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237831 - head/sys/dev/cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 02:05:10 -0000 Author: np Date: Sat Jun 30 02:05:09 2012 New Revision: 237831 URL: http://svn.freebsd.org/changeset/base/237831 Log: - Assign (don't OR) the CSUM_XXX bits to csum_flags in the rx checksum code. - Fix TSO/TSO4 mixup. - Add IFCAP_LINKSTATE to the available/enabled capabilities. Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Jun 30 01:40:29 2012 (r237830) +++ head/sys/dev/cxgbe/t4_main.c Sat Jun 30 02:05:09 2012 (r237831) @@ -823,7 +823,7 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ - IFCAP_VLAN_HWTSO | IFCAP_HWCSUM_IPV6) + IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6) #define T4_CAP_ENABLE (T4_CAP) static int @@ -1028,11 +1028,11 @@ fail: ifp->if_capenable ^= IFCAP_TXCSUM; ifp->if_hwassist ^= (CSUM_TCP | CSUM_UDP | CSUM_IP); - if (IFCAP_TSO & ifp->if_capenable && + if (IFCAP_TSO4 & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { ifp->if_capenable &= ~IFCAP_TSO4; if_printf(ifp, - "tso disabled due to -txcsum.\n"); + "tso4 disabled due to -txcsum.\n"); } } if (mask & IFCAP_TXCSUM_IPV6) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Jun 30 01:40:29 2012 (r237830) +++ head/sys/dev/cxgbe/t4_sge.c Sat Jun 30 02:05:09 2012 (r237831) @@ -1059,12 +1059,12 @@ t4_eth_rx(struct sge_iq *iq, const struc if (cpl->csum_calc && !cpl->err_vec) { if (ifp->if_capenable & IFCAP_RXCSUM && cpl->l2info & htobe32(F_RXF_IP)) { - m0->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | + m0->m_pkthdr.csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); rxq->rxcsum++; } else if (ifp->if_capenable & IFCAP_RXCSUM_IPV6 && cpl->l2info & htobe32(F_RXF_IP6)) { - m0->m_pkthdr.csum_flags |= (CSUM_DATA_VALID_IPV6 | + m0->m_pkthdr.csum_flags = (CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR); rxq->rxcsum++; } From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 02:11:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A098F1065670; Sat, 30 Jun 2012 02:11:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AC178FC12; Sat, 30 Jun 2012 02:11:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5U2Bsaq084017; Sat, 30 Jun 2012 02:11:54 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5U2BsNW084013; Sat, 30 Jun 2012 02:11:54 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201206300211.q5U2BsNW084013@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 30 Jun 2012 02:11: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: r237832 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 02:11:54 -0000 Author: np Date: Sat Jun 30 02:11:53 2012 New Revision: 237832 URL: http://svn.freebsd.org/changeset/base/237832 Log: cxgb(4): IPv6 rx/tx hw checksum, IPv6 TSO and LRO too. (Some parts already worked, this makes it complete). Modified: head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_sge.c Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Sat Jun 30 02:05:09 2012 (r237831) +++ head/sys/dev/cxgb/cxgb_adapter.h Sat Jun 30 02:11:53 2012 (r237832) @@ -265,15 +265,6 @@ struct sge_txq { struct sg_ent txq_sgl[TX_MAX_SEGS / 2 + 1]; }; - -enum { - SGE_PSTAT_TSO, /* # of TSO requests */ - SGE_PSTAT_RX_CSUM_GOOD, /* # of successful RX csum offloads */ - SGE_PSTAT_TX_CSUM, /* # of TX checksum offloads */ - SGE_PSTAT_VLANEX, /* # of VLAN tag extractions */ - SGE_PSTAT_VLANINS, /* # of VLAN tag insertions */ -}; - #define SGE_PSTAT_MAX (SGE_PSTAT_VLANINS+1) #define QS_EXITING 0x1 @@ -288,7 +279,6 @@ struct sge_qset { struct lro_state lro; struct sge_txq txq[SGE_TXQ_PER_SET]; uint32_t txq_stopped; /* which Tx queues are stopped */ - uint64_t port_stats[SGE_PSTAT_MAX]; struct port_info *port; struct adapter *adap; int idx; /* qset # */ @@ -538,7 +528,7 @@ int t3_sge_reset_adapter(adapter_t *); int t3_sge_init_port(struct port_info *); void t3_free_tx_desc(struct sge_qset *qs, int n, int qid); -void t3_rx_eth(struct adapter *adap, struct sge_rspq *rq, struct mbuf *m, int ethpad); +void t3_rx_eth(struct adapter *adap, struct mbuf *m, int ethpad); void t3_add_attach_sysctls(adapter_t *sc); void t3_add_configured_sysctls(adapter_t *sc); Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Sat Jun 30 02:05:09 2012 (r237831) +++ head/sys/dev/cxgb/cxgb_main.c Sat Jun 30 02:11:53 2012 (r237832) @@ -986,7 +986,7 @@ cxgb_makedev(struct port_info *pi) #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ - IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) + IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6) #define CXGB_CAP_ENABLE CXGB_CAP static int @@ -1027,7 +1027,8 @@ cxgb_port_attach(device_t dev) ifp->if_capabilities |= IFCAP_TOE4; #endif ifp->if_capenable = CXGB_CAP_ENABLE; - ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO; + ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | + CSUM_UDP_IPV6 | CSUM_TCP_IPV6; /* * Disable TSO on 4-port - it isn't supported by the firmware. @@ -1950,31 +1951,52 @@ fail: ifp->if_capenable ^= IFCAP_TXCSUM; ifp->if_hwassist ^= (CSUM_TCP | CSUM_UDP | CSUM_IP); - if (IFCAP_TSO & ifp->if_capenable && + if (IFCAP_TSO4 & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { - ifp->if_capenable &= ~IFCAP_TSO; - ifp->if_hwassist &= ~CSUM_TSO; + ifp->if_capenable &= ~IFCAP_TSO4; if_printf(ifp, - "tso disabled due to -txcsum.\n"); + "tso4 disabled due to -txcsum.\n"); + } + } + if (mask & IFCAP_TXCSUM_IPV6) { + ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; + ifp->if_hwassist ^= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6); + + if (IFCAP_TSO6 & ifp->if_capenable && + !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + ifp->if_capenable &= ~IFCAP_TSO6; + if_printf(ifp, + "tso6 disabled due to -txcsum6.\n"); } } if (mask & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; - if (mask & IFCAP_TSO) { - ifp->if_capenable ^= IFCAP_TSO; + if (mask & IFCAP_RXCSUM_IPV6) + ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; - if (IFCAP_TSO & ifp->if_capenable) { - if (IFCAP_TXCSUM & ifp->if_capenable) - ifp->if_hwassist |= CSUM_TSO; - else { - ifp->if_capenable &= ~IFCAP_TSO; - ifp->if_hwassist &= ~CSUM_TSO; - if_printf(ifp, - "enable txcsum first.\n"); - error = EAGAIN; - } - } else - ifp->if_hwassist &= ~CSUM_TSO; + /* + * Note that we leave CSUM_TSO alone (it is always set). The + * kernel takes both IFCAP_TSOx and CSUM_TSO into account before + * sending a TSO request our way, so it's sufficient to toggle + * IFCAP_TSOx only. + */ + if (mask & IFCAP_TSO4) { + if (!(IFCAP_TSO4 & ifp->if_capenable) && + !(IFCAP_TXCSUM & ifp->if_capenable)) { + if_printf(ifp, "enable txcsum first.\n"); + error = EAGAIN; + goto fail; + } + ifp->if_capenable ^= IFCAP_TSO4; + } + if (mask & IFCAP_TSO6) { + if (!(IFCAP_TSO6 & ifp->if_capenable) && + !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + if_printf(ifp, "enable txcsum6 first.\n"); + error = EAGAIN; + goto fail; + } + ifp->if_capenable ^= IFCAP_TSO6; } if (mask & IFCAP_LRO) { ifp->if_capenable ^= IFCAP_LRO; Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Sat Jun 30 02:05:09 2012 (r237831) +++ head/sys/dev/cxgb/cxgb_sge.c Sat Jun 30 02:11:53 2012 (r237832) @@ -1432,7 +1432,8 @@ t3_encap(struct sge_qset *qs, struct mbu cntrl |= V_TXPKT_OPCODE(CPL_TX_PKT); if (__predict_false(!(cflags & CSUM_IP))) cntrl |= F_TXPKT_IPCSUM_DIS; - if (__predict_false(!(cflags & (CSUM_TCP | CSUM_UDP)))) + if (__predict_false(!(cflags & (CSUM_TCP | CSUM_UDP | + CSUM_UDP_IPV6 | CSUM_TCP_IPV6)))) cntrl |= F_TXPKT_L4CSUM_DIS; hflit[0] = htonl(cntrl); @@ -1547,7 +1548,8 @@ t3_encap(struct sge_qset *qs, struct mbu cntrl |= V_TXPKT_OPCODE(CPL_TX_PKT); if (__predict_false(!(m0->m_pkthdr.csum_flags & CSUM_IP))) cntrl |= F_TXPKT_IPCSUM_DIS; - if (__predict_false(!(m0->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)))) + if (__predict_false(!(m0->m_pkthdr.csum_flags & (CSUM_TCP | + CSUM_UDP | CSUM_UDP_IPV6 | CSUM_TCP_IPV6)))) cntrl |= F_TXPKT_L4CSUM_DIS; cpl->cntrl = htonl(cntrl); cpl->len = htonl(mlen | 0x80000000); @@ -2620,20 +2622,12 @@ err: * will also be taken into account here. */ void -t3_rx_eth(struct adapter *adap, struct sge_rspq *rq, struct mbuf *m, int ethpad) +t3_rx_eth(struct adapter *adap, struct mbuf *m, int ethpad) { struct cpl_rx_pkt *cpl = (struct cpl_rx_pkt *)(mtod(m, uint8_t *) + ethpad); struct port_info *pi = &adap->port[adap->rxpkt_map[cpl->iff]]; struct ifnet *ifp = pi->ifp; - if ((ifp->if_capenable & IFCAP_RXCSUM) && !cpl->fragment && - cpl->csum_valid && cpl->csum == 0xffff) { - m->m_pkthdr.csum_flags = (CSUM_IP_CHECKED|CSUM_IP_VALID); - rspq_to_qset(rq)->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++; - m->m_pkthdr.csum_flags = (CSUM_IP_CHECKED|CSUM_IP_VALID|CSUM_DATA_VALID|CSUM_PSEUDO_HDR); - m->m_pkthdr.csum_data = 0xffff; - } - if (cpl->vlan_valid) { m->m_pkthdr.ether_vtag = ntohs(cpl->vlan); m->m_flags |= M_VLANTAG; @@ -2647,6 +2641,30 @@ t3_rx_eth(struct adapter *adap, struct s m->m_pkthdr.len -= (sizeof(*cpl) + ethpad); m->m_len -= (sizeof(*cpl) + ethpad); m->m_data += (sizeof(*cpl) + ethpad); + + if (!cpl->fragment && cpl->csum_valid && cpl->csum == 0xffff) { + struct ether_header *eh = mtod(m, void *); + uint16_t eh_type; + + if (eh->ether_type == htons(ETHERTYPE_VLAN)) { + struct ether_vlan_header *evh = mtod(m, void *); + + eh_type = evh->evl_proto; + } else + eh_type = eh->ether_type; + + if (ifp->if_capenable & IFCAP_RXCSUM && + eh_type == htons(ETHERTYPE_IP)) { + m->m_pkthdr.csum_flags = (CSUM_IP_CHECKED | + CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + m->m_pkthdr.csum_data = 0xffff; + } else if (ifp->if_capenable & IFCAP_RXCSUM_IPV6 && + eh_type == htons(ETHERTYPE_IPV6)) { + m->m_pkthdr.csum_flags = (CSUM_DATA_VALID_IPV6 | + CSUM_PSEUDO_HDR); + m->m_pkthdr.csum_data = 0xffff; + } + } } /** @@ -2913,7 +2931,7 @@ process_responses(adapter_t *adap, struc } else if (eth && eop) { struct mbuf *m = mh->mh_head; - t3_rx_eth(adap, rspq, m, ethpad); + t3_rx_eth(adap, m, ethpad); /* * The T304 sends incoming packets on any qset. If LRO From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 04:52:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45C9C106566C; Sat, 30 Jun 2012 04:52:02 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 021828FC08; Sat, 30 Jun 2012 04:52:01 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so5898387pbb.13 for ; Fri, 29 Jun 2012 21:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=XsUZ/ez2b6NuISbYDC1d4VU6K4Drel35HjmVEjEH39I=; b=rfNE2qr7Tlw5mF66F4ORR3aqrC3sQpMYq4vfx16fCX2MVHcwGIydM91jdp2B3DiSsn lv6FWafPX5COrsKMxHVVM7ozk9aZbuIEpOetA28QJjkk+dANy9IWczppwkCE2PtGGDaJ /DtZnK/35lCsbPJpmH1Grnn0FW1wSMWV1EHASnlVN5CgwIu5Ez8+lYBJMHJxFxGVrgK5 r4KjtWlUeLOUCTFVeS0C84gKob4G6v7HmMi4tongOQqxW42cj5+XhZPkuYPVwuQXYOSS Pbq2xyAudOo9E3TmawbRSae/bmsLo1iUh/YRb3JZy31DDVsvM70LFjeW/xMUNggfFyST fPLw== Received: by 10.68.231.40 with SMTP id td8mr12636540pbc.150.1341031915474; Fri, 29 Jun 2012 21:51:55 -0700 (PDT) Received: from [10.70.116.93] (mobile-166-147-093-178.mycingular.net. [166.147.93.178]) by mx.google.com with ESMTPS id tq4sm7358184pbc.11.2012.06.29.21.51.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jun 2012 21:51:54 -0700 (PDT) References: <201206292015.q5TKF0bw068017@svn.freebsd.org> In-Reply-To: <201206292015.q5TKF0bw068017@svn.freebsd.org> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Message-Id: <014C4331-E53B-41AE-A5DA-76A4C3EA8083@gmail.com> X-Mailer: iPhone Mail (9B206) From: Garrett Cooper Date: Fri, 29 Jun 2012 21:51:49 -0700 To: Brooks Davis Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r237820 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 04:52:02 -0000 Sent from my iPhone On Jun 29, 2012, at 1:15 PM, Brooks Davis wrote: > Author: brooks > Date: Fri Jun 29 20:15:00 2012 > New Revision: 237820 > URL: http://svn.freebsd.org/changeset/base/237820 > > Log: > MFP4 #212266 > > Fix compile on MIPS64. > > Sponsored by: DARPA, AFRL This commit appears to have broken arm (ETHERNUT5). Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 06:10:33 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1E3E106564A; Sat, 30 Jun 2012 06:10:33 +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 67F5B8FC0C; Sat, 30 Jun 2012 06:10:33 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q5U6AT0c006515 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 30 Jun 2012 16:10:31 +1000 Date: Sat, 30 Jun 2012 16:10:29 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Brooks Davis In-Reply-To: <201206292015.q5TKF0bw068017@svn.freebsd.org> Message-ID: <20120630154607.P852@besplex.bde.org> References: <201206292015.q5TKF0bw068017@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: r237820 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 06:10:34 -0000 On Fri, 29 Jun 2012, Brooks Davis wrote: > Log: > MFP4 #212266 > > Fix compile on MIPS64. > > Sponsored by: DARPA, AFRL > > Modified: > head/sys/geom/geom_map.c > > Modified: head/sys/geom/geom_map.c > ============================================================================== > --- head/sys/geom/geom_map.c Fri Jun 29 19:51:06 2012 (r237819) > +++ head/sys/geom/geom_map.c Fri Jun 29 20:15:00 2012 (r237820) > @@ -119,13 +119,13 @@ g_map_dumpconf(struct sbuf *sb, const ch > g_slice_dumpconf(sb, indent, gp, cp, pp); > if (pp != NULL) { > if (indent == NULL) { > - sbuf_printf(sb, " entry %lld", sc->entry[pp->index]); > - sbuf_printf(sb, " dsize %lld", sc->dsize[pp->index]); > + sbuf_printf(sb, " entry %jd", (intmax_t)sc->entry[pp->index]); > + sbuf_printf(sb, " dsize %jd", (intmax_t)sc->dsize[pp->index]); Style bugs (lines too long). > @@ -153,8 +153,8 @@ find_marker(struct g_consumer *cp, const > return (1); > > if (bootverbose) { > - printf("MAP: search key \"%s\" from 0x%llx, step 0x%llx\n", > - search_key, search_start, search_step); > + printf("MAP: search key \"%s\" from 0x%jx, step 0x%jx\n", > + search_key, (intmax_t)search_start, (intmax_t)search_step); > } Still has sign mismatches. %jx takes a uintmax_t arg, but an intmax_t arg is passed. The variables start as signed (off_t). Printing signed values using hex formats is dubious, but if it is wanted then the conversion should be done when the parameter is passed instead of depending on printf() doing something reasonable. > > /* error if search_key is empty */ > @@ -321,9 +321,10 @@ g_map_parse_part(struct g_class *mp, str > } > > if (bootverbose) { > - printf("MAP: %llxx%llx, data=%llxx%llx " > + printf("MAP: %lxx%lx, data=%lxx%lx " > "\"/dev/map/%s\"\n", > - start, size, offset, dsize, name); > + (intmax_t)start, (intmax_t)size, (intmax_t)offset, > + (intmax_t)dsize, name); Still has fatal type mimatches which are larger than before: - before: the format said but the default promotion of off_t was passed. Everything was 64 bits in practice, so there was no problem at runtime except possibly with the sign mismatch, but the static format checker complained - after: the format says u_long, but intmax_t is passed. Now the sizes are different on arches with 32 bit u_long, and the result is garbage. Still has sign mismatches, as above. As well as printf format errors, this still has the following format-printf errors (formatting style bugs): - source level: the string is still obfuscated using the C90 string concatenation misfeature to split it across multiple lines. The string is not even long enough to not fit on 1 line. - output level: %lxx%lx is still a weird format. It consists of 2 hex numbers without any 0x prefixes to indicate that they are in hex. But there is an "x" with no spaces between the numbers. This apparently means multiplication, but it looks like part of a 0x prefix. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 07:23:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3526106566C; Sat, 30 Jun 2012 07:23:22 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9496F8FC19; Sat, 30 Jun 2012 07:23:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5U7NM1w096831; Sat, 30 Jun 2012 07:23:22 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5U7NM5u096830; Sat, 30 Jun 2012 07:23:22 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206300723.q5U7NM5u096830@svn.freebsd.org> From: Martin Matuska Date: Sat, 30 Jun 2012 07:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237833 - in vendor/illumos: . dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 07:23:22 -0000 Author: mm Date: Sat Jun 30 07:23:22 2012 New Revision: 237833 URL: http://svn.freebsd.org/changeset/base/237833 Log: Copy opensolaris/dist to illumos/dist in vendor branch Added: vendor/illumos/ vendor/illumos/dist/ - copied from r237832, vendor/opensolaris/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 07:46:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3CD841065673; Sat, 30 Jun 2012 07:46:40 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22FCE8FC0C; Sat, 30 Jun 2012 07:46:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5U7kdcr097807; Sat, 30 Jun 2012 07:46:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5U7kdEW097787; Sat, 30 Jun 2012 07:46:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206300746.q5U7kdEW097787@svn.freebsd.org> From: Martin Matuska Date: Sat, 30 Jun 2012 07:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237834 - in vendor/illumos/dist: cmd/dtrace/test/cmd/jdtrace cmd/dtrace/test/cmd/scripts cmd/dtrace/test/tst/common/aggs cmd/dtrace/test/tst/common/buffering cmd/dtrace/test/tst/common... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 07:46:40 -0000 Author: mm Date: Sat Jun 30 07:46:38 2012 New Revision: 237834 URL: http://svn.freebsd.org/changeset/base/237834 Log: Update illumos/dist to revision 13742:b6bbdd77139c ZFS bits will follow in a separate commit Added: vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtfailures.ksh (contents, props changed) vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.tolower.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.toupper.d vendor/illumos/dist/cmd/dtrace/test/tst/common/include/ vendor/illumos/dist/cmd/dtrace/test/tst/common/include/tst.includefirst.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/ vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.bases.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.basic.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.normal.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.range.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.range.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.steps.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/print/ vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.array.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.array.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.bitfield.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.bitfield.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.primitive.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.primitive.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.struct.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.struct.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.noprivdrop.ksh (contents, props changed) vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.noprivrestrict.ksh (contents, props changed) vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.tick.ksh (contents, props changed) vendor/illumos/dist/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_TRACE_DYN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh vendor/illumos/dist/lib/libdtrace/common/dt_print.c Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/JDTrace.java vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/exception.lst vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/jdtrace.c vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.subr.d vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize1.d vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize2.d vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/java_api/src/TestBean.java vendor/illumos/dist/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.include.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.header.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.include.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.static.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.user.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh vendor/illumos/dist/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh vendor/illumos/dist/lib/libctf/common/ctf_lib.c vendor/illumos/dist/lib/libdtrace/common/dt_aggregate.c vendor/illumos/dist/lib/libdtrace/common/dt_cc.c vendor/illumos/dist/lib/libdtrace/common/dt_consume.c vendor/illumos/dist/lib/libdtrace/common/dt_decl.c vendor/illumos/dist/lib/libdtrace/common/dt_dof.c vendor/illumos/dist/lib/libdtrace/common/dt_errtags.h vendor/illumos/dist/lib/libdtrace/common/dt_ident.c vendor/illumos/dist/lib/libdtrace/common/dt_impl.h vendor/illumos/dist/lib/libdtrace/common/dt_map.c vendor/illumos/dist/lib/libdtrace/common/dt_open.c vendor/illumos/dist/lib/libdtrace/common/dt_options.c vendor/illumos/dist/lib/libdtrace/common/dt_parser.c vendor/illumos/dist/lib/libdtrace/common/dt_pragma.c vendor/illumos/dist/lib/libdtrace/common/dt_printf.c vendor/illumos/dist/lib/libdtrace/common/dt_program.c vendor/illumos/dist/lib/libdtrace/common/dt_string.c vendor/illumos/dist/lib/libdtrace/common/dt_string.h vendor/illumos/dist/lib/libdtrace/common/dt_subr.c vendor/illumos/dist/lib/libdtrace/common/dtrace.h vendor/illumos/dist/lib/libdtrace/i386/regs.d.in vendor/illumos/dist/tools/ctf/cvt/dwarf.c Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/JDTrace.java ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/JDTrace.java Sat Jun 30 07:23:22 2012 (r237833) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/JDTrace.java Sat Jun 30 07:46:38 2012 (r237834) @@ -23,7 +23,6 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * - * ident "%Z%%M% %I% %E% SMI" */ import org.opensolaris.os.dtrace.*; import java.io.*; @@ -303,6 +302,7 @@ public class JDTrace { Distribution.Bucket bucket; int b1 = 0; // first displayed bucket int b2 = d.size() - 1; // last displayed bucket + for (; (b1 <= b2) && (d.get(b1).getFrequency() == 0); ++b1); // If possible, get one bucket before the first non-zero // bucket and one bucket after the last. @@ -337,9 +337,14 @@ public class JDTrace { v = bucket.getFrequency(); b = bucket.getMin(); - if (d instanceof LinearDistribution) { + if ((d instanceof LinearDistribution) || + (d instanceof LogLinearDistribution)) { if (b == Long.MIN_VALUE) { - String lt = "< " + ((LinearDistribution)d).getBase(); + String lt; + if (d instanceof LinearDistribution) + lt = "< " + ((LinearDistribution)d).getBase(); + else + lt = "< " + ((LogLinearDistribution)d).getBase(); out.printf("%16s ", lt); } else if (bucket.getMax() == Long.MAX_VALUE) { String ge = ">= " + b; Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/exception.lst ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/exception.lst Sat Jun 30 07:23:22 2012 (r237833) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/exception.lst Sat Jun 30 07:46:38 2012 (r237834) @@ -23,7 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" # Exception list: names tests that are bypassed when running in Java # mode (relative to /opt/SUNWdtrt/tst) @@ -52,14 +51,17 @@ common/usdt/tst.enabled.ksh common/usdt/tst.enabled2.ksh common/usdt/tst.entryreturn.ksh common/usdt/tst.fork.ksh -common/usdt/tst.header.ksh common/usdt/tst.guess32.ksh common/usdt/tst.guess64.ksh +common/usdt/tst.header.ksh common/usdt/tst.linkpriv.ksh common/usdt/tst.linkunpriv.ksh common/usdt/tst.multiple.ksh common/usdt/tst.nodtrace.ksh +common/usdt/tst.noreap.ksh +common/usdt/tst.noreapring.ksh common/usdt/tst.onlyenabled.ksh +common/usdt/tst.reap.ksh common/usdt/tst.reeval.ksh common/usdt/tst.static.ksh common/usdt/tst.static2.ksh Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/jdtrace.c ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/jdtrace.c Sat Jun 30 07:23:22 2012 (r237833) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/jdtrace.c Sat Jun 30 07:46:38 2012 (r237834) @@ -22,25 +22,27 @@ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2011, Richard Lowe */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include +#include #include int main(int argc, char **argv) { - int i, ac, has64; + int i, ac; char **av, **p; + char isaname[16]; ac = argc + 3; av = p = alloca(sizeof (char *) * ac); - *p++ = "java"; + *p++ = "/usr/java/bin/java"; *p++ = "-jar"; *p++ = "/opt/SUNWdtrt/lib/java/jdtrace.jar"; @@ -52,9 +54,9 @@ main(int argc, char **argv) } p[i] = NULL; - (void) execvp(av[0], av); - - perror("exec failed"); + if (sysinfo(SI_ARCHITECTURE_64, isaname, sizeof (isaname)) != -1) + asprintf(av, "/usr/java/bin/%s/java", isaname); - return (0); + (void) execv(av[0], av); + err(1, "exec failed"); } Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl Sat Jun 30 07:23:22 2012 (r237833) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl Sat Jun 30 07:46:38 2012 (r237834) @@ -25,6 +25,9 @@ # Use is subject to license terms. # +# +# Copyright (c) 2011, Joyent, Inc. All rights reserved. +# require 5.8.4; use File::Find; @@ -35,8 +38,8 @@ use Cwd 'abs_path'; $PNAME = $0; $PNAME =~ s:.*/::; -$OPTSTR = 'abd:fghi:jlnqsx:'; -$USAGE = "Usage: $PNAME [-abfghjlnqs] [-d dir] [-i isa] " +$OPTSTR = 'abd:fFghi:jlnqsx:'; +$USAGE = "Usage: $PNAME [-abfFghjlnqs] [-d dir] [-i isa] " . "[-x opt[=arg]] [file | dir ...]\n"; ($MACH = `uname -p`) =~ s/\W*\n//; ($PLATFORM = `uname -i`) =~ s/\W*\n//; @@ -69,6 +72,20 @@ sub dirname { return $i == -1 ? '.' : $i == 0 ? '/' : $s; } +sub inpath +{ + my ($exec) = (@_); + my @path = File::Spec->path(); + + for my $dir (@path) { + if (-x $dir . "/" . $exec) { + return 1; + } + } + + return 0; +} + sub usage { print $USAGE; @@ -77,6 +94,7 @@ sub usage print "\t -d specify directory for test results files and cores\n"; print "\t -g enable libumem debugging when running tests\n"; print "\t -f force bypassed tests to run\n"; + print "\t -F force tests to be run, even if missing dependencies\n"; print "\t -h display verbose usage message\n"; print "\t -i specify ISA to test instead of isaexec(3C) default\n"; print "\t -j execute test suite using jdtrace (Java API) only\n"; @@ -240,8 +258,8 @@ sub run_tests { my($failed) = $errs; my($total) = 0; - die "$PNAME: $dtrace not found\n" unless (-x "$dtrace"); - logmsg($dtrace . "\n"); + die "$PNAME: $dtrace not found; aborting\n" unless (-x "$dtrace"); + logmsg("executing tests using $dtrace ...\n"); load_exceptions($exceptions_path); @@ -546,9 +564,20 @@ $dt_bin = '/opt/SUNWdtrt/bin'; $defdir = -d $dt_tst ? $dt_tst : '.'; $bindir = -d $dt_bin ? $dt_bin : '.'; +if (!$opt_F) { + my @dependencies = ("gcc", "make", "java", "perl"); + + for my $dep (@dependencies) { + if (!inpath($dep)) { + die "$PNAME: '$dep' not found (use -F to force run)\n"; + } + } +} + find(\&wanted, "$defdir/common") if (scalar(@ARGV) == 0); find(\&wanted, "$defdir/$MACH") if (scalar(@ARGV) == 0); find(\&wanted, "$defdir/$PLATFORM") if (scalar(@ARGV) == 0); + die $USAGE if (scalar(@files) == 0); $dtrace_path = '/usr/sbin/dtrace'; @@ -562,7 +591,7 @@ if ($opt_j || $opt_n || $opt_i) { push(@dtrace_cmds, $jdtrace_path) if ($opt_j); push(@dtrace_cmds, "/usr/sbin/$opt_i/dtrace") if ($opt_i); } else { - @dtrace_cmds = ($dtrace_path, $jdtrace_path); + @dtrace_cmds = ($dtrace_path); } if ($opt_d) { @@ -589,12 +618,6 @@ if ($opt_g) { $ENV{'LD_PRELOAD'} = 'libumem.so'; } -# -# Ensure that $PATH contains a cc(1) so that we can execute the -# test programs that require compilation of C code. -# -$ENV{'PATH'} = $ENV{'PATH'} . ':/ws/onnv-tools/SUNWspro/SS11/bin'; - if ($opt_b) { logmsg("badioctl'ing ... "); Added: vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtfailures.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtfailures.ksh Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,42 @@ +#!/usr/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2011, Joyent, Inc. All rights reserved. +# + +let failure=0 + +printf "%-3s %-10s %-31s %s\n" "#" "KIND" "TEST" "DETAILS" + +while [[ -d failure.$failure ]]; do + dir=failure.$failure + tst=`cat $dir/README | head -1 | nawk '{ print $2 }'` + kind=`basename $(dirname $tst)` + name=`basename $tst` + cols=$(expr `tput cols` - 47) + details=`tail -1 $dir/*.err | cut -c1-$cols` + printf "%-3d %-10s %-31s " $failure $kind $name + echo $details + let failure=failure+1 +done + Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.subr.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.subr.d Sat Jun 30 07:23:22 2012 (r237833) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.subr.d Sat Jun 30 07:46:38 2012 (r237834) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #define INTFUNC(x) \ @@ -98,6 +96,8 @@ INTFUNC(ntohll(0x1234567890abcdefL)) STRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof (ipaddr_t)))) STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t)))) STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t)))) +STRFUNC(toupper("foo")) +STRFUNC(tolower("BAR")) BEGIN /subr == DIF_SUBR_MAX + 1/ Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize1.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize1.d Sat Jun 30 07:23:22 2012 (r237833) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize1.d Sat Jun 30 07:46:38 2012 (r237834) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: * Checks that setting "bufresize" to "auto" will cause buffer @@ -34,14 +32,8 @@ * SECTION: Buffers and Buffering/Buffer Resizing Policy; * Options and Tunables/bufsize; * Options and Tunables/bufresize - * - * NOTES: - * We use the undocumented "preallocate" option to make sure dtrace(1M) - * has enough space in its heap to allocate a buffer as large as the - * kernel's trace buffer. */ -#pragma D option preallocate=100t #pragma D option bufresize=auto #pragma D option bufsize=100t Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize2.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize2.d Sat Jun 30 07:23:22 2012 (r237833) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize2.d Sat Jun 30 07:46:38 2012 (r237834) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: * Checks that setting "bufresize" to "auto" will cause buffer @@ -34,14 +32,8 @@ * SECTION: Buffers and Buffering/Buffer Resizing Policy; * Options and Tunables/aggsize; * Options and Tunables/bufresize - * - * NOTES: - * We use the undocumented "preallocate" option to make sure dtrace(1M) - * has enough space in its heap to allocate a buffer as large as the - * kernel's trace buffer. */ -#pragma D option preallocate=100t #pragma D option bufresize=auto #pragma D option aggsize=100t Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(tolower(2152006)); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(toupper(timestamp)); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(tolower()); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(tolower("dory", "eel", "roughy")); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(toupper()); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(tolower("haino", "tylo")); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,80 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet + +int64_t val[int]; + +BEGIN +{ + base = -2; + i = 0; + val[i++] = -10; + val[i++] = -1; + val[i++] = 0; + val[i++] = 10; + val[i++] = 100; + val[i++] = 1000; + val[i++] = (1LL << 62); + maxval = i; + i = 0; +} + +tick-1ms +/i < maxval/ +{ + printf("base %2d of %20d: ", base, val[i]); +} + +tick-1ms +/i < maxval/ +{ + printf(" %s\n", lltostr(val[i], base)); +} + +ERROR +{ + printf(" \n"); +} + +tick-1ms +/i < maxval/ +{ + i++; +} + +tick-1ms +/i == maxval/ +{ + i = 0; + base++; +} + +tick-1ms +/base > 40/ +{ + exit(0); +} + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,302 @@ +base -2 of -10: +base -2 of -1: +base -2 of 0: +base -2 of 10: +base -2 of 100: +base -2 of 1000: +base -2 of 4611686018427387904: +base -1 of -10: +base -1 of -1: +base -1 of 0: +base -1 of 10: +base -1 of 100: +base -1 of 1000: +base -1 of 4611686018427387904: +base 0 of -10: +base 0 of -1: +base 0 of 0: +base 0 of 10: +base 0 of 100: +base 0 of 1000: +base 0 of 4611686018427387904: +base 1 of -10: +base 1 of -1: +base 1 of 0: +base 1 of 10: +base 1 of 100: +base 1 of 1000: +base 1 of 4611686018427387904: +base 2 of -10: 1111111111111111111111111111111111111111111111111111111111110110 +base 2 of -1: 1111111111111111111111111111111111111111111111111111111111111111 +base 2 of 0: 0 +base 2 of 10: 1010 +base 2 of 100: 1100100 +base 2 of 1000: 1111101000 +base 2 of 4611686018427387904: 100000000000000000000000000000000000000000000000000000000000000 +base 3 of -10: 11112220022122120101211020120210210211120 +base 3 of -1: 11112220022122120101211020120210210211220 +base 3 of 0: 0 +base 3 of 10: 101 +base 3 of 100: 10201 +base 3 of 1000: 1101001 +base 3 of 4611686018427387904: 1010201120122220002201001122110012110111 +base 4 of -10: 33333333333333333333333333333312 +base 4 of -1: 33333333333333333333333333333333 +base 4 of 0: 0 +base 4 of 10: 22 +base 4 of 100: 1210 +base 4 of 1000: 33220 +base 4 of 4611686018427387904: 10000000000000000000000000000000 +base 5 of -10: 2214220303114400424121122411 +base 5 of -1: 2214220303114400424121122430 +base 5 of 0: 0 +base 5 of 10: 20 +base 5 of 100: 400 +base 5 of 1000: 13000 +base 5 of 4611686018427387904: 302141200402211214402403104 +base 6 of -10: 3520522010102100444244410 +base 6 of -1: 3520522010102100444244423 +base 6 of 0: 0 +base 6 of 10: 14 +base 6 of 100: 244 +base 6 of 1000: 4344 +base 6 of 4611686018427387904: 550120301313313111041104 +base 7 of -10: 45012021522523134134556 +base 7 of -1: 45012021522523134134601 +base 7 of 0: 0 +base 7 of 10: 13 +base 7 of 100: 202 +base 7 of 1000: 2626 +base 7 of 4611686018427387904: 11154003640456024361134 +base 8 of -10: 01777777777777777777766 +base 8 of -1: 01777777777777777777777 +base 8 of 0: 0 +base 8 of 10: 012 +base 8 of 100: 0144 +base 8 of 1000: 01750 +base 8 of 4611686018427387904: 0400000000000000000000 +base 9 of -10: 145808576354216723746 +base 9 of -1: 145808576354216723756 +base 9 of 0: 0 +base 9 of 10: 11 +base 9 of 100: 121 +base 9 of 1000: 1331 +base 9 of 4611686018427387904: 33646586081048405414 +base 10 of -10: -10 +base 10 of -1: -1 +base 10 of 0: 0 +base 10 of 10: 10 +base 10 of 100: 100 +base 10 of 1000: 1000 +base 10 of 4611686018427387904: 4611686018427387904 +base 11 of -10: 335500516a429071276 +base 11 of -1: 335500516a429071284 +base 11 of 0: 0 +base 11 of 10: a +base 11 of 100: 91 +base 11 of 1000: 82a +base 11 of 4611686018427387904: 9140013181078458a4 +base 12 of -10: 839365134a2a240706 +base 12 of -1: 839365134a2a240713 +base 12 of 0: 0 +base 12 of 10: a +base 12 of 100: 84 +base 12 of 1000: 6b4 +base 12 of 4611686018427387904: 20b3a733a268670194 +base 13 of -10: 219505a9511a867b66 +base 13 of -1: 219505a9511a867b72 +base 13 of 0: 0 +base 13 of 10: a +base 13 of 100: 79 +base 13 of 1000: 5bc +base 13 of 4611686018427387904: 6c1349246a2881c84 +base 14 of -10: 8681049adb03db166 +base 14 of -1: 8681049adb03db171 +base 14 of 0: 0 +base 14 of 10: a +base 14 of 100: 72 +base 14 of 1000: 516 +base 14 of 4611686018427387904: 219038263637dd3c4 +base 15 of -10: 2c1d56b648c6cd106 +base 15 of -1: 2c1d56b648c6cd110 +base 15 of 0: 0 +base 15 of 10: a +base 15 of 100: 6a +base 15 of 1000: 46a +base 15 of 4611686018427387904: a7e8ce189a933404 +base 16 of -10: 0xfffffffffffffff6 +base 16 of -1: 0xffffffffffffffff +base 16 of 0: 0x0 +base 16 of 10: 0xa +base 16 of 100: 0x64 +base 16 of 1000: 0x3e8 +base 16 of 4611686018427387904: 0x4000000000000000 +base 17 of -10: 67979g60f5428008 +base 17 of -1: 67979g60f5428010 +base 17 of 0: 0 +base 17 of 10: a +base 17 of 100: 5f +base 17 of 1000: 37e +base 17 of 4611686018427387904: 1a6a6ca03e10a88d +base 18 of -10: 2d3fgb0b9cg4bd26 +base 18 of -1: 2d3fgb0b9cg4bd2f +base 18 of 0: 0 +base 18 of 10: a +base 18 of 100: 5a +base 18 of 1000: 31a +base 18 of 4611686018427387904: c588bdbfgd12ge4 +base 19 of -10: 141c8786h1ccaag7 +base 19 of -1: 141c8786h1ccaagg +base 19 of 0: 0 +base 19 of 10: a +base 19 of 100: 55 +base 19 of 1000: 2ec +base 19 of 4611686018427387904: 5ecbb6fi9h7ggi9 +base 20 of -10: b53bjh07be4dj06 +base 20 of -1: b53bjh07be4dj0f +base 20 of 0: 0 +base 20 of 10: a +base 20 of 100: 50 +base 20 of 1000: 2a0 +base 20 of 4611686018427387904: 2g5hjj51hib39f4 +base 21 of -10: 5e8g4ggg7g56di6 +base 21 of -1: 5e8g4ggg7g56dif +base 21 of 0: 0 +base 21 of 10: a +base 21 of 100: 4g +base 21 of 1000: 25d +base 21 of 4611686018427387904: 18hjgjjjhebh8f4 +base 22 of -10: 2l4lf104353j8k6 +base 22 of -1: 2l4lf104353j8kf +base 22 of 0: 0 +base 22 of 10: a +base 22 of 100: 4c +base 22 of 1000: 21a +base 22 of 4611686018427387904: g6g95gc0hha7g4 +base 23 of -10: 1ddh88h2782i50j +base 23 of -1: 1ddh88h2782i515 +base 23 of 0: 0 +base 23 of 10: a +base 23 of 100: 48 +base 23 of 1000: 1kb +base 23 of 4611686018427387904: 93a22467dc4chd +base 24 of -10: l12ee5fn0ji1i6 +base 24 of -1: l12ee5fn0ji1if +base 24 of 0: 0 +base 24 of 10: a +base 24 of 100: 44 +base 24 of 1000: 1hg +base 24 of 4611686018427387904: 566ffd9ni4mcag +base 25 of -10: c9c336o0mlb7e6 +base 25 of -1: c9c336o0mlb7ef +base 25 of 0: 0 +base 25 of 10: a +base 25 of 100: 40 +base 25 of 1000: 1f0 +base 25 of 4611686018427387904: 32970kc6bo2kg4 +base 26 of -10: 7b7n2pcniokcg6 +base 26 of -1: 7b7n2pcniokcgf +base 26 of 0: 0 +base 26 of 10: a +base 26 of 100: 3m +base 26 of 1000: 1cc +base 26 of 4611686018427387904: 1m8c769io65344 +base 27 of -10: 4eo8hfam6fllmf +base 27 of -1: 4eo8hfam6fllmo +base 27 of 0: 0 +base 27 of 10: a +base 27 of 100: 3j +base 27 of 1000: 1a1 +base 27 of 4611686018427387904: 13jfho2j1hc5cd +base 28 of -10: 2nc6j26l66rho6 +base 28 of -1: 2nc6j26l66rhof +base 28 of 0: 0 +base 28 of 10: a +base 28 of 100: 3g +base 28 of 1000: 17k +base 28 of 4611686018427387904: jo1ilfj8fkpd4 +base 29 of -10: 1n3rsh11f098re +base 29 of -1: 1n3rsh11f098rn +base 29 of 0: 0 +base 29 of 10: a +base 29 of 100: 3d +base 29 of 1000: 15e +base 29 of 4611686018427387904: d0slim0b029e6 +base 30 of -10: 14l9lkmo30o406 +base 30 of -1: 14l9lkmo30o40f +base 30 of 0: 0 +base 30 of 10: a +base 30 of 100: 3a +base 30 of 1000: 13a +base 30 of 4611686018427387904: 8k9rrkl0ml104 +base 31 of -10: nd075ib45k866 +base 31 of -1: nd075ib45k86f +base 31 of 0: 0 +base 31 of 10: a +base 31 of 100: 37 +base 31 of 1000: 118 +base 31 of 4611686018427387904: 5qfh94i8okhh4 +base 32 of -10: fvvvvvvvvvvvm +base 32 of -1: fvvvvvvvvvvvv +base 32 of 0: 0 +base 32 of 10: a +base 32 of 100: 34 +base 32 of 1000: v8 +base 32 of 4611686018427387904: 4000000000000 +base 33 of -10: b1w8p7j5q9r66 +base 33 of -1: b1w8p7j5q9r6f +base 33 of 0: 0 +base 33 of 10: a +base 33 of 100: 31 +base 33 of 1000: ua +base 33 of 4611686018427387904: 2p826a4q6ivi4 +base 34 of -10: 7orp63sh4dph8 +base 34 of -1: 7orp63sh4dphh +base 34 of 0: 0 +base 34 of 10: a +base 34 of 100: 2w +base 34 of 1000: te +base 34 of 4611686018427387904: 1vnvr0wl9ketu +base 35 of -10: 5g24a25twkwf6 +base 35 of -1: 5g24a25twkwff +base 35 of 0: 0 +base 35 of 10: a +base 35 of 100: 2u +base 35 of 1000: sk +base 35 of 4611686018427387904: 1cqrb9a7gvgu4 +base 36 of -10: 3w5e11264sgs6 +base 36 of -1: 3w5e11264sgsf +base 36 of 0: 0 +base 36 of 10: a +base 36 of 100: 2s +base 36 of 1000: rs +base 36 of 4611686018427387904: z1ci99jj7474 +base 37 of -10: +base 37 of -1: +base 37 of 0: +base 37 of 10: +base 37 of 100: +base 37 of 1000: +base 37 of 4611686018427387904: +base 38 of -10: +base 38 of -1: +base 38 of 0: +base 38 of 10: +base 38 of 100: +base 38 of 1000: +base 38 of 4611686018427387904: +base 39 of -10: +base 39 of -1: +base 39 of 0: +base 39 of 10: +base 39 of 100: +base 39 of 1000: +base 39 of 4611686018427387904: +base 40 of -10: +base 40 of -1: +base 40 of 0: +base 40 of 10: +base 40 of 100: +base 40 of 1000: +base 40 of 4611686018427387904: + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.tolower.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.tolower.d Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,66 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; + + input[i] = "ahi"; + expected[i++] = "ahi"; + + input[i] = "MaHi!"; + expected[i++] = "mahi!"; + + input[i] = " Nase-5"; + expected[i++] = " nase-5"; + + input[i] = "!@#$%"; + expected[i++] = "!@#$%"; + + i = 0; +} + +tick-1ms +/input[i] != NULL && (this->out = tolower(input[i])) != expected[i]/ +{ + printf("expected tolower(\"%s\") to be \"%s\"; found \"%s\"\n", + input[i], expected[i], this->out); + exit(1); +} + +tick-1ms +/input[i] != NULL/ +{ + printf("tolower(\"%s\") is \"%s\", as expected\n", + input[i], expected[i]); +} + +tick-1ms +/input[i++] == NULL/ +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.toupper.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.toupper.d Sat Jun 30 07:46:38 2012 (r237834) @@ -0,0 +1,66 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 07:52:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1006A106566B; Sat, 30 Jun 2012 07:52:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA0808FC0C; Sat, 30 Jun 2012 07:52:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5U7q6r6098054; Sat, 30 Jun 2012 07:52:06 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5U7q6LK098052; Sat, 30 Jun 2012 07:52:06 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206300752.q5U7q6LK098052@svn.freebsd.org> From: Martin Matuska Date: Sat, 30 Jun 2012 07:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237835 - vendor/illumos/dist/cmd/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 07:52:07 -0000 Author: mm Date: Sat Jun 30 07:52:06 2012 New Revision: 237835 URL: http://svn.freebsd.org/changeset/base/237835 Log: Update vendor dtrace manpage from usr/src/man/man1m/dtrace.1m Modified: vendor/illumos/dist/cmd/dtrace/dtrace.1 Modified: vendor/illumos/dist/cmd/dtrace/dtrace.1 ============================================================================== --- vendor/illumos/dist/cmd/dtrace/dtrace.1 Sat Jun 30 07:46:38 2012 (r237834) +++ vendor/illumos/dist/cmd/dtrace/dtrace.1 Sat Jun 30 07:52:06 2012 (r237835) @@ -1,51 +1,42 @@ '\" te -.\" CDDL HEADER START -.\" -.\" The contents of this file are subject to the terms of the -.\" Common Development and Distribution License (the "License"). -.\" You may not use this file except in compliance with the License. -.\" -.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -.\" or http://www.opensolaris.org/os/licensing. -.\" See the License for the specific language governing permissions -.\" and limitations under the License. -.\" -.\" When distributing Covered Code, include this CDDL HEADER in each -.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. -.\" If applicable, add the following below this CDDL HEADER, with the -.\" fields enclosed by brackets "[]" replaced with your own identifying -.\" information: Portions Copyright [yyyy] [name of copyright owner] -.\" -.\" CDDL HEADER END -.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. -.TH dtrace 1M "5 Sep 2006" "SunOS 5.11" "System Administration Commands" +.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved. +.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. +.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the +.\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] +.TH DTRACE 1M "Aug 4, 2009" .SH NAME dtrace \- DTrace dynamic tracing compiler and tracing utility .SH SYNOPSIS .LP .nf -\fBdtrace\fR [\fB-32\fR | \fB-64\fR] [\fB-aACeFGHhlqSvVwZ\fR] [\fB-b\fR \fIbufsz\fR] [\fB-c\fR \fIcmd\fR] - [\fB-D\fR \fIname\fR [\fI=value\fR]] [\fB-I\fR \fIpath\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fIoutput\fR] - [\fB-s\fR \fIscript\fR] [\fB-U\fR \fIname\fR] [\fB-x\fR \fIarg\fR [\fI=val\fR]] - [\fB-X\fR a | c | s | t] [\fB-p\fR \fIpid\fR] - [\fB-P\fR \fIprovider\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-m\fR [\fIprovider:\fR] \fImodule\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-f\fR [[\fIprovider:\fR] \fImodule:\fR] \fIfunction\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-i\fR \fIprobe-id\fR [[\fIpredicate\fR] \fIaction\fR]] +\fBdtrace\fR [\fB-32\fR | \fB-64\fR] [\fB-aACeFGHhlqSvVwZ\fR] [\fB-b\fR \fIbufsz\fR] [\fB-c\fR \fIcmd\fR] + [\fB-D\fR \fIname\fR [\fI=value\fR]] [\fB-I\fR \fIpath\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fIoutput\fR] + [\fB-s\fR \fIscript\fR] [\fB-U\fR \fIname\fR] [\fB-x\fR \fIarg\fR [\fI=val\fR]] + [\fB-X\fR a | c | s | t] [\fB-p\fR \fIpid\fR] + [\fB-P\fR \fIprovider\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-m\fR [\fIprovider:\fR] \fImodule\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-f\fR [[\fIprovider:\fR] \fImodule:\fR] \fIfunction\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-i\fR \fIprobe-id\fR [[\fIpredicate\fR] \fIaction\fR]] .fi .SH DESCRIPTION .sp .LP -DTrace is a comprehensive dynamic tracing framework for the Solaris Operating System. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs. +DTrace is a comprehensive dynamic tracing framework for the Solaris Operating +System. DTrace provides a powerful infrastructure that permits administrators, +developers, and service personnel to concisely answer arbitrary questions about +the behavior of the operating system and user programs. .sp .LP -The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe, debug, and tune system behavior. Refer to this book for a detailed description of DTrace features, including the bundled DTrace observability -tools, instrumentation providers, and the D programming language. +The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe, +debug, and tune system behavior. Refer to this book for a detailed description +of DTrace features, including the bundled DTrace observability tools, +instrumentation providers, and the D programming language. .sp .LP -The \fBdtrace\fR command provides a generic interface to the essential services provided by the DTrace facility, including: +The \fBdtrace\fR command provides a generic interface to the essential services +provided by the DTrace facility, including: .RS +4 .TP .ie t \(bu @@ -56,13 +47,15 @@ Options that list the set of probes and .TP .ie t \(bu .el o -Options that enable probes directly using any of the probe description specifiers (provider, module, function, name) +Options that enable probes directly using any of the probe description +specifiers (provider, module, function, name) .RE .RS +4 .TP .ie t \(bu .el o -Options that run the D compiler and compile one or more D program files or programs written directly on the command line +Options that run the D compiler and compile one or more D program files or +programs written directly on the command line .RE .RS +4 .TP @@ -80,442 +73,533 @@ Options that generate program stability .TP .ie t \(bu .el o -Options that modify DTrace tracing and buffering behavior and enable additional D compiler features +Options that modify DTrace tracing and buffering behavior and enable additional +D compiler features .RE .sp .LP -You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the \fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks. +You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR +declaration to create an interpreter file. You can also use \fBdtrace\fR to +attempt to compile D programs and determine their properties without actually +enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the +\fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the +\fBdtrace\fR utility to perform these tasks. .SH OPTIONS .sp .LP -The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and \fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid intepretation of meta-characters by the shell. +The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and +\fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in +slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed +in braces \fB{}\fR. D program code specified on the command line must be +appropriately quoted to avoid interpretation of meta-characters by the shell. .sp .LP The following options are supported: .sp .ne 2 -.mk .na \fB\fB-32\fR | \fB-64\fR\fR .ad .sp .6 .RS 4n -The D compiler produces programs using the native data model of the operating system kernel. You can use the \fBisainfo\fR \fB-b\fR command to determine the current operating system data model. If the \fB-32\fR option is specified, \fBdtrace\fR forces -the D compiler to compile a D program using the 32-bit data model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler to compile a D program using the 64-bit data model. These options are typically not required as \fBdtrace\fR selects the -native data model as the default. The data model affects the sizes of integer types and other language properties. D programs compiled for either data model can be executed on both 32-bit and 64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file format -(ELF32 or ELF64) produced by the \fB-G\fR option. +The D compiler produces programs using the native data model of the operating +system kernel. You can use the \fBisainfo\fR \fB-b\fR command to determine the +current operating system data model. If the \fB-32\fR option is specified, +\fBdtrace\fR forces the D compiler to compile a D program using the 32-bit data +model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler +to compile a D program using the 64-bit data model. These options are typically +not required as \fBdtrace\fR selects the native data model as the default. The +data model affects the sizes of integer types and other language properties. D +programs compiled for either data model can be executed on both 32-bit and +64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file +format (ELF32 or ELF64) produced by the \fB-G\fR option. .RE .sp .ne 2 -.mk .na \fB\fB-a\fR\fR .ad .sp .6 .RS 4n -Claim anonymous tracing state and display the traced data. You can combine the \fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit immediately after consuming the anonymous tracing state rather than continuing to wait for new -data. See the \fISolaris Dynamic Tracing Guide\fR for more information about anonymous tracing. +Claim anonymous tracing state and display the traced data. You can combine the +\fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit +immediately after consuming the anonymous tracing state rather than continuing +to wait for new data. See the \fISolaris Dynamic Tracing Guide\fR for more +information about anonymous tracing. .RE .sp .ne 2 -.mk .na \fB\fB-A\fR\fR .ad .sp .6 .RS 4n -Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option constructs a set of \fBdtrace\fR(7D) configuration file directives to enable the specified probes for anonymous tracing and then exits. By default, \fBdtrace\fR attempts to store the directives to the file \fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the \fB-o\fR option to specify an alternate output file. +Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option +constructs a set of \fBdtrace\fR(7D) configuration file directives to enable +the specified probes for anonymous tracing and then exits. By default, +\fBdtrace\fR attempts to store the directives to the file +\fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the +\fB-o\fR option to specify an alternate output file. .RE .sp .ne 2 -.mk .na \fB\fB-b\fR \fIbufsz\fR\fR .ad .sp .6 .RS 4n -Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts -to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property. +Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can +include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the +buffer space cannot be allocated, \fBdtrace\fR attempts to reduce the buffer +size or exit depending on the setting of the \fBbufresize\fR property. .RE .sp .ne 2 -.mk .na \fB\fB-c\fR \fIcmd\fR\fR .ad .sp .6 .RS 4n -Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it -terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information -on macro variables. +Run the specified command \fIcmd\fR and exit upon its completion. If more than +one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all +commands have exited, reporting the exit status for each child process as it +terminates. The process-ID of the first command is made available to any D +programs specified on the command line or using the \fB-s\fR option through the +\fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR +for more information on macro variables. .RE .sp .ne 2 -.mk .na \fB\fB-C\fR\fR .ad .sp .6 .RS 4n -Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, and \fB-H\fR options. You can select the degree of C standard conformance if you use the \fB-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB-X\fR. +Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You +can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, +and \fB-H\fR options. You can select the degree of C standard conformance if +you use the \fB-X\fR option. For a description of the set of tokens defined by +the D compiler when invoking the C preprocessor, see \fB-X\fR. .RE .sp .ne 2 -.mk .na \fB\fB-D\fR \fIname\fR \fB[=\fR\fIvalue\fR\fB]\fR\fR .ad .sp .6 .RS 4n -Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). If you specify the equals sign (\fB=\fR) -and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB-D\fR option to each \fBcpp\fR invocation. +Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR +option). If you specify the equals sign (\fB=\fR) and additional \fIvalue\fR, +the name is assigned the corresponding value. This option passes the \fB-D\fR +option to each \fBcpp\fR invocation. .RE .sp .ne 2 -.mk .na \fB\fB-e\fR\fR .ad .sp .6 .RS 4n -Exit after compiling any requests and consuming anonymous tracing state (\fB-a\fR option) but prior to enabling any probes. You can combine this option with the \fB-a\fR option to print anonymous tracing data and exit. You can also combine this option with D -compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation. +Exit after compiling any requests and consuming anonymous tracing state +(\fB-a\fR option) but prior to enabling any probes. You can combine this option +with the \fB-a\fR option to print anonymous tracing data and exit. You can also +combine this option with D compiler options. This combination verifies that the +programs compile without actually executing them and enabling the corresponding +instrumentation. .RE .sp .ne 2 -.mk .na -\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR +\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[ +[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR .ad .sp .6 .RS 4n -Specify function name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR. -Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched. -The \fB-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-f\fR option on the command line at a time. +Specify function name to trace or list (\fB-l\fR option). The corresponding +argument can include any of the probe description forms +\fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR. +Unspecified probe description fields are left blank and match any probes +regardless of the values in those fields. If no qualifiers other than +\fIfunction\fR are specified in the description, all probes with the +corresponding \fIfunction\fR are matched. The \fB-f\fR argument can be suffixed +with an optional D probe clause. You can specify more than one \fB-f\fR option +on the command line at a time. .RE .sp .ne 2 -.mk .na \fB\fB-F\fR\fR .ad .sp .6 .RS 4n -Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call -entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&. +Coalesce trace output by identifying function entry and return. Function entry +probe reports are indented and their output is prefixed with \fB->\fR. Function +return probe reports are unindented and their output is prefixed with +\fB<-\fR\&. System call entry probe reports are indented and their output is +prefixed with \fB=>\fR. System call return probe reports are unindented and +their output is prefixed with \fB<=\fR\&. .RE .sp .ne 2 -.mk .na \fB\fB-G\fR\fR .ad .sp .6 .RS 4n -Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB-o\fR option is present, the ELF file is saved using the pathname specified -as the argument for this operand. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR. -Otherwise the ELF file is saved using the name \fBd.out\fR. +Generate an ELF file containing an embedded DTrace program. The DTrace probes +specified in the program are saved inside of a relocatable ELF object which can +be linked into another program. If the \fB-o\fR option is present, the ELF file +is saved using the pathname specified as the argument for this operand. If the +\fB-o\fR option is not present and the DTrace program is contained with a file +whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name +\fB\fIfilename\fR.o\fR. Otherwise the ELF file is saved using the name +\fBd.out\fR. .RE .sp .ne 2 -.mk .na \fB\fB-H\fR\fR .ad .sp .6 .RS 4n -Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-H\fR option -to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR. +Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using +the \fB-C\fR option). This option passes the \fB-H\fR option to each \fBcpp\fR +invocation, causing it to display the list of pathnames, one for each line, to +\fBstderr\fR. .RE .sp .ne 2 -.mk .na \fB\fB-h\fR\fR .ad .sp .6 .RS 4n -Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB-G\fR option. If the \fB-o\fR option -is present, the header file is saved using the pathname specified as the argument for that option. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved -using the name \fIfilename\fR\fB\&.h\fR. +Generate a header file containing macros that correspond to probes in the +specified provider definitions. This option should be used to generate a header +file that is included by other source files for later use with the \fB-G\fR +option. If the \fB-o\fR option is present, the header file is saved using the +pathname specified as the argument for that option. If the \fB-o\fR option is +not present and the DTrace program is contained with a file whose name is +\fIfilename\fR\fB\&.d\fR, then the header file is saved using the name +\fIfilename\fR\fB\&.h\fR. .RE .sp .ne 2 -.mk .na \fB\fB-i\fR \fIprobe-id\fR\fB[[\fR\fIpredicate\fR] \fIaction\fR\fB]\fR\fR .ad .sp .6 .RS 4n -Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB-l\fR. The \fB-i\fR argument can be suffixed with an optional -D probe clause. You can specify more than one \fB-i\fR option at a time. +Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). +You can specify probe IDs using decimal integers as shown by \fBdtrace\fR +\fB-l\fR. The \fB-i\fR argument can be suffixed with an optional D probe +clause. You can specify more than one \fB-i\fR option at a time. .RE .sp .ne 2 -.mk .na \fB\fB-I\fR \fIpath\fR\fR .ad .sp .6 .RS 4n -Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled -using the \fB-C\fR option). This option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list. +Add the specified directory \fIpath\fR to the search path for \fB#include\fR +files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This +option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified +\fIpath\fR is inserted into the search path ahead of the default directory +list. .RE .sp .ne 2 -.mk .na \fB\fB-L\fR \fIpath\fR\fR .ad .sp .6 .RS 4n -Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library +Add the specified directory \fIpath\fR to the search path for DTrace libraries. +DTrace libraries are used to contain common definitions that can be used when +writing D programs. The specified \fIpath\fR is added after the default library search path. .RE .sp .ne 2 -.mk .na \fB\fB-l\fR\fR .ad .sp .6 .RS 4n -List probes instead of enabling them. If the \fB-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR, -and \fB-s\fR options. If none of these options are specified, this option lists all probes. +List probes instead of enabling them. If the \fB-l\fR option is specified, +\fBdtrace\fR produces a report of the probes matching the descriptions given +using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR, and \fB-s\fR +options. If none of these options are specified, this option lists all probes. .RE .sp .ne 2 -.mk .na -\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] \fIaction\fR]]\fR +\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] +\fIaction\fR]]\fR .ad .sp .6 .RS 4n -Specify module name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match -any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed with an optional D -probe clause. More than one \fB-m\fR option can be specified on the command line at a time. +Specify module name to trace or list (\fB-l\fR option). The corresponding +argument can include any of the probe description forms \fIprovider:module\fR +or \fImodule\fR. Unspecified probe description fields are left blank and match +any probes regardless of the values in those fields. If no qualifiers other +than \fImodule\fR are specified in the description, all probes with a +corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed +with an optional D probe clause. More than one \fB-m\fR option can be specified +on the command line at a time. .RE .sp .ne 2 -.mk .na -\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]\fR +\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR +[[\fIpredicate\fR] \fIaction\fR]\fR .ad .sp .6 .RS 4n -Specify probe name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR, -or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are -matched. The \fB-n\fR argument can be suffixed with an optional D probe clause. More than one \fB-n\fR option can be specified on the command line at a time. +Specify probe name to trace or list (\fB-l\fR option). The corresponding +argument can include any of the probe description forms +\fIprovider:module:function:name\fR, \fImodule:function:name\fR, +\fIfunction:name\fR, or \fIname\fR. Unspecified probe description fields are +left blank and match any probes regardless of the values in those fields. If no +qualifiers other than \fIname\fR are specified in the description, all probes +with a corresponding \fIname\fR are matched. The \fB-n\fR argument can be +suffixed with an optional D probe clause. More than one \fB-n\fR option can be +specified on the command line at a time. .RE .sp .ne 2 -.mk .na \fB\fB-o\fR \fIoutput\fR\fR .ad .sp .6 .RS 4n -Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, and \fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is present and \fB-o\fR is not present, the default output file is \fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the \fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR. -Otherwise the default output file is \fBd.out\fR. +Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, \fB-h\fR, and +\fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is +present and \fB-o\fR is not present, the default output file is +\fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the +\fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR +is not present, the default output file is \fB\fIfilename\fR.o\fR. Otherwise +the default output file is \fBd.out\fR. .RE .sp .ne 2 -.mk .na \fB\fB-p\fR \fIpid\fR\fR .ad .sp .6 .RS 4n -Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status -for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for -more information on macro variables. +Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon +its completion. If more than one \fB-p\fR option is present on the command +line, \fBdtrace\fR exits when all commands have exited, reporting the exit +status for each process as it terminates. The first process-ID is made +available to any D programs specified on the command line or using the \fB-s\fR +option through the \fB$target\fR macro variable. Refer to the \fISolaris +Dynamic Tracing Guide\fR for more information on macro variables. .RE .sp .ne 2 -.mk .na \fB\fB-P\fR \fIprovider\fR \fB[[\fR\fIpredicate\fR\fB]\fR \fIaction\fR]\fR .ad .sp .6 .RS 4n -Specify provider name to trace or list (\fB-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB-P\fR argument can be suffixed with an optional D -probe clause. You can specify more than one \fB-P\fR option on the command line at a time. +Specify provider name to trace or list (\fB-l\fR option). The remaining probe +description fields module, function, and name are left blank and match any +probes regardless of the values in those fields. The \fB-P\fR argument can be +suffixed with an optional D probe clause. You can specify more than one +\fB-P\fR option on the command line at a time. .RE .sp .ne 2 -.mk .na \fB\fB-q\fR\fR .ad .sp .6 .RS 4n -Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program -statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR. +Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes +matched by the specified options and D programs and does not print column +headers, the CPU ID, the probe ID, or insert newlines into the output. Only +data traced and formatted by D program statements such as \fBtrace()\fR and +\fBprintf()\fR is displayed to \fBstdout\fR. .RE .sp .ne 2 -.mk .na \fB\fB-s\fR\fR .ad .sp .6 .RS 4n -Compile the specified D program source file. If the \fB-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation -is not enabled. If none of \fB-e\fR, \fB-l\fR, \fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D program is enabled and tracing begins. +Compile the specified D program source file. If the \fB-e\fR option is present, +the program is compiled but instrumentation is not enabled. If the \fB-l\fR +option is present, the program is compiled and the set of probes matched by it +is listed, but instrumentation is not enabled. If none of \fB-e\fR, \fB-l\fR, +\fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D +program is enabled and tracing begins. .RE .sp .ne 2 -.mk .na \fB\fB-S\fR\fR .ad .sp .6 .RS 4n -Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR. +Show D compiler intermediate code. The D compiler produces a report of the +intermediate code generated for each D program to \fBstderr\fR. .RE .sp .ne 2 -.mk .na \fB\fB-U\fR \fIname\fR\fR .ad .sp .6 .RS 4n -Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation. +Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the +\fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR +invocation. .RE .sp .ne 2 -.mk .na \fB\fB-v\fR\fR .ad .sp .6 .RS 4n -Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fISolaris Dynamic Tracing Guide\fR. +Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a +program stability report showing the minimum interface stability and dependency +level for the specified D programs. DTrace stability levels are explained in +further detail in the \fISolaris Dynamic Tracing Guide\fR. .RE .sp .ne 2 -.mk .na \fB\fB-V\fR\fR .ad .sp .6 .RS 4n -Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for -more information about DTrace versioning features. +Report the highest D programming interface version supported by \fBdtrace\fR. +The version information is printed to \fBstdout\fR and the \fBdtrace\fR command +exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information +about DTrace versioning features. .RE .sp .ne 2 -.mk .na \fB\fB-w\fR\fR .ad .sp .6 .RS 4n -Permit destructive actions in D programs specified using the \fB-s\fR, \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR option is not specified, \fBdtrace\fR does not -permit the compilation or enabling of a D program that contains destructive actions. +Permit destructive actions in D programs specified using the \fB-s\fR, +\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR +option is not specified, \fBdtrace\fR does not permit the compilation or +enabling of a D program that contains destructive actions. .RE .sp .ne 2 -.mk .na \fB\fB-x\fR \fIarg\fR [\fI=val\fR]\fR .ad .sp .6 .RS 4n -Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and -value with an equals sign (\fB=\fR). +Enable or modify a DTrace runtime option or D compiler option. The list of +options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options +are enabled by specifying their name. Options with values are set by separating +the option name and value with an equals sign (\fB=\fR). .RE .sp .ne 2 -.mk .na \fB\fB-X\fR \fBa | c | s | t\fR\fR .ad .sp .6 .RS 4n -Specify the degree of conformance to the ISO C standard that should be selected when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). -The \fB-X\fR option argument affects the value and presence of the \fB__STDC__\fR macro depending upon the value of the argument letter. +Specify the degree of conformance to the ISO C standard that should be selected +when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). The \fB-X\fR +option argument affects the value and presence of the \fB__STDC__\fR macro +depending upon the value of the argument letter. .sp The \fB-X\fR option supports the following arguments: .sp .ne 2 -.mk .na \fB\fBa\fR\fR .ad .RS 5n -.rt -Default. ISO C plus K&R compatibility extensions, with semantic changes required by ISO C. This is the default mode if \fB-X\fR is not specified. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction -with the \fB-Xa\fR option. +Default. ISO C plus K&R compatibility extensions, with semantic changes +required by ISO C. This is the default mode if \fB-X\fR is not specified. The +predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in +conjunction with the \fB-Xa\fR option. .RE .sp .ne 2 -.mk .na \fB\fBc\fR\fR .ad .RS 5n -.rt -Conformance. Strictly conformant ISO C, without K&R C compatibility extensions. The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked in conjunction with the \fB-Xc\fR option. +Conformance. Strictly conformant ISO C, without K&R C compatibility extensions. +The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked +in conjunction with the \fB-Xc\fR option. .RE .sp .ne 2 -.mk .na \fB\fBs\fR\fR .ad .RS 5n -.rt -K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked in conjunction with the \fB-Xs\fR option. +K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked +in conjunction with the \fB-Xs\fR option. .RE .sp .ne 2 -.mk .na \fB\fBt\fR\fR .ad .RS 5n -.rt -Transition. ISO C plus K&R C compatibility extensions, without semantic changes required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option. +Transition. ISO C plus K&R C compatibility extensions, without semantic changes +required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when +\fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option. .RE -As the \fB-X\fR option only affects how the D compiler invokes the C preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the perspective of D and both are provided only to ease re-use of settings from a C build environment. +As the \fB-X\fR option only affects how the D compiler invokes the C +preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the +perspective of D and both are provided only to ease re-use of settings from a C +build environment. .sp -Regardless of the \fB-X\fR mode, the following additional C preprocessor definitions are always specified and valid in all modes: +Regardless of the \fB-X\fR mode, the following additional C preprocessor +definitions are always specified and valid in all modes: .RS +4 .TP .ie t \(bu @@ -576,66 +660,71 @@ Regardless of the \fB-X\fR mode, the fol .el o \fB__SUNW_D_VERSION=0x\fIMMmmmuuu\fR\fR .sp -Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the minor release value in hexadecimal, and \fIuuu\fR is the -micro release value in hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information about DTrace versioning. +Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the +minor release value in hexadecimal, and \fIuuu\fR is the micro release value in +hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more +information about DTrace versioning. .RE .RE .sp .ne 2 -.mk .na \fB\fB-Z\fR\fR .ad .sp .6 .RS 4n -Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB-s\fR option) or on the command line (\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain descriptions that do not match any known probes. +Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not +specified, \fBdtrace\fR reports an error and exits if any probe descriptions +specified in D program files (\fB-s\fR option) or on the command line +(\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain +descriptions that do not match any known probes. .RE .SH OPERANDS .sp .LP -You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB-s\fR option -or on the command line. The use of macro variables is described further in the \fISolaris Dynamic Tracing Guide\fR. +You can specify zero or more additional arguments on the \fBdtrace\fR command +line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The +additional arguments can be used in D programs specified using the \fB-s\fR +option or on the command line. The use of macro variables is described further +in the \fISolaris Dynamic Tracing Guide\fR. .SH EXIT STATUS .sp .LP The following exit values are returned: .sp .ne 2 -.mk .na \fB0\fR .ad .RS 5n -.rt -Successful completion. +Successful completion. .sp -For D program requests, an exit status of \fB0\fR indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified tracing requests -encountered errors or drops. +For D program requests, an exit status of \fB0\fR indicates that programs were +successfully compiled, probes were successfully enabled, or anonymous state was +successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified +tracing requests encountered errors or drops. .RE .sp .ne 2 -.mk .na \fB\fB1\fR\fR .ad .RS 5n -.rt An error occurred. .sp -For D program requests, an exit status of \fB1\fR indicates that program compilation failed or that the specified request could not be satisfied. +For D program requests, an exit status of \fB1\fR indicates that program +compilation failed or that the specified request could not be satisfied. .RE .sp .ne 2 -.mk .na \fB\fB2\fR\fR .ad .RS 5n -.rt Invalid command line options or arguments were specified. .RE @@ -647,15 +736,12 @@ See \fBattributes\fR(5) for descriptions .sp .TS -tab() box; -cw(2.75i) |cw(2.75i) -lw(2.75i) |lw(2.75i) -. -ATTRIBUTE TYPEATTRIBUTE VALUE +box; +c | c +l | l . +ATTRIBUTE TYPE ATTRIBUTE VALUE _ -AvailabilitySUNWdtrc -_ -Interface StabilitySee below. +Interface Stability See below. .TE .sp @@ -664,7 +750,19 @@ The command-line syntax is Committed. Th .SH SEE ALSO .sp .LP -\fBcpp\fR(1), \fBisainfo\fR(1), \fBlibdtrace\fR(3LIB), \fBdriver.conf\fR(4), \fBattributes\fR(5), \fBdtrace\fR(7D) +\fBcpp\fR(1), \fBisainfo\fR(1), \fBssh\fR(1), \fBlibdtrace\fR(3LIB), +\fBdriver.conf\fR(4), \fBattributes\fR(5), \fBdtrace\fR(7D) .sp .LP \fISolaris Dynamic Tracing Guide\fR +.SH USAGE +.sp +.LP +When using the \fB-p\fR flag, \fBdtrace\fR stops the target processes while it +is inspecting them and reporting results. A process can do nothing while it is +stopped. This means that, if , for example, the X server is inspected by +\fBdtrace\fR running in a window under the X server's control, the whole window +system can become deadlocked, because the \fBproc\fR tool would be attempting +to display its results to a window that cannot be refreshed. In such a case, +logging in from another system using \fBssh\fR(1) and killing the offending +\fBproc\fR tool clears the deadlock. From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 13:17:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44FA8106566B; Sat, 30 Jun 2012 13:17:22 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FE4C8FC08; Sat, 30 Jun 2012 13:17:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UDHMo2020915; Sat, 30 Jun 2012 13:17:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UDHLWS020913; Sat, 30 Jun 2012 13:17:21 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201206301317.q5UDHLWS020913@svn.freebsd.org> From: Christian Brueffer Date: Sat, 30 Jun 2012 13:17: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: r237836 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 13:17:22 -0000 Author: brueffer Date: Sat Jun 30 13:17:21 2012 New Revision: 237836 URL: http://svn.freebsd.org/changeset/base/237836 Log: mps(4) is endian safe as of r237683. Modified: head/share/man/man4/mps.4 Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Sat Jun 30 07:52:06 2012 (r237835) +++ head/share/man/man4/mps.4 Sat Jun 30 13:17:21 2012 (r237836) @@ -34,7 +34,7 @@ .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd February 7, 2012 +.Dd June 30, 2012 .Dt MPS 4 .Os .Sh NAME @@ -205,9 +205,6 @@ This man page was written by This driver has a couple of known shortcomings: .Bl -bullet -compact .It -Not endian safe. -It only works on little endian machines (e.g. amd64 and i386). -.It No userland utility available (e.g. .Xr mptutil 8 ) . .It From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 14:05:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C33910656D1; Sat, 30 Jun 2012 14:05:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4564B8FC0C; Sat, 30 Jun 2012 14:05:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UE5aPW022914; Sat, 30 Jun 2012 14:05:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UE5aF7022912; Sat, 30 Jun 2012 14:05:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206301405.q5UE5aF7022912@svn.freebsd.org> From: Andriy Gapon Date: Sat, 30 Jun 2012 14:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237837 - stable/9/usr.sbin/cpucontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 14:05:36 -0000 Author: avg Date: Sat Jun 30 14:05:35 2012 New Revision: 237837 URL: http://svn.freebsd.org/changeset/base/237837 Log: MFC r236504: cpucontrol: use CPUCTL_UPDATE ioctl on correct file descriptor (in amd case) Modified: stable/9/usr.sbin/cpucontrol/amd.c Directory Properties: stable/9/usr.sbin/cpucontrol/ (props changed) Modified: stable/9/usr.sbin/cpucontrol/amd.c ============================================================================== --- stable/9/usr.sbin/cpucontrol/amd.c Sat Jun 30 13:17:21 2012 (r237836) +++ stable/9/usr.sbin/cpucontrol/amd.c Sat Jun 30 14:05:35 2012 (r237837) @@ -160,7 +160,7 @@ amd_update(const char *dev, const char * args.data = fw_image; args.size = st.st_size; - error = ioctl(fd, CPUCTL_UPDATE, &args); + error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { fprintf(stderr, "failed.\n"); warn("ioctl()"); From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 14:06:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA9E21065670; Sat, 30 Jun 2012 14:06:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 955078FC17; Sat, 30 Jun 2012 14:06:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UE6HcR022983; Sat, 30 Jun 2012 14:06:17 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UE6HMn022981; Sat, 30 Jun 2012 14:06:17 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206301406.q5UE6HMn022981@svn.freebsd.org> From: Andriy Gapon Date: Sat, 30 Jun 2012 14:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237838 - stable/8/usr.sbin/cpucontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 14:06:17 -0000 Author: avg Date: Sat Jun 30 14:06:17 2012 New Revision: 237838 URL: http://svn.freebsd.org/changeset/base/237838 Log: MFC r236504: cpucontrol: use CPUCTL_UPDATE ioctl on correct file descriptor (in amd case) Modified: stable/8/usr.sbin/cpucontrol/amd.c Directory Properties: stable/8/usr.sbin/cpucontrol/ (props changed) Modified: stable/8/usr.sbin/cpucontrol/amd.c ============================================================================== --- stable/8/usr.sbin/cpucontrol/amd.c Sat Jun 30 14:05:35 2012 (r237837) +++ stable/8/usr.sbin/cpucontrol/amd.c Sat Jun 30 14:06:17 2012 (r237838) @@ -162,7 +162,7 @@ amd_update(const char *dev, const char * args.data = fw_image; args.size = st.st_size; - error = ioctl(fd, CPUCTL_UPDATE, &args); + error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { fprintf(stderr, "failed.\n"); warn("ioctl()"); From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 14:08:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C45991065674 for ; Sat, 30 Jun 2012 14:08:37 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm28.bullet.mail.sp2.yahoo.com (nm28.bullet.mail.sp2.yahoo.com [98.139.91.98]) by mx1.freebsd.org (Postfix) with SMTP id 984F68FC0C for ; Sat, 30 Jun 2012 14:08:37 +0000 (UTC) Received: from [98.139.91.67] by nm28.bullet.mail.sp2.yahoo.com with NNFMP; 30 Jun 2012 14:08:37 -0000 Received: from [98.139.91.41] by tm7.bullet.mail.sp2.yahoo.com with NNFMP; 30 Jun 2012 14:08:37 -0000 Received: from [127.0.0.1] by omp1041.mail.sp2.yahoo.com with NNFMP; 30 Jun 2012 14:08:37 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 369777.25964.bm@omp1041.mail.sp2.yahoo.com Received: (qmail 82091 invoked by uid 60001); 30 Jun 2012 14:08:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1341065316; bh=T6fnrieP3NzWXILbczmo7XmJmlY4sWpa/lxpPJxnmoY=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=TmS2jsXjA2GvVV/j+nvX/bW89AH8zc/2lYI6ZlNCD/nbmpRUTB55E7t6mti+fC/CcZslLNGEy6D2IWDRY6GnM1Es9wmjFFTC2/08RuYomP+IbOTiVirBKA8yFCor7ETvx9DhGsRnUKi05zUrPgR+u2cMbQSxZqH0NeNAzHzXLoY= X-YMail-OSG: Q9U2eZUVM1krfq6x5xLoupsqTsOSzrIXb2e2kvigQKsM8wc GvrYxffpAFwWLGcX4ztjjSSgWmTK_V7B8fBZdwm0YeeNlH_iMLbaYx8Ijp4b sUxC2Zai9GR9SGDDvz98pRQb0kmXuRk2dv_gxtQv4VouPD5w2eiMnBNukkFu ismQaMeAg7mGGv9d01.i3FPxFThFl6WqeI10U7DPAzwW9V26.911SE2q.RJ5 PUK0tw5AHmMBkDgvVQM_L90drXwgxoEJLs1inHmThsku_ePJYukj_dmcucg. umKYtwaFfgqihKJweqKz3a0_Cmw6WUvgNfT3crZxUH.qfhTPynKutuw4mtjw vnrM.mMjWZQAZ2uCU0zlctyl0frQkVTiPMn.YuUyl.O.PVwQLYd2EwObaNZM 0Gl0QIuWv8mMy6nZfcGLeS.XDa64oUyqLyDn8Hb4fZq5ydgolA_ID1OYVc0W GgbBM Received: from [200.118.157.7] by web113506.mail.gq1.yahoo.com via HTTP; Sat, 30 Jun 2012 07:08:36 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.8 YahooMailWebService/0.8.118.349524 Message-ID: <1341065316.77630.YahooMailClassic@web113506.mail.gq1.yahoo.com> Date: Sat, 30 Jun 2012 07:08:36 -0700 (PDT) From: Pedro Giffuni To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org, Martin Matuska In-Reply-To: <201206300723.q5U7NM5u096830@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: R: svn commit: r237833 - in vendor/illumos: . dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 14:08:37 -0000 =0A=0A--- Sab 30/6/12, Martin Matuska ha scritto:=0A...=0A= > Author: mm=0A> Date: Sat Jun 30 07:23:22 2012=0A> New Revision: 237833=0A= > URL: http://svn.freebsd.org/changeset/base/237833=0A> =0A> Log:=0A> =A0 C= opy opensolaris/dist to illumos/dist in vendor=0A> branch=0A> =0A> Added:= =0A> =A0 vendor/illumos/=0A> =A0 vendor/illumos/dist/=0A> =A0 =A0=A0=A0- co= pied from r237832,=0A> vendor/opensolaris/dist/=0A> =0A=0AThank you Martin = ... that's clever.=0A=0APedro. From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 14:18:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97BD5106566C; Sat, 30 Jun 2012 14:18:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77B748FC0A; Sat, 30 Jun 2012 14:18:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UEI0VB023610; Sat, 30 Jun 2012 14:18:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UEI06V023604; Sat, 30 Jun 2012 14:18:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206301418.q5UEI06V023604@svn.freebsd.org> From: Andriy Gapon Date: Sat, 30 Jun 2012 14:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237839 - in stable/9/sys: amd64/amd64 i386/i386 kern x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 14:18:00 -0000 Author: avg Date: Sat Jun 30 14:17:59 2012 New Revision: 237839 URL: http://svn.freebsd.org/changeset/base/237839 Log: MFC r236503: free wdog_kern_pat calls in post-panic paths from under SW_WATCHDOG Modified: stable/9/sys/amd64/amd64/minidump_machdep.c stable/9/sys/i386/i386/minidump_machdep.c stable/9/sys/kern/kern_shutdown.c stable/9/sys/kern/vfs_subr.c stable/9/sys/x86/x86/dump_machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/minidump_machdep.c Sat Jun 30 14:06:17 2012 (r237838) +++ stable/9/sys/amd64/amd64/minidump_machdep.c Sat Jun 30 14:17:59 2012 (r237839) @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include #include #include @@ -177,9 +175,9 @@ blk_write(struct dumperinfo *di, char *p report_progress(progress, dumpsize); counter &= (1<<24) - 1; } -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif + if (ptr) { error = dump_write(di, ptr, 0, dumplo, len); if (error) Modified: stable/9/sys/i386/i386/minidump_machdep.c ============================================================================== --- stable/9/sys/i386/i386/minidump_machdep.c Sat Jun 30 14:06:17 2012 (r237838) +++ stable/9/sys/i386/i386/minidump_machdep.c Sat Jun 30 14:17:59 2012 (r237839) @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include #include #include @@ -143,9 +141,9 @@ blk_write(struct dumperinfo *di, char *p printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); counter &= (1<<24) - 1; } -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif + if (ptr) { error = dump_write(di, ptr, 0, dumplo, len); if (error) Modified: stable/9/sys/kern/kern_shutdown.c ============================================================================== --- stable/9/sys/kern/kern_shutdown.c Sat Jun 30 14:06:17 2012 (r237838) +++ stable/9/sys/kern/kern_shutdown.c Sat Jun 30 14:17:59 2012 (r237839) @@ -66,9 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include @@ -331,9 +329,7 @@ kern_reboot(int howto) waittime = 0; -#ifdef SW_WATCHDOG wdog_kern_pat(WD_LASTVAL); -#endif sys_sync(curthread, NULL); /* @@ -359,9 +355,8 @@ kern_reboot(int howto) if (nbusy < pbusy) iter = 0; pbusy = nbusy; -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif sys_sync(curthread, NULL); #ifdef PREEMPTION Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Sat Jun 30 14:06:17 2012 (r237838) +++ stable/9/sys/kern/vfs_subr.c Sat Jun 30 14:17:59 2012 (r237839) @@ -73,9 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include @@ -1869,10 +1867,10 @@ sched_sync(void) LIST_INSERT_HEAD(next, bo, bo_synclist); continue; } -#ifdef SW_WATCHDOG + if (first_printf == 0) wdog_kern_pat(WD_LASTVAL); -#endif + } if (!LIST_EMPTY(gslp)) { mtx_unlock(&sync_mtx); Modified: stable/9/sys/x86/x86/dump_machdep.c ============================================================================== --- stable/9/sys/x86/x86/dump_machdep.c Sat Jun 30 14:06:17 2012 (r237838) +++ stable/9/sys/x86/x86/dump_machdep.c Sat Jun 30 14:17:59 2012 (r237839) @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include #include #include @@ -198,9 +196,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr a = pa + i * PAGE_SIZE; va = pmap_kenter_temporary(trunc_page(a), i); } -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif + error = dump_write(di, va, 0, dumplo, sz); if (error) break; From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 14:18:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDDD3106564A; Sat, 30 Jun 2012 14:18:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E31C8FC12; Sat, 30 Jun 2012 14:18:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UEI4CH023651; Sat, 30 Jun 2012 14:18:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UEI4dO023645; Sat, 30 Jun 2012 14:18:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201206301418.q5UEI4dO023645@svn.freebsd.org> From: Andriy Gapon Date: Sat, 30 Jun 2012 14:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237840 - in stable/8/sys: amd64/amd64 i386/i386 kern x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 14:18:04 -0000 Author: avg Date: Sat Jun 30 14:18:04 2012 New Revision: 237840 URL: http://svn.freebsd.org/changeset/base/237840 Log: MFC r236503: free wdog_kern_pat calls in post-panic paths from under SW_WATCHDOG Modified: stable/8/sys/amd64/amd64/minidump_machdep.c stable/8/sys/i386/i386/minidump_machdep.c stable/8/sys/kern/kern_shutdown.c stable/8/sys/kern/vfs_subr.c stable/8/sys/x86/x86/dump_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/minidump_machdep.c Sat Jun 30 14:17:59 2012 (r237839) +++ stable/8/sys/amd64/amd64/minidump_machdep.c Sat Jun 30 14:18:04 2012 (r237840) @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include #include #include @@ -175,9 +173,9 @@ blk_write(struct dumperinfo *di, char *p report_progress(progress, dumpsize); counter &= (1<<24) - 1; } -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif + if (ptr) { error = dump_write(di, ptr, 0, dumplo, len); if (error) Modified: stable/8/sys/i386/i386/minidump_machdep.c ============================================================================== --- stable/8/sys/i386/i386/minidump_machdep.c Sat Jun 30 14:17:59 2012 (r237839) +++ stable/8/sys/i386/i386/minidump_machdep.c Sat Jun 30 14:18:04 2012 (r237840) @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include #include #include @@ -143,9 +141,9 @@ blk_write(struct dumperinfo *di, char *p printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); counter &= (1<<24) - 1; } -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif + if (ptr) { error = dump_write(di, ptr, 0, dumplo, len); if (error) Modified: stable/8/sys/kern/kern_shutdown.c ============================================================================== --- stable/8/sys/kern/kern_shutdown.c Sat Jun 30 14:17:59 2012 (r237839) +++ stable/8/sys/kern/kern_shutdown.c Sat Jun 30 14:18:04 2012 (r237840) @@ -66,9 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include @@ -330,9 +328,7 @@ boot(int howto) waittime = 0; -#ifdef SW_WATCHDOG wdog_kern_pat(WD_LASTVAL); -#endif sync(curthread, NULL); /* @@ -358,9 +354,8 @@ boot(int howto) if (nbusy < pbusy) iter = 0; pbusy = nbusy; -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif sync(curthread, NULL); #ifdef PREEMPTION Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Sat Jun 30 14:17:59 2012 (r237839) +++ stable/8/sys/kern/vfs_subr.c Sat Jun 30 14:18:04 2012 (r237840) @@ -73,9 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include @@ -1878,10 +1876,10 @@ sched_sync(void) LIST_INSERT_HEAD(next, bo, bo_synclist); continue; } -#ifdef SW_WATCHDOG + if (first_printf == 0) wdog_kern_pat(WD_LASTVAL); -#endif + } if (!LIST_EMPTY(gslp)) { mtx_unlock(&sync_mtx); Modified: stable/8/sys/x86/x86/dump_machdep.c ============================================================================== --- stable/8/sys/x86/x86/dump_machdep.c Sat Jun 30 14:17:59 2012 (r237839) +++ stable/8/sys/x86/x86/dump_machdep.c Sat Jun 30 14:18:04 2012 (r237840) @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include #include #include @@ -198,9 +196,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr a = pa + i * PAGE_SIZE; va = pmap_kenter_temporary(trunc_page(a), i); } -#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); -#endif + error = dump_write(di, va, 0, dumplo, sz); if (error) break; From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 14:48:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F29C10656D0; Sat, 30 Jun 2012 14:48:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A6F38FC1A; Sat, 30 Jun 2012 14:48:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UEmq2O024952; Sat, 30 Jun 2012 14:48:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UEmqxU024950; Sat, 30 Jun 2012 14:48:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206301448.q5UEmqxU024950@svn.freebsd.org> From: Marius Strobl Date: Sat, 30 Jun 2012 14:48: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: r237841 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 14:48:53 -0000 Author: marius Date: Sat Jun 30 14:48:52 2012 New Revision: 237841 URL: http://svn.freebsd.org/changeset/base/237841 Log: Exclude at91sam9x25 support, which just wastes space for Ethernut 5. Modified: head/sys/arm/at91/std.ethernut5 Modified: head/sys/arm/at91/std.ethernut5 ============================================================================== --- head/sys/arm/at91/std.ethernut5 Sat Jun 30 14:18:04 2012 (r237840) +++ head/sys/arm/at91/std.ethernut5 Sat Jun 30 14:48:52 2012 (r237841) @@ -9,3 +9,4 @@ options KERNVIRTADDR=0xc0000000 device at91_board_ethernut5 nodevice at91sam9g20 +nodevice at91sam9x25 From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 14:55:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C1391065672; Sat, 30 Jun 2012 14:55:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56C0A8FC08; Sat, 30 Jun 2012 14:55:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UEtbuE025275; Sat, 30 Jun 2012 14:55:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UEtbQb025273; Sat, 30 Jun 2012 14:55:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206301455.q5UEtbQb025273@svn.freebsd.org> From: Marius Strobl Date: Sat, 30 Jun 2012 14:55: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: r237842 - head/sys/sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 14:55:37 -0000 Author: marius Date: Sat Jun 30 14:55:36 2012 New Revision: 237842 URL: http://svn.freebsd.org/changeset/base/237842 Log: Switch back to the 4BSD scheduler for now. There is some more or less recent regression with ULE, causing processes to get stuck in getblk as well as interrupt handler execution delays to rise above the command timeout of mpt(4). MFC after: 3 days Modified: head/sys/sparc64/conf/GENERIC Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sat Jun 30 14:48:52 2012 (r237841) +++ head/sys/sparc64/conf/GENERIC Sat Jun 30 14:55:36 2012 (r237842) @@ -26,7 +26,7 @@ makeoptions DEBUG=-g # Build kernel wit # Platforms supported # At this time all platforms are supported, as-is. -options SCHED_ULE # ULE scheduler +options SCHED_4BSD # 4BSD scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 16:20:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6F181065673; Sat, 30 Jun 2012 16:20:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C9ED8FC0C; Sat, 30 Jun 2012 16:20:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UGK2s9028853; Sat, 30 Jun 2012 16:20:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UGK2CH028852; Sat, 30 Jun 2012 16:20:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206301620.q5UGK2CH028852@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 30 Jun 2012 16:20: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: r237844 - head/usr.bin/killall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 16:20:02 -0000 Author: kib Date: Sat Jun 30 16:20:01 2012 New Revision: 237844 URL: http://svn.freebsd.org/changeset/base/237844 Log: Initialize procs closer to the place were it is used. Free can properly handle NULL pointer (but keep free() call on the premise that the code might be reused). Show errno when realloc failed. MFC after: 3 days Modified: head/usr.bin/killall/killall.c Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Sat Jun 30 15:55:40 2012 (r237843) +++ head/usr.bin/killall/killall.c Sat Jun 30 16:20:01 2012 (r237844) @@ -90,7 +90,7 @@ nosig(char *name) int main(int ac, char **av) { - struct kinfo_proc *procs = NULL, *newprocs; + struct kinfo_proc *procs, *newprocs; struct stat sb; struct passwd *pw; regex_t rgx; @@ -292,14 +292,14 @@ main(int ac, char **av) miblen = 4; } + procs = NULL; st = sysctl(mib, miblen, NULL, &size, NULL, 0); do { size += size / 10; newprocs = realloc(procs, size); - if (newprocs == 0) { - if (procs) - free(procs); - errx(1, "could not reallocate memory"); + if (newprocs == NULL) { + free(procs); + err(1, "could not reallocate memory"); } procs = newprocs; st = sysctl(mib, miblen, procs, &size, NULL, 0); From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 16:21:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F320106566C; Sat, 30 Jun 2012 16:21:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39BDD8FC12; Sat, 30 Jun 2012 16:21:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UGLqg8028955; Sat, 30 Jun 2012 16:21:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UGLqvG028953; Sat, 30 Jun 2012 16:21:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206301621.q5UGLqvG028953@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 30 Jun 2012 16: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: r237845 - head/usr.bin/killall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 16:21:52 -0000 Author: kib Date: Sat Jun 30 16:21:51 2012 New Revision: 237845 URL: http://svn.freebsd.org/changeset/base/237845 Log: Only initialize array of mibs once. MFC after: 3 days Modified: head/usr.bin/killall/killall.c Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Sat Jun 30 16:20:01 2012 (r237844) +++ head/usr.bin/killall/killall.c Sat Jun 30 16:21:51 2012 (r237845) @@ -278,9 +278,6 @@ main(int ac, char **av) size = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; - mib[2] = KERN_PROC_PROC; - mib[3] = 0; - miblen = 3; if (user) { mib[2] = eflag ? KERN_PROC_UID : KERN_PROC_RUID; @@ -290,6 +287,10 @@ main(int ac, char **av) mib[2] = KERN_PROC_TTY; mib[3] = tdev; miblen = 4; + } else { + mib[2] = KERN_PROC_PROC; + mib[3] = 0; + miblen = 3; } procs = NULL; From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 16:23:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C879106564A; Sat, 30 Jun 2012 16:23:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC30B8FC0C; Sat, 30 Jun 2012 16:23:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UGN8uk029053; Sat, 30 Jun 2012 16:23:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UGN8c3029051; Sat, 30 Jun 2012 16:23:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206301623.q5UGN8c3029051@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 30 Jun 2012 16:23: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: r237846 - head/usr.bin/killall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 16:23:09 -0000 Author: kib Date: Sat Jun 30 16:23:08 2012 New Revision: 237846 URL: http://svn.freebsd.org/changeset/base/237846 Log: killall(1) does not use libkvm. MFC after: 3 days Modified: head/usr.bin/killall/killall.c Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Sat Jun 30 16:21:51 2012 (r237845) +++ head/usr.bin/killall/killall.c Sat Jun 30 16:23:08 2012 (r237846) @@ -310,7 +310,7 @@ main(int ac, char **av) if (size % sizeof(struct kinfo_proc) != 0) { fprintf(stderr, "proc size mismatch (%zu total, %zu chunks)\n", size, sizeof(struct kinfo_proc)); - fprintf(stderr, "userland out of sync with kernel, recompile libkvm etc\n"); + fprintf(stderr, "userland out of sync with kernel\n"); exit(1); } nprocs = size / sizeof(struct kinfo_proc); From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 16:36:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7079E1065670; Sat, 30 Jun 2012 16:36:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AD978FC08; Sat, 30 Jun 2012 16:36:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UGaNLH029815; Sat, 30 Jun 2012 16:36:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UGaNCB029813; Sat, 30 Jun 2012 16:36:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206301636.q5UGaNCB029813@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 30 Jun 2012 16:36: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: r237847 - head/usr.bin/killall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 16:36:23 -0000 Author: kib Date: Sat Jun 30 16:36:22 2012 New Revision: 237847 URL: http://svn.freebsd.org/changeset/base/237847 Log: Once in a month, when the moon is full, killall mistakenly considers living process as a zombie and refuses to kill it. The cause is that the code masks ki_stat with SZOMB to compare with SZOMB, but ki_stat is not a mask. Possibly reported by: cperciva MFC after: 3 days Modified: head/usr.bin/killall/killall.c Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Sat Jun 30 16:23:08 2012 (r237846) +++ head/usr.bin/killall/killall.c Sat Jun 30 16:36:22 2012 (r237847) @@ -319,7 +319,7 @@ main(int ac, char **av) mypid = getpid(); for (i = 0; i < nprocs; i++) { - if ((procs[i].ki_stat & SZOMB) == SZOMB && !zflag) + if (procs[i].ki_stat == SZOMB && !zflag) continue; thispid = procs[i].ki_pid; strlcpy(thiscmd, procs[i].ki_comm, sizeof(thiscmd)); From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 17:01:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43ABC106566B; Sat, 30 Jun 2012 17:01:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E5E08FC19; Sat, 30 Jun 2012 17:01:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UH1Tww031290; Sat, 30 Jun 2012 17:01:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UH1SmU031288; Sat, 30 Jun 2012 17:01:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206301701.q5UH1SmU031288@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 30 Jun 2012 17:01: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: r237848 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 17:01:29 -0000 Author: kib Date: Sat Jun 30 17:01:28 2012 New Revision: 237848 URL: http://svn.freebsd.org/changeset/base/237848 Log: Remove stray blank line. MFC after: 3 days Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Jun 30 16:36:22 2012 (r237847) +++ head/sys/sys/proc.h Sat Jun 30 17:01:28 2012 (r237848) @@ -627,7 +627,6 @@ struct proc { #define P_SIGEVENT 0x200000 /* Process pending signals changed. */ #define P_SINGLE_BOUNDARY 0x400000 /* Threads should suspend at user boundary. */ #define P_HWPMC 0x800000 /* Process is using HWPMCs */ - #define P_JAILED 0x1000000 /* Process is in jail. */ #define P_ORPHAN 0x2000000 /* Orphaned. */ #define P_INEXEC 0x4000000 /* Process is in execve(). */ From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 18:57:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE1551065672; Sat, 30 Jun 2012 18:57:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7E7C8FC0C; Sat, 30 Jun 2012 18:57:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UIvt2m036017; Sat, 30 Jun 2012 18:57:55 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UIvtPe036014; Sat, 30 Jun 2012 18:57:55 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201206301857.q5UIvtPe036014@svn.freebsd.org> From: Andrew Thompson Date: Sat, 30 Jun 2012 18:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237850 - stable/9/usr.bin/sockstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 18:57:55 -0000 Author: thompsa Date: Sat Jun 30 18:57:55 2012 New Revision: 237850 URL: http://svn.freebsd.org/changeset/base/237850 Log: MFC r237674 Update the usage with the new jail option. Modified: stable/9/usr.bin/sockstat/sockstat.c Directory Properties: stable/9/usr.bin/sockstat/ (props changed) Modified: stable/9/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/9/usr.bin/sockstat/sockstat.c Sat Jun 30 18:56:08 2012 (r237849) +++ stable/9/usr.bin/sockstat/sockstat.c Sat Jun 30 18:57:55 2012 (r237850) @@ -732,7 +732,7 @@ static void usage(void) { fprintf(stderr, - "Usage: sockstat [-46cLlu] [-p ports] [-P protocols]\n"); + "Usage: sockstat [-46cLlu] [-j jid] [-p ports] [-P protocols]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 18:58:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C113C1065707; Sat, 30 Jun 2012 18:58:21 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAD288FC14; Sat, 30 Jun 2012 18:58:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UIwLEI036075; Sat, 30 Jun 2012 18:58:21 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UIwLGu036073; Sat, 30 Jun 2012 18:58:21 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201206301858.q5UIwLGu036073@svn.freebsd.org> From: Andrew Thompson Date: Sat, 30 Jun 2012 18:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237851 - stable/8/usr.bin/sockstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 18:58:22 -0000 Author: thompsa Date: Sat Jun 30 18:58:21 2012 New Revision: 237851 URL: http://svn.freebsd.org/changeset/base/237851 Log: MFC r237674 Update the usage with the new jail option. Modified: stable/8/usr.bin/sockstat/sockstat.c Directory Properties: stable/8/usr.bin/sockstat/ (props changed) Modified: stable/8/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/8/usr.bin/sockstat/sockstat.c Sat Jun 30 18:57:55 2012 (r237850) +++ stable/8/usr.bin/sockstat/sockstat.c Sat Jun 30 18:58:21 2012 (r237851) @@ -732,7 +732,7 @@ static void usage(void) { fprintf(stderr, - "Usage: sockstat [-46cLlu] [-p ports] [-P protocols]\n"); + "Usage: sockstat [-46cLlu] [-j jid] [-p ports] [-P protocols]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 19:09:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9C441065670; Sat, 30 Jun 2012 19:09:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4D468FC12; Sat, 30 Jun 2012 19:09:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UJ926A036536; Sat, 30 Jun 2012 19:09:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UJ92LA036534; Sat, 30 Jun 2012 19:09:02 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201206301909.q5UJ92LA036534@svn.freebsd.org> From: Andrew Thompson Date: Sat, 30 Jun 2012 19:09: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: r237852 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 19:09:02 -0000 Author: thompsa Date: Sat Jun 30 19:09:02 2012 New Revision: 237852 URL: http://svn.freebsd.org/changeset/base/237852 Log: Add the same check as vlan(4) where we ignore the ifnet departure event if the interface is just being renamed. PR: kern/169557 Submitted by: Mark Johnston MFC after: 3 days Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Sat Jun 30 18:58:21 2012 (r237851) +++ head/sys/net/if_lagg.c Sat Jun 30 19:09:02 2012 (r237852) @@ -797,6 +797,9 @@ lagg_port_ifdetach(void *arg __unused, s if ((lp = ifp->if_lagg) == NULL) return; + /* If the ifnet is just being renamed, don't do anything. */ + if (ifp->if_flags & IFF_RENAMING) + return; sc = lp->lp_softc; From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 20:22:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0566C106566B; Sat, 30 Jun 2012 20:22:21 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E14498FC1D; Sat, 30 Jun 2012 20:22:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UKMKVg039694; Sat, 30 Jun 2012 20:22:20 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UKMK2T039692; Sat, 30 Jun 2012 20:22:20 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201206302022.q5UKMK2T039692@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 30 Jun 2012 20:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237853 - stable/9/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 20:22:21 -0000 Author: gavin Date: Sat Jun 30 20:22:20 2012 New Revision: 237853 URL: http://svn.freebsd.org/changeset/base/237853 Log: Merge r237645 from head: The -S option, to specify the sector size, has been usable on all types of memory disks since r135340. Update the man page to reflect this. Noticed by: avg Modified: stable/9/sbin/mdconfig/mdconfig.8 Directory Properties: stable/9/sbin/mdconfig/ (props changed) Modified: stable/9/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/9/sbin/mdconfig/mdconfig.8 Sat Jun 30 19:09:02 2012 (r237852) +++ stable/9/sbin/mdconfig/mdconfig.8 Sat Jun 30 20:22:20 2012 (r237853) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 2008 +.Dd June 27, 2012 .Dt MDCONFIG 8 .Os .Sh NAME @@ -143,7 +143,7 @@ and .Fl t Ar swap are implied if not specified. .It Fl S Ar sectorsize -Sectorsize to use for malloc backed device. +Sectorsize to use for the memory disk, in bytes. .It Fl x Ar sectors/track See the description of the .Fl y From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 20:24:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 534FF106564A; Sat, 30 Jun 2012 20:24:00 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D7C28FC19; Sat, 30 Jun 2012 20:24:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UKO0h2039806; Sat, 30 Jun 2012 20:24:00 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UKO0Jc039803; Sat, 30 Jun 2012 20:24:00 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201206302024.q5UKO0Jc039803@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 30 Jun 2012 20:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237854 - stable/7/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 20:24:00 -0000 Author: gavin Date: Sat Jun 30 20:23:59 2012 New Revision: 237854 URL: http://svn.freebsd.org/changeset/base/237854 Log: Merge r237645 from head: The -S option, to specify the sector size, has been usable on all types of memory disks since r135340. Update the man page to reflect this. Noticed by: avg Modified: stable/7/sbin/mdconfig/mdconfig.8 Directory Properties: stable/7/sbin/mdconfig/ (props changed) Modified: stable/7/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/7/sbin/mdconfig/mdconfig.8 Sat Jun 30 20:22:20 2012 (r237853) +++ stable/7/sbin/mdconfig/mdconfig.8 Sat Jun 30 20:23:59 2012 (r237854) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2007 +.Dd June 27, 2012 .Dt MDCONFIG 8 .Os .Sh NAME @@ -140,7 +140,7 @@ and .Fl t Ar swap are implied if not specified. .It Fl S Ar sectorsize -Sectorsize to use for malloc backed device. +Sectorsize to use for the memory disk, in bytes. .It Fl x Ar sectors/track See the description of the .Fl y From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 20:25:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66C6F1065670; Sat, 30 Jun 2012 20:25:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 526938FC26; Sat, 30 Jun 2012 20:25:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UKPDwN039910; Sat, 30 Jun 2012 20:25:13 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UKPDav039907; Sat, 30 Jun 2012 20:25:13 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201206302025.q5UKPDav039907@svn.freebsd.org> From: Alan Cox Date: Sat, 30 Jun 2012 20:25: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: r237855 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 20:25:13 -0000 Author: alc Date: Sat Jun 30 20:25:12 2012 New Revision: 237855 URL: http://svn.freebsd.org/changeset/base/237855 Log: Optimize reserve_pv_entries() using the popcnt instruction. Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/cpufunc.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Jun 30 20:23:59 2012 (r237854) +++ head/sys/amd64/amd64/pmap.c Sat Jun 30 20:25:12 2012 (r237855) @@ -2408,9 +2408,15 @@ reserve_pv_entries(pmap_t pmap, int need retry: avail = 0; TAILQ_FOREACH(pc, &pmap->pm_pvchunk, pc_list) { - free = popcnt_pc_map_elem(pc->pc_map[0]); - free += popcnt_pc_map_elem(pc->pc_map[1]); - free += popcnt_pc_map_elem(pc->pc_map[2]); + if ((cpu_feature2 & CPUID2_POPCNT) == 0) { + free = popcnt_pc_map_elem(pc->pc_map[0]); + free += popcnt_pc_map_elem(pc->pc_map[1]); + free += popcnt_pc_map_elem(pc->pc_map[2]); + } else { + free = popcntq(pc->pc_map[0]); + free += popcntq(pc->pc_map[1]); + free += popcntq(pc->pc_map[2]); + } if (free == 0) break; avail += free; Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Sat Jun 30 20:23:59 2012 (r237854) +++ head/sys/amd64/include/cpufunc.h Sat Jun 30 20:25:12 2012 (r237855) @@ -273,6 +273,15 @@ outw(u_int port, u_short data) __asm __volatile("outw %0, %w1" : : "a" (data), "Nd" (port)); } +static __inline u_long +popcntq(u_long mask) +{ + u_long result; + + __asm __volatile("popcntq %1,%0" : "=r" (result) : "rm" (mask)); + return (result); +} + static __inline void mfence(void) { From owner-svn-src-all@FreeBSD.ORG Sat Jun 30 20:25:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EF8D1065767; Sat, 30 Jun 2012 20:25:51 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19C158FC1C; Sat, 30 Jun 2012 20:25:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5UKPo9u039970; Sat, 30 Jun 2012 20:25:50 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5UKPoE3039968; Sat, 30 Jun 2012 20:25:50 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201206302025.q5UKPoE3039968@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 30 Jun 2012 20:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237856 - stable/8/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2012 20:25:51 -0000 Author: gavin Date: Sat Jun 30 20:25:50 2012 New Revision: 237856 URL: http://svn.freebsd.org/changeset/base/237856 Log: Merge r237645 from head: The -S option, to specify the sector size, has been usable on all types of memory disks since r135340. Update the man page to reflect this. Noticed by: avg Modified: stable/8/sbin/mdconfig/mdconfig.8 Directory Properties: stable/8/sbin/mdconfig/ (props changed) Modified: stable/8/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/8/sbin/mdconfig/mdconfig.8 Sat Jun 30 20:25:12 2012 (r237855) +++ stable/8/sbin/mdconfig/mdconfig.8 Sat Jun 30 20:25:50 2012 (r237856) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 2008 +.Dd June 27, 2012 .Dt MDCONFIG 8 .Os .Sh NAME @@ -143,7 +143,7 @@ and .Fl t Ar swap are implied if not specified. .It Fl S Ar sectorsize -Sectorsize to use for malloc backed device. +Sectorsize to use for the memory disk, in bytes. .It Fl x Ar sectors/track See the description of the .Fl y