From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 07:14:58 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B58DD106566C; Sun, 17 Jun 2012 07:14:58 +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 A02778FC0A; Sun, 17 Jun 2012 07:14: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 q5H7EwEn091453; Sun, 17 Jun 2012 07:14:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5H7EwCd091451; Sun, 17 Jun 2012 07:14:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206170714.q5H7EwCd091451@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 17 Jun 2012 07:14: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: r237185 - stable/9/sys/vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 07:14:58 -0000 Author: kib Date: Sun Jun 17 07:14:58 2012 New Revision: 237185 URL: http://svn.freebsd.org/changeset/base/237185 Log: MFC r236848: Use the previous stack entry protection and max protection to correctly propagate the stack execution permissions when stack is grown down. Modified: stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Sun Jun 17 05:56:27 2012 (r237184) +++ stable/9/sys/vm/vm_map.c Sun Jun 17 07:14:58 2012 (r237185) @@ -3530,7 +3530,7 @@ Retry: } rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start, - p->p_sysent->sv_stackprot, VM_PROT_ALL, 0); + next_entry->protection, next_entry->max_protection, 0); /* Adjust the available stack space by the amount we grew. */ if (rv == KERN_SUCCESS) { From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 09:42:57 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56F081065674; Sun, 17 Jun 2012 09:42:57 +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 40AF68FC0C; Sun, 17 Jun 2012 09:42: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 q5H9gvou097573; Sun, 17 Jun 2012 09:42:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5H9gv5N097570; Sun, 17 Jun 2012 09:42:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206170942.q5H9gv5N097570@svn.freebsd.org> From: Marius Strobl Date: Sun, 17 Jun 2012 09:42: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: r237186 - stable/9/sys/dev/sym X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 09:42:57 -0000 Author: marius Date: Sun Jun 17 09:42:56 2012 New Revision: 237186 URL: http://svn.freebsd.org/changeset/base/237186 Log: MFC: r237101 Fix a braino in r236469 (MFC'ed to stable/9 in r236468); the number of DMA tags required for handling MAXPHYS should be based on PAGE_SIZE rather than SYM_CONF_DMA_BOUNDARY. While at it, reuse the SYM_CONF_MAX_SG macro for specifying the maximum number of DMA tags so sym(4) itself doesn't size memory beyond what's required for handling MAXPHYS. PR: 168928 Modified: stable/9/sys/dev/sym/sym_conf.h stable/9/sys/dev/sym/sym_hipd.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/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/sym/sym_conf.h ============================================================================== --- stable/9/sys/dev/sym/sym_conf.h Sun Jun 17 07:14:58 2012 (r237185) +++ stable/9/sys/dev/sym/sym_conf.h Sun Jun 17 09:42:56 2012 (r237186) @@ -90,11 +90,12 @@ #define SYM_CONF_DMA_BOUNDARY (1UL << 24) /* - * Max number of scatter/gather entries for en IO. + * Max number of scatter/gather entries for an I/O. * Each entry costs 8 bytes in the internal CCB data structure. - * For now 65 should suffice given the BSD O/Ses capabilities. + * We use at most 33 segments but also no more than required for handling + * MAXPHYS. */ -#define SYM_CONF_MAX_SG (33) +#define SYM_CONF_MAX_SG (MIN(33, (MAXPHYS / PAGE_SIZE) + 1)) /* * Max number of targets. Modified: stable/9/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/9/sys/dev/sym/sym_hipd.c Sun Jun 17 07:14:58 2012 (r237185) +++ stable/9/sys/dev/sym/sym_hipd.c Sun Jun 17 09:42:56 2012 (r237186) @@ -1609,7 +1609,6 @@ struct sym_hcb { u_int features; /* Chip features map */ u_char myaddr; /* SCSI id of the adapter */ u_char maxburst; /* log base 2 of dwords burst */ - u_char maxsegcnt; /* Max DMA S/G segments */ u_char maxwide; /* Maximum transfer width */ u_char minsync; /* Min sync period factor (ST) */ u_char maxsync; /* Max sync period factor (ST) */ @@ -8135,7 +8134,7 @@ static void sym_action2(struct cam_sim * cpi->xport_specific.spi.ppr_options = SID_SPI_CLOCK_DT_ST; } - cpi->maxio = np->maxsegcnt * SYM_CONF_DMA_BOUNDARY; + cpi->maxio = SYM_CONF_MAX_SG * PAGE_SIZE; sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; case XPT_ABORT: @@ -8536,11 +8535,9 @@ sym_pci_attach(device_t dev) /* * Allocate a tag for the DMA of user data. */ - np->maxsegcnt = MIN(SYM_CONF_MAX_SG, - (MAXPHYS / SYM_CONF_DMA_BOUNDARY) + 1); if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - BUS_SPACE_MAXSIZE, np->maxsegcnt, SYM_CONF_DMA_BOUNDARY, + BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY, BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { device_printf(dev, "failed to create DMA tag.\n"); goto attach_failed; From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 09:43:05 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5167010657A1; Sun, 17 Jun 2012 09:43:05 +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 3B2C98FC0A; Sun, 17 Jun 2012 09:43:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5H9h5Yu097616; Sun, 17 Jun 2012 09:43:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5H9h4cZ097613; Sun, 17 Jun 2012 09:43:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206170943.q5H9h4cZ097613@svn.freebsd.org> From: Marius Strobl Date: Sun, 17 Jun 2012 09:43: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: r237187 - stable/8/sys/dev/sym X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 09:43:05 -0000 Author: marius Date: Sun Jun 17 09:43:04 2012 New Revision: 237187 URL: http://svn.freebsd.org/changeset/base/237187 Log: MFC: r237101 Fix a braino in r236469 (MFC'ed to stable/8 in r236469); the number of DMA tags required for handling MAXPHYS should be based on PAGE_SIZE rather than SYM_CONF_DMA_BOUNDARY. While at it, reuse the SYM_CONF_MAX_SG macro for specifying the maximum number of DMA tags so sym(4) itself doesn't size memory beyond what's required for handling MAXPHYS. PR: 168928 Modified: stable/8/sys/dev/sym/sym_conf.h stable/8/sys/dev/sym/sym_hipd.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/sym/sym_conf.h ============================================================================== --- stable/8/sys/dev/sym/sym_conf.h Sun Jun 17 09:42:56 2012 (r237186) +++ stable/8/sys/dev/sym/sym_conf.h Sun Jun 17 09:43:04 2012 (r237187) @@ -90,11 +90,12 @@ #define SYM_CONF_DMA_BOUNDARY (1UL << 24) /* - * Max number of scatter/gather entries for en IO. + * Max number of scatter/gather entries for an I/O. * Each entry costs 8 bytes in the internal CCB data structure. - * For now 65 should suffice given the BSD O/Ses capabilities. + * We use at most 33 segments but also no more than required for handling + * MAXPHYS. */ -#define SYM_CONF_MAX_SG (33) +#define SYM_CONF_MAX_SG (MIN(33, (MAXPHYS / PAGE_SIZE) + 1)) /* * Max number of targets. Modified: stable/8/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/8/sys/dev/sym/sym_hipd.c Sun Jun 17 09:42:56 2012 (r237186) +++ stable/8/sys/dev/sym/sym_hipd.c Sun Jun 17 09:43:04 2012 (r237187) @@ -1609,7 +1609,6 @@ struct sym_hcb { u_int features; /* Chip features map */ u_char myaddr; /* SCSI id of the adapter */ u_char maxburst; /* log base 2 of dwords burst */ - u_char maxsegcnt; /* Max DMA S/G segments */ u_char maxwide; /* Maximum transfer width */ u_char minsync; /* Min sync period factor (ST) */ u_char maxsync; /* Max sync period factor (ST) */ @@ -8135,7 +8134,7 @@ static void sym_action2(struct cam_sim * cpi->xport_specific.spi.ppr_options = SID_SPI_CLOCK_DT_ST; } - cpi->maxio = np->maxsegcnt * SYM_CONF_DMA_BOUNDARY; + cpi->maxio = SYM_CONF_MAX_SG * PAGE_SIZE; sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; case XPT_ABORT: @@ -8536,11 +8535,9 @@ sym_pci_attach(device_t dev) /* * Allocate a tag for the DMA of user data. */ - np->maxsegcnt = MIN(SYM_CONF_MAX_SG, - (MAXPHYS / SYM_CONF_DMA_BOUNDARY) + 1); if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - BUS_SPACE_MAXSIZE, np->maxsegcnt, SYM_CONF_DMA_BOUNDARY, + BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY, BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { device_printf(dev, "failed to create DMA tag.\n"); goto attach_failed; From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 09:50:56 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0C6C1065672; Sun, 17 Jun 2012 09:50:56 +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 C15118FC08; Sun, 17 Jun 2012 09:50: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 q5H9ouun098037; Sun, 17 Jun 2012 09:50:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5H9ougE098034; Sun, 17 Jun 2012 09:50:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206170950.q5H9ougE098034@svn.freebsd.org> From: Marius Strobl Date: Sun, 17 Jun 2012 09:50: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: r237188 - in stable/9/sys/dev/usb: . serial X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 09:50:57 -0000 Author: marius Date: Sun Jun 17 09:50:56 2012 New Revision: 237188 URL: http://svn.freebsd.org/changeset/base/237188 Log: MFC: r230179 BeagleBone uses an FTDI chip with an altered Product ID. Modified: stable/9/sys/dev/usb/serial/uftdi.c stable/9/sys/dev/usb/usbdevs 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/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/usb/serial/uftdi.c ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi.c Sun Jun 17 09:43:04 2012 (r237187) +++ stable/9/sys/dev/usb/serial/uftdi.c Sun Jun 17 09:50:56 2012 (r237188) @@ -217,6 +217,7 @@ static STRUCT_USB_HOST_ID uftdi_devs[] = UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO), UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM), UFTDI_DEV(FTDI, SERIAL_2232D, 8U232AM), + UFTDI_DEV(FTDI, BEAGLEBONE, 8U232AM), UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Sun Jun 17 09:43:04 2012 (r237187) +++ stable/9/sys/dev/usb/usbdevs Sun Jun 17 09:50:56 2012 (r237188) @@ -1604,6 +1604,7 @@ product FTDI SERIAL_8U232AM 0x6001 8U232 product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial +product FTDI BEAGLEBONE 0xA6D0 BeagleBone product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 09:51:00 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63997106564A; Sun, 17 Jun 2012 09:51:00 +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 341DA8FC0A; Sun, 17 Jun 2012 09:51: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 q5H9p0IY098075; Sun, 17 Jun 2012 09:51:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5H9oxZH098072; Sun, 17 Jun 2012 09:51:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206170951.q5H9oxZH098072@svn.freebsd.org> From: Marius Strobl Date: Sun, 17 Jun 2012 09:50:59 +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: r237189 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 09:51:00 -0000 Author: marius Date: Sun Jun 17 09:50:59 2012 New Revision: 237189 URL: http://svn.freebsd.org/changeset/base/237189 Log: MFC: r230179 BeagleBone uses an FTDI chip with an altered Product ID. Modified: stable/8/sys/dev/usb/serial/uftdi.c stable/8/sys/dev/usb/usbdevs 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/usb/serial/uftdi.c ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi.c Sun Jun 17 09:50:56 2012 (r237188) +++ stable/8/sys/dev/usb/serial/uftdi.c Sun Jun 17 09:50:59 2012 (r237189) @@ -217,6 +217,7 @@ static STRUCT_USB_HOST_ID uftdi_devs[] = UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO), UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM), UFTDI_DEV(FTDI, SERIAL_2232D, 8U232AM), + UFTDI_DEV(FTDI, BEAGLEBONE, 8U232AM), UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sun Jun 17 09:50:56 2012 (r237188) +++ stable/8/sys/dev/usb/usbdevs Sun Jun 17 09:50:59 2012 (r237189) @@ -1600,6 +1600,7 @@ product FTDI SERIAL_8U232AM 0x6001 8U232 product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial +product FTDI BEAGLEBONE 0xA6D0 BeagleBone product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 11:16:15 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6629C1065673; Sun, 17 Jun 2012 11:16:15 +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 27AE38FC0C; Sun, 17 Jun 2012 11:16: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 q5HBGF2v004717; Sun, 17 Jun 2012 11:16:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HBGEIQ004715; Sun, 17 Jun 2012 11:16:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206171116.q5HBGEIQ004715@svn.freebsd.org> From: Marius Strobl Date: Sun, 17 Jun 2012 11:16:14 +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: r237191 - stable/9/sys/dev/ata/chipsets X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 11:16:15 -0000 Author: marius Date: Sun Jun 17 11:16:14 2012 New Revision: 237191 URL: http://svn.freebsd.org/changeset/base/237191 Log: MFC: r237107 - As a baind-aid, disable ATAPI DMA when using ATA_CAM for these controllers as well as it causes the kernel to hang during boot. Reported and tested by: Kevin Oberman - Use NULL instead of 0 for a pointer. Modified: stable/9/sys/dev/ata/chipsets/ata-ite.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/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/ata/chipsets/ata-ite.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-ite.c Sun Jun 17 11:04:38 2012 (r237190) +++ stable/9/sys/dev/ata/chipsets/ata-ite.c Sun Jun 17 11:16:14 2012 (r237191) @@ -105,10 +105,10 @@ ata_ite_chipinit(device_t dev) ctlr->setmode = ata_ite_821x_setmode; /* No timing restrictions initally. */ - ctlr->chipset_data = (void *)0; + ctlr->chipset_data = NULL; } ctlr->ch_attach = ata_ite_ch_attach; - return 0; + return (0); } static int @@ -119,6 +119,9 @@ ata_ite_ch_attach(device_t dev) error = ata_pci_ch_attach(dev); ch->flags |= ATA_CHECKS_CABLE; +#ifdef ATA_CAM + ch->flags |= ATA_NO_ATAPI_DMA; +#endif return (error); } From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 11:16:18 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0361D106566C; Sun, 17 Jun 2012 11:16:18 +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 E26228FC14; Sun, 17 Jun 2012 11:16: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 q5HBGHAA004751; Sun, 17 Jun 2012 11:16:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HBGHTH004749; Sun, 17 Jun 2012 11:16:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206171116.q5HBGHTH004749@svn.freebsd.org> From: Marius Strobl Date: Sun, 17 Jun 2012 11:16: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: r237192 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 11:16:18 -0000 Author: marius Date: Sun Jun 17 11:16:17 2012 New Revision: 237192 URL: http://svn.freebsd.org/changeset/base/237192 Log: MFC: r237107 - As a baind-aid, disable ATAPI DMA when using ATA_CAM for these controllers as well as it causes the kernel to hang during boot. Reported and tested by: Kevin Oberman - Use NULL instead of 0 for a pointer. Modified: stable/8/sys/dev/ata/chipsets/ata-ite.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/ata/chipsets/ata-ite.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ite.c Sun Jun 17 11:16:14 2012 (r237191) +++ stable/8/sys/dev/ata/chipsets/ata-ite.c Sun Jun 17 11:16:17 2012 (r237192) @@ -105,10 +105,10 @@ ata_ite_chipinit(device_t dev) ctlr->setmode = ata_ite_821x_setmode; /* No timing restrictions initally. */ - ctlr->chipset_data = (void *)0; + ctlr->chipset_data = NULL; } ctlr->ch_attach = ata_ite_ch_attach; - return 0; + return (0); } static int @@ -119,6 +119,9 @@ ata_ite_ch_attach(device_t dev) error = ata_pci_ch_attach(dev); ch->flags |= ATA_CHECKS_CABLE; +#ifdef ATA_CAM + ch->flags |= ATA_NO_ATAPI_DMA; +#endif return (error); } From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 19:16:32 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D7E1065670; Sun, 17 Jun 2012 19:16:32 +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 8D2398FC0A; Sun, 17 Jun 2012 19:16: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 q5HJGW7H027224; Sun, 17 Jun 2012 19:16:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HJGW1u027222; Sun, 17 Jun 2012 19:16:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206171916.q5HJGW1u027222@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 17 Jun 2012 19:16: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: r237201 - stable/9/sys/dev/drm2/i915 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 19:16:32 -0000 Author: kib Date: Sun Jun 17 19:16:31 2012 New Revision: 237201 URL: http://svn.freebsd.org/changeset/base/237201 Log: MFC r237131: Use right size when freeing unneeded GTT mapping. Modified: stable/9/sys/dev/drm2/i915/i915_gem.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- stable/9/sys/dev/drm2/i915/i915_gem.c Sun Jun 17 18:34:04 2012 (r237200) +++ stable/9/sys/dev/drm2/i915/i915_gem.c Sun Jun 17 19:16:31 2012 (r237201) @@ -1064,7 +1064,7 @@ i915_gem_gtt_write(struct drm_device *de IDX_TO_OFF(obj_pi), size, PAT_WRITE_COMBINING); ret = -copyin_nofault((void *)(uintptr_t)data_ptr, (char *)mkva + obj_po, size); - pmap_unmapdev(mkva, PAGE_SIZE); + pmap_unmapdev(mkva, size); return (ret); } From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 21:06:36 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4664106564A; Sun, 17 Jun 2012 21:06:36 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A694B8FC17; Sun, 17 Jun 2012 21:06: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 q5HL6afJ032634; Sun, 17 Jun 2012 21:06:36 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HL6a4O032632; Sun, 17 Jun 2012 21:06:36 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206172106.q5HL6a4O032632@svn.freebsd.org> From: Doug Barton Date: Sun, 17 Jun 2012 21:06: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: r237205 - stable/9/sys/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 21:06:37 -0000 Author: dougb Date: Sun Jun 17 21:06:36 2012 New Revision: 237205 URL: http://svn.freebsd.org/changeset/base/237205 Log: Improve the functionality of the PORTS_MODULES knob by adding LOCALBASE/bin and sbin to PATH, which allows dependencies to be found; adding SRC_BASE and OSVERSION to match the new kernel, and putting the related builds under MAKEOBJDIRPREFIX so that they only need to be built once per kernel. In addition to the PR this includes ideas/contributions from crees and matthew. PR: ports/161452 Submitted by: Garrett Cooper Modified: stable/9/sys/conf/kern.post.mk Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/kern.post.mk ============================================================================== --- stable/9/sys/conf/kern.post.mk Sun Jun 17 21:04:22 2012 (r237204) +++ stable/9/sys/conf/kern.post.mk Sun Jun 17 21:06:36 2012 (r237205) @@ -36,9 +36,30 @@ modules-${target}: .endif .endfor -# Handle out of tree ports +# Handle ports (as defined by the user) that build kernel modules .if !defined(NO_MODULES) && defined(PORTS_MODULES) -PORTSMODULESENV=SYSDIR=${SYSDIR} +# +# The ports tree needs some environment variables defined to match the new kernel +# +# Ports search for some dependencies in PATH, so add the location of the installed files +LOCALBASE?= /usr/local +# SRC_BASE is how the ports tree refers to the location of the base source files +.if !defined(SRC_BASE) +SRC_BASE!= realpath "${SYSDIR:H}/" +.endif +# OSVERSION is used by some ports to determine build options +.if !defined(OSRELDATE) +# Definition copied from src/Makefile.inc1 +OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ + ${MAKEOBJDIRPREFIX}${SRC_BASE}/include/osreldate.h +.endif +# Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build +WRKDIRPREFIX?= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF} +PORTSMODULESENV=\ + PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \ + SRC_BASE=${SRC_BASE} \ + OSVERSION=${OSRELDATE} \ + WRKDIRPREFIX=${WRKDIRPREFIX} .for __target in all install reinstall clean ${__target}: ports-${__target} ports-${__target}: From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 21:07:01 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 510981065687; Sun, 17 Jun 2012 21:07:01 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2288A8FC0A; Sun, 17 Jun 2012 21: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 q5HL70ZH032695; Sun, 17 Jun 2012 21:07:00 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HL70wQ032692; Sun, 17 Jun 2012 21:07:00 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206172107.q5HL70wQ032692@svn.freebsd.org> From: Doug Barton Date: Sun, 17 Jun 2012 21:07: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: r237206 - stable/8/sys/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 21:07:01 -0000 Author: dougb Date: Sun Jun 17 21:07:00 2012 New Revision: 237206 URL: http://svn.freebsd.org/changeset/base/237206 Log: Improve the functionality of the PORTS_MODULES knob by adding LOCALBASE/bin and sbin to PATH, which allows dependencies to be found; adding SRC_BASE and OSVERSION to match the new kernel, and putting the related builds under MAKEOBJDIRPREFIX so that they only need to be built once per kernel. In addition to the PR this includes ideas/contributions from crees and matthew. PR: ports/161452 Submitted by: Garrett Cooper Modified: stable/8/sys/conf/kern.post.mk Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/conf/kern.post.mk ============================================================================== --- stable/8/sys/conf/kern.post.mk Sun Jun 17 21:06:36 2012 (r237205) +++ stable/8/sys/conf/kern.post.mk Sun Jun 17 21:07:00 2012 (r237206) @@ -28,9 +28,30 @@ modules-${target}: .endif .endfor -# Handle out of tree ports +# Handle ports (as defined by the user) that build kernel modules .if !defined(NO_MODULES) && defined(PORTS_MODULES) -PORTSMODULESENV=SYSDIR=${SYSDIR} +# +# The ports tree needs some environment variables defined to match the new kernel +# +# Ports search for some dependencies in PATH, so add the location of the installed files +LOCALBASE?= /usr/local +# SRC_BASE is how the ports tree refers to the location of the base source files +.if !defined(SRC_BASE) +SRC_BASE!= realpath "${SYSDIR:H}/" +.endif +# OSVERSION is used by some ports to determine build options +.if !defined(OSRELDATE) +# Definition copied from src/Makefile.inc1 +OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ + ${MAKEOBJDIRPREFIX}${SRC_BASE}/include/osreldate.h +.endif +# Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build +WRKDIRPREFIX?= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF} +PORTSMODULESENV=\ + PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \ + SRC_BASE=${SRC_BASE} \ + OSVERSION=${OSRELDATE} \ + WRKDIRPREFIX=${WRKDIRPREFIX} .for __target in all install reinstall clean ${__target}: ports-${__target} ports-${__target}: From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 21:07:28 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B6221065680; Sun, 17 Jun 2012 21:07:28 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CDB28FC14; Sun, 17 Jun 2012 21:07: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 q5HL7SXt032754; Sun, 17 Jun 2012 21:07:28 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HL7SQj032752; Sun, 17 Jun 2012 21:07:28 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206172107.q5HL7SQj032752@svn.freebsd.org> From: Doug Barton Date: Sun, 17 Jun 2012 21:07:28 +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: r237207 - stable/7/sys/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 21:07:28 -0000 Author: dougb Date: Sun Jun 17 21:07:27 2012 New Revision: 237207 URL: http://svn.freebsd.org/changeset/base/237207 Log: Improve the functionality of the PORTS_MODULES knob by adding LOCALBASE/bin and sbin to PATH, which allows dependencies to be found; adding SRC_BASE and OSVERSION to match the new kernel, and putting the related builds under MAKEOBJDIRPREFIX so that they only need to be built once per kernel. In addition to the PR this includes ideas/contributions from crees and matthew. PR: ports/161452 Submitted by: Garrett Cooper Modified: stable/7/sys/conf/kern.post.mk Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/conf/kern.post.mk ============================================================================== --- stable/7/sys/conf/kern.post.mk Sun Jun 17 21:07:00 2012 (r237206) +++ stable/7/sys/conf/kern.post.mk Sun Jun 17 21:07:27 2012 (r237207) @@ -28,9 +28,30 @@ modules-${target}: .endif .endfor -# Handle out of tree ports +# Handle ports (as defined by the user) that build kernel modules .if !defined(NO_MODULES) && defined(PORTS_MODULES) -PORTSMODULESENV=SYSDIR=${SYSDIR} +# +# The ports tree needs some environment variables defined to match the new kernel +# +# Ports search for some dependencies in PATH, so add the location of the installed files +LOCALBASE?= /usr/local +# SRC_BASE is how the ports tree refers to the location of the base source files +.if !defined(SRC_BASE) +SRC_BASE!= realpath "${SYSDIR:H}/" +.endif +# OSVERSION is used by some ports to determine build options +.if !defined(OSRELDATE) +# Definition copied from src/Makefile.inc1 +OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ + ${MAKEOBJDIRPREFIX}${SRC_BASE}/include/osreldate.h +.endif +# Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build +WRKDIRPREFIX?= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF} +PORTSMODULESENV=\ + PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \ + SRC_BASE=${SRC_BASE} \ + OSVERSION=${OSRELDATE} \ + WRKDIRPREFIX=${WRKDIRPREFIX} .for __target in all install reinstall clean ${__target}: ports-${__target} ports-${__target}: From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 21:11:46 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id E7623106566B; Sun, 17 Jun 2012 21:11:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 89BD1162878; Sun, 17 Jun 2012 21:11:24 +0000 (UTC) Message-ID: <4FDE47FC.3090809@FreeBSD.org> Date: Sun, 17 Jun 2012 14:11:24 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120609 Thunderbird/13.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org References: <201206172106.q5HL6a4O032632@svn.freebsd.org> In-Reply-To: <201206172106.q5HL6a4O032632@svn.freebsd.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r237205 - stable/9/sys/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 21:11:47 -0000 On 06/17/2012 14:06, Doug Barton wrote: > stable/9/sys/conf/ (props changed) There is what looks like a really large amount of crufty mergeinfo on stable/9/sys/conf. The diff was large and hairy enough that I didn't feel comfortable tackling it in the time I have allotted today. Given that 9 is still a fairly new branch, it would probably be good if someone with the knowledge and time were to see about cleaning it up. ... which leads to the gentle reminder, always do merges for files under sys/ IN sys/. Doug -- This .signature sanitized for your protection From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 21:28:12 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 202FC106564A; Sun, 17 Jun 2012 21:28:12 +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 07DDC8FC08; Sun, 17 Jun 2012 21:28: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 q5HLSBg0033754; Sun, 17 Jun 2012 21:28:11 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HLSBD3033748; Sun, 17 Jun 2012 21:28:11 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201206172128.q5HLSBD3033748@svn.freebsd.org> From: Matt Jacob Date: Sun, 17 Jun 2012 21:28: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: r237208 - in stable/9/sys: conf dev/isp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 21:28:12 -0000 Author: mjacob Date: Sun Jun 17 21:28:11 2012 New Revision: 237208 URL: http://svn.freebsd.org/changeset/base/237208 Log: MFC of r236427 Clean up and complete the incomplete deferred enable code. Make the default role NONE if target mode is selected. This allows ctl(8) to switch to/from target mode via knob settings. If we default to role 'none', this causes a reset of the 24XX f/w which then causes initiators to wake up and notice when we come online. Modified: stable/9/sys/conf/NOTES stable/9/sys/dev/isp/isp.c stable/9/sys/dev/isp/isp_freebsd.c stable/9/sys/dev/isp/isp_freebsd.h stable/9/sys/dev/isp/ispvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Sun Jun 17 21:07:27 2012 (r237207) +++ stable/9/sys/conf/NOTES Sun Jun 17 21:28:11 2012 (r237208) @@ -1592,7 +1592,7 @@ options ISP_TARGET_MODE=1 # # ISP_INTERNAL_TARGET (trivial internal disk target, for testing) # -options ISP_DEFAULT_ROLES=2 +options ISP_DEFAULT_ROLES=0 # Options used in dev/sym/ (Symbios SCSI driver). #options SYM_SETUP_LP_PROBE_MAP #-Low Priority Probe Map (bits) Modified: stable/9/sys/dev/isp/isp.c ============================================================================== --- stable/9/sys/dev/isp/isp.c Sun Jun 17 21:07:27 2012 (r237207) +++ stable/9/sys/dev/isp/isp.c Sun Jun 17 21:28:11 2012 (r237208) @@ -2277,6 +2277,11 @@ isp_port_login(ispsoftc_t *isp, uint16_t } } +/* + * Pre-24XX fabric port logout + * + * Note that portid is not used + */ static int isp_port_logout(ispsoftc_t *isp, uint16_t handle, uint32_t portid) { @@ -2721,7 +2726,7 @@ not_on_fabric: * layer appropriately). * * We also do initiator map target id assignment here for new initiator - * devices and refresh old ones ot make sure that they point to the corret + * devices and refresh old ones ot make sure that they point to the correct * entities. */ static int Modified: stable/9/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/9/sys/dev/isp/isp_freebsd.c Sun Jun 17 21:07:27 2012 (r237207) +++ stable/9/sys/dev/isp/isp_freebsd.c Sun Jun 17 21:28:11 2012 (r237208) @@ -773,6 +773,9 @@ isp_free_pcmd(ispsoftc_t *isp, union ccb */ #ifdef ISP_TARGET_MODE +static ISP_INLINE void isp_tmlock(ispsoftc_t *, const char *); +static ISP_INLINE void isp_tmunlk(ispsoftc_t *); +static ISP_INLINE int is_any_lun_enabled(ispsoftc_t *, int); static ISP_INLINE int is_lun_enabled(ispsoftc_t *, int, lun_id_t); static ISP_INLINE tstate_t *get_lun_statep(ispsoftc_t *, int, lun_id_t); static ISP_INLINE tstate_t *get_lun_statep_from_tag(ispsoftc_t *, int, uint32_t); @@ -786,10 +789,11 @@ static ISP_INLINE void isp_put_ntpd(isps static cam_status create_lun_state(ispsoftc_t *, int, struct cam_path *, tstate_t **); static void destroy_lun_state(ispsoftc_t *, tstate_t *); static void isp_enable_lun(ispsoftc_t *, union ccb *); -static void isp_enable_deferred_luns(ispsoftc_t *, int); +static cam_status isp_enable_deferred_luns(ispsoftc_t *, int); static cam_status isp_enable_deferred(ispsoftc_t *, int, lun_id_t); static void isp_disable_lun(ispsoftc_t *, union ccb *); static int isp_enable_target_mode(ispsoftc_t *, int); +static int isp_disable_target_mode(ispsoftc_t *, int); static void isp_ledone(ispsoftc_t *, lun_entry_t *); static timeout_t isp_refire_putback_atio; static void isp_complete_ctio(union ccb *); @@ -807,6 +811,40 @@ static void isp_handle_platform_target_t static void isp_target_mark_aborted(ispsoftc_t *, union ccb *); static void isp_target_mark_aborted_early(ispsoftc_t *, tstate_t *, uint32_t); +static ISP_INLINE void +isp_tmlock(ispsoftc_t *isp, const char *msg) +{ + while (isp->isp_osinfo.tmbusy) { + isp->isp_osinfo.tmwanted = 1; + mtx_sleep(isp, &isp->isp_lock, PRIBIO, msg, 0); + } + isp->isp_osinfo.tmbusy = 1; +} + +static ISP_INLINE void +isp_tmunlk(ispsoftc_t *isp) +{ + isp->isp_osinfo.tmbusy = 0; + if (isp->isp_osinfo.tmwanted) { + isp->isp_osinfo.tmwanted = 0; + wakeup(isp); + } +} + +static ISP_INLINE int +is_any_lun_enabled(ispsoftc_t *isp, int bus) +{ + struct tslist *lhp; + int i; + + for (i = 0; i < LUN_HASH_SIZE; i++) { + ISP_GET_PC_ADDR(isp, bus, lun_hash[i], lhp); + if (SLIST_FIRST(lhp)) + return (1); + } + return (0); +} + static ISP_INLINE int is_lun_enabled(ispsoftc_t *isp, int bus, lun_id_t lun) { @@ -909,6 +947,7 @@ get_ntp_from_tagdata(ispsoftc_t *isp, ui } return (NULL); } + static ISP_INLINE void rls_lun_statep(ispsoftc_t *isp, tstate_t *tptr) { @@ -1050,7 +1089,7 @@ create_lun_state(ispsoftc_t *isp, int bu if (is_lun_enabled(isp, bus, lun)) { return (CAM_LUN_ALRDY_ENA); } - tptr = (tstate_t *) malloc(sizeof (tstate_t), M_DEVBUF, M_NOWAIT|M_ZERO); + tptr = malloc(sizeof (tstate_t), M_DEVBUF, M_NOWAIT|M_ZERO); if (tptr == NULL) { return (CAM_RESRC_UNAVAIL); } @@ -1079,10 +1118,12 @@ static ISP_INLINE void destroy_lun_state(ispsoftc_t *isp, tstate_t *tptr) { struct tslist *lhp; + KASSERT((tptr->hold != 0), ("tptr is not held")); KASSERT((tptr->hold == 1), ("tptr still held (%d)", tptr->hold)); ISP_GET_PC_ADDR(isp, cam_sim_bus(xpt_path_sim(tptr->owner)), lun_hash[LUN_HASH_FUNC(xpt_path_lun_id(tptr->owner))], lhp); SLIST_REMOVE(lhp, tptr, tstate, next); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, tptr->owner, "destroyed tstate\n"); xpt_free_path(tptr->owner); free(tptr, M_DEVBUF); } @@ -1098,12 +1139,14 @@ isp_enable_lun(ispsoftc_t *isp, union cc target_id_t target; lun_id_t lun; + /* * We only support either a wildcard target/lun or a target ID of zero and a non-wildcard lun */ bus = XS_CHANNEL(ccb); target = ccb->ccb_h.target_id; lun = ccb->ccb_h.target_lun; + ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, "enabling lun %u\n", lun); if (target != CAM_TARGET_WILDCARD && target != 0) { ccb->ccb_h.status = CAM_TID_INVALID; xpt_done(ccb); @@ -1127,11 +1170,7 @@ isp_enable_lun(ispsoftc_t *isp, union cc /* * Wait until we're not busy with the lun enables subsystem */ - while (isp->isp_osinfo.tmbusy) { - isp->isp_osinfo.tmwanted = 1; - mtx_sleep(isp, &isp->isp_lock, PRIBIO, "want_isp_enable_lun", 0); - } - isp->isp_osinfo.tmbusy = 1; + isp_tmlock(isp, "isp_enable_lun"); /* * This is as a good a place as any to check f/w capabilities. @@ -1200,7 +1239,7 @@ isp_enable_lun(ispsoftc_t *isp, union cc if (tm_enabled == 0) { ISP_SET_PC(isp, bus, tm_enable_defer, 1); ccb->ccb_h.status = CAM_REQ_CMP; - xpt_print(ccb->ccb_h.path, "Target Mode Not Enabled Yet- Lun Enables Deferred\n"); + xpt_print(ccb->ccb_h.path, "Target Mode not enabled yet- lun enable deferred\n"); goto done; } @@ -1210,37 +1249,78 @@ isp_enable_lun(ispsoftc_t *isp, union cc ccb->ccb_h.status = isp_enable_deferred(isp, bus, lun); done: - if (ccb->ccb_h.status != CAM_REQ_CMP && tptr) { - destroy_lun_state(isp, tptr); - tptr = NULL; + if (ccb->ccb_h.status != CAM_REQ_CMP) { + if (tptr) { + destroy_lun_state(isp, tptr); + tptr = NULL; + } + } else { + tptr->enabled = 1; } if (tptr) { rls_lun_statep(isp, tptr); } - isp->isp_osinfo.tmbusy = 0; - if (isp->isp_osinfo.tmwanted) { - isp->isp_osinfo.tmwanted = 0; - wakeup(isp); - } + + /* + * And we're outta here.... + */ + isp_tmunlk(isp); xpt_done(ccb); } -static void +static cam_status isp_enable_deferred_luns(ispsoftc_t *isp, int bus) { + tstate_t *tptr = NULL; + struct tslist *lhp; + int i, n; + + ISP_GET_PC(isp, bus, tm_enabled, i); + if (i == 1) { + return (CAM_REQ_CMP); + } + ISP_GET_PC(isp, bus, tm_enable_defer, i); + if (i == 0) { + return (CAM_REQ_CMP); + } /* - * XXX: not entirely implemented yet + * If this succeeds, it will set tm_enable */ - (void) isp_enable_deferred(isp, bus, 0); + if (isp_enable_target_mode(isp, bus)) { + return (CAM_REQ_CMP_ERR); + } + isp_tmlock(isp, "isp_enable_deferred_luns"); + for (n = i = 0; i < LUN_HASH_SIZE; i++) { + ISP_GET_PC_ADDR(isp, bus, lun_hash[i], lhp); + SLIST_FOREACH(tptr, lhp, next) { + tptr->hold++; + if (tptr->enabled == 0) { + if (isp_enable_deferred(isp, bus, xpt_path_lun_id(tptr->owner)) == 0) { + tptr->enabled = 1; + n++; + } + } else { + n++; + } + tptr->hold--; + } + } + isp_tmunlk(isp); + if (n == 0) { + return (CAM_REQ_CMP_ERR); + } + ISP_SET_PC(isp, bus, tm_enable_defer, 0); + return (CAM_REQ_CMP); } -static uint32_t +static cam_status isp_enable_deferred(ispsoftc_t *isp, int bus, lun_id_t lun) { cam_status status; + int luns_already_enabled = ISP_FC_PC(isp, bus)->tm_luns_enabled; isp_prt(isp, ISP_LOGTINFO, "%s: bus %d lun %u", __func__, bus, lun); - if (IS_24XX(isp) || (IS_FC(isp) && ISP_FC_PC(isp, bus)->tm_luns_enabled)) { + if (IS_24XX(isp) || (IS_FC(isp) && luns_already_enabled)) { status = CAM_REQ_CMP; } else { int cmd_cnt, not_cnt; @@ -1261,10 +1341,9 @@ isp_enable_deferred(ispsoftc_t *isp, int } isp->isp_osinfo.rptr = NULL; } - if (status == CAM_REQ_CMP) { ISP_SET_PC(isp, bus, tm_luns_enabled, 1); - isp_prt(isp, ISP_LOGTINFO, "bus %d lun %u now enabled for target mode", bus, lun); + isp_prt(isp, ISP_LOGCONFIG|ISP_LOGTINFO, "bus %d lun %u now enabled for target mode", bus, lun); } return (status); } @@ -1281,11 +1360,13 @@ isp_disable_lun(ispsoftc_t *isp, union c bus = XS_CHANNEL(ccb); target = ccb->ccb_h.target_id; lun = ccb->ccb_h.target_lun; + ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, "disabling lun %u\n", lun); if (target != CAM_TARGET_WILDCARD && target != 0) { ccb->ccb_h.status = CAM_TID_INVALID; xpt_done(ccb); return; } + if (target == CAM_TARGET_WILDCARD && lun != CAM_LUN_WILDCARD) { ccb->ccb_h.status = CAM_LUN_INVALID; xpt_done(ccb); @@ -1297,18 +1378,11 @@ isp_disable_lun(ispsoftc_t *isp, union c xpt_done(ccb); return; } - if (isp->isp_dblev & ISP_LOGTDEBUG0) { - xpt_print(ccb->ccb_h.path, "enabling lun 0x%x on channel %d\n", lun, bus); - } /* * See if we're busy disabling a lun now. */ - while (isp->isp_osinfo.tmbusy) { - isp->isp_osinfo.tmwanted = 1; - mtx_sleep(isp, &isp->isp_lock, PRIBIO, "want_isp_disable_lun", 0); - } - isp->isp_osinfo.tmbusy = 1; + isp_tmlock(isp, "isp_disable_lun"); status = CAM_REQ_INPROG; /* @@ -1333,85 +1407,86 @@ isp_disable_lun(ispsoftc_t *isp, union c if (IS_FC(isp)) { lun = 0; } - isp->isp_osinfo.rptr = &status; if (isp_lun_cmd(isp, RQSTYPE_ENABLE_LUN, bus, lun, 0, 0)) { status = CAM_RESRC_UNAVAIL; } else { mtx_sleep(ccb, &isp->isp_lock, PRIBIO, "isp_disable_lun", 0); } + isp->isp_osinfo.rptr = NULL; done: - ccb->ccb_h.status = status; if (status == CAM_REQ_CMP) { - xpt_print(ccb->ccb_h.path, "now disabled for target mode\n"); + tptr->enabled = 0; + /* + * If we have no more luns enabled for this bus, delete all tracked wwns for it (if we are FC) + * and disable target mode. + */ + if (is_any_lun_enabled(isp, bus) == 0) { + isp_del_all_wwn_entries(isp, bus); + if (isp_disable_target_mode(isp, bus)) { + status = CAM_REQ_CMP_ERR; + } + } } - if (tptr) { + ccb->ccb_h.status = status; + if (status == CAM_REQ_CMP) { + xpt_print(ccb->ccb_h.path, "lun now disabled for target mode\n"); destroy_lun_state(isp, tptr); + } else { + if (tptr) + rls_lun_statep(isp, tptr); } - isp->isp_osinfo.rptr = NULL; - isp->isp_osinfo.tmbusy = 0; - if (isp->isp_osinfo.tmwanted) { - isp->isp_osinfo.tmwanted = 0; - wakeup(isp); - } + isp_tmunlk(isp); xpt_done(ccb); } static int isp_enable_target_mode(ispsoftc_t *isp, int bus) { - int ct; + int tm_enabled; - ISP_GET_PC(isp, bus, tm_enabled, ct); - if (ct != 0) { + ISP_GET_PC(isp, bus, tm_enabled, tm_enabled); + if (tm_enabled != 0) { return (0); } - if (IS_SCSI(isp)) { mbreg_t mbs; - MBSINIT(&mbs, MBOX_ENABLE_TARGET_MODE, MBLOGALL, 0); mbs.param[0] = MBOX_ENABLE_TARGET_MODE; mbs.param[1] = ENABLE_TARGET_FLAG|ENABLE_TQING_FLAG; mbs.param[2] = bus << 7; if (isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs) < 0 || mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, "Unable to add Target Role to Bus %d", bus); + isp_prt(isp, ISP_LOGERR, "Unable to enable Target Role on Bus %d", bus); return (EIO); } - SDPARAM(isp, bus)->role |= ISP_ROLE_TARGET; } ISP_SET_PC(isp, bus, tm_enabled, 1); - isp_prt(isp, ISP_LOGINFO, "Target Role added to Bus %d", bus); + isp_prt(isp, ISP_LOGINFO, "Target Role enabled on Bus %d", bus); return (0); } -#ifdef NEEDED static int isp_disable_target_mode(ispsoftc_t *isp, int bus) { - int ct; + int tm_enabled; - ISP_GET_PC(isp, bus, tm_enabled, ct); - if (ct == 0) { + ISP_GET_PC(isp, bus, tm_enabled, tm_enabled); + if (tm_enabled == 0) { return (0); } - if (IS_SCSI(isp)) { mbreg_t mbs; - MBSINIT(&mbs, MBOX_ENABLE_TARGET_MODE, MBLOGALL, 0); mbs.param[2] = bus << 7; if (isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs) < 0 || mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, "Unable to subtract Target Role to Bus %d", bus); + isp_prt(isp, ISP_LOGERR, "Unable to disable Target Role on Bus %d", bus); return (EIO); } - SDPARAM(isp, bus)->role &= ~ISP_ROLE_TARGET; } ISP_SET_PC(isp, bus, tm_enabled, 0); - isp_prt(isp, ISP_LOGINFO, "Target Role subtracted from Bus %d", bus); + isp_prt(isp, ISP_LOGINFO, "Target Role disabled onon Bus %d", bus); return (0); } -#endif static void isp_ledone(ispsoftc_t *isp, lun_entry_t *lep) @@ -4431,7 +4506,7 @@ isp_action(struct cam_sim *sim, union cc tptr->atio_count++; SLIST_INSERT_HEAD(&tptr->atios, &ccb->ccb_h, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "Put FREE ATIO (tag id 0x%x), count now %d\n", - ((struct ccb_accept_tio *)ccb)->tag_id, tptr->atio_count); + ccb->atio.tag_id, tptr->atio_count); } else if (ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) { if (ccb->cin1.tag_id) { inot_private_data_t *ntp = isp_find_ntpd(isp, tptr, ccb->cin1.tag_id, ccb->cin1.seq_id); @@ -4442,12 +4517,12 @@ isp_action(struct cam_sim *sim, union cc tptr->inot_count++; SLIST_INSERT_HEAD(&tptr->inots, &ccb->ccb_h, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "Put FREE INOT, (seq id 0x%x) count now %d\n", - ((struct ccb_immediate_notify *)ccb)->seq_id, tptr->inot_count); + ccb->cin1.seq_id, tptr->inot_count); } else if (ccb->ccb_h.func_code == XPT_IMMED_NOTIFY) { tptr->inot_count++; SLIST_INSERT_HEAD(&tptr->inots, &ccb->ccb_h, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "Put FREE INOT, (seq id 0x%x) count now %d\n", - ((struct ccb_immediate_notify *)ccb)->seq_id, tptr->inot_count); + ccb->cin1.seq_id, tptr->inot_count); } rls_lun_statep(isp, tptr); ccb->ccb_h.status = CAM_REQ_INPROG; @@ -4730,7 +4805,6 @@ isp_action(struct cam_sim *sim, union cc struct ccb_sim_knob *kp = &ccb->knob; fcparam *fcp; - if (!IS_FC(isp)) { ccb->ccb_h.status = CAM_REQ_INVALID; xpt_done(ccb); @@ -4788,11 +4862,12 @@ isp_action(struct cam_sim *sim, union cc break; } if (rchange) { + ISP_PATH_PRT(isp, ISP_LOGCONFIG, ccb->ccb_h.path, "changing role on from %d to %d\n", fcp->role, newrole); if (isp_fc_change_role(isp, bus, newrole) != 0) { ccb->ccb_h.status = CAM_REQ_CMP_ERR; #ifdef ISP_TARGET_MODE } else if (newrole == ISP_ROLE_TARGET || newrole == ISP_ROLE_BOTH) { - isp_enable_deferred_luns(isp, bus); + ccb->ccb_h.status = isp_enable_deferred_luns(isp, bus); #endif } } @@ -4800,7 +4875,7 @@ isp_action(struct cam_sim *sim, union cc xpt_done(ccb); break; } - case XPT_GET_SIM_KNOB: /* Set SIM knobs */ + case XPT_GET_SIM_KNOB: /* Get SIM knobs */ { struct ccb_sim_knob *kp = &ccb->knob; Modified: stable/9/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/9/sys/dev/isp/isp_freebsd.h Sun Jun 17 21:07:27 2012 (r237207) +++ stable/9/sys/dev/isp/isp_freebsd.h Sun Jun 17 21:28:11 2012 (r237208) @@ -121,8 +121,10 @@ typedef struct tstate { struct ccb_hdr_slist atios; struct ccb_hdr_slist inots; uint32_t hold; - int atio_count; - int inot_count; + uint32_t + enabled : 1, + atio_count : 15, + inot_count : 15; inot_private_data_t * restart_queue; inot_private_data_t * ntfree; inot_private_data_t ntpool[ATPDPSIZE]; Modified: stable/9/sys/dev/isp/ispvar.h ============================================================================== --- stable/9/sys/dev/isp/ispvar.h Sun Jun 17 21:07:27 2012 (r237207) +++ stable/9/sys/dev/isp/ispvar.h Sun Jun 17 21:28:11 2012 (r237208) @@ -724,8 +724,17 @@ struct ispsoftc { #define ISP_ROLE_BOTH (ISP_ROLE_TARGET|ISP_ROLE_INITIATOR) #define ISP_ROLE_EITHER ISP_ROLE_BOTH #ifndef ISP_DEFAULT_ROLES +/* + * Counterintuitively, we prefer to default to role 'none' + * if we are enable target mode support. This gives us the + * maximum flexibility as to which port will do what. + */ +#ifdef ISP_TARGET_MODE +#define ISP_DEFAULT_ROLES ISP_ROLE_NONE +#else #define ISP_DEFAULT_ROLES ISP_ROLE_INITIATOR #endif +#endif /* From owner-svn-src-stable@FreeBSD.ORG Sun Jun 17 21:30:25 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BB9B106564A; Sun, 17 Jun 2012 21:30:25 +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 361C78FC15; Sun, 17 Jun 2012 21:30: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 q5HLUPAD033901; Sun, 17 Jun 2012 21:30:25 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HLUPjb033899; Sun, 17 Jun 2012 21:30:25 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201206172130.q5HLUPjb033899@svn.freebsd.org> From: Matt Jacob Date: Sun, 17 Jun 2012 21:30: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: r237209 - stable/9/sys/dev/isp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 21:30:25 -0000 Author: mjacob Date: Sun Jun 17 21:30:24 2012 New Revision: 237209 URL: http://svn.freebsd.org/changeset/base/237209 Log: MFC of 237135 If debug values were set, the default from tval floated down and triggered an attempt to set multiple virtual ports whether you wanted them or not. Modified: stable/9/sys/dev/isp/isp_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/dev/isp/isp_pci.c ============================================================================== --- stable/9/sys/dev/isp/isp_pci.c Sun Jun 17 21:28:11 2012 (r237208) +++ stable/9/sys/dev/isp/isp_pci.c Sun Jun 17 21:30:24 2012 (r237209) @@ -483,6 +483,7 @@ isp_get_generic_options(device_t dev, is if (bootverbose) { isp->isp_dblev |= ISP_LOGCONFIG|ISP_LOGINFO; } + tval = 0; (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "vports", &tval); if (tval > 0 && tval < 127) { *nvp = tval; From owner-svn-src-stable@FreeBSD.ORG Mon Jun 18 04:55:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9C751065672; Mon, 18 Jun 2012 04:55:08 +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 A1E2B8FC08; Mon, 18 Jun 2012 04:55: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 q5I4t8WG055177; Mon, 18 Jun 2012 04:55:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5I4t7Rp055134; Mon, 18 Jun 2012 04:55:07 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206180455.q5I4t7Rp055134@svn.freebsd.org> From: Eitan Adler Date: Mon, 18 Jun 2012 04:55:07 +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: r237216 - in stable/9: bin/pwait bin/setfacl bin/sh games/pom lib/libbluetooth lib/libc/gen lib/libc/locale lib/libc/net lib/libc/posix1e lib/libc/stdio lib/libc/stdlib lib/libc/string ... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 04:55:09 -0000 Author: eadler Date: Mon Jun 18 04:55:07 2012 New Revision: 237216 URL: http://svn.freebsd.org/changeset/base/237216 Log: MFC r233648: Remove trailing whitespace per mdoc lint warning Approved by: cperciva (implicit) Modified: stable/9/bin/pwait/pwait.1 stable/9/bin/setfacl/setfacl.1 stable/9/bin/sh/sh.1 stable/9/games/pom/pom.6 stable/9/lib/libbluetooth/bluetooth.3 stable/9/lib/libc/gen/fts.3 stable/9/lib/libc/gen/getpagesizes.3 stable/9/lib/libc/gen/sysconf.3 stable/9/lib/libc/locale/ctype.3 stable/9/lib/libc/locale/ctype_l.3 stable/9/lib/libc/locale/digittoint.3 stable/9/lib/libc/locale/isalnum.3 stable/9/lib/libc/locale/isalpha.3 stable/9/lib/libc/locale/isblank.3 stable/9/lib/libc/locale/iscntrl.3 stable/9/lib/libc/net/sctp_bindx.3 stable/9/lib/libc/net/sctp_connectx.3 stable/9/lib/libc/net/sctp_freepaddrs.3 stable/9/lib/libc/net/sctp_getaddrlen.3 stable/9/lib/libc/net/sctp_getassocid.3 stable/9/lib/libc/net/sctp_getpaddrs.3 stable/9/lib/libc/net/sctp_opt_info.3 stable/9/lib/libc/net/sctp_recvmsg.3 stable/9/lib/libc/net/sctp_send.3 stable/9/lib/libc/net/sctp_sendmsg.3 stable/9/lib/libc/net/sourcefilter.3 stable/9/lib/libc/posix1e/acl_add_flag_np.3 stable/9/lib/libc/posix1e/acl_create_entry.3 stable/9/lib/libc/stdio/getline.3 stable/9/lib/libc/stdlib/at_quick_exit.3 stable/9/lib/libc/stdlib/getenv.3 stable/9/lib/libc/string/memchr.3 stable/9/lib/libc/sys/cap_new.2 stable/9/lib/libc/sys/cpuset.2 stable/9/lib/libc/sys/cpuset_getaffinity.2 stable/9/lib/libc/sys/kqueue.2 stable/9/lib/libc/sys/pathconf.2 stable/9/lib/libc/sys/ptrace.2 stable/9/lib/libc/sys/quotactl.2 stable/9/lib/libc/sys/sctp_generic_sendmsg.2 stable/9/lib/libc/sys/sctp_peeloff.2 stable/9/lib/libc/sys/select.2 stable/9/lib/libc/sys/sendfile.2 stable/9/lib/libelf/elf.3 stable/9/lib/libelf/elf_getdata.3 stable/9/lib/libgssapi/gss_release_buffer.3 stable/9/lib/libgssapi/gss_release_oid_set.3 stable/9/lib/libgssapi/mech.5 stable/9/lib/libpam/modules/pam_nologin/pam_nologin.8 stable/9/lib/librpcsec_gss/rpc_gss_seccreate.3 stable/9/lib/libtacplus/libtacplus.3 stable/9/lib/libulog/utempter_add_record.3 stable/9/lib/libusb/libusb20.3 stable/9/lib/libutil/login_cap.3 stable/9/lib/libutil/quotafile.3 stable/9/libexec/tftpd/tftpd.8 stable/9/sbin/camcontrol/camcontrol.8 stable/9/sbin/devfs/devfs.8 stable/9/sbin/gvinum/gvinum.8 stable/9/sbin/ifconfig/ifconfig.8 stable/9/sbin/ipfw/ipfw.8 stable/9/sbin/mdmfs/mdmfs.8 stable/9/sbin/mount_unionfs/mount_unionfs.8 stable/9/sbin/ping6/ping6.8 stable/9/sbin/quotacheck/quotacheck.8 stable/9/sbin/rcorder/rcorder.8 stable/9/share/man/man3/pthread_attr_affinity_np.3 stable/9/share/man/man3/pthread_cond_timedwait.3 stable/9/share/man/man3/pthread_cond_wait.3 stable/9/share/man/man4/acpi_hp.4 stable/9/share/man/man4/acpi_wmi.4 stable/9/share/man/man4/carp.4 stable/9/share/man/man4/ipmi.4 stable/9/share/man/man4/iwn.4 stable/9/share/man/man4/iwnfw.4 stable/9/share/man/man4/ktr.4 stable/9/share/man/man4/man4.powerpc/abtn.4 stable/9/share/man/man4/man4.powerpc/akbd.4 stable/9/share/man/man4/man4.powerpc/bm.4 stable/9/share/man/man4/man4.powerpc/cuda.4 stable/9/share/man/man4/man4.powerpc/smu.4 stable/9/share/man/man4/man4.powerpc/snd_ai2s.4 stable/9/share/man/man4/md.4 stable/9/share/man/man4/mos.4 stable/9/share/man/man4/mps.4 stable/9/share/man/man4/netmap.4 stable/9/share/man/man4/ng_patch.4 stable/9/share/man/man4/nvram2env.4 stable/9/share/man/man4/nxge.4 stable/9/share/man/man4/ufoma.4 stable/9/share/man/man4/upgt.4 stable/9/share/man/man4/wbwd.4 stable/9/share/man/man4/xen.4 stable/9/share/man/man5/ar.5 stable/9/share/man/man5/fdescfs.5 stable/9/share/man/man5/fs.5 stable/9/share/man/man5/fstab.5 stable/9/share/man/man5/nsmb.conf.5 stable/9/share/man/man5/quota.user.5 stable/9/share/man/man5/services.5 stable/9/share/man/man7/release.7 stable/9/share/man/man8/picobsd.8 stable/9/share/man/man9/BUS_DESCRIBE_INTR.9 stable/9/share/man/man9/BUS_SETUP_INTR.9 stable/9/share/man/man9/DB_COMMAND.9 stable/9/share/man/man9/DEVICE_PROBE.9 stable/9/share/man/man9/SYSINIT.9 stable/9/share/man/man9/buf_ring.9 stable/9/share/man/man9/condvar.9 stable/9/share/man/man9/devclass_get_maxunit.9 stable/9/share/man/man9/device_get_children.9 stable/9/share/man/man9/drbr.9 stable/9/share/man/man9/eventtimers.9 stable/9/share/man/man9/firmware.9 stable/9/share/man/man9/ieee80211.9 stable/9/share/man/man9/ieee80211_amrr.9 stable/9/share/man/man9/ieee80211_bmiss.9 stable/9/share/man/man9/ieee80211_input.9 stable/9/share/man/man9/ieee80211_node.9 stable/9/share/man/man9/ieee80211_output.9 stable/9/share/man/man9/ieee80211_proto.9 stable/9/share/man/man9/ieee80211_radiotap.9 stable/9/share/man/man9/ieee80211_regdomain.9 stable/9/share/man/man9/ieee80211_scan.9 stable/9/share/man/man9/ieee80211_vap.9 stable/9/share/man/man9/kproc.9 stable/9/share/man/man9/kthread.9 stable/9/share/man/man9/lock.9 stable/9/share/man/man9/locking.9 stable/9/share/man/man9/malloc.9 stable/9/share/man/man9/mi_switch.9 stable/9/share/man/man9/osd.9 stable/9/share/man/man9/rmlock.9 stable/9/share/man/man9/shm_map.9 stable/9/share/man/man9/sleep.9 stable/9/share/man/man9/spl.9 stable/9/share/man/man9/sysctl_ctx_init.9 stable/9/share/man/man9/taskqueue.9 stable/9/share/man/man9/timeout.9 stable/9/share/man/man9/usbdi.9 stable/9/share/man/man9/vm_map_find.9 stable/9/share/man/man9/watchdog.9 stable/9/sys/boot/common/loader.8 stable/9/sys/boot/forth/loader.conf.5 stable/9/tools/tools/ath/athrd/athrd.1 stable/9/tools/tools/ether_reflect/ether_reflect.1 stable/9/tools/tools/vimage/vimage.8 stable/9/usr.bin/bsdiff/bsdiff/bsdiff.1 stable/9/usr.bin/calendar/calendar.1 stable/9/usr.bin/comm/comm.1 stable/9/usr.bin/csup/cpasswd.1 stable/9/usr.bin/csup/csup.1 stable/9/usr.bin/find/find.1 stable/9/usr.bin/fstat/fuser.1 stable/9/usr.bin/ipcrm/ipcrm.1 stable/9/usr.bin/locale/locale.1 stable/9/usr.bin/lockf/lockf.1 stable/9/usr.bin/ministat/ministat.1 stable/9/usr.bin/printf/printf.1 stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/sed/sed.1 stable/9/usr.bin/tftp/tftp.1 stable/9/usr.bin/top/top.local.1 stable/9/usr.bin/touch/touch.1 stable/9/usr.sbin/adduser/adduser.conf.5 stable/9/usr.sbin/bluetooth/ath3kfw/ath3kfw.8 stable/9/usr.sbin/bsdinstall/bsdinstall.8 stable/9/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 stable/9/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 stable/9/usr.sbin/cdcontrol/cdcontrol.1 stable/9/usr.sbin/config/config.8 stable/9/usr.sbin/ctladm/ctladm.8 stable/9/usr.sbin/edquota/edquota.8 stable/9/usr.sbin/freebsd-update/freebsd-update.8 stable/9/usr.sbin/gpioctl/gpioctl.8 stable/9/usr.sbin/i2c/i2c.8 stable/9/usr.sbin/mountd/exports.5 stable/9/usr.sbin/mptutil/mptutil.8 stable/9/usr.sbin/newsyslog/newsyslog.conf.5 stable/9/usr.sbin/pciconf/pciconf.8 stable/9/usr.sbin/pkg_install/updating/pkg_updating.1 stable/9/usr.sbin/rtadvd/rtadvd.8 stable/9/usr.sbin/setfib/setfib.1 stable/9/usr.sbin/timed/timed/timed.8 stable/9/usr.sbin/wlandebug/wlandebug.8 Directory Properties: stable/9/bin/pwait/ (props changed) stable/9/bin/setfacl/ (props changed) stable/9/bin/sh/ (props changed) stable/9/games/pom/ (props changed) stable/9/lib/libbluetooth/ (props changed) stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/lib/libelf/ (props changed) stable/9/lib/libgssapi/ (props changed) stable/9/lib/libpam/ (props changed) stable/9/lib/librpcsec_gss/ (props changed) stable/9/lib/libtacplus/ (props changed) stable/9/lib/libulog/ (props changed) stable/9/lib/libusb/ (props changed) stable/9/lib/libutil/ (props changed) stable/9/libexec/tftpd/ (props changed) stable/9/sbin/camcontrol/ (props changed) stable/9/sbin/devfs/ (props changed) stable/9/sbin/gvinum/ (props changed) stable/9/sbin/ifconfig/ (props changed) stable/9/sbin/ipfw/ (props changed) stable/9/sbin/mdmfs/ (props changed) stable/9/sbin/mount_unionfs/ (props changed) stable/9/sbin/ping6/ (props changed) stable/9/sbin/quotacheck/ (props changed) stable/9/sbin/rcorder/ (props changed) stable/9/share/man/man3/ (props changed) stable/9/share/man/man5/ (props changed) stable/9/share/man/man7/ (props changed) stable/9/share/man/man8/ (props changed) stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/tools/tools/ath/ (props changed) stable/9/tools/tools/ether_reflect/ (props changed) stable/9/tools/tools/vimage/ (props changed) stable/9/usr.bin/bsdiff/ (props changed) stable/9/usr.bin/calendar/ (props changed) stable/9/usr.bin/comm/ (props changed) stable/9/usr.bin/csup/ (props changed) stable/9/usr.bin/find/ (props changed) stable/9/usr.bin/fstat/ (props changed) stable/9/usr.bin/ipcrm/ (props changed) stable/9/usr.bin/locale/ (props changed) stable/9/usr.bin/lockf/ (props changed) stable/9/usr.bin/ministat/ (props changed) stable/9/usr.bin/printf/ (props changed) stable/9/usr.bin/procstat/ (props changed) stable/9/usr.bin/sed/ (props changed) stable/9/usr.bin/tftp/ (props changed) stable/9/usr.bin/top/ (props changed) stable/9/usr.bin/touch/ (props changed) stable/9/usr.sbin/adduser/ (props changed) stable/9/usr.sbin/bluetooth/ath3kfw/ (props changed) stable/9/usr.sbin/bsdinstall/ (props changed) stable/9/usr.sbin/bsnmpd/modules/snmp_wlan/ (props changed) stable/9/usr.sbin/bsnmpd/tools/bsnmptools/ (props changed) stable/9/usr.sbin/cdcontrol/ (props changed) stable/9/usr.sbin/config/ (props changed) stable/9/usr.sbin/ctladm/ (props changed) stable/9/usr.sbin/edquota/ (props changed) stable/9/usr.sbin/freebsd-update/ (props changed) stable/9/usr.sbin/gpioctl/ (props changed) stable/9/usr.sbin/i2c/ (props changed) stable/9/usr.sbin/mountd/ (props changed) stable/9/usr.sbin/mptutil/ (props changed) stable/9/usr.sbin/newsyslog/ (props changed) stable/9/usr.sbin/pciconf/ (props changed) stable/9/usr.sbin/pkg_install/updating/ (props changed) stable/9/usr.sbin/rtadvd/ (props changed) stable/9/usr.sbin/setfib/ (props changed) stable/9/usr.sbin/timed/timed/ (props changed) stable/9/usr.sbin/wlandebug/ (props changed) Modified: stable/9/bin/pwait/pwait.1 ============================================================================== --- stable/9/bin/pwait/pwait.1 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/bin/pwait/pwait.1 Mon Jun 18 04:55:07 2012 (r237216) @@ -46,7 +46,7 @@ .Sh DESCRIPTION The .Nm -utility will wait until each of the given processes has terminated. +utility will wait until each of the given processes has terminated. .Pp The following option is available: .Bl -tag -width indent Modified: stable/9/bin/setfacl/setfacl.1 ============================================================================== --- stable/9/bin/setfacl/setfacl.1 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/bin/setfacl/setfacl.1 Mon Jun 18 04:55:07 2012 (r237216) @@ -295,7 +295,7 @@ The ACL qualifier field describes the us the ACL entry. It may consist of one of the following: uid or user name, or gid or group name. In entries whose tag type is -one of +one of .Dq Li owner@ , .Dq Li group@ , or Modified: stable/9/bin/sh/sh.1 ============================================================================== --- stable/9/bin/sh/sh.1 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/bin/sh/sh.1 Mon Jun 18 04:55:07 2012 (r237216) @@ -1632,7 +1632,7 @@ All values are of type .It Constants Decimal, octal (starting with .Li 0 ) -and hexadecimal (starting with +and hexadecimal (starting with .Li 0x ) integer constants. .It Variables Modified: stable/9/games/pom/pom.6 ============================================================================== --- stable/9/games/pom/pom.6 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/games/pom/pom.6 Mon Jun 18 04:55:07 2012 (r237216) @@ -35,7 +35,7 @@ .Nm pom .Nd display the phase of the moon .Sh SYNOPSIS -.Nm +.Nm .Op Fl p .Op Fl d Ar yyyy.mm.dd .Op Fl t Ar hh:mm:ss Modified: stable/9/lib/libbluetooth/bluetooth.3 ============================================================================== --- stable/9/lib/libbluetooth/bluetooth.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libbluetooth/bluetooth.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -512,7 +512,7 @@ The function returns 0 on success, or -1 .Pp The .Fn bt_devfilter_pkt_set , -.Fn bt_devfilter_pkt_clr +.Fn bt_devfilter_pkt_clr and .Fn bt_devfilter_pkt_tst functions can be used to modify and test the @@ -527,7 +527,7 @@ packet type. .Pp The .Fn bt_devfilter_evt_set , -.Fn bt_devfilter_evt_clr +.Fn bt_devfilter_evt_clr and .Fn bt_devfilter_evt_tst functions can be used to modify and test the Modified: stable/9/lib/libc/gen/fts.3 ============================================================================== --- stable/9/lib/libc/gen/fts.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/gen/fts.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -802,12 +802,12 @@ principally to provide for alternative i .Nm functionality using different data structures. .Sh BUGS -The +The .Fn fts_open function will automatically set the .Dv FTS_NOCHDIR -option if the +option if the .Dv FTS_LOGICAL -option is provided, or if it cannot +option is provided, or if it cannot .Xr open 2 the current directory. Modified: stable/9/lib/libc/gen/getpagesizes.3 ============================================================================== --- stable/9/lib/libc/gen/getpagesizes.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/gen/getpagesizes.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -56,7 +56,7 @@ array referenced by These page sizes are expressed in bytes. In this case, .Fn getpagesizes -returns the number of such page sizes that it assigned to the array. +returns the number of such page sizes that it assigned to the array. .Sh RETURN VALUES If successful, the .Fn getpagesizes Modified: stable/9/lib/libc/gen/sysconf.3 ============================================================================== --- stable/9/lib/libc/gen/sysconf.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/gen/sysconf.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -211,7 +211,7 @@ Maximum number of functions that may be .It Li _SC_XOPEN_VERSION An integer value greater than or equal to 4, indicating the version of the X/Open Portability Guide to which this -system conforms. +system conforms. .It Li _SC_XOPEN_XCU_VERSION An integer value indicating the version of the XCU Specification to which this system conforms. Modified: stable/9/lib/libc/locale/ctype.3 ============================================================================== --- stable/9/lib/libc/locale/ctype.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/locale/ctype.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -55,7 +55,7 @@ .Nm toascii , .Nm tolower , .Nm toupper -.Nd character classification functions +.Nd character classification functions .Sh LIBRARY .Lb libc .Sh SYNOPSIS Modified: stable/9/lib/libc/locale/ctype_l.3 ============================================================================== --- stable/9/lib/libc/locale/ctype_l.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/locale/ctype_l.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -102,11 +102,11 @@ .Fn toupper_l "int c" "locale_t loc" .Sh DESCRIPTION The above functions perform character tests and conversions on the integer -.Fa c +.Fa c in the locale .Fa loc . They behave in the same way as the versions without the _l suffix, but use the -specified locale rather than the global or per-thread locale. +specified locale rather than the global or per-thread locale. .In ctype.h , or as true functions in the C library. See the specific manual pages for more information. Modified: stable/9/lib/libc/locale/digittoint.3 ============================================================================== --- stable/9/lib/libc/locale/digittoint.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/locale/digittoint.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -49,7 +49,7 @@ function converts a numeric character to The character can be any decimal digit or hexadecimal digit. With hexadecimal characters, the case of the values does not matter. .Pp -The +The .Fn digittoint_l function takes an explicit locale argument, whereas the .Fn digittoint Modified: stable/9/lib/libc/locale/isalnum.3 ============================================================================== --- stable/9/lib/libc/locale/isalnum.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/locale/isalnum.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -77,7 +77,7 @@ In the ASCII character set, this include .It "\&171\ ``y'' \t172\ ``z''" .El .Pp -The +The .Fn isalnum_l function takes an explicit locale argument, whereas the .Fn isalnum Modified: stable/9/lib/libc/locale/isalpha.3 ============================================================================== --- stable/9/lib/libc/locale/isalpha.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/locale/isalpha.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -74,7 +74,7 @@ In the ASCII character set, this include .It "\&164\ ``t'' \t165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x''" .It "\&171\ ``y'' \t172\ ``z''" .El -The +The .Fn isalpha_l function takes an explicit locale argument, whereas the .Fn isalpha Modified: stable/9/lib/libc/locale/isblank.3 ============================================================================== --- stable/9/lib/libc/locale/isblank.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/locale/isblank.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -59,7 +59,7 @@ The value of the argument must be repres or the value of .Dv EOF . .Pp -The +The .Fn isblank_l function takes an explicit locale argument, whereas the .Fn isblank Modified: stable/9/lib/libc/locale/iscntrl.3 ============================================================================== --- stable/9/lib/libc/locale/iscntrl.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/locale/iscntrl.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -68,7 +68,7 @@ In the ASCII character set, this include .It "\&036\ RS \t037\ US \t177\ DEL" .El .Pp -The +The .Fn iscntrl_l function takes an explicit locale argument, whereas the .Fn iscntrl Modified: stable/9/lib/libc/net/sctp_bindx.3 ============================================================================== --- stable/9/lib/libc/net/sctp_bindx.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sctp_bindx.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -55,7 +55,7 @@ This allows a user to bind a subset of addresses. The .Fn sctp_bindx -call operates similarly to +call operates similarly to .Fn bind but allows a list of addresses and also allows a bind or an unbind. @@ -98,7 +98,7 @@ This value is returned if the field is not one of the allowed values (see above). .It Bq Er ENOMEM This value is returned if the number of addresses -being added causes a memory allocation failure in +being added causes a memory allocation failure in the call. .It Bq Er EBADF The argument Modified: stable/9/lib/libc/net/sctp_connectx.3 ============================================================================== --- stable/9/lib/libc/net/sctp_connectx.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sctp_connectx.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -58,18 +58,18 @@ This allows a fault tolerant method of initiating an association. When one of the peers addresses is unreachable, the subsequent listed addresses will also be used -to set up the association with the peer. +to set up the association with the peer. .Pp -The user also needs to consider that any address listed in an +The user also needs to consider that any address listed in an .Fn sctp_connectx call is also considered "confirmed". A confirmed address is one in which the SCTP transport will trust is a part of the association and it will not send a confirmation heartbeat to it with -a random nonce. +a random nonce. .Pp If the peer SCTP stack does not list one or more of -the provided addresses in its response message then +the provided addresses in its response message then the extra addresses sent in the .Fn sctp_connectx call will be silently discarded from the association. Modified: stable/9/lib/libc/net/sctp_freepaddrs.3 ============================================================================== --- stable/9/lib/libc/net/sctp_freepaddrs.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sctp_freepaddrs.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -46,9 +46,9 @@ .In sys/socket.h .In netinet/sctp.h .Ft void -.Fn sctp_freepaddrs "struct sockaddr *" +.Fn sctp_freepaddrs "struct sockaddr *" .Ft void -.Fn sctp_freeladdrs "struct sockaddr *" +.Fn sctp_freeladdrs "struct sockaddr *" .Sh DESCRIPTION The .Fn sctp_freepaddrs Modified: stable/9/lib/libc/net/sctp_getaddrlen.3 ============================================================================== --- stable/9/lib/libc/net/sctp_getaddrlen.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sctp_getaddrlen.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -62,7 +62,7 @@ system calls. If for some reason a SCTP socket cannot be created or the .Fn getsockopt -call fails, an error will be returned +call fails, an error will be returned with .Va errno set as specified in the Modified: stable/9/lib/libc/net/sctp_getassocid.3 ============================================================================== --- stable/9/lib/libc/net/sctp_getassocid.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sctp_getassocid.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -50,7 +50,7 @@ The .Fn sctp_getassocid call attempts to look up the specified socket address .Fa addr -and find the respective association identification. +and find the respective association identification. .Pp .Sh RETURN VALUES The call returns the association id upon success and Modified: stable/9/lib/libc/net/sctp_getpaddrs.3 ============================================================================== --- stable/9/lib/libc/net/sctp_getpaddrs.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sctp_getpaddrs.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -53,7 +53,7 @@ The .Fn sctp_getpaddrs function is used to get the list of the peers addresses. -The +The .Fn sctp_getladdrs function is used to get the list of the local addresses. The association of interest is identified by the Modified: stable/9/lib/libc/net/sctp_opt_info.3 ============================================================================== --- stable/9/lib/libc/net/sctp_opt_info.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sctp_opt_info.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -50,7 +50,7 @@ The .Fn sctp_opt_info call provides a multi-os compatible method for getting -specific +specific .Fn getsockopt data where an association identification needs to be passed into the operating system. @@ -70,7 +70,7 @@ who wish to write portable code amongst this call should be used for the following SCTP socket options. .Pp -.Dv SCTP_RTOINFO +.Dv SCTP_RTOINFO .Pp .Dv SCTP_ASSOCINFO .Pp Modified: stable/9/lib/libc/net/sctp_recvmsg.3 ============================================================================== --- stable/9/lib/libc/net/sctp_recvmsg.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sctp_recvmsg.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -56,11 +56,11 @@ is used to receive a message from anothe The .Fn sctp_recvmsg call is used by one-to-one (SOCK_STREAM) type sockets after a -successful +successful .Fn connect -call or after the application has performed a -.Fn listen -followed by a successful +call or after the application has performed a +.Fn listen +followed by a successful .Fn accept . For a one-to-many (SOCK_SEQPACKET) type socket, an endpoint may call .Fn sctp_recvmsg @@ -77,7 +77,7 @@ with a positive backlog to enable the re .Pp The address of the sender is held in the .Fa from -argument with +argument with .Fa fromlen specifying its size. At the completion of a successful @@ -88,16 +88,16 @@ will hold the address of the peer and .Fa fromlen will hold the length of that address. Note that -the address is bounded by the initial value of +the address is bounded by the initial value of .Fa fromlen which is used as an in/out variable. .Pp -The length of the message +The length of the message .Fa msg to be received is bounded by .Fa len . If the message is too long to fit in the users -receive buffer, then the +receive buffer, then the .Fa flags argument will .Em not @@ -105,16 +105,16 @@ have the .Dv MSG_EOF flag applied. If the message is a complete message then -the +the .Fa flags argument will have .Dv MSG_EOF set. -Locally detected errors are +Locally detected errors are indicated by a return value of -1 with .Va errno set accordingly. -The +The .Fa flags argument may also hold the value .Dv MSG_NOTIFICATION . @@ -141,7 +141,7 @@ The system call may be used to determine when it is possible to receive a message. .Pp -The +The .Fa sinfo argument is defined as follows. .Bd -literal @@ -161,7 +161,7 @@ struct sctp_sndrcvinfo { The .Fa sinfo->sinfo_ppid field is an opaque 32 bit value that is passed transparently -through the stack from the peer endpoint. +through the stack from the peer endpoint. Note that the stack passes this value without regard to byte order. .Pp @@ -182,7 +182,7 @@ was delivered in order within the stream .Pp The .Fa sinfo->sinfo_stream -field is the SCTP stream that the message was received on. +field is the SCTP stream that the message was received on. Streams in SCTP are reliable (or partially reliable) flows of ordered messages. .Pp @@ -194,7 +194,7 @@ context with the socket option. Optionally a user process can use this value to index some application specific data structure for all data coming from a specific -association. +association. .Pp The .Fa sinfo->sinfo_ssn @@ -230,12 +230,12 @@ sockets this value can be used to send d the use of an address field. It is also quite useful in setting various socket options on the specific association -(see +(see .Xr sctp 4 ) . .Pp The .Fa sinfo->info_timetolive -field is not used by +field is not used by .Fn sctp_recvmsg . .Sh RETURN VALUES The call returns the number of bytes received, or -1 Modified: stable/9/lib/libc/net/sctp_send.3 ============================================================================== --- stable/9/lib/libc/net/sctp_send.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sctp_send.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -62,14 +62,14 @@ is used to transmit a message to another .Fn sctp_send may be used to send data to an existing association for both one-to-many (SOCK_SEQPACKET) and one-to-one (SOCK_STREAM) socket types. -The length of the message +The length of the message .Fa msg is given by .Fa len . If the message is too long to pass atomically through the underlying protocol, .Va errno -is set to +is set to .Er EMSGSIZE , -1 is returned, and the message is not transmitted. @@ -88,7 +88,7 @@ The system call may be used to determine when it is possible to send more data on one-to-one type (SOCK_STREAM) sockets. .Pp -The +The .Fa sinfo structure is used to control various SCTP features and has the following format: @@ -106,7 +106,7 @@ struct sctp_sndrcvinfo { }; .Ed .Pp -The +The .Fa sinfo->sinfo_ppid argument is an opaque 32 bit value that is passed transparently through the stack to the peer endpoint. It will be available on @@ -131,7 +131,7 @@ argument may include one or more of the #define SCTP_PR_SCTP_RTX 0x0003 /* Number of retransmissions based PR-SCTP */ .Ed .Pp -The flag +The flag .Dv SCTP_EOF is used to instruct the SCTP stack to queue this message and then start a graceful shutdown of the association. @@ -158,7 +158,7 @@ is used to specify that a specific addre Normally SCTP will use only one of a multi-homed peers addresses as the primary address to send to. -By default, no matter what the +By default, no matter what the .Fa to argument is, this primary address is used to send data. By specifying @@ -193,14 +193,14 @@ skipped and no longer transmitted. Note that this policy does not even assure that the data will ever be sent. In times of a congestion -with large amounts of data being queued, the +with large amounts of data being queued, the .Fa sinfo->sinfo_timetolive may expire before the first transmission is ever made. .Pp The .Dv SCTP_PR_SCTP_BUF based policy transforms the -.Fa sinfo->sinfo_timetolive +.Fa sinfo->sinfo_timetolive field into a total number of bytes allowed on the outbound send queue. If that number or more bytes are in queue, then @@ -208,19 +208,19 @@ other buffer-based sends are looked to b skipped. Note that this policy may also result in the data never being sent if no buffer based sends are in queue and -the maximum specified by -.Fa timetolive +the maximum specified by +.Fa timetolive bytes is in queue. .Pp The .Dv SCTP_PR_SCTP_RTX policy transforms the -.Fa sinfo->sinfo_timetolive +.Fa sinfo->sinfo_timetolive into a number of retransmissions to allow. This policy always assures that at a minimum one send attempt is made of the data. -After which no more than +After which no more than .Fa sinfo->sinfo_timetolive retransmissions will be made before the data is skipped. .Pp @@ -228,11 +228,11 @@ retransmissions will be made before the is the SCTP stream that you wish to send the message on. Streams in SCTP are reliable (or partially reliable) flows of ordered -messages. +messages. .Pp The .Fa sinfo->sinfo_assoc_id -field is used to +field is used to select the association to send to on a one-to-many socket. For a one-to-one socket, this field is ignored. .Pp @@ -256,16 +256,16 @@ The fields .Fa sinfo->sinfo_ssn , .Fa sinfo->sinfo_tsn , and -.Fa sinfo->sinfo_cumtsn +.Fa sinfo->sinfo_cumtsn are used only when receiving messages and are thus ignored by .Fn sctp_send . The function -.Fn sctp_sendx -has the same properties as +.Fn sctp_sendx +has the same properties as .Fn sctp_send with the additional arguments of an array of sockaddr structures passed in. -With the +With the .Fa addrs argument being given as an array of addresses to be sent to and the @@ -277,7 +277,7 @@ when an implicit association is being se This allows the user the equivalent behavior as doing a .Fn sctp_connectx -followed by a +followed by a .Fn sctp_send to the association. Note that if the Modified: stable/9/lib/libc/net/sctp_sendmsg.3 ============================================================================== --- stable/9/lib/libc/net/sctp_sendmsg.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sctp_sendmsg.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -72,10 +72,10 @@ Data sent in such an instance will resul the data being sent on the third leg of the SCTP four-way handshake. Note that if the socket is a one-to-one type (SOCK_STREAM) socket then an association must -be in existence (by use of the +be in existence (by use of the .Xr connect 2 system call). -Calling +Calling .Fn sctp_sendmsg or .Fn sctp_sendmsgx @@ -90,14 +90,14 @@ The address of the target is given by with .Fa tolen specifying its size. -The length of the message +The length of the message .Fa msg is given by .Fa len . If the message is too long to pass atomically through the underlying protocol, .Va errno -is set to +is set to .Er EMSGSIZE , -1 is returned, and the message is not transmitted. @@ -117,7 +117,7 @@ The system call may be used to determine when it is possible to send more data on one-to-one type (SOCK_STREAM) sockets. .Pp -The +The .Fa ppid argument is an opaque 32 bit value that is passed transparently through the stack to the peer endpoint. @@ -143,7 +143,7 @@ argument may include one or more of the #define SCTP_PR_SCTP_RTX 0x0003 /* Number of retransmissions based PR-SCTP */ .Ed .Pp -The flag +The flag .Dv SCTP_EOF is used to instruct the SCTP stack to queue this message and then start a graceful shutdown of the association. @@ -170,7 +170,7 @@ is used to specify that an specific addr Normally SCTP will use only one of a multi-homed peers addresses as the primary address to send to. -By default, no matter what the +By default, no matter what the .Fa to argument is, this primary address is used to send data. By specifying @@ -205,14 +205,14 @@ skipped and no longer transmitted. Note that this policy does not even assure that the data will ever be sent. In times of a congestion -with large amounts of data being queued, the +with large amounts of data being queued, the .Fa timetolive may expire before the first transmission is ever made. .Pp The .Dv SCTP_PR_SCTP_BUF based policy transforms the -.Fa timetolive +.Fa timetolive field into a total number of bytes allowed on the outbound send queue. If that number or more bytes are in queue, then @@ -220,19 +220,19 @@ other buffer based sends are looked to b skipped. Note that this policy may also result in the data never being sent if no buffer based sends are in queue and -the maximum specified by -.Fa timetolive +the maximum specified by +.Fa timetolive bytes is in queue. .Pp The .Dv SCTP_PR_SCTP_RTX policy transforms the -.Fa timetolive +.Fa timetolive into a number of retransmissions to allow. This policy always assures that at a minimum one send attempt is made of the data. -After which no more than +After which no more than .Fa timetolive retransmissions will be made before the data is skipped. .Pp @@ -241,7 +241,7 @@ is the SCTP stream that you wish to send message on. Streams in SCTP are reliable (or partially reliable) flows of ordered messages. -The +The .Fa context field is used only in the event the message cannot be sent. This is an opaque @@ -251,7 +251,7 @@ is given if that notification is enabled Normally a user process can use this value to index some application specific data structure when a send cannot be fulfilled. .Fn sctp_sendmsgx -is identical to +is identical to .Fn sctp_sendmsg with the exception that it takes an array of sockaddr structures in the argument @@ -262,7 +262,7 @@ which specifies how many addresses are i This allows a caller to implicitly set up an association passing multiple addresses as if -.Fn sctp_connectx +.Fn sctp_connectx had been called to set up the association. .Sh RETURN VALUES The call returns the number of characters sent, or -1 @@ -325,7 +325,7 @@ is not connected and is a one-to-one sty .Xr sctp 4 .Sh BUGS Because in the one-to-many style socket -.Fn sctp_sendmsg +.Fn sctp_sendmsg or .Fn sctp_sendmsgx may have multiple associations under one endpoint, a Modified: stable/9/lib/libc/net/sourcefilter.3 ============================================================================== --- stable/9/lib/libc/net/sourcefilter.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/net/sourcefilter.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -158,7 +158,7 @@ For the protocol-independent functions .Fn getsourcefilter and .Fn setsourcefilter , -the +the argument .Fa grouplen argument specifies the size of the structure pointed to by .Fa group . @@ -220,7 +220,7 @@ operation. .Sh SEE ALSO .Xr ip 4 , .Xr ip6 4 , -.Xr multicast 4 , +.Xr multicast 4, .Xr ifmcstat 8 .Rs .%A D. Thaler Modified: stable/9/lib/libc/posix1e/acl_add_flag_np.3 ============================================================================== --- stable/9/lib/libc/posix1e/acl_add_flag_np.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/posix1e/acl_add_flag_np.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm acl_add_flag_np -.Nd add flags to a flagset +.Nd add flags to a flagset .Sh LIBRARY .Lb libc .Sh SYNOPSIS Modified: stable/9/lib/libc/posix1e/acl_create_entry.3 ============================================================================== --- stable/9/lib/libc/posix1e/acl_create_entry.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/posix1e/acl_create_entry.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -39,7 +39,7 @@ .In sys/acl.h .Ft int .Fn acl_create_entry "acl_t *acl_p" "acl_entry_t *entry_p" -.Ft int +.Ft int .Fn acl_create_entry_np "acl_t *acl_p" "acl_entry_t *entry_p" "int index" .Sh DESCRIPTION The Modified: stable/9/lib/libc/stdio/getline.3 ============================================================================== --- stable/9/lib/libc/stdio/getline.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/stdio/getline.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -78,7 +78,7 @@ and .Fn getline functions return the number of characters written, excluding the terminating -.Dv NUL +.Dv NUL character. The value \-1 is returned if an error occurs, or if end-of-file is reached. .Sh EXAMPLES Modified: stable/9/lib/libc/stdlib/at_quick_exit.3 ============================================================================== --- stable/9/lib/libc/stdlib/at_quick_exit.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/stdlib/at_quick_exit.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -1,6 +1,6 @@ .\" Copyright (c) 2011 David Chisnall .\" All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -9,7 +9,7 @@ .\" 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 @@ -21,7 +21,7 @@ .\" 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 December 7, 2011 @@ -40,16 +40,16 @@ The .Fn at_quick_exit function registers a cleanup function to be called when the program exits as a -result of calling +result of calling .Xr quick_exit 3 . The cleanup functions are called in the reverse order and will not be called if -the program exits by calling +the program exits by calling .Xr exit 3 , .Xr _Exit 3 , or .Xr abort 3 . .Sh RETURN VALUES -The +The .Fn at_quick_exit function returns the value 0 if successful and a non-zero value on failure. .Sh SEE ALSO Modified: stable/9/lib/libc/stdlib/getenv.3 ============================================================================== --- stable/9/lib/libc/stdlib/getenv.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/stdlib/getenv.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -202,7 +202,7 @@ function appeared in Until .Fx 7.0 , .Fn putenv -would make a copy of +would make a copy of .Fa string and insert it into the environment using .Fn setenv . Modified: stable/9/lib/libc/string/memchr.3 ============================================================================== --- stable/9/lib/libc/string/memchr.3 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/string/memchr.3 Mon Jun 18 04:55:07 2012 (r237216) @@ -94,7 +94,7 @@ conforms to .St -isoC . .Pp The -.Fn memrchr +.Fn memrchr function is a GNU extension and conforms to no standard. .Sh HISTORY The Modified: stable/9/lib/libc/sys/cap_new.2 ============================================================================== --- stable/9/lib/libc/sys/cap_new.2 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/sys/cap_new.2 Mon Jun 18 04:55:07 2012 (r237216) @@ -462,14 +462,14 @@ argument is not a capability. Support for capabilities and capabilities mode was developed as part of the .Tn TrustedBSD Project. +.Sh AUTHORS +These functions and the capability facility were created by +.An "Robert N. M. Watson" +at the University of Cambridge Computer Laboratory with support from a grant +from Google, Inc. .Sh BUGS This man page should list the set of permitted system calls more specifically for each capability right. .Pp Capability rights sometimes have unclear indirect impacts, which should be documented, or at least hinted at. -.Sh AUTHORS -These functions and the capability facility were created by -.An "Robert N. M. Watson" -at the University of Cambridge Computer Laboratory with support from a grant -from Google, Inc. Modified: stable/9/lib/libc/sys/cpuset.2 ============================================================================== --- stable/9/lib/libc/sys/cpuset.2 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/sys/cpuset.2 Mon Jun 18 04:55:07 2012 (r237216) @@ -77,7 +77,7 @@ while application developers will manipu To select the correct set a value of type .Ft cpulevel_t is used. -The following values for +The following values for .Fa level are supported: .Bl -column CPU_LEVEL_CPUSET -offset indent @@ -137,7 +137,7 @@ Children inherit this set after a call t .Xr fork 2 . .Pp .Fn cpuset_setid -attempts to set the id of the object specified by the +attempts to set the id of the object specified by the .Fa which argument. Currently @@ -149,12 +149,12 @@ Upon successful completion all of the th be running on CPUs permitted by the set. .Pp .Fn cpuset_getid -retrieves a set id from the object indicated by +retrieves a set id from the object indicated by .Fa which and stores it in the space pointed to by .Fa setid . The retrieved id may be that of either the root or assigned set -depending on the value of +depending on the value of .Fa level . .Fa level should be Modified: stable/9/lib/libc/sys/cpuset_getaffinity.2 ============================================================================== --- stable/9/lib/libc/sys/cpuset_getaffinity.2 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/sys/cpuset_getaffinity.2 Mon Jun 18 04:55:07 2012 (r237216) @@ -45,7 +45,7 @@ .Fn cpuset_getaffinity and .Fn cpuset_setaffinity -allow the manipulation of sets of CPUs available to processes, threads, +allow the manipulation of sets of CPUs available to processes, threads, interrupts, jails and other resources. These functions may manipulate sets of CPUs that contain many processes or per-object anonymous masks that effect only a single object. Modified: stable/9/lib/libc/sys/kqueue.2 ============================================================================== --- stable/9/lib/libc/sys/kqueue.2 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/sys/kqueue.2 Mon Jun 18 04:55:07 2012 (r237216) @@ -203,7 +203,7 @@ will not return it. The filter itself is not disabled. .It EV_DISPATCH Disable the event source immediately after delivery of an event. -See +See .Dv EV_DISABLE above. .It EV_DELETE @@ -217,7 +217,7 @@ any pending events. When passed as input, it forces .Dv EV_ERROR to always be returned. -When a filter is successfully added the +When a filter is successfully added the .Va data field will be zero. .It EV_ONESHOT @@ -449,10 +449,10 @@ Establishes a user event identified by .Va ident which is not associated with any kernel mechanism but is triggered by user level code. -The lower 24 bits of the +The lower 24 bits of the .Va fflags may be used for user defined flags and manipulated using the following: -.Bl -tag -width XXNOTE_FFLAGSMASK +.Bl -tag -width XXNOTE_FFLAGSMASK .It Dv NOTE_FFNOP Ignore the input .Va fflags . Modified: stable/9/lib/libc/sys/pathconf.2 ============================================================================== --- stable/9/lib/libc/sys/pathconf.2 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/sys/pathconf.2 Mon Jun 18 04:55:07 2012 (r237216) @@ -174,7 +174,7 @@ return a positive number that represents bytes. The offsets of holes returned will be aligned to this same value. A special value of 1 is returned if the file system does not specify the minimum -hole size but still reports holes. +hole size but still reports holes. .El .Sh RETURN VALUES If the call to Modified: stable/9/lib/libc/sys/ptrace.2 ============================================================================== --- stable/9/lib/libc/sys/ptrace.2 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/sys/ptrace.2 Mon Jun 18 04:55:07 2012 (r237216) @@ -441,7 +441,7 @@ This request is used to iterate over the process. The .Fa addr -argument specifies a pointer to a +argument specifies a pointer to a .Vt "struct ptrace_vm_entry" , which is defined as follows: .Bd -literal Modified: stable/9/lib/libc/sys/quotactl.2 ============================================================================== --- stable/9/lib/libc/sys/quotactl.2 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/sys/quotactl.2 Mon Jun 18 04:55:07 2012 (r237216) @@ -113,7 +113,7 @@ Only the super-user may turn quotas off. .It Dv Q_GETQUOTASIZE Get the wordsize used to represent the quotas for the user or group (as determined by the command type). -Possible values are 32 for the old-style quota file +Possible values are 32 for the old-style quota file and 64 for the new-style quota file. The .Fa addr @@ -199,7 +199,7 @@ The .Fa id argument to .Dv Q_GETQUOTA , -.Dv Q_SETQUOTA +.Dv Q_SETQUOTA or .Dv Q_SETUSE is a negative value. Modified: stable/9/lib/libc/sys/sctp_generic_sendmsg.2 ============================================================================== --- stable/9/lib/libc/sys/sctp_generic_sendmsg.2 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/sys/sctp_generic_sendmsg.2 Mon Jun 18 04:55:07 2012 (r237216) @@ -54,7 +54,7 @@ and .Fn sctp_generic_sendmsg_iov are the true system calls used by the .Xr sctp_sendmsg 3 -and +and .Xr sctp_send 3 function calls. These are more efficient since they are @@ -68,7 +68,7 @@ For detailed usage please see either the .Xr sctp_send 3 or .Xr sctp_sendmsg 3 -function calls. +function calls. .Sh RETURN VALUES The call returns the number of bytes written on success and -1 upon failure. .Sh ERRORS Modified: stable/9/lib/libc/sys/sctp_peeloff.2 ============================================================================== --- stable/9/lib/libc/sys/sctp_peeloff.2 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/sys/sctp_peeloff.2 Mon Jun 18 04:55:07 2012 (r237216) @@ -61,7 +61,7 @@ The system call can return the following errors: .Bl -tag -width Er .It Bq Er ENOTCONN -The +The .Fa id given to the call does not map to a valid association. Modified: stable/9/lib/libc/sys/select.2 ============================================================================== --- stable/9/lib/libc/sys/select.2 Mon Jun 18 04:00:56 2012 (r237215) +++ stable/9/lib/libc/sys/select.2 Mon Jun 18 04:55:07 2012 (r237216) @@ -222,6 +222,6 @@ Thus, it is unwise to assume that the ti by the .Fn select system call. -.Fx +.Fx does not modify the return value, which can cause problems for applications ported from other systems. Modified: stable/9/lib/libc/sys/sendfile.2 ============================================================================== --- stable/9/lib/libc/sys/sendfile.2 Mon Jun 18 04:00:56 2012 (r237215) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Mon Jun 18 05:01:58 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6199F106564A; Mon, 18 Jun 2012 05:01:58 +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 4BCB68FC0C; Mon, 18 Jun 2012 05:01: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 q5I51wKf055979; Mon, 18 Jun 2012 05:01:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5I51wVU055977; Mon, 18 Jun 2012 05:01:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206180501.q5I51wVU055977@svn.freebsd.org> From: Eitan Adler Date: Mon, 18 Jun 2012 05:01: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: r237217 - stable/9/share/man/man5 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 05:01:58 -0000 Author: eadler Date: Mon Jun 18 05:01:57 2012 New Revision: 237217 URL: http://svn.freebsd.org/changeset/base/237217 Log: MFC 236352: Bump date for content missed in r236290 Approved by: cperciva (implicit) Modified: stable/9/share/man/man5/periodic.conf.5 Directory Properties: stable/9/share/man/man5/ (props changed) Modified: stable/9/share/man/man5/periodic.conf.5 ============================================================================== --- stable/9/share/man/man5/periodic.conf.5 Mon Jun 18 04:55:07 2012 (r237216) +++ stable/9/share/man/man5/periodic.conf.5 Mon Jun 18 05:01:57 2012 (r237217) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2012 +.Dd May 30, 2012 .Dt PERIODIC.CONF 5 .Os .Sh NAME From owner-svn-src-stable@FreeBSD.ORG Mon Jun 18 05:02:22 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EFC2010657BC; Mon, 18 Jun 2012 05:02:21 +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 9F33E8FC12; Mon, 18 Jun 2012 05:02: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 q5I52LdO056035; Mon, 18 Jun 2012 05:02:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5I52Ll6056033; Mon, 18 Jun 2012 05:02:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206180502.q5I52Ll6056033@svn.freebsd.org> From: Eitan Adler Date: Mon, 18 Jun 2012 05:02: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: r237218 - stable/8/share/man/man5 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 05:02:22 -0000 Author: eadler Date: Mon Jun 18 05:02:21 2012 New Revision: 237218 URL: http://svn.freebsd.org/changeset/base/237218 Log: MFC 236352: Bump date for content missed in r236290 Approved by: cperciva (implicit) Modified: stable/8/share/man/man5/periodic.conf.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/periodic.conf.5 ============================================================================== --- stable/8/share/man/man5/periodic.conf.5 Mon Jun 18 05:01:57 2012 (r237217) +++ stable/8/share/man/man5/periodic.conf.5 Mon Jun 18 05:02:21 2012 (r237218) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2012 +.Dd May 30, 2012 .Dt PERIODIC.CONF 5 .Os .Sh NAME From owner-svn-src-stable@FreeBSD.ORG Mon Jun 18 10:56:30 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99409106564A; Mon, 18 Jun 2012 10:56:30 +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 7A7648FC08; Mon, 18 Jun 2012 10:56: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 q5IAuUpl075140; Mon, 18 Jun 2012 10:56:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5IAuUwX075136; Mon, 18 Jun 2012 10:56:30 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206181056.q5IAuUwX075136@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 18 Jun 2012 10:56: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: r237224 - stable/9/sys/dev/sdhci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 10:56:30 -0000 Author: glebius Date: Mon Jun 18 10:56:29 2012 New Revision: 237224 URL: http://svn.freebsd.org/changeset/base/237224 Log: Merge 231266 from head: Add support for RICOH R5CE823 card reader, that can be found in some Lenovo laptops. The conroller needs a quirk to lower its frequency, and after that it operates normally. Modified: stable/9/sys/dev/sdhci/sdhci.c stable/9/sys/dev/sdhci/sdhci.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/9/sys/dev/sdhci/sdhci.c Mon Jun 18 07:54:10 2012 (r237223) +++ stable/9/sys/dev/sdhci/sdhci.c Mon Jun 18 10:56:29 2012 (r237224) @@ -74,6 +74,8 @@ __FBSDID("$FreeBSD$"); #define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<7) /* Controller has broken read timings */ #define SDHCI_QUIRK_BROKEN_TIMINGS (1<<8) +/* Controller needs lowered frequency */ +#define SDHCI_QUIRK_LOWER_FREQUENCY (1<<9) static const struct sdhci_device { uint32_t model; @@ -85,6 +87,8 @@ static const struct sdhci_device { SDHCI_QUIRK_FORCE_DMA }, { 0xe8221180, 0xffff, "RICOH SD", SDHCI_QUIRK_FORCE_DMA }, + { 0xe8231180, 0xffff, "RICOH R5CE823 SD", + SDHCI_QUIRK_LOWER_FREQUENCY }, { 0x8034104c, 0xffff, "TI XX21/XX11 SD", SDHCI_QUIRK_FORCE_DMA }, { 0x05501524, 0xffff, "ENE CB712 SD", @@ -350,6 +354,24 @@ sdhci_init(struct sdhci_slot *slot) } static void +sdhci_lower_frequency(device_t dev) +{ + + /* Enable SD2.0 mode. */ + pci_write_config(dev, SDHC_PCI_MODE_KEY, 0xfc, 1); + pci_write_config(dev, SDHC_PCI_MODE, SDHC_PCI_MODE_SD20, 1); + pci_write_config(dev, SDHC_PCI_MODE_KEY, 0x00, 1); + + /* + * Some SD/MMC cards don't work with the default base + * clock frequency of 200MHz. Lower it to 50Hz. + */ + pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x01, 1); + pci_write_config(dev, SDHC_PCI_BASE_FREQ, 50, 1); + pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x00, 1); +} + +static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock) { uint32_t res; @@ -631,6 +653,9 @@ sdhci_attach(device_t dev) break; } } + /* Some controllers need to be bumped into the right mode. */ + if (sc->quirks & SDHCI_QUIRK_LOWER_FREQUENCY) + sdhci_lower_frequency(dev); /* Read slots info from PCI registers. */ slots = pci_read_config(dev, PCI_SLOT_INFO, 1); bar = PCI_SLOT_INFO_FIRST_BAR(slots); Modified: stable/9/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/9/sys/dev/sdhci/sdhci.h Mon Jun 18 07:54:10 2012 (r237223) +++ stable/9/sys/dev/sdhci/sdhci.h Mon Jun 18 10:56:29 2012 (r237224) @@ -38,6 +38,15 @@ #define PCI_SLOT_INFO_FIRST_BAR(x) ((x) & 7) /* + * RICOH specific PCI registers + */ +#define SDHC_PCI_MODE_KEY 0xf9 +#define SDHC_PCI_MODE 0x150 +#define SDHC_PCI_MODE_SD20 0x10 +#define SDHC_PCI_BASE_FREQ_KEY 0xfc +#define SDHC_PCI_BASE_FREQ 0xe1 + +/* * Controller registers */ From owner-svn-src-stable@FreeBSD.ORG Mon Jun 18 17:21:03 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CC841065673; Mon, 18 Jun 2012 17:21: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 1745E8FC14; Mon, 18 Jun 2012 17:21: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 q5IHL2LN091145; Mon, 18 Jun 2012 17:21:02 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5IHL2VU091143; Mon, 18 Jun 2012 17:21:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206181721.q5IHL2VU091143@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 18 Jun 2012 17:21:02 +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: r237231 - stable/8/usr.sbin/acpi/acpidump X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 17:21:03 -0000 Author: jkim Date: Mon Jun 18 17:21:02 2012 New Revision: 237231 URL: http://svn.freebsd.org/changeset/base/237231 Log: MFC: r235948 Catch up with realpath(3) changes (r236400) and unbreak acpidump(8). Modified: stable/8/usr.sbin/acpi/acpidump/acpi.c Directory Properties: stable/8/usr.sbin/acpi/acpidump/ (props changed) Modified: stable/8/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- stable/8/usr.sbin/acpi/acpidump/acpi.c Mon Jun 18 17:11:24 2012 (r237230) +++ stable/8/usr.sbin/acpi/acpidump/acpi.c Mon Jun 18 17:21:02 2012 (r237231) @@ -994,13 +994,13 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt, if (tmpdir == NULL) tmpdir = _PATH_TMP; strncpy(tmpstr, tmpdir, sizeof(tmpstr)); - strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(tmpdir)); if (realpath(tmpstr, buf) == NULL) { - perror("realpath tmp file"); + perror("realpath tmp dir"); return; } strncpy(tmpstr, buf, sizeof(tmpstr)); - len = strlen(buf); + strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(buf)); + len = strlen(tmpstr); tmpext = tmpstr + len; strncpy(tmpext, "XXXXXX", sizeof(tmpstr) - len); fd = mkstemp(tmpstr); From owner-svn-src-stable@FreeBSD.ORG Mon Jun 18 17:23:24 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 98991106566B; Mon, 18 Jun 2012 17:23:24 +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 834B58FC19; Mon, 18 Jun 2012 17:23: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 q5IHNONf091290; Mon, 18 Jun 2012 17:23:24 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5IHNOMf091288; Mon, 18 Jun 2012 17:23:24 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206181723.q5IHNOMf091288@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 18 Jun 2012 17:23:24 +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: r237232 - stable/9/usr.sbin/acpi/acpidump X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 17:23:24 -0000 Author: jkim Date: Mon Jun 18 17:23:24 2012 New Revision: 237232 URL: http://svn.freebsd.org/changeset/base/237232 Log: MFC: r235948 Catch up with realpath(3) changes (r236400) and unbreak acpidump(8). Modified: stable/9/usr.sbin/acpi/acpidump/acpi.c Directory Properties: stable/9/usr.sbin/acpi/acpidump/ (props changed) Modified: stable/9/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- stable/9/usr.sbin/acpi/acpidump/acpi.c Mon Jun 18 17:21:02 2012 (r237231) +++ stable/9/usr.sbin/acpi/acpidump/acpi.c Mon Jun 18 17:23:24 2012 (r237232) @@ -1196,13 +1196,13 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt, if (tmpdir == NULL) tmpdir = _PATH_TMP; strncpy(tmpstr, tmpdir, sizeof(tmpstr)); - strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(tmpdir)); if (realpath(tmpstr, buf) == NULL) { - perror("realpath tmp file"); + perror("realpath tmp dir"); return; } strncpy(tmpstr, buf, sizeof(tmpstr)); - len = strlen(buf); + strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(buf)); + len = strlen(tmpstr); tmpext = tmpstr + len; strncpy(tmpext, "XXXXXX", sizeof(tmpstr) - len); fd = mkstemp(tmpstr); From owner-svn-src-stable@FreeBSD.ORG Tue Jun 19 02:54:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 432B8106566C; Tue, 19 Jun 2012 02:54:55 +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 24F828FC0A; Tue, 19 Jun 2012 02:54: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 q5J2stj5016228; Tue, 19 Jun 2012 02:54:55 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5J2ssLp016195; Tue, 19 Jun 2012 02:54:54 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206190254.q5J2ssLp016195@svn.freebsd.org> From: Warren Block Date: Tue, 19 Jun 2012 02:54: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: r237247 - in stable/9: lib/libpam/modules/pam_exec sbin/atacontrol sbin/geom/class/part sbin/geom/class/raid sbin/geom/class/virstor sbin/gvinum sbin/hastctl sbin/hastd sbin/mount sbin/... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 02:54:55 -0000 Author: wblock (doc committer) Date: Tue Jun 19 02:54:54 2012 New Revision: 237247 URL: http://svn.freebsd.org/changeset/base/237247 Log: MFC r235873, r235967: Fixes to man8 groff mandoc style, usage mistakes, or typos. PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb (mentor) Modified: stable/9/lib/libpam/modules/pam_exec/pam_exec.8 stable/9/sbin/atacontrol/atacontrol.8 stable/9/sbin/geom/class/part/gpart.8 stable/9/sbin/geom/class/raid/graid.8 stable/9/sbin/geom/class/virstor/gvirstor.8 stable/9/sbin/gvinum/gvinum.8 stable/9/sbin/hastctl/hastctl.8 stable/9/sbin/hastd/hastd.8 stable/9/sbin/mount/mount.8 stable/9/sbin/natd/natd.8 stable/9/share/man/man8/picobsd.8 stable/9/share/man/man8/rc.8 stable/9/sys/boot/common/loader.8 stable/9/sys/boot/forth/beastie.4th.8 stable/9/sys/boot/forth/brand.4th.8 stable/9/sys/boot/forth/check-password.4th.8 stable/9/sys/boot/forth/color.4th.8 stable/9/sys/boot/forth/delay.4th.8 stable/9/sys/boot/forth/menu.4th.8 stable/9/sys/boot/forth/version.4th.8 stable/9/usr.bin/ctlstat/ctlstat.8 stable/9/usr.sbin/cpucontrol/cpucontrol.8 stable/9/usr.sbin/ctladm/ctladm.8 stable/9/usr.sbin/flowctl/flowctl.8 stable/9/usr.sbin/freebsd-update/freebsd-update.8 stable/9/usr.sbin/i2c/i2c.8 stable/9/usr.sbin/jail/jail.8 stable/9/usr.sbin/rtadvctl/rtadvctl.8 stable/9/usr.sbin/rtadvd/rtadvd.8 stable/9/usr.sbin/smbmsg/smbmsg.8 stable/9/usr.sbin/utxrm/utxrm.8 stable/9/usr.sbin/wpa/ndis_events/ndis_events.8 Directory Properties: stable/9/lib/libpam/ (props changed) stable/9/sbin/atacontrol/ (props changed) stable/9/sbin/geom/class/part/ (props changed) stable/9/sbin/geom/class/raid/ (props changed) stable/9/sbin/geom/class/virstor/ (props changed) stable/9/sbin/gvinum/ (props changed) stable/9/sbin/hastctl/ (props changed) stable/9/sbin/hastd/ (props changed) stable/9/sbin/mount/ (props changed) stable/9/sbin/natd/ (props changed) stable/9/share/man/man8/ (props changed) stable/9/sys/boot/ (props changed) stable/9/usr.bin/ctlstat/ (props changed) stable/9/usr.sbin/cpucontrol/ (props changed) stable/9/usr.sbin/ctladm/ (props changed) stable/9/usr.sbin/flowctl/ (props changed) stable/9/usr.sbin/freebsd-update/ (props changed) stable/9/usr.sbin/i2c/ (props changed) stable/9/usr.sbin/jail/ (props changed) stable/9/usr.sbin/rtadvctl/ (props changed) stable/9/usr.sbin/rtadvd/ (props changed) stable/9/usr.sbin/smbmsg/ (props changed) stable/9/usr.sbin/utxrm/ (props changed) stable/9/usr.sbin/wpa/ (props changed) Modified: stable/9/lib/libpam/modules/pam_exec/pam_exec.8 ============================================================================== --- stable/9/lib/libpam/modules/pam_exec/pam_exec.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/lib/libpam/modules/pam_exec/pam_exec.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -131,10 +131,10 @@ This is useful in shell scripts for inst .Xr pam 8 , .Xr pam_sm_acct_mgmt 8 , .Xr pam_sm_authenticate 8 , -.Xr pam_sm_chauthtok 8, +.Xr pam_sm_chauthtok 8 , .Xr pam_sm_close_session 8 , .Xr pam_sm_open_session 8 , -.Xr pam_sm_setcred 8 . +.Xr pam_sm_setcred 8 .Sh AUTHORS The .Nm Modified: stable/9/sbin/atacontrol/atacontrol.8 ============================================================================== --- stable/9/sbin/atacontrol/atacontrol.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sbin/atacontrol/atacontrol.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -367,8 +367,8 @@ You should not set a spindown timeout on or syslog logging on it as the disk will be worn out spinning down and up all the time. .Sh SEE ALSO -.Xr ata 4 -.Xr cam 4 +.Xr ata 4 , +.Xr cam 4 , .Xr camcontrol 8 .Sh HISTORY The Modified: stable/9/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/9/sbin/geom/class/part/gpart.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sbin/geom/class/part/gpart.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -650,7 +650,7 @@ for MBR, for GPT. .It Cm ms-ldm-metadata A partition that contains Logical Disk Manager (LDM) database. -The scheme-specifig type is +The scheme-specific type is .Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3" for GPT. .El @@ -971,7 +971,7 @@ By default mirrored volumes are shown as .Sx "PARTITION TYPES" section). If this variable set to 1 each component of the mirrored volume will be -present as independet partition. +present as independent partition. .Em NOTE : This may break a mirrored volume and lead to data damage. .El Modified: stable/9/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/9/sbin/geom/class/raid/graid.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sbin/geom/class/raid/graid.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -294,7 +294,7 @@ Debug level of the .Nm RAID GEOM class. .It Va kern.geom.raid.idle_threshold : No 1000000 -Time in microseconds to consider a volume idle for rebuild puroses. +Time in microseconds to consider a volume idle for rebuild purposes. .It Va kern.geom.raid.name_format : No 0 Providers name format: 0 -- raid/r{num}, 1 -- raid/{label}. .It Va kern.geom.raid.read_err_thresh : No 10 Modified: stable/9/sbin/geom/class/virstor/gvirstor.8 ============================================================================== --- stable/9/sbin/geom/class/virstor/gvirstor.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sbin/geom/class/virstor/gvirstor.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -113,7 +113,7 @@ Adds new components to existing virtual The specified virstor device must exist and be active .Pq i.e. module loaded, device present in Pa /dev . This action can be safely performed while the virstor device is in use -.Pq Qo hot Qc operation +.Pq Qo hot Qc operation . .It Cm remove Removes components from existing virtual device with the given .Ar name . @@ -268,7 +268,8 @@ change once it is set, and that the size components will always remain constant during their existence. For alternative ways to implement virtual or resizable file systems see .Xr zfs 1M , -.Xr gconcat 8 and +.Xr gconcat 8 +and .Xr growfs 8 . .Pp Note that Modified: stable/9/sbin/gvinum/gvinum.8 ============================================================================== --- stable/9/sbin/gvinum/gvinum.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sbin/gvinum/gvinum.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -58,7 +58,8 @@ All subdisks in the plex must be up for a parity check. .It Ic concat Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives Create a concatenated volume from the specified drives. -If no name is specified, a unique name will be set by gvinum. +If no name is specified, a unique name will be set by +.Ic gvinum . .It Ic create Oo Fl f Oc Op Ar description-file Create a volume as described in .Ar description-file . @@ -148,8 +149,8 @@ Normally this would be done by entering EOF character. .It Ic raid5 Oo Fl fv Oc Oo Fl s Ar stripesize Oc Oo Fl n Ar name Oc Ar drives Create a RAID-5 volume from the specified drives. -If no name is specified,a unique name will be set by -.Ic gvinum. +If no name is specified, a unique name will be set by +.Ic gvinum . This organization requires at least three drives. .It Ic rename Oo Fl r Oc Ar drive | subdisk | plex | volume newname Change the name of the specified object. @@ -202,8 +203,9 @@ Terminate access to the objects, or stop if no parameters are specified. .It Ic stripe Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives Create a striped volume from the specified drives. If no name is specified, -a unique name will be set by Ic gvinum. This organization requires at least two -drives. +a unique name will be set by +.Ic gvinum . +This organization requires at least two drives. .El .Sh DESCRIPTION The @@ -278,7 +280,8 @@ objects .El .Sh EXAMPLES To create a mirror on disks /dev/ad1 and /dev/ad2, create a filesystem, mount, -unmount and then stop Ic gvinum: +unmount and then stop +.Ic gvinum : .Pp .Dl "gvinum mirror /dev/ad1 /dev/ad2" .Dl "newfs /dev/gvinum/gvinumvolume0" Modified: stable/9/sbin/hastctl/hastctl.8 ============================================================================== --- stable/9/sbin/hastctl/hastctl.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sbin/hastctl/hastctl.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -211,7 +211,7 @@ nodeB# application_start .Xr ggatel 8 , .Xr hastd 8 , .Xr mount 8 , -.Xr newfs 8 . +.Xr newfs 8 .Sh AUTHORS The .Nm Modified: stable/9/sbin/hastd/hastd.8 ============================================================================== --- stable/9/sbin/hastd/hastd.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sbin/hastd/hastd.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -223,7 +223,7 @@ nodeA# mount -o noatime /dev/hast/shared .Xr hastctl 8 , .Xr mount 8 , .Xr newfs 8 , -.Xr g_bio 9 . +.Xr g_bio 9 .Sh AUTHORS The .Nm Modified: stable/9/sbin/mount/mount.8 ============================================================================== --- stable/9/sbin/mount/mount.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sbin/mount/mount.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -448,7 +448,7 @@ However, for the following file system t .Cm smbfs , .Cm udf , and -.Cm unionfs , +.Cm unionfs . .Nm will not call .Xr nmount 2 Modified: stable/9/sbin/natd/natd.8 ============================================================================== --- stable/9/sbin/natd/natd.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sbin/natd/natd.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -787,7 +787,7 @@ ipfw add allow ip from any to any .Pp Here the packet from internal network to Internet goes out via .Ql sis0 -(rule number 2000) and gets catched by the +(rule number 2000) and gets caught by the .Ic globalport socket (3000). After that, either a match is found in a translation table Modified: stable/9/share/man/man8/picobsd.8 ============================================================================== --- stable/9/share/man/man8/picobsd.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/share/man/man8/picobsd.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -54,7 +54,7 @@ The most important options for common op .Fl src , .Fl init , .Fl n and -.Fl v. +.Fl v . .Bl -tag -width indent .\" .It Fl -all_in_mfs @@ -94,7 +94,10 @@ subtree as necessary to subsequently bui images. .\" .It Fl -iso -Generate an ISO image, picobsd.iso, in addition to the disk image picobsd.bin +Generate an ISO image, +.Pa picobsd.iso , +in addition to the disk image +.Pa picobsd.bin . .\" .It Fl -modules Also build kernel modules. Modified: stable/9/share/man/man8/rc.8 ============================================================================== --- stable/9/share/man/man8/rc.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/share/man/man8/rc.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -253,7 +253,7 @@ The boot does not stop if such a script but a script can stop the boot if necessary by invoking the .Fn stop_boot function (from -.Xr rc.subr 8 ). +.Xr rc.subr 8 ) . .El .Pp Each script should contain Modified: stable/9/sys/boot/common/loader.8 ============================================================================== --- stable/9/sys/boot/common/loader.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sys/boot/common/loader.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -423,7 +423,7 @@ variable take effect immediately. Defines the base i/o port used to access console UART (i386 and amd64 only). If the variable is not set, its assumed value is 0x3F8, which -corresponds to PC port COM1, unless overriden by +corresponds to PC port COM1, unless overridden by .Va BOOT_COMCONSOLE_PORT variable during the compilation of .Nm . Modified: stable/9/sys/boot/forth/beastie.4th.8 ============================================================================== --- stable/9/sys/boot/forth/beastie.4th.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sys/boot/forth/beastie.4th.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm beastie.4th -.Nd FreeBSD ASCII art boot module. +.Nd FreeBSD ASCII art boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: stable/9/sys/boot/forth/brand.4th.8 ============================================================================== --- stable/9/sys/boot/forth/brand.4th.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sys/boot/forth/brand.4th.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm brand.4th -.Nd FreeBSD ASCII art boot module. +.Nd FreeBSD ASCII art boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: stable/9/sys/boot/forth/check-password.4th.8 ============================================================================== --- stable/9/sys/boot/forth/check-password.4th.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sys/boot/forth/check-password.4th.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm check-password.4th -.Nd FreeBSD password-checking boot module. +.Nd FreeBSD password-checking boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: stable/9/sys/boot/forth/color.4th.8 ============================================================================== --- stable/9/sys/boot/forth/color.4th.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sys/boot/forth/color.4th.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm color.4th -.Nd FreeBSD color-detection boot module. +.Nd FreeBSD color-detection boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: stable/9/sys/boot/forth/delay.4th.8 ============================================================================== --- stable/9/sys/boot/forth/delay.4th.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sys/boot/forth/delay.4th.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm delay.4th -.Nd FreeBSD debugging boot module. +.Nd FreeBSD debugging boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: stable/9/sys/boot/forth/menu.4th.8 ============================================================================== --- stable/9/sys/boot/forth/menu.4th.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sys/boot/forth/menu.4th.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm menu.4th -.Nd FreeBSD dynamic menu boot module. +.Nd FreeBSD dynamic menu boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: stable/9/sys/boot/forth/version.4th.8 ============================================================================== --- stable/9/sys/boot/forth/version.4th.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/sys/boot/forth/version.4th.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm version.4th -.Nd FreeBSD version string boot module. +.Nd FreeBSD version string boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: stable/9/usr.bin/ctlstat/ctlstat.8 ============================================================================== --- stable/9/usr.bin/ctlstat/ctlstat.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.bin/ctlstat/ctlstat.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -86,8 +86,8 @@ Notation (JSON) format. No statistics are computed in this mode, only raw numbers are displayed. .It Fl l Ar lun Request statistics for the specified LUN. -This option is incompatible with total ( -.Fl t ) +This option is incompatible with total +.Fl ( t ) mode. .It Fl n Ar numdevs Display statistics for this many devices. Modified: stable/9/usr.sbin/cpucontrol/cpucontrol.8 ============================================================================== --- stable/9/usr.sbin/cpucontrol/cpucontrol.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/cpucontrol/cpucontrol.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -31,7 +31,7 @@ .Nm cpucontrol .Nd control utility for the .Xr cpuctl 4 -device. +device .Sh SYNOPSIS .Nm .Op Fl vh Modified: stable/9/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/9/usr.sbin/ctladm/ctladm.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/ctladm/ctladm.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -538,7 +538,7 @@ List all LUNs registered with CTL. Because this command uses the ioctl port, it will only work when the FETDs (Front End Target Drivers) are enabled. This command is the equivalent of doing a REPORT LUNS on one LUN and then -and then an INQUIRY on each LUN in the system. +an INQUIRY on each LUN in the system. .It Ic delay Delay commands at the given location. There are two places where commands may be delayed currently: before data is transferred @@ -745,7 +745,7 @@ single port. As a general rule, the WWNN should be the same across all ports on the system. .It Fl W Ar wwpn -Set the World Wide Node Name for the given port. +Set the World Wide Port Name for the given port. The .Fl n argument must be specified, since this is only possible to implement on a @@ -915,10 +915,10 @@ Create a LUN using the block backend, sp .Pa src/usr.sbin/ctladm/ctladm.8 as the backing store, and specify the .Tn SCSI -VPD page 0x80 and 0x83 serial number ( -.Fl S) -and device ID ( -.Fl d). +VPD page 0x80 and 0x83 serial number +.Fl ( S ) +and device ID +.Fl ( d ) . .Pp .Dl ctladm remove -b block -l 12 .Pp Modified: stable/9/usr.sbin/flowctl/flowctl.8 ============================================================================== --- stable/9/usr.sbin/flowctl/flowctl.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/flowctl/flowctl.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -60,7 +60,7 @@ This command is the analog of the .Dq "show ip cache flow" command of a Cisco router. It dumps the contents of the flow cache in Cisco-like format. -Specifing either +Specifying either .Cm ipv4 or .Cm ipv6 Modified: stable/9/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- stable/9/usr.sbin/freebsd-update/freebsd-update.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/freebsd-update/freebsd-update.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -62,7 +62,7 @@ Release Engineering Team, e.g., .Fx 9.0-CURRENT. .Sh OPTIONS -The following options are supported +The following options are supported: .Bl -tag -width "-f conffile" .It Fl b Ar basedir Operate on a system mounted at Modified: stable/9/usr.sbin/i2c/i2c.8 ============================================================================== --- stable/9/usr.sbin/i2c/i2c.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/i2c/i2c.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -88,7 +88,7 @@ reset the controller. .It Fl s scan the bus for devices. .It Fl v -be verbose +be verbose. .It Fl w Ar 0|8|16 device addressing width (in bits). .El Modified: stable/9/usr.sbin/jail/jail.8 ============================================================================== --- stable/9/usr.sbin/jail/jail.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/jail/jail.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -255,7 +255,7 @@ They can also be given the values .Dq true and .Dq false . -Other partameters may have more than one value, specified as a +Other parameters may have more than one value, specified as a comma-separated list or with .Dq += in the configuration file (see @@ -269,7 +269,7 @@ parameters that are passed to the kernel can be seen with .Xr jls 8 , and can (usually) be changed with -.Dq Nm Fl m. +.Dq Nm Fl m . Then there are pseudo-parameters that are only used by .Nm itself. @@ -580,7 +580,7 @@ command parameters are command lines that are run in either the system or prison environment. They may be given multiple values, which run would the specified commands in sequence. -All commands must succed (return a zero exit status), or the jail will +All commands must succeed (return a zero exit status), or the jail will not be created or removed. .Pp The pseudo-parameters are: @@ -657,7 +657,8 @@ The maximum amount of time to wait for a after sending them a .Dv SIGTERM signal (which happens after the -.Va exec.stop commands have completed). +.Va exec.stop +commands have completed). After this many seconds have passed, the prison will be removed, which will kill any remaining processes. If this is set to zero, no Modified: stable/9/usr.sbin/rtadvctl/rtadvctl.8 ============================================================================== --- stable/9/usr.sbin/rtadvctl/rtadvctl.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/rtadvctl/rtadvctl.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -31,7 +31,8 @@ .Sh NAME .Nm rtadvctl .Nd control program for -.Xr rtadvd 8 daemon +.Xr rtadvd 8 +daemon .Sh SYNOPSIS .Nm .Op Fl v Modified: stable/9/usr.sbin/rtadvd/rtadvd.8 ============================================================================== --- stable/9/usr.sbin/rtadvd/rtadvd.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/rtadvd/rtadvd.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -140,7 +140,7 @@ option, which enables routing renumberin .It Fl p Specify an alternative file in which to store the process ID. The default is -.Pa /var/run/rtadvd.pid. +.Pa /var/run/rtadvd.pid . .It Fl R Accept router renumbering requests. If you enable it, certain IPsec setup is suggested for security reasons. Modified: stable/9/usr.sbin/smbmsg/smbmsg.8 ============================================================================== --- stable/9/usr.sbin/smbmsg/smbmsg.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/smbmsg/smbmsg.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -70,7 +70,7 @@ and writeable, respectively. The only valid additional option for this modus of operation (besides the .Fl p -option that choses the modus) is +option that chooses the modus) is .Fl f Ar dev . See below for a description. .Pp Modified: stable/9/usr.sbin/utxrm/utxrm.8 ============================================================================== --- stable/9/usr.sbin/utxrm/utxrm.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/utxrm/utxrm.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -62,7 +62,7 @@ database, its use is limited to the supe .Sh SEE ALSO .Xr getent 1 , .Xr w 1 , -.Xr pututxline 3 . +.Xr pututxline 3 .Sh HISTORY The .Nm Modified: stable/9/usr.sbin/wpa/ndis_events/ndis_events.8 ============================================================================== --- stable/9/usr.sbin/wpa/ndis_events/ndis_events.8 Tue Jun 19 00:41:29 2012 (r237246) +++ stable/9/usr.sbin/wpa/ndis_events/ndis_events.8 Tue Jun 19 02:54:54 2012 (r237247) @@ -71,7 +71,7 @@ When it detects an event that was genera interface, it transmits it via UDP packet on the loopback interface, where .Xr wpa_supplicant 8 -is presumeably listening. +is presumably listening. The standard .Xr wpa_supplicant 8 distribution includes its own version of this utility for use with From owner-svn-src-stable@FreeBSD.ORG Tue Jun 19 06:46:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 390FF1065674; Tue, 19 Jun 2012 06:46:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0971D8FC08; Tue, 19 Jun 2012 06:46: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 q5J6ksU4026584; Tue, 19 Jun 2012 06:46:54 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5J6ksNT026580; Tue, 19 Jun 2012 06:46:54 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201206190646.q5J6ksNT026580@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 19 Jun 2012 06:46: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: r237261 - stable/9/lib/libusb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 06:46:55 -0000 Author: hselasky Date: Tue Jun 19 06:46:54 2012 New Revision: 237261 URL: http://svn.freebsd.org/changeset/base/237261 Log: MFC r236944: LibUSB v1.0 API compliance and bugfixes. Modified: stable/9/lib/libusb/Makefile stable/9/lib/libusb/libusb10.c stable/9/lib/libusb/libusb10_io.c Directory Properties: stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/Makefile ============================================================================== --- stable/9/lib/libusb/Makefile Tue Jun 19 06:18:42 2012 (r237260) +++ stable/9/lib/libusb/Makefile Tue Jun 19 06:46:54 2012 (r237261) @@ -18,6 +18,9 @@ NOGCCERROR= WARNS?= 2 +DPADD= ${LIBPTHREAD} +LDADD= -lpthread + MLINKS+= libusb.3 usb.3 # libusb 0.1 compat Modified: stable/9/lib/libusb/libusb10.c ============================================================================== --- stable/9/lib/libusb/libusb10.c Tue Jun 19 06:18:42 2012 (r237260) +++ stable/9/lib/libusb/libusb10.c Tue Jun 19 06:46:54 2012 (r237261) @@ -92,6 +92,7 @@ int libusb_init(libusb_context **context) { struct libusb_context *ctx; + pthread_condattr_t attr; char *debug; int ret; @@ -110,8 +111,28 @@ libusb_init(libusb_context **context) TAILQ_INIT(&ctx->pollfds); TAILQ_INIT(&ctx->tr_done); - pthread_mutex_init(&ctx->ctx_lock, NULL); - pthread_cond_init(&ctx->ctx_cond, NULL); + if (pthread_mutex_init(&ctx->ctx_lock, NULL) != 0) { + free(ctx); + return (LIBUSB_ERROR_NO_MEM); + } + if (pthread_condattr_init(&attr) != 0) { + pthread_mutex_destroy(&ctx->ctx_lock); + free(ctx); + return (LIBUSB_ERROR_NO_MEM); + } + if (pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) != 0) { + pthread_mutex_destroy(&ctx->ctx_lock); + pthread_condattr_destroy(&attr); + free(ctx); + return (LIBUSB_ERROR_OTHER); + } + if (pthread_cond_init(&ctx->ctx_cond, &attr) != 0) { + pthread_mutex_destroy(&ctx->ctx_lock); + pthread_condattr_destroy(&attr); + free(ctx); + return (LIBUSB_ERROR_NO_MEM); + } + pthread_condattr_destroy(&attr); ctx->ctx_handler = NO_THREAD; Modified: stable/9/lib/libusb/libusb10_io.c ============================================================================== --- stable/9/lib/libusb/libusb10_io.c Tue Jun 19 06:18:42 2012 (r237260) +++ stable/9/lib/libusb/libusb10_io.c Tue Jun 19 06:46:54 2012 (r237261) @@ -307,12 +307,16 @@ libusb_wait_for_event(libusb_context *ct &ctx->ctx_lock); return (0); } - err = clock_gettime(CLOCK_REALTIME, &ts); + err = clock_gettime(CLOCK_MONOTONIC, &ts); if (err < 0) return (LIBUSB_ERROR_OTHER); - ts.tv_sec = tv->tv_sec; - ts.tv_nsec = tv->tv_usec * 1000; + /* + * The "tv" arguments points to a relative time structure and + * not an absolute time structure. + */ + ts.tv_sec += tv->tv_sec; + ts.tv_nsec += tv->tv_usec * 1000; if (ts.tv_nsec >= 1000000000) { ts.tv_nsec -= 1000000000; ts.tv_sec++; From owner-svn-src-stable@FreeBSD.ORG Tue Jun 19 06:52:21 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA8AB1065672; Tue, 19 Jun 2012 06:52:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B8BE8FC12; Tue, 19 Jun 2012 06:52: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 q5J6qLfa026852; Tue, 19 Jun 2012 06:52:21 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5J6qLF2026848; Tue, 19 Jun 2012 06:52:21 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201206190652.q5J6qLF2026848@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 19 Jun 2012 06:52: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: r237262 - stable/8/lib/libusb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 06:52:21 -0000 Author: hselasky Date: Tue Jun 19 06:52:21 2012 New Revision: 237262 URL: http://svn.freebsd.org/changeset/base/237262 Log: MFC r236944: LibUSB v1.0 API compliance and bugfixes. Modified: stable/8/lib/libusb/Makefile stable/8/lib/libusb/libusb10.c stable/8/lib/libusb/libusb10_io.c Directory Properties: stable/8/lib/libusb/ (props changed) Modified: stable/8/lib/libusb/Makefile ============================================================================== --- stable/8/lib/libusb/Makefile Tue Jun 19 06:46:54 2012 (r237261) +++ stable/8/lib/libusb/Makefile Tue Jun 19 06:52:21 2012 (r237262) @@ -16,6 +16,9 @@ MAN= libusb.3 libusb20.3 MKLINT= no NOGCCERROR= +DPADD= ${LIBPTHREAD} +LDADD= -lpthread + MLINKS+= libusb.3 usb.3 # libusb 0.1 compat Modified: stable/8/lib/libusb/libusb10.c ============================================================================== --- stable/8/lib/libusb/libusb10.c Tue Jun 19 06:46:54 2012 (r237261) +++ stable/8/lib/libusb/libusb10.c Tue Jun 19 06:52:21 2012 (r237262) @@ -92,6 +92,7 @@ int libusb_init(libusb_context **context) { struct libusb_context *ctx; + pthread_condattr_t attr; char *debug; int ret; @@ -110,8 +111,28 @@ libusb_init(libusb_context **context) TAILQ_INIT(&ctx->pollfds); TAILQ_INIT(&ctx->tr_done); - pthread_mutex_init(&ctx->ctx_lock, NULL); - pthread_cond_init(&ctx->ctx_cond, NULL); + if (pthread_mutex_init(&ctx->ctx_lock, NULL) != 0) { + free(ctx); + return (LIBUSB_ERROR_NO_MEM); + } + if (pthread_condattr_init(&attr) != 0) { + pthread_mutex_destroy(&ctx->ctx_lock); + free(ctx); + return (LIBUSB_ERROR_NO_MEM); + } + if (pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) != 0) { + pthread_mutex_destroy(&ctx->ctx_lock); + pthread_condattr_destroy(&attr); + free(ctx); + return (LIBUSB_ERROR_OTHER); + } + if (pthread_cond_init(&ctx->ctx_cond, &attr) != 0) { + pthread_mutex_destroy(&ctx->ctx_lock); + pthread_condattr_destroy(&attr); + free(ctx); + return (LIBUSB_ERROR_NO_MEM); + } + pthread_condattr_destroy(&attr); ctx->ctx_handler = NO_THREAD; Modified: stable/8/lib/libusb/libusb10_io.c ============================================================================== --- stable/8/lib/libusb/libusb10_io.c Tue Jun 19 06:46:54 2012 (r237261) +++ stable/8/lib/libusb/libusb10_io.c Tue Jun 19 06:52:21 2012 (r237262) @@ -307,12 +307,16 @@ libusb_wait_for_event(libusb_context *ct &ctx->ctx_lock); return (0); } - err = clock_gettime(CLOCK_REALTIME, &ts); + err = clock_gettime(CLOCK_MONOTONIC, &ts); if (err < 0) return (LIBUSB_ERROR_OTHER); - ts.tv_sec = tv->tv_sec; - ts.tv_nsec = tv->tv_usec * 1000; + /* + * The "tv" arguments points to a relative time structure and + * not an absolute time structure. + */ + ts.tv_sec += tv->tv_sec; + ts.tv_nsec += tv->tv_usec * 1000; if (ts.tv_nsec >= 1000000000) { ts.tv_nsec -= 1000000000; ts.tv_sec++; From owner-svn-src-stable@FreeBSD.ORG Tue Jun 19 10:04:37 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E59C106566B; Tue, 19 Jun 2012 10:04:37 +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 289478FC14; Tue, 19 Jun 2012 10:04: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 q5JA4a3E035040; Tue, 19 Jun 2012 10:04:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5JA4auO035038; Tue, 19 Jun 2012 10:04:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206191004.q5JA4auO035038@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 19 Jun 2012 10:04: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: r237265 - stable/9/sbin/fsck_ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 10:04:37 -0000 Author: kib Date: Tue Jun 19 10:04:36 2012 New Revision: 237265 URL: http://svn.freebsd.org/changeset/base/237265 Log: MFC r236976: For incompleted block allocations or frees, the inode block count usage must be recalculated. The blk_check pass of suj checker explicitely marks inodes which owned such blocks as needing block count adjustment. But ino_adjblks() is only called by cg_trunc pass, which is performed before blk_check. As result, the block use count for such inodes is left wrong. This causes full fsck run after journaled run to still find inconsistencies like 'INCORRECT BLOCK COUNT I=14557 (328 should be 0)' in phase 1. Fix this issue by running additional adj_blk pass after blk_check, which updates the field. Modified: stable/9/sbin/fsck_ffs/suj.c Directory Properties: stable/9/sbin/fsck_ffs/ (props changed) Modified: stable/9/sbin/fsck_ffs/suj.c ============================================================================== --- stable/9/sbin/fsck_ffs/suj.c Tue Jun 19 08:12:44 2012 (r237264) +++ stable/9/sbin/fsck_ffs/suj.c Tue Jun 19 10:04:36 2012 (r237265) @@ -1789,6 +1789,20 @@ cg_trunc(struct suj_cg *sc) } } +static void +cg_adj_blk(struct suj_cg *sc) +{ + struct suj_ino *sino; + int i; + + for (i = 0; i < SUJ_HASHSIZE; i++) { + LIST_FOREACH(sino, &sc->sc_inohash[i], si_next) { + if (sino->si_blkadj) + ino_adjblks(sino); + } + } +} + /* * Free any partially allocated blocks and then resolve inode block * counts. @@ -2720,6 +2734,7 @@ suj_check(const char *filesys) printf("** Processing journal entries.\n"); cg_apply(cg_trunc); cg_apply(cg_check_blk); + cg_apply(cg_adj_blk); cg_apply(cg_check_ino); } if (preen == 0 && (jrecs > 0 || jbytes > 0) && reply("WRITE CHANGES") == 0) From owner-svn-src-stable@FreeBSD.ORG Tue Jun 19 10:06:35 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F725106566C; Tue, 19 Jun 2012 10:06:35 +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 EE6C78FC0A; Tue, 19 Jun 2012 10:06: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 q5JA6YbY035180; Tue, 19 Jun 2012 10:06:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5JA6YNC035178; Tue, 19 Jun 2012 10:06:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206191006.q5JA6YNC035178@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 19 Jun 2012 10:06:34 +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: r237266 - stable/9/lib/libc/gen X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 10:06:35 -0000 Author: kib Date: Tue Jun 19 10:06:34 2012 New Revision: 237266 URL: http://svn.freebsd.org/changeset/base/237266 Log: MFC r237159: Fix reading of netgroup(5) file which contains more then one netgroup. Modified: stable/9/lib/libc/gen/getnetgrent.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/getnetgrent.c ============================================================================== --- stable/9/lib/libc/gen/getnetgrent.c Tue Jun 19 10:04:36 2012 (r237265) +++ stable/9/lib/libc/gen/getnetgrent.c Tue Jun 19 10:06:34 2012 (r237266) @@ -538,7 +538,7 @@ parse_netgrp(const char *group) static struct linelist * read_for_group(const char *group) { - char *pos, *spos, *linep; + char *linep, *olinep, *pos, *spos; int len, olen; int cont; struct linelist *lp; @@ -615,15 +615,20 @@ read_for_group(const char *group) } else cont = 0; if (len > 0) { - linep = reallocf(linep, olen + len + 1); + linep = malloc(olen + len + 1); if (linep == NULL) { free(lp->l_groupname); free(lp); return (NULL); } + if (olen > 0) { + bcopy(olinep, linep, olen); + free(olinep); + } bcopy(pos, linep + olen, len); olen += len; *(linep + olen) = '\0'; + olinep = linep; } if (cont) { if (fgets(line, LINSIZ, netf)) { From owner-svn-src-stable@FreeBSD.ORG Tue Jun 19 10:07:51 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58742106566C; Tue, 19 Jun 2012 10:07:51 +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 290048FC15; Tue, 19 Jun 2012 10:07: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 q5JA7pfN035286; Tue, 19 Jun 2012 10:07:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5JA7odp035284; Tue, 19 Jun 2012 10:07:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206191007.q5JA7odp035284@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 19 Jun 2012 10:07: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: r237267 - stable/9/lib/libc/gen X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 10:07:51 -0000 Author: kib Date: Tue Jun 19 10:07:50 2012 New Revision: 237267 URL: http://svn.freebsd.org/changeset/base/237267 Log: MFC r237160: More style. Modified: stable/9/lib/libc/gen/getnetgrent.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/getnetgrent.c ============================================================================== --- stable/9/lib/libc/gen/getnetgrent.c Tue Jun 19 10:06:34 2012 (r237266) +++ stable/9/lib/libc/gen/getnetgrent.c Tue Jun 19 10:07:50 2012 (r237267) @@ -161,8 +161,7 @@ setnetgrent(const char *group) if (group == NULL || !strlen(group)) return; - if (grouphead.gr == (struct netgrp *)0 || - strcmp(group, grouphead.grname)) { + if (grouphead.gr == NULL || strcmp(group, grouphead.grname)) { endnetgrent(); #ifdef YP /* Presumed guilty until proven innocent. */ @@ -172,7 +171,7 @@ setnetgrent(const char *group) * use NIS exclusively. */ if (((stat(_PATH_NETGROUP, &_yp_statp) < 0) && - errno == ENOENT) || _yp_statp.st_size == 0) + errno == ENOENT) || _yp_statp.st_size == 0) _use_only_yp = _netgr_yp_enabled = 1; if ((netf = fopen(_PATH_NETGROUP,"r")) != NULL ||_use_only_yp){ /* @@ -247,27 +246,24 @@ endnetgrent(void) lp = lp->l_next; free(olp->l_groupname); free(olp->l_line); - free((char *)olp); + free(olp); } - linehead = (struct linelist *)0; + linehead = NULL; if (grouphead.grname) { free(grouphead.grname); - grouphead.grname = (char *)0; + grouphead.grname = NULL; } gp = grouphead.gr; while (gp) { ogp = gp; gp = gp->ng_next; - if (ogp->ng_str[NG_HOST]) - free(ogp->ng_str[NG_HOST]); - if (ogp->ng_str[NG_USER]) - free(ogp->ng_str[NG_USER]); - if (ogp->ng_str[NG_DOM]) - free(ogp->ng_str[NG_DOM]); - free((char *)ogp); + free(ogp->ng_str[NG_HOST]); + free(ogp->ng_str[NG_USER]); + free(ogp->ng_str[NG_DOM]); + free(ogp); } - grouphead.gr = (struct netgrp *)0; - nextgrp = (struct netgrp *)0; + grouphead.gr = NULL; + nextgrp = NULL; #ifdef YP _netgr_yp_enabled = 0; #endif @@ -282,7 +278,7 @@ _listmatch(const char *list, const char int glen = strlen(group); /* skip possible leading whitespace */ - while(isspace((unsigned char)*ptr)) + while (isspace((unsigned char)*ptr)) ptr++; while (ptr < list + len) { @@ -291,7 +287,7 @@ _listmatch(const char *list, const char ptr++; if (strncmp(cptr, group, glen) == 0 && glen == (ptr - cptr)) return (1); - while(*ptr == ',' || isspace((unsigned char)*ptr)) + while (*ptr == ',' || isspace((unsigned char)*ptr)) ptr++; } @@ -436,8 +432,7 @@ parse_netgrp(const char *group) break; lp = lp->l_next; } - if (lp == (struct linelist *)0 && - (lp = read_for_group(group)) == (struct linelist *)0) + if (lp == NULL && (lp = read_for_group(group)) == NULL) return (1); if (lp->l_parsed) { #ifdef DEBUG From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 06:58:18 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C7A7106566B; Wed, 20 Jun 2012 06:58: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 17B038FC0A; Wed, 20 Jun 2012 06:58: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 q5K6wHDP024881; Wed, 20 Jun 2012 06:58:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5K6wH1j024879; Wed, 20 Jun 2012 06:58:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206200658.q5K6wH1j024879@svn.freebsd.org> From: Eitan Adler Date: Wed, 20 Jun 2012 06:58: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: r237287 - stable/9/share/examples/csh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 06:58:18 -0000 Author: eadler Date: Wed Jun 20 06:58:17 2012 New Revision: 237287 URL: http://svn.freebsd.org/changeset/base/237287 Log: MFC r236999: Include a warning when using the example code as it may not work in unusual situations. Also slightly optimize the command. Approved by: cperciva (implicit) Modified: stable/9/share/examples/csh/dot.cshrc Directory Properties: stable/9/share/examples/csh/ (props changed) Modified: stable/9/share/examples/csh/dot.cshrc ============================================================================== --- stable/9/share/examples/csh/dot.cshrc Wed Jun 20 06:38:41 2012 (r237286) +++ stable/9/share/examples/csh/dot.cshrc Wed Jun 20 06:58:17 2012 (r237287) @@ -4,8 +4,12 @@ # # Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running +# +# This has a couple caveats, the most notable being that if a user +# has multiple ssh-agent(1) processes running, this will very likely +# set SSH_AUTH_SOCK to point to the wrong file/domain socket. if (${?SSH_AUTH_SOCK} != "1") then - setenv SSH_AUTH_SOCK `sockstat | grep "^${USER} " | awk '/ssh-agent/ { print $6 }'` + setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print $6 }' endif # Change only root's prompt From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 06:58:38 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C677D10656F0; Wed, 20 Jun 2012 06:58:38 +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 B080B8FC08; Wed, 20 Jun 2012 06:58: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 q5K6wcWl024928; Wed, 20 Jun 2012 06:58:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5K6wcDj024926; Wed, 20 Jun 2012 06:58:38 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206200658.q5K6wcDj024926@svn.freebsd.org> From: Eitan Adler Date: Wed, 20 Jun 2012 06:58:38 +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: r237288 - stable/8/share/examples/csh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 06:58:38 -0000 Author: eadler Date: Wed Jun 20 06:58:38 2012 New Revision: 237288 URL: http://svn.freebsd.org/changeset/base/237288 Log: MFC r236999: Include a warning when using the example code as it may not work in unusual situations. Also slightly optimize the command. Approved by: cperciva (implicit) Modified: stable/8/share/examples/csh/dot.cshrc Directory Properties: stable/8/share/examples/csh/ (props changed) Modified: stable/8/share/examples/csh/dot.cshrc ============================================================================== --- stable/8/share/examples/csh/dot.cshrc Wed Jun 20 06:58:17 2012 (r237287) +++ stable/8/share/examples/csh/dot.cshrc Wed Jun 20 06:58:38 2012 (r237288) @@ -4,8 +4,12 @@ # # Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running +# +# This has a couple caveats, the most notable being that if a user +# has multiple ssh-agent(1) processes running, this will very likely +# set SSH_AUTH_SOCK to point to the wrong file/domain socket. if (${?SSH_AUTH_SOCK} != "1") then - setenv SSH_AUTH_SOCK `sockstat | grep "^${USER} " | awk '/ssh-agent/ { print $6 }'` + setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print $6 }' endif # Change only root's prompt From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 06:58:57 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CFF210657A9; Wed, 20 Jun 2012 06:58:57 +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 05BB08FC08; Wed, 20 Jun 2012 06:58: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 q5K6wuBf024976; Wed, 20 Jun 2012 06:58:56 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5K6wu9F024973; Wed, 20 Jun 2012 06:58:56 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206200658.q5K6wu9F024973@svn.freebsd.org> From: Eitan Adler Date: Wed, 20 Jun 2012 06:58:56 +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: r237289 - stable/7/share/examples/csh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 06:58:57 -0000 Author: eadler Date: Wed Jun 20 06:58:56 2012 New Revision: 237289 URL: http://svn.freebsd.org/changeset/base/237289 Log: MFC r236999: Include a warning when using the example code as it may not work in unusual situations. Also slightly optimize the command. Approved by: cperciva (implicit) Modified: stable/7/share/examples/csh/dot.cshrc Directory Properties: stable/7/share/examples/csh/ (props changed) Modified: stable/7/share/examples/csh/dot.cshrc ============================================================================== --- stable/7/share/examples/csh/dot.cshrc Wed Jun 20 06:58:38 2012 (r237288) +++ stable/7/share/examples/csh/dot.cshrc Wed Jun 20 06:58:56 2012 (r237289) @@ -4,8 +4,12 @@ # # Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running +# +# This has a couple caveats, the most notable being that if a user +# has multiple ssh-agent(1) processes running, this will very likely +# set SSH_AUTH_SOCK to point to the wrong file/domain socket. if (${?SSH_AUTH_SOCK} != "1") then - setenv SSH_AUTH_SOCK `sockstat | grep "^${USER} " | awk '/ssh-agent/ { print $6 }'` + setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print $6 }' endif # Change only root's prompt From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 09:38:36 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E91C1065675; Wed, 20 Jun 2012 09:38:36 +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 88A508FC20; Wed, 20 Jun 2012 09:38:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5K9caUG031931; Wed, 20 Jun 2012 09:38:36 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5K9ca4q031926; Wed, 20 Jun 2012 09:38:36 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201206200938.q5K9ca4q031926@svn.freebsd.org> From: Christian Brueffer Date: Wed, 20 Jun 2012 09:38: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: r237296 - in stable/9: . share/man/man9 sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 09:38:36 -0000 Author: brueffer Date: Wed Jun 20 09:38:35 2012 New Revision: 237296 URL: http://svn.freebsd.org/changeset/base/237296 Log: MFC: r232051 Catch up with r195837 (2.5 years ago) which renamed net_add_domain() to domain_add(). Modified: stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/share/man/man9/Makefile stable/9/share/man/man9/domain.9 stable/9/sys/kern/uipc_domain.c Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Wed Jun 20 09:01:44 2012 (r237295) +++ stable/9/ObsoleteFiles.inc Wed Jun 20 09:38:35 2012 (r237296) @@ -677,6 +677,8 @@ OLD_LIBS+=usr/lib32/pam_tacplus.so.4 OLD_LIBS+=usr/lib32/pam_unix.so.4 # 20090718: the gdm pam.d file is no longer required. OLD_FILES+=etc/pam.d/gdm +# 20090714: net_add_domain(9) renamed to domain_add(9) +OLD_FILES+=usr/share/man/man9/net_add_domain.9.gz # 20090713: vimage container structs removed. OLD_FILES+=usr/include/netinet/vinet.h OLD_FILES+=usr/include/netinet6/vinet6.h Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Wed Jun 20 09:01:44 2012 (r237295) +++ stable/9/share/man/man9/Makefile Wed Jun 20 09:38:35 2012 (r237296) @@ -614,7 +614,7 @@ MLINKS+=disk.9 disk_alloc.9 \ disk.9 disk_destroy.9 \ disk.9 disk_gone.9 MLINKS+=domain.9 DOMAIN_SET.9 \ - domain.9 net_add_domain.9 \ + domain.9 domain_add.9 \ domain.9 pfctlinput.9 \ domain.9 pfctlinput2.9 \ domain.9 pffindproto.9 \ Modified: stable/9/share/man/man9/domain.9 ============================================================================== --- stable/9/share/man/man9/domain.9 Wed Jun 20 09:01:44 2012 (r237295) +++ stable/9/share/man/man9/domain.9 Wed Jun 20 09:38:35 2012 (r237296) @@ -26,11 +26,11 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd February 23, 2012 .Dt DOMAIN 9 .Os .Sh NAME -.Nm net_add_domain , +.Nm domain_add , .Nm pfctlinput , .Nm pfctlinput2 , .Nm pffindproto , @@ -43,7 +43,7 @@ .In sys/protosw.h .In sys/domain.h .Ft void -.Fn net_add_domain "void *data" +.Fn domain_add "void *data" .Ft void .Fn pfctlinput "int cmd" "struct sockaddr *sa" .Ft void @@ -142,7 +142,7 @@ have their .Fn pr_ctlinput function called. .Pp -.Fn net_add_domain +.Fn domain_add adds a new protocol domain to the system. The argument .Fa data @@ -153,13 +153,13 @@ within the function, but is declared in order to prevent compiler warnings when new domains are registered with .Fn SYSINIT . In most cases -.Fn net_add_domain +.Fn domain_add is not called directly, instead .Fn DOMAIN_SET is used. .Pp If the new domain has defined an initialization routine, it is called by -.Fn net_add_domain ; +.Fn domain_add ; as well, each of the protocols within the domain that have defined an initialization routine will have theirs called. .Pp Modified: stable/9/sys/kern/uipc_domain.c ============================================================================== --- stable/9/sys/kern/uipc_domain.c Wed Jun 20 09:01:44 2012 (r237295) +++ stable/9/sys/kern/uipc_domain.c Wed Jun 20 09:38:35 2012 (r237296) @@ -220,7 +220,7 @@ domain_add(void *data) domains = dp; KASSERT(domain_init_status >= 1, - ("attempt to net_add_domain(%s) before domaininit()", + ("attempt to domain_add(%s) before domaininit()", dp->dom_name)); #ifndef INVARIANTS if (domain_init_status < 1) From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 10:59:12 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46AB0106567A; Wed, 20 Jun 2012 10:59:12 +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 2FA628FC08; Wed, 20 Jun 2012 10:59: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 q5KAxCDP038069; Wed, 20 Jun 2012 10:59:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KAxBXM038064; Wed, 20 Jun 2012 10:59:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201206201059.q5KAxBXM038064@svn.freebsd.org> From: Christian Brueffer Date: Wed, 20 Jun 2012 10:59: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: r237298 - in stable/8: . share/man/man9 sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 10:59:12 -0000 Author: brueffer Date: Wed Jun 20 10:59:11 2012 New Revision: 237298 URL: http://svn.freebsd.org/changeset/base/237298 Log: MFC: r232051 Catch up with r195837 (2.5 years ago) which renamed net_add_domain() to domain_add(). Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/share/man/man9/Makefile stable/8/share/man/man9/domain.9 stable/8/sys/kern/uipc_domain.c Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Wed Jun 20 10:15:45 2012 (r237297) +++ stable/8/ObsoleteFiles.inc Wed Jun 20 10:59:11 2012 (r237298) @@ -345,6 +345,8 @@ OLD_LIBS+=usr/lib32/pam_unix.so.4 .endif # 20090718: the gdm pam.d file is no longer required. OLD_FILES+=etc/pam.d/gdm +# 20090714: net_add_domain(9) renamed to domain_add(9) +OLD_FILES+=usr/share/man/man9/net_add_domain.9.gz # 20090713: vimage container structs removed. OLD_FILES+=usr/include/netinet/vinet.h OLD_FILES+=usr/include/netinet6/vinet6.h Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Wed Jun 20 10:15:45 2012 (r237297) +++ stable/8/share/man/man9/Makefile Wed Jun 20 10:59:11 2012 (r237298) @@ -612,7 +612,7 @@ MLINKS+=disk.9 disk_alloc.9 \ disk.9 disk_gone.9 \ disk.9 disk_destroy.9 MLINKS+=domain.9 DOMAIN_SET.9 \ - domain.9 net_add_domain.9 \ + domain.9 domain_add.9 \ domain.9 pfctlinput.9 \ domain.9 pfctlinput2.9 \ domain.9 pffindproto.9 \ Modified: stable/8/share/man/man9/domain.9 ============================================================================== --- stable/8/share/man/man9/domain.9 Wed Jun 20 10:15:45 2012 (r237297) +++ stable/8/share/man/man9/domain.9 Wed Jun 20 10:59:11 2012 (r237298) @@ -26,11 +26,11 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd February 23, 2012 .Dt DOMAIN 9 .Os .Sh NAME -.Nm net_add_domain , +.Nm domain_add , .Nm pfctlinput , .Nm pfctlinput2 , .Nm pffindproto , @@ -43,7 +43,7 @@ .In sys/protosw.h .In sys/domain.h .Ft void -.Fn net_add_domain "void *data" +.Fn domain_add "void *data" .Ft void .Fn pfctlinput "int cmd" "struct sockaddr *sa" .Ft void @@ -142,7 +142,7 @@ have their .Fn pr_ctlinput function called. .Pp -.Fn net_add_domain +.Fn domain_add adds a new protocol domain to the system. The argument .Fa data @@ -153,13 +153,13 @@ within the function, but is declared in order to prevent compiler warnings when new domains are registered with .Fn SYSINIT . In most cases -.Fn net_add_domain +.Fn domain_add is not called directly, instead .Fn DOMAIN_SET is used. .Pp If the new domain has defined an initialization routine, it is called by -.Fn net_add_domain ; +.Fn domain_add ; as well, each of the protocols within the domain that have defined an initialization routine will have theirs called. .Pp Modified: stable/8/sys/kern/uipc_domain.c ============================================================================== --- stable/8/sys/kern/uipc_domain.c Wed Jun 20 10:15:45 2012 (r237297) +++ stable/8/sys/kern/uipc_domain.c Wed Jun 20 10:59:11 2012 (r237298) @@ -220,7 +220,7 @@ domain_add(void *data) domains = dp; KASSERT(domain_init_status >= 1, - ("attempt to net_add_domain(%s) before domaininit()", + ("attempt to domain_add(%s) before domaininit()", dp->dom_name)); #ifndef INVARIANTS if (domain_init_status < 1) From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 13:41:21 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37C151065674; Wed, 20 Jun 2012 13:41:21 +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 223628FC14; Wed, 20 Jun 2012 13: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 q5KDfKDY045102; Wed, 20 Jun 2012 13:41:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KDfKmY045100; Wed, 20 Jun 2012 13:41:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201341.q5KDfKmY045100@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 13:41: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: r237303 - stable/9/sys/cam X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 13:41:21 -0000 Author: mav Date: Wed Jun 20 13:41:20 2012 New Revision: 237303 URL: http://svn.freebsd.org/changeset/base/237303 Log: MFC r236605: Replace #ifdef CAMDEBUG + if + panic() with single KASSERT(). 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 20 12:46:27 2012 (r237302) +++ stable/9/sys/cam/cam_xpt.c Wed Jun 20 13:41:20 2012 (r237303) @@ -3226,13 +3226,8 @@ xpt_run_dev_allocq(struct cam_eb *bus) ("running device %p\n", device)); drvq = &device->drvq; - -#ifdef CAMDEBUG - if (drvq->entries <= 0) { - panic("xpt_run_dev_allocq: " - "Device on queue without any work to do"); - } -#endif + KASSERT(drvq->entries > 0, ("xpt_run_dev_allocq: " + "Device on queue without any work to do")); if ((work_ccb = xpt_get_ccb(device)) != NULL) { devq->alloc_openings--; devq->alloc_active++; From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 13:42:41 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69DE91065676; Wed, 20 Jun 2012 13:42:41 +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 54B878FC20; Wed, 20 Jun 2012 13:42: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 q5KDgfeH045208; Wed, 20 Jun 2012 13:42:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KDgf4S045206; Wed, 20 Jun 2012 13:42:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201342.q5KDgf4S045206@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 13:42: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: r237304 - stable/8/sys/cam X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 13:42:41 -0000 Author: mav Date: Wed Jun 20 13:42:40 2012 New Revision: 237304 URL: http://svn.freebsd.org/changeset/base/237304 Log: MFC r236605: Replace #ifdef CAMDEBUG + if + panic() with single KASSERT(). 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 20 13:41:20 2012 (r237303) +++ stable/8/sys/cam/cam_xpt.c Wed Jun 20 13:42:40 2012 (r237304) @@ -3179,13 +3179,8 @@ xpt_run_dev_allocq(struct cam_eb *bus) ("running device %p\n", device)); drvq = &device->drvq; - -#ifdef CAMDEBUG - if (drvq->entries <= 0) { - panic("xpt_run_dev_allocq: " - "Device on queue without any work to do"); - } -#endif + KASSERT(drvq->entries > 0, ("xpt_run_dev_allocq: " + "Device on queue without any work to do")); if ((work_ccb = xpt_get_ccb(device)) != NULL) { devq->alloc_openings--; devq->alloc_active++; From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 13:59:25 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0B5F1065676; Wed, 20 Jun 2012 13:59:25 +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 B92228FC12; Wed, 20 Jun 2012 13:59: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 q5KDxPpG046008; Wed, 20 Jun 2012 13:59:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KDxPqD045999; Wed, 20 Jun 2012 13:59:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201359.q5KDxPqD045999@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 13:59: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: r237305 - in stable/9/sys/cam: ata scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 13:59:26 -0000 Author: mav Date: Wed Jun 20 13:59:25 2012 New Revision: 237305 URL: http://svn.freebsd.org/changeset/base/237305 Log: MFC r236602, r236613: Tune and add some missing CAM_DEBUG() points for better consistency. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_pmp.c stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_pt.c stable/9/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Wed Jun 20 13:42:40 2012 (r237304) +++ stable/9/sys/cam/ata/ata_da.c Wed Jun 20 13:59:25 2012 (r237305) @@ -436,9 +436,8 @@ adaopen(struct disk *dp) softc = (struct ada_softc *)periph->softc; softc->flags |= ADA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("adaopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit, - periph->unit_number)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("adaopen\n")); if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) { /* Invalidate our pack information. */ @@ -469,6 +468,10 @@ adaclose(struct disk *dp) } softc = (struct ada_softc *)periph->softc; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("adaclose\n")); + /* We only sync the cache if the drive is capable of it. */ if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { @@ -542,6 +545,8 @@ adastrategy(struct bio *bp) cam_periph_lock(periph); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adastrategy(%p)\n", bp)); + /* * If the device has been made invalid, error out */ @@ -1167,6 +1172,8 @@ adastart(struct cam_periph *periph, unio struct ada_softc *softc = (struct ada_softc *)periph->softc; struct ccb_ataio *ataio = &start_ccb->ataio; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adastart\n")); + switch (softc->state) { case ADA_STATE_NORMAL: { @@ -1175,7 +1182,7 @@ adastart(struct cam_periph *periph, unio /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = ADA_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -1467,6 +1474,9 @@ adadone(struct cam_periph *periph, union softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adadone\n")); + switch (ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) { case ADA_CCB_BUFFER_IO: case ADA_CCB_TRIM: Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Wed Jun 20 13:42:40 2012 (r237304) +++ stable/9/sys/cam/ata/ata_pmp.c Wed Jun 20 13:59:25 2012 (r237305) @@ -429,7 +429,9 @@ pmpstart(struct cam_periph *periph, unio softc = (struct pmp_softc *)periph->softc; ataio = &start_ccb->ataio; - + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("pmpstart\n")); + if (softc->restart) { softc->restart = 0; softc->state = min(softc->state, PMP_STATE_PRECONFIG); @@ -560,7 +562,7 @@ pmpdone(struct cam_periph *periph, union softc = (struct pmp_softc *)periph->softc; ataio = &done_ccb->ataio; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("pmpdone\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("pmpdone\n")); priority = done_ccb->ccb_h.pinfo.priority; Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Wed Jun 20 13:42:40 2012 (r237304) +++ stable/9/sys/cam/ata/ata_xpt.c Wed Jun 20 13:59:25 2012 (r237305) @@ -96,6 +96,7 @@ typedef enum { PROBE_PM_PRV, PROBE_IDENTIFY_SES, PROBE_IDENTIFY_SAFTE, + PROBE_DONE, PROBE_INVALID } probe_action; @@ -115,6 +116,7 @@ static char *probe_action_text[] = { "PROBE_PM_PRV", "PROBE_IDENTIFY_SES", "PROBE_IDENTIFY_SAFTE", + "PROBE_DONE", "PROBE_INVALID" }; @@ -122,7 +124,7 @@ static char *probe_action_text[] = { do { \ char **text; \ text = probe_action_text; \ - CAM_DEBUG((softc)->periph->path, CAM_DEBUG_INFO, \ + CAM_DEBUG((softc)->periph->path, CAM_DEBUG_PROBE, \ ("Probe %s to %s\n", text[(softc)->action], \ text[(newaction)])); \ (softc)->action = (newaction); \ @@ -251,6 +253,8 @@ proberegister(struct cam_periph *periph, if (status != CAM_REQ_CMP) { return (status); } + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); + /* * Ensure nobody slip in until probe finish. */ @@ -653,11 +657,8 @@ negotiate: ata_28bit_cmd(ataio, ATA_SEP_ATTN, 0xEC, 0x00, sizeof(softc->ident_data) / 4); break; - case PROBE_INVALID: - CAM_DEBUG(path, CAM_DEBUG_INFO, - ("probestart: invalid action state\n")); default: - break; + panic("probestart: invalid action state 0x%x\n", softc->action); } xpt_action(start_ccb); } @@ -776,6 +777,7 @@ probedone(struct cam_periph *periph, uni */ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) xpt_async(AC_LOST_DEVICE, path, NULL); + PROBE_SET_ACTION(softc, PROBE_INVALID); found = 0; goto done; } @@ -787,8 +789,8 @@ noerror: { int sign = (done_ccb->ataio.res.lba_high << 8) + done_ccb->ataio.res.lba_mid; - if (bootverbose) - xpt_print(path, "SIGNATURE: %04x\n", sign); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("SIGNATURE: %04x\n", sign)); if (sign == 0x0000 && done_ccb->ccb_h.target_id != 15) { path->device->protocol = PROTO_ATA; @@ -1053,6 +1055,7 @@ notsata: xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; case PROBE_INQUIRY: case PROBE_FULL_INQUIRY: @@ -1094,6 +1097,7 @@ notsata: xpt_action(done_ccb); xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; } case PROBE_PM_PID: @@ -1165,6 +1169,7 @@ notsata: xpt_action(done_ccb); xpt_async(AC_SCSI_AEN, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; case PROBE_IDENTIFY_SES: case PROBE_IDENTIFY_SAFTE: @@ -1210,12 +1215,10 @@ notsata: xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; - case PROBE_INVALID: - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probedone: invalid action state\n")); default: - break; + panic("probedone: invalid action state 0x%x\n", softc->action); } done: if (softc->restart) { @@ -1225,6 +1228,7 @@ done: return; } xpt_release_ccb(done_ccb); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); while ((done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs))) { TAILQ_REMOVE(&softc->request_ccbs, &done_ccb->ccb_h, periph_links.tqe); Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Wed Jun 20 13:42:40 2012 (r237304) +++ stable/9/sys/cam/scsi/scsi_cd.c Wed Jun 20 13:59:25 2012 (r237305) @@ -1013,6 +1013,9 @@ cdopen(struct disk *dp) return (error); } + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("cdopen\n")); + /* * Check for media, and set the appropriate flags. We don't bail * if we don't have media, but then we don't allow anything but the @@ -1050,6 +1053,9 @@ cdclose(struct disk *dp) cam_periph_lock(periph); cam_periph_hold(periph, PRIBIO); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("cdclose\n")); + if ((softc->flags & CD_FLAG_DISC_REMOVABLE) != 0) cdprevent(periph, PR_ALLOW); @@ -1394,7 +1400,8 @@ cdstrategy(struct bio *bp) } cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdstrategy\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("cdstrategy(%p)\n", bp)); softc = (struct cd_softc *)periph->softc; @@ -1860,12 +1867,11 @@ cdioctl(struct disk *dp, u_long cmd, voi return(ENXIO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdioctl\n")); softc = (struct cd_softc *)periph->softc; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("trying to do ioctl %#lx\n", cmd)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("cdioctl(%#lx)\n", cmd)); if ((error = cam_periph_hold(periph, PRIBIO | PCATCH)) != 0) { cam_periph_unlock(periph); Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Wed Jun 20 13:42:40 2012 (r237304) +++ stable/9/sys/cam/scsi/scsi_da.c Wed Jun 20 13:59:25 2012 (r237305) @@ -938,9 +938,8 @@ daopen(struct disk *dp) softc = (struct da_softc *)periph->softc; softc->flags |= DA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("daopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit, - unit)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("daopen\n")); if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { /* Invalidate our pack information. */ @@ -1000,6 +999,9 @@ daclose(struct disk *dp) softc = (struct da_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("daclose\n")); + if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0 && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { union ccb *ccb; @@ -1109,7 +1111,9 @@ dastrategy(struct bio *bp) biofinish(bp, NULL, ENXIO); return; } - + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastrategy(%p)\n", bp)); + /* * Place it in the queue of disk activities for this disk */ @@ -1725,6 +1729,8 @@ dastart(struct cam_periph *periph, union softc = (struct da_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastart\n")); + switch (softc->state) { case DA_STATE_NORMAL: { @@ -1733,7 +1739,7 @@ dastart(struct cam_periph *periph, union /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = DA_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -2064,6 +2070,9 @@ dadone(struct cam_periph *periph, union softc = (struct da_softc *)periph->softc; priority = done_ccb->ccb_h.pinfo.priority; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone\n")); + csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { case DA_CCB_BUFFER_IO: Modified: stable/9/sys/cam/scsi/scsi_pt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pt.c Wed Jun 20 13:42:40 2012 (r237304) +++ stable/9/sys/cam/scsi/scsi_pt.c Wed Jun 20 13:59:25 2012 (r237305) @@ -425,12 +425,14 @@ ptstart(struct cam_periph *periph, union softc = (struct pt_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ptstart\n")); + /* * See if there is a buf with work for us to do.. */ bp = bioq_first(&softc->bio_queue); if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = PT_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -483,6 +485,9 @@ ptdone(struct cam_periph *periph, union struct ccb_scsiio *csio; softc = (struct pt_softc *)periph->softc; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ptdone\n")); + csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state) { case PT_CCB_BUFFER_IO: Modified: stable/9/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_xpt.c Wed Jun 20 13:42:40 2012 (r237304) +++ stable/9/sys/cam/scsi/scsi_xpt.c Wed Jun 20 13:59:25 2012 (r237305) @@ -141,6 +141,7 @@ typedef enum { PROBE_INQUIRY_BASIC_DV1, PROBE_INQUIRY_BASIC_DV2, PROBE_DV_EXIT, + PROBE_DONE, PROBE_INVALID } probe_action; @@ -157,6 +158,7 @@ static char *probe_action_text[] = { "PROBE_INQUIRY_BASIC_DV1", "PROBE_INQUIRY_BASIC_DV2", "PROBE_DV_EXIT", + "PROBE_DONE", "PROBE_INVALID" }; @@ -164,7 +166,7 @@ static char *probe_action_text[] = { do { \ char **text; \ text = probe_action_text; \ - CAM_DEBUG((softc)->periph->path, CAM_DEBUG_INFO, \ + CAM_DEBUG((softc)->periph->path, CAM_DEBUG_PROBE, \ ("Probe %s to %s\n", text[(softc)->action], \ text[(newaction)])); \ (softc)->action = (newaction); \ @@ -642,7 +644,7 @@ proberegister(struct cam_periph *periph, if (status != CAM_REQ_CMP) { return (status); } - + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); /* * Ensure we've waited at least a bus settle @@ -981,11 +983,8 @@ again: probedone(periph, start_ccb); return; } - case PROBE_INVALID: - CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probestart: invalid action state\n")); default: - break; + panic("probestart: invalid action state 0x%x\n", softc->action); } xpt_action(start_ccb); } @@ -1065,7 +1064,7 @@ proberequestbackoff(struct cam_periph *p } if (device->flags & CAM_DEV_DV_HIT_BOTTOM) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("hit async: giving up on DV\n")); return (0); } @@ -1085,7 +1084,7 @@ proberequestbackoff(struct cam_periph *p if (spi->sync_period >= 0xf) { spi->sync_period = 0; spi->sync_offset = 0; - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("setting to async for DV\n")); /* * Once we hit async, we don't want to try @@ -1093,7 +1092,7 @@ proberequestbackoff(struct cam_periph *p */ device->flags |= CAM_DEV_DV_HIT_BOTTOM; } else if (bootverbose) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("DV: period 0x%x\n", spi->sync_period)); printf("setting period to 0x%x\n", spi->sync_period); } @@ -1103,7 +1102,7 @@ proberequestbackoff(struct cam_periph *p if ((cts.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { break; } - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("DV: failed to set period 0x%x\n", spi->sync_period)); if (spi->sync_period == 0) { return (0); @@ -1250,6 +1249,7 @@ probedone(struct cam_periph *periph, uni if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) /* Send the async notification. */ xpt_async(AC_LOST_DEVICE, path, NULL); + PROBE_SET_ACTION(softc, PROBE_INVALID); xpt_release_ccb(done_ccb); break; @@ -1283,8 +1283,9 @@ probedone(struct cam_periph *periph, uni /* * Reallocate and retry to cover all luns */ - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, - ("reallocating REPORT_LUNS for %u luns\n", nlun)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("Probe: reallocating REPORT_LUNS for %u luns\n", + nlun)); free(lp, M_CAMXPT); path->target->rpl_size = (nlun << 3) + 8; xpt_release_ccb(done_ccb); @@ -1307,8 +1308,8 @@ probedone(struct cam_periph *periph, uni lun_id_t lun; int idx; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, - ("%u luns reported\n", nlun)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("Probe: %u lun(s) reported\n", nlun)); CAM_GET_SIMPLE_LUN(lp, 0, lun); /* @@ -1330,8 +1331,8 @@ probedone(struct cam_periph *periph, uni lp->luns[idx].lundata, 8); memcpy(lp->luns[idx].lundata, tlun, 8); - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - path, ("lun 0 in position %u\n", idx)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("lun 0 in position %u\n", idx)); } else { /* * There is no lun 0 in our list. Destroy @@ -1616,7 +1617,7 @@ probe_device_check: && done_ccb->ccb_h.target_lun == 0 && (path->device->inq_data.flags & SID_Sync) != 0 && (path->device->flags & CAM_DEV_IN_DV) == 0) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Begin Domain Validation\n")); path->device->flags |= CAM_DEV_IN_DV; xpt_release_ccb(done_ccb); @@ -1625,7 +1626,7 @@ probe_device_check: return; } if (softc->action == PROBE_DV_EXIT) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Leave Domain Validation\n")); } if (path->device->flags & CAM_DEV_UNCONFIGURED) { @@ -1641,6 +1642,7 @@ probe_device_check: xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); xpt_release_ccb(done_ccb); break; case PROBE_INQUIRY_BASIC_DV1: @@ -1680,7 +1682,7 @@ probe_device_check: return; } if (softc->action == PROBE_INQUIRY_BASIC_DV2) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Leave Domain Validation Successfully\n")); } if (path->device->flags & CAM_DEV_UNCONFIGURED) { @@ -1696,20 +1698,19 @@ probe_device_check: xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); xpt_release_ccb(done_ccb); break; } - case PROBE_INVALID: - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probedone: invalid action state\n")); default: - break; + panic("probedone: invalid action state 0x%x\n", softc->action); } done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); TAILQ_REMOVE(&softc->request_ccbs, &done_ccb->ccb_h, periph_links.tqe); done_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(done_ccb); if (TAILQ_FIRST(&softc->request_ccbs) == NULL) { + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); cam_periph_invalidate(periph); cam_release_devq(periph->path, RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); @@ -1922,7 +1923,7 @@ scsi_scan_bus(struct cam_periph *periph, xpt_done(request_ccb); return; } - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("SCAN start for %p\n", scan_info)); scan_info->request_ccb = request_ccb; scan_info->cpi = &work_ccb->cpi; @@ -2035,8 +2036,8 @@ scsi_scan_bus(struct cam_periph *periph, CAM_GET_SIMPLE_LUN(target->luns, scan_info->lunindex[target_id], lun_id); next_target = 0; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, + CAM_DEBUG_PROBE, ("next lun to try at index %u is %u\n", scan_info->lunindex[target_id], lun_id)); scan_info->lunindex[target_id]++; @@ -2143,8 +2144,8 @@ scsi_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, + CAM_DEBUG_TRACE, ("SCAN done for %p\n", scan_info)); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = CAM_REQ_CMP; From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:11:19 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A1851065675; Wed, 20 Jun 2012 14:11:19 +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 129D38FC08; Wed, 20 Jun 2012 14:11: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 q5KEBJuk046552; Wed, 20 Jun 2012 14:11:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEBI7f046544; Wed, 20 Jun 2012 14:11:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201411.q5KEBI7f046544@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:11:18 +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: r237306 - in stable/8/sys/cam: ata scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:11:19 -0000 Author: mav Date: Wed Jun 20 14:11:18 2012 New Revision: 237306 URL: http://svn.freebsd.org/changeset/base/237306 Log: MFC r236602, r236613: Tune and add some missing CAM_DEBUG() points for better consistency. Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/ata/ata_pmp.c stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/scsi/scsi_cd.c stable/8/sys/cam/scsi/scsi_da.c stable/8/sys/cam/scsi/scsi_pt.c stable/8/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/ata/ata_da.c Wed Jun 20 14:11:18 2012 (r237306) @@ -426,9 +426,8 @@ adaopen(struct disk *dp) softc = (struct ada_softc *)periph->softc; softc->flags |= ADA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("adaopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit, - periph->unit_number)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("adaopen\n")); if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) { /* Invalidate our pack information. */ @@ -459,6 +458,10 @@ adaclose(struct disk *dp) } softc = (struct ada_softc *)periph->softc; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("adaclose\n")); + /* We only sync the cache if the drive is capable of it. */ if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { @@ -532,6 +535,8 @@ adastrategy(struct bio *bp) cam_periph_lock(periph); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adastrategy(%p)\n", bp)); + /* * If the device has been made invalid, error out */ @@ -1113,6 +1118,8 @@ adastart(struct cam_periph *periph, unio struct ada_softc *softc = (struct ada_softc *)periph->softc; struct ccb_ataio *ataio = &start_ccb->ataio; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adastart\n")); + switch (softc->state) { case ADA_STATE_NORMAL: { @@ -1121,7 +1128,7 @@ adastart(struct cam_periph *periph, unio /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = ADA_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -1413,6 +1420,9 @@ adadone(struct cam_periph *periph, union softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adadone\n")); + switch (ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) { case ADA_CCB_BUFFER_IO: case ADA_CCB_TRIM: Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/ata/ata_pmp.c Wed Jun 20 14:11:18 2012 (r237306) @@ -429,7 +429,9 @@ pmpstart(struct cam_periph *periph, unio softc = (struct pmp_softc *)periph->softc; ataio = &start_ccb->ataio; - + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("pmpstart\n")); + if (softc->restart) { softc->restart = 0; softc->state = min(softc->state, PMP_STATE_PRECONFIG); @@ -560,7 +562,7 @@ pmpdone(struct cam_periph *periph, union softc = (struct pmp_softc *)periph->softc; ataio = &done_ccb->ataio; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("pmpdone\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("pmpdone\n")); priority = done_ccb->ccb_h.pinfo.priority; Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/ata/ata_xpt.c Wed Jun 20 14:11:18 2012 (r237306) @@ -94,6 +94,7 @@ typedef enum { PROBE_FULL_INQUIRY, PROBE_PM_PID, PROBE_PM_PRV, + PROBE_DONE, PROBE_INVALID } probe_action; @@ -111,6 +112,7 @@ static char *probe_action_text[] = { "PROBE_FULL_INQUIRY", "PROBE_PM_PID", "PROBE_PM_PRV", + "PROBE_DONE", "PROBE_INVALID" }; @@ -118,7 +120,7 @@ static char *probe_action_text[] = { do { \ char **text; \ text = probe_action_text; \ - CAM_DEBUG((softc)->periph->path, CAM_DEBUG_INFO, \ + CAM_DEBUG((softc)->periph->path, CAM_DEBUG_PROBE, \ ("Probe %s to %s\n", text[(softc)->action], \ text[(newaction)])); \ (softc)->action = (newaction); \ @@ -247,6 +249,8 @@ proberegister(struct cam_periph *periph, if (status != CAM_REQ_CMP) { return (status); } + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); + /* * Ensure nobody slip in until probe finish. */ @@ -623,11 +627,8 @@ negotiate: 10 * 1000); ata_pm_read_cmd(ataio, 1, 15); break; - case PROBE_INVALID: - CAM_DEBUG(path, CAM_DEBUG_INFO, - ("probestart: invalid action state\n")); default: - break; + panic("probestart: invalid action state 0x%x\n", softc->action); } xpt_action(start_ccb); } @@ -729,6 +730,7 @@ probedone(struct cam_periph *periph, uni */ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) xpt_async(AC_LOST_DEVICE, path, NULL); + PROBE_SET_ACTION(softc, PROBE_INVALID); found = 0; goto done; } @@ -740,8 +742,8 @@ noerror: { int sign = (done_ccb->ataio.res.lba_high << 8) + done_ccb->ataio.res.lba_mid; - if (bootverbose) - xpt_print(path, "SIGNATURE: %04x\n", sign); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("SIGNATURE: %04x\n", sign)); if (sign == 0x0000 && done_ccb->ccb_h.target_id != 15) { path->device->protocol = PROTO_ATA; @@ -986,6 +988,7 @@ notsata: xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; case PROBE_INQUIRY: case PROBE_FULL_INQUIRY: @@ -1029,6 +1032,7 @@ notsata: xpt_action(done_ccb); xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; } case PROBE_PM_PID: @@ -1100,12 +1104,10 @@ notsata: xpt_action(done_ccb); xpt_async(AC_SCSI_AEN, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; - case PROBE_INVALID: - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probedone: invalid action state\n")); default: - break; + panic("probedone: invalid action state 0x%x\n", softc->action); } done: if (softc->restart) { @@ -1115,6 +1117,7 @@ done: return; } xpt_release_ccb(done_ccb); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); while ((done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs))) { TAILQ_REMOVE(&softc->request_ccbs, &done_ccb->ccb_h, periph_links.tqe); Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/scsi/scsi_cd.c Wed Jun 20 14:11:18 2012 (r237306) @@ -1006,6 +1006,9 @@ cdopen(struct disk *dp) return (error); } + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("cdopen\n")); + /* * Check for media, and set the appropriate flags. We don't bail * if we don't have media, but then we don't allow anything but the @@ -1043,6 +1046,9 @@ cdclose(struct disk *dp) cam_periph_lock(periph); cam_periph_hold(periph, PRIBIO); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("cdclose\n")); + if ((softc->flags & CD_FLAG_DISC_REMOVABLE) != 0) cdprevent(periph, PR_ALLOW); @@ -1387,7 +1393,8 @@ cdstrategy(struct bio *bp) } cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdstrategy\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("cdstrategy(%p)\n", bp)); softc = (struct cd_softc *)periph->softc; @@ -1852,12 +1859,11 @@ cdioctl(struct disk *dp, u_long cmd, voi return(ENXIO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdioctl\n")); softc = (struct cd_softc *)periph->softc; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("trying to do ioctl %#lx\n", cmd)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("cdioctl(%#lx)\n", cmd)); if ((error = cam_periph_hold(periph, PRIBIO | PCATCH)) != 0) { cam_periph_unlock(periph); Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/scsi/scsi_da.c Wed Jun 20 14:11:18 2012 (r237306) @@ -914,9 +914,8 @@ daopen(struct disk *dp) softc = (struct da_softc *)periph->softc; softc->flags |= DA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("daopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit, - unit)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("daopen\n")); if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { /* Invalidate our pack information. */ @@ -972,6 +971,9 @@ daclose(struct disk *dp) softc = (struct da_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("daclose\n")); + if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0 && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { union ccb *ccb; @@ -1061,7 +1063,9 @@ dastrategy(struct bio *bp) biofinish(bp, NULL, ENXIO); return; } - + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastrategy(%p)\n", bp)); + /* * Place it in the queue of disk activities for this disk */ @@ -1576,6 +1580,8 @@ dastart(struct cam_periph *periph, union softc = (struct da_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastart\n")); + switch (softc->state) { case DA_STATE_NORMAL: { @@ -1587,7 +1593,7 @@ dastart(struct cam_periph *periph, union */ bp = bioq_first(&softc->bio_queue); if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = DA_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -1784,6 +1790,9 @@ dadone(struct cam_periph *periph, union softc = (struct da_softc *)periph->softc; priority = done_ccb->ccb_h.pinfo.priority; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone\n")); + csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { case DA_CCB_BUFFER_IO: Modified: stable/8/sys/cam/scsi/scsi_pt.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_pt.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/scsi/scsi_pt.c Wed Jun 20 14:11:18 2012 (r237306) @@ -425,12 +425,14 @@ ptstart(struct cam_periph *periph, union softc = (struct pt_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ptstart\n")); + /* * See if there is a buf with work for us to do.. */ bp = bioq_first(&softc->bio_queue); if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = PT_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -483,6 +485,9 @@ ptdone(struct cam_periph *periph, union struct ccb_scsiio *csio; softc = (struct pt_softc *)periph->softc; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ptdone\n")); + csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state) { case PT_CCB_BUFFER_IO: Modified: stable/8/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_xpt.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/scsi/scsi_xpt.c Wed Jun 20 14:11:18 2012 (r237306) @@ -140,6 +140,7 @@ typedef enum { PROBE_INQUIRY_BASIC_DV1, PROBE_INQUIRY_BASIC_DV2, PROBE_DV_EXIT, + PROBE_DONE, PROBE_INVALID } probe_action; @@ -155,6 +156,7 @@ static char *probe_action_text[] = { "PROBE_INQUIRY_BASIC_DV1", "PROBE_INQUIRY_BASIC_DV2", "PROBE_DV_EXIT", + "PROBE_DONE", "PROBE_INVALID" }; @@ -162,7 +164,7 @@ static char *probe_action_text[] = { do { \ char **text; \ text = probe_action_text; \ - CAM_DEBUG((softc)->periph->path, CAM_DEBUG_INFO, \ + CAM_DEBUG((softc)->periph->path, CAM_DEBUG_PROBE, \ ("Probe %s to %s\n", text[(softc)->action], \ text[(newaction)])); \ (softc)->action = (newaction); \ @@ -639,7 +641,7 @@ proberegister(struct cam_periph *periph, if (status != CAM_REQ_CMP) { return (status); } - + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); /* * Ensure we've waited at least a bus settle @@ -927,11 +929,8 @@ again: probedone(periph, start_ccb); return; } - case PROBE_INVALID: - CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probestart: invalid action state\n")); default: - break; + panic("probestart: invalid action state 0x%x\n", softc->action); } xpt_action(start_ccb); } @@ -1011,7 +1010,7 @@ proberequestbackoff(struct cam_periph *p } if (device->flags & CAM_DEV_DV_HIT_BOTTOM) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("hit async: giving up on DV\n")); return (0); } @@ -1031,7 +1030,7 @@ proberequestbackoff(struct cam_periph *p if (spi->sync_period >= 0xf) { spi->sync_period = 0; spi->sync_offset = 0; - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("setting to async for DV\n")); /* * Once we hit async, we don't want to try @@ -1039,7 +1038,7 @@ proberequestbackoff(struct cam_periph *p */ device->flags |= CAM_DEV_DV_HIT_BOTTOM; } else if (bootverbose) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("DV: period 0x%x\n", spi->sync_period)); printf("setting period to 0x%x\n", spi->sync_period); } @@ -1049,7 +1048,7 @@ proberequestbackoff(struct cam_periph *p if ((cts.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { break; } - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("DV: failed to set period 0x%x\n", spi->sync_period)); if (spi->sync_period == 0) { return (0); @@ -1194,6 +1193,7 @@ probedone(struct cam_periph *periph, uni if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) /* Send the async notification. */ xpt_async(AC_LOST_DEVICE, path, NULL); + PROBE_SET_ACTION(softc, PROBE_INVALID); xpt_release_ccb(done_ccb); break; @@ -1227,8 +1227,9 @@ probedone(struct cam_periph *periph, uni /* * Reallocate and retry to cover all luns */ - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, - ("reallocating REPORT_LUNS for %u luns\n", nlun)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("Probe: reallocating REPORT_LUNS for %u luns\n", + nlun)); free(lp, M_CAMXPT); path->target->rpl_size = (nlun << 3) + 8; xpt_release_ccb(done_ccb); @@ -1251,8 +1252,8 @@ probedone(struct cam_periph *periph, uni lun_id_t lun; int idx; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, - ("%u luns reported\n", nlun)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("Probe: %u lun(s) reported\n", nlun)); CAM_GET_SIMPLE_LUN(lp, 0, lun); /* @@ -1274,8 +1275,8 @@ probedone(struct cam_periph *periph, uni lp->luns[idx].lundata, 8); memcpy(lp->luns[idx].lundata, tlun, 8); - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - path, ("lun 0 in position %u\n", idx)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("lun 0 in position %u\n", idx)); } else { /* * There is no lun 0 in our list. Destroy @@ -1523,7 +1524,7 @@ probedone(struct cam_periph *periph, uni && done_ccb->ccb_h.target_lun == 0 && (path->device->inq_data.flags & SID_Sync) != 0 && (path->device->flags & CAM_DEV_IN_DV) == 0) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Begin Domain Validation\n")); path->device->flags |= CAM_DEV_IN_DV; xpt_release_ccb(done_ccb); @@ -1532,7 +1533,7 @@ probedone(struct cam_periph *periph, uni return; } if (softc->action == PROBE_DV_EXIT) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Leave Domain Validation\n")); } if (path->device->flags & CAM_DEV_UNCONFIGURED) { @@ -1548,6 +1549,7 @@ probedone(struct cam_periph *periph, uni xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); xpt_release_ccb(done_ccb); break; case PROBE_INQUIRY_BASIC_DV1: @@ -1587,7 +1589,7 @@ probedone(struct cam_periph *periph, uni return; } if (softc->action == PROBE_INQUIRY_BASIC_DV2) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Leave Domain Validation Successfully\n")); } if (path->device->flags & CAM_DEV_UNCONFIGURED) { @@ -1603,20 +1605,19 @@ probedone(struct cam_periph *periph, uni xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); xpt_release_ccb(done_ccb); break; } - case PROBE_INVALID: - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probedone: invalid action state\n")); default: - break; + panic("probedone: invalid action state 0x%x\n", softc->action); } done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); TAILQ_REMOVE(&softc->request_ccbs, &done_ccb->ccb_h, periph_links.tqe); done_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(done_ccb); if (TAILQ_FIRST(&softc->request_ccbs) == NULL) { + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); cam_periph_invalidate(periph); cam_release_devq(periph->path, RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); @@ -1829,7 +1830,7 @@ scsi_scan_bus(struct cam_periph *periph, xpt_done(request_ccb); return; } - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("SCAN start for %p\n", scan_info)); scan_info->request_ccb = request_ccb; scan_info->cpi = &work_ccb->cpi; @@ -1942,8 +1943,8 @@ scsi_scan_bus(struct cam_periph *periph, CAM_GET_SIMPLE_LUN(target->luns, scan_info->lunindex[target_id], lun_id); next_target = 0; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, + CAM_DEBUG_PROBE, ("next lun to try at index %u is %u\n", scan_info->lunindex[target_id], lun_id)); scan_info->lunindex[target_id]++; @@ -2050,8 +2051,8 @@ scsi_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, + CAM_DEBUG_TRACE, ("SCAN done for %p\n", scan_info)); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = CAM_REQ_CMP; From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:13:08 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 853E2106566C; Wed, 20 Jun 2012 14:13:08 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F65D8FC12; Wed, 20 Jun 2012 14:13:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KED8vQ046682; Wed, 20 Jun 2012 14:13:08 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KED8hj046680; Wed, 20 Jun 2012 14:13:08 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201206201413.q5KED8hj046680@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 20 Jun 2012 14:13:08 +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: r237307 - stable/9/sys/netinet/ipfw X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:13:08 -0000 Author: melifaro Date: Wed Jun 20 14:13:07 2012 New Revision: 237307 URL: http://svn.freebsd.org/changeset/base/237307 Log: MFC r236819 Validate IPv4 network mask being passed to ipfw kernel interface. Incorrect mask can possibly be one of the reasons for kern/127209 existance. Approved by: ae(mentor) Modified: stable/9/sys/netinet/ipfw/ip_fw_table.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_table.c Wed Jun 20 14:11:18 2012 (r237306) +++ stable/9/sys/netinet/ipfw/ip_fw_table.c Wed Jun 20 14:13:07 2012 (r237307) @@ -153,6 +153,9 @@ ipfw_add_table_entry(struct ip_fw_chain case IPFW_TABLE_CIDR: if (plen == sizeof(in_addr_t)) { #ifdef INET + /* IPv4 case */ + if (mlen > 32) + return (EINVAL); ent = malloc(sizeof(*ent), M_IPFW_TBL, M_WAITOK | M_ZERO); ent->value = value; /* Set 'total' structure length */ From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:14:28 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 605FE1065673; Wed, 20 Jun 2012 14:14: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 30F2A8FC15; Wed, 20 Jun 2012 14:14: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 q5KEESB9046782; Wed, 20 Jun 2012 14:14:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEERc4046777; Wed, 20 Jun 2012 14:14:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201414.q5KEERc4046777@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:14: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: r237308 - stable/9/sbin/camcontrol X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:14:28 -0000 Author: mav Date: Wed Jun 20 14:14:27 2012 New Revision: 237308 URL: http://svn.freebsd.org/changeset/base/237308 Log: MFC r236555: Add -p argument for `camcontrol debug` to allow enabling CAM_DEBUG_PROBE added at r208911. Modified: stable/9/sbin/camcontrol/camcontrol.8 stable/9/sbin/camcontrol/camcontrol.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.8 Wed Jun 20 14:13:07 2012 (r237307) +++ stable/9/sbin/camcontrol/camcontrol.8 Wed Jun 20 14:14:27 2012 (r237308) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2010 +.Dd June 4, 2012 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -175,6 +175,7 @@ .Op Fl S .Op Fl X .Op Fl c +.Op Fl p .Aq all|off|bus Ns Op :target Ns Op :lun .Nm .Ic tags @@ -789,6 +790,8 @@ Enable CAM_DEBUG_XPT printfs. Enable CAM_DEBUG_CDB printfs. This will cause the kernel to print out the SCSI CDBs sent to the specified device(s). +.It Fl p +Enable CAM_DEBUG_PROBE printfs. .It all Enable debugging for all devices. .It off Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Wed Jun 20 14:13:07 2012 (r237307) +++ stable/9/sbin/camcontrol/camcontrol.c Wed Jun 20 14:14:27 2012 (r237308) @@ -122,6 +122,7 @@ typedef enum { CAM_ARG_DEBUG_CDB = 0x08000000, CAM_ARG_DEBUG_XPT = 0x10000000, CAM_ARG_DEBUG_PERIPH = 0x20000000, + CAM_ARG_DEBUG_PROBE = 0x40000000, } cam_argmask; struct camcontrol_opts { @@ -175,7 +176,7 @@ struct camcontrol_opts option_table[] = {"tags", CAM_CMD_TAG, CAM_ARG_NONE, "N:q"}, {"negotiate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, {"rate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, - {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXc"}, + {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXcp"}, {"format", CAM_CMD_FORMAT, CAM_ARG_NONE, "qrwy"}, {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, @@ -2640,6 +2641,10 @@ camdebug(int argc, char **argv, char *co arglist |= CAM_ARG_DEBUG_CDB; ccb.cdbg.flags |= CAM_DEBUG_CDB; break; + case 'p': + arglist |= CAM_ARG_DEBUG_PROBE; + ccb.cdbg.flags |= CAM_DEBUG_PROBE; + break; default: break; } @@ -2669,7 +2674,7 @@ camdebug(int argc, char **argv, char *co ccb.cdbg.flags = CAM_DEBUG_NONE; arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH| CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE| - CAM_ARG_DEBUG_XPT); + CAM_ARG_DEBUG_XPT|CAM_ARG_DEBUG_PROBE); } else if (strncmp(tstr, "all", 3) != 0) { tmpstr = (char *)strtok(tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')){ From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:15:14 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC8C81065674; Wed, 20 Jun 2012 14:15:14 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6FA78FC1C; Wed, 20 Jun 2012 14: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 q5KEFEo5046874; Wed, 20 Jun 2012 14:15:14 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEFEan046872; Wed, 20 Jun 2012 14:15:14 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201206201415.q5KEFEan046872@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 20 Jun 2012 14:15: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: r237309 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:15:14 -0000 Author: melifaro Date: Wed Jun 20 14:15:14 2012 New Revision: 237309 URL: http://svn.freebsd.org/changeset/base/237309 Log: MFC r236819 Validate IPv4 network mask being passed to ipfw kernel interface. Incorrect mask can possibly be one of the reasons for kern/127209 existance. Approved by: ae(mentor) Modified: stable/8/sys/netinet/ipfw/ip_fw_table.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_table.c Wed Jun 20 14:14:27 2012 (r237308) +++ stable/8/sys/netinet/ipfw/ip_fw_table.c Wed Jun 20 14:15:14 2012 (r237309) @@ -153,6 +153,9 @@ ipfw_add_table_entry(struct ip_fw_chain case IPFW_TABLE_CIDR: if (plen == sizeof(in_addr_t)) { #ifdef INET + /* IPv4 case */ + if (mlen > 32) + return (EINVAL); ent = malloc(sizeof(*ent), M_IPFW_TBL, M_WAITOK | M_ZERO); ent->value = value; /* Set 'total' structure length */ From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:15:40 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3167A1065680; Wed, 20 Jun 2012 14:15:40 +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 0336F8FC14; Wed, 20 Jun 2012 14:15: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 q5KEFde9046931; Wed, 20 Jun 2012 14:15:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEFdSl046928; Wed, 20 Jun 2012 14:15:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201415.q5KEFdSl046928@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:15:39 +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: r237310 - stable/8/sbin/camcontrol X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:15:40 -0000 Author: mav Date: Wed Jun 20 14:15:39 2012 New Revision: 237310 URL: http://svn.freebsd.org/changeset/base/237310 Log: MFC r236555: Add -p argument for `camcontrol debug` to allow enabling CAM_DEBUG_PROBE added at r208911. Modified: stable/8/sbin/camcontrol/camcontrol.8 stable/8/sbin/camcontrol/camcontrol.c Directory Properties: stable/8/sbin/camcontrol/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.8 Wed Jun 20 14:15:14 2012 (r237309) +++ stable/8/sbin/camcontrol/camcontrol.8 Wed Jun 20 14:15:39 2012 (r237310) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2010 +.Dd June 4, 2012 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -138,6 +138,7 @@ .Op Fl S .Op Fl X .Op Fl c +.Op Fl p .Aq all|off|bus Ns Op :target Ns Op :lun .Nm .Ic tags @@ -581,6 +582,8 @@ Enable CAM_DEBUG_XPT printfs. Enable CAM_DEBUG_CDB printfs. This will cause the kernel to print out the SCSI CDBs sent to the specified device(s). +.It Fl p +Enable CAM_DEBUG_PROBE printfs. .It all Enable debugging for all devices. .It off Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Wed Jun 20 14:15:14 2012 (r237309) +++ stable/8/sbin/camcontrol/camcontrol.c Wed Jun 20 14:15:39 2012 (r237310) @@ -113,6 +113,7 @@ typedef enum { CAM_ARG_DEBUG_CDB = 0x08000000, CAM_ARG_DEBUG_XPT = 0x10000000, CAM_ARG_DEBUG_PERIPH = 0x20000000, + CAM_ARG_DEBUG_PROBE = 0x40000000, } cam_argmask; struct camcontrol_opts { @@ -155,7 +156,7 @@ struct camcontrol_opts option_table[] = {"tags", CAM_CMD_TAG, CAM_ARG_NONE, "N:q"}, {"negotiate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, {"rate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, - {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXc"}, + {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXcp"}, {"format", CAM_CMD_FORMAT, CAM_ARG_NONE, "qrwy"}, {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, @@ -2568,6 +2569,10 @@ camdebug(int argc, char **argv, char *co arglist |= CAM_ARG_DEBUG_CDB; ccb.cdbg.flags |= CAM_DEBUG_CDB; break; + case 'p': + arglist |= CAM_ARG_DEBUG_PROBE; + ccb.cdbg.flags |= CAM_DEBUG_PROBE; + break; default: break; } @@ -2597,7 +2602,7 @@ camdebug(int argc, char **argv, char *co ccb.cdbg.flags = CAM_DEBUG_NONE; arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH| CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE| - CAM_ARG_DEBUG_XPT); + CAM_ARG_DEBUG_XPT|CAM_ARG_DEBUG_PROBE); } else if (strncmp(tstr, "all", 3) != 0) { tmpstr = (char *)strtok(tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')){ From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:19:56 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6383E106564A; Wed, 20 Jun 2012 14:19:56 +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 34DB28FC14; Wed, 20 Jun 2012 14:19: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 q5KEJuYW047164; Wed, 20 Jun 2012 14:19:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEJtA8047161; Wed, 20 Jun 2012 14:19:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201419.q5KEJtA8047161@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:19: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: r237311 - in stable/9/sys/cam: ata scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:19:56 -0000 Author: mav Date: Wed Jun 20 14:19:55 2012 New Revision: 237311 URL: http://svn.freebsd.org/changeset/base/237311 Log: MFC r236604, r236639: Do not reinvent a wheel and let default error handler do its job. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Wed Jun 20 14:15:39 2012 (r237310) +++ stable/9/sys/cam/ata/ata_da.c Wed Jun 20 14:19:55 2012 (r237311) @@ -490,7 +490,7 @@ adaclose(struct disk *dp) ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, 0, 0); else ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0); - cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0, + cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, /*sense_flags*/0, softc->disk->d_devstat); if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Wed Jun 20 14:15:39 2012 (r237310) +++ stable/9/sys/cam/scsi/scsi_da.c Wed Jun 20 14:19:55 2012 (r237311) @@ -1017,30 +1017,9 @@ daclose(struct disk *dp) SSD_FULL_SIZE, 5 * 60 * 1000); - cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0, - /*sense_flags*/SF_RETRY_UA, + cam_periph_runccb(ccb, daerror, /*cam_flags*/0, + /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if ((ccb->ccb_h.status & CAM_STATUS_MASK) == - CAM_SCSI_STATUS_ERROR) { - int asc, ascq; - int sense_key, error_code; - - scsi_extract_sense_len(&ccb->csio.sense_data, - ccb->csio.sense_len - ccb->csio.sense_resid, - &error_code, &sense_key, &asc, &ascq, - /*show_errors*/ 1); - if (sense_key != SSD_KEY_ILLEGAL_REQUEST) - scsi_sense_print(&ccb->csio); - } else { - xpt_print(periph->path, "Synchronize cache " - "failed, status == 0x%x, scsi status == " - "0x%x\n", ccb->csio.ccb_h.status, - ccb->csio.scsi_status); - } - } - xpt_release_ccb(ccb); } @@ -2498,8 +2477,8 @@ daprevent(struct cam_periph *periph, int SSD_FULL_SIZE, 5000); - error = cam_periph_runccb(ccb, /*error_routine*/NULL, CAM_RETRY_SELTO, - SF_RETRY_UA, softc->disk->d_devstat); + error = cam_periph_runccb(ccb, daerror, CAM_RETRY_SELTO, + SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); if (error == 0) { if (action == PR_ALLOW) From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:23:10 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8720106566C; Wed, 20 Jun 2012 14:23:10 +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 A316F8FC1A; Wed, 20 Jun 2012 14:23: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 q5KENAoJ047406; Wed, 20 Jun 2012 14:23:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KENAni047404; Wed, 20 Jun 2012 14:23:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201423.q5KENAni047404@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:23:10 +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: r237313 - stable/8/sys/cam/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:23:10 -0000 Author: mav Date: Wed Jun 20 14:23:10 2012 New Revision: 237313 URL: http://svn.freebsd.org/changeset/base/237313 Log: MFC r236639: Use default error handler when flushing disk caches. Modified: stable/8/sys/cam/ata/ata_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Wed Jun 20 14:22:38 2012 (r237312) +++ stable/8/sys/cam/ata/ata_da.c Wed Jun 20 14:23:10 2012 (r237313) @@ -480,7 +480,7 @@ adaclose(struct disk *dp) ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, 0, 0); else ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0); - cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0, + cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, /*sense_flags*/0, softc->disk->d_devstat); if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:27:56 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E1161065673; Wed, 20 Jun 2012 14:27:56 +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 E25F78FC17; Wed, 20 Jun 2012 14:27: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 q5KERtTc047772; Wed, 20 Jun 2012 14:27:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KERtYY047769; Wed, 20 Jun 2012 14:27:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201427.q5KERtYY047769@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:27: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: r237315 - stable/9/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:27:56 -0000 Author: mav Date: Wed Jun 20 14:27:55 2012 New Revision: 237315 URL: http://svn.freebsd.org/changeset/base/237315 Log: MFC r236689 (by ken): Fix a memory leak in the kernel case in scsi_command_string(). Submitted by: Kashyap Desai Modified: stable/9/sys/cam/scsi/scsi_all.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.c Wed Jun 20 14:24:13 2012 (r237314) +++ stable/9/sys/cam/scsi/scsi_all.c Wed Jun 20 14:27:55 2012 (r237315) @@ -3059,6 +3059,10 @@ scsi_command_string(struct cam_device *d sizeof(cdb_str))); } +#ifdef _KERNEL + xpt_free_ccb((union ccb *)cgd); +#endif + return(0); } From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:29:02 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CDF7106566B; Wed, 20 Jun 2012 14:29: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 575068FC16; Wed, 20 Jun 2012 14:29: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 q5KET23i047868; Wed, 20 Jun 2012 14:29:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KET25d047866; Wed, 20 Jun 2012 14:29:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201429.q5KET25d047866@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:29:02 +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: r237316 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:29:02 -0000 Author: mav Date: Wed Jun 20 14:29:01 2012 New Revision: 237316 URL: http://svn.freebsd.org/changeset/base/237316 Log: MFC r236689 (by ken): Fix a memory leak in the kernel case in scsi_command_string(). Submitted by: Kashyap Desai Modified: stable/8/sys/cam/scsi/scsi_all.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Wed Jun 20 14:27:55 2012 (r237315) +++ stable/8/sys/cam/scsi/scsi_all.c Wed Jun 20 14:29:01 2012 (r237316) @@ -3037,6 +3037,10 @@ scsi_command_string(struct cam_device *d sizeof(cdb_str))); } +#ifdef _KERNEL + xpt_free_ccb((union ccb *)cgd); +#endif + return(0); } From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:36:10 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 635AA106564A; Wed, 20 Jun 2012 14:36:10 +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 4B4278FC16; Wed, 20 Jun 2012 14:36: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 q5KEaA2X048234; Wed, 20 Jun 2012 14:36:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEa9Cj048224; Wed, 20 Jun 2012 14:36:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201436.q5KEa9Cj048224@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:36: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: r237317 - in stable/9: share/man/man4 sys/cam sys/cam/scsi sys/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:36:10 -0000 Author: mav Date: Wed Jun 20 14:36:09 2012 New Revision: 237317 URL: http://svn.freebsd.org/changeset/base/237317 Log: MFC r236712: To make CAM debugging easier, compile in some debug flags (CAM_DEBUG_INFO, CAM_DEBUG_CDB, CAM_DEBUG_PERIPH and CAM_DEBUG_PROBE) by default. List of these flags can be modified with CAM_DEBUG_COMPILE kernel option. CAMDEBUG kernel option still enables all possible debug, if not overriden. Additional 50KB of kernel size is a good price for the ability to debug problems without rebuilding the kernel. In case where size is important, debugging can be compiled out by setting CAM_DEBUG_COMPILE option to 0. Modified: stable/9/share/man/man4/scsi.4 stable/9/sys/cam/cam_debug.h stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/cam_xpt.h stable/9/sys/cam/scsi/scsi_sa.c stable/9/sys/cam/scsi/scsi_target.c stable/9/sys/conf/NOTES stable/9/sys/conf/options Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/share/man/man4/scsi.4 ============================================================================== --- stable/9/share/man/man4/scsi.4 Wed Jun 20 14:29:01 2012 (r237316) +++ stable/9/share/man/man4/scsi.4 Wed Jun 20 14:36:09 2012 (r237317) @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd March 4, 2010 +.Dd June 7, 2012 .Dt CAM 4 .Os .Sh NAME @@ -43,6 +43,7 @@ .Cd "options CAM_DEBUG_BUS=-1" .Cd "options CAM_DEBUG_TARGET=-1" .Cd "options CAM_DEBUG_LUN=-1" +.Cd "options CAM_DEBUG_COMPILE=CAM_DEBUG_INFO|CAM_DEBUG_CDB|CAM_DEBUG_PROBE" .Cd "options CAM_DEBUG_FLAGS=CAM_DEBUG_INFO|CAM_DEBUG_CDB" .Cd "options CAM_MAX_HIGHPOWER=4" .Cd "options SCSI_NO_SENSE_STRINGS" @@ -72,12 +73,11 @@ There are a number of generic kernel con subsystem: .Bl -tag -width SCSI_NO_SENSE_STRINGS .It Dv CAMDEBUG -This option enables the +This option compiles in all the .Nm debugging printf code. This will not actually cause any debugging information to be printed out when included by itself. -Enabling printouts requires additional configuration. See below for details. .It Dv "CAM_MAX_HIGHPOWER=4" This sets the maximum allowable number of concurrent "high power" commands. @@ -248,54 +248,53 @@ see other .Nm device entries. .Sh DIAGNOSTICS -When the kernel is compiled with options CAMDEBUG, an XPT_DEBUG CCB can be -used to enable various amounts of tracing information on any -specific device. -Devices not being traced will not produce trace information. -There are currently four debugging flags that may be turned on: +An XPT_DEBUG CCB can be used to enable various amounts of tracing information +on any specific bus/device from the list of options compiled into the kernel. +There are currently seven debugging flags that may be compiled in and used: .Bl -tag -width CAM_DEBUG_SUBTRACE .It Dv CAM_DEBUG_INFO -This debugging flag enables general informational printfs for the device +This flag enables general informational printfs for the device or devices in question. .It Dv CAM_DEBUG_TRACE -This debugging flag enables function-level command flow tracing. +This flag enables function-level command flow tracing. i.e.\& kernel printfs will happen at the entrance and exit of various functions. .It Dv CAM_DEBUG_SUBTRACE -This debugging flag enables debugging output internal to various functions. +This flag enables debugging output internal to various functions. .It Dv CAM_DEBUG_CDB -This debugging flag will cause the kernel to print out all +This flag will cause the kernel to print out all +.Tn ATA +and .Tn SCSI commands sent to a particular device or devices. +.It Dv CAM_DEBUG_XPT +This flag will enable command scheduler tracing. +.It Dv CAM_DEBUG_PERIPH +This flag will enable peripheral drivers messages. +.It Dv CAM_DEBUG_PROBE +This flag will enable devices probe process tracing. .El .Pp Some of these flags, most notably .Dv CAM_DEBUG_TRACE and -.Dv CAM_DEBUG_SUBTRACE -will produce kernel printfs in EXTREME numbers, -and because of that, they are not especially useful. -There are not many things logged at the -.Dv CAM_DEBUG_INFO -level, so it is not especially useful. -The most useful debugging flag is the -.Dv CAM_DEBUG_CDB -flag. +.Dv CAM_DEBUG_SUBTRACE , +will produce kernel printfs in EXTREME numbers. +.Pp Users can enable debugging from their kernel config file, by using the following kernel config options: -.Bl -tag -width CAM_DEBUG_TARGET +.Bl -tag -width CAM_DEBUG_COMPILE .It Dv CAMDEBUG -This enables +This builds into the kernel all possible .Nm debugging. -Without this option, users will not even be able -to turn on debugging from userland via -.Xr camcontrol 8 . -.It Dv CAM_DEBUG_FLAGS -This allows the user to set the various debugging flags described above -in a kernel config file. +.It Dv CAM_DEBUG_COMPILE +This allows to specify support for which debugging flags described above +should be built into the kernel. Flags may be ORed together if the user wishes to see printfs for multiple debugging levels. +.It Dv CAM_DEBUG_FLAGS +This allows to set the various debugging flags from a kernel config file. .It Dv CAM_DEBUG_BUS Specify a bus to debug. To debug all busses, set this to -1. @@ -307,17 +306,9 @@ Specify a lun to debug. To debug all luns, set this to -1. .El .Pp -When specifying a bus, target or lun to debug, you -.Em MUST -specify all three bus/target/lun options above. -Using wildcards, you -should be able to enable debugging on most anything. -.Pp -Users may also enable debugging printfs on the fly, if the -.Dv CAMDEBUG -option is their config file, by using the +Users may also enable debugging on the fly by using the .Xr camcontrol 8 -utility. +utility, if wanted options built into the kernel. See .Xr camcontrol 8 for details. Modified: stable/9/sys/cam/cam_debug.h ============================================================================== --- stable/9/sys/cam/cam_debug.h Wed Jun 20 14:29:01 2012 (r237316) +++ stable/9/sys/cam/cam_debug.h Wed Jun 20 14:36:09 2012 (r237317) @@ -44,7 +44,35 @@ typedef enum { CAM_DEBUG_PROBE = 0x40 /* print out probe actions */ } cam_debug_flags; -#if defined(CAMDEBUG) && defined(_KERNEL) +#if defined(_KERNEL) + +#ifndef CAM_DEBUG_FLAGS +#define CAM_DEBUG_FLAGS CAM_DEBUG_NONE +#endif + +#ifndef CAM_DEBUG_COMPILE +#ifdef CAMDEBUG +#define CAM_DEBUG_COMPILE (-1) +#else +#define CAM_DEBUG_COMPILE (CAM_DEBUG_INFO | CAM_DEBUG_CDB | \ + CAM_DEBUG_PERIPH | CAM_DEBUG_PROBE | \ + CAM_DEBUG_FLAGS) +#endif +#endif + +#ifndef CAM_DEBUG_BUS +#define CAM_DEBUG_BUS (-1) +#endif +#ifndef CAM_DEBUG_TARGET +#define CAM_DEBUG_TARGET (-1) +#endif +#ifndef CAM_DEBUG_LUN +#define CAM_DEBUG_LUN (-1) +#endif + +#ifndef CAM_DEBUG_DELAY +#define CAM_DEBUG_DELAY 0 +#endif /* Path we want to debug */ extern struct cam_path *cam_dpath; @@ -52,48 +80,48 @@ extern struct cam_path *cam_dpath; extern u_int32_t cam_dflags; /* Printf delay value (to prevent scrolling) */ extern u_int32_t cam_debug_delay; - + /* Debugging macros. */ #define CAM_DEBUGGED(path, flag) \ - ((cam_dflags & (flag)) \ + (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \ && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) #define CAM_DEBUG(path, flag, printfargs) \ - if ((cam_dflags & (flag)) \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \ && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) { \ xpt_print_path(path); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } #define CAM_DEBUG_PRINT(flag, printfargs) \ - if (cam_dflags & (flag)) { \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \ printf("cam_debug: "); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } #define CAM_DEBUG_PATH_PRINT(flag, path, printfargs) \ - if (cam_dflags & (flag)) { \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \ xpt_print(path, "cam_debug: "); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } -#else /* !CAMDEBUG || !_KERNEL */ +#else /* !_KERNEL */ #define CAM_DEBUGGED(A, B) 0 #define CAM_DEBUG(A, B, C) #define CAM_DEBUG_PRINT(A, B) #define CAM_DEBUG_PATH_PRINT(A, B, C) -#endif /* CAMDEBUG && _KERNEL */ +#endif /* _KERNEL */ #endif /* _CAM_CAM_DEBUG_H */ Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Jun 20 14:29:01 2012 (r237316) +++ stable/9/sys/cam/cam_xpt.c Wed Jun 20 14:36:09 2012 (r237317) @@ -188,21 +188,15 @@ static struct cdevsw xpt_cdevsw = { }; /* Storage for debugging datastructures */ -#ifdef CAMDEBUG struct cam_path *cam_dpath; -#ifdef CAM_DEBUG_FLAGS u_int32_t cam_dflags = CAM_DEBUG_FLAGS; -#else -u_int32_t cam_dflags = CAM_DEBUG_NONE; -#endif TUNABLE_INT("kern.cam.dflags", &cam_dflags); SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW, - &cam_dflags, 0, "Cam Debug Flags"); -u_int32_t cam_debug_delay; + &cam_dflags, 0, "Enabled debug flags"); +u_int32_t cam_debug_delay = CAM_DEBUG_DELAY; TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay); SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW, - &cam_debug_delay, 0, "Cam Debug Flags"); -#endif + &cam_debug_delay, 0, "Delay in us after each debug message"); /* Our boot-time initialization hook */ static int cam_module_event_handler(module_t, int /*modeventtype_t*/, void *); @@ -2472,9 +2466,7 @@ xpt_action(union ccb *start_ccb) void xpt_action_default(union ccb *start_ccb) { -#ifdef CAMDEBUG char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; -#endif struct cam_path *path; path = start_ccb->ccb_h.path; @@ -2980,16 +2972,17 @@ xpt_action_default(union ccb *start_ccb) break; } case XPT_DEBUG: { -#ifdef CAMDEBUG -#ifdef CAM_DEBUG_DELAY - cam_debug_delay = CAM_DEBUG_DELAY; -#endif + /* Check that all request bits are supported. */ + if (start_ccb->cdbg.flags & ~CAM_DEBUG_COMPILE) { + start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; + break; + } + cam_dflags = start_ccb->cdbg.flags; if (cam_dpath != NULL) { xpt_free_path(cam_dpath); cam_dpath = NULL; } - if (cam_dflags != CAM_DEBUG_NONE) { if (xpt_create_path(&cam_dpath, xpt_periph, start_ccb->ccb_h.path_id, @@ -3007,9 +3000,6 @@ xpt_action_default(union ccb *start_ccb) cam_dpath = NULL; start_ccb->ccb_h.status = CAM_REQ_CMP; } -#else /* !CAMDEBUG */ - start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; -#endif /* CAMDEBUG */ break; } case XPT_FREEZE_QUEUE: @@ -4749,9 +4739,7 @@ xpt_config(void *arg) * Now that interrupts are enabled, go find our devices */ -#ifdef CAMDEBUG - /* Setup debugging flags and path */ -#ifdef CAM_DEBUG_BUS + /* Setup debugging path */ if (cam_dflags != CAM_DEBUG_NONE) { /* * Locking is specifically omitted here. No SIMs have @@ -4768,10 +4756,6 @@ xpt_config(void *arg) } } else cam_dpath = NULL; -#else /* !CAM_DEBUG_BUS */ - cam_dpath = NULL; -#endif /* CAM_DEBUG_BUS */ -#endif /* CAMDEBUG */ periphdriver_init(1); xpt_hold_boot(); Modified: stable/9/sys/cam/cam_xpt.h ============================================================================== --- stable/9/sys/cam/cam_xpt.h Wed Jun 20 14:29:01 2012 (r237316) +++ stable/9/sys/cam/cam_xpt.h Wed Jun 20 14:36:09 2012 (r237317) @@ -63,28 +63,6 @@ struct async_node { SLIST_HEAD(async_list, async_node); SLIST_HEAD(periph_list, cam_periph); -#if defined(CAM_DEBUG_FLAGS) && !defined(CAMDEBUG) -#error "You must have options CAMDEBUG to use options CAM_DEBUG_FLAGS" -#endif - -/* - * In order to enable the CAM_DEBUG_* options, the user must have CAMDEBUG - * enabled. Also, the user must have either none, or all of CAM_DEBUG_BUS, - * CAM_DEBUG_TARGET, and CAM_DEBUG_LUN specified. - */ -#if defined(CAM_DEBUG_BUS) || defined(CAM_DEBUG_TARGET) \ - || defined(CAM_DEBUG_LUN) -#ifdef CAMDEBUG -#if !defined(CAM_DEBUG_BUS) || !defined(CAM_DEBUG_TARGET) \ - || !defined(CAM_DEBUG_LUN) -#error "You must define all or none of CAM_DEBUG_BUS, CAM_DEBUG_TARGET \ - and CAM_DEBUG_LUN" -#endif /* !CAM_DEBUG_BUS || !CAM_DEBUG_TARGET || !CAM_DEBUG_LUN */ -#else /* !CAMDEBUG */ -#error "You must use options CAMDEBUG if you use the CAM_DEBUG_* options" -#endif /* CAMDEBUG */ -#endif /* CAM_DEBUG_BUS || CAM_DEBUG_TARGET || CAM_DEBUG_LUN */ - void xpt_action(union ccb *new_ccb); void xpt_action_default(union ccb *new_ccb); union ccb *xpt_alloc_ccb(void); Modified: stable/9/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sa.c Wed Jun 20 14:29:01 2012 (r237316) +++ stable/9/sys/cam/scsi/scsi_sa.c Wed Jun 20 14:36:09 2012 (r237317) @@ -1482,10 +1482,6 @@ saregister(struct cam_periph *periph, vo softc->quirks = ((struct sa_quirk_entry *)match)->quirks; softc->last_media_blksize = ((struct sa_quirk_entry *)match)->prefblk; -#ifdef CAMDEBUG - xpt_print(periph->path, "found quirk entry %d\n", - (int) (((struct sa_quirk_entry *) match) - sa_quirk_table)); -#endif } else softc->quirks = SA_QUIRK_NONE; @@ -1798,13 +1794,11 @@ sadone(struct cam_periph *periph, union */ if (error || (softc->flags & SA_FLAG_ERR_PENDING)) cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0); -#ifdef CAMDEBUG if (error || bp->bio_resid) { CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("error %d resid %ld count %ld\n", error, bp->bio_resid, bp->bio_bcount)); } -#endif biofinish(bp, softc->device_stats, 0); break; } Modified: stable/9/sys/cam/scsi/scsi_target.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_target.c Wed Jun 20 14:29:01 2012 (r237316) +++ stable/9/sys/cam/scsi/scsi_target.c Wed Jun 20 14:36:09 2012 (r237317) @@ -305,7 +305,6 @@ targioctl(struct cdev *dev, u_long cmd, break; case TARGIOCDEBUG: { -#ifdef CAMDEBUG struct ccb_debug cdbg; /* If no periph available, disallow debugging changes */ @@ -326,9 +325,6 @@ targioctl(struct cdev *dev, u_long cmd, xpt_action((union ccb *)&cdbg); cam_periph_unlock(softc->periph); status = cdbg.ccb_h.status & CAM_STATUS_MASK; -#else - status = CAM_FUNC_NOTAVAIL; -#endif break; } default: Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Wed Jun 20 14:29:01 2012 (r237316) +++ stable/9/sys/conf/NOTES Wed Jun 20 14:36:09 2012 (r237317) @@ -1291,14 +1291,13 @@ device ctl #CAM Target Layer # CAM OPTIONS: # debugging options: -# -- NOTE -- If you specify one of the bus/target/lun options, you must -# specify them all! -# CAMDEBUG: When defined enables debugging macros -# CAM_DEBUG_BUS: Debug the given bus. Use -1 to debug all busses. -# CAM_DEBUG_TARGET: Debug the given target. Use -1 to debug all targets. -# CAM_DEBUG_LUN: Debug the given lun. Use -1 to debug all luns. -# CAM_DEBUG_FLAGS: OR together CAM_DEBUG_INFO, CAM_DEBUG_TRACE, -# CAM_DEBUG_SUBTRACE, and CAM_DEBUG_CDB +# CAMDEBUG Compile in all possible debugging. +# CAM_DEBUG_COMPILE Debug levels to compile in. +# CAM_DEBUG_FLAGS Debug levels to enable on boot. +# CAM_DEBUG_BUS Limit debugging to the given bus. +# CAM_DEBUG_TARGET Limit debugging to the given target. +# CAM_DEBUG_LUN Limit debugging to the given lun. +# CAM_DEBUG_DELAY Delay in us after printing each debug line. # # CAM_MAX_HIGHPOWER: Maximum number of concurrent high power (start unit) cmds # SCSI_NO_SENSE_STRINGS: When defined disables sense descriptions @@ -1309,10 +1308,12 @@ device ctl #CAM Target Layer # can be changed at boot and runtime with the # kern.cam.scsi_delay tunable/sysctl. options CAMDEBUG +options CAM_DEBUG_COMPILE=-1 +options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH) options CAM_DEBUG_BUS=-1 options CAM_DEBUG_TARGET=-1 options CAM_DEBUG_LUN=-1 -options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB) +options CAM_DEBUG_DELAY=1 options CAM_MAX_HIGHPOWER=4 options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Wed Jun 20 14:29:01 2012 (r237316) +++ stable/9/sys/conf/options Wed Jun 20 14:36:09 2012 (r237317) @@ -302,6 +302,7 @@ MAXSSIZ opt_param.h # Generic SCSI options. CAM_MAX_HIGHPOWER opt_cam.h CAMDEBUG opt_cam.h +CAM_DEBUG_COMPILE opt_cam.h CAM_DEBUG_DELAY opt_cam.h CAM_DEBUG_BUS opt_cam.h CAM_DEBUG_TARGET opt_cam.h From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:39:36 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C4121065672; Wed, 20 Jun 2012 14:39:36 +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 63C0A8FC17; Wed, 20 Jun 2012 14:39: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 q5KEdaRB048433; Wed, 20 Jun 2012 14:39:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEdaF9048424; Wed, 20 Jun 2012 14:39:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201439.q5KEdaF9048424@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:39: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: r237318 - in stable/8: share/man/man4 sys/cam sys/cam/scsi sys/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:39:36 -0000 Author: mav Date: Wed Jun 20 14:39:35 2012 New Revision: 237318 URL: http://svn.freebsd.org/changeset/base/237318 Log: MFC r236712: To make CAM debugging easier, compile in some debug flags (CAM_DEBUG_INFO, CAM_DEBUG_CDB, CAM_DEBUG_PERIPH and CAM_DEBUG_PROBE) by default. List of these flags can be modified with CAM_DEBUG_COMPILE kernel option. CAMDEBUG kernel option still enables all possible debug, if not overriden. Additional 50KB of kernel size is a good price for the ability to debug problems without rebuilding the kernel. In case where size is important, debugging can be compiled out by setting CAM_DEBUG_COMPILE option to 0. Modified: stable/8/share/man/man4/scsi.4 stable/8/sys/cam/cam_debug.h stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/cam_xpt.h stable/8/sys/cam/scsi/scsi_sa.c stable/8/sys/cam/scsi/scsi_target.c stable/8/sys/conf/NOTES stable/8/sys/conf/options Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/share/man/man4/scsi.4 ============================================================================== --- stable/8/share/man/man4/scsi.4 Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/share/man/man4/scsi.4 Wed Jun 20 14:39:35 2012 (r237318) @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd March 4, 2010 +.Dd June 7, 2012 .Dt CAM 4 .Os .Sh NAME @@ -43,6 +43,7 @@ .Cd "options CAM_DEBUG_BUS=-1" .Cd "options CAM_DEBUG_TARGET=-1" .Cd "options CAM_DEBUG_LUN=-1" +.Cd "options CAM_DEBUG_COMPILE=CAM_DEBUG_INFO|CAM_DEBUG_CDB|CAM_DEBUG_PROBE" .Cd "options CAM_DEBUG_FLAGS=CAM_DEBUG_INFO|CAM_DEBUG_CDB" .Cd "options CAM_MAX_HIGHPOWER=4" .Cd "options SCSI_NO_SENSE_STRINGS" @@ -72,12 +73,11 @@ There are a number of generic kernel con subsystem: .Bl -tag -width SCSI_NO_SENSE_STRINGS .It Dv CAMDEBUG -This option enables the +This option compiles in all the .Nm debugging printf code. This will not actually cause any debugging information to be printed out when included by itself. -Enabling printouts requires additional configuration. See below for details. .It Dv "CAM_MAX_HIGHPOWER=4" This sets the maximum allowable number of concurrent "high power" commands. @@ -248,54 +248,53 @@ see other .Nm device entries. .Sh DIAGNOSTICS -When the kernel is compiled with options CAMDEBUG, an XPT_DEBUG CCB can be -used to enable various amounts of tracing information on any -specific device. -Devices not being traced will not produce trace information. -There are currently four debugging flags that may be turned on: +An XPT_DEBUG CCB can be used to enable various amounts of tracing information +on any specific bus/device from the list of options compiled into the kernel. +There are currently seven debugging flags that may be compiled in and used: .Bl -tag -width CAM_DEBUG_SUBTRACE .It Dv CAM_DEBUG_INFO -This debugging flag enables general informational printfs for the device +This flag enables general informational printfs for the device or devices in question. .It Dv CAM_DEBUG_TRACE -This debugging flag enables function-level command flow tracing. +This flag enables function-level command flow tracing. i.e.\& kernel printfs will happen at the entrance and exit of various functions. .It Dv CAM_DEBUG_SUBTRACE -This debugging flag enables debugging output internal to various functions. +This flag enables debugging output internal to various functions. .It Dv CAM_DEBUG_CDB -This debugging flag will cause the kernel to print out all +This flag will cause the kernel to print out all +.Tn ATA +and .Tn SCSI commands sent to a particular device or devices. +.It Dv CAM_DEBUG_XPT +This flag will enable command scheduler tracing. +.It Dv CAM_DEBUG_PERIPH +This flag will enable peripheral drivers messages. +.It Dv CAM_DEBUG_PROBE +This flag will enable devices probe process tracing. .El .Pp Some of these flags, most notably .Dv CAM_DEBUG_TRACE and -.Dv CAM_DEBUG_SUBTRACE -will produce kernel printfs in EXTREME numbers, -and because of that, they are not especially useful. -There are not many things logged at the -.Dv CAM_DEBUG_INFO -level, so it is not especially useful. -The most useful debugging flag is the -.Dv CAM_DEBUG_CDB -flag. +.Dv CAM_DEBUG_SUBTRACE , +will produce kernel printfs in EXTREME numbers. +.Pp Users can enable debugging from their kernel config file, by using the following kernel config options: -.Bl -tag -width CAM_DEBUG_TARGET +.Bl -tag -width CAM_DEBUG_COMPILE .It Dv CAMDEBUG -This enables +This builds into the kernel all possible .Nm debugging. -Without this option, users will not even be able -to turn on debugging from userland via -.Xr camcontrol 8 . -.It Dv CAM_DEBUG_FLAGS -This allows the user to set the various debugging flags described above -in a kernel config file. +.It Dv CAM_DEBUG_COMPILE +This allows to specify support for which debugging flags described above +should be built into the kernel. Flags may be ORed together if the user wishes to see printfs for multiple debugging levels. +.It Dv CAM_DEBUG_FLAGS +This allows to set the various debugging flags from a kernel config file. .It Dv CAM_DEBUG_BUS Specify a bus to debug. To debug all busses, set this to -1. @@ -307,17 +306,9 @@ Specify a lun to debug. To debug all luns, set this to -1. .El .Pp -When specifying a bus, target or lun to debug, you -.Em MUST -specify all three bus/target/lun options above. -Using wildcards, you -should be able to enable debugging on most anything. -.Pp -Users may also enable debugging printfs on the fly, if the -.Dv CAMDEBUG -option is their config file, by using the +Users may also enable debugging on the fly by using the .Xr camcontrol 8 -utility. +utility, if wanted options built into the kernel. See .Xr camcontrol 8 for details. Modified: stable/8/sys/cam/cam_debug.h ============================================================================== --- stable/8/sys/cam/cam_debug.h Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/cam/cam_debug.h Wed Jun 20 14:39:35 2012 (r237318) @@ -44,7 +44,35 @@ typedef enum { CAM_DEBUG_PROBE = 0x40 /* print out probe actions */ } cam_debug_flags; -#if defined(CAMDEBUG) && defined(_KERNEL) +#if defined(_KERNEL) + +#ifndef CAM_DEBUG_FLAGS +#define CAM_DEBUG_FLAGS CAM_DEBUG_NONE +#endif + +#ifndef CAM_DEBUG_COMPILE +#ifdef CAMDEBUG +#define CAM_DEBUG_COMPILE (-1) +#else +#define CAM_DEBUG_COMPILE (CAM_DEBUG_INFO | CAM_DEBUG_CDB | \ + CAM_DEBUG_PERIPH | CAM_DEBUG_PROBE | \ + CAM_DEBUG_FLAGS) +#endif +#endif + +#ifndef CAM_DEBUG_BUS +#define CAM_DEBUG_BUS (-1) +#endif +#ifndef CAM_DEBUG_TARGET +#define CAM_DEBUG_TARGET (-1) +#endif +#ifndef CAM_DEBUG_LUN +#define CAM_DEBUG_LUN (-1) +#endif + +#ifndef CAM_DEBUG_DELAY +#define CAM_DEBUG_DELAY 0 +#endif /* Path we want to debug */ extern struct cam_path *cam_dpath; @@ -52,48 +80,48 @@ extern struct cam_path *cam_dpath; extern u_int32_t cam_dflags; /* Printf delay value (to prevent scrolling) */ extern u_int32_t cam_debug_delay; - + /* Debugging macros. */ #define CAM_DEBUGGED(path, flag) \ - ((cam_dflags & (flag)) \ + (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \ && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) #define CAM_DEBUG(path, flag, printfargs) \ - if ((cam_dflags & (flag)) \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \ && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) { \ xpt_print_path(path); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } #define CAM_DEBUG_PRINT(flag, printfargs) \ - if (cam_dflags & (flag)) { \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \ printf("cam_debug: "); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } #define CAM_DEBUG_PATH_PRINT(flag, path, printfargs) \ - if (cam_dflags & (flag)) { \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \ xpt_print(path, "cam_debug: "); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } -#else /* !CAMDEBUG || !_KERNEL */ +#else /* !_KERNEL */ #define CAM_DEBUGGED(A, B) 0 #define CAM_DEBUG(A, B, C) #define CAM_DEBUG_PRINT(A, B) #define CAM_DEBUG_PATH_PRINT(A, B, C) -#endif /* CAMDEBUG && _KERNEL */ +#endif /* _KERNEL */ #endif /* _CAM_CAM_DEBUG_H */ Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/cam/cam_xpt.c Wed Jun 20 14:39:35 2012 (r237318) @@ -189,21 +189,15 @@ static struct cdevsw xpt_cdevsw = { }; /* Storage for debugging datastructures */ -#ifdef CAMDEBUG struct cam_path *cam_dpath; -#ifdef CAM_DEBUG_FLAGS u_int32_t cam_dflags = CAM_DEBUG_FLAGS; -#else -u_int32_t cam_dflags = CAM_DEBUG_NONE; -#endif TUNABLE_INT("kern.cam.dflags", &cam_dflags); SYSCTL_INT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW, - &cam_dflags, 0, "Cam Debug Flags"); -u_int32_t cam_debug_delay; + &cam_dflags, 0, "Enabled debug flags"); +u_int32_t cam_debug_delay = CAM_DEBUG_DELAY; TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay); SYSCTL_INT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW, - &cam_debug_delay, 0, "Cam Debug Flags"); -#endif + &cam_debug_delay, 0, "Delay in us after each debug message"); /* Our boot-time initialization hook */ static int cam_module_event_handler(module_t, int /*modeventtype_t*/, void *); @@ -2428,9 +2422,7 @@ xpt_action(union ccb *start_ccb) void xpt_action_default(union ccb *start_ccb) { -#ifdef CAMDEBUG char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; -#endif struct cam_path *path; path = start_ccb->ccb_h.path; @@ -2935,16 +2927,17 @@ xpt_action_default(union ccb *start_ccb) break; } case XPT_DEBUG: { -#ifdef CAMDEBUG -#ifdef CAM_DEBUG_DELAY - cam_debug_delay = CAM_DEBUG_DELAY; -#endif + /* Check that all request bits are supported. */ + if (start_ccb->cdbg.flags & ~CAM_DEBUG_COMPILE) { + start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; + break; + } + cam_dflags = start_ccb->cdbg.flags; if (cam_dpath != NULL) { xpt_free_path(cam_dpath); cam_dpath = NULL; } - if (cam_dflags != CAM_DEBUG_NONE) { if (xpt_create_path(&cam_dpath, xpt_periph, start_ccb->ccb_h.path_id, @@ -2962,9 +2955,6 @@ xpt_action_default(union ccb *start_ccb) cam_dpath = NULL; start_ccb->ccb_h.status = CAM_REQ_CMP; } -#else /* !CAMDEBUG */ - start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; -#endif /* CAMDEBUG */ break; } case XPT_FREEZE_QUEUE: @@ -4707,9 +4697,7 @@ xpt_config(void *arg) * Now that interrupts are enabled, go find our devices */ -#ifdef CAMDEBUG - /* Setup debugging flags and path */ -#ifdef CAM_DEBUG_BUS + /* Setup debugging path */ if (cam_dflags != CAM_DEBUG_NONE) { /* * Locking is specifically omitted here. No SIMs have @@ -4726,10 +4714,6 @@ xpt_config(void *arg) } } else cam_dpath = NULL; -#else /* !CAM_DEBUG_BUS */ - cam_dpath = NULL; -#endif /* CAM_DEBUG_BUS */ -#endif /* CAMDEBUG */ periphdriver_init(1); xpt_hold_boot(); Modified: stable/8/sys/cam/cam_xpt.h ============================================================================== --- stable/8/sys/cam/cam_xpt.h Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/cam/cam_xpt.h Wed Jun 20 14:39:35 2012 (r237318) @@ -63,28 +63,6 @@ struct async_node { SLIST_HEAD(async_list, async_node); SLIST_HEAD(periph_list, cam_periph); -#if defined(CAM_DEBUG_FLAGS) && !defined(CAMDEBUG) -#error "You must have options CAMDEBUG to use options CAM_DEBUG_FLAGS" -#endif - -/* - * In order to enable the CAM_DEBUG_* options, the user must have CAMDEBUG - * enabled. Also, the user must have either none, or all of CAM_DEBUG_BUS, - * CAM_DEBUG_TARGET, and CAM_DEBUG_LUN specified. - */ -#if defined(CAM_DEBUG_BUS) || defined(CAM_DEBUG_TARGET) \ - || defined(CAM_DEBUG_LUN) -#ifdef CAMDEBUG -#if !defined(CAM_DEBUG_BUS) || !defined(CAM_DEBUG_TARGET) \ - || !defined(CAM_DEBUG_LUN) -#error "You must define all or none of CAM_DEBUG_BUS, CAM_DEBUG_TARGET \ - and CAM_DEBUG_LUN" -#endif /* !CAM_DEBUG_BUS || !CAM_DEBUG_TARGET || !CAM_DEBUG_LUN */ -#else /* !CAMDEBUG */ -#error "You must use options CAMDEBUG if you use the CAM_DEBUG_* options" -#endif /* CAMDEBUG */ -#endif /* CAM_DEBUG_BUS || CAM_DEBUG_TARGET || CAM_DEBUG_LUN */ - void xpt_action(union ccb *new_ccb); void xpt_action_default(union ccb *new_ccb); union ccb *xpt_alloc_ccb(void); Modified: stable/8/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_sa.c Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/cam/scsi/scsi_sa.c Wed Jun 20 14:39:35 2012 (r237318) @@ -1477,10 +1477,6 @@ saregister(struct cam_periph *periph, vo softc->quirks = ((struct sa_quirk_entry *)match)->quirks; softc->last_media_blksize = ((struct sa_quirk_entry *)match)->prefblk; -#ifdef CAMDEBUG - xpt_print(periph->path, "found quirk entry %d\n", - (int) (((struct sa_quirk_entry *) match) - sa_quirk_table)); -#endif } else softc->quirks = SA_QUIRK_NONE; @@ -1793,13 +1789,11 @@ sadone(struct cam_periph *periph, union */ if (error || (softc->flags & SA_FLAG_ERR_PENDING)) cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0); -#ifdef CAMDEBUG if (error || bp->bio_resid) { CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("error %d resid %ld count %ld\n", error, bp->bio_resid, bp->bio_bcount)); } -#endif biofinish(bp, softc->device_stats, 0); break; } Modified: stable/8/sys/cam/scsi/scsi_target.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_target.c Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/cam/scsi/scsi_target.c Wed Jun 20 14:39:35 2012 (r237318) @@ -302,7 +302,6 @@ targioctl(struct cdev *dev, u_long cmd, break; case TARGIOCDEBUG: { -#ifdef CAMDEBUG struct ccb_debug cdbg; /* If no periph available, disallow debugging changes */ @@ -323,9 +322,6 @@ targioctl(struct cdev *dev, u_long cmd, xpt_action((union ccb *)&cdbg); cam_periph_unlock(softc->periph); status = cdbg.ccb_h.status & CAM_STATUS_MASK; -#else - status = CAM_FUNC_NOTAVAIL; -#endif break; } default: Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/conf/NOTES Wed Jun 20 14:39:35 2012 (r237318) @@ -1264,14 +1264,13 @@ device sg #Linux SCSI passthrough # CAM OPTIONS: # debugging options: -# -- NOTE -- If you specify one of the bus/target/lun options, you must -# specify them all! -# CAMDEBUG: When defined enables debugging macros -# CAM_DEBUG_BUS: Debug the given bus. Use -1 to debug all busses. -# CAM_DEBUG_TARGET: Debug the given target. Use -1 to debug all targets. -# CAM_DEBUG_LUN: Debug the given lun. Use -1 to debug all luns. -# CAM_DEBUG_FLAGS: OR together CAM_DEBUG_INFO, CAM_DEBUG_TRACE, -# CAM_DEBUG_SUBTRACE, and CAM_DEBUG_CDB +# CAMDEBUG Compile in all possible debugging. +# CAM_DEBUG_COMPILE Debug levels to compile in. +# CAM_DEBUG_FLAGS Debug levels to enable on boot. +# CAM_DEBUG_BUS Limit debugging to the given bus. +# CAM_DEBUG_TARGET Limit debugging to the given target. +# CAM_DEBUG_LUN Limit debugging to the given lun. +# CAM_DEBUG_DELAY Delay in us after printing each debug line. # # CAM_MAX_HIGHPOWER: Maximum number of concurrent high power (start unit) cmds # SCSI_NO_SENSE_STRINGS: When defined disables sense descriptions @@ -1282,10 +1281,12 @@ device sg #Linux SCSI passthrough # can be changed at boot and runtime with the # kern.cam.scsi_delay tunable/sysctl. options CAMDEBUG +options CAM_DEBUG_COMPILE=-1 +options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH) options CAM_DEBUG_BUS=-1 options CAM_DEBUG_TARGET=-1 options CAM_DEBUG_LUN=-1 -options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB) +options CAM_DEBUG_DELAY=1 options CAM_MAX_HIGHPOWER=4 options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/conf/options Wed Jun 20 14:39:35 2012 (r237318) @@ -298,6 +298,7 @@ MAXSSIZ opt_param.h # Generic SCSI options. CAM_MAX_HIGHPOWER opt_cam.h CAMDEBUG opt_cam.h +CAM_DEBUG_COMPILE opt_cam.h CAM_DEBUG_DELAY opt_cam.h CAM_DEBUG_BUS opt_cam.h CAM_DEBUG_TARGET opt_cam.h From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:43:41 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2262F1065709; Wed, 20 Jun 2012 14:43:41 +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 0D4148FC14; Wed, 20 Jun 2012 14:43: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 q5KEheAA048647; Wed, 20 Jun 2012 14:43:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEheMR048644; Wed, 20 Jun 2012 14:43:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201443.q5KEheMR048644@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:43:40 +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: r237319 - stable/9/sys/cam X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:43:41 -0000 Author: mav Date: Wed Jun 20 14:43:40 2012 New Revision: 237319 URL: http://svn.freebsd.org/changeset/base/237319 Log: MFC r236713: Add CAM_DEBUG_INFO debug messages for periph created/invalidated/destroyed and for asyncs sent. Modified: stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_xpt.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 20 14:39:35 2012 (r237318) +++ stable/9/sys/cam/cam_periph.c Wed Jun 20 14:43:40 2012 (r237319) @@ -240,6 +240,7 @@ cam_periph_alloc(periph_ctor_t *periph_c goto failure; init_level++; + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph created\n")); status = periph_ctor(periph, arg); @@ -252,6 +253,7 @@ failure: /* Initialized successfully */ break; case 3: + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); xpt_remove_periph(periph); /* FALLTHROUGH */ case 2: @@ -572,6 +574,7 @@ void cam_periph_invalidate(struct cam_periph *periph) { + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); /* * We only call this routine the first time a peripheral is * invalidated. @@ -610,6 +613,7 @@ camperiphfree(struct cam_periph *periph) if (periph->periph_dtor != NULL) periph->periph_dtor(periph); xpt_remove_periph(periph); + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { union ccb ccb; Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Jun 20 14:39:35 2012 (r237318) +++ stable/9/sys/cam/cam_xpt.c Wed Jun 20 14:43:40 2012 (r237319) @@ -2973,7 +2973,7 @@ xpt_action_default(union ccb *start_ccb) } case XPT_DEBUG: { /* Check that all request bits are supported. */ - if (start_ccb->cdbg.flags & ~CAM_DEBUG_COMPILE) { + if (start_ccb->cdbg.flags & ~(CAM_DEBUG_COMPILE)) { start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; break; } @@ -4033,6 +4033,28 @@ xptpathid(const char *sim_name, int sim_ return (pathid); } +static const char * +xpt_async_string(u_int32_t async_code) +{ + + switch (async_code) { + case AC_BUS_RESET: return ("AC_BUS_RESET"); + case AC_UNSOL_RESEL: return ("AC_UNSOL_RESEL"); + case AC_SCSI_AEN: return ("AC_SCSI_AEN"); + case AC_SENT_BDR: return ("AC_SENT_BDR"); + case AC_PATH_REGISTERED: return ("AC_PATH_REGISTERED"); + case AC_PATH_DEREGISTERED: return ("AC_PATH_DEREGISTERED"); + case AC_FOUND_DEVICE: return ("AC_FOUND_DEVICE"); + case AC_LOST_DEVICE: return ("AC_LOST_DEVICE"); + case AC_TRANSFER_NEG: return ("AC_TRANSFER_NEG"); + case AC_INQ_CHANGED: return ("AC_INQ_CHANGED"); + case AC_GETDEV_CHANGED: return ("AC_GETDEV_CHANGED"); + case AC_CONTRACT: return ("AC_CONTRACT"); + case AC_ADVINFO_CHANGED: return ("AC_ADVINFO_CHANGED"); + } + return ("AC_UNKNOWN"); +} + void xpt_async(u_int32_t async_code, struct cam_path *path, void *async_arg) { @@ -4041,8 +4063,8 @@ xpt_async(u_int32_t async_code, struct c struct cam_ed *device, *next_device; mtx_assert(path->bus->sim->mtx, MA_OWNED); - - CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_async\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE | CAM_DEBUG_INFO, + ("xpt_async(%s)\n", xpt_async_string(async_code))); /* * Most async events come from a CAM interrupt context. In From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 14:47:39 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A52CC1065670; Wed, 20 Jun 2012 14:47:39 +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 90B2E8FC17; Wed, 20 Jun 2012 14:47: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 q5KEldow048880; Wed, 20 Jun 2012 14:47:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEldRZ048877; Wed, 20 Jun 2012 14:47:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201447.q5KEldRZ048877@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:47:39 +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: r237320 - stable/8/sys/cam X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:47:39 -0000 Author: mav Date: Wed Jun 20 14:47:39 2012 New Revision: 237320 URL: http://svn.freebsd.org/changeset/base/237320 Log: MFC r236713: Add CAM_DEBUG_INFO debug messages for periph created/invalidated/destroyed and for asyncs sent. Modified: stable/8/sys/cam/cam_periph.c stable/8/sys/cam/cam_xpt.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 20 14:43:40 2012 (r237319) +++ stable/8/sys/cam/cam_periph.c Wed Jun 20 14:47:39 2012 (r237320) @@ -239,6 +239,7 @@ cam_periph_alloc(periph_ctor_t *periph_c goto failure; init_level++; + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph created\n")); status = periph_ctor(periph, arg); @@ -251,6 +252,7 @@ failure: /* Initialized successfully */ break; case 3: + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); xpt_remove_periph(periph); /* FALLTHROUGH */ case 2: @@ -526,6 +528,7 @@ void cam_periph_invalidate(struct cam_periph *periph) { + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); /* * We only call this routine the first time a peripheral is * invalidated. @@ -564,6 +567,7 @@ camperiphfree(struct cam_periph *periph) if (periph->periph_dtor != NULL) periph->periph_dtor(periph); xpt_remove_periph(periph); + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { union ccb ccb; Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Jun 20 14:43:40 2012 (r237319) +++ stable/8/sys/cam/cam_xpt.c Wed Jun 20 14:47:39 2012 (r237320) @@ -2928,7 +2928,7 @@ xpt_action_default(union ccb *start_ccb) } case XPT_DEBUG: { /* Check that all request bits are supported. */ - if (start_ccb->cdbg.flags & ~CAM_DEBUG_COMPILE) { + if (start_ccb->cdbg.flags & ~(CAM_DEBUG_COMPILE)) { start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; break; } @@ -3992,6 +3992,27 @@ xptpathid(const char *sim_name, int sim_ return (pathid); } +static const char * +xpt_async_string(u_int32_t async_code) +{ + + switch (async_code) { + case AC_BUS_RESET: return ("AC_BUS_RESET"); + case AC_UNSOL_RESEL: return ("AC_UNSOL_RESEL"); + case AC_SCSI_AEN: return ("AC_SCSI_AEN"); + case AC_SENT_BDR: return ("AC_SENT_BDR"); + case AC_PATH_REGISTERED: return ("AC_PATH_REGISTERED"); + case AC_PATH_DEREGISTERED: return ("AC_PATH_DEREGISTERED"); + case AC_FOUND_DEVICE: return ("AC_FOUND_DEVICE"); + case AC_LOST_DEVICE: return ("AC_LOST_DEVICE"); + case AC_TRANSFER_NEG: return ("AC_TRANSFER_NEG"); + case AC_INQ_CHANGED: return ("AC_INQ_CHANGED"); + case AC_GETDEV_CHANGED: return ("AC_GETDEV_CHANGED"); + case AC_CONTRACT: return ("AC_CONTRACT"); + } + return ("AC_UNKNOWN"); +} + void xpt_async(u_int32_t async_code, struct cam_path *path, void *async_arg) { @@ -4000,8 +4021,8 @@ xpt_async(u_int32_t async_code, struct c struct cam_ed *device, *next_device; mtx_assert(path->bus->sim->mtx, MA_OWNED); - - CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_async\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE | CAM_DEBUG_INFO, + ("xpt_async(%s)\n", xpt_async_string(async_code))); /* * Most async events come from a CAM interrupt context. In From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 16:51:15 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1973E1065673; Wed, 20 Jun 2012 16:51:15 +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 024168FC1B; Wed, 20 Jun 2012 16:51: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 q5KGpEos055133; Wed, 20 Jun 2012 16:51:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KGpEor055126; Wed, 20 Jun 2012 16:51:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201651.q5KGpEor055126@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 16:51:14 +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: r237327 - in stable/9/sys/cam: . ata scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 16:51:15 -0000 Author: mav Date: Wed Jun 20 16:51:14 2012 New Revision: 237327 URL: http://svn.freebsd.org/changeset/base/237327 Log: MFC r236814: One more major cam_periph_error() rewrite to improve error handling and reporting. It includes: - removing of error messages controlled by bootverbose, replacing them with more universal and informative debugging on CAM_DEBUG_INFO level, that is now built into the kernel by default; - more close following to the arguments submitted by caller, such as SF_PRINT_ALWAYS, SF_QUIET_IR and SF_NO_PRINT; consumer knows better which errors are usual/expected at this point and which are really informative; - adding two new flags SF_NO_RECOVERY and SF_NO_RETRY to allow caller specify how much assistance it needs at this point; previously consumers controlled that by not calling cam_periph_error() at all, but that made behavior inconsistent and debugging complicated; - tuning debug messages and taken actions order to make debugging output more readable and cause-effect relationships visible; - making camperiphdone() (common device recovery completion handler) to also use cam_periph_error() in most cases, instead of own dumb code; - removing manual sense fetching code from cam_periph_error(); I was told by number of people that it is SIM obligation to fetch sense data, so this code is useless and only significantly complicates recovery logic; - making ada, da and pass driver to use cam_periph_error() with new limited recovery options to handle error recovery and debugging in common way; as one of results, CAM_REQUEUE_REQ and other retrying statuses are now working fine with pass driver, that caused many problems before. - reverting r186891 by raj@ to avoid burning few seconds in tight DELAY() loops on device probe, while device simply loads media; I think that problem may already be fixed in other way, and even if it is not, solution must be different. Sponsored by: iXsystems, Inc. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam.h stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_periph.h stable/9/sys/cam/scsi/scsi_all.c stable/9/sys/cam/scsi/scsi_all.h stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_pass.c stable/9/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Wed Jun 20 16:24:02 2012 (r237326) +++ stable/9/sys/cam/ata/ata_da.c Wed Jun 20 16:51:14 2012 (r237327) @@ -584,6 +584,7 @@ adadump(void *arg, void *virtual, vm_off struct disk *dp; uint64_t lba; uint16_t count; + int error = 0; dp = arg; periph = dp->d_drv1; @@ -622,13 +623,16 @@ adadump(void *arg, void *virtual, vm_off } xpt_polled_action(&ccb); - if ((ccb.ataio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + error = cam_periph_error(&ccb, + 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); + if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + if (error != 0) printf("Aborting dump due to I/O error.\n"); - cam_periph_unlock(periph); - return(EIO); - } + cam_periph_unlock(periph); - return(0); + return (error); } if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) { @@ -636,7 +640,7 @@ adadump(void *arg, void *virtual, vm_off ccb.ccb_h.ccb_state = ADA_CCB_DUMP; cam_fill_ataio(&ccb.ataio, - 1, + 0, adadone, CAM_DIR_NONE, 0, @@ -650,18 +654,16 @@ adadump(void *arg, void *virtual, vm_off ata_28bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); xpt_polled_action(&ccb); - if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) - xpt_print(periph->path, "Synchronize cache failed\n"); - + error = cam_periph_error(&ccb, + 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); + cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + if (error != 0) + xpt_print(periph->path, "Synchronize cache failed\n"); } cam_periph_unlock(periph); - return (0); + return (error); } static void @@ -1716,6 +1718,7 @@ adaflush(void) { struct cam_periph *periph; struct ada_softc *softc; + int error; TAILQ_FOREACH(periph, &adadriver.units, unit_links) { union ccb ccb; @@ -1739,7 +1742,7 @@ adaflush(void) ccb.ccb_h.ccb_state = ADA_CCB_DUMP; cam_fill_ataio(&ccb.ataio, - 1, + 0, adadone, CAM_DIR_NONE, 0, @@ -1753,15 +1756,13 @@ adaflush(void) ata_28bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); xpt_polled_action(&ccb); - if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) - xpt_print(periph->path, "Synchronize cache failed\n"); - + error = cam_periph_error(&ccb, + 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); + cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + if (error != 0) + xpt_print(periph->path, "Synchronize cache failed\n"); cam_periph_unlock(periph); } } @@ -1771,6 +1772,7 @@ adaspindown(uint8_t cmd, int flags) { struct cam_periph *periph; struct ada_softc *softc; + int error; TAILQ_FOREACH(periph, &adadriver.units, unit_links) { union ccb ccb; @@ -1795,7 +1797,7 @@ adaspindown(uint8_t cmd, int flags) ccb.ccb_h.ccb_state = ADA_CCB_DUMP; cam_fill_ataio(&ccb.ataio, - 1, + 0, adadone, CAM_DIR_NONE | flags, 0, @@ -1806,15 +1808,13 @@ adaspindown(uint8_t cmd, int flags) ata_28bit_cmd(&ccb.ataio, cmd, 0, 0, 0); xpt_polled_action(&ccb); - if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) - xpt_print(periph->path, "Spin-down disk failed\n"); - + error = cam_periph_error(&ccb, + 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); + cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + if (error != 0) + xpt_print(periph->path, "Spin-down disk failed\n"); cam_periph_unlock(periph); } } Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Wed Jun 20 16:24:02 2012 (r237326) +++ stable/9/sys/cam/ata/ata_xpt.c Wed Jun 20 16:51:14 2012 (r237327) @@ -705,12 +705,9 @@ probedone(struct cam_periph *periph, uni inq_buf = &path->device->inq_data; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (softc->restart) { - if (bootverbose) { - cam_error_print(done_ccb, - CAM_ESF_ALL, CAM_EPF_ALL); - } - } else if (cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) + if (cam_periph_error(done_ccb, + 0, softc->restart ? (SF_NO_RECOVERY | SF_NO_RETRY) : 0, + NULL) == ERESTART) return; if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ Modified: stable/9/sys/cam/cam.h ============================================================================== --- stable/9/sys/cam/cam.h Wed Jun 20 16:24:02 2012 (r237326) +++ stable/9/sys/cam/cam.h Wed Jun 20 16:51:14 2012 (r237327) @@ -108,6 +108,15 @@ typedef enum { CAM_RETRY_SELTO = 0x02 /* Retry Selection Timeouts */ } cam_flags; +enum { + SF_RETRY_UA = 0x01, /* Retry UNIT ATTENTION conditions. */ + SF_NO_PRINT = 0x02, /* Never print error status. */ + SF_QUIET_IR = 0x04, /* Be quiet about Illegal Request reponses */ + SF_PRINT_ALWAYS = 0x08, /* Always print error status. */ + SF_NO_RECOVERY = 0x10, /* Don't do active error recovery. */ + SF_NO_RETRY = 0x20 /* Don't do any retries. */ +}; + /* CAM Status field values */ typedef enum { CAM_REQ_INPROG, /* CCB request is in progress */ Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Wed Jun 20 16:24:02 2012 (r237326) +++ stable/9/sys/cam/cam_periph.c Wed Jun 20 16:51:14 2012 (r237327) @@ -69,18 +69,22 @@ static void camperiphdone(struct cam_pe union ccb *done_ccb); static void camperiphfree(struct cam_periph *periph); static int camperiphscsistatuserror(union ccb *ccb, + union ccb **orig_ccb, cam_flags camflags, u_int32_t sense_flags, int *openings, u_int32_t *relsim_flags, u_int32_t *timeout, + int *print, const char **action_string); static int camperiphscsisenseerror(union ccb *ccb, + union ccb **orig_ccb, cam_flags camflags, u_int32_t sense_flags, int *openings, u_int32_t *relsim_flags, u_int32_t *timeout, + int *print, const char **action_string); static int nperiph_drivers; @@ -1108,255 +1112,84 @@ cam_release_devq(struct cam_path *path, } #define saved_ccb_ptr ppriv_ptr0 -#define recovery_depth ppriv_field1 -static void -camperiphsensedone(struct cam_periph *periph, union ccb *done_ccb) -{ - union ccb *saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; - cam_status status; - int frozen = 0; - int depth = done_ccb->ccb_h.recovery_depth; - - status = done_ccb->ccb_h.status; - if (status & CAM_DEV_QFRZN) { - frozen = 1; - /* - * Clear freeze flag now for case of retry, - * freeze will be dropped later. - */ - done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; - } - status &= CAM_STATUS_MASK; - switch (status) { - case CAM_REQ_CMP: - { - int error_code, sense_key, asc, ascq; - - scsi_extract_sense_len(&saved_ccb->csio.sense_data, - saved_ccb->csio.sense_len - - saved_ccb->csio.sense_resid, - &error_code, &sense_key, &asc, &ascq, - /*show_errors*/ 1); - /* - * If we manually retrieved sense into a CCB and got - * something other than "NO SENSE" send the updated CCB - * back to the client via xpt_done() to be processed via - * the error recovery code again. - */ - if ((sense_key != -1) - && (sense_key != SSD_KEY_NO_SENSE)) { - saved_ccb->ccb_h.status |= CAM_AUTOSNS_VALID; - } else { - saved_ccb->ccb_h.status &= ~CAM_STATUS_MASK; - saved_ccb->ccb_h.status |= CAM_AUTOSENSE_FAIL; - } - saved_ccb->csio.sense_resid = done_ccb->csio.resid; - bcopy(saved_ccb, done_ccb, sizeof(union ccb)); - xpt_free_ccb(saved_ccb); - break; - } - default: - bcopy(saved_ccb, done_ccb, sizeof(union ccb)); - xpt_free_ccb(saved_ccb); - done_ccb->ccb_h.status &= ~CAM_STATUS_MASK; - done_ccb->ccb_h.status |= CAM_AUTOSENSE_FAIL; - break; - } - periph->flags &= ~CAM_PERIPH_SENSE_INPROG; - /* - * If it is the end of recovery, drop freeze, taken due to - * CAM_DEV_QFREEZE flag, set on recovery request. - */ - if (depth == 0) { - cam_release_devq(done_ccb->ccb_h.path, - /*relsim_flags*/0, - /*openings*/0, - /*timeout*/0, - /*getcount_only*/0); - } - /* - * Copy frozen flag from recovery request if it is set there - * for some reason. - */ - if (frozen != 0) - done_ccb->ccb_h.status |= CAM_DEV_QFRZN; - (*done_ccb->ccb_h.cbfcnp)(periph, done_ccb); -} - static void camperiphdone(struct cam_periph *periph, union ccb *done_ccb) { - union ccb *saved_ccb, *save_ccb; + union ccb *saved_ccb; cam_status status; - int frozen = 0; struct scsi_start_stop_unit *scsi_cmd; - u_int32_t relsim_flags, timeout; + scsi_cmd = (struct scsi_start_stop_unit *) + &done_ccb->csio.cdb_io.cdb_bytes; status = done_ccb->ccb_h.status; - if (status & CAM_DEV_QFRZN) { - frozen = 1; - /* - * Clear freeze flag now for case of retry, - * freeze will be dropped later. - */ - done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; - } - timeout = 0; - relsim_flags = 0; - saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; - - switch (status & CAM_STATUS_MASK) { - case CAM_REQ_CMP: - { - /* - * If we have successfully taken a device from the not - * ready to ready state, re-scan the device and re-get - * the inquiry information. Many devices (mostly disks) - * don't properly report their inquiry information unless - * they are spun up. - */ - scsi_cmd = (struct scsi_start_stop_unit *) - &done_ccb->csio.cdb_io.cdb_bytes; - - if (scsi_cmd->opcode == START_STOP_UNIT) - xpt_async(AC_INQ_CHANGED, - done_ccb->ccb_h.path, NULL); - goto final; - } - case CAM_SCSI_STATUS_ERROR: - scsi_cmd = (struct scsi_start_stop_unit *) - &done_ccb->csio.cdb_io.cdb_bytes; - if (status & CAM_AUTOSNS_VALID) { - struct ccb_getdev cgd; + if ((status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if ((status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR && + (status & CAM_AUTOSNS_VALID)) { struct scsi_sense_data *sense; int error_code, sense_key, asc, ascq, sense_len; - scsi_sense_action err_action; sense = &done_ccb->csio.sense_data; sense_len = done_ccb->csio.sense_len - done_ccb->csio.sense_resid; - scsi_extract_sense_len(sense, sense_len, &error_code, - &sense_key, &asc, &ascq, - /*show_errors*/ 1); - /* - * Grab the inquiry data for this device. - */ - xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); - err_action = scsi_error_action(&done_ccb->csio, - &cgd.inq_data, 0); + scsi_extract_sense_len(sense, sense_len, &error_code, + &sense_key, &asc, &ascq, /*show_errors*/ 1); /* - * If the error is "invalid field in CDB", - * and the load/eject flag is set, turn the - * flag off and try again. This is just in - * case the drive in question barfs on the - * load eject flag. The CAM code should set - * the load/eject flag by default for + * If the error is "invalid field in CDB", + * and the load/eject flag is set, turn the + * flag off and try again. This is just in + * case the drive in question barfs on the + * load eject flag. The CAM code should set + * the load/eject flag by default for * removable media. */ - /* XXX KDM - * Should we check to see what the specific - * scsi status is?? Or does it not matter - * since we already know that there was an - * error, and we know what the specific - * error code was, and we know what the - * opcode is.. - */ if ((scsi_cmd->opcode == START_STOP_UNIT) && ((scsi_cmd->how & SSS_LOEJ) != 0) && - (asc == 0x24) && (ascq == 0x00) && - (done_ccb->ccb_h.retry_count > 0)) { - + (asc == 0x24) && (ascq == 0x00)) { scsi_cmd->how &= ~SSS_LOEJ; + if (status & CAM_DEV_QFRZN) { + cam_release_devq(done_ccb->ccb_h.path, + 0, 0, 0, 0); + done_ccb->ccb_h.status &= + ~CAM_DEV_QFRZN; + } xpt_action(done_ccb); - } else if ((done_ccb->ccb_h.retry_count > 1) - && ((err_action & SS_MASK) != SS_FAIL)) { - - /* - * In this case, the error recovery - * command failed, but we've got - * some retries left on it. Give - * it another try unless this is an - * unretryable error. - */ - /* set the timeout to .5 sec */ - relsim_flags = - RELSIM_RELEASE_AFTER_TIMEOUT; - timeout = 500; - xpt_action(done_ccb); - break; - } else { - /* - * Perform the final retry with the original - * CCB so that final error processing is - * performed by the owner of the CCB. - */ - goto final; + goto out; } - } else { - save_ccb = xpt_alloc_ccb_nowait(); - if (save_ccb == NULL) - goto final; - bcopy(done_ccb, save_ccb, sizeof(*save_ccb)); - periph->flags |= CAM_PERIPH_SENSE_INPROG; - /* - * Send a Request Sense to the device. We - * assume that we are in a contingent allegiance - * condition so we do not tag this request. - */ - scsi_request_sense(&done_ccb->csio, /*retries*/1, - camperiphsensedone, - &save_ccb->csio.sense_data, - save_ccb->csio.sense_len, - CAM_TAG_ACTION_NONE, - /*sense_len*/SSD_FULL_SIZE, - /*timeout*/5000); - done_ccb->ccb_h.pinfo.priority--; - done_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; - done_ccb->ccb_h.saved_ccb_ptr = save_ccb; - done_ccb->ccb_h.recovery_depth++; - xpt_action(done_ccb); } - break; - default: -final: - bcopy(saved_ccb, done_ccb, sizeof(*done_ccb)); - xpt_free_ccb(saved_ccb); - periph->flags &= ~CAM_PERIPH_RECOVERY_INPROG; - xpt_action(done_ccb); - break; + if (cam_periph_error(done_ccb, + 0, SF_RETRY_UA | SF_NO_PRINT, NULL) == ERESTART) + goto out; + if (done_ccb->ccb_h.status & CAM_DEV_QFRZN) { + cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0); + done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; + } + } else { + /* + * If we have successfully taken a device from the not + * ready to ready state, re-scan the device and re-get + * the inquiry information. Many devices (mostly disks) + * don't properly report their inquiry information unless + * they are spun up. + */ + if (scsi_cmd->opcode == START_STOP_UNIT) + xpt_async(AC_INQ_CHANGED, done_ccb->ccb_h.path, NULL); } - /* decrement the retry count */ - /* - * XXX This isn't appropriate in all cases. Restructure, - * so that the retry count is only decremented on an - * actual retry. Remeber that the orignal ccb had its - * retry count dropped before entering recovery, so - * doing it again is a bug. - */ - if (done_ccb->ccb_h.retry_count > 0) - done_ccb->ccb_h.retry_count--; /* - * Drop freeze taken due to CAM_DEV_QFREEZE flag set on recovery - * request. + * Perform the final retry with the original CCB so that final + * error processing is performed by the owner of the CCB. */ - cam_release_devq(done_ccb->ccb_h.path, - /*relsim_flags*/relsim_flags, - /*openings*/0, - /*timeout*/timeout, - /*getcount_only*/0); - /* Drop freeze taken, if this recovery request got error. */ - if (frozen != 0) { - cam_release_devq(done_ccb->ccb_h.path, - /*relsim_flags*/0, - /*openings*/0, - /*timeout*/0, - /*getcount_only*/0); - } + saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; + bcopy(saved_ccb, done_ccb, sizeof(*done_ccb)); + xpt_free_ccb(saved_ccb); + if (done_ccb->ccb_h.cbfcnp != camperiphdone) + periph->flags &= ~CAM_PERIPH_RECOVERY_INPROG; + xpt_action(done_ccb); + +out: + /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ + cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0); } /* @@ -1415,10 +1248,10 @@ cam_periph_freeze_after_event(struct cam } static int -camperiphscsistatuserror(union ccb *ccb, cam_flags camflags, - u_int32_t sense_flags, - int *openings, u_int32_t *relsim_flags, - u_int32_t *timeout, const char **action_string) +camperiphscsistatuserror(union ccb *ccb, union ccb **orig_ccb, + cam_flags camflags, u_int32_t sense_flags, + int *openings, u_int32_t *relsim_flags, + u_int32_t *timeout, int *print, const char **action_string) { int error; @@ -1431,14 +1264,13 @@ camperiphscsistatuserror(union ccb *ccb, break; case SCSI_STATUS_CMD_TERMINATED: case SCSI_STATUS_CHECK_COND: - if (bootverbose) - xpt_print(ccb->ccb_h.path, "SCSI status error\n"); - error = camperiphscsisenseerror(ccb, + error = camperiphscsisenseerror(ccb, orig_ccb, camflags, sense_flags, openings, relsim_flags, timeout, + print, action_string); break; case SCSI_STATUS_QUEUE_FULL: @@ -1493,9 +1325,6 @@ camperiphscsistatuserror(union ccb *ccb, } *timeout = 0; error = ERESTART; - if (bootverbose) { - xpt_print(ccb->ccb_h.path, "Queue full\n"); - } break; } /* FALLTHROUGH */ @@ -1505,9 +1334,6 @@ camperiphscsistatuserror(union ccb *ccb, * Restart the queue after either another * command completes or a 1 second timeout. */ - if (bootverbose) { - xpt_print(ccb->ccb_h.path, "Device busy\n"); - } if (ccb->ccb_h.retry_count > 0) { ccb->ccb_h.retry_count--; error = ERESTART; @@ -1519,12 +1345,7 @@ camperiphscsistatuserror(union ccb *ccb, } break; case SCSI_STATUS_RESERV_CONFLICT: - xpt_print(ccb->ccb_h.path, "Reservation conflict\n"); - error = EIO; - break; default: - xpt_print(ccb->ccb_h.path, "SCSI status 0x%x\n", - ccb->csio.scsi_status); error = EIO; break; } @@ -1532,18 +1353,18 @@ camperiphscsistatuserror(union ccb *ccb, } static int -camperiphscsisenseerror(union ccb *ccb, cam_flags camflags, - u_int32_t sense_flags, - int *openings, u_int32_t *relsim_flags, - u_int32_t *timeout, const char **action_string) +camperiphscsisenseerror(union ccb *ccb, union ccb **orig, + cam_flags camflags, u_int32_t sense_flags, + int *openings, u_int32_t *relsim_flags, + u_int32_t *timeout, int *print, const char **action_string) { struct cam_periph *periph; union ccb *orig_ccb = ccb; - int error; + int error, recoveryccb; periph = xpt_path_periph(ccb->ccb_h.path); - if (periph->flags & - (CAM_PERIPH_RECOVERY_INPROG | CAM_PERIPH_SENSE_INPROG)) { + recoveryccb = (ccb->ccb_h.cbfcnp == camperiphdone); + if ((periph->flags & CAM_PERIPH_RECOVERY_INPROG) && !recoveryccb) { /* * If error recovery is already in progress, don't attempt * to process this error, but requeue it unconditionally @@ -1558,6 +1379,7 @@ camperiphscsisenseerror(union ccb *ccb, * imperitive that we don't violate this assumption. */ error = ERESTART; + *print = 0; } else { scsi_sense_action err_action; struct ccb_getdev cgd; @@ -1573,14 +1395,36 @@ camperiphscsisenseerror(union ccb *ccb, err_action = scsi_error_action(&ccb->csio, &cgd.inq_data, sense_flags); - else if ((ccb->ccb_h.flags & CAM_DIS_AUTOSENSE) == 0) - err_action = SS_REQSENSE; else err_action = SS_RETRY|SSQ_DECREMENT_COUNT|EIO; - error = err_action & SS_ERRMASK; /* + * Do not autostart sequential access devices + * to avoid unexpected tape loading. + */ + if ((err_action & SS_MASK) == SS_START && + SID_TYPE(&cgd.inq_data) == T_SEQUENTIAL) { + *action_string = "Will not autostart a " + "sequential access device"; + goto sense_error_done; + } + + /* + * Avoid recovery recursion if recovery action is the same. + */ + if ((err_action & SS_MASK) >= SS_START && recoveryccb) { + if (((err_action & SS_MASK) == SS_START && + ccb->csio.cdb_io.cdb_bytes[0] == START_STOP_UNIT) || + ((err_action & SS_MASK) == SS_TUR && + (ccb->csio.cdb_io.cdb_bytes[0] == TEST_UNIT_READY))) { + err_action = SS_RETRY|SSQ_DECREMENT_COUNT|EIO; + *relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT; + *timeout = 500; + } + } + + /* * If the recovery action will consume a retry, * make sure we actually have retries available. */ @@ -1627,15 +1471,6 @@ camperiphscsisenseerror(union ccb *ccb, case SS_START: { int le; - if (SID_TYPE(&cgd.inq_data) == T_SEQUENTIAL) { - xpt_free_ccb(orig_ccb); - ccb->ccb_h.status |= CAM_DEV_QFRZN; - *action_string = "Will not autostart a " - "sequential access device"; - err_action = SS_FAIL; - error = EIO; - break; - } /* * Send a start unit command to the device, and @@ -1699,24 +1534,6 @@ camperiphscsisenseerror(union ccb *ccb, *timeout = 500; break; } - case SS_REQSENSE: - { - *action_string = "Requesting SCSI sense data"; - periph->flags |= CAM_PERIPH_SENSE_INPROG; - /* - * Send a Request Sense to the device. We - * assume that we are in a contingent allegiance - * condition so we do not tag this request. - */ - scsi_request_sense(&ccb->csio, /*retries*/1, - camperiphsensedone, - &orig_ccb->csio.sense_data, - orig_ccb->csio.sense_len, - CAM_TAG_ACTION_NONE, - /*sense_len*/SSD_FULL_SIZE, - /*timeout*/5000); - break; - } default: panic("Unhandled error action %x", err_action); } @@ -1733,14 +1550,12 @@ camperiphscsisenseerror(union ccb *ccb, ccb->ccb_h.pinfo.priority--; ccb->ccb_h.flags |= CAM_DEV_QFREEZE; ccb->ccb_h.saved_ccb_ptr = orig_ccb; - ccb->ccb_h.recovery_depth = 0; error = ERESTART; + *orig = orig_ccb; } sense_error_done: - if ((err_action & SSQ_PRINT_SENSE) != 0 - && (ccb->ccb_h.status & CAM_AUTOSNS_VALID) != 0) - cam_error_print(orig_ccb, CAM_ESF_ALL, CAM_EPF_ALL); + *print = ((err_action & SSQ_PRINT_SENSE) != 0); } return (error); } @@ -1754,87 +1569,35 @@ int cam_periph_error(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, union ccb *save_ccb) { + union ccb *orig_ccb; struct cam_periph *periph; const char *action_string; cam_status status; - int frozen; - int error, printed = 0; - int openings; - u_int32_t relsim_flags; - u_int32_t timeout = 0; + int frozen, error, openings, print, lost_device; + u_int32_t relsim_flags, timeout; + print = 1; periph = xpt_path_periph(ccb->ccb_h.path); action_string = NULL; status = ccb->ccb_h.status; frozen = (status & CAM_DEV_QFRZN) != 0; status &= CAM_STATUS_MASK; - openings = relsim_flags = 0; + openings = relsim_flags = timeout = lost_device = 0; + orig_ccb = ccb; switch (status) { case CAM_REQ_CMP: error = 0; + print = 0; break; case CAM_SCSI_STATUS_ERROR: - error = camperiphscsistatuserror(ccb, - camflags, - sense_flags, - &openings, - &relsim_flags, - &timeout, - &action_string); + error = camperiphscsistatuserror(ccb, &orig_ccb, + camflags, sense_flags, &openings, &relsim_flags, + &timeout, &print, &action_string); break; case CAM_AUTOSENSE_FAIL: - xpt_print(ccb->ccb_h.path, "AutoSense failed\n"); error = EIO; /* we have to kill the command */ break; - case CAM_ATA_STATUS_ERROR: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "ATA status error\n"); - cam_error_print(ccb, CAM_ESF_ALL, CAM_EPF_ALL); - printed++; - } - /* FALLTHROUGH */ - case CAM_REQ_CMP_ERR: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, - "Request completed with CAM_REQ_CMP_ERR\n"); - printed++; - } - /* FALLTHROUGH */ - case CAM_CMD_TIMEOUT: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "Command timed out\n"); - printed++; - } - /* FALLTHROUGH */ - case CAM_UNEXP_BUSFREE: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "Unexpected Bus Free\n"); - printed++; - } - /* FALLTHROUGH */ - case CAM_UNCOR_PARITY: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, - "Uncorrected parity error\n"); - printed++; - } - /* FALLTHROUGH */ - case CAM_DATA_RUN_ERR: - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "Data overrun\n"); - printed++; - } - /* decrement the number of retries */ - if (ccb->ccb_h.retry_count > 0 && - (periph->flags & CAM_PERIPH_INVALID) == 0) { - ccb->ccb_h.retry_count--; - error = ERESTART; - } else { - action_string = "Retries exhausted"; - error = EIO; - } - break; case CAM_UA_ABORT: case CAM_UA_TERMIO: case CAM_MSG_REJECT_REC: @@ -1845,14 +1608,8 @@ cam_periph_error(union ccb *ccb, cam_fla if ((camflags & CAM_RETRY_SELTO) != 0) { if (ccb->ccb_h.retry_count > 0 && (periph->flags & CAM_PERIPH_INVALID) == 0) { - ccb->ccb_h.retry_count--; error = ERESTART; - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, - "Selection timeout\n"); - printed++; - } /* * Wait a bit to give the device @@ -1866,38 +1623,10 @@ cam_periph_error(union ccb *ccb, cam_fla } /* FALLTHROUGH */ case CAM_DEV_NOT_THERE: - { - struct cam_path *newpath; - lun_id_t lun_id; - error = ENXIO; - - /* - * For a selection timeout, we consider all of the LUNs on - * the target to be gone. If the status is CAM_DEV_NOT_THERE, - * then we only get rid of the device(s) specified by the - * path in the original CCB. - */ - if (status == CAM_DEV_NOT_THERE) - lun_id = xpt_path_lun_id(ccb->ccb_h.path); - else - lun_id = CAM_LUN_WILDCARD; - - /* Should we do more if we can't create the path?? */ - if (xpt_create_path(&newpath, periph, - xpt_path_path_id(ccb->ccb_h.path), - xpt_path_target_id(ccb->ccb_h.path), - lun_id) != CAM_REQ_CMP) - break; - - /* - * Let peripheral drivers know that this device has gone - * away. - */ - xpt_async(AC_LOST_DEVICE, newpath, NULL); - xpt_free_path(newpath); + print = 0; + lost_device = 1; break; - } case CAM_REQ_INVALID: case CAM_PATH_INVALID: case CAM_NO_HBA: @@ -1917,27 +1646,16 @@ cam_periph_error(union ccb *ccb, cam_fla * these events and should be unconditionally * retried. */ - if (bootverbose && printed == 0) { - xpt_print_path(ccb->ccb_h.path); - if (status == CAM_BDR_SENT) - printf("Bus Device Reset sent\n"); - else - printf("Bus Reset issued\n"); - printed++; - } - /* FALLTHROUGH */ case CAM_REQUEUE_REQ: - /* Unconditional requeue */ - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "Request requeued\n"); - printed++; - } - if ((periph->flags & CAM_PERIPH_INVALID) == 0) - error = ERESTART; - else { - action_string = "Retries exhausted"; + /* Unconditional requeue if device is still there */ + if (periph->flags & CAM_PERIPH_INVALID) { + action_string = "Periph was invalidated"; error = EIO; - } + } else if (sense_flags & SF_NO_RETRY) { + error = EIO; + action_string = "Retry was blocked"; + } else + error = ERESTART; break; case CAM_RESRC_UNAVAIL: /* Wait a bit for the resource shortage to abate. */ @@ -1950,30 +1668,37 @@ cam_periph_error(union ccb *ccb, cam_fla } relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT; /* FALLTHROUGH */ + case CAM_ATA_STATUS_ERROR: + case CAM_REQ_CMP_ERR: + case CAM_CMD_TIMEOUT: + case CAM_UNEXP_BUSFREE: + case CAM_UNCOR_PARITY: + case CAM_DATA_RUN_ERR: default: - /* decrement the number of retries */ - if (ccb->ccb_h.retry_count > 0 && - (periph->flags & CAM_PERIPH_INVALID) == 0) { - ccb->ccb_h.retry_count--; - error = ERESTART; - if (bootverbose && printed == 0) { - xpt_print(ccb->ccb_h.path, "CAM status 0x%x\n", - status); - printed++; - } - } else { + if (periph->flags & CAM_PERIPH_INVALID) { + error = EIO; + action_string = "Periph was invalidated"; + } else if (ccb->ccb_h.retry_count == 0) { error = EIO; action_string = "Retries exhausted"; + } else if (sense_flags & SF_NO_RETRY) { + error = EIO; + action_string = "Retry was blocked"; + } else { + ccb->ccb_h.retry_count--; + error = ERESTART; } break; } - /* - * If we have and error and are booting verbosely, whine - * *unless* this was a non-retryable selection timeout. - */ - if (error != 0 && bootverbose && - !(status == CAM_SEL_TIMEOUT && (camflags & CAM_RETRY_SELTO) == 0)) { + if ((sense_flags & SF_PRINT_ALWAYS) || + CAM_DEBUGGED(ccb->ccb_h.path, CAM_DEBUG_INFO)) + print = 1; + else if (sense_flags & SF_NO_PRINT) + print = 0; + if (print) + cam_error_print(orig_ccb, CAM_ESF_ALL, CAM_EPF_ALL); + if (error != 0 && print) { if (error != ERESTART) { if (action_string == NULL) action_string = "Unretryable error"; @@ -1985,6 +1710,36 @@ cam_periph_error(union ccb *ccb, cam_fla xpt_print(ccb->ccb_h.path, "Retrying command\n"); } + if (lost_device) { + struct cam_path *newpath; + lun_id_t lun_id; + + /* + * For a selection timeout, we consider all of the LUNs on + * the target to be gone. If the status is CAM_DEV_NOT_THERE, + * then we only get rid of the device(s) specified by the + * path in the original CCB. + */ + if (status == CAM_DEV_NOT_THERE) + lun_id = xpt_path_lun_id(ccb->ccb_h.path); + else + lun_id = CAM_LUN_WILDCARD; + + /* Should we do more if we can't create the path?? */ + if (xpt_create_path(&newpath, periph, + xpt_path_path_id(ccb->ccb_h.path), + xpt_path_target_id(ccb->ccb_h.path), + lun_id) == CAM_REQ_CMP) { + + /* + * Let peripheral drivers know that this + * device has gone away. + */ + xpt_async(AC_LOST_DEVICE, newpath, NULL); + xpt_free_path(newpath); + } + } + /* Attempt a retry */ if (error == ERESTART || error == 0) { if (frozen != 0) Modified: stable/9/sys/cam/cam_periph.h ============================================================================== --- stable/9/sys/cam/cam_periph.h Wed Jun 20 16:24:02 2012 (r237326) +++ stable/9/sys/cam/cam_periph.h Wed Jun 20 16:51:14 2012 (r237327) @@ -118,7 +118,6 @@ struct cam_periph { #define CAM_PERIPH_INVALID 0x08 #define CAM_PERIPH_NEW_DEV_FOUND 0x10 #define CAM_PERIPH_RECOVERY_INPROG 0x20 -#define CAM_PERIPH_SENSE_INPROG 0x40 #define CAM_PERIPH_FREE 0x80 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 21:28:17 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FC9F106566B; Wed, 20 Jun 2012 21:28:17 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89A3F8FC1B; Wed, 20 Jun 2012 21:28: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 q5KLSHdt068753; Wed, 20 Jun 2012 21:28:17 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KLSHUU068751; Wed, 20 Jun 2012 21:28:17 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <201206202128.q5KLSHUU068751@svn.freebsd.org> From: Robert Noland Date: Wed, 20 Jun 2012 21:28: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: r237340 - stable/8/sys/dev/wbwd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 21:28:17 -0000 Author: rnoland Date: Wed Jun 20 21:28:17 2012 New Revision: 237340 URL: http://svn.freebsd.org/changeset/base/237340 Log: MFC r236245 Fix a typo in wbwd so that CRF5 is actually written to the data register rather than the index register. Modified: stable/8/sys/dev/wbwd/wbwd.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/wbwd/wbwd.c ============================================================================== --- stable/8/sys/dev/wbwd/wbwd.c Wed Jun 20 21:10:38 2012 (r237339) +++ stable/8/sys/dev/wbwd/wbwd.c Wed Jun 20 21:28:17 2012 (r237340) @@ -638,7 +638,7 @@ wb_attach(device_t dev) */ sc->reg_1 &= ~(WB_LDN8_CRF5_KEYB_P20); write_efir_1(sc, WB_LDN8_CRF5); - write_efir_1(sc, sc->reg_1); + write_efdr_1(sc, sc->reg_1); sc->reg_2 &= ~WB_LDN8_CRF7_CLEAR_MASK; write_efir_1(sc, WB_LDN8_CRF7); From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 21:29:20 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2056E106566B; Wed, 20 Jun 2012 21:29:20 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A0E58FC1B; Wed, 20 Jun 2012 21:29: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 q5KLTJUn068839; Wed, 20 Jun 2012 21:29:19 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KLTJE7068837; Wed, 20 Jun 2012 21:29:19 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <201206202129.q5KLTJE7068837@svn.freebsd.org> From: Robert Noland Date: Wed, 20 Jun 2012 21:29: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: r237341 - stable/8/sys/dev/wbwd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 21:29:20 -0000 Author: rnoland Date: Wed Jun 20 21:29:19 2012 New Revision: 237341 URL: http://svn.freebsd.org/changeset/base/237341 Log: MFC r236246 Add device ids for the Winbond 83627DHG-P chip and set the registers to trigger the keyboard reset line on timeout. Modified: stable/8/sys/dev/wbwd/wbwd.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/wbwd/wbwd.c ============================================================================== --- stable/8/sys/dev/wbwd/wbwd.c Wed Jun 20 21:28:17 2012 (r237340) +++ stable/8/sys/dev/wbwd/wbwd.c Wed Jun 20 21:29:19 2012 (r237341) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #define WB_LDN8_CRF5 0xF5 #define WB_LDN8_CRF5_SCALE 0x08 /* 0: 1s, 1: 60s */ #define WB_LDN8_CRF5_KEYB_P20 0x04 /* 1: keyb P20 forces timeout */ +#define WB_LDN8_CRF5_KBRST 0x02 /* 1: timeout causes pin60 kbd reset */ /* CRF6: Watchdog Timeout (0 == off). Mapped to reg_timeout. */ #define WB_LDN8_CRF6 0xF6 @@ -180,6 +181,12 @@ struct winbond_vendor_device_id { .device_rev = 0x25, .descr = "Winbond 83627DHG IC ver. 5", }, + { + .vendor_id = 0x5ca3, + .device_id = 0xb0, + .device_rev = 0x73, + .descr = "Winbond 83627DHG-P", + }, }; /* @@ -637,6 +644,7 @@ wb_attach(device_t dev) * Disable all all interrupt reset sources (defaults). */ sc->reg_1 &= ~(WB_LDN8_CRF5_KEYB_P20); + sc->reg_1 |= WB_LDN8_CRF5_KBRST; write_efir_1(sc, WB_LDN8_CRF5); write_efdr_1(sc, sc->reg_1); From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 21:32:54 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8CF6106564A; Wed, 20 Jun 2012 21:32:54 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B28528FC08; Wed, 20 Jun 2012 21:32: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 q5KLWsCH069038; Wed, 20 Jun 2012 21:32:54 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KLWswd069036; Wed, 20 Jun 2012 21:32:54 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <201206202132.q5KLWswd069036@svn.freebsd.org> From: Robert Noland Date: Wed, 20 Jun 2012 21:32: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: r237342 - stable/9/sys/dev/wbwd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 21:32:54 -0000 Author: rnoland Date: Wed Jun 20 21:32:54 2012 New Revision: 237342 URL: http://svn.freebsd.org/changeset/base/237342 Log: MFC r236245 Fix a typo in wbwd so that CRF5 is actually written to the data register rather than the index register. Modified: stable/9/sys/dev/wbwd/wbwd.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/wbwd/wbwd.c ============================================================================== --- stable/9/sys/dev/wbwd/wbwd.c Wed Jun 20 21:29:19 2012 (r237341) +++ stable/9/sys/dev/wbwd/wbwd.c Wed Jun 20 21:32:54 2012 (r237342) @@ -638,7 +638,7 @@ wb_attach(device_t dev) */ sc->reg_1 &= ~(WB_LDN8_CRF5_KEYB_P20); write_efir_1(sc, WB_LDN8_CRF5); - write_efir_1(sc, sc->reg_1); + write_efdr_1(sc, sc->reg_1); sc->reg_2 &= ~WB_LDN8_CRF7_CLEAR_MASK; write_efir_1(sc, WB_LDN8_CRF7); From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 21:34:04 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10948106566B; Wed, 20 Jun 2012 21:34:04 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5F9A8FC17; Wed, 20 Jun 2012 21:34: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 q5KLY39f069140; Wed, 20 Jun 2012 21:34:03 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KLY3NE069137; Wed, 20 Jun 2012 21:34:03 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <201206202134.q5KLY3NE069137@svn.freebsd.org> From: Robert Noland Date: Wed, 20 Jun 2012 21:34: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: r237343 - stable/9/sys/dev/wbwd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 21:34:04 -0000 Author: rnoland Date: Wed Jun 20 21:34:03 2012 New Revision: 237343 URL: http://svn.freebsd.org/changeset/base/237343 Log: MFC r236246 Add device ids for the Winbond 83627DHG-P chip and set the registers to trigger the keyboard reset line on timeout. Modified: stable/9/sys/dev/wbwd/wbwd.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/wbwd/wbwd.c ============================================================================== --- stable/9/sys/dev/wbwd/wbwd.c Wed Jun 20 21:32:54 2012 (r237342) +++ stable/9/sys/dev/wbwd/wbwd.c Wed Jun 20 21:34:03 2012 (r237343) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #define WB_LDN8_CRF5 0xF5 #define WB_LDN8_CRF5_SCALE 0x08 /* 0: 1s, 1: 60s */ #define WB_LDN8_CRF5_KEYB_P20 0x04 /* 1: keyb P20 forces timeout */ +#define WB_LDN8_CRF5_KBRST 0x02 /* 1: timeout causes pin60 kbd reset */ /* CRF6: Watchdog Timeout (0 == off). Mapped to reg_timeout. */ #define WB_LDN8_CRF6 0xF6 @@ -180,6 +181,12 @@ struct winbond_vendor_device_id { .device_rev = 0x25, .descr = "Winbond 83627DHG IC ver. 5", }, + { + .vendor_id = 0x5ca3, + .device_id = 0xb0, + .device_rev = 0x73, + .descr = "Winbond 83627DHG-P", + }, }; /* @@ -637,6 +644,7 @@ wb_attach(device_t dev) * Disable all all interrupt reset sources (defaults). */ sc->reg_1 &= ~(WB_LDN8_CRF5_KEYB_P20); + sc->reg_1 |= WB_LDN8_CRF5_KBRST; write_efir_1(sc, WB_LDN8_CRF5); write_efdr_1(sc, sc->reg_1); From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 22:21:02 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4623106566B; Wed, 20 Jun 2012 22:21:02 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6E5F8FC12; Wed, 20 Jun 2012 22:21: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 q5KML21r071230; Wed, 20 Jun 2012 22:21:02 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KML2Vv071228; Wed, 20 Jun 2012 22:21:02 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201206202221.q5KML2Vv071228@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 20 Jun 2012 22:21:02 +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: r237345 - stable/9/usr.bin/find X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 22:21:02 -0000 Author: jilles Date: Wed Jun 20 22:21:02 2012 New Revision: 237345 URL: http://svn.freebsd.org/changeset/base/237345 Log: MFC r236860,r237035: find(1): Extend and move description of -d option to -depth primary. The nullary -depth primary is standard and the -d option provides little advantage. Commit r236860 originally by issyl0. PR: docs/168885 Modified: stable/9/usr.bin/find/find.1 Directory Properties: stable/9/usr.bin/find/ (props changed) Modified: stable/9/usr.bin/find/find.1 ============================================================================== --- stable/9/usr.bin/find/find.1 Wed Jun 20 21:38:16 2012 (r237344) +++ stable/9/usr.bin/find/find.1 Wed Jun 20 22:21:02 2012 (r237345) @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd March 17, 2010 +.Dd June 13, 2012 .Dt FIND 1 .Os .Sh NAME @@ -126,36 +126,15 @@ as an effective alternative. .It Fl d Cause .Nm -to perform a depth-first traversal, i.e., directories -are visited in post-order and all entries in a directory will be acted -on before the directory itself. -By default, -.Nm -visits directories in pre-order, i.e., before their contents. -Note, the default is -.Em not -a breadth-first traversal. +to perform a depth-first traversal. .Pp -This option is equivalent to the +This option is a BSD-specific equivalent of the .Ic -depth -primary of +primary specified by .St -p1003.1-2001 . -The -.Fl d -option -can be useful when -.Nm -is used with -.Xr cpio 1 -to process files that are contained in directories with unusual permissions. -It ensures that you have write permission while you are placing files in a -directory, then sets the directory's permissions as the last thing. -.It Fl f -Specify a file hierarchy for -.Nm -to traverse. -File hierarchies may also be specified as the operands immediately -following the options. +Refer to its description under +.Sx PRIMARIES +for more information. .It Fl s Cause .Nm @@ -302,7 +281,7 @@ Please refer to the .Ic -atime primary description for information on supported time units. .It Ic -d -Same as +Non-portable, BSD-specific version of .Ic depth . GNU find implements this as a primary in mistaken emulation of .Fx @@ -323,9 +302,31 @@ Depth-first traversal processing is impl Following symlinks is incompatible with this option. .It Ic -depth Always true; -same as the +same as the non-portable .Fl d option. +Cause +.Nm +to perform a depth-first traversal, i.e., directories +are visited in post-order and all entries in a directory will be acted +on before the directory itself. +By default, +.Nm +visits directories in pre-order, i.e., before their contents. +Note, the default is +.Em not +a breadth-first traversal. +.Pp +The +.Ic -depth +primary +can be useful when +.Nm +is used with +.Xr cpio 1 +to process files that are contained in directories with unusual permissions. +It ensures that you have write permission while you are placing files in a +directory, then sets the directory's permissions as the last thing. .It Ic -depth Ar n True if the depth of the file relative to the starting point of the traversal is From owner-svn-src-stable@FreeBSD.ORG Wed Jun 20 23:47:49 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70E79106566B; Wed, 20 Jun 2012 23:47: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 579DA8FC12; Wed, 20 Jun 2012 23:47: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 q5KNlnRd074845; Wed, 20 Jun 2012 23:47:49 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KNln28074825; Wed, 20 Jun 2012 23:47:49 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206202347.q5KNln28074825@svn.freebsd.org> From: Warren Block Date: Wed, 20 Jun 2012 23:47:48 +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: r237347 - in stable/8: lib/libpam/modules/pam_exec sbin/atacontrol sbin/geom/class/part sbin/geom/class/raid sbin/geom/class/virstor sbin/gvinum sbin/hastctl sbin/hastd sbin/mount sbin/... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 23:47:49 -0000 Author: wblock (doc committer) Date: Wed Jun 20 23:47:48 2012 New Revision: 237347 URL: http://svn.freebsd.org/changeset/base/237347 Log: MFC r235873: Fixes to man8 groff mandoc style, usage mistakes, or typos. Includes a partial MFC of r233648 for sbin/gvinum/gvinum.8. PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb (mentor) Modified: stable/8/lib/libpam/modules/pam_exec/pam_exec.8 stable/8/sbin/atacontrol/atacontrol.8 stable/8/sbin/geom/class/part/gpart.8 stable/8/sbin/geom/class/raid/graid.8 stable/8/sbin/geom/class/virstor/gvirstor.8 stable/8/sbin/gvinum/gvinum.8 stable/8/sbin/hastctl/hastctl.8 stable/8/sbin/hastd/hastd.8 stable/8/sbin/mount/mount.8 stable/8/sbin/natd/natd.8 stable/8/share/man/man8/picobsd.8 stable/8/share/man/man8/rc.8 stable/8/usr.sbin/cpucontrol/cpucontrol.8 stable/8/usr.sbin/freebsd-update/freebsd-update.8 stable/8/usr.sbin/i2c/i2c.8 stable/8/usr.sbin/rtadvctl/rtadvctl.8 stable/8/usr.sbin/rtadvd/rtadvd.8 stable/8/usr.sbin/smbmsg/smbmsg.8 stable/8/usr.sbin/wpa/ndis_events/ndis_events.8 Directory Properties: stable/8/lib/libpam/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/raid/ (props changed) stable/8/sbin/geom/class/virstor/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/rtadvctl/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/wpa/ (props changed) Modified: stable/8/lib/libpam/modules/pam_exec/pam_exec.8 ============================================================================== --- stable/8/lib/libpam/modules/pam_exec/pam_exec.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/lib/libpam/modules/pam_exec/pam_exec.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -131,10 +131,10 @@ This is useful in shell scripts for inst .Xr pam 8 , .Xr pam_sm_acct_mgmt 8 , .Xr pam_sm_authenticate 8 , -.Xr pam_sm_chauthtok 8, +.Xr pam_sm_chauthtok 8 , .Xr pam_sm_close_session 8 , .Xr pam_sm_open_session 8 , -.Xr pam_sm_setcred 8 . +.Xr pam_sm_setcred 8 .Sh AUTHORS The .Nm Modified: stable/8/sbin/atacontrol/atacontrol.8 ============================================================================== --- stable/8/sbin/atacontrol/atacontrol.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/atacontrol/atacontrol.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -367,8 +367,8 @@ You should not set a spindown timeout on or syslog logging on it as the disk will be worn out spinning down and up all the time. .Sh SEE ALSO -.Xr ata 4 -.Xr cam 4 +.Xr ata 4 , +.Xr cam 4 , .Xr camcontrol 8 .Sh HISTORY The Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/geom/class/part/gpart.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -650,7 +650,7 @@ for MBR, for GPT. .It Cm ms-ldm-metadata A partition that contains Logical Disk Manager (LDM) database. -The scheme-specifig type is +The scheme-specific type is .Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3" for GPT. .El @@ -971,7 +971,7 @@ By default mirrored volumes are shown as .Sx "PARTITION TYPES" section). If this variable set to 1 each component of the mirrored volume will be -present as independet partition. +present as independent partition. .Em NOTE : This may break a mirrored volume and lead to data damage. .El Modified: stable/8/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/8/sbin/geom/class/raid/graid.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/geom/class/raid/graid.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -294,7 +294,7 @@ Debug level of the .Nm RAID GEOM class. .It Va kern.geom.raid.idle_threshold : No 1000000 -Time in microseconds to consider a volume idle for rebuild puroses. +Time in microseconds to consider a volume idle for rebuild purposes. .It Va kern.geom.raid.name_format : No 0 Providers name format: 0 -- raid/r{num}, 1 -- raid/{label}. .It Va kern.geom.raid.read_err_thresh : No 10 Modified: stable/8/sbin/geom/class/virstor/gvirstor.8 ============================================================================== --- stable/8/sbin/geom/class/virstor/gvirstor.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/geom/class/virstor/gvirstor.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -109,7 +109,7 @@ Adds new components to existing virtual The specified virstor device must exist and be active .Pq i.e. module loaded, device present in Pa /dev . This action can be safely performed while the virstor device is in use -.Pq Qo hot Qc operation +.Pq Qo hot Qc operation . .It Cm remove Removes components from existing virtual device with the given .Ar name . @@ -264,7 +264,8 @@ change once it is set, and that the size components will always remain constant during their existence. For alternative ways to implement virtual or resizable file systems see .Xr zfs 1M , -.Xr gconcat 8 and +.Xr gconcat 8 +and .Xr growfs 8 . .Pp Note that Modified: stable/8/sbin/gvinum/gvinum.8 ============================================================================== --- stable/8/sbin/gvinum/gvinum.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/gvinum/gvinum.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -42,7 +42,7 @@ .Bl -tag -width indent .It Ic attach Ar plex volume Op Cm rename .It Ic attach Ar subdisk plex Oo Ar offset Oc Op Cm rename -Attach a plex to a volume, or a subdisk to a plex. +Attach a plex to a volume, or a subdisk to a plex. If offset is specified, the subdisk will be attached to the given offset within the plex. If rename is specified, the subdisk or plex will change name according to the @@ -58,7 +58,8 @@ All subdisks in the plex must be up for a parity check. .It Ic concat Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives Create a concatenated volume from the specified drives. -If no name is specified, a unique name will be set by gvinum. +If no name is specified, a unique name will be set by +.Ic gvinum . .It Ic create Oo Fl f Oc Op Ar description-file Create a volume as described in .Ar description-file . @@ -103,10 +104,10 @@ and .Fl V flags provide progressively more detailed output. .It Ic mirror Oo Fl fsv Oc Oo Fl n Ar name Oc Ar drives -Create a mirrored volume from the specified drives. +Create a mirrored volume from the specified drives. It requires at least a multiple of 2 drives. If no name is specified, a unique name will be set by gvinum. -If the +If the .Fl s flag is specified, a striped mirror will be created, and thus requires a multiple of 4 drives. @@ -148,8 +149,8 @@ Normally this would be done by entering EOF character. .It Ic raid5 Oo Fl fv Oc Oo Fl s Ar stripesize Oc Oo Fl n Ar name Oc Ar drives Create a RAID-5 volume from the specified drives. -If no name is specified,a unique name will be set by -.Ic gvinum. +If no name is specified, a unique name will be set by +.Ic gvinum . This organization requires at least three drives. .It Ic rename Oo Fl r Oc Ar drive | subdisk | plex | volume newname Change the name of the specified object. @@ -202,8 +203,9 @@ Terminate access to the objects, or stop if no parameters are specified. .It Ic stripe Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives Create a striped volume from the specified drives. If no name is specified, -a unique name will be set by Ic gvinum. This organization requires at least two -drives. +a unique name will be set by +.Ic gvinum . +This organization requires at least two drives. .El .Sh DESCRIPTION The @@ -278,11 +280,12 @@ objects .El .Sh EXAMPLES To create a mirror on disks /dev/ad1 and /dev/ad2, create a filesystem, mount, -unmount and then stop Ic gvinum: +unmount and then stop +.Ic gvinum : .Pp .Dl "gvinum mirror /dev/ad1 /dev/ad2" .Dl "newfs /dev/gvinum/gvinumvolume0" -.Dl "mount /dev/gvinum/gvinumvolume0 /mnt" +.Dl "mount /dev/gvinum/gvinumvolume0 /mnt" .Dl "..." .Dl "unmount /mnt" .Dl "gvinum stop" Modified: stable/8/sbin/hastctl/hastctl.8 ============================================================================== --- stable/8/sbin/hastctl/hastctl.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/hastctl/hastctl.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -211,7 +211,7 @@ nodeB# application_start .Xr ggatel 8 , .Xr hastd 8 , .Xr mount 8 , -.Xr newfs 8 . +.Xr newfs 8 .Sh AUTHORS The .Nm Modified: stable/8/sbin/hastd/hastd.8 ============================================================================== --- stable/8/sbin/hastd/hastd.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/hastd/hastd.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -223,7 +223,7 @@ nodeA# mount -o noatime /dev/hast/shared .Xr hastctl 8 , .Xr mount 8 , .Xr newfs 8 , -.Xr g_bio 9 . +.Xr g_bio 9 .Sh AUTHORS The .Nm Modified: stable/8/sbin/mount/mount.8 ============================================================================== --- stable/8/sbin/mount/mount.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/mount/mount.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -448,7 +448,7 @@ However, for the following file system t .Cm smbfs , .Cm udf , and -.Cm unionfs , +.Cm unionfs . .Nm will not call .Xr nmount 2 Modified: stable/8/sbin/natd/natd.8 ============================================================================== --- stable/8/sbin/natd/natd.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/natd/natd.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -787,7 +787,7 @@ ipfw add allow ip from any to any .Pp Here the packet from internal network to Internet goes out via .Ql sis0 -(rule number 2000) and gets catched by the +(rule number 2000) and gets caught by the .Ic globalport socket (3000). After that, either a match is found in a translation table Modified: stable/8/share/man/man8/picobsd.8 ============================================================================== --- stable/8/share/man/man8/picobsd.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/share/man/man8/picobsd.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -54,7 +54,7 @@ The most important options for common op .Fl src , .Fl init , .Fl n and -.Fl v. +.Fl v . .Pp .Bl -tag -width indent .\" @@ -95,7 +95,10 @@ subtree as necessary to subsequently bui images. .\" .It Fl -iso -Generate an ISO image, picobsd.iso, in addition to the disk image picobsd.bin +Generate an ISO image, +.Pa picobsd.iso , +in addition to the disk image +.Pa picobsd.bin . .\" .It Fl -modules Also build kernel modules. Modified: stable/8/share/man/man8/rc.8 ============================================================================== --- stable/8/share/man/man8/rc.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/share/man/man8/rc.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -253,7 +253,7 @@ The boot does not stop if such a script but a script can stop the boot if necessary by invoking the .Fn stop_boot function (from -.Xr rc.subr 8 ). +.Xr rc.subr 8 ) . .El .Pp Each script should contain Modified: stable/8/usr.sbin/cpucontrol/cpucontrol.8 ============================================================================== --- stable/8/usr.sbin/cpucontrol/cpucontrol.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/cpucontrol/cpucontrol.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -31,7 +31,7 @@ .Nm cpucontrol .Nd control utility for the .Xr cpuctl 4 -device. +device .Sh SYNOPSIS .Nm .Op Fl vh Modified: stable/8/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- stable/8/usr.sbin/freebsd-update/freebsd-update.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/freebsd-update/freebsd-update.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -62,7 +62,7 @@ Release Engineering Team, e.g., .Fx 9.0-CURRENT. .Sh OPTIONS -The following options are supported +The following options are supported: .Bl -tag -width "-f conffile" .It Fl b Ar basedir Operate on a system mounted at Modified: stable/8/usr.sbin/i2c/i2c.8 ============================================================================== --- stable/8/usr.sbin/i2c/i2c.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/i2c/i2c.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -88,7 +88,7 @@ reset the controller. .It Fl s scan the bus for devices. .It Fl v -be verbose +be verbose. .It Fl w Ar 0|8|16 device addressing width (in bits). .El Modified: stable/8/usr.sbin/rtadvctl/rtadvctl.8 ============================================================================== --- stable/8/usr.sbin/rtadvctl/rtadvctl.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/rtadvctl/rtadvctl.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -31,7 +31,8 @@ .Sh NAME .Nm rtadvctl .Nd control program for -.Xr rtadvd 8 daemon +.Xr rtadvd 8 +daemon .Sh SYNOPSIS .Nm .Op Fl v Modified: stable/8/usr.sbin/rtadvd/rtadvd.8 ============================================================================== --- stable/8/usr.sbin/rtadvd/rtadvd.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/rtadvd/rtadvd.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -140,7 +140,7 @@ option, which enables routing renumberin .It Fl p Specify an alternative file in which to store the process ID. The default is -.Pa /var/run/rtadvd.pid. +.Pa /var/run/rtadvd.pid . .It Fl R Accept router renumbering requests. If you enable it, certain IPsec setup is suggested for security reasons. Modified: stable/8/usr.sbin/smbmsg/smbmsg.8 ============================================================================== --- stable/8/usr.sbin/smbmsg/smbmsg.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/smbmsg/smbmsg.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -70,7 +70,7 @@ and writeable, respectively. The only valid additional option for this modus of operation (besides the .Fl p -option that choses the modus) is +option that chooses the modus) is .Fl f Ar dev . See below for a description. .Pp Modified: stable/8/usr.sbin/wpa/ndis_events/ndis_events.8 ============================================================================== --- stable/8/usr.sbin/wpa/ndis_events/ndis_events.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/wpa/ndis_events/ndis_events.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -71,7 +71,7 @@ When it detects an event that was genera interface, it transmits it via UDP packet on the loopback interface, where .Xr wpa_supplicant 8 -is presumeably listening. +is presumably listening. The standard .Xr wpa_supplicant 8 distribution includes its own version of this utility for use with From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 02:48:50 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7808F1065670; Thu, 21 Jun 2012 02:48:50 +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 57E478FC12; Thu, 21 Jun 2012 02:48: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 q5L2mon5083693; Thu, 21 Jun 2012 02:48:50 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L2moL8083684; Thu, 21 Jun 2012 02:48:50 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206210248.q5L2moL8083684@svn.freebsd.org> From: Warren Block Date: Thu, 21 Jun 2012 02:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237349 - in stable/7: sbin/mount sbin/natd share/man/man8 usr.sbin/cpucontrol usr.sbin/freebsd-update usr.sbin/rtadvd usr.sbin/smbmsg usr.sbin/wpa/ndis_events X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 02:48:50 -0000 Author: wblock (doc committer) Date: Thu Jun 21 02:48:49 2012 New Revision: 237349 URL: http://svn.freebsd.org/changeset/base/237349 Log: MFC r235873: Fixes to man8 groff mandoc style, usage mistakes, or typos. PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb (mentor) Modified: stable/7/sbin/mount/mount.8 stable/7/sbin/natd/natd.8 stable/7/share/man/man8/rc.8 stable/7/usr.sbin/cpucontrol/cpucontrol.8 stable/7/usr.sbin/freebsd-update/freebsd-update.8 stable/7/usr.sbin/rtadvd/rtadvd.8 stable/7/usr.sbin/smbmsg/smbmsg.8 stable/7/usr.sbin/wpa/ndis_events/ndis_events.8 Directory Properties: stable/7/sbin/mount/ (props changed) stable/7/sbin/natd/ (props changed) stable/7/share/man/man8/ (props changed) stable/7/usr.sbin/cpucontrol/ (props changed) stable/7/usr.sbin/freebsd-update/ (props changed) stable/7/usr.sbin/rtadvd/ (props changed) stable/7/usr.sbin/smbmsg/ (props changed) stable/7/usr.sbin/wpa/ (props changed) Modified: stable/7/sbin/mount/mount.8 ============================================================================== --- stable/7/sbin/mount/mount.8 Wed Jun 20 23:53:36 2012 (r237348) +++ stable/7/sbin/mount/mount.8 Thu Jun 21 02:48:49 2012 (r237349) @@ -436,7 +436,7 @@ However, for the following file system t .Cm smbfs , .Cm udf , and -.Cm unionfs , +.Cm unionfs . .Nm will not call .Xr nmount 2 Modified: stable/7/sbin/natd/natd.8 ============================================================================== --- stable/7/sbin/natd/natd.8 Wed Jun 20 23:53:36 2012 (r237348) +++ stable/7/sbin/natd/natd.8 Thu Jun 21 02:48:49 2012 (r237349) @@ -782,7 +782,7 @@ ipfw add allow ip from any to any .Pp Here the packet from internal network to Internet goes out via .Ql sis0 -(rule number 2000) and gets catched by the +(rule number 2000) and gets caught by the .Ic globalport socket (3000). After that, either a match is found in a translation table Modified: stable/7/share/man/man8/rc.8 ============================================================================== --- stable/7/share/man/man8/rc.8 Wed Jun 20 23:53:36 2012 (r237348) +++ stable/7/share/man/man8/rc.8 Thu Jun 21 02:48:49 2012 (r237349) @@ -253,7 +253,7 @@ The boot does not stop if such a script but a script can stop the boot if necessary by invoking the .Fn stop_boot function (from -.Xr rc.subr 8 ). +.Xr rc.subr 8 ) . .El .Pp Each script should contain Modified: stable/7/usr.sbin/cpucontrol/cpucontrol.8 ============================================================================== --- stable/7/usr.sbin/cpucontrol/cpucontrol.8 Wed Jun 20 23:53:36 2012 (r237348) +++ stable/7/usr.sbin/cpucontrol/cpucontrol.8 Thu Jun 21 02:48:49 2012 (r237349) @@ -31,7 +31,7 @@ .Nm cpucontrol .Nd control utility for the .Xr cpuctl 4 -device. +device .Sh SYNOPSIS .Nm .Op Fl vh Modified: stable/7/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- stable/7/usr.sbin/freebsd-update/freebsd-update.8 Wed Jun 20 23:53:36 2012 (r237348) +++ stable/7/usr.sbin/freebsd-update/freebsd-update.8 Thu Jun 21 02:48:49 2012 (r237349) @@ -62,7 +62,7 @@ Release Engineering Team, e.g., .Fx 7.0-CURRENT. .Sh OPTIONS -The following options are supported +The following options are supported: .Bl -tag -width "-f conffile" .It Fl b Ar basedir Operate on a system mounted at Modified: stable/7/usr.sbin/rtadvd/rtadvd.8 ============================================================================== --- stable/7/usr.sbin/rtadvd/rtadvd.8 Wed Jun 20 23:53:36 2012 (r237348) +++ stable/7/usr.sbin/rtadvd/rtadvd.8 Thu Jun 21 02:48:49 2012 (r237349) @@ -147,7 +147,7 @@ option, which enables routing renumberin .It Fl p Specify an alternative file in which to store the process ID. The default is -.Pa /var/run/rtadvd.pid. +.Pa /var/run/rtadvd.pid . .It Fl R Accept router renumbering requests. If you enable it, certain IPsec setup is suggested for security reasons. Modified: stable/7/usr.sbin/smbmsg/smbmsg.8 ============================================================================== --- stable/7/usr.sbin/smbmsg/smbmsg.8 Wed Jun 20 23:53:36 2012 (r237348) +++ stable/7/usr.sbin/smbmsg/smbmsg.8 Thu Jun 21 02:48:49 2012 (r237349) @@ -71,7 +71,7 @@ and writeable, respectively. The only valid additional option for this modus of operation (besides the .Fl p -option that choses the modus) is +option that chooses the modus) is .Fl f Ar dev . See below for a description. .Pp Modified: stable/7/usr.sbin/wpa/ndis_events/ndis_events.8 ============================================================================== --- stable/7/usr.sbin/wpa/ndis_events/ndis_events.8 Wed Jun 20 23:53:36 2012 (r237348) +++ stable/7/usr.sbin/wpa/ndis_events/ndis_events.8 Thu Jun 21 02:48:49 2012 (r237349) @@ -71,7 +71,7 @@ When it detects an event that was genera interface, it transmits it via UDP packet on the loopback interface, where .Xr wpa_supplicant 8 -is presumeably listening. +is presumably listening. The standard .Xr wpa_supplicant 8 distribution includes its own version of this utility for use with From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 03:58:11 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 381C61065670; Thu, 21 Jun 2012 03:58:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08A708FC08; Thu, 21 Jun 2012 03:58: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 q5L3wAaY087036; Thu, 21 Jun 2012 03:58:10 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L3wAmn087034; Thu, 21 Jun 2012 03:58:10 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201206210358.q5L3wAmn087034@svn.freebsd.org> From: Kirk McKusick Date: Thu, 21 Jun 2012 03:58:10 +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: r237351 - stable/9/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 03:58:11 -0000 Author: mckusick Date: Thu Jun 21 03:58:10 2012 New Revision: 237351 URL: http://svn.freebsd.org/changeset/base/237351 Log: MFC of 236825 When synchronously syncing a device (MNT_WAIT), wait for buffers to become available. Otherwise we may excessively spin and fail with ``fsync: giving up on dirty''. Reviewed by: kib Tested by: Peter Holm Modified: stable/9/sys/kern/vfs_default.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/vfs_default.c ============================================================================== --- stable/9/sys/kern/vfs_default.c Thu Jun 21 03:10:48 2012 (r237350) +++ stable/9/sys/kern/vfs_default.c Thu Jun 21 03:58:10 2012 (r237351) @@ -646,8 +646,17 @@ loop2: if ((bp->b_vflags & BV_SCANNED) != 0) continue; bp->b_vflags |= BV_SCANNED; - if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) - continue; + if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) { + if (ap->a_waitfor != MNT_WAIT) + continue; + if (BUF_LOCK(bp, + LK_EXCLUSIVE | LK_INTERLOCK | LK_SLEEPFAIL, + BO_MTX(bo)) != 0) { + BO_LOCK(bo); + goto loop1; + } + BO_LOCK(bo); + } BO_UNLOCK(bo); KASSERT(bp->b_bufobj == bo, ("bp %p wrong b_bufobj %p should be %p", From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 04:02:07 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A838A106564A; Thu, 21 Jun 2012 04:02:07 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91D958FC14; Thu, 21 Jun 2012 04:02: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 q5L427rB087285; Thu, 21 Jun 2012 04:02:07 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L427FS087283; Thu, 21 Jun 2012 04:02:07 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201206210402.q5L427FS087283@svn.freebsd.org> From: Kirk McKusick Date: Thu, 21 Jun 2012 04:02:07 +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: r237352 - stable/9/sys/ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 04:02:07 -0000 Author: mckusick Date: Thu Jun 21 04:02:07 2012 New Revision: 237352 URL: http://svn.freebsd.org/changeset/base/237352 Log: MFC of 236937 In softdep_setup_inomapdep() we may have to allocate both inodedep and bmsafemap dependency structures in inodedep_lookup() and bmsafemap_lookup() respectively. The setup of these structures must be done while holding the soft-dependency mutex. If the inodedep is allocated first, it may be freed in the I/O completion callback when the mutex is released to allocate the bmsafemap. If the bmsafemap is allocated first, it may be freed in the I/O completion callback when the mutex is released to allocate the inodedep. To resolve this problem, bmsafemap_lookup has had a parameter added that allows a pre-malloc'ed bmsafemap to be passed in so that it does not need to release the mutex to create a new bmsafemap. The softdep_setup_inomapdep() routine pre-malloc's a bmsafemap dependency before acquiring the mutex and starting to build the inodedep with a call to inodedep_lookup(). The subsequent call to bmsafemap_lookup() is passed this pre-allocated bmsafemap entry so that it need not release the mutex if it needs to create a new one. Reported by: Peter Holm Tested by: Peter Holm Modified: stable/9/sys/ufs/ffs/ffs_softdep.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/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_softdep.c Thu Jun 21 03:58:10 2012 (r237351) +++ stable/9/sys/ufs/ffs/ffs_softdep.c Thu Jun 21 04:02:07 2012 (r237352) @@ -919,7 +919,7 @@ static struct freefrag *allocindir_merge static int bmsafemap_find(struct bmsafemap_hashhead *, struct mount *, int, struct bmsafemap **); static struct bmsafemap *bmsafemap_lookup(struct mount *, struct buf *, - int cg); + int cg, struct bmsafemap *); static int newblk_find(struct newblk_hashhead *, struct mount *, ufs2_daddr_t, int, struct newblk **); static int newblk_lookup(struct mount *, ufs2_daddr_t, int, struct newblk **); @@ -4707,12 +4707,26 @@ softdep_setup_inomapdep(bp, ip, newinum, * Panic if it already exists as something is seriously wrong. * Otherwise add it to the dependency list for the buffer holding * the cylinder group map from which it was allocated. + * + * We have to preallocate a bmsafemap entry in case it is needed + * in bmsafemap_lookup since once we allocate the inodedep, we + * have to finish initializing it before we can FREE_LOCK(). + * By preallocating, we avoid FREE_LOCK() while doing a malloc + * in bmsafemap_lookup. We cannot call bmsafemap_lookup before + * creating the inodedep as it can be freed during the time + * that we FREE_LOCK() while allocating the inodedep. We must + * call workitem_alloc() before entering the locked section as + * it also acquires the lock and we must avoid trying doing so + * recursively. */ + bmsafemap = malloc(sizeof(struct bmsafemap), + M_BMSAFEMAP, M_SOFTDEP_FLAGS); + workitem_alloc(&bmsafemap->sm_list, D_BMSAFEMAP, mp); ACQUIRE_LOCK(&lk); if ((inodedep_lookup(mp, newinum, DEPALLOC | NODELAY, &inodedep))) panic("softdep_setup_inomapdep: dependency %p for new" "inode already exists", inodedep); - bmsafemap = bmsafemap_lookup(mp, bp, ino_to_cg(fs, newinum)); + bmsafemap = bmsafemap_lookup(mp, bp, ino_to_cg(fs, newinum), bmsafemap); if (jaddref) { LIST_INSERT_HEAD(&bmsafemap->sm_jaddrefhd, jaddref, ja_bmdeps); TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref, @@ -4786,7 +4800,7 @@ softdep_setup_blkmapdep(bp, mp, newblkno if (newblk_lookup(mp, newblkno, DEPALLOC, &newblk) != 0) panic("softdep_setup_blkmapdep: found block"); newblk->nb_bmsafemap = bmsafemap = bmsafemap_lookup(mp, bp, - dtog(fs, newblkno)); + dtog(fs, newblkno), NULL); if (jnewblk) { jnewblk->jn_dep = (struct worklist *)newblk; LIST_INSERT_HEAD(&bmsafemap->sm_jnewblkhd, jnewblk, jn_deps); @@ -4827,13 +4841,16 @@ bmsafemap_find(bmsafemaphd, mp, cg, bmsa * Find the bmsafemap associated with a cylinder group buffer. * If none exists, create one. The buffer must be locked when * this routine is called and this routine must be called with - * splbio interrupts blocked. + * the softdep lock held. To avoid giving up the lock while + * allocating a new bmsafemap, a preallocated bmsafemap may be + * provided. If it is provided but not needed, it is freed. */ static struct bmsafemap * -bmsafemap_lookup(mp, bp, cg) +bmsafemap_lookup(mp, bp, cg, newbmsafemap) struct mount *mp; struct buf *bp; int cg; + struct bmsafemap *newbmsafemap; { struct bmsafemap_hashhead *bmsafemaphd; struct bmsafemap *bmsafemap, *collision; @@ -4843,16 +4860,27 @@ bmsafemap_lookup(mp, bp, cg) mtx_assert(&lk, MA_OWNED); if (bp) LIST_FOREACH(wk, &bp->b_dep, wk_list) - if (wk->wk_type == D_BMSAFEMAP) + if (wk->wk_type == D_BMSAFEMAP) { + if (newbmsafemap) + WORKITEM_FREE(newbmsafemap,D_BMSAFEMAP); return (WK_BMSAFEMAP(wk)); + } fs = VFSTOUFS(mp)->um_fs; bmsafemaphd = BMSAFEMAP_HASH(fs, cg); - if (bmsafemap_find(bmsafemaphd, mp, cg, &bmsafemap) == 1) + if (bmsafemap_find(bmsafemaphd, mp, cg, &bmsafemap) == 1) { + if (newbmsafemap) + WORKITEM_FREE(newbmsafemap, D_BMSAFEMAP); return (bmsafemap); - FREE_LOCK(&lk); - bmsafemap = malloc(sizeof(struct bmsafemap), - M_BMSAFEMAP, M_SOFTDEP_FLAGS); - workitem_alloc(&bmsafemap->sm_list, D_BMSAFEMAP, mp); + } + if (newbmsafemap) { + bmsafemap = newbmsafemap; + } else { + FREE_LOCK(&lk); + bmsafemap = malloc(sizeof(struct bmsafemap), + M_BMSAFEMAP, M_SOFTDEP_FLAGS); + workitem_alloc(&bmsafemap->sm_list, D_BMSAFEMAP, mp); + ACQUIRE_LOCK(&lk); + } bmsafemap->sm_buf = bp; LIST_INIT(&bmsafemap->sm_inodedephd); LIST_INIT(&bmsafemap->sm_inodedepwr); @@ -4862,7 +4890,6 @@ bmsafemap_lookup(mp, bp, cg) LIST_INIT(&bmsafemap->sm_jnewblkhd); LIST_INIT(&bmsafemap->sm_freehd); LIST_INIT(&bmsafemap->sm_freewr); - ACQUIRE_LOCK(&lk); if (bmsafemap_find(bmsafemaphd, mp, cg, &collision) == 1) { WORKITEM_FREE(bmsafemap, D_BMSAFEMAP); return (collision); @@ -10221,7 +10248,7 @@ softdep_setup_blkfree(mp, bp, blkno, fra ACQUIRE_LOCK(&lk); /* Lookup the bmsafemap so we track when it is dirty. */ fs = VFSTOUFS(mp)->um_fs; - bmsafemap = bmsafemap_lookup(mp, bp, dtog(fs, blkno)); + bmsafemap = bmsafemap_lookup(mp, bp, dtog(fs, blkno), NULL); /* * Detach any jnewblks which have been canceled. They must linger * until the bitmap is cleared again by ffs_blkfree() to prevent @@ -10267,7 +10294,7 @@ softdep_setup_blkfree(mp, bp, blkno, fra * allocation dependency. */ fs = VFSTOUFS(mp)->um_fs; - bmsafemap = bmsafemap_lookup(mp, bp, dtog(fs, blkno)); + bmsafemap = bmsafemap_lookup(mp, bp, dtog(fs, blkno), NULL); end = blkno + frags; LIST_FOREACH(jnewblk, &bmsafemap->sm_jnewblkhd, jn_deps) { /* From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 08:35:47 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A72E41065672; Thu, 21 Jun 2012 08:35:47 +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 90E708FC1F; Thu, 21 Jun 2012 08:35: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 q5L8ZlR8099226; Thu, 21 Jun 2012 08:35:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L8ZlBS099224; Thu, 21 Jun 2012 08:35:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206210835.q5L8ZlBS099224@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 21 Jun 2012 08:35: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: r237361 - stable/9/lib/libc/gen X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 08:35:47 -0000 Author: kib Date: Thu Jun 21 08:35:47 2012 New Revision: 237361 URL: http://svn.freebsd.org/changeset/base/237361 Log: MFC r237061: Make sure that fstab fd is not leaked on exec. PR: kern/169023 Modified: stable/9/lib/libc/gen/fstab.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/fstab.c ============================================================================== --- stable/9/lib/libc/gen/fstab.c Thu Jun 21 07:48:14 2012 (r237360) +++ stable/9/lib/libc/gen/fstab.c Thu Jun 21 08:35:47 2012 (r237361) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -246,6 +247,8 @@ getfsfile(name) int setfsent() { + int fd; + if (_fs_fp) { rewind(_fs_fp); LineNo = 0; @@ -257,11 +260,18 @@ setfsent() else setfstab(getenv("PATH_FSTAB")); } - if ((_fs_fp = fopen(path_fstab, "r")) != NULL) { + fd = _open(path_fstab, O_RDONLY | O_CLOEXEC); + if (fd == -1) { + error(errno); + return (0); + } + _fs_fp = fdopen(fd, "r"); + if (_fs_fp != NULL) { LineNo = 0; return(1); } error(errno); + _close(fd); return(0); } From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 08:55:08 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A71D106564A; Thu, 21 Jun 2012 08:55:07 +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 DC48C8FC17; Thu, 21 Jun 2012 08:55: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 q5L8t7Aq000157; Thu, 21 Jun 2012 08:55:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L8t7LV000155; Thu, 21 Jun 2012 08:55:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206210855.q5L8t7LV000155@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 21 Jun 2012 08:55: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: r237362 - stable/8/lib/libc/gen X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 08:55:08 -0000 Author: kib Date: Thu Jun 21 08:55:07 2012 New Revision: 237362 URL: http://svn.freebsd.org/changeset/base/237362 Log: MFC r237061: Make sure that fstab fd is not leaked on exec. PR: kern/169023 Modified: stable/8/lib/libc/gen/fstab.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/fstab.c ============================================================================== --- stable/8/lib/libc/gen/fstab.c Thu Jun 21 08:35:47 2012 (r237361) +++ stable/8/lib/libc/gen/fstab.c Thu Jun 21 08:55:07 2012 (r237362) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -246,6 +247,8 @@ getfsfile(name) int setfsent() { + int fd; + if (_fs_fp) { rewind(_fs_fp); LineNo = 0; @@ -257,11 +260,18 @@ setfsent() else setfstab(getenv("PATH_FSTAB")); } - if ((_fs_fp = fopen(path_fstab, "r")) != NULL) { + fd = _open(path_fstab, O_RDONLY | O_CLOEXEC); + if (fd == -1) { + error(errno); + return (0); + } + _fs_fp = fdopen(fd, "r"); + if (_fs_fp != NULL) { LineNo = 0; return(1); } error(errno); + _close(fd); return(0); } From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 09:48:14 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3DD7110656A6; Thu, 21 Jun 2012 09:48:14 +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 26BC28FC0C; Thu, 21 Jun 2012 09:48: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 q5L9mEFl003112; Thu, 21 Jun 2012 09:48:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L9mDeY003110; Thu, 21 Jun 2012 09:48:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206210948.q5L9mDeY003110@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 09:48:13 +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: r237370 - stable/9/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:48:14 -0000 Author: marius Date: Thu Jun 21 09:48:13 2012 New Revision: 237370 URL: http://svn.freebsd.org/changeset/base/237370 Log: MFC: r237234 Avoid hard sentence break. Modified: stable/9/share/man/man4/ahci.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ahci.4 ============================================================================== --- stable/9/share/man/man4/ahci.4 Thu Jun 21 09:47:05 2012 (r237369) +++ stable/9/share/man/man4/ahci.4 Thu Jun 21 09:48:13 2012 (r237370) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2011 +.Dd June 18, 2012 .Dt AHCI 4 .Os .Sh NAME @@ -98,7 +98,8 @@ setting to nonzero value limits maximum Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .It Va hw.ahci.force setting to nonzero value forces driver attach to some known AHCI-capable -chips even if they are configured for legacy IDE emulation. Default is 1. +chips even if they are configured for legacy IDE emulation. +Default is 1. .El .Sh DESCRIPTION This driver provides the From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 09:48:23 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E39AA1065790; Thu, 21 Jun 2012 09:48:21 +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 A2AF78FC16; Thu, 21 Jun 2012 09:48: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 q5L9mLWq003153; Thu, 21 Jun 2012 09:48:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L9mLe3003151; Thu, 21 Jun 2012 09:48:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206210948.q5L9mLe3003151@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 09:48: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: r237371 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:48:23 -0000 Author: marius Date: Thu Jun 21 09:48:21 2012 New Revision: 237371 URL: http://svn.freebsd.org/changeset/base/237371 Log: MFC: r237234 Avoid hard sentence break. Modified: stable/8/share/man/man4/ahci.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ahci.4 ============================================================================== --- stable/8/share/man/man4/ahci.4 Thu Jun 21 09:48:13 2012 (r237370) +++ stable/8/share/man/man4/ahci.4 Thu Jun 21 09:48:21 2012 (r237371) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2011 +.Dd June 18, 2012 .Dt AHCI 4 .Os .Sh NAME @@ -99,7 +99,8 @@ setting to nonzero value limits maximum Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .It Va hw.ahci.force setting to nonzero value forces driver attach to some known AHCI-capable -chips even if they are configured for legacy IDE emulation. Default is 1. +chips even if they are configured for legacy IDE emulation. +Default is 1. .El .Sh DESCRIPTION This driver provides the From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 09:57:30 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 415F0106564A; Thu, 21 Jun 2012 09:57:30 +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 2C0728FC18; Thu, 21 Jun 2012 09:57: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 q5L9vUBx003591; Thu, 21 Jun 2012 09:57:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L9vTe5003589; Thu, 21 Jun 2012 09:57:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206210957.q5L9vTe5003589@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 09:57: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: r237372 - stable/9/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:57:30 -0000 Author: marius Date: Thu Jun 21 09:57:29 2012 New Revision: 237372 URL: http://svn.freebsd.org/changeset/base/237372 Log: MFC: r237235 Document the hw.ahci.force tunable here, too, as it's also used by ataahci(4) and atanvidia(4). Modified: stable/9/share/man/man4/ata.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ata.4 ============================================================================== --- stable/9/share/man/man4/ata.4 Thu Jun 21 09:48:21 2012 (r237371) +++ stable/9/share/man/man4/ata.4 Thu Jun 21 09:57:29 2012 (r237372) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2011 +.Dd June 18, 2012 .Dt ATA 4 .Os .Sh NAME @@ -89,8 +89,12 @@ subsystem module. The following tunables are settable from the .Xr loader 8 : .Bl -ohang +.It Va hw.ahci.force +set to nonzero value for forcing drivers to attach to some known AHCI-capable +chips even if they are configured for legacy IDE emulation (the default is 1, +force the attach). .It Va hw.ata.ata_dma_check_80pin -set to 0 to disable the 80pin cable check (the default is 1, check the cable) +set to 0 to disable the 80pin cable check (the default is 1, check the cable). .It Va hint.atapci.X.msi set to 1 to allow Message Signalled Interrupts (MSI) to be used by the specified PCI ATA controller, if supported. From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 09:57:34 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D77CF106566B; Thu, 21 Jun 2012 09:57:34 +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 C1EFB8FC08; Thu, 21 Jun 2012 09:57: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 q5L9vYTI003638; Thu, 21 Jun 2012 09:57:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L9vYcd003635; Thu, 21 Jun 2012 09:57:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206210957.q5L9vYcd003635@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 09:57: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: r237373 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:57:35 -0000 Author: marius Date: Thu Jun 21 09:57:34 2012 New Revision: 237373 URL: http://svn.freebsd.org/changeset/base/237373 Log: MFC: r237235 Document the hw.ahci.force tunable here, too, as it's also used by ataahci(4) and atanvidia(4). Modified: stable/8/share/man/man4/ata.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ata.4 ============================================================================== --- stable/8/share/man/man4/ata.4 Thu Jun 21 09:57:29 2012 (r237372) +++ stable/8/share/man/man4/ata.4 Thu Jun 21 09:57:34 2012 (r237373) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2010 +.Dd June 18, 2012 .Dt ATA 4 .Os .Sh NAME @@ -90,10 +90,14 @@ APIs and periperal drivers): .Pp The following tunables are settable from the loader: .Bl -ohang +.It Va hw.ahci.force +set to nonzero value for forcing drivers to attach to some known AHCI-capable +chips even if they are configured for legacy IDE emulation (the default is 1, +force the attach). .It Va hw.ata.ata_dma set to 1 for DMA access, 0 for PIO (default is DMA). .It Va hw.ata.ata_dma_check_80pin -set to 0 to disable the 80pin cable check (default is 1, check the cable) +set to 0 to disable the 80pin cable check (default is 1, check the cable). .It Va hw.ata.atapi_dma set to 1 for DMA access, 0 for PIO (default is DMA). .It Va hw.ata.wc From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 10:29:00 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 217371065670; Thu, 21 Jun 2012 10:29:00 +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 0B9B98FC0C; Thu, 21 Jun 2012 10:29: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 q5LASxPL006857; Thu, 21 Jun 2012 10:28:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LASxnI006853; Thu, 21 Jun 2012 10:28:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206211028.q5LASxnI006853@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Jun 2012 10:28: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: r237378 - stable/9/sys/dev/mvs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 10:29:00 -0000 Author: mav Date: Thu Jun 21 10:28:59 2012 New Revision: 237378 URL: http://svn.freebsd.org/changeset/base/237378 Log: MFC r236952: - Limit r214102 workaround to only x86. On arm it causes more problems then solves because of cache coherency issues. This fixes periodic error messages on console and command timeouts. - Patch SATA PHY configuration for 65nm SoCs to improve SNR same as Linux does. Modified: stable/9/sys/dev/mvs/mvs.c stable/9/sys/dev/mvs/mvs.h stable/9/sys/dev/mvs/mvs_soc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mvs/mvs.c ============================================================================== --- stable/9/sys/dev/mvs/mvs.c Thu Jun 21 10:21:33 2012 (r237377) +++ stable/9/sys/dev/mvs/mvs.c Thu Jun 21 10:28:59 2012 (r237378) @@ -1048,14 +1048,19 @@ mvs_crbq_intr(device_t dev) * Handle only successfull completions here. * Errors will be handled by main intr handler. */ +#if defined(__i386__) || defined(__amd64__) if (crpb->id == 0xffff && crpb->rspflg == 0xffff) { device_printf(dev, "Unfilled CRPB " "%d (%d->%d) tag %d flags %04x rs %08x\n", cin_idx, fin_idx, in_idx, slot, flags, ch->rslots); - } else if (ch->numtslots != 0 || + } else +#endif + if (ch->numtslots != 0 || (flags & EDMA_IE_EDEVERR) == 0) { +#if defined(__i386__) || defined(__amd64__) crpb->id = 0xffff; crpb->rspflg = 0xffff; +#endif if (ch->slot[slot].state >= MVS_SLOT_RUNNING) { ccb = ch->slot[slot].ccb; ccb->ataio.res.status = @@ -1999,6 +2004,39 @@ mvs_reset_to(void *arg) } static void +mvs_errata(device_t dev) +{ + struct mvs_channel *ch = device_get_softc(dev); + uint32_t val; + + if (ch->quirks & MVS_Q_SOC65) { + val = ATA_INL(ch->r_mem, SATA_PHYM3); + val &= ~(0x3 << 27); /* SELMUPF = 1 */ + val |= (0x1 << 27); + val &= ~(0x3 << 29); /* SELMUPI = 1 */ + val |= (0x1 << 29); + ATA_OUTL(ch->r_mem, SATA_PHYM3, val); + + val = ATA_INL(ch->r_mem, SATA_PHYM4); + val &= ~0x1; /* SATU_OD8 = 0 */ + val |= (0x1 << 16); /* reserved bit 16 = 1 */ + ATA_OUTL(ch->r_mem, SATA_PHYM4, val); + + val = ATA_INL(ch->r_mem, SATA_PHYM9_GEN2); + val &= ~0xf; /* TXAMP[3:0] = 8 */ + val |= 0x8; + val &= ~(0x1 << 14); /* TXAMP[4] = 0 */ + ATA_OUTL(ch->r_mem, SATA_PHYM9_GEN2, val); + + val = ATA_INL(ch->r_mem, SATA_PHYM9_GEN1); + val &= ~0xf; /* TXAMP[3:0] = 8 */ + val |= 0x8; + val &= ~(0x1 << 14); /* TXAMP[4] = 0 */ + ATA_OUTL(ch->r_mem, SATA_PHYM9_GEN1, val); + } +} + +static void mvs_reset(device_t dev) { struct mvs_channel *ch = device_get_softc(dev); @@ -2044,6 +2082,7 @@ mvs_reset(device_t dev) ATA_OUTL(ch->r_mem, EDMA_CMD, EDMA_CMD_EATARST); DELAY(25); ATA_OUTL(ch->r_mem, EDMA_CMD, 0); + mvs_errata(dev); /* Reset and reconnect PHY, */ if (!mvs_sata_phy_reset(dev)) { if (bootverbose) Modified: stable/9/sys/dev/mvs/mvs.h ============================================================================== --- stable/9/sys/dev/mvs/mvs.h Thu Jun 21 10:21:33 2012 (r237377) +++ stable/9/sys/dev/mvs/mvs.h Thu Jun 21 10:28:59 2012 (r237378) @@ -382,6 +382,10 @@ #define SATA_FISDW5 0x384 /* FIS DW5 */ #define SATA_FISDW6 0x388 /* FIS DW6 */ +#define SATA_PHYM9_GEN2 0x398 +#define SATA_PHYM9_GEN1 0x39c +#define SATA_PHYCFG_OFS 0x3a0 /* 65nm SoCs only */ + #define MVS_MAX_PORTS 8 #define MVS_MAX_SLOTS 32 @@ -537,6 +541,7 @@ struct mvs_channel { #define MVS_Q_GENIIE 4 #define MVS_Q_SOC 8 #define MVS_Q_CT 16 +#define MVS_Q_SOC65 32 int pm_level; /* power management level */ struct mvs_slot slot[MVS_MAX_SLOTS]; Modified: stable/9/sys/dev/mvs/mvs_soc.c ============================================================================== --- stable/9/sys/dev/mvs/mvs_soc.c Thu Jun 21 10:21:33 2012 (r237377) +++ stable/9/sys/dev/mvs/mvs_soc.c Thu Jun 21 10:28:59 2012 (r237378) @@ -135,6 +135,8 @@ mvs_attach(device_t dev) if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_rid, RF_ACTIVE))) return ENXIO; + if (ATA_INL(ctlr->r_mem, PORT_BASE(0) + SATA_PHYCFG_OFS) != 0) + ctlr->quirks |= MVS_Q_SOC65; /* Setup our own memory management for channels. */ ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem); ctlr->sc_iomem.rm_end = rman_get_end(ctlr->r_mem); From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 10:41:28 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 064AA106566B; Thu, 21 Jun 2012 10: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 E42438FC08; Thu, 21 Jun 2012 10: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 q5LAfRdr007480; Thu, 21 Jun 2012 10: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 q5LAfRwH007476; Thu, 21 Jun 2012 10:41:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206211041.q5LAfRwH007476@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Jun 2012 10:41: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: r237379 - stable/8/sys/dev/mvs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 10:41:28 -0000 Author: mav Date: Thu Jun 21 10:41:27 2012 New Revision: 237379 URL: http://svn.freebsd.org/changeset/base/237379 Log: MFC r236952: - Limit r214102 workaround to only x86. On arm it causes more problems then solves because of cache coherency issues. This fixes periodic error messages on console and command timeouts. - Patch SATA PHY configuration for 65nm SoCs to improve SNR same as Linux does. Modified: stable/8/sys/dev/mvs/mvs.c stable/8/sys/dev/mvs/mvs.h stable/8/sys/dev/mvs/mvs_soc.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/mvs/mvs.c ============================================================================== --- stable/8/sys/dev/mvs/mvs.c Thu Jun 21 10:28:59 2012 (r237378) +++ stable/8/sys/dev/mvs/mvs.c Thu Jun 21 10:41:27 2012 (r237379) @@ -1047,14 +1047,19 @@ mvs_crbq_intr(device_t dev) * Handle only successfull completions here. * Errors will be handled by main intr handler. */ +#if defined(__i386__) || defined(__amd64__) if (crpb->id == 0xffff && crpb->rspflg == 0xffff) { device_printf(dev, "Unfilled CRPB " "%d (%d->%d) tag %d flags %04x rs %08x\n", cin_idx, fin_idx, in_idx, slot, flags, ch->rslots); - } else if (ch->numtslots != 0 || + } else +#endif + if (ch->numtslots != 0 || (flags & EDMA_IE_EDEVERR) == 0) { +#if defined(__i386__) || defined(__amd64__) crpb->id = 0xffff; crpb->rspflg = 0xffff; +#endif if (ch->slot[slot].state >= MVS_SLOT_RUNNING) { ccb = ch->slot[slot].ccb; ccb->ataio.res.status = @@ -1998,6 +2003,39 @@ mvs_reset_to(void *arg) } static void +mvs_errata(device_t dev) +{ + struct mvs_channel *ch = device_get_softc(dev); + uint32_t val; + + if (ch->quirks & MVS_Q_SOC65) { + val = ATA_INL(ch->r_mem, SATA_PHYM3); + val &= ~(0x3 << 27); /* SELMUPF = 1 */ + val |= (0x1 << 27); + val &= ~(0x3 << 29); /* SELMUPI = 1 */ + val |= (0x1 << 29); + ATA_OUTL(ch->r_mem, SATA_PHYM3, val); + + val = ATA_INL(ch->r_mem, SATA_PHYM4); + val &= ~0x1; /* SATU_OD8 = 0 */ + val |= (0x1 << 16); /* reserved bit 16 = 1 */ + ATA_OUTL(ch->r_mem, SATA_PHYM4, val); + + val = ATA_INL(ch->r_mem, SATA_PHYM9_GEN2); + val &= ~0xf; /* TXAMP[3:0] = 8 */ + val |= 0x8; + val &= ~(0x1 << 14); /* TXAMP[4] = 0 */ + ATA_OUTL(ch->r_mem, SATA_PHYM9_GEN2, val); + + val = ATA_INL(ch->r_mem, SATA_PHYM9_GEN1); + val &= ~0xf; /* TXAMP[3:0] = 8 */ + val |= 0x8; + val &= ~(0x1 << 14); /* TXAMP[4] = 0 */ + ATA_OUTL(ch->r_mem, SATA_PHYM9_GEN1, val); + } +} + +static void mvs_reset(device_t dev) { struct mvs_channel *ch = device_get_softc(dev); @@ -2043,6 +2081,7 @@ mvs_reset(device_t dev) ATA_OUTL(ch->r_mem, EDMA_CMD, EDMA_CMD_EATARST); DELAY(25); ATA_OUTL(ch->r_mem, EDMA_CMD, 0); + mvs_errata(dev); /* Reset and reconnect PHY, */ if (!mvs_sata_phy_reset(dev)) { if (bootverbose) Modified: stable/8/sys/dev/mvs/mvs.h ============================================================================== --- stable/8/sys/dev/mvs/mvs.h Thu Jun 21 10:28:59 2012 (r237378) +++ stable/8/sys/dev/mvs/mvs.h Thu Jun 21 10:41:27 2012 (r237379) @@ -379,6 +379,10 @@ #define SATA_FISDW5 0x384 /* FIS DW5 */ #define SATA_FISDW6 0x388 /* FIS DW6 */ +#define SATA_PHYM9_GEN2 0x398 +#define SATA_PHYM9_GEN1 0x39c +#define SATA_PHYCFG_OFS 0x3a0 /* 65nm SoCs only */ + #define MVS_MAX_PORTS 8 #define MVS_MAX_SLOTS 32 @@ -534,6 +538,7 @@ struct mvs_channel { #define MVS_Q_GENIIE 4 #define MVS_Q_SOC 8 #define MVS_Q_CT 16 +#define MVS_Q_SOC65 32 int pm_level; /* power management level */ struct mvs_slot slot[MVS_MAX_SLOTS]; Modified: stable/8/sys/dev/mvs/mvs_soc.c ============================================================================== --- stable/8/sys/dev/mvs/mvs_soc.c Thu Jun 21 10:28:59 2012 (r237378) +++ stable/8/sys/dev/mvs/mvs_soc.c Thu Jun 21 10:41:27 2012 (r237379) @@ -130,6 +130,8 @@ mvs_attach(device_t dev) if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_rid, RF_ACTIVE))) return ENXIO; + if (ATA_INL(ctlr->r_mem, PORT_BASE(0) + SATA_PHYCFG_OFS) != 0) + ctlr->quirks |= MVS_Q_SOC65; /* Setup our own memory management for channels. */ ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem); ctlr->sc_iomem.rm_end = rman_get_end(ctlr->r_mem); From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 11:06:30 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41DE510656B1; Thu, 21 Jun 2012 11:06:30 +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 1D53F8FC16; Thu, 21 Jun 2012 11: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 q5LB6TCv008636; Thu, 21 Jun 2012 11:06:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LB6TFd008632; Thu, 21 Jun 2012 11:06:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211106.q5LB6TFd008632@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 11:06: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: r237380 - in stable/9/sys/dev/usb: . serial X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:06:30 -0000 Author: marius Date: Thu Jun 21 11:06:29 2012 New Revision: 237380 URL: http://svn.freebsd.org/changeset/base/237380 Log: MFC: r230242, r237102, r237236 - Add support for the FT2232 based egnite Turtelizer 2 JTAG/RS232 Adapter. This includes adding support for skipping FTDI interfaces used for JTAG leaving them for userland and just attaching to the RS232 half, similarly to how the corresponding Linux drivers handles these kind of adapters. While at it, sort uftdi_devs and return BUS_PROBE_SPECIFIC (because uftdi_probe() alters the instance variables for better or worse as do other probe routines of USB drivers) instead of 0. - Remove duplicated entries for BeagleBone. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. - Remove some stray lines. Modified: stable/9/sys/dev/usb/serial/uftdi.c stable/9/sys/dev/usb/serial/uftdi_reg.h stable/9/sys/dev/usb/usbdevs 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/usb/serial/uftdi.c ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi.c Thu Jun 21 10:41:27 2012 (r237379) +++ stable/9/sys/dev/usb/serial/uftdi.c Thu Jun 21 11:06:29 2012 (r237380) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); */ /* - * FTDI FT8U100AX serial adapter driver + * FTDI FT2232x, FT8U100AX and FT8U232AM serial adapter driver */ #include @@ -81,7 +81,7 @@ SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debu #endif #define UFTDI_CONFIG_INDEX 0 -#define UFTDI_IFACE_INDEX 0 +#define UFTDI_IFACE_INDEX_JTAG 0 #define UFTDI_OBUFSIZE 64 /* bytes, cannot be increased due to * do size encoding */ @@ -102,10 +102,10 @@ struct uftdi_softc { struct mtx sc_mtx; uint32_t sc_unit; - enum uftdi_type sc_type; uint16_t sc_last_lcr; + uint8_t sc_type; uint8_t sc_iface_index; uint8_t sc_hdrlen; uint8_t sc_msr; @@ -190,7 +190,7 @@ static device_method_t uftdi_methods[] = DEVMETHOD(device_attach, uftdi_attach), DEVMETHOD(device_detach, uftdi_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t uftdi_devclass; @@ -201,58 +201,61 @@ static driver_t uftdi_driver = { .size = sizeof(struct uftdi_softc), }; -DRIVER_MODULE(uftdi, uhub, uftdi_driver, uftdi_devclass, NULL, 0); +DRIVER_MODULE(uftdi, uhub, uftdi_driver, uftdi_devclass, NULL, NULL); MODULE_DEPEND(uftdi, ucom, 1, 1, 1); MODULE_DEPEND(uftdi, usb, 1, 1, 1); MODULE_VERSION(uftdi, 1); -static STRUCT_USB_HOST_ID uftdi_devs[] = { -#define UFTDI_DEV(v,p,t) \ - { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, UFTDI_TYPE_##t) } - UFTDI_DEV(ATMEL, STK541, 8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 8U232AM), - UFTDI_DEV(FALCOM, TWIST, 8U232AM), - UFTDI_DEV(FTDI, GAMMASCOUT, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO), - UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_2232D, 8U232AM), - UFTDI_DEV(FTDI, BEAGLEBONE, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM), - UFTDI_DEV(FTDI, SEMC_DSS20, 8U232AM), - UFTDI_DEV(FTDI, CFA_631, 8U232AM), - UFTDI_DEV(FTDI, CFA_632, 8U232AM), - UFTDI_DEV(FTDI, CFA_633, 8U232AM), - UFTDI_DEV(FTDI, CFA_634, 8U232AM), - UFTDI_DEV(FTDI, CFA_635, 8U232AM), - UFTDI_DEV(FTDI, USB_UIRT, 8U232AM), - UFTDI_DEV(FTDI, USBSERIAL, 8U232AM), - UFTDI_DEV(FTDI, KBS, 8U232AM), - UFTDI_DEV(FTDI, MX2_3, 8U232AM), - UFTDI_DEV(FTDI, MX4_5, 8U232AM), - UFTDI_DEV(FTDI, LK202, 8U232AM), - UFTDI_DEV(FTDI, LK204, 8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, 8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, 8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, 8U232AM), - UFTDI_DEV(FTDI, EISCOU, 8U232AM), - UFTDI_DEV(FTDI, UOPTBR, 8U232AM), - UFTDI_DEV(FTDI, EMCU2D, 8U232AM), - UFTDI_DEV(FTDI, PCMSFU, 8U232AM), - UFTDI_DEV(FTDI, EMCU2H, 8U232AM), - UFTDI_DEV(FTDI, MAXSTREAM, 8U232AM), - UFTDI_DEV(FTDI, CTI_USB_NANO_485, 8U232AM), - UFTDI_DEV(FTDI, CTI_USB_MINI_485, 8U232AM), - UFTDI_DEV(SIIG2, US2308, 8U232AM), - UFTDI_DEV(INTREPIDCS, VALUECAN, 8U232AM), - UFTDI_DEV(INTREPIDCS, NEOVI, 8U232AM), - UFTDI_DEV(BBELECTRONICS, USOTL4, 8U232AM), - UFTDI_DEV(MATRIXORBITAL, MOUA, 8U232AM), - UFTDI_DEV(MARVELL, SHEEVAPLUG, 8U232AM), - UFTDI_DEV(MELCO, PCOPRS1, 8U232AM), - UFTDI_DEV(RATOC, REXUSB60F, 8U232AM), +static const STRUCT_USB_HOST_ID uftdi_devs[] = { +#define UFTDI_DEV(v, p, i) \ + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + UFTDI_DEV(ATMEL, STK541, UFTDI_TYPE_8U232AM), + UFTDI_DEV(BBELECTRONICS, USOTL4, UFTDI_TYPE_8U232AM), + UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, + UFTDI_TYPE_8U232AM), + UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, + UFTDI_TYPE_8U232AM), + UFTDI_DEV(FALCOM, TWIST, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_631, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_632, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_633, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_634, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_635, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CTI_USB_MINI_485, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CTI_USB_NANO_485, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, EISCOU, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, EMCU2D, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, EMCU2H, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, GAMMASCOUT, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, KBS, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, LK202, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, LK204, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, MAXSTREAM, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, MX2_3, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, MX4_5, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, PCMSFU, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SEMC_DSS20, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_2232D, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_4232H, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_8U100AX, UFTDI_TYPE_SIO), + UFTDI_DEV(FTDI, SERIAL_8U232AM, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_8U232AM4, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_TYPE_8U232AM | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, UOPTBR, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, USBSERIAL, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, USB_UIRT, UFTDI_TYPE_8U232AM), + UFTDI_DEV(INTREPIDCS, NEOVI, UFTDI_TYPE_8U232AM), + UFTDI_DEV(INTREPIDCS, VALUECAN, UFTDI_TYPE_8U232AM), + UFTDI_DEV(MARVELL, SHEEVAPLUG, UFTDI_TYPE_8U232AM), + UFTDI_DEV(MATRIXORBITAL, MOUA, UFTDI_TYPE_8U232AM), + UFTDI_DEV(MELCO, PCOPRS1, UFTDI_TYPE_8U232AM), + UFTDI_DEV(RATOC, REXUSB60F, UFTDI_TYPE_8U232AM), + UFTDI_DEV(SIIG2, US2308, UFTDI_TYPE_8U232AM) #undef UFTDI_DEV }; @@ -260,6 +263,7 @@ static int uftdi_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + const struct usb_device_id *id; if (uaa->usb_mode != USB_MODE_HOST) { return (ENXIO); @@ -267,9 +271,24 @@ uftdi_probe(device_t dev) if (uaa->info.bConfigIndex != UFTDI_CONFIG_INDEX) { return (ENXIO); } - /* attach to all present interfaces */ - return (usbd_lookup_id_by_uaa(uftdi_devs, sizeof(uftdi_devs), uaa)); + /* + * Attach to all present interfaces unless this is a JTAG one, which + * we leave for userland. + */ + id = usbd_lookup_id_by_info(uftdi_devs, sizeof(uftdi_devs), + &uaa->info); + if (id == NULL) + return (ENXIO); + if ((id->driver_info & UFTDI_FLAG_JTAG) != 0 && + uaa->info.bIfaceIndex == UFTDI_IFACE_INDEX_JTAG) { + printf("%s: skipping JTAG interface at %u.%u\n", + device_get_name(dev), usbd_get_bus_index(uaa->device), + usbd_get_device_index(uaa->device)); + return (ENXIO); + } + uaa->driver_info = id->driver_info; + return (BUS_PROBE_SPECIFIC); } static int @@ -292,7 +311,7 @@ uftdi_attach(device_t dev) DPRINTF("\n"); sc->sc_iface_index = uaa->info.bIfaceIndex; - sc->sc_type = USB_GET_DRIVER_INFO(uaa); + sc->sc_type = USB_GET_DRIVER_INFO(uaa) & UFTDI_TYPE_MASK; switch (sc->sc_type) { case UFTDI_TYPE_SIO: @@ -561,6 +580,7 @@ static int uftdi_set_parm_soft(struct termios *t, struct uftdi_param_config *cfg, uint8_t type) { + memset(cfg, 0, sizeof(*cfg)); switch (type) { @@ -823,5 +843,6 @@ static void uftdi_poll(struct ucom_softc *ucom) { struct uftdi_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UFTDI_N_TRANSFER); } Modified: stable/9/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi_reg.h Thu Jun 21 10:41:27 2012 (r237379) +++ stable/9/sys/dev/usb/serial/uftdi_reg.h Thu Jun 21 11:06:29 2012 (r237380) @@ -35,10 +35,12 @@ #define FTDI_PIT_SIOB 2 /* SIOB */ #define FTDI_PIT_PARALLEL 3 /* Parallel */ -enum uftdi_type { - UFTDI_TYPE_SIO, - UFTDI_TYPE_8U232AM -}; +/* Values for driver_info */ +#define UFTDI_TYPE_MASK 0x000000ff +#define UFTDI_TYPE_SIO 0x00000001 +#define UFTDI_TYPE_8U232AM 0x00000002 +#define UFTDI_FLAG_MASK 0x0000ff00 +#define UFTDI_FLAG_JTAG 0x00000100 /* * BmRequestType: 0100 0000B @@ -63,14 +65,12 @@ enum uftdi_type { * baud and data format not reset * * The Purge RX and TX buffer commands affect nothing except the buffers - * */ /* FTDI_SIO_RESET */ #define FTDI_SIO_RESET_SIO 0 #define FTDI_SIO_RESET_PURGE_RX 1 #define FTDI_SIO_RESET_PURGE_TX 2 - /* * BmRequestType: 0100 0000B * bRequest: FTDI_SIO_SET_BAUDRATE @@ -135,7 +135,6 @@ enum { #define FTDI_SIO_SET_DATA_STOP_BITS_2 (0x2 << 11) #define FTDI_SIO_SET_BREAK (0x1 << 14) - /* * BmRequestType: 0100 0000B * bRequest: FTDI_SIO_MODEM_CTRL @@ -172,7 +171,6 @@ enum { #define FTDI_SIO_SET_RTS_HIGH (2 | ( FTDI_SIO_SET_RTS_MASK << 8)) #define FTDI_SIO_SET_RTS_LOW (0 | ( FTDI_SIO_SET_RTS_MASK << 8)) - /* * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_FLOW_CTRL @@ -203,7 +201,6 @@ enum { #define FTDI_SIO_DTR_DSR_HS 0x2 #define FTDI_SIO_XON_XOFF_HS 0x4 - /* * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_EVENT_CHAR @@ -227,8 +224,6 @@ enum { * which is what normally happens. */ - - /* * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_ERROR_CHAR @@ -243,14 +238,11 @@ enum { * 0 = disabled * 1 = enabled * B9..15 Reserved - * - * * FTDI_SIO_SET_ERROR_CHAR * Set the parity error replacement character for the specified communications * port. */ - /* * BmRequestType: 1100 0000b * bRequest: FTDI_SIO_GET_MODEM_STATUS @@ -282,10 +274,7 @@ enum { #define FTDI_SIO_RI_MASK 0x40 #define FTDI_SIO_RLSD_MASK 0x80 - - /* - * * DATA FORMAT * * IN Endpoint @@ -317,8 +306,6 @@ enum { * B5 Transmitter Holding Register (THRE) * B6 Transmitter Empty (TEMT) * B7 Error in RCVR FIFO - * - * * OUT Endpoint * * This device reserves the first bytes of data on this endpoint contain the @@ -330,7 +317,6 @@ enum { * Offset Description * B0..1 Port * B2..7 Length of message - (not including Byte 0) - * */ #define FTDI_PORT_MASK 0x0f #define FTDI_MSR_MASK 0xf0 Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Thu Jun 21 10:41:27 2012 (r237379) +++ stable/9/sys/dev/usb/usbdevs Thu Jun 21 11:06:29 2012 (r237380) @@ -1604,8 +1604,9 @@ product FTDI SERIAL_8U232AM 0x6001 8U232 product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial -product FTDI BEAGLEBONE 0xA6D0 BeagleBone product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial +product FTDI BEAGLEBONE 0xa6d0 BeagleBone +product FTDI TURTELIZER2 0xbdc8 egnite Turtelizer 2 JTAG/RS232 Adapter /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 11:06:31 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD31E10656E1; Thu, 21 Jun 2012 11:06: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 A60158FC12; Thu, 21 Jun 2012 11:06: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 q5LB6VPl008670; Thu, 21 Jun 2012 11:06:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LB6VYB008666; Thu, 21 Jun 2012 11:06:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211106.q5LB6VYB008666@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 11:06: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: r237381 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:06:31 -0000 Author: marius Date: Thu Jun 21 11:06:31 2012 New Revision: 237381 URL: http://svn.freebsd.org/changeset/base/237381 Log: MFC: r230242, r237102, r237236 - Add support for the FT2232 based egnite Turtelizer 2 JTAG/RS232 Adapter. This includes adding support for skipping FTDI interfaces used for JTAG leaving them for userland and just attaching to the RS232 half, similarly to how the corresponding Linux drivers handles these kind of adapters. While at it, sort uftdi_devs and return BUS_PROBE_SPECIFIC (because uftdi_probe() alters the instance variables for better or worse as do other probe routines of USB drivers) instead of 0. - Remove duplicated entries for BeagleBone. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. - Remove some stray lines. Modified: stable/8/sys/dev/usb/serial/uftdi.c stable/8/sys/dev/usb/serial/uftdi_reg.h stable/8/sys/dev/usb/usbdevs 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/usb/serial/uftdi.c ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi.c Thu Jun 21 11:06:29 2012 (r237380) +++ stable/8/sys/dev/usb/serial/uftdi.c Thu Jun 21 11:06:31 2012 (r237381) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); */ /* - * FTDI FT8U100AX serial adapter driver + * FTDI FT2232x, FT8U100AX and FT8U232AM serial adapter driver */ #include @@ -81,7 +81,7 @@ SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debu #endif #define UFTDI_CONFIG_INDEX 0 -#define UFTDI_IFACE_INDEX 0 +#define UFTDI_IFACE_INDEX_JTAG 0 #define UFTDI_OBUFSIZE 64 /* bytes, cannot be increased due to * do size encoding */ @@ -102,10 +102,10 @@ struct uftdi_softc { struct mtx sc_mtx; uint32_t sc_unit; - enum uftdi_type sc_type; uint16_t sc_last_lcr; + uint8_t sc_type; uint8_t sc_iface_index; uint8_t sc_hdrlen; uint8_t sc_msr; @@ -190,7 +190,7 @@ static device_method_t uftdi_methods[] = DEVMETHOD(device_attach, uftdi_attach), DEVMETHOD(device_detach, uftdi_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t uftdi_devclass; @@ -201,58 +201,61 @@ static driver_t uftdi_driver = { .size = sizeof(struct uftdi_softc), }; -DRIVER_MODULE(uftdi, uhub, uftdi_driver, uftdi_devclass, NULL, 0); +DRIVER_MODULE(uftdi, uhub, uftdi_driver, uftdi_devclass, NULL, NULL); MODULE_DEPEND(uftdi, ucom, 1, 1, 1); MODULE_DEPEND(uftdi, usb, 1, 1, 1); MODULE_VERSION(uftdi, 1); -static STRUCT_USB_HOST_ID uftdi_devs[] = { -#define UFTDI_DEV(v,p,t) \ - { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, UFTDI_TYPE_##t) } - UFTDI_DEV(ATMEL, STK541, 8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 8U232AM), - UFTDI_DEV(FALCOM, TWIST, 8U232AM), - UFTDI_DEV(FTDI, GAMMASCOUT, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO), - UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_2232D, 8U232AM), - UFTDI_DEV(FTDI, BEAGLEBONE, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM), - UFTDI_DEV(FTDI, SEMC_DSS20, 8U232AM), - UFTDI_DEV(FTDI, CFA_631, 8U232AM), - UFTDI_DEV(FTDI, CFA_632, 8U232AM), - UFTDI_DEV(FTDI, CFA_633, 8U232AM), - UFTDI_DEV(FTDI, CFA_634, 8U232AM), - UFTDI_DEV(FTDI, CFA_635, 8U232AM), - UFTDI_DEV(FTDI, USB_UIRT, 8U232AM), - UFTDI_DEV(FTDI, USBSERIAL, 8U232AM), - UFTDI_DEV(FTDI, KBS, 8U232AM), - UFTDI_DEV(FTDI, MX2_3, 8U232AM), - UFTDI_DEV(FTDI, MX4_5, 8U232AM), - UFTDI_DEV(FTDI, LK202, 8U232AM), - UFTDI_DEV(FTDI, LK204, 8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, 8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, 8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, 8U232AM), - UFTDI_DEV(FTDI, EISCOU, 8U232AM), - UFTDI_DEV(FTDI, UOPTBR, 8U232AM), - UFTDI_DEV(FTDI, EMCU2D, 8U232AM), - UFTDI_DEV(FTDI, PCMSFU, 8U232AM), - UFTDI_DEV(FTDI, EMCU2H, 8U232AM), - UFTDI_DEV(FTDI, MAXSTREAM, 8U232AM), - UFTDI_DEV(FTDI, CTI_USB_NANO_485, 8U232AM), - UFTDI_DEV(FTDI, CTI_USB_MINI_485, 8U232AM), - UFTDI_DEV(SIIG2, US2308, 8U232AM), - UFTDI_DEV(INTREPIDCS, VALUECAN, 8U232AM), - UFTDI_DEV(INTREPIDCS, NEOVI, 8U232AM), - UFTDI_DEV(BBELECTRONICS, USOTL4, 8U232AM), - UFTDI_DEV(MATRIXORBITAL, MOUA, 8U232AM), - UFTDI_DEV(MARVELL, SHEEVAPLUG, 8U232AM), - UFTDI_DEV(MELCO, PCOPRS1, 8U232AM), - UFTDI_DEV(RATOC, REXUSB60F, 8U232AM), +static const STRUCT_USB_HOST_ID uftdi_devs[] = { +#define UFTDI_DEV(v, p, i) \ + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + UFTDI_DEV(ATMEL, STK541, UFTDI_TYPE_8U232AM), + UFTDI_DEV(BBELECTRONICS, USOTL4, UFTDI_TYPE_8U232AM), + UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, + UFTDI_TYPE_8U232AM), + UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, + UFTDI_TYPE_8U232AM), + UFTDI_DEV(FALCOM, TWIST, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_631, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_632, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_633, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_634, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_635, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CTI_USB_MINI_485, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CTI_USB_NANO_485, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, EISCOU, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, EMCU2D, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, EMCU2H, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, GAMMASCOUT, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, KBS, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, LK202, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, LK204, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, MAXSTREAM, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, MX2_3, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, MX4_5, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, PCMSFU, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SEMC_DSS20, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_2232D, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_4232H, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_8U100AX, UFTDI_TYPE_SIO), + UFTDI_DEV(FTDI, SERIAL_8U232AM, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_8U232AM4, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_TYPE_8U232AM | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, UOPTBR, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, USBSERIAL, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, USB_UIRT, UFTDI_TYPE_8U232AM), + UFTDI_DEV(INTREPIDCS, NEOVI, UFTDI_TYPE_8U232AM), + UFTDI_DEV(INTREPIDCS, VALUECAN, UFTDI_TYPE_8U232AM), + UFTDI_DEV(MARVELL, SHEEVAPLUG, UFTDI_TYPE_8U232AM), + UFTDI_DEV(MATRIXORBITAL, MOUA, UFTDI_TYPE_8U232AM), + UFTDI_DEV(MELCO, PCOPRS1, UFTDI_TYPE_8U232AM), + UFTDI_DEV(RATOC, REXUSB60F, UFTDI_TYPE_8U232AM), + UFTDI_DEV(SIIG2, US2308, UFTDI_TYPE_8U232AM) #undef UFTDI_DEV }; @@ -260,6 +263,7 @@ static int uftdi_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + const struct usb_device_id *id; if (uaa->usb_mode != USB_MODE_HOST) { return (ENXIO); @@ -267,9 +271,24 @@ uftdi_probe(device_t dev) if (uaa->info.bConfigIndex != UFTDI_CONFIG_INDEX) { return (ENXIO); } - /* attach to all present interfaces */ - return (usbd_lookup_id_by_uaa(uftdi_devs, sizeof(uftdi_devs), uaa)); + /* + * Attach to all present interfaces unless this is a JTAG one, which + * we leave for userland. + */ + id = usbd_lookup_id_by_info(uftdi_devs, sizeof(uftdi_devs), + &uaa->info); + if (id == NULL) + return (ENXIO); + if ((id->driver_info & UFTDI_FLAG_JTAG) != 0 && + uaa->info.bIfaceIndex == UFTDI_IFACE_INDEX_JTAG) { + printf("%s: skipping JTAG interface at %u.%u\n", + device_get_name(dev), usbd_get_bus_index(uaa->device), + usbd_get_device_index(uaa->device)); + return (ENXIO); + } + uaa->driver_info = id->driver_info; + return (BUS_PROBE_SPECIFIC); } static int @@ -292,7 +311,7 @@ uftdi_attach(device_t dev) DPRINTF("\n"); sc->sc_iface_index = uaa->info.bIfaceIndex; - sc->sc_type = USB_GET_DRIVER_INFO(uaa); + sc->sc_type = USB_GET_DRIVER_INFO(uaa) & UFTDI_TYPE_MASK; switch (sc->sc_type) { case UFTDI_TYPE_SIO: @@ -561,6 +580,7 @@ static int uftdi_set_parm_soft(struct termios *t, struct uftdi_param_config *cfg, uint8_t type) { + memset(cfg, 0, sizeof(*cfg)); switch (type) { @@ -823,5 +843,6 @@ static void uftdi_poll(struct ucom_softc *ucom) { struct uftdi_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UFTDI_N_TRANSFER); } Modified: stable/8/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi_reg.h Thu Jun 21 11:06:29 2012 (r237380) +++ stable/8/sys/dev/usb/serial/uftdi_reg.h Thu Jun 21 11:06:31 2012 (r237381) @@ -35,10 +35,12 @@ #define FTDI_PIT_SIOB 2 /* SIOB */ #define FTDI_PIT_PARALLEL 3 /* Parallel */ -enum uftdi_type { - UFTDI_TYPE_SIO, - UFTDI_TYPE_8U232AM -}; +/* Values for driver_info */ +#define UFTDI_TYPE_MASK 0x000000ff +#define UFTDI_TYPE_SIO 0x00000001 +#define UFTDI_TYPE_8U232AM 0x00000002 +#define UFTDI_FLAG_MASK 0x0000ff00 +#define UFTDI_FLAG_JTAG 0x00000100 /* * BmRequestType: 0100 0000B @@ -63,14 +65,12 @@ enum uftdi_type { * baud and data format not reset * * The Purge RX and TX buffer commands affect nothing except the buffers - * */ /* FTDI_SIO_RESET */ #define FTDI_SIO_RESET_SIO 0 #define FTDI_SIO_RESET_PURGE_RX 1 #define FTDI_SIO_RESET_PURGE_TX 2 - /* * BmRequestType: 0100 0000B * bRequest: FTDI_SIO_SET_BAUDRATE @@ -135,7 +135,6 @@ enum { #define FTDI_SIO_SET_DATA_STOP_BITS_2 (0x2 << 11) #define FTDI_SIO_SET_BREAK (0x1 << 14) - /* * BmRequestType: 0100 0000B * bRequest: FTDI_SIO_MODEM_CTRL @@ -172,7 +171,6 @@ enum { #define FTDI_SIO_SET_RTS_HIGH (2 | ( FTDI_SIO_SET_RTS_MASK << 8)) #define FTDI_SIO_SET_RTS_LOW (0 | ( FTDI_SIO_SET_RTS_MASK << 8)) - /* * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_FLOW_CTRL @@ -203,7 +201,6 @@ enum { #define FTDI_SIO_DTR_DSR_HS 0x2 #define FTDI_SIO_XON_XOFF_HS 0x4 - /* * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_EVENT_CHAR @@ -227,8 +224,6 @@ enum { * which is what normally happens. */ - - /* * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_ERROR_CHAR @@ -243,14 +238,11 @@ enum { * 0 = disabled * 1 = enabled * B9..15 Reserved - * - * * FTDI_SIO_SET_ERROR_CHAR * Set the parity error replacement character for the specified communications * port. */ - /* * BmRequestType: 1100 0000b * bRequest: FTDI_SIO_GET_MODEM_STATUS @@ -282,10 +274,7 @@ enum { #define FTDI_SIO_RI_MASK 0x40 #define FTDI_SIO_RLSD_MASK 0x80 - - /* - * * DATA FORMAT * * IN Endpoint @@ -317,8 +306,6 @@ enum { * B5 Transmitter Holding Register (THRE) * B6 Transmitter Empty (TEMT) * B7 Error in RCVR FIFO - * - * * OUT Endpoint * * This device reserves the first bytes of data on this endpoint contain the @@ -330,7 +317,6 @@ enum { * Offset Description * B0..1 Port * B2..7 Length of message - (not including Byte 0) - * */ #define FTDI_PORT_MASK 0x0f #define FTDI_MSR_MASK 0xf0 Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Thu Jun 21 11:06:29 2012 (r237380) +++ stable/8/sys/dev/usb/usbdevs Thu Jun 21 11:06:31 2012 (r237381) @@ -1600,8 +1600,9 @@ product FTDI SERIAL_8U232AM 0x6001 8U232 product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial -product FTDI BEAGLEBONE 0xA6D0 BeagleBone product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial +product FTDI BEAGLEBONE 0xa6d0 BeagleBone +product FTDI TURTELIZER2 0xbdc8 egnite Turtelizer 2 JTAG/RS232 Adapter /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 11:10:50 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A94E51065670; Thu, 21 Jun 2012 11:10:50 +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 92F728FC16; Thu, 21 Jun 2012 11:10: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 q5LBAoXJ008920; Thu, 21 Jun 2012 11:10:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LBAoM4008918; Thu, 21 Jun 2012 11:10:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211110.q5LBAoM4008918@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 11:10: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: r237382 - stable/9/sys/arm/at91 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:10:50 -0000 Author: marius Date: Thu Jun 21 11:10:49 2012 New Revision: 237382 URL: http://svn.freebsd.org/changeset/base/237382 Log: MFC: r237239 Revert the part of r236495 (MFC'ed to stable/9 in r237095) that introduced checking of SPI_SR_TXEMPTY for TX transfer completion as for reasons unknown this occasionally causes SPI_SR_RXBUFF and SPI_SR_ENDRX to not rise. In any case, once the RX part of the transfer is done it's obvious that the preceding TX part had finished and checking of SPI_SR_TXEMPTY was introduced to rule out a possible cause for the data corruption mentioned in r236495 but which didn't turn out to be the problem anyway. Modified: stable/9/sys/arm/at91/at91_spi.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/arm/at91/at91_spi.c ============================================================================== --- stable/9/sys/arm/at91/at91_spi.c Thu Jun 21 11:06:31 2012 (r237381) +++ stable/9/sys/arm/at91/at91_spi.c Thu Jun 21 11:10:49 2012 (r237382) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include @@ -59,7 +58,6 @@ struct at91_spi_softc bus_dma_tag_t dmatag; /* bus dma tag for transfers */ bus_dmamap_t map[4]; /* Maps for the transaction */ struct sx xfer_mtx; /* Enforce one transfer at a time */ - uint32_t xfer_mask; /* Bits to wait on for completion */ uint32_t xfer_done; /* interrupt<->mainthread signaling */ }; @@ -124,7 +122,6 @@ at91_spi_attach(device_t dev) * Set up the hardware. */ - sc->xfer_mask = SPI_SR_RXBUFF | (at91_is_rm92() ? 0 : SPI_SR_TXEMPTY); WR4(sc, SPI_CR, SPI_CR_SWRST); /* "Software Reset must be Written Twice" erratum */ WR4(sc, SPI_CR, SPI_CR_SWRST); @@ -272,7 +269,6 @@ at91_spi_transfer(device_t dev, device_t struct at91_spi_softc *sc; bus_addr_t addr; int err, i, j, mode[4]; - uint32_t mask; KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, ("%s: TX/RX command sizes should be equal", __func__)); @@ -356,12 +352,11 @@ at91_spi_transfer(device_t dev, device_t * Start the transfer, wait for it to complete. */ sc->xfer_done = 0; - mask = sc->xfer_mask; - WR4(sc, SPI_IER, mask); + WR4(sc, SPI_IER, SPI_SR_RXBUFF); WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN | PDC_PTCR_RXTEN); do err = tsleep(&sc->xfer_done, PCATCH | PZERO, "at91_spi", hz); - while (sc->xfer_done != mask && err != EINTR); + while (sc->xfer_done == 0 && err != EINTR); /* * Stop the transfer and clean things up. @@ -383,20 +378,19 @@ static void at91_spi_intr(void *arg) { struct at91_spi_softc *sc; - uint32_t mask, sr; + uint32_t sr; sc = (struct at91_spi_softc*)arg; - mask = sc->xfer_mask; sr = RD4(sc, SPI_SR) & RD4(sc, SPI_IMR); - if ((sr & mask) != 0) { - sc->xfer_done |= sr & mask; - WR4(sc, SPI_IDR, mask); + if ((sr & SPI_SR_RXBUFF) != 0) { + sc->xfer_done = 1; + WR4(sc, SPI_IDR, SPI_SR_RXBUFF); wakeup(&sc->xfer_done); } - if ((sr & ~mask) != 0) { + if ((sr & ~SPI_SR_RXBUFF) != 0) { device_printf(sc->dev, "Unexpected ISR %#x\n", sr); - WR4(sc, SPI_IDR, sr & ~mask); + WR4(sc, SPI_IDR, sr & ~SPI_SR_RXBUFF); } } From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 11:10:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7D1C1065675; Thu, 21 Jun 2012 11:10:55 +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 B1C6A8FC17; Thu, 21 Jun 2012 11:10: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 q5LBAtjj008957; Thu, 21 Jun 2012 11:10:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LBAtVd008955; Thu, 21 Jun 2012 11:10:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211110.q5LBAtVd008955@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 11:10: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: r237383 - stable/8/sys/arm/at91 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:10:56 -0000 Author: marius Date: Thu Jun 21 11:10:55 2012 New Revision: 237383 URL: http://svn.freebsd.org/changeset/base/237383 Log: MFC: r237239 Revert the part of r236495 (MFC'ed to stable/8 in r237096) that introduced checking of SPI_SR_TXEMPTY for TX transfer completion as for reasons unknown this occasionally causes SPI_SR_RXBUFF and SPI_SR_ENDRX to not rise. In any case, once the RX part of the transfer is done it's obvious that the preceding TX part had finished and checking of SPI_SR_TXEMPTY was introduced to rule out a possible cause for the data corruption mentioned in r236495 but which didn't turn out to be the problem anyway. Modified: stable/8/sys/arm/at91/at91_spi.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/arm/at91/at91_spi.c ============================================================================== --- stable/8/sys/arm/at91/at91_spi.c Thu Jun 21 11:10:49 2012 (r237382) +++ stable/8/sys/arm/at91/at91_spi.c Thu Jun 21 11:10:55 2012 (r237383) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include @@ -59,7 +58,6 @@ struct at91_spi_softc bus_dma_tag_t dmatag; /* bus dma tag for transfers */ bus_dmamap_t map[4]; /* Maps for the transaction */ struct sx xfer_mtx; /* Enforce one transfer at a time */ - uint32_t xfer_mask; /* Bits to wait on for completion */ uint32_t xfer_done; /* interrupt<->mainthread signaling */ }; @@ -124,7 +122,6 @@ at91_spi_attach(device_t dev) * Set up the hardware. */ - sc->xfer_mask = SPI_SR_RXBUFF | (at91_is_rm92() ? 0 : SPI_SR_TXEMPTY); WR4(sc, SPI_CR, SPI_CR_SWRST); /* "Software Reset must be Written Twice" erratum */ WR4(sc, SPI_CR, SPI_CR_SWRST); @@ -272,7 +269,6 @@ at91_spi_transfer(device_t dev, device_t struct at91_spi_softc *sc; bus_addr_t addr; int err, i, j, mode[4]; - uint32_t mask; KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, ("%s: TX/RX command sizes should be equal", __func__)); @@ -356,12 +352,11 @@ at91_spi_transfer(device_t dev, device_t * Start the transfer, wait for it to complete. */ sc->xfer_done = 0; - mask = sc->xfer_mask; - WR4(sc, SPI_IER, mask); + WR4(sc, SPI_IER, SPI_SR_RXBUFF); WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN | PDC_PTCR_RXTEN); do err = tsleep(&sc->xfer_done, PCATCH | PZERO, "at91_spi", hz); - while (sc->xfer_done != mask && err != EINTR); + while (sc->xfer_done == 0 && err != EINTR); /* * Stop the transfer and clean things up. @@ -383,20 +378,19 @@ static void at91_spi_intr(void *arg) { struct at91_spi_softc *sc; - uint32_t mask, sr; + uint32_t sr; sc = (struct at91_spi_softc*)arg; - mask = sc->xfer_mask; sr = RD4(sc, SPI_SR) & RD4(sc, SPI_IMR); - if ((sr & mask) != 0) { - sc->xfer_done |= sr & mask; - WR4(sc, SPI_IDR, mask); + if ((sr & SPI_SR_RXBUFF) != 0) { + sc->xfer_done = 1; + WR4(sc, SPI_IDR, SPI_SR_RXBUFF); wakeup(&sc->xfer_done); } - if ((sr & ~mask) != 0) { + if ((sr & ~SPI_SR_RXBUFF) != 0) { device_printf(sc->dev, "Unexpected ISR %#x\n", sr); - WR4(sc, SPI_IDR, sr & ~mask); + WR4(sc, SPI_IDR, sr & ~SPI_SR_RXBUFF); } } From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 11:16:05 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB2B71065672; Thu, 21 Jun 2012 11:16:05 +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 C3C378FC22; Thu, 21 Jun 2012 11:16:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LBG5S5009256; Thu, 21 Jun 2012 11:16:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LBG51C009254; Thu, 21 Jun 2012 11:16:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211116.q5LBG51C009254@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 11:16:05 +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: r237384 - stable/9/sys/dev/flash X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:16:06 -0000 Author: marius Date: Thu Jun 21 11:16:05 2012 New Revision: 237384 URL: http://svn.freebsd.org/changeset/base/237384 Log: MFC: r236496 - Loop up to 3 seconds when waiting for a device to get ready. [1] - Make the device description match the driver name. - Identify the chip variant based on the JEDEC and use that information to use the proper values for page count, offset and size instead of hardcoding a AT45DB642x with 2^N byte page support disabled. - Take advantage of bioq_takefirst(). - Given that CONTINUOUS_ARRAY_READ_HF (0x0b) command isn't even mentioned in Atmel's DataFlash Application Note, as suggested by the previous comment may not work on all all devices and actually doesn't properly on at least AT45DB321D (JEDEC 0x1f2701), rewrite at45d_task() to use CONTINUOUS_ARRAY_READ (0xe8) for reading instead. This rewrite is laid out in a way allowing to easily add support for BIO_DELETE later on. - Add support for reads and writes not starting on a page boundary. - Verify the flash content after writing. - Let at45d_task() gracefully handle errors on SPI transfers and the device not becoming ready afterwards again. [1] - Use DEVMETHOD_END. [1] - Use NULL instead of 0 for pointers. [1] Additional testing by: Ian Lepore Submitted by: Ian Lepore [1] Modified: stable/9/sys/dev/flash/at45d.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/flash/at45d.c ============================================================================== --- stable/9/sys/dev/flash/at45d.c Thu Jun 21 11:10:55 2012 (r237383) +++ stable/9/sys/dev/flash/at45d.c Thu Jun 21 11:16:05 2012 (r237384) @@ -1,5 +1,8 @@ /*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2006 M. Warner Losh + * Copyright (c) 2011-2012 Ian Lepore + * Copyright (c) 2012 Marius Strobl + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,44 +45,82 @@ __FBSDID("$FreeBSD$"); #include #include "spibus_if.h" -struct at45d_softc +struct at45d_flash_ident { - struct intr_config_hook config_intrhook; - device_t dev; - struct mtx sc_mtx; - struct disk *disk; - struct proc *p; - struct bio_queue_head bio_queue; + const char *name; + uint32_t jedec; + uint16_t pagecount; + uint16_t pageoffset; + uint16_t pagesize; + uint16_t pagesize2n; }; -#define AT45D_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +struct at45d_softc +{ + struct bio_queue_head bio_queue; + struct mtx sc_mtx; + struct disk *disk; + struct proc *p; + struct intr_config_hook config_intrhook; + device_t dev; + uint16_t pagecount; + uint16_t pageoffset; + uint16_t pagesize; +}; + +#define AT45D_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define AT45D_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define AT45D_LOCK_INIT(_sc) \ +#define AT45D_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "at45d", MTX_DEF) -#define AT45D_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define AT45D_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define AT45D_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); - -static void at45d_delayed_attach(void *xsc); +#define AT45D_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define AT45D_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define AT45D_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + +/* bus entry points */ +static device_attach_t at45d_attach; +static device_detach_t at45d_detach; +static device_probe_t at45d_probe; /* disk routines */ -static int at45d_open(struct disk *dp); static int at45d_close(struct disk *dp); +static int at45d_open(struct disk *dp); static void at45d_strategy(struct bio *bp); static void at45d_task(void *arg); -#define CONTINUOUS_ARRAY_READ 0xE8 -#define CONTINUOUS_ARRAY_READ_HF 0x0B -#define CONTINUOUS_ARRAY_READ_LF 0x03 -#define STATUS_REGISTER_READ 0xD7 -#define PROGRAM_THROUGH_BUFFER 0x82 -#define MANUFACTURER_ID 0x9F +/* helper routines */ +static void at45d_delayed_attach(void *xsc); +static int at45d_get_mfg_info(device_t dev, uint8_t *resp); +static int at45d_get_status(device_t dev, uint8_t *status); +static int at45d_wait_ready(device_t dev, uint8_t *status); + +#define BUFFER_TRANSFER 0x53 +#define BUFFER_COMPARE 0x60 +#define PROGRAM_THROUGH_BUFFER 0x82 +#define MANUFACTURER_ID 0x9f +#define STATUS_REGISTER_READ 0xd7 +#define CONTINUOUS_ARRAY_READ 0xe8 + +/* + * A sectorsize2n != 0 is used to indicate that a device optionally supports + * 2^N byte pages. If support for the latter is enabled, the sector offset + * has to be reduced by one. + */ +static const struct at45d_flash_ident const at45d_flash_devices[] = { + { "AT45DB011B", 0x1f2200, 512, 9, 264, 256 }, + { "AT45DB021B", 0x1f2300, 1024, 9, 264, 256 }, + { "AT45DB041x", 0x1f2400, 2028, 9, 264, 256 }, + { "AT45DB081B", 0x1f2500, 4096, 9, 264, 256 }, + { "AT45DB161x", 0x1f2600, 4096, 10, 528, 512 }, + { "AT45DB321x", 0x1f2700, 8192, 10, 528, 0 }, + { "AT45DB321x", 0x1f2701, 8192, 10, 528, 512 }, + { "AT45DB642x", 0x1f2800, 8192, 11, 1056, 1024 } +}; -static uint8_t -at45d_get_status(device_t dev) +static int +at45d_get_status(device_t dev, uint8_t *status) { - uint8_t txBuf[8], rxBuf[8]; + uint8_t rxBuf[8], txBuf[8]; struct spi_command cmd; int err; @@ -90,23 +131,16 @@ at45d_get_status(device_t dev) txBuf[0] = STATUS_REGISTER_READ; cmd.tx_cmd = txBuf; cmd.rx_cmd = rxBuf; - cmd.rx_cmd_sz = 2; - cmd.tx_cmd_sz = 2; + cmd.rx_cmd_sz = cmd.tx_cmd_sz = 2; err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); - return (rxBuf[1]); -} - -static void -at45d_wait_for_device_ready(device_t dev) -{ - while (!(at45d_get_status(dev) & 0x80)) - continue; + *status = rxBuf[1]; + return (err); } static int at45d_get_mfg_info(device_t dev, uint8_t *resp) { - uint8_t txBuf[8], rxBuf[8]; + uint8_t rxBuf[8], txBuf[8]; struct spi_command cmd; int err; @@ -117,22 +151,37 @@ at45d_get_mfg_info(device_t dev, uint8_t txBuf[0] = MANUFACTURER_ID; cmd.tx_cmd = &txBuf; cmd.rx_cmd = &rxBuf; - cmd.tx_cmd_sz = 5; - cmd.rx_cmd_sz = 5; + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 5; err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); if (err) return (err); memcpy(resp, rxBuf + 1, 4); - // XXX We really should 'decode' the reply into some kind of - // XXX structure. To be generic (and not just for atmel parts) - // XXX we'd have to loop until we got a full reply. return (0); } static int +at45d_wait_ready(device_t dev, uint8_t *status) +{ + struct timeval now, tout; + int err; + + getmicrouptime(&tout); + tout.tv_sec += 3; + do { + getmicrouptime(&now); + if (now.tv_sec > tout.tv_sec) + err = ETIMEDOUT; + else + err = at45d_get_status(dev, status); + } while (err == 0 && (*status & 0x80) == 0); + return (err); +} + +static int at45d_probe(device_t dev) { - device_set_desc(dev, "AT45 Flash Family"); + + device_set_desc(dev, "AT45D Flash Family"); return (0); } @@ -156,31 +205,66 @@ at45d_attach(device_t dev) static int at45d_detach(device_t dev) { - return EIO; + + return (EBUSY) /* XXX */; } static void at45d_delayed_attach(void *xsc) { - struct at45d_softc *sc = xsc; - uint8_t buf[4]; - - at45d_get_mfg_info(sc->dev, buf); - at45d_wait_for_device_ready(sc->dev); - - sc->disk = disk_alloc(); - sc->disk->d_open = at45d_open; - sc->disk->d_close = at45d_close; - sc->disk->d_strategy = at45d_strategy; - sc->disk->d_name = "flash/spi"; - sc->disk->d_drv1 = sc; - sc->disk->d_maxsize = DFLTPHYS; - sc->disk->d_sectorsize = 1056; /* XXX */ - sc->disk->d_mediasize = 8192 * 1056; /* XXX */ - sc->disk->d_unit = device_get_unit(sc->dev); - disk_create(sc->disk, DISK_VERSION); - bioq_init(&sc->bio_queue); - kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash"); + struct at45d_softc *sc; + const struct at45d_flash_ident *ident; + u_int i; + uint32_t jedec; + uint16_t pagesize; + uint8_t buf[4], status; + + sc = xsc; + ident = NULL; + jedec = 0; + + if (at45d_wait_ready(sc->dev, &status) != 0) + device_printf(sc->dev, "Error waiting for device-ready.\n"); + else if (at45d_get_mfg_info(sc->dev, buf) != 0) + device_printf(sc->dev, "Failed to get ID.\n"); + else { + jedec = buf[0] << 16 | buf[1] << 8 | buf[2]; + for (i = 0; i < nitems(at45d_flash_devices); i++) { + if (at45d_flash_devices[i].jedec == jedec) { + ident = &at45d_flash_devices[i]; + break; + } + } + } + if (ident == NULL) + device_printf(sc->dev, "JEDEC 0x%x not in list.\n", jedec); + else { + sc->pagecount = ident->pagecount; + sc->pageoffset = ident->pageoffset; + if (ident->pagesize2n != 0 && (status & 0x01) != 0) { + sc->pageoffset -= 1; + pagesize = ident->pagesize2n; + } else + pagesize = ident->pagesize; + sc->pagesize = pagesize; + + sc->disk = disk_alloc(); + sc->disk->d_open = at45d_open; + sc->disk->d_close = at45d_close; + sc->disk->d_strategy = at45d_strategy; + sc->disk->d_name = "flash/spi"; + sc->disk->d_drv1 = sc; + sc->disk->d_maxsize = DFLTPHYS; + sc->disk->d_sectorsize = pagesize; + sc->disk->d_mediasize = pagesize * ident->pagecount; + sc->disk->d_unit = device_get_unit(sc->dev); + disk_create(sc->disk, DISK_VERSION); + bioq_init(&sc->bio_queue); + kproc_create(&at45d_task, sc, &sc->p, 0, 0, + "task: at45d flash"); + device_printf(sc->dev, "%s, %d bytes per page, %d pages\n", + ident->name, pagesize, ident->pagecount); + } config_intrhook_disestablish(&sc->config_intrhook); } @@ -188,13 +272,15 @@ at45d_delayed_attach(void *xsc) static int at45d_open(struct disk *dp) { - return 0; + + return (0); } static int at45d_close(struct disk *dp) { - return 0; + + return (0); } static void @@ -212,53 +298,132 @@ at45d_strategy(struct bio *bp) static void at45d_task(void *arg) { - struct at45d_softc *sc = (struct at45d_softc*)arg; + uint8_t rxBuf[8], txBuf[8]; + struct at45d_softc *sc; struct bio *bp; - uint8_t txBuf[8], rxBuf[8]; struct spi_command cmd; - int sz; - daddr_t block, end; device_t dev, pdev; - int err; + caddr_t buf; + u_long len, resid; + u_int addr, berr, err, offset, page; + uint8_t status; + + sc = (struct at45d_softc*)arg; + dev = sc->dev; + pdev = device_get_parent(dev); + memset(&cmd, 0, sizeof(cmd)); + memset(txBuf, 0, sizeof(txBuf)); + memset(rxBuf, 0, sizeof(rxBuf)); + cmd.tx_cmd = txBuf; + cmd.rx_cmd = rxBuf; for (;;) { - dev = sc->dev; - pdev = device_get_parent(dev); AT45D_LOCK(sc); do { - bp = bioq_first(&sc->bio_queue); + bp = bioq_takefirst(&sc->bio_queue); if (bp == NULL) msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); } while (bp == NULL); - bioq_remove(&sc->bio_queue, bp); AT45D_UNLOCK(sc); - sz = sc->disk->d_sectorsize; - end = bp->bio_pblkno + (bp->bio_bcount / sz); - for (block = bp->bio_pblkno; block < end; block++) { - char *vaddr = bp->bio_data + (block - bp->bio_pblkno) * sz; - if (bp->bio_cmd == BIO_READ) { - txBuf[0] = CONTINUOUS_ARRAY_READ_HF; - cmd.tx_cmd_sz = 5; - cmd.rx_cmd_sz = 5; - } else { + + berr = 0; + buf = bp->bio_data; + len = resid = bp->bio_bcount; + page = bp->bio_offset / sc->pagesize; + offset = bp->bio_offset % sc->pagesize; + + switch (bp->bio_cmd) { + case BIO_READ: + txBuf[0] = CONTINUOUS_ARRAY_READ; + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 8; + cmd.tx_data = cmd.rx_data = buf; + break; + case BIO_WRITE: + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 4; + cmd.tx_data = cmd.rx_data = buf; + if (resid + offset > sc->pagesize) + len = sc->pagesize - offset; + break; + default: + berr = EINVAL; + goto out; + } + + /* + * NB: for BIO_READ, this loop is only traversed once. + */ + while (resid > 0) { + if (page > sc->pagecount) { + berr = EINVAL; + goto out; + } + addr = page << sc->pageoffset; + if (bp->bio_cmd == BIO_WRITE) { + if (len != sc->pagesize) { + txBuf[0] = BUFFER_TRANSFER; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = 0; + cmd.tx_data_sz = cmd.rx_data_sz = 0; + err = SPIBUS_TRANSFER(pdev, dev, + &cmd); + if (err == 0) + err = at45d_wait_ready(dev, + &status); + if (err != 0) { + berr = EIO; + goto out; + } + } txBuf[0] = PROGRAM_THROUGH_BUFFER; - cmd.tx_cmd_sz = 4; - cmd.rx_cmd_sz = 4; } - // XXX only works on certain devices... Fixme - txBuf[1] = ((block >> 5) & 0xFF); - txBuf[2] = ((block << 3) & 0xF8); - txBuf[3] = 0; - txBuf[4] = 0; - cmd.tx_cmd = txBuf; - cmd.rx_cmd = rxBuf; - cmd.tx_data = vaddr; - cmd.tx_data_sz = sz; - cmd.rx_data = vaddr; - cmd.rx_data_sz = sz; + + addr += offset; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = (addr & 0xff); + cmd.tx_data_sz = cmd.rx_data_sz = len; err = SPIBUS_TRANSFER(pdev, dev, &cmd); - // XXX err check? + if (err == 0 && bp->bio_cmd != BIO_READ) + err = at45d_wait_ready(dev, &status); + if (err != 0) { + berr = EIO; + goto out; + } + if (bp->bio_cmd == BIO_WRITE) { + addr = page << sc->pageoffset; + txBuf[0] = BUFFER_COMPARE; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = 0; + cmd.tx_data_sz = cmd.rx_data_sz = 0; + err = SPIBUS_TRANSFER(pdev, dev, &cmd); + if (err == 0) + err = at45d_wait_ready(dev, &status); + if (err != 0 || (status & 0x40) != 0) { + device_printf(dev, "comparing page " + "%d failed (status=0x%x)\n", addr, + status); + berr = EIO; + goto out; + } + } + page++; + buf += len; + offset = 0; + resid -= len; + if (resid > sc->pagesize) + len = sc->pagesize; + else + len = resid; + cmd.tx_data = cmd.rx_data = buf; + } + out: + if (berr != 0) { + bp->bio_flags |= BIO_ERROR; + bp->bio_error = berr; } + bp->bio_resid = resid; biodone(bp); } } @@ -271,7 +436,7 @@ static device_method_t at45d_methods[] = DEVMETHOD(device_attach, at45d_attach), DEVMETHOD(device_detach, at45d_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t at45d_driver = { @@ -280,4 +445,4 @@ static driver_t at45d_driver = { sizeof(struct at45d_softc), }; -DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devclass, 0, 0); +DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devclass, NULL, NULL); From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 11:16:15 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6F401065788; Thu, 21 Jun 2012 11:16:14 +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 7D4F78FC14; Thu, 21 Jun 2012 11:16: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 q5LBGDvw009299; Thu, 21 Jun 2012 11:16:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LBGDCB009297; Thu, 21 Jun 2012 11:16:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211116.q5LBGDCB009297@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 11:16:13 +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: r237385 - stable/8/sys/dev/flash X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:16:16 -0000 Author: marius Date: Thu Jun 21 11:16:13 2012 New Revision: 237385 URL: http://svn.freebsd.org/changeset/base/237385 Log: MFC: r236496 - Loop up to 3 seconds when waiting for a device to get ready. [1] - Make the device description match the driver name. - Identify the chip variant based on the JEDEC and use that information to use the proper values for page count, offset and size instead of hardcoding a AT45DB642x with 2^N byte page support disabled. - Take advantage of bioq_takefirst(). - Given that CONTINUOUS_ARRAY_READ_HF (0x0b) command isn't even mentioned in Atmel's DataFlash Application Note, as suggested by the previous comment may not work on all all devices and actually doesn't properly on at least AT45DB321D (JEDEC 0x1f2701), rewrite at45d_task() to use CONTINUOUS_ARRAY_READ (0xe8) for reading instead. This rewrite is laid out in a way allowing to easily add support for BIO_DELETE later on. - Add support for reads and writes not starting on a page boundary. - Verify the flash content after writing. - Let at45d_task() gracefully handle errors on SPI transfers and the device not becoming ready afterwards again. [1] - Use DEVMETHOD_END. [1] - Use NULL instead of 0 for pointers. [1] Additional testing by: Ian Lepore Submitted by: Ian Lepore [1] Modified: stable/8/sys/dev/flash/at45d.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/flash/at45d.c ============================================================================== --- stable/8/sys/dev/flash/at45d.c Thu Jun 21 11:16:05 2012 (r237384) +++ stable/8/sys/dev/flash/at45d.c Thu Jun 21 11:16:13 2012 (r237385) @@ -1,5 +1,8 @@ /*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2006 M. Warner Losh + * Copyright (c) 2011-2012 Ian Lepore + * Copyright (c) 2012 Marius Strobl + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,44 +45,82 @@ __FBSDID("$FreeBSD$"); #include #include "spibus_if.h" -struct at45d_softc +struct at45d_flash_ident { - struct intr_config_hook config_intrhook; - device_t dev; - struct mtx sc_mtx; - struct disk *disk; - struct proc *p; - struct bio_queue_head bio_queue; + const char *name; + uint32_t jedec; + uint16_t pagecount; + uint16_t pageoffset; + uint16_t pagesize; + uint16_t pagesize2n; }; -#define AT45D_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +struct at45d_softc +{ + struct bio_queue_head bio_queue; + struct mtx sc_mtx; + struct disk *disk; + struct proc *p; + struct intr_config_hook config_intrhook; + device_t dev; + uint16_t pagecount; + uint16_t pageoffset; + uint16_t pagesize; +}; + +#define AT45D_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define AT45D_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define AT45D_LOCK_INIT(_sc) \ +#define AT45D_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "at45d", MTX_DEF) -#define AT45D_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define AT45D_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define AT45D_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); - -static void at45d_delayed_attach(void *xsc); +#define AT45D_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define AT45D_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define AT45D_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + +/* bus entry points */ +static device_attach_t at45d_attach; +static device_detach_t at45d_detach; +static device_probe_t at45d_probe; /* disk routines */ -static int at45d_open(struct disk *dp); static int at45d_close(struct disk *dp); +static int at45d_open(struct disk *dp); static void at45d_strategy(struct bio *bp); static void at45d_task(void *arg); -#define CONTINUOUS_ARRAY_READ 0xE8 -#define CONTINUOUS_ARRAY_READ_HF 0x0B -#define CONTINUOUS_ARRAY_READ_LF 0x03 -#define STATUS_REGISTER_READ 0xD7 -#define PROGRAM_THROUGH_BUFFER 0x82 -#define MANUFACTURER_ID 0x9F +/* helper routines */ +static void at45d_delayed_attach(void *xsc); +static int at45d_get_mfg_info(device_t dev, uint8_t *resp); +static int at45d_get_status(device_t dev, uint8_t *status); +static int at45d_wait_ready(device_t dev, uint8_t *status); + +#define BUFFER_TRANSFER 0x53 +#define BUFFER_COMPARE 0x60 +#define PROGRAM_THROUGH_BUFFER 0x82 +#define MANUFACTURER_ID 0x9f +#define STATUS_REGISTER_READ 0xd7 +#define CONTINUOUS_ARRAY_READ 0xe8 + +/* + * A sectorsize2n != 0 is used to indicate that a device optionally supports + * 2^N byte pages. If support for the latter is enabled, the sector offset + * has to be reduced by one. + */ +static const struct at45d_flash_ident const at45d_flash_devices[] = { + { "AT45DB011B", 0x1f2200, 512, 9, 264, 256 }, + { "AT45DB021B", 0x1f2300, 1024, 9, 264, 256 }, + { "AT45DB041x", 0x1f2400, 2028, 9, 264, 256 }, + { "AT45DB081B", 0x1f2500, 4096, 9, 264, 256 }, + { "AT45DB161x", 0x1f2600, 4096, 10, 528, 512 }, + { "AT45DB321x", 0x1f2700, 8192, 10, 528, 0 }, + { "AT45DB321x", 0x1f2701, 8192, 10, 528, 512 }, + { "AT45DB642x", 0x1f2800, 8192, 11, 1056, 1024 } +}; -static uint8_t -at45d_get_status(device_t dev) +static int +at45d_get_status(device_t dev, uint8_t *status) { - uint8_t txBuf[8], rxBuf[8]; + uint8_t rxBuf[8], txBuf[8]; struct spi_command cmd; int err; @@ -90,23 +131,16 @@ at45d_get_status(device_t dev) txBuf[0] = STATUS_REGISTER_READ; cmd.tx_cmd = txBuf; cmd.rx_cmd = rxBuf; - cmd.rx_cmd_sz = 2; - cmd.tx_cmd_sz = 2; + cmd.rx_cmd_sz = cmd.tx_cmd_sz = 2; err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); - return (rxBuf[1]); -} - -static void -at45d_wait_for_device_ready(device_t dev) -{ - while (!(at45d_get_status(dev) & 0x80)) - continue; + *status = rxBuf[1]; + return (err); } static int at45d_get_mfg_info(device_t dev, uint8_t *resp) { - uint8_t txBuf[8], rxBuf[8]; + uint8_t rxBuf[8], txBuf[8]; struct spi_command cmd; int err; @@ -117,22 +151,37 @@ at45d_get_mfg_info(device_t dev, uint8_t txBuf[0] = MANUFACTURER_ID; cmd.tx_cmd = &txBuf; cmd.rx_cmd = &rxBuf; - cmd.tx_cmd_sz = 5; - cmd.rx_cmd_sz = 5; + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 5; err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); if (err) return (err); memcpy(resp, rxBuf + 1, 4); - // XXX We really should 'decode' the reply into some kind of - // XXX structure. To be generic (and not just for atmel parts) - // XXX we'd have to loop until we got a full reply. return (0); } static int +at45d_wait_ready(device_t dev, uint8_t *status) +{ + struct timeval now, tout; + int err; + + getmicrouptime(&tout); + tout.tv_sec += 3; + do { + getmicrouptime(&now); + if (now.tv_sec > tout.tv_sec) + err = ETIMEDOUT; + else + err = at45d_get_status(dev, status); + } while (err == 0 && (*status & 0x80) == 0); + return (err); +} + +static int at45d_probe(device_t dev) { - device_set_desc(dev, "AT45 Flash Family"); + + device_set_desc(dev, "AT45D Flash Family"); return (0); } @@ -156,31 +205,66 @@ at45d_attach(device_t dev) static int at45d_detach(device_t dev) { - return EIO; + + return (EBUSY) /* XXX */; } static void at45d_delayed_attach(void *xsc) { - struct at45d_softc *sc = xsc; - uint8_t buf[4]; - - at45d_get_mfg_info(sc->dev, buf); - at45d_wait_for_device_ready(sc->dev); - - sc->disk = disk_alloc(); - sc->disk->d_open = at45d_open; - sc->disk->d_close = at45d_close; - sc->disk->d_strategy = at45d_strategy; - sc->disk->d_name = "flash/spi"; - sc->disk->d_drv1 = sc; - sc->disk->d_maxsize = DFLTPHYS; - sc->disk->d_sectorsize = 1056; /* XXX */ - sc->disk->d_mediasize = 8192 * 1056; /* XXX */ - sc->disk->d_unit = device_get_unit(sc->dev); - disk_create(sc->disk, DISK_VERSION); - bioq_init(&sc->bio_queue); - kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash"); + struct at45d_softc *sc; + const struct at45d_flash_ident *ident; + u_int i; + uint32_t jedec; + uint16_t pagesize; + uint8_t buf[4], status; + + sc = xsc; + ident = NULL; + jedec = 0; + + if (at45d_wait_ready(sc->dev, &status) != 0) + device_printf(sc->dev, "Error waiting for device-ready.\n"); + else if (at45d_get_mfg_info(sc->dev, buf) != 0) + device_printf(sc->dev, "Failed to get ID.\n"); + else { + jedec = buf[0] << 16 | buf[1] << 8 | buf[2]; + for (i = 0; i < nitems(at45d_flash_devices); i++) { + if (at45d_flash_devices[i].jedec == jedec) { + ident = &at45d_flash_devices[i]; + break; + } + } + } + if (ident == NULL) + device_printf(sc->dev, "JEDEC 0x%x not in list.\n", jedec); + else { + sc->pagecount = ident->pagecount; + sc->pageoffset = ident->pageoffset; + if (ident->pagesize2n != 0 && (status & 0x01) != 0) { + sc->pageoffset -= 1; + pagesize = ident->pagesize2n; + } else + pagesize = ident->pagesize; + sc->pagesize = pagesize; + + sc->disk = disk_alloc(); + sc->disk->d_open = at45d_open; + sc->disk->d_close = at45d_close; + sc->disk->d_strategy = at45d_strategy; + sc->disk->d_name = "flash/spi"; + sc->disk->d_drv1 = sc; + sc->disk->d_maxsize = DFLTPHYS; + sc->disk->d_sectorsize = pagesize; + sc->disk->d_mediasize = pagesize * ident->pagecount; + sc->disk->d_unit = device_get_unit(sc->dev); + disk_create(sc->disk, DISK_VERSION); + bioq_init(&sc->bio_queue); + kproc_create(&at45d_task, sc, &sc->p, 0, 0, + "task: at45d flash"); + device_printf(sc->dev, "%s, %d bytes per page, %d pages\n", + ident->name, pagesize, ident->pagecount); + } config_intrhook_disestablish(&sc->config_intrhook); } @@ -188,13 +272,15 @@ at45d_delayed_attach(void *xsc) static int at45d_open(struct disk *dp) { - return 0; + + return (0); } static int at45d_close(struct disk *dp) { - return 0; + + return (0); } static void @@ -212,53 +298,132 @@ at45d_strategy(struct bio *bp) static void at45d_task(void *arg) { - struct at45d_softc *sc = (struct at45d_softc*)arg; + uint8_t rxBuf[8], txBuf[8]; + struct at45d_softc *sc; struct bio *bp; - uint8_t txBuf[8], rxBuf[8]; struct spi_command cmd; - int sz; - daddr_t block, end; device_t dev, pdev; - int err; + caddr_t buf; + u_long len, resid; + u_int addr, berr, err, offset, page; + uint8_t status; + + sc = (struct at45d_softc*)arg; + dev = sc->dev; + pdev = device_get_parent(dev); + memset(&cmd, 0, sizeof(cmd)); + memset(txBuf, 0, sizeof(txBuf)); + memset(rxBuf, 0, sizeof(rxBuf)); + cmd.tx_cmd = txBuf; + cmd.rx_cmd = rxBuf; for (;;) { - dev = sc->dev; - pdev = device_get_parent(dev); AT45D_LOCK(sc); do { - bp = bioq_first(&sc->bio_queue); + bp = bioq_takefirst(&sc->bio_queue); if (bp == NULL) msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); } while (bp == NULL); - bioq_remove(&sc->bio_queue, bp); AT45D_UNLOCK(sc); - sz = sc->disk->d_sectorsize; - end = bp->bio_pblkno + (bp->bio_bcount / sz); - for (block = bp->bio_pblkno; block < end; block++) { - char *vaddr = bp->bio_data + (block - bp->bio_pblkno) * sz; - if (bp->bio_cmd == BIO_READ) { - txBuf[0] = CONTINUOUS_ARRAY_READ_HF; - cmd.tx_cmd_sz = 5; - cmd.rx_cmd_sz = 5; - } else { + + berr = 0; + buf = bp->bio_data; + len = resid = bp->bio_bcount; + page = bp->bio_offset / sc->pagesize; + offset = bp->bio_offset % sc->pagesize; + + switch (bp->bio_cmd) { + case BIO_READ: + txBuf[0] = CONTINUOUS_ARRAY_READ; + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 8; + cmd.tx_data = cmd.rx_data = buf; + break; + case BIO_WRITE: + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 4; + cmd.tx_data = cmd.rx_data = buf; + if (resid + offset > sc->pagesize) + len = sc->pagesize - offset; + break; + default: + berr = EINVAL; + goto out; + } + + /* + * NB: for BIO_READ, this loop is only traversed once. + */ + while (resid > 0) { + if (page > sc->pagecount) { + berr = EINVAL; + goto out; + } + addr = page << sc->pageoffset; + if (bp->bio_cmd == BIO_WRITE) { + if (len != sc->pagesize) { + txBuf[0] = BUFFER_TRANSFER; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = 0; + cmd.tx_data_sz = cmd.rx_data_sz = 0; + err = SPIBUS_TRANSFER(pdev, dev, + &cmd); + if (err == 0) + err = at45d_wait_ready(dev, + &status); + if (err != 0) { + berr = EIO; + goto out; + } + } txBuf[0] = PROGRAM_THROUGH_BUFFER; - cmd.tx_cmd_sz = 4; - cmd.rx_cmd_sz = 4; } - // XXX only works on certain devices... Fixme - txBuf[1] = ((block >> 5) & 0xFF); - txBuf[2] = ((block << 3) & 0xF8); - txBuf[3] = 0; - txBuf[4] = 0; - cmd.tx_cmd = txBuf; - cmd.rx_cmd = rxBuf; - cmd.tx_data = vaddr; - cmd.tx_data_sz = sz; - cmd.rx_data = vaddr; - cmd.rx_data_sz = sz; + + addr += offset; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = (addr & 0xff); + cmd.tx_data_sz = cmd.rx_data_sz = len; err = SPIBUS_TRANSFER(pdev, dev, &cmd); - // XXX err check? + if (err == 0 && bp->bio_cmd != BIO_READ) + err = at45d_wait_ready(dev, &status); + if (err != 0) { + berr = EIO; + goto out; + } + if (bp->bio_cmd == BIO_WRITE) { + addr = page << sc->pageoffset; + txBuf[0] = BUFFER_COMPARE; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = 0; + cmd.tx_data_sz = cmd.rx_data_sz = 0; + err = SPIBUS_TRANSFER(pdev, dev, &cmd); + if (err == 0) + err = at45d_wait_ready(dev, &status); + if (err != 0 || (status & 0x40) != 0) { + device_printf(dev, "comparing page " + "%d failed (status=0x%x)\n", addr, + status); + berr = EIO; + goto out; + } + } + page++; + buf += len; + offset = 0; + resid -= len; + if (resid > sc->pagesize) + len = sc->pagesize; + else + len = resid; + cmd.tx_data = cmd.rx_data = buf; + } + out: + if (berr != 0) { + bp->bio_flags |= BIO_ERROR; + bp->bio_error = berr; } + bp->bio_resid = resid; biodone(bp); } } @@ -271,7 +436,7 @@ static device_method_t at45d_methods[] = DEVMETHOD(device_attach, at45d_attach), DEVMETHOD(device_detach, at45d_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t at45d_driver = { @@ -280,4 +445,4 @@ static driver_t at45d_driver = { sizeof(struct at45d_softc), }; -DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devclass, 0, 0); +DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devclass, NULL, NULL); From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 11:23:39 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18BDD1065673; Thu, 21 Jun 2012 11:23:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 018138FC0C; Thu, 21 Jun 2012 11:23: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 q5LBNcHK009681; Thu, 21 Jun 2012 11:23:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LBNcne009676; Thu, 21 Jun 2012 11:23:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211123.q5LBNcne009676@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 11:23: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: r237386 - in stable/9/sys/arm: at91 conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:23:39 -0000 Author: marius Date: Thu Jun 21 11:23:38 2012 New Revision: 237386 URL: http://svn.freebsd.org/changeset/base/237386 Log: MFC: r235348, r236191, r236497 Add glue/support for the SAM9XE512-based Ethernut 5 boards. Currently, all integrated and on-board peripherals except NAND Flash (missing NAND framework/integration) are working. Added: stable/9/sys/arm/at91/board_ethernut5.c - copied unchanged from r235348, head/sys/arm/at91/board_ethernut5.c stable/9/sys/arm/at91/std.ethernut5 - copied unchanged from r235348, head/sys/arm/at91/std.ethernut5 stable/9/sys/arm/conf/ETHERNUT5 - copied, changed from r235348, head/sys/arm/conf/ETHERNUT5 stable/9/sys/arm/conf/ETHERNUT5.hints - copied, changed from r235348, head/sys/arm/conf/ETHERNUT5.hints Modified: stable/9/sys/arm/at91/files.at91sam9 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) Copied: stable/9/sys/arm/at91/board_ethernut5.c (from r235348, head/sys/arm/at91/board_ethernut5.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/arm/at91/board_ethernut5.c Thu Jun 21 11:23:38 2012 (r237386, copy of r235348, head/sys/arm/at91/board_ethernut5.c) @@ -0,0 +1,146 @@ +/*- + * Copyright (c) 2012 Marius Strobl + * 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. + */ + +/* + * Ethernut 5 board support + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +long +board_init(void) +{ + + /* + * DBGU + */ + /* DRXD */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB14, 0); + /* DTXD */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB15, 1); + + /* + * EMAC + */ + /* ETX0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA12, 0); + /* ETX1 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA13, 0); + /* ERX0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA14, 0); + /* ERX1 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA15, 0); + /* ETXEN */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA16, 0); + /* ERXDV */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA17, 0); + /* ERXER */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA18, 0); + /* ETXCK */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA19, 0); + /* EMDC */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA20, 0); + /* EMDIO */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA21, 0); + + /* + * MMC + */ + /* MCDA0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA6, 1); + /* MCCDA */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA7, 1); + /* MCCK */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA8, 1); + /* MCDA1 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA9, 1); + /* MCDA2 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA10, 1); + /* MCDA3 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA11, 1); + + /* + * SPI0 + */ + /* MISO */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA0, 0); + /* MOSI */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA1, 0); + /* SPCK */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA2, 0); + /* NPCS0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA3, 0); + + /* + * TWI + */ + /* TWD */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA23, 1); + /* TWCK */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA24, 1); + + /* + * USART0 + */ + /* TXD0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB4, 1); + /* RXD0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB5, 0); + /* DSR0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB22, 0); + /* DCD0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB23, 0); + /* DTR0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB24, 1); + /* RI0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB25, 0); + /* RTS0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB26, 1); + /* CTS0 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB27, 0); + + /* + * USART2 + */ + /* RTS2 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA4, 1); + /* CTS2 */ + at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA5, 0); + /* TXD2 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB8, 1); + /* RXD2 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB9, 0); + + return (at91_ramsize()); +} Modified: stable/9/sys/arm/at91/files.at91sam9 ============================================================================== --- stable/9/sys/arm/at91/files.at91sam9 Thu Jun 21 11:16:13 2012 (r237385) +++ stable/9/sys/arm/at91/files.at91sam9 Thu Jun 21 11:23:38 2012 (r237386) @@ -31,6 +31,7 @@ arm/at91/at91sam9260.c optional at91sam # # All the boards we support # +arm/at91/board_ethernut5.c optional at91_board_ethernut5 arm/at91/board_hl201.c optional at91_board_hl201 arm/at91/board_sam9g20ek.c optional at91_board_sam9g20ek arm/at91/board_qila9g20.c optional at91_board_qila9g20 Copied: stable/9/sys/arm/at91/std.ethernut5 (from r235348, head/sys/arm/at91/std.ethernut5) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/arm/at91/std.ethernut5 Thu Jun 21 11:23:38 2012 (r237386, copy of r235348, head/sys/arm/at91/std.ethernut5) @@ -0,0 +1,14 @@ +# $FreeBSD$ +include "../at91/std.at91sam9" + +options STARTUP_PAGETABLE_ADDR=0x20800000 +makeoptions KERNPHYSADDR=0x20000000 +makeoptions KERNVIRTADDR=0xc0000000 +options KERNPHYSADDR=0x20000000 +options KERNVIRTADDR=0xc0000000 + +# SAM9XE512 w/ 90.3168 MHz master clock +options AT91C_MASTER_CLOCK=90316800 + +device at91_board_ethernut5 +nodevice at91sam9g20 Copied and modified: stable/9/sys/arm/conf/ETHERNUT5 (from r235348, head/sys/arm/conf/ETHERNUT5) ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Sat May 12 18:11:26 2012 (r235348, copy source) +++ stable/9/sys/arm/conf/ETHERNUT5 Thu Jun 21 11:23:38 2012 (r237386) @@ -66,11 +66,11 @@ options PRINTF_BUFR_SIZE=128 # Prevent #options INCLUDE_CONFIG_FILE # Include this file in kernel # required for netbooting -options BOOTP_NFSROOT options BOOTP +options BOOTP_COMPAT +options BOOTP_NFSROOT options BOOTP_NFSV3 options BOOTP_WIRED_TO=ate0 -options BOOTP_COMPAT # alternatively, boot from a MMC/SD memory card #options ROOTDEVNAME=\"ufs:/dev/mmcsd0a\" @@ -117,11 +117,11 @@ options AT91_MCI_HAS_4WIRE device mmc # MMC/SD bus device mmcsd # MMC/SD memory card -# DataFlash - totally b0rken drivers -#device at91_spi # Atmel AT91 Serial Peripheral Interface -#device spibus # SPI bus -#device at45d # Atmel AT45D -#device geom_map # GEOM partition mapping +# DataFlash +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus +device at45d # Atmel AT45D +device geom_map # GEOM partition mapping # Pseudo devices. device loop # Network loopback Copied and modified: stable/9/sys/arm/conf/ETHERNUT5.hints (from r235348, head/sys/arm/conf/ETHERNUT5.hints) ============================================================================== --- head/sys/arm/conf/ETHERNUT5.hints Sat May 12 18:11:26 2012 (r235348, copy source) +++ stable/9/sys/arm/conf/ETHERNUT5.hints Thu Jun 21 11:23:38 2012 (r237386) @@ -27,18 +27,24 @@ hint.map.3.start=0x000c6000 hint.map.3.end=0x00359fff hint.map.3.name="kernel" #hint.map.3.readonly=1 -# nutos 3432 kbytes +# nutos 528 kbytes hint.map.4.at="flash/spi0" hint.map.4.start=0x0035a000 hint.map.4.end=0x003ddfff hint.map.4.name="nutos" hint.map.4.readonly=1 -# env 3960 kbytes +# env 132 kbytes hint.map.5.at="flash/spi0" hint.map.5.start=0x003de000 hint.map.5.end=0x003fefff hint.map.5.name="env" hint.map.5.readonly=1 +# env 132 kbytes +hint.map.6.at="flash/spi0" +hint.map.6.start=0x003ff000 +hint.map.6.end=0x0041ffff +hint.map.6.name="nutoscfg" +hint.map.6.readonly=1 # NXP PCF8563 clock/calendar hint.pcf8563_rtc.0.at="iicbus0" From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 12:10:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E20F106567D; Thu, 21 Jun 2012 12:10:09 +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 69B458FC0C; Thu, 21 Jun 2012 12:10: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 q5LCA9UK011774; Thu, 21 Jun 2012 12:10:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LCA9h7011772; Thu, 21 Jun 2012 12:10:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211210.q5LCA9h7011772@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 12:10: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: r237388 - stable/9/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 12:10:09 -0000 Author: marius Date: Thu Jun 21 12:10:08 2012 New Revision: 237388 URL: http://svn.freebsd.org/changeset/base/237388 Log: MFC: r231617 Add ARM relocations types used for thread-local storage Reviewed by: cognet Modified: stable/9/sys/sys/elf_common.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/sys/elf_common.h ============================================================================== --- stable/9/sys/sys/elf_common.h Thu Jun 21 11:39:56 2012 (r237387) +++ stable/9/sys/sys/elf_common.h Thu Jun 21 12:10:08 2012 (r237388) @@ -634,6 +634,10 @@ typedef struct { #define R_ARM_THM_SWI8 14 #define R_ARM_XPC25 15 #define R_ARM_THM_XPC22 16 +/* TLS relocations */ +#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */ +#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */ +#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */ #define R_ARM_COPY 20 /* Copy data from shared object. */ #define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */ #define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */ From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 12:10:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2B89106567E; Thu, 21 Jun 2012 12:10:09 +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 B6DB18FC12; Thu, 21 Jun 2012 12:10: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 q5LCA9di011788; Thu, 21 Jun 2012 12:10:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LCA9P3011786; Thu, 21 Jun 2012 12:10:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211210.q5LCA9P3011786@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 12:10:09 +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: r237389 - stable/8/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 12:10:10 -0000 Author: marius Date: Thu Jun 21 12:10:09 2012 New Revision: 237389 URL: http://svn.freebsd.org/changeset/base/237389 Log: MFC: r231617 Add ARM relocations types used for thread-local storage Reviewed by: cognet Modified: stable/8/sys/sys/elf_common.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/sys/elf_common.h ============================================================================== --- stable/8/sys/sys/elf_common.h Thu Jun 21 12:10:08 2012 (r237388) +++ stable/8/sys/sys/elf_common.h Thu Jun 21 12:10:09 2012 (r237389) @@ -630,6 +630,10 @@ typedef struct { #define R_ARM_THM_SWI8 14 #define R_ARM_XPC25 15 #define R_ARM_THM_XPC22 16 +/* TLS relocations */ +#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */ +#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */ +#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */ #define R_ARM_COPY 20 /* Copy data from shared object. */ #define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */ #define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */ From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 12:47:21 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE588106566C; Thu, 21 Jun 2012 12:47:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEE8B8FC1A; Thu, 21 Jun 2012 12:47: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 q5LClLSw013499; Thu, 21 Jun 2012 12:47:21 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LClLia013497; Thu, 21 Jun 2012 12:47:21 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201206211247.q5LClLia013497@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 21 Jun 2012 12:47: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: r237391 - stable/9/sys/geom/part X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 12:47:22 -0000 Author: ae Date: Thu Jun 21 12:47:21 2012 New Revision: 237391 URL: http://svn.freebsd.org/changeset/base/237391 Log: MFC r237057: Always reconstruct partition entries in the PMBR when Boot Camp is disabled. This helps to easily recover from situations when PMBR is damaged and contains no entries. Modified: stable/9/sys/geom/part/g_part_gpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/9/sys/geom/part/g_part_gpt.c Thu Jun 21 12:26:12 2012 (r237390) +++ stable/9/sys/geom/part/g_part_gpt.c Thu Jun 21 12:47:21 2012 (r237391) @@ -339,9 +339,6 @@ gpt_update_bootcamp(struct g_part_table disable: table->bootcamp = 0; - bzero(table->mbr + DOSPARTOFF, DOSPARTSIZE * NDOSPART); - gpt_write_mbr_entry(table->mbr, 0, 0xee, 1ull, - MIN(table->lba[GPT_ELT_SECHDR], UINT32_MAX)); } static struct gpt_hdr * @@ -587,10 +584,6 @@ g_part_gpt_bootcode(struct g_part_table codesz = MIN(codesz, gpp->gpp_codesize); if (codesz > 0) bcopy(gpp->gpp_codeptr, table->mbr, codesz); - - /* Mark the PMBR active since some BIOS require it. */ - if (!table->bootcamp) - table->mbr[DOSPARTOFF] = 0x80; /* status */ return (0); } @@ -599,7 +592,6 @@ g_part_gpt_create(struct g_part_table *b { struct g_provider *pp; struct g_part_gpt_table *table; - quad_t last; size_t tblsz; /* We don't nest, which means that our depth should be 0. */ @@ -615,11 +607,6 @@ g_part_gpt_create(struct g_part_table *b pp->sectorsize) return (ENOSPC); - last = (pp->mediasize / pp->sectorsize) - 1; - - le16enc(table->mbr + DOSMAGICOFFSET, DOSMAGIC); - gpt_write_mbr_entry(table->mbr, 0, 0xee, 1, MIN(last, UINT32_MAX)); - /* Allocate space for the header */ table->hdr = g_malloc(sizeof(struct gpt_hdr), M_WAITOK | M_ZERO); @@ -1045,6 +1032,16 @@ g_part_gpt_write(struct g_part_table *ba if (table->bootcamp) gpt_update_bootcamp(basetable); + /* Update partition entries in the PMBR if Boot Camp disabled. */ + if (!table->bootcamp) { + bzero(table->mbr + DOSPARTOFF, DOSPARTSIZE * NDOSPART); + gpt_write_mbr_entry(table->mbr, 0, 0xee, 1, + MIN(pp->mediasize / pp->sectorsize - 1, UINT32_MAX)); + /* Mark the PMBR active since some BIOS require it. */ + table->mbr[DOSPARTOFF] = 0x80; + } + le16enc(table->mbr + DOSMAGICOFFSET, DOSMAGIC); + /* Write the PMBR */ buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); bcopy(table->mbr, buf, MBRSIZE); From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 13:01:01 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BAF51065676; Thu, 21 Jun 2012 13:01:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B58D8FC08; Thu, 21 Jun 2012 13:01: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 q5LD11iI014197; Thu, 21 Jun 2012 13:01:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LD11fw014192; Thu, 21 Jun 2012 13:01:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211301.q5LD11fw014192@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 13:01: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: r237394 - in stable/9/libexec/rtld-elf: . arm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 13:01:01 -0000 Author: marius Date: Thu Jun 21 13:01:00 2012 New Revision: 237394 URL: http://svn.freebsd.org/changeset/base/237394 Log: MFC: r231618, r233231 (partial) Add thread-local storage support for ARM to rtld-elf Reviewed by: cognet Obtained from: NetBSD Modified: stable/9/libexec/rtld-elf/arm/reloc.c stable/9/libexec/rtld-elf/arm/rtld_machdep.h stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/arm/reloc.c ============================================================================== --- stable/9/libexec/rtld-elf/arm/reloc.c Thu Jun 21 12:52:15 2012 (r237393) +++ stable/9/libexec/rtld-elf/arm/reloc.c Thu Jun 21 13:01:00 2012 (r237394) @@ -10,6 +10,9 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include "machine/sysarch.h" + #include "debug.h" #include "rtld.h" @@ -235,6 +238,63 @@ reloc_nonplt_object(Obj_Entry *obj, cons dbg("COPY (avoid in main)"); break; + case R_ARM_TLS_DTPOFF32: + def = find_symdef(symnum, obj, &defobj, flags, cache, + lockstate); + if (def == NULL) + return -1; + + tmp = (Elf_Addr)(def->st_value); + if (__predict_true(RELOC_ALIGNED_P(where))) + *where = tmp; + else + store_ptr(where, tmp); + + dbg("TLS_DTPOFF32 %s in %s --> %p", + obj->strtab + obj->symtab[symnum].st_name, + obj->path, (void *)tmp); + + break; + case R_ARM_TLS_DTPMOD32: + def = find_symdef(symnum, obj, &defobj, flags, cache, + lockstate); + if (def == NULL) + return -1; + + tmp = (Elf_Addr)(defobj->tlsindex); + if (__predict_true(RELOC_ALIGNED_P(where))) + *where = tmp; + else + store_ptr(where, tmp); + + dbg("TLS_DTPMOD32 %s in %s --> %p", + obj->strtab + obj->symtab[symnum].st_name, + obj->path, (void *)tmp); + + break; + + case R_ARM_TLS_TPOFF32: + def = find_symdef(symnum, obj, &defobj, flags, cache, + lockstate); + if (def == NULL) + return -1; + + if (!defobj->tls_done && allocate_tls_offset(obj)) + return -1; + + /* XXX: FIXME */ + tmp = (Elf_Addr)def->st_value + defobj->tlsoffset + + TLS_TCB_SIZE; + if (__predict_true(RELOC_ALIGNED_P(where))) + *where = tmp; + else + store_ptr(where, tmp); + dbg("TLS_TPOFF32 %s in %s --> %p", + obj->strtab + obj->symtab[symnum].st_name, + obj->path, (void *)tmp); + break; + + default: dbg("sym = %lu, type = %lu, offset = %p, " "contents = %p, symbol = %s", @@ -373,11 +433,26 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr void allocate_initial_tls(Obj_Entry *objs) { - + void **_tp = (void **)ARM_TP_ADDRESS; + + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic modules to + * use. + */ + + tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; + + (*_tp) = (void *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8); } void * __tls_get_addr(tls_index* ti) { - return (NULL); + void **_tp = (void **)ARM_TP_ADDRESS; + char *p; + + p = tls_get_addr_common((Elf_Addr **)(*_tp), ti->ti_module, ti->ti_offset); + + return (p); } Modified: stable/9/libexec/rtld-elf/arm/rtld_machdep.h ============================================================================== --- stable/9/libexec/rtld-elf/arm/rtld_machdep.h Thu Jun 21 12:52:15 2012 (r237393) +++ stable/9/libexec/rtld-elf/arm/rtld_machdep.h Thu Jun 21 13:01:00 2012 (r237394) @@ -51,20 +51,20 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, #define call_init_pointer(obj, target) \ (((InitArrFunc)(target))(main_argc, main_argv, environ)) +#define TLS_TCB_SIZE 8 typedef struct { unsigned long ti_module; unsigned long ti_offset; } tls_index; #define round(size, align) \ - (((size) + (align) - 1) & ~((align) - 1)) + (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(size, align) + round(8, align) #define calculate_tls_offset(prev_offset, prev_size, size, align) \ - round(prev_offset + prev_size, align) + round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) - /* * Lazy binding entry point, called via PLT. */ Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Thu Jun 21 12:52:15 2012 (r237393) +++ stable/9/libexec/rtld-elf/rtld.c Thu Jun 21 13:01:00 2012 (r237394) @@ -3937,9 +3937,7 @@ tls_get_addr_common(Elf_Addr **dtvp, int return (tls_get_addr_slow(dtvp, index, offset)); } -/* XXX not sure what variants to use for arm. */ - -#if defined(__ia64__) || defined(__powerpc__) +#if defined(__arm__) || defined(__ia64__) || defined(__powerpc__) /* * Allocate Static TLS using the Variant I method. @@ -4021,7 +4019,7 @@ free_tls(void *tcb, size_t tcbsize, size #endif #if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) || \ - defined(__arm__) || defined(__mips__) + defined(__mips__) /* * Allocate Static TLS using the Variant II method. From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 13:39:56 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB6BF1065675; Thu, 21 Jun 2012 13:39:56 +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 D562A8FC22; Thu, 21 Jun 2012 13:39: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 q5LDduTO015843; Thu, 21 Jun 2012 13:39:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LDdumX015841; Thu, 21 Jun 2012 13:39:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211339.q5LDdumX015841@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 13:39: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: r237395 - stable/9/lib/libc/gen X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 13:39:57 -0000 Author: marius Date: Thu Jun 21 13:39:56 2012 New Revision: 237395 URL: http://svn.freebsd.org/changeset/base/237395 Log: MFC: r232582 (partial) - Switch ARM to TLS Variant I. - Fix TLS allocation for Variant I: both rtld and libc allocators assume that tls_static_space includes space for TLS structure. So increment calculated static size by the size of it. Modified: stable/9/lib/libc/gen/tls.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/lib/libc/uuid/ (props changed) Modified: stable/9/lib/libc/gen/tls.c ============================================================================== --- stable/9/lib/libc/gen/tls.c Thu Jun 21 13:01:00 2012 (r237394) +++ stable/9/lib/libc/gen/tls.c Thu Jun 21 13:39:56 2012 (r237395) @@ -66,11 +66,12 @@ void __libc_free_tls(void *tls, size_t t #error TLS_TCB_ALIGN undefined for target architecture #endif -#if defined(__ia64__) || defined(__powerpc__) +#if defined(__arm__) || defined(__ia64__) || \ + defined(__powerpc__) #define TLS_VARIANT_I #endif #if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) || \ - defined(__arm__) || defined(__mips__) + defined(__mips__) #define TLS_VARIANT_II #endif @@ -308,6 +309,13 @@ _init_tls() } } +#ifdef TLS_VARIANT_I + /* + * tls_static_space should include space for TLS structure + */ + tls_static_space += TLS_TCB_SIZE; +#endif + tls = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN); _set_tp(tls); From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 13:51:51 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BC5F106566B; Thu, 21 Jun 2012 13:51:51 +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 4622C8FC14; Thu, 21 Jun 2012 13:51: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 q5LDpptf016408; Thu, 21 Jun 2012 13:51:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LDppvr016406; Thu, 21 Jun 2012 13:51:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211351.q5LDppvr016406@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 13:51: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: r237396 - stable/9/lib/libc/arm/gen X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 13:51:51 -0000 Author: marius Date: Thu Jun 21 13:51:50 2012 New Revision: 237396 URL: http://svn.freebsd.org/changeset/base/237396 Log: MFC: r233106, r233107 Fix TLS for statically linked binaries. Modified: stable/9/lib/libc/arm/gen/_set_tp.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/lib/libc/uuid/ (props changed) Modified: stable/9/lib/libc/arm/gen/_set_tp.c ============================================================================== --- stable/9/lib/libc/arm/gen/_set_tp.c Thu Jun 21 13:39:56 2012 (r237395) +++ stable/9/lib/libc/arm/gen/_set_tp.c Thu Jun 21 13:51:50 2012 (r237396) @@ -27,9 +27,13 @@ */ #include -#include +#include + +#include void _set_tp(void *tp) { + + *((struct tcb **)ARM_TP_ADDRESS) = tp; } From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 13:53:29 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40FEC106566B; Thu, 21 Jun 2012 13:53:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AFE48FC15; Thu, 21 Jun 2012 13:53: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 q5LDrT05016507; Thu, 21 Jun 2012 13:53:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LDrSxI016504; Thu, 21 Jun 2012 13:53:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211353.q5LDrSxI016504@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 13:53:28 +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: r237397 - in stable/9/lib/libthr/arch/arm: arm include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 13:53:29 -0000 Author: marius Date: Thu Jun 21 13:53:28 2012 New Revision: 237397 URL: http://svn.freebsd.org/changeset/base/237397 Log: MFC: r231619 Add thread-local storage support for arm: - Switch to Variant I TCB layout - Use function from rtld for TCB allocation/deallocation Modified: stable/9/lib/libthr/arch/arm/arm/pthread_md.c stable/9/lib/libthr/arch/arm/include/pthread_md.h Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/arch/arm/arm/pthread_md.c ============================================================================== --- stable/9/lib/libthr/arch/arm/arm/pthread_md.c Thu Jun 21 13:51:50 2012 (r237396) +++ stable/9/lib/libthr/arch/arm/arm/pthread_md.c Thu Jun 21 13:53:28 2012 (r237397) @@ -37,14 +37,17 @@ _tcb_ctor(struct pthread *thread, int in { struct tcb *tcb; - tcb = malloc(sizeof(struct tcb)); + tcb = _rtld_allocate_tls((initial) ? _tcb_get() : NULL, + sizeof(struct tcb), 16); if (tcb) tcb->tcb_thread = thread; + return (tcb); } void _tcb_dtor(struct tcb *tcb) { - free(tcb); + + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } Modified: stable/9/lib/libthr/arch/arm/include/pthread_md.h ============================================================================== --- stable/9/lib/libthr/arch/arm/include/pthread_md.h Thu Jun 21 13:51:50 2012 (r237396) +++ stable/9/lib/libthr/arch/arm/include/pthread_md.h Thu Jun 21 13:53:28 2012 (r237397) @@ -43,10 +43,8 @@ * Variant II tcb, first two members are required by rtld. */ struct tcb { - struct tcb *tcb_self; /* required by rtld */ void *tcb_dtv; /* required by rtld */ struct pthread *tcb_thread; /* our hook */ - void *tcb_spare[1]; }; /* From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 14:55:35 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B719210657A2; Thu, 21 Jun 2012 14:55:35 +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 973D78FC1A; Thu, 21 Jun 2012 14:55: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 q5LEtZTN019444; Thu, 21 Jun 2012 14:55:35 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LEtZOD019442; Thu, 21 Jun 2012 14:55:35 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201206211455.q5LEtZOD019442@svn.freebsd.org> From: Fabien Thomas Date: Thu, 21 Jun 2012 14:55: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: r237400 - stable/8/sys/dev/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 14:55:35 -0000 Author: fabient Date: Thu Jun 21 14:55:35 2012 New Revision: 237400 URL: http://svn.freebsd.org/changeset/base/237400 Log: MFC r221839: Allow direct children of PCI-ISA bridges to allocate resources from the parent PCI bus. Heavily inspired by jhb@ and a similar implementation present in sys/dev/pci/vga_pci.c. Modified: stable/8/sys/dev/pci/isa_pci.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/pci/isa_pci.c ============================================================================== --- stable/8/sys/dev/pci/isa_pci.c Thu Jun 21 14:37:05 2012 (r237399) +++ stable/8/sys/dev/pci/isa_pci.c Thu Jun 21 14:55:35 2012 (r237400) @@ -45,12 +45,22 @@ __FBSDID("$FreeBSD$"); #include #include -static int isab_probe(device_t dev); +#include +#include +#include + +static int isab_pci_probe(device_t dev); +static int isab_pci_attach(device_t dev); +static struct resource * isab_pci_alloc_resource(device_t dev, + device_t child, int type, int *rid, u_long start, u_long end, u_long count, + u_int flags); +static int isab_pci_release_resource(device_t dev, device_t child, + int type, int rid, struct resource *r); static device_method_t isab_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, isab_probe), - DEVMETHOD(device_attach, isab_attach), + DEVMETHOD(device_probe, isab_pci_probe), + DEVMETHOD(device_attach, isab_pci_attach), DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), @@ -58,8 +68,8 @@ static device_method_t isab_methods[] = /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_alloc_resource, isab_pci_alloc_resource), + DEVMETHOD(bus_release_resource, isab_pci_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), @@ -68,10 +78,19 @@ static device_method_t isab_methods[] = DEVMETHOD_END }; +struct isab_pci_resource { + struct resource *ip_res; + int ip_refs; +}; + +struct isab_pci_softc { + struct isab_pci_resource isab_pci_res[PCIR_MAX_BAR_0 + 1]; +}; + static driver_t isab_driver = { "isab", isab_methods, - 0, + sizeof(struct isab_pci_softc), }; DRIVER_MODULE(isab, pci, isab_driver, isab_devclass, 0, 0); @@ -81,7 +100,7 @@ DRIVER_MODULE(isab, pci, isab_driver, is * report themselves. */ static int -isab_probe(device_t dev) +isab_pci_probe(device_t dev) { int matched = 0; @@ -139,3 +158,88 @@ isab_probe(device_t dev) } return(ENXIO); } + +static int +isab_pci_attach(device_t dev) +{ + + bus_generic_probe(dev); + return (isab_attach(dev)); +} + +static struct resource * +isab_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct isab_pci_softc *sc; + int bar; + + if (device_get_parent(child) != dev) + return bus_generic_alloc_resource(dev, child, type, rid, start, + end, count, flags); + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + /* + * For BARs, we cache the resource so that we only allocate it + * from the PCI bus once. + */ + bar = PCI_RID2BAR(*rid); + if (bar < 0 || bar > PCIR_MAX_BAR_0) + return (NULL); + sc = device_get_softc(dev); + if (sc->isab_pci_res[bar].ip_res == NULL) + sc->isab_pci_res[bar].ip_res = bus_alloc_resource(dev, type, + rid, start, end, count, flags); + if (sc->isab_pci_res[bar].ip_res != NULL) + sc->isab_pci_res[bar].ip_refs++; + return (sc->isab_pci_res[bar].ip_res); + } + + return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, + start, end, count, flags)); +} + +static int +isab_pci_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct isab_pci_softc *sc; + int bar, error; + + if (device_get_parent(child) != dev) + return bus_generic_release_resource(dev, child, type, rid, r); + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + /* + * For BARs, we release the resource from the PCI bus + * when the last child reference goes away. + */ + bar = PCI_RID2BAR(rid); + if (bar < 0 || bar > PCIR_MAX_BAR_0) + return (EINVAL); + sc = device_get_softc(dev); + if (sc->isab_pci_res[bar].ip_res == NULL) + return (EINVAL); + KASSERT(sc->isab_pci_res[bar].ip_res == r, + ("isa_pci resource mismatch")); + if (sc->isab_pci_res[bar].ip_refs > 1) { + sc->isab_pci_res[bar].ip_refs--; + return (0); + } + KASSERT(sc->isab_pci_res[bar].ip_refs > 0, + ("isa_pci resource reference count underflow")); + error = bus_release_resource(dev, type, rid, r); + if (error == 0) { + sc->isab_pci_res[bar].ip_res = NULL; + sc->isab_pci_res[bar].ip_refs = 0; + } + return (error); + } + + return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, type, + rid, r)); +} From owner-svn-src-stable@FreeBSD.ORG Thu Jun 21 16:48:57 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F593106564A; Thu, 21 Jun 2012 16:48:57 +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 2002E8FC08; Thu, 21 Jun 2012 16:48: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 q5LGmukC024850; Thu, 21 Jun 2012 16:48:56 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LGmuhg024848; Thu, 21 Jun 2012 16:48:56 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201206211648.q5LGmuhg024848@svn.freebsd.org> From: Mitsuru IWASAKI Date: Thu, 21 Jun 2012 16:48: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: r237405 - stable/9/sys/dev/acpica X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 16:48:57 -0000 Author: iwasaki Date: Thu Jun 21 16:48:56 2012 New Revision: 237405 URL: http://svn.freebsd.org/changeset/base/237405 Log: MFC r237197: - Resotre LCD brightness level on resuming. Modified: stable/9/sys/dev/acpica/acpi_video.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_video.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_video.c Thu Jun 21 16:37:36 2012 (r237404) +++ stable/9/sys/dev/acpica/acpi_video.c Thu Jun 21 16:48:56 2012 (r237405) @@ -75,6 +75,7 @@ static void acpi_video_identify(driver_t static int acpi_video_probe(device_t); static int acpi_video_attach(device_t); static int acpi_video_detach(device_t); +static int acpi_video_resume(device_t); static int acpi_video_shutdown(device_t); static void acpi_video_notify_handler(ACPI_HANDLE, UINT32, void *); static void acpi_video_power_profile(void *); @@ -155,6 +156,7 @@ static device_method_t acpi_video_method DEVMETHOD(device_probe, acpi_video_probe), DEVMETHOD(device_attach, acpi_video_attach), DEVMETHOD(device_detach, acpi_video_detach), + DEVMETHOD(device_resume, acpi_video_resume), DEVMETHOD(device_shutdown, acpi_video_shutdown), { 0, 0 } }; @@ -305,6 +307,36 @@ acpi_video_detach(device_t dev) } static int +acpi_video_resume(device_t dev) +{ + struct acpi_video_softc *sc; + struct acpi_video_output *vo, *vn; + int level; + + sc = device_get_softc(dev); + + /* Restore brightness level */ + ACPI_SERIAL_BEGIN(video); + ACPI_SERIAL_BEGIN(video_output); + STAILQ_FOREACH_SAFE(vo, &sc->vid_outputs, vo_next, vn) { + if ((vo->adr & DOD_DEVID_MASK_FULL) != DOD_DEVID_LCD && + (vo->adr & DOD_DEVID_MASK) != DOD_DEVID_INTDFP) + continue; + + if ((vo_get_device_status(vo->handle) & DCS_ACTIVE) == 0) + continue; + + level = vo_get_brightness(vo->handle); + if (level != -1) + vo_set_brightness(vo->handle, level); + } + ACPI_SERIAL_END(video_output); + ACPI_SERIAL_END(video); + + return (0); +} + +static int acpi_video_shutdown(device_t dev) { struct acpi_video_softc *sc; From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:23:40 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89DAE106564A; Fri, 22 Jun 2012 05:23:40 +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 398B48FC0A; Fri, 22 Jun 2012 05:23: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 q5M5NeJq057463; Fri, 22 Jun 2012 05:23:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5Neeg057461; Fri, 22 Jun 2012 05:23:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220523.q5M5Neeg057461@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:23:40 +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: r237415 - stable/9/usr.sbin/kldxref X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:23:40 -0000 Author: eadler Date: Fri Jun 22 05:23:39 2012 New Revision: 237415 URL: http://svn.freebsd.org/changeset/base/237415 Log: MFC r237258: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/kldxref/ef.c Directory Properties: stable/9/usr.sbin/kldxref/ (props changed) Modified: stable/9/usr.sbin/kldxref/ef.c ============================================================================== --- stable/9/usr.sbin/kldxref/ef.c Fri Jun 22 05:01:36 2012 (r237414) +++ stable/9/usr.sbin/kldxref/ef.c Fri Jun 22 05:23:39 2012 (r237415) @@ -532,7 +532,7 @@ ef_open(const char *filename, struct elf int error; int phlen, res; int nsegs; - Elf_Phdr *phdr, *phdyn, *phphdr, *phlimit; + Elf_Phdr *phdr, *phdyn, *phlimit; if (filename == NULL) return EFTYPE; @@ -576,7 +576,6 @@ ef_open(const char *filename, struct elf phlimit = phdr + hdr->e_phnum; nsegs = 0; phdyn = NULL; - phphdr = NULL; while (phdr < phlimit) { if (verbose > 1) ef_print_phdr(phdr); @@ -590,7 +589,6 @@ ef_open(const char *filename, struct elf ef->ef_segs[nsegs++] = phdr; break; case PT_PHDR: - phphdr = phdr; break; case PT_DYNAMIC: phdyn = phdr; From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:23:49 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBCD110657A3; Fri, 22 Jun 2012 05:23:49 +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 D60EA8FC0A; Fri, 22 Jun 2012 05:23: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 q5M5Nnc6057534; Fri, 22 Jun 2012 05:23:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5Nnd0057532; Fri, 22 Jun 2012 05:23:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220523.q5M5Nnd0057532@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:23: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: r237416 - stable/8/usr.sbin/kldxref X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:23:50 -0000 Author: eadler Date: Fri Jun 22 05:23:49 2012 New Revision: 237416 URL: http://svn.freebsd.org/changeset/base/237416 Log: MFC r237258: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/kldxref/ef.c Directory Properties: stable/8/usr.sbin/kldxref/ (props changed) Modified: stable/8/usr.sbin/kldxref/ef.c ============================================================================== --- stable/8/usr.sbin/kldxref/ef.c Fri Jun 22 05:23:39 2012 (r237415) +++ stable/8/usr.sbin/kldxref/ef.c Fri Jun 22 05:23:49 2012 (r237416) @@ -532,7 +532,7 @@ ef_open(const char *filename, struct elf int error; int phlen, res; int nsegs; - Elf_Phdr *phdr, *phdyn, *phphdr, *phlimit; + Elf_Phdr *phdr, *phdyn, *phlimit; if (filename == NULL) return EFTYPE; @@ -576,7 +576,6 @@ ef_open(const char *filename, struct elf phlimit = phdr + hdr->e_phnum; nsegs = 0; phdyn = NULL; - phphdr = NULL; while (phdr < phlimit) { if (verbose > 1) ef_print_phdr(phdr); @@ -590,7 +589,6 @@ ef_open(const char *filename, struct elf ef->ef_segs[nsegs++] = phdr; break; case PT_PHDR: - phphdr = phdr; break; case PT_DYNAMIC: phdyn = phdr; From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:23:50 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FB2D10657A4; Fri, 22 Jun 2012 05:23:50 +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 EE5278FC0C; Fri, 22 Jun 2012 05:23: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 q5M5NnGZ057538; Fri, 22 Jun 2012 05:23:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5NnqV057536; Fri, 22 Jun 2012 05:23:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220523.q5M5NnqV057536@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237417 - stable/7/usr.sbin/kldxref X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:23:50 -0000 Author: eadler Date: Fri Jun 22 05:23:49 2012 New Revision: 237417 URL: http://svn.freebsd.org/changeset/base/237417 Log: MFC r237258: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva (implicit) Modified: stable/7/usr.sbin/kldxref/ef.c Directory Properties: stable/7/usr.sbin/kldxref/ (props changed) Modified: stable/7/usr.sbin/kldxref/ef.c ============================================================================== --- stable/7/usr.sbin/kldxref/ef.c Fri Jun 22 05:23:49 2012 (r237416) +++ stable/7/usr.sbin/kldxref/ef.c Fri Jun 22 05:23:49 2012 (r237417) @@ -532,7 +532,7 @@ ef_open(const char *filename, struct elf int error; int phlen, res; int nsegs; - Elf_Phdr *phdr, *phdyn, *phphdr, *phlimit; + Elf_Phdr *phdr, *phdyn, *phlimit; if (filename == NULL) return EFTYPE; @@ -576,7 +576,6 @@ ef_open(const char *filename, struct elf phlimit = phdr + hdr->e_phnum; nsegs = 0; phdyn = NULL; - phphdr = NULL; while (phdr < phlimit) { if (verbose > 1) ef_print_phdr(phdr); @@ -590,7 +589,6 @@ ef_open(const char *filename, struct elf ef->ef_segs[nsegs++] = phdr; break; case PT_PHDR: - phphdr = phdr; break; case PT_DYNAMIC: phdyn = phdr; From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:36:38 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 461C11065672; Fri, 22 Jun 2012 05:36:38 +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 2654B8FC08; Fri, 22 Jun 2012 05:36: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 q5M5acfh058228; Fri, 22 Jun 2012 05:36:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5abqv058225; Fri, 22 Jun 2012 05:36:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220536.q5M5abqv058225@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237418 - in stable/7: lib/libncp sys/netncp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:36:38 -0000 Author: eadler Date: Fri Jun 22 05:36:37 2012 New Revision: 237418 URL: http://svn.freebsd.org/changeset/base/237418 Log: MFC r236376: Add characters mapping for codepages used in Germany. PR: bin/163847 Approved by: cperciva (implicit) Modified: stable/7/lib/libncp/ncpl_nls.c stable/7/sys/netncp/ncp_nls.h Directory Properties: stable/7/lib/libncp/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/lib/libncp/ncpl_nls.c ============================================================================== --- stable/7/lib/libncp/ncpl_nls.c Fri Jun 22 05:23:49 2012 (r237417) +++ stable/7/lib/libncp/ncpl_nls.c Fri Jun 22 05:36:37 2012 (r237418) @@ -200,6 +200,79 @@ static u_int8_t se_unix2nw[] = { 0x9c, 0x9b, 0x87, 0x98, 0x9d, 0x99, 0x97, 0x9a }; +/* + * Characters mapping for codepages used in Germany. + */ +static u_int8_t de_nw2unix[] = { + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0xb6, 0xa7, 0x5f, 0x5f, /* 0x10 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0xc7, 0xfc, 0xe9, 0xe2, 0xe4, 0xe0, 0xe5, 0xe7, /* 0x80 */ + 0xea, 0xeb, 0xe8, 0xef, 0xee, 0xec, 0xc4, 0xc5, + 0xc9, 0xe6, 0xc6, 0xf4, 0xf6, 0xf2, 0xfb, 0xf9, /* 0x90 */ + 0xff, 0xd6, 0xdc, 0xa2, 0xa3, 0xa5, 0x5f, 0x5f, + 0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xaa, 0xba, /* 0xA0 */ + 0xbf, 0x5f, 0xac, 0xbd, 0xbc, 0xa1, 0xab, 0xbb, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xB0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xC0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xD0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0xdf, 0x5f, 0x5f, 0x5f, 0x5f, 0xb5, 0x5f, /* 0xE0 */ + 0x5f, 0x5f, 0x5f, 0xf0, 0x5f, 0xf8, 0x5f, 0x5f, + 0x5f, 0xb1, 0x5f, 0x5f, 0x5f, 0x5f, 0xf7, 0x5f, /* 0xF0 */ + 0xb0, 0x5f, 0xb7, 0x5f, 0x5f, 0xb2, 0x5f, 0xa0 +}; + +static u_int8_t de_unix2nw[] = { + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x10 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x80 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x90 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0xff, 0xad, 0x9b, 0x9c, 0x5f, 0x9d, 0x5f, 0x15, /* 0xA0 */ + 0x5f, 0x5f, 0xa6, 0xae, 0xaa, 0x5f, 0x5f, 0x5f, + 0xf8, 0xf1, 0xfd, 0x5f, 0x5f, 0xe6, 0x14, 0xfa, /* 0xB0 */ + 0x5f, 0x5f, 0xa7, 0xaf, 0xac, 0xab, 0x5f, 0xa8, + 0x5f, 0x5f, 0x5f, 0x5f, 0x8e, 0x8f, 0x92, 0x80, /* 0xC0 */ + 0x5f, 0x90, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0xa5, 0x5f, 0x5f, 0x5f, 0x5f, 0x99, 0x5f, /* 0xD0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x9a, 0x5f, 0x5f, 0xe1, + 0x85, 0xa0, 0x83, 0x5f, 0x84, 0x86, 0x91, 0x87, /* 0xE0 */ + 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, + 0xeb, 0xa4, 0x95, 0xa2, 0x93, 0x5f, 0x94, 0xf6, /* 0xF0 */ + 0xed, 0x97, 0xa3, 0x96, 0x81, 0x5f, 0x5f, 0x98 +}; + static u_int8_t def2lower[256]; static u_int8_t def2upper[256]; @@ -225,6 +298,9 @@ static struct ncp_nlsdesc ncp_nlslist[] {NCP_NLS_SE, NCP_NLS_SE_NAME, {def2lower, def2upper, se_nw2unix, se_unix2nw, 0} }, + {NCP_NLS_DE, NCP_NLS_DE_NAME, + {def2lower, def2upper, de_nw2unix, de_unix2nw, 0} + }, {0} }; Modified: stable/7/sys/netncp/ncp_nls.h ============================================================================== --- stable/7/sys/netncp/ncp_nls.h Fri Jun 22 05:23:49 2012 (r237417) +++ stable/7/sys/netncp/ncp_nls.h Fri Jun 22 05:36:37 2012 (r237418) @@ -58,9 +58,11 @@ struct ncp_nlstables { #define NCP_NLS_AS_IS 1 #define NCP_NLS_AS_IS_NAME "asis" #define NCP_NLS_KOI_866 2 -#define NCP_NLS_SE 3 #define NCP_NLS_KOI_866_NAME "koi2cp866" +#define NCP_NLS_SE 3 #define NCP_NLS_SE_NAME "se" +#define NCP_NLS_DE 4 +#define NCP_NLS_DE_NAME "de" extern struct ncp_nlstables ncp_nls; /* active nls */ From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:36:43 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71BDD1065673; Fri, 22 Jun 2012 05:36:43 +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 51ECA8FC16; Fri, 22 Jun 2012 05:36: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 q5M5ahLG058269; Fri, 22 Jun 2012 05:36:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5ahAb058266; Fri, 22 Jun 2012 05:36:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220536.q5M5ahAb058266@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:36: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: r237419 - in stable/8: lib/libncp sys/netncp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:36:43 -0000 Author: eadler Date: Fri Jun 22 05:36:42 2012 New Revision: 237419 URL: http://svn.freebsd.org/changeset/base/237419 Log: MFC r236376: Add characters mapping for codepages used in Germany. PR: bin/163847 Approved by: cperciva (implicit) Modified: stable/8/lib/libncp/ncpl_nls.c stable/8/sys/netncp/ncp_nls.h Directory Properties: stable/8/lib/libncp/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/lib/libncp/ncpl_nls.c ============================================================================== --- stable/8/lib/libncp/ncpl_nls.c Fri Jun 22 05:36:37 2012 (r237418) +++ stable/8/lib/libncp/ncpl_nls.c Fri Jun 22 05:36:42 2012 (r237419) @@ -200,6 +200,79 @@ static u_int8_t se_unix2nw[] = { 0x9c, 0x9b, 0x87, 0x98, 0x9d, 0x99, 0x97, 0x9a }; +/* + * Characters mapping for codepages used in Germany. + */ +static u_int8_t de_nw2unix[] = { + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0xb6, 0xa7, 0x5f, 0x5f, /* 0x10 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0xc7, 0xfc, 0xe9, 0xe2, 0xe4, 0xe0, 0xe5, 0xe7, /* 0x80 */ + 0xea, 0xeb, 0xe8, 0xef, 0xee, 0xec, 0xc4, 0xc5, + 0xc9, 0xe6, 0xc6, 0xf4, 0xf6, 0xf2, 0xfb, 0xf9, /* 0x90 */ + 0xff, 0xd6, 0xdc, 0xa2, 0xa3, 0xa5, 0x5f, 0x5f, + 0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xaa, 0xba, /* 0xA0 */ + 0xbf, 0x5f, 0xac, 0xbd, 0xbc, 0xa1, 0xab, 0xbb, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xB0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xC0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xD0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0xdf, 0x5f, 0x5f, 0x5f, 0x5f, 0xb5, 0x5f, /* 0xE0 */ + 0x5f, 0x5f, 0x5f, 0xf0, 0x5f, 0xf8, 0x5f, 0x5f, + 0x5f, 0xb1, 0x5f, 0x5f, 0x5f, 0x5f, 0xf7, 0x5f, /* 0xF0 */ + 0xb0, 0x5f, 0xb7, 0x5f, 0x5f, 0xb2, 0x5f, 0xa0 +}; + +static u_int8_t de_unix2nw[] = { + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x10 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x80 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x90 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0xff, 0xad, 0x9b, 0x9c, 0x5f, 0x9d, 0x5f, 0x15, /* 0xA0 */ + 0x5f, 0x5f, 0xa6, 0xae, 0xaa, 0x5f, 0x5f, 0x5f, + 0xf8, 0xf1, 0xfd, 0x5f, 0x5f, 0xe6, 0x14, 0xfa, /* 0xB0 */ + 0x5f, 0x5f, 0xa7, 0xaf, 0xac, 0xab, 0x5f, 0xa8, + 0x5f, 0x5f, 0x5f, 0x5f, 0x8e, 0x8f, 0x92, 0x80, /* 0xC0 */ + 0x5f, 0x90, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0xa5, 0x5f, 0x5f, 0x5f, 0x5f, 0x99, 0x5f, /* 0xD0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x9a, 0x5f, 0x5f, 0xe1, + 0x85, 0xa0, 0x83, 0x5f, 0x84, 0x86, 0x91, 0x87, /* 0xE0 */ + 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, + 0xeb, 0xa4, 0x95, 0xa2, 0x93, 0x5f, 0x94, 0xf6, /* 0xF0 */ + 0xed, 0x97, 0xa3, 0x96, 0x81, 0x5f, 0x5f, 0x98 +}; + static u_int8_t def2lower[256]; static u_int8_t def2upper[256]; @@ -225,6 +298,9 @@ static struct ncp_nlsdesc ncp_nlslist[] {NCP_NLS_SE, NCP_NLS_SE_NAME, {def2lower, def2upper, se_nw2unix, se_unix2nw, 0} }, + {NCP_NLS_DE, NCP_NLS_DE_NAME, + {def2lower, def2upper, de_nw2unix, de_unix2nw, 0} + }, {0} }; Modified: stable/8/sys/netncp/ncp_nls.h ============================================================================== --- stable/8/sys/netncp/ncp_nls.h Fri Jun 22 05:36:37 2012 (r237418) +++ stable/8/sys/netncp/ncp_nls.h Fri Jun 22 05:36:42 2012 (r237419) @@ -58,9 +58,11 @@ struct ncp_nlstables { #define NCP_NLS_AS_IS 1 #define NCP_NLS_AS_IS_NAME "asis" #define NCP_NLS_KOI_866 2 -#define NCP_NLS_SE 3 #define NCP_NLS_KOI_866_NAME "koi2cp866" +#define NCP_NLS_SE 3 #define NCP_NLS_SE_NAME "se" +#define NCP_NLS_DE 4 +#define NCP_NLS_DE_NAME "de" extern struct ncp_nlstables ncp_nls; /* active nls */ From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:36:50 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5CE31065674; Fri, 22 Jun 2012 05:36:50 +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 B5FAD8FC14; Fri, 22 Jun 2012 05:36: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 q5M5ao5j058311; Fri, 22 Jun 2012 05:36:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5aoru058308; Fri, 22 Jun 2012 05:36:50 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220536.q5M5aoru058308@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:36: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: r237420 - in stable/9: lib/libncp sys/netncp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:36:50 -0000 Author: eadler Date: Fri Jun 22 05:36:50 2012 New Revision: 237420 URL: http://svn.freebsd.org/changeset/base/237420 Log: MFC r236376: Add characters mapping for codepages used in Germany. PR: bin/163847 Approved by: cperciva (implicit) Modified: stable/9/lib/libncp/ncpl_nls.c stable/9/sys/netncp/ncp_nls.h Directory Properties: stable/9/lib/libncp/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/lib/libncp/ncpl_nls.c ============================================================================== --- stable/9/lib/libncp/ncpl_nls.c Fri Jun 22 05:36:42 2012 (r237419) +++ stable/9/lib/libncp/ncpl_nls.c Fri Jun 22 05:36:50 2012 (r237420) @@ -200,6 +200,79 @@ static u_int8_t se_unix2nw[] = { 0x9c, 0x9b, 0x87, 0x98, 0x9d, 0x99, 0x97, 0x9a }; +/* + * Characters mapping for codepages used in Germany. + */ +static u_int8_t de_nw2unix[] = { + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0xb6, 0xa7, 0x5f, 0x5f, /* 0x10 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0xc7, 0xfc, 0xe9, 0xe2, 0xe4, 0xe0, 0xe5, 0xe7, /* 0x80 */ + 0xea, 0xeb, 0xe8, 0xef, 0xee, 0xec, 0xc4, 0xc5, + 0xc9, 0xe6, 0xc6, 0xf4, 0xf6, 0xf2, 0xfb, 0xf9, /* 0x90 */ + 0xff, 0xd6, 0xdc, 0xa2, 0xa3, 0xa5, 0x5f, 0x5f, + 0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xaa, 0xba, /* 0xA0 */ + 0xbf, 0x5f, 0xac, 0xbd, 0xbc, 0xa1, 0xab, 0xbb, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xB0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xC0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xD0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0xdf, 0x5f, 0x5f, 0x5f, 0x5f, 0xb5, 0x5f, /* 0xE0 */ + 0x5f, 0x5f, 0x5f, 0xf0, 0x5f, 0xf8, 0x5f, 0x5f, + 0x5f, 0xb1, 0x5f, 0x5f, 0x5f, 0x5f, 0xf7, 0x5f, /* 0xF0 */ + 0xb0, 0x5f, 0xb7, 0x5f, 0x5f, 0xb2, 0x5f, 0xa0 +}; + +static u_int8_t de_unix2nw[] = { + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x10 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x80 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x90 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0xff, 0xad, 0x9b, 0x9c, 0x5f, 0x9d, 0x5f, 0x15, /* 0xA0 */ + 0x5f, 0x5f, 0xa6, 0xae, 0xaa, 0x5f, 0x5f, 0x5f, + 0xf8, 0xf1, 0xfd, 0x5f, 0x5f, 0xe6, 0x14, 0xfa, /* 0xB0 */ + 0x5f, 0x5f, 0xa7, 0xaf, 0xac, 0xab, 0x5f, 0xa8, + 0x5f, 0x5f, 0x5f, 0x5f, 0x8e, 0x8f, 0x92, 0x80, /* 0xC0 */ + 0x5f, 0x90, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0xa5, 0x5f, 0x5f, 0x5f, 0x5f, 0x99, 0x5f, /* 0xD0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x9a, 0x5f, 0x5f, 0xe1, + 0x85, 0xa0, 0x83, 0x5f, 0x84, 0x86, 0x91, 0x87, /* 0xE0 */ + 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, + 0xeb, 0xa4, 0x95, 0xa2, 0x93, 0x5f, 0x94, 0xf6, /* 0xF0 */ + 0xed, 0x97, 0xa3, 0x96, 0x81, 0x5f, 0x5f, 0x98 +}; + static u_int8_t def2lower[256]; static u_int8_t def2upper[256]; @@ -225,6 +298,9 @@ static struct ncp_nlsdesc ncp_nlslist[] {NCP_NLS_SE, NCP_NLS_SE_NAME, {def2lower, def2upper, se_nw2unix, se_unix2nw, 0} }, + {NCP_NLS_DE, NCP_NLS_DE_NAME, + {def2lower, def2upper, de_nw2unix, de_unix2nw, 0} + }, {0} }; Modified: stable/9/sys/netncp/ncp_nls.h ============================================================================== --- stable/9/sys/netncp/ncp_nls.h Fri Jun 22 05:36:42 2012 (r237419) +++ stable/9/sys/netncp/ncp_nls.h Fri Jun 22 05:36:50 2012 (r237420) @@ -52,9 +52,11 @@ struct ncp_nlstables { #define NCP_NLS_AS_IS 1 #define NCP_NLS_AS_IS_NAME "asis" #define NCP_NLS_KOI_866 2 -#define NCP_NLS_SE 3 #define NCP_NLS_KOI_866_NAME "koi2cp866" +#define NCP_NLS_SE 3 #define NCP_NLS_SE_NAME "se" +#define NCP_NLS_DE 4 +#define NCP_NLS_DE_NAME "de" extern struct ncp_nlstables ncp_nls; /* active nls */ From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:40:15 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9171E1065670; Fri, 22 Jun 2012 05:40: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 7BE868FC16; Fri, 22 Jun 2012 05:40: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 q5M5eFSs058567; Fri, 22 Jun 2012 05:40:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5eFMK058564; Fri, 22 Jun 2012 05:40:15 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220540.q5M5eFMK058564@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:40: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: r237421 - stable/9/usr.sbin/kbdmap X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:40:15 -0000 Author: eadler Date: Fri Jun 22 05:40:14 2012 New Revision: 237421 URL: http://svn.freebsd.org/changeset/base/237421 Log: MFC r237257: Remove variables which are initialized but never used thereafter reported by gcc46 warning PR: bin/163847 Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/kbdmap/kbdmap.c Directory Properties: stable/9/usr.sbin/kbdmap/ (props changed) Modified: stable/9/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- stable/9/usr.sbin/kbdmap/kbdmap.c Fri Jun 22 05:36:50 2012 (r237420) +++ stable/9/usr.sbin/kbdmap/kbdmap.c Fri Jun 22 05:40:14 2012 (r237421) @@ -327,7 +327,6 @@ show_dialog(struct keymap **km_sorted, i FILE *fp; char *cmd, *dialog; char tmp_name[] = "/tmp/_kbd_lang.XXXX"; - const char *ext; int fd, i, size; fd = mkstemp(tmp_name); @@ -339,8 +338,6 @@ show_dialog(struct keymap **km_sorted, i asprintf(&dialog, "/usr/bin/dialog --clear --title \"Keyboard Menu\" " "--menu \"%s\" 0 0 0", menu); - ext = extract_name(dir); - /* start right font, assume that current font is equal * to default font in /etc/rc.conf * From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:40:16 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BA31106564A; Fri, 22 Jun 2012 05:40:16 +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 16DED8FC18; Fri, 22 Jun 2012 05:40: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 q5M5eFk8058588; Fri, 22 Jun 2012 05:40:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5eFAG058586; Fri, 22 Jun 2012 05:40:15 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220540.q5M5eFAG058586@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:40:15 +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: r237422 - stable/7/usr.sbin/kbdmap X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:40:16 -0000 Author: eadler Date: Fri Jun 22 05:40:15 2012 New Revision: 237422 URL: http://svn.freebsd.org/changeset/base/237422 Log: MFC r237257: Remove variables which are initialized but never used thereafter reported by gcc46 warning PR: bin/163847 Approved by: cperciva (implicit) Modified: stable/7/usr.sbin/kbdmap/kbdmap.c Directory Properties: stable/7/usr.sbin/kbdmap/ (props changed) Modified: stable/7/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- stable/7/usr.sbin/kbdmap/kbdmap.c Fri Jun 22 05:40:14 2012 (r237421) +++ stable/7/usr.sbin/kbdmap/kbdmap.c Fri Jun 22 05:40:15 2012 (r237422) @@ -327,7 +327,6 @@ show_dialog(struct keymap **km_sorted, i FILE *fp; char *cmd, *dialog; char tmp_name[] = "/tmp/_kbd_lang.XXXX"; - const char *ext; int fd, i, size; fd = mkstemp(tmp_name); @@ -339,8 +338,6 @@ show_dialog(struct keymap **km_sorted, i asprintf(&dialog, "/usr/bin/dialog --clear --title \"Keyboard Menu\" " "--menu \"%s\" -1 -1 10", menu); - ext = extract_name(dir); - /* start right font, assume that current font is equal * to default font in /etc/rc.conf * From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:40:16 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66C3F106566B; Fri, 22 Jun 2012 05:40:16 +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 5181C8FC19; Fri, 22 Jun 2012 05:40: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 q5M5eGKe058602; Fri, 22 Jun 2012 05:40:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5eGq9058600; Fri, 22 Jun 2012 05:40:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220540.q5M5eGq9058600@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:40: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: r237423 - stable/8/usr.sbin/kbdmap X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:40:16 -0000 Author: eadler Date: Fri Jun 22 05:40:15 2012 New Revision: 237423 URL: http://svn.freebsd.org/changeset/base/237423 Log: MFC r237257: Remove variables which are initialized but never used thereafter reported by gcc46 warning PR: bin/163847 Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/kbdmap/kbdmap.c Directory Properties: stable/8/usr.sbin/kbdmap/ (props changed) Modified: stable/8/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- stable/8/usr.sbin/kbdmap/kbdmap.c Fri Jun 22 05:40:15 2012 (r237422) +++ stable/8/usr.sbin/kbdmap/kbdmap.c Fri Jun 22 05:40:15 2012 (r237423) @@ -327,7 +327,6 @@ show_dialog(struct keymap **km_sorted, i FILE *fp; char *cmd, *dialog; char tmp_name[] = "/tmp/_kbd_lang.XXXX"; - const char *ext; int fd, i, size; fd = mkstemp(tmp_name); @@ -339,8 +338,6 @@ show_dialog(struct keymap **km_sorted, i asprintf(&dialog, "/usr/bin/dialog --clear --title \"Keyboard Menu\" " "--menu \"%s\" -1 -1 10", menu); - ext = extract_name(dir); - /* start right font, assume that current font is equal * to default font in /etc/rc.conf * From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:42:06 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DCAB1065676; Fri, 22 Jun 2012 05:42:06 +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 18A0E8FC18; Fri, 22 Jun 2012 05:42: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 q5M5g5T3058740; Fri, 22 Jun 2012 05:42:05 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5g5e4058738; Fri, 22 Jun 2012 05:42:05 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220542.q5M5g5e4058738@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:42:05 +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: r237424 - stable/9/usr.sbin/crunch/crunchide X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:42:06 -0000 Author: eadler Date: Fri Jun 22 05:42:05 2012 New Revision: 237424 URL: http://svn.freebsd.org/changeset/base/237424 Log: MFC r237254: Remove variables which are initialized but never used thereafter reported by gcc46 warning PR: bin/163847 Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Directory Properties: stable/9/usr.sbin/crunch/ (props changed) Modified: stable/9/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Fri Jun 22 05:40:15 2012 (r237423) +++ stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Fri Jun 22 05:42:05 2012 (r237424) @@ -238,7 +238,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) Elf_Shdr *shdrp = NULL, *symtabshdr, *strtabshdr; Elf_Sym *symtabp = NULL; char *strtabp = NULL; - Elf_Size nsyms, nlocalsyms, ewi; + Elf_Size nsyms, ewi; ssize_t shdrsize; int rv, i, weird; size_t nstrtab_size, nstrtab_nextoff, fn_size; @@ -327,7 +327,6 @@ ELFNAMEEND(hide)(int fd, const char *fn) /* Prepare data structures for symbol movement. */ nsyms = xewtoh(symtabshdr->sh_size) / xewtoh(symtabshdr->sh_entsize); - nlocalsyms = xe32toh(symtabshdr->sh_info); /* move symbols, making them local */ for (ewi = 0; ewi < nsyms; ewi++) { From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:44:38 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5E371065675; Fri, 22 Jun 2012 05:44:38 +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 C14298FC21; Fri, 22 Jun 2012 05: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 q5M5icMd058907; Fri, 22 Jun 2012 05:44:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5icGh058905; Fri, 22 Jun 2012 05:44:38 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220544.q5M5icGh058905@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:44: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: r237425 - stable/9/usr.sbin/ctladm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:44:39 -0000 Author: eadler Date: Fri Jun 22 05:44:38 2012 New Revision: 237425 URL: http://svn.freebsd.org/changeset/base/237425 Log: MFC r237255: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/ctladm/ctladm.c Directory Properties: stable/9/usr.sbin/ctladm/ (props changed) Modified: stable/9/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/9/usr.sbin/ctladm/ctladm.c Fri Jun 22 05:42:05 2012 (r237424) +++ stable/9/usr.sbin/ctladm/ctladm.c Fri Jun 22 05:44:38 2012 (r237425) @@ -764,7 +764,6 @@ static int cctl_delay(int fd, int target, int lun, int argc, char **argv, char *combinedopt) { - int datamove_delay; struct ctl_io_delay_info delay_info; char *delayloc = NULL; char *delaytype = NULL; @@ -773,7 +772,6 @@ cctl_delay(int fd, int target, int lun, int c; retval = 0; - datamove_delay = 0; memset(&delay_info, 0, sizeof(delay_info)); @@ -3708,7 +3706,7 @@ CTL_DEFAULT_DEV); int main(int argc, char **argv) { - int option_index, c; + int c; ctladm_cmdfunction command; ctladm_cmdargs cmdargs; ctladm_optret optreturn; @@ -3719,10 +3717,9 @@ main(int argc, char **argv) int target, lun; int optstart = 2; int retval, fd; - int retries, timeout; + int retries; int initid; - option_index = 0; retval = 0; cmdargs = CTLADM_ARG_NONE; command = CTLADM_CMD_HELP; @@ -3731,7 +3728,6 @@ main(int argc, char **argv) retries = 0; target = 0; lun = 0; - timeout = 0; initid = 7; if (argc < 2) { From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:46:44 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99BD41065680; Fri, 22 Jun 2012 05:46:44 +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 845408FC1D; Fri, 22 Jun 2012 05:46: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 q5M5ki8t059061; Fri, 22 Jun 2012 05:46:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5kiWn059059; Fri, 22 Jun 2012 05:46:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220546.q5M5kiWn059059@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:46:44 +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: r237426 - stable/8/usr.sbin/ifmcstat X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:46:44 -0000 Author: eadler Date: Fri Jun 22 05:46:43 2012 New Revision: 237426 URL: http://svn.freebsd.org/changeset/base/237426 Log: MFC r237256: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/ifmcstat/ifmcstat.c Directory Properties: stable/8/usr.sbin/ifmcstat/ (props changed) Modified: stable/8/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- stable/8/usr.sbin/ifmcstat/ifmcstat.c Fri Jun 22 05:44:38 2012 (r237425) +++ stable/8/usr.sbin/ifmcstat/ifmcstat.c Fri Jun 22 05:46:43 2012 (r237426) @@ -388,7 +388,6 @@ ll_addrlist(struct ifaddr *ifap) struct sockaddr sa; struct sockaddr_dl sdl; struct ifaddr *ifap0; - int error; if (af && af != AF_LINK) return; @@ -405,7 +404,7 @@ ll_addrlist(struct ifaddr *ifap) if (sdl.sdl_alen == 0) goto nextifap; addrbuf[0] = '\0'; - error = getnameinfo((struct sockaddr *)&sdl, sdl.sdl_len, + getnameinfo((struct sockaddr *)&sdl, sdl.sdl_len, addrbuf, sizeof(addrbuf), NULL, 0, NI_NUMERICHOST); printf("\tlink %s\n", addrbuf); nextifap: @@ -428,7 +427,7 @@ ll_addrlist(struct ifaddr *ifap) goto nextmulti; KREAD(ifm.ifma_addr, &sdl, struct sockaddr_dl); addrbuf[0] = '\0'; - error = getnameinfo((struct sockaddr *)&sdl, + getnameinfo((struct sockaddr *)&sdl, sdl.sdl_len, addrbuf, sizeof(addrbuf), NULL, 0, NI_NUMERICHOST); printf("\t\tgroup %s refcnt %d\n", From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:46:50 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3726E1065731; Fri, 22 Jun 2012 05:46:50 +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 0048B8FC19; Fri, 22 Jun 2012 05:46: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 q5M5knkf059102; Fri, 22 Jun 2012 05:46:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5knho059100; Fri, 22 Jun 2012 05:46:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220546.q5M5knho059100@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:46: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: r237427 - stable/9/usr.sbin/ifmcstat X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:46:50 -0000 Author: eadler Date: Fri Jun 22 05:46:49 2012 New Revision: 237427 URL: http://svn.freebsd.org/changeset/base/237427 Log: MFC r237256: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/ifmcstat/ifmcstat.c Directory Properties: stable/9/usr.sbin/ifmcstat/ (props changed) Modified: stable/9/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- stable/9/usr.sbin/ifmcstat/ifmcstat.c Fri Jun 22 05:46:43 2012 (r237426) +++ stable/9/usr.sbin/ifmcstat/ifmcstat.c Fri Jun 22 05:46:49 2012 (r237427) @@ -387,7 +387,6 @@ ll_addrlist(struct ifaddr *ifap) struct sockaddr sa; struct sockaddr_dl sdl; struct ifaddr *ifap0; - int error; if (af && af != AF_LINK) return; @@ -404,7 +403,7 @@ ll_addrlist(struct ifaddr *ifap) if (sdl.sdl_alen == 0) goto nextifap; addrbuf[0] = '\0'; - error = getnameinfo((struct sockaddr *)&sdl, sdl.sdl_len, + getnameinfo((struct sockaddr *)&sdl, sdl.sdl_len, addrbuf, sizeof(addrbuf), NULL, 0, NI_NUMERICHOST); printf("\tlink %s\n", addrbuf); nextifap: @@ -427,7 +426,7 @@ ll_addrlist(struct ifaddr *ifap) goto nextmulti; KREAD(ifm.ifma_addr, &sdl, struct sockaddr_dl); addrbuf[0] = '\0'; - error = getnameinfo((struct sockaddr *)&sdl, + getnameinfo((struct sockaddr *)&sdl, sdl.sdl_len, addrbuf, sizeof(addrbuf), NULL, 0, NI_NUMERICHOST); printf("\t\tgroup %s refcnt %d\n", From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 05:48:54 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91126106564A; Fri, 22 Jun 2012 05:48:54 +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 616F48FC12; Fri, 22 Jun 2012 05:48: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 q5M5msRG059242; Fri, 22 Jun 2012 05:48:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5msOh059239; Fri, 22 Jun 2012 05:48:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220548.q5M5msOh059239@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:48: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: r237428 - stable/9/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:48:54 -0000 Author: eadler Date: Fri Jun 22 05:48:53 2012 New Revision: 237428 URL: http://svn.freebsd.org/changeset/base/237428 Log: MFC r237253: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/bsdinstall/partedit/diskeditor.c stable/9/usr.sbin/bsdinstall/partedit/part_wizard.c Directory Properties: stable/9/usr.sbin/bsdinstall/ (props changed) Modified: stable/9/usr.sbin/bsdinstall/partedit/diskeditor.c ============================================================================== --- stable/9/usr.sbin/bsdinstall/partedit/diskeditor.c Fri Jun 22 05:46:49 2012 (r237427) +++ stable/9/usr.sbin/bsdinstall/partedit/diskeditor.c Fri Jun 22 05:48:53 2012 (r237428) @@ -74,7 +74,7 @@ diskeditor_show(const char *title, const int x, y; int i; int height, width, min_width; - int partlist_height, partlist_width, min_partlist_width; + int partlist_height, partlist_width; int cur_scroll = 0; int key, fkey; int cur_button = 0, cur_part = 0; @@ -102,7 +102,6 @@ diskeditor_show(const char *title, const min_width = 50; height = width = 0; partlist_height = 10; - min_partlist_width = 0; dlg_tab_correct_str(prompt); dlg_button_layout(buttons, &min_width); dlg_auto_size(title, prompt, &height, &width, 2, min_width); Modified: stable/9/usr.sbin/bsdinstall/partedit/part_wizard.c ============================================================================== --- stable/9/usr.sbin/bsdinstall/partedit/part_wizard.c Fri Jun 22 05:46:49 2012 (r237427) +++ stable/9/usr.sbin/bsdinstall/partedit/part_wizard.c Fri Jun 22 05:48:53 2012 (r237428) @@ -294,8 +294,6 @@ wizard_makeparts(struct gmesh *mesh, con struct gmesh submesh; struct gclass *classp; struct ggeom *gp; - struct gconfig *gc; - const char *scheme; struct gprovider *pp; intmax_t swapsize, available; char swapsizestr[10], rootsizestr[10]; @@ -309,10 +307,6 @@ wizard_makeparts(struct gmesh *mesh, con if (strcmp(gp->lg_name, disk) == 0) break; - LIST_FOREACH(gc, &gp->lg_config, lg_config) - if (strcmp(gc->lg_name, "scheme") == 0) - scheme = gc->lg_val; - pp = provider_for_name(mesh, disk); available = gpart_max_free(gp, NULL)*pp->lg_sectorsize; From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 14:58:41 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B4B5106566C; Fri, 22 Jun 2012 14:58:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F01428FC18; Fri, 22 Jun 2012 14:58: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 q5MEweKJ084498; Fri, 22 Jun 2012 14:58:40 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MEwe0c084495; Fri, 22 Jun 2012 14:58:40 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201206221458.q5MEwe0c084495@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 22 Jun 2012 14:58:40 +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: r237444 - stable/9/sys/dev/hwpmc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 14:58:41 -0000 Author: gnn Date: Fri Jun 22 14:58:40 2012 New Revision: 237444 URL: http://svn.freebsd.org/changeset/base/237444 Log: MFC 230063 Clean up a switch statement for uncore events on Westmere processors. Submitted by: Davide Italiano Reviewed by: gnn Modified: stable/9/sys/dev/hwpmc/hwpmc_uncore.c stable/9/sys/dev/hwpmc/hwpmc_uncore.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/dev/hwpmc/hwpmc_uncore.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_uncore.c Fri Jun 22 13:56:58 2012 (r237443) +++ stable/9/sys/dev/hwpmc/hwpmc_uncore.c Fri Jun 22 14:58:40 2012 (r237444) @@ -1032,26 +1032,18 @@ ucp_start_pmc(int cpu, int ri) /* Event specific configuration. */ switch (pm->pm_event) { case PMC_EV_UCP_EVENT_0CH_04H_E: + case PMC_EV_UCP_EVENT_0CH_08H_E: wrmsr(MSR_GQ_SNOOP_MESF,0x2); break; case PMC_EV_UCP_EVENT_0CH_04H_F: + case PMC_EV_UCP_EVENT_0CH_08H_F: wrmsr(MSR_GQ_SNOOP_MESF,0x8); break; case PMC_EV_UCP_EVENT_0CH_04H_M: - wrmsr(MSR_GQ_SNOOP_MESF,0x1); - break; - case PMC_EV_UCP_EVENT_0CH_04H_S: - wrmsr(MSR_GQ_SNOOP_MESF,0x4); - break; - case PMC_EV_UCP_EVENT_0CH_08H_E: - wrmsr(MSR_GQ_SNOOP_MESF,0x2); - break; - case PMC_EV_UCP_EVENT_0CH_08H_F: - wrmsr(MSR_GQ_SNOOP_MESF,0x8); - break; case PMC_EV_UCP_EVENT_0CH_08H_M: wrmsr(MSR_GQ_SNOOP_MESF,0x1); break; + case PMC_EV_UCP_EVENT_0CH_04H_S: case PMC_EV_UCP_EVENT_0CH_08H_S: wrmsr(MSR_GQ_SNOOP_MESF,0x4); break; Modified: stable/9/sys/dev/hwpmc/hwpmc_uncore.h ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_uncore.h Fri Jun 22 13:56:58 2012 (r237443) +++ stable/9/sys/dev/hwpmc/hwpmc_uncore.h Fri Jun 22 14:58:40 2012 (r237444) @@ -89,7 +89,6 @@ struct pmc_md_ucp_op_pmcallocate { #define UC_GLOBAL_CTRL 0x391 #define UC_GLOBAL_OVF_CTRL 0x393 - #define UC_GLOBAL_STATUS_FLAG_CLRCHG (1ULL << 63) #define UC_GLOBAL_STATUS_FLAG_OVFPMI (1ULL << 61) #define UC_GLOBAL_CTRL_FLAG_FRZ (1ULL << 63) From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 16:31:01 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C2A01065691; Fri, 22 Jun 2012 16:31:01 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D7BD8FC17; Fri, 22 Jun 2012 16:31: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 q5MGV122088414; Fri, 22 Jun 2012 16:31:01 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MGV1b4088411; Fri, 22 Jun 2012 16:31:01 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201206221631.q5MGV1b4088411@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 22 Jun 2012 16:31: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: r237447 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 16:31:01 -0000 Author: gnn Date: Fri Jun 22 16:31:00 2012 New Revision: 237447 URL: http://svn.freebsd.org/changeset/base/237447 Log: MFC 230063 Clean up a switch statement for uncore events on Westmere processors. Submitted by: Davide Italiano Reviewed by: gnn Modified: stable/8/sys/dev/hwpmc/hwpmc_uncore.c stable/8/sys/dev/hwpmc/hwpmc_uncore.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/dev/hwpmc/hwpmc_uncore.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_uncore.c Fri Jun 22 16:20:13 2012 (r237446) +++ stable/8/sys/dev/hwpmc/hwpmc_uncore.c Fri Jun 22 16:31:00 2012 (r237447) @@ -974,26 +974,18 @@ ucp_start_pmc(int cpu, int ri) /* Event specific configuration. */ switch (pm->pm_event) { case PMC_EV_UCP_EVENT_0CH_04H_E: + case PMC_EV_UCP_EVENT_0CH_08H_E: wrmsr(MSR_GQ_SNOOP_MESF,0x2); break; case PMC_EV_UCP_EVENT_0CH_04H_F: + case PMC_EV_UCP_EVENT_0CH_08H_F: wrmsr(MSR_GQ_SNOOP_MESF,0x8); break; case PMC_EV_UCP_EVENT_0CH_04H_M: - wrmsr(MSR_GQ_SNOOP_MESF,0x1); - break; - case PMC_EV_UCP_EVENT_0CH_04H_S: - wrmsr(MSR_GQ_SNOOP_MESF,0x4); - break; - case PMC_EV_UCP_EVENT_0CH_08H_E: - wrmsr(MSR_GQ_SNOOP_MESF,0x2); - break; - case PMC_EV_UCP_EVENT_0CH_08H_F: - wrmsr(MSR_GQ_SNOOP_MESF,0x8); - break; case PMC_EV_UCP_EVENT_0CH_08H_M: wrmsr(MSR_GQ_SNOOP_MESF,0x1); break; + case PMC_EV_UCP_EVENT_0CH_04H_S: case PMC_EV_UCP_EVENT_0CH_08H_S: wrmsr(MSR_GQ_SNOOP_MESF,0x4); break; Modified: stable/8/sys/dev/hwpmc/hwpmc_uncore.h ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_uncore.h Fri Jun 22 16:20:13 2012 (r237446) +++ stable/8/sys/dev/hwpmc/hwpmc_uncore.h Fri Jun 22 16:31:00 2012 (r237447) @@ -87,7 +87,6 @@ struct pmc_md_ucp_op_pmcallocate { #define UC_GLOBAL_CTRL 0x391 #define UC_GLOBAL_OVF_CTRL 0x393 - #define UC_GLOBAL_STATUS_FLAG_CLRCHG (1ULL << 63) #define UC_GLOBAL_STATUS_FLAG_OVFPMI (1ULL << 61) #define UC_GLOBAL_CTRL_FLAG_FRZ (1ULL << 63) From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 19:19:54 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03B6A106564A; Fri, 22 Jun 2012 19:19:54 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E19738FC0C; Fri, 22 Jun 2012 19:19: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 q5MJJrI7095689; Fri, 22 Jun 2012 19:19:53 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MJJr9M095687; Fri, 22 Jun 2012 19:19:53 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201206221919.q5MJJr9M095687@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 22 Jun 2012 19:19:53 +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: r237454 - stable/8/lib/libthr/thread X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 19:19:54 -0000 Author: gnn Date: Fri Jun 22 19:19:53 2012 New Revision: 237454 URL: http://svn.freebsd.org/changeset/base/237454 Log: MFC: 234424 Set SIGCANCEL to SIGTHR as part of some cleanup of DTrace code. Reviewed by: davidxu@ Modified: stable/8/lib/libthr/thread/thr_private.h Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_private.h ============================================================================== --- stable/8/lib/libthr/thread/thr_private.h Fri Jun 22 19:09:15 2012 (r237453) +++ stable/8/lib/libthr/thread/thr_private.h Fri Jun 22 19:19:53 2012 (r237454) @@ -61,7 +61,7 @@ typedef TAILQ_HEAD(atfork_head, pthread_ TAILQ_HEAD(mutex_queue, pthread_mutex); /* Signal to do cancellation */ -#define SIGCANCEL 32 +#define SIGCANCEL SIGTHR /* * Kernel fatal error handler macro. From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 19:19:59 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06BD71065672; Fri, 22 Jun 2012 19:19:59 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5CB98FC12; Fri, 22 Jun 2012 19:19: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 q5MJJwEl095727; Fri, 22 Jun 2012 19:19:58 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MJJwGg095725; Fri, 22 Jun 2012 19:19:58 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201206221919.q5MJJwGg095725@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 22 Jun 2012 19:19: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: r237455 - stable/9/lib/libthr/thread X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 19:19:59 -0000 Author: gnn Date: Fri Jun 22 19:19:58 2012 New Revision: 237455 URL: http://svn.freebsd.org/changeset/base/237455 Log: MFC: 234424 Set SIGCANCEL to SIGTHR as part of some cleanup of DTrace code. Reviewed by: davidxu@ Modified: stable/9/lib/libthr/thread/thr_private.h Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/thread/thr_private.h ============================================================================== --- stable/9/lib/libthr/thread/thr_private.h Fri Jun 22 19:19:53 2012 (r237454) +++ stable/9/lib/libthr/thread/thr_private.h Fri Jun 22 19:19:58 2012 (r237455) @@ -80,7 +80,7 @@ typedef TAILQ_HEAD(atfork_head, pthread_ TAILQ_HEAD(mutex_queue, pthread_mutex); /* Signal to do cancellation */ -#define SIGCANCEL 32 +#define SIGCANCEL SIGTHR /* * Kernel fatal error handler macro. From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 20:38:01 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A5FA106564A; Fri, 22 Jun 2012 20:38:01 +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 E91B08FC15; Fri, 22 Jun 2012 20:38: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 q5MKc0IO099048; Fri, 22 Jun 2012 20:38:00 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MKc0T7099046; Fri, 22 Jun 2012 20:38:00 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206222038.q5MKc0T7099046@svn.freebsd.org> From: Martin Matuska Date: Fri, 22 Jun 2012 20:38: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: r237456 - stable/9/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 20:38:01 -0000 Author: mm Date: Fri Jun 22 20:38:00 2012 New Revision: 237456 URL: http://svn.freebsd.org/changeset/base/237456 Log: MFC r237119: Do not remount ZFS dataset if changing canmount property to "on" and dataset is already mounted. PR: 167905 Submitted by: Bryan Drewery Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jun 22 19:19:58 2012 (r237455) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jun 22 20:38:00 2012 (r237456) @@ -1485,11 +1485,13 @@ zfs_prop_set(zfs_handle_t *zhp, const ch /* * If the dataset's canmount property is being set to noauto, + * or being set to on and the dataset is already mounted, * then we want to prevent unmounting & remounting it. */ do_prefix = !((prop == ZFS_PROP_CANMOUNT) && (zprop_string_to_index(prop, propval, &idx, - ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO)); + ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO || + (idx == ZFS_CANMOUNT_ON && zfs_is_mounted(zhp, NULL)))); if (do_prefix && (ret = changelist_prefix(cl)) != 0) goto error; From owner-svn-src-stable@FreeBSD.ORG Fri Jun 22 20:38:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA6131065787; Fri, 22 Jun 2012 20:38:09 +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 5E3CE8FC0C; Fri, 22 Jun 2012 20:38: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 q5MKc9VF099095; Fri, 22 Jun 2012 20:38:09 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MKc9Jp099093; Fri, 22 Jun 2012 20:38:09 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206222038.q5MKc9Jp099093@svn.freebsd.org> From: Martin Matuska Date: Fri, 22 Jun 2012 20:38:09 +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: r237457 - stable/8/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 20:38:10 -0000 Author: mm Date: Fri Jun 22 20:38:08 2012 New Revision: 237457 URL: http://svn.freebsd.org/changeset/base/237457 Log: MFC r237119: Do not remount ZFS dataset if changing canmount property to "on" and dataset is already mounted. PR: 167905 Submitted by: Bryan Drewery Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jun 22 20:38:00 2012 (r237456) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jun 22 20:38:08 2012 (r237457) @@ -1485,11 +1485,13 @@ zfs_prop_set(zfs_handle_t *zhp, const ch /* * If the dataset's canmount property is being set to noauto, + * or being set to on and the dataset is already mounted, * then we want to prevent unmounting & remounting it. */ do_prefix = !((prop == ZFS_PROP_CANMOUNT) && (zprop_string_to_index(prop, propval, &idx, - ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO)); + ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO || + (idx == ZFS_CANMOUNT_ON && zfs_is_mounted(zhp, NULL)))); if (do_prefix && (ret = changelist_prefix(cl)) != 0) goto error; From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 00:37:33 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D306106572C; Sat, 23 Jun 2012 00:37: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 EB3538FC14; Sat, 23 Jun 2012 00:37: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 q5N0bWoO009248; Sat, 23 Jun 2012 00:37:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N0bW0o009246; Sat, 23 Jun 2012 00:37:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206230037.q5N0bW0o009246@svn.freebsd.org> From: Xin LI Date: Sat, 23 Jun 2012 00:37: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: r237464 - in stable: 7/usr.bin/makewhatis 8/usr.bin/makewhatis 9/usr.bin/makewhatis X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 00:37:33 -0000 Author: delphij Date: Sat Jun 23 00:37:32 2012 New Revision: 237464 URL: http://svn.freebsd.org/changeset/base/237464 Log: MFC r237348: Currently the code uses gzFile * for a zlib file descriptor, which is not correct. The code works by accident because gzFile is currently defined as void *, and internally it would be casted from or to its real type. A newer version of zlib will instead define it as a pointer to a specific type pointer (namely, struct gzFile_s *). This therefore would cause stricter checks and compiler would catch this type mismatch. This change does not cause any changes to the resulting binary, as validated with md5(1). Modified: stable/9/usr.bin/makewhatis/makewhatis.c Directory Properties: stable/9/usr.bin/makewhatis/ (props changed) Changes in other areas also in this revision: Modified: stable/7/usr.bin/makewhatis/makewhatis.c stable/8/usr.bin/makewhatis/makewhatis.c Directory Properties: stable/7/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) Modified: stable/9/usr.bin/makewhatis/makewhatis.c ============================================================================== --- stable/9/usr.bin/makewhatis/makewhatis.c Fri Jun 22 22:59:42 2012 (r237463) +++ stable/9/usr.bin/makewhatis/makewhatis.c Sat Jun 23 00:37:32 2012 (r237464) @@ -693,7 +693,7 @@ enum { STATE_UNKNOWN, STATE_MANSTYLE, ST static void process_page(struct page_info *page, char *section_dir) { - gzFile *in; + gzFile in; char buffer[4096]; char *line; StringList *names; From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 00:37:33 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43DBF1065732; Sat, 23 Jun 2012 00:37: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 2DE0D8FC15; Sat, 23 Jun 2012 00:37: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 q5N0bXhU009254; Sat, 23 Jun 2012 00:37:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N0bWfG009252; Sat, 23 Jun 2012 00:37:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206230037.q5N0bWfG009252@svn.freebsd.org> From: Xin LI Date: Sat, 23 Jun 2012 00:37:32 +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: r237464 - in stable: 7/usr.bin/makewhatis 8/usr.bin/makewhatis 9/usr.bin/makewhatis X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 00:37:33 -0000 Author: delphij Date: Sat Jun 23 00:37:32 2012 New Revision: 237464 URL: http://svn.freebsd.org/changeset/base/237464 Log: MFC r237348: Currently the code uses gzFile * for a zlib file descriptor, which is not correct. The code works by accident because gzFile is currently defined as void *, and internally it would be casted from or to its real type. A newer version of zlib will instead define it as a pointer to a specific type pointer (namely, struct gzFile_s *). This therefore would cause stricter checks and compiler would catch this type mismatch. This change does not cause any changes to the resulting binary, as validated with md5(1). Modified: stable/8/usr.bin/makewhatis/makewhatis.c Directory Properties: stable/8/usr.bin/makewhatis/ (props changed) Changes in other areas also in this revision: Modified: stable/7/usr.bin/makewhatis/makewhatis.c stable/9/usr.bin/makewhatis/makewhatis.c Directory Properties: stable/7/usr.bin/makewhatis/ (props changed) stable/9/usr.bin/makewhatis/ (props changed) Modified: stable/8/usr.bin/makewhatis/makewhatis.c ============================================================================== --- stable/8/usr.bin/makewhatis/makewhatis.c Fri Jun 22 22:59:42 2012 (r237463) +++ stable/8/usr.bin/makewhatis/makewhatis.c Sat Jun 23 00:37:32 2012 (r237464) @@ -693,7 +693,7 @@ enum { STATE_UNKNOWN, STATE_MANSTYLE, ST static void process_page(struct page_info *page, char *section_dir) { - gzFile *in; + gzFile in; char buffer[4096]; char *line; StringList *names; From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 00:37:33 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7884A10656DC; Sat, 23 Jun 2012 00:37: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 625D48FC17; Sat, 23 Jun 2012 00:37: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 q5N0bX4P009260; Sat, 23 Jun 2012 00:37:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N0bXov009258; Sat, 23 Jun 2012 00:37:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206230037.q5N0bXov009258@svn.freebsd.org> From: Xin LI Date: Sat, 23 Jun 2012 00:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237464 - in stable: 7/usr.bin/makewhatis 8/usr.bin/makewhatis 9/usr.bin/makewhatis X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 00:37:33 -0000 Author: delphij Date: Sat Jun 23 00:37:32 2012 New Revision: 237464 URL: http://svn.freebsd.org/changeset/base/237464 Log: MFC r237348: Currently the code uses gzFile * for a zlib file descriptor, which is not correct. The code works by accident because gzFile is currently defined as void *, and internally it would be casted from or to its real type. A newer version of zlib will instead define it as a pointer to a specific type pointer (namely, struct gzFile_s *). This therefore would cause stricter checks and compiler would catch this type mismatch. This change does not cause any changes to the resulting binary, as validated with md5(1). Modified: stable/7/usr.bin/makewhatis/makewhatis.c Directory Properties: stable/7/usr.bin/makewhatis/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.bin/makewhatis/makewhatis.c stable/9/usr.bin/makewhatis/makewhatis.c Directory Properties: stable/8/usr.bin/makewhatis/ (props changed) stable/9/usr.bin/makewhatis/ (props changed) Modified: stable/7/usr.bin/makewhatis/makewhatis.c ============================================================================== --- stable/7/usr.bin/makewhatis/makewhatis.c Fri Jun 22 22:59:42 2012 (r237463) +++ stable/7/usr.bin/makewhatis/makewhatis.c Sat Jun 23 00:37:32 2012 (r237464) @@ -692,7 +692,7 @@ enum { STATE_UNKNOWN, STATE_MANSTYLE, ST static void process_page(struct page_info *page, char *section_dir) { - gzFile *in; + gzFile in; char buffer[4096]; char *line; StringList *names; From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 07:45:15 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 194421065672; Sat, 23 Jun 2012 07:45:15 +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 031FC8FC19; Sat, 23 Jun 2012 07:45: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 q5N7jEwe027334; Sat, 23 Jun 2012 07:45:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N7jEXN027332; Sat, 23 Jun 2012 07:45:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206230745.q5N7jEXN027332@svn.freebsd.org> From: Alexander Motin Date: Sat, 23 Jun 2012 07:45:14 +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: r237469 - stable/9/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 07:45:15 -0000 Author: mav Date: Sat Jun 23 07:45:14 2012 New Revision: 237469 URL: http://svn.freebsd.org/changeset/base/237469 Log: MFC r237335: Check status of cam_periph_hold() inside cdclose(). If cd device was invalidated while open, cam_periph_hold() will return error and won't get the reference. Following reference release will crash the system. Sponsored by: iXsystems, Inc. Modified: stable/9/sys/cam/scsi/scsi_cd.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 Sat Jun 23 04:47:41 2012 (r237468) +++ stable/9/sys/cam/scsi/scsi_cd.c Sat Jun 23 07:45:14 2012 (r237469) @@ -1043,6 +1043,7 @@ cdclose(struct disk *dp) { struct cam_periph *periph; struct cd_softc *softc; + int error; periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) @@ -1051,7 +1052,11 @@ cdclose(struct disk *dp) softc = (struct cd_softc *)periph->softc; cam_periph_lock(periph); - cam_periph_hold(periph, PRIBIO); + if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { + cam_periph_unlock(periph); + cam_periph_release(periph); + return (0); + } CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, ("cdclose\n")); From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 07:46:33 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB2B01065670; Sat, 23 Jun 2012 07:46:33 +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 C5CBF8FC08; Sat, 23 Jun 2012 07:46: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 q5N7kXb0027522; Sat, 23 Jun 2012 07:46:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N7kXd2027520; Sat, 23 Jun 2012 07:46:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206230746.q5N7kXd2027520@svn.freebsd.org> From: Alexander Motin Date: Sat, 23 Jun 2012 07:46:33 +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: r237470 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 07:46:34 -0000 Author: mav Date: Sat Jun 23 07:46:33 2012 New Revision: 237470 URL: http://svn.freebsd.org/changeset/base/237470 Log: MFC r237335: Check status of cam_periph_hold() inside cdclose(). If cd device was invalidated while open, cam_periph_hold() will return error and won't get the reference. Following reference release will crash the system. Sponsored by: iXsystems, Inc. Modified: stable/8/sys/cam/scsi/scsi_cd.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 Sat Jun 23 07:45:14 2012 (r237469) +++ stable/8/sys/cam/scsi/scsi_cd.c Sat Jun 23 07:46:33 2012 (r237470) @@ -1036,6 +1036,7 @@ cdclose(struct disk *dp) { struct cam_periph *periph; struct cd_softc *softc; + int error; periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) @@ -1044,7 +1045,11 @@ cdclose(struct disk *dp) softc = (struct cd_softc *)periph->softc; cam_periph_lock(periph); - cam_periph_hold(periph, PRIBIO); + if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { + cam_periph_unlock(periph); + cam_periph_release(periph); + return (0); + } CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, ("cdclose\n")); From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 07:48:01 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A32A1065670; Sat, 23 Jun 2012 07:48:01 +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 E5F678FC15; Sat, 23 Jun 2012 07:48: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 q5N7m0eo027719; Sat, 23 Jun 2012 07:48:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N7m07k027716; Sat, 23 Jun 2012 07:48:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206230748.q5N7m07k027716@svn.freebsd.org> From: Alexander Motin Date: Sat, 23 Jun 2012 07:48: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: r237471 - stable/9/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 07:48:01 -0000 Author: mav Date: Sat Jun 23 07:48:00 2012 New Revision: 237471 URL: http://svn.freebsd.org/changeset/base/237471 Log: MFC r237336: Remove unused error variables in cdclose() and daclose(). 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 Sat Jun 23 07:46:33 2012 (r237470) +++ stable/9/sys/cam/scsi/scsi_cd.c Sat Jun 23 07:48:00 2012 (r237471) @@ -1043,7 +1043,6 @@ cdclose(struct disk *dp) { struct cam_periph *periph; struct cd_softc *softc; - int error; periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) @@ -1052,7 +1051,7 @@ cdclose(struct disk *dp) softc = (struct cd_softc *)periph->softc; cam_periph_lock(periph); - if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { + if (cam_periph_hold(periph, PRIBIO) != 0) { cam_periph_unlock(periph); cam_periph_release(periph); return (0); Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Sat Jun 23 07:46:33 2012 (r237470) +++ stable/9/sys/cam/scsi/scsi_da.c Sat Jun 23 07:48:00 2012 (r237471) @@ -984,14 +984,13 @@ daclose(struct disk *dp) { struct cam_periph *periph; struct da_softc *softc; - int error; periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) return (0); cam_periph_lock(periph); - if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { + if (cam_periph_hold(periph, PRIBIO) != 0) { cam_periph_unlock(periph); cam_periph_release(periph); return (0); From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 07:49:11 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E35C106566B; Sat, 23 Jun 2012 07:49:11 +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 583808FC12; Sat, 23 Jun 2012 07:49: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 q5N7nB80027889; Sat, 23 Jun 2012 07:49:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N7nB23027886; Sat, 23 Jun 2012 07:49:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206230749.q5N7nB23027886@svn.freebsd.org> From: Alexander Motin Date: Sat, 23 Jun 2012 07:49: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: r237472 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 07:49:11 -0000 Author: mav Date: Sat Jun 23 07:49:10 2012 New Revision: 237472 URL: http://svn.freebsd.org/changeset/base/237472 Log: MFC r237336: Remove unused error variables in cdclose() and daclose(). 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 Sat Jun 23 07:48:00 2012 (r237471) +++ stable/8/sys/cam/scsi/scsi_cd.c Sat Jun 23 07:49:10 2012 (r237472) @@ -1036,7 +1036,6 @@ cdclose(struct disk *dp) { struct cam_periph *periph; struct cd_softc *softc; - int error; periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) @@ -1045,7 +1044,7 @@ cdclose(struct disk *dp) softc = (struct cd_softc *)periph->softc; cam_periph_lock(periph); - if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { + if (cam_periph_hold(periph, PRIBIO) != 0) { cam_periph_unlock(periph); cam_periph_release(periph); return (0); Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Sat Jun 23 07:48:00 2012 (r237471) +++ stable/8/sys/cam/scsi/scsi_da.c Sat Jun 23 07:49:10 2012 (r237472) @@ -956,14 +956,13 @@ daclose(struct disk *dp) { struct cam_periph *periph; struct da_softc *softc; - int error; periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) return (0); cam_periph_lock(periph); - if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { + if (cam_periph_hold(periph, PRIBIO) != 0) { cam_periph_unlock(periph); cam_periph_release(periph); return (0); From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 17:39:41 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89DD21065672; Sat, 23 Jun 2012 17:39:41 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73DFA8FC08; Sat, 23 Jun 2012 17:39: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 q5NHdfk3054737; Sat, 23 Jun 2012 17:39:41 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NHdfg5054735; Sat, 23 Jun 2012 17:39:41 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206231739.q5NHdfg5054735@svn.freebsd.org> From: Davide Italiano Date: Sat, 23 Jun 2012 17: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: r237485 - stable/9/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 17:39:41 -0000 Author: davide Date: Sat Jun 23 17:39:40 2012 New Revision: 237485 URL: http://svn.freebsd.org/changeset/base/237485 Log: MFC r237195: The variable 'error' in sys_poll() is initialized in declaration to value zero but in any case is overwritten by successive copyin(), making the previous initialization useless. Remove this. As an added bonus this fixes a style(9) bug. Approved by: gnn (mentor) Modified: stable/9/sys/kern/sys_generic.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sys_generic.c ============================================================================== --- stable/9/sys/kern/sys_generic.c Sat Jun 23 15:36:32 2012 (r237484) +++ stable/9/sys/kern/sys_generic.c Sat Jun 23 17:39:40 2012 (r237485) @@ -1255,7 +1255,7 @@ sys_poll(td, uap) struct pollfd *bits; struct pollfd smallbits[32]; struct timeval atv, rtv, ttv; - int error = 0, timo; + int error, timo; u_int nfds; size_t ni; From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 17:42:38 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20BBB106566C; Sat, 23 Jun 2012 17:42:38 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC638FC08; Sat, 23 Jun 2012 17:42: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 q5NHgbsg054906; Sat, 23 Jun 2012 17:42:37 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NHgbcK054904; Sat, 23 Jun 2012 17:42:37 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206231742.q5NHgbcK054904@svn.freebsd.org> From: Davide Italiano Date: Sat, 23 Jun 2012 17:42:37 +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: r237486 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 17:42:38 -0000 Author: davide Date: Sat Jun 23 17:42:37 2012 New Revision: 237486 URL: http://svn.freebsd.org/changeset/base/237486 Log: MFC r237195: The variable 'error' in sys_poll() is initialized in declaration to value zero but in any case is overwritten by successive copyin(), making the previous initialization useless. Remove this. As an added bonus this fixes a style(9) bug. Approved by: gnn (mentor) Modified: stable/8/sys/kern/sys_generic.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/sys_generic.c ============================================================================== --- stable/8/sys/kern/sys_generic.c Sat Jun 23 17:39:40 2012 (r237485) +++ stable/8/sys/kern/sys_generic.c Sat Jun 23 17:42:37 2012 (r237486) @@ -1208,7 +1208,7 @@ poll(td, uap) struct pollfd *bits; struct pollfd smallbits[32]; struct timeval atv, rtv, ttv; - int error = 0, timo; + int error, timo; u_int nfds; size_t ni; From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 17:46:42 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B176C1065673; Sat, 23 Jun 2012 17:46:42 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B86D8FC08; Sat, 23 Jun 2012 17:46: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 q5NHkga0055146; Sat, 23 Jun 2012 17:46:42 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NHkgUm055144; Sat, 23 Jun 2012 17:46:42 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206231746.q5NHkgUm055144@svn.freebsd.org> From: Davide Italiano Date: Sat, 23 Jun 2012 17:46: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: r237487 - stable/9/sys/dev/hwpmc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 17:46:42 -0000 Author: davide Date: Sat Jun 23 17:46:42 2012 New Revision: 237487 URL: http://svn.freebsd.org/changeset/base/237487 Log: MFC r237196: Disable hwpmc(4) support for Intel Xeon Sandy Bridge (Model 0x2D). Due to some differences in MSRs between Xeon Sandy Bridge and Core Sandy Bridge (Model 0x2A), wrmsr() may generate in a GP# fault exception and so a panic of the machine. Approved by: gnn (mentor) Modified: stable/9/sys/dev/hwpmc/hwpmc_intel.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_intel.c Sat Jun 23 17:42:37 2012 (r237486) +++ stable/9/sys/dev/hwpmc/hwpmc_intel.c Sat Jun 23 17:46:42 2012 (r237487) @@ -143,7 +143,6 @@ pmc_intel_initialize(void) nclasses = 5; break; case 0x2A: /* Per Intel document 253669-039US 05/2011. */ - case 0x2D: /* Per Intel document 253669-041US 12/2011. */ cputype = PMC_CPU_INTEL_SANDYBRIDGE; nclasses = 5; break; From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 17:59:33 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7440B1065674; Sat, 23 Jun 2012 17:59:33 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E9738FC08; Sat, 23 Jun 2012 17: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 q5NHxXoS055711; Sat, 23 Jun 2012 17:59:33 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NHxX97055709; Sat, 23 Jun 2012 17:59:33 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201206231759.q5NHxX97055709@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 23 Jun 2012 17:59: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: r237488 - stable/9/usr.sbin/traceroute6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 17:59:33 -0000 Author: ume Date: Sat Jun 23 17:59:32 2012 New Revision: 237488 URL: http://svn.freebsd.org/changeset/base/237488 Log: MFC r235138: Add -a and -A option to the usage. Modified: stable/9/usr.sbin/traceroute6/traceroute6.c Directory Properties: stable/9/usr.sbin/traceroute6/ (props changed) Modified: stable/9/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/9/usr.sbin/traceroute6/traceroute6.c Sat Jun 23 17:46:42 2012 (r237487) +++ stable/9/usr.sbin/traceroute6/traceroute6.c Sat Jun 23 17:59:32 2012 (r237488) @@ -1448,7 +1448,8 @@ usage() { fprintf(stderr, -"usage: traceroute6 [-dIlnNrUv] [-f firsthop] [-g gateway] [-m hoplimit]\n" -" [-p port] [-q probes] [-s src] [-w waittime] target [datalen]\n"); +"usage: traceroute6 [-adIlnNrUv] [-A as_server] [-f firsthop] [-g gateway]\n" +" [-m hoplimit] [-p port] [-q probes] [-s src] [-w waittime] target\n" +" [datalen]\n"); exit(1); } From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 18:07:48 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BCD2F1065675; Sat, 23 Jun 2012 18:07:48 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A75D68FC1D; Sat, 23 Jun 2012 18:07: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 q5NI7mnu056124; Sat, 23 Jun 2012 18:07:48 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NI7mpU056122; Sat, 23 Jun 2012 18:07:48 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201206231807.q5NI7mpU056122@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 23 Jun 2012 18:07:48 +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: r237489 - stable/8/usr.sbin/traceroute6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 18:07:48 -0000 Author: ume Date: Sat Jun 23 18:07:48 2012 New Revision: 237489 URL: http://svn.freebsd.org/changeset/base/237489 Log: MFC r235138: Add -a and -A option to the usage. Modified: stable/8/usr.sbin/traceroute6/traceroute6.c Directory Properties: stable/8/usr.sbin/traceroute6/ (props changed) Modified: stable/8/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/8/usr.sbin/traceroute6/traceroute6.c Sat Jun 23 17:59:32 2012 (r237488) +++ stable/8/usr.sbin/traceroute6/traceroute6.c Sat Jun 23 18:07:48 2012 (r237489) @@ -1453,7 +1453,8 @@ usage() { fprintf(stderr, -"usage: traceroute6 [-dIlnNrUv] [-f firsthop] [-g gateway] [-m hoplimit]\n" -" [-p port] [-q probes] [-s src] [-w waittime] target [datalen]\n"); +"usage: traceroute6 [-adIlnNrUv] [-A as_server] [-f firsthop] [-g gateway]\n" +" [-m hoplimit] [-p port] [-q probes] [-s src] [-w waittime] target\n" +" [datalen]\n"); exit(1); } From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 18:26:24 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DDDB106566B; Sat, 23 Jun 2012 18:26:24 +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 683508FC08; Sat, 23 Jun 2012 18:26: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 q5NIQOEY056915; Sat, 23 Jun 2012 18:26:24 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NIQOgY056913; Sat, 23 Jun 2012 18:26:24 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206231826.q5NIQOgY056913@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 23 Jun 2012 18:26:24 +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: r237490 - stable/9/sys/ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 18:26:24 -0000 Author: trasz Date: Sat Jun 23 18:26:23 2012 New Revision: 237490 URL: http://svn.freebsd.org/changeset/base/237490 Log: MFC r234036: Fix panic in ffs_reload(), which may happen when read-only filesystem gets resized and then reloaded. MFC r234537: Fix use-after-free introduced in r234036. Modified: stable/9/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vfsops.c Sat Jun 23 18:07:48 2012 (r237489) +++ stable/9/sys/ufs/ffs/ffs_vfsops.c Sat Jun 23 18:26:23 2012 (r237490) @@ -675,8 +675,14 @@ ffs_reload(struct mount *mp, struct thre /* * Step 3: re-read summary information from disk. */ - blks = howmany(fs->fs_cssize, fs->fs_fsize); - space = fs->fs_csp; + size = fs->fs_cssize; + blks = howmany(size, fs->fs_fsize); + if (fs->fs_contigsumsize > 0) + size += fs->fs_ncg * sizeof(int32_t); + size += fs->fs_ncg * sizeof(u_int8_t); + free(fs->fs_csp, M_UFSMNT); + space = malloc((u_long)size, M_UFSMNT, M_WAITOK); + fs->fs_csp = space; for (i = 0; i < blks; i += fs->fs_frag) { size = fs->fs_bsize; if (i + fs->fs_frag > blks) @@ -693,10 +699,14 @@ ffs_reload(struct mount *mp, struct thre * We no longer know anything about clusters per cylinder group. */ if (fs->fs_contigsumsize > 0) { - lp = fs->fs_maxcluster; + fs->fs_maxcluster = lp = space; for (i = 0; i < fs->fs_ncg; i++) *lp++ = fs->fs_contigsumsize; + space = lp; } + size = fs->fs_ncg * sizeof(u_int8_t); + fs->fs_contigdirs = (u_int8_t *)space; + bzero(fs->fs_contigdirs, size); loop: MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 18:39:35 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D610A106566C; Sat, 23 Jun 2012 18:39:35 +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 B60208FC12; Sat, 23 Jun 2012 18: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 q5NIdZsN057496; Sat, 23 Jun 2012 18:39:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NIdZOD057490; Sat, 23 Jun 2012 18:39:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206231839.q5NIdZOD057490@svn.freebsd.org> From: Marius Strobl Date: Sat, 23 Jun 2012 18: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: r237491 - in stable/9: lib/libc/arm lib/libc/arm/gen sys/arm/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 18:39:35 -0000 Author: marius Date: Sat Jun 23 18:39:35 2012 New Revision: 237491 URL: http://svn.freebsd.org/changeset/base/237491 Log: MFC: r231616, r232497, r234337 Add __aeabi_read_tp function required for thread-local storage. Added: stable/9/lib/libc/arm/gen/__aeabi_read_tp.S - copied unchanged from r234337, head/lib/libc/arm/gen/__aeabi_read_tp.S Modified: stable/9/lib/libc/arm/Symbol.map stable/9/lib/libc/arm/gen/Makefile.inc stable/9/sys/arm/include/armreg.h stable/9/sys/arm/include/sysarch.h Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/lib/libc/uuid/ (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/lib/libc/arm/Symbol.map ============================================================================== --- stable/9/lib/libc/arm/Symbol.map Sat Jun 23 18:26:23 2012 (r237490) +++ stable/9/lib/libc/arm/Symbol.map Sat Jun 23 18:39:35 2012 (r237491) @@ -41,6 +41,7 @@ FBSDprivate_1.0 { __sys_exit; _set_tp; + __aeabi_read_tp; ___longjmp; __umodsi3; __modsi3; Modified: stable/9/lib/libc/arm/gen/Makefile.inc ============================================================================== --- stable/9/lib/libc/arm/gen/Makefile.inc Sat Jun 23 18:26:23 2012 (r237490) +++ stable/9/lib/libc/arm/gen/Makefile.inc Sat Jun 23 18:39:35 2012 (r237491) @@ -3,4 +3,4 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \ getcontextx.c infinity.c ldexp.c makecontext.c modf.c \ - setjmp.S signalcontext.c sigsetjmp.S divsi3.S + __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S divsi3.S Copied: stable/9/lib/libc/arm/gen/__aeabi_read_tp.S (from r234337, head/lib/libc/arm/gen/__aeabi_read_tp.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/arm/gen/__aeabi_read_tp.S Sat Jun 23 18:39:35 2012 (r237491, copy of r234337, head/lib/libc/arm/gen/__aeabi_read_tp.S) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012 Andrew Turner + * 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 + +ENTRY(__aeabi_read_tp) + ldr r0, .Larm_tp_address + ldr r0, [r0] + RET + +.Larm_tp_address: + .word ARM_TP_ADDRESS + Modified: stable/9/sys/arm/include/armreg.h ============================================================================== --- stable/9/sys/arm/include/armreg.h Sat Jun 23 18:26:23 2012 (r237490) +++ stable/9/sys/arm/include/armreg.h Sat Jun 23 18:39:35 2012 (r237491) @@ -316,8 +316,13 @@ /* * Address of the vector page, low and high versions. */ +#ifndef __ASSEMBLER__ #define ARM_VECTORS_LOW 0x00000000U #define ARM_VECTORS_HIGH 0xffff0000U +#else +#define ARM_VECTORS_LOW 0 +#define ARM_VECTORS_HIGH 0xffff0000 +#endif /* * ARM Instructions Modified: stable/9/sys/arm/include/sysarch.h ============================================================================== --- stable/9/sys/arm/include/sysarch.h Sat Jun 23 18:26:23 2012 (r237490) +++ stable/9/sys/arm/include/sysarch.h Sat Jun 23 18:39:35 2012 (r237491) @@ -55,6 +55,7 @@ #define ARM_RAS_END (ARM_TP_ADDRESS + 8) #ifndef LOCORE +#ifndef __ASSEMBLER__ #include @@ -85,6 +86,7 @@ int sysarch(int, void *); __END_DECLS #endif +#endif /* __ASSEMBLER__ */ #endif /* LOCORE */ #endif /* !_ARM_SYSARCH_H_ */ From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 18:43:12 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DDBF106564A; Sat, 23 Jun 2012 18:43:12 +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 4DCC28FC08; Sat, 23 Jun 2012 18:43: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 q5NIhBs3057758; Sat, 23 Jun 2012 18:43:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NIhBNk057754; Sat, 23 Jun 2012 18:43:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206231843.q5NIhBNk057754@svn.freebsd.org> From: Marius Strobl Date: Sat, 23 Jun 2012 18:43: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: r237492 - in stable/9/gnu: lib/libgomp lib/libstdc++ usr.bin/cc/cc_tools X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 18:43:12 -0000 Author: marius Date: Sat Jun 23 18:43:11 2012 New Revision: 237492 URL: http://svn.freebsd.org/changeset/base/237492 Log: MFC: r231620, r237098 Enable TLS support for ARM toolchain Modified: stable/9/gnu/lib/libgomp/config.h stable/9/gnu/lib/libstdc++/config.h stable/9/gnu/usr.bin/cc/cc_tools/auto-host.h Directory Properties: stable/9/gnu/lib/libgomp/ (props changed) stable/9/gnu/lib/libstdc++/ (props changed) stable/9/gnu/usr.bin/cc/cc_tools/ (props changed) Modified: stable/9/gnu/lib/libgomp/config.h ============================================================================== --- stable/9/gnu/lib/libgomp/config.h Sat Jun 23 18:39:35 2012 (r237491) +++ stable/9/gnu/lib/libgomp/config.h Sat Jun 23 18:43:11 2012 (r237492) @@ -59,7 +59,7 @@ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if the target supports thread-local storage. */ -#if !defined(__arm__) && !defined(__mips__) +#if !defined(__mips__) #define HAVE_TLS 1 #endif Modified: stable/9/gnu/lib/libstdc++/config.h ============================================================================== --- stable/9/gnu/lib/libstdc++/config.h Sat Jun 23 18:39:35 2012 (r237491) +++ stable/9/gnu/lib/libstdc++/config.h Sat Jun 23 18:43:11 2012 (r237492) @@ -371,7 +371,7 @@ /* #undef HAVE_TANL */ /* Define to 1 if the target supports thread-local storage. */ -#if !defined(__arm__) && !defined(__mips__) +#if !defined(__mips__) #define HAVE_TLS 1 #endif Modified: stable/9/gnu/usr.bin/cc/cc_tools/auto-host.h ============================================================================== --- stable/9/gnu/usr.bin/cc/cc_tools/auto-host.h Sat Jun 23 18:39:35 2012 (r237491) +++ stable/9/gnu/usr.bin/cc/cc_tools/auto-host.h Sat Jun 23 18:43:11 2012 (r237492) @@ -287,10 +287,8 @@ /* Define if your assembler supports thread-local storage. */ #ifndef USED_FOR_TARGET -#if !defined(__arm__) #define HAVE_AS_TLS 1 #endif -#endif /* Define to 1 if you have the `atoll' function. */ From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 18:51:34 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 636921065679; Sat, 23 Jun 2012 18:51:34 +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 4D3D58FC08; Sat, 23 Jun 2012 18:51: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 q5NIpYaO058241; Sat, 23 Jun 2012 18:51:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NIpYuG058239; Sat, 23 Jun 2012 18:51:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206231851.q5NIpYuG058239@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 23 Jun 2012 18:51:34 +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: r237495 - stable/9/sbin/growfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 18:51:34 -0000 Author: trasz Date: Sat Jun 23 18:51:33 2012 New Revision: 237495 URL: http://svn.freebsd.org/changeset/base/237495 Log: MFC r227081 by ed@: Add missing static keywords for global variables to tools in sbin/. These tools declare global variables without using the static keyword, even though their use is limited to a single C-file, or without placing an extern declaration of them in the proper header file. Modified: stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Jun 23 18:45:32 2012 (r237494) +++ stable/9/sbin/growfs/growfs.c Sat Jun 23 18:51:33 2012 (r237495) @@ -116,7 +116,7 @@ union dinode { } while (0) static ufs2_daddr_t inoblk; /* inode block address */ static char inobuf[MAXBSIZE]; /* inode block */ -ino_t maxino; /* last valid inode */ +static ino_t maxino; /* last valid inode */ static int unlabeled; /* unlabeled partition, e.g. vinum volume etc. */ /* From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 18:54:25 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B44DA1065674; Sat, 23 Jun 2012 18:54:25 +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 9E5568FC18; Sat, 23 Jun 2012 18:54: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 q5NIsPM1058397; Sat, 23 Jun 2012 18:54:25 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NIsP26058395; Sat, 23 Jun 2012 18:54:25 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206231854.q5NIsP26058395@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 23 Jun 2012 18:54: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: r237496 - stable/9/sbin/growfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 18:54:25 -0000 Author: trasz Date: Sat Jun 23 18:54:24 2012 New Revision: 237496 URL: http://svn.freebsd.org/changeset/base/237496 Log: MFC r230289 by ed@: Allow growfs to be built with GCC 4.7 and -Werror. The dp1 variable is only used when FSIRAND is defined. Just place the variable behind #ifdefs entirely. Modified: stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Jun 23 18:51:33 2012 (r237495) +++ stable/9/sbin/growfs/growfs.c Sat Jun 23 18:54:24 2012 (r237496) @@ -374,7 +374,9 @@ initcg(int cylno, time_t modtime, int fs static caddr_t iobuf; long blkno, start; ufs2_daddr_t i, cbase, dmax; +#ifdef FSIRAND struct ufs1_dinode *dp1; +#endif struct csum *cs; uint d, dupper, dlower; @@ -452,8 +454,8 @@ initcg(int cylno, time_t modtime, int fs bzero(iobuf, sblock.fs_bsize); for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) { - dp1 = (struct ufs1_dinode *)(void *)iobuf; #ifdef FSIRAND + dp1 = (struct ufs1_dinode *)(void *)iobuf; for (j = 0; j < INOPB(&sblock); j++) { dp1->di_gen = random(); dp1++; From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 18:58:02 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAB371065672; Sat, 23 Jun 2012 18:58:02 +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 B2DE28FC0A; Sat, 23 Jun 2012 18:58: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 q5NIw25n058625; Sat, 23 Jun 2012 18:58:02 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NIw2I8058622; Sat, 23 Jun 2012 18:58:02 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206231858.q5NIw2I8058622@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 23 Jun 2012 18:58:02 +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: r237497 - stable/9/sbin/growfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 18:58:02 -0000 Author: trasz Date: Sat Jun 23 18:58:02 2012 New Revision: 237497 URL: http://svn.freebsd.org/changeset/base/237497 Log: MFC r232548: Make growfs(8) mostly style compliant. No functional changes, verified with MD5. MFC r232858: After r232548, clang complains about the apparent '=-' operator (a left-over from ancient C times, and a frequent typo) in growfs.c: sbin/growfs/growfs.c:1550:8: error: use of unary operator that may be intended as compound assignment (-=) [-Werror] blkno =- 1; ^~ Use 'blkno = -1' instead, to silence the error. Modified: stable/9/sbin/growfs/debug.c stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/debug.c ============================================================================== --- stable/9/sbin/growfs/debug.c Sat Jun 23 18:54:24 2012 (r237496) +++ stable/9/sbin/growfs/debug.c Sat Jun 23 18:58:02 2012 (r237497) @@ -44,7 +44,6 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -/* ********************************************************** INCLUDES ***** */ #include #include @@ -57,15 +56,13 @@ static const char rcsid[] = #ifdef FS_DEBUG -/* *********************************************************** GLOBALS ***** */ -static FILE *dbg_log=NULL; -static unsigned int indent=0; +static FILE *dbg_log = NULL; +static unsigned int indent = 0; /* * prototypes not done here, as they come with debug.h */ -/* ********************************************************** dbg_open ***** */ /* * Open the filehandle where all debug output has to go. */ @@ -74,14 +71,13 @@ dbg_open(const char *fn) { if (strcmp(fn, "-") == 0) - dbg_log=fopen("/dev/stdout", "a"); + dbg_log = fopen("/dev/stdout", "a"); else - dbg_log=fopen(fn, "a"); + dbg_log = fopen(fn, "a"); return; } -/* ********************************************************* dbg_close ***** */ /* * Close the filehandle where all debug output went to. */ @@ -89,15 +85,14 @@ void dbg_close(void) { - if(dbg_log) { + if (dbg_log) { fclose(dbg_log); - dbg_log=NULL; + dbg_log = NULL; } return; } -/* ****************************************************** dbg_dump_hex ***** */ /* * Dump out a full file system block in hex. */ @@ -106,17 +101,16 @@ dbg_dump_hex(struct fs *sb, const char * { int i, j, k; - if(!dbg_log) { + if (!dbg_log) return; - } + fprintf(dbg_log, "===== START HEXDUMP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)mem, comment); indent++; - for (i=0; ifs_bsize; i+=24) { - for (j=0; j<3; j++) { - for (k=0; k<8; k++) { + for (i = 0; i < sb->fs_bsize; i += 24) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 8; k++) fprintf(dbg_log, "%02x ", *mem++); - } fprintf(dbg_log, " "); } fprintf(dbg_log, "\n"); @@ -127,7 +121,6 @@ dbg_dump_hex(struct fs *sb, const char * return; } -/* ******************************************************* dbg_dump_fs ***** */ /* * Dump the superblock. */ @@ -135,12 +128,11 @@ void dbg_dump_fs(struct fs *sb, const char *comment) { #ifdef FSMAXSNAP - int j; + int j; #endif /* FSMAXSNAP */ - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START SUPERBLOCK =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)sb, comment); @@ -308,10 +300,10 @@ dbg_dump_fs(struct fs *sb, const char *c sb->fs_pendinginodes); #ifdef FSMAXSNAP - for(j=0; jfs_snapinum[j]); - if(!sb->fs_snapinum[j]) { /* list is dense */ + if (!sb->fs_snapinum[j]) { /* list is dense */ break; } } @@ -356,7 +348,6 @@ dbg_dump_fs(struct fs *sb, const char *c return; } -/* ******************************************************* dbg_dump_cg ***** */ /* * Dump a cylinder group. */ @@ -365,9 +356,8 @@ dbg_dump_cg(const char *comment, struct { int j; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START CYLINDER GROUP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)cgr, comment); @@ -383,7 +373,7 @@ dbg_dump_cg(const char *comment, struct fprintf(dbg_log, "rotor int32_t 0x%08x\n", cgr->cg_rotor); fprintf(dbg_log, "frotor int32_t 0x%08x\n", cgr->cg_frotor); fprintf(dbg_log, "irotor int32_t 0x%08x\n", cgr->cg_irotor); - for(j=0; jcg_frsum[j]); } @@ -411,7 +401,6 @@ dbg_dump_cg(const char *comment, struct return; } -/* ***************************************************** dbg_dump_csum ***** */ /* * Dump a cylinder summary. */ @@ -419,9 +408,8 @@ void dbg_dump_csum(const char *comment, struct csum *cs) { - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START CYLINDER SUMMARY =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)cs, comment); @@ -438,7 +426,6 @@ dbg_dump_csum(const char *comment, struc return; } -/* ************************************************ dbg_dump_csum_total ***** */ /* * Dump a cylinder summary. */ @@ -446,9 +433,8 @@ void dbg_dump_csum_total(const char *comment, struct csum_total *cs) { - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START CYLINDER SUMMARY TOTAL =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)cs, comment); @@ -475,7 +461,6 @@ dbg_dump_csum_total(const char *comment, return; } -/* **************************************************** dbg_dump_inmap ***** */ /* * Dump the inode allocation map in one cylinder group. */ @@ -485,30 +470,29 @@ dbg_dump_inmap(struct fs *sb, const char int j,k,l,e; unsigned char *cp; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START INODE ALLOCATION MAP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)cgr, comment); indent++; - cp=(unsigned char *)cg_inosused(cgr); - e=sb->fs_ipg/8; - for(j=0; jfs_ipg / 8; + for (j = 0; j < e; j += 32) { fprintf(dbg_log, "%08x: ", j); - for(k=0; k<32; k+=8) { - if(j+k+8fs_old_nspf) - e=howmany((sb->fs_old_cpg * sb->fs_old_spc / sb->fs_old_nspf), CHAR_BIT); + e = howmany((sb->fs_old_cpg * sb->fs_old_spc / sb->fs_old_nspf), CHAR_BIT); else e = 0; - for(j=0; jfs_old_nspf) - e=howmany(sb->fs_old_cpg * sb->fs_old_spc / (sb->fs_old_nspf << sb->fs_fragshift), CHAR_BIT); + e = howmany(sb->fs_old_cpg * sb->fs_old_spc / (sb->fs_old_nspf << sb->fs_fragshift), CHAR_BIT); else e = 0; - for(j=0; jfs_contigsumsize; j++) { + ip = (int *)cg_clustersum(cgr); + for (j = 0; j <= sb->fs_contigsumsize; j++) { fprintf(dbg_log, "%02d: %8d\n", j, *ip++); } @@ -651,7 +629,6 @@ dbg_dump_clsum(struct fs *sb, const char * will leave it disabled for now; it should probably be re-enabled * specifically for UFS1. */ -/* **************************************************** dbg_dump_sptbl ***** */ /* * Dump the block summary, and the rotational layout table. */ @@ -661,23 +638,21 @@ dbg_dump_sptbl(struct fs *sb, const char int j,k; int *ip; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START BLOCK SUMMARY AND POSITION TABLE =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)cgr, comment); indent++; - ip=(int *)cg_blktot(cgr); - for(j=0; jfs_old_cpg; j++) { + ip = (int *)cg_blktot(cgr); + for (j = 0; j < sb->fs_old_cpg; j++) { fprintf(dbg_log, "%2d: %5d = ", j, *ip++); - for(k=0; kfs_old_nrpos; k++) { + for (k = 0; k < sb->fs_old_nrpos; k++) { fprintf(dbg_log, "%4d", cg_blks(sb, cgr, j)[k]); - if(kfs_old_nrpos-1) { + if (k < sb->fs_old_nrpos - 1) fprintf(dbg_log, " + "); - } } fprintf(dbg_log, "\n"); } @@ -689,7 +664,6 @@ dbg_dump_sptbl(struct fs *sb, const char } #endif -/* ************************************************** dbg_dump_ufs1_ino ***** */ /* * Dump a UFS1 inode structure. */ @@ -699,9 +673,8 @@ dbg_dump_ufs1_ino(struct fs *sb, const c int ictr; int remaining_blocks; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START UFS1 INODE DUMP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)ino, comment); @@ -723,25 +696,25 @@ dbg_dump_ufs1_ino(struct fs *sb, const c fprintf(dbg_log, "ctimensec int32_t 0x%08x\n", ino->di_ctimensec); - remaining_blocks=howmany(ino->di_size, sb->fs_bsize); /* XXX ts - +1? */ - for(ictr=0; ictr < MIN(NDADDR, remaining_blocks); ictr++) { + remaining_blocks = howmany(ino->di_size, sb->fs_bsize); /* XXX ts - +1? */ + for (ictr = 0; ictr < MIN(NDADDR, remaining_blocks); ictr++) { fprintf(dbg_log, "db ufs_daddr_t[%x] 0x%08x\n", ictr, ino->di_db[ictr]); } - remaining_blocks-=NDADDR; - if(remaining_blocks>0) { + remaining_blocks -= NDADDR; + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs_daddr_t[0] 0x%08x\n", ino->di_ib[0]); } - remaining_blocks-=howmany(sb->fs_bsize, sizeof(ufs1_daddr_t)); - if(remaining_blocks>0) { + remaining_blocks -= howmany(sb->fs_bsize, sizeof(ufs1_daddr_t)); + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs_daddr_t[1] 0x%08x\n", ino->di_ib[1]); } -#define SQUARE(a) ((a)*(a)) - remaining_blocks-=SQUARE(howmany(sb->fs_bsize, sizeof(ufs1_daddr_t))); +#define SQUARE(a) ((a) * (a)) + remaining_blocks -= SQUARE(howmany(sb->fs_bsize, sizeof(ufs1_daddr_t))); #undef SQUARE - if(remaining_blocks>0) { + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs_daddr_t[2] 0x%08x\n", ino->di_ib[2]); } @@ -758,7 +731,6 @@ dbg_dump_ufs1_ino(struct fs *sb, const c return; } -/* ************************************************** dbg_dump_ufs2_ino ***** */ /* * Dump a UFS2 inode structure. */ @@ -768,9 +740,8 @@ dbg_dump_ufs2_ino(struct fs *sb, const c int ictr; int remaining_blocks; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START UFS2 INODE DUMP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)ino, comment); @@ -785,8 +756,8 @@ dbg_dump_ufs2_ino(struct fs *sb, const c ((unsigned int *)&(ino->di_size))[1], ((unsigned int *)&(ino->di_size))[0]); fprintf(dbg_log, "blocks u_int64_t 0x%08x%08x\n", - ((unsigned int *)&(ino->di_blocks))[1], - ((unsigned int *)&(ino->di_blocks))[0]); + ((unsigned int *)&(ino->di_blocks))[1], + ((unsigned int *)&(ino->di_blocks))[0]); fprintf(dbg_log, "atime ufs_time_t %10jd\n", ino->di_atime); fprintf(dbg_log, "mtime ufs_time_t %10jd\n", ino->di_mtime); fprintf(dbg_log, "ctime ufs_time_t %10jd\n", ino->di_ctime); @@ -802,25 +773,25 @@ dbg_dump_ufs2_ino(struct fs *sb, const c /* XXX: What do we do with di_extb[NXADDR]? */ - remaining_blocks=howmany(ino->di_size, sb->fs_bsize); /* XXX ts - +1? */ - for(ictr=0; ictr < MIN(NDADDR, remaining_blocks); ictr++) { + remaining_blocks = howmany(ino->di_size, sb->fs_bsize); /* XXX ts - +1? */ + for (ictr = 0; ictr < MIN(NDADDR, remaining_blocks); ictr++) { fprintf(dbg_log, "db ufs2_daddr_t[%x] 0x%16jx\n", ictr, ino->di_db[ictr]); } - remaining_blocks-=NDADDR; - if(remaining_blocks>0) { + remaining_blocks -= NDADDR; + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs2_daddr_t[0] 0x%16jx\n", ino->di_ib[0]); } - remaining_blocks-=howmany(sb->fs_bsize, sizeof(ufs2_daddr_t)); - if(remaining_blocks>0) { + remaining_blocks -= howmany(sb->fs_bsize, sizeof(ufs2_daddr_t)); + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs2_daddr_t[1] 0x%16jx\n", ino->di_ib[1]); } -#define SQUARE(a) ((a)*(a)) - remaining_blocks-=SQUARE(howmany(sb->fs_bsize, sizeof(ufs2_daddr_t))); +#define SQUARE(a) ((a) * (a)) + remaining_blocks -= SQUARE(howmany(sb->fs_bsize, sizeof(ufs2_daddr_t))); #undef SQUARE - if(remaining_blocks>0) { + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs2_daddr_t[2] 0x%16jx\n", ino->di_ib[2]); } @@ -831,7 +802,6 @@ dbg_dump_ufs2_ino(struct fs *sb, const c return; } -/* ***************************************************** dbg_dump_iblk ***** */ /* * Dump an indirect block. The iteration to dump a full file has to be * written around. @@ -841,9 +811,8 @@ dbg_dump_iblk(struct fs *sb, const char { unsigned int *mem, i, j, size; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START INDIRECT BLOCK DUMP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)block, @@ -855,14 +824,13 @@ dbg_dump_iblk(struct fs *sb, const char else size = sizeof(ufs2_daddr_t); - mem=(unsigned int *)block; - for (i=0; (size_t)ifs_bsize, size), - length); i+=8) { + mem = (unsigned int *)block; + for (i = 0; (size_t)i < MIN(howmany(sb->fs_bsize, size), length); + i += 8) { fprintf(dbg_log, "%04x: ", i); - for (j=0; j<8; j++) { - if((size_t)(i+j) __FBSDID("$FreeBSD$"); -/* ********************************************************** INCLUDES ***** */ #include #include #include @@ -72,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include "debug.h" -/* *************************************************** GLOBALS & TYPES ***** */ #ifdef FS_DEBUG int _dbg_lvl_ = (DL_INFO); /* DL_TRC */ #endif /* FS_DEBUG */ @@ -117,7 +115,7 @@ union dinode { static ufs2_daddr_t inoblk; /* inode block address */ static char inobuf[MAXBSIZE]; /* inode block */ static ino_t maxino; /* last valid inode */ -static int unlabeled; /* unlabeled partition, e.g. vinum volume etc. */ +static int unlabeled; /* unlabeled partition, e.g. vinum volume */ /* * An array of elements of type struct gfs_bpp describes all blocks to @@ -130,10 +128,9 @@ struct gfs_bpp { #define GFS_FL_FIRST 1 #define GFS_FL_LAST 2 unsigned int flags; /* special handling required */ - int found; /* how many references were updated */ + int found; /* how many references were updated */ }; -/* ******************************************************** PROTOTYPES ***** */ static void growfs(int, int, unsigned int); static void rdfs(ufs2_daddr_t, size_t, void *, int); static void wtfs(ufs2_daddr_t, size_t, void *, int, unsigned int); @@ -158,7 +155,6 @@ static void indirchk(ufs_lbn_t, ufs_lbn_ struct gfs_bpp *, int, int, unsigned int); static void get_dev_size(int, int *); -/* ************************************************************ growfs ***** */ /* * Here we actually start growing the file system. We basically read the * cylinder summary from the first cylinder group as we want to update @@ -174,12 +170,12 @@ static void growfs(int fsi, int fso, unsigned int Nflag) { DBG_FUNC("growfs") - time_t modtime; - uint cylno; - int i, j, width; - char tmpbuf[100]; + time_t modtime; + uint cylno; + int i, j, width; + char tmpbuf[100]; #ifdef FSIRAND - static int randinit=0; + static int randinit=0; DBG_ENTER; @@ -198,37 +194,35 @@ growfs(int fsi, int fso, unsigned int Nf * Get the cylinder summary into the memory. */ fscs = (struct csum *)calloc((size_t)1, (size_t)sblock.fs_cssize); - if(fscs == NULL) { + if (fscs == NULL) errx(1, "calloc failed"); - } for (i = 0; i < osblock.fs_cssize; i += osblock.fs_bsize) { rdfs(fsbtodb(&osblock, osblock.fs_csaddr + numfrags(&osblock, i)), (size_t)MIN(osblock.fs_cssize - i, - osblock.fs_bsize), (void *)(((char *)fscs)+i), fsi); + osblock.fs_bsize), (void *)(((char *)fscs) + i), fsi); } #ifdef FS_DEBUG -{ - struct csum *dbg_csp; - int dbg_csc; - char dbg_line[80]; - - dbg_csp=fscs; - for(dbg_csc=0; dbg_csc= width) { printf("\n"); i = 0; @@ -288,20 +282,18 @@ growfs(int fsi, int fso, unsigned int Nf DBG_PRINT0("fscs written\n"); #ifdef FS_DEBUG -{ - struct csum *dbg_csp; - int dbg_csc; - char dbg_line[80]; - - dbg_csp=fscs; - for(dbg_csc=0; dbg_csc 0) @@ -549,7 +538,6 @@ initcg(int cylno, time_t modtime, int fs return; } -/* ******************************************************* frag_adjust ***** */ /* * Here we add or subtract (sign +1/-1) the available fragments in a given * block to or from the fragment statistics. By subtracting before and adding @@ -570,45 +558,38 @@ frag_adjust(ufs2_daddr_t frag, int sign) * Here frag only needs to point to any fragment in the block we want * to examine. */ - for(f=rounddown(frag, sblock.fs_frag); - ffound++; DBG_PRINT3("scg (%jd->%jd)[%d] reference updated\n", - (intmax_t)f->old, - (intmax_t)f->new, - fragnum); + (intmax_t)f->old, (intmax_t)f->new, fragnum); /* * Copy the block back immediately. @@ -669,7 +648,6 @@ cond_bl_upd(ufs2_daddr_t *block, struct return (0); } -/* ************************************************************ updjcg ***** */ /* * Here we do all needed work for the former last cylinder group. It has to be * changed in any case, even if the file system ended exactly on the end of @@ -685,10 +663,10 @@ static void updjcg(int cylno, time_t modtime, int fsi, int fso, unsigned int Nflag) { DBG_FUNC("updjcg") - ufs2_daddr_t cbase, dmax, dupper; - struct csum *cs; - int i,k; - int j=0; + ufs2_daddr_t cbase, dmax, dupper; + struct csum *cs; + int i, k; + int j = 0; DBG_ENTER; @@ -699,9 +677,7 @@ updjcg(int cylno, time_t modtime, int fs rdfs(fsbtodb(&osblock, cgtod(&osblock, cylno)), (size_t)osblock.fs_cgsize, (void *)&aocg, fsi); DBG_PRINT0("jcg read\n"); - DBG_DUMP_CG(&sblock, - "old joining cg", - &aocg); + DBG_DUMP_CG(&sblock, "old joining cg", &aocg); memcpy((void *)&cgun1, (void *)&cgun2, sizeof(cgun2)); @@ -713,16 +689,14 @@ updjcg(int cylno, time_t modtime, int fs * cylinder group we have to change that value now to fs_cpg. */ - if(cgbase(&osblock, cylno+1) == osblock.fs_size) { + if (cgbase(&osblock, cylno + 1) == osblock.fs_size) { if (sblock.fs_magic == FS_UFS1_MAGIC) acg.cg_old_ncyl=sblock.fs_old_cpg; wtfs(fsbtodb(&sblock, cgtod(&sblock, cylno)), (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); DBG_PRINT0("jcg written\n"); - DBG_DUMP_CG(&sblock, - "new joining cg", - &acg); + DBG_DUMP_CG(&sblock, "new joining cg", &acg); DBG_LEAVE; return; @@ -736,9 +710,8 @@ updjcg(int cylno, time_t modtime, int fs if (dmax > sblock.fs_size) dmax = sblock.fs_size; dupper = cgdmin(&sblock, cylno) - cbase; - if (cylno == 0) { /* XXX fscs may be relocated */ + if (cylno == 0) /* XXX fscs may be relocated */ dupper += howmany(sblock.fs_cssize, sblock.fs_fsize); - } /* * Set pointer to the cylinder summary for our cylinder group. @@ -760,21 +733,16 @@ updjcg(int cylno, time_t modtime, int fs } else { acg.cg_old_ncyl = sblock.fs_old_cpg; } - DBG_PRINT2("jcg dbg: %d %u", - cylno, - sblock.fs_ncg); + DBG_PRINT2("jcg dbg: %d %u", cylno, sblock.fs_ncg); #ifdef FS_DEBUG if (sblock.fs_magic == FS_UFS1_MAGIC) - DBG_PRINT2("%d %u", - acg.cg_old_ncyl, - sblock.fs_old_cpg); + DBG_PRINT2("%d %u", acg.cg_old_ncyl, sblock.fs_old_cpg); #endif DBG_PRINT0("\n"); acg.cg_ndblk = dmax - cbase; - sblock.fs_dsize += acg.cg_ndblk-aocg.cg_ndblk; - if (sblock.fs_contigsumsize > 0) { + sblock.fs_dsize += acg.cg_ndblk - aocg.cg_ndblk; + if (sblock.fs_contigsumsize > 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; - } /* * Now we have to update the free fragment bitmap for our new free @@ -788,15 +756,16 @@ updjcg(int cylno, time_t modtime, int fs * Handle the first new block here if it was partially available * before. */ - if(osblock.fs_size % sblock.fs_frag) { - if(roundup(osblock.fs_size, sblock.fs_frag)<=sblock.fs_size) { + if (osblock.fs_size % sblock.fs_frag) { + if (roundup(osblock.fs_size, sblock.fs_frag) <= + sblock.fs_size) { /* * The new space is enough to fill at least this * block */ - j=0; - for(i=roundup(osblock.fs_size-cbase, sblock.fs_frag)-1; - i>=osblock.fs_size-cbase; + j = 0; + for (i = roundup(osblock.fs_size - cbase, + sblock.fs_frag) - 1; i >= osblock.fs_size - cbase; i--) { setbit(cg_blksfree(&acg), i); acg.cg_cs.cs_nffree++; @@ -808,44 +777,43 @@ updjcg(int cylno, time_t modtime, int fs * already existing fragment at the former end of the * file system. */ - if(isblock(&sblock, cg_blksfree(&acg), - ((osblock.fs_size - cgbase(&sblock, cylno))/ - sblock.fs_frag))) { + if (isblock(&sblock, cg_blksfree(&acg), + ((osblock.fs_size - cgbase(&sblock, cylno)) / + sblock.fs_frag))) { /* * The block is now completely available. */ DBG_PRINT0("block was\n"); - acg.cg_frsum[osblock.fs_size%sblock.fs_frag]--; + acg.cg_frsum[osblock.fs_size % sblock.fs_frag]--; acg.cg_cs.cs_nbfree++; - acg.cg_cs.cs_nffree-=sblock.fs_frag; - k=rounddown(osblock.fs_size-cbase, + acg.cg_cs.cs_nffree -= sblock.fs_frag; + k = rounddown(osblock.fs_size - cbase, + sblock.fs_frag); + updclst((osblock.fs_size - cbase) / sblock.fs_frag); - updclst((osblock.fs_size-cbase)/sblock.fs_frag); } else { /* * Lets rejoin a possible partially growed * fragment. */ - k=0; - while(isset(cg_blksfree(&acg), i) && - (i>=rounddown(osblock.fs_size-cbase, + k = 0; + while (isset(cg_blksfree(&acg), i) && + (i >= rounddown(osblock.fs_size - cbase, sblock.fs_frag))) { i--; k++; } - if(k) { + if (k) acg.cg_frsum[k]--; - } - acg.cg_frsum[k+j]++; + acg.cg_frsum[k + j]++; } } else { /* * We only grow by some fragments within this last * block. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 19:01:42 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3BA61065677; Sat, 23 Jun 2012 19:01:42 +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 ACDD18FC1D; Sat, 23 Jun 2012 19:01: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 q5NJ1gKu058843; Sat, 23 Jun 2012 19:01:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NJ1gbu058841; Sat, 23 Jun 2012 19:01:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206231901.q5NJ1gbu058841@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 23 Jun 2012 19:01: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: r237498 - stable/9/sbin/growfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 19:01:42 -0000 Author: trasz Date: Sat Jun 23 19:01:42 2012 New Revision: 237498 URL: http://svn.freebsd.org/changeset/base/237498 Log: MFC r233656: Remove disklabel handling code from growfs. This should be done via geom_part(4), and it doesn't belong in growfs anyway. Reviewed by: kib, mckusick Sponsored by: The FreeBSD Foundation Modified: stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Jun 23 18:58:02 2012 (r237497) +++ stable/9/sbin/growfs/growfs.c Sat Jun 23 19:01:42 2012 (r237498) @@ -50,7 +50,6 @@ All rights reserved.\n"; __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -115,7 +114,6 @@ union dinode { static ufs2_daddr_t inoblk; /* inode block address */ static char inobuf[MAXBSIZE]; /* inode block */ static ino_t maxino; /* last valid inode */ -static int unlabeled; /* unlabeled partition, e.g. vinum volume */ /* * An array of elements of type struct gfs_bpp describes all blocks to @@ -143,8 +141,6 @@ static void setblock(struct fs *, unsign static void initcg(int, time_t, int, unsigned int); static void updjcg(int, time_t, int, int, unsigned int); static void updcsloc(time_t, int, int, unsigned int); -static struct disklabel *get_disklabel(int); -static void return_disklabel(int, struct disklabel *, unsigned int); static union dinode *ginode(ino_t, int, int); static void frag_adjust(ufs2_daddr_t, int); static int cond_bl_upd(ufs2_daddr_t *, struct gfs_bpp *, int, int, @@ -1814,8 +1810,7 @@ charsperline(void) } /* - * Get the size of the partition if we can't figure it out from the disklabel, - * e.g. from vinum volumes. + * Get the size of the partition. */ static void get_dev_size(int fd, int *size) @@ -1841,8 +1836,7 @@ get_dev_size(int fd, int *size) * and it does some basic checkings. The old file system size is determined * and after some more checks like we can really access the new last block * on the disk etc. we calculate the new parameters for the superblock. After - * having done this we just call growfs() which will do the work. Before - * we finish the only thing left is to update the disklabel. + * having done this we just call growfs() which will do the work. * We still have to provide support for snapshots. Therefore we first have to * understand what data structures are always replicated in the snapshot on * creation, for all other blocks we touch during our procedure, we have to @@ -1860,15 +1854,13 @@ int main(int argc, char **argv) { DBG_FUNC("main") - char *device, *special, *cp; + char *device, *special; int ch; unsigned int size = 0; size_t len; unsigned int Nflag = 0; int ExpertFlag = 0; struct stat st; - struct disklabel *lp; - struct partition *pp; int i, fsi, fso; u_int32_t p_size; char reply[5]; @@ -1960,24 +1952,11 @@ main(int argc, char **argv) err(1, "%s", device); /* - * Try to read a label and guess the slice if not specified. This - * code should guess the right thing and avoid to bother the user - * with the task of specifying the option -v on vinum volumes. - */ - cp = device + strlen(device) - 1; - lp = get_disklabel(fsi); - pp = NULL; - if (lp != NULL) { - if (isdigit(*cp)) - pp = &lp->d_partitions[2]; - else if (*cp>='a' && *cp<='h') - pp = &lp->d_partitions[*cp - 'a']; - else - errx(1, "unknown device"); - p_size = pp->p_size; - } else { - get_dev_size(fsi, &p_size); - } + * Try to guess the slice if not specified. This code should guess + * the right thing and avoid to bother the user with the task + * of specifying the option -v on vinum volumes. + */ + get_dev_size(fsi, &p_size); /* * Check if that partition is suitable for growing a file system. @@ -2007,8 +1986,7 @@ main(int argc, char **argv) DBG_DUMP_FS(&sblock, "old sblock"); /* - * Determine size to grow to. Default to the full size specified in - * the disk label. + * Determine size to grow to. Default to the device size. */ sblock.fs_size = dbtofsb(&osblock, p_size); if (size != 0) { @@ -2068,7 +2046,7 @@ main(int argc, char **argv) /* * Now calculate new superblock values and check for reasonable * bound for new file system size: - * fs_size: is derived from label or user input + * fs_size: is derived from user input * fs_dsize: should get updated in the routines creating or * updating the cylinder groups on the fly * fs_cstotal: should get updated in the routines creating or @@ -2120,18 +2098,6 @@ main(int argc, char **argv) */ growfs(fsi, fso, Nflag); - /* - * Update the disk label. - */ - if (!unlabeled) { - pp->p_fsize = sblock.fs_fsize; - pp->p_frag = sblock.fs_frag; - pp->p_cpg = sblock.fs_fpg; - - return_disklabel(fso, lp, Nflag); - DBG_PRINT0("label rewritten\n"); - } - close(fsi); if (fso > -1) close(fso); @@ -2143,68 +2109,6 @@ main(int argc, char **argv) } /* - * Write the updated disklabel back to disk. - */ -static void -return_disklabel(int fd, struct disklabel *lp, unsigned int Nflag) -{ - DBG_FUNC("return_disklabel") - u_short sum; - u_short *ptr; - - DBG_ENTER; - - if (!lp) { - DBG_LEAVE; - return; - } - if (!Nflag) { - lp->d_checksum = 0; - sum = 0; - ptr = (u_short *)lp; - - /* - * recalculate checksum - */ - while (ptr < (u_short *)&lp->d_partitions[lp->d_npartitions]) - sum ^= *ptr++; - lp->d_checksum=sum; - - if (ioctl(fd, DIOCWDINFO, (char *)lp) < 0) - errx(1, "DIOCWDINFO failed"); - } - free(lp); - - DBG_LEAVE; - return ; -} - -/* - * Read the disklabel from disk. - */ -static struct disklabel * -get_disklabel(int fd) -{ - DBG_FUNC("get_disklabel") - static struct disklabel *lab; - - DBG_ENTER; - - lab = (struct disklabel *)malloc(sizeof(struct disklabel)); - if (!lab) - errx(1, "malloc failed"); - - if (!ioctl(fd, DIOCGDINFO, (char *)lab)) - return (lab); - - unlabeled++; - - DBG_LEAVE; - return (NULL); -} - - -/* * Dump a line of usage. */ static void From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 19:03:43 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C4AC1065675; Sat, 23 Jun 2012 19:03:43 +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 057EF8FC17; Sat, 23 Jun 2012 19: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 q5NJ3gx1058973; Sat, 23 Jun 2012 19:03:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NJ3gxf058971; Sat, 23 Jun 2012 19:03:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206231903.q5NJ3gxf058971@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 23 Jun 2012 19:03: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: r237499 - stable/9/sbin/growfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 19:03:43 -0000 Author: trasz Date: Sat Jun 23 19:03:42 2012 New Revision: 237499 URL: http://svn.freebsd.org/changeset/base/237499 Log: MFC r234178: Remove block reallocation used to make room for the cylinder group summary structure. From now on, when there is no room for it, we simply allocate new one in a newly added cylinder group. This patch removes a conditional in updcsloc(), reindents some code there, and removes unused routines. I decided to do it this way instead of disabling reallocation when the filesystem is live and leaving it as it is otherwise, because this allows for removal of lots of complicated and hard to test code. Also, conditionally disabling it would result in a different layout in filesystems resized online and offline, which would look somewhat weird. Reviewed by: mckusick No objections from: kib Sponsored by: The FreeBSD Foundation Modified: stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Jun 23 19:01:42 2012 (r237498) +++ stable/9/sbin/growfs/growfs.c Sat Jun 23 19:03:42 2012 (r237499) @@ -94,45 +94,11 @@ static union { #define acg cgun1.cg /* a cylinder cgroup (new) */ #define aocg cgun2.cg /* an old cylinder group */ -static char ablk[MAXBSIZE]; /* a block */ - static struct csum *fscs; /* cylinder summary */ -union dinode { - struct ufs1_dinode dp1; - struct ufs2_dinode dp2; -}; -#define DIP(dp, field) \ - ((sblock.fs_magic == FS_UFS1_MAGIC) ? \ - (uint32_t)(dp)->dp1.field : (dp)->dp2.field) -#define DIP_SET(dp, field, val) do { \ - if (sblock.fs_magic == FS_UFS1_MAGIC) \ - (dp)->dp1.field = (val); \ - else \ - (dp)->dp2.field = (val); \ - } while (0) -static ufs2_daddr_t inoblk; /* inode block address */ -static char inobuf[MAXBSIZE]; /* inode block */ -static ino_t maxino; /* last valid inode */ - -/* - * An array of elements of type struct gfs_bpp describes all blocks to - * be relocated in order to free the space needed for the cylinder group - * summary for all cylinder groups located in the first cylinder group. - */ -struct gfs_bpp { - ufs2_daddr_t old; /* old block number */ - ufs2_daddr_t new; /* new block number */ -#define GFS_FL_FIRST 1 -#define GFS_FL_LAST 2 - unsigned int flags; /* special handling required */ - int found; /* how many references were updated */ -}; - static void growfs(int, int, unsigned int); static void rdfs(ufs2_daddr_t, size_t, void *, int); static void wtfs(ufs2_daddr_t, size_t, void *, int, unsigned int); -static ufs2_daddr_t alloc(void); static int charsperline(void); static void usage(void); static int isblock(struct fs *, unsigned char *, int); @@ -141,14 +107,8 @@ static void setblock(struct fs *, unsign static void initcg(int, time_t, int, unsigned int); static void updjcg(int, time_t, int, int, unsigned int); static void updcsloc(time_t, int, int, unsigned int); -static union dinode *ginode(ino_t, int, int); static void frag_adjust(ufs2_daddr_t, int); -static int cond_bl_upd(ufs2_daddr_t *, struct gfs_bpp *, int, int, - unsigned int); static void updclst(int); -static void updrefs(int, ino_t, struct gfs_bpp *, int, int, unsigned int); -static void indirchk(ufs_lbn_t, ufs_lbn_t, ufs2_daddr_t, ufs_lbn_t, - struct gfs_bpp *, int, int, unsigned int); static void get_dev_size(int, int *); /* @@ -587,64 +547,6 @@ frag_adjust(ufs2_daddr_t frag, int sign) } /* - * Here we conditionally update a pointer to a fragment. We check for all - * relocated blocks if any of its fragments is referenced by the current - * field, and update the pointer to the respective fragment in our new - * block. If we find a reference we write back the block immediately, - * as there is no easy way for our general block reading engine to figure - * out if a write back operation is needed. - */ -static int -cond_bl_upd(ufs2_daddr_t *block, struct gfs_bpp *field, int fsi, int fso, - unsigned int Nflag) -{ - DBG_FUNC("cond_bl_upd") - struct gfs_bpp *f; - ufs2_daddr_t src, dst; - int fragnum; - void *ibuf; - - DBG_ENTER; - - for (f = field; f->old != 0; f++) { - src = *block; - if (fragstoblks(&sblock, src) != f->old) - continue; - /* - * The fragment is part of the block, so update. - */ - dst = blkstofrags(&sblock, f->new); - fragnum = fragnum(&sblock, src); - *block = dst + fragnum; - f->found++; - DBG_PRINT3("scg (%jd->%jd)[%d] reference updated\n", - (intmax_t)f->old, (intmax_t)f->new, fragnum); - - /* - * Copy the block back immediately. - * - * XXX If src is from an indirect block we have - * to implement copy on write here in case of - * active snapshots. - */ - ibuf = malloc(sblock.fs_bsize); - if (!ibuf) - errx(1, "malloc failed"); - src -= fragnum; - rdfs(fsbtodb(&sblock, src), (size_t)sblock.fs_bsize, ibuf, fsi); - wtfs(dst, (size_t)sblock.fs_bsize, ibuf, fso, Nflag); - free(ibuf); - /* - * The same block can't be found again in this loop. - */ - return (1); - } - - DBG_LEAVE; - return (0); -} - -/* * Here we do all needed work for the former last cylinder group. It has to be * changed in any case, even if the file system ended exactly on the end of * this group, as there is some slightly inconsistent handling of the number @@ -890,11 +792,8 @@ updjcg(int cylno, time_t modtime, int fs * longer in the beginning of the first cylinder group you should never * use a version of fsck which is not aware of the possibility to have * this structure in a non standard place. - * Option (1) is considered to be less intrusive to the structure of the file- - * system. So we try to stick to that whenever possible. If there is not enough - * space in the cylinder group containing the cylinder summary we have to use - * method (2). In case of active snapshots in the file system we probably can - * completely avoid implementing copy on write if we stick to method (2) only. + * Option (2) is considered to be less intrusive to the structure of the file- + * system, so that's the one being used. */ static void updcsloc(time_t modtime, int fsi, int fso, unsigned int Nflag) @@ -903,11 +802,7 @@ updcsloc(time_t modtime, int fsi, int fs struct csum *cs; int ocscg, ncscg; int blocks; - ufs2_daddr_t cbase, dupper, odupper, d, f, g; - int ind, inc; - uint cylno; - struct gfs_bpp *bp; - int i, l; + ufs2_daddr_t d; int lcs = 0; int block; @@ -951,117 +846,86 @@ updcsloc(time_t modtime, int fsi, int fs * also up to 8*3 blocks for indirect blocks for all possible * references. */ - if (/*((int)sblock.fs_time&0x3)>0||*/ cs->cs_nbfree < blocks) { - /* - * There is not enough space in the old cylinder group to - * relocate all blocks as needed, so we relocate the whole - * cylinder group summary to a new group. We try to use the - * first complete new cylinder group just created. Within the - * cylinder group we align the area immediately after the - * cylinder group information location in order to be as - * close as possible to the original implementation of ffs. - * - * First we have to make sure we'll find enough space in the - * new cylinder group. If not, then we currently give up. - * We start with freeing everything which was used by the - * fragments of the old cylinder summary in the current group. - * Now we write back the group meta data, read in the needed - * meta data from the new cylinder group, and start allocating - * within that group. Here we can assume, the group to be - * completely empty. Which makes the handling of fragments and - * clusters a lot easier. - */ - DBG_TRC; - if (sblock.fs_ncg - osblock.fs_ncg < 2) - errx(2, "panic: not enough space"); + /* + * There is not enough space in the old cylinder group to + * relocate all blocks as needed, so we relocate the whole + * cylinder group summary to a new group. We try to use the + * first complete new cylinder group just created. Within the + * cylinder group we align the area immediately after the + * cylinder group information location in order to be as + * close as possible to the original implementation of ffs. + * + * First we have to make sure we'll find enough space in the + * new cylinder group. If not, then we currently give up. + * We start with freeing everything which was used by the + * fragments of the old cylinder summary in the current group. + * Now we write back the group meta data, read in the needed + * meta data from the new cylinder group, and start allocating + * within that group. Here we can assume, the group to be + * completely empty. Which makes the handling of fragments and + * clusters a lot easier. + */ + DBG_TRC; + if (sblock.fs_ncg - osblock.fs_ncg < 2) + errx(2, "panic: not enough space"); - /* - * Point "d" to the first fragment not used by the cylinder - * summary. - */ - d = osblock.fs_csaddr + (osblock.fs_cssize / osblock.fs_fsize); + /* + * Point "d" to the first fragment not used by the cylinder + * summary. + */ + d = osblock.fs_csaddr + (osblock.fs_cssize / osblock.fs_fsize); - /* - * Set up last cluster size ("lcs") already here. Calculate - * the size for the trailing cluster just behind where "d" - * points to. - */ - if (sblock.fs_contigsumsize > 0) { - for (block = howmany(d % sblock.fs_fpg, sblock.fs_frag), - lcs = 0; lcs < sblock.fs_contigsumsize; - block++, lcs++) { - if (isclr(cg_clustersfree(&acg), block)) - break; - } + /* + * Set up last cluster size ("lcs") already here. Calculate + * the size for the trailing cluster just behind where "d" + * points to. + */ + if (sblock.fs_contigsumsize > 0) { + for (block = howmany(d % sblock.fs_fpg, sblock.fs_frag), + lcs = 0; lcs < sblock.fs_contigsumsize; + block++, lcs++) { + if (isclr(cg_clustersfree(&acg), block)) + break; } + } + /* + * Point "d" to the last frag used by the cylinder summary. + */ + d--; + + DBG_PRINT1("d=%jd\n", (intmax_t)d); + if ((d + 1) % sblock.fs_frag) { /* - * Point "d" to the last frag used by the cylinder summary. + * The end of the cylinder summary is not a complete + * block. */ - d--; - - DBG_PRINT1("d=%jd\n", (intmax_t)d); - if ((d + 1) % sblock.fs_frag) { - /* - * The end of the cylinder summary is not a complete - * block. - */ - DBG_TRC; - frag_adjust(d % sblock.fs_fpg, -1); - for (; (d + 1) % sblock.fs_frag; d--) { - DBG_PRINT1("d=%jd\n", (intmax_t)d); - setbit(cg_blksfree(&acg), d % sblock.fs_fpg); - acg.cg_cs.cs_nffree++; - sblock.fs_cstotal.cs_nffree++; - } - /* - * Point "d" to the last fragment of the last - * (incomplete) block of the cylinder summary. - */ - d++; - frag_adjust(d%sblock.fs_fpg, 1); - - if (isblock(&sblock, cg_blksfree(&acg), - (d % sblock.fs_fpg) / sblock.fs_frag)) { - DBG_PRINT1("d=%jd\n", (intmax_t)d); - acg.cg_cs.cs_nffree -= sblock.fs_frag; - acg.cg_cs.cs_nbfree++; - sblock.fs_cstotal.cs_nffree -= sblock.fs_frag; - sblock.fs_cstotal.cs_nbfree++; - if (sblock.fs_contigsumsize > 0) { - setbit(cg_clustersfree(&acg), - (d % sblock.fs_fpg) / - sblock.fs_frag); - if (lcs < sblock.fs_contigsumsize) { - if (lcs) - cg_clustersum(&acg)[lcs]--; - lcs++; - cg_clustersum(&acg)[lcs]++; - } - } - } - /* - * Point "d" to the first fragment of the block before - * the last incomplete block. - */ - d--; + DBG_TRC; + frag_adjust(d % sblock.fs_fpg, -1); + for (; (d + 1) % sblock.fs_frag; d--) { + DBG_PRINT1("d=%jd\n", (intmax_t)d); + setbit(cg_blksfree(&acg), d % sblock.fs_fpg); + acg.cg_cs.cs_nffree++; + sblock.fs_cstotal.cs_nffree++; } + /* + * Point "d" to the last fragment of the last + * (incomplete) block of the cylinder summary. + */ + d++; + frag_adjust(d%sblock.fs_fpg, 1); - DBG_PRINT1("d=%jd\n", (intmax_t)d); - for (d = rounddown(d, sblock.fs_frag); d >= osblock.fs_csaddr; - d -= sblock.fs_frag) { - DBG_TRC; + if (isblock(&sblock, cg_blksfree(&acg), + (d % sblock.fs_fpg) / sblock.fs_frag)) { DBG_PRINT1("d=%jd\n", (intmax_t)d); - setblock(&sblock, cg_blksfree(&acg), - (d % sblock.fs_fpg) / sblock.fs_frag); + acg.cg_cs.cs_nffree -= sblock.fs_frag; acg.cg_cs.cs_nbfree++; + sblock.fs_cstotal.cs_nffree -= sblock.fs_frag; sblock.fs_cstotal.cs_nbfree++; if (sblock.fs_contigsumsize > 0) { setbit(cg_clustersfree(&acg), - (d % sblock.fs_fpg) / sblock.fs_frag); - /* - * The last cluster size is already set up. - */ + (d % sblock.fs_fpg) / + sblock.fs_frag); if (lcs < sblock.fs_contigsumsize) { if (lcs) cg_clustersum(&acg)[lcs]--; @@ -1070,392 +934,138 @@ updcsloc(time_t modtime, int fsi, int fs } } } - *cs = acg.cg_cs; - /* - * Now write the former cylinder group containing the cylinder - * summary back to disk. + * Point "d" to the first fragment of the block before + * the last incomplete block. */ - wtfs(fsbtodb(&sblock, cgtod(&sblock, ocscg)), - (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); - DBG_PRINT0("oscg written\n"); - DBG_DUMP_CG(&sblock, "old summary cg", &acg); - - /* - * Find the beginning of the new cylinder group containing the - * cylinder summary. - */ - sblock.fs_csaddr = cgdmin(&sblock, osblock.fs_ncg); - ncscg = dtog(&sblock, sblock.fs_csaddr); - cs = fscs + ncscg; - - /* - * If Nflag is specified, we would now read random data instead - * of an empty cg structure from disk. So we can't simulate that - * part for now. - */ - if (Nflag) { - DBG_PRINT0("nscg update skipped\n"); - DBG_LEAVE; - return; - } - - /* - * Read the future cylinder group containing the cylinder - * summary from disk, and make a copy. - */ - rdfs(fsbtodb(&sblock, cgtod(&sblock, ncscg)), - (size_t)sblock.fs_cgsize, (void *)&aocg, fsi); - DBG_PRINT0("nscg read\n"); - DBG_DUMP_CG(&sblock, "new summary cg", &aocg); - - memcpy((void *)&cgun1, (void *)&cgun2, sizeof(cgun2)); + d--; + } - /* - * Allocate all complete blocks used by the new cylinder - * summary. - */ - for (d = sblock.fs_csaddr; d + sblock.fs_frag <= - sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize); - d += sblock.fs_frag) { - clrblock(&sblock, cg_blksfree(&acg), + DBG_PRINT1("d=%jd\n", (intmax_t)d); + for (d = rounddown(d, sblock.fs_frag); d >= osblock.fs_csaddr; + d -= sblock.fs_frag) { + DBG_TRC; + DBG_PRINT1("d=%jd\n", (intmax_t)d); + setblock(&sblock, cg_blksfree(&acg), + (d % sblock.fs_fpg) / sblock.fs_frag); + acg.cg_cs.cs_nbfree++; + sblock.fs_cstotal.cs_nbfree++; + if (sblock.fs_contigsumsize > 0) { + setbit(cg_clustersfree(&acg), (d % sblock.fs_fpg) / sblock.fs_frag); - acg.cg_cs.cs_nbfree--; - sblock.fs_cstotal.cs_nbfree--; - if (sblock.fs_contigsumsize > 0) { - clrbit(cg_clustersfree(&acg), - (d % sblock.fs_fpg) / sblock.fs_frag); - } - } - - /* - * Allocate all fragments used by the cylinder summary in the - * last block. - */ - if (d < - sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize)) { - for (; d - sblock.fs_csaddr < - sblock.fs_cssize/sblock.fs_fsize; d++) { - clrbit(cg_blksfree(&acg), d % sblock.fs_fpg); - acg.cg_cs.cs_nffree--; - sblock.fs_cstotal.cs_nffree--; + /* + * The last cluster size is already set up. + */ + if (lcs < sblock.fs_contigsumsize) { + if (lcs) + cg_clustersum(&acg)[lcs]--; + lcs++; + cg_clustersum(&acg)[lcs]++; } - acg.cg_cs.cs_nbfree--; - acg.cg_cs.cs_nffree += sblock.fs_frag; - sblock.fs_cstotal.cs_nbfree--; - sblock.fs_cstotal.cs_nffree += sblock.fs_frag; - if (sblock.fs_contigsumsize > 0) - clrbit(cg_clustersfree(&acg), - (d % sblock.fs_fpg) / sblock.fs_frag); - - frag_adjust(d % sblock.fs_fpg, 1); } - /* - * XXX Handle the cluster statistics here in the case this - * cylinder group is now almost full, and the remaining - * space is less then the maximum cluster size. This is - * probably not needed, as you would hardly find a file - * system which has only MAXCSBUFS+FS_MAXCONTIG of free - * space right behind the cylinder group information in - * any new cylinder group. - */ - - /* - * Update our statistics in the cylinder summary. - */ - *cs = acg.cg_cs; - - /* - * Write the new cylinder group containing the cylinder summary - * back to disk. - */ - wtfs(fsbtodb(&sblock, cgtod(&sblock, ncscg)), - (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); - DBG_PRINT0("nscg written\n"); - DBG_DUMP_CG(&sblock, "new summary cg", &acg); - - DBG_LEAVE; - return; } - /* - * We have got enough of space in the current cylinder group, so we - * can relocate just a few blocks, and let the summary information - * grow in place where it is right now. - */ - DBG_TRC; - - cbase = cgbase(&osblock, ocscg); /* old and new are equal */ - dupper = sblock.fs_csaddr - cbase + - howmany(sblock.fs_cssize, sblock.fs_fsize); - odupper = osblock.fs_csaddr - cbase + - howmany(osblock.fs_cssize, osblock.fs_fsize); - - sblock.fs_dsize -= dupper - odupper; + *cs = acg.cg_cs; /* - * Allocate the space for the array of blocks to be relocated. + * Now write the former cylinder group containing the cylinder + * summary back to disk. */ - bp = (struct gfs_bpp *)malloc(((dupper - odupper) / - sblock.fs_frag + 2) * sizeof(struct gfs_bpp)); - if (bp == NULL) - errx(1, "malloc failed"); - memset((char *)bp, 0, ((dupper - odupper) / sblock.fs_frag + 2) * - sizeof(struct gfs_bpp)); + wtfs(fsbtodb(&sblock, cgtod(&sblock, ocscg)), + (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); + DBG_PRINT0("oscg written\n"); + DBG_DUMP_CG(&sblock, "old summary cg", &acg); /* - * Lock all new frags needed for the cylinder group summary. This is - * done per fragment in the first and last block of the new required - * area, and per block for all other blocks. - * - * Handle the first new block here (but only if some fragments where - * already used for the cylinder summary). + * Find the beginning of the new cylinder group containing the + * cylinder summary. */ - ind = 0; - frag_adjust(odupper, -1); - for (d = odupper; ((d < dupper) && (d % sblock.fs_frag)); d++) { - DBG_PRINT1("scg first frag check loop d=%jd\n", (intmax_t)d); - if (isclr(cg_blksfree(&acg), d)) { - if (!ind) { - bp[ind].old = d / sblock.fs_frag; - bp[ind].flags |= GFS_FL_FIRST; - if (roundup(d, sblock.fs_frag) >= dupper) - bp[ind].flags |= GFS_FL_LAST; - ind++; - } - } else { - clrbit(cg_blksfree(&acg), d); - acg.cg_cs.cs_nffree--; - sblock.fs_cstotal.cs_nffree--; - } - /* - * No cluster handling is needed here, as there was at least - * one fragment in use by the cylinder summary in the old - * file system. - * No block-free counter handling here as this block was not - * a free block. - */ - } - frag_adjust(odupper, 1); + sblock.fs_csaddr = cgdmin(&sblock, osblock.fs_ncg); + ncscg = dtog(&sblock, sblock.fs_csaddr); + cs = fscs + ncscg; /* - * Handle all needed complete blocks here. + * If Nflag is specified, we would now read random data instead + * of an empty cg structure from disk. So we can't simulate that + * part for now. */ - for (; d + sblock.fs_frag <= dupper; d += sblock.fs_frag) { - DBG_PRINT1("scg block check loop d=%jd\n", (intmax_t)d); - if (!isblock(&sblock, cg_blksfree(&acg), d / sblock.fs_frag)) { - for (f = d; f < d + sblock.fs_frag; f++) { - if (isset(cg_blksfree(&aocg), f)) { - acg.cg_cs.cs_nffree--; - sblock.fs_cstotal.cs_nffree--; - } - } - clrblock(&sblock, cg_blksfree(&acg), d / sblock.fs_frag); - bp[ind].old = d / sblock.fs_frag; - ind++; - } else { - clrblock(&sblock, cg_blksfree(&acg), d / sblock.fs_frag); - acg.cg_cs.cs_nbfree--; - sblock.fs_cstotal.cs_nbfree--; - if (sblock.fs_contigsumsize > 0) { - clrbit(cg_clustersfree(&acg), d / sblock.fs_frag); - for (lcs = 0, l = (d / sblock.fs_frag) + 1; - lcs < sblock.fs_contigsumsize; l++, lcs++ ) { - if (isclr(cg_clustersfree(&acg), l)) - break; - } - if (lcs < sblock.fs_contigsumsize) { - cg_clustersum(&acg)[lcs + 1]--; - if (lcs) - cg_clustersum(&acg)[lcs]++; - } - } - } - /* - * No fragment counter handling is needed here, as this finally - * doesn't change after the relocation. - */ + if (Nflag) { + DBG_PRINT0("nscg update skipped\n"); + DBG_LEAVE; + return; } /* - * Handle all fragments needed in the last new affected block. + * Read the future cylinder group containing the cylinder + * summary from disk, and make a copy. */ - if (d < dupper) { - frag_adjust(dupper - 1, -1); + rdfs(fsbtodb(&sblock, cgtod(&sblock, ncscg)), + (size_t)sblock.fs_cgsize, (void *)&aocg, fsi); + DBG_PRINT0("nscg read\n"); + DBG_DUMP_CG(&sblock, "new summary cg", &aocg); - if (isblock(&sblock, cg_blksfree(&acg), d / sblock.fs_frag)) { - acg.cg_cs.cs_nbfree--; - sblock.fs_cstotal.cs_nbfree--; - acg.cg_cs.cs_nffree += sblock.fs_frag; - sblock.fs_cstotal.cs_nffree += sblock.fs_frag; - if (sblock.fs_contigsumsize > 0) { - clrbit(cg_clustersfree(&acg), d / sblock.fs_frag); - for (lcs = 0, l =(d / sblock.fs_frag) + 1; - lcs < sblock.fs_contigsumsize; l++, lcs++ ) { - if (isclr(cg_clustersfree(&acg),l)) - break; - } - if (lcs < sblock.fs_contigsumsize) { - cg_clustersum(&acg)[lcs + 1]--; - if (lcs) - cg_clustersum(&acg)[lcs]++; - } - } - } + memcpy((void *)&cgun1, (void *)&cgun2, sizeof(cgun2)); - for (; d < dupper; d++) { - DBG_PRINT1("scg second frag check loop d=%jd\n", - (intmax_t)d); - if (isclr(cg_blksfree(&acg), d)) { - bp[ind].old = d / sblock.fs_frag; - bp[ind].flags |= GFS_FL_LAST; - } else { - clrbit(cg_blksfree(&acg), d); - acg.cg_cs.cs_nffree--; - sblock.fs_cstotal.cs_nffree--; - } + /* + * Allocate all complete blocks used by the new cylinder + * summary. + */ + for (d = sblock.fs_csaddr; d + sblock.fs_frag <= + sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize); + d += sblock.fs_frag) { + clrblock(&sblock, cg_blksfree(&acg), + (d % sblock.fs_fpg) / sblock.fs_frag); + acg.cg_cs.cs_nbfree--; + sblock.fs_cstotal.cs_nbfree--; + if (sblock.fs_contigsumsize > 0) { + clrbit(cg_clustersfree(&acg), + (d % sblock.fs_fpg) / sblock.fs_frag); } - if (bp[ind].flags & GFS_FL_LAST) /* we have to advance here */ - ind++; - frag_adjust(dupper - 1, 1); } /* - * If we found a block to relocate just do so. + * Allocate all fragments used by the cylinder summary in the + * last block. */ - if (ind) { - for (i = 0; i < ind; i++) { - if (!bp[i].old) { /* no more blocks listed */ - /* - * XXX A relative blocknumber should not be - * zero, which is not explicitly - * guaranteed by our code. - */ - break; - } - /* - * Allocate a complete block in the same (current) - * cylinder group. - */ - bp[i].new = alloc() / sblock.fs_frag; - - /* - * There is no frag_adjust() needed for the new block - * as it will have no fragments yet :-). - */ - for (f = bp[i].old * sblock.fs_frag, - g = bp[i].new * sblock.fs_frag; - f < (bp[i].old + 1) * sblock.fs_frag; - f++, g++) { - if (isset(cg_blksfree(&aocg), f)) { - setbit(cg_blksfree(&acg), g); - acg.cg_cs.cs_nffree++; - sblock.fs_cstotal.cs_nffree++; - } - } - - /* - * Special handling is required if this was the first - * block. We have to consider the fragments which were - * used by the cylinder summary in the original block - * which re to be free in the copy of our block. We - * have to be careful if this first block happens to - * be also the last block to be relocated. - */ - if (bp[i].flags & GFS_FL_FIRST) { - for (f = bp[i].old * sblock.fs_frag, - g =bp[i].new * sblock.fs_frag; - f < odupper; f++, g++) { - setbit(cg_blksfree(&acg), g); - acg.cg_cs.cs_nffree++; - sblock.fs_cstotal.cs_nffree++; - } - if (!(bp[i].flags & GFS_FL_LAST)) - frag_adjust(bp[i].new * sblock.fs_frag, 1); - } - - /* - * Special handling is required if this is the last - * block to be relocated. - */ - if (bp[i].flags & GFS_FL_LAST) { - frag_adjust(bp[i].new * sblock.fs_frag, 1); - frag_adjust(bp[i].old * sblock.fs_frag, -1); - for (f = dupper; - f < roundup(dupper, sblock.fs_frag); f++) { - if (isclr(cg_blksfree(&acg), f)) { - setbit(cg_blksfree(&acg), f); - acg.cg_cs.cs_nffree++; - sblock.fs_cstotal.cs_nffree++; - } - } - frag_adjust(bp[i].old * sblock.fs_frag, 1); - } - - /* - * !!! Attach the cylindergroup offset here. - */ - bp[i].old += cbase / sblock.fs_frag; - bp[i].new += cbase / sblock.fs_frag; - - /* - * Copy the content of the block. - */ - /* - * XXX Here we will have to implement a copy on write - * in the case we have any active snapshots. - */ - rdfs(fsbtodb(&sblock, bp[i].old * sblock.fs_frag), - (size_t)sblock.fs_bsize, (void *)&ablk, fsi); - wtfs(fsbtodb(&sblock, bp[i].new * sblock.fs_frag), - (size_t)sblock.fs_bsize, (void *)&ablk, fso, Nflag); - DBG_DUMP_HEX(&sblock, "copied full block", - (unsigned char *)&ablk); - DBG_PRINT2("scg (%jd->%jd) block relocated\n", - (intmax_t)bp[i].old, (intmax_t)bp[i].new); - } - - /* - * Now we have to update all references to any fragment which - * belongs to any block relocated. We iterate now over all - * cylinder groups, within those over all non zero length - * inodes. - */ - for (cylno = 0; cylno < osblock.fs_ncg; cylno++) { - DBG_PRINT1("scg doing cg (%d)\n", cylno); - for (inc = osblock.fs_ipg - 1 ; inc > 0 ; inc--) - updrefs(cylno, (ino_t)inc, bp, fsi, fso, Nflag); + if (d < + sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize)) { + for (; d - sblock.fs_csaddr < + sblock.fs_cssize/sblock.fs_fsize; d++) { + clrbit(cg_blksfree(&acg), d % sblock.fs_fpg); + acg.cg_cs.cs_nffree--; + sblock.fs_cstotal.cs_nffree--; } + acg.cg_cs.cs_nbfree--; + acg.cg_cs.cs_nffree += sblock.fs_frag; + sblock.fs_cstotal.cs_nbfree--; + sblock.fs_cstotal.cs_nffree += sblock.fs_frag; + if (sblock.fs_contigsumsize > 0) + clrbit(cg_clustersfree(&acg), + (d % sblock.fs_fpg) / sblock.fs_frag); - /* - * All inodes are checked, now make sure the number of - * references found make sense. - */ - for (i = 0; i < ind; i++) { - if (!bp[i].found || (bp[i].found > sblock.fs_frag)) { - warnx("error: %jd refs found for block %jd.", - (intmax_t)bp[i].found, (intmax_t)bp[i].old); - } - } + frag_adjust(d % sblock.fs_fpg, 1); } /* - * The following statistics are not changed here: - * sblock.fs_cstotal.cs_ndir - * sblock.fs_cstotal.cs_nifree - * The following statistics were already updated on the fly: - * sblock.fs_cstotal.cs_nffree - * sblock.fs_cstotal.cs_nbfree - * As the statistics for this cylinder group are ready, copy it to - * the summary information array. + * XXX Handle the cluster statistics here in the case this + * cylinder group is now almost full, and the remaining + * space is less then the maximum cluster size. This is + * probably not needed, as you would hardly find a file + * system which has only MAXCSBUFS+FS_MAXCONTIG of free + * space right behind the cylinder group information in + * any new cylinder group. */ + /* + * Update our statistics in the cylinder summary. + */ *cs = acg.cg_cs; /* - * Write summary cylinder group back to disk. + * Write the new cylinder group containing the cylinder summary + * back to disk. */ - wtfs(fsbtodb(&sblock, cgtod(&sblock, ocscg)), (size_t)sblock.fs_cgsize, - (void *)&acg, fso, Nflag); - DBG_PRINT0("scg written\n"); + wtfs(fsbtodb(&sblock, cgtod(&sblock, ncscg)), + (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); + DBG_PRINT0("nscg written\n"); DBG_DUMP_CG(&sblock, "new summary cg", &acg); DBG_LEAVE; @@ -1511,126 +1121,6 @@ wtfs(ufs2_daddr_t bno, size_t size, void } /* - * Here we allocate a free block in the current cylinder group. It is assumed, - * that acg contains the current cylinder group. As we may take a block from - * somewhere in the file system we have to handle cluster summary here. - */ -static ufs2_daddr_t -alloc(void) -{ - DBG_FUNC("alloc") - ufs2_daddr_t d, blkno; - int lcs1, lcs2; - int l; - int csmin, csmax; - int dlower, dupper, dmax; - - DBG_ENTER; - - if (acg.cg_magic != CG_MAGIC) { - warnx("acg: bad magic number"); - DBG_LEAVE; - return (0); - } - if (acg.cg_cs.cs_nbfree == 0) { - warnx("error: cylinder group ran out of space"); - DBG_LEAVE; - return (0); - } - /* - * We start seeking for free blocks only from the space available after - * the end of the new grown cylinder summary. Otherwise we allocate a - * block here which we have to relocate a couple of seconds later again - * again, and we are not prepared to to this anyway. - */ - blkno = -1; - dlower = cgsblock(&sblock, acg.cg_cgx) - cgbase(&sblock, acg.cg_cgx); - dupper = cgdmin(&sblock, acg.cg_cgx) - cgbase(&sblock, acg.cg_cgx); - dmax = cgbase(&sblock, acg.cg_cgx) + sblock.fs_fpg; - if (dmax > sblock.fs_size) - dmax = sblock.fs_size; - dmax -= cgbase(&sblock, acg.cg_cgx); /* retransform into cg */ - csmin = sblock.fs_csaddr - cgbase(&sblock, acg.cg_cgx); - csmax = csmin + howmany(sblock.fs_cssize, sblock.fs_fsize); - DBG_PRINT3("seek range: dl=%d, du=%d, dm=%d\n", dlower, dupper, dmax); - DBG_PRINT2("range cont: csmin=%d, csmax=%d\n", csmin, csmax); - - for (d = 0; (d < dlower && blkno == -1); d += sblock.fs_frag) { - if (d >= csmin && d <= csmax) - continue; - if (isblock(&sblock, cg_blksfree(&acg), fragstoblks(&sblock, d))) { - blkno = fragstoblks(&sblock, d);/* Yeah found a block */ - break; - } - } - for (d = dupper; (d < dmax && blkno == -1); d += sblock.fs_frag) { - if (d >= csmin && d <= csmax) { - continue; - } - if (isblock(&sblock, cg_blksfree(&acg), fragstoblks(&sblock, d))) { - blkno = fragstoblks(&sblock, d);/* Yeah found a block */ - break; - } - } - if (blkno == -1) { - warnx("internal error: couldn't find promised block in cg"); - DBG_LEAVE; - return (0); - } - - /* - * This is needed if the block was found already in the first loop. - */ - d = blkstofrags(&sblock, blkno); - - clrblock(&sblock, cg_blksfree(&acg), blkno); - if (sblock.fs_contigsumsize > 0) { - /* - * Handle the cluster allocation bitmap. - */ - clrbit(cg_clustersfree(&acg), blkno); - /* - * We possibly have split a cluster here, so we have to do - * recalculate the sizes of the remaining cluster halves now, - * and use them for updating the cluster summary information. - * - * Lets start with the blocks before our allocated block ... - */ - for (lcs1 = 0, l = blkno - 1; lcs1 < sblock.fs_contigsumsize; - l--, lcs1++ ) { - if (isclr(cg_clustersfree(&acg), l)) - break; - } - /* - * ... and continue with the blocks right after our allocated - * block. - */ - for (lcs2 = 0, l = blkno + 1; lcs2 < sblock.fs_contigsumsize; - l++, lcs2++ ) { - if (isclr(cg_clustersfree(&acg), l)) - break; - } - - /* - * Now update all counters. - */ - cg_clustersum(&acg)[MIN(lcs1 + lcs2 + 1, sblock.fs_contigsumsize)]--; - if (lcs1) - cg_clustersum(&acg)[lcs1]++; - if (lcs2) - cg_clustersum(&acg)[lcs2]++; - } - /* - * Update all statistics based on blocks. - */ - acg.cg_cs.cs_nbfree--; - sblock.fs_cstotal.cs_nbfree--; - - DBG_LEAVE; - return (d); -} - -/* * Here we check if all frags of a block are free. For more details again * please see the source of newfs(8), as this function is taken over almost * unchanged. @@ -1735,54 +1225,6 @@ setblock(struct fs *fs, unsigned char *c } /* - * This function provides access to an individual inode. We find out in which - * block the requested inode is located, read it from disk if needed, and - * return the pointer into that block. We maintain a cache of one block to - * not read the same block again and again if we iterate linearly over all - * inodes. - */ -static union dinode * -ginode(ino_t inumber, int fsi, int cg) -{ - DBG_FUNC("ginode") - static ino_t startinum = 0; /* first inode in cached block */ - - DBG_ENTER; - - /* - * The inumber passed in is relative to the cg, so use it here to see - * if the inode has been allocated yet. - */ - if (isclr(cg_inosused(&aocg), inumber)) { - DBG_LEAVE; - return NULL; - } - /* - * Now make the inumber relative to the entire inode space so it can - * be sanity checked. - */ - inumber += (cg * sblock.fs_ipg); - if (inumber < ROOTINO) { - DBG_LEAVE; - return NULL; - } - if (inumber > maxino) - errx(8, "bad inode number %d to ginode", inumber); - if (startinum == 0 || - inumber < startinum || inumber >= startinum + INOPB(&sblock)) { - inoblk = fsbtodb(&sblock, ino_to_fsba(&sblock, inumber)); - rdfs(inoblk, (size_t)sblock.fs_bsize, inobuf, fsi); - startinum = (inumber / INOPB(&sblock)) * INOPB(&sblock); - } - DBG_LEAVE; - if (sblock.fs_magic == FS_UFS1_MAGIC) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 19:08:27 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73A061065748; Sat, 23 Jun 2012 19:08:27 +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 2D4A18FC12; Sat, 23 Jun 2012 19:08: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 q5NJ8Pkd059254; Sat, 23 Jun 2012 19:08:25 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NJ8O0a059251; Sat, 23 Jun 2012 19:08:24 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206231908.q5NJ8O0a059251@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 23 Jun 2012 19:08:24 +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: r237500 - stable/9/sbin/growfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 19:08:27 -0000 Author: trasz Date: Sat Jun 23 19:08:24 2012 New Revision: 237500 URL: http://svn.freebsd.org/changeset/base/237500 Log: MFC r234189: Style. MFC r234312: Remove FSIRAND and FSMAXSWAP ifdefs, removing code unconditionally. Reviewed by: kib, mckusick Sponsored by: The FreeBSD Foundation MFC r234314: Style. MFC r234420: Style. Modified: stable/9/sbin/growfs/debug.c stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/debug.c ============================================================================== --- stable/9/sbin/growfs/debug.c Sat Jun 23 19:03:42 2012 (r237499) +++ stable/9/sbin/growfs/debug.c Sat Jun 23 19:08:24 2012 (r237500) @@ -127,9 +127,7 @@ dbg_dump_hex(struct fs *sb, const char * void dbg_dump_fs(struct fs *sb, const char *comment) { -#ifdef FSMAXSNAP int j; -#endif /* FSMAXSNAP */ if (!dbg_log) return; @@ -299,7 +297,6 @@ dbg_dump_fs(struct fs *sb, const char *c fprintf(dbg_log, "pendinginodes int32_t 0x%08x\n", sb->fs_pendinginodes); -#ifdef FSMAXSNAP for (j = 0; j < FSMAXSNAP; j++) { fprintf(dbg_log, "snapinum int32_t[%2d] 0x%08x\n", j, sb->fs_snapinum[j]); @@ -307,7 +304,6 @@ dbg_dump_fs(struct fs *sb, const char *c break; } } -#endif /* FSMAXSNAP */ fprintf(dbg_log, "avgfilesize int32_t 0x%08x\n", sb->fs_avgfilesize); fprintf(dbg_log, "avgfpdir int32_t 0x%08x\n", Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Jun 23 19:03:42 2012 (r237499) +++ stable/9/sbin/growfs/growfs.c Sat Jun 23 19:08:24 2012 (r237500) @@ -76,7 +76,7 @@ int _dbg_lvl_ = (DL_INFO); /* DL_TRC */ static union { struct fs fs; - char pad[SBLOCKSIZE]; + char pad[SBLOCKSIZE]; } fsun1, fsun2; #define sblock fsun1.fs /* the new superblock */ #define osblock fsun2.fs /* the old superblock */ @@ -89,7 +89,7 @@ static ufs2_daddr_t sblockloc; static union { struct cg cg; - char pad[MAXBSIZE]; + char pad[MAXBSIZE]; } cgun1, cgun2; #define acg cgun1.cg /* a cylinder cgroup (new) */ #define aocg cgun2.cg /* an old cylinder group */ @@ -130,8 +130,7 @@ growfs(int fsi, int fso, unsigned int Nf uint cylno; int i, j, width; char tmpbuf[100]; -#ifdef FSIRAND - static int randinit=0; + static int randinit = 0; DBG_ENTER; @@ -139,11 +138,6 @@ growfs(int fsi, int fso, unsigned int Nf randinit = 1; srandomdev(); } -#else /* not FSIRAND */ - - DBG_ENTER; - -#endif /* FSIRAND */ time(&modtime); /* @@ -183,7 +177,7 @@ growfs(int fsi, int fso, unsigned int Nf /* * Dump out summary information about file system. */ -# define B2MBFACTOR (1 / (1024.0 * 1024.0)) +#define B2MBFACTOR (1 / (1024.0 * 1024.0)) printf("growfs: %.1fMB (%jd sectors) block size %d, fragment size %d\n", (float)sblock.fs_size * sblock.fs_fsize * B2MBFACTOR, (intmax_t)fsbtodb(&sblock, sblock.fs_size), sblock.fs_bsize, @@ -193,7 +187,7 @@ growfs(int fsi, int fso, unsigned int Nf sblock.fs_fpg / sblock.fs_frag, sblock.fs_ipg); if (sblock.fs_flags & FS_DOSOFTDEP) printf("\twith soft updates\n"); -# undef B2MBFACTOR +#undef B2MBFACTOR /* * Now build the cylinders group blocks and @@ -319,11 +313,9 @@ initcg(int cylno, time_t modtime, int fs static caddr_t iobuf; long blkno, start; ufs2_daddr_t i, cbase, dmax; -#ifdef FSIRAND struct ufs1_dinode *dp1; -#endif struct csum *cs; - uint d, dupper, dlower; + uint j, d, dupper, dlower; if (iobuf == NULL && (iobuf = malloc(sblock.fs_bsize * 3)) == NULL) errx(37, "panic: cannot allocate I/O buffer"); @@ -399,13 +391,11 @@ initcg(int cylno, time_t modtime, int fs bzero(iobuf, sblock.fs_bsize); for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) { -#ifdef FSIRAND dp1 = (struct ufs1_dinode *)(void *)iobuf; for (j = 0; j < INOPB(&sblock); j++) { dp1->di_gen = random(); dp1++; } -#endif wtfs(fsbtodb(&sblock, cgimin(&sblock, cylno) + i), sblock.fs_bsize, iobuf, fso, Nflag); } @@ -509,7 +499,7 @@ frag_adjust(ufs2_daddr_t frag, int sign) DBG_ENTER; - fragsize=0; + fragsize = 0; /* * Here frag only needs to point to any fragment in the block we want * to examine. @@ -526,7 +516,7 @@ frag_adjust(ufs2_daddr_t frag, int sign) /* * We found something in between. */ - acg.cg_frsum[fragsize]+=sign; + acg.cg_frsum[fragsize] += sign; DBG_PRINT2("frag_adjust [%d]+=%d\n", fragsize, sign); } @@ -589,7 +579,7 @@ updjcg(int cylno, time_t modtime, int fs if (cgbase(&osblock, cylno + 1) == osblock.fs_size) { if (sblock.fs_magic == FS_UFS1_MAGIC) - acg.cg_old_ncyl=sblock.fs_old_cpg; + acg.cg_old_ncyl = sblock.fs_old_cpg; wtfs(fsbtodb(&sblock, cgtod(&sblock, cylno)), (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); @@ -882,8 +872,7 @@ updcsloc(time_t modtime, int fsi, int fs */ if (sblock.fs_contigsumsize > 0) { for (block = howmany(d % sblock.fs_fpg, sblock.fs_frag), - lcs = 0; lcs < sblock.fs_contigsumsize; - block++, lcs++) { + lcs = 0; lcs < sblock.fs_contigsumsize; block++, lcs++) { if (isclr(cg_clustersfree(&acg), block)) break; } @@ -913,7 +902,7 @@ updcsloc(time_t modtime, int fsi, int fs * (incomplete) block of the cylinder summary. */ d++; - frag_adjust(d%sblock.fs_fpg, 1); + frag_adjust(d % sblock.fs_fpg, 1); if (isblock(&sblock, cg_blksfree(&acg), (d % sblock.fs_fpg) / sblock.fs_frag)) { @@ -924,8 +913,7 @@ updcsloc(time_t modtime, int fsi, int fs sblock.fs_cstotal.cs_nbfree++; if (sblock.fs_contigsumsize > 0) { setbit(cg_clustersfree(&acg), - (d % sblock.fs_fpg) / - sblock.fs_frag); + (d % sblock.fs_fpg) / sblock.fs_frag); if (lcs < sblock.fs_contigsumsize) { if (lcs) cg_clustersum(&acg)[lcs]--; @@ -1026,8 +1014,7 @@ updcsloc(time_t modtime, int fsi, int fs * Allocate all fragments used by the cylinder summary in the * last block. */ - if (d < - sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize)) { + if (d < sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize)) { for (; d - sblock.fs_csaddr < sblock.fs_cssize/sblock.fs_fsize; d++) { clrbit(cg_blksfree(&acg), d % sblock.fs_fpg); @@ -1248,7 +1235,7 @@ charsperline(void) columns = 80; /* last resort */ DBG_LEAVE; - return columns; + return (columns); } /* @@ -1306,9 +1293,7 @@ main(int argc, char **argv) int i, fsi, fso; u_int32_t p_size; char reply[5]; -#ifdef FSMAXSNAP int j; -#endif /* FSMAXSNAP */ DBG_ENTER; @@ -1445,8 +1430,6 @@ main(int argc, char **argv) (intmax_t)osblock.fs_size, (intmax_t)sblock.fs_size); } - -#ifdef FSMAXSNAP /* * Check if we find an active snapshot. */ @@ -1461,7 +1444,6 @@ main(int argc, char **argv) break; } } -#endif if (ExpertFlag == 0 && Nflag == 0) { printf("We strongly recommend you to make a backup " @@ -1544,7 +1526,7 @@ main(int argc, char **argv) DBG_CLOSE; DBG_LEAVE; - return 0; + return (0); } /* From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 19:15:13 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49B19106566C; Sat, 23 Jun 2012 19:15:13 +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 32F6E8FC0C; Sat, 23 Jun 2012 19:15: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 q5NJFDEn059634; Sat, 23 Jun 2012 19:15:13 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NJFDt9059630; Sat, 23 Jun 2012 19:15:13 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206231915.q5NJFDt9059630@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 23 Jun 2012 19:15:13 +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: r237501 - stable/9/sbin/growfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 19:15:13 -0000 Author: trasz Date: Sat Jun 23 19:15:12 2012 New Revision: 237501 URL: http://svn.freebsd.org/changeset/base/237501 Log: MFC r234846: Improve growfs(8) in a few ways; unfortunately, it's somewhat hard to untangle them and commit separately. 1. Rewrite the way growfs(8) finds the device and mount point. This makes it possible to use e.g. "growfs /mnt"; it's also used to display more helpful messages. 2. Be more user-friendly, using descriptive messages, like this: OK to grow filesystem on /dev/md0, mounted on /mnt, from 9.8GB to 20GB? [Yes/No]" 3. Allow to specify the size (-s option) just like with mdconfig(8), i.e. with postfixes ("mdconfig -s 10g").4. Reload read-only filesystem after growing. Reviewed by: kib, mckusick (earlier version) Sponsored by: The FreeBSD Foundation MFC r235079: Fix offset calculation to actually rewrite the _last_ block. Modified: stable/9/sbin/growfs/Makefile stable/9/sbin/growfs/growfs.8 stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) Modified: stable/9/sbin/growfs/Makefile ============================================================================== --- stable/9/sbin/growfs/Makefile Sat Jun 23 19:08:24 2012 (r237500) +++ stable/9/sbin/growfs/Makefile Sat Jun 23 19:15:12 2012 (r237501) @@ -6,12 +6,18 @@ #GFSDBG= +.PATH: ${.CURDIR}/../mount + PROG= growfs -SRCS= growfs.c +SRCS= growfs.c getmntopts.c MAN= growfs.8 +CFLAGS+=-I${.CURDIR}/../mount .if defined(GFSDBG) SRCS+= debug.c .endif +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Modified: stable/9/sbin/growfs/growfs.8 ============================================================================== --- stable/9/sbin/growfs/growfs.8 Sat Jun 23 19:08:24 2012 (r237500) +++ stable/9/sbin/growfs/growfs.8 Sat Jun 23 19:15:12 2012 (r237501) @@ -37,7 +37,7 @@ .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" $FreeBSD$ .\" -.Dd June 29, 2011 +.Dd April 30, 2012 .Dt GROWFS 8 .Os .Sh NAME @@ -47,41 +47,20 @@ .Nm .Op Fl Ny .Op Fl s Ar size -.Ar special +.Ar special | filesystem .Sh DESCRIPTION The .Nm -utility extends the -.Xr newfs 8 -program. -Before starting -.Nm -the disk must be labeled to a bigger size using -.Xr bsdlabel 8 . -If you wish to grow a file system beyond the boundary of -the slice it resides in, you must re-size the slice using -.Xr gpart 8 -before running -.Nm . +utility makes it possible to expand an UFS file system. +Before running +.Nm +the partition or slice containing the file system must be extended using +.Xr gpart 8 . If you are using volumes you must enlarge them by using .Xr gvinum 8 . The .Nm utility extends the size of the file system on the specified special file. -Currently -.Nm -can only enlarge unmounted file systems. -Do not try enlarging a mounted file system, your system may panic and you will -not be able to use the file system any longer. -Most of the -.Xr newfs 8 -options cannot be changed by -.Nm . -In fact, you can only increase the size of the file system. -Use -.Xr tunefs 8 -for other changes. -.Pp The following options are available: .Bl -tag -width indent .It Fl N @@ -103,6 +82,13 @@ So use this option with great care! Determines the .Ar size of the file system after enlarging in sectors. +.Ar Size +is the number of 512 byte sectors unless suffixed with a +.Cm b , k , m , g , +or +.Cm t +which +denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively. This value defaults to the size of the raw partition specified in .Ar special (in other words, @@ -110,19 +96,18 @@ This value defaults to the size of the r will enlarge the file system to the size of the entire partition). .El .Sh EXAMPLES -.Dl growfs -s 4194304 /dev/vinum/testvol +.Dl growfs -s 2G /dev/ada0p1 .Pp will enlarge -.Pa /dev/vinum/testvol +.Pa /dev/ada0p1 up to 2GB if there is enough space in -.Pa /dev/vinum/testvol . +.Pa /dev/ada0p1 . .Sh SEE ALSO -.Xr bsdlabel 8 , .Xr dumpfs 8 , .Xr ffsinfo 8 , .Xr fsck 8 , +.Xr fsdb 8 , .Xr gpart 8 , -.Xr gvinum 8 , .Xr newfs 8 , .Xr tunefs 8 .Sh HISTORY @@ -134,61 +119,12 @@ utility first appeared in .An Christoph Herrmann Aq chm@FreeBSD.org .An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org .An The GROWFS team Aq growfs@Tomsoft.COM +.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .Sh BUGS -The -.Nm -utility works starting with -.Fx -3.x. -There may be cases on -.Fx -3.x only, when -.Nm -does not recognize properly whether or not the file system is mounted and -exits with an error message. -Then please use -.Nm -.Fl y -if you are sure that the file system is not mounted. -It is also recommended to always use -.Xr fsck 8 -after enlarging (just to be on the safe side). -.Pp -For enlarging beyond certain limits, it is essential to have some free blocks -available in the first cylinder group. -If that space is not available in the first cylinder group, a critical data -structure has to be relocated into one of the new available cylinder groups. -On -.Fx -3.x this will cause problems with -.Xr fsck 8 -afterwards. -So -.Xr fsck 8 -needs to be patched if you want to use -.Nm -for -.Fx -3.x. -This patch is already integrated in -.Fx -starting with -.Fx 4.4 . -To avoid an unexpected relocation of that structure it is possible to use -.Nm ffsinfo -.Fl g Ar 0 -.Fl l Ar 4 -on the first cylinder group to verify that -.Em nbfree -in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP -.Em cgr0 -has enough blocks. -As a rule of thumb for default file system parameters one block is needed for -every 2 GB of total file system size. .Pp Normally .Nm -writes this critical structure to disk and reads it again later for doing more +writes cylinder group summary to disk and reads it again later for doing more updates. This read operation will provide unexpected data when using .Fl N . Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sat Jun 23 19:08:24 2012 (r237500) +++ stable/9/sbin/growfs/growfs.c Sat Jun 23 19:15:12 2012 (r237501) @@ -1,11 +1,15 @@ /* - * Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz * Copyright (c) 1980, 1989, 1993 The Regents of the University of California. + * Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * * This code is derived from software contributed to Berkeley by * Christoph Herrmann and Thomas-Henning von Kamptz, Munich and Frankfurt. * + * 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: @@ -53,13 +57,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include #include +#include +#include #include +#include #include #include #include @@ -67,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "debug.h" @@ -109,7 +119,7 @@ static void updjcg(int, time_t, int, int static void updcsloc(time_t, int, int, unsigned int); static void frag_adjust(ufs2_daddr_t, int); static void updclst(int); -static void get_dev_size(int, int *); +static void mount_reload(const struct statfs *stfs); /* * Here we actually start growing the file system. We basically read the @@ -177,6 +187,7 @@ growfs(int fsi, int fso, unsigned int Nf /* * Dump out summary information about file system. */ +#ifdef FS_DEBUG #define B2MBFACTOR (1 / (1024.0 * 1024.0)) printf("growfs: %.1fMB (%jd sectors) block size %d, fragment size %d\n", (float)sblock.fs_size * sblock.fs_fsize * B2MBFACTOR, @@ -188,6 +199,7 @@ growfs(int fsi, int fso, unsigned int Nf if (sblock.fs_flags & FS_DOSOFTDEP) printf("\twith soft updates\n"); #undef B2MBFACTOR +#endif /* FS_DEBUG */ /* * Now build the cylinders group blocks and @@ -774,7 +786,7 @@ updjcg(int cylno, time_t modtime, int fs /* * Here we update the location of the cylinder summary. We have two possible - * ways of growing the cylinder summary. + * ways of growing the cylinder summary: * (1) We can try to grow the summary in the current location, and relocate * possibly used blocks within the current cylinder group. * (2) Alternatively we can relocate the whole cylinder summary to the first @@ -1238,24 +1250,104 @@ charsperline(void) return (columns); } +static int +is_dev(const char *name) +{ + struct stat devstat; + + if (stat(name, &devstat) != 0) + return (0); + if (!S_ISCHR(devstat.st_mode)) + return (0); + return (1); +} + /* - * Get the size of the partition. - */ -static void -get_dev_size(int fd, int *size) + * Return mountpoint on which the device is currently mounted. + */ +static const struct statfs * +dev_to_statfs(const char *dev) { - int sectorsize; - off_t mediasize; + struct stat devstat, mntdevstat; + struct statfs *mntbuf, *statfsp; + char device[MAXPATHLEN]; + char *mntdevname; + int i, mntsize; + + /* + * First check the mounted filesystems. + */ + if (stat(dev, &devstat) != 0) + return (NULL); + if (!S_ISCHR(devstat.st_mode) && !S_ISBLK(devstat.st_mode)) + return (NULL); + + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); + for (i = 0; i < mntsize; i++) { + statfsp = &mntbuf[i]; + mntdevname = statfsp->f_mntfromname; + if (*mntdevname != '/') { + strcpy(device, _PATH_DEV); + strcat(device, mntdevname); + mntdevname = device; + } + if (stat(mntdevname, &mntdevstat) == 0 && + mntdevstat.st_rdev == devstat.st_rdev) + return (statfsp); + } - if (ioctl(fd, DIOCGSECTORSIZE, §orsize) == -1) - err(1,"DIOCGSECTORSIZE"); - if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) == -1) - err(1,"DIOCGMEDIASIZE"); + return (NULL); +} - if (sectorsize <= 0) - errx(1, "bogus sectorsize: %d", sectorsize); +static const char * +mountpoint_to_dev(const char *mountpoint) +{ + struct statfs *mntbuf, *statfsp; + struct fstab *fs; + int i, mntsize; - *size = mediasize / sectorsize; + /* + * First check the mounted filesystems. + */ + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); + for (i = 0; i < mntsize; i++) { + statfsp = &mntbuf[i]; + + if (strcmp(statfsp->f_mntonname, mountpoint) == 0) + return (statfsp->f_mntfromname); + } + + /* + * Check the fstab. + */ + fs = getfsfile(mountpoint); + if (fs != NULL) + return (fs->fs_spec); + + return (NULL); +} + +static const char * +getdev(const char *name) +{ + static char device[MAXPATHLEN]; + const char *cp, *dev; + + if (is_dev(name)) + return (name); + + cp = strrchr(name, '/'); + if (cp == 0) { + snprintf(device, sizeof(device), "%s%s", _PATH_DEV, name); + if (is_dev(device)) + return (device); + } + + dev = mountpoint_to_dev(name); + if (dev != NULL && is_dev(dev)) + return (dev); + + return (NULL); } /* @@ -1283,17 +1375,13 @@ int main(int argc, char **argv) { DBG_FUNC("main") - char *device, *special; - int ch; - unsigned int size = 0; - size_t len; - unsigned int Nflag = 0; - int ExpertFlag = 0; - struct stat st; - int i, fsi, fso; - u_int32_t p_size; - char reply[5]; - int j; + const char *device; + const struct statfs *statfsp; + uint64_t size = 0; + off_t mediasize; + int error, i, j, fsi, fso, ch, Nflag = 0, yflag = 0; + char *p, reply[5], oldsizebuf[6], newsizebuf[6]; + void *testbuf; DBG_ENTER; @@ -1303,14 +1391,27 @@ main(int argc, char **argv) Nflag = 1; break; case 's': - size = (size_t)atol(optarg); - if (size < 1) - usage(); + size = (off_t)strtoumax(optarg, &p, 0); + if (p == NULL || *p == '\0') + size *= DEV_BSIZE; + else if (*p == 'b' || *p == 'B') + ; /* do nothing */ + else if (*p == 'k' || *p == 'K') + size <<= 10; + else if (*p == 'm' || *p == 'M') + size <<= 20; + else if (*p == 'g' || *p == 'G') + size <<= 30; + else if (*p == 't' || *p == 'T') { + size <<= 30; + size <<= 10; + } else + errx(1, "unknown suffix on -s argument"); break; case 'v': /* for compatibility to newfs */ break; case 'y': - ExpertFlag = 1; + yflag = 1; break; case '?': /* FALLTHROUGH */ @@ -1324,71 +1425,29 @@ main(int argc, char **argv) if (argc != 1) usage(); - device = *argv; - /* - * Now try to guess the (raw)device name. + * Now try to guess the device name. */ - if (0 == strrchr(device, '/')) { - /* - * No path prefix was given, so try in that order: - * /dev/r%s - * /dev/%s - * /dev/vinum/r%s - * /dev/vinum/%s. - * - * FreeBSD now doesn't distinguish between raw and block - * devices any longer, but it should still work this way. - */ - len = strlen(device) + strlen(_PATH_DEV) + 2 + strlen("vinum/"); - special = (char *)malloc(len); - if (special == NULL) - errx(1, "malloc failed"); - snprintf(special, len, "%sr%s", _PATH_DEV, device); - if (stat(special, &st) == -1) { - snprintf(special, len, "%s%s", _PATH_DEV, device); - if (stat(special, &st) == -1) { - snprintf(special, len, "%svinum/r%s", - _PATH_DEV, device); - if (stat(special, &st) == -1) { - /* For now this is the 'last resort' */ - snprintf(special, len, "%svinum/%s", - _PATH_DEV, device); - } - } - } - device = special; - } + device = getdev(*argv); + if (device == NULL) + errx(1, "cannot find special device for %s", *argv); - /* - * Try to access our devices for writing ... - */ - if (Nflag) { - fso = -1; - } else { - fso = open(device, O_WRONLY); - if (fso < 0) - err(1, "%s", device); - } + statfsp = dev_to_statfs(device); - /* - * ... and reading. - */ fsi = open(device, O_RDONLY); if (fsi < 0) err(1, "%s", device); /* - * Try to guess the slice if not specified. This code should guess - * the right thing and avoid to bother the user with the task - * of specifying the option -v on vinum volumes. + * Try to guess the slice size if not specified. */ - get_dev_size(fsi, &p_size); + if (ioctl(fsi, DIOCGMEDIASIZE, &mediasize) == -1) + err(1,"DIOCGMEDIASIZE"); /* * Check if that partition is suitable for growing a file system. */ - if (p_size < 1) + if (mediasize < 1) errx(1, "partition is unavailable"); /* @@ -1414,16 +1473,36 @@ main(int argc, char **argv) /* * Determine size to grow to. Default to the device size. */ - sblock.fs_size = dbtofsb(&osblock, p_size); - if (size != 0) { - if (size > p_size) - errx(1, "there is not enough space (%d < %d)", - p_size, size); - sblock.fs_size = dbtofsb(&osblock, size); + if (size == 0) + size = mediasize; + else { + if (size > (uint64_t)mediasize) { + humanize_number(oldsizebuf, sizeof(oldsizebuf), size, + "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + humanize_number(newsizebuf, sizeof(newsizebuf), + mediasize, + "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + + errx(1, "requested size %s is larger " + "than the available %s", oldsizebuf, newsizebuf); + } + } + + if (size <= (uint64_t)(osblock.fs_size * osblock.fs_fsize)) { + humanize_number(oldsizebuf, sizeof(oldsizebuf), + osblock.fs_size * osblock.fs_fsize, + "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + humanize_number(newsizebuf, sizeof(newsizebuf), size, + "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + + errx(1, "requested size %s is not larger than the current " + "filesystem size %s", newsizebuf, oldsizebuf); } + sblock.fs_size = dbtofsb(&osblock, size / DEV_BSIZE); + /* - * Are we really growing ? + * Are we really growing? */ if (osblock.fs_size >= sblock.fs_size) { errx(1, "we are not growing (%jd->%jd)", @@ -1433,7 +1512,7 @@ main(int argc, char **argv) /* * Check if we find an active snapshot. */ - if (ExpertFlag == 0) { + if (yflag == 0) { for (j = 0; j < FSMAXSNAP; j++) { if (sblock.fs_snapinum[j]) { errx(1, "active snapshot found in file system; " @@ -1445,10 +1524,23 @@ main(int argc, char **argv) } } - if (ExpertFlag == 0 && Nflag == 0) { - printf("We strongly recommend you to make a backup " + if (yflag == 0 && Nflag == 0) { + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) + errx(1, "%s is mounted read-write on %s", + statfsp->f_mntfromname, statfsp->f_mntonname); + printf("It's strongly recommended to make a backup " "before growing the file system.\n" - "Did you backup your data (Yes/No)? "); + "OK to grow filesystem on %s", device); + if (statfsp != NULL) + printf(", mounted on %s,", statfsp->f_mntonname); + humanize_number(oldsizebuf, sizeof(oldsizebuf), + osblock.fs_size * osblock.fs_fsize, + "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + humanize_number(newsizebuf, sizeof(newsizebuf), + sblock.fs_size * sblock.fs_fsize, + "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + printf(" from %s to %s? [Yes/No] ", oldsizebuf, newsizebuf); + fflush(stdout); fgets(reply, (int)sizeof(reply), stdin); if (strcmp(reply, "Yes\n")){ printf("\nNothing done\n"); @@ -1456,15 +1548,30 @@ main(int argc, char **argv) } } - printf("New file system size is %jd frags\n", (intmax_t)sblock.fs_size); + /* + * Try to access our device for writing. If it's not mounted, + * or mounted read-only, simply open it; otherwise, use UFS + * suspension mechanism. + */ + if (Nflag) { + fso = -1; + } else { + fso = open(device, O_WRONLY); + if (fso < 0) + err(1, "%s", device); + } /* - * Try to access our new last block in the file system. Even if we - * later on realize we have to abort our operation, on that block - * there should be no data, so we can't destroy something yet. + * Try to access our new last block in the file system. */ - wtfs((ufs2_daddr_t)p_size - 1, (size_t)DEV_BSIZE, (void *)&sblock, - fso, Nflag); + testbuf = malloc(sblock.fs_fsize); + if (testbuf == NULL) + err(1, "malloc"); + rdfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE), + sblock.fs_fsize, testbuf, fsi); + wtfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE), + sblock.fs_fsize, testbuf, fso, Nflag); + free(testbuf); /* * Now calculate new superblock values and check for reasonable @@ -1520,8 +1627,13 @@ main(int argc, char **argv) growfs(fsi, fso, Nflag); close(fsi); - if (fso > -1) - close(fso); + if (fso > -1) { + error = close(fso); + if (error != 0) + err(1, "close"); + } + if (statfsp != NULL) + mount_reload(statfsp); DBG_CLOSE; @@ -1539,7 +1651,7 @@ usage(void) DBG_ENTER; - fprintf(stderr, "usage: growfs [-Ny] [-s size] special\n"); + fprintf(stderr, "usage: growfs [-Ny] [-s size] special | filesystem\n"); DBG_LEAVE; exit(1); @@ -1586,3 +1698,26 @@ updclst(int block) DBG_LEAVE; return; } + +static void +mount_reload(const struct statfs *stfs) +{ + char errmsg[255]; + struct iovec *iov; + int iovlen; + + iov = NULL; + iovlen = 0; + *errmsg = '\0'; + build_iovec(&iov, &iovlen, "fstype", __DECONST(char *, "ffs"), 4); + build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, stfs->f_mntonname), (size_t)-1); + build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); + build_iovec(&iov, &iovlen, "update", NULL, 0); + build_iovec(&iov, &iovlen, "reload", NULL, 0); + + if (nmount(iov, iovlen, stfs->f_flags) < 0) { + errmsg[sizeof(errmsg) - 1] = '\0'; + err(9, "%s: cannot reload filesystem%s%s", stfs->f_mntonname, + *errmsg != '\0' ? ": " : "", errmsg); + } +} From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 19:42:07 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A151106567E; Sat, 23 Jun 2012 19:42:07 +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 148EE8FC12; Sat, 23 Jun 2012 19:42: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 q5NJg6iI060972; Sat, 23 Jun 2012 19:42:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NJg6Tb060970; Sat, 23 Jun 2012 19:42:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206231942.q5NJg6Tb060970@svn.freebsd.org> From: Eitan Adler Date: Sat, 23 Jun 2012 19:42:06 +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: r237503 - stable/8/sbin/geom/class/sched X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 19:42:07 -0000 Author: eadler Date: Sat Jun 23 19:42:06 2012 New Revision: 237503 URL: http://svn.freebsd.org/changeset/base/237503 Log: MFC r231992: Remove reference to gsched_as module, which doesn't actually exist. Approved by: cperciva (implicit) Modified: stable/8/sbin/geom/class/sched/gsched.8 (contents, props changed) Directory Properties: stable/8/sbin/geom/ (props changed) Modified: stable/8/sbin/geom/class/sched/gsched.8 ============================================================================== --- stable/8/sbin/geom/class/sched/gsched.8 Sat Jun 23 19:39:03 2012 (r237502) +++ stable/8/sbin/geom/class/sched/gsched.8 Sat Jun 23 19:42:06 2012 (r237503) @@ -141,7 +141,7 @@ and how to destroy it. # Load the geom_sched module: kldload geom_sched # Load some scheduler classes used by geom_sched: -kldload gsched_rr gsched_as +kldload gsched_rr # Configure device ad0 to use scheduler "rr": geom sched insert -a rr ad0 # Now provider ad0 uses the "rr" algorithm; From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 19:42:07 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FB73106567F; Sat, 23 Jun 2012 19:42:07 +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 29F9B8FC14; Sat, 23 Jun 2012 19:42: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 q5NJg7IH060976; Sat, 23 Jun 2012 19:42:07 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NJg6h1060974; Sat, 23 Jun 2012 19:42:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206231942.q5NJg6h1060974@svn.freebsd.org> From: Eitan Adler Date: Sat, 23 Jun 2012 19:42:06 +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: r237504 - stable/9/sbin/geom/class/sched X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 19:42:07 -0000 Author: eadler Date: Sat Jun 23 19:42:06 2012 New Revision: 237504 URL: http://svn.freebsd.org/changeset/base/237504 Log: MFC r231992: Remove reference to gsched_as module, which doesn't actually exist. Approved by: cperciva (implicit) Modified: stable/9/sbin/geom/class/sched/gsched.8 Directory Properties: stable/9/sbin/geom/ (props changed) Modified: stable/9/sbin/geom/class/sched/gsched.8 ============================================================================== --- stable/9/sbin/geom/class/sched/gsched.8 Sat Jun 23 19:42:06 2012 (r237503) +++ stable/9/sbin/geom/class/sched/gsched.8 Sat Jun 23 19:42:06 2012 (r237504) @@ -141,7 +141,7 @@ and how to destroy it. # Load the geom_sched module: kldload geom_sched # Load some scheduler classes used by geom_sched: -kldload gsched_rr gsched_as +kldload gsched_rr # Configure device ad0 to use scheduler "rr": geom sched insert -a rr ad0 # Now provider ad0 uses the "rr" algorithm; From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 19:46:08 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87E971065676; Sat, 23 Jun 2012 19:46:08 +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 7347B8FC0A; Sat, 23 Jun 2012 19:46: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 q5NJk8nG061199; Sat, 23 Jun 2012 19:46:08 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NJk8Jp061197; Sat, 23 Jun 2012 19:46:08 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201206231946.q5NJk8Jp061197@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 23 Jun 2012 19:46:08 +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: r237505 - stable/9/sbin/newfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 19:46:08 -0000 Author: trasz Date: Sat Jun 23 19:46:07 2012 New Revision: 237505 URL: http://svn.freebsd.org/changeset/base/237505 Log: Make newfs(8) display "super-block backups (for fsck_ffs -b #)" instead of super-block backups (for fsck -b #), since fsck(8) doesn't accept the "-b" option; only fsck_ffs(8) does. PR: bin/82720 MFC after: 1 week Modified: stable/9/sbin/newfs/mkfs.c Modified: stable/9/sbin/newfs/mkfs.c ============================================================================== --- stable/9/sbin/newfs/mkfs.c Sat Jun 23 19:42:06 2012 (r237504) +++ stable/9/sbin/newfs/mkfs.c Sat Jun 23 19:46:07 2012 (r237505) @@ -539,7 +539,7 @@ restart: * Now build the cylinders group blocks and * then print out indices of cylinder groups. */ - printf("super-block backups (for fsck -b #) at:\n"); + printf("super-block backups (for fsck_ffs -b #) at:\n"); i = 0; width = charsperline(); /* From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 20:33:29 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E54D106566C; Sat, 23 Jun 2012 20:33:29 +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 766AD8FC0C; Sat, 23 Jun 2012 20:33: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 q5NKXTPj063198; Sat, 23 Jun 2012 20:33:29 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NKXTY3063187; Sat, 23 Jun 2012 20:33:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206232033.q5NKXTY3063187@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 23 Jun 2012 20:33: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: r237507 - stable/9/contrib/libstdc++/include/bits X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 20:33:29 -0000 Author: pfg Date: Sat Jun 23 20:33:29 2012 New Revision: 237507 URL: http://svn.freebsd.org/changeset/base/237507 Log: MFC: r236829 Bring a couple of libstdc++ patches from Apple's llvm-gcc project. Modified Fri Jul 10 07:44:34 2009 CDT by rafael backport part of http://gcc.gnu.org/ml/gcc-cvs/2007-10/msg00118.html The patch is for libstdc++ and it was GPL2 at the time. Modified Tue Apr 29 01:20:19 2008 CDT by asl Backport from mainline (pre-GPLv3). Fix for sizeof(const void*) > sizeof(unsigned long). Modified: stable/9/contrib/libstdc++/include/bits/locale_facets.tcc stable/9/contrib/libstdc++/include/bits/stl_bvector.h stable/9/contrib/libstdc++/include/bits/stl_deque.h stable/9/contrib/libstdc++/include/bits/stl_list.h stable/9/contrib/libstdc++/include/bits/stl_map.h stable/9/contrib/libstdc++/include/bits/stl_multimap.h stable/9/contrib/libstdc++/include/bits/stl_multiset.h stable/9/contrib/libstdc++/include/bits/stl_set.h stable/9/contrib/libstdc++/include/bits/stl_tree.h stable/9/contrib/libstdc++/include/bits/stl_vector.h Directory Properties: stable/9/contrib/libstdc++/ (props changed) Modified: stable/9/contrib/libstdc++/include/bits/locale_facets.tcc ============================================================================== --- stable/9/contrib/libstdc++/include/bits/locale_facets.tcc Sat Jun 23 19:49:18 2012 (r237506) +++ stable/9/contrib/libstdc++/include/bits/locale_facets.tcc Sat Jun 23 20:33:29 2012 (r237507) @@ -887,7 +887,11 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE const fmtflags __fmt = __io.flags(); __io.flags(__fmt & ~ios_base::basefield | ios_base::hex); - unsigned long __ul; + typedef __gnu_cxx::__conditional_type<(sizeof(void*) + <= sizeof(unsigned long)), + unsigned long, unsigned long long>::__type _UIntPtrType; + + _UIntPtrType __ul; __beg = _M_extract_int(__beg, __end, __io, __err, __ul); // Reset from hex formatted input. @@ -1309,8 +1313,12 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE | ios_base::internal); __io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase)); + typedef __gnu_cxx::__conditional_type<(sizeof(const void*) + <= sizeof(unsigned long)), + unsigned long, unsigned long long>::__type _UIntPtrType; + __s = _M_insert_int(__s, __io, __fill, - reinterpret_cast(__v)); + reinterpret_cast<_UIntPtrType>(__v)); __io.flags(__flags); return __s; } Modified: stable/9/contrib/libstdc++/include/bits/stl_bvector.h ============================================================================== --- stable/9/contrib/libstdc++/include/bits/stl_bvector.h Sat Jun 23 19:49:18 2012 (r237506) +++ stable/9/contrib/libstdc++/include/bits/stl_bvector.h Sat Jun 23 20:33:29 2012 (r237507) @@ -385,6 +385,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL _Bit_iterator _M_start; _Bit_iterator _M_finish; _Bit_type* _M_end_of_storage; + + _Bvector_impl() + : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0) + { } + _Bvector_impl(const _Bit_alloc_type& __a) : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0) { } @@ -405,7 +410,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL get_allocator() const { return allocator_type(_M_get_Bit_allocator()); } - _Bvector_base(const allocator_type& __a) : _M_impl(__a) { } + _Bvector_base() + : _M_impl() { } + + _Bvector_base(const allocator_type& __a) + : _M_impl(__a) { } ~_Bvector_base() { this->_M_deallocate(); } @@ -480,8 +489,11 @@ template using _Base::_M_get_Bit_allocator; public: + vector() + : _Base() { } + explicit - vector(const allocator_type& __a = allocator_type()) + vector(const allocator_type& __a) : _Base(__a) { } explicit @@ -678,7 +690,7 @@ template } void - swap(vector& __x) + swap(vector& __x) { std::swap(this->_M_impl._M_start, __x._M_impl._M_start); std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish); Modified: stable/9/contrib/libstdc++/include/bits/stl_deque.h ============================================================================== --- stable/9/contrib/libstdc++/include/bits/stl_deque.h Sat Jun 23 19:49:18 2012 (r237506) +++ stable/9/contrib/libstdc++/include/bits/stl_deque.h Sat Jun 23 20:33:29 2012 (r237507) @@ -380,6 +380,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator; typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator; + _Deque_base() + : _M_impl() + { _M_initialize_map(0); } + _Deque_base(const allocator_type& __a, size_t __num_elements) : _M_impl(__a) { _M_initialize_map(__num_elements); } @@ -406,6 +410,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL iterator _M_start; iterator _M_finish; + _Deque_impl() + : _Tp_alloc_type(), _M_map(0), _M_map_size(0), + _M_start(), _M_finish() + { } + _Deque_impl(const _Tp_alloc_type& __a) : _Tp_alloc_type(__a), _M_map(0), _M_map_size(0), _M_start(), _M_finish() @@ -679,8 +688,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL /** * @brief Default constructor creates no elements. */ + deque() + : _Base() { } + explicit - deque(const allocator_type& __a = allocator_type()) + deque(const allocator_type& __a) : _Base(__a, 0) {} /** Modified: stable/9/contrib/libstdc++/include/bits/stl_list.h ============================================================================== --- stable/9/contrib/libstdc++/include/bits/stl_list.h Sat Jun 23 19:49:18 2012 (r237506) +++ stable/9/contrib/libstdc++/include/bits/stl_list.h Sat Jun 23 20:33:29 2012 (r237507) @@ -305,6 +305,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL { _List_node_base _M_node; + _List_impl() + : _Node_alloc_type(), _M_node() + { } + _List_impl(const _Node_alloc_type& __a) : _Node_alloc_type(__a), _M_node() { } @@ -339,6 +343,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL get_allocator() const { return allocator_type(_M_get_Node_allocator()); } + _List_base() + : _M_impl() + { _M_init(); } + _List_base(const allocator_type& __a) : _M_impl(__a) { _M_init(); } @@ -468,8 +476,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL /** * @brief Default constructor creates no elements. */ + list() + : _Base() { } + explicit - list(const allocator_type& __a = allocator_type()) + list(const allocator_type& __a) : _Base(__a) { } /** Modified: stable/9/contrib/libstdc++/include/bits/stl_map.h ============================================================================== --- stable/9/contrib/libstdc++/include/bits/stl_map.h Sat Jun 23 19:49:18 2012 (r237506) +++ stable/9/contrib/libstdc++/include/bits/stl_map.h Sat Jun 23 20:33:29 2012 (r237507) @@ -155,7 +155,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * @brief Default constructor creates no elements. */ map() - : _M_t(_Compare(), allocator_type()) { } + : _M_t() { } // for some reason this was made a separate function /** @@ -186,7 +186,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template map(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) + : _M_t() { _M_t._M_insert_unique(__first, __last); } /** Modified: stable/9/contrib/libstdc++/include/bits/stl_multimap.h ============================================================================== --- stable/9/contrib/libstdc++/include/bits/stl_multimap.h Sat Jun 23 19:49:18 2012 (r237506) +++ stable/9/contrib/libstdc++/include/bits/stl_multimap.h Sat Jun 23 20:33:29 2012 (r237507) @@ -152,7 +152,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * @brief Default constructor creates no elements. */ multimap() - : _M_t(_Compare(), allocator_type()) { } + : _M_t() { } // for some reason this was made a separate function /** @@ -184,8 +184,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template multimap(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) - { _M_t._M_insert_equal(__first, __last); } + : _M_t() + { _M_t._M_insert_unique(__first, __last); } /** * @brief Builds a %multimap from a range. Modified: stable/9/contrib/libstdc++/include/bits/stl_multiset.h ============================================================================== --- stable/9/contrib/libstdc++/include/bits/stl_multiset.h Sat Jun 23 19:49:18 2012 (r237506) +++ stable/9/contrib/libstdc++/include/bits/stl_multiset.h Sat Jun 23 20:33:29 2012 (r237507) @@ -134,7 +134,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * @brief Default constructor creates no elements. */ multiset() - : _M_t(_Compare(), allocator_type()) { } + : _M_t() { } explicit multiset(const _Compare& __comp, @@ -152,7 +152,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template multiset(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) + : _M_t() { _M_t._M_insert_equal(__first, __last); } /** @@ -180,7 +180,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * The newly-created %multiset uses a copy of the allocation object used * by @a x. */ - multiset(const multiset<_Key,_Compare,_Alloc>& __x) + multiset(const multiset& __x) : _M_t(__x._M_t) { } /** @@ -190,8 +190,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * All the elements of @a x are copied, but unlike the copy constructor, * the allocator object is not copied. */ - multiset<_Key,_Compare,_Alloc>& - operator=(const multiset<_Key,_Compare,_Alloc>& __x) + multiset& + operator=(const multiset& __x) { _M_t = __x._M_t; return *this; @@ -275,7 +275,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * std::swap(s1,s2) will feed to this function. */ void - swap(multiset<_Key, _Compare, _Alloc>& __x) + swap(multiset& __x) { _M_t.swap(__x._M_t); } // insert/erase Modified: stable/9/contrib/libstdc++/include/bits/stl_set.h ============================================================================== --- stable/9/contrib/libstdc++/include/bits/stl_set.h Sat Jun 23 19:49:18 2012 (r237506) +++ stable/9/contrib/libstdc++/include/bits/stl_set.h Sat Jun 23 20:33:29 2012 (r237507) @@ -138,7 +138,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL // allocation/deallocation /// Default constructor creates no elements. set() - : _M_t(_Compare(), allocator_type()) {} + : _M_t() { } /** * @brief Default constructor creates no elements. @@ -162,7 +162,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template set(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) + : _M_t() { _M_t._M_insert_unique(__first, __last); } /** @@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * The newly-created %set uses a copy of the allocation object used * by @a x. */ - set(const set<_Key,_Compare,_Alloc>& __x) + set(const set& __x) : _M_t(__x._M_t) { } /** @@ -200,8 +200,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * All the elements of @a x are copied, but unlike the copy constructor, * the allocator object is not copied. */ - set<_Key,_Compare,_Alloc>& - operator=(const set<_Key, _Compare, _Alloc>& __x) + set& + operator=(const set& __x) { _M_t = __x._M_t; return *this; @@ -283,7 +283,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * std::swap(s1,s2) will feed to this function. */ void - swap(set<_Key,_Compare,_Alloc>& __x) + swap(set& __x) { _M_t.swap(__x._M_t); } // insert/erase Modified: stable/9/contrib/libstdc++/include/bits/stl_tree.h ============================================================================== --- stable/9/contrib/libstdc++/include/bits/stl_tree.h Sat Jun 23 19:49:18 2012 (r237506) +++ stable/9/contrib/libstdc++/include/bits/stl_tree.h Sat Jun 23 20:33:29 2012 (r237507) @@ -410,10 +410,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _Rb_tree_node_base _M_header; size_type _M_node_count; // Keeps track of size of tree. - _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(), - const _Key_compare& __comp = _Key_compare()) - : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), + _Rb_tree_impl() + : _Node_allocator(), _M_key_compare(), _M_header(), _M_node_count(0) + { _M_initialize(); } + + _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a) + : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), + _M_node_count(0) + { _M_initialize(); } + + private: + void + _M_initialize() { this->_M_header._M_color = _S_red; this->_M_header._M_parent = 0; @@ -431,11 +440,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _Rb_tree_node_base _M_header; size_type _M_node_count; // Keeps track of size of tree. - _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(), - const _Key_compare& __comp = _Key_compare()) + _Rb_tree_impl() + : _Node_allocator(), _M_key_compare(), _M_header(), + _M_node_count(0) + { _M_initialize(); } + + _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a) : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), _M_node_count(0) - { + { _M_initialize(); } + + private: + void + _M_initialize() + { this->_M_header._M_color = _S_red; this->_M_header._M_parent = 0; this->_M_header._M_left = &this->_M_header; @@ -568,16 +586,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _Rb_tree() { } - _Rb_tree(const _Compare& __comp) - : _M_impl(allocator_type(), __comp) - { } - - _Rb_tree(const _Compare& __comp, const allocator_type& __a) - : _M_impl(__a, __comp) + _Rb_tree(const _Compare& __comp, + const allocator_type& __a = allocator_type()) + : _M_impl(__comp, __a) { } - _Rb_tree(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x) - : _M_impl(__x._M_get_Node_allocator(), __x._M_impl._M_key_compare) + _Rb_tree(const _Rb_tree& __x) + : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator()) { if (__x._M_root() != 0) { @@ -591,8 +606,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ~_Rb_tree() { _M_erase(_M_begin()); } - _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& - operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x); + _Rb_tree& + operator=(const _Rb_tree& __x); // Accessors. _Compare @@ -653,7 +668,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return get_allocator().max_size(); } void - swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t); + swap(_Rb_tree& __t); // Insert/erase. pair Modified: stable/9/contrib/libstdc++/include/bits/stl_vector.h ============================================================================== --- stable/9/contrib/libstdc++/include/bits/stl_vector.h Sat Jun 23 19:49:18 2012 (r237506) +++ stable/9/contrib/libstdc++/include/bits/stl_vector.h Sat Jun 23 20:33:29 2012 (r237507) @@ -84,6 +84,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL _Tp* _M_start; _Tp* _M_finish; _Tp* _M_end_of_storage; + + _Vector_impl() + : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0) + { } + _Vector_impl(_Tp_alloc_type const& __a) : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0) { } @@ -104,6 +109,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL get_allocator() const { return allocator_type(_M_get_Tp_allocator()); } + _Vector_base() + : _M_impl() { } + _Vector_base(const allocator_type& __a) : _M_impl(__a) { } @@ -194,8 +202,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL /** * @brief Default constructor creates no elements. */ + vector() + : _Base() { } + explicit - vector(const allocator_type& __a = allocator_type()) + vector(const allocator_type& __a) : _Base(__a) { } From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 20:37:28 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28090106566B; Sat, 23 Jun 2012 20:37:28 +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 0F6608FC0A; Sat, 23 Jun 2012 20:37: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 q5NKbSW7063404; Sat, 23 Jun 2012 20:37:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NKbRP5063393; Sat, 23 Jun 2012 20:37:27 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206232037.q5NKbRP5063393@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 23 Jun 2012 20:37: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: r237508 - stable/8/contrib/libstdc++/include/bits X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 20:37:28 -0000 Author: pfg Date: Sat Jun 23 20:37:27 2012 New Revision: 237508 URL: http://svn.freebsd.org/changeset/base/237508 Log: MFC: r236829 Bring a couple of libstdc++ patches from Apple's llvm-gcc project. Modified Fri Jul 10 07:44:34 2009 CDT by rafael backport part of http://gcc.gnu.org/ml/gcc-cvs/2007-10/msg00118.html The patch is for libstdc++ and it was GPL2 at the time. Modified Tue Apr 29 01:20:19 2008 CDT by asl Backport from mainline (pre-GPLv3). Fix for sizeof(const void*) > sizeof(unsigned long). Modified: stable/8/contrib/libstdc++/include/bits/locale_facets.tcc stable/8/contrib/libstdc++/include/bits/stl_bvector.h stable/8/contrib/libstdc++/include/bits/stl_deque.h stable/8/contrib/libstdc++/include/bits/stl_list.h stable/8/contrib/libstdc++/include/bits/stl_map.h stable/8/contrib/libstdc++/include/bits/stl_multimap.h stable/8/contrib/libstdc++/include/bits/stl_multiset.h stable/8/contrib/libstdc++/include/bits/stl_set.h stable/8/contrib/libstdc++/include/bits/stl_tree.h stable/8/contrib/libstdc++/include/bits/stl_vector.h Directory Properties: stable/8/contrib/libstdc++/ (props changed) Modified: stable/8/contrib/libstdc++/include/bits/locale_facets.tcc ============================================================================== --- stable/8/contrib/libstdc++/include/bits/locale_facets.tcc Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/locale_facets.tcc Sat Jun 23 20:37:27 2012 (r237508) @@ -887,7 +887,11 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE const fmtflags __fmt = __io.flags(); __io.flags(__fmt & ~ios_base::basefield | ios_base::hex); - unsigned long __ul; + typedef __gnu_cxx::__conditional_type<(sizeof(void*) + <= sizeof(unsigned long)), + unsigned long, unsigned long long>::__type _UIntPtrType; + + _UIntPtrType __ul; __beg = _M_extract_int(__beg, __end, __io, __err, __ul); // Reset from hex formatted input. @@ -1309,8 +1313,12 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE | ios_base::internal); __io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase)); + typedef __gnu_cxx::__conditional_type<(sizeof(const void*) + <= sizeof(unsigned long)), + unsigned long, unsigned long long>::__type _UIntPtrType; + __s = _M_insert_int(__s, __io, __fill, - reinterpret_cast(__v)); + reinterpret_cast<_UIntPtrType>(__v)); __io.flags(__flags); return __s; } Modified: stable/8/contrib/libstdc++/include/bits/stl_bvector.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_bvector.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_bvector.h Sat Jun 23 20:37:27 2012 (r237508) @@ -385,6 +385,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL _Bit_iterator _M_start; _Bit_iterator _M_finish; _Bit_type* _M_end_of_storage; + + _Bvector_impl() + : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0) + { } + _Bvector_impl(const _Bit_alloc_type& __a) : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0) { } @@ -405,7 +410,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL get_allocator() const { return allocator_type(_M_get_Bit_allocator()); } - _Bvector_base(const allocator_type& __a) : _M_impl(__a) { } + _Bvector_base() + : _M_impl() { } + + _Bvector_base(const allocator_type& __a) + : _M_impl(__a) { } ~_Bvector_base() { this->_M_deallocate(); } @@ -480,8 +489,11 @@ template using _Base::_M_get_Bit_allocator; public: + vector() + : _Base() { } + explicit - vector(const allocator_type& __a = allocator_type()) + vector(const allocator_type& __a) : _Base(__a) { } explicit @@ -678,7 +690,7 @@ template } void - swap(vector& __x) + swap(vector& __x) { std::swap(this->_M_impl._M_start, __x._M_impl._M_start); std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish); Modified: stable/8/contrib/libstdc++/include/bits/stl_deque.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_deque.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_deque.h Sat Jun 23 20:37:27 2012 (r237508) @@ -380,6 +380,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator; typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator; + _Deque_base() + : _M_impl() + { _M_initialize_map(0); } + _Deque_base(const allocator_type& __a, size_t __num_elements) : _M_impl(__a) { _M_initialize_map(__num_elements); } @@ -406,6 +410,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL iterator _M_start; iterator _M_finish; + _Deque_impl() + : _Tp_alloc_type(), _M_map(0), _M_map_size(0), + _M_start(), _M_finish() + { } + _Deque_impl(const _Tp_alloc_type& __a) : _Tp_alloc_type(__a), _M_map(0), _M_map_size(0), _M_start(), _M_finish() @@ -679,8 +688,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL /** * @brief Default constructor creates no elements. */ + deque() + : _Base() { } + explicit - deque(const allocator_type& __a = allocator_type()) + deque(const allocator_type& __a) : _Base(__a, 0) {} /** Modified: stable/8/contrib/libstdc++/include/bits/stl_list.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_list.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_list.h Sat Jun 23 20:37:27 2012 (r237508) @@ -305,6 +305,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL { _List_node_base _M_node; + _List_impl() + : _Node_alloc_type(), _M_node() + { } + _List_impl(const _Node_alloc_type& __a) : _Node_alloc_type(__a), _M_node() { } @@ -339,6 +343,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL get_allocator() const { return allocator_type(_M_get_Node_allocator()); } + _List_base() + : _M_impl() + { _M_init(); } + _List_base(const allocator_type& __a) : _M_impl(__a) { _M_init(); } @@ -468,8 +476,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL /** * @brief Default constructor creates no elements. */ + list() + : _Base() { } + explicit - list(const allocator_type& __a = allocator_type()) + list(const allocator_type& __a) : _Base(__a) { } /** Modified: stable/8/contrib/libstdc++/include/bits/stl_map.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_map.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_map.h Sat Jun 23 20:37:27 2012 (r237508) @@ -155,7 +155,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * @brief Default constructor creates no elements. */ map() - : _M_t(_Compare(), allocator_type()) { } + : _M_t() { } // for some reason this was made a separate function /** @@ -186,7 +186,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template map(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) + : _M_t() { _M_t._M_insert_unique(__first, __last); } /** Modified: stable/8/contrib/libstdc++/include/bits/stl_multimap.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_multimap.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_multimap.h Sat Jun 23 20:37:27 2012 (r237508) @@ -152,7 +152,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * @brief Default constructor creates no elements. */ multimap() - : _M_t(_Compare(), allocator_type()) { } + : _M_t() { } // for some reason this was made a separate function /** @@ -184,8 +184,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template multimap(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) - { _M_t._M_insert_equal(__first, __last); } + : _M_t() + { _M_t._M_insert_unique(__first, __last); } /** * @brief Builds a %multimap from a range. Modified: stable/8/contrib/libstdc++/include/bits/stl_multiset.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_multiset.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_multiset.h Sat Jun 23 20:37:27 2012 (r237508) @@ -134,7 +134,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * @brief Default constructor creates no elements. */ multiset() - : _M_t(_Compare(), allocator_type()) { } + : _M_t() { } explicit multiset(const _Compare& __comp, @@ -152,7 +152,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template multiset(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) + : _M_t() { _M_t._M_insert_equal(__first, __last); } /** @@ -180,7 +180,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * The newly-created %multiset uses a copy of the allocation object used * by @a x. */ - multiset(const multiset<_Key,_Compare,_Alloc>& __x) + multiset(const multiset& __x) : _M_t(__x._M_t) { } /** @@ -190,8 +190,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * All the elements of @a x are copied, but unlike the copy constructor, * the allocator object is not copied. */ - multiset<_Key,_Compare,_Alloc>& - operator=(const multiset<_Key,_Compare,_Alloc>& __x) + multiset& + operator=(const multiset& __x) { _M_t = __x._M_t; return *this; @@ -275,7 +275,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * std::swap(s1,s2) will feed to this function. */ void - swap(multiset<_Key, _Compare, _Alloc>& __x) + swap(multiset& __x) { _M_t.swap(__x._M_t); } // insert/erase Modified: stable/8/contrib/libstdc++/include/bits/stl_set.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_set.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_set.h Sat Jun 23 20:37:27 2012 (r237508) @@ -138,7 +138,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL // allocation/deallocation /// Default constructor creates no elements. set() - : _M_t(_Compare(), allocator_type()) {} + : _M_t() { } /** * @brief Default constructor creates no elements. @@ -162,7 +162,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template set(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) + : _M_t() { _M_t._M_insert_unique(__first, __last); } /** @@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * The newly-created %set uses a copy of the allocation object used * by @a x. */ - set(const set<_Key,_Compare,_Alloc>& __x) + set(const set& __x) : _M_t(__x._M_t) { } /** @@ -200,8 +200,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * All the elements of @a x are copied, but unlike the copy constructor, * the allocator object is not copied. */ - set<_Key,_Compare,_Alloc>& - operator=(const set<_Key, _Compare, _Alloc>& __x) + set& + operator=(const set& __x) { _M_t = __x._M_t; return *this; @@ -283,7 +283,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * std::swap(s1,s2) will feed to this function. */ void - swap(set<_Key,_Compare,_Alloc>& __x) + swap(set& __x) { _M_t.swap(__x._M_t); } // insert/erase Modified: stable/8/contrib/libstdc++/include/bits/stl_tree.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_tree.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_tree.h Sat Jun 23 20:37:27 2012 (r237508) @@ -410,10 +410,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _Rb_tree_node_base _M_header; size_type _M_node_count; // Keeps track of size of tree. - _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(), - const _Key_compare& __comp = _Key_compare()) - : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), + _Rb_tree_impl() + : _Node_allocator(), _M_key_compare(), _M_header(), _M_node_count(0) + { _M_initialize(); } + + _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a) + : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), + _M_node_count(0) + { _M_initialize(); } + + private: + void + _M_initialize() { this->_M_header._M_color = _S_red; this->_M_header._M_parent = 0; @@ -431,11 +440,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _Rb_tree_node_base _M_header; size_type _M_node_count; // Keeps track of size of tree. - _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(), - const _Key_compare& __comp = _Key_compare()) + _Rb_tree_impl() + : _Node_allocator(), _M_key_compare(), _M_header(), + _M_node_count(0) + { _M_initialize(); } + + _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a) : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), _M_node_count(0) - { + { _M_initialize(); } + + private: + void + _M_initialize() + { this->_M_header._M_color = _S_red; this->_M_header._M_parent = 0; this->_M_header._M_left = &this->_M_header; @@ -568,16 +586,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _Rb_tree() { } - _Rb_tree(const _Compare& __comp) - : _M_impl(allocator_type(), __comp) - { } - - _Rb_tree(const _Compare& __comp, const allocator_type& __a) - : _M_impl(__a, __comp) + _Rb_tree(const _Compare& __comp, + const allocator_type& __a = allocator_type()) + : _M_impl(__comp, __a) { } - _Rb_tree(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x) - : _M_impl(__x._M_get_Node_allocator(), __x._M_impl._M_key_compare) + _Rb_tree(const _Rb_tree& __x) + : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator()) { if (__x._M_root() != 0) { @@ -591,8 +606,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ~_Rb_tree() { _M_erase(_M_begin()); } - _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& - operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x); + _Rb_tree& + operator=(const _Rb_tree& __x); // Accessors. _Compare @@ -653,7 +668,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return get_allocator().max_size(); } void - swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t); + swap(_Rb_tree& __t); // Insert/erase. pair Modified: stable/8/contrib/libstdc++/include/bits/stl_vector.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_vector.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_vector.h Sat Jun 23 20:37:27 2012 (r237508) @@ -84,6 +84,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL _Tp* _M_start; _Tp* _M_finish; _Tp* _M_end_of_storage; + + _Vector_impl() + : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0) + { } + _Vector_impl(_Tp_alloc_type const& __a) : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0) { } @@ -104,6 +109,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL get_allocator() const { return allocator_type(_M_get_Tp_allocator()); } + _Vector_base() + : _M_impl() { } + _Vector_base(const allocator_type& __a) : _M_impl(__a) { } @@ -194,8 +202,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL /** * @brief Default constructor creates no elements. */ + vector() + : _Base() { } + explicit - vector(const allocator_type& __a = allocator_type()) + vector(const allocator_type& __a) : _Base(__a) { } From owner-svn-src-stable@FreeBSD.ORG Sat Jun 23 21:29:54 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 129761065673; Sat, 23 Jun 2012 21:29:54 +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 F08228FC0C; Sat, 23 Jun 2012 21:29: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 q5NLTrua065797; Sat, 23 Jun 2012 21:29:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NLTrQp065794; Sat, 23 Jun 2012 21:29:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206232129.q5NLTrQp065794@svn.freebsd.org> From: Eitan Adler Date: Sat, 23 Jun 2012 21:29:53 +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: r237511 - stable/9/share/syscons/keymaps X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 21:29:54 -0000 Author: eadler Date: Sat Jun 23 21:29:53 2012 New Revision: 237511 URL: http://svn.freebsd.org/changeset/base/237511 Log: MFC r235251: Add Spanish Dvorak keyboard model to syscons. PR: conf/160235 Approved by: cperciva (implicit) Added: stable/9/share/syscons/keymaps/spanish.dvorak.kbd - copied unchanged from r235251, head/share/syscons/keymaps/spanish.dvorak.kbd Modified: stable/9/share/syscons/keymaps/Makefile Directory Properties: stable/9/share/syscons/ (props changed) Modified: stable/9/share/syscons/keymaps/Makefile ============================================================================== --- stable/9/share/syscons/keymaps/Makefile Sat Jun 23 21:03:50 2012 (r237510) +++ stable/9/share/syscons/keymaps/Makefile Sat Jun 23 21:29:53 2012 (r237511) @@ -36,6 +36,7 @@ FILES= INDEX.keymaps \ ru.cp866.kbd ru.iso5.kbd \ si.iso.kbd \ sk.iso2.kbd \ + spanish.dvorak.kbd \ spanish.iso.kbd spanish.iso.acc.kbd spanish.iso15.acc.kbd \ swedish.iso.kbd swedish.cp850.kbd \ swissfrench.iso.kbd swissfrench.iso.acc.kbd swissfrench.cp850.kbd \ Copied: stable/9/share/syscons/keymaps/spanish.dvorak.kbd (from r235251, head/share/syscons/keymaps/spanish.dvorak.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/syscons/keymaps/spanish.dvorak.kbd Sat Jun 23 21:29:53 2012 (r237511, copy of r235251, head/share/syscons/keymaps/spanish.dvorak.kbd) @@ -0,0 +1,139 @@ +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '|' '!' nop nop O + 003 '2' '"' nop nop '@' '"' nop nop O + 004 '3' 183 nop nop '#' '#' nop nop O + 005 '4' '$' nop nop '~' '~' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '&' nop nop 172 172 nop nop O + 008 '7' '/' nop nop '7' '/' nop nop O + 009 '8' '(' nop nop '8' '(' nop nop O + 010 '9' ')' nop nop '9' ')' nop nop O + 011 '0' '=' nop nop '0' '=' nop nop O + 012 ''' '?' nop nop ''' '?' nop nop O + 013 161 191 nop nop 161 191 nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 '.' ':' nop nop '.' ':' nop nop O + 017 ',' ';' nop nop ',' ';' nop nop O + 018 241 209 nop nop '~' '~' nop nop O + 019 'p' 'P' dle dle 'p' 'P' dle dle C + 020 'y' 'Y' em em 'y' 'Y' em em C + 021 'f' 'F' ack ack 'f' 'F' ack ack C + 022 'g' 'G' bel bel 'g' 'G' bel bel C + 023 'c' 'C' etx etx 'c' 'C' etx etx C + 024 'h' 'H' bs bs 'h' 'H' bs bs C + 025 'l' 'L' ff ff 'l' 'L' ff ff C + 026 dgra dcir esc esc '[' '[' esc esc O + 027 '+' '*' gs gs ']' ']' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 'o' 'O' si si 243 211 si si C + 032 'e' 'E' enq enq 164 164 enq enq C + 033 'u' 'U' nak nak 250 218 nak nak C + 034 'i' 'I' ht ht 237 205 ht ht C + 035 'd' 'D' eot eot 'd' 'D' eot eot C + 036 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 037 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 038 'n' 'N' so so 'n' 'N' so so C + 039 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 040 dacu duml nop nop '{' '{' nop nop O + 041 '\' '|' fs fs '\' '|' fs fs O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 231 199 rs rs '}' '}' rs rs O + 044 '-' '_' us us '-' '_' us us O + 045 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 046 'j' 'J' nl nl 'j' 'J' nl nl C + 047 'k' 'K' vt vt 'k' 'K' vt vt C + 048 'x' 'X' can can 'x' 'X' can can C + 049 'b' 'B' stx stx 'b' 'B' stx stx C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 'w' 'W' etb etb 'w' 'W' etb etb C + 052 'v' 'V' syn syn 'v' 'V' syn syn C + 053 'z' 'Z' sub sub 'z' 'Z' sub sub C + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' nop nop '<' '>' nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + + dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 ) + ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 ) + ( 'u' 249 ) ( 'U' 217 ) + dacu 180 ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 ) + ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 ) + ( 'u' 250 ) ( 'U' 218 ) ( 'y' 253 ) ( 'Y' 221 ) + dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 ) + ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 ) + ( 'u' 251 ) ( 'U' 219 ) + dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'n' 241 ) ( 'N' 209 ) + ( 'o' 245 ) ( 'O' 213 ) + dmac 000 + dbre 000 + ddot 000 + duml 168 ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 ) + ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 ) + ( 'u' 252 ) ( 'U' 220 ) ( 'y' 255 ) + dsla 000 + drin 176 ( 'a' 229 ) ( 'A' 197 ) + dced 184 ( 'c' 231 ) ( 'C' 199 ) + dapo 000 + ddac 000 + dogo 000 + dcar 000